-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemp.txt
1467 lines (1099 loc) · 48.7 KB
/
temp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
day tips
========
2012.05.30
----------
1. Chrome专用!
修改Chrome的默认搜索引擎为:。http://64.233.183.132/search?gbv=1&tbo=1&as_qdr=all&hl=en&num=50&q=%s
选项 - 高级 - 内容设置 (chrome://settings/content) 里禁用掉 64.233.183.132 这个域名的javascript运行权限。
2012.05.08
----------
1. gitscm site
https://github.com/github/gitscm-next
>gem install bundler
>
update Gemfile:
# gem 'thin'
gem "thin", "1.3.1"
gem "eventmachine", "1.0.0.beta.4.1"
remove Gemfile.lock
>bundler install
...
-- 没成功
2. sphinx pdf
install rst2pdf
register rst2pdf in your conf.py Sphinx config
extensions = ['sphinx.ext.autodoc','rst2pdf.pdfbuilder']
run
sphinx-build -bpdf sourcedir outdir
参考: http://d.hatena.ne.jp/re_guzy/20101012/p1
conf.py:
pdf_stylesheets = ['sphinx','ja']
import os
font_dir = os.path.abspath(os.path.join(os.path.split(__file__)[0], os.pardir, 'fonts'))
pdf_font_path = [font_dir, 'C:\WINDOWS\Fonts']
pdf_language = "ja"
ja.json
{
"embeddedFonts" : [
[
"VL-Gothic-Regular.ttf",
"VL-PGothic-Regular.ttf",
"ipam.ttf",
"verdanaz.ttf"
]
],
"fontsAlias" : {
"stdFont": "VL-PGothic-Regular",
"stdBold": "VL-PGothic-Regular",
"stdItalic": "VL-PGothic-Regular",
"stdBoldItalic": "VL-PGothic-Regular",
"stdMono": "VL-PGothic-Regular",
"stdMonoBold": "VL-PGothic-Regular",
"stdSanBold": "VL-PGothic-Regular",
"stdSansBold": "VL-PGothic-Regular"
},
"styles" : [
["base" , {
"wordWrap": "CJK",
"kerning" : true
}],
["literal" , {
"wordWrap": "None"
}]
]
}
2012.04.29
----------
1. ipython editor in windows
http://stackoverflow.com/questions/655530/how-to-configure-ipython-to-use-gvim-on-windows
set EDITOR=gvim -f
2012.04.28
----------
1. 如何把BT种子隐藏在图片内
http://www.sharezy8.com/wangluozatan/463.html
a.将zhongzi.torrent压缩为rar文件,得到zhongzi.rar压缩包。
b. cmd
copy/b d:huangtu.jpg+d:zhongzi.rar d:huangtu.jpg
c. 这就OK了,打开huangtu.jpg,图没变,把它改成rar格式看一看吧
2012.04.26
----------
1. 显示代码提交动画效果
https://code.google.com/p/codeswarm/
http://www.cnblogs.com/cos2004/archive/2012/01/18/2325851.html
>svn log -v > my_svn.log
Convert the log to our event-based XML format:
> python convert_logs/convert_logs.py -s path/to/my_svn.log -o svn_log.xml
--把xml文件拷贝到codeswarm/data下,备份原来的sample-repevents.xml文件,然后把你的xml文件改名为sample-repevents.xml
找到data/sample.config文件打开,配置你的动画参数,例如改以下参数可以使字体更大,我的是20:
FontSize=20
BoldFontSize=20
InfoFontSize=20
ColorAssign这个参数是表示某种类型的代码的颜色,如:
ColorAssign1="js",".*js.*", 0,0,255, 0,0,255
表示js代码为动画里蓝色的点 。
TakeSnapshots为是否保存截图
...更多配置自己去发掘。
到这已经完成了所有配置了。双击打开根目录下的run.bat文件,然后enter就可以看到动画了
git
https://github.com/yangjiandong/code_swarm
2012.04.23
----------
1. python virtualenv
定义python环境包
pip freeze > requirements.txt
2. ruby
gem install foreman
https://github.com/ddollar/foreman
3. javascript 文档生成工具
gem install jsduck
https://github.com/senchalabs/jsduck
--需DevKit-tdm-32-4.5.2-20110712-1620-sfx
example:
$ jsduck ext-4.0.7/src \
--builtin-classes \
--images ext-4.0.7/docs/images \
--output your/docs
2012.04.17
----------
1. github blog,直接在github上建blog
http://jekyllbootstrap.com/
http://octopress.org/docs/
2012.04.06
----------
1. javascript kissy 编程规范
web/ext/javascript.kissy.style.txt
2012.04.01
----------
1. eclipse markdown plugin
http://winterstein.me.uk/projects/tt-update-site/
2. markdown 等各种文档转换
http://johnmacfarlane.net/pandoc/
Pandoc can convert documents in markdown, reStructuredText, textile, HTML, or LaTeX
2012.03.31
----------
1. git more remote
http://f2e.us/wiki/git-remote.html#!/
nodeclub,
git branch yang
git co yang
--github create repo
git remote add yang [email protected]:yangjiandong/nodeclub.git
git push -u yang yang
git remote rename yang yh
--远程更新
git pull yh
2. vim jsbeautify
http://blog.longwin.com.tw/2009/11/vim-javascript-indent-formatter-plugin-2009/
.vim/plugin/jsbeautify.vim
vim .vimrc # 設定 <leader> 鍵值 (若已經有設好 <leader> 鍵, 此步驟請跳過)
let mapleader=","
use format:
,fo
vim 已设置tab为2个space,jsbeautify后强制为2 space
vim/plugin/jsbeautify.vim
"let s:opt_indent_size = 1
"let s:opt_indent_char = "\t"
let s:opt_indent_size = 2
let s:opt_indent_char = " "
2012.03.29
----------
1. html compressor
http://code.google.com/p/htmlcompressor/
2. node.js code reload
https://github.com/kuchumovn/node-js-development-mode
3. 一个社区网站,没看懂,俄文?
https://github.com/kuchumovn/sociopathy
4. node.js debug
a. npm install node-inspector
b. 启动 node-inspector
~/$ node-inspector
info - socket.io started
visit http://0.0.0.0:8080/debug?port=5858 to start debugging
c. 启动debug
~/node-project$ node --debug-brk app.js //表示从第一行代码开始调试
debugger listening on port 5858Error 0
5. install redis in cygwin
$ wget http://redis.googlecode.com/files/redis-2.4.9.tar.gz
$ tar xzf redis-2.4.9.tar.gz
$ cd redis-2.4.9
$ make
update src/redis.c
#include <sys/time.h>
#include <sys/resource.h>
#ifndef SA_ONSTACK
#define SA_ONSTACK 0
#endif
The binaries that are now compiled are available in the src directory. Run Redis with:
$ src/redis-server
You can interact with Redis using the built-in client:
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
2012.03.26
----------
1. node.js hot reload
npm install -g node-dev
node-dev main.js
? windows7 下没成功,
? use growl
2012.03.23
----------
1. camel 学习例子,Open eHealth Integration Platform (IPF) ipf
https://github.com/krasserm/ipf.git
2012.03.15
----------
1. twitter bootstrap and backbone application
use php as webapp,
https://github.com/ccoenraets/backbone-directory
2012.03.14
----------
1. pythonic
0-10 求偶
v = [i for i in range(10) if i % 2 == 0]
2. 在windows7上开启虚拟wifi热点
http://www.vimer.cn/2012/02/%E5%9C%A8windows7%E4%B8%8A%E5%BC%80%E5%90%AF%E8%99%9A%E6%8B%9Fwifi%E7%83%AD%E7%82%B9-2.html
1). 以管理员身份运行命令提示符
“开始”---在搜索栏输入“cmd”----右键以“管理员身份运行”
2). 启用并设定虚拟WiFi网卡
运行命令:
netsh wlan set hostednetwork mode=allow ssid=dantezhu_wifi key=00000000
"ssid"后为网络名称,起个名字就行
"Key"后为密码,一般要求是8位
执行完之后,打开“网络和共享中心”--“更改适配器设置”看看是不是多了一项,若果有多出的这一项“Microsoft Virtual WiFi Miniport Adapter”,为方便区分,将其改名为“虚拟wifi”。
3) .设置Internet连接共享
在“网络连接”窗口中,右键单击已连接到Internet的网络连接,选择“属性”→“共享”,勾上“允许其他······连接(N)”并选择“虚拟WiFi”。
这里要注意的是,如果像我一样采用宽带拨号,那么要更改的网络链接是那个“宽带链接”而不是“本地链接”
4) .开启无线网络
继续在命令提示符中运行:
netsh wlan start hostednetwork
或者将命令存为bat文件,以管理员运行。方便每次开机时执行~
5).配置静态IP
上面第4步结束之后,我们的设备就可以连接上了,但这个时候很可能是上不了网的。需要我们静态配置一下。
a)电脑设置
点击“更改适配器设置”-“虚拟wifi”属性------“ipv4”,修改成如下:
b)手机设置
iphone等无线设备的设置:打开iphone等上的无线网络,选择你设置无线网的名称,进入后选择“静态”
第一行,ip地址填:192.168.137.X(X在2-254之间)
第二行, 子网掩码:255.255.255.0
第三行,路由器:192.168.137.1(电脑上虚拟网路是多少就填多少,不能填其它数值)
第四行:DNS : 8.8.8.8 (使用的google的dns,这里要注意,使用192.168.137.1是不行的!)
如果手机上的DNS配置有问题的话,就会出现很多朋友遇到的,手机能上QQ,但是上不了网的情况。
如果上面的步骤还是不能上网,就将PC的虚拟wifi的DNS也改成8.8.8.8试试
OK,到此结束~
2012.03.13
----------
1. node.js ide cloud9
Via git (or downloaded tarball):
$ git clone git://github.com/ajaxorg/cloud9.git
Try to run Cloud9 (bin/cloud9.sh). If this throws an error update submodules after cloning:
$ git submodule update --init --recursive
Via npm:
$ npm install cloud9
2. node.js eclipse
http://code.abnoctus.com/publish/binaries/node-launcher/
https://portawiki.abnoctus.com/view/NodeIDE.html
use chrome development tools
https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger
plugin:
http://chromedevtools.googlecode.com/svn/update/dev/
3. python 短连接
https://github.com/lyxint/shurl
2012.03.12
----------
1. mac 美化win字体
http://getmactype.com/
2012.03.10
----------
1. node.js 中文社区
https://github.com/muyuan/nodeclub.git
2012.03.09
----------
1. del cvs dir
@echo off
echo Deleting CVS folders and files under: %1
REM Open Folder specified by parameter.
cd %1
REM Recursive delete command
for /f "tokens=*" %%i in ('dir /b/a/s CVS*') do @rmdir /q /s "%%i"
echo Done!
2. trac
http://blog.csdn.net/lanphaday/article/details/5374066
python/other/trac.txt
3. 怎样删除大于200条的数据删除
delete from test where id in ((select t.id from (select rownum rn,t.* from test t) t where rn >=200));
2012.03.06
----------
1. python for win
http://css.dzone.com/articles/python-101-setting-windows?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fpython+%28Python+Zone%29
winsys
git clone https://github.com/tjguk/winsys.git
winshell
http://timgolden.me.uk/python/winshell.html
2. django search
Django and Haystack: Lattitude and Longitude Radius Search with Solr
http://css.dzone.com/articles/django-and-haystack-lattitude?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fpython+%28Python+Zone%29
Haystack: http://haystacksearch.org/
started
Install the package:
Latest stable (1.2.6) off PyPI: pip install django-haystack
Latest dev (2.0.0-beta) off GitHub: pip install -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
Add haystack to your INSTALLED_APPS.
Create search_indexes.py files for your models.
Setup the main SearchIndex via autodiscover.
Include haystack.urls to your URLconf.
Search!
2012.03.05
----------
1. 隐藏数据在数码文件
use ruby
http://qaa.ath.cx/PiggyPack.html
2. sublimetext2 theme
https://github.com/originell/DarkTango
ide theme
https://github.com/ChrisKempson/Tomorrow-Theme
git submodule init
git submodule update
textMate theme
http://textmatetheme.com/
3. ipython save session
--save 1-20 line to my.py
%save my.py 1-20
2012.03.04
----------
1. 替代cygwin的轻量级工具gow
https://github.com/bmatzelle/gow/downloads
2. remove ^M 有效方法
http://www.oualline.com/vim-cook.html
:1,$s/^M//
:1,$s/{Ctrl+V}{Ctrl+M}//{Enter}
3. 借助于GitStats,我们能很好地统计自己的每个项目的工作量,从而看到工作进展。
用法如下,
#复制GitStats项目到本地
cd ~/dev
git clone git://github.com/trybeee/GitStats.git
python ~/dev/gitstats/git-stats /youproject public
4. 监测github 项目
https://github.com/DAddYE/githubwatcher
5. HTTPie is a CLI, cURL-like tool for humans
https://github.com/jkbr/httpie
usage:
http PATCH api.example.com/person/1 X-API-Token:123 name=John [email protected]
http -a user:password GET https://api.github.com
6. vimrc
https://github.com/jeffbuttars/Viming-With-Buttars
Vimdown - Create great looking READMEs from your .vimrc using Markdown:
https://github.com/jeffbuttars/Vimdown
2012.03.03
----------
1. springside git
https://github.com/springside/springside4
2. git client
http://www.syntevo.com/smartgit/index.html
3. jquery input text
<input type="text" placeholder="搜索问题, 话题 或 会员" />
输入框提示,
chrome下input[type=text]的placeholder不垂直居中的问题解决
css:
line-height: normal; /* for non-ie */
line-height: 22px\9; /* for ie */
4. htc android
http://www.htcdev.com/devcenter/opensense-sdk/download-instructions
user:yangjiandong,123456789,[email protected]
2012.03.02
----------
1. cygwin git 升级到1.7.9
2. cygin gitk fail
http://cygwin.com/ml/cygwin/2011-08/msg00478.html
> Application initialization failed: no display name and no $DISPLAY environment v
> ariable
> Error in startup script: no display name and no $DISPLAY environment variable
> while executing
> "load /usr/lib/tk8.5/../../bin/libtk8.5.dll Tk"
> ("package ifneeded Tk 8.5.9" script)
> invoked from within
> "package require Tk"
> (file "C:\cygwin\bin\gitk" line 11)
install xinit package
--没解决问题
--继续
http://cygwin.com/ml/cygwin/2012-02/msg00115.html
3. Wget将网站下载到本地
使用wget可以将在线的网站下载到本地。
如下实例下载在线的电子书http://web2py.com/books/default/chapter/29到本地目录C:\D\web2pybooken。
1) wget下载网站
set LOCAL-DIR=C:\D\web2pybooken
set WEBSITE-URL=http://web2py.com/books/default/chapter/29
wget --mirror --page-requisites --convert-links --no-host-directories --html-extension -P %LOCAL-DIR% %WEBSITE-URL%
wget帮助:
wget -h.
-m, --mirror shortcut for -N -r -l inf --no-remove-listing.
-r, --recursive specify recursive download.
-l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).
-N, --timestamping don't re-retrieve files unless newer than local.
--no-remove-listing don't remove `.listing' files.
-p, --page-requisites get all images, etc. needed to display HTML page.
-P, --directory-prefix=PREFIX save files to PREFIX/...
-k, --convert-links make links in downloaded HTML point to local files.
-E, --html-extension save HTML documents with `.html' extension.
-nH, --no-host-directories don't create host directories.
2)将下载的网站放到httpserver上
如下为在本地通过python2.7启动httpserver,当然你也可以使用其他的httpserver。
cd %LOCAL-DIR%
python -m SimpleHTTPServer 8080
3) 在ie中打开本地的网站
http://your-local-machine-ip:8080/*****
完!
4. 用ffmpeg给视频添加水印
完整命令行如下,ffmpeg -y -i input.flv -acodec copy -b 300k -vfilters “movie=0:png:watermark.png [wm];[in][wm] overlay=5:5:1 [out]” output.flv
-y 表示有同名的output.flv存在时不提示,直接覆盖
-i input.flv 表示要进行水印添加处理的视频
-acodec copy 表示保持音频不变
-b 300k 表示处理视频的比特率,用-vcodec copy时报错,使用其他工具获取到原始视频比特率后加到这里,保持比特率基本不变,不然默认为200k,视频有损。
output.flv 处理后的视频
-vfilters “…” 中间便是水印处理参数,重要的是overlay=后面的部分,
第一个参数表示水印距离视频左边的距离,
第二个参数表示水印距离视频上边的距离,
第三个参数 为1,表示支持透明水印。使用透明的png图片进行视频编码后,成功获得带透明水印的视频,并且画质也比较好。
有一篇-vfilters参数使用的文章可供参考,其中还例举了如何同时加入2个水印到画面不同位置,
http://www.techenigma.com/2010/05/ffmpeg-watermark-video-without- vhook-solution/。
ffmpeg -y -i sample.avi -vfilters “movie=0:png:watermark.png [wm];[in][wm] overlay=10:mainH-overlayH-10:1 [out]” -b 100k -ar 44100 -ab 24k -f flv -s 320×240 -acodec libmp3lame -ac 1 samplewithwater.flv
Which converted from AVI to FLV and added watermark. i‘ve included a couple of examples below for just adding the watermark.
Example 1 – insert transparent PNG watermark in bottom left corner of the video:
-vfilters “movie=0:png:logo.png [wm];[in][wm] overlay=10:mainH-overlayH-10:1 [out]”
Notice the last parameter to overlay “:1″ – this enables alpha blending.
Example 2 – insert 2 different transparent PNG watermarks (second watermark on bottom right corner):
-vfilters “movie=0:png:logo.png [wm];movie=0:png:logo2.png [awm];[in][wm] overlay=10:mainH-overlayH-10:1 [int];[int][awm] overlay=mainW-overlayW-10:mainH-overlayH-10:1 [out]”
You could chain and add more overlays this way but the efficiency of such approach is yet to be tested.
待解问题:
H264/x264编码的flv经过上述ffmpeg加水印处理后变成了H263编码,即普通的flv编码,可能处理参数加的不对或是不全,
或者就应该对普通flv和H264/x264编码的视频分别处理,后续再进一步测试想办法解决。
refer to:http://tuzwu.iteye.com/blog/1025337
2012.03.01
----------
1. 高并发测试工具 siege
http://superuser.com/questions/144990/how-to-install-siege-on-cygwin
2012.02.29
----------
1. sublime plugin
https://github.com/JulianEberius/SublimeRope
after install,use:
ctrl+shift+p call command "Rope:New Project"
edit /.ropeproject/config.py
prefs.add('python_path', 'D:/PortablePython_1.1_py2.6.1/App/Lib/site-packages/')
for django
https://github.com/squ1b3r/Djaneiro
bracker Highlighter
https://github.com/akira-cn/sublime-gbk
2. sublime theme
package install: soda
user set:
"theme": "Soda Dark.sublime-theme"
2012.02.27
----------
1. count lines of code
a. eclispe:
http://nexnet.wordpress.com/2011/03/30/count-lines-of-code-and-number-of-classes-in-eclipse-projects/
Search - File
Search for the regular expression '\n' in all '*.java' files of the selected resource
b. SourceCounter
c. SLOCCount
linux tool
http://www.dwheeler.com/sloccount/
d. sonar
http://www.sonarsource.org/
java/mvn.txt
maven + sonar: mvn sonar:sonar
e. cloc
http://cloc.sourceforge.net/
简单用法:
cloc .
use sqlite3
cloc . --sql 1 | sqlite3 code.db
Which is the longest file over all projects?
> sqlite3 code.db 'select project,file,nBlank+nComment+nCode as nL from t where nL = (select max(nBlank+nComment+nCode) from t)'
Which is the longest file in each project?
> sqlite3 code.db 'select project,file,max(nBlank+nComment+nCode) as nL from t group by project order by nL;' | sqlite_formatter
Project File nL
__________ _____________________________________________ ______
perl perl-5.10.0/t/op/mkdir.t 22658
python Python-2.6.4/Lib/email/quoprimime.py 28091
postgresql postgresql-8.4.2/contrib/pgcrypto/pgp-pgsql.c 40041
mysql mysql-5.1.42/netware/mysqldump.def 51841
sqlite sqlite-3.6.22/config.sub 110860
2012.02.26
----------
1. A Chinese translation of Zed Shaw's Learning Python The Hard Way.
https://bitbucket.org/gastlygem/lpthw/src
hg clone ssh://[email protected]/gastlygem/lpthw
2. pydoc
edit pydoc.bat in path
@python D:\PortablePython_1.1_py2.6.1\App\lib\pydoc.py %*
2012.02.25
----------
1. ipython 0.12
http://ipython.org/download.html
AttributeError: 'module' object has no attribute 'get_current_history_length'
use: 1.7.1 pyreadline
http://pypi.python.org/pypi/pyreadline
ipython editor
set editor=g.bat
>ed -x main.py
2. ipdb
pdb 调试
代码中启用ipdb:import ipdb;ipdb.set_trace()
cmd: python -m ipdb main.py
ipython: pdb
2012.02.23
----------
1. 取消pydev editor -- code analysis
2. django 打包
http://misunderstandings.wordpress.com/2008/06/26/django-desktop-app/
http://blog.robotercoding.com/?p=124
3. django use cherrypy
http://www.defuze.org/archives/262-hosting-a-django-application-on-a-cherrypy-server.html
2012.02.22
----------
1. 程序员的世界
save/programer.xps,programming-language.jpg
2. quora
被外界评价为:Twitter 之后最让人兴奋的产品
需邀请码注册
http://www.quora.com/
https://github.com/renxing/quora-python
Quora clone write in Python + Tornado + MongoDB
https://github.com/huacnlee/quora
Quora clone by Ruby on Rails
2012.02.20
----------
1. django sql 占位符 %s
2. django Using Stored Procedure
http://djangosnippets.org/snippets/118/
2012.02.19
----------
1. java 高性能并发库
jactor
https://github.com/laforge49/JActor
2. django mongodb
http://simple-is-better.com/news/821
3. django solr
solr-tomcat6,
pip install pysolr,django-haystack
http://dmyz.org/archives/354
2012.02.17
----------
1. python关于中文分词有什么成熟的库?
http://www.zhimaq.com/questions/1896/python
smallseg -- 开源的,基于DFA的轻量级的中文分词工具包,特点:可自定义词典、切割后返回登录词列表和未登录词列表、有一定的新词识别能力。
http://code.google.com/p/smallseg/
coreseek,使用sphinx和mmseg 支持万能的python数据源
https://github.com/pluskid/pymmseg-cpp/ 这个挺不错的,基于MMSEG中文分词算法,以前是ruby实现,现在有pytho
2. pypi mirror download
http://pypi.zepheira.com/simple/
pip
If you’re using a recent pip (0.8.1 or later) use the —use-mirrors flag:
pip install --use-mirrors $PACKAGE
use automation:
[global]
index-url = http://d.pypi.python.org/simple
Into ~/.pip/pip.conf.
3. 转移用户目录到d盘
到用户目录: %AppData%
假设你想把用户文件夹设置在D盘,
robocopy "C:\Users" "D:\Users" /E /COPYALL /XJ
rmdir "C:\Users" /S /Q
mklink /J "C:\Users" "D:\Users"
想要移动已安装好的Windows7中的用户文件夹 ,
0. 关闭所有应用程序;
1. 按一下“Windows”键,输入“计算机管理”之后按“Enter”,呼出“计算机管理器”;
2. 鼠标点击“Administrator”,选择属性,而后在随后的对话框中去掉“帐户已禁用”之前的勾,而后关闭“计算机管理器”;
3. 注销当前用户(注意,不是“切换用户”),而后以“Administrator”登录
4. 打开命令行窗口,输入以下命令:robocopy "C:\Users" "D:\Users" /E /COPYALL /XJ /XD "C:\Users\Administrator"
5. 注销Administrator,重新用你的用户名登录Windows7,而后到“计算机管理器”里禁用Administrator;
6. 以管理员身份打开一个DOS窗口,输入以下命令:
rmdir "C:\Users" /S /Q
mklink /J "C:\Users" "D:\Users"
搞定。
2012.02.16
----------
1. Ubuntu各版本开发代号一览
http://www.cnblogs.com/sinojelly/archive/2011/11/06/2238286.html
2. python 学习资源
http://www.cnblogs.com/sinojelly/archive/2012/01/29/2331503.html
3. django 项目
https://github.com/vicalloy/LBForum.git
注意,\scripts\create_lbforum_env.py初始化lbforum的python虚拟环境
https://github.com/vicalloy
2012.02.15
----------
1. intellij 块选择
ctrl+w,注意它是按单词来扩展选择的,-- 还没找到更好的方法,没eclipse下双击方便
让光标不随意定位:Settings->Editor中去掉Allow placement of caret after end of line
http://cowboy-bebop.iteye.com/blog/1035550
java/intellij.txt
intellij python : pycharm
http://www.jetbrains.com/pycharm/
2. nginx
3. java ide netbeans,intellij 字体设置
推荐 YaHei.Consolas.1.12.zip
4. python 版本 virtualenv
http://www.intellij.org.cn/blog/?p=1208
2012.02.14
----------
1. intellij highlight all occurrence var
Settings - Editor - Highlight usages of element at caret
2012.02.13
----------
1. ropevim, rope in vim
Ropevim is a plugin for performing python refactorings in vim. It uses rope library.
2012.02.11
----------
1. djangobook in russian
git://github.com/RaD/djbookru.git
--but no run
2012.02.10
----------
1. python ide
http://stackoverflow.com/questions/81584/what-ide-to-use-for-python
Rapid Application Development -.
Integrated DB Support -+ |
GUI Designer -+ | |
Unit Testing -+ | | |
Code Templates -. | | | |
Code Folding -+ | | | | |
UML Editing / Viewing -+ | | | | | |
Line Numbering -+ | | | | | | |
Bracket Matching -+ | | | | | | | |
Smart Indent -+ | | | | | | | | |
Source Control Integration -+ | | | | | | | | | |
Error Markup -+ | | | | | | | | | | |
Integrated Python Debugging -+ | | | | | | | | | | | |
Multi-Language Support -+ | | | | | | | | | | | | |
Auto Code Completion -+ | | | | | | | | | | | | | |
Commercial / Free --+ | | | | | | | | | | | | | | |
Cross Platform -+ | | | | | | | | | | | | | | | |
_|___|__|___|__|__|__|__|__|__|___|__|__|__|___|__|___|_
|CP|C/F|AC|MLS|PD|EM|SC|SI|BM|LN|UML|CF|CT|UT|UID|DB|RAD|comments
+--+---+--+---+--+--+--+--+--+--+---+--+--+--+---+--+---+
BlackAdder |Y | C | | | | | |Y | | | |Y | | | | | |
BlueFish |L | | | | | | | | | | | | | | | | |
Boa Constructor|Y | F |Y | |Y |Y | |Y |Y |Y | Y |Y |Y | | | | |
ConTEXT |W | C | | | | | | | | | | | | | | | |
DABO |Y | | | | | | | | | | | | | | | | |
DreamPie | | F | | | | | | | | | | | | | | | |
Dr.Python | | F | | | |Y | | | | | | | | | | | |
Editra |Y | F |Y | Y | | |Y |Y |Y |Y | |Y | | | | | |
Emacs |Y | F |Y | Y |Y |Y |Y |Y |Y |Y | Y |Y |Y |Y | | | |
Eric Ide |Y | F |Y | |Y |Y | |Y | |Y | |Y | |Y | | | |
E-Texteditor |W | | | | | | | | | | | | | | | | |
Geany |Y | F |Y*| Y | | | |Y |Y |Y | |Y | | | | | |* very limited
Gedit |Y | F |Y¹| Y | | | |Y |Y |Y | | |Y²| | | | |¹ with plugin ² sort of
Idle |Y | F |Y | | | | | | | | | | | | | | |
JEdit |Y | F | | Y | | | | |Y |Y | |Y | | | | | |
KDevelop |Y | F | | Y | | |Y |Y |Y |Y | |Y | | | | | |
Komodo |Y |C/F|Y | Y |Y |Y |Y |Y |Y |Y | |Y |Y |Y | |Y | |
NetBeans |Y | F |Y | Y |Y | |Y |Y |Y |Y | Y |Y |Y |Y | | | Y |
NotePad++ |W | F | | Y | | | | | |Y | | | | | | | |
Pfaide |W | C |Y | Y | | | |Y |Y |Y | |Y |Y | | | | |
PIDA |LW| F |Y | Y | | | |Y |Y |Y | |Y | | | | | |VIM based
PTVS |W | F |Y | Y |Y |Y |Y |Y |Y |Y | |Y | | |Y* | | Y |*WPF bsed
PyCharm |Y | C |Y | Y*|Y | |Y |Y |Y |Y | |Y | |Y | | | |* javascript
PyDev(Eclipse) |Y | F |Y | Y |Y |Y |Y |Y |Y |Y | Y |Y |Y |Y | | | |
Pyscripter |W | F |Y | |Y |Y | |Y | |Y | | |Y |Y | | | |
PythonWin |W | F |Y | |Y | | |Y |Y | | |Y | | | | | |
SciTE |Y | F | | Y | |Y | | |Y |Y | |Y |Y | | | | |
ScriptDev |W | C |Y | Y |Y |Y | |Y |Y |Y | |Y |Y | | | | |
SPE | | F |Y | | | | | | | | Y | | | | | | |
Spyder |Y | F |Y | |Y |Y | |Y |Y |Y | | | | | | | |
Sublime Text |Y | C |Y | Y | | | |Y |Y |Y | | |Y | | | | |extensible w/python
TextMate |M | | | Y | | | |Y |Y |Y | |Y |Y | | | | |
UliPad |Y | F |Y | Y |Y | | |Y |Y | | | |Y |Y | | | |
Vim |Y | F |Y | Y |Y |Y |Y |Y |Y |Y | |Y |Y |Y | | | |
WingIde |Y | C |Y | Y*|Y |Y |Y |Y |Y |Y | |Y |Y |Y | | | |* support for C
Zeus |W | C | | | | |Y |Y |Y |Y | |Y |Y | | | | |
+--+---+--+---+--+--+--+--+--+--+---+--+--+--+---+--+---+
|CP|C/F|AC|MLS|PD|EM|SC|SI|BM|LN|UML|CF|CT|UT|UID|DB|RAD|
|__|___|__|___|__|__|__|__|__|__|___|__|__|__|___|__|___|
2. pgp cygwin,gnupg
save/gpg.txt
use:
--创建自己的密钥
gpg --gen-key
...
(yangjiandong,qaz123456789)
key会保存在~/.gnupg/目录下,其中公钥文件为 pubring.gpg,私钥文件为secring.gpg。
--密钥的管理
gpg -K #列出当前机器上的密钥
gpg -a -o lily.key --export lily.yu #导出lily 的公钥到lily.key 。
gpg -a -o lily-secret.key --export-secret-keys 2lily.yu #导出lily 的私钥
gpg --delete-keys lily.yu #从公钥钥匙环里删除密钥
gpg --delete-secret-keys lily.yu #从私钥钥匙环里删除密钥
gpg --delete-secret-and-public-key lily.yu #同时删除公钥私钥
gpg --import filenamepubkey #导入一个密钥
--用GnuPG 加解密文件
gpg -ea -r "lily.yu" hello.txt #使用lily.yu 这个密钥加密hello.txt,你会得到一个加密后的文件hello.txt.asc。-a 表示已ASCII 输出.
gpg -o new.txt -d hello.txt.asc #解密hello.txt.asc 文件并输出到 new.txt 文件。
--用GnuPG 为文件做数字签名
gpg -s hello.txt #为hello.txt 加签名,不加 -o 参数会产生一个hello.txt.gpg 文件
gpg --verify hello.txt.gpg #验证该文件的签名
gpg -o hello-new.txt --clearsign hello.txt #将数字签名直接附加在文件中
gpg --verify hello-new.txt #验证
--http://javatgo.iteye.com/blog/1049485
-- WARNING: using insecure memory!
3. djangobook
https://github.com/RaD/djbookru
2012.02.09
----------
1. Psyco speeds up the execution of most Python programs with a single extension module
http://www.insomnihack.com/?p=412
2012.02.07
----------
1. python export oracle to txt
http://weizi888.appspot.com/?p=107001
osqa/src/utils/ora_exp.py
2. vim
* highlight all occurrence of a selected word
:nohlsearch remvoe
dbext : access db server
http://blog.sina.com.cn/s/blog_498a6eeb0100a1pt.html
3. cx_oracle
下载安装cx_Oracle
http://sourceforge.net/projects/cx-oracle/
复制C:\XEClient\bin目录下的oci.dll、oraocixe10.dll、oraocci10.dll到python库目录下
E:\Program Files\Python26\Lib\site-packages
4. in eclipse use vim
http://www.viplugin.com/viplugin/
--收费?
2012.02.06
----------
1. 另一个类似osqa的项目askbot,是osqa的安装版本,但也优化过
https://github.com/ASKBOT/askbot-devel.git
osqa.git
https://github.com/sghael/OSQA.git
开发方式安装: python setup.py develop
same project: http://www.mkyong.com/featured/top-5-open-source-qa-systems/
2012.02.04
----------
1. 这称得上是一个 Vim 的杀手级 Tip,利用该 Tip,你可以快速处理 '、"、()、[]、{}、<> 等配对标点符号中的文本内容,包括更改、删除、复制等。
ci'、ci"、ci(、ci[、ci{、ci< - 分别更改这些配对标点符号中的文本内容
di'、di"、di(、di[、di{、di< - 分别删除这些配对标点符号中的文本内容
yi'、yi"、yi(、yi[、yi{、yi< - 分别复制这些配对标点符号中的文本内容
vi'、vi"、vi(、vi[、vi{、vi< - 分别选中这些配对标点符号中的文本内容
对于经常用 Vim 写代码的朋友来说,善用此 Tip 将极大的提高编码效率。
注:把 i 改成 a 的话,会连配对标点一起操作
2012.02.03
----------
1. android 获取 root 权限
superOneClick
http://www.androidba.net/android-phone-root-with-superoneclick/