Category Archives: Code

Tables: MS Word vs CSS

Here’s why I like CSS.

Here’s a table created in Microsoft Word and pasted into a CMS:


<table border="1" cellspacing="0" cellpadding="0" class="MsoNormalTable" style="border-collapse: collapse; border: medium none"><tbody><tr><td width="64" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: windowtext 2.25pt solid; padding-left: 5.4pt; background: #4bacc6 0% 50%; padding-bottom: 0cm; border-left: #f0f0f0; width: 47.65pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">&nbsp;</font></span></strong></td><td width="170" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: windowtext 2.25pt solid; padding-left: 5.4pt; background: #4bacc6 0% 50%; padding-bottom: 0cm; border-left: #f0f0f0; width: 127.85pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Description</font></span></strong><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">&nbsp;</font></span></strong></td><td width="335" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: windowtext 2.25pt solid; padding-left: 5.4pt; background: #4bacc6 0% 50%; padding-bottom: 0cm; border-left: #f0f0f0; width: 250.95pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">&nbsp;</font></span></strong></td></tr><tr style="height: 36.85pt; page-break-inside: avoid"><td rowspan="7" width="64" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #4bacc6 0% 50%; padding-bottom: 0cm; width: 47.65pt; padding-top: 0cm; height: 36.85pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Benefits</font></span></strong></td><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; height: 36.85pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Low Total Cost of Ownership (TCO)</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; height: 36.85pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">No up-front hardware or software costs</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Significantly less work effort to set-up a B2B integration solution since it involves&nbsp;mostly configuration tasks rather than programming</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Free use of online development interface&nbsp;for developers&nbsp;</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Data processing rates for usage&nbsp;are world&rsquo;s best</span></p></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Best Return on Investment (ROI)</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">ROI achieved sooner due to low up-front and on-going costs </span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Optimizes work effort since tasks removed or simplified</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Higher ROI due to removal of costs</span></p></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Speed of Delivery</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Solutions delivered in days and weeks rather than months and years</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">No requirement to establish and maintain hardware and software</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Support for standards reduces need for specialists and training</span></p></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Control and Flexibility</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Developers have full control over tenancies, design data and administration</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Development can be done anywhere at anytime</span></p></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Guaranteed Service </font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Secure and reliable infrastructure </span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Guaranteed service level</span></p><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Data-back-up and disaster recovery provided </span></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Market Leading Service</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; background-color: transparent; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Most advanced functionality</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">First remotely configurable Integration, BPM and BI service</span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Wide support for industry standards and customizations</span></p></td></tr><tr><td width="170" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 127.85pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Future Proof</font></span></td><td width="335" valign="top" style="padding-right: 5.4pt; padding-left: 5.4pt; background: #d8d8d8 0% 50%; padding-bottom: 0cm; width: 250.95pt; padding-top: 0cm; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; border: #f0f0f0"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Quarterly releases ensure up-to-date functionality </span></p><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Upgrades are our responsibility</span></p></td></tr><tr><td width="64" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; background: #4bacc6 0% 50%; padding-bottom: 0cm; border-left: #f0f0f0; width: 47.65pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><strong><span style="color: white; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">&nbsp;</font></span></strong></td><td width="170" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0cm; border-left: #f0f0f0; width: 127.85pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; background-color: transparent"><span style="font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;"><font size="2">Expert Assistance</font></span></td><td width="335" valign="top" style="border-right: #f0f0f0; padding-right: 5.4pt; border-top: #f0f0f0; padding-left: 5.4pt; padding-bottom: 0cm; border-left: #f0f0f0; width: 250.95pt; padding-top: 0cm; border-bottom: windowtext 2.25pt solid; background-color: transparent"><p style="margin: 0cm 0cm 4pt" class="MsoBodyText"><span style="font-size: 8pt; font-family: &#39;Calibri&#39;,&#39;sans-serif&#39;">Expertise and knowledge available for support, development, consulting and training</span></p></td></tr></tbody></table>

With a little CSS coding (held in an external file), it has become this:


<table class="featuretable">
  <tbody>
    <tr>
      <td class="ftop"></td>
      <td class="ftop">Description</td>
      <td class="ftop"></td>
    </tr>
    <tr>
      <td class="fside">Benefits</td>
      <td class="fd0">Low Total Cost of Ownership (TCO)</td>
      <td class="fd0">No up-front hardware or software
costs<br>
Significantly less work effort to set-up a B2B integration solution
since it involves mostly configuration tasks rather than programming<br>
Free use of online development interface for developers <br>
Data processing rates for usage are world’s best</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd1">Best Return on Investment (ROI)</td>
      <td class="fd1">ROI achieved sooner due to low
up-front and on-going costs<br>
Optimizes work effort since tasks removed or simplified<br>
Higher ROI due to removal of costs</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd0">Speed of Delivery</td>
      <td class="fd0">Solutions delivered in days and
weeks rather than months and years<br>
No requirement to establish and maintain hardware and software<br>
Support for standards reduces need for specialists and training</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd1">Control and Flexibility</td>
      <td class="fd1">Developers have full control over
tenancies, design data and administration<br>
Development can be done anywhere at anytime</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd0">Guaranteed Service</td>
      <td class="fd0">Secure and reliable infrastructure<br>
Guaranteed service level<br>
Data-back-up and disaster recovery provided</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd1">Market Leading Service</td>
      <td class="fd1">Most advanced functionality<br>
First remotely configurable Integration, BPM and BI service<br>
Wide support for industry standards and customizations</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd0">Future Proof</td>
      <td class="fd0">Quarterly releases ensure up-to-date
functionality<br>
Upgrades are our responsibility</td>
    </tr>
    <tr>
      <td class="fside"></td>
      <td class="fd0">Expert Assistance</td>
      <td class="fd0">Expertise and knowledge available
for support, development, consulting and training</td>
    </tr>
  </tbody>
</table>

Old version: 12250 bytes.

New version: 2490 bytes + 605 bytes of CSS. And much more maintainable, and it’ll be easier to change the table styles later.

OK, the new looks slightly different to the old (this was on purpose to enlarge the fonts a bit), but jeez.

MySchool: so wrong

Background: The Australian federal government has finally pushed out a web site publishing performance metrics for all schools throughout Australia. There has been much brouhaha regarding this. For some reason, the go-live wasn’t a quiet one, but a very loud, flick-on-the-switch big-bang go live.

Naturally, the website asploded.

Any website that’s going to be hit by 1% of the Australian population the moment it goes live is going to blow up unless there are some cluey, experienced people behind it. Clever, inexperienced people, or experienced idiots with a large budget might stand a chance if things got progressively worse over time, but turn it on and hammer it on day one? MySchool.edu.au does not have cluey, experienced people behind it. There are various signs.

For a start, what is it with the TLD? .edu.au seems fine, but what’s wrong with a redirect from .gov.au given they were the folks running around promoting it? It’s not like myschool is an education institution.

Then you get there. Guess what? It won’t work without JavaScript. At all. Because typing in a string and hitting enter demands the availability of JavaScript. Using <form> is so 2000s. Get with the new decade! It’s so vital to the site that users must not be allowed in if they don’t have JavaScript. Screw the blind! They’ve only got one school to go to anyway.

And the site is slow, amazing slow. But I guess if you’ve got to download all that JavaScript to enter that string, of course it’s going to be slow. Switching to a different set of data? Couldn’t download that and just do a hide/show, no you’ve got to do some kinda AJAX-y postback crap for a massive round-trip delay; if you were dealing with rapidly changing data, that might almost make sense; every year this website will get data updates, so no: this makes no sense. I clicked on it, and a long time later, something happened to the web page. In the meantime, I went off to get a drink. Alternatively, you could just show a table for each year, and skip the damn JavaScript altogether. Why there’s even a backend is beyond me, this whole thing could be served perfectly well – and mind-numbingly quickly – from static pages.

And for the purpose it’s intended for: parents picking a school for their kids. Can you compare schools? No. Open them up in different browser tabs, if you have a tabbed browser (remember: the blind can go take a flying leap). Good thing the site is chocked full of JavaScript. And the JavaScript is used for handy things like map-based locating of schools, and – oh, hang on, no it’s not. There’s no Google-maps mash-up. Good thing the site is chocked full of JavaScript.

Clearly, the entire site has been an exercise in some programmer somewhere bolstering their resume rather than giving the client something appropriate. Either that, or a manager was in charge of the feature spec, and demanded all the latest buzzwords that they had heard but didn’t understand. I’m betting it took more than a year to build. Feel free to speculate.

I’m also willing to bet the price on this site was more than the $50,000 it should have cost (one person, three months). I’m imagining about two or three orders of magnitude more. I’m figuring the servers required for this aren’t running in some guy’s bedroom, even though that would be about all that’s required for such a simple dataset that’s presented in such a straightforward way.

Must try harder.

One third party: a tiny bit more complexity; Many: :-(

I didn’t find the most interesting part of the StackOverflow podcast #16 to be my question. I direct you to 17:06 in, where Jeff discusses the pros and cons of using OpenID as the authentication mechanism for StackOverflow:

Atwood: Granted, there’s a third entity here so there’s going to be a tiny bit more complexity.

What Jeff’s overlooked here is the Combinatorial Complexity; he’s not hooking up with an OpenID provider, he’s hooking up with all OpenID providers, which he acknowledged earlier can be a bit of a problem [34:48 in podcast #7]:

Atwood: Well you can, I found that Yahoo doesn’t really do attribute exchange very well.

If you look at the uservoice… forum… bug-reporting… suggestion-y thing for the StackOverflow beta, you see a lot of people complaining “my OpenID provider doesn’t work [at all]/[properly] with your site”.
OpenID has a spec, but given the difficulties being experienced, it mustn’t be terribly tight or there’s no reference implementation to validate against.

Having said all that, guess what I’m going to be using as my authentication process on my next website?

Linker problems galore

LINK : fatal error LNK1104: cannot open file ‘mfcs42d.lib’

Go to Tools | Options… | Projects and Solutions | VC++ Directories, select Show Directories for: Library files and insert the path to your existing mfcs42d.lib.

Now you get
LNK2019: unresolved external symbol “public: __thiscall AFX_MODULE_STATE::AFX_MODULE_STATE(int,long (__stdcall*)(struct HWND__ *,unsigned int,unsigned int,long),unsigned long)” (??0AFX_MODULE_STATE@@QAE@HP6GJPAUHWND__@@IIJ@ZK@Z) referenced in function “public: __thiscall _AFX_DLL_MODULE_STATE::_AFX_DLL_MODULE_STATE(void)” (??0_AFX_DLL_MODULE_STATE@@QAE@XZ)

Remove mfcs42d.lib and you get
mfcs90d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)

Know what you did wrong?

I’ve got the answer.

Don’t link to mfcs42d (and, for that matter, the non-debug version mfcs42.lib) in your 2008 project. If that name’s hard-coded into your project – and it is, isn’t it? – then change the name to mfcs90d and you’ll be fine.

Visual C++ Compiler Error C2316: Make with the class definition

Visual C++ Compiler Error C2316

You know, I was getting this error when porting some exception catching code from Visual C++ 6 to version 9. The error message helpfully states that 'exception' cannot be caught as the destructor and/or copy constructor are inaccessible

Weird thing was, it was wrong. Both the copy constructor and destructor for the class and all it’s ancestors were in public scope.

Eventually there was the figuring out: the exception was being anonymously caught, like so:
try {
whatever();
}
catch (MyExceptionClass&) {}

And to keep MSVC6 happy, earlier in the codebase a preceding programmer had coded:
class MyExceptionClass;
Which did indeed keep MSVC6 happy. MSVC9 asked what I’d done with the copy constructor. Well, dear friend: it’s in the header file that wasn’t included. Delete the forward declaration, add one #include and we are cooking with gas.

If we actually give the compiler the definition of the class being caught it can generate code rather than misleading error messages. Why the error message wasn’t: “No definition for this class” is beyond me.

Typical URLs and how to shorten them

Some web sites have very well designed, brief, URLs.

But some have URLs that are way too long. And you don’t always want to be putting them through TinyURL.

Here’s how some of them can be shortened if sending them via email (when they might break when text wraps) or in print.

Anything that’s not bold can be chopped out. And remember when putting it in print, drop the http:// — it’s not necessary to key in, and only slows people down. The same is usually true for the www — though I’m in two minds about that. For publicity etc, it sometimes helps to jog people’s minds that we’re talking about web addresses.

Amazon — it’s the ISBN or other identifier which is critical here
http://www.amazon.com/Doctor-Who-Complete-David-Tennant/dp/B000UVV2GA/ref=pd_bbs_sr_1?ie=UTF8&s=dvd&qid=1212896155&sr=8-1

YouTube — remove the country, and any extraneous arguments such as “Featured”
http://uk.youtube.com/watch?v=-BOYAl0F6xs&feature=user

The Age (and other Fairfax sites) — remove the headline text. (This works for their older articles/older URLs too.)
http://www.theage.com.au/national/clouds-loom-as-oil-price-soars-and-petrol-hits-170-20080607-2n9n.html?page=-1

Google Maps — the co-ordinates and zoom quotient (or whatever it’s called) matter the most. Though if you’re trying to specifically point out an address, you’ll need to leave the query in.
http://maps.google.com.au/maps?f=q&q=247+flinders+lane,+melbourne,+vic,+AU&ie=UTF8&ll=-37.813751,144.964621&spn=0.011188,0.018196&z=16&iwloc=addr

Realestateview — gets really messy depending on how you find the property. Some of the arguments tell it what navigation options to show, but when it all comes down to it, it’s the OID which is the critical argument. Mind you, leaving the “rev=on” stuff gives you the area map by default, so better to leave that on if emailing.
http://www.realestateview.com.au/cgi-bin/view.pl?OID=1136439&rev=on&s=102294592&Sub=bentleigh&BeL=0&BeH=9999&PrL=0&PrH=99999&Surr=&IKW=bolinda&PT=hou&PT=uni&PT=tow&PT=stu&PT=lan&PT=dev&PT=inv&PT=ter&PT=vil&PT=sem&PT=dup&PT=pen&PT=wac&PT=hol&PT=rta&PT=alp&PT=car&PT=bof&PTr=&CS=VIC&OrderBy=listed&OrderStr=&Con=S&SearchPage=/buy/residential/melbourne.shtml&Bkmk=_&OFI=&OFIDays=&BS=10&Thu=&Qui=n

BBC News — these aren’t overly long, but can still be shortened.
http://news.bbc.co.uk/2/hi/south_asia/7442323.stm

MS KB — all kinds of different versions of their URLs fly around the place, though a lot of their new links use the most sensible, concise version.
One of many of the old style: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q917925
Better: http://support.microsoft.com/kb/917925
(Of course to many geeks, just say Q917925.)

For other sites? No doubt people will have their suggestions.

For myself, when I’m sending a URL to someone, and I have the time, I tend to muck about and remove what look like the extraneous parameters and see what still works. Mind you, some sites don’t work very well for this — Dick Smith (dse.com.au) for example, relies on some kind of weird-arse session parameter, so it’s best to use their own “email this link” feature.

And always check it before you send it.

Weird bug

Let’s say, for example, that a system supplies you the time of some event in UTC, you convert it to local and shove the date/time up on the display. Say, for argument’s sake, you also include the Day Of Week, ending up with a format of DD/MM, DOW HH:MM. Everything looks fine, until someone notices that the Day Of Week is wrong. The 28th of May is a Wednesday, not a Thursday.

What happened?

The date conversion routine that generates the DOW string does a bunch of odd stuff, but seems to work correctly; it certainly works in other parts of the code, and generates the right string there.

WTF?

The UTC time seemed to be converted to local time twice, but that wasn’t the culprit; surprisingly, no-one is killed in an explosion of silicon splinters when that code is double-executed. Whatever.

Could it be that the system supplying you the time of that event in UTC is off by a year? One year into the future. That would give you that behaviour.

Check it.

Freebie database dev tools

I used TOAD for a while for browsing around Oracle databases. Good stuff, though the free version is a bit limited, and Quest Software, who sell it, have the annoying thing of not selling it retail, but negotiating licence prices, making purchasing it a long drawn-out process.

Turns out there’s now an alternative: Oracle’s SQL Developer, which does a pretty good job at doing the same thing, and it’s free. It runs on Windows, Mac and Linux, and it uses Java and the JDBC client and apparently doesn’t need the humungous Oracle client software (though I haven’t actually verified that yet).

(Tony found the SQL Server equivalent some time ago, though it’s moved slightly. MySQL? MySQL GUI Tools.)

The importance of filenames

When I’m putting PDFs (or any kind of downloadable file) on web sites, I’m always sure to publish them with a filename which is meaningful, including some indication of the web site it came from. ‘Cos if the average user is like me, they save PDFs etc all over the place, and some kind of identifier makes it heaps easier to find the file later.