Skip to content

Instantly share code, notes, and snippets.

public static void main(String[] args) {
System.out.println( "Wildfly Version: "+ getWildflyVersion() );
}
import com.sumzerotrading.data.StockTicker;
import com.zerosumtrading.interactive.brokers.client.InteractiveBrokersClient;
import com.sumzerotrading.marketdata.ILevel1Quote;
import com.sumzerotrading.marketdata.QuoteType;
public class MarketDataStocksExample {
public void placeEquityOrder() {
InteractiveBrokersClientInterface ibClient = InteractiveBrokersClient.getInstance("localhost", 7999, 1);
ibClient.connect();
StockTicker amazonTicker = new StockTicker("AMZN");
String orderId = ibClient.getNextOrderId();
int shares = 500;
TradeOrder order = new TradeOrder(orderId, amazonTicker, shares, TradeDirection.SELL);
public void placeFuturesOrder() {
InteractiveBrokersClientInterface ibClient = InteractiveBrokersClient.getInstance("localhost", 7999, 1);
ibClient.connect();
//Create a crude oil futures ticker
FuturesTicker futuresTicker = new FuturesTicker();
futuresTicker.setSymbol("CL");
futuresTicker.setExpiryMonth(4);
futuresTicker.setExpiryYear(2016);
futuresTicker.setExchange(Exchange.NYMEX);
public void placeCurrencyOrder() {
InteractiveBrokersClientInterface ibClient = InteractiveBrokersClient.getInstance("localhost", 7999, 1);
ibClient.connect();
CurrencyTicker eurTicker = new CurrencyTicker();
eurTicker.setSymbol("EUR");
eurTicker.setCurrency("USD");
eurTicker.setExchange(Exchange.IDEALPRO);
String orderId = ibClient.getNextOrderId();
int amount = 50000;
{
"type": "file",
"enabled": true,
"connection": "file:///",
"config": null,
"workspaces": {
"root": {
"location": "/var/log/jms-jmx/output-jms-jmx",
"writable": false,
"defaultInputFormat": null
require 'net/http'
require 'json'
url = 'http://lweb.lynden.com/WildflyRegistry/registry/services'
webapps = []
resp = Net::HTTP.get_response(URI.parse(url))
resp_text = resp.body
data =JSON.parse(resp_text)
servers = data
# Loop through each Wildfly server that was found
webapps.each do |app|
url = "http://nexus.lynden.com/repo/com/lynden/" + app[:name] + "/" + app[:version] + "/" + app[:name] + "-" + app[:version] + ".war"
puts "deploying " + app[:name] + "-" + app[:version]
fullFileNameNew = app[:name] + "-" + app[:version]
fullPath = "/tmp/" + app[:name] + "-" + app[:version]
fullPath = fullPath + ".war"
puts "Full path to apps " + fullPath
remote_file fullPath do
!/bin/sh
FILENAME=$1
PATH=$PATH:/usr/local/java/bin
cd /usr/local/wildfly/bin
./jboss-cli.sh -c --user=myUser --password=myPassword --command="deploy $FILENAME"
GeocodingService gs = new GeocodingService();
GeocoderRequest geocoderRequest = new GeocoderRequest("Sao Paulo");
gs.getGeocoding(geocoderRequest, (GeocodingResult[] results, GeocoderStatus status) -> {
System.out.println("Geocoding Results: " + results.length);
System.out.println("Lat long" + results[0].getGeometry().getLocation() );
});