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
#include <iostream> | |
#define B(l,a) __##l##E##__ | |
#define _O_ ((1<<2>>1<<1)-2) | |
#define _h_ 7-3 | |
#define _C_ (7/_h_) | |
#define _r_ ((1<<0)+0x00a/2+_C_) | |
#define _a_ ((1<<5)-_r_) | |
#define _p_ { void _(){} namespace | |
#define printf(_0_) squeak(_O_,B(LIN,!)-_a_); _ | |
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
local insp={} | |
assert( type(insp)=="table" ) | |
function InspectValue(value,history,indent,inside) | |
res="" | |
for vkey,vvalue in pairs(value) do | |
local vvtype=type(vvalue) | |
res=res..(string.rep(" ",indent)..tostring(vkey).." ["..tostring(vvalue).."]").."\n" | |
if not history[vvalue] then |
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
//original post: http://slackito.com/2011/03/17/automatic-memoization-in-cplusplus0x/ | |
//a BOOST way of doing it: http://www.boost.org/doc/libs/1_49_0/libs/flyweight/example/fibonacci.cpp | |
#include <iostream> | |
#include <functional> | |
#include <map> | |
#include <time.h> | |
//maahcros | |
#define TIME(__x) init=clock(); __x; final=clock()-init; std::cout << "time:"<<(double)final / ((double)CLOCKS_PER_SEC)<<std::endl; |
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
#include <iostream> | |
#define B(l,a) __##l##E##__ | |
#define _O_ ((1<<2>>1<<1)-2) | |
#define _h_ 7-3 | |
#define _C_ (7/_h_) | |
#define _r_ ((1<<0)+0x00a/2+_C_) | |
#define _a_ ((1<<5)-_r_) | |
#define _p_ { void _(){} namespace | |
#define printf(_0_) squeak(_O_,B(LIN,!)-_a_); _ | |
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
require('pugilua') | |
local doc=pugi.xml_document() | |
local res=doc:load_file [[..\pugilua.vcproj]] | |
print('Parsed: '..res.description) | |
assert(res.valid) | |
local text='{\n' | |
local query1=doc:root():select_nodes('/VisualStudioProject/Files/Filter/File | /VisualStudioProject/Files/File') | |
local n=query1.size |
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
require('pugilua') | |
local doc=pugi.xml_document() | |
local res=doc:load_file [[..\pugilua.vcxproj]] | |
print('Parsed: '..res.description) | |
assert(res.valid) | |
local text='{\n' | |
local query1=doc:root():select_nodes('/Project/ItemGroup/ClCompile | /Project/ItemGroup/ClInclude') | |
local n=query1.size |
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
1>------ Build started: Project: pugilua, Configuration: Release Win32 ------ | |
1> pugilua.cpp | |
1> pugilua_lib.cpp | |
1>..\..\..\LuaBridge\LuaBridge.h(1505): error C2953: 'luabridge::FuncTraits<R(__cdecl *)(void),D>' : class template has already been defined | |
1> ..\..\..\LuaBridge\LuaBridge.h(1082) : see declaration of 'luabridge::FuncTraits<R(__cdecl *)(void),D>' | |
1>..\..\..\LuaBridge\LuaBridge.h(1518): error C2953: 'luabridge::FuncTraits<R(__cdecl *)(P1),D>' : class template has already been defined | |
1> ..\..\..\LuaBridge\LuaBridge.h(1095) : see declaration of 'luabridge::FuncTraits<R(__cdecl *)(P1),D>' | |
1>..\..\..\LuaBridge\LuaBridge.h(1531): error C2953: 'luabridge::FuncTraits<R(__cdecl *)(P1,P2),D>' : class template has already been defined | |
1> ..\..\..\LuaBridge\LuaBridge.h(1108) : see declaration of 'luabridge::FuncTraits<R(__cdecl *)(P1,P2),D>' | |
1>..\..\..\LuaBridge\LuaBridge.h(1544): error C2953: 'luabridge::FuncTraits<R(__cdecl *)(P1,P2,P3),D>' : class template has already been defi |
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
local dir=assert(require 'pl.dir') | |
local path=assert(require 'pl.path') | |
assert(require('pugilua')) | |
local function getsourcefiles(dir,d) | |
local text='{\n' | |
------------------------ | |
local query1=d:root():select_nodes('/VisualStudioProject/Files/Filter/File | /VisualStudioProject/Files/File') | |
local n=query1.size | |
for i=0,n-1 do |
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
using System; | |
using System.Reactive.Concurrency; | |
using System.Reactive.Linq; | |
namespace rxtest | |
{ | |
class FrequencyMeter | |
{ | |
Random rand = new Random(); | |
public int Hz |
OlderNewer