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
from numpy import linalg as alg | |
import numpy as np | |
arr = np.array([ | |
0.0, 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., | |
0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., | |
0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., | |
0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., |
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 pandas as pd | |
def read_eni_cap(filename): | |
return pd.read_csv(filename,header=None, sep='\t', names=['name', 'old', 'new']).set_index('name') | |
eni_cap = read_eni_cap('instance-types.txt') | |
def read_enis(filename): | |
enis = pd.read_json(filename, orient='records') | |
return enis.join(enis.Attachment.apply(pd.Series), rsuffix='.attach').set_index('NetworkInterfaceId') |
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
# python3 bug_categories.py | |
a b c | |
0 foo foo foo | |
1 bar bar bar | |
2 baz baz baz | |
3 foo foo foo | |
4 bar bar bar | |
5 baz baz baz | |
6 foo foo foo |
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
# Assumes you have in third_party libsbp, rapidjson, and b64.c (built) | |
g++ -O3 -g -v -stdlib=libstdc++\ | |
-Wall -Werror -Wno-c++11-extensions \ | |
-Ithird_party/rapidjson/include \ | |
-Ithird_party/libsbp/c/include \ | |
-Ithird_party/b64.c/ \ | |
third_party/b64.c/b64 $1; | |
time ./a.out |
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
GST - GNSS Pseudorange Error Statistics | |
1 2 3 4 5 6 7 8 | |
| | | | | | | | | |
$--GST,hhmmss.ss,x.x,x.x,x.x,x.x,x.x,x.x,x.x*hh<CR><LF> | |
1. UTC time of the GGA or GNS fix associated with this sentence. | |
2. RMS value of the standard deviation of the range inputs to | |
the navigation process. Range inputs include pseudoranges & | |
DGNSS corrections. | |
3. Standard deviation of semi-major axis of error ellipse (meters) | |
4. Standard deviation of semi-minor axis of error ellipse (meters) |
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
# Copyright (C) 2015 Swift Navigation Inc. | |
# Contact: Engineering <[email protected]> | |
# | |
# This source is subject to the license found in the file 'LICENSE' which must | |
# be be distributed together with this source. All other rights reserved. | |
# | |
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | |
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | |
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. |
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 Test.QuickCheck | |
import Test.QuickCheck.Instances.Maybe | |
import Test.QuickCheck.Monadic | |
instance Arbitrary LogLevel where | |
arbitrary = do | |
n <- choose (0, 4) :: Gen Int | |
return $ case n of | |
0 -> LevelDebug | |
1 -> LevelInfo |
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
function generateDish() { | |
var ADJ_PROB = 0.5; | |
var STRUCTURE_PROB = 0.5; | |
var adjs = ["chilled", "fried", "smoked", "brined", "cultured", "farmer's", "pressed", "cured", "charred", "dill", "sweet", "corned", "kefir", "paprika", "pickled", "truffled", "black", "rye", "sour cream", "preserved", "burnt", "seeded", "dried"]; | |
var ingredients = ["cabbage", "chicken", "tongue", "cheese", "liver", "sturgeon", "chard", "tuna", "beef", "radish", "mushroom", "trout", "carrot", "yoghurt", "lard", "bone marrow", "tripe", "bottarga", "egg", "catfish", "ramp", "tendon", "greens", "fennel", "chicories", "bonito", "potato", "garlic", "mussel", "nettle", "herring", "sardine", "walnut", "plum"]; | |
var structures = ["croquettes", "melt", "stew", "soup", "slab", "bread", "butter", "pickles", "dip", "dumplings", "broth", "tartare", "loin", "crackers", "cake", "steak", "flatbread", "toast"]; | |
var dish = ""; | |
if (_.random(0, 100) < ADJ_PROB * 100) { | |
dish += _.sample(adjs) + " "; | |
} |
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
%typemap(in) float value[ANY] (float temp[$1_dim0]) { | |
int i; | |
if (!PySequence_Check($input)) { | |
PyErr_SetString(PyExc_ValueError,"Expected a sequence"); | |
return NULL; | |
} | |
if (PySequence_Length($input) != $1_dim0) { | |
PyErr_SetString(PyExc_ValueError,"Size mismatch. Expected $1_dim0 elements"); | |
return NULL; | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am mookerji on github. | |
* I am mookerji (https://keybase.io/mookerji) on keybase. | |
* I have a public key whose fingerprint is E277 702B 9088 47A1 2228 5D2B A056 FAB1 7C28 EE91 | |
To claim this, I am signing this object: |
NewerOlder