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 <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <event.h> | |
#define BUFSIZE 256 | |
#define TIMEOUT_SEC 3 | |
void read_handler(int fd, short event, void *arg) | |
{ |
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
/* | |
* filename: SetConsoleCtrlHandler.c | |
* description: | |
* This is a example of the SetConsoleCtrlHandler function that is used to | |
* install a control handler. | |
* via http://msdn.microsoft.com/en-us/library/ms685049(v=VS.85).aspx | |
* author: uhziel([email protected]) | |
* history: | |
* version date ps | |
* ------- ---------- -------------------------------- |
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
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
m := make(map[string]int) | |
a := strings.Fields(s) |
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
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
// Allocate two-dimensioanl array. | |
a := make([][]uint8, dy) | |
for i := 0; i < dy; i++ { | |
a[i] = make([]uint8, dx) | |
} |
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 <stdio.h> | |
#include <sqlite3.h> | |
int main(void) | |
{ | |
sqlite3 *db; | |
sqlite3_stmt *stmt; | |
sqlite3_open("expenses.db", &db); |
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
import matplotlib.pyplot as plt | |
def zoom_factory(ax,base_scale = 2.): | |
def zoom_fun(event): | |
# get the current x and y limits | |
cur_xlim = ax.get_xlim() | |
cur_ylim = ax.get_ylim() | |
# set the range | |
cur_xrange = (cur_xlim[1] - cur_xlim[0])*.5 |
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
package main | |
import ( | |
"fmt" | |
"labix.org/v2/mgo" | |
"labix.org/v2/mgo/bson" | |
"time" | |
) | |
type Person struct { |
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/bash | |
GCC_VERSION="5.2.0" | |
WORKDIR="$HOME/src/" | |
INSTALLDIR="/platform" | |
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools. | |
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files. | |
# xcode-select --install |
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
import urllib | |
from wordpress_xmlrpc import Client, WordPressPost | |
from wordpress_xmlrpc.methods import posts | |
import xmlrpclib | |
from wordpress_xmlrpc.compat import xmlrpc_client | |
from wordpress_xmlrpc.methods import media, posts | |
import os | |
########################### Read Me First ############################### | |
''' | |
------------------------------------------In DETAIL-------------------------------- |
OlderNewer