Friday, August 29, 2008

AFK: Gator Game

going to first gator game of season, BRB.
if yer in g-ville COME GET WASTED WITH ME.

Wednesday, August 20, 2008

Resource files, satellite assemblies, and you

So while at work doing a POC for a C# windows form, i was fiddling with the resource files for my app. If you are not aware of them, resource files are compiled text or XML files that contain key-value pairs. You create a form (or a website if yer doing ASP.NET) that has some default textboxes, labels, and such. Then you create some text/resx files that contain the key-value pairs and rename them to match the culture you are using (en-US for US english, de-DE for german, etc).
After adding a custom section in the app.config file via an example from this guy Derik, i was now able to add languages to a drop down on the fly.
The next step was to create the resource files for each of the languages. Now creating them through the 2k5 IDE is obviously the simple and easier way to go as the compilation and generation of resources is done for you at compile time.

But my requirements needed to be able to compile the app once and add language resource files at any given time. While there is still a process to do it, it can be done with very little effort.
The steps include:
- create a text file or resx file and add some key-value pairs
- compile the file into a resource file using the resgen executable that comes along with Visual Studio
- link the resource file into a DLL
- create a new folder in the working folder, named after the culture you are adding
- plop it in, edit the app.config and POOF, yer off

Now as easy as it sounds, i did run into issues. The main error message being:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "YOUR RESOURCE HERE" was correctly embedded or linked into assembly "YOUR ASSEMBLY" at compile time, or that all the satellite assemblies required are loadable and fully signed.


There were some details left out in the many examples out on the interwebs and it seemed a lot of people came across the same issue i had. Basically, after compiling the resource file and linking to a DLL, the application still couldnt find said DLL and its resources.
It turns out that when you compile the resource file, you need to add the namespace of the calling application thats using it.
Before, i was doing this:

resgen german.txt Form1.de-DE.resources


where Form1 was the default form name from Visual Studio. Where as the correct way to do it was to run it as
resgen german.txt TestAPP.Form1.de-DE.resources


and then from there we need to link it to a DLL

Al.exe /t:lib /embed:TestAPP.Form1.de-DE.resources /culture:de-DE /out:TestAPP.resources.dll


After putting it in the correct folder, things went great. Now im currently working on getting a datetime object to format correctly for neutral cultures... if anyone has info on that let me know

Friday, August 15, 2008

Shadow Priest NOM NOM NOM NOM

First got my
[Frozen Shadoweave Robe]
[Frozen Shadoweave Shoulders]
[Frozen Shadoweave Boots]
and now
[Belt of Blasting]
DPS mana battery here i come!

and on a real life note, we find out next week whether the baby is a boy or girl... though they are determining this through bizarre means... id rather have DNA evidence then measuring certain aspects of the head size or skin behind the neck or whatever they are doing. For you parents out there, is that how they do it?

Tuesday, August 12, 2008

Friday, August 8, 2008

Im an Idiot

Soooooo. I was mistaken. It seems i have way too many partitions for my 4 HDDs and coupled with the fact i had a USB hub with some flash drives attached and a card reader installed when i reinstalled windows (on a different partition thank god, as apparently when i first installed windows, it was NOT on the C drive as i thought) that the new windows install didnt recognize one of my hard drives, at all. So i thought my files were overwritten when in actuality they werent even seen.
After pulling out the hub and unplugging the card reader, the new windows install finally could see my other HDD, and with it my old windows install. So after copying over the hal.dll from new to old, i restarted and entered the recovery console.
I recreated my boot.ini and moved to the next step.
From there, i discovered (at least it seems) that before i installed the new windows, i couldnt run bootcfg /rebuild on my C drive because there was no installation of windows on there previously, but i understood the error as "yer fucked".
But it seems that that was the case, as i ran it again on the old windows partition and it ran fine. I included my old install in the rebuild but not the new one. Rebooted and BAM, old windows works again. I then proceeded to delete everything i can from the new install and happy days are here again.

Thursday, August 7, 2008

UGH

Ok so my windows install got corrupted. Apparently the hal.dll file was bad or missing. So a little research points to 2 things, that i either have a bad or missing hal.dll, or i have a bad or missing boot.ini.
The most direct solution is to unzip the hal.dll from the xp cd onto your computer into the windows/system32 folder through the Recovery Console. Easier said than done as i haz ACCESS DENIED to my windows folder. Well shit. So another advice that "looked" to work was to install windows into a different folder, then move over the correct files to the old windows folder since you can access these files through reg windows. I must have not done it right, as it was supposed to prompt me to choose whether to install over the old installation or choose a new directory.
it didnt.
it installed over the old directory.
everything in my documents and desktop are lost now as it was overwriten. no more pics, no more itunes library, no more random notes i write myself on my desktop.
gonna try to see if a file recovery prog will work but it looks like im shit outta luck.
So lesson of the day, either backup your desktop files and my document files, or make sure to keep them NOT in those folders. As if you do try to reinstall windows, you might screw yerself like i did.