Entrepreneur Geek

Nirav Mehta on life, technology and future

Archive for May, 2009

Setting up local copy of PHP manual – with smart lookups

with 3 comments

If you are a PHP developer, you probably know that you can type “php.net/substr” to look at documentation for the substr() function. This works for many other keywords as well and is a superb feature. It’s just so convenient, I stopped using my local copy of PHP manual.

But yesterday, I wanted it offline. I downloaded the “many HTML files” version of the documentation, extracted it and set it up on my local Apache. I can now open up http://localhost/phpman/ to read the documentation. (this is how I actually learned PHP 11 years ago!!)

And I wanted the smart lookups – auto complete! I searched around to find if there was a ready .htaccess file that I could use. Or if someone had made something similar already. I did not really find anything solid. Suddenly I realized I can just look up the PHP.net site source code and figure out what they are doing, and replicate it on my local setup. (Yes, PHP.net’s source code is open too!)

Eureka!

So after a few minutes of hacking around, I have my nice little setup that mimics PHP.net’s quick / smart lookup of functions. Typing http://localhost/phpman/substr takes me to http://localhost/phpman/function.substr.html in a split second.

Jai ho!

Let me jump to the code now that you’ve read so much!

Here’s the .htaccess file. And here’s the PHP file – “manual-lookup.php” placed in the phpman folder. The file is an adaptation from php.net website’s source.

Here’s the complete procedure:

  1. Ensure you have Apache / PHP setup locally.
  2. Download the many HTML files version of PHP documentation.
  3. Extract it in a folder called “phpman” in your website root. You should now be able to see it at http://localhost/phpman
  4. Download this file, and save it as .htaccess within the phpman folder.
  5. Download this file, and save it as manual-lookup.php within the phpman folder.
  6. Try http://localhost/phpman/substr – it should work if all went well!
  7. Enjoy!

Hope this helps someone like me ;-)

Written by Nirav

May 29th, 2009 at 2:15 pm

Paperless Office?

without comments

paperless-ticket

For more such cartoons, visit BrainStuck.com

Written by Nirav

May 27th, 2009 at 3:51 pm

Teaching English is not easy

with one comment

Our maid requested if Nikita (my wife) could teach English to her daughters. They are 12-14 year and know only the alphabets.

One of the daughters came yesterday evening for her first class. I was watching things as Nikita asked her to write down A-Z. First in capital then in small.

And she did not even understand what capital and small meant. The only language she can understand well is Telugu – her mother tongue. She does not also know Hindi well. It was funny to see them struggle with each other. Trying to understand each other by visual cues more than spoken words.

Fortunately, dad had brought a Rapidex English Speaking Course Telugu book for her. She started reading that. The book had Telugu sentences, their English translations, and pronunciation guide in Telugu. Learning by saying aloud seemed to work and that’s what they did yesterday.

Teaching English is not easy. Especially when both people don’t know each other’s language ;-)

Let’s see how it goes.. Have you taught English to someone? What’s the best way?

Written by Nirav

May 26th, 2009 at 2:23 pm

Posted in Experiences

Tagged with ,

Who is Bhaskar Bharati?

with 5 comments

Bhaskar bana Bharti

Bhaskar bana Bharti

If you are in India, you may have seen such hoardings around. Who is Bhaskar Bharti you may ask? And why did Bhaskar ditch so many girl friends? (and more interestingly, how did he make so many girlfriends in the first place ;-)

Bhaskar (bana) Bharti is a new comedy show on Sony TV.

The story is about a playboy, Bhaskar who has ditched a number of girls and has taken all their curses. One of his girlfriends casts magic on him and one night he transforms into a girl. To adjust his life as a girl he changes his name to Bharti and acts as Bhaskar’s cousin. Bhaskar’s friend falls in love with Bharti who is actually a boy. Will Bhaskar be able to adjust as a girl or will his truth be revealed?

Checkout Baskar Bharti on Wikipedia, and a promo video on YouTube.

Clearly, media companies are trying to innovate their marketing. Not only are they using social networking and Internet, they are also trying to create buzz this way or the other.

Did they succeed? I believe the marketing has succeeded in creating curiosity. Now let’s see what happens to the show once it goes live on Monday!

Written by Nirav

May 23rd, 2009 at 6:44 pm

Posted in Business

Tagged with

Team: We need to improve quality of Gujarati translations

with 5 comments

Incorrect Translations

Incorrect Translations

Upgraded Firefox for my dad, and that led to this screen. Essentially, it says that “Your Firefox has been upgraded to the latest edition”. But the translation to Gujarati changes the meaning. If I were to translate this Gujarati back, it would read “You have been upgraded/improved to the latest edition of Firefox”. C’mon, it’s Firefox that got upgraded, not myself! :-)

Now, it’s my team that’s done most of these translations! These were done by the same people who did initial Utkarsh localization work. I have done translations myself and I know the difficulties to get them right.

But hey, is it time we do a QA on our translations and get them more up to date? More and more Gujarati users are coming online, and we really want to make it easier for them to use the web.

What say? Kartik, Ankit, Shweta? Others?

Written by Nirav

May 22nd, 2009 at 4:45 pm