Categories
Life

More Global Warming Stuff: LiberalHexum Year 2

Last year I blogged about LiberalHexum.org, where Nick Hexum, the lead singer of 311 is running the LA marathon and raising money for global warming. I donated last year, and did again this year. Here is a video from the local LA news station with more info.

I can’t stress how important this issue is, if you can even donate 5 bucks its worth it. Peace 🙂

Categories
Life

IM help stop global warming.

You can help different causes by just using Windows Live Messenger 8.1

Here are the codes:

*red+u American Red Cross
*bgca Boys & Girls Clubs
*naf National AIDS Fund
*mssoc National Multiple Sclerosis Society
*9mil ninemillion.org
*sierra Sierra Club
*help StopGlobalWarming.org
*komen Susan G. Komen for the Cure
*unicef The US fund for UNICEF

I am doing the *help code, to help stop global warming. This is such a cool idea and pretty easy to do. The will donate ad revenue to the charities if you put the code in your name and send IM’s.

Categories
Life

Snow Day Update


Snow Day II

Originally uploaded by ScaleOvenStove.

Well, now that the storm has somewhat passed, it is still snowing out, but not as hard. My car doesn’t seem to want to move though. Wish I still had my truck on days like today, although, the 20 dollars a month in gas makes up for it in the long run (compared to 65 dollars a fillup on the truck every week)

At least we have the option of working from home today, so I can take advantage of that. Now that I have my Wii, I can even take Wii breaks, just like at the office 🙂 (although I have only played like 2 times at work)

Categories
Geeky/Programming

C++ – Release Your Buffers

I am in the process of taking some 3rd party c++ source code, and converting it to VS2005. One thing I noticed over and over, is that when you are reading in file contents, you need to make sure to release the buffer, but with the length of the file as the parameter.

For example, this code:

CString myData;

if (file.Open(lpszFilename, CFile::modeRead))
{
DWORD dwLength = file.GetLength();

file.Read(myData.GetBuffer(dwLength), dwLength);
myData.ReleaseBuffer();

file.Close();
}

will throw an assertion when in debug mode

GetData.JPG
to fix, add the dwLength value to your ReleaseBuffer()

myData.ReleaseBuffer(dwLength);

if you run the bad code in release mode, nothing happens, which suprises me, you would think that the runtime would croak, but it doesn’t. Anyways, make sure to release your buffers.

Categories
Life

Snow Day


Snow Day

Originally uploaded by ScaleOvenStove.

What do you do what the office closes early? Stop by the local watering hole, and take advantage of the free wi-fi

Categories
Life

Legend of Zelda Ocarina of Time

Now that I have a Wii, I’ve been downloading old Nintendo games. The Legend of Zelda Ocarina of Time, what a great game. Spiller and I played this all through sophomore year of college, between classes and parties. We could never find the triforce though!!

Update: fixed spelling and added link to Spiller’s MySpace

Categories
Geeky/Programming

fatal error CVT1100: duplicate resource.

More C++ gotchas. You get this error, what do you do?

Check your resource file, there is a resource with an ID of 1. Change it to something (5000) or whatever, and rebuild. You should be good to go.

Categories
Geeky/Programming

error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'

If you are updating from VS2003 to VS2005, C++, you might run across an error like this. What it means is that they changes the return types from 2003 to 2005. You just need to change the UINT to an LRESULT and you should be good to go.

Categories
Geeky/Programming

FizzBuzz Test

This is all over the blogs today:

CodingHorror.com. Jeff Atwood writes a great post entitled Why Can’t Programmers.. Program?

Just for kix, I did it, just so I knew I wasn’t crazy 🙂

for(int i = 1; i < 101; i++)
{
if(i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if(i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else if(i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else
{
Console.WriteLine(i.ToString());
}

}

Categories
Geeky/Programming

ForFiles – Delete files older than X amount of Days

Windows 2003 – ForFiles

FORFILES /P C:MyPath /S /M log*.xml /D -30 /C "cmd /c del @file"

/S – look at subdirectories

log*.xml – that is the file pattern, you could have it be like *.txt for example

/D -30 = files greater than 30 days

/C – thats the command you want to run

this is pretty much a one line command that could replace a ton of vbScripts, batch files, and other apps I have seen over the years to clean up files. Something for every sys admin’s toolbelt.