Archive for the ‘Computer Technology’ Category

validating myself

Thursday, February 25th, 2010

Excepting the blog, my site now adheres to the XHTML 1.0 Strict standard.

Pages on this site that pass the standard bear the w3c logo at the bottom.

I will see about getting the blog up to snuff, but since I’m using WordPress, it involves a bit more digging around.

blog. updated.

Wednesday, February 24th, 2010

I bit the bullet and created a theme for this blog so that it finally fits in with the rest of the site. Other than how it looks, which is, of course, hideous, I hope you like it.

site. updated.

Tuesday, February 23rd, 2010

The blog doesn’t look any different, but my site does. The content hasn’t changed but I updated the look and style to bring it up to the standards of modern web browsing. You know, cuz that’s what I do for a living, and I suppose my site should reflect something or other about my mad skillz.

Yes, it still looks hideous. But the way it looks hideous is so much more elegant, and that’s what matters. Style is everything.

Someday I’d like to translate that hideousness over to this blog, but writing css for WordPress is a bit daunting. Until then, let your eyes be grateful for my laziness.

Anyway, please let me know if things are out of whack (you may need to do a [ctrl]+F5 to clear your cache) and I will whack ‘em back in, post-haste.

i do not like flash, sam i am

Monday, February 1st, 2010

As a web developer, I have always despised Flash. I’ve never really been able to fully articulate exactly why, but here are some basic reasons:

  • Flash files can be large and can take long to load
  • Flash files are difficult to edit without the right (and costly) software
  • Flash files require the Flash plugin, which is a potential security hole and therefore can’t be assumed to be on every user’s web browser
  • Since I can’t assume that everyone has Flash, I have to figure out a way to rewrite the Flash content so that it complies with HTML standards

My basic issue with Flash is that it makes it a lot more difficult to maintain a website. This is more of a personal bias against Flash than anything else, but I just finished reading this blog post which decries Flash for not adhering to basic HTML standards. Well spoken, good sir.

solved: abandoned sessions in iis6

Friday, January 30th, 2009

I’m working on an ASP.NET web application hosted on a Windows 2003 server running IIS 6. Despite explicitly setting the session timeout value to 180 minutes, I was inexplicably getting timeouts after 20 minutes of inactivity.

Some googling revealed hints about timeouts for Forms authentication, though I am using Windows authentication. I thought that maybe the security token retrieved for the internet guest account might have been expiring after 20 minutes but that turned out to be a dead end.

I then ran across this article which explained how to setup up event logging when the IIS application restarts, which might give a clue as to why the application is restarting. Add the following xml node to the global web.config file ([windows dir]\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config) under the <healthmonitoring><rules> node:
eventName="Application Lifetime Events"
provider="EventLogProvider"
profile="Default"
minInstances="1"
maxLimit="Infinite"
minInterval="00:01:00"
custom="" />

Once that’s in there, the ASP.NET worker thread recognizes a change in settings and restarts the web application. Log in to the web application, then wait 20 minutes for the timeout, and look in the Event Viewer’s Application log. Here is what I found:

Event code: 1002
Event message: Application is shutting down. Reason: Hosting environment is shutting down.
Event time: 1/30/2009 12:17:48 PM
Event time (UTC): 1/30/2009 8:17:48 PM
Event ID: b16deb6ad49e4b63a4bd43bab2a26684
Event sequence: 394
Event occurrence: 1
Event detail code: 50002

Application information:
Application domain: /LM/W3SVC/1/ROOT/[WEBAPPNAME]-2-128778143729651871
Trust level: Full
Application Virtual Path: /WMS
Application Path: C:\inetpub\wwwroot\[webAppName]\
Machine name: [MACHINENAME]

Some more googling on the error revealed this thread, which advised that IIS has an option for application pooling which restarts the application after 20 minutes of inactivity.

A little more googling on where to set application pooling options revealed this article which showed that in IIS Manager, there is a folder just under the computer name called Application Pools where you can configure them. I right-clicked on DefaultAppPool, chose the Performance tab, and found the “Idle Timeout” setting which shuts down the application after 20 minutes.

Hooray for explicit session timeouts that get overruled by seemingly unrelated global application settings!

mp3: still not for me

Monday, December 15th, 2008

I’m a really slow adopter of new technology. As a software engineer, you’d think that I would be more on top of things. In my profession, I try to keep up with new technologies as they apply to my career, but I’ve found this to be more about keeping up with the latest buzzwords than actually learning anything new.

A couple of years back, my company gave its employees iPod Shuffles. I tinkered with mine a little, and enjoyed the novelty, but ultimately found no use for it. I simply don’t have the time. The only time I have to listen to music is in my car, and its stereo has no line in, so there you go. While the shuffle was a fun toy, I was annoyed that I couldn’t download songs from multiple computers. In an attempt to discourage people from downloading unpurchased songs (say from a friend’s computer), Apple only allows the Shuffle to link up to one computer’s instance of iTunes.

A couple of days ago, the wife said she wants to enter into the mp3 age. And it got me to thinking, why haven’t I adopted this new technology?

Well, for one, I like to own the physical media of albums that I purchase. I like to have the CD in hand, to unfold the artwork and read the lyrics and have a physical connection to the music that I listen to. Yes, I know CDs are antiquated, and there are problems with the record industry attempting to regulate the ripping of CDs to computer, but I still like to be in control (or at least have the illusion of control) over the media that I purchase. And that’s what’s wrong with mp3s. The technology, or rather, the copyright technology, has not been fully vetted, and the consumer has no control over the content that they buy.

Cory Doctorow of BoingBoing follows copyright law and always posts new developments in BoingBoing’s CopyFight category. Copyright bores the hell out of me, so I don’t follow his copyright posts, but I recognize the importance of his activism, and I really appreciate that his voice is out there for the consumer.

Maybe there will be a day when copyright and digital media can coexist in peace. But I don’t see that day coming soon, and until then, I will continue to enjoy my old, antiquated CD collection.

Little Endians

Thursday, May 15th, 2008

A minor bit (pun most definitely intended) of one of my projects at work deals with endian-ness. Click the link to learn more or you can suffer my hair-brained attempt at explanation. Or, here are some links to places far1 more interesting.

<HAIR-BRAINED EXPLANATION>
In computers, data is stored in bits (on/off). A string of 8 bits forms a byte. Bytes can be used to store numeric, binary data. But which end of the byte contains the most significant* bit? It turns out that the answer to this question is arbitrary. The number 1, stored in a binary byte, might be represented as 00000001. This is an example of big-endian bit ordering: the biggest bits are at the front of the string. The same number 1 can also be represented as 10000000. This is an example of low-endian bit ordering: the lowest bits are at the front.

Endianness, therefore, has major implications for computing across operating systems. It is absolutely essential that the OSs agree on which end of the byte contains the most significant bit. The number 1 on a low-endian platform (10000000) would be interpreted as the number 127 on a big-endian platform.

* Significant, in this case, means the bit representing the largest number. I can best explain this through example. The number fifteen (15 decimal) consists of two numbers, 1 and 5. In this case, the 1 is located in the more significant location, representing the number 10. The 5 is located in the less significant location, so even though 5 > 1, its lesser significance gives it a lesser value. Sorry, 5. It’s not you, it’s your endianness.
</ HAIR-BRAINED EXPLANATION>

Ok, now that that’s over, here comes the point of this post. When I was growing up, we sang a politically-incorrect children’s song called 10 Little Indians. Well I’ve had a really bad song going through my head all week:

One, little two, little three little endians
Four, little five, little six little endians
Seven, little eight, little nine little endians
Ten little endian bytes

1Oh how totally weird is it that a softer world has a comic about vegetables on the day I post this?

Sometimes the internet does it for you

Friday, March 7th, 2008

I had a bit of a frustrating time this week configuring my development computer at work. I’m a Windows guy. Not so much because of choice, but because that was the road well-traveled. But enough of that.

My company’s website runs on a Linux box hosted elsewhere. Since I’m the only developer here that is suitably proficient with web technologies, it’s my job to maintain and develop the company site. Pretty standard stuff: PHP scripts, mysql database, and Apache web server.

You may see where this is going. I’m developing on a Windows workstation, so my environment is obviously much different from the production environment. Not the best of situations, but hey, it’s only PHP and mysql, right?

So I got PHP and mysql all happy and square on my machine. Yay. But PHP is still running under IIS, and since my machine is running Windows 2000, it’s running an older version of IIS. Ultimately, I ran into a “feature” of IIS in which cookies simply cannot be sent when there is a redirect using the “Location” header. From what I can tell, IIS sees the Location header and sends it immediately to the client, completely ignoring any cookie data that was set beforehand. How rude.

After a day or two of cursing and scouring the internet for a solution, I came to the realization that there simply was no solution. So I decided to install Apache and bypass IIS.

After I got Apache and PHP all squared away (yay), I spent another frustrating day trying to figure out why PHP wasn’t loading its mysql module. It worked in IIS, but for some reason Apache didn’t want to let PHP play with mysql. After more cursing, I finally fell upon Apache’s error log, which reported something strange:

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\apache\\ext\\php_mysql.dll' - The specified procedure could not be found.\r\n in Unknown on line 0

Something was not happy with php_mysql.dll. I immediately realized I must be in dll hell. A little more scouring of the internet unearthed this little gem of a blog post:

The php_mysql.dll module loads libmysql.dll, but apparently it has to be the version against which it was compiled. The required DLL is bundled with PHP, but what if an older, incompatible version of that DLL is found earlier in the search path? You’re hosed, that’s what if, and the module load fails with a message to the log file like so:

PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\php-5.2.3\\ext\\php_mysql.dll' - The specified procedure could not be found.\r\n in Unknown line 0

Oh lordy, that’s my error too! I applied his solution and a few seconds later my PHP was happily talking to mysql. Thank you, Sander, for lifting my soul from dll hell to purgatory.

His comments are turned off, or I would have posted my gratitude there.

EDIT: I’m including his solution in case his blog gets eaten by the internet:

How do we solve this the Apache Way? Not by copying DLLs around, that’s for sure. The Apache configuration language has the LoadFile directive for this particular purpose. Loading the correct DLL right before the PHP module:

LoadFile “d:/php-5.2.3/libmysql.dll”
LoadModule php5_module “d:/php-5.2.3/php5apache2_2.dll”

makes PHP pick up the right symbols to run with MySQL.

Windows Genuine Advantage Notification

Sunday, March 25th, 2007

For many, this post is about beating a dead horse. But I haven’t gotten my licks in, so hand me that club.

When I upgraded to WindowsXP, I had a choice. Use a pirated copy or buy a legal copy. I decided to go the legal route because I wanted the peace of mind that comes with having a lawful copy, as well as the possibility of product support should something go awry.

Now there is a Windows Update waiting to be installed. It’s called the Windows Genuine Advantage Notification. It is described as follows:

The Windows Genuine Advantage Notification tool notifies you if your copy of Windows is not genuine. If your system is found to be a non-genuine, the tool will help you obtain a licensed copy of Windows.

My reaction? Fuck you, Microsoft. I know that my copy of Windows is genuine. If you, Microsoft, can’t figure out your licensing, that’s not my problem. I bought your damned software with my own hard-earned cash, and in return you treat me with suspicion, like a criminal. By installing this, I run the risk of getting a false negative and all the hassle that comes with it. By not installing it, I get a popup every time I log in that says I have an important Windows update to install. So fuck you. Go take your Windows Genuine Disadvantage software and cram it up your stinky, hairy, shit-stained asshole.

EDIT:
Apparently this appears to be Microsoft’s response to a license key crack that you can read about here, a brute-force method to obtaining a product key in which software creates random keys until one works. The downside to this brute-force method is that it effectively “steals” a key from a real licensed copy, so that it is possible that if you buy a fully legal and licensed copy of Vista, someone else may have already stolen and used your key, rendering your copy useless.

when to say when

Thursday, November 16th, 2006

One of the more frustrating aspects of software programming is when a hitherto unknown quirk decides to lay my lofty ambitions to waste. Much programming occurs under assumptions about how technology behaves, and when an assumption proves false, much time and cursing is often expelled until the root of the assumption is revealed. Finding the root is indeed an arduous task. Once found, the software developer may be forced to re-evaluate the programming direction they have chosen, which at the worst may entail some form of the dreaded re-write. All that beautiful code laid to rest.

Such a thing happened today.

In my opinion, one of the biggest failings of the internet is the lack of, or lack of adherence to, standards. Oh sure, standards exist, but getting all of the players to play along is much easier said than done.

Fortunately, the internet is rife with discussion about the various bugs and vagaries that developers may encounter whilst developing. And so I happened upon this article, which discusses some limitations Internet Explorer has with cookies. Thanks to its author’s findings, I can stop messing around with an apparent bug in Internet Explorer’s handling of cookies and move on to the Code That Matters.

Those of you who develop may question why I would need more than 20 cookies when there are data serializing tools like databases around, and I’ll answer that a database is not in the current spec and leave it at that.