Stripes

Stripes is an “easy-to-use” web framework to overthrow Struts, as described on [1]. I have not tried it myself, but I quite agree with the disadvantages of using Struts, especially the high learning curve of learning Struts. The tight integration between the components and cryptic errors has also made incremental development difficult. Stripes has made it easy for a new developer do Stripes in less time, but it will be especially easy for a existing Struts developer to switch over because of the large similarities between them.

You can read about the Struts post at [2].

[1] Stripes vs. Struts
[2] Apache Jakarta Struts (Action 1)

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…

Solaris TAR vs GNU TAR

There was a problem using Solaris’ tar as it had problems extracting Apache Tomcat that had files in deep directories inside the tar. It happily truncated the name and created a weird “@LongLink” file outside.

Following suggestions from Google to use GNU tar instead, I found all GNU FTP sites to offer the tar source in a tar.gz.

@_@

Excel VLookup

VLookups in Excel can help to change values in Excel tables based on a combo box value.

Question: Can I select a combo box value and have the data copied to a new table?

AFAIK the “new table” will need to contain formula that references the combo box, e.g. =vlookup(comboBox, Sheet1!Data, 3). If you want the new table to be empty and the contain pure values, it can only be achieved through macro programming using VBA.

Excel cells cannot be affected without a formula in it. It will stay an empty cell (without VBA).

Ant

I’ve been avoiding ANT for many many years now… probably because I’ve not got into any serious deployment, or something which simple compilation cannot do. However, I finally took my step in (JUST to try it), and it wasn’t so bad after all.

Essentially, the Ant tool is a cross-platform build script (windows batch file or unix make) that can run commands in batches. Core commands (“built-in”) include copy, delete, javac, java, jar, etc. You can group these commands in ‘tasks’ in a ‘project’ to be executed separately or you can create dependant tasks that executes one after another.

Common tasks include init (which setup variable for use in the tasks, usually a dependancy for all other tasks), build/compile (main javac code to javac and move them to appropriate dir), deploy (copy ready jar/war and files to deployment locations) and clean (delete everything).

I’ve used the core copy and jar commands to build Wildfire plugins that are deployed directly, eliminating the need to manually move class files, jar and copy to deploy folder. Compilation was automatically done with Eclipse, and the Ant task was run directly in Eclipse too.

For more complicated projects Ant also support defining your own Ant tasks, though I’ve yet to need such services. However being so extensible you can say it can do anything that you can code.