Tweakomatic

The Tweakomatic is a nifty new utility that writes scripts that allow you to retrieve and/or configure Windows and Internet Explorer settings. So what, you might ask. Well, think about it. Because these are WMI scripts, they can be used to configure settings on remote computers. Need to change something on a remote machine? Then haul out the Tweakomatic. And think about this: because the Tweakomatic writes scripts, you could do something like run these scripts as logon or logoff scripts. In other words, you could quickly, easily, and automatically configure settings on any or all the computers in your organization. Get it here.

Microsoft exams are specially priced at $35

Microsoft exams which are normally $50 have been specially priced at $35 for a limited time.

For a limited time, Microsoft® is offering certification exams in India (and the subcontinent) at the special price of USD $35.00. This makes it the perfect time for you to move ahead with certification exams. Exams are available at both Pearson VUE and Prometric testing centers. Candidates must use the exam promotion code INDCHN when registering to receive the special price.

Don’t wait! Specially priced exams must be taken by December 31, 2003.

Register for an exam today.

Want your own blog?

 Get your free weblog!

Get it now, for free!  Some guy is hosting Moveable Type based blogs for free at weblogs.us

You get a blog, 100mb of hosting (for photoblog or whatever), and 1gb of traffic FOR FREE..  what a deal -- if you wanted to start blogging but weren't sure how to get started, now you can!

Good luck

 


[Brian Goldfarb's Blog]

Sortable Table

If you thought the Tab navigation was good, check out the Sort-able grid script. By simply setting a class on any table you can make the headers sortable. The script takes care of numbers, dates and text automatically.

Stuart Langridge has released a couple of very neat new Javascript experiments. sorttable makes any data table on a page "sortable" by clicking the table headers. I've seen this effect used to demonstrate Microsoft's proprietary "behaviors" technology but Stuart's solution has the advantage of being standards compliant and working across different browsers. Best of all, it follows the principles of inobtrusive DHTML and hooks in to the markup using only a class attribute.

Stuart's second experiment, JavaScript Event Sheets, is even more interesting. It tackles the problem of attaching events to page elements. The most common way of doing this is with inline attributes, but these require adding behavioural (rather than structural) code to your markup and can lead to additional maintenance costs further down the road. A better alternative is to use the DOM to dynamically add events, which works fine but means tightly coupling the structure of the document to the Javascript that sets up the events. Stuart's solution is to abstract the logic that attaches events to elements out to a separate file, called a Javascript Event Sheet. This uses CSS style syntax (partially handled by my getElementsBySelector function) to specify how events attached to different elements should be handled. Stuart demonstrates the idea with a common image rollover:

img.rollover { 
 mouseover: rollover_handler; 
 mouseout: rollout_handler; 
} 

Stuart's blog entries concerning the two new experiments are here and JavaScript Event Sheets.


[Simon Willison's Weblog]

EasyToggle (Tab Navigation)

Simon Willison has created an easy way to enable tabs in web pages. There is no javascript coding involved. Just include the .js file and add the class to your links.

I've been working on a new inobtrusive DHTML effect: easytoggle, which is an inobtrusive implementation of the common effect where links or tabs can be clicked to reveal part of a page while hiding the other parts. It's similar in some ways to the Multi part forms with Javascript technique.

The idea is pretty simple - all you need are a bunch of links and a bunch of elements that should be toggled by those links. When adding special behaviour to links it is always a good idea to ensure that they still link to something sensible, so that in user agents without Javascript support they still do something useful. In this case, it makes sense for them to act as anchor links that point to the elements with which they are associated. With easytoggle, all you need to do is define the links, point them at an element with an ID and assign them the class 'toggle'. The script does the rest of the work. For example, for a simple set with only two panels the markup would look something like this:

<ul> 
<li><a href="#p1" class="toggle">Panel 1</a></li> 
<li><a href="#p2" class="toggle">Panel 2</a></li> 
</ul> 
<p id="p1">This is panel 1</p> 
<p id="p2">This is panel 2</p> 

That's all it takes - the demo has a very slightly more complicated example.

I thought it was finished, until I tested it in Apple's Safari browser. In Safari, the worst possible thing happens. The initialisation code which hides all of the panels after the first one works fine. Unfortunately, the code that causes the links to change which panel is visible fails silently, leaving only the first panel accessible to users with that browser. That's a big problem.

It was at this point that I discovered that Safari's support for debugging Javascript sucks rocks. Firstly, the browser gives no indication that a bug has been encountered. I'm sure this is a deliberate usability decision, but it also means users who encounter a bug won't even know that there is a problem with the site. A quick Google led me to this page, which told me how to enable Javascript error reporting:

  1. In a command line shell, execute defaults write com.apple.Safari IncludeDebugMenu 1 (apparently Safari Enhancer lets you do this from a GUI).
  2. Reload Safari and check the "Log Javascript Exceptions" option in the newly enabled Debug menu.
  3. Start Console.app, which lives in /Application/Utilities. Note that this is not the same thing as the command line console. This took me a few moments to figure out. Macs remain a strange new realm of discovery.
  4. Javascript exceptions will now appear in the Console.app window.

Excellent - just what I needed to know. The entire error message I got when I clicked a link? (event handler):Undefined value. Gee, thanks a lot Safari. If anyone has any ideas how I can fix the script in Safari (or at the very least prevent it from being unusable) please leave me a note.

Update: Thanks to a tip from David Lindquist, the updated version of the script now works in Safari. It's a little bit uglier though.


[Simon Willison's Weblog]

Multiple Internet Explorers

Never thought this was possible.

In possibly the best news web designers will hear this year, Joe Maddalone of Insert Title Web Designs has discovered a way of running multiple versions of Internet Explorer on one installation of Windows! The problem of testing in different versions of IE has plagued developers for years, and it's fantastic to see a solution that doesn't involve running multiple partitions with separate Windows installations or shelling out for VMWare or VirtualPC.

Unsurprisingly, Joe's revelation is causing quite a stir in the web development community. Matthew Haughey is asking why Microsoft didn't tell us about this themselves, Luke Redpath has released some funky coloured icons to distinguish between versions and Ryan Parman has taken the risky (from a bandwidth point of view) step of packaging the minimum files needed to run versions 5.01 and 5.5 up in to zip files. Amazingly, they're 2.92 MB and 3.25 MB respectively. I'm running them now and they seem to work just fine - major kudos to Joe for the discovery, and Ryan for making it so easy to take advantage of.


[Simon Willison's Weblog]

StrokeIt

This is a must have utility on all Windows machines.  StrokeIt is a mouse gesture recognition program. Once you install the program simply right click and make gestures with your mouse to perform actions. For example I never have to move my mouse to the corner of a window to minimize it, I just make a small mouse movement and presto the window minimizes.

Some browse like Opera and Mozilla have mouse gestures built-in but Stroke It is truly unique in that it work on all windows. And the best thing I love is its small footprint (less than 200k). Stroke It is so cool almost everyone at my office uses StrokeIt.  Get it here.

Use scope_identity() instead of @@identity

TravisL explains why we should use scope_identity instead of @@identity when we want to get the ID of the last record that was added.

The problem with @@identity is that it returns the ID of the last record that was in the current connection. In which case if the table that you adding to has triggers (which inserts records in other tables) then @@identity returns the ID of the last record that was added by code inside the trigger. This becomes a potentially very difficult bug to track down.

So what should you do? Use scope_identity() which returns the ID of the last record that was inserted in the current scope. See MSDN:scope_identity() for detailed examples.