Skip to content

Instantly share code, notes, and snippets.

@vivithemage
vivithemage / boost_list_directory.cpp
Created March 12, 2014 22:18
list all files in directory with boost
#include <iostream>
#include "boost/filesystem.hpp"
using namespace std;
using namespace boost::filesystem;
int main(int argc, char *argv[])
{
// list all files in current directory.
//You could put any file path in here, e.g. "/home/me/mwah" to list that directory
@iizukak
iizukak / gram_schmidt.py
Created October 14, 2011 18:18
Gram-Schmidt Orthogonization using Numpy
import numpy as np
def gs_cofficient(v1, v2):
return np.dot(v2, v1) / np.dot(v1, v1)
def multiply(cofficient, v):
return map((lambda x : x * cofficient), v)
def proj(v1, v2):
return multiply(gs_cofficient(v1, v2) , v1)
@beniwohli
beniwohli / greek_alphabet.py
Created January 4, 2011 19:29
A Python dictionary mapping the Unicode codes of the greek alphabet to their names
greek_alphabet = {
u'\u0391': 'Alpha',
u'\u0392': 'Beta',
u'\u0393': 'Gamma',
u'\u0394': 'Delta',
u'\u0395': 'Epsilon',
u'\u0396': 'Zeta',
u'\u0397': 'Eta',
u'\u0398': 'Theta',
u'\u0399': 'Iota',