This file contains 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
;; | |
;; Example of thread last macro ->> and partial function application | |
;; | |
(defn header [this] {:head this}) | |
(->> (header 1) :head ((partial + 1))) | |
;; => 2 | |
(->> (header 3) :head ((partial - 1))) | |
;; => -2 |
This file contains 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
library(ggplot2) | |
library(plyr) | |
## Graphing | |
# Histogram of columnName in someDataFrame, ordered in descending frequency | |
# from left to right. | |
ggplot(someDataFrame, aes(x=reorder(columnName,columnName,function(x)-length(x)))) + | |
geom_bar() + | |
xlab("X Label") + |
This file contains 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
-ea -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Dhive.metastore.uri=thrift://localhost:9083 |
This file contains 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
<!-- BEGINS: AUTO-GENERATED FFMP3 CODE --> | |
<object width="180" height="60" bgcolor="#FFFFFF"> | |
<param name="movie" value="ffmp3-config.swf" /> | |
<param name="flashvars" value="url=http://remote.krui.fm:8000/listen&lang=en&codec=mp3&volume=100&tracking=true&skin=ffmp3-mcclean.xml&title=KRUI" /> | |
<param name="wmode" value="window" /> | |
<param name="scale" value="noscale" /> | |
<embed src="ffmp3-config.swf" flashvars="url=http://remote.krui.fm:8000/listen&lang=en&codec=mp3&volume=100&tracking=true&skin=ffmp3-mcclean.xml&title=KRUI" width="180" scale="noscale" height="60" wmode="window" bgcolor="#FFFFFF" type="application/x-shockwave-flash" /> | |
</object> | |
<!-- ENDS: AUTO-GENERATED FFMP3 CODE --> |
This file contains 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 padInt(number){ | |
if (parseInt(number) < 10){ | |
return "0" + parseInt(number).toString(); | |
} else { | |
return number.toString(); | |
} | |
} |
This file contains 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
/* | |
JavaScript Stream data client and graph renderer | |
*/ | |
jQuery(document).ready(function() { | |
function Graph(type) { | |
/* | |
Graph class | |
Override properties to modify graph appearance before invoking the render() method | |
*/ | |
this.category = type; |
This file contains 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
test = Test( | |
string='test-554e4b55e8cc57f39f16f335b0a63825', | |
integer=123, | |
float=3.14159265, | |
array=['thing 1', 'thing 2', 'thing 3'], | |
tuple=('string', 123, 3.14159265), | |
dictionary={'this 1': 'that 1', 'this 2': 'that 2'}, | |
tuples_in_array=[('string', 123, 3.14159265), ('string', 456, 3.14159265)], | |
arrays_in_tupple=(['thing 1', 'thing 2', 'thing 3'], ['thing 4', 'thing 5', 'thing 6']), | |
complex_nested_mixed_data_types=( |
This file contains 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
class Stub(object): | |
def __init__(self, **kwargs): | |
for key in kwargs: | |
setattr(self, key, kwargs[key]) |
This file contains 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
1300383220 : <Event dir=False mask=0x100 maskname=IN_CREATE name=latest.tar.gz path=/home/fgaloso/test pathname=/home/fgaloso/test/latest.tar.gz wd=1 > | |
1300383225 : <Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=latest.tar.gz path=/home/fgaloso/test pathname=/home/fgaloso/test/latest.tar.gz wd=1 > | |
1300383241 : <Event dir=True mask=0x40000100 maskname=IN_CREATE|IN_ISDIR name=wordpress path=/home/fgaloso/test pathname=/home/fgaloso/test/wordpress wd=1 > | |
1300383241 : <Event dir=False mask=0x100 maskname=IN_CREATE name=wp-rss.php path=/home/fgaloso/test/wordpress pathname=/home/fgaloso/test/wordpress/wp-rss.php wd=2 > | |
1300383241 : <Event dir=False mask=0x8 maskname=IN_CLOSE_WRITE name=wp-rss.php path=/home/fgaloso/test/wordpress pathname=/home/fgaloso/test/wordpress/wp-rss.php wd=2 > | |
1300383241 : <Event dir=False mask=0x100 maskname=IN_CREATE name=wp-blog-header.php path=/home/fgaloso/test/wordpress pathname=/home/fgaloso/test/wordpress/wp-blog-header.php wd=2 > | |
1300383241 : <Event dir=False mask=0x8 mask |
This file contains 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
'key1' => 'somevalue' | |
'key1' => 'somevalue' | |
'key2' => 'anotherval' | |
'key2' => 'andanother' | |
'key2' => 'andanother' | |
/* | |
Way to return unique distinct values by a given key? | |
For example: | |
?key="key1" would return ['somevalue'] |
OlderNewer