Entrepreneur Geek

Nirav Mehta on life, technology and future

Archive for the ‘Technology’ Category

Setting up local copy of PHP manual – with smart lookups

with 2 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

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

National Geographic Photo Of The Day Wallpaper on your Mac Desktop

without comments

I love National Geographic photographs. Sujeet linked to a Nat Geo photo on a tweet today, and that led me to setting up National Geographic Photo of the Day as my Mac desktop wallpaper using an Automator action.

Interested? Here are some notes:

I still remember the sweet old Webshots days! Beautiful wallpapers are always refreshing! May be time to try out their beta mac application!

Written by Nirav

May 20th, 2009 at 2:23 am

Who’s following you on Twitter – bots?

with one comment

Is the last person who started following you on Twitter real? Or just a software robot that’s out to eat every good Twitter feed?

My Twitter follower count is growing, but some of them just seem too unbelievable! They don’t have any updates, have nobody (or only a few) people following them, but they are following hundreds of people. How come?

whos-following-you-on-twitter

Are they new joinees, trying to see what everyone’s doing? How would you even keep up with updates from a 1000 people?

My theory is that there is a flood coming! Your twitter updates will be soon be decorated with Google Ads around them, naive readers will keep clicking on ads, keeping cash counters running for those bots!

Do you agree?

(PS: If you are human, you can follow me on twitter!)

Written by Nirav

May 15th, 2009 at 5:48 pm

Posted in Technology

Tagged with , ,

MacBook won’t boot – sometimes!

with 3 comments

My MacBook has started misbehaving after 3 years of good service! Last Monday it did not boot. Came with “the folder with question mark”. Which means it did not detect the hard disk.

Removing the battery and putting it back in fixed it for the day. I was able to work happily. Took a backup later in the evening before leaving for a small vacation.

Then yesterday morning when I booted it, it did not boot again. Removing power and booting from battery started it well. Disk Util permission verification and disk verification did not report any problem. All was OK.

I was able to boot again yesterday night. And it froze while I was working.

Sometimes it starts booting, but hangs in between with a crossed circle. Keeps spinning without moving forward.

Not sure what the problem is. I suspect it’s the hard disk – but then it should not boot at all if it’s the hard disk.

Randomness makes a problem all the more difficult!

Time to take it to the service center?

Written by Nirav

May 5th, 2009 at 10:24 am

Posted in Apple, Technology

Tagged with ,