Skip to content

Instantly share code, notes, and snippets.

View GLitchfield's full-sized avatar

Gavin M Litchfield GLitchfield

  • Maxpoint
  • Raleigh, NC
View GitHub Profile
public interface TradingAccountManager {
Account createAccount(String actName, Price startingCashBalance);
void closeAccount(Account account);
}
Observable<Map.Entry<Date, TradingAccountModel>> accountHistory(Account account, Date start);
public static final ValueFactory vals = new ValueFactoryImpl();
@Test
public void testPriceText() {
Price p1 = vals.newPrice(-5, -1);
Price p2 = vals.newPrice(-5, 0);
Price p3 = vals.newPrice(5, -1);
Price p4 = vals.newPrice(5, 0);
Fraction f = vals.newFraction(10, -1);
public class FilterHistoricData {
public static final String SYMBOL1 = "XFU4";
public static final String SYMBOL2 = "XFH4";
public static final String SYMBOL3 = "XFK4";
/** ddf time stamp encoding/decoding mask */
final static int DDF_TIME_STAMP_MASK = 0x40;
final static byte DDF_CENTURY = 0x14;
HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.marketplace-protectedRequestContext': Invocation of init method failed; nested exception is com.blizzard.asterion.client.exception.AsterionException: javax.xml.ws.soap.SOAPFaultException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
type Exception report
message Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.marketplace-protectedRequestContext': Invocation of init method failed; nested exception is com.blizzard.asterion.client.exception.AsterionException: javax.xml.ws.soap.SOAPFaultException: Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error
static final ReadableDateTime dateFromString(final String time) {
MutableDateTime t = new MutableDateTime();
t.setYear(Integer.parseInt(time.subSequence(0,4).toString()));
t.setMonthOfYear(Integer.parseInt(time.subSequence(4,6).toString()));
t.setDayOfMonth(Integer.parseInt(time.subSequence(6,8).toString()));
t.setHourOfDay(Integer.parseInt(time.subSequence(8,10).toString()));
t.setMinuteOfHour(Integer.parseInt(time.subSequence(10, 12).toString()));
t.setSecondOfMinute(Integer.parseInt(time.subSequence(12,14).toString()));
t.setMillisOfSecond(Integer.parseInt(time.subSequence(14,17).toString()));
final static byte encodeTimeStampByte(final int timeField) {
return (byte) (timeField | DDF_TIME_STAMP_MASK);
}
//
// /** time zone information is discarded */
static final void encodeTimeStamp(final ReadableDateTime dateTime, final ByteBuffer buffer) {
// base fields
buffer.put(DDF_CENTURY); // century
buffer.put(encodeTimeStampByte(dateTime.getYearOfCentury())); // year
public class BarchartMarketplaceReplay extends BarchartMarketplace {
public BarchartMarketplaceReplay(final int socketAddress) {
super("", "");
maker = DDF_Marketplace.newInstance(new DummySubHandler());
}
public void handleMessage(final DDF_BaseMessage message) {
public class BarchartMarketplaceReplay extends BarchartMarketplace {
public BarchartMarketplaceReplay(final int socketAddress) {
super("", "");
this.connection = new HistoricReplayListenerClientDDF(socketAddress,
Executors.newCachedThreadPool(
new ThreadFactory() {
interface LastPrice {
/**
* In order of lowest to highest priority
*/
enum Source {
NULL, PREV_SETTLE, LAST_TRADE, CLOSE, SETTLE
}
Source source();