www.jlion.com

Monday, October 29, 2007

I like the task list feature of visual studio. It's very convenient to be able to prefix a comment with TODO and have it automatically appear in the task list. A great way not to forget to fix those little issues that would otherwise be very easy to lose track of.

However, for some reason it had not occurred to me until today to see if I could add my own prefixes. What do you know! It's not only possible, but not difficult at all.

Here's the MSDN article that describes how to do it:
http://msdn2.microsoft.com/en-us/library/zce12xx2(VS.80).aspx

Saturday, October 27, 2007

One of my favorite games is Popcap Games' Bookworm. There are two versions: An offline version, which is a windows executable, and an online version, which is a java applet.

A few weeks ago mostly as an exercise in javascript, I decided to see if I could create a javascript derivative of bookworm. The project gradually simplified itself into an on-line word-find puzzle creator, which I've posted here.

I think the word-find utility turned out OK, and at least on the newer PCs that I use at home and at work seems not to suffer from noticeable lag. While working on it, I learned several useful tricks for working with DIV elements, which I will share with you here:
  • While in Firefox it is possible to use document.getElementsByName to get an array of all DIV elements with a particular name, this technique does not work in IE. Instead, a workaround is to use document.getElementsByTagName to get a list of all DIV elements in the document, then look at the name property for each DIV. There may be a more efficient way to do this, but for the moment it seems to work acceptably well with one caveat, which leads us to...

  • While in Firefox it is possible to directly access the name property of a DIV, this does not work in IE. Instead, use div.getAttribute("name") to retrieve the name of the DIV.

  • Elements inside a DIV are easily accessible by using the childNodes property. Let's assume here that a DIV contains two text boxes. This statement will set the value of the second text box to "Hello World!": oDiv.childNodes[2].value='Hello World!';

  • To set the background color of a DIV, use the javascript backgroundColor property as in:
    oDiv.style.backgroundColor ='#cccccc';

  • Also useful, but not related to divs:
    1. Use the javascript parseInt function to force a value to be a number when adding or subtracting.
    2. Use the setInterval function when you need a timer. This function executes another javascript function at a set interval (in milliseconds) until you stop it by using the clearInterval function.

Friday, October 26, 2007

From the big guy vs little guy dept: On August 17th, I chose not to renew my Verizon cell phone contract. Now Verizon, like a lot of cell phone companies, bills a month in advance so on August 17th they owed me a refund. After miscellaneous charges were deducted, the amount of the refund came to $94.56.

It's now October 26, 69 days later. I have received two "invoices" from Verizon showing the amount of the credit and warning me in big bold letters that I have a credit balance and "do not pay". Curious, I just called Verizon customer service and was told that due to standard operating procedures I should not expect a check for several more weeks. Most likely, I was told, I would receive my refund by the end of November.

What do you think Verizon would have done had I waited 106 days to pay them?

Thursday, October 18, 2007

About two weeks ago, I purchased the latest version of VMWare Workstation, v6. I've been using both VMWare and Microsoft Virtual PC now for probably about 5 years on or off.

There are two good reasons that I've found to use virtualization software: To test installations & setups, or to test in alternative configurations such as different operating systems or operating systems with different configurations.

I've recently found a third reason though: To run application software that I do not want to install on my primary O/S. For example: Our ERP system uses Crystal Reports v9, which is an older version of Crystal Reports. I've recently purchased Crystal Reports v11, which is not entirely backward computable and which automatically upgrades any older versions of Crystal it finds when installed. So that I can use Crystal v11 with some new web applications I'm working on, I set up a development environment in a VMWare virtual machine. When I need to develop with Crystal v11, I start up the virtual machine and maximize it. It's easy to forget that I'm working in a virtual environment.

VMWare instances are reasonably portable as well, so I've been able to put my virtual machine on a USB hard drive and take it home, where I can run it using the free VMWare player software. This is much more convenient than taking my entire laptop home.

Microsoft Virtual PC is free, however the VMWare snapshot feature that lets you save a configuration and quickly return to that configuration at any time is more than worth the $190 cost of VMWare.

-----------------------------------------------------------------------------------------------

A few days ago the most recent copy of Information Week magazine arrived, and the front page story was how VMWare is going to supplant Microsoft. VMWare's key advantage? That they have a hypervisor and Microsoft does not (currently). Essentially, a hypervisor is a very compact O/S that allows multiple operating systems to more efficiently run on a single server.

I've set up Microsoft's Virtual Server before, just to evaluate it, and found it somewhat more sluggish when running the same apps than either VMWare workstation or Virtual PC. It does have a significant advantage in that it does appear to be a real server on the network and it runs as a service so when the hardware reboots the virtual machine is there. I assume that VMWare's server product has similar capabilities.

There are definite advantages to using virtualization software to host multiple virtual servers on a single physical server. I can think of a few:
  • Ease of backup and restore. Setting up and configuring a server and the applications that run on it can take days. If the installation is done on a virtual machine, then the entire machine can be easily backed up and restored. The host physical server need run only the virtual machine software. Moreover, the virtual machine can be restored to a different physical server, so hardware failure becomes easy to accommodate.

  • Security. Enterprise services can multiply like rabbits, with each server having unique access permission requirements. When using physical servers, there's a strong cost incentive to colocate as many services on a single server as possible, rather than buy, then support, new hardware. With virtual servers, the HR software can have its own virtual server and since it doesn't need IIS, IIS doesn't need to be installed on the virtual server. However, the HR virtual server can run right along side the market forecasting software which does require IIS. Both servers are supported by different vendors and each vendor can be granted access only to the virtual server that is running their product.

  • Testing. Rolling out service packs and upgrades to enterprise applications can be a nightmare task. With virtualization technology, it need not be. Just make a copy of the HR server. Apply the service pack to the copy. Verify that everything is working correctly then replace the production virtual machine with the upgraded copy. What could be easier?
There are a few gotchas though, and here are two:
  • Performance is the most obvious. A virtual server will always run more slowly than the bare hardware. I think hypervisor technology may ameliorate this problem somewhat but it's always a concern that will need to be addressed. You may want to think twice, for example, before putting your data warehouse SQL Server on a virtual machine.

  • The other issue, Support, is not so obvious. How do you keep all your servers up with the most recent patches and service packs? Microsoft makes this easy, with Windows Update and when running a Microsoft OS a virtual machine is no more difficult to administer than a physical one. As the InformationWeek article points out, however, if folks start writing applications than run directly on top of the VMWare software, then this could become a bigger issue.

    Let's say that one vendor configures Java and Apache to run directly on top of a VMWare environment. Another vendor does the same thing but in a slightly different way. Now, when an urgent security threat must be patched, IT administrative staff must update vendor 1's server in a different way than vendor 2. It's a step back, perhaps many steps back to the days before we had update managers such as windows update or the java machine's automatic update.
I just thought of another good use for virtualization technology: Updating a user's PC can be a time consuming task for the help desk. Users often have lots of software installed that has to be reinstalled on the new PC, data must be copied over and mapped drives and network connections reconfigured. What if each user were given a virtual machine that runs on their PC. When upgrade time comes along, the virtual machine is moved from the old hardware to the new hardware. Quick and easy!

-----------------------------------------------------------------------------------------------

To sum it all up, virtualization is cool and, InformationWeek aside, represents no immediate threat to Microsoft's domination of the operating system market.

Monday, October 15, 2007

So MapQuest has much better satellite images of north eastern PA than Google does. Their street maps are better too. For example, here's mapquest for Beltzville State Park. Here's google for the same park. Obviously, mapquest offers much better resolution. This may have something to do with the fact that mapquest maintains an office in Mountville, Pennsylvania.

Why do I bring this up? Because if you live in Eastern PA like I do then the northern part of the state is like a big theme park with some great places to be outdoors, like the Beltzville park or the interestingly named town of Jim Thorpe. In fact, Jim Thorpe (once called "Mauch Chunk") was home to one of America's first roller coasters, the Switchback Gravity Railroad.

I took the boys up to Glen Onoko last weekend and we had a great time exploring. Long ago, Glen Onoko was home to a large hotel with terraced gardens, and the crumbling ruins of the terraces and other assorted structures remain on the hillside above the river. There is a mountain pathway that leads to spectacular waterfall as well but as we had spent much of the morning exploring elsewhere we ran out of energy well before we reached the top and had to turn back.

I subscribe to the audio version of the Harvard Business Review and in the most recent edition there is an article about women's careers and how the "glass ceiling" is more like a labyrinth. The article pointed out that because of family commitments women often are unable to spend as much time at the office as men, which often impaired their ability to be promoted. The article also included an interesting observation. The authors quoted a study that revealed that aspiring managers who were most likely to be promoted were the ones who spent the most time socializing. These managers were much more likely to be promoted, regardless of their general relative competence. Surprise, surprise.

On a political note, from this Christian Science Monitor article comes an interesting observation:

Finally, it has been observed that if Hillary Clinton is elected president in November 2008, Americans will have had at least six terms – 24 years – of Bushes and Clintons in the White House. In a country of 300 million people, it seems improbable that so many consecutive presidencies would have emerged from just two families.

Tuesday, October 02, 2007

I've been a follower of the news for a long time. When I was in elementary school, it was called current events. Later, in high school, a really great history teacher named Jim Pizzani encouraged us to read the New York Times on a daily basis.

Today, however, the news seems increasingly sensationalist and confrontive. What was tabloid fodder 20 years ago is now headline CNN (or Fox News). I just saw something on CNN that made me cringe. It would be child abuse to require adolescents to read some of today's top stories.

In particular, I miss thoughtful and balanced reporting, where by balanced I mean in the sense that balanced is the opposite of putting two rapid dog partisans in a box in front of a TV camera and urging them to duke it out, where balanced means keeping ones composure and treating ones' guests with respect and dignity even if one does not approve of their point of view.

Monday, October 01, 2007

So I've been experimenting with the latest (v6) version of VMWare workstation and I like it a lot. I've set up a virtual machine and have taken snapshots with various software installed (IE: fresh install of XP, XP + DotNet 2.0, XP/DotNet/SQL Express, etc.)

The ability to revert to a snapshot is incredibly useful when testing installs.

Also, VMWare allows you to clone a Virtual Machine. This is handy for testing under different configurations.

Finally, there's a free VMWare player that allows you to run Virtual Machines created with workstation. This isn't as useful as I'd hoped. It appears that it can't be set up to start up at boot (probably to encourage sales of VMWare Server).

However, VMWare Player does offer up some intriguing deployment options. What if instead of deploying a setup app, you simply deployed a fully configured virtual machine? The problem with this and windows is if the name of the virtual machine must be unique on the domain. Then there's also licensing to consider. But I'll bet it work really well with linux.