Author: Haidong Ji

  • Find and replace text in a file with Python

    Continuing my Lego block building, here is the code for myself and whoever will find it useful. Two blocks of code, the first one searches and replaces, then write the results to a new file, leaving the original intact. The second replaces things in place. Highlights: 1. os.path.join is cool, but you’ve got to be…

  • Reading and watching journalists

    Time permitting, I think it will be a worthy endeavor to conduct a study of the history of China reporting and its impact worldwide. In order for the study to be valuable, the entity who is doing it should not have a patronizing attitude, who has the need to enlighten, educate, and proselytize to fill…

  • Building up Python Lego pieces – some directory stuff

    I lost all my Python code that I have written and collected over time, don’t ask why. So I am in the process of building that back up. Here is some code to create directories for a SQL Server gig I am working on. Highlights: 1. Use os.path.join to take care of the forward and…

  • Unattended install of SQL Server 2008 R2

    I’ve written unattended / silent install before for SQL Server 2005. Unattended install is cool because you can automate things: it saves time and improves consistency. Here is something to get you started. I used the command below to: 1. Install SQL Server 2008 R2 default instance, including Replication and FullText search; 2. Install client…

  • Testing Windows IO with SQLIO and SysBench

    To benchmark IO on Linux and MySQL transaction processing, SysBench is a popular choice that can do both. After poking around at the source code, it seems PostgreSQL and Oracle are also included for transaction processing testing if you have the proper header files, but I didn’t test those. To benchmark IO on Windows and…