python3 setup.py build
Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2) | |
PROJECT(msgpack_test) | |
SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++11") | |
SET(EXECUTABLES test_vector test_stream test_class test_array test_map1 test_map2) | |
FOREACH(EXE ${EXECUTABLES}) | |
ADD_EXECUTABLE(${EXE} "${EXE}.cpp") | |
TARGET_LINK_LIBRARIES(${EXE} msgpack) |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2) | |
PROJECT(hello) | |
SET(PROJECT_ROOT_PATH "${CMAKE_SOURCE_DIR}") | |
SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin") | |
SET(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib") | |
ADD_EXECUTABLE(hello hello.cpp) |
import pdb | |
import cgi | |
import dis | |
import time | |
import struct | |
import marshal | |
def dump_code_object(code, ident=0): | |
print '%s<code_object>' % (' '*ident,) | |
ident += 2 |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pcap/pcap.h> | |
/* callback function when packet have captured */ | |
static void mycb(u_char *user, | |
const struct pcap_pkthdr *h, const u_char *packet) | |
{ | |
static int count = 1; | |
printf("Packet %d:\n", count); |
/* tcp_keepalive.c | |
* | |
* References: | |
* http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html | |
* http://www.tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
#!/bin/bash | |
osascript -e 'tell application "Google Chrome"' -e 'set bounds of front window to {1, 1, 1280, 640}' -e 'end tell' |
-- $ lua hash2array.lua | |
-- print a table that contains numbers and strings only | |
local f_log_hash = function(hash, name) | |
if name ~= nil then | |
print(name .. ':') | |
end | |
for k, v in pairs(hash) do | |
print(k, ' => ', v) | |
end |
// Basic usage example of SJCL. | |
// Tested on firefox 20.0 and nodejs 0.8. | |
// Refer to: http://crypto.stanford.edu/sjcl/ | |
var sjcl = require("./sjcl"); | |
var plaintext = "大丈夫だ、問題ない"; | |
var encrypted = sjcl.encrypt("password", plaintext); | |
console.log(encrypted); | |
var decrypted = sjcl.decrypt("password", encrypted); | |
console.log(plaintext == decrypted); |