This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ PYTHONPATH="$PYTHONPATH:DOESNT_GET_TO_WORKER" pyspark | |
| [..snip..] | |
| In [1]: import os | |
| In [2]: os.environ['PYTHONPATH'] | |
| Out[2]: '/mnt/spark/python/lib/py4j-0.8.2.1-src.zip:/mnt/spark/python/:DOESNT_GET_TO_WORKER' | |
| In [3]: sc.parallelize([1]).map(lambda x: os.environ['PYTHONPATH']).first() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| lines.repartition(1).foreachRDD((rdd: RDD[_], time: Time) => { | |
| val file = backupPath + "-" + time.milliseconds | |
| if ("".equals(compressionCodec)) { | |
| rdd.saveAsTextFile(file) | |
| } else { | |
| val codec = Class.forName(compressionCodec).asInstanceOf[Class[_ <: org.apache.hadoop.io.compress.CompressionCodec]] | |
| rdd.saveAsTextFile(file, codec) | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Change hadoop version to your liking, don't include kinesis-acl profile unless you are using aws kinesis | |
| $ git clone git@github.com:apache/spark | |
| $ cd spark | |
| $ mvn -DskipTests=true -Dhadooop.version=2.6.0 -Phadoop-2.6,kinesis-asl clean package install | |
| # In my build.sbt: | |
| [..snip..] | |
| val sparkVersion = "1.4.0" | |
| val hadoopVersion = "2.6.0" | |
| libraryDependencies += "org.apache.spark" %% "spark-core" % sparkVersion % "provided" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String play = "var i=document.getElementsByClassName('embedly-embed')[0];var p=new playerjs.Player(i);p.on('ready', function(){p.play()});"; | |
| embedWebView.getSettings().setMediaPlaybackRequiresUserGesture(false); | |
| embedWebView.evaluateJavascript(play, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.HashMap; | |
| import org.json.JSONArray; | |
| import com.embedly.api.Api; | |
| ... | |
| Api api = new Api('Mozilla/5.0 (compatible; mytestapp/1.0; my@email.com)'); | |
| HashMap<String, Object> params = new HashMap<String, Object>(); | |
| params.put('url', 'http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos'); | |
| JSONArray oembed = api.oembed(params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('q-io/http'), | |
| BufferStream = require('q-io/buffer-stream'), | |
| Url = require('url'), | |
| _ = require('underscore'), | |
| version = require('../../package.json').version, | |
| debug = require('debug')('blaze-in:middleware:minecraft'), | |
| inspect = require('sys').inspect, | |
| sprintf = require('util').format, | |
| uuid = require('node-uuid'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- This configuration file specifies the required security policies | |
| for Bluetooth core daemon to work. --> | |
| <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | |
| "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> | |
| <busconfig> | |
| <!-- ../system.conf have denied everything, so we just punch some holes --> | |
| <policy user="root"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Configuration file for the audio service | |
| # This section contains options which are not specific to any | |
| # particular interface | |
| [General] | |
| # Allow PulseAudio to connect by default | |
| # https://bugzilla.redhat.com/show_bug.cgi?id=964031 | |
| Enable=Sink,Control,Gateway,Source,Headset | |
| Disable=Socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Player(opts) { | |
| if (!(this instanceof Player)) { | |
| return new Player(opts); | |
| } | |
| // do stuff | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count = 4; | |
| var dist = 0.3; | |
| var radius = 0.4; | |
| var start = -(count*dist/2); | |
| var last = CSG.sphere({ center: [start, start, 0], radius: radius }); | |
| for (var i = 1; i <= count; i++) { | |
| last = CSG.sphere({ center: [start + i*dist, start, 0], radius: radius }).union(last); | |
| }for (var i = 1; i <= count; i++) { | |
| last = CSG.sphere({ center: [start, start + i*dist, 0], radius: radius }).union(last); | |
| } |