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
#!/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="" |
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
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} |
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
# 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 |
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
// 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; |
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 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) { |
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
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) |
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
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? |
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
@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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.