Skip to content

Instantly share code, notes, and snippets.

View adragomir's full-sized avatar

Andrei Dragomir adragomir

View GitHub Profile
Creating bin/ in case it does not exist.
mkdir -p bin/
Compiling from C source
cd build/ && ROCK_DIST=.. make
Finished compiling for arch osx
gcc -I c-source -I ../libs/headers/ -g -std=gnu99 -Wall -D__OOC_USE_GC__ -w -DROCK_BUILD_DATE="\"bootstrapped\"" -DROCK_BUILD_TIME="\"\"" c-source/source/rock/rock.o c-source/sdk/lang/Numbers.o c-source/sdk/lang/types.o c-source/sdk/lang/Iterators.o c-source/sdk/lang/String.o c-source/sdk/lang/Exception.o c-source/sdk/lang/IO.o c-source/sdk/lang/System.o c-source/sdk/lang/Memory.o c-source/sdk/text/Buffer.o c-source/sdk/io/Writer.o c-source/sdk/io/Reader.o c-source/sdk/structs/ArrayList.o c-source/sdk/structs/List.o c-source/sdk/math/Random.o c-source/sdk/os/Time.o c-source/sdk/structs/HashMap.o c-source/source/rock/frontend/CommandLine.o c-source/sdk/io/File.o c-source/sdk/io/FileReader.o c-source/sdk/io/FileWriter.o c-source/sdk/io/native/FileWin32.o c-source/sdk/native/win32/types.o c-source/sdk/io/native/FileUnix.o c-source/sdk/os/Terminal.o c-source/sdk/os/unistd.o
public boolean solve(String equation) {
StringTokenizer t = new StringTokenizer(equation, " ()", true);
List<String> parsed = new ArrayList<String>();
while (t.hasMoreTokens()) {
parsed.add(t.nextToken().trim());
}
return solveSubExpression(parsed, new int[]{0, 0});
}
public boolean solveSubExpression(List<String> parsed, int[] limits) {
Int: cover {
seconds2minutes: func -> This { return this / 60 }
}
main: func -> Int {
"hello world" println()
}
Last login: Thu Sep 2 21:58:42 on ttys008
[<adragomi@adragomi-mac>][21:58:43][~][]
$ history -d $(($HISTCMD-1)) && clear && exec '/Users/adragomi/dotfiles/dotless/bin/csshX' '--slave' '--sock' '/var/tmp/tmp.0.BFvId7' '--slavehost' 'l7' '--ssh_args' '' '--debug' '0' '--slaveid' '7' '--login' 'root'
@adragomir
adragomir / js2py.py
Created October 25, 2010 07:40 — forked from anonymous/js2py.py
import os, sys
PREAMBLE = '''# Preamble
import sys
def Array(n):
return [0]*n
# Body
export WORKING_DIR=~/work/textaurant
cd $WORKING_DIR; mvim; gitx
tmux start-server
tmux new-session -d -s Textaurant -n work
tmux new-window -tTextaurant:1 -n server
tmux new-window -tTextaurant:2 -n test
tmux send-keys -tTextaurant:0 'cd $WORKING_DIR' C-m
@adragomir
adragomir / refactor.py
Created December 18, 2010 07:14 — forked from jdp/refactor.py
#!/usr/bin/env python
import sys
import types
import operator
class Runtime:
def __init__(self, env={}, stack=[]):
self.env = {
# Primitive words, not an impressive base but it works
The Five Essential Phone-Screen Questions
Stevey's Drunken Blog Rants™
I've been on a lot of SDE interview loops lately where the candidate failed miserably: not-inclined votes all around, even from the phone screeners who brought the person in initially.
It's usually pretty obvious when the candidate should have been eliminated during the phone screens. Well, it's obvious in retrospect, anyway: during the interviews, we find some horrible flaw in the candidate which, had anyone thought to ask about it during the phone screen, would surely have disqualified the person.
##########################################################################
#### Felipe Andres Manzano * [email protected] ####
##########################################################################
'''
A mini PDF library for constructing very basic PDF files.
'''
import struct
#For constructing a minimal pdf file
git fetch origin
git rebase -p origin/master