-
Recent Posts
Recent Comments
Mike T. on Code snippet Using WMI via… Drew Canitz on minimal ATL window eskici on file transfer over synchronous… Rose on Purify reported error entry po… duongnguyenvan on file transfer over synchronous… Archives
- August 2018
- March 2018
- May 2017
- July 2012
- May 2012
- April 2012
- March 2012
- January 2012
- October 2011
- September 2011
- July 2011
- June 2011
- May 2011
- April 2011
- October 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- July 2009
- June 2009
- May 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
Categories
Meta
Monthly Archives: December 2006
Allocate consecutive sectors for large file
#include <stdio.h>#include <tchar.h>#include <windows.h>#include <iostream> int CreateFileOfSize(LPCTSTR filename, __int64 len){ HANDLE hfile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,// FILE_ATTRIBUTE_SPARSE_FILE flag will not allocate disk space 0); if(!hfile) { return GetLastError(); } LARGE_INTEGER li; li.QuadPart = len; if( 0 == … Continue reading
Posted in Computers and Internet
Leave a comment
All files in SD card are missing…
I was using a laptop sending a file of 5Mb to my phone via wirelessconnection. After sending, the phone popped up prompting if I wanted toreceive it, I chose yes. But then I don’t know where it was, so I … Continue reading
Posted in Uncategorized
Leave a comment
build boost 1.33.1 with VC80
Open "Visual Studio 2005 Command Prompt",change to boost directryset PYTHON_VERSION="2.5"set PYTHON_ROOT="c:\python25"set PYTHON_LIB_PATH="c:\python25\libs"E:\opensource\boost\boost_1_33_1>bjam "-sTOOLS=vc-8_0" install
Posted in Computers and Internet
Leave a comment
book review: Service Oriented Architecture A Planning and implementation Guide For Business and Technology
Service Oriented Architecture A Planning and implementation Guide For Business and TechnologyThis is not a book for Engieers, it is a book best for sales and people that talk more that do something. After a glance of it, I don’t … Continue reading
Posted in Books
Leave a comment
book review: XSLT Cookbook 2nd Edition
I want to have a turtorial on XSLT, but this book is not the right one. It provided a lot of small scripts, I think those little tips can be easily found in internet by google.
Posted in Books
Leave a comment
Lottery calculator
import randomimport structfor i in range(0, 5): ndict={} #empty dict while len(ndict) < 6: n = random.randint(1, 33) ndict[n] = n keys = ndict.keys() keys.sort() #for k, v in ndict.iteritems(): red_nums = ‘ ‘ for k in keys: print ‘ … Continue reading
Posted in Computers and Internet
Leave a comment
Simple string operation in python
def get_ext(s): # get extension part of file name dot_pos = s.rfind(‘.’) if dot_pos<> -1: print ‘dot position is ‘, dot_pos, ‘ input is ‘, s s = s[0:dot_pos] print ‘output is ‘, sget_ext(‘a.b’) # test the functionget_ext(‘a.b.c’)
Posted in Computers and Internet
Leave a comment
Dump constants defined by enum
I have a long list of constants (all are prefixed with EID_) defined in enum and I want to dump them in user friendly name, so I did a regex replace in Notepad++.Find what: (EID_[_A-Z0-9]*),Replace with: case \1: MY_TRACE("PushEvent(\1)"); break;
Posted in Computers and Internet
Leave a comment
failed to delete ReadOnly file on Windows via Python
The following does not work:win32api.SetFileAttributes( file2, win32con.FILE_ATTRIBUTE_NORMAL)win32api.DeleteFile(file2)#os.remove(file2)win32file.CopyFile( file1, file2, 0)I am in administrators’ group.The following errors occurred: (5, ‘CopyFile’, ‘Access is denied.’)
Posted in Uncategorized
Leave a comment
Oracle Drive and IE7
Our IT helpdesk claimed that Oracle Drive is not compatible with IE7.0, so I give up using it after having connection error. But Oracle Drive works well on my peer’s machine. I have another PC with IE6.0 installed, also can’t … Continue reading
Posted in Uncategorized
Leave a comment