Skip to content

Instantly share code, notes, and snippets.

View ludovicc's full-sized avatar
🎯
Focusing

Ludovic Claude ludovicc

🎯
Focusing
View GitHub Profile
Topics to talk about at FOSDEM 2010 regarding Debian-Java:
* Status of maven-repo
* Merge of javahelper and maven-repo-helper?
* Dependencies - versioned or not?
* Versioned .jar files? why? parallell installation?
* CDBS vs. Debhelper7, dh -with maven?
* why it's useful to package Java software, Java packaging is way behind python packaging
* Bridging two great packaging systems: Debian apt and Maven
* OSGi in Debian: the promise of always on, always up-to-date systems
@ludovicc
ludovicc / pom.xml
Created December 12, 2011 19:51
Maven - configure the Release plugin to work with a Git repository
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<!-- required for Git -->
<localCheckout>true</localCheckout>
<preparationGoals>clean verify</preparationGoals>
<releaseProfiles>release</releaseProfiles>
@ludovicc
ludovicc / git-to-p4-setup.sh
Created December 12, 2011 20:13
Git madness - Synchronisation from Git to P4
#
# Suppose that you are happily working with your sources in Git, and manager says 'Thou shalt use the company's Perforce repository'
#
# And you strike a deal: I keep working on Git, but all releases will also be published on Perforce
#
# === Initial setup, run this script once
# My project under Git is located at ~/MyProject
cd MyProject
@ludovicc
ludovicc / TestSerialisationPerf.java
Created July 11, 2012 16:02
Test performance of Java serialisation vs ByteBuffer vs Unsafe - copied from http://mechanical-sympathy.blogspot.com
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
@ludovicc
ludovicc / TestSequentialIoPerf.java
Created August 3, 2012 15:41
Performance test for different methods of sequential IO
package game;
import static java.lang.Integer.MAX_VALUE;
import static java.lang.System.out;
import static java.nio.channels.FileChannel.MapMode.READ_ONLY;
import static java.nio.channels.FileChannel.MapMode.READ_WRITE;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
@ludovicc
ludovicc / TestMemoryAccessPatterns.java
Created August 7, 2012 12:38
Performance test for memory access patterns
/**
* {@link http://mechanical-sympathy.blogspot.fr/2012/08/memory-access-patterns-are-important.html}
*
* Run with the -Xmx4g JVM option.
*/
public class TestMemoryAccessPatterns {
private static final int LONG_SIZE = 8;
private static final int PAGE_SIZE = 2 * 1024 * 1024;
private static final int ONE_GIG = 1024 * 1024 * 1024;
private static final long TWO_GIG = 2L * ONE_GIG;
@ludovicc
ludovicc / gist:3294110
Created August 8, 2012 10:33
Performance results for sequential IO on Ubuntu 12.04 / Intel Core i7 920 @ 2.67GHz / HDD 1Gb 7200RPM read: 87Mb/s access time: 17ms
/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java -Xmx4g -cp . TestSequentialIoPerf
RandomAccessFile write=54,328,651 read=60,534,405 bytes/sec
RandomAccessFile write=59,765,083 read=55,440,505 bytes/sec
RandomAccessFile write=61,703,473 read=61,216,559 bytes/sec
RandomAccessFile write=57,671,052 read=61,041,399 bytes/sec
RandomAccessFile write=59,171,939 read=60,650,931 bytes/sec
BufferedStreamFile write=52,955,816 read=65,539,670 bytes/sec
BufferedStreamFile write=69,623,157 read=70,514,917 bytes/sec
BufferedStreamFile write=83,528,763 read=96,234,948 bytes/sec
public class Unicorn {
private static StackTraceElement[] previousTrace;
public static boolean pat() {
Throwable t = new Exception();
StackTraceElement[] trace = t.getStackTrace();
if (previousTrace == null) {
@ludovicc
ludovicc / bootstrap.sh
Last active December 14, 2015 17:59 — forked from roderik/bootstrap.sh
#!/bin/bash
sudo xcodebuild -license
if rvm --version 2>/dev/null; then
gem install soloist
else
sudo gem install soloist
fi

Keybase proof

I hereby claim:

  • I am ludovicc on github.
  • I am ludovicc (https://keybase.io/ludovicc) on keybase.
  • I have a public key whose fingerprint is 4B02 0161 E88B 495D D15F 9D6F 89A6 16FE B21B 3EBD

To claim this, I am signing this object: