Generating sample first names

I had a need to write a script that would give me a random first name.  I grabbed the top 200 first names for baby boys in the US from 2000-2009, and the same list for baby girls: http://www.ssa.gov/OACT/babynames/decades/names2000s.html Boys Girls Jacob Emily Michael Madison … … My initial implementation just printed out the name,…

0

Programmatically adding a folder to a shell library (e.g., the Music library)

I wrote a selfhost tool which allows me to add a folder (for example, C:\music) to a shell library (for example, the Music library.) This was before I found out about the shlib shell library sample which Raymond Chen blogged about.  If you’re looking for a sample on how to manipulate shell libraries, prefer that…

0

Changing the desktop wallpaper using IDesktopWallpaper

About a year ago I wrote about how to change the desktop wallpaper using SystemParametersInfo(SPI_SETDESKWALLPAPER). Windows 8 desktop apps (not Store apps) can use the new IDesktopWallpaper API to get a more fine level of control.  So I wrote an app which uses the new API, though I just set the background on all monitors…

1

Grabbing large amounts of text from STDIN in O(n) time

Last time I blogged about an O(n log n) solution to finding the longest duplicated substring in a given piece of text; I have since found an O(n) algorithm, which I linked to in the comments. But my blog post used an O(n2) algorithm to read the text from STDIN! It looked something like this:…

0