This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn diagonal [m] | |
(map #(nth (nth m %) %) | |
(take (count m) (iterate inc 0)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
disk-speed() { | |
tstfile=/tmp/tstfile.$RANDOM | |
print "Write speed: " $(dd if=/dev/zero bs=1024k of=$tstfile count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }') | |
purge | |
print " Read speed: " $(dd if=$tstfile bs=1024k of=/dev/null count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }') | |
rm $tstfile | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reduce + | |
(map #(read-string (str %)) | |
(str (.pow (BigInteger. "2") 1000)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mycompany.app</groupId> | |
<artifactId>app</artifactId> | |
<version>0.1</version> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding> | |
</properties> | |
<dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javax.swing.Timer; | |
import javax.swing.event.DocumentEvent; | |
import javax.swing.event.DocumentListener; | |
public class DelayedDocumentListener implements DocumentListener { | |
private final Timer timer; | |
private DocumentEvent lastEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class IsolatedClassLoader extends URLClassLoader { | |
private static URL[] classPathAsURLArray() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.nandork.exchangertest; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Exchanger; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TimeoutException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.beans.Introspector; | |
import java.beans.PropertyDescriptor; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.math.BigDecimal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/share/classes/com/sun/tools/javac/jvm/Pool.java b/src/share/classes/com/sun/tools/javac/jvm/Pool.java | |
--- a/src/share/classes/com/sun/tools/javac/jvm/Pool.java | |
+++ b/src/share/classes/com/sun/tools/javac/jvm/Pool.java | |
@@ -28,6 +28,7 @@ | |
import java.util.*; | |
import com.sun.tools.javac.code.Symbol.*; | |
+import com.sun.tools.javac.code.Type.ClassType; | |
/** An internal structure that corresponds to the constant pool of a classfile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Latest Mercurial, OS X Command Line Tools, JDK 8 and libffi are needed | |
# Tested with OSX 10.10.3 and Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) | |
brew install mercurial | |
brew install libffi | |
brew link libffi --force | |
# only needed if you build the zeroshark variant | |
# brew install llvm | |
# brew link llvm --force | |
hg clone http://hg.openjdk.java.net/jdk9/jdk9 |