Programming magic, glory, and juices.

Recent YouTube Favorites >>

heath ledger singing Frankie Valli & The Four Seasons- Hits Medley : Frankie Valli & The Four Seasons on the
Popendipity tv program in 1967.Performing a medley of Sherry,Big Girls Don't Cry, I've Got You Under My Skin & Bye Bye Baby . (Tags: Frankie Valli Four Seasons Medley 1967) (111423 views, rated 4.90)Frankie Valli - Grease  (1978 Footage) : For HQ add &fmt=18 to url (Tags:  disco rso grease film soundtrack frankie valli RTL4 jukebox) (135441 views, rated 4.88)The 4 Seasons - Sherry : Classic performance - The 4 Seasons performing 'Sherry' (Tags: 4 Seasons Sherry Time Life Sound Of The City) (17595 views, rated 4.65)FRANKIE VALLI - Big Girls Don't Cry : Frankie Valli, along with Tommy DeVito, Nick Massi, and Bob Gaudio, the original members of The 4 Seasons, were inducted into the Rock and Roll Hall of Fame in 1990 and the Vocal Group Hall of Fame in 1999.

Valli scored 29 Top 40 Hits with The 4 Seasons, 1 Top 40 Hit under The 4 Seasons alias of 'The Wonder Who?' and 9 Top 40 Hits as a solo artist. As a member of The 4 Seasons, Valli scored Number One Hits with Longhorn concept : a video of an early longhorn concept from 2003.( vista does not look like this) (Tags: longhorn windows aero) (743272 views, rated 4.38)Civil Protection: Friday : Episode 1 of the comedy series based off the game Half-Life 2.  Check out the official site at http://civil-protection.blogspot.com for more episodes. (Tags: half life machinima civil protection friday ninja) (181356 views, rated 4.86)Crazy badminton : a really long rally (Tags: badminton) (1536908 views, rated 4.85)
Recent Comments >>

C# Converting hexadecimal string to/from byte array, FAST!

June 26th, 2008


I previously wrote about how to quickly convert a byte array to its hex representation and back again in C. Now I’ve converted the same source code to C#. Even though there is a built in method using String.Format, it is too slow.

  public static string ByteArrayToHexString(byte[] Bytes)
  {
	 StringBuilder Result;
	 string HexAlphabet = “0123456789ABCDEF”;

	 Result = new StringBuilder();

	 foreach (byte B in Bytes)
		{
		Result.Append(HexAlphabet[(int)(B >> 4)]);
		Result.Append(HexAlphabet[(int)(B & 0xF)]);
		}

	 return Result.ToString();
  }

  public static byte[] HexStringToByteArray(string Hex)
  {
	 byte[] Bytes;
	 int ByteLength;
	 string HexValue = “\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF”;

	 ByteLength = Hex.Length / 2;
	 Bytes = new byte[ByteLength];

	 for (int x = 0, i = 0; i < Hex.Length; i += 2, x += 1)
		{
		Bytes[x]  = (byte)(HexValue[Char.ToUpper(Hex[i + 0]) - '0'] << 4);
		Bytes[x] |= (byte)(HexValue[Char.ToUpper(Hex[i + 1]) - '0']);
		}

	 return Bytes;
  }

October 27, 2000

June 21st, 2008


Took this photo on October 27th, 2000 at 8:13AM in Puyallup, Washington probably on the way to school.

Secure your wireless network

June 9th, 2008


We have some wireless network in our apartment complex that is unsecured. I tooked the liberty of disabling that wireless network today. I hate having my computers try and connect to an unsecured network, even in the case that my network is down. Why? Because if it fails once to connect to my network, and instead connects to their unsecured network, then I have to reconnect it to my network if I want to RDC to it. As for the 10 people that were leeching that internet connection, boo yea. If it happens again, I’ll just try and upgrade the firmware wirelessly which would disable the router hopefully. That’s what you get when you don’t secure your wireless network.

A SET without a GET?!!

June 9th, 2008


How is it possible that Microsoft didn’t introduce PBM_GETBKCOLOR/PBM_GETBARCOLOR until Windows Vista? I mean, I can’t imagine it! The progress bar messages PBM_SETBKCOLOR and PBM_SETBARCOLOR are supported in Windows 95+, but it took them until Vista to develop PBM_GETBKCOLOR and PBM_GETBARCOLOR??!! How do failures like that go overlooked for such a long period of time?

Story of my brother’s kidnapping

June 4th, 2008


My brother was drugged and kidnapped at a San Diego club. He managed to escape. Here is his story.

The purpose of this email is not to worry any of you but only to inform you of an event that has just recently happened to me just one day after my birthday.

It was a work event, and most everyone from the Navy that I worked with plus some attended. We all were going out in celebration of a fellow co worker leaving our duty station and starting life in the civilian world. The celebration was also an event in celebration of my birthday, which was the day prior on the 30th of May.

The night was awesome! Everyone was drinking and communicating, alcohol was much a friend of ours thru the hours of the night. I arrived at 11:45 pm and midnight was nearing. My friend David had accompanied me to the occasion and we both had a little vodka before we started drinking at the club, just to save some money in the long run. Well in the course of 2 to 2 and a half hours I had had a 4 shots and 1 drink.

On a normal 2 to 3 hour span I would be feeling giggly. Not sober though. Unfortunately this night
turned out to be different.

I dont remember the club lights turning on, I dont remember leavings, I only remember saying “yeah lets get some pizza” A glimpse of a mexican appeared.

I asked ” Where are we going”
He replied “with your friends”
“Who are you?”
“Im one of your friends”

Soon I woke up, my door opened…. “get out the voice said”

I replied “where are we?”
The mans voice replied “my house, just come on in, you can crash here”

The front door opened. In front of my blurred eyes I could see brown stacked boxes and pitch black to the right and left. To the left there seemed to be a hallway. The man or figure of a man pointed for me to go left down the black hallway. I was drugged…I was definitely not drunk, because Ive been drunk and this was not the feeling. I definitely knew the situation was not right and I had no friends or familiar faces around. I tried to switch the subject saying I was thirsty and dont feel good….something else probably around the lines of “I wanna go home”. The man disappeared and came back with what resembled a 20 ounce sprite bottle with some murky color added to
it….almost like a citrus sierra mist drink or something. I refused the drink and the man insisted
with a demanding voice. I drank a little and remember thinking “poison” in my head. When I began to put the lid back on the man demanded I “FINISH IT ALL”. I remember being very scared in the situation. No phone….no friends….

I had been kidnapped with no idea how I got where I was! At the same time i thought “how could this be? This is my home town! This is San Diego!”

I pleaded for fresh air and a walk. I reached for the door knob and heard an agressive response.

“WHERE DO YOU THINK YOUR GOING?”

I replied ” I need a walk/fresh air/walk, stuttering anything that my impaired brain could spaz out for the sake of my situation and freedom!”

The man unlocked the door and I opened the handle and ran….most likely like a drugged loon. But I just ran and ran and ran! I looked at houses for a possible safe place, but the addrenaline I had going thru my body was telling me that I was all alone and anyone could possible be involved. It was a horror flick and I was the teenager/ young adult trying to escape death!

I ran to a street intersection. To the right I saw a maze of streets with no busy roads! To the left I saw a coldisack with a fence!

I thought this might be my only way out! I ran to the fence to find a trolly station, which by the way are extremely dangerous at night, depending which stop you are at. I figured it would have been safer than contracting ass rape trauma, or having my loved ones find my body sliced to pieces, or even worse my body intact with organs missing! I ran back to the street of the house I left at first to double check a safety point! There was nothing that my flashbacks tell me looked safer than jumping the chain linked fence to the trolly station.

I finally stopped in front of the fence and argued with myself! NO PHONE! NO PHONE! I CANT CALL WITH A DIGITAL CAMERA, I CANT CALL WITH A WALLET! THE ONE THING I NEED I DONT HAVE!!!! NO PHONE!

A flashback….

Suddenly a flashback shows me over the fence, carefully trying to scrimmage my way down this hill
covered in slick green ice plants and patches of lose gravel and dry dirt! I slip!….

A flashback….

“Do you know who you are?”

Reality! BOOM! ZIRI? ZIRI!!! ZIRI?! WAKE UP DUDE!!!
ITS 4 IN THE AFTERNOON! WAKE UP!!!

One of my first class petty officers was there.
“FEGER! WHERE AM I?”

“Your at work Ziri, youve been passed out all day”

“Where am I? How did I get here?

Questions upon questions ran thru my mind. I had total amnesia…. No recollection of anything, just
what I have written above from starting sentence to now!

I was found snoring in an alley near college area of San Diego. The police said it was a very bad area and that I was lucky to be intact! The police somehow got information out of me which I dont remember even the slightest bit….

The san diego police then handed me over to the military police who then handed me over to my work on base. AC2 Peraza dragged me unconscious from the squad car to the bunk room inside of our shop.
Another sailor began questioning me, and later the next day told me I had muttered only but a few words.

“I hate mexicans, I hate mexicans, there were three of them and they wouldnt leave me alone!”

I then woke up and my Navy Chiefs who I love and have the upmost respect for, took care of me. Chief Pullen escorted me to the Naval Hospital Balboa where my urine was tested for drugs.

After a near 2 hour wait I was brought to the back room undressed and given my results. I had been
Highly drugged by a anesthetic drug used in hospitals called “benzodiaz”. I cant really remember much of the day after that. I could barely walk and my coordination was shot from the minute I woke up til
about mid day today June 3rd. This whole incident took place the morning of June 1st.

Im assuming that my captors didnt mug me, but after my spill down the hill in search of help, maybe 3
mexicans beat me and mugged me. I have a bruise on the left backside of my head. My right thigh and the right front of my head. They took my digital camera, wallet and even my promotion cards for DJing. Either way…. I am lucky to be alive and thank all of you for the support and care thats been given since.

For all the military reading this…..PLEASE PLEASE PLEASE! Watch your buddies!!!! Dont leave them, watch their drinks! Girls are never so important that you have to ignore your friends, and if your not going up to groups of girls in numbers equal to or larger than you and your group, you not really pimpin anything. So bottom line! WATCH YOUR SHIPMATES AND LETS NOT LET THIS HAPPEN AGAIN!

Once again thank you to all the Chiefs, First Classes, and everyone down the line who showed concern and asked if i needed assistance. My gratitude and graciousness is never ending to you! Thank you again!

The police drove him back to the neighborhood and he couldn’t identify the house that he was at. VISA is investigating the charges to his credit card. Recently he heard of the same thing happening to somebody else except that they were found dead in an alley.

Windows slow file sharing over wireless

June 2nd, 2008


Lately I’ve noticed that my Windows XP file sharing speeds have took a dump.

You know lots of people have a prejudice against wireless internet connections. That if you are using a wireless internet connection and it is downloading slow it is because it is wireless. BS! My wireless internet connection is able suck dry all of the bandwidth that my ISP gives me. Yet, my LAN transfer speeds were well below the transfer speeds that I’m capable of getting when downloading normally from the internetz.

When playing large video files over the wireless network, it would always stutter. I tried various things to help improve it. I switched my media player from Media Player Classic to Windows Media Player, since Windows Media Player has some advanced networking options. What I noticed was that Media Player Classic stutters a lot more than Windows Media Player when playing files across the network. Yea, I love MPC just as much as the next guy, but it doesn’t have any network buffering options. Yet, even with those options turned on in Windows Media Player I was still getting pausing and stuttering, but not as much as I was with MPC.

So in order to test the speeds of the file transfers across the LAN I setup an FTP server on one computer and then started downloading from my other computer. What I noticed was that at first I was consistently getting 100KBps. So I went in the router and changed some options, and sure enough D-Link’s Firewall SPI feature slowed down LAN file transfers. With SPI turned off I got 500-600KBps. I then turned it back on to see if SPI was indeed the reason for the transfer and when I turned it back on I got 200KBps. So I have reason to believe that the SPI option in the D-Link router slowed down file transfers in Windows and I have my suspicions that it not only slowed it down, but over a period of time of high usage that it actually degraded the transfer speed.

Performance testing

June 1st, 2008


I thought it might be cool to show a bit of how I run my multi-threaded batch mode tests for WebShot.

Basically I have a class called DebugDlg that allows me to easyly throw any kind of information about an instance of an object to a listview control. Then you can also organize object types by tab. The DebugDlg class uses dialog templates so it isn’t dependent upon including a resource file into the project. I even thought about making it do graphs and stuff so that you could see the change in the number of objects or resources being used at any one time.

The time in the screenshot is accurate.