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
/* | |
* Silly Word Count example -- Mappers each get 1k input, 15 reducers, combiners currently broken | |
*/ | |
/* | |
* Mapper | |
*/ | |
function(key, value) { | |
var tokens = value.split(' '); | |
for(var i=0; i<tokens.length; i++) { |
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
sieve([]) -> | |
[]; | |
sieve([H|T]) -> | |
[H|filter(fun(I) -> I rem H /= 0 end, T)]; | |
sieve(Max) -> | |
sieve(seq(2, Max)). |
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
sieve([]) -> | |
[]; | |
sieve([H|T]) -> | |
[H|sieve(filter(fun(I) -> I rem H /= 0 end, T))]; | |
sieve(Max) -> | |
sieve(seq(2, Max)). | |
main(_) -> |
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" | |
version="2.4"> | |
<servlet> | |
<servlet-name>AkkaServlet</servlet-name> | |
<servlet-class>se.scalablesolutions.akka.comet.AkkaServlet</servlet-class> | |
</servlet> |
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
import sbt._ | |
import jython.sbt.JythonProject | |
class PassingProject(info: ProjectInfo) extends DefaultProject(info) | |
with JythonProject { | |
override def jythonHome = Path.fromFile("/opt/jython") | |
easy_install("paycheck == 0.4.2") | |
easy_install("messaging") from "https://dev1.invitemedia.com/dist" | |
} |
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
import org.python.core.PyDictionary | |
object cjson { | |
def encode(dict: PyDictionary): String = | |
dict.toString | |
def decode(s: String): PyDictionary = | |
new PyDictionary() | |
} |
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
#!/bin/bash | |
WATCH_DIR=`pwd -P` | |
PATTERN="*.py" | |
TMPFILE=`mktemp /tmp/nosewatch-XXXXXXXX` | |
INOTIFY="inotifywait -e modify --fromfile $TMPFILE" | |
trap "rm -f $TMPFILE; exit" INT TERM EXIT | |
find $WATCH_DIR -name "$PATTERN" > $TMPFILE |
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
def secret_formula(started): | |
jelly_beans = started * 500 | |
my_jars = jelly_beans / 1000 | |
my_crates = my_jars / 100 | |
return jelly_beans, my_jars, my_crates | |
start_point = 10000 | |
beans, jars, crates = secret_formula(start_point) | |
print "With a starting point of: %d" % start_point |
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
mapreduce: | |
- name: Resave Users | |
mapper: | |
input_reader: google.appengine.ext.mapreduce.input_readers.DatastoreInputReader | |
handler: turan.jobs.resave | |
params: | |
- name: entity_kind | |
default: turan.model.User |
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 RoutingModule extends ServletModule { | |
override def configureServlets() = { | |
filter("*").through(classOf[vistar.adserver.servlet.LoggingFilter]) | |
serve("/api/v1/get_ad/json").with(classOf[JsonAdRequestHandler]) | |
serve("/api/v1/get_ad/park/*").with(classOf[ParkMediaAdRequestHandler]) | |
} | |
} |
OlderNewer