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
public static double normalise(double value, double min, double max, double size, boolean invert) | |
{ | |
double range = max - min; | |
double result = 0; | |
if (range != 0) | |
{ | |
result = (value - min) / range; | |
} |
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 com.chrisnewland.raytrace; | |
import java.io.FileOutputStream; | |
/* | |
* Standing on the shoulders of giants. | |
* I didn't invent this raytracer, just converted it from C to Java with the help of this web page by Fabien Sanglard: | |
* http://fabiensanglard.net/rayTracing_back_of_business_card/index.php | |
* The original code is by Andrew Kensler. Comments copied from Fabien Sanglard's notes. | |
*/ |
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 javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.layout.BorderPane; | |
import javafx.stage.FileChooser; | |
import javafx.stage.Stage; | |
public class TestFileChooser extends Application | |
{ |
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
<task_queued osr_bci="12" method="SandboxTest main ([Ljava/lang/String;)V" compile_kind="osr" level="3" bytes="56" count="1" backedge_count="69632" stamp="0.199" comment="tiered" hot_count="69632" compile_id="34" iicount="1"/> | |
<nmethod stub_offset="2448" dependencies_offset="3672" compileMillis="10" address="0x00000001048dda50" method="SandboxTest main ([Ljava/lang/String;)V" level="3" count="1" backedge_count="375551" stamp="0.209" nul_chk_table_offset="3680" scopes_data_offset="2736" iicount="1" oops_offset="2680" entry="0x00000001048ddc40" size="3728" scopes_pcs_offset="3064" compile_kind="osr" insts_offset="496" bytes="56" relocation_offset="288" compile_id="34" compiler="C1"/> | |
<task_queued method="SandboxTest main ([Ljava/lang/String;)V" level="3" bytes="56" count="1" backedge_count="376371" stamp="0.209" comment="tiered" hot_count="1" compile_id="35" iicount="1"/> | |
<nmethod inlined_bytes="26" backedge_count="1000000" stamp="0.217" scopes_data_offset="2608" osr_bci="12" scopes_pcs_offset="2912" insts_offs |
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
<task_queued osr_bci="12" method="SandboxTest main ([Ljava/lang/String;)V" compile_kind="osr" bytes="56" count="1" backedge_count="14563" stamp="0.086" comment="backedge_count" hot_count="14563" compile_id="5" iicount="1"/> | |
<nmethod stub_offset="560" dependencies_offset="848" compileMillis="2" inlined_bytes="20" address="0x0000000106466650" method="SandboxTest main ([Ljava/lang/String;)V" count="10000" backedge_count="5681" stamp="0.088" nmsize="248" scopes_data_offset="632" iicount="1" oops_offset="584" entry="0x00000001064667a0" osr_bci="12" size="864" scopes_pcs_offset="688" compile_kind="osr" insts_offset="336" bytes="56" success="1" relocation_offset="288" compile_id="5" compiler="C2"/> | |
<task osr_bci="12" method="SandboxTest main ([Ljava/lang/String;)V" compile_kind="osr" bytes="56" count="10000" backedge_count="5336" stamp="0.086" compile_id="5" iicount="1"> | |
<phase nodes="3" name="parse" stamp="0.086" live="3"> | |
<type name="void" id="680"/> | |
<klass name="[Ljava/lang/String;" flags="1041" id="777 |
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
public class SandboxTest | |
{ | |
public int a(int x) | |
{ | |
return 1 + b(x); | |
} | |
public int b(int x) | |
{ | |
return 1 + c(x); |
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/sh | |
#================================================================================ | |
# This script fetches and builds the latest OpenJDK9 and OpenJFX (currently 8u40) | |
# and installs OpenJFX into the OpenJDK j2sdk image. | |
# | |
# It requires an existing 1.8 JDK installation to bootstrap the OpenJDK build | |
# (I used Oracle jdk1.8.0_20). | |
# | |
# Tested on Debian x86_64 (Squeeze and Wheezy) |
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
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 37 | |
model name : Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz | |
stepping : 5 | |
microcode : 0x2 | |
cpu MHz : 1199.000 | |
cache size : 4096 KB | |
physical id : 0 |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
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
/home/chris/jdk1.8.0_25/jre/lib/ext/jfxrt.jar: | |
"com.sun.deploy.uitoolkit.impl.fx.FXPreloader$FXDispatcher","public java.lang.Boolean call()",479 | |
"com.sun.deploy.uitoolkit.impl.fx.FXProgressBarSkin","public com.sun.deploy.uitoolkit.impl.fx.FXProgressBarSkin(javafx.scene.control.ProgressBar)",463 | |
"com.sun.deploy.uitoolkit.impl.fx.FXProgressBarSkin","protected void layoutChildren(double,double,double,double)",388 | |
"com.sun.deploy.uitoolkit.impl.fx.ui.CertificateDialog","private static javafx.scene.Node getComponents(javafx.stage.Stage,java.security.cert.Certificate[],int,int)",362 | |
"com.sun.deploy.uitoolkit.impl.fx.ui.CertificateDialog","private static void showCertificateInfo(java.security.cert.X509Certificate,javafx.scene.control.TableView,javafx.scene.control.TextArea)",397 | |
"com.sun.deploy.uitoolkit.impl.fx.ui.DialogTemplate","private javafx.scene.layout.BorderPane createSSVTopPanel(java.lang.String,java.lang.String,java.lang.String)",383 | |
"com.sun.deploy.uitoolkit.impl.fx.ui.DialogTemplate","private javafx.scen |
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 org.sample; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.concurrent.TimeUnit; | |
import javax.script.Invocable; | |
import javax.script.ScriptEngineManager; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; |
OlderNewer