Skip to content

Instantly share code, notes, and snippets.

Building MLVM version of OpenJDK (Java 1.8) on Mac OS X

Take a look at the comments and code in update.sh.

Requires a working version of Java 1.8.

I use create_tarball.sh to make a copy of the build to share.

OpenJDK 1.7 builds for Mac OS X:

require 'rubygems'
require 'mechanize'
require 'httparty'
# Ugly code, for an ugly hack.
# Hey, if Lighthouse didn't suck then none of this would happen.
# It's been lotsa fun coding it though, so I suppose I should be thankful for the "opportunity"
@nahi
nahi / gist:1029091
Created June 16, 2011 11:57
AES-256-CBC encryption/decryption w/o using JCE on JRuby
# Java's JCE requires extra JVM config download named Jurisdiction Policy Files where AES keysize > 128bit.
# You can do encrypt/decrypt using BouncyCastle via JRuby's Java integration like this.
# Use this at your own risk.
require 'java'
require 'openssl'
java_import 'org.bouncycastle.crypto.BlockCipher'
java_import 'org.bouncycastle.crypto.engines.AESLightEngine'
java_import 'org.bouncycastle.crypto.modes.CBCBlockCipher'
anonymous
anonymous / gist:1108283
Created July 26, 2011 22:47
package com.headius.indy.examples;
import java.lang.invoke.MethodHandle;
import static java.lang.invoke.MethodHandles.*;
import static java.lang.invoke.MethodType.*;
import java.lang.invoke.MutableCallSite;
public class IndyLoop {
public static void main(String[] args) throws Throwable {
// method handle loop adds up numbers from 1 to args[0].to_i
@jlbfalcao
jlbfalcao / gist:1143112
Created August 12, 2011 22:08
SocketChannel problem
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.channels.SocketChannel;
public class LeakTest {
public static void main(String[] args) {
new LeakTest().test();
@vinibaggio
vinibaggio / arvoreb.c
Created November 20, 2011 20:22
Arvore B, sem remoção, apenas inserção
// PS: Datasets:
// http://dl.dropbox.com/u/3545192/cep.zip
// http://dl.dropbox.com/u/3545192/consultas.txt
/* SCE-183 - Algoritmos e estruturas de dados II
* Professora: Prof.a Dr.a Hosiane M. Bueno
*
* Trabalho 2: ¡rvore-B
*
* Autor: VinÌcius Baggio Fuentes
@qmx
qmx / gist:1407191
Created November 29, 2011 23:43 — forked from anonymous/gist:1406238
yammer moving away from scala
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
require 'benchmark'
require 'time'
string = "2010-11-10 23:00:00 UTC"
n = 100_000
(ARGV[0] || 5).to_i.times do
Benchmark.bm(20) do |b|
b.report 'Time.parse' do
n.times do
@gleicon
gleicon / base_62.rb
Created March 26, 2012 14:44
base 62 encoding in ruby
ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
def base62_encode(num, alphabet=ALPHABET)
return alphabet[0] if num == 0
arr = []
base = alphabet.size
while num > 0 do
rem = num % base
num = num / base
arr << alphabet[rem]
@jboner
jboner / latency.txt
Last active May 12, 2024 19:52
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD