Wednesday, August 31, 2011

StackOverflow.java

% cat StackOverflow.java
class StackOverflow
{
public static void main(String[] args)
{
StackOverflow.main(args);
}
}

% javac StackOverflow.java && java StackOverflow 2>&1 | vim -
1:Exception in thread "main" java.lang.StackOverflowError
2: at StackOverflow.main(StackOverflow.java:5)
3: at StackOverflow.main(StackOverflow.java:5)
...
1025: at StackOverflow.main(StackOverflow.java:5)

Thursday, August 11, 2011

make me a sandwich

% cat Makefile
me: a

a: sandwich

sandwich:
% make me a sandwich
make: `me' is up to date.
make: `a' is up to date.
make: Nothing to be done for `sandwich'.

--
  = ^ . ^ =

Tuesday, August 9, 2011

random.c

% cat random.c
#include
#include
#include
#include

int main(int argc,char* argv[])
{
unsigned int i=0;

initstate(random(),(char*)argv,argc);

for (i=0;i
fprintf(stderr,"%d\n",random());

return EXIT_SUCCESS ;
}

% cat Makefile
CC=cc
FLAGS=-ansi -static -Wall --pedantic

random: random.c
${CC} ${FLAGS} -o random random.c

% make
% ./random 1>random.out 2>random.err
...