This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/usr/bin/ruby | |
puts "input N" | |
i=gets.to_i | |
m=[1] | |
1.upto i do |j| | |
puts "input N#{j}" | |
k=gets.to_i | |
m.unshift m[0]*(k+1) |
#!/usr/bin/ruby | |
class PE14 | |
@@l=Hash.new | |
@@l[1]=1 | |
def PE14.eval x | |
if @@l[x] #found | |
return @@l[x] | |
else | |
if x%2==0 #even | |
y=PE14.eval(x/2) |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
/* | |
12306 Auto Query => A javascript snippet to help you book tickets online. | |
Copyright (C) 2011 Jingqin Lynn | |
Includes jQuery | |
Copyright 2011, John Resig | |
Dual licensed under the MIT or GPL Version 2 licenses. | |
http://jquery.org/license | |
Includes Sizzle.js |
" VIM配置文件 | |
" Author: Fanzeyi (fanzeyi1994[at]gmail.com) | |
" Last Modified Date: 2012-01-14 13:36 | |
" 设置语言及编码 | |
source $VIMRUNTIME/delmenu.vim | |
source $VIMRUNTIME/menu.vim | |
set enc=utf-8 | |
" set fencs=utf-8,ucs-bom,gbk,gb18030,shift-jis,gb2312,cp936 |
% facts : sname(ID,NAME) | |
sname(1,ada). | |
sname(2,bob). | |
% facts : point(ID,POINT) | |
point(1,80). | |
point(2,81). | |
% working search in example | |
search_by_name(Key,Value) :- |
def def_scope(name, &block) | |
singleton_class.send(:define_method, name) do |*args| | |
klass = clone | |
block.call(klass, *args) | |
klass | |
end | |
end |
@cases=( | |
'\\040==case1', | |
'\\\\040==case2', | |
'\\\\\\040==case3', | |
'\\\\\\\\040==case4', | |
'\\\\\\\\\\040==case5' | |
); | |
for(@cases){ | |
s/^((\\\\)*)\\040/ /g and print"$_\n"; | |
} |
#!/usr/bin/python | |
"""minimalign.py: minimal version of anymalign.py | |
Adrien Lardilleux <[email protected]> | |
http://users.info.unicaen.fr/~alardill/anymalign/ | |
""" | |
import sys | |
import random |
// ==UserScript== | |
// @name Script name | |
// @description Description | |
// @namespace http://yourwebsite.com | |
// @version 0.1.0 | |
// @author Your name | |
// @license MIT | |
// @released 2013-02-17 | |
// @updated 2013-02-17 | |
// @match *://example.com/* |