C# Using List.Find

Ever wonder how you use a Predicate Delegate to make the Find function work? Well I was wondering as well, so I found the following useful snippet on MSDN: http://msdn2.microsoft.com/en-us/library/x0b5b5bc.aspx

C# Environment variables

If you ever need to set environment variables in .Net 2.0+, you can use these: System.Environment.SetEnvironmentVariable(“MACHINE_VAR”, “Somevalue”, EnvironmentVariableTarget.Machine); System.Environment.SetEnvironmentVariable(“USER_VAR”, “Somevalue”, EnvironmentVariableTarget.User); System.Environment.SetEnvironmentVariable(“PROCESS_VAR”, “Somevalue”, EnvironmentVariableTarget.Process); string env_val = System.Environment.GetEnvironmentVariable( “PROCESS_VAR”, EnvironmentVariableTarget.Process); These however do have their limitations: If your use does not have privileges to the registry or to set environment variables these will not work. …

Hitting on Ruby…

Some interesting jump-in tutorials here if you’re a Ruby on Rails virgin.  Intersting link there is the one about packaging up your app as a standalone exe for demo purposes…  would like to see what that actually does. I’ve been writing some ruby aps lately and I could have used some login code.  Word on the …

Get a Hobby…

So I was surfin today and came across this article… http://blogs.msdn.com/coding4fun/archive/2007/01/22/1507304.aspx You can get a controller here: http://www.phidgets.com/ If I ever have the time, I’m so doing this! If only I had the time….

Enhance Windows Search

You know how annoying it is when you are working with files that are essentially just text files but then windows search skips over it because it does not recognize the file type? Turns out windows registers filters and they come from the author of the file type. I found this nifty utility that allows …

C# Power Management

So I was messing around with power management on battery powered devices today and I came across a relatively useful class: cPower class. Also see C# Suspend and Wakeup Basically it allows you to check on system state with the following methods: BatteryLifePercent BatteryRemainingSeconds BatteryTotalSeconds HasBattery BatteryLevel BatteryCharging UsingAC DriveAlseep SetPowerReq CanHibernate CanSuspend CanShutdown LockWorkstation …

C# WMI Object Queries .Net 1.x

OK so if you ever needed to use Windows Management Interface to retrieve some shday OS-type values like battery serial numbers or MAC Addresses then you’re in luck. I had to do this today, albeit for relatively rare battery info. Here’s a snippet: StringBuilder sb = new StringBuilder(); try { ManagementObjectSearcher query = new ManagementObjectSearcher(“SELECT …