- 博客(202)
- 资源 (25)
- 收藏
- 关注
原创 Python type and object relationship
1) Everything is object in Python, even types (what the hell, how can this happen ? See below bullet points)2) "class" and "type" are the same thing, they are "type objects". "Type objects" can be s
2013-06-25 12:15:17 1849 1
原创 The problematic NULLs
(1) The base principalanything OP NULL => NULLNULL OP anything => NULLNULL doesn't equal anything including NULL NULL = NULL => NULLNULL NULLNULL IS NULL => trueNULL IS NOT NULL => fal
2013-06-17 22:37:03 651
原创 free - Linux tools 2 of n
"free" is used to check the system's memory information.Let's understand its output.sysadmin@ubuntu:~$ free total used free shared buffers
2013-06-15 22:08:53 620
转载 /proc/meminfo
How To Analyse Output Of /proc/meminfo | Linux The /proc filesystem is pseudo filesystem. It does not exist on a disk. Instead, the kernel creates it in memory. It is used to provide in
2013-06-15 21:32:18 1456
原创 top - Linux tools 1 of n
(1) The command linetop -hv|-bcHisS -d delay -n limit -u|U user -p pid -w [cols]# dump top to a text file (-b batch mode)top -b -n 1 > top.txt # use command line instead of command name (-
2013-06-15 12:59:56 939
原创 Linux perf monitor tools
1 - top --> CPU usage, memory usage, swap memory, Cache, Buffer Size, PID process user commands.2 - vmstat -> Virtual Memory Statistics3 - lsof -> open files list4 - tcpdump-i eth0 -> Packet Ana
2013-06-11 09:37:17 1182
转载 C++ auto and decltype Explained
ContentsIntroductionThe auto Keyword: The BasicsThe auto Keyword: The Rest of the StoryWhen auto Is Not a LuxuryThe decltype keyword: The BasicsHow decltype Deduces the Type of an Expression: Case
2013-05-31 22:02:39 2077
转载 C++ Rvalue References Explained
Last updated: March 2013ContentsIntroductionMove SemanticsRvalue ReferencesForcing Move SemanticsIs an Rvalue Reference an Rvalue?Move Semantics and Compiler OptimizationsPerfect Forwarding: T
2013-05-31 21:57:33 2501
转载 How browses work
How browsers workBehind the scenes of modern web browsers Safeguarded by Incapsula IntroductionThe browsers we will talk aboutThe browser's main functionalityThe browse
2013-05-26 22:54:12 1080
原创 Cool tools/binaries you need to know on Linux
1) netstat2) ifconfig3) lsof4) sysstat/iostat5) top6) grep7) awk/gawk8) sed9) chkconfig10) log rotate11) scp12) rsync13) screen14) tup15) ps 16) ls
2013-05-05 20:57:20 666
原创 Greenplum - Merge tables in two different database instances
(1) Solution 1:pg_dump -d launchpad -t src_flr_sum2 | psql lsipsql -d lsi insert into src_flr_sum select * from src_flr_sum2;(2) Solution 2:http://blog.2ndquadrant.com/using_dblink_in_gree
2013-04-22 13:43:48 996
原创 Regex in VIM
1) The metacharacters2) The greedy qualifiers3) The non-greedy qualifiers4) The ranges[12345], [^"], [a-z], [-0-9], ...5) The grouping and backreferences6) The alternatives
2013-04-08 22:20:30 1355
转载 Software development procedure at Facebook
http://www.csdn.net/article/2013-03-15/2814517
2013-04-07 10:26:26 723
原创 Python yield expression (generator)
When a function has a "yield" expression, it is called generator.The generator doesn't run until it is called with next(g) or g.next(). The first time to call the function which has "yield" expression
2013-02-25 09:49:18 804
原创 The implementation of multiprocess.Queue
Note:1) When calling _buffer.popleft(), it doesn't hold any lock in QueueFeederThread.2) It uses semaphore/pipe for mulitiprocess resource management.3) Reader and Writer are holding different l
2013-02-24 15:39:16 765
原创 Solution to the failure of installing pywin32-218.win-amd64-py2.6.exe in Win7 64bit
During the installation of package downloaded from sourceforge.net, it reports the following error in its post installation process.With the following traceback:Traceback (most recent call
2013-01-18 14:42:10 4489
原创 config group quota for smb shares in Ubuntu
1) sudo vim /etc/fsftabEdit the corresponding filesystem entry as below (add "grpquota"):/dev/mapper/lpfs-root / ext4 grpquota,errors=remount-ro 0 12) Remount the file systemsudo moun
2013-01-09 17:46:32 831
原创 Windows - "Multiple connections to a server or shared resource by the same user..."
After created a new smb share directories in Ubuntu and trying to access in Windows, it complains as below :After running the following command, I can access this new share, but I lost the previou
2013-01-09 14:58:05 4310
转载 My End of the World Post
With the coming and passing of the predicated date of the Mayan apocalypse, I got to thinking about what kind of final advice I would leave the development world in the event of my untimely departure.
2013-01-05 09:57:38 930
转载 Suggestion for using "auto" from Herb Sutter
Short answer: More completely, my current opinion on auto is that you should useauto by default unless you explicitly want a conversion. (Slightly more precisely, "... unless you want to explicitly co
2013-01-03 19:38:08 483
原创 Extend ext3 filesystem for RH5 Virtual Machine running in vCluster
1) Add more disk space to RH VM by vSphere a. Power off the RH VM b. Click 'Edit Virtual Machine Setting' in the panel of vSphere c. 'Hardware -> Hard Disk 1 -> Increase the provisione
2012-12-07 13:40:36 716
转载 vector<> VS <> deque<> VS list<>
Here is the summary from an interesting performance benchmark article which comparing vector and list int C++11ConclusionTo conclude, we can get some facts about each data structure:std::l
2012-11-29 18:03:29 573
转载 Universal References in C++11—Scott Meyers
T&& Doesn’t Always Mean “Rvalue Reference”by Scott MeyersRelated materials:A video of Scott’s C&B talk based on this material is available on Channel 9.A black-and-white PDF version of thi
2012-11-27 22:18:52 1801
转载 On the Superfluousness of std::move - Scott Meyers
During my presentation of "Universal References in C++11" at C++ and Beyond 2012, I gave the advice to apply std::move to rvalue reference parameters and std::forward to universal reference parame
2012-11-27 17:19:26 813
原创 Install PostgreSQL 9.2 on RHEL 5, x64
1) Install from rpm a. download rpm from http://yum.postgresql.org/rpmchart.php and then do "rpm -ivhpgdg-redhat92-9.2-4.noarch.rpm" b. rpm -i http://yum.postgresql.org/9.2/redhat/rhel-5-x8
2012-11-22 16:21:56 1321
转载 upsert VS merge
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6618304976523ops$tkyte@ORA920.US.ORACLE.COM> create global temporary table ao 2 on commit PRESERVE ROWS 3 as 4 select *
2012-11-14 22:31:41 1409
原创 A nice article which shows how to root cause the package corruption
http://mina.naguib.ca/blog/2012/10/22/the-little-ssh-that-sometimes-couldnt.html
2012-11-14 22:27:38 606
原创 After clone Redhat machine by using vSphere, can't reach the new machine
After cloning the redhat machine by using vSphere and configure the ip address by using ifconfig, the new machine is not accessible by public network, but can be accessible in the intranet of the VM c
2012-11-14 20:42:28 741
原创 "No match" error while execute the excutable
This related to the C shell and the special characters like "?"{nsgb26}ken_410: echo $SHELL/bin/csh{nsgb26}ken_411: gdb --args./smController -?gdb: No match.{nsgb26}ken_412: ./smController
2012-11-13 18:33:14 543
转载 Python Performance 2 of n - Python Performance Tips, Part 1
Two good articles talking the performance for Python. Bookmark them here.http://blog.monitis.com/index.php/2012/02/13/python-performance-tips-part-1/http://blog.monitis.com/index.php/2012/03/21/py
2012-10-28 14:49:08 675
原创 ctypes free memory which is allocated by C
In Python, how to explicitly free the non-trivial memory (not int/char/ etc) returned by C module ?Say C interface is like as below:____________________struct Dummy{ int a; int b;
2012-10-27 23:29:03 1393
原创 One quick note for poi lib accessing excel
Usually don't use HSSFRow.getPhysicalNumberOfCells() (it may return wrong information) to determine how many columns there are in excel spreadsheet, use HSSFRow.getLastCellNum() instead. getPhysicalN
2012-10-25 11:42:01 441
原创 C module with ctypes
Python ctypes module is very convenient for python to integrate C module.Win7 X64 examples:1) Call c dll library passing in arguments and return structure ptrC lib:------------------------
2012-10-24 16:06:37 769
原创 Watchdog on Linux
On Linux, if we would like to restart our process when it is down without expect, we can achieve this goal by1) As a service, can be used as 'service start/stop program' etcWrite a script which
2012-10-14 10:39:36 521
原创 The protocols - Python
iteration protocol: implement __iter__() methodsequence protocol ([]): implement __len__() and __getitem__() method with integer argument starting at 0iterator protocol: implement __next__() metho
2012-10-08 15:16:10 603
原创 Python Eggs
This is the summary from the network.1) What is Python egg file ?It’s simply a way of distributing Python packages, similar to RPM or Java jar package.2) Where do I find the Python eggs ?You
2012-10-06 10:26:19 1956
原创 Python idioms, 2 of n
1) Don't do trivial assignment in __init__ of the classDon't:class Foo(object): def __init__(self): self.attr1 = 0 self.attr2 = '' self.attr3 = [] self.at
2012-09-26 09:36:06 1324
原创 Python performance 1 of n
If you would like to improve the running performance of Python, try1) Use profile/cProfile to benchmark your program, find the possible hotspot, switch to correct data structure to solve problem etc
2012-09-25 22:43:34 495
MPEG-4 ISO 标准 ISO/IEC14496-3 part3
2009-02-26
MPEG-4 ISO 标准 ISO/IEC14496-3 part2
2009-02-26
MPEG-4 ISO 标准 ISO/IEC14496-3 part1
2009-02-26
MPEG-4 ISO 标准 ISO/IEC14496-1 2004 third edition
2009-02-26
the c++ Standard library C++标准程序库—自修教程与参考手册.part4.rar(中文版)
2007-10-12
the c++ Standard library C++标准程序库—自修教程与参考手册.part3.rar(中文版)
2007-10-11
the c++ Standard library C++标准程序库—自修教程与参考手册.part2.rar(中文版)
2007-10-11
the c++ Standard library C++标准程序库—自修教程与参考手册.part1.rar(中文版)
2007-10-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人