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
int sqlite3_create_function_v2( | |
sqlite3 *db, // db connection | |
const char *zFunctionName, // function name | |
int nArg, // number of argument this function takes. -1 for arbitrary numbers | |
int eTextRep, // text encoding, e.g. SQLITE_UTF8 or SQLITE_ANY | |
void *pApp, // pinter to function context | |
void (*xFunc)(sqlite3_context*,int,sqlite3_value**), // a scalar function implementation | |
void (*xStep)(sqlite3_context*,int,sqlite3_value**), // a aggregate function implementation | |
void (*xFinal)(sqlite3_context*), // the same pointer with previous one | |
void(*xDestroy)(void*) // destroy function context |
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
#define FUSE_USE_VERSION 26 | |
#include <fuse.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include "glue.hpp" | |
struct hello_fs |
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 <CoreServices/CoreServices.h> | |
#include <iostream> | |
void callback( | |
ConstFSEventStreamRef stream, | |
void *callbackInfo, | |
size_t numEvents, | |
void *evPaths, | |
const FSEventStreamEventFlags evFlags[], | |
const FSEventStreamEventId evIds[]) |
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 "impl.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
struct obj_impl | |
{ | |
int a; | |
}; |
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
function sortable(table_dom, column_types, default_ordering) { | |
var rows = $(table_dom).find('tbody tr') | |
var dataset = []; | |
for (var i = 0; i < rows.length; ++i) { | |
var vals = $(rows[i]).find('td').toArray().map(function(v){ | |
// console.log(arguments); | |
return v.innerText; | |
}); | |
dataset.push(vals); |
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
import json | |
import requests | |
import functools | |
""" | |
Example: | |
cli = jsonrpc('http://rpcserver.com:6666') | |
try: | |
resp = cli.echo(hello='world') |
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> | |
using namespace std; | |
uint32_t to_unicode(size_t *bytes, char const *utf8) | |
{ | |
if (!utf8 || !*utf8) { | |
*bytes = 0; | |
return 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
#include <vector> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
struct obs { | |
obs() : m_mv(0), m_cp(0) { m_regs.insert(this); } | |
obs(obs const &cp) { m_regs.insert(this); m_cp++; m_total_cp++;} | |
obs(obs &&mv) { m_regs.insert(this); m_mv++; m_total_mv++;} |
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
struct profiler { | |
profiler() : m_start{chrono::high_resolution_clock::now()} { | |
} | |
size_t til_now() const { | |
return chrono::duration_cast<chrono::milliseconds>( | |
chrono::high_resolution_clock::now() - m_start).count(); | |
} | |
chrono::high_resolution_clock::time_point m_start; |
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 <list> | |
#include <unordered_map> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
template<typename T> | |
struct lru { |