Skip to content

Instantly share code, notes, and snippets.

View larrycai's full-sized avatar
💭
I may be slow to respond.

Larry Cai larrycai

💭
I may be slow to respond.
View GitHub Profile
@larrycai
larrycai / README.md
Last active March 21, 2021 01:52
Learn REST API with Python script, slides : http://www.slideshare.net/larrycai/learn-rest-apiwithpython

Introduction

Learn REST API with Python script, slides : http://www.slideshare.net/larrycai/learn-rest-apiwithpython

REST/JSON is perfect match to fetch web data, and python requests module

@larrycai
larrycai / all-testcase.txt
Created August 20, 2013 00:47
sample files for parallel test executor plugin demo
testcase_0
testcase_1
testcase_2
testcase_3
testcase_4
testcase_5
testcase_6
testcase_7
testcase_8
testcase_9
@larrycai
larrycai / log.md
Created July 25, 2013 07:56
can't upgrade python package in ubuntu 12.10 using pip 1.3.1 and pip 1.4 has error in list

Try to use pip to install python packages like vcrpy in standard ubuntu 12.10

it seems there is problem to upgrade using pip 1.3.1

see log below

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10

DISTRIB_CODENAME=quantal

@larrycai
larrycai / hello2.py
Created December 16, 2012 15:56 — forked from anonymous/hello2.py
update the bug for passing parameter
#!/usr/bin/env python
"""
hello2.py hello world sample
Usage: hello2.py [options]
Options:
-m messages message list, separare by ','
-h this help
Mail bug reports and suggestion to : Larry Cai <larry.caiyu AT gmail.com>
@larrycai
larrycai / redmine2tuleap.py
Created October 16, 2012 07:18
covert the issues from redmine to tuleap
#!/usr/bin/env python
import csv
import sys
# read sample tuleap csv header to avoid some field changes
tuleapcsvfile = open('tuleap.csv', 'rb')
reader = csv.DictReader(tuleapcsvfile)
# open stdout for output
@larrycai
larrycai / env.rb
Created March 12, 2012 14:37
make aruba work for unix and windows under cucumber
require 'aruba/cucumber'
module ArubaOverrides
def detect_ruby(cmd)
processor, platform, *rest = RUBY_PLATFORM.split("-")
#puts platform
if platform =~ /w32$/ && cmd =~ /^mkbok / #mkbok is the real command in features
"ruby -I../../lib -S ../../bin/#{cmd}"
else
"#{cmd}"
end
@larrycai
larrycai / sample1.tex
Created February 1, 2012 14:25
regex in ruby to convert from sample1.tex to sample2.tex ?
\begin{enumerate}\setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}
\item
item1
\item
item2
\end{enumerate}
\begin{enumerate}\setlength{\itemsep}{1pt}\setlength{\parskip}{0pt}\setlength{\parsep}{0pt}
\item
@larrycai
larrycai / p1.py
Created October 13, 2011 02:04
http://projecteuler.net solutions in python
# solution from http://weibo.com/1937408130
total = sum([x for x in range(1,1000) if x % 3 == 0 or x % 5 == 0])
print total
@larrycai
larrycai / p2.py
Created October 13, 2011 01:02
solution for problem 2
# http://projecteuler.net/problem=2
total = 0;
a,b = 0,1
while a<4000000:
a,b = b,a+b
if a %2 == 0:
print a;
total += a;
print total
@larrycai
larrycai / p1.py
Created October 13, 2011 00:47
solution for problem 1
# http://projecteuler.net/problem=1
total = 0;
for i in range(1,1000):
if (i % 3 == 0) or (i % 5 ==0):
# print i;
total += i;
print "the sum of all the multiples of 3 or 5 below 1000: " , total