Skip to content

Instantly share code, notes, and snippets.

@jdunkerley
jdunkerley / Enso Getting Started Guide.md
Created September 22, 2023 16:01
Notes on starting work on Enso code.

sbt Build Commands:

  • clean: flushes all the stuff and can be useful when getting new code.
  • runtime/clean: flushes just the engine libs bits (so quicker).
  • buildProjectManagerDistribution: builds the project manager server executable.
  • buildEngineDistribution: builds the engine server and libraries distribution executable.
  • buildStdLib...: builds the standard library can be All or a specific one. Tends to leave the index in a mess so often lose the dropdowns or CB.

Running Enso IDE:

  • Just run the executable it will launch a GUI and a Project Manager. Opening a project opens a Language Server. IDE Dashboard <---> Project Manager --launches-> Language Server <---> IDE Graph Editor
@jdunkerley
jdunkerley / Guide.md
Last active October 6, 2023 08:16
Set up a Windows 10 machine from empty to ready to build Enso
@jdunkerley
jdunkerley / Week3.enso
Created March 10, 2023 11:43
Preppin Data Week 3 - in Enso
from Standard.Base import all
from Standard.Table import all
from Standard.Database import all
import Standard.Visualization
func1 operator11 =
operator12 = operator11.split "-"
operator13 = operator12.first
operator13
@jdunkerley
jdunkerley / Week2.Enso
Created March 9, 2023 10:27
Preppin Data Week 2 - in Enso
from Standard.Base import all
from Standard.Table import all
from Standard.Database import all
import Standard.Visualization
main =
operator3 = enso_project.data/"Transactions.csv" . read
operator4 = enso_project.data/"Swift Codes.csv" . read
operator1 = operator4.use_first_row_as_names
operator2 = operator3.join operator1 Join_Kind.Inner "Bank"
@jdunkerley
jdunkerley / Week1.Enso
Last active March 8, 2023 11:55
Preppin Data Week 1 - in Enso
from Standard.Base import all
from Standard.Table import all
from Standard.Database import all
import Standard.Visualization
func1 operator11 =
operator12 = operator11.split "-"
operator13 = operator12.first
operator13
@jdunkerley
jdunkerley / connect-instance.sh
Last active July 24, 2023 13:40
Amazon Linux EC2 Set Up For Enso
#!/bin/bash
instanceid=`aws ec2 describe-instances --query 'Reservations[0].Instances[*].InstanceId' --output text`
aws ssm start-session --target $instanceid
@jdunkerley
jdunkerley / barrier_numpy.py
Created April 27, 2021 20:39
barrier.numpy.py
from random import random
from math import sqrt, log, exp
from numba import njit
import numpy
from numpy.random import normal
def path_final_min_max(initial, steps, sdt, volatility, drift):
randoms = numpy.exp(normal(size=steps)*volatility*sdt) * drift
randoms[0] = 1
factors = numpy.cumprod(randoms) * initial
@jdunkerley
jdunkerley / barrier_numba.py
Last active April 27, 2021 20:38
barrier_numba.py
from random import random
from math import sqrt, log, exp
from numba import njit, jit, prange
@njit(fastmath=True)
def box_muller_rand():
while True:
x = random() * 2.0 - 1
y = random() * 2.0 - 1
d = x * x + y * y
@jdunkerley
jdunkerley / barrier.cpp
Created April 27, 2021 12:52
Barrier Pricing via MonteCarlo in C++
#include <cstdlib>
#include <random>
#include <iostream>
namespace barrierpricer {
static std::random_device rd;
static std::mt19937_64 rand_generator(rd());
static std::normal_distribution<> dis;
double box_muller_rand() {
@jdunkerley
jdunkerley / barrier.py
Last active April 27, 2021 12:59
Barrier Pricer
from random import random
from math import sqrt, log, exp
def box_muller_rand():
while True:
x = random() * 2.0 - 1
y = random() * 2.0 - 1
d = x * x + y * y
if d < 1:
return x * sqrt(-2 * log(d) / d)