Quick & Dirty Theme Switcher
转载: Quick & Dirty Theme Switcher | Ugly Duck
I recently added a fairly straightforward color scheme (theme) switcher to my personal website. You can toggle this simple color switcher in the footer of the site to see it in action. In case anyone else had the desire to add such functionality...
more...
Python Faker
转载: 求求你,别再手工造假数据了,fake 了解一下 - FooFish-Python 之禅
项目开发初期,为了测试方便,我们总要造不少假数据到系统中,尽量模拟真实环境。
比如要创建一批用户,创建一段文本,或者是电话号码,抑或着是街道地址或者 IP 地址等等。
以前要么就是键盘一顿乱敲,随便造个什么字符串出来,当然最后谁也不认识谁。
现在你不要这样做了。
用 faker 就能满足你的一切需求。
先安装 faker
1pip install Faker
创建 faker 对象
12from faker import Fakerfake = Faker()
fake...
more...
Programming languages are similar
转载:GitHub - jiyinyiyong/swift-is-like-go: Comparing Swift syntax with Go’s
# BASICS
# Hello World
# Swift
1print("Hello, world!")
# Go
1234567package mainimport "fmt"func main() { fmt.Println("Hello, world!")}
#...
more...
Code Fragment
# 百钱百鸡
中国古代数学家张丘建在他的《算经》中提出了一个著名的 “百钱百鸡问题”:
一只公鸡值五钱,一只母鸡值三钱,三只小鸡值一钱,现在要用百钱买百鸡,请问公鸡、母鸡、小鸡各多少只?
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556package mainimport "fmt"fun one() { count := 0 for cock := 0; cock <=...
more...
Easy to Remember Color Guide for Non-Designers
转载: Easy to Remember Color Guide for Non-Designers - Send With SES
# Easy to Remember Color Guide for Non-Designers
NOTE: I’m not a designer. This is what i’ve self-learnt over the years because i couldn’t afford good designers. I don’t know if this is scientific. This works for me. I hope it works...
more...
Update a table with data from another table
# 问题
table1
id
name
description
1
a
aaa
2
b
bbb
3
c
ccc
table2
id
name
description
1
x
xxx
2
y
yyy
通过 id 更新 table2 的 name 和 description 到 table1
result
id
name
description
1
x
xxx
2
y
yyy
3
c
ccc
test data
1234567891011121314151617181920create table table1( id number, name...
more...
Oracle XML
# 从关系数据库生成 XML
12345678910111213141516171819202122232425262728293031323334353637383940414243-- create the tablesCREATE TABLE customers ( customer_id INTEGER CONSTRAINT customers_pk PRIMARY KEY, first_name VARCHAR2(10) NOT NULL, last_name VARCHAR2(10) NOT NULL, dob DATE, phone VARCHAR2(12), type...
more...









