Archive for the ‘Development’ Category

__MyCompanyName__

Wednesday, May 20th, 2009

How to change it: Xcode and MyCompanyName

It’s the little things, you know?

Shoe In

Monday, December 15th, 2008

Why don’t we all go down to Washington D.C. and throw our shoes at the White House?

curly throws a shoe at bush Shoe In

Shoes or, creme pies.

Best quote from the Huffington Post comment board:

“Did you see how well he dodged those shoes?? Decades of dodging responsibility sure paid off!”

Indeed.

SVN File Status Flags

Friday, December 12th, 2008

More SVN stuff I can never completely remember.  As seen from running svn update, svn switch, or svn merge. “G” always throws me. See $ svn status help for details.

U filename = item (U)pdated to repository version
G filename = item’s local changes mer(G)ed with repository
C filename = item’s local changes (C)onflicted with repository
D filename = item (D)eleted from working copy
A filename = item (A)dded to working copy
~ filename = item (S)ubstitution; for example local file update obstructed by substitution of a symlink with the same name in the repository (I think of this as a sideways/backwards “S”)

Also note that a real “S” flag means that something has gone horribly wrong with a switch and that the operation was not fully completed. Hopefully you’ll never see this.

Testing J2ME Timers

Saturday, November 22nd, 2008

And I thought developing against cron was bad.

In J2ME, at least on BlackBerry devices, one cannot test Timer and TimerTask objects by simply changing the device clock. J2ME apps seems to remember the time at which they were launched, rather than pinging what the clock on the device says.

Testing involves shutting down the app, resetting the clock, and starting the app back up. Time consuming if you’re working on an app with some heavy startup / shutdown overhead.

“Only websites with over 100,000 daily page views across user pages are eligible to participate in the Google AdSense API program…”

Sunday, November 9th, 2008

What the.. This is annoying.  And all I wanted to do was write a hack to see my AdSense pittance from within WordPress.

Running the BlackBerry Simulator on Vista

Saturday, October 4th, 2008

BlackBerry Simulator mysteriously dying every time you try to fire it up on Vista?  Same here. It’s a good thing I’ve become a compulsive reader of release notes. From the the latest JDE 4.6.0 docs:

If you install the BlackBerry® Java® Development Environment on a computer with Windows Vista™, if Use Account Control is turned on, launching the BlackBerry® Smartphone simulator might produce error messages and the simulator might not start.

Translation:  Simulator will definitely. not. start.  And of course they mean User Access Control. How-To Geek has an easy way to kill UAC here.

Elegant PHP error logging in Firefox

Thursday, September 25th, 2008

Mika Tuupola has come up with an elegant logging mechanism that has already found its way into the official PEAR::Log package.

It’s a snap to use.  Simply instantiate a “Firebug” log as such:

$log = &Log::singleton('firebug', '', 'PHP', array('buffering' => true), PEAR_LOG_DEBUG);

Output will then go to your Firebug console window:

firebug output 300x113 Elegant PHP error logging in Firefox

$log->log('Debug lorem ipsum.', PEAR_LOG_DEBUG);
$log->log('Info wisi enim ad minim veniam', PEAR_LOG_INFO);
$log->log('Warning est usus legentis in', PEAR_LOG_WARNING);
$log->log('Error est notare quam', PEAR_LOG_ERR);

To split output to both the default error log as well as the Firebug console, build a “composite” log:

$log = &Log::singleton('composite');
$logFile =& parent::singleton('error_log', PEAR_LOG_TYPE_SYSTEM, 'to error log', array(), PEAR_LOG_DEBUG);
$logFire =& parent::singleton('firebug', '', 'to firebug', array('buffering'=>true), PEAR_LOG_DEBUG);
$log->addChild($logFile);
$log->addChild($logFire);

Mantis State Plugin Updated

Thursday, September 11th, 2008

gmap state 004 150x150 Mantis State Plugin UpdatedI was surprised to receive a support request last week for the Mantis State Plugin.  Given that the thing wouldn’t allow itself to be uninstalled, I figured it was time to release an update.

Version 0.0.4 includes clearer severity output, issue details on mouseover, and an attempt to better visualize date ranges within the state matrix.

Oh, and it can now be uninstalled.

Mantis State

Remote PHP Debugging with Emacs

Saturday, June 21st, 2008

It’s an Emacs weekend here at blog.arithm.

I was recently asked if it was possible to do remote PHP debugging with Emacs. We’re talking about Emacs, so the answer is:  Of course!  How to do it:

  1. Grab Tohru Fujinaka’s GEBEN library.  It’s an aging alpha release, but works fairly well.
  2. Make sure you also have CEDET installed.  I’m using the 1.0 pre4 release.
  3. Drop debugclient somewhere in your path.  (Here Emacs is running on Windows, so I just threw it into the C:\WINDOWS\ directory.)  Make sure the executable is named “debugclient” and not “debugclient-0.9.0″ or whatever.
  4. If you’re using the standard xdebug port 9,000 (recommended), make sure that port is open on your firewall.  For most folks these days that means opening up the default OS firewall as well as forwarding a port from the router.  See the exceptional portforward.com for more information on router port forwarding specifics.

Now, assuming you already have xdebug plugged into PHP, modify php.ini or an .htaccess file with the following settings:

  • xdebug.remote_enable = true
  • xdebug.remote_handler = dbgp
  • xdebug.remote_host = your_client_ip

For security reasons it’s wiser to do this via .htaccess on directories that permit only authenticated access.

To debug, ask Emacs to listen for connections by going into GEBEN Mode with Meta-x geben. You should see “xdebug started.” in the status row at the bottom of the Emacs window.

Run your PHP script with the xdebug switch on, eg.

http://www.example.com/script.php?XDEBUG_SESSION_START

If everything is setup correctly, Emacs will load the source of script.php (be wary of security!) and allow you to step through the code.

Available commands are:

spc step into/step over
i   step into
o   step over
r   step out
b   set a breakpoint at a line
u   unset a breakpoint at a line
g   run
q   stop

Some gotchas: I’ve noticed the GEBEN expects the first keystroke to be “space”; often it will freeze otherwise.  GEBEN may also run into problems on certain session-related PHP commands.

Happy debugging!

TOAD versus DBVisualizer Revisited

Tuesday, June 17th, 2008

Despite all the nice things I said about TOAD last year, I thought I should mention that I find myself still using DBVisualizer almost exclusively.

Although TOAD has some really powerful features, DBVisualizer is just so easy to use.. that it’s a difficult habit to break.