Skip to content

Instantly share code, notes, and snippets.

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

svaksha ॥ स्वक्ष ॥ svaksha

💭
zzZen()
View GitHub Profile
@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}
@rossant
rossant / hdf5.md
Created October 9, 2015 08:49
Problems with HDF5

Problems with HDF5

  • Corruption: not sure why, sometimes files get corrupted during a session and users lose all their work, either automatic or manual, which may correspond to days of computer time or, worse, human time. Corruption is more likely to happen because libhdf5 is a very complex piece of software, and a crash or sudden kill is likely to corrupt the file completely. This would be much rarer with flat binary or text files, at least you'd be able to recover part of the data.

  • Not possible to delete arrays, but that might be fixed in the future (not today though...).

  • Various bugs with strings on Windows and h5py: users may need to downgrade h5py in order to use their files, otherwise a nasty segfault occurs. Not a good sign...

  • There is a single implementation of HDF5 in the world, so we depend critically on it. It is almost impossible to contribute on such a complex piece of code since it is really low-level (in C). There are bugs and performance issues with it and there is nothing we can

@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 / mapping.jl
Last active August 29, 2015 14:18 — forked from rofinn/mapping.jl
@doc doc"""
Takes a 2d array where each column is a pattern which maps to a row in
the resulting dataframe. Each pattern index is its own column in
the dataframe.
""" ->
function DataFrame(data::Array{Float64, 2})
m = data'
result = DataFrame()
for i in 1:size(data, 1)
@rofinn
rofinn / mapping.jl
Created April 7, 2015 23:19
Julialang DataFrame & Matrix mappings
@doc doc"""
Takes a 2d array where each column is a pattern which maps to a row in
the resulting dataframe. Each pattern index is its own column in
the dataframe.
""" ->
function DataFrame(data::Array{Float64, 2})
m = data'
result = DataFrame()
for i in 1:size(data, 1)
# vim: set ft=python :
from __future__ import print_function
import json
import sys
import datetime
from redis import StrictRedis as Redis
@lbenet
lbenet / PendulumIntegration.ipynb
Created June 19, 2014 20:17
A IJulia notebook showing Taylor's method integration of the pendulum
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiahao
jiahao / juliacontribmontage.jl
Last active October 14, 2020 05:55
Creates a photo montage of Julia contributors using ImageMagick
#Working version
using JSON
auth_token= #fill in to access Github API
function getcontribs(owner, repo, auth_token)
#Download information about contributors
page, authors=0, {}
while true #Download every page
page += 1
url="https://api.github.com/repos/$owner/$repo/contributors?page=$(page)&access_token=$(auth_token)"
#Python/pypy
import math
def smallestdivisall(n):
for i in xrange(1, math.factorial(n)+1):
for j in xrange(1, n+1):
if i % j != 0:
break
elif j == n:
return i
@ivandrofly
ivandrofly / Unicode table
Created May 4, 2014 02:20
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character: