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
// Only add if it doesn't exist yet! | |
if (!String.prototype.format) { | |
String.prototype.format = function() { | |
var str = this.toString(); | |
if (!arguments.length) | |
return str; | |
var args = typeof arguments[0], | |
args = (("string" == args || "number" == args) ? arguments : arguments[0]); | |
for (arg in args) | |
str = str.replace(RegExp("\\{" + arg + "\\}", "gi"), args[arg]); |
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.junit.Test; | |
import javax.annotation.Nonnull; | |
import java.util.*; | |
public class TestRandomzingIterator | |
{ | |
@Test | |
public void testRandomIteration() | |
{ |
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
{ | |
"$schema": "http://json-schema.org/schema#", | |
"definitions": { | |
"uuid": { | |
"title": "uuid", | |
"description": "UUID ( http://regex101.com/r/eJ7gN2 )", | |
"type": "string", | |
"minLength": 36, | |
"maxLength": 36, | |
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" |
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
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
clearTimeout(timeout); | |
timeout = setTimeout(function() { |
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.vertigrated.mbean.jackson; | |
import com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.JsonSerializer; | |
import com.fasterxml.jackson.databind.SerializerProvider; | |
import weblogic.health.HealthState; | |
import java.io.IOException; |
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
ps -ax | grep "java -jar" | grep -v "grep" | cut -d " " -f 1 |
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
<dependency> | |
<groupId>net.sf.jasperreports</groupId> | |
<artifactId>jasperreports</artifactId> | |
<version>3.7.4</version> | |
<exclusions> | |
<exclusion> | |
<artifactId>jdtcore</artifactId> | |
<groupId>eclipse</groupId> | |
</exclusion> | |
</exclusions> |
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
#define XP_UNIX | |
#include "jsapi.h" | |
/* The class of the global object. */ | |
static JSClass global_class = { | |
"global", JSCLASS_GLOBAL_FLAGS, | |
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, | |
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, | |
JSCLASS_NO_OPTIONAL_MEMBERS | |
}; |
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 TestThreadStackSizes | |
{ | |
public static void main(final String[] args) | |
{ | |
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { | |
public void uncaughtException(final Thread t, final Throwable e) | |
{ | |
System.err.println(e.getMessage()); | |
System.exit(1); | |
} |
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
-module(inet_mdns). | |
-include_lib("kernel/src/inet_dns.hrl"). | |
-export([open/2,start/0]). | |
-export([stop/1,receiver/1]). | |
-export([subscribe/2,unsubscribe/2,getsubs/1]). | |
% gets a timestamp in ms from the epoch | |
get_timestamp() -> | |
{Mega,Sec,Micro} = erlang:now(), |
OlderNewer