This file contains hidden or 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 matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.stats import norm | |
# Data points | |
data_points = [2, 4, 6, 4, 2] | |
# Fit a normal distribution to the data | |
mu, std = np.mean(data_points), np.std(data_points) | |
xmin, xmax = min(data_points), max(data_points) |
This file contains hidden or 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 gateway.ibkr; | |
import com.ib.client.OrderStatus; | |
public class OrderStatusDetails { | |
public final int orderId; | |
public final OrderStatus orderStatus; | |
public final Integer errorCode; | |
public final String msg; |
This file contains hidden or 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 samples.sandbox; | |
import com.ib.client.*; | |
import com.ib.contracts.StkContract; | |
import com.ib.controller.ApiConnection; | |
import com.ib.controller.ApiController; | |
import java.util.List; | |
import java.util.concurrent.atomic.AtomicBoolean; |
This file contains hidden or 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
(ns example.go | |
(:require [chesster.core :as go] | |
[chesster.uci :as uci] | |
[chesster.pgn :as pgn])) | |
(ns example.go | |
(:require [chesster.core :as go] | |
[chesster.uci :as uci] | |
[chesster.pgn :as pgn])) |
This file contains hidden or 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
(ns example.chat-app | |
(:require [aleph.tcp :as tcp] | |
[clojure.core.async :refer [<! >! chan close!]] | |
[sente.client :as client])) | |
(defn chat-app | |
"Starts a chat server at the specified host and port and connects a chat client to it. | |
host: the hostname or IP address of the chat server | |
port: the port number of the chat server" | |
[host port] |
This file contains hidden or 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
(defn parseInt [^String s] | |
#?(:clj (Integer/parseInt s) | |
:cljs (js/parseInt s))) | |
(defn try-parse-int [s] | |
(some->> s str (re-matches #"[-+]?\d+") parseInt)) |
This file contains hidden or 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
data = [ | |
("S1", [1, 2, 3, 4, 5], 1, 7), | |
("S2", [4, 2, 6, 4, 4], 5, 200), | |
("S3", [4, 2, 6, 4, 4], 2, 200), | |
("S4", [4, 2, 6, 4, 4], 5, 600), | |
] | |
distData = sc.parallelize(data) | |
def checkCriteriaForTag(t): | |
asset_id, ts, multiplier, criteria = t |
This file contains hidden or 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
(ns ds-sandbox.core | |
(:use clojure.tools.trace) | |
) | |
(def data [[0 1] [1 0] [1 1] [0 0] [1 0] [0 1] [0 1] [0 1]]) | |
(defn txor [tuple] | |
(-> (first tuple) | |
(+ (second tuple)) | |
(= 1) |
This file contains hidden or 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
public class FileUtils { | |
public static String loadFile(String name) throws IOException { | |
final ClassLoader classLoader = getClass().getClassLoader(); | |
final URL resource = classLoader.getResource(name); | |
if (resource == null) throw new NullPointerException("Resource " + name + " not found"); | |
final File file = new File(resource.getFile()); | |
try (FileInputStream fis = new FileInputStream(file)) { | |
final byte[] data = new byte[(int) file.length()]; | |
fis.read(data); | |
return new String(data, "UTF-8"); |
This file contains hidden or 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
[:div.col-md-offset-3.col-md-5 | |
[:p {:style {:height "calc(100vh - 100px)"}} "Going to fill it in"] | |
[:p "This is footer"] | |
] |
NewerOlder