Skip to content

Instantly share code, notes, and snippets.

@vaz
vaz / vaz-sorting.cpp
Created October 18, 2012 05:24
Timed trials of selection, merge and quick sort.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
typedef void (*sorting_fun)(int[], int);
@vaz
vaz / js-function-declarations.js
Created October 16, 2012 21:55
Javascript function declaration tutorial
> // There are two different ways to define functions in javascript.
> // Functions can be named, or anonymous.
> // The named function syntax looks more like a C- or Java-style "statement":
> function f(){ }
undefined
> // Notice it evaluates to "undefined". I'll come back to this in a sec.
> // The named function syntax binds the function to a local variable with the given name.
> f
[Function: f]
> // It also actually names the function object: