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
// MIT licensed. | |
use std::net::TcpStream; | |
use std::io::{Read, Write}; | |
use std::sync::mpsc::channel; | |
use std::thread; | |
fn main() { | |
let mut stream = TcpStream::connect("127.0.0.1:7496").expect("connect"); | |
stream.set_nodelay(true).expect("nodelay"); // Because we're wannabe HFT traders. |
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 main | |
import ( | |
"os" | |
"os/signal" | |
polygonws "github.com/polygon-io/client-go/websocket" | |
"github.com/polygon-io/client-go/websocket/models" | |
"github.com/sirupsen/logrus" | |
) |
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
#install rust | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | |
source "$HOME/.cargo/env" | |
sudo apt update | |
sudo apt install git | |
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
wget https://go.dev/dl/go1.19.linux-amd64.tar.gz | |
sudo tar -xvf go1.19.linux-amd64.tar.gz | |
sudo mv go /usr/local/go | |
export GOROOT=/usr/local/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH | |
echo "GOROOT=/usr/local/go " >> ~/.bashrc | |
echo "PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> ~/.bashrc |
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
type SymbolMapping struct { | |
IBSymbol string | |
FirstRateSymbol string | |
TickDataSymbol string | |
Name string | |
} | |
var SymbolMappings = []SymbolMapping{ | |
{IBSymbol: "ES", FirstRateSymbol: "ES", TickDataSymbol: "ES", Name: "S&P 500"}, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
const admin = require("firebase-admin") // required | |
const projectId = "lingo-e9b0f" | |
admin.initializeApp({ projectId }) | |
const db = admin.firestore() | |
async function getMarker() { | |
let count = 0; | |
const snapshot = await admin.firestore().collection('sentence-pairs').get() |
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
const stringSimilarity = require("string-similarity"); | |
const arrayOfLangNames = Object.values(languages) | |
function getLangCodeFromLanguage(languageName) { | |
let code = Object.keys(languages).find(key => | |
languages[key] === languageName | |
) | |
if (!code) { |
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
const csv = require('csvtojson') | |
const fs = require('fs') | |
const csvFilePath='sentences.csv' | |
const csvWritePath='sentences.json' | |
const readStream= fs.createReadStream(csvFilePath); | |
const writeStream = fs.createWriteStream(csvWritePath) | |
// This writes JSON but incorrectly. You will see. Look at the options for this CSV library |
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 numpy as np | |
import os | |
import shutil | |
from PIL import Image | |
from tensorboardX import SummaryWriter | |
INFECTED = 'infected' | |
UNINFECTED = 'uninfected' | |
train_dir = 'dataset/train_signs' | |
X_train = os.listdir(train_dir) |
NewerOlder