This file contains hidden or 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
/** | |
* Small utility script to use JavaFX 2 from scala REPL | |
* To use ':l fxutil.scala' in REPL. | |
* Recent java7 JDK contains javafx runtime at $JAVA_HOME/jre/lib/jfxrt.jar | |
* Scala 2.9 takes -cp or CLASSPATH, so specify the jfxrt.jar path using | |
* either way. | |
* Scala 2.10 does not work in the same way. Its startup script passes | |
* -classpath "", thus -cp does not work. Instead, it has -toolcp option, | |
* so specify the jfxrt.jar using the option. | |
* |
This file contains hidden or 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.InputStream; | |
import java.net.*; | |
// import java.util.concurrent.Phaser; | |
// Try mutex/condvar style. | |
// If it didn't work, try semaphore | |
// test for JDK-8006395 | |
// Racey test, will not always fail, but if it does then we have a problem. | |
public class Race15 { |
This file contains hidden or 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
/Users/yoshi/local/openjdk/jdk8-b102-hs25-b45/hotspot/src/os/bsd/vm/attachListener_bsd.cpp: In static member function ‘static void AttachListener::vm_start()’: | |
/Users/yoshi/local/openjdk/jdk8-b102-hs25-b45/hotspot/src/os/bsd/vm/attachListener_bsd.cpp:455: warning: ‘stat64’ is deprecated (declared at /usr/include/sys/stat.h:466) | |
/Users/yoshi/local/openjdk/jdk8-b102-hs25-b45/hotspot/src/os/bsd/vm/attachListener_bsd.cpp:455: warning: ‘stat64’ is deprecated (declared at /usr/include/sys/stat.h:466) | |
make[8]: *** [attachListener_bsd.o] Error 1 | |
make[8]: *** Waiting for unfinished jobs.... | |
make[7]: *** [the_vm] Error 2 | |
make[6]: *** [product] Error 2 | |
make[5]: *** [generic_build2] Error 2 | |
make[4]: *** [product] Error 2 | |
make[3]: *** [all_product_universal] Error 2 |
This file contains hidden or 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 org.jfree.chart.ChartFactory | |
import org.jfree.chart.ChartFrame | |
import org.jfree.chart.JFreeChart | |
import org.jfree.data.general.DefaultPieDataset | |
object First extends App { | |
val data = new DefaultPieDataset | |
List(("Category 1", 43.2), ("Category 2", 27.9), ("Category 3", 79.5)). | |
foreach(e => data.setValue(e._1, e._2)) | |
val chart = ChartFactory.createPieChart("Simple Pie Chart", |
This file contains hidden or 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._ | |
import collection.JavaConversions._ | |
case class MatchedEnt(path: String, names: List[String]) | |
class FindJar(path: String, patternStr: String) { | |
import scala.util.matching.Regex | |
val pattern = patternStr.r |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# windows batch file example | |
# c:\Python27\python %UserProfile%\local\bin\mypg.py %* | |
# | |
import sys | |
import os.path | |
DEFAULT_CHAR = ':' |
This file contains hidden or 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
/* | |
* JDK 8 javac has a new option -parameters. | |
* If this option was used, parameter name is stored in class file. | |
* The parameter name can be obtained via reflection. New class | |
* Parameter and a new method Method#getParameters() was added. | |
* $ ~/local/jdk1.8.0/bin/java ParamEx | |
* method: main | |
* param: java.lang.String[] arg0 | |
* method: doit | |
* param: java.lang.String arg0 |
This file contains hidden or 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.lang.annotation.Target; | |
import java.lang.annotation.Repeatable; | |
import static java.lang.annotation.ElementType.*; | |
import java.lang.annotation.Retention; | |
import static java.lang.annotation.RetentionPolicy.*; | |
@Target(METHOD) | |
@Retention(RUNTIME) | |
@Repeatable(Schedules.class) | |
public @interface Schedule { |
This file contains hidden or 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
/* dump big byte arrays in ascii */ | |
select [ba, ba.length, String.fromCharCode.apply(String, | |
toArray(ba))] from [B ba where ba.length > 1000000 |
This file contains hidden or 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
/* | |
* shows font smoothing setting, which is true by default. | |
* flips font smoothing setting if "flip" was specified on command line. | |
* compilation: cl fontsmoothing.cpp user32.lib | |
*/ | |
#include <windows.h> | |
#include <stdio.h> | |
BOOL fontSmoothingStatus() | |
{ |