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
#include <stdio.h> | |
int main() { | |
int a[10]; | |
int i; | |
for (i=0; i < 10; i++) { | |
a[i] = i; | |
} |
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
/** | |
* Serialize the Thrift object into a byte array. The process is simple, | |
* just clear the byte array output, write the object into it, and grab the | |
* raw bytes. | |
* | |
* @param base The object to serialize | |
* @return Serialized object in byte[] format | |
*/ | |
public byte[] serialize(TBase base) throws TException { | |
baos_.reset(); |
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 | |
# Script to distribute MATLAB training jobs to multiple nodes in a system and create a screen for each job | |
# some helpers, stolen shamelessly from internet forums | |
rand() { | |
printf $(( $1 * RANDOM / 32767 )) | |
} | |
rand_element () { | |
local -a th=("$@") |
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
# Quick hack - really hacky, untested, and probably breaks a lot | |
require 'rubygems' | |
require 'mechanize' | |
module TumblrScraper | |
class TumblrPost | |
attr_accessor :url, :post_id, :tumblr_id |
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
# make sure all packages and sources are up-to-date | |
sudo apt-get update | |
# update system and kernel files as well | |
sudo apt-get dist-upgrade | |
# install compiler packages | |
sudo apt-get install build-essential | |
# Git |
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 | |
# This script creates a git repository on your local machine and your CDF account and links them together | |
# Set up env | |
REPO_NAME=myproj # or $1 if you want to run this script often | |
CDF_NAME=g1someone | |
SERVER=redwolf.cdf.toronto.edu | |
# Creating the project | |
mkdir $REPO_NAME |
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 python | |
# Script to clone all the github repos that a user is watching | |
import requests | |
import json | |
import subprocess | |
# Grab all the URLs of the watched repo | |
user = 'jharjono' | |
r = requests.get("http://github.com/api/v2/json/repos/watched/%s" % (user)) | |
repos = json.loads(r.content) |
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
puts self.class.constants.inspect |
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
\documentclass{article} | |
% Custom Macros and Packages--------------------------- | |
\input{macros} | |
% Header and Footer------------------------------------ | |
\input{header_footer} | |
\begin{document} |
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 python | |
# List all source video URLs for Pycon 2011 Videos | |
# easy_install bliptv.reader | |
from bliptv.reader import Show | |
def list_episodes_url(page): | |
urls = [] | |
for episode in page.episodes: | |
enclosure = episode.enclosures.get('video/mp4', None) |
NewerOlder