www.jlion.com

Thursday, September 27, 2007

I've been listening to Jules Verne's 20,000 Leagues Beneath the Sea. This is a book that was one of my favorites as a 7th grader. I reread it later, sometime in my early twenties so this is my third journey beneath the seas with Captain Nemo.

This time around the descriptions seem more vivid, the characters perhaps a bit more typecast, but the book has lost little of its hook into my imagination. What's especially nice now is google earth, which allows me to follow Nemo's journey on satellite maps, and wikipedia, which helps me find more information about some of the sea life that is referenced in the novel. For example wikipedia revealed to me that the cachelots that Nemo slaughters (so as to protect a pod of gentler whales) are also called Sperm Whales, and hunt as I might I could find no mention of the undersea tunnel that Nemo uses to escape the Red Sea.

It's interesting too, to compare the description of the Nautilus in the book with the Disney sub so commonly pictured. I found this Nautilus design compendium operated by Michael & Karen Crisafulli.

Monday, September 24, 2007

I've been working a lot recently on my SQLAutoDoc program, trying to get it to a point where other folks could use it. To that end, I created a setup for it and have fixed some bugs that didn't bother me but which might bother others (computability with IE vs Firefox, for example).

I'm still working on documentation which I see as being a big part of the project. How can someone take advantage of a feature if they're not sure how it works or aren't even aware that it exists? An example of this is a change I made a few months back. The descriptions of tables/views/functions/etc. are now stored both in the database and also as extended properties so they'll show up when using Enterprise Manager (or SQL Server Management Studio, for 2005 folks).

I'm also seeing a couple of deficiencies: The charting, which I see as one of the coolest things about the app (watch the db size grow!) is actually just a taste of what's possible. For example, it would be nifty to be able to see which periods of the day are busiest by selecting a date range then seeing min/average/max connection counts for each hour in the period. I also think it would be good to take a pass at improving performance as some scans take a long time to complete, currently. Better performance would enable more scans and thus finer resolution into schema changes.




Mr. Ahmadinejad, President of Iran, is scheduled to speak at Columbia University in NYC soon. There's a lot of controversy surrounding this speech and I think a lot of the controversy is ill-placed. Some is stoked by the media for sake of ratings, some is stoked by folks who regard Iran as an enemy of Israel (which is in no danger of running out of enemies anytime soon), and some by folks who are looking for the next big demon on which to blame our conflaguration in Iraq (we killed the last big demon, Abu Musab al-Zarqawi).

It looks to me like Ahmadinejad is very successfully taunting the US and playing up US xenophobia. When he offers to lay a wreath at the 9/11 site and is denounced as a terrorist, it makes the US look callous and ungracious. His letter to Bush, his visit here and his speeches are intended for this same end, I believe. This is something akin to Hugo Chavez's offer to fund low-income heating oil in the US, or Fidel Castro's offer to send medical assistance after Hurricane Katrina.

We here in the US have a great deal of difficulty with nuance. As a society, we want everything to have sharply defined edges. Either Iran is good or it is bad, either we are winning in Iraq or we are losing. Folks elsewhere don't share our cultural blinders, and Ahmadinejad, Castro and Chavez play us up to make us look like buffoons and make our various admonitions ring somewhat hollow on the world stage.

A few months ago, Lt. Col. Paul Yingling raised much controversy with an article in the Armed Forces Journal entitled "A failure in generalship". One of the issues that he cites is a narrowly focused education of military leaders:


An understanding of the larger aspects of war is essential to great generalship. However, a survey of Army three- and four-star generals shows that only 25 percent hold advanced degrees from civilian institutions in the social sciences or humanities.


I would suggest that this diagnosis carries even beyond the ranks of the military. A deemphasis of the liberal arts (and a shunning of all thinks "liberal") has ossified us; we are rapidly losing the flexibility and adaptability that has enabled us in the past to work well with other cultures and that has in the past brought us the respect and admiration of the world. In an internet-enabled world, we all must be Homer Atkins.




I use Google Analytics and think it's wonderful. In the past I'd looked into search engine optimization a bit, on behalf of a client. While SEO techniques might be helpful, I tend to think that the internet is somewhat organic and rises and falls like the tide as search terms become popular, fade into obscurity then become popular again.




I have a three year old who is very interested in dinosaurs. In the process of helping him with his research, I rented Before the Dinosaurs from Netflix. As the name suggests, the documentary covers forms of life that preceded the dinosaurs. What was interesting to me though was the relative temperatures and oxygen levels (<30% of today's levels), as well as the periods of mass extinction. From a historical point of view, global warming is nothing new and rather than all die off in a massive flood, precedent suggests instead that we'll diversify into 25 foot tall dinohumans. Wonder what the stock market will look like in 10 million years?

Thursday, September 20, 2007

Today, an XSL discovery relating to relative URLs:

Let's say that in an XSL document you specify an HREF tag like this:
<a href="../../SQCTable.aspx" target="_blank">

And you reference the XSL document from:
http://localhost:3886/sad/CONTENT/


What you want the user to get is:
http://localhost:3886/sad/SQCTable.aspx

Instead what the user gets, because xsl doesn't do relative references, is: http://localhost:3886/sad/CONTENT/sad/SQCTable.aspx
So how do you include a relative url in an xsl document? Well one way is to use xsl:attribute like this:

<a>
<xsl:attribute name="href">
../../SQCTable.aspx
</xsl:attribute>
SQCTable.aspx
</a>

Wednesday, September 19, 2007

A few weeks ago my primary PC died, or at least I think it died as it started booting to a message saying "NTLoader not found". I reinstalled the OS and the reinstall would appear to work properly until the reboot and then, voila!, the error message.

I tried this with two different hard drives before giving up.

The computer was old, anyway, I reasoned, and after four years it was time for a new one so I dialed into ZipZoomFly and ordered myself up an 775 motherboard and an E6700 Duo. This should keep me going for a few more years, I thought.

I also ordered a new case, a nice midtower one that included a 350w power supply that I thought would be plenty beefy for anything I was likely to want to do with the PC.

The parts arrived and times have changed. The labeling and documentation is much better than I've seen in the past. The motherboard came with a nice sticker with jumper layouts for attaching to the inside of the case, and another with port layouts for the outside. The case was nicely layed out and roomy, and assembling the parts of my new PC went without incident (or so I thought!).

The processor and memory was installed, the hard drives mounted and the motherboard fixed into the case with the power connectors attached when my attention turned next to that very important of functions: video.

I have, over the past ten years or so, accumulated quite a collection of video cards. I noticed when I looked at the motherboard that there was no AGP slot but I didn't think this was an issue..I had a few PCI video cards and video performance wasn't a core issue for me--I would use them.

I plugged two of my newer PCI cards in and tried to boot up the system--no joy. Damn! One of the cards was an ATI card, the other an NVidia that was a little newer. I unplugged the ATI card and tried to boot again. This time I got the appropriate bios messages. I turned the system off, tried just the ATI card and found that with it as the only video card installed the system would boot too.

OK, so the 975XBX2KR (my motherboard) doesn't support two PCI video cards? Doesn't support two older PCI video cards? Not sure, I decided to order a new PCI Express x16 video card. I found that my motherboard was friendlier toward ATI Crossfire than Nvidia SLI and that folks in general liked the Radeon 2600PRO. I found one with 512MB on NewEgg and ordered it.

In a few days it arrived, I installed it and the system booted up happily with dual monitors. Joy! I settled down and started to install software. While waiting for one particularly lengthly installation to complete I started leafing through the manual that came with the video card. Buried inside (on the 2nd page, I think) I found a warning: "Do not install this card if your computer does not have a 400 watt power supply or greater". Yikes! The power supply that came with my case was only 350 watts! Perhaps I had already damaged my computer!

Time to order a new power supply. Off to Tom's Hardware I went in search of power supply reviews. The one they liked the most was made by a company called Verax. NewEgg doesn't carry Verax but they do carry Sparkle which according to this post (and others) are the same. So tomorrow I should receive my new 600W Sparkle power supply. Hopefully it will fit.

Tuesday, September 18, 2007

Here's my discovery for today. DotNet 2.0 is great in that you can set permissions on folders and files programmatically. So I've got a routine that assigns permissions that looks like the following, and I'm happy with it and it's working well.

Private Sub AddDirectorySecurity( _
ByVal sDirName As String, _
ByVal sAccount As String, _
ByVal oRights As FileSystemRights, _
ByVal oControlType As AccessControlType)

Dim oDir As DirectorySecurity = Directory.GetAccessControl(sDirName)
oDir.AddAccessRule(New FileSystemAccessRule(sAccount, FileSystemRights.FullControl, AccessControlType.Allow))
Directory.SetAccessControl(sDirName, oDir)
End Sub


Well, now I want to use the routine to add a permission on a folder to the "users" group that's built in to windows. What happens when I try? A nasty IdentityNotMappedException exception. How could this happen? I know the account exists, and I know (or at least I think I know) that it's spelled correctly. (JLYNDS\Users).

Many minutes of fruitless googling ensues until...at last...eureka! I find the answer. Since "users" belongs to that special class of group, the "built in" group, instead of using machine name\group name as the account, I need to use the word "builtin" as in "builtin\Users".

Who woulda thunk it?

Monday, September 17, 2007

I've been working for the past couple of days to create a setup for an ASP.NET application. Microsoft's setup wizard has come a long ways since the days of VB.6 and I'm finding it's now quite flexible.

I've managed to create a setup application that creates an ASP.NET website with the appropriate permissions (via a helper app) and that copies in a SQL Express database. My helper app also restarts IIS and configures and starts a windows service.

Since I want this web app to act like a desktop application, I needed shortcuts on the desktop and in the programs group so that the user could start it up. The setup wizard can create shortcuts, but it turns out that there are two types: One for traditional applications, and a separate type for internet URLs.

These internet shortcuts are managed using a COM interface and most of what I found on the subject of COM interfaces refers to either C++ or C#. Here's a VB.NET translation. The "CreateShortcut" method creates an internet shortcut (with an extension of ".URL") in the specified location with a link to the specified URL.

Imports System
Imports System.Runtime.InteropServices

Public Class CreateInternetShortcut
<ComImport(), _
Guid("CABB0DA0-DA57-11CF-9974-0020AFD79762"), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Private Interface IUniformResourceLocatorW
Sub SetURL( _
<MarshalAs(UnmanagedType.LPWStr)> ByVal _
pcszURL As String, _
ByVal dwInFlags As Int16)

Sub GetURL( _
<Out(), MarshalAs(UnmanagedType.LPWStr)> ByVal ppszURL As String)

Sub InvokeCommand( _
ByVal purlici As IntPtr)
End Interface


<ComImport(), Guid("FBF23B40-E3F0-101B-8488-00AA003E56F8")> _
Private Class InternetShortcut
Implements IUniformResourceLocatorW

Public Sub GetURL(ByVal ppszURL As String) Implements IUniformResourceLocatorW.GetURL

End Sub

Public Sub InvokeCommand(ByVal purlici As System.IntPtr) Implements IUniformResourceLocatorW.InvokeCommand

End Sub

Public Sub SetURL(ByVal pcszURL As String, ByVal dwInFlags As Short) Implements IUniformResourceLocatorW.SetURL

End Sub
End Class

Public Sub CreateShortcut( _
ByVal sFilePath As String, _
ByVal sURL As String)

Dim oIS As New InternetShortcut
Dim oPF As System.Runtime.InteropServices.ComTypes.IPersistFile = oIS

oIS.SetURL(sURL, 0)
oPF.Save(sFilePath & ".url", True)

Marshal.ReleaseComObject(oPF)
End Sub
End Class

Wednesday, September 05, 2007

This last week has been a pretty special one for me...my oldest son started kindergarten, and I got to talk with several old friends that I haven't heard from in years and years. I also drove north for 7 hours with three little kids in the back seat of our family minivan...

You know what's interesting about toys for little children? There doesn't seem to be any sort of cost/quality relationship, where by quality I mean how interesting little children find the toy to be. My kids like wooden trains and building blocks, which are our biggest toy investments, but I've also purchased various musical devices (little pianos, singing drums) which they snub in favor of a dime-store harmonica, an old tambourine and an ancient Egyptian drum we picked up used at a store in Greensboro.

When in the toy store, they are attracted to various cars and of course to the movie promotional toys and on occasion my resolve has broken down and I've actually purchased something (for example, a CARS movie toy tow truck that moves) or a large pirate ship. Once at home the kids quickly become bored and the expensive new toys are resigned to the bottom of the toy box.

I think a lot of the interest that kids have in toys is in novelty. Musical instruments that require them to make their own sounds, blocks that don't become toys until they're assembled into some fantastic item of the child's imagination, train tracks that are different each time they're assembled -- these toys always have novelty. A brightly colored truck that always does just one thing: move when a button is pushed and can not be a catalyst for the child's creative process quickly becomes boring.