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 <sys/wait.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
pid_t pid; | |
if ((pid = fork()) < 0) |
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: 2048.lua | |
# Desc: lua console 2048 | |
# Author: hanxi | |
# Email: hanxi.info@gmail.com | |
# HomePage: http://www.hanxi.info | |
# Version: 0.0.1 | |
# LastChange: 2014-04-28 11:05:09 | |
# History: | |
=============================================================================]] |
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
local rawnext = next | |
function next(t,k) | |
local m = getmetatable(t) | |
local n = m and m.__next or rawnext | |
return n(t,k) | |
end | |
function pairs(t) return next, t, nil end | |
function readonly(t) | |
local proxy = {} |
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 TABLE `ScoreRank` ( | |
`Name` varbinary(64) NOT NULL, | |
`Score` int(11) DEFAULT NULL, | |
`Level` int(11) NOT NULL DEFAULT '1', | |
PRIMARY KEY (`Name`,`Level`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
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
-- bare-bones luac in Lua | |
-- usage: lua luac.lua file.lua file.out | |
local out=arg[1]..".out" | |
if arg[2]~=nil then out=arg[2] end | |
f=assert(io.open(out,"wb")) | |
assert(f:write(string.dump(assert(loadfile(arg[1]))))) | |
assert(f:close()) |
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
local tostring = tostring | |
local tonumber = tonumber | |
local ssub = string.sub | |
local sformat = string.format | |
local tconcat = table.concat | |
local tinsert = table.insert | |
local si={1,2,3,4,5,6,7,8,9} | |
function printsi(si) | |
print(tconcat(si)) |
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 <string.h> | |
#include <stdlib.h> | |
struct sslice { | |
const char *ptr; | |
size_t sz; | |
}; | |
int |
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
function split(str,sep) | |
local array = {} | |
local reg = string.format("([^%s]+)",sep) | |
local tinsert = table.insert | |
for mem in string.gmatch(str,reg) do | |
tinsert(array, mem) | |
end | |
return array | |
end | |
local s = "one;two;;four" |
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
/* J. David's webserver */ | |
/* This is a simple webserver. | |
* Created November 1999 by J. David Blackstone. | |
* CSE 4344 (Network concepts), Prof. Zeigler | |
* University of Texas at Arlington | |
*/ | |
/* This program compiles for Sparc Solaris 2.6. | |
* To compile for Linux: | |
* 1) Comment out the #include <pthread.h> line. | |
* 2) Comment out the line that defines the variable newthread. |
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
set nocompatible | |
filetype off | |
"{{ 插件安装 | |
"git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
"PluginInstall | |
"set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' |
OlderNewer