Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -xe
# Run this script from machine with the credintials and the latest api tools installed
EBS_DEVICE='/dev/sdh'
INSTANCE_ID=$1
AKI=${2:-'aki-5f15f636'}
ARI=${3:-'ari-0915f660'}
ARCH=${4:-'i386'}
SIZE=${5:-10}
set[:foo] = [{},{}]
foo.each do |foo|
foo[:name] = 3
end
@krisr
krisr / gist:884124
Created March 23, 2011 22:02
git branches - lists local and remote branches sorted by date
#!/usr/bin/env bash
#
# Prints local branches and remote branches prefixed with your git email
# username sorted by date.
set -o errexit
set -o nounset
USER_NAME=`git config user.email | sed s:\@.*::`
TAN="\033[33m"
NO_COLOR="\033[0m"
float radicalInverse_VdC(uint bits) {
bits = (bits << 16u) | (bits >> 16u);
bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
return float(bits) * 2.3283064365386963e-10; // / 0x100000000
}
vec2 Hammersley(uint i, uint N) {
uint w = m_image.width();
uint h = m_image.height();
uint m = m_image.size();
const Scalar de = 1.0/gamma;
const Scalar dc = -4.0/gamma + 1.0;
printf("w h %i %i\n", w, h);
using Matrix = Eigen::SparseMatrix<Scalar>;
Matrix A(m, m);
Eigen::VectorXd b(m);