- Add Heroku to your Gemfile and
bundle install
. - Create your Heroku app. This will only work with their (currently-beta)
'cedar' stack, so you have to
heroku create --stack=cedar
. - Create a Procfile for your bot. This tells Heroku how to run your worker. In
our case, the bot is bot.rb, so the only line in the Procfile is
cinch: bundle exec ./bot.rb
- Commit and push to Heroku.
- You do not want a Web worker running, so
heroku scale web=0 cinch=1
. This also sets up your deployments to restart the bot.
#!/bin/sh | |
# check for where the latest version of IDEA is installed | |
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
wd=`pwd` | |
# were we given a directory? | |
if [ -d "$1" ]; then | |
# echo "checking for things in the working dir given" | |
wd=`ls -1d "$1" | head -n1` |
class StreamingStatementCreator implements PreparedStatementCreator { | |
private final String sql; | |
public StreamingStatementCreator(String sql) { | |
this.sql = sql; | |
} | |
@Override | |
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException { | |
final PreparedStatement statement = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); |
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
#!/bin/bash | |
# | |
# This version uses September 2017 august stretch image, please use this image | |
# | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi |
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi | |
ADAPTER="eth0" | |
# Allow overriding from eth0 by passing in a single argument |
package common; | |
/** | |
* <blockquote> | |
* <pre> | |
* Map<String, Integer> myMap = map("a", 1).with("b", 2); | |
* </pre> | |
* </blockquote> | |
* | |
* The first tuple determines the map type, so cast as appropriate: | |
* <blockquote> |
The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o