Monday, December 10, 2007

Today is a Monday and it's been a pretty busy one. However, I did find time to read the news, and found a pretty cool new charting applet from the folks at google:
http://google.blognewschannel.com/archives/2007/12/10/new-google-api-serves-charts/

There's also an interesting discussion on code quality over at Slashdot:
http://ask.slashdot.org/article.pl?sid=07/12/10/0744259

Code quality is something I've often thought about. Years ago, I had written a program to analyze VB4 code for McCable metrics, and have worked hard to make my code as reusable as possible, given time constraints. I do have to admit that it can be very tempting to unfairly criticize unfamiliar code. One sometimes feels that fixing an existing simple application might take more time than just rewriting it. Why? Because time is necessary both to understand the current and original requirements, as well as to understand the previous programmer's logic.

For a lot of folks, code is business. You do what you have to, in order to get the job done, get yourself and the company you work for paid, and go home to your family (or to the beach, or whatever). Those folks are happy as long as the code works and is reasonably maintainable. They aren't going to notice if you make it clean as a whistle and efficient as all get out, or if it's clunky and crunky as a coal-fired sewing machine. You do the best you can because it reflects morally on yourself (cut corners unnecessarily, become an unconscientious person) not because anyone will likely notice the difference.

The article does mention open source as a way to improve one's code quality. This appeals to me, mostly because I tend to think that copyrights are both over- and mis- used. The elephant in the room with open source is: who pays the developers' bills while they are so generously donating their time to the public good? I'm unclear on this issue. I do like to contribute to the public good and so as an experiment have decided to create an open source project on CodePlex, Microsoft's open source hosting environment for the jChart (for jlion chart) charting tool that I developed for my own use. We'll see if anyone comments on it one way or the other. I do think that commerical projects are likely to be of higher quality, if for no other reason than because they can pay developers to spend time working on them.

Now that I've finished "The Dark Tower" by Stephen King, I'm on to "Saint Thomas Aquinas, the Dumb Ox (Unabridged)" a biography of St. Thomas Aquinas written by GK Chesterton. Chesteron contrasts Aquinas with another contemporary, St. Francis. He describes St. Thomas as a philosopher who struggled to reconcile reason with spirit, and St. Francis as a humanist, who worked to bring Christian doctrine from the ivory tower to the common men and women of the time. I've long had an interest in St. Thomas, not least because my grandfather named his cat after him and when I was five I thought "St. Thomas Aquinas" was a very unusual and cool name for a cat. I constantly struggle to marry the spiritual and logical parts of my being. I think that both are valid, and find that most embrace one more fully than the other. Hopefully St. Thomas can help me find a middle way.

Tuesday, December 04, 2007

After 10 minutes of research I've found this blog entry describing how the AssemblyVersion build and revision numbers are determined if you use the following syntax in the AssemblyInfo.vb file (found in the "My Project" folder of your component or application)

<Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyFileVersion("1.0.*")>

It seems that build is the number of days since a predetermined date (controlled by a windows registry setting and by default Jan 1, 200) and revision is the number of seconds since midnight.

I've started displaying this information on some internal web pages so I can track what build/revision of various DLLs were in place when an error occurred.

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

I rediscovered www.codeplex.com today. I have several utilities that I wrote that I think I will post out here, starting with my jChart charting library. I've installed TortoiseSVN and SVNBridge and am now looking at how these tools are used.

I've finished "The Dark Tower" by Stephen King. I found this series to be clever and rich and thought-provoking. I highly recommend it.

King writes that the Dark Tower series was based on a poem by Robert Browning called "Childe Roland to the Dark Tower Came". The text of that poem can be found here.

The Dark Tower series, I think, is two things: It is a study in the evolution of Stephen King as a writer being written, as it was, over the course of many years. It is also a study in the afterlife. Who can know what lies beyond? Perhaps we're all virtual, collections of on-bits and off-bits in some alien teenager's equivalent of sim-earth. Perhaps the Hindus are right and fate is a wheel which we work over the course of many lifetimes to escape. Perhaps the Christians, Jews and Muslims are right and all has been created by an omnipresent and all powerful God. Or perhaps, as King imagines, the truth is some combination of all of these. If you liked "The Matrix" because it called into question your preconceptions about reality, then you'll love "The Dark Tower" series.

Recently one of King's short works which I liked came out on film. "The Mist" from "Skeleton Crew", a collection of short stories, was released to theaters in November. I haven't seen the film, but I do think that it would be quite difficult to make a movie out of the "Dark Tower" series. There's just too much going on, and it's all interweaved too tightly.

Finally, I do think that the conclusion of the series is not as strong as it could be. When I arrive at the end of this wild tale I see that King has ended with a bit of humor and a final allusion back to Browning's poem that puts the entire series in context as merely a literary exercise. It's not a work of philosophy, it's a work of fiction.

Thursday, November 29, 2007

I'm now about half way through the last book in Stephen King's Dark Tower series. It's fascinating how King threads various ends left loose in earlier books in the series through and around the plots in this one. Also, King's recursive reference to himself I have forgiven: It works, and works well, I think.

A job applicant for a system administration position stopped by a few minutes ago and I had the opportunity to chat with him about VMWare and virtual machines. In his current position, he manages the active directory implementation for a smallish multinational and at that company most of the servers are now virtualized. Apparently VMWare-server has a management service that serves as a front-end to a pool of virtual machines and a pool of physical servers. The management service shifts virtual machines amongst the physical servers to balance load. Entire servers are backed up, OS and all. It's also possible to take snapshots if, for example, one is making pervasive changes that one is not entirely sure will be successful. If there's a problem, it's easy then to revert to the snapshot. I am planning to lobby even more strongly than I have been for the purchase and implementation of the server version of VMWare.

On the side, I have also continued working on my speech server 2007 test environment. When installing speech server 2007, one thing that you should know up front is that it must be installed in a domain. If you're doing this at home and you have a workgroup, you'll have to convert to a domain before you can proceed with installation. Some other prerequisites are as follows:

  1. Windows 2003 Server with these components installed:
    • SP2
    • MSMQ
    • IIS/ASP

  2. For development, you'll need VS2005...
  3. ...and VS2005 SP1
  4. You'll also need DotNet 3.0
  5. and workflow extensions.
    Information about both DotNet 3.0 and workflow extensions, as well as downloads for both can be found here: http://msdn2.microsoft.com/en-us/netframework/default.aspx
  6. OK, now you can download speech server from Microsoft's web site:
    http://www.microsoft.com/downloads/details.aspx?FamilyId=BB183640-4B8F-4828-80C9-E83C3B2E7A2C&displaylang=en
  7. The speech server file that you download is compressed. When you run it, it will uncompress to a location you designate. After you've done this, you will need to...
  8. ...run hotfix #kb91733, which you'll find here:
    %DVDROOT%\Prerequisites\dotNetFramework\KB917833
  9. Speech Server requires at least one language pack to install. The language packs are also available (in various languages) from the same web site where the speech server download is located. I did not install the language pack first, but I believe it is what Microsoft intends for you do to, so here you should download then install one of the language packs.
  10. Finally now you can install speech server.
  11. ...since I did not have a domain I did not proceed beyond this point. Also, note that a mediation server is required. I'm not sure if by mediation server Microsoft is referring to a "mediation service" that can run on the same physical machine as the speech server, or whether they are implying that a second physical (or virtual) PC is required.

If you're planning to set up a Speech Server 2007 test environment there are at least two alternatives to consider when determining how to connect your server to the PSTN.

One of those solutions is to use a VOIP service provider. It's my understanding that SS07 requires a TCP connection and that most providers support UDP. There are some that do support TCP and more information about who those providers are can (I think) be found on GotSpeech.Net.

Another alternative is to use a hardware media gateway to POTS. At least two vendors supply SS07 compatable media gateways. One is AudioCodes. Their MP-114 is relatively inexpensive but reportedly suffers from poor tech support and documentation. Another option is the Dialogic DMG1000 series. Dialogic has wonderful support and great documentation. If you're an ISP they you may qualify for a promotion that Dialogic currently is running on the DMG series that allows you to purchase one gateway for evaluation at a sharply discounted price. More information about this promotion can be found on Paracon's web site.

In the break room here at the factory, there is a large screen TV that's always running CNN. I see it each day when I stop by for my morning and afternoon coffees and it always seems like they're running some story about some individual that did something wrong, or is suffering somehow. For example, earlier they were running a story about an Iraqi boy who is receiving surgery to patch up severe burns that he suffered in a bombing. Before that was a story about the search for the missing and presumed murdered wife of a police officer.

These stories strike me as a little pornographic in the sense that I suspect that they are intended to titillate. Titillate is described by Dictionary.COM as "to tickle; excite a tingling or itching sensation in, as by touching or stroking lightly." Why is it that people find stories like that of the missing wife so enrapturing? The same thing goes for the recent OJ story, or the various stories about the doings and misdoings of Britney Spears.

I see those stories and I can't help but feel a tinge of empathy for the victims of these stories. It must really suck to be a girl who can't stop hiccuping, who is featured on CNN for a day. That girl must have received thousands of letters and telephone calls, not to mention visits from crackpots who are interested in meeting her for themselves, or who want something from her. Same goes for the police officer who, murderer or not, is now redoubtably being hounded by people who have already predetermined his guilt based on what they saw on CNN. No wonder celebrities run over paparazzi.

Thursday, November 22, 2007

So after T-dinner today, I was helping to set up a wireless home network (such is the life of a computer guy) and we decided to move one of the computers well away from the the router (downstairs, the router is upstairs). What's open on T-Day? Walmart, Kmart. So Kmart doesn't have much in the way of computer accessories. We check out Walmart's web page and see that they have a Belkin FSD7050 Wireless USB adapter for $29.98 that is "also available in many stores". There happens to be a Walmart near here and we high-tail it down there. Lo and behold! On the shelf we find the very thing we're looking for: A shiny new Belkin FSD7050. Yeah! Except that the marked price is not $29.98 as we expected from the web site, but $34.76.

"So what's up with that?" we ask a friendly walmart employee. She doesn't know, and phones her manager who informs her that they don't do price matching with web sites. "But it's walmart's web site!" I tell her. She relays this to the manager, still on the phone, and his response is "so order it on line then."

Well, that's ridiculous, I think. "What about walmart's ship-to-store program?" I ask. "Couldn't we order it on line here," (using Walmart's own order-on-line terminal that they have so conveniently placed in the electronics department) "then have it shipped to this store, then just take the one we have here now?" The clerk relayed this to her manager, who reiterated "we don't do price matching with web sites".

At this point I'm becoming frustrated. "If I order it on line, I probably won't order it from Walmart," I tell the clerk. "But I think there's something dishonest going on here. See here," and I pointed at text on the web page. "It says 'also in many stores' and it does happen to be in your store. It doesn't say anything about paying an extra $5 for in-store pickup."

The clerk agreed with me, and again spoke with her manager. His response this time was: "OK. But one time only."

So what's up with walmart? I think they probably lowered the price on the web page and didn't tell the stores, or perhaps there's a delay between the web page price adjustment and the store price adjustment to give the store time to relabel shelving. In any case, the manager's actions struck me as devious. Buyer beware!

Wednesday, November 21, 2007

Still reading "Song of Susannah" and my initial reluctance is starting to transmogrify into great interest. What a metaphysical trip! What if we're all figments? OK, comfortable with that? Ok, now: What kind of figments are we? Are we the dreams of God? Iterations of some kind of virtual universe? Stephen King makes The Matrix seem like Sesame Street...

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

I had always labored under the impression that the "stop" button in internet explorer or firefox disconnected the browser from the current request. That seems not to be true as I have long running pages that just can't be canceled, no matter how persistently the user clicks on the red X.

As usual, a bit of surfing revealed gold, in this case in the form of some javascript functions:


function ShowCancel()
{
var oCancel=document.getElementById('cmdCancel');
oCancel.style.visibility='visible';
}

function HideCancel()
{
var oCancel=document.getElementById('cmdCancel');
oCancel.style.visibility='hidden';
}

function Cancel()
{
if (window.stop)
window.stop(); // for firefox
else if
(document.execCommand) document.execCommand("Stop"); // for IE

return true;
}


Here's how a cancel button would work:

<input id="cmdCancel" value="Cancel" style="width: 100px;" onclick="javascript:Cancel();" type="button">


Make the button invisible when the page loads, like this:

<body onload="HideCancel();">


Reference the ShowCancel() function in the OnClick event of the button that executes the long running query, like this:

<input id="cmdRefresh" value="Refresh" onclick="ShowCancel();" type="submit">


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

Do you want to display version information for DLLs that are referenced by your web page? It's handy if you want users to report the version that was in use when they experienced a problem. Here's how I did it.

Step 1: Modify the Assembly Information properties (see AssemblyInfo.vb in the "My Project" directory). The AssemblyVersion and AssemblyFileVersion should look something like this:

<Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyFileVersion("1.0.*")>


Step 2: This function returns the version number, given a reference to any type included in your DLL:

Private Function VersionNumber(ByVal oType As Type) As String
Dim oAssembly As Assembly = Assembly.GetAssembly(oType)
Dim oName As AssemblyName = oAssembly.GetName

Return oName.Version.ToString
End Function


Step 3: Rebuild your solution. Version info returned will be something along the lines of "1.0.2880.30736" and will be automatically updated each time you recompile.

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

The blocking log in SQLAutoDoc came in handy today. Users were reporting mysterious messages with our ERP system. When we looked, we saw no problems. Typically in the past such errors have been due to blocking issues but when we looked, the horizons were clear. No blocks.

When I looked at SQLAutoDoc's block log, however, I saw a different picture. Several processes had deadlocked, causing dozens of blocks to proliferate. After twenty minutes or so, the problem had cleared itself out. Thanks to SQLAutoDoc, we have the culprit processes and can work to get them scheduled at a less congested time of day.

Tuesday, November 20, 2007

For any small ISP types interested in setting up a development Speech Server 2007, Marshall at GotSpeech has described his experiences with the AudioCodes MediaPack MP-114 2FXs. I was thinking about buying the AudioCodes box, even if it doesn't have very good support but then I found this offer from Paracon and Dialogic.

As I mentioned before, I've had very good experiences in the past with Cantata tech support and as they're now part of the new Dialogic I'm hoping that Dialogic tech support will be good. From the sound of Marshall's experiences, good tech support might be an important component of a media gateway.

The first step I'm planning to take is to install Speech Server 2007 on a virtual machine. This will let me experiment with various setup options and configurations and the cool thing about VMWare is that there is a snapshot feature that will allow one to revert to an earlier configuration. I can use the snapshot feature to select an option, then if it doesn't perform as expected, I can revert and try a different option. I expect this to be a relatively painless way to learn how to configure OCS/Speech Server 2007.

On a slightly political note, I have just now read that Blackwater operatives in Iraq are not covered under any laws. Not military/DOD, not civilian/DOS, not Iraqi. Doesn't that make them unlawful combatants?

I'm about a third of the way through "Song of Susannah", Stephen King's second-to last novel in the Dark Tower series. The series has taken a bit of an odd turn and I'm not sure I like it. I do like the"there are other worlds than these" concept of endless variations of our world all on a spindle ended on one end by the Dark Tower and on the other end by the Rose, where the afterlife is, in many cases, just a transition between these worlds and where time is no more fixed than is the currents of the sea. I liked imagining that this vision was true, "suspending my disbelief", as my sophomore high school English teacher liked to say. In this second to last novel, Stephen King threatens to take this from me by making the story a variation of "all in a night's dream". I'll have to see how the book turns out. I hope he's leading me on a false path.

I had an heated discussion with our network administrator just now about the best strategy for backups. I had created a scheduled job that does some database maintenance and the backup and have been running this stored procedure for several months. The NetAdmin just purchased a new backup solution, very fast transfer rates, and (without talking to me) a sql agent for it as well. Now he wants me to disable the backup component of my scheduled job. However, I like knowing that the backup completed, knowing that I have tested the configuration with restores and that it works and knowing that I can execute it at will without invoking the NetAdmin's help. I suppose that we can use the backup agent as well as the standard SQL backup but I'm a little peeved that I wasn't consulted and do feel that if we use the agent we will need to test it with a restore before we turn off the backup portion of the scheduled job.

We had our first snow of the winter on Sunday and our neighborhood is white with snow. My kids were very excited but I was reluctant to let them play too long in the snow as my oldest son seems to be catching a cold. It's nice that we have snow. I'm afraid what with global warming and all that my sons aren't going to see as much snow as I did when I was a boy. As a child, winter was one of my favorite seasons, with sliding, skiing, snowmobiles and snow forts.

Sunday, November 18, 2007

While surfing the news yesterday I happened across an editorial (can't remember where, unfortunately) that examined the music publishing industry's current malaise. The music industry, opined the editorial, would need to shift from marketing media (aka CDs) to marketing artists, and the future would see a larger percentage of the industry's revenues coming from live performances than is true today. As evidence of this trend, the editorial referenced Madonna's shift from Warner Music to Live Nation.

It occurs to me that this same shift is likely to occur for arts and publishing industries across the board. Whereas in the past, an artist could create a product, market the product then live off the residuals, in the future art could likely be much more personalized. This trend applied to computer book publishing would explain the decline in mass-produced tomes in favor of smaller, more personalized blog articles. Probably the same will be true for a lot of mass produced products. Why shouldn't you be able to apply the same degree of personalization to buying a car that you do to buying a house or a computer? And why shouldn't a similar smörgåsbord of options be available when you purchase a refrigerator or a pair of shoes? If I were an American manufacturer this would be a fundamental aspect of my strategy to fend of cheap Chinese imports.

In other news, I've started setting up a Office Communications Server Speech Server. It looks to be quite complicated.