Skip to content

Instantly share code, notes, and snippets.

@ghais
ghais / test.hs
Last active February 22, 2021 01:15
{-# LANGUAGE ScopedTypeVariables #-}
type Speed = Double
type Name = String
class Ship s c where
sail :: s -> c -> Speed
data Sea s c = Sea {
ships :: M.Map (Name) s
[Trace - 10:42:02 AM] Sending request 'textDocument/codeAction - (71)'.
Params: {
"textDocument": {
"uri": "file:///home/ghais/workspace/hq/test/normalimpliedvol/Spec.hs"
},
"range": {
"start": {
"line": 24,
"character": 49
},
@ghais
ghais / options.csv
Last active December 1, 2020 14:51
strike tte callPut ir vol premium delta vega gamma logRelativeStrike
1.0 0.1 C 1.0e-2 0.1 99.00099950016663 1.0 0.0 0.0 -4.606170185988091
1.0 1.0 C 1.0e-2 0.1 99.00995016625083 1.0 0.0 0.0 -4.615170185988092
1.0 2.0 C 1.0e-2 0.1 99.01980132669325 1.0 3.0418944353759704e-233 1.5209472176879847e-235 -4.625170185988091
1.0 10.0 C 1.0e-2 0.1 99.09516258196403 1.0 1.000806406421531e-48 1.0008064064215306e-51 -4.7051701859880914
1.0 20.0 C 1.0e-2 0.1 99.18126924692203 1.0 1.3423256074892505e-25 6.711628037446251e-29 -4.805170185988091
2.0 0.1 C 1.0e-2 0.1 98.00199900033326 1.0 0.0 0.0 -3.9130230054281463
2.0 1.0 C 1.0e-2 0.1 98.01990033250166 1.0 0.0 0.0 -3.922023005428146
2.0 2.0 C 1.0e-2 0.1 98.0396026533865 1.0 1.0788346059421287e-168 5.394173029710641e-171 -3.9320230054281464
2.0 10.0 C 1.0e-2 0.1 98.19032516392808 1.0 1.8687371426398972e-35 1.8687371426398963e-38 -4.012023005428146
@ghais
ghais / init.el
Created November 30, 2020 17:26
Emacs config
;; Required packages.
(require 'use-package)
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
;; Make file names unique
@ghais
ghais / delta.csv
Last active November 30, 2020 01:18
strike tte callPut ir vol premium delta vega gamma logRelativeStrike
80.0 0.1 C 1.0e-2 0.1 20.079960013330258 0.9999999999993934 1.388782498137288e-11 1.3887824981372875e-12 -0.22414355131420977
80.0 1.0 C 1.0e-2 0.1 20.82569116799547 0.9913773450413681 0.2341084073017343 2.341084073017343e-3 -0.2331435513142097
80.0 2.0 C 1.0e-2 0.1 21.802171458026738 0.9632726598800867 1.1367561351098632 5.683780675549315e-3 -0.2431435513142098
80.0 10.0 C 1.0e-2 0.1 29.74568586256516 0.8809966145242178 6.288726316776251 6.288726316776248e-3 -0.32314355131420985
81.0 0.1 C 1.0e-2 0.1 19.08095951350103 0.9999999999903365 2.094514693991717e-10 2.094514693991716e-11 -0.21172103131565267
81.0 1.0 C 1.0e-2 0.1 19.848794428404823 0.9880025318501997 0.31228075528423416 3.122807552842341e-3 -0.22072103131565263
81.0 2.0 C 1.0e-2 0.1 20.87524838384068 0.9556368173266855 1.3251885843575477 6.6259429217877365e-3 -0.23072103131565266
81.0 10.0 C 1.0e-2 0.1 29.0212091173788 0.873002618969313 6.5820141091778686 6.582014109177866e-3 -0.31
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\ ".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA -Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }
ssh root@jabber.convertglobal.com
killall -9 openfire
rm -rf /var/run/openfire.pid
/etc/init.d/openfire start
Generate a sequence of N characters, chosen from an alphabet of three elements (e.g., 1, 2, 3), such that no two immediately adjacent subsequences are equal.
For instance, the sequence of length N = 5 with the characters “12321″ is acceptable, but neither “12323″ nor “12123″ are.
Develop a program that generates in ascending order the least 100 numbers of the set M, where M is defined as follows:
a) The number 1 is in M.
b) If x is in M, then y = 2 * x + 1 and z = 3 * x + 1 are also in M.
c) No other numbers are in M.
Wirth also gives the first six numbers in the result sequence: 1, 3, 4, 7, 9, 10….