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
<?php | |
define('MAX_NUM', 1000000); | |
$all = array_fill(0, MAX_NUM, 0); | |
$i = 2; | |
if ($all[$i] == 0) { | |
echo $i . "\n"; //测试性能时去掉这行。输出会占据大部分时间。 | |
for ($j = $i; $j < MAX_NUM; $j+=$i) { | |
$all[$j] = 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
function window.onload() | |
{ | |
var olink=document.links; | |
for(var i=0; i<olink.length; i++){ | |
olink[i].onmouseover=function(){window.status='';return true;} | |
olink[i].onfocus=function(){window.status='';return true;} | |
} | |
} |
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:(function(){readConvertLinksToFootnotes=false;readStyle='style-novel';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_print_cs |
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
sfHover = function() { | |
var sfEl = document.getElementById("menu"); | |
if(sfEl){ | |
var sfEls = document.getElementById("menu").getElementsByTagName("LI"); | |
for (var i=0; i<sfEls.length; i++) { | |
sfEls[i].onmouseover=function() { | |
this.className+=" sfhover"; | |
} | |
sfEls[i].onmouseout=function() { | |
this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); |
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 -*- | |
u'''cdays-3-exercise-3.py | |
@note: 使用全局变量和函式的递归调用 | |
''' | |
global col # 竖直线(列线),用于记录列线冲突状态 | |
global row # 行号,本代码是逐行放置的,这里的row是可以当做do_queen函数的参数的。 | |
global pos_diag # 右对角线,用于记录右对角线冲突,拿笔画画就知道有15条左对角线了 | |
global nag_diag # 左对角线,用于记录左对角线冲突状态,同样也有15条右对角线 |
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
/* | |
* view-source:http://www.rowtothepole.com/ | |
* | |
* <body id="home" class="js-disabled section-"> | |
* <div id="outer"> | |
* </body> | |
* | |
* style.css | |
* body { | |
* background: #1a2732 url(/release/images/inverted/layout/body-bg.jpg) repeat-y center top; |
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://wiki.woodpecker.org.cn/moin/AllStartFromGame | |
def solve(seq,where): | |
n = len(seq) | |
seq.sort() | |
seq.reverse() | |
table = [ [] for i in range(n) ] | |
left, right = where, n - where | |
leftr = long('1'*left) | |
rightr = long('1'*right) |
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/sh | |
## runK.sh | |
## 先进入对应目录 cd /path/to/Karrigell | |
## 使用 daemon 命令来包裹并记录 Karrigell 的运行 pid | |
/usr/sbin/daemon -p /var/run/karrigell.pid /usr/local/bin/python Karrigell.py 2>/var/log/K.log & | |
#!/bin/sh | |
# | |
# rcNG |
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
# .bashrc | |
function vasa { | |
if [ ! "$*" ]; then | |
echo 'Oops, I need food!' | |
return 1 | |
fi | |
gougou $* | |
echo "$* #vasa" | bti | |
} |
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 | |
# vim:fileencoding=utf-8 | |
# @Author: Vayn a.k.a. VT <vayn@vayn.de> | |
# @Name: a.py | |
# @Date: 2011年04月04日 星期一 13时24分03秒 | |
input = raw_input('Please type:') | |
data = input.split() | |
price = 200 |