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
| As always, I'm just playing with interesting things to relax a little bit. Just it. | |
| == 1. Dependencies | |
| I tried to use redis-clojure but it sucks and I shifted to Jedis which rocks. So if you want to try | |
| as well, this little joke (ops! I mean...) program depends on: | |
| * org.clojure/clojure "1.2.0" | |
| * org.clojure/clojure-contrib "1.2.0" | |
| * redis.clients/jedis "1.5.2" |
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
| #!/usr/bin/python | |
| import glob | |
| import math | |
| import os | |
| import getopt | |
| import sys | |
| from PIL import Image |
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
| package main | |
| import( | |
| "fmt" | |
| "reflect" | |
| ) | |
| func main(){ | |
| // iterate through the attributes of a Data Model instance | |
| for name, mtype := range attributes(&Dish{}) { |
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 logging | |
| log = logging.getLogger('socrates') | |
| from Queue import Empty, Full, Queue | |
| from riak.transports import RiakPbcTransport | |
| from riak.transports.transport import RiakTransport | |
| class PbcPoolTransport(RiakTransport): |
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
| #!/bin/bash | |
| for i in `hadoop fs -lsr /flume/incoming/2011/04 | awk '{print $8}'`; do | |
| echo $i; hadoop fs -cat $i | gzip -t | |
| if [ $? -ne 0 ] && [ -n "`echo \"$i\" | grep 'gz$'`" ]; then | |
| `echo hadoop fs -rmr -skipTrash $i` | |
| fi | |
| done |
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
| /* Prelude.cs : What happens when a haskell programmer learns C#. | |
| Copyright (c) 2011 Clark Gaebel | |
| 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: |
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
| #!/utilisateur/bin/frython | |
| @privé | |
| le debut class (ma variable) | |
| le debut init(moi) | |
| imprime 'Bonjour Monde' | |
| le fin | |
| le fin |
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
| def format_time(secs): | |
| return "%d:%02d" % (secs / 60, secs % 60) | |
| def invert(arr): | |
| """ | |
| Make a dictionary that with the array elements as keys and | |
| their positions positions as values. | |
| >>> invert([3, 1, 3, 6]) |
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
| """ A script to attempt the compression of written english | |
| to the chinese character set """ | |
| import os | |
| from collections import OrderedDict | |
| from math import log | |
| import itertools | |
| from collections import Counter | |
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
| /* gcc -Wall -Wextra `allegro-config --libs` -lm w.c */ | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <math.h> | |
| #include <time.h> | |
| #include <allegro.h> | |
| #define POINTS 3 | |
| #define WIDTH 600 |