Wednesday, December 22, 2004

I just have to recommend this product I bought. It's a file comparison utility, and it's the best twenty bucks I ever spent. It's "Beyond Compare", by Scooter Software.

As a developer, I'm always comparing versions of files from here and there. As someone who collaborates on HTML, it's easy for people to step on each other when your only connection is a remote FTP server. BC let's you open up local and remote versions of files simultaneously and do a line by line comparison. Out of the box it's extremely powerful and intuitive, and with deep customization features it only gets better.

As a general computer user, I use BC all the time to compare folder structures, do quick backups to remote drives, stuff like that.

If you compare files and folders, or you should and you just cut and paste instead like I used to, you have to get this thing.


Tuesday, December 14, 2004

Perhaps you are, like me, using SpamNet, a fine anti-spam solution by Cloudmark. You may have noticed in the new version you get popups every now and then asking you to refer your friends as potiential customers.

This seems like spam to me, doesn't it to you? I emailed the marketing director at Cloudmark and got some results. To turn it off, follow these instructions...

Please do the following:
1. Choose Start > Run and type REGEDIT
2. Navigate to the following key:
HKEY_CURRENT_USER\Software\Cloudmark\SpamNet\DialogPrefs
3. Double click on SignatureOffer.
4. Change the value of this from 1 to 0 with a Base of Decimal.


Happy spam destruction,

Jamie

Tuesday, October 12, 2004

Pure, table free HTML is not ready for prime time. That's where I come down today.

This blanket statement is based on the following assumptions:

  1. You are building web applications, not displaying content.
  2. You need your pages to be resizeable.

This page does not meet the above conditions. Yes, the content is displayed without tables. But this is not an application, and the content does not truly resize.

If you can use absolute positioning, and you don't care about resizing, go right ahead. But if you're looking to deploy your application to multiple browsers, and you really need that resize capability, you're going to get lost in your CSS. It reminds me of trying to build cross-browser JavaScript in the late 90s, and absolute nightmare.

You can get pretty close to perfection without tables, but the browsers fall down, most notably FireFox, when you squish your screen to the point of collapsing elements. Things get ugly in there, and the time investment required seems huge for the payoff of true display abstraction.

Go ahead, use tables, but use them sparingly. Put your table formatting off into CSS wherever possible. Wait patiently for the bold new day when all the browsers truly support the new CSS standard.


Tuesday, July 27, 2004

Problems with updates using OleDbConnection in VS.Net when dates are present.

In my last post I forgot to mention, if you're having problems updating something and you're connecting to Access or another database using OleDb, do yourself a favor and edit the autogenerated code that handles record creation and deletes.

In your oleDbUpdateCommand section, you'll find that date fields are handled with the attribute

System.Data.OleDb.OleDbType.DBDate
 
Instead switch the "DBDate" to "Date" and the update will actually function, like

System.Data.OleDb.OleDbType.Date
 
It is safe to do a global search and replace on this, as the other areas that use DBDate without problems aren't affected by the change.

This reminds me of all the trouble you have to go through with date delimiters when you're working with old ADO in Access and SQL Server, that is, using "#" or " ' " respectively.
Somtimes, they lie to you. Microsoft has plastered all over it's documentation that you can just call "Update" on a dataset, and bingo, all relevant changes will be posted back to the datastore in a bandwidth conserving manner.

An example...

private void btnSave_Click(object sender, System.EventArgs e)
{
     oleDbDataAdapter1.Update(dataSet1);
}


How tidy this would be! To bad it doesn't work if you're doing something of any value with the dataset. For example, you might be using databinding on a form. Not exactly stretching the limits of the IDE here. The thing is, the CurrencyManager, which handles the task of binding datasets to form elements, is a bit sloppy. You get intermittent results if you just bind a form element to a dataset and then call update. The form does not consistently "let go" of the bound value, so when you call update, it may be the case that the dataset does not appear to have been altered, so you're hosed.

Here is an example of a properly built function, replacing the one line piece of crap above...

private void btnSave_Click(object sender, System.EventArgs e)
{
     this.BindingContext[dataSet1, "TableName"].EndCurrentEdit();
     try
     {
        if(dataSet1.GetChanges() != null)
        {
           this.oleDbDataAdapter1.Update(this.dataSet1.GetChanges());
           this.dataSet1.AcceptChanges();
        }
     }
     catch(Exception err)
     {
        MessageBox.Show(err.ToString());
     }
}


Not exactly the same, but it works.

Thursday, April 29, 2004

I'm working in VS.Net, and I'm creating a setup package. I ran into an obscure problem that I just had to pass along. When you create a setup package, an MSI file, it doesn't include the ability to create any procedure based code like the old, really lousy setup funtionality under the old Visual Studio.

When you register users, you sometimes want to create a file, in my case an XML file containing configuration information, in the folder the user selects for the installed application. The problem is, you can't use "Application.StartupPath" in an EXE that is called from the MSI file, because that file runs in a temp folder, and there is no point in creating a settings file there. Obviously, you want to save the file to the folder where the application is running, but how do you pass the user's selection to your registration EXE at runtime?

The setup package offers a screen named "Installation Folder", which is where the user selects the deployment folder. You can get at the string the user selects using the attribute "TARGETDIR", however there is a trick to it, and that's what I wanted to pass along.

In your "Register User" screen, the one that calls your registration EXE, you have an attribute called Arguments. To correctly pass the path to your EXE, you have to make sure it can accept command line arguments, and example of which you can find here.

To put it short, the text you should enter in the arguments field is (in bold for clarity) "[TARGETDIR] . Notice the quotation mark at the beginning and not the end of the string. Isn't that nasty? If you don't add this, you are going to end up with an arguments array that automatically splits at any space characters, (" "), so if you try to read the value your going to get "C:\Program" because of the space in "Program Folders". If you add the quotation mark at the end, like "[TARGETDIR]", you end up with a path that includes a trailing quotation mark, such as C:\Program Files\Company\Application" . Another option would be to join the elements in the array within your EXE, but this is just easier, and gives you the ability to pass arguments as well, although I haven't teased out the syntax for this.

Cheers!

Wednesday, April 28, 2004

OK, so you are using moving to Windows XP from Windows 2000. You are on a laptop, or a machine with a keyboard with all these ridiculous little custom buttons at the top that do stuff like pull up your system manufacturer's PDF file. You like to lock your machine when you step away from it, like any sane person does, knowing that they are all out to get you, but you miss hitting Ctrl-Alt-Delete to gain access to the quick "Lock Machine" function that Windows 2000 offers.

Why not use one of those stupid "extra" buttons on your keyboard to lock your machine with? It just so happens I have an EXE you can use, I pulled it off of an HP Pavilion, but you can use it on any XP machine. Just map one of those buttons to the EXE, and you're all set. Here is the file... QuikLock.zip

Monday, April 26, 2004

Diving yesterday at Haigh Quarry was cold! It's about 40' in there, chilly even with the drysuit, particularly after you've been down for more that a half hour. First dive of the year, and it was great to get underwater again. Visibility was the best I've ever seen it, you could see the bottom of "the hole" from the edge of the cliff, that's looking downward from about 55' to 80'. I saw some sort of tank-treaded quarrying gadget I hadn't seen before, but other than that it was all pretty familiar. My new OMS gauntlet style gloves didn't live up to my high expectations.

Sunday, April 18, 2004

I just finished reading "Prey" (2002) by Michael Chrichton, and I just had to say something about what a complete waste of time it is. It's about nanotechnology, so I was hopeful because of the wide range of possibilities he could explore. Instead, it was a poorly concieved rehash of his brilliant Andromea Strain, without a shred of the story-telling ability of the original film. It just didn't make sense, in terms of either technology or character motivation.

The worst part for me was that the story was so obviously pandering to the current computer rendering capabilities of hollywood. I could easily picture all the gee-whiz graphics that would be installed in the flick to cover the absurd, slow-pitched storyline. Were you impressed with the sandstorms in "The Mummy Returns" (2001)? Well, so was Crichton, because right after he saw it, he undoubtedly rushed home, took the technology buzz de jour, nanotech, layered both over the plot of his first film success, and popped out this looser during a long weekend.

Perhaps, after the phenominal success of the Jurrasic Park series, he's just gotten lazy. Too bad, because there was a time when the guy could really put a yarn together. I'm just thankful I didn't pay for the book.

Saturday, April 17, 2004

I'm building some threaded SOAP client GUI stuff in C#, and it's pretty fun. I'm interested to see how this model is going to work on the Symbol PPT 2846 unit I'm working with to build barcoding/SOAP connectivity. For the desktop portion of the system, things are working wonderfully.

I'd been doing some work with AppForge, but unfortunately, nobody seems to give a crap about those devices that I've held so dear, namely the Symbian OS (Nokia phones) and the good old Palm Pilot OS. Everybody in industry seems to be fixated on Microsoft based handhelds.

Scuba diving season is now upon us again. I'm hoping to go diving with a couple of buddies on the 25th. It will be great to get back in the water, and I don't care how damn cold it is. Bill Prince of Nordic Diver is starting to spam all the divers again. It's great to see him really cranking up the communications. I hope I spend lots of time on his boat this year. Hopefully one of the guys will bring a camera on the 25th so I can finally start posting some dive pictures.

Monday, April 12, 2004

My buddy Ted is in Japan, and his is such a swell blog, I thought I'd link to it. Look, he's crawling all over the set of "Lost in Translation"...

http://www.vetana.com/ted/tokyo/

Thursday, April 01, 2004

So, you type in an invalid URL and you find yourself redirected to the absurd website "www.bestsearchonearth.info". Surprise, you're a victim of New.net services. You've probably downloaded some junky shareware that has New.net bundled in it.

If you're on IE or Netscape, do yourself a favor and follow the Netscape removal instructions, which are...
"To deactivate the Search Helper Service, go to the Add/Remove Programs tool in your Control Panel and uninstall the New.net Domains application."

Monday, March 29, 2004

Here is a news article of interest. NASA has made a scramjet function for 11 seconds. If this becomes operational, the cost of launching material into space will be drastically reduced.

http://www.newscientist.com/news/news.jsp?id=ns99994824

Friday, March 26, 2004

Well, I guess I'm finally going to start posting some public content here. My particular wish is to help some poor sap like me out there who is googling for info on this or that, and can't find the data. So the post today is going to be about connecting to password protected databases using Visual Studio.Net, C# specifically.

OK, so if you read the docs, and most of the stuff out there, you see all kinds of neat info about how to configure the password of the database using the various methods .Net has to connect to data sources. Further, you know how you can password protect an Access database by opening it exclusively in Access? Well, if you don't, open Access first (but don't open any database) then select File/Open, then browse to the database you want, highlight it, and in the lower right corner hit the dropdown within the "Open" button and select "Open Exclusive" (shouldn't that be "Open Exclusively"?). Anyway do that and you can then get at the password setting feature. Go find that yourself.

So, now you've got this swell password protected database sitting out there on the network, and you're moving to .Net like me and you want to connect, which you've done like one zillion times before using ADO and/or ADOX, but guess what? You're stumped. You ain't opening doodly because you're getting an error like "Connection failed, missing or open exclusively" or some such misleading malarky.

Well the real deal is that you don't use "Password=foobar", you need to use the somewhat difficult to find @"Jet OLEDB:Database Password=foobar;", which I uncovered digging around by creating a blank data connector and looking at the latent attributes, of which there are MANY.

So, there you have it. I hope that helps someone.