Skip to content

Instantly share code, notes, and snippets.

View svaksha's full-sized avatar
💭
zzZen()

svaksha ॥ स्वक्ष ॥ svaksha

💭
zzZen()
View GitHub Profile
@svaksha
svaksha / 20150721-23@pydiversity
Created July 24, 2015 17:01
20150721-23@pydiversity
2015-07-20:CEST:11:13:24 [Users #pydiversity]
2015-07-20:CEST:11:13:24 [ __love__] [ cwarner] [ svaksha] [ treyhunner] [ willingc_]
2015-07-20:CEST:11:13:24 -!- Irssi: #pydiversity: Total of 5 nicks [0 ops, 0 halfops, 0 voices, 5 normal]
2015-07-20:CEST:11:13:25 -!- mode/#pydiversity [+o svaksha] by ChanServ
2015-07-20:CEST:11:14:14 -!- Channel #pydiversity created Mon Aug 4 20:45:27 2014
2015-07-20:CEST:11:16:25 -!- Irssi: Join to #pydiversity was synced in 212 secs
Day changed to 21 juil. 2015
2015-07-21:CEST:21:55:02 < __love__> kushal: ping
2015-07-21:CEST:21:55:12 < kushal> __love__, hello
2015-07-21:CEST:21:56:03 < kushal> __love__, How are you?
@svaksha
svaksha / Julia-Segmentation-fault
Last active August 29, 2015 14:27
Segmentation fault
On Ubuntu14-04-LTS, using git-master `f3217a8d123e51f534` 2015-08-17, julia throws this error:
स्वक्ष@ilak:~/julia$ ju
signal (11): Segmentation fault
unknown function (ip: 0x7f35398dca3b)
unknown function (ip: 0x7f35398dcd84)
jl_restore_incremental at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
_require_from_serialized at loading.jl:72
jlcall__require_from_serialized_20926 at (unknown line)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
@svaksha
svaksha / hn_seach.js
Last active September 12, 2015 11:52 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments);
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
@svaksha
svaksha / hn_seach.js
Last active September 12, 2015 11:52 — forked from meiamsome/hn_search.js
hn job query search
// takes arguments and produces an array of functions that accept context
function handle_args() {
var args = Array.prototype.slice.call(arguments);
return args.map(function(arg) {
if(arg instanceof Function) return arg; // Presumably already a contex-accepting function.
if(arg instanceof Array) return and.apply(this, arg); // make arrays behave as and.
// Presuming a string, build a function to check.
var my_regex = new RegExp(arg.toString(), 'i');
return function(context) {
return context.search(my_regex) > -1;
@svaksha
svaksha / FArray.jl
Created September 28, 2015 02:28 — forked from alsam/FArray.jl
Julia implementation Fortran-like array with arbitrary starting indices, negative or zero. Incurs a reasonable overhead vs. Base.Array, expected performance degradation should be strictly less than 2x.
# Fortran-like array with arbitrary starting indices
#
# usage:
#
# julia> include("FArray.jl")
# size (generic function with 51 methods)
#
# julia> y = FArray(Float64, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1);
#
# julia> y[-1,-7,-128,-5,-1,-3,-2,-1] = 14
@svaksha
svaksha / meetup.jl
Created October 20, 2015 11:48 — forked from tmlbl/meetup.jl
Script to find Julia developers in your area using the GitHub API
using HTTPClient: HTTPC
using JSON
# Fill in your city name and GitHub API token
const MEETUP_LOCATION = lowercase("Seattle")
const API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Pages of search results to examine. Warning - you WILL hit the rate limit
const NUM_PAGES = 1
typealias Field Union{AbstractString,Void}
@svaksha
svaksha / jvm
Created October 20, 2015 11:48 — forked from tmlbl/jvm
JVM - Julia Version Manager
#!/bin/bash
# I keep Julia binaries in /opt/julia with the same directory structure
# as ~/.julia to store different versions, and use this script to switch
# between them. I also like to maintain a link of the ~/.julia folder to
# ~/julia, for easier package development.
JBIN=""
PDIR=""
@svaksha
svaksha / julia-openblas
Last active April 19, 2017 16:27
julia-openblas
स्व@क्ष:~/julia$ make
make -C scratch/openblas-85636ff1a015d04d3a8f960bc644b85ee5157135/ CC=gcc -m64 FC=gfortran -m64 RANLIB=ranlib FFLAGS= -O2 -fPIC TARGET= BINARY=64 USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NUM_THREADS=16 NO_AFFINITY=1 DYNAMIC_ARCH=1 INTERFACE64=1 SYMBOLSUFFIX=64_ LIBPREFIX=libopenblas64_ CFLAGS= FFLAGS= MAKE_NB_JOBS=0
getarch_2nd.c: In function ‘main’:
getarch_2nd.c:12:35: error: ‘SGEMM_DEFAULT_UNROLL_M’ undeclared (first use in this function)
printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
^~~~~~~~~~~~~~~~~~~~~~
getarch_2nd.c:12:35: note: each undeclared identifier is reported only once for each function it appears in
getarch_2nd.c:13:35: error: ‘SGEMM_DEFAULT_UNROLL_N’ undeclared (first use in this function)
printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
^~~~~~~~~~~~~~~~~~~~~~
@svaksha
svaksha / pythontojulia.md
Created May 12, 2017 12:27 — forked from cuckookernel/pythontojulia.md
Python to Julia Quick translation / conversion reference Guide

A quick and dirty syntax translation / conversion reference guide to ease the transition between Python and Julia. This is not meant as a reference to the language. For that you should read the manual.

Some important differences

  • Arrays in Julia are indexed starting from 1.
  • In Julia classes (i.e. types) don't own methods. Methods are implementations of generic functions and are invoked in a "static style", i.e. instead of Python's str1.rstrip(), we will have rstrip( str1 ), instead of file1.close(), close( file1 ).

Some important similarities.

@svaksha
svaksha / doi2bibtex.sh
Created August 22, 2017 07:49 — forked from konrad/doi2bibtex.sh
Returns a BibTeX entry for one or more given DOIs.
#!/usr/bin/env bash
# Returns a BibTeX (www.bibtex.org) entry for one or more given DOIs
# (https://www.doi.org/).
#
# Call it like this:
#
# $ doi2bibtex.sh 10.1093/bioinformatics/btu533
#
# Can also be used for several DOIs at once: