This file contains hidden or 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
.built-in.o.cmd | |
.hello.ko.cmd | |
.hello.mod.o.cmd | |
.hello.o.cmd | |
.tmp_versions/ | |
Module.symvers | |
hello.ko | |
hello.mod.c | |
modules.order |
This file contains hidden or 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
# Coverage targets | |
if HAVE_GCOV | |
.PHONY: clean-gcda | |
clean-gcda: | |
@echo Removing old coverage results | |
-find -name '*.gcda' -print | xargs -r rm | |
.PHONY: coverage-html generate-coverage-html clean-coverage-html |
This file contains hidden or 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 simple brain-fuck interpretor | |
// see http:://en.wikipedia.org/wiki/Brainfuck | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <vector> | |
#define BUFSIZE 30000 | |
class State { |
This file contains hidden or 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
// create an equivalent functor that call the function pointer and print | |
// all input arguments | |
#include <boost/function_types/parameter_types.hpp> | |
#include <boost/function_types/result_type.hpp> | |
#include <boost/mpl/size.hpp> | |
#include <boost/mpl/pop_front.hpp> | |
#include <functional> | |
#include <utility> | |
#include <iostream> |
This file contains hidden or 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 <iostream> | |
#include <string> | |
#include <type_traits> | |
#include <utility> | |
using namespace std; | |
void print(const string& str) { | |
cout << str << endl; | |
} |
This file contains hidden or 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
_ = require("underscore") | |
assert = require('assert') | |
zip = (list) -> _.zip.apply(null, list) | |
sum = (list) -> _.reduce(list, ((memo, v) -> memo + v), 0) | |
mean = (list) -> sum(list) / list.length | |
distances = | |
euclidean : (p,q) ->Math.sqrt(sum _.map(_.zip(p, q), (v)->(v[0]-v[1])**2)) | |
manhattan : (p,q) ->sum(_.map(_.zip(p, q), (v) -> Math.abs(v[0] - v[1]))) | |
cosine : (p, q) -> |
This file contains hidden or 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
var events = require("events"); | |
var net = require("net"); | |
var util = require("util"); | |
function make_line_reader(line_consumer) { | |
var buffer = []; | |
function parser(char) { | |
if (char !== '\n') { | |
buffer.push(char); |
This file contains hidden or 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
// websocket server for evaluating javascript expression remotely | |
var http = require("http"); | |
var assert = require('assert'); | |
var srv = http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('simple websocket server for calculator'); | |
}); |
This file contains hidden or 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 | |
# vim: set fileencoding=utf-8: | |
import sys | |
import numpy | |
import random | |
class Direction: | |
def __str__(self): | |
if self._dir == 0: |
This file contains hidden or 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/ksh | |
typeset port=$((RANDOM % 60000)) | |
while ((port < 30000)); do | |
port=$((RANDOM % 60000)) | |
done | |
typeset pipe=`mktemp -u` | |
mkfifo $pipe | |
trap "rm -f $pipe" INT |