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> | |
using namespace std; | |
int main(){ | |
int i,j; | |
i = 3; | |
j = 5; | |
// compiled with g++ |
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 <ostream> | |
#include <array> | |
#include <mutex> | |
#include <condition_variable> | |
#define DEBUG_PRINT | |
#ifdef DEBUG_PRINT | |
#include <iostream> | |
#endif |
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 <cassert> | |
#include <iostream> | |
#include <functional> | |
std::function<int (int)> make_g(int x) | |
{ | |
std::cout << "Stack var: " << &x << std::endl; | |
return [x] (int y) { | |
std::cout << "Lambda var: " << &x << std::endl; | |
return 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 <iostream> | |
#include <boost/preprocessor.hpp> | |
#define VALUED_ENUM(unused, index, seq) \ | |
BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_ELEM(index, seq)) \ | |
= BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_ELEM(index, seq)) | |
#define INSERT_TUPLE_HEAD(s, state, elem) \ | |
BOOST_PP_SEQ_PUSH_BACK(state, \ | |
BOOST_PP_TUPLE_ELEM(2, 0, elem)) |
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
#!/bin/sh | |
#version 1.0 | |
#CPU=corei7 | |
CPU=core2 | |
./configure\ | |
--prefix=${HOME}/local\ | |
--enable-shared\ | |
--enable-gpl\ | |
--enable-version3\ |
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
#!/usr/bin/env python3 | |
""" | |
ZSH history convert script. | |
When you mistakenly type your password or quite bad command into ZSH, | |
you may want to remove the entry from the history. | |
The problem is, the .zsh_history is encoded in a weird format! | |
If you want to find a command with non-ASCII character, it'll be problematic. |
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
#!/usr/bin/python | |
import argparse | |
import sys | |
import math | |
import operator | |
import itertools | |
import Image, ImageDraw | |
# http://stackoverflow.com/questions/14423794/equivalent-of-haskell-scanl-in-python |
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
#define _FILE_OFFSET_BITS 64 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#ifndef SEEK_DATA |
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
#define _FILE_OFFSET_BITS 64 | |
#include <vector> | |
#include <fstream> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cassert> | |
#include <cstring> | |
#include <sys/types.h> |
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
#!/usr/bin/python | |
import os | |
import os.path | |
import sys | |
import Image | |
class ImageFile(object): |
OlderNewer