Author: ellen

Construct a variable name in PHP from a string and another variable

The “Shop” page of this site is a php page which displays an amazon a-store category and the second level tabs appropriate to that category, using a “node id”.

The html for the tabs is defined in an included page like this:

<?php
//-------------//
$tabs6= '<ul class="yui-navset bd">';
$tabs6.='<li class="first selected" id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs6.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs6.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs6.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs6.='</ul>';

$tabs180= '<ul class="yui-navset bd">';
$tabs180.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs180.='<li class="selected" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs180.='<li class=" " id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs180.='</ul>';

$tabs183= '<ul class="yui-navset bd">';
$tabs183.='<li class="first " id="tab6"><a href="shop.php?tab=6" >Web Development</a></li>';
$tabs183.='<li class="" id="tab180"><a href="shop.php?tab=180" >CSS</a></li>';
$tabs183.='<li class=" selected" id="tab183"><a href="shop.php?tab=183">Javascript</a></li>';
$tabs183.='<li class="last" id="tab181"><a href="shop.php?tab=181">DHTML</a></li>';
$tabs183.='</ul>';

?>
Continue reading

Site Optimization: use Google Suggest and Google Trends to determine top searches

Google Suggest and Google Trends are easy-to-use tools you might not have thought of using for search engine optimization (SEO).

Google Suggest suggests terms related to whatever keywords you type in, and lists the number of results for each one. According to the FAQ, it uses data about the overall popularity of various searches to help rank the refinements it offers.

Continue reading

SyncServer can take up 100% of CPU on OS X

On an underpowered G5 iMac running OS X 10.4, I spent a lot of time troubleshooting performance issues. One of them was the “spinning beachball” effect, where some process would take over for a moment, resulting in everything else hanging until it released some CPU.

On at least one of these instances, launching Activity Monitor showed that Sync Server was taking up 100% of the CPU every few minutes.

Apparently this is a common problem on both 10.4 and 10.5:

SyncServer Problem Post on Mac Forums

Continue reading

Voice recording with the iPhone

UPDATE 2: March 27, 2009 I’ve been using QuickVoice for a couple of months now. It’s good enough that I use it to record piano sessions and meetings. It is pretty sensitive. I did purchase the 15.00 syncing software which you need to pull the files off the iPhone if you haven’t jailbroken it.
UPDATE: Jan 24, 2009 Since this article was written, the app store was launched and there are now many Voice recording apps for the iPhone. Click here to search for the latest list of Voice Recorder applications available in the iTunes Store

Now you can record your voice with the iPhone (or any other phone), and get speech to text functionality as well!

Continue reading

Timing Issues and Javascript

Sometimes, when you use javascript to make a change to some element on a page, you will get a Javascript error along the lines of: “element ‘n’ has no properties.” You check your page, and yes, the element is definitely there, and it is definitely named correctly, and your syntax is definitely correct. So where is the problem?

Well, it may be a timing issue. If your script executes before the element targeted by the script has been rendered, it will not find the element. This can particularly be a problem with frames or iframes. The solution is to move the function call to the bottom of the page, after the element has loaded.

Continue reading

How to analyze Captivate Movie structure

If you want to create widgets that control Captivate files with new functions, other than the standard playbar functions, you will need to develop them in flash. Here’s how to figure out what is going on in a Captivate movie file:

Create a Captivate movie, and publish it (Captivate 2) or export it to Flash (Captivate 3). To create my faster-slower widgets, I had to decompile it into an .fla (I used SWFdecompiler )

Open it in Flash, and start exploring the structure. If you are using version 3, by far the best tool you can use include the “debug movie” command.

Continue reading

Review of the latest iPhone Update (1.1.3)

A few days ago, Apple sent down version 1.1.3 of the IPhone software. This update is a huge leap in much-needed functionality.

Home Page
The home page interface now makes sense! It always looked as if it were customizable, and practically begged you to add items to it, but it wasn’t possible. Now it is.

Adding a new application is as simple as browsing to the application on iPhone Safari, clicking the “+” symbol and selecting “add to home page.” The various web-based iphone applications available all over the internet are now as easy to access from the iphone home page as the native apps.

And all the icons on the home page can be moved around, reorganized, and shifted to other pages (up to 7 of them.) Even the dock icons (Phone, Mail, Safari, iPod) can be moved.

Continue reading