Ph: 277212429492

Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

August 19, 2008

How Wordpress 2.6 ‘Post Revisions’ Retrieved My Unsaved Post Updates

Filed under: General, Wordpress — tabrez @ 3:24 pm

The feature announced to be included in the next version of Wordpress that had excited me the most was the Post Revisioning feature that was set for the Wordpress 2.6 release. After having used 2.6 version for so many days, I finally had a taste of its usefulness today. (Even though I didn’t get to use it much until now, the peace of mind that you get to carry while editing the posts makes the feature worth every effort put in by the Wordpress development team).

I did nothing strange on this occasion: while editing and saving and editing and saving and… a draft post, I opened another related, older post in a new browser tab and made a few changes to that post too. Just forgot to save it! I don’t remember when I had closed that tab as my focus was on my current draft post. When I opened the older post again after sometime, Wordpress displayed a notice informing me that there is a newer auto-saved version of the post available:

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

Auto-saving posts/drafts is old news. But near the bottom of the page, I could see the complete history of my edits, the relevant date and time information included:

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

Clicking on “View the autosave” link(see the first screenshot above) took me to the automatically saved version of the page. Scrolling down the page took me to “Post Revisions” section where I could select the versions that I want to compare:

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

And finally, I was able to view the two versions side-by-side to see the difference between the two versions visually(click the image to see the larger version):

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

(Bonus: What happens if you compare the same versions of a post? Wordpress 2.6 Easteregg!)

A click of a button switched the post to the autosave version(because that’s what I had wanted):

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

And the post was restored:

Wordpress 2.6 warns about autosaved version of a post and allows restoring it through its new Post Revisions feature.

(I didn’t have to worry a lot when restoring because I can always go back to the earlier version because all the revisions are still there.)

Nothing that I didn’t know already but actually going through the process and being able to save those few edits that would have been lost into thin air(or difficult to restore) in earlier versions of Wordpress was quite a bit of fun. The whole experience was seamless and tension-free.

Just sharing the excitement ;)


If you want to receive future posts by email, enter your email address here:

Related Posts:

July 4, 2008

Free Software Community Catching Up to Social Networking Trend

Filed under: GNU/Linux, General, Identica, Web — tabrez @ 8:37 pm

The Free software community has never lagged too behind in any technological development field leaving it completely to the closed platform and service providers to rule the market. The first good GPL software that I came across many months ago targeting the social networking domain was Elgg. I liked it, yes, but more importantly, it confirmed the fact that, it may happen late, but the open source community will sure catch up with the new technology domains eventually if they show the potential to become popular and useful.

Another Free software product that I came across today was Laconi.ca and it powers the microblogging service called Identi.ca.

Identi.ca is a microblogging service. Users post short (140 character) notices which are broadcast to their friends and fans using the Web, RSS, or instant messages.

So Identi.ca is a microblogging service like Twitter, Jaiku and Plurk. Yes, yet another micro blogging service you may say. But is there anything new? From Identi.ca’s FAQ:

Our main goal is to provide a fair and transparent service that preserves users’ autonomy. In particular, all the software used for Identi.ca is Free Software, and all the data is available under the Creative Commons Attribution 3.0 license, making it Open Data.

The software also implements the OpenMicroBlogging protocol, meaning that you can have friends on other microblogging services that can receive your notices.

This is huge. The support for OpenID based login itself had impressed me in no time. Then the whole service runs powered by Free software. It uses the OpenMicroBlogging protocol which means that the other similar services can easily interact with it and the users don’t have to create different accounts with different services leading to isolated communities. (And we have to recourse to poor integration alternatives like Ping.FM and HelloTxt.com).

The service is in its infancy still, so use it only if you want to get a feel of it or submit bug and feature requests to help improve the product. Look at the roadmap to and tell me if you are impressed or not. To host it on your own server/domain, you can download laconi.ca source code from its darcs repository(a tar ball is also available). To see an example of laconi.ca being hosted on a private server, go to Foozik.

[ I was not able to login to Foozik.com using my OpenID account though. I wonder if it was intentionally disabled or if there was a glitch in the service. Russell Beattie, the guy who installed Laconi.ca on Foozik.com, also explains why the current architecture of laconica/identi.ca is not scalable. (Also reproves Twitter.com) ]

Another open source social networking software written using Ruby on Rails framework is RailsSpace, which was originally created as part of the book RailsSpace: Building a Social Networking Website with Ruby on Rails. [ Sidenote: Excellent write-up on how to upgrade Rails applications to Rails 2.1 version: A Rails 2.1 case study: upgrading the Insoshi social networking platform ]

Elgg is another open source social networking web application software that is closer to Facebook in functionality than Twitter. You are supposed to download it and install it on your server. Lot of educational institutes are reportedly using this software.

Mugshot is RedHat’s hosted social networking service. I don’t know how easy it is to get its source code and install it on a private server.

Didn’t satisfy your palate yet? Check the list of 10 open source social networking[1] software on Mashable.com. So see you at Identi.ca, let’s turn the heat on!

[1] term used in the broadest sense of its meaning


If you want to receive future posts by email, enter your email address here:

Related Posts:

June 21, 2008

Don’t Let the “Smart” Way to Write the Swap Function in C++ Fool You

Filed under: Eclipse/C++, General — tabrez @ 11:42 am

Over the years many beginning programmers have shown me two different versions of C++ code for swapping the values of two variables. I am now starting to get tired of correcting the wrong version of the two, especially because of the disappointment that I get to see written on the face of those who thought theirs to be a very clever way of writing code. (Even if the version was correct, I don't know why they take such personal pride in the code. Obviously they have not invented the code; it has been circling the Internet or the general student community for many years, from where they have merely copied it.)

The first and the correct version for swapping values of two variables, in C++, is like this:

C++:
template<typename T>
void swap(T &a, T &b)
{
    T t = a;
    a = b;
    b = t;
}

Simple, straightforward, and correct.

The second, wrong version goes like this:

C++:
template<typename T>
void swap(T &a, T &b)
{
    a = a + b;
    b = a - b;
    a = a - b;
}

The openly asserted advantage of this version is that one variable is saved in this case. But the real, hidden attraction is that it appears to be smartly written code. If only the version was correct too. The problem with this version, of course, is that it is useless for any type that doesn't support arithmetic operations. It works fine for integer type for example, most of the times at least. It is not guaranteed to work even for floating point variables. But what if I want to swap the values of two Colour objects? Two Shape objects? The requirement that the type support addition and subtraction operations for its objects to be swappable is very absurd.

More problems with the second "smart" version:

The code fails utterly when you pass references to the same variable!
C++:
int a;
//read something into a
::swap(a, a)//BOOM! 'a' is now corrupted and beyond recovery.

The call to swap() in this case should have been a "no operation" like it will be with the first version.

The code fails even for the integers when the the sum of two passed variables exceeds the maximum integer limit on that machine. The code is also needlessly unnatural. Human beings don't swap things by indulging in addition and subtraction activities. Unless a person knows that the second version works for at least the integer type (some of the times), or verifies it manually by working through it logically or with a large number of example cases, it is difficult to just see and "get" that the code indeed does the swapping operation. The second version indeed uses one less variable than the first version but at the same time uses three additional arithmetic operations.

There are similar clever ways to swap two variables(using XOR operation, or macros for example), but all of them have one or more problems of similar kind. The best way to swap two variables is definitely the natural way to do it. By the way, parts of the above explanation apply to swapping variables in most other languages too(can't think one where it doesn't). Clever code is useless code if it isn't also correct at the same time.


If you want to receive future posts by email, enter your email address here:

Related Posts:

June 19, 2008

How To Create a Single-Click Link to View All Unread EMails in GMail

Filed under: General — tabrez @ 11:24 am

It was one of the requested features in my now almost two years old "GMail Wish List". I wanted one click access to all of my unread emails only. There is still no such ready-made solution in GMail but I am happy that I can at least create one now, thanks to GMail's advance search operators and the new "Quick Links" feature introduced as part of GMail Labs experimental features. Follow these five steps to create a custom link to fetch all unread emails from the GMail inbox.

Sign-in to your GMail account. Go to the Settings page and click on the Labs link.

If it is visible, you can also click the green funnel like icon sitting just to the left of "Settings" link(it is not visible when no GMail Labs feature is selected).

(If these links are not there, then you have to first enable the GMail Labs feature for your GMail account. Look for a link at the top-right corner of your GMail inbox page to do so.)

On the Labs settings page, enable the "Quick Links" feature, which should be the first feature listed on the page.
Now enter the text "in:inbox is:unread" into GMail search box as shown in the below screenshot, and click the "Search Mail" button(or press ENTER).
Find the "Quick Links" box in the left sidebar(should be somewhere below the "Contacts" and "Labels" boxes) and click the "Add Quick Link" link in it.
Enter some readable text for this custom link as shown in the screenshot below.
Your custom link is piping hot and ready now.

Just click on it whenever you want to load all the unread messages in your inbox. Alas there is no way to just drag this "Quick Links" block and place it at the top of the GMail page.

You can similarly create custom links using other search operators; refer to GMail help for more advanced search operators. These search operators can also be used to create filters and label the messages.


If you want to receive future posts by email, enter your email address here:

Related Posts:

June 18, 2008

Dreamhost Invitation Codes Give Four Times The Normal Bandwidth and Disk Space

Filed under: General — tabrez @ 1:42 pm

I got this email from th Dreamhost folks couple of weeks ago and they sent me five special invitation codes that can be used to sign-up for Dreamhost web hosting packages but get four times the normal bandwidth and hard disk space. Here is the complete text of the email:

You just got five DreamHost Invitations!

Hey Tabrez!

This email is to let you know that you, yes you, have just been given
five (5) oh so special DreamHost Invitations you can use to invite your
friends and colleagues to DreamHost!

Of course, they don't NEED an official invitation to sign up, but if you
email them and tell them to use one of these five invitation codes:





277212429492 670907616224 450568037263 134970060629600482886073

... they will get all these super special advantages not available any
other way:

* They will get four (4) times the normal disk and bandwidth!
* If they choose our five-year plan, they'll get $150 off!
* If they choose our ten-year plan, they'll get $200 off!
* YOU will still earn a full $97 for each person who signs up!

That means these five invitations are worth like, $485 in your pocket!
(Each code is good for only ONE sweet DreamHostering referral!)

Tell your invitees to use the 12-digit code you give them in the "Promo
Code" field when they sign up at:

https://signup.dreamhost.com/

So there you are. All the details are included in the quoted email text. Have a look at Dreamhost's normal shared hosting package feature set. It comes with 500GB of disk space and 5TB of bandwidth. Now multiply that with four!

The reason for not posting the invite codes here earlier is that, in my opinion, even the normal amount of bandwidth and disk space that comes with Dreamhost shared hosting package is way, way more than most users will ever need. I don't use even 2% of it. What then is the big attraction of four times of that bandwidth and disk space? If there is someone who hosts a lot of static content and this kind of huge disk space and bandwidth make sense to them, well, the invite codes are here for the grabbing:




Code 5 : 277212429492 Code 4 : 670907616224 Code 3 : 450568037263 Code 2 : 134970060629 Code 1 : 600482886073

There may be many such invite codes posted on Dreamhost forum too. Hosting service wise, Dreamhost is pretty good. Apart from the never going away ~30 minutes of downtime almost every week, I like their hosting service very much. For example, they have got very good wiki documentation. You can read reviews of it on the Internet.


If you want to receive future posts by email, enter your email address here:

Related Posts:

Next Page »

Copyright (c) 2006, 2007 Tabrez Iqbal.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


Powered by WordPress
This website is hosted by Dreamhost


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser