DRY:dont repeat yourself假设一个逻辑(代码块)会重复两次或者以上,应该写成函数被调用为什么呢,实际上,我们处处可见重复性的代码.这除了增加工作量之外,还会增加维护难度。dry原则不仅仅是炫技。它的代码更容易被维护。假设某个逻辑需在多个地方被重复编写,当你需要更改此逻辑时,也意...
分类:
其他好文 时间:
2015-12-23 10:45:53
阅读次数:
161
Before you even start trying any of the alternatives provided, ask yourself whether you really need to have multiple processes log to the same file, t...
分类:
移动开发 时间:
2015-12-16 23:10:35
阅读次数:
390
JSON对象与JSON数组的长度和遍历方法 1.json对象的长度与遍历 结构:var json={“name”:”sm”,”sex”:”woman”} 遍历的方法:for(var js2 in json){ alert...
分类:
编程语言 时间:
2015-12-16 21:18:35
阅读次数:
293
首先从官网http://www.dcloud.io/下载HBuilder,用该软件创建一个HTML5的移动APP项目,具体可去官网查看相应的文档。接下来就是如何将写好的HBuilder引入到我们的安卓项目中。先到http://ask.dcloud.net.cn/article/103下载HBuilder离线打包Android版SDK,SDK里面有个HBuilder-..
分类:
移动开发 时间:
2015-12-15 15:58:34
阅读次数:
12565
http://ccl.northwestern.edu/netlogo/创建agentcreate-turtles 10动一动ask turtle 0 [forward 10 right 90 left 90 back 10]ask turtles [pen down] 或者 [pen up]...
分类:
Web程序 时间:
2015-12-07 11:58:39
阅读次数:
175
You are playing the followingBulls and Cowsgame with your friend: You write down a number and ask your friend to guess what the number is. Each time y...
分类:
其他好文 时间:
2015-12-04 10:31:27
阅读次数:
102
1. 转载自http://book.douban.com/review/6007037/,版权归丸子(^.^)v所有。 New Google employees (we call “Nooglers”) often ask me what makes me effective at what I ....
分类:
其他好文 时间:
2015-11-22 18:55:40
阅读次数:
150
Given a bounch of points, ask to find K closest point to origin.This question can be changed. For example, here is origin, but there might be another ...
分类:
其他好文 时间:
2015-11-22 09:59:21
阅读次数:
206
在视图上创建索引,但视图调用了函数,需要将自定义函数绑定到架构。如何绑定,也是在函数上加一个with SCHEMABINDING 1 --创建一个求季度的标量函数 2 use House2 3 go 4 create function Ask_Quarter(@Q_id date) 5 return...
分类:
其他好文 时间:
2015-11-22 00:14:47
阅读次数:
153
终于要提笔写点东西了,我掩饰不住自己的窃喜,这篇文章的内容可能和标题有所不符,哦,真抱歉,我害怕这样的文章成为你眼中的垃圾,因为如果你假装没看到这样的文章,我到觉得还对得起“读者体验”,良心上过得去,然而如果你不幸看了,然后唾弃这篇文章,那么我觉得就良心不安了!...
分类:
其他好文 时间:
2015-11-10 19:29:27
阅读次数:
213