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
# Reason a project was crashing the machine. | |
Thread(target=fun1).start() | |
def fun1(): | |
do_a_network_call_that_takes_10s_or_raises_some_weird_exception() | |
some_gui_and_os_related_code() | |
fun1() | |
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 aeminiumruntime.examples.fjtests; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.concurrent.Callable; | |
import aeminiumruntime.Runtime; | |
import aeminiumruntime.Task; | |
import aeminiumruntime.Body; | |
import aeminiumruntime.simpleparallel.ParallelRuntime; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
namespace WatchDog | |
{ | |
class Program | |
{ |
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 jsr166y.*; | |
@SuppressWarnings("serial") | |
class Fib extends RecursiveAction { | |
public volatile int number; | |
private int THREASHOLD = 12; //(12 works) | |
private static int TARGET = 12; | |
Fib(int n) { number = n; } |
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
@echo off | |
set A=0 | |
:BEGIN | |
set /a A=1+%A% | |
echo Changing number of cores to %A% |
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 os | |
import datetime | |
import foursquare | |
from orm.models import * | |
from utils import geo | |
username = os.environ.get('FS_USER','') | |
passw = os.environ.get('FS_PASS','') |
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 re | |
import urllib | |
import urllib2 | |
import os | |
import sys | |
import time | |
USERNAME = os.environ.get("WOCU","") | |
PASSWORD = os.environ.get("WOCP","") |
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 | |
import imaplib | |
import datetime | |
from tumblr import Api | |
import sys | |
BLOG='perolasdoaniceto.tumblr.com' | |
USER='myusername' |
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
x = long_function() | |
y = another_long_function() | |
z = x + y |
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
:: Processing exports a stub for windows that starts a new javaw process and closes itself | |
:: Below is a python launcher that parses args.txt, runs the app, waits for it to finish and prints the stdout. | |
python -c "import os;from subprocess import *;f = open('lib/args.txt');flags = f.readline().strip().split();mainclass = f.readline().strip();classpath = f.readline().strip().replace(',',';');args = ['java','-classpath', classpath] + flags + [mainclass];path = os.path.join(os.getcwd(),'lib');print Popen(args,stdout=PIPE, cwd=path).communicate()[0] |