Log in

No account? Create an account
verdammt... nie kann ich schlafen - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

verdammt... nie kann ich schlafen [Jul. 18th, 2002|05:11 am]
Brad Fitzpatrick

Remember my brilliant plan of sleeping yesterday really early? Yeah, well, I did. And then I slept until past noon anyway. So.... too much sleep = I'm still awake now. Bleh. I should set an alarm next time I attempt that.

Two different morons attempted to race me today coming home from the gym. I so smoked their asses it wasn't even funny. Repeat after me: STUPID STICKERS DO NOT A FAST CAR MAKE!

I'm getting in need of a haircut. This girl that works at my DSL provider managing the router and stuff is also attending beautician school for hair.... I wonder if she needs victims. Better than me doing it. Maybe I'll call her tomorrow after 6 and ask for my reverse DNS changed and a haircut.

Umm.... I wish I had a hot tub right now. Too bad they're expensive. Maybe PicPix will make enough money by winter so I can buy one. That'd rule. I don't want a hot tub in summer, anyway.

I worked on FotoBilder for a few hours tonight .... love being in the middle of big projects coming together. You work on infrastructure (DB schema/APIs) for so long and then boom... suddenly everything starts to tick, and the pace only accelerates. I'm in my own virtual race now with Evan .... I gotta finish my management stuff before he finishes the Windows client. Not that it matters, but once the Windows client is ready, a ton of testers will be handy.

I made a cheese omelet[t]e today. It was good.

The End.

[User Picture]From: detritus
2002-07-18 05:27 am (UTC)
Careful Brad, you better watch out for those Ford Thunderbird R cars
(Reply) (Thread)
[User Picture]From: revjim
2002-07-18 05:35 am (UTC)

But.. but.. vinyl adds horsepower.
(Reply) (Thread)
[User Picture]From: mobley
2002-07-18 06:16 am (UTC)
i guess i'm going to have to peel off all my "volvo racing" stickers.
i was hoping for any help i could get.
(Reply) (Thread)
[User Picture]From: visions
2002-07-18 06:52 am (UTC)
what kind of car do you have now? i take it you got rid of the accord?
(Reply) (Thread)
[User Picture]From: brad
2002-07-18 01:47 pm (UTC)
Don't hate. My Accord's the bomb. :)
(Reply) (Parent) (Thread)
From: dninawars
2002-07-18 09:30 am (UTC)
Warum kannst du denn nicht schlafen??? Hast du das mit den Fotos schon gemacht??
(Reply) (Thread)
[User Picture]From: brad
2002-07-18 11:27 am (UTC)
Weil mein Kopf lauft.

Welches Fotos? Ich hab schon vergessen. :(

Ich warte auf meine neue Webseite, bevor ich Fotos uploaden kann.
(Reply) (Parent) (Thread)
From: evan
2002-07-18 11:23 am (UTC)
This is about all the code I have so far, mostly to test these APIs I haven't touched in a while:

hInet = InternetOpen("Win32-FotoBilder", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (hInet) {
	hConn = InternetConnect(hInet, "fb.bunny.e", INTERNET_DEFAULT_HTTP_PORT,
		NULL, NULL, /* user, password */
	if (hConn) {
		hHTTP = HttpOpenRequest(hConn, NULL, "/", NULL, NULL, NULL,
		if (hHTTP) {
			if (HttpSendRequest(hHTTP, NULL, 0, NULL, 0)) {

(Reply) (Thread)
From: evan
2002-07-18 01:09 pm (UTC)
Windows MD5. Seems a bit complicated, eh?

char hashme[] = "hello there";
BYTE bHash[255]; DWORD dwHashLen;
CString hash, result;

if (CryptAcquireContext(&hCryptProv, NULL, NULL,
	if (CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash)) {
		if (CryptHashData(hHash, (BYTE*)hashme, strlen(hashme), CRYPT_USERDATA)) {
			if (CryptGetHashParam(hHash, HP_HASHVAL, bHash, &dwHashLen, 0)) {
				// we succeeded!  we'll fall through below.
			} else HANDLE_ERROR()
		} else HANDLE_ERROR()
	} else HANDLE_ERROR()
	CryptReleaseContext(hCryptProv, 0); 
for (DWORD i = 0; i < dwHashLen; i++) {
	hash += as_hex_digit(bHash[i] >> 4);
	hash += as_hex_digit(bHash[i] & 0xF);
result.Format("Hash of '%s' is '%s'.", hashme, hash);

(Reply) (Parent) (Thread)
[User Picture]From: brad
2002-07-18 01:11 pm (UTC)
dear god.
(Reply) (Parent) (Thread)
[User Picture]From: supersat
2002-07-18 08:47 pm (UTC)
.NET/C# version:

public static string hashPassword(string password) {
    MD5 md5 = new MD5CryptoServiceProvider();
    StringBuilder hpassStr = new StringBuilder();

    byte[] hpassword = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password));

        hpassword[0], hpassword[1], hpassword[2], hpassword[3], hpassword[4], hpassword[5], hpassword[6], hpassword[7],
        hpassword[8], hpassword[9], hpassword[10], hpassword[11], hpassword[12], hpassword[13], hpassword[14], hpassword[15]);

    return hpassStr.ToString();
(Reply) (Parent) (Thread)
[User Picture]From: brad
2002-07-18 08:54 pm (UTC)
Umm... that one ugly line alone makes it painful.

Surely you can rewrite that to not suck so much. ;)
(Reply) (Parent) (Thread)
[User Picture]From: supersat
2002-07-18 09:00 pm (UTC)


There's actually a // TODO comment above it reminding me to redo it.
(Reply) (Parent) (Thread)
From: evan
2002-07-18 10:40 pm (UTC)


Yeah, I kept hitting .NET docs when I was searching for a built-in MD5 function because I didn't know what it was named...
(Reply) (Parent) (Thread)
[User Picture]From: supersat
2002-07-19 12:24 am (UTC)


I was hoping there'd be some sort of way to convert a byte array into a string of hex characters, but there isn't.

I also had a difficult time trying to figure out how to hash a string. Turns out I had to convert the string to bytes (using System.Text.Encoding.UTF8.GetBytes() or System.Text.Encoding.ASCII.GetBytes()) first.
(Reply) (Parent) (Thread)
[User Picture]From: niko
2002-07-18 02:03 pm (UTC)
I've seen a lowrider Festiva Type R. I hope to god it was a joke.
(Reply) (Thread)
[User Picture]From: ccupguy
2002-07-18 04:48 pm (UTC)

Hey Brad...

Won't the fact that JPEG's aren't free (http://www.theregister.co.uk/content/4/26272.html) get in the way of making money with picpix ?
I didn't know if you'd seen that article and it might be of interest to your project.
(Reply) (Thread)
[User Picture]From: chran
2002-07-19 03:04 am (UTC)
>This girl that works at my DSL provider managing the router and stuff is also
>attending beautician school for hair....

Maybe this means you spend too much time on the phone to the support line...
(Reply) (Thread)