This file contains 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
if length(ARGS) != 1 | |
error("Output file name not provided!") | |
end | |
ofile = ARGS[1] | |
println("Writing the plot to: $ofile") | |
using Gadfly | |
M,N = 22,30 | |
matrix = zeros(Float64, (M,N)) | |
for i=1:M, j=1:N |
This file contains 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 | |
echo "Working directory:" `pwd` | |
date | |
echo | |
echo "SLURM variables" | |
# For a full list, see http://slurm.schedmd.com/sbatch.html | |
echo SLURM_JOB_ID=${SLURM_JOB_ID} | |
echo SLURM_JOB_NAME=${SLURM_JOB_NAME} | |
echo SLURM_JOB_NODELIST=${SLURM_JOB_NODELIST} |
This file contains 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
@define-color light-aubergine #BBBBBB; | |
@define-color super-light-aubergine #EDEDED; | |
/* | |
do not use text-shadow until bugzilla.gnome.org bug #686209 is | |
fixed - its leaking memory | |
*/ | |
#featured-star { |
This file contains 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 Base: gc_bytes, gc_time_ns, time_print | |
function lm_1_10(x1, x10) | |
A = (x10-x1)/9 | |
B = (10*x1-x10)/9 | |
A,B | |
end | |
macro time_N(N, ex) | |
quote |
This file contains 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
# Gets the Nth bit of m | |
function bit(N, m) | |
m & (1<<(N-1)) >> (N-1) | |
end | |
@show [bit(n,0) for n=1:5] | |
@show [bit(n,1) for n=1:5] | |
@show [bit(n,2) for n=1:5] | |
@show [bit(n,3) for n=1:5] | |
@show [bit(n,5) for n=1:5] |
This file contains 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
# ComposeHacks module | |
# | |
# This module is a collection of hacks to make working with Compose and Gadfly | |
# more convenient (in Julia). | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2015 Morten Piibeleht | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
This file contains 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
module NoninteractiveGadfly | |
import Compose | |
import Compose: writemime | |
import Gadfly | |
export @noninteractive | |
type NoninteractivePlot | |
p::Gadfly.Plot | |
end |
This file contains 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
#!/usr/bin/env python3 | |
import argparse | |
import os | |
import os.path | |
import re | |
import sqlite3 | |
def yumdb_packages(path): | |
dirs = os.listdir(path) | |
dirs.sort() |
This file contains 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
// Create a vector of evenly spaced numbers. | |
vector<double> range(double min, double max, size_t N) { | |
vector<double> range; | |
double delta = (max-min)/double(N-1); | |
for(int i=0; i<N; i++) { | |
range.push_back(min + i*delta); | |
} | |
return range; | |
} |
This file contains 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
#!/usr/bin/env python3 | |
import itertools | |
def powerset(iterable): | |
xs = list(iterable) | |
return itertools.chain.from_iterable( | |
itertools.combinations(xs,n) for n in range(len(xs)+1) | |
) | |
samples = [ |