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<她有一定自己主见> | |
#include<她不是绿茶裱> | |
void main(){ | |
if(你跟她很熟 ) | |
{ | |
直接指出她随身的物件A 比如衣服 鞋子 配饰 手表 包等 很丑 很难看 很low; | |
if(她第二天还是照常穿A &&持续一段时间没有发生对A使用频率的改变) | |
reslut=‘你是朋友’; | |
else | |
result=‘你可能是她喜欢的人’; |
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 simple echo server using epoll in linux | |
// | |
// 2009-11-05 | |
// 2013-03-22:修改了几个问题,1是/n格式问题,2是去掉了原代码不小心加上的ET模式; | |
// 本来只是简单的示意程序,决定还是加上 recv/send时的buffer偏移 | |
// by sparkling | |
// | |
#include <sys/socket.h> | |
#include <sys/epoll.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
function htmlDecode(input){ | |
var e = document.createElement('div'); | |
e.innerHTML = input; | |
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; | |
} | |
htmlDecode("<img src='myimage.jpg'>"); | |
// returns "<img src='myimage.jpg'>" |
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
<script type="application/json" id="init_data_obj"> | |
{{xhtml_escape(json.dumps(data))}} | |
</script> | |
<script> | |
function htmlDecode(input){ | |
var e = document.createElement('div'); | |
e.innerHTML = input; | |
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; | |
} | |
var _jsonText = document.getElementById('init_data_obj').innerText; |
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
{ | |
"province": [ | |
{ | |
"code": 110000, | |
"name": "北京市", | |
"py": "beijingshi" | |
}, | |
{ | |
"code": 120000, | |
"name": "天津市", |
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
jQuery.postJSON = function(url, args, successCall, errorCall){ | |
$.ajax({ | |
type:"post", | |
url:url, | |
data:JSON.stringify(args), | |
contentType:"application/json; charset=UTF-8", | |
success:successCall, | |
error:errorCall | |
}); | |
} |
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
#coding: utf-8 | |
"""调度系统日志分析:日志统计""" | |
import multiprocessing | |
from multiprocessing import Process, Queue, Pool | |
import logging | |
import time | |
import pprint | |
import 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
import signal | |
from functools import wraps | |
from nose.tools import nottest, with_setup | |
class TestTimeoutException(Exception): | |
pass | |
@nottest | |
def raise_timeout_exception(*args, **kwargs): |
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
SCRIPT_DIR="$(dirname "$(readlink -f "$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
# coding: utf-8 | |
import sys,os | |
import logging | |
from logging.handlers import TimedRotatingFileHandler | |
def is_stdout_attached_to_terminal(): | |
'''判断当前进程组是不是前台进程组(主要关注stdout是否被关联到/dev/tty)''' | |
try: | |
# 如果stdout被绑定到终端设备上,则是前端进程组 | |
if os.getpgrp() == os.tcgetpgrp(sys.stdout.fileno()): |
OlderNewer