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 org.mozilla.javascript.Context; | |
import org.mozilla.javascript.NativeJavaObject; | |
import org.mozilla.javascript.Scriptable; | |
public class RhinoLoader { | |
public static void main(String args[]){ | |
Context ctx = Context.enter(); | |
try { |
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 SinglyListNode { | |
SinglyListNode next; | |
String s; | |
public String toString(){return s;} | |
public SinglyListNode(String s){this.s=s;} | |
public static void main(String argsp[]){ |
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.util.PriorityQueue; | |
public class BoundedPriorityQueue<T> extends PriorityQueue<T> { | |
final private int maxSize ; | |
public BoundedPriorityQueue(int maxSize) { | |
this.maxSize = maxSize; | |
} |
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 servo; | |
import com.netflix.servo.monitor.Counter; | |
import com.netflix.servo.monitor.MonitorConfig; | |
import com.netflix.servo.monitor.Monitors; | |
import com.netflix.servo.monitor.PeakRateCounter; | |
public class ServoDemo { |
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 jmh; | |
import com.netflix.servo.monitor.Counter; | |
import com.netflix.servo.monitor.MaxGauge; | |
import com.netflix.servo.monitor.MonitorConfig; | |
import com.netflix.servo.monitor.Monitors; | |
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 jmh; | |
import org.openjdk.jmh.annotations.*; | |
import org.openjdk.jmh.profile.GCProfiler; | |
import org.openjdk.jmh.profile.StackProfiler; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.options.Options; | |
import org.openjdk.jmh.runner.options.OptionsBuilder; | |
import java.util.ArrayList; | |
import java.util.List; |
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
// Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362 | |
// Paste this in browser's console | |
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope'); | |
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams); | |
}); | |
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeError - fired when an error occurs during transition.'); |
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 com.carrotsearch.junitbenchmarks.BenchmarkOptions; | |
import com.carrotsearch.junitbenchmarks.BenchmarkRule; | |
import org.junit.Before; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import static junit.framework.Assert.assertTrue; | |
public class DivideBenchmark { |
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 scala.Some | |
import scala.swing._ | |
import scala.util.Random | |
import java.awt.Color | |
import java.util.Timer | |
import java.util.TimerTask | |
import swing.event._ |
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.company; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class Item { | |
Logger log = Logger.getLogger("ItemLogger"); | |
public boolean function(String param) { |
OlderNewer