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
import cffi | |
GRB_EQUAL = 61 | |
ffi = cffi.FFI() | |
ffi.cdef(''' | |
typedef ... GRBenv; | |
typedef ... GRBmodel; |
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
Profit é o lucro total e não lucro da operação. | |
Buy 5000 PETRF20 at: 0.140000 | |
Buy 1000 PETRF18 at: 0.200000 | |
Sell 1000 PETRF18 at: 0.220000 | |
Profit: -20.000000 | |
Buy 1200 PETRF18 at: 0.220000 | |
Sell 5000 PETRF20 at: 0.230000 | |
Profit: 390.000000 | |
Buy 1300 PETRF16 at: 0.770000 |
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
#include <iostream> | |
#include <vector> | |
#include <numeric> | |
using namespace std; | |
class Perceptron { | |
vector<double> w; | |
double learning_rate; | |
bool error; |
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: felipe cruz felipecruz@gmail.com | |
*/ | |
#include <iostream> | |
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <algorithm> | |
#include <map> | |
#include <random> |
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
import pyaio | |
import time | |
def aio_callback(buf): | |
print 'python callback %s' % buf | |
#file name, offset, lenght, callback function | |
pyaio.aio_read('/tmp/b.txt', 10, 20, aio_callback) |
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
static PyObject * | |
pyaio_write(PyObject *dummy, PyObject *args) { | |
const char *filename; | |
const char *buffer; | |
struct aiocb cb; | |
int ret, offset, numbytes; | |
Pyaio_cb *aio; | |
PyObject *result = NULL; |
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
# Original WSGI application. | |
def application(environ, start_response): | |
... | |
# Logging WSGI middleware. | |
import pprint | |
class LoggingMiddleware: |
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
# if you're on linux host, you need xvfb | |
sudo apt-get install xvfb | |
git clone git://github.com/felipecruz/jasmine-gem.git | |
cd jasmine-gem | |
git submodule init | |
git submodule update | |
gem install rails | |
gem install gem-release | |
gem install bundler |
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
module Jasmine | |
class Config | |
# Add your overrides or custom config code here | |
def jasmine_xvfb | |
'xvfb-run --server-args="-screen 0 2000x1400x24"' | |
end | |
end | |
end |
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
rake jasmine:phantomjsci |