Skip to content

Instantly share code, notes, and snippets.

View jponge's full-sized avatar
:octocat:
I may be slow to respond.

Julien Ponge jponge

:octocat:
I may be slow to respond.
View GitHub Profile
@jponge
jponge / convert.rb
Created February 28, 2012 12:35
How I recovered a SVN repo archive, extracted mod/{trunk,tags,branches} submodules, and merged it into a single Git repo
# export/ is a svn checkout
modules = Dir['export/*'].map { |path| path[7..-1]}
modules.each do |mod|
puts "\n>>> Converting #{mod}\n\n"
system "git svn clone --no-metadata --preserve-empty-dirs --stdlayout --authors-file=users.txt svn://localhost/#{mod} git/#{mod}"
end
@jponge
jponge / .vimrc
Last active October 8, 2015 05:48
My current .vimrc for MacVIM
""" General
set nocompatible
set nobackup
""" Pathogen
filetype off
call pathogen#infect()
syntax on
filetype plugin indent on
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
export PATH=$JAVA_HOME/bin:$PATH
@jponge
jponge / Foo.java
Created November 12, 2012 14:26
Bytecode quizz
public class Foo extends SomeClass implements SomeInterface {
public static void main(java.lang.String[]);
Code:
0: new #2 // class Foo
3: dup
4: invokespecial #12 // Method "<init>":()V
7: return
public Foo();
Code:
file = "jooflux-ecoop13"
task :default => [:compile] do
end
task :pdf => :compile
task :compile do
system "pdflatex -interaction=nonstopmode #{file}.tex"
system "bibtex #{file}"
class Const {
public void foo() {
final int x = 10;
int y = x;
}
public void bar() {
int x = 10;
int y = x;
@jponge
jponge / Except.java
Last active December 13, 2015 18:58
import java.io.IOException;
public class Except {
static void a() throws Exception {
try {
b();
} catch (IOException e) {
throw new Exception("woops", e);
} finally {
@jponge
jponge / Fibonacci.java
Created April 16, 2013 12:54
Memoization with invokedynamic
/*
* Copyright (C) 2013 Julien Ponge
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
diff --git a/pom.xml b/pom.xml
index ce4561e..1fe4972 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
<version>7</version>
</parent>
- <packaging>jar</packaging>
+ <packaging>bundle</packaging>
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running closure.CallClosureTest
CallClosureTest.groovy: [measured 5 out of 15 rounds, threads: 1 (sequential)]
round: 1.16 [+- 0.03], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 15, GC.time: 0.02, time.total: 18.18, time.warmup: 12.38, time.bench: 5.80
CallClosureTest.java_unboxed: [measured 5 out of 15 rounds, threads: 1 (sequential)]
round: 0.24 [+- 0.01], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 7, GC.time: 0.01, time.total: 3.58, time.warmup: 2.38, time.bench: 1.20
CallClosureTest.java_boxed: [measured 5 out of 15 rounds, threads: 1 (sequential)]
round: 0.25 [+- 0.01], round.block: 0.00 [+- 0.00], round.gc: 0.00 [+- 0.00], GC.calls: 8, GC.time: 0.01, time.total: 3.82, time.warmup: 2.55, time.bench: 1.27