Skip to content

Instantly share code, notes, and snippets.

View AndrewTsao's full-sized avatar
🎯
Focusing

andi AndrewTsao

🎯
Focusing
  • SHANGHAI, Boshen,CN
  • PUDONG, SHANGHAI, CN
View GitHub Profile
@AndrewTsao
AndrewTsao / lua_mem_usage.c
Created January 1, 2013 07:45
Measuring lua vm memory usage
#include <stdio.h>
#include <stdlib.h>
#include "lua5.1/lua.h"
#include "lua5.1/lauxlib.h"
#include "lua5.1/lualib.h"
// Measuring lua vm memory usage.
// build: gcc main.c -llua5.1 -lm -ldl -fPIC
static size_t mem_used = 0;
@AndrewTsao
AndrewTsao / hello2013.cc
Created December 31, 2012 13:25
Learn CompoundExpression in supersonic.
static void LearnCompoundExpression() {
scoped_ptr<CompoundExpression> tuple(new CompoundExpression());
tuple->AddAs("from", ConstString("Supersonic: "));
tuple->AddAs("say",
If(Less(ConstInt32(28), ConstInt32(29)),
ConstString("Hello"),
ConstString("World")));
tuple->AddAs("comma", ConstString(","));
tuple->AddAs("new", Plus(ConstInt32(2012), ConstInt32(1)));
scoped_ptr<Operation> compute(Compute(tuple.release(), Generate(10)));
@AndrewTsao
AndrewTsao / Makefile
Created December 9, 2012 01:56
测试Lua table中以lightuserdata和string作key的性能
all:
gcc -O2 -fpic -c -o symbol.o symbol.c
gcc -O -shared -fpic -o symbol.so symbol.o
@AndrewTsao
AndrewTsao / buildit.bat
Created July 20, 2012 15:06 — forked from adam-singer/buildit.bat
Building dart on win32, the quick guide
cd c:\
mkdir dart_bleeding
svn co http://gyp.googlecode.com/svn/trunk build/gyp
mkdir dart-repo
set Path=%PATH%;c:\dart_bleeding\build\gyp\
git svn clone -rHEAD "https://dart.googlecode.com/svn/branches/bleeding_edge/dart" dart
gclient config "https://dart.googlecode.com/svn/branches/bleeding_edge/deps/all.deps"
cd dart
gclient sync
gclient runhooks