Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-06-09 23:14:45
阅读次数:
264
先给大家来个干活^~^,学习Python的一个好网站,http://learnpythonthehardway.org/book/
经典例子
下面是几个老经典的例子喽,刚接触Python的可以敲一敲,看看结果喽!
my_name='Zed A. Shaw'
my_age=35#not a lie
my_height=74#inches
my_weight=180#1bs
my_eye...
分类:
编程语言 时间:
2014-06-08 17:15:58
阅读次数:
369
我们在浏览一些网站,尤其是一些小说网站的时候,都会有修改页面背景颜色的地方,这个功能使用jquery很容易实现。
效果图:
show you code:
jquery test
white
red
green
yellow
$("button").click(
function()
{
var color = this.value;
$("...
分类:
Web程序 时间:
2014-06-08 16:48:45
阅读次数:
274
原始form表单值获取方式(手动):$.ajax({
type: "POST",
url: "ajax.php",
data: "Name=摘取天上星&position=IT技术",
success: function(msg){alert(msg);},
error: function(error){alert(error);}
});JQ serialize()...
分类:
Web程序 时间:
2014-06-08 16:19:01
阅读次数:
280
今天有个需求:点击某个按钮之后,弹出对话框,然后无论如何点击都做同样的事情。主要代码如下:
function dialogues(){
var r = window.confirm();
var form1 = document.getElementById("form1");
if(r) form1.action = "";
else ...
分类:
其他好文 时间:
2014-06-08 15:52:57
阅读次数:
179
血条是常见功能,可以通过一个血条背景和一个不断改变得血条宽度,来实现少血。
在MainScence.lua中,先改代码:
function MainScene:ctor()
local bg = display.newSprite("bg01.jpg")
bg:setPosition(display.cx, display.cy)
self:addChild(bg...
分类:
其他好文 时间:
2014-06-08 15:34:24
阅读次数:
347
extjs4 tree check 级联选择 实现效果:关键代码:
function changeAllNode(node, isCheck) {
allChild(node, isCheck);
allParent(node, isCheck);
function allChild(nodec, isCheckc) {
var chileNodes = n...
分类:
Web程序 时间:
2014-06-08 15:25:20
阅读次数:
222
这两天给公司一个新项目做上线前的压力测试,这个项目主要的接口有两个,获取订单号(getOrderId)和确认订单(confirm),需要重点压测。开始,我们选择用python写测试例,python的好处是开发迅速,但是并发能力不够;我就想试试用tsung,tsung是用erlang写的,并发肯定没问题,但我以前只用来测试过静态网站,没有测试过动态API,查了查文档,发现tsung是支持用erlang脚本生成动态参数的,于是我决定用tsung。...
分类:
其他好文 时间:
2014-06-08 10:50:33
阅读次数:
390
从一个装饰器的完整形式出发说明四种装饰器形式的用法和差异...
分类:
其他好文 时间:
2014-06-08 10:33:44
阅读次数:
247
1 Supervisord的安装
Supervisord是运行在python环境下的服务监控程序。所以在安装supervisord之前必须有python环境。
如果系统没有PYTHON,键入:yum install python(CENTOS)或者apt-get installpython(UBUNTU)
键入:yum install python-setuptools...
分类:
其他好文 时间:
2014-06-08 08:35:43
阅读次数:
235