Archive for December, 2006

PHP: Declare your GLOBAL variables

Posted on the December 23rd, 2006 under Uncategorized by

Something that bugged me all day, which I managed to fix using an idea from someone else’s code:

With PHP5 being more Object Oriented, we are quick to declare our variables and functions as public, private and protected. But one thing we should also do is declare global variables as global using:

$GLOBALS[‘nameOfVariable’];

instead of just:

$nameOfVariable;

If you are used to OOP, you’d probably not use global variables at all. But it’s useful to know if you are using a library or piece of code that is not object oriented. For example, I was busy trying to incorporate PhpMathPublisher into Chisimba, and ended up with weird looking formulas. Only by converting the four PhpMathPublisher variables to use $GLOBALS could I get it to work.

Demo phones at VodaShop = Worthless and Hopeless

Posted on the December 23rd, 2006 under Uncategorized by

If you have a contract phone, you’d probably experience this. You enter a cell phone shop to decide which phone you want, which ones are free, which ones will cost you extra, etc. Besides the many criteria you could choose from, recommendations, adverts, etc., there are times when you are undecided. And the way you tend to decide is by requesting for the demo in the window.

But here comes the problem. The demos in Vodacom, MTN (I experienced both, not sure about Cell C) are just that demos, pieces of plastic crap . In both instances when I requested them to switch on the phone, I got told, “Sorry it’s just a demo.”

A demo of what??? I don’t get to see any of the features. I don’t get to see if it has the features I need. I don’t get to see if the features like taking photos are worth the quality. What happened to don’t judge a book by it’s cover?

And to top it all, the assistants aren’t worth the questions you ask.

Yeah they can go on that it’s easy to steal the phone, but don’t insult our intelligence by showing as a worthless demo. If they really wanted to, they could have:

  1. Get a Real Phone
  2. Insert a sim with no airtime
  3. Attach some security device to the phone or cable it.
  4. Make the manuals or better documentation on the phone available.
  5. Teach their assistants to know the products they sell!

Your own PDF bookmarks in Acrobat Reader

Posted on the December 11th, 2006 under Uncategorized by

As nice as PDF is for distributing books/documents and not withstanding the ability to structure the titles of those documents with bookmarks, the is one thing I really wished for:

The ability to add my own bookmarks. Read, add bookmark, close pdf, open later, continue where I left off.

The are commercial options available for this, but I don’t have the time (and reluctant to spend $$) to see what they offer. Instead I found a solution from the PDF Hacks Book’s Website at: http://www.oreilly.com/pub/h/2358

It’s a script, you download and place in the Reader\Javascripts. For Windows, it will probably be. C:\Program Files\Adobe\Acrobat 7.0\Reader\Javascripts

Works well (source is in javascript), though pity it is limited interface wise. If Adobe includes Ajax and CSS support, it could be improved 😉