Monthly Archives: July 2009

No More Slashes

I’ve gotten in such a habit of closing my img and br and every other such tag that I’ll probably have to work hard to stop. It was forward looking to be XML compatible. You know, server-side parsing, semantic web, search-engine indexing, etc.

Bye bye “<![CDATA<[“! And hey, I only need to remember one doctype: “<!doctype html>”.

More on HTML5

PhpGuru.org: What is new in HTML 5?

W3C.org: HTML 5 differences from HTML 4

Sitepoint.com: RIP XHTML 2

Pathetic Longing for Connection (x214)

For 214 calendar days, I was without Internet. The last day without Internat was May 19, 2009–the next day I started a new job. The CEO took all Internet access away “temporarily” under the guise of security. Until indirectly repremanded, I maintained several different day tallies at my desk as a silent protest.

Others’ protests included a wall plastered with desk-calendar pages and a paperclip chain with one paperclip each day. Eventually he converted the paperclip chain to a binary representation when he exhausted his paperclip supply. Yes, 214 days requires 8 bits worth of paperclips.

During that time I had little motivation for keeping up with personal coding projects and keeping up with friends after work. I never quite made the connection as to why that motivation left me, but now I realize operating in a disconnected world makes me feel out of the loop. Without 9 hours of connection every day, I feel like there is no time to “catch up” and make meaningful connections in the evening.

The result was more TV and pathetic longing for connection.

It is so refreshing to be back!

I Love MySQL

There are several things I love about MySQL compared to SQL Server and Oracle. Hopefully my memory is accurate on the SQL Server and Oracle support. I haven’t used Oracle in a few months and SQL Server in two years.

Extended Inserts
MySQL 5 Supported
SQL Server 2005 Not Supported
Oracle 10g Not Supported
Linux/BSD support
MySQL 5 First class
SQL Server 2005 None
Oracle 10g First class
Switch to another database in a single session (e.g. USE database)
MySQL 5 As expected: use database per connection
SQL Server 2005 As expected: use database per connection
Oracle 10g Schema changes for all connections in the same threads so you have to call “ALTER SESSION SET CURRENT_SCHEMA = database” on before every query to be sure (or use a global singleton property to track which schema is current and alter session when needed).
LIMIT max, offset
MySQL 5 Super useful
SQL Server 2005 “SELECT TOP” with nested queries for offset
Oracle 10g “SELECT * FROM (SELECT …) WHERE ROWNUM BETWEEN lowest AND highest
Updated row count
MySQL 5 Number of rows actually changed
SQL Server 2005 Number of rows matched in WHERE clause
Oracle 10g Number of rows matched in WHERE clause
Unlimited size of results on limit clause
MySQL 5 SQL_CALC_FOUND_ROWS keyword
SQL Server 2005 follow-up query needed: SELECT COUNT(*) FROM (SELECT …)
Oracle 10g follow-up query needed: SELECT COUNT(*) FROM (SELECT …)
Bitwise Operators
MySQL 5 Default 64-bit support
SQL Server 2005 No 64-bit support
Oracle 10g ?
Command line client
MySQL 5 Very usable (e.g. /g switch is very helpful)
SQL Server 2005 None. You’re stuck with Windows GUI.
Oracle 10g SQL Plus. Clunky and minimal options
GUI tools
MySQL 5 Lots of great open source tools (phpMyAdmin, MySQL AB, etc. etc.)
SQL Server 2005 Free SQL client. Clob data viewer is clunky
Oracle 10g Free SQL Developer app. Third-party program needed to view Clob data (I hear support is coming)
Documentation and Support
MySQL 5 Comprehensive docs and comments online; online communities
SQL Server 2005 Buy a book
Oracle 10g Buy 2 books
GROUP CONCAT keyword
MySQL 5 Supported
SQL Server 2005 Not Supported
UPDATE: the “FOR XML PATH” construct can help:
SELECT CustomerID AS ‘data()’
FROM Customer
FOR XML PATH(”)
Oracle 10g Not Supported
ON DUPLICATE KEY UPDATE
MySQL 5 Super useful
SQL Server 2005 IF EXISTS (…) BEGIN UPDATE … SET … END / IF NOT EXISTS (…) BEGIN INSERT (…) VALUES (…) END
Oracle 10g IF EXISTS (…) BEGIN UPDATE … SET … END / IF NOT EXISTS (…) BEGIN INSERT (…) VALUES (…) END
Cost
MySQL 5 Free License
SQL Server 2005 Expensive
Oracle 10g Painfully Expensive
Native Datetime Format
MySQL 5 Normal general-to-specific format (2005-07-15 11:30:52)
SQL Server 2005 Normal general-to-specific format (2005-07-15 11:30:52)
Oracle 10g Queries, updates, inserts default to chicago format “15-JUL-05 11.30.52.000000 AM” so you need to set NLS_DATE_FORMAT or TO_CHAR for other formats
Date Subtraction/Manipulation
MySQL 5 SELECT TIMESTAMPDIFF(SECOND,’2009-07-01′,’2009-07-04 20:05:00′) / (24 * 60 * 60) as ‘Days Between’
SQL Server 2005 ?
Oracle 10g SELECT TO_DATE(‘2009-07-04 20:05:00′,’DD.MM.YYYY:HH24:MI:SS’) – TO_DATE(‘2009-07-01′,’DD.MM.YYYY:HH24:MI:SS’) as ‘Days Between’
Programmatically reading schema (e.g. to alter schema)
MySQL 5 DESCRIBE table_name
SQL Server 2005 Complex managerie of queries to various system tables
Oracle 10g Painfully complex managerie of queries to various system tables

On the flip side, Oracle and SQL Server have much more robust backup and clustering support.

Microsoft: King of Backwards Compatibility

The most ironic part about Microsoft’s patent claims is that they are seeking to protect a hack from 14 years ago. Microsoft sued TomTom to prevent them from using code that allows long filenames to be accessible in the 8.3 filename format. For example, DOS will read “c:\documents and settings\usernameA” as “c:\docume~1\userna~1” and so will be able to access the files.