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
--- | |
Node: | |
type: Class | |
Original: | |
type: Role | |
columns: | |
origin: | |
ptype: string | |
index: string | |
tz: |
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
--- | |
Node: | |
type: Class | |
Original: | |
type: Role | |
columns: | |
origin: | |
ptype: string | |
index: string | |
tz: |
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
SELECT | |
nodes.*, | |
links.id AS `link_id`, | |
links.status AS `l_status`, | |
links.comment AS `l_comment`, | |
links.date AS `l_date` | |
FROM | |
idx_contracts AS sc1, /* custom index class */ | |
idx_nodes_ml_strings AS ml1, /* key/value index */ | |
links, /* relations contract ==> contact */ |
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
// Usage: | |
// H("foobar") ===> replaced by uint during compilation | |
// macro hashing function by http://chrissavoie.com/index.php?option=com_content&task=view&id=14&Itemid=1 | |
#define HASH_CONSTANT 5381 | |
// The following is the guts of the compile-time hasher |
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
-- ============ Create new class | |
SpecialEdit = {} | |
setmetatable(SpecialEdit, mimas.LineEdit_mt) | |
-- calling SpecialEdit() should do the following things | |
-- 1. create userdata | |
-- 2. set new table as uservale ---> self | |
-- 3. create new lua thread and install "self" on the stack | |
-- 4. set access to userdata from self ---> self.super = userdata | |
-- 5. set "SpecialEdit" as metatable for "self" ---> setmetatable(self, SpecialEdit) |
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
// g++ simple.cpp -shared -o libsimple.dylib | |
#include <stdio.h> | |
class Simple { | |
int id_; | |
public: | |
Simple(int id); | |
~Simple(); |
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
-- luajit simple_jit.lua | |
ffi = require 'ffi' | |
simple = ffi.load('simple') | |
ffi.cdef[[ | |
typedef struct Simple Simple; | |
Simple *Simple_Simple(int); | |
void Simple__gc(Simple *); |
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
// =========================================================== Return value optimization | |
/** Vect Vect::operator+(const Vect &v) | |
* test/fixtures/pointers/Vect.h:55 | |
*/ | |
static int Vect_operator_add(lua_State *L) { | |
try { | |
Vect *self = *((Vect**)dub_checksdata(L, 1, "Vect")); | |
Vect *v = *((Vect**)dub_checksdata(L, 2, "Vect")); | |
dub_pushudata(L, new Vect(self->operator+(*v)), "Vect"); |
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 'lubyk' | |
-- Box2D bindings are not yet in published but code will look the same | |
-- (18.1.2012) | |
local function makeBody(x, y, r, hue) | |
-- Define the dynamic body. We set its position and call the body factory. | |
local bodyDef = b2.BodyDef() | |
bodyDef.type = b2.dynamicBody | |
bodyDef.position:Set(x, y) |
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 <QtGui/QApplication> | |
#include <QtCore/QTimer> | |
#include <qglobal.h> | |
#include <cstdio> | |
static int app_argc = 0; | |
static char *app_argv[] = {}; | |
static void something() { |