Skip to content

Instantly share code, notes, and snippets.

View brapse's full-sized avatar

Sean Braithwaite brapse

View GitHub Profile
@brapse
brapse / flatten.clj
Created May 16, 2014 14:42
Flatten a clojure map
(defn map-flatten
([m] (map-flatten m [] []))
([todo keys collection]
(if (empty? todo)
collection
(let [[k v] (first todo)]
(if (map? v)
(concat (map-flatten v
(conj keys k)
collection)
java.lang.NullPointerException
at com.soundcloud.insights.sifted.EventLogs.encode(EventLogs.java:78)
at com.soundcloud.insights.sifted.Sift$Map.map(Sift.java:40)
at com.soundcloud.insights.sifted.Sift$Map.map(Sift.java:23)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:140)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:672)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
Scistoric!
To add the detect bookmarklet, drag this to your bookmark bar:
<a href="
javascript:(function () {
var newScript = document.createElement('script');
newScript.src = 'http://localhost:4000/scistoric.user.js';
document.body.appendChild(newScript);
}());
To add the detect bookmarklet, drag this to your bookmark bar:
<a href="
javascript:(function () {
window.location='http://api.soundcloud.com/resolve.json?url=' + document.location.href + '&client_id=b45b1aa10f1ac2941910a7f0d10f8e28';
}());
">SoundInfo</a> &lt;----
<br><br>
Then click on it, when you are on a page you want to diagnose.
javascript:window.location='http://api.soundcloud.com/resolve.json?url=' + document.location.href + '&client_id=b45b1aa10f1ac2941910a7f0d10f8e28';
@brapse
brapse / README.md
Created January 6, 2013 19:11
gist

SomeGraph

Look at all the details and how they work

  • It has an x axis
  • It has a y axis
@brapse
brapse / README.md
Last active December 10, 2015 11:58
gist

SomeGraph

Look at all the details and how they work

IT WORKS REALLY WEELL

  • It has an x axis
  • It has a y axis
@brapse
brapse / README.md
Last active December 10, 2015 11:39 — forked from anonymous/README.md

SomeGraph

Look at all the details and how they work

  • It has an x axis
  • It has a y axis
I'm going to pause after every step of this process, and explain what I've done. I hope that is sufficiently annoying for you.
enter to continue
So, first we'll get a list of every player in the NBA and their respective positions off of a list on yahoo sports:
http://sports.yahoo.com/nba/players?type=position&c=NBA&pos=
This will be the data we will work from.
enter to continue
Traceback (most recent call last):
File "run_me.py", line 9, in <module>
scrapenames.scrape('namelist.txt')
(defn parallel-test []
(let [tapA (delivery/tap "2012-04-30-00" "2012-04-30-00")
tapB (delivery/tap "2012-04-30-01" "2012-04-30-01")]
(with-job-conf {"mapred.reduce.tasks" 20
"mapred.map.tasks" 20}
;(with-debug
(?- (stdout)
;(println tapB)
(union
(clicks (delivery/events tapA "CLICK"))