Skip to content

Instantly share code, notes, and snippets.

View bholt's full-sized avatar

Brandon Holt bholt

View GitHub Profile
@bholt
bholt / gist:2866689
Created June 4, 2012 06:34
Made up graph traversal
while (end[phase_num] - start[phase_num]) {
#pragma omp parallel for
for v in vertices {
for e in v.edges {
v.edges.endVertex.color(1)
path_length[v] += v.edges.weight
}
}
}
#define range(a,s,e) __attribute__(range(a,s,e))
int * global vlist, xoff, xadj, bfs_tree;
void bfs_simpler() {
#pragma cache vlist
for (int& k : vlist.cache(start, end)) {
int v = vlist[k];
int vstart = xoff[2*v];
#!/usr/bin/env ruby
require "experiments"
require "pry"
class Experiments
attr_accessor :defaults
def initialize(params)
@id = 0
import sun.util.logging.*;
public class test {
public void main(String[] args) {
PlatformLogger l;
}
}
; ModuleID = 'hello.cpp'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.8.0"
@.str = private unnamed_addr constant [7 x i8] c"global\00", section "llvm.metadata"
@.str1 = private unnamed_addr constant [10 x i8] c"hello.cpp\00", section "llvm.metadata"
define i32 @main(i32 %argc, i8** %argv) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
//
// main.c
// AppSuite
//
// Created by Brandon Holt on 12/13/11.
// Copyright 2011 University of Washington. All rights reserved.
//
#if HAVE_UNISTD_H
#include <unistd.h>
#else
@bholt
bholt / viz.rb
Created November 16, 2012 20:31
#!/usr/bin/env ruby
require "rubyvis"
vis = Rubyvis::Panel.new do
width 150
height 150
bar do
data [1, 1.2, 1.7, 1.5, 0.7, 0.3]
width 20
height {|d| d * 80}
#!/bin/bash
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
source ~/grappa/system/grappa_gdb.macros
# blue (gdb) prompt
set prompt \033[0;34m(gdb)\033[0m
shell mkfifo /tmp/bholt_gdb_color_pipe
define hook-backtrace
shell cat /tmp/bholt_gdb_color_pipe | sed -e 's/\(^#[0-9]*.*in \|^#[0-9]*\) \(.*\) \((.*)\)/\1 '$(echo -e '\033[0;33m')'\2 '$(echo -e '\033[0;36m')'\3'$(echo -e '\033[0m')'/' | sed -e 's/\/sampa\/home\/bholt\(\/.*:[0-9]*\)/'$(echo -e '\033[0;32m')'~\1'$(echo -e '\033[0m')'/' &
set logging redirect on
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSWorkspace</key>
<key>SystemConfiguration</key>
<dict>
<key>State:/Network/Global/IPv4</key>
<dict>
<key>command</key>