Skip to content

Instantly share code, notes, and snippets.

@c0ming
c0ming / build.sh
Last active January 30, 2019 01:12
A script for build iOS7 universal static library with clang
#!/bin/bash
# e.g. libmms http://sourceforge.net/projects/libmms/
# set -x
BUILD_DIR=`pwd`"/build"
STATIC_LIB_NAME="libmms.a"
STATIC_LIB_NAME_ARM="libmms.a.arm"
STATIC_LIB_NAME_X86="libmms.a.x86"

Resilient Distributed Datasets(RDD)

この章ではRDDの概要について説明します。 最初はRDD($2-1)Sparkで利用するプログラムインタフェース($2-2)について説明します。それからメモリの詳細について説明し($2-3)、最後にSparkのモデルの限界($2-4)について議論します。

2-1. RDD概要

RDDは読み込み専用のレコードを分割した集まりです。RDDはオペレーションを通して安定したストレージか他のRDDが作成されます。私たちはこのオペレーションについて他のRDDオペレーションと差別化するためにtransformationsとよびます。例えばmap,filter,joinなどがそれにあたります。

RDDは常に実データを持つ必要はありません。その代わりRDDはストレージのデータからたどれるための情報を持つようにします。これはパワフルな特徴で失敗したあと、再構成できないRDDはプログラムから参照できません。

@JodiTheTigger
JodiTheTigger / gdbBacktraceToJson.py
Created January 14, 2014 01:52
gdbBacktraceToJson.py parses the output of the command "thread apply all bt full" and turns it into a json array. Useful for automating the analysis of coredump files generated when an application crashes. Use the tokenised json to search a database of crashes for similar crashes or make a nice web interface for viewing back traces. You could ma…
#!/usr/bin/python2
#
# gdbBacktraceToJson.py. Parses gdb backtraces into json.
# Copyright (C) 2014 Richard Maxwell <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@squito
squito / badValDefMacro.scala
Last active August 12, 2020 20:57
some basic macros with quasiquotes. Accompanies this blog post <http://imranrashid.com/posts/learning-scala-macros/>. Partially a translation of this example <http://www.warski.org/blog/2012/12/starting-with-scala-macros-a-short-tutorial/> to quasiquotes.
def getValMacro(c: Context)(s: c.Expr[Any]) : c.Expr[Any] = {
import c.universe._
val q"val $name = $value" = s.tree
c.Expr(value)
}
def getVal(s: Any) = macro getValMacro
getVal{val x = 17}
error: exception during macro expansion:
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@j5ik2o
j5ik2o / gist:5660744
Last active November 18, 2021 11:04
Scala 2.10 & SBT & JRebel & IntelliJ IDEAの環境構築方法

できること

  • JRebelを利用すると、アプリケーションの再起動なしで実行中のアプリケーションに加えた変更を即座に反映することができます(ホットリローディング)。まるでPHPのようにサクサク書けるッ!
  • Scala開発者にはライセンスが$0で提供されます。Javaで利用する場合は購入してね☆彡

前提

以下がインストールされているものとする。

@watilde
watilde / gist:5617571
Created May 21, 2013 05:03
gruntfile.js
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
watch: {
files: ['src/js/*.js', 'spec/*.js'],
tasks: 'spec'
},
jshint: {
files: ['src/js/*.js'],
options: {
@drexin
drexin / Macros.scala
Last active October 27, 2016 09:41
macros to get current file and line, inspired by ruby's __FILE__ and __LINE__
import java.io.File
import language.experimental.macros
import scala.reflect.macros.Context
object Macros {
def LINE: Int = macro lineImpl
def lineImpl(c: Context): c.Expr[Int] = {
import c.universe._
@emil2k
emil2k / Connectivity.java
Last active August 5, 2024 10:48
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@akjir
akjir / AccessGranted.scala
Last active January 18, 2025 17:36
Access private fields and methods using Java Reflection in Scala.
object Main extends App {
val printer = new Printer[String]()
val break = true
val text = "access granted"
//cannot be accessed:
//printer.printCodeName
//printer.codeName = "Rejewski"
//printer.printCodeName