Friday, November 30, 2007

banana

its funny how simplest of things bring back some powerful memories. like today, i bit into a banana, and it was like a stormclould of memories just passed by in a split second. it reminded me of my first experience at a supermarket in the US, and how plastic everything looked in the vegetable/fruits section. i do not remember eating bananas in korea, but my first memory of a banana is in the US. And when i bit into it, it had this funny green, citrus, very rounded sweetness to it. it wasn't the best thing i tasted, but definitely was something i could get used to. enough of that, back to my banana.

Tuesday, November 20, 2007

sourdough: yuck or mmmmmmm?

From wikipedia: Sourdough bread is made by using a small amount (20-25%) of "starter" dough (sometimes known as "the mother sponge"), which contains the yeast culture, and mixing it with new flour and water. Part of this resulting dough is then saved to use as the starter for the next batch. As long as the starter dough is fed flour and water daily, the sourdough mixture can stay in room temperature indefinitely and remain healthy and usable. It is not uncommon for a baker's starter dough to have years of history, from many hundreds of previous batches. As a result each bakery's sourdough has a distinct taste. The combination of starter, yeast culture and air temperature, humidity, and elevation also makes each batch of sourdough different.

Friday, November 16, 2007

Thinkpad Power Manager Problem

There's a lot of misinformed information about how to fix the Power Manager problem where the profile does not set, or the list is blank. I have a rock solid answer why this occurs, and how it can be addressed.

Bug #1. The list is blank. This is because the lowest numbered Profile Policy in the registry is blank. For example:
[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\1]
If it doesn't contain any information, your list of profiles in the power manager will be blank. Every time the power manager is accessed, it will create approximately 4-10 additional default profiles due to a bug.

Bug #2. Newly created (or even default policies won't set). This is because when there is a background policy of power manager is running, it won't let you set policies where the number (according to the registry) is above 50. You can test this by:
Terminate the both instances of power manager, open up the windows task manager (taskmgr.exe), go to processes tab, and just to be sure that we kill the process, kill all that say rundll32.exe.

Start up a foreground instance of power manager, go to start -> all programs -> thinkvantage -> power manager. you'll notice now (by referring to the registry's profile numbers) you can now set any profile in that list, even profile policies above #50. For verification of the problem, start up the background process again by going to start-> run:
rundll32 C:\PROGRA~1\ThinkPad\UTILIT~1\PWRMGRTR.DLL,PwrMgrBkGndMonitor
and switch to any profile policy #50 or below (like number 10) which should set. then try switching back to a profile that is higher than #50 (like number 90). It will NOT set.


5 Steps in getting this problem handled once and for all.

1. Go to: [HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies] and delete ALL the policies.
2. (close first if its open) Open up a Power Manager. (This action will create 4 default profiles when none exist.) Don't worry about not being able to set them just yet.
3. Create any custom profiles that you want. Don't worry about not being able to set them.
4. (close first if its open, as the registry needs to reload), Open up the registry (regedit.exe) and go to: [HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies]
5. Renumber these (the profile numbers on the left panel) starting from 1.
6. Set [HKEY_CURRENT_USER\Control Panel\PowerCfg]"CurrentPowerPolicy" to an existing number.

I've emailed ibm about how to fix it. Lets see if they do anything about it. its been a major bug that's been around for years.

Optional Step...if you've for some reason deleted the GlobalPowerPoilcy\Policies key, then you gotta have it. Here's an example
[HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy]"Policies"=hex:01,00,00,00,00,00,00,00,03,00,00,00,10,00,00,00,00,00,00,00,03,\ 00,00,00,10,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,00,\ 00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,01,00,00,\ 00,00,00,00,00,01,00,00,00,03,00,00,00,03,00,00,00,00,00,00,c0,01,00,00,00,\ 05,00,00,00,01,00,00,00,0a,00,00,00,00,00,00,00,03,00,00,00,01,00,00,00,01,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,16,00,00,00

Monday, November 5, 2007

Get UTC/GMT time in classic ASP

ASP doesn't have the .NET UtcNow() function, but you can easily make one. Code I found on google seemed overly complex for such a simple solution. this lets you get the server UTC time in classic ASP, it outputs the time in datetime format, and the function is conveniently named UtcNow so that if you wanted to transfer your code to asp.net later, it would already be taken care of. make sure you replace the brackets and put the javascript in the head.



[script language="JScript" runat="server"]
var serverdate=new Date();
[/script]

[%
Function UtcNow()
UtcNow = serverdate.toUTCString()
UtcNow = CDate(Replace(Right(UtcNow, Len(UtcNow) - Instr(UtcNow, ",")), "UTC", ""))
End Function
%]