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
object.use("net",function(net){ | |
function f(){ | |
new net.Request({ | |
url:"http://www.renren.com/bulletin/lottery",method:"post", | |
onSuccess:function(r){ | |
if (parseInt(r.responseText)==1){alert("终于抢到了。。")} | |
else{console.log("还没...");setTimeout(f,1000)} | |
}, | |
onError:function(){alert("网络错误,请稍后再试")} | |
}).send() |
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 getComments(shareId, ownerId, startCommentId){ | |
var count = 0; | |
function getComment(commentId){ | |
var data = { shareId: shareId, owner: ownerId, commentId: commentId } | |
data.md5 = XN.app.share.CommentManger.getOptions("shareUrlMd5"); | |
var xhr = new XN.net.xmlhttp({ | |
url: "http://share.renren.com/share/comment/moreurlcomment", | |
data: XN.array.toQueryString(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
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#define NUM_OF_KEYWORDS 7 | |
#define BUFFER_SIZE 1000 | |
#define TOKEN_VALUE_SIZE 20 | |
typedef struct Token{ |
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
from config import APP_SECRET, APP_KEY | |
from weibopy.auth import OAuthHandler | |
CALLBACK = "" | |
auth = OAuthHandler(APP_KEY, APP_SECRET, CALLBACK) | |
url = auth.get_authorization_url() | |
print "open this in the browser: " + url | |
code = raw_input("input the code: ") |
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
bɑ bo bɑi bei bɑo bɑn ben bɑnɡ benɡ bi bie biao biɑn bin binɡ bu | |
pɑ po pɑi pei pɑo pou pɑn pen pɑnɡ penɡ pi pie piao piɑn pin pinɡ pu | |
mɑ mo mɑi mei mɑo mou mɑn men mɑnɡ menɡ mi mie miao miu miɑn min minɡ mu | |
fɑ fo me fei fou fɑn fen fɑnɡ fenɡ fu | |
dɑ de dɑi dei dɑo dou dɑn den dɑnɡ denɡ donɡ di dia die diao diu diɑn dinɡ du duo dui duɑn dun | |
tɑ te tɑi tei tɑo tou tɑn tɑnɡ tenɡ tonɡ ti tie tiao tiɑn tinɡ tu tuo tui tuɑn tun | |
nɑ ne nɑi nei nɑo nou nɑn nen nɑnɡ nenɡ nonɡ ni nie niao niu niɑn nin niɑnɡ ninɡ nu nuo nuɑn nü nüe | |
lɑ le lɑi lei lɑo lou lɑn lɑnɡ lenɡ lonɡ li lia lie liao liu liɑn lin liɑnɡ linɡ lu luo luɑn lun lü lüe | |
ɡɑ ɡe ɡɑi ɡei ɡɑo ɡou ɡɑn ɡen ɡɑnɡ ɡenɡ ɡonɡ ɡu ɡuɑ guo ɡuɑi ɡui ɡuɑn ɡun ɡuɑnɡ | |
kɑ ke kɑi kɑo kou kɑn ken kɑnɡ kenɡ konɡ ku kuɑ kuo kuɑi kui kuɑn kun kuɑnɡ |
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" | |
"levenshtein" | |
) | |
func main() { | |
r1 := levenshtein.GetDistance("今天的话", "明天再说") | |
r2 := levenshtein.GetSimilarity("今天天气不错, hello world", "今天天气不错呢, bye bye world") |
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 time | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
class ChangeHandler(FileSystemEventHandler): | |
def on_modified(self, event): | |
print event.event_type, event.src_path | |
if __name__ == "__main__": | |
event_handler = ChangeHandler() |
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
// 在 http://dfss.anjia365.com/jpv2/web/personPlan!player.do 页面,console里输入: | |
setInterval(function() { | |
if ($('#player').css('display') == 'none') { | |
getExamById(examArray.slice(-2)[0]); | |
examCorrectFlag = true; | |
$('#nextPlayButton').click(); | |
} else { | |
showNext(); | |
$('.aui_buttons button').click(); |
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
from flask import Flask | |
app = Flask() | |
@app.route('/') | |
def index(request): | |
return 'Hello World' | |
if __name__ == '__main__': | |
app.run() |
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.font_manager | |
>>> set([f.name for f in matplotlib.font_manager.fontManager.ttflist]) |