Archive for June, 2009

What are they thinking? Opera still proprietary

This came to mind recently, what the hell is Opera Software thinking? They’re code is still proprietary, is there any point or benefit. I mean, even webkit is open source, they’ll only be left further behind if they keep this closed.

Come on Opera! Release your code to the world!

PHP Particularities: Escaping characters the right way

PHP, like any language has its particularities. One of the them is the inability to understand escaped characters which aren’t in double quotes. So yes, there is a technical difference between a quote and a double quote in a programming language, in PHP at least, if anyone asks.

How does it work? Let’s look at some examples!

$stringData = '<?xml version="1.0" encoding="UTF-8"?> \n SoraGami';
fwrite($fh, $stringData);

So, that PHP script generates an XML file as you can see in our variable $stringData. However I’ve omitted the other code as it isn’t the focus of this article. So, highlighted in blue is the famous escaped character which, in PHP and in all C-insipired languages creates a new line. However, to use it, you must put it inside double quotes (“) and not single quotes (‘). Unfortunately, in the scenario presented here, we needed to put the whole string inside single quotes so that PHP wouldn’t mess itself up with the double quotes inside the XML doctype.

In case you didn’t know, if you have elements with quotes in your string, you can use a combination of double and single quotes to make it work, like this:

'  "..."  '
"  '...'  "

Maybe that helped. Anyway, back to our previous example. The way we made it, because \n is within single quotes, it won’t work and appear as text instead. In this case, $stringData would give this:

<?xml version=”1.0″ encoding=”UTF-8″?> \n SoraGami

Unfortunately this is far from what we wanted to achieve, which was to have SoraGami on a new line. We could do the following:

$stringData = "<?xml version='1.0' encoding='UTF-8'?> \n SoraGami";
fwrite($fh, $stringData);

That would work, but in my opinion Single Quotes don’t look like XML. So, instead, you can do it like in two sequences:

$stringData = '<?xml version="1.0" encoding="UTF-8"?>';
fwrite($fh, $stringData);

$stringData = "\n SoraGami";
fwrite($fh, $stringData);

While this works, you might be wondering why the second sequence doesn’t overwrite what we did before. Our PHP $fh variable is written like this:

$fh = fopen($myFile, 'w') or die("can't open file");

‘w’ says to write, but PHP is session-based in the browser, and so as long as we are in the same session and didn’t explicitly fclose() our writing script, PHP is going to append whatever we write to the file. To overwrite, either reload the page (new session) or fclose() the file and make a new fopen() and fwrite().

If you want to append to the file, just changed the ‘w’ parameter for ‘a’. Tizag has a nice tutorial for PHP File Handling that explains further on what we did here.

You might also be wondering why ‘\n’ doesn’t work and “\n” works. The reason is simple, PHP will escape \n regardless of context when inside double quotes. That means if you wrote that:
“The server can be found through Windows on \\nopi”, you would obtain that:

The server can be found through Windows on \
opi

However, since you don’t want PHP to escape the \n in this situation, you would write the following:
‘The server can be found through Windows on \\nopi’, which would give the correct:

The server can be found through Windows on \\nopi

Windows 7 Pricing Fail

A few days ago Microsoft released the official US pricing for Windows 7, which got detailed in a beautiful feature comparison by Paul Thurrott. In some ways, I could say Microsoft did exactly what they shouldn’t have done, put the pricing way too high. Windows 7 had an incredible momentum and it just got blatantly killed. And so I decided to take Paul Thurrott’s feature comparison table and pricing and add Mac OS X Snow Leopard and Ubuntu Jaunty Jackalope to it to see how it compares.

Availability

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Retail packaging Yes Yes Ult. only Yes
Can purchase electronically Yes Yes Ult. only Yes
Pricing: Full version $199.99 $299.99 $319.99 (Ult) $129.00 Free
Pricing: Upgrade version $119.99 $199.99 $219.99 (Ult.)
Upgrade promotional pricing $49.99 $99.99 $29.00
Bundled with new PCs in major markets Yes Yes Yes Ult. only Mac only
Windows Anytime Upgrade Yes Yes Yes Yes

There’s only one version of Mac OS X, and it’s full featured. Ubuntu, along with 99% of Linux distributions, is 100% free, so obviously there’s no point in making different versions. Mac OS X doesn’t really come in upgrade form except for a limited time when a new version comes out. Most Mac users will buy the upgrade when it comes out or get the latest OS with a new Mac, and OS X’s retail price is just 10$ above Home Premium’s upgrade price, so Apple doesn’t have to make an upgrade version permanently available.

User Interface Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Windows Basic UI Yes Yes Yes Yes Yes Yes
Windows Standard UI Yes Yes Yes Yes Yes Yes
Windows Aero UI (“Glass”) Yes Yes Yes Equivalent Compiz
Aero Peek Yes Yes Yes
Aero Snaps Yes Yes Yes Yes Yes
Aero Shake Yes Yes Yes
Aero Background Yes Yes Yes Equivalent Equivalent
Windows Flip Yes Yes Yes Yes Yes Exposé Compiz
Windows Flip 3D Yes Yes Yes Exposé Compiz
Live Taskbar Previews Yes Yes Yes Yes Exposé
Live Preview (Explorer) Yes Yes Yes Quicklook
Jump Lists Yes Yes Yes Yes Yes
Windows Search Yes Yes Yes Yes Yes Spotlight Beagle

This is one area where Windows 7 excels, the user interface. You get pretty dam close with OS X and Linux, but Windows 7’s interface is arguably more sophisticated and complete. Next up would be OS X of course, with its unbeatable Quicklook, but the Finder suffers. Linux unfortunately isn’t really up to par in this area, something common to the majority of Open Source software.

Security Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
More granular UAC Yes Yes Yes Yes Yes Yes Yes
Action Center Yes Yes Yes Yes Yes
Windows Defender Yes Yes Yes Yes Yes Equivalent Equivalent
Windows Firewall Yes Yes Yes Yes Yes Weak Equivalent
IE 8 Protected Mode and DEP support Yes Yes Yes Yes Yes DEP only DEP only
Windows Update (can access Microsoft Update) Yes Yes Yes Yes Yes Equivalent Equivalent
Fast User Switching Yes Yes Yes Yes Yes Yes
Parental Controls Yes Yes Yes Yes Yes Yes Yes

Although IE 8 is the only browser to feature a “protected mode” as is described by Microsoft, Safari and Firefox are patched faster and have less security holes than IE. Both Mac and Ubuntu had better update systems since ages, with Ubuntu’s being considerably far ahead of both Mac and Windows. The Unix roots of Mac and Ubuntu have made them kings in Fast User Switching, Parental controls and granular User Account Control way before Windows, but Windows’ Action Center is a great managing tool lacking in Mac and Linux. The Windows Firewall is adequate, much better than Mac’s good-for-nothing Firewall, but still easily beaten by Ubuntu’s Firewall.

Since the very same Linux Kernel on Ubuntu is being used in high security server environments, you get all the benefits from those companies using Linux that require extreme security. When talking security, Linux is obviously a much more secure environment than Mac or Windows.

Performance Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu
Windows ReadyDrive Yes Yes Yes Yes Yes
Windows ReadyBoost Yes Yes Yes Yes Yes
SuperFetch Yes Yes Yes Yes Yes
64-bit processor support Yes Yes Yes Yes Yes Yes Yes
Physical processor support 1 1 2 2 2 Unlimited Unlimited
Processor core support Unlimited Unlimited Unlimited Unlimited Unlimited Unlimited Unlimited
Max RAM (32-bit) 4 GB 4 GB 4 GB 4 GB 4 GB 4 GB 4 GB
Max RAM (64-bit) 8 GB 8 GB 16 GB 192 GB 192 GB 16 TB Unlimited

Nevermind ReadyDrive and what not, Mac and Linux never needed those and they remain gimmicks of Windows. 64 bit support has been on Linux since ages, OS X just catched up in much more graceful manners, physical processor support has never been limited on Mac or Linux, and Ram support really is only limited by what your motherboard can handle. The 16 TB number on Mac OS X is only a number to put on so users can more easily compare, but there’s no such thing. Every Unix system is entitled to the complete 64 bit support, much more than 16 TB, only limited by your hardware. Unfortunately Windows deliberately blocks users from using more RAM on Windows, and of course, the 4GB limit is only because of 32 bit.

Reliability Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Windows Backup Yes Yes Yes Yes Yes Equivalent Equivalent
System image Yes Yes Yes Yes Yes Yes Yes
Backup to network Yes Yes Yes Yes
Encrypting File System (EFS) Yes Yes Yes Yes
BitLocker Yes Filevault Equivalent
BitLocker To Go Yes Equivalent Equivalent
Automatic hard disk defragmentation Yes Yes Yes Yes Yes Equivalent Equivalent
Previous Versions Yes Yes Yes Yes Yes
Create and attach (mount) VHD Yes Yes Yes Yes Yes Yes Yes

When talking reliability, Windows is only mostly playing catch-up. Since Mac OS X’s kernel is based on FreeBSD and Ubuntu’s is Linux, both systems have had a history of stellar stability beyond anything ever experienced on Windows. Even though NT 6.1 (Windows 7’s kernel) is fairly ahead of every other Windows kernel up to date, it still cannot match the Linux kernel, which is itself surpassed by the FreeBSD-based kernel called Darwin used on Mac OS X.

OS X never needed previous version compatibility modes, neither does Linux, so there’s no point, and fragmentation has always been an issue on Microsoft’s file systems, but not on Apple’s or the on the Linux community’s. In fact, defragmenting an OS X or Linux disk has always been pointless because of the way the file system is made. As long as you keep your system under 80% of disk space used, you should never face fragmentation issues on Mac OS X or Ubuntu.

All other abilities like Encryption and Virtual Hard-Drives included, are not new to Mac and Linux.

Bundled Applications

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Internet Explorer 8 Yes Yes Yes Yes Yes Safari Firefox
Windows Gadgets and Gallery Yes Yes Yes Yes Yes Dashboard Equivalent
Games Explorer with basic games (FreeCell, Hearts, Minesweeper, Purble Palace, Solitaire, Spide Solitaire) Yes Yes Yes Yes Yes Yes
Premium games (Internet Backgammon, Internet Checkers, Internet Spades, Mahjong Titans) Yes Yes Yes Yes
Calculator Yes Yes Yes Yes Yes Yes Yes
Paint Yes Yes Yes Yes Yes Gimp
Snipping Tool Yes Yes Yes Yes Yes
Sticky Notes Yes Yes Yes Yes Yes
Windows Journal Yes Yes Yes Equivalent Equivalent
Windows Fax and Scan Yes Yes Yes Yes Yes Equivalent Equivalent
Windows PowerShell and ISE Yes Yes Yes Yes Yes Terminal Terminal
WordPad Yes Yes Yes Yes Yes Equivalent Equivalent
XPS Viewer Yes Yes Yes Yes Yes Native PDF Yes

Browsers are included on each system, that’s a given. The only thing really missing is a graphics application and mini-games on Mac OS X. On Ubuntu, you get all those games in Linux-version, and more for free obviously, and instead of Paint you get a Photoshop competitor called Gimp, which is also free and open source. However, Gimp is much more complicated to use than Paint, which is easier and more complete than its predecessors, so I have to give Windows the upper hand here.

Apart from that, Mac OS X has had native and fast support for PDF for ever, and Windows PowerShell is shaded by the Terminal (command-line), which, if you know the Unix world, is the base of the system. Indeed, you can control any aspect of your system with the command-line on Mac and Linux, far ahead of what is possible with PowerShell.

Ubuntu also includes OpenOffice and a WordPad equivalent, which makes the WordPad thing really irrelevant.

Digital Media and Devices

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Windows Photo Viewer Yes Yes Yes Yes Yes Preview Equivalent
Basic photo slide shows Yes Yes Yes Yes Yes Yes Yes
Windows Media Player 12 with Play To Yes Yes Yes Yes Yes Quicktime X Equivalent
Windows Media Player Remote Media Experience Yes Yes Yes Equivalent Equivalent
MPEG-2 decoding Yes Yes Yes Yes Yes
Dolby Digital compatibility Yes Yes Yes Yes Yes
AAC and H.264 decoding Yes Yes Yes Yes Yes Yes Yes
DVD playback Yes Yes Yes Yes Yes
Can install MPEG-2 (DVD playback) add-in Yes Yes n/a n/a n/a n/a n/a
Windows Media Center Yes Yes Yes FrontRow Equivalent
Number of TV tuners supported 4 of each type (analog, digital, etc.) 4 of each type (analog, digital, etc.) 4 of each type (analog, digital, etc.)
Windows DVD Maker Yes Yes Yes iLife Equivalent
Device Stage Yes Yes Yes Yes Yes
Sync Center Yes Yes Yes Yes Yes iTunes + iPod Equivalent

Needless to say DVD playback is included on every Mac and Ubuntu system, along with better Image Viewing capabilities (RAW formats) and all the other bling. Where Windows is better though is in its entertainment specialty. TV tuners are abound on Windows systems, the Device Stage and syncing capabilities aren’t limited to the iPod or niche players as in Linux, and Windows Media Center is a truly complete experience. If you really use your computer as a computer though, Mac OS X will do a better job at being multimedia-centric than Windows or Linux (if you know the right software), and your Playstation 3 will be a faster, more reliable, cheaper and Blu-ray capable Media Center experience than the other solutions.

Networking Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
SMB connections 20 20 20 20 20 Yes Yes
Network and Sharing Center Yes Yes Yes Yes Yes Yes Yes
HomeGroup sharing Join only Join only Yes Yes Yes Equivalent Equivalent
Improved power management Yes Yes Yes Yes Yes Yes Yes
Connect to a Projector Yes Yes Yes Yes Yes Yes Yes
Remote Desktop Yes Yes Yes Yes Yes Yes Yes
Remote Desktop Host Yes Yes Yes Yes
IIS Web Server Yes Yes Yes Equivalent Equivalent
RSS support Yes Yes Yes Yes Yes Yes Yes
Internet Connection Sharing Yes Yes Yes Yes Yes Yes
Network Bridge Yes Yes Yes Yes Yes Yes
Offline files Yes Yes Yes Yes

Networking is much more sophisticated on Windows and Linux than it is on Mac OS X, but Linux is definitely ahead. Simply said, Linux is also the most popular sever operating system, and it shows. Although complicated, its networking capabilities are far ahead of anything included on non-server versions of Windows and Mac. But even then, Windows and Mac servers can’t compete.

However, the order is reversed when it comes to simplicity. Mac gets it first for network KISS (Keep it Simple Stupid), Windows is in 2nd and Linux is way behind with its incomplete visual management tools for network (it’s really, really complicated).

Mobility Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Windows Mobility Center Yes (No presentation mode) Yes (No presentation mode) Yes Yes Equivalent Equivalent
Windows Sideshow (Auxilliary display) Yes Yes Yes Equivalent Equivalent
Sync Center Yes Yes Yes Yes Yes iPod Touch & iPhone
Tablet PC functionality Yes Yes Yes Yes
Multi-Touch support Yes Yes Yes

So, although I don’t know why Windows Sideshow is a feature (wasn’t it possible before?), it’s a given it already exists on Mac and Linux, and by the way Mac has way better support for dual screen environments than both other OSes, Windows has the upper hand here because it has more support. The fact is, Windows is more popular, thus, more devices work with it. Syncing with mobile devices is near in-existent on Linux and is relegated to the iPod Touch and the iPhone on the Mac. And of course, Tablet PC functionality is only included on Windows (and possibly Linux to a certain degree), afterall, Microsoft did invent the Tablet PC.

You may want to consider the multi-touch thing in Windows 7 as a disadvantage for heavy Wacom users though. I’ve had a very bad experience with the drawing pad which is recognized as a touch screen and doesn’t act as it should when drawing in Photoshop on Windows 7. Maybe Wacom’s going to fix this with drivers, but consider yourself warned if you’re an artist.

Enterprise Features

Home Basic Starter Home Premium Professional Enterprise & Ultimate Mac OS X 10.6 Ubuntu 9.04
Domain join (Windows Server) Yes Yes Equivalent Equivalent
XP Mode licensed Yes Yes
AppLocker Yes Yes Yes
Boot from VHD Yes Yes Yes
Branche Cache Yes
DirectAccess Yes
Federated Search (Enterprise Search Scopes) Yes Yes
Multilingual User Interface (MUI) Language Packs Yes Yes Yes
Location-aware printing Yes Yes Yes Yes
Subsystem for UNIX-based Applications Yes

Windows has always been stellar in the enterprise. Arguably, there’s still a lot of things not charted here that Windows does better in an enterprise network than OS X or Ubuntu (or any other Linux distribution in fact). The only thing that really irritates me on Windows is Multilingual Interface Languages Packs.

On Linux and on Mac, you have access to all the languages you want, anytime. On Windows Home Premium, you can’t even type in Japanese if your system is in English. What’s more, applications on Mac and Linux install independent of the OS’s language, even better, Linux’s pacakge management ensures your applications are always available in whatever language you would use for your system’s, which, unlike Mac, makes multilingual not limited to Apple applications only.

On Windows, everything is heavily tied to the language you bought your Windows in. Not only do you have to buy the most expensive version to have multiple languages at all, software can only install on the system’s original language. For example, when IE 9’s first beta comes out, you won’t be able to install the English version on a system bought in French, even if a language pack has been installed to make it English. What’s more, you have to download and install language packs to get additional languages. On Mac and Linux, it’s already included and it’s as easy as logging out and logging back in.

Why should you pay?

All in all, the comparison is pretty tight. Where it isn’t is in the pricing. The only way the comparison can be equal is if you are comparing the Ultimate version of Windows to Mac OS X and Ubuntu. However, Mac OS X costs less than the lower-end Home Premium for Windows, and Ubuntu is absolutely free, not counting the myriad of costly software you’ll have to buy for Windows. To match the functionality included for Free in OpenOffice on Ubuntu (also available on Mac and Windows), you have to buy an edition of Office that costs 500$. The difference in price vs the what you get is outrageous.

If you don’t play games or have software only available on Windows and that’s not enough to switch, I assume you’re playing the “I-don’t-pay-for-Windows” game, or that you have a lot of money to waste.

Even though this might be the only reasonable price for Microsoft to keep on doing business, what Microsoft doesn’t see is that reducing the price of Windows would lower piracy and reverse the tendency of Windows to lose market share each year. The current pricing plan may be a short term success, but in the long run it’s suicide for Microsoft’s already endangered business.

But!

You pay for the platform. Buying Windows is buying free developer tools from Microsoft, access to a very prominent gaming platform, a ton of software only built for Windows, support from Microsoft, usability not available on Linux, and a bunch of devices that only work with Windows. So even though there’s the price, don’t forget Microsoft is a genius platform maker and living the Mac life, let alone the Linux life, is an often very limited life.

Feature Crap: Safari What?

Today I got a funny experience on TechCrunch that led me to accept that yes, other IE alternatives really are incomplete, well, Safari is at least. So, I’m in Safari 4 on my Mac, browsing Tech Crunch, and I want to send a link to my friend in IM. I right click the link, click on copy link, and paste that in the chatbox.

Pastes: video by College Humor

The name of the link… wait, what? I try again, same thing. WTF?
I go in Firefox, and I right click > Copy Link Location (hey the title’s more obvious)
And it correctly pastes: http://www.collegehumor.com/video:1915736

Functionality issues? Dam right, I just switched back to Firefox.

How secure should your wireless network be?

Wireless network security is something often overlooked. Network is already complicated enough, most will simply bypass the complicated setups and go along with unprotected network access for years. But even if you go through the trouble, there’s a tone of ways to secure your router, some better than others, and sometimes choosing the correct solution is not easy. This is why I decided to create this short guide through which I’ll explain security solutions, what’s good about them, and what’s bad.

Unsecured Access

Although maybe not the best idea, unsecured access guarantees compatibility, speed and ease of use. No complicated key to enter, your network is always available no matter what. This is the worst solution of course, but something to consider if you live in a remote farm area.

SSID (Service Set IDentifier) Broadcast Hiding

Your SSID is your network name. Through your router’s setup, you can choose anything you like. This facilitates recognizing which network is yours when having to connect between multiple networks. It’s also how Windows or other OSes will be able to remember your network settings and automatically connect you. Your SSID is always broadcast over the air so that devices scanning for your network can find it. One easy technique to augment network security has been to stop broadcasting your SSID. This is an easy thing to do. What it does is it hides your router from scanning. That way, only people knowing what your SSID is can access your network.

SSID hiding is however flawed. Each time a user connects to your network, be it you turning on your laptop or a gaming console, your SSID is transferred in the clear, even on an encrypted connection. Widely available software allows to sniff network connections and easily retrieve the SSID. Additionally, most of the time your network isn’t even hidden, it simply comes up as a blank wireless entry, which, however requiring to enter an SSID to connect to, allows a cracker to trick your connection into reconnecting you, broadcasting your SSID in the clear when you connect.

In my opinion, SSID hiding more of a bother than a useful thing. I never hide my SSID, it would just make my already long connection setup longer, and for no real security benefit.

Mac Address Filtering

Every network device in the world has a unique identifier called a Mac Address, something like this: 00-0A-5E-54-59-BF. The theory is, if every adapter has a unique ID, is it possible to enable only the desired network devices to access your network. Fortunately, it is, every single router has that feature, or at least it should. Unfortunately, it’s no means of real protection and again, more a bother than a useful thing. The problem is Mac addresses can be easily spoofed, easier than SSID hiding, and detecting what Mac addresses work on a given network is also pie if you’re the least resourceful as they are transferred in the clear (without encryption).

WEP (Wired Equivalent Privacy)

This deprecated protection scheme for networks (yup, deprecated) is a very flawed but highly compatible security solution for wireless networks. WEP uses the stream cipher RC4, which is unfortunately an old and completely insecure encryption algorithm, so much that WEP’s been delcared deprecated since 2004. In fact, with software mentionned on Wikipedia, I can crack any of your WEP connection under a minute. There’s even step by step articles, not shady and very easy to find, on how to operate the tool that performs Klein’s attack on WEP secured networks. Why isn’t this being pulled down the web? Simply because WEP is deprecated. Such tools are widely available as a proof of concept as to how you should not use WEP protection.

WPA (WiFi Protected Access)

WPA is sort of a half solution. It still uses the RC4 cipher, but unlike its cousin WEP, it implements a different security protocol called TKIP which includes a countermeasure mechanism that makes it impossible to get your network key. However, in 2008, a TKIP vulnerability has been discovered but it only allows an attacker to play with packets on your network (the form in which data is sent out and in). This makes it possible for the attacker to perform ARP spoofing on your network and incidentally sniff data over the air, compromising that data’s security and privacy, and also a DoS attack or denial of service attack (blocking all network traffic, essentially bringing down a server). While a DoS attack may not be of concern for a home network (who would want to DoS attack you, seriously), it certainly is a potential threat for a business.

In other words, WPA remains a perfectly fine solution for home networks and its use of the RC4 cipher makes it compatible with legacy WEP hardware.

WPA2

However similar the name may be, if anything WPA2 is not is similar to WPA. Version 2 is the correctly implemented 802.11i standard. Yes, WPA was made in a hurry before the standard was even finalized so that router makers could address the issues with WEP. This is why WPA support is sketchy, and some routers may offer varients of WPA not intercompatible with other devices. Conversely, WPA2 compliant routers all use the exact same standard, but you have to have recent hardware/firmware for that. Getting WPA2 protection on a computer or router is as simple as having an update firmware, but even recent gaming devices like the PSP 3000, especially due to WPA2’s increased overhead, often do not support it (The Nintendo DSi supports it).

Unlike WPA, WPA2 uses a completely different protocol and cipher, respectively CCMP (Counter Mode with Cipher Block Chaining Message Authentication Code) and AES (Advanced Encryption Standard — AES certification winner Rijndael cipher). Unlike RC4, AES is an extremely sophisticated encryption algorithm used today to encrypt everything from US Government Secret Information to TLS (SSL) secure connections when you shop online.

AES is uncrackable. No one has ever find a way to crack this encryption scheme for the exception of brute-forcing. Brute-forcing a connection involves trying every password possible until you can access the network. However, brute-forcing often implies dictionary attacks, where common words are used against the network’s authentication to find the password. This can be easily avoided with a complete 63 ASCII character key you can make here: https://www.grc.com/passwords.htm

A brute-force on such a key is estimated to take a trillion years, and counter-brute-force mechanisms can slow that down several times. In other words, WPA2 is uncrackable if you use a good key.

The Perfection Solution

Unfortunately, WPA2 is not widely supported on all hardware possible, and making use of combined WPA/WPA2 for increased compatibility breaks your perfect uncrackable unsniffable protection. Fortunately for home users, routers such as the D-Link DIR-655 can handle two networks at the same time. Yup, you can setup a main network in WPA2, and a separate guest network any protection scheme desired for incompatible devices. You can even prevent routing between the two networks so that your secure WPA2 network remains completely isolated from the less secure network.

I use this technique at home to enable compatibility with my PSP, which only supports WPA. My main network is WPA2-only, and my guest network is isolated (not routable) with a WPA-only scheme. This makes my main network, for credit card transactions over the Internet for example, completely secure, while still leaving gaming access for older machines. Since WPA can only be sniffed, it makes also makes it impossible for anyone not authorized to use my own bandwidth, which could happen by leaving the Guest Connection open or on WEP security.

<video>

The new video element in Firefox 3.5, despite having been implemented much earlier by Safari, is making all the rave on the web, especially in the open source community. However, you may still want to stick with Flash for the moment, despite the ability of the video element to simply subtract itself for a flash video if it isn’t supported.

Why? Because the video element has no fallback for browsers that do support the element. Since both browsers currently supporting it do away with different codecs, unless you provide specific sources encoded in two different formats, your video simply won’t play in one or another even if you provided a fallback to Flash.

Safari’s support is preliminary too. On Mac it may be fast, but its support is limited to what’s available in QuickTime, which is very slow on Windows. Having complex h.264 videos that easily play in Flash will kill your Safari with the video element, even with a dual-core processor.

Additionally, as mentioned, support is browser-based, much like images. It’s great because it means your user won’t have to install any codecs, but Theora isn’t the best compression you can get for video out there and you’re stuck using it for Firefox’s video element because that’s the only codec its engine supports.

Oh and talking about bandwidth cost reduction with more efficient codecs like h.264, the video element also does not support streaming protocols, which again, is something that would have to be implemented individually in every browser.

Flash is also arguably much more flexible. The video element allows to be controlled by JavaScript, but for now, it’s just about basics and native controls of each browser are also very inconsistent in both appearance and functionality, preventing users of one browser or another to have the same experience on your website.

In other words, the video element for now is what I consider nothing more than a gimmick for Linux freaks.

Saving yourself from Piracy: Make it free

Examples Matter – What Ragnarok Online did and should have done from the start

Ragnarok Online is one of the MMO (Massive Multiplayer Online) games you could say missed the opportunity. Initially the game was a cost per month only game, you had to pay monthly, like World or Warcraft, to play. The game’s appeal however, was more in line with players that didn’t want to pay or simply couldn’t; all those under the legal age to have a credit card.

Incidentally, Ragnarok Online spawed a mass of free private servers that people used to play the game instead of playing the real one. This is illegal of course, but the creators of Ragnarok Online ended up doing something smart, they adopted a private server, making it a free version of Ragnarok Online. On the same server, you can now pay a monthly fee to have a premium gaming experience (ie. easier experience, premium monster drops).

This is a great way to make a game both free and money-making. It allows anyone to try the game without ever feeling pressure to play, and to end up paying if they want more. This is pretty much in line with Nexon’s games, such as Maple Story, which rely on free gameplay with payed add-on content. But Ragnarok Online should have been that way since the start.

The Music Industry’s Problem

Why did people buy records? Because they listened to it first and liked  it. Where? On the radio. Does anyone still listen to the radio? No. So where do they listen to the songs? By downloading them illegally.

Where’s the problem? It’s in the listening phase. Nobody will ever, except fans, buy a CD or a song without listening to it first. You don’t blindly buy a movie without having seen it first at the theaters or somewhere else. It’s logical, it makes sense! The music industry however doesn’t seem to understand this, at least, a few do. Take Imeem for example, I love that site. A lot of new albums are free to listen to on there, directly from the artist, and in very good quality. This is what I want, good quality free legal content.

Wait, how do they make money then? Simple, you can’t take Imeem on your MP3 player or on your stereo. It’s not convenient, and you have to have Internet.  If you like the song, you buy it with a simple iTunes or Amazon link, or go in a store and buy the CD, so that way you have the convenience of having it. Imeem’s secret is the fact that you can listen to the songs in their complete format.

I won’t buy an album based on 30 second previews of songs, I want the full thing. If I like it, I’ll want to listen to it elsewhere than on a computer, which is why I think services like Imeem are the way to go.

Free vs Free

The bigger problem is what the music industry doesn’t understand. If you don’t offer it for free, people will get it free elsewhere. We used to be able to listen to the songs we liked for free on the radio, nobody does that anymore. If you don’t offer your music for free so that I can listen to it I’ll find it free elsewhere, and that’s how people think. No, they won’t pay for it if you don’t offer it for free, they’ll just get it elsewhere for free, even if it means illegally.

That’s why anyone selling something has to understand they have to make it free before people get it free elsewhere. That way, you have much more control on your content, and you can start sensitizing people about buying music they like. When I like a song on Imeem, I end up buying it. Really, I do.

Stupid Concerns

Vendors of all sorts all have this concern: “Yeah but, aren’t people gonna find a way to download it from Imeem?”

If you’re really concerned about this issue, there’s two things you can do:
- Build a better service yourself (yes, the technology exists, ask Adobe)
- Sensitize people about the importance of buying music they like so that artists can live

Remember, not making it free or making someone poor for the rest of its life because she shared 24 songs Online will just have your music illegally downloaded again.

Browser Speed is not all about Load Speed

Have you ever had this weird feeling that although Google Chrome itself was quick, the page was dreadfully slow? If yes, it’s perfectly normal, because Google Chrome may be the worst in dynamic page render speed.

Hmm, what’s dynamic page render speed? Let’s explain:

Cold Start > When your browser is booted for the very first time
Warm Start > When your browser is booted after having been closed once or more
Tab Speed > How long does it take to open one or more tabs
Load Speed >  How long does it take to load a page
Dynamic Load Speed > How does the browser handle loading content on the page as you scroll through the page

Surprisingly, having a slow dynamic load speed can  make your browsing experience quite bad, especially on complex sites like IGN.com. I haven’t thoroughly tested this theory yet, but here are some preview results:

- Chrome > Frankly the slowest of all, like, really slow
- IE > Small amelioration over Chrome
- Firefox > Small amelioration over IE
- Opera > Significantly faster than Firefox

I haven’t tested Safari yet, or any of this scientifically, but Opera’s claim of “making you faster” might not be far-fetched after-all.

Left in the dust: IE’s demise

When Acid2 was released, it took a few months for Safari to pass it (webkit), a year for Opera (presto) and 3 for Firefox. Internet Explorer took 4 years, with the release of Internet Explorer 8.

Now that Acid3 is released, both Safari and Opera managed to pass it under a year, quickly followed by Google Chrome which also runs a build of webkit (Safari’s engine). Although not complete, beta versions of Firefox 3.5 are already ready near passing the test.

On top of that, Firefox, Opera, Safari and Chrome’s latest versions all support the CSS 3 @font-face property, allowing custom fonts to be embedded in web pages. Some other CSS 3 niceties are being supported as well, such as multiple backgrounds, etc.

Internet Explorer is nowhere near.

Developer Frustration

The result is developer frustration. Since IE is still used by the majority of the world, supporting it is not an option if you want your web business to work. So because of one browser, you’re stuck on not using features which have been included in all major browsers since the dawn of time (CSS Tables, although finally supported on IE8) and you’re also stuck waiting another round for those newer features, like embedded fonts, that could make your website better.

Google, Chrome, Wave and HTML 5

Google knew what they were doing in picking Safari’s engine (it’s open source!) for Google Chrome. Afterall, webkit is the fastest moving engine out there, not only in terms of shear web page render speed, but also in terms of standard. Beating everyone else in the standards race isn’t new to Apple. Strategically, it would have been ideal if Google couldn’t have put their hands on that engine, speaking in Apple’s favor of course. But webkit wouldn’t be so advanced if it wasn’t for its open-source nature. Everybody wins in that case, especially developers. It’s one less browser to care for, because virtually anything that works in Safari works exactly the same in Chrome, and vice-versa.

Google is a fairly innovative company, but more specifically, they’re freaks of doing everything strictly withing the browser’s capabilities. Forget about RIA frameworks like Flex or Silverlight at Google, everything happens in HTML, CSS and JavaScript. The prospect is interesting though: What happens when Google wants to do something that’s not yet possible in browsers? Wave.

As mentioned in their Google I|O presentation, Google Wave, literally e-mail re-invented, is a web application + protocol that needs HTML features that aren’t even in the HTML 5 spec. Of course, they managed to make it happen with JavaScript, but Google is still applying to put those specs in HTML 5, and considering their position and especially their participation in webkit, it’s almost guaranteed they’ll get anything they want in there, including very early support in Safari and Chrome.

If you watched the keynote about Wave, you’ll notice that it ran in Chrome and Safari, on Windows and Mac OS X respectively. It looks obvious at first, they both use the same engine, but wait, ask yourself that: Why didn’t Google show it for Firefox? Why did Google bother to show it on Safari at all? It’s almost a given what Google meant; webkit is the most advanced engine and not even Firefox could follow.

Is it possible Google, in both an effort at further eating away from Microsoft, and as a gift to the developer community, intends to leave the non-standard browsers, in other words IE, without support for Wave? They’d even have a very good reason to do it, and Wave is a protocol so Microsoft could just make its own IE-compatible Live Wave.

History Tells

It actually doesn’t tell much as of the current situation. In the 1990s, Netscape got eradicated by IE simply because Microsoft’s resources far outpaced anything Netscape was capable of. Internet Explorer was both more stable, free (Netscape wasn’t free until 1998), and especially more widely distributed; bundled with Microsoft’s OS, a first in that industry. Since IE won because of Windows, both on a finance and availability measure, attributing IE’s success to its engine isn’t very exact. That makes history totally irrelevant as far as the web industry goes right now.

It’s even more unclear how a browser manages to gather popularity since both reasons feed each other. The first is that the features are better and users like it more and the second is that developers prefer developing for that platform. The third might be accessibility (ie. bundling with an OS) but it doesn’t count in something that really makes the user switch.

As far as it’s going, Firefox has largely gained its popularity because of its clear superiority to IE 6. Tabs and better security, seen in the form of more efficient pop-up blocking, a stop to malware, and arguably speed, prompted people to switch to Firefox. However, brewing behind was the developer community, who suddenly realized there was much more out there than what IE 6 was capable of. Very quickly IE 6 became hated for its quirks and lack of proper functioning and the whole IE suite still retains that perception amongst developers today.

As the Mac increases in popularity, Safari becomes more popular, much in the same way IE originally won the first browser war. But Firefox keeps eating away from Internet Explorer’s market share while the others keep growing. Really, the only browser losing market share is IE. Some websites even lack support for IE completely and Firefox has recently seen its European market share get the majority. Developers even test their websites in IE after having developed them in Firefox.

Game-changing Mechanics

There’s a very inevitable game-changing mechanism coming up, if users see that their websites don’t work properly in IE anymore, they’ll switch. Take Opera for example, most users who’ve heard about it say they’ve decided to stick with IE/Firefox because Opera is broken; it doesn’t render pages correctly. The reality is Opera is a much less broken browser than even Firefox, it’s always been faster as adopting new standards and passing Acid tests, trailing behind Safari. But that doesn’t change the perception for a regular user that it’s not the website that’s broken but the browser.

Some less knowledgeable developers even talk about “fixing an Opera quirk” while it works very well in Firefox. In reality though, if they have to do that, they’re code is wrong, not the browser. Fixing an Opera quirk essentially means making your code right because Firefox interprets it wrong.

So theoretically, looking at IE’s state of support for standards and the speed at which it supports them makes it an ideal candidate for abandonment. Microsoft can keep doing all of their advertising, it doesn’t matter, the other browsers have better engines that very tightly keep up with one another more than ever. If Microsoft doesn’t invest serious energy into making IE a top browser engine, they’re going to lose the 2nd browser war, and probably much faster, because of Google, than the current rate of decrease.

Object Oriented CSS – A Primer

Preface

Object Oriented CSS (OOCSS) has recently made some buzz in the web industry and for very good reasons. It’s the kind of thing I go: why didn’t I think about this? As a CSS architect, I’m very enchanted to learn something new in the subject, all thanks to Nicole Sullivan at Yahoo.

It’s a great idea, well, just maybe

A lot of Nicole’s arguments were hammering around the fact that OOCSS would be faster. While it may be efficient to code OOCSS from a programmer’s perspective, it’s far from making your page load any faster. OOP concepts require you to separate classes into individual files so that the code becomes more manageable. However brilliant that is from a manageability perspective, it’s a nightmare plan for CSS speed. You don’t want to make your browser load every single little piece of CSS like that.

If your OOCSS class files are served from a single domain, the average browser will only handle 2 concurrent connections to that given domain, making your loading of CSS classes literally 2 at a time. This isn’t beneficial at all. Having multiple pieces would require your browser to wait for the other ones to finish before even sending a request for the rest, and that also makes a lot more HTTP requests, in other words, a lot of overhead.

PHP and other applications of course don’t have that problem since they request files that are stored on the server from the server, which just results in an insignificant increase in disk I/O. But the whole OOP concept remains slower however you see it. In software engineering, everything ends up being either a 1 or 0. The computer by itself cannot understand OOP, which means you have to add additional application logic to make it work, making things slower. The only reason OOP exists is to make it easier for programmers to develop complex applications, it has nothing to do with speed.

Easier to learn?

Apparently OOCSS is easier to learn. Yes, ok, it’s true that making it possible for a junior CSS developer to only handle smaller properties from different classes at first is a way to make CSS easier to work with. But it doesn’t make it easier to comprehend.

OOP concepts won’t help in any way at understanding the CSS box model, neither will they fix the differences between the various browsers. In fact, OOCSS just makes it more difficult to comprehend CSS because on top of that, you have to learn the Object Oriented concepts.

The only real easy part is what OO brings to anything; maintainability. You don’t have to dive into a super long page of CSS rules to modify something.

Cascading, not Object Oriented

Unfortunately for Sullivan, as she mentioned in her presentation, OOCSS is but a practice. CSS has never been Object Oriented, it’s a Cascading language. Using OO practices with CSS is a good idea, but it doesn’t really work. Let’s take a look at some examples:

<style type="text/css">

.block {
   width:200px;
   height:200px;
   background-color:blue;
}

.redBlock {
   width:400px;
   background-color:red;
}

</style>

[...]

<div class="block redBlock"></div>

Ok, what do we have here. First off, you’ll notice there’s a lot of stuff missing, but just imagine there’s all the HTML headers and tags around it. So we have two classes and a div with both of those classes in its name. Yes, this is perfectly fine CSS practice.

With that, we would obtain a 400 by 200 pixels red square. The ability for the square to take one of the classes’ property and override it while still keeping its other properties intact is called Inheritance in OOP. Based on our HTML code, you would guess that redBlock inherits the properties of block. So how about we switch it like this:

<div class="redBlock block"></div>

The block would then take a blue color and a width of 200 px right? Well, this is where the problems start, it doesn’t. In fact, the order in which you specify the classes of the div has no importance whatsoever. In this scenario, we would still get the same red block with 400 px of width because the redBlock class is written after the block class in our CSS rules. This is called Cascading, which is where CSS takes its name: Cascading Style Sheets.

Most people who do CSS know the other aspect of Cascading which states that internal CSS overrides external, and in-line overrides internal. But very few know that it even extends directly into the declarations themselves, possibly because they’ve never used two classes in a single element at once, a very rare CSS practice as of now.

In real OOP however, there’s so such thing as cascading. By inventing some nice pieces of fictional CSS to define the inheritance, much in the way it’s done in real OOP languages, we can do the following:

<style type="text/css">

.block {
   width:200px;
   height:200px;
   background-color:blue;
}

.redBlock {
   extends:block;
   width:400px;
   background-color:red;
}

</style>

[...]

<div class="redBlock"></div>

In OOP, making a class “extend” another is literally telling it to inherit the properties of that class. In this scenario, we don’t even have to write the two classes inside the div because the CSS rules already define redBlock as inheriting (extending) the properties of the block class. We would obtain our famous red block. However, we didn’t say that block extended redBlock, so writing a div element with the class block would only use the block class’s properties, not the redBlock’s.

Unfortunately that CSS code is pure fiction. There’s no such construct in CSS and since it hasn’t been planned for CSS3, the whole idea remains largely a dream years away.

But do you really want this dream?

However brilliant this OO thing would be, its current implementation is nothing but a way of coding. Because of its functionality issues and overhead though, that way of coding CSS is nothing more than a gimmick.

In my opinion, it doesn’t bring in enough maintainability and functional benefits in its current state versus the overhead induced. Yes, Object Oriented practices do make it easier not to make scalability mistakes but a lot of Sullivan’s speech is just good practice, not OO. Every newbie in every field will make scalability mistakes no matter what the language.

I’m not sure if the current state of OOCSS solves anything.