November 2005 - Posts - Jon Galloway

November 2005 - Posts

[tool] DiffDoc - Show differences between Word documents (and PDF, XLS, PPT, RTF..)

I just read about DiffDoc on Buck Hodges' blog. This thing's amazing - it shows differences between all sorts of businessy document formats - MS Word, Excel, PowerPoint, Wordperfect, PDF, RTF, and HTML

Wow! I don't know how many times I've been handed a new version of a software spec with no clues as to what has changed between versions, and this would have saved me quite a bit of grief.

There's a free trial available, and it worked just great on my tests. Check out the HTML demo slides here.

[Source: Buck Hodges - How to diff Word documents ]

Posted by Jon Galloway | 1 comment(s)
Filed under:

[fix] Killing the F-Lock on MS Keyboards (even under USB)

Summary

None of the normal hacks to disable the F-Lock key on Microsoft keyboards work if you're connected via USB. The XML file at the end of this post corrects it.

Long story version

For some bizarre reason, the function keys (F1 through F12) on MS Keyboards have different meanings. I can't say it any better than Udolpho:

A few years ago Microsoft decided that something should be done with the function keys, F1 through F12, which sit at the top of every PC keyboard and have done so since IBM and God put them there in 1987.  Microsoft decided out of the blue that the keys should be assigned arbitrary program actions, such as Undo, Redo, Open, Save, Reply, etc.  Pressing F10 on Microsoft's newer keyboards starts the spell check routine, for example, if such a routine is supported by the application that currently has focus...

The most common key used is probably F5, labeled in virtually every Windows application as the Refresh key. It causes whatever window has the focus to redraw itself with up-to-date information. It's commonly used in browsers to refresh the web page. But refresh isn't even present on Microsoft's remapped keys; instead F5 is now the Open command, which means that in the most commonly used program it is entirely useless. And as with Word's spell check, the browser menu still tells you to use F5 to refresh. Well, don't bother.

This is especially annoying if you're developing software on Windows, since most development environments make heavy use of the function keys.

There is an F-Lock key on the keyboard which allows toggling the function keys to their proper behavior, but until recently it had to be hit every time you rebooted. They finally fixed it to remember the setting when you reboot, but... it only works when the keyboard is connected via the PS/2 keyboard port. Many newer computers (like mine) only have USB connections, which don't remember the F-Lock settings on reboot. Argh.

Jason Tsang wrote up some cool registry files to eliminate the F-Lock by modifying the keyboard scan codes, but sadly they don't work when the keyboard is connected via USB. Argh.

Udolpho came up with a workable solution which uses the Intellitype keyboard configuration software to map the F keys to a VBS script which calls SendKeys to send the correct key. This of course begs a question - if there's keyboard configuration software software, doesn't it allow configuring the F-Lock behavior? Nope. It has a lot of interesting options, but maddeningly doesn't allow configuring the F-Lock key behavior. So, anyway - Udolpho's solution works, but it's a pretty wild hack that requires manually mapping each key in the config software and running a VBS script every time you hit a function key.

I came up with a slightly simpler solution. I figured if Intellitype allows you to configure the key behaviors, it's got to store the configuration information somewhere. Sure enough, it's stored in a file called commands.xml. On my default installation, it's at C:\Program Files\Microsoft IntelliType Pro\commands.xml.

I made a backup of the commands.xml file and made a special version which maps the keys to the standard F-Key settings. This is a baby with the bathwater approach that probably kills some of the other special media buttons which I've never used; they're all in the commands.xml backup in case I ever want to hook them up. Anyways, here's the commands.xml file I came up with:

<?xml version="1.0" encoding="Windows-1252" standalone="yes" ?>
<DPGCmd>
    <Copyright>
        
Copyright (c) 1983-2005 Microsoft Corporation. All rights reserved.
    
</Copyright>
    <
Version>5.30.606.0</Version>
    <CHS 
/>
    <CHT 
/>
    <ENG 
/>
    <FRA 
/>
    <DEU 
/>
    <ITA 
/>
    <JPN 
/>
    <KOR 
/>
    <PTB 
/>
    <PTI 
/>
    <ESP 
/>
    <ALL>
        <Application 
UniqueName="StandardSupport">
            <C302 
Type="5" KeySeq="F1" />
            <C203 
Type="5" KeySeq="F2" />
            <C204 
Type="5" KeySeq="F3" />
            <C307 
Type="5" KeySeq="F4" />
            <C308 
Type="5" KeySeq="F5" />
            <C309 
Type="5" KeySeq="F6" />
            <C900 
Type="5" KeySeq="F7" />
            <C901 
Type="5" KeySeq="F8" />
            <C902 
Type="5" KeySeq="F9" />
            <C401 
Type="5" KeySeq="F10" />
            <C311 
Type="5" KeySeq="F11" />
            <C310 
Type="5" KeySeq="F12" />
        <
/Application>
    <
/ALL>
<
/DPGCmd>

So, to set this up you just need to:

  1. Rename your commands.xml file (commands.xml.bak for instance)
  2. Create a new text file and edit it in Notepad
  3. Paste in the above text
  4. Save it as commands.xml in the same folder the old commands.xml file was in
  5. Test it - open IE, browse to a site, and hit F5. Did the page refresh?

Kinda hacky. If I get enough hits on this, I may put an installer together.

Posted by Jon Galloway | 6 comment(s)
Filed under: ,

[tip] (Re)installing Windows on a SATA drive

I recently bought a Dell Dimension 9100, mainly due to the 24" LCD bundle. I blew out whatever goofiness had been preinstalled and went to intall Windows XP SP2. Well, it has a SATA drive and Windows still doesn't include SATA drivers.

One solution, as Jeff Key describes, is to slipstream the SATA drivers.

In my case, though, there was a simpler solution - change the BIOS settings for SATA Operation from "RAID Autodetect / AHCI" to "COMBINATION" as detailed here. That did the trick.

Of course, the network drivers need to be loaded. For a Dell 9100, the drivers are here.

Posted by Jon Galloway | with no comments
Filed under:

[wish] Windows MCE TV / Video Playlists

I'll confess - my kids watch the occasional TV show. At least with our Windows MCE setup, they watch shows my wife and I preselect instead of whatever happens to be on at the time, but that brings with it the annoyance of having to change the shows when each one ends.

Why doesn't MCE have TV / Video playlists which work exactly the same as Windows Media Player music playlists? I'd love to stack up two or three shows and play them in order without any intervention. That could be handy for parties, too - have a playlist of interesting shows or videos playing in the background without having to run and change them each time one ends.

Posted by Jon Galloway | with no comments
Filed under: ,

3D Pie Chart

Here's a nice free3D Pie Chart class on CodeProject. Version 1.4 (just released) includes some bug fixes and a demo app. Purty.

Posted by Jon Galloway | with no comments
Filed under: ,

[FIX] BizTalk 2004 - Failed to generate the master secret (error code 0X80070005)

The BizTalk Server 2004 installation fails on XP SP2 with an error message that doesn't give much of a clue as to what the problem is: Failed to generate the master secret (error code 0X80070005). As Marco says in his post, it's easy enough to Google it if you know that XP SP2 caused the problem, but otherwise it's not easy to figure out.

Marco's got the fix here:

The install failure is: An unexpected error occurred while configuring the Single Sign-On server. The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. Microsoft support article 841893 explains in detail how to resolve the issue by:
* Using Gpedit.msc to enforce the authentication of client calls or
* Using Registry Editor to enforce the authentication of client calls
Posted by Jon Galloway | with no comments
Filed under:

[tip] Use the Coral Distribution Network to save bandwidwidth

A family member called me about the bandwidth on his site due to MP3 downloads lately. The host company said there had been 40GB of downloads this past month, which required extra fees since the hosting plan doesn't allow for near that bandwidth. I changed the offending MP3 links to use the (free) Coral Distribution Network , and thought it would be good to share the information on this service since it's bailed me out more than a few times.

The Coral Distribution Network (CDN) is a free service that was started by NYU includes a global network of universities and other nice folks. More info about it on the Coral CDN site and on the Coral Wiki.

The coolest thing about it is that it's really easy to use. You just modify your links to include .nyud.net:8090/ after your domain name. So instead of this:
http://www.mysite.com/mysite/media/mp3/example.mp3
you would use this::
http://www.mysite.com.nyud.net:8090/mysite/media/mp3/example.mp3

The file is still on your website, but when people click on the link it gets routed through CDN. The first time someone clicks on the link, the file's not there and it gets downloaded from your site just like it always would have, but now the CDN knows about it and grabs a copy. From then on, if someone clicks the link, CDN checks if it's still on your website and hasn't been changed, then sends the file itself. You don't pay for the bandwidth; they handle it. What's even cooler is that they have a global network, so if someone in Australia downloads it, they get the file from an Australian Coral server, so it's much faster from the user point of view.


(see area maps here)

Some caveats:
1) I read in their FAQ that it's possible for people to have problems with downloads if they have a weird firewall setup (port 8090 outbound blocked), but I haven't run into this. Something to be aware of, but if the alternative is to pay thousands a year in hosting I think this is worth it.

2) Transfers > 50MB just redirect back to the original host due to bandwidth overuse (see the FAQ).

3) You're not able to track your downloads. If you need hit counts for sponsorship, this won't work for you. On the other hand, if you want to post some audio or video and

Posted by Jon Galloway | with no comments
Filed under:

[OT] 300th post

Well, hey, look at that! This is my 300th post. Hooray for multiples of 100!

Posted by Jon Galloway | with no comments
Filed under:

NSurvey goes 2.0, shifts to mixed license model

NSurvey has gone 2.0 and shifted to a mixed license - free for community use, paid for commercial use. There's also a pretty good NetPolls system, and a new DotNetNuke module version has just been released (doesn't appear to be linked on Products page yet, but if you register you can download it from the forum ).
 
I've got mixed feelings about this - it's a great package that's obviously taken some time to build, but new licenses aren't cheap. The whole open source community development thing doesn't always seem to pan out.
 
Still, it's a great package and the new release adds a lot of professional features.
 

NSurvey V2.0 is finally available along with new licensing terms from the member section. A a FREE community license is still available for small to mid size surveys.

Regarding features V2.0 provides with a new level of professional features like a new reporting engine, most part of the core have been rewritten and a full active directory support is now part of the tool.

DotNetnuke version will be available again beg 2006 stay tuned ..

Here is the complete change list of v2.0 :

New features

  • Submit survey button gets disabled after a user clicks on it to avoid multiple submissions
  • New styles creator to create new styles template online and visually without vs.net or webmatrix
  • You can now create groups to manage users, roles and survey access
  •  Roles's rights are now inclusive if you have a user, group with several role
  •  Full Active Directory user / group provider to integrate NSurvey in any Active directory environement
  • Active directory security addin that allows to take the form only if the user is authentifed and has the rights to take it
  • Password image generator answer item, can be used to avoid automatic submissions from bots
  • Password image generator security addin
  • Progression percent can now also be shown as graphical bar
  • Messages editor allows you to edit / translate all system and control messages of the language Xml files
  • Web installer located at : "/installer/default.aspx" that allows remote installation of NSurvey's database without any external tools.
  • Specify a reporting alias that will replace original question, answer labels in exports and  results reporting. It also makes it easier to retrieve data directly from the database using third party reporting tools without having on the question, answer label which could change.
  • Country flags can be shown to the user for multi-languages selections surveys
  • Creation of messages templates for the Emailing features
  • Specify fields, answers to export
  • Token generator and security addin that let you generate or import unique tokens for survey security access
  • Tokens can be used along with the emailing tool using the [--invitationtoken-] tag instead of the standard [--invitationid-] tag
  • Ranking answer type added
  •  Constant sum answer type added
  • SurveyBox control supports languages which need to be written from the right to left
  •  Users can be allowed to change their answers after they have submitted them
  • New "key provider" model to allow external security addins to provide unique keys to the resume and change modes
  • Active directory, Email and token security addins can be used a key providers
  • Report engine has been completly rewritten
  • Reports can be cloned
  • Extended filter allows you to create a filter based on specific answer types
  • Report builder to customize reports based on report items
  • Report item addins architecture allows to easily extend or integrate any additional new item to the reporting engine
  • Included report items addins (Free text, graphical, voter and cross tab report items)
  • Show text answers grouped by answers or by voters
  • Paged text answers reports
  • Ability to show publicly specific reports at the end of the survey
  •  Report can be shown in print mode
  • Branching, skip logic and conditional messages engine have been completly rewritten
  • More user friendly Branching, skip logic and conditional messages engine interfaces
  • Branching, skip logic and conditional messages engine support now logical branching AND / OR groups
  •  Regex can be used to validate text entries for Branching, skip logic
Posted by Jon Galloway | with no comments
Filed under:

E4X - XLINQ in Javascript, but when?

With all the AJAX / Web 2.0 hype lately, I've been thinking about what's next for Javascript (the J in AJAX - Asynchronous Javascript And XML), a.k.a. ECMAScript.

Now, Javascript (the worlds most misunderstood programming language) is a pretty advanced language. In a lot of ways it was way ahead of its time when it first came out, blending object orientation with dynamic scripting. Unfortunately, a lot of that elegance and extensibility is wasted on HTML hackers, but the fact is that the glue behind the all these flashy AJAX web apps came out almost 5 years ago and has held up pretty well.

However, if we're really committed to this Web 2.0 thing (and it seems like we are), we need some solid infrastructure. Instead of writing piles of Javascript scripts to handle XML based on the clunky DOM (Atlas and other projects), why not upgrade Javascript to beef up the XML support?

Better yet, why doesn't Microsoft implement XLINQ like support in the JScript engine for IE?

Here's the interesting thing - ECMA-357, ECMAScript For XML (E4X) proposed exactly that back in June 2004. Firefox 1.5 will have partial support for it, but it's not on the list for IE7 and at this point it doesn't look like it's necessarily on the IE roadmap at all. That's too bad, because if there's any environment and language that could use improved XML support, it's Javascript on IE, and right about now before we crank out piles of complex legacy DOM / XML code for this whole WebJax One Point Niner thing.

E4X moves XML support right into the Javascript language, which greatly simplifies XML manipulation. Check this code sample out (from Brendan Eich's slides): 

var order = <order><customer>. . .</customer>
        <item><price>
5</price><qty>10</qty></item>
        <item 
level="rush">
         <price>
2.5</price>
         <qty>
30</qty>
        <
/item>
        <item 
level="rush">
         <price>
1.5</price>
         <qty>
50</qty>
        <
/item>
        <
/order>;
var items = order.item; // XMLList of item el'ts
var prices = order..price;
var urgentItems = order.item.(@level == "rush");
var itemAttrs = order.item[0].@*;

Here's a more informative example (via CodingForums) - an RSS reader. With Javascript 1.5 and E4X, it takes only 7 lines of code to hit an RSS feed, iterate, and display the results. Check out the demo and code explanation here, but the main thing is that sweet for each loop.

<script type="application/x-javascript; e4x=1">
//<![CDATA[
var request = new XMLHttpRequest();
request.open("GET", "/index.php/main/rss_2.0", false);
request.send();

var rss = new XML(request.responseText.replace(/^[\s\S]*<rss/, "<rss"));
var dc = new Namespace("http://purl.org/dc/elements/1.1/");

for each (var item in rss..item.(dc::subject == "JavaScript")) {
    alert(item.title + "\n\n" + item.description);
}
//]]>
<
/script>

But I think this is the coolest - E4X with Expandos:

<script type="application/x-javascript; e4x=1">
//<![CDATA[
var html = <html/>;
html.head.title = "My Page Title";
html.body.@bgcolor = "#e4e4e4";
html.body.form.@name = "myform";
html.body.form.@action = "someurl.jss";
html.body.form.@method = "post";
html.body.form.@onclick = "return somejs();";
html.body.form.input[0] = "";
html.body.form.input[0].@name = "test";
//]]>
</script>

// gives you this:
<html>
  <
head>
    <
title>My Page Title</title>
  <
/head>
  <
body bgcolor="#e4e4e4">
    <
form name="myform" action="someurl.jss"
          
method="post" onclick="return somejs();">
      <
input name="test"></input>
    <
/form>
  <
/body>
<
/html>

 

What's the point? The point is that:

  1. AJAX is here and it's big, like it or not
  2. We're going to be writing a ton of Javascript over the next few years (or at least using a lot of libraries and frameworks that run on top of scads of Javascript).
  3. E4X could make the Javascript a lot easier
  4. You can't have it. It's great, it would make the internet a better place (for developers and users), and you can't have it because it's not going to be supported in IE anytime soon. Bummer.

I guess Mozilla's always going to be driving Javascript. They started it, and they believe in it. Mozilla and Firefox extensions and applications are written in Javascript - it's the platform (XUL). It's different for IE - there's all the bad blood over the whole "Java" thing, and there are two JScript engines to maintain - the J# one and the ActiveScripting IE engine that no one at Microsoft seems excited about.

Hacked.Brain wants it. Andrew Stopford wants it. Me likum the E4X, too.

Oh, check out the slides here. More intersting stuff on Javascript's past, present, and future here.

Posted by Jon Galloway | with no comments
More Posts Next page »