Do-it-Yourself Photo Booth!

December 8th, 2009 No comments

DIY Photo BoothA friend and her husband recently returned from a wedding with one of the best favours we'd ever seen: a strip of photos that appeared to have come from a photo booth.  But, they were unlike any photo booth photos we'd ever seen: the lighting was textbook, the images sharp and clear, and the colours as good as any professional photograph.  The reason was...that they were professional photographs.  The wedding photographer set up a booth and invited the guests to have their picture taken.

What a fantastic idea.  We simply had to build one.

Mr. and Mrs. Mango are already married but they decided to have a Christmas party this week and thought it an ideal time for a photo booth.  As it turned out, it was very easy to build.


Google Calculator Rocks!

September 20th, 2009 No comments

We always seem to want to convert various forms of measurements to some other various forms of measurements.  We used to have bookmarks for every conversion necessary: one for distance, one for weight, one for currency, and so on.  Then, Mango discovered Google Calculator.  Google has outdone itself and created the easiest conversion tool we've ever seen.  You simply write your conversion in plain English into the Google search box.

Examples follow.


ATAs vs. IP Phones: Which should you choose?

September 17th, 2009 No comments

Instead of using a customary ATA to convert legacy telephones or PBX equipment, some users of VoIP prefer to use a "pure IP" system and use IP phones.  There are advantages to both methods.


Six Notify Sounds

September 10th, 2009 No comments

Here are six "notify" sound effects that Mango made for use in an application, free for the download.

How to Solve Two Four Encore CS3 Quirks

July 4th, 2009 2 comments

Recently we were attempting to build a DVD with Adobe Encore CS3.  Due to Encore's oddities, it took two days to figure out how to do it.  We look forward to the day when Adobe's video editing software will reach the same caliber as its industry standard Photoshop.  Perhaps at this point mentioning "I use Premiere" at a professionals' meeting won't be met with stifled giggling.

Until then, here's how we solved two most notable quirks.  The first was an error message that occurred upon build that went along the lines of: PGC "xxxx" has an error at xx:xx:xx:xy internal software error : %0, line xxxx - PGCINFO: name= xxxx, ref=BPGC, time=xx:xx:xx:xy

This error referenced a point on the timeline approximately one second from the end of the clip.  The last second wasn't significant so we simply trimmed the last second from the clip.  The error then referenced a point on the timeline TWO seconds from the end of the clip.  This was frustrating.


12 Things Mango Wishes He'd Known When He Was a PHP N00b.

June 29th, 2009 2 comments

  1. Never use Register Globals.  Ever.  And if you ever even THINK of using Register Globals, and we find out, Mango is going to send someone over to your house to kick your ass.  Are we clear?
    As much as we love working with PHP, Register Globals is something that should be filed under "Monumentally Bad Ideas".  And unfortunately, it's something that, at first glance, appears convenient.  If a user submits a form to a PHP script with Register Globals enabled, the script will create a variable for each form element.  However, keep in mind that this allows your end users to set any variable in your script that they like.  Here is a common mistake that we see:
    if ($logged_in) { secret_functions_allow(); }
    In a situation like this, the author has first run some code to see if the user is logged in or not.  If so, the script will have defined the $logged_in variable.  When the above line of code fires, it will provide the user with some functions only availble to authenticated users.  Innocent enough, yes?  However, to "hack" this, all that a malicious user would need to do is form a URL like  To turn off Register Globals, add php_flag register_globals off to .htaccess or register_globals = Off to php.ini.  Many administrators ban use of Register Globals entirely, so by developing without it, your script will be more portable.  This is a good thing.


Mango's PHP PostScript Functions

June 17th, 2009 No comments

The latest techniques we've been playing with involve using a PHP script on our server in Michigan to print to a remote printer at our office in Vancouver.  In the past we've done this by generating an XHTML document with high-resolution images and simply prompting the user to print it.  This worked, but if any sort of precision was required, the user had to configure their browser's page setup just so, and to make things even more difficult, different browsers required different settings.

Enter PostScript, a language understood by many laser printers.  With PostScript, we can go directly from our script to the printer, (pipe the finished PostScript document to the printer on port 9100) eliminating the stop off at the browser.  And, we can position things on our page with as much precision as necessary.


Converters for Webmasters

June 7th, 2009 No comments

When we're writing software, we always seem to use a few functions for quick conversions.  We've got a series of converters bookmarked, but today we were thinking it would be even more handy to have everything all in one place.  So we developed the Converters for Webmasters bookmarklet.


Quotes of the day from doctors

May 1st, 2009 No comments

"I just love miraculous recoveries, so I try to have as many of them as possible."  -Brian Davies, ND

"There is a widespread belief [...] that genes are essentially destiny and if you're born with a particular set of genes, you're going to get a particular illness.  That is nonsense.  But it is also very convenient for people who don't want to take responsibility for their own health." -Harold D. Foster, PhD

Things We've Learned Watching COPS

April 25th, 2009 No comments

Lately we've been watching a TV series called COPS.  The show follows law enforcement officers during police activities.  While watching this show, we have learned a few things:

  1. If all of a sudden you see a cop, RUN!!  As fast as you can!  They won't get suspicious!
  2. If you have a large quantity of illegal substances or weapons in your car, don't bother with stop signs or red lights.  It is best to get where you are going as fast as possible.
  3. If an officer asks if you have any drugs on you, and you have a joint behind your ear, say no anyway.  They will never notice something like that.


Configure your Linksys VoIP ATA the right way!

March 20th, 2009 57 comments

ATAs made by Linksys (formerly Sipura) are arguably the most popular ATAs amongst consumers and small businesses, because of their wide array of configuration options.  However, their default settings are not appropriate for users in Canada and the USA.  Let's talk about some settings you can use to ensure that your VoIP equipment properly matches your region.  We apologize in advance for Mango's verbosity but truly feel that the information in this article is very important.  If you're in a hurry, read the bold parts, and the last three paragraphs labeled important note.

Please note: Though the Linksys adapters have historically been an industry standard, they are built on old technology.  If you are considering buying a VoIP ATA, we recommend the new OBi ATAs.  The OBi ATAs were built by the same engineers that built the PAP/SPA devices, and are sure to make an already great VoIP experience even better.

We do not recommend the new SPA112 and SPA122. Though the SPA112 and SPA122 are sold by Cisco as successors to the PAP2T and SPA2102, the new devices are not built on the same technology as the old devices and have received poor reception in the community.

Last update: August 6, 2012.


Linksys Dial Plan Tips and Tricks

March 6th, 2009 9 comments

One of the most common questions we get asked about VoIP is, "Is it still okay if I dial 10 digits for local calls?"  Regardless of the fact that that's a terrible first question to ask, the answer is up to you.  The dial plan on Linksys devices is one of their most powerful features, and with it, you can configure your dialing rules any way you want.

We were going to write an entire introduction to dial plans but discovered Cisco has rewritten lots of Linksys documentation and done a great job of it.  So instead, here's a link to the Cisco ATA Administration Guide - dial plans start on page 63 of the PDF.

What we will post are some excellent dial plans along with some examples of various tips and tricks you may not have thought of.  These should work with the PAP2T, SPA-2102, SPA-3102, and similar devices.


Replacing smart quotes, em-dashes, and ellipses with MySQL or PHP

March 5th, 2009 44 comments

Alternate title: "Help!  My Quotes Appear as Question Marks or Other Strange Characters!"

The "Smart quotes" feature in Microsoft Office transforms straight quotes into curly quotes.  It also transforms hyphens into em-dashes and three periods into ellipses.  While one might think, "How lovely!  My document looks almost as if I'm educated!" readers of said document may not.  Microsoft, in its infinite wisdom, decided to assign special characters such as the ones we just mentioned to a range of codes above 128.  Problem: these codes aren't compatible with other character sets such as ISO-8859-1 or UTF-8, resulting in frustrating issues with non-Microsoft systems.

Keep reading for some PHP and MySQL code to help out with this issue.


OV2Tools not working? Let us explain three confusing things.

March 4th, 2009 No comments

Mrs. Mango and I have a diesel Smart car, which I just absolutely love.  He holds a surprisingly large amount of cargo (such as enough equipment for a two-camera video shoot along with the operators), he's all kinds of fun to drive, and as a bonus he's cheaper than the bus.  We've even named him.  Affection aside, I made a Google map with locations of all the Diesel Stations in Vancouver, BC that I could find.  This of course required going to the computer and looking up the map any time we needed gas in an unfamiliar area.  So when I got a TomTom GO720 GPS, I thought it would be a grand idea to create a POI list of the Google map.

As it turned out, this was VERY much easier said than done.


reCAPTCHA is cool.

October 13th, 2008 1 comment

I wanted people to be able to leave comments to my articles without having to go through the hassle of signing up and waiting for an email confirmation.  So, I looked for a CAPTCHA plugin for WordPress - one of those "enter the words you see in this picture" programs.  I found reCAPTCHA, and let me tell you, reCAPTCHA has got to be one of the neatest ideas ever.  According to the reCAPTCHA website, "About 60 million CAPTCHAs are solved by humans around the world every day. In each case, roughly ten seconds of human time are being spent. Individually, that's not a lot of time, but in aggregate these little puzzles consume more than 150,000 hours of work each day."

Amazing!  Apparently, a brilliant group of people from the Carnegie Mellon University thought so too.  Their next thought was, "How can we harness those 150,000 hours of work?"  (Why can't I ever have thoughts like that?) They got together with some people digitizing old books and newspapers.  They had a problem.  OCR, technology that is used to convert an image of printed text into digital format, is not perfect and occasionally can't read a word.  reCAPTCHA was born.  The program takes a known word, pairs it with an unknown word, and gives it to a user to enter.  If the user solves the one for which the answer is already known, reCAPTCHA assumes the second is also solved correctly.  Presto!  Word by word, a book is eventually digitized.

Here's an example.  The word on the right was difficult to read.  I assume it's "their".  reCAPTCHA will show this word to a few other people as well, in case I'm wrong.

This operation cannot be completed because of dialog or database engine failures.

September 21st, 2008 4 comments

And now!  It's time to play..."Guess what the error message means!"

Ladies and gentlemen...the error of the night IS: "This operation cannot be completed because of database engine failures.  Please try again later."  This error occurs in Microsoft Publisher when attempting to create a Mail Merge using a CSV file.

Does it mean...

a) Your CSV file was deleted.
b) Your CSV file is corrupted.
c) Your CSV file has a stupid period in the file name.


Javascript Drag-and-Drop

September 14th, 2008 No comments

I spent a lot of time trying to find a simple, lightweight, drag-and-drop example to learn from.  Finally I located a drag-and-drop demo from the fine folks at WebToolkit.  The Javascript is only 50 lines which impressed even me.  I've tested this to work with Firefox, IE, and Opera.

Here's how to use it.  The element must have position:absolute; or position:relative;.
var dragable = dragHandler.attach(document.getElementById('some_element_id'));
/*This function will be called when dragging starts.  Note that we do not write begin(); here. */
dragable.dragBegin = begin;
/*This function will be called every time the element moves.*/
dragable.drag = drag;
/*This function will be called when dragging ends.*/
dragable.dragEnd = end;
The last three lines are optional.  You can write your own functions (here, imaginitively named 'begin', 'drag', and 'end') that will be run when you specify.

Here's a Drag-and-Drop example I made.  Check the source code for the rest of the Javascript.

Phenomenal Gluten-Free Pie Crust

August 10th, 2008 No comments

I just made an awesome quiche in the absolute best pie crust I have ever made.  As a bonus, it was gluten-free.  As an additional bonus, it disappeared in no time flat.  Quiche recipe to follow next week - stay tuned.

In a food processor, place 1 cup white rice flour, ¼ teaspoon baking powder, and ¼ teaspoon salt.  Pulse a few times with feed chute covered.  Cut ¼ cup butter into small pieces and add to food processor.  Process until butter is mixed in with flour mixture.  Add 1 egg and 2 teaspoons cold water and process just until evenly combined.  As this dough will not stick together as gluten dough would, simply turn the entire mixture into a pie plate and press around and up the edges with a fork.  Place in fridge while preparing filling.

This is based on the recipe from Chaotic Cooking.

Wheat-Free Banana Bread

July 7th, 2008 1 comment

I've finally come up with a banana bread recipe that is wheat-free, is at least relatively healthyish and, in Ms. Mango's and my opinion, is quite tasty.  Here it is:

Combine 1½ cups barley flour, 1 cup sugar, 1½ teaspoons baking soda, and ¼ teaspoon salt.  Use a food processor, two table knives, or a pastry blender to cut in ¼ cup cold butter.

In a separate bowl, mash 4 very ripe bananas, leaving a few small chunks of banana if you desire.  To the bananas, add 4 eggs.  Beat well.  Fold in the flour mixture and mix until just blended.  Transfer to a greased loaf pan and bake at 350° Fahrenheit for 90 minutes.

I have tried all the following variations with excellent success:
- Add ½ cup of chocolate chips or chopped nuts.
- Replace the butter with shortening for a non-dairy version.
- Use an alternative sugar such as evaporated cane juice.

"Did you just...un-veganize a vegan recipe...?"
"Er...yeah, I guess I did.  Still want to marry me?"

Setting Variables with .htaccess

June 9th, 2008 No comments

I was thinking a few months ago how handy it would be if I could set server variables with .htaccess.  In particular was the path to which I had installed my customer management software.  Many programs had used its include file, both in the software's directory and outside of it, requiring me to hard-code its path.  And, of course, it is good programming practice NOT to hard-code paths.

I was told then that this was impossible.  I like to think that I am the first to make a great discovery, but it is likely that the person that told me that was just wrong.

SetEnv cm_path /home/mango/public_html/cm

and in PHP, you simply access the cm_path variable like this:


Simply Accounting Encountered a Problem

June 3rd, 2008 No comments

I was just looking over this blog's stats and was amused to note that 17% of hits from search engines were from people searching for "Simply Accounting Encountered a Problem".

Well, I hope the article about how I fixed it is helping some people.

Silly Microsoft...

May 23rd, 2008 No comments

Windows has the following information about this file type. This page will help you find software needed to open your file.
Extension: *.wmv
File Type: Unknown
Description: Windows does not recognize this file type.


Chronicles of Simply Accounting 2008 and msvcr80.dll

May 15th, 2008 1 comment

In a previous post, I said, "According to Google, I am apparently the only person in the world who likes Simply Accounting more than QuickBooks."  I am beginning to discover why.

After happily using the trial Simply Accounting 2008 for a few months, I finally got around to activating it.  Simply promptly quit working.  Completely.  When I tried to load any data file, even the test company, it would get as far as "Verifying database..." and then bring up an error that said, "Simply Accounting by Sage 2008 has encountered a problem and needs to close."

This was frustrating.


Preventing Double-Clicked Submit Buttons

May 7th, 2008 No comments

This works and is compact; the only caveat is if the user uses the back button, the Submit button remains disabled.
<input type='submit' value='Submit' onclick='this.disabled=true;' />

Toshiba Laptops' Multimedia Keys and iTunes

April 26th, 2008 8 comments

Here is, as far as I know, the best way to make Toshiba Laptops' Play/Pause/Stop keys work with iTunes.

iTunes only has limited support for multimedia keys out of the box.  They work only when the iTunes window is activated.  So, here's a plugin one can use to make it work even when minimized.  I found the plugin on the Aqua-Soft Forums site.  You can browse the thread if you want, or just download the plugin: iTunes multimedia keys play pause stop minimized.  Just put it in the C:\Program Files\iTunes\Plug-Ins folder.  (In rare cases, it won't work in this folder - see the thread for more info.)

Next, we need to make the Toshiba multimedia keys work like normal multimedia keys.  For reasons known only to Toshiba, the keys on my laptop have completely different scancode mappings from standard multimedia keys.  Fortunately, on Windows 2000/XP/2003/Vista, we can remap them.

Here's a registry file I built that solved the problem for me (I use a Toshiba Satellite M70): Toshiba multimedia keys play pause stop.  Just download this to the desktop, and double-click it to run it.  You may wish to back up your registry before doing so, though I have yet to see any issues caused by this.

For more information about scancode mappings, or if the file above didn't work, keep reading...