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
(function() { | |
if (! jasmine) { | |
throw new Exception("jasmine library does not exist in global namespace!"); | |
} | |
var ConsoleReporter = function() { | |
this.started = false; | |
this.finished = false; | |
}; |
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
{ | |
"root": "/var/chroot/", | |
"source": "http://th.archive.ubuntu.com/ubuntu/", | |
"http-proxy": "http://apt-cacher:3142/", | |
"defaults": {}, | |
"schroot": { | |
"skype": { | |
"release": "lucid", | |
"packages": [ | |
"libasound2", "libqt4-dbus", "libqt4-network", "libqt4-webkit", |
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 | |
import os | |
import subprocess | |
import sys | |
REPO="file:///var/backups/fsl-svn/felspar/" | |
def capture(args): |
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
// Compile as C++14 | |
// clang++ --std=c++14 snake.cpp -O3 -o /tmp/snake && /tmp/snake | |
// http://www.theguardian.com/science/alexs-adventures-in-numberland/2015/may/20/can-you-do-the-maths-puzzle-for-vietnamese-eight-year-olds-that-has-stumped-parents-and-teachers | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
int main() { | |
std::size_t tries = 0, wins = 0; |
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
// Signal handling.... sigh | |
template<typename F> inline | |
int syscall(F f) { | |
int result{}; | |
do { | |
result = f(); | |
} while ( result == -1 && errno == EINTR ); | |
return result; | |
} |
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
#ifdef DEBUG | |
inline void check(const auto &b) { | |
if ( !b ) std::terminate(); | |
} | |
#else | |
inline void check(const auto &) { | |
} | |
#endif | |
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
// Compile with: | |
// clang++ --std=c++14 -O3 -o pi pi.cpp | |
#include <algorithm> | |
#include <cmath> | |
#include <experimental/iterator> | |
#include <iomanip> | |
#include <iostream> | |
#include <iterator> | |
#include <type_traits> |
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
/* | |
* A generator. Initial code taken from N4649 p15 | |
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf | |
*/ | |
#include <experimental/coroutine> | |
#include <iostream> | |
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
/// # Build me a LISP | |
// Read this nicely formatted at https://kirit.com/Build%20me%20a%20LISP | |
/** | |
Normally programming language blog posts get started with grammars and syntax | |
and parsing and all sorts of stuff like that. I can't be bothered with all of | |
that, so instead, let's start with the (maybe more interesting aspect) of the | |
actual evaluation of the code. Here we'll build an evaluation engine for LISP | |
like languages in less than 50 lines of C++ -- [and literate C++ at |
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
/** | |
# Look for 32 byte collisions from urandom. | |
Compile with: | |
``` | |
clang++ urandom.cpp -std=c++17 -O3 -o urandom -Werror | |
``` | |
*/ |
OlderNewer