Skip to content

Instantly share code, notes, and snippets.


ixaxaar ixaxaar

View GitHub Profile
View gdb-logs
gdb python
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
import faiss
from faiss import cast_integer_to_float_ptr as cast_float
from faiss import cast_integer_to_int_ptr as cast_int
from faiss import cast_integer_to_long_ptr as cast_long
import torch as T
def ptr(tensor):
def repackage_hidden(h):
"""Wraps hidden states in new Variables, to detach them from their history."""
if type(h) == Variable:
return Variable(
elif type(h) == tuple:
return tuple(repackage_hidden(v) for v in h)
elif type(h) == list:
return [ repackage_hidden(v) for v in h ]
def repackage_hidden_dnc(h):
  1. download model
if [[ ! -e 'numberbatch-17.06.txt' ]]; then
    gunzip numberbatch-17.06.txt.gz
sudo pip install wordfreq
sudo pip install gensim
View langid
#!/usr/bin/env bash
sudo apt-get install -y python3-pip python3-dev python-dev python-pip
sudo pip install langid
sudo pip2 install langid
sudo pip3 install langid
ixaxaar / beamPermute.scala
Last active Mar 2, 2017
Beam over permutations, find the best possible sequence given a perplexity function
View beamPermute.scala
def beamPermute[T](
data: List[T],
perplexityFn: List[T] => Double,
startNode: T,
beamSize: Int = 10,
beamWindow: Int = 3
): List[(List[T], Double)] = {
var candidates = List((List(startNode), 0d))
View beam.scala
def beam[T](
perplexityFn: List[T] => Double,
beamSize:Int = 10)
:List[(List[T], Double)] = {
var candidates = List((List(startNode), 0d))
data.foreach{ case datum:List[T] =>
ixaxaar /
Created Sep 2, 2016
Multi-DC cassandra installer
#!/usr/bin/env bash
# A script to install cassandra
# Deploy a few instances as seed nodes first, this script can run on those seed nodes as well
# Number of seed nodes equal number of data centers
# Add the seed nodes here


Traversal[S,E] which implements Iterator[E] where S:Start, E:End

Step[S,E] //  an individual function applied to S to yield E . Steps are chained within a traversal.
TraversalStrategy // interceptor methods to alter the execution of the traversal (e.g. query re­writing).
TraversalSideEffects // key/value pairs that can be used to store global information about the traversal.
Traverser[T] // the object propagating through the Traversal currently representing an object of type T .
View curl.log
curl -v
* Trying
* Connected to ( port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 704 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* gnutls_handshake() failed: Error in the pull function.
* Closing connection 0
curl: (35) gnutls_handshake() failed: Error in the pull function.