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 img | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/go-sql-driver/mysql" | |
"io" | |
"log" | |
"net/http" | |
"os" |
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 ( | |
"container/list" | |
"crypto/md5" | |
// "errors" | |
"flag" | |
"fmt" | |
"io" | |
"os" |
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
var AI = AI||{}; | |
AI.historyTable = {}; //历史表 | |
//人工智能初始化 | |
AI.init = function(pace){ | |
var bill = AI.historyBill || com.gambit; //开局库 | |
if (bill.length){ | |
var len=pace.length; |
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 | |
ARGS=1 | |
E_BADARGS=65 | |
TEM_FILE="/tmp/dict.tmp" | |
if [ $# -ne "$ARGS" ] | |
then | |
echo "Usage:`basename $0` word" | |
exit $E_BADARGS | |
fi |
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> | |
typedef struct Node{ | |
int data; | |
int bf; | |
struct Node *lchild; | |
struct Node *rchild; | |
}Node; | |
#define LH 1 |
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
/*------------------------------------------------------------------------------ | |
程序名:sweep_mine.c | |
程序功能:在Linux终端通过输入每个小格子的坐标和flag来模拟Window平台自带的扫雷小游戏 | |
作者:张峰 [mailto:[email protected]] | |
修改日期:2013-12-6 | |
------------------------------------------------------------------------------*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.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
# -*- encodeing:utf-8 -*- | |
from wsgiref.simple_server import make_server | |
def simple_app(environ, start_response): | |
status = '200 OK' | |
response_headers = [('Content-type', 'text/plain')] | |
start_response(status, response_headers) | |
return [u"This is hello wsgi app".encode('utf8')] |
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
/* | |
有时候在使用javascript的时候需要格式化一些输出,比如AJAx回来的JSON数据格式化成HTML片段的时候,使用简单的字符串拼接都闲得比较麻烦,当然有的时候可以使用一些JS模板引擎但是又觉得不合适,可能代码里就只用到了几处这样的功能却引入及时KB的JS库,有些不划算。这里给出一个只要12行代码就可以实现的模板引擎。功能很简单只是替换变量。但是对于一般的需求应该是够用了。 | |
*/ | |
;(function (window) { | |
function Template(str) { | |
this.str = str; | |
} | |
Template.prototype.format = function () { | |
var arg = arguments[0] instanceof Array ? arguments[0] : arguments; |
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
a[href$=".pdf"] { | |
background: url(../img/pdf_icon_16x16.png) no-repeat; | |
padding-left: 20px; | |
} | |
...or if you don't want to use an icon, but do want to let your users know you're linking to a file: | |
a[href$=".pdf"]:after { | |
content: " (PDF)" | |
} |
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 python | |
# -*- coding: utf-8 -*- | |
import datetime | |
import httplib | |
import json | |
import time | |
import urllib2 | |
def urlopen(url): |
NewerOlder