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
DEV_PROVISIONING_UUID = "3E4D9E49-E44B-4B73-AFAD-248C720ECD53" | |
DEV_SIGN = "Ruben Fonseca" | |
DEV_APP_NAME = "My greatest app" | |
DEV_APP_ID = 'com.0x82.app' | |
TITANIUM_SDK_VERSION = '1.8.2' | |
IPHONE_SDK_VERSION = '5.0' | |
BUILDER_PATH = "/Library/Application Support/Titanium/mobilesdk/osx/#{TITANIUM_SDK_VERSION}/iphone/builder.py" | |
if File.exists?(BUILDER_PATH) |
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
type DataStore = [(Int, Int)] | |
iter :: Int -> DataStore -> Int -> (DataStore, Int) | |
iter rem ks d = ( (d, rem `div` d):ks, rem `mod` d) | |
wrapper :: Int -> DataStore -> Int -> (DataStore, Int) | |
wrapper re ds 1 = (ds, re) | |
wrapper re ds d = wrapper re' ds' (d `div` 2) | |
where (ds', re') = iter re ds d |
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 random, math | |
MAX = 100 | |
MIN = 10 | |
class Randomizer: | |
def __init__(self): | |
self.choice = random.choice | |
self.list = lambda f,m: [ f() for i in self.range(0,m) ] | |
self.hash = lambda a,b: dict( zip( a(), b() ) ) |
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
#!/usr/bin/env python | |
from django.core.management import execute_manager | |
try: | |
import settings # Assumed to be in the same directory. | |
except ImportError: | |
import sys | |
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) | |
sys.exit(1) | |
if __name__ == "__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
public class JNotifyExample | |
public static void main(String[] args) throws InterruptedException, IOException | |
{ | |
String dir = new File(args.length == 0 ? "." : args[0]).getCanonicalFile().getAbsolutePath(); | |
JNotify.addWatch(dir, FILE_ANY, true, new JNotifyListener() | |
{ | |
public void fileRenamed(int wd, String rootPath, String oldName, | |
String newName) | |
{ | |
System.out.println("renamed " + rootPath + " : " + oldName + " -> " + newName); |
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
#include <stdlib.h> | |
#include <stdio.h> | |
char *buffer; | |
void read(char* fname) { | |
FILE *fp = fopen(fname, "r"); | |
if (fp != NULL) { | |
fseek(fp, 0L, SEEK_END); | |
long s = ftell(fp); |
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
require 'rubygems' | |
require 'xmpp4r/client' | |
require 'open-uri' | |
require 'sanitize' | |
include Jabber | |
class ClientB < Client | |
def main_loop | |
keepalive_loop |
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
package pt.uc.dei | |
import scala.collection.immutable.List | |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
case class MessageNotSent(val msg:String) extends Exception { | |
override def getMessage = msg | |
} |
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 im = thinning(img) | |
% THINNING Short description | |
% [IM] = THINNING(IMG) | |
im = img; | |
repeat = 1; | |
is_even = 0; | |
while repeat | |
repeat = 0; |
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
IntList output = (IntList) input.map(new Lambda<Integer,Integer>() { | |
@Override | |
public Integer call(Integer input) { | |
return 2 * input; | |
} | |
@Override | |
public String getSource() { | |
return "return 2 * input;"; |