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
local seq = require 'pl.seq' | |
local function bench (n, func, ...) | |
assert (n > 0) | |
assert (type(func) == 'function') | |
local start = os.clock () | |
if n % 2 == 1 then | |
func (...) | |
n = n - 1 |
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
local dump = require 'pl.pretty'.dump | |
local function printboard(board) | |
if not board then return end | |
local n = #board | |
io.stdout:write ("\n", (" -"):rep(n), "\n") | |
for i = 1, n do | |
io.stdout:write "|" | |
for j = 1, n do | |
io.stdout:write(board[j][i] and "Q" or " ", "|") |
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 <vector> | |
using namespace std; | |
#define Describe(unitgroup) \ | |
struct unitgroup; \ | |
register_harness<unitgroup> unitgroup ## _registered; \ | |
struct unitgroup : public testharness<unitgroup> \ |
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
--[[ | |
Simple arithmetic expression parser | |
using LPeg's re module | |
--]] | |
require 'table.clear' -- luajit extension | |
local dprint = dbg and print or function() end | |
local dump = require 'pl.pretty'.dump | |
local re = require 're' | |
re.updatelocale() |
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
LIBRARY MKL_RT.DLL | |
EXPORTS | |
_CAXPBY = CAXPBY | |
_CAXPY = CAXPY | |
_CAXPYI = CAXPYI | |
_CBBCSD = CBBCSD | |
_CBDSQR = CBDSQR | |
_CCOPY = CCOPY | |
_CDOTC = CDOTC |
NewerOlder