Skip to content

Instantly share code, notes, and snippets.

@rubik
rubik / run_glm.py
Last active October 27, 2017 15:23
import numpy as np
import pymc3 as pm
import theano as t
train_new = np.load('train_new.npy')
targets = np.load('y.npy')
X = t.shared(train_new)
features = list(map(str, range(train_new.shape[1])))
with pm.Model() as logistic_model:

Keybase proof

I hereby claim:

  • I am rubik on github.
  • I am rubik (https://keybase.io/rubik) on keybase.
  • I have a public key ASAdcueU55alkZqzJ-Ha8dhGYEK3Uqy_ySm5OWVU6WtsOQo

To claim this, I am signing this object:

id percentage
1001 9.9
1003 7.2
1005 9.7
1007 9.0
1009 8.0
1011 11.5
1013 10.1
1015 9.2
1017 10.5

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth.

Data Structure Basics

Array

Definition:

[%LetsPlan.Vote{__meta__: #Ecto.Schema.Metadata<:loaded>,
availabilities: [%LetsPlan.Availability{__meta__: #Ecto.Schema.Metadata<:loaded>,
from: #Ecto.Date<2016-03-26>, id: "9b7ec626-5c58-4194-9925-535b8af597e4",
to: #Ecto.Date<2016-03-28>},
%LetsPlan.Availability{__meta__: #Ecto.Schema.Metadata<:loaded>,
from: #Ecto.Date<2016-03-30>, id: "26714a0b-ce51-4471-9214-13fcf0cae8ea",
to: #Ecto.Date<2016-03-31>}],
event: #Ecto.Association.NotLoaded<association :event is not loaded>,
event_id: 1, id: 4, inserted_at: #Ecto.DateTime<2016-03-26T19:47:03Z>,
name: "mic (again!)", updated_at: #Ecto.DateTime<2016-03-26T19:47:03Z>},
test/Spec.hs:57:44:
Couldn't match type ‘m’ with ‘Pipes.Safe.SafeT IO’
‘m’ is a rigid type variable bound by
the type signature for
shouldReturnP :: (MonadIO m, MonadSafe m) =>
IO (Producer FilePath m ()) -> [FilePath] -> Expectation
at test/Spec.hs:53:18
Expected type: Producer FilePath (Pipes.Safe.SafeT IO) ()
Actual type: Producer FilePath m ()
Relevant bindings include
@rubik
rubik / Alb-DS.txt
Last active November 4, 2015 10:54
group: esempio alberghi
Cliente = { CodC, NomeC
1, Mario
2, Giuseppe
3, Laura
4, Angela
}
Albergo = { CodA, NomeA, Comune, NumStelle:number
@rubik
rubik / .gitignore
Last active August 29, 2015 14:15
Formulario di Chimica I e principali composti organici
*.aux
*.fdb_latexmk
*.pdf
*.log
*.fls
module Main
where
perfectSquares :: [Int]
perfectSquares = map (^2) [1..100]
divisors :: Int -> [(Int, Int)]
divisors n = [ (i, div n i) | i <- [1..floor $ sqrt $ fromIntegral n]
, mod n i == 0]
module Main
where
import System.Environment (getArgs)
import Data.List (transpose, sort, groupBy)
import Math.Sieve.Factor (factor, sieve)
-- The Thue-Morse sequence
thueMorse :: [Int]