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 ch.maxant.tradingengine.model; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import ch.maxant.tradingengine.model.TradingEngine.Listener; |
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
// ///////////////////////////////////////////////// | |
// this file contains all the classes related to a | |
// market. | |
// ///////////////////////////////////////////////// | |
var log4js = require('log4js'); | |
var logger = log4js.getLogger(require('path').basename(__filename, '.js')); | |
require('es6-collections'); | |
var _ = require('underscore'); | |
/** |
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
{ | |
"model": { | |
"input1.xml": { | |
"servlet1": { | |
"name1": "value1" | |
}, | |
"servlet2": { | |
"name1": "value1", | |
"name2": "value2" | |
}, |
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
# prerequisites: | |
# https://github.com/stchris/untangle/blob/master/examples.py | |
# C:\temp>c:\Python27\Scripts\pip.exe install untangle | |
# run: C:\temp\read_xml_out_csv>c:\Python27\python.exe read_xml_out_csv.py | |
import untangle | |
import os | |
import time | |
def now(): | |
return time.time()*1000.0 |
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
/* | |
* built using Scala 2.12.4 in intellij | |
* prerequisites: add library for org.scala-lang.modules:scala-xml_2.12:1.0.6 | |
*/ | |
package ch.maxant.readxmloutcsv | |
import java.io.{File, PrintWriter} | |
import scala.xml.XML | |
import java.lang.System.{currentTimeMillis => now} |
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
<?xml version="1.0"?> | |
<config> | |
<!-- 0..n servlets --> | |
<servlet> | |
<name>servlet1</name> | |
<!-- 0..n name-value pairs --> | |
<param-name>name1</param-name> | |
<param-value>value1</param-value> |
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
filename | servlet name | name1 | name2 | ||
---|---|---|---|---|---|
input1.xml | servlet1 | value1 | |||
input1.xml | servlet2 | value1 | value2 | ||
input1.xml | servlet3 | value2 | |||
input2.xml | servlet4 | value4 |
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
// npm install xml2js | |
// compile using "./node_modules/.bin/tsc read_xml_out_csv.ts -w" | |
// run using node read_xml_out_csv.js | |
const parseString: any = require('xml2js').parseString; | |
import * as fs from "fs"; | |
const model = {}; // dictionary of dictionaries with filename -> servlet -> parameter name -> parameter value | |
const params = {}; // all params that are found (mapped to undefined) | |
const start = Date.now(); |
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
@Resource UserTransaction ut; | |
@Override | |
protected void doGet(HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { | |
ut.begin(); | |
... | |
CompletableFuture<String> cf = new CompletableFuture<>(); | |
service.foo(cf, pw); | |
... |
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
@Stateless | |
public class Service5 { | |
@Resource ManagedExecutorService mes; | |
@Resource EJBContext ctx; | |
@PersistenceContext(name="asdf") EntityManager em; | |
@Asynchronous | |
public void foo(CompletableFuture<String> cf, final PrintWriter pw) { |
NewerOlder