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 Date randomShiftOnDate(Date someDate) { | |
Random random = new Random(); | |
int randomValue = random.nextInt(31) * 60 * 1000; // 30 min. | |
boolean subtract = random.nextBoolean(); | |
if (subtract) randomValue *= -1; | |
long time = someDate.getTime(); | |
time += randomValue; | |
Calendar cal = Calendar.getInstance(); |
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
asadmin> get resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.* | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.portNumber=3306 | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.serverName=localhost | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.databaseName=gf2wls | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.User=gf2wls | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.URL=jdbc:mysql://localhost:3306/gf2wls?zeroDateTimeBehavior=convertToNull | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.driverClass=com.mysql.jdbc.Driver | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.property.Password=gf2wls | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.allow-non-component-callers=false | |
resources.jdbc-connection-pool.mysql_gf2wls_gf2wlsPool.associate-with-thread=false |
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 foo; | |
import java.util.Arrays; | |
import java.util.Locale; | |
/** | |
* @author bruno borges | |
*/ | |
public class Foo { |
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 EventProducer { | |
@Inject Event event; | |
public void doSomething() { | |
MyEvent e = new @Async MyEvent(); | |
e.data = "This is a test event"; | |
e.eventTime = new Date(); | |
event.fire(e); | |
} |
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
/** | |
* @author bruno.borges@oracle.com | |
*/ | |
public class FooBar { | |
private final String foobar; | |
public FooBar() { | |
foobar = "foobar"; | |
} |
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 | |
MAVEN_OPTS=-Xmx1024M -XX:MaxPermSize=512m | |
svn checkout https://svn.java.net/svn/glassfish~svn/trunk/main | |
cd main | |
mvn install -Dmaven.wagon.http.ssl.insecure=true \ | |
-Dmaven.wagon.http.ssl.allowall=true \ | |
-DskipTests |
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
var WebView = javafx.scene.web.WebView; | |
var StackPane = javafx.scene.layout.StackPane; | |
var Scene = javafx.scene.Scene; | |
var url = arguments.join(''); | |
function start(stage) { | |
var browser = new WebView(); | |
var engine = browser.getEngine(); | |
engine.load(url); | |
var root = new StackPane(); | |
root.children.add(browser); |
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 WebViewSample extends Application { | |
@Override public void start(Stage stage) { | |
WebView browser = new WebView(); | |
browser.getEngine().load("http://twitter.com/brunoborges"); | |
StackPane root = new StackPane(); | |
root.getChildren().add(browser); | |
stage.setTitle("WebView"); | |
stage.setScene(new Scene(root, 750, 500)); |
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
private void hackScriptEngine(FXMLLoader loader) { | |
try { | |
Field fse = loader.getClass().getDeclaredField("scriptEngine"); | |
fse.setAccessible(true); | |
scriptEngine = (ScriptEngine) fse.get(loader); | |
} catch (IllegalAccessException | NoSuchFieldException | SecurityException ex) { | |
LOGGER.log(Level.SEVERE, null, ex); | |
} | |
} |
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
#!/usr/bin/jjs -J-Djava.class.path=lib/kvclient.jar | |
var oracle = Packages.oracle; | |
var KVStore = oracle.kv.KVStore; | |
var KVStoreConfig = oracle.kv.KVStoreConfig; | |
var KVStoreFactory = oracle.kv.KVStoreFactory; | |
var Direction = oracle.kv.Direction; | |
var store = KVStoreFactory.getStore(new KVStoreConfig("kvstore", "localhost:5000")); | |
var batchSize = 10; |
OlderNewer