We discuss how to modify Union-Find algorithm to get the largest element in each connected components with every operation taking logarithmic time or better. And it turns out an extra array has to be allocated to keep the largest value and no constant extra memory approach could be achievabl

Read More
A matlab implementation is given for the problem to randomly select a number i (i >= 1 and i < = n) with probablity Pr(i), from 1 to n where n >= 1 given a probability discrete distribution P, such that Pr(i) = pi.

Read More
A quite neat and vectorized copy of matlab code to implement mutation operator of the genetic algorithm is given after introducing the mutation operator and the naive and basic implementation.

Read More
I rewrite an incompatible SQL script to create table correctly on both SQL Server 2008 and 2000. I also analyzed the detailed difference between these two different scripts and explains why they could create the same table.

Read More
I just wrote some C++ code to export data from MFC list control into CSV file. And it supports different options with whether or not to include the header names into the CSV file and the delimiter in the CSV file could be customized as well. The code applies to list control with any number of columns and row.

Read More