Skip to content

Instantly share code, notes, and snippets.

@truncs
truncs / parallel_prog.cpp
Created March 14, 2012 23:25
Parallel Programming
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
int n;
@truncs
truncs / heap.cpp
Created February 12, 2012 20:54
Heap in C++
#include <iostream>
#include <vector>
using namespace std;
template <class T>
class Heap {
vector<T> list;
void bubbleUp();
@truncs
truncs / trie.py
Created January 29, 2012 20:20
Simple Trie in python
#! /usr/bin/python
import unittest
class Trie(object):
""" Trie implementation in python
"""
def __init__(self, ):
""" So we use a dictionary at each level to represent a level in the hashmap
#! /usr/bin/python
def merge(a, size):
for i in range(0, len(a), size):
tmp = a[i:size + i];print tmp;
newtmp = []
for j in range(0, len(tmp)):
newtmp.append(tmp.pop(tmp.index(min(tmp))))
print newtmp
a[i:size + i] = newtmp
@truncs
truncs / gist:1442642
Created December 7, 2011 12:35
Mallet MaxEnt
bin/mallet import-dir --input /opt/data/* --output ~/obama.mallet
bin/mallet train-classifier --input ~/media_elections.mallet --trainer MaxEnt --output-classifier ~/media_elections.classifier --training-portion 0.9
bin/mallet classify-dir --input /opt/data --output - --classifier ~/obama.classifier
#!/bin/sh
feh --bg-scale /home/prudhvi/Downloads/wallpaper.jpg
while true; do
xsetroot -name "`date '+%a %Y-%m-%d %H:%M:%S'`"
sleep 1
done &
exec /usr/bin/dwm