A pedant that hangs out in the dark corner-cases of the web.

Wednesday, March 28, 2007

When to buy Vista

Warning: this article includes dangerous levels of sarcasm, and should not be read by young children or pregnant women.

Vista supports an expensive (for you) increase in DRM [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] [C]. Buy it only if you support your digital rights being "managed". Video drivers that check the "integrity" of their connections over 30 times a second can't be that much slower, right? Having your video driver "revoked" out from under you is a small price to pay in order to add several layers of new things you've gotta check when things go wrong.

Maybe you just like to drop $250-$400 on improvements that even supporters characterize as "incremental" [1] [2] [3] [4] [5], or have trouble understanding. That sidebar will certainly not represent a distraction that will get old inside a few months, or be disabled by your network admin sooner.

Or maybe you appreciate the fact that, to reinstall the upgrade edition, you have to install XP first [1]. Every time.

You probably are excited about the Aero Glass interface, if you haven't seen any of the videos of Beryl on youtube or Google Video or Metacafe.

The security enhancements may help protect you, once they release the latest round of fixes [1] [2] [3] [4] [5] [6]. You are running the 64-bit edition, right? [1] [2]

Anyway, be sure you've spent enough money on hardware. [$] [$] [$] [$] [$] [$] [$] [$] [$] [$] [$]

Thursday, March 15, 2007

References!

2007-09-12 Update: ASP.NET Resources - Download "ASP.NET AJAX Client Life-Cycle Events" Cheat Sheet

2007-08-27 Update: Some more references at: Software Development in the Real World: Ultimate Web Development Cheat Sheet Guide

2007-03-15 Update: There is another great reference roundup at: Our Favorite Cheat Sheets - a definition from Whatis.com. Another good source is the "cheat sheets" tag at Lifehacker.

I've been vastly outdone by stark's list at The Developer Cheat Sheet Compilation by Fuzzy Future (mirrored below}.

Command Line

  1. Windows NT/XP Command Line Reference
  2. Bash Command Line Reference
  3. Bash Command Line Programming Reference
  4. DOS Commands

Databases

  1. Firebird SQL Cheat Sheet
  2. MySQL Cheat Sheet
  3. MySQL Reference List
  4. Oracle Cheat Sheet
  5. Oracle PL/SQL Cheat Sheet
  6. Oracle 9i Server Reference (PDF)
  7. Oracle 9i Command Reference
  8. PostgreSQL Cheat Sheet
  9. PostgreSQL Cheat Sheet List
  10. SQL Cheat Sheet
  11. SQL Server 2005 Commands

Programming

  1. Ada Syntax Card (PDF)
  2. ASP/VBScript Cheat Sheet
  3. C++ Language Summary
  4. C++ Reference Sheet (PDF)
  5. C++ Containers Cheat Sheet
  6. C# Language Reference
  7. C# Programmer’s Reference Sheet
  8. Delphi Technical Reference Card (PDF)
  9. Java Syntax Cheat Sheet
  10. Java Quick Reference (PDF)
  11. Java Reference for C++
  12. JSP 2.0 Syntax Reference Sheet (PDF)
  13. LaTeX Reference Card (PDF)
  14. .NET Cheat Sheets
  15. Perl Cheat Sheet
  16. Perl Reference Card (PDF)
  17. Perl Regular Expression Quick Reference (PDF)
  18. Perl Reference Guide
  19. PHP Cheat Sheet
  20. PHP Developer Cheat Sheet
  21. Python 101 Cheat Sheet
  22. Python 2.5 Quick Reference
  23. Python Cheat Sheet
  24. Python Quick Reference (PDF)
  25. Ruby Cheat Sheet (PDF)
  26. Ruby on Rails Cheat Sheet Collectors Edition
  27. Ruby Reference
  28. Ruby on Rails Reference Sheet

Unix/Linux

  1. Debian Linux Reference Guide (PDF)
  2. Linux Shortcuts and Commands
  3. One Page Linux Manual (PDF)
  4. TCP Ports List
  5. Treebeard’s Unix Cheat Sheet
  6. Unix Command Line Tips

Web Development

  1. Actionscript 2.0 Cheat Sheet (PDF)
  2. Actionscript 3.0 Cheat Sheet (PDF)
  3. Cold Fusion Cheat Sheet
  4. CSS Cheat Sheet
  5. CSS 2 Reference Card (PDF)
  6. CSS Reference Sheet
  7. CSS Shorthand Guide
  8. CSS Useful Properties
  9. Drupal 4.7 Cheat Sheet
  10. .htaccess Cheat Sheet
  11. HTML Cheat Sheet
  12. HTML Dom Quick Reference Card (PDF)
  13. Javascript Cheat Sheet
  14. Javascript Quick Reference
  15. Javascript Reference Page * No Longer Available
  16. JQuery Cheat Sheet (PDF) 
  17. JQuery Reference (PDF)
  18. JQuery Visual Map
  19. Mod_Rewrite Cheat Sheet
  20. Scriptaculous Combination Effects Field Guide (PDF)
  21. XHTML Cheat sheet
  22. XHTML Reference
  23. XHTML & HTML Cheat Sheet
  24. XML Syntax Quick Reference (PDF)
  25. XML Schema Reference (PDF)
  26. XSLT and XPath Quick Reference (PDF)

Miscellaneous Topics

  1. Ascii Codes Cheat Sheet
  2. CVS Cheat Sheet
  3. EMacs Keyboard Shortcut Reference
  4. Regular Expressions Cheat Sheet
  5. RGB Hex Colour Chart
  6. Subversion Quick Reference (PDF) * No Longer Available
  7. Theoretical Computer Science Cheat Sheet (PDF)
  8. UML Quick Reference Card (PDF)
  9. UML Cheat Sheet
  10. Vi Cheat Sheet
  11. Vim Commands Cheat Sheet
  12. XEmacs Commands Cheat Sheet

Monday, March 12, 2007

Perl one liner: spaces to tabs

This Perl one liner converts a file indented with spaces into one indented with tabs, using the first indented line to measure the number of spaces per indent.

perl -i~ -pe "/^( +)/ or next; $I or $I=$1; for($i=0;s/^$I//;$i++){} $_=(qq'\t' x $i).$_;" file ...

javascript: is not required in onclick or other event handlers

In Non-IE Browsers

The javascript: URI scheme is only necessary where URIs are used, such as href attributes.

The onevent event handlers accept javascript code, not URIs, so the scheme isn't required.

It isn't an error, because the colon causes the JavaScript parser to interpret it as a label (though MSIE just seems to ignore the leading javascript:).

In Firefox you can use the label, to confirm that it is interpreted as a label:

<a href="#" onclick="javascript:while(1) if(!confirm('Again?')) break javascript;return false;">test</a>

If you put the same code in the href, it doesn't work, because the URI parser consumes the javascript: scheme before the JavaScript processor can parse it as a label:

<a href="javascript:while(1) if(!confirm('Again?')) break javascript;return false;">test</a>

In IE

Internet Explorer supports two scripting languages (more can be installed, but are very rarely used in practice): JScript and VBScript. IE uses the first script on the page to determine the default scripting language for the page. If all of your onevent handlers are JavaScript (JScript to IE), then it makes sense to rearrange your scripts to ensure that a JavaScript appears first. Otherwise, if your handlers are a mix of JScript and VBScript, a language declaration (that looks like a label to non-IE browsers) can be used to disambiguate, e.g. onclick="javascript:alert(now Date())" or onclick="vbscript:alert(Now)".

Note that any VBScript handlers are still going to cause problems for non-IE browsers, so it may be better to define whatever VBScript code you need as a function outside the handler, using type="text/vbscript", and a dummy/alternative function with the same name can be defined for non-IE browsers using type="application/x-javascript", then call the function using a JavaScript handler. This approach also obviates the need to use these declarations.