Friday, July 25, 2008

Clearing cached passwords in Windows

For quite some time I'd struggled with the occasional problem of cached passwords in Windows. You've probably had this happen before. You have some network resource such as a file server share that you need to access. When accessing it you are prompted for Windows credentials. So you put in a username and password, and because you don't want to go through that process every time, you select "Remember my password".

But then one day something doesn't work or you simply want to change how you are connecting to that resource.

I originally thought it might have something to do with the cached network connection itself. Going into a command prompt and typing "net use" will show you all the network resource connections you've made since the last login/boot. You can also use "net use" to disconnect them. However, if you've saved a password for the resource you still won't be prompted for one even on a new connection.

The question remains: Where exactly do those passwords go??

Go to Start -> Control Panel -> User Accounts

Select the "Manage Passwords" button. You'll get the "Stored User Names and Passwords" dialog:

This contains Microsoft Passport/Windows Live logins that are associated with the current logged in user profile as well as the saved passwords for network connections. You can add, remove or change as you like.

Wednesday, July 23, 2008

Reflection: Personal Uniqueless

Yes, the title says uniqueless, that being the opposite of uniqueness.

A friend of mine uses the the following tagline on his forum posts:
"Everyone is unique, except for me."
When I was growing up, I was told, "You are special... there's no one else like you." That was a nice sentiment. Unfortunately, it's not quite so true. With a world population of nearly 6.7 Billion people, the chances are pretty good that there is someone who's just like me out there, probably even in my own country. (Given cultural influences, it's probably even more likely.) They might even look like me! (Scary thought, and my sincerest apologies.)

Being ensconced firmly in the information society, it's easier more than ever to find people who are like you. You come up with a great idea, google it, and find people who have already done it. Most of the good web site URLs are taken. There's probably someone, somewhere with your name, married to someone with your spouse's name, with the same set of kids. Statistics dictate that's its more than likely.

It's sad really. Growing up as an "individual", thinking your ideas are unique when they most likely aren't. Is this cynicism or just the acceptance of reality? Instead of thinking that my ideas are "special" and "one-of-a-kind", I now take them to the internet and see who else has them to learn more. I get disappointed when I can't find anything, thinking to myself "I must not be looking hard enough, someone must have thought of this already." Or I think that if I can't find anyone else who's thought of this and publicized it, it mustn't be that good of an idea. It is provoking to think about how information availability can provide and discourage.

We may look, act and behave differently, but like the Earth, we are all made up mostly of water and ultimately are just 1 single drop in the very large ocean of the human race.

Monday, July 21, 2008

Merits of a System.Collections.Hashtable

I was recently working on a very simple data analysis process involving two lists of items. One is a list of files on disk, another a list of files in a database table. The work sets were on the order of 85,000 items each. I needed to simply scan each list to see if each item existed in the other. I loaded the two lists into a generic string collection (List) and iterated through each one once, looking in the other for the existence of the item (otherList.Contains(item)). I ran the process and it took a good 2 to 3 minutes to complete. Reasonable I though, as it was many 10s of thousands.

I then thought about the way the code was probably running internally. I imagined that the List.Contains method is probably just doing it's own internal loop and comparing the item against each one in the list until it finds a match. Otherwise, it runs through to the end. I remembered that the Hashtable organizes the list of items by the hash of the key so it might have a better and more efficient way of finding items based on that logic. I refactored the code to use Hashtable instead of the List. In addition to finding that I had some duplicates in the list coming from the database (fixed after adding a "DISTINCT" to the query) I found that the the process now took about 5 seconds! That's an insane improvement. I'm curious how the Hashtable does it's thing.

Tuesday, July 15, 2008

Neuros OSD + WRT160N + DD-WRT = Media center happiness

For a while I have had my eyes on the Neuros OSD: "The Open, Embedded Media Center". Not long ago, I got one. I hooked it up to my digital cable DVR and started playing with it. Unfortunately, I don't have network cabling down to my living room where the entertainment center lives so I was limited to using flash/thumb drives plugged into the front of the OSD. Having only a couple thumb drives of a few gig, this greatly limited the amount of recording I could do, basically a 30 minute show (at highest video size and quality) per drive. While experimenting I relied on sneakernet to move the recorded shows to my 0.5 Terabyte network attached storage.

Whether or not to network the OSD wasn't a question, it would be networked. However, I pondered for a while how I would get it hooked up physically. Due to the limitations in running a physical cable, I was left with the possibility of setting it up via WIFI. Understandably, the OSD does not come with WIFI, only a standard 100Mb RJ45 jack for direct connection to an ethernet network.

So I was off to my local Best Buy to see what they had for wireless devices. I found a standard Linksys wireless access point whose box hinted at the capability of being a wireless bridge. 60 bucks for a single wire to wireless bridge. Meh. For 100 bucks they had a wireless game bridge. Huh?? How is that any different? For 70 bucks I could get a whole standard router/gateway/access point. Despite any marketing-speak suggestion that I might be able to use a standard router as a bridge, I picked the Linksys WRT160N as the hardware for this experiment knowing where I was headed next...

The factory installed firmware for the WRT160N is not much different than previous versions I've seen in the stock Linksys routers (both wired [BEFSR41] and wifi [WRT54G] versions). The options are acceptable but not terribly flexible and there doesn't seem to be a way to configure the router as a wifi bridge. So in comes DD-WRT, an open source wireless router firmware alternative. I followed the specific instructions for the firmware version for my new router, flashing it with the new DD-WRT version (v24). I set up the wireless settings to match my network configuration (enabled WEP, entered keys), added the new router's WLAN MAC address to the MAC address restriction list on my existing access point/gateway, and gave the router the right static IP information to put it on the same subnet as the rest of my gear. After a reboot, I was able to traverse the wireless bridge connection and see network resources on the other side!

Much of this time during setup I had a laptop hooked up and set with a static IP. The new router has DHCP disabled so I needed to ensure that I could connect. To ensure I wasn't getting false positives on my tests I disabled the laptop wireless to ensure everything was going over the wire to the bridge router. Once it appeared that the bridge was functioning properly, I reverted the laptop network adapter settings back to standard DHCP mode to see if I could pick up an address from the gateway/AP/DHCP server. Sure enough, it worked!

At this point I was very delighted that all seemed to be working, however I remained cautiously optimistic, as I still needed to get the OSD wired to it and talking. (There was a very small glint of skepticism because I bought the OSD off a friend who had had problems getting it connected to his network.) I moved the router into it's place into the entertainment cabinet and hooked it up to the OSD. After power cycling both I went to the OSD networking settings screen and instructed it to look for a wireless bridge. Apparently this is not what I needed, as it failed. I suspect that this is for a specific wireless connector device. So instead, I instructed it to configure automatically using DHCP. Again, despite suspicions that I'd be plagued with problems, it worked!

After making the decision to try the wireless bridge approach, I was greatly concerned about the amount of network throughput the OSD would need to reliably stream a live recording to a network drive. I started testing it by playing back some recordings I'd already moved to the NAS box. These played without difficulty. Then I set up a recording and let it run. This didn't seem to have any issues either. (I didn't watch the entire recording so I can't really say for sure that it completed without a glitch.)

Later on I discovered the Bandwidth Monitoring tab under the Status tab of the DD-WRT firmware admin site. This provides a live graph of the WAN, LAN and WLAN network usage in both bits/sec and bytes/sec. While recording at the highest settings for recording resolution, quality and audio sampling, the OSD appears to only be pushing out about 400 kilobytes per second. My existing wireless access point is a WRT54G set to wireles-G mode so the new router is limited to that, however, there is still ample bandwidth and throughput available to service the OSD reliably by the looks of it. I am pleasantly surprised at how well it is all working. (Of course, something will break tomorrow for sure just to prove me wrong.)