Mooching

That’s the new geek term for Wi-Fi tapping. It has stirred up some controversy over here as people are caught and charged for tapping into someone else’s unsecured wireless network.

The question: Crime or No Crime?

Supporters for the “Crime” side are focusing on the “someone else” and saying its akin to Stealing or Trespassing. On the other side of the fence are people who stress on the “unsecured”, saying it is harmless (just reduces some bandwidth), Free-For-All, and it is the responsibility of the owner since he has the option and power to secure it.

There are many other side factors, such as the intent of mooching. There are those who want to surf for free, there are those who have automatic connections to the strongest signals. There are also people who mooch to post bomb hoaxes, those who ride on to conceal their identity and actions, or maybe those who wants to compromise other machines in the same Wi-Fi network.

The accusation is more obvious if there is a malicious intent when mooching, but for harmless mooching I’m currently leaning slightly towards no crime. I’ll still be sitting on the fence (and leaning to one side) for now as the reasons or analogies to back either decision isn’t strong enough.

Sorting Javascript Arrays (of Objects)

There’re many ready Javascripts out there, which already allow you to sort arrays. However, if you come from a OO background like me, it won’t be long before you start using Javascript arrays of custome objects. You can’t really use those simple number or string sorting algorithms available, since they don’t inspect the attributes to sort correctly. You could write a custom sort function for that purpose, then rewrite it again and again for each of the attributes of that object, and again and again for all other objects.

Or you could follow that well known Comparable model from Java. By attaching methods to the custom objects [1] like a Comparable, you can write generic sort algorithms to performing sorting. You can even extend the feature to using a Comparator to influence the object’s natural sort order.

Side note: Javascript does not support method overloading, and it doesn’t report and error that it doesn’t [2]. It simply uses the last method declared. I’ve therefore named the other method sortArray2. Bad method name, but you should name it more appropriately if you decide to use it.

Javascript Object Array Sorting Example

[1] Introduction and Features of Javascript “Function” Objects
[2] JavaScript only pretends to support function overloading

Modern Internet Business Models

As many people (and articles) have identified, online businesses are moving towards newer models to offer free stuff using advertising [1] and service support [2] to sustain.

Advertising usually means the site provides free content, and generates revenue by displaying advertisement alongside their content. The site would need to update content regularly, in order to attract returning visitors. There seems to be also a trend of user-generated content, such as video-sharing, which empowers the site visitors to contribute to the site content.

Service support usually allows users to use their product for free, charging for support when problem arises or signing support contracts with bigger companies. It is noticed that such companies have to work with lower profits, as a result more company operations are streamlined, such as reduced sales staff and marketing. Early adopters to such products also usually help shape future versions of the product.

[1] The Internet’s Biggest Google Whores
[2] Taking the plunge into open source

WEP, WPA and WPA2

WEP, or Wired Equivalent Privacy, is a wireLESS standard for protecting data transmited over a WLAN network. Since wireless signals run over the air, they may be tapped easily. These data may include your login credentials to websites or application, sensitve emails, etc.

WEP uses a key which the user must enter into the router as well as all participating nodes. The key is then used to allow the user on the network and subsequently encrypt all trafiic using the key. Users will still be able to descrypt and see the data sent by another user on the same network, just as if the user had physical access to the Ethernet wire on the wired version. The problem with WEP is that it is not secure; by intercepting a big number of encrypted packets a cracker is able to crack the key used. There are also other known problems with WEP that cannot be solved with a bigger key.

After discovering this major security problem, WPA (Wi-FI Protected Access) was quickly created to replace WEP. As the 802.11i specifications was complete, WPA2 was introduced to comply with the new standard. WPA allows for two modes of operation, a “Personal” mode, where a Pre-Shared Key (PSK) is used for authentication and encryption, or an “Enterprise” mode where a IEEE 802.11X authentication server is used. [1]

The personal mode works similar to WEP, all users enter the “Network Key” to gain access to the network, then all traffic is protected. This scheme is suitable for home networks and small offices, where there are few machines and seldom changing.

No chance to try the authentication server mode yet…

[1] Wi-Fi Protected Access – Wikipedia, the free encyclopedia

P2PTV

Was recently introduced to a streaming TV application that allows you to watch overseas channels. Turns out it is based on the popular BitTorrent technology for streaming. What’s interesting about this form is that it has inverse properties of traditional Internet broadcasting: In traditional (uni-)broadcasts, the less people watching, the better the quality. The more people watch, the quality drops. Using BT, the more people watch, the better is quality, since there are more peers on the network and everyone becomes a re-broadcaster.

It also just takes a simple subscriber to the desired channel service to be the source. Despite only one source, if the content is popular (such as soccer matches), the peers will quickly help to make the swarm very big. It also does not matter if the original source bandwidth is not that high. As long there are enough people in the swarm, and you have a good download bandwidth, it is more likely your stream will be served well by the other peers.

Code markup

Yes, like many others I have realized the troublesome-ness of posting code in WordPress. There’s no need for me to re-iterate the problem since this site [1] has done it perfectly I feel. The Problem analysis, Alternatives such as off-the-shelf plugins, selected Solution, Usage and Tests look just like a perfect project to me.

However, the plugin didn’t work for me at first, nothing was being escaped at all. The same symptoms appeared. The plugin didn’t work with WP 2.0’s WYSI[N]WYG editor, and there was advise to disable the editor under the post comments. Despite disabling it at Options>Writing, the Visual Rich Editor still persistently appeared! Finally this quicktip [2] taught me the correct way to disable it, so now I am writing without the Visual Editor! I’ll probably be better staying this way with the TechBlog due to the amount of code I post.

[1] WordPress Plugin: Code Autoescape
[2] QuickTip: Turn Off WordPress 2.0 Visual Editor

Earthquake disrupts Internet

The Taiwan earthquake that occured late last year showed the world how dependant they were on communications technology. However I was thinking more about the lessons that this event brought about…

The Internet was designed to contain redundant links. It was supposed to withstand breakdowns within the network. And it did have redundant links through other continents and countries. Why did a single point of failure cause a drop in more than 50% of connectivity across Asia? Why was so much traffic preferred over the Taiwan link? Was it because it was cheaper so everyone turned to its link rather than the others? Was the Internet backbone design flawed to allow Taiwan to connect so many links?

I understand certain organisations or telephony networks might be directly connect to those links, but what about the rest of the major ISPs? I would expect slowness but not a breakdown such that it may cripples economies due to lack of financial information getting across. In fact economy crippling might be even on a terrorist agenda. (No I’m nothing near one.)

Perhaps, and hopefully, I’m just missing some information that gives me this mis-interpretation.

Update: According to this report [1], economical factors are preventing the network to be laid the way they should. I should have guessed.

But nature’s precise targeting alone cannot be blamed for Wednesday’s virtual blackout. It costs up to US$500,000 ($767,000) to lay a single kilometre of cables. Thousands of such kilometres were laid in the 1990s, but the returns dried up and no one was keen to pour money into fibre-optic activity for years. The next wave of investments is overdue, and just earlier this month a consortium announced plans to spend US$500 million on a high-speed undersea link directly between the United States and China.

Source: Channel News Asia

[1] The cable disconnect: Channel News Asia

The WordPress database

I’ve gone one round from a simple blog+wiki to trying MediaWiki, then XOOPS, now finally back to WordPress. After listing my requirements of chronological and categorized articles it seems WP has what I need and is easier to setup and customize as compared to the wiki and CMS.

During the process I tried the XOOPS news module and a variation of it know as the Article Management System (AMS). They could have sufficed for categorized articles, but I also need a blog-like interface, which I tried XPress – WordPress for XOOPS. It was simply a wrapper and could switch between the XOOPS and WordPress styles. Pretty impressive to me. Since I’ve migrated my older posts into the wrapped WP it should be easier for me to move posts over to the current WP.

Posts in WP are stored in the “wp_posts” table, or whatever your table prefix is. This includes your Pages, so be careful not to have duplicated IDs over at both sides. For a clean migration you’ll need to delete both the example post AND the example About page. Then, export the wp_posts data from the old blog and import it into the new blog.

Categories are stored in the “wp_categories” table, and linked to posts via the “wp_post2cat” table. This is due to the many-to-many relationship between categories and posts. The table has 3 columns, the first being a running number, the 2nd and third columns are the PKs of the category and posts table. Also, if the categories don’t match the new database, be sure to also update the category_count column in the wp_categories table. Mine was empty so the category didn’t show up on the blog and the category admin page showed 0 posts on the category.

Finally remember to set the correct time difference on the Options page before you begin migration, or you’ll end up with screwed up old posts like me…

Domain migration

No posts for the whole of December – because of several reasons. One being the festive season I spent less time at the computer so there’re less stuff to write. Second and more importantly I registered new domains and was busy migrating stuff over. Currently the forum and blog migration is complete, I’ll need to move the wiki stuff into this system as well.

Will be writing more about the new stuff after migration. In the meantime, have a happy 2007!