Main

September 13, 2007

vi Ninjas

I don't know anyone besides myself who uses vi as their primary text editor. I would not consider myself a vi Ninja either...I'm more of a vi wheelbarrow. There are some users out their who will straight up scare you with the stuff they can pull off in vi...like a Ninja in the darkness they can edit an entire file with a single regular expression wrapped in vi commands typed faster than the eyes can follow. I'm worried vi is a dying art that will be lost under new generations of GUI only users.

Posted by stm at 03:03 PM | Comments (3) | TrackBack

September 10, 2007

RealPlayer 11 Beta

I had to install Realplayer 11 Beta on some older machines to be imaged, and it was exhibiting some peculiar behavior. The executable forked (or whatever the windows equivalent might be) and was running two instances of itself. The one instance was spiking at around 97% to 100% CPU usage, and the other one was using what was left. I left the install run for about 30 minutes and it had only made it to 60% completion. Here is where it gets really weird...

By accident I drug the task manager over the installer window so that it covered the picture area where the installer was trying to show animations or something. At this point the second instance of the installer process jumped up to around 30% CPU usage and the install finished in a couple minutes. I was doing it on two machines at the same time so I did the same thing to the other one. The second machine was just starting the install (around 10% done or so) but it also reacted the same way. When I drug the task manager over the animation area it began using more CPU on the second process and finished installing in a couple minutes.

I'm guessing maybe this has something to do with DirectX? Maybe placing one window over the other meant RP could not access that part of video memory, or meant it returned false for some "is visible" type of boolean test? I had installed RealPlayer 11 Beta on a couple newer machine last week and it did not do this... Any thoughts are welcome.

Posted by stm at 09:10 AM | Comments (1) | TrackBack

September 06, 2007

How to send a Cookie with an xmlHttpRequest from IE

I'm not sure if this was just me, or if anyone else has ever struggled with this. I did some Googling and found a few posts related to other people trying to do a similar thing and encountering the same problem.

The problem I encountered was when I used an xmlHttpRequest in IE (IE only. I didn't see this behavior in any other browsers...), it did not send the Cookie(s) for the current session with the request. Also, if I tried to set the Cookie header directly using setRequestHeader("Cookie",foo) the Cookie value would arrive blank at the server.

I determined this by writing a cgi script to print out all request headers for a given request to a log file so I could track them.

The interesting thing I noticed is if I instead used a custom header setRequestHeader("MyHeader",foo) rather than the Cookie header, the custom header and value would arrive intact at the server. So what I did was wrote a conditional statement into the server code that first checked for the existence of the Cookie value, and if it did not exist, it checked for the existence of MyHeader to get the Cookie value.

It seems to work around the problem in IE, and it has also worked in Opera, FireFox and Safari with no problems/errors. There may be an explanation for the IE behavior that involves me being wrong/trying to do something restricted by protocol/blah blah blah...but either way you look at it, I need to get it done, so this at least worked. Hopefully it will help somebody.

Posted by stm at 08:51 AM | Comments (7) | TrackBack