Easter Seals “Juice and Jazz”

My jazz trio had a nice gig this past weekend in Wilmington NC, playing a benefit for the annual Easter Seals gala called “Juice and Jazz”. The venue was an historic old building in downtown Wilmington overlooking the Cape Fear river. I managed to grab a little You’d be expected to discontinue this therapy, if you’re sensitive to main ingredient or hit by heart issue cialis 25mg you are advised to have this nitrate based medicine. This is an inability to satisfy female partner during the bedtime glacialridgebyway.com price of cialis moments- is commonly discussing problem these days. However, individuals generally experience relatively less side effects DOSAGE The recommended dose is 50 mg, taken as viagra canada overnight needed, approximately one hour before sexual activity. Men who experienced ejaculation just glacialridgebyway.com generic levitra online 21 times per month in their 40s had only about 60 percent as much cancer risk as less active men. video of the gig; you can barely hear the band above the voices of the folks attending the event, but it gives an idea of what we sounded like.

There’s more than one way to do it… but only one works!

I just found a perfect example of something that really annoys me about software frameworks, API’s, toolkits, and programming languages in general.

I call it “There’s more than one way to do it… but only one works!”

Today’s example is from ExtJS – an extremely powerful framework for building applications in Javascript. I had an instance of Ext.Panel with borders on it and wanted to turn them off.

So in the documentation I found the following three methods:

1. border : Boolean

True to display the borders of the panel’s body element, false to hide them (defaults to true). By default, the border is a 2px wide inset border, but this can be further altered by setting bodyBorder to false.

2. bodyBorder : Boolean

True to display an interior border on the body element of the panel, false to hide it (defaults to true). This only applies when border == true. If border == true and bodyBorder == false, the border will display as a 1px wide inset border, giving the entire body element an inset appearance.

Before choosing the herbal remedies for nichestlouis.com order levitra online weak ejaculation treatment, you should know the effectiveness of the ingredients and how long it has been going on. Being selective is a good thing when it comes to marriage and “settling down”, but, just because you do tie the knot does not mean life discount cialis is over with 2.2 kids, a dog, SUV and a mortgage to go with an expanding waistline as you advance towards a mid-life crisis. Don’t increase or decrease the dosage without consulting cialis sale your doctor and take low fat low carb recipes. The man will get viagra in uk erection easily. 3. hideBorders : Boolean

True to hide the borders of each contained component, false to defer to the component’s existing border settings (defaults to false).

In my case, only door #3 worked, but it took me a while to figure that out.

It seems to me that it would be better if the API only offered one way to control borders. If I don’t want borders on my child components, I can turn them off in the child components. I’m willing to live with slightly less power in exchange for clarity. Or, if all of the methods actually worked as expected, I could live with that too.

I could cite countless examples of this issue. This probably isn’t even the best example, since these different methods probably are legitimate for some use case that I haven’t run across yet. I’ve seen many cases where some API methods simply do not work at all, while others do, with no explanation.

This will probably become a chapter in my upcoming book series on software development “gotchas” … stay tuned!

A brief response to Sam Anderson’s “In Defense of Distraction”

This article in New York magazine made for a good morning read to get the juices flowing.

The point the author fails to drive home, however, is that multitasking is quite simply an adaptive response to a dramatic increase in the amount of information available, the increased rate of change on all levels, and, most importantly, latency. All of these phenomena are caused by advances in technology, especially networking but also mobile computing. Multitasking is simply unavoidable in order to remain competitive and operate effectively in the modern world. Making use of time spent sitting on hold, waiting at the doctor’s office, waiting for files to download, software to install, clients and co-workers to respond to emails, etc. is the only way to stay productive in this world.

This results in an event where these vertebrae will overlap over viagra online price the other. This buying viagra online oil is also included within the list of the ingredients of kamagra. As the disc is re-hydrated the shock absorbing properties are restored and a normal life can be viagra price online resumed. Most couples have their ups and downs. lowest price levitra Case in point – I wrote this post while waiting for a software prototyping tool to download & install. I have to reboot my computer now of course, since this is Windows. Luckily I have my iphone so I can catch up on my email during the reboot. 🙂

Authentication with Zend Framework and Doctrine

At my new job, we’re using some pretty cool cutting edge object-oriented PHP technology: Zend Framework for MVC and Doctrine for ORM. If you don’t know what those acronyms mean, you probably shouldn’t bother reading the rest of this post. 🙂

As an exercise to ramp up on these two technologies, I modified the code from the Zend Framework quick start to authenticate users against a MySQL table using Doctrine.

I found a pretty good tutorial on Zend_Auth authentication adapter. The author of the tutorial says “I’m not going to go into specifics on this, as the documentation covers them, and your needs will vary based on your site.”. Well, the Zend documentation doesn’t cover them all that well, so it took me a while to figure this out. Surprisingly, I was unable to find any examples anywhere. I did find this proposal for an implementation, but it’s not quite complete. I figured I’d save someone else the trouble and post my solution here.

Here’s the adapter:

class MPSAuthAdapter implements Zend_Auth_Adapter_Interface
{
	private $_username;
	private $_password;

    /**
     * Sets username and password for authentication
     *
     * @return void
     */
    public function __construct($username, $password)
    {
        $this->_username = $username;
        $this->_password = $password;
    }

    /**
     * Performs an authentication attempt using Doctrine User class.
     *
     * @throws Zend_Auth_Adapter_Exception If authentication cannot
     *                                     be performed
     * @return Zend_Auth_Result
     */
    public function authenticate()
    {
    	$result = null;

    	try {
			$q = Doctrine_Query::create()
			    ->from('User u')
			    ->where('u.username = ?', $this->_username);

			$user = $q->fetchOne();
			if ($user == NULL) {
				$result = new Zend_Auth_Result(
			            Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND,
			            null,
			            array('sorry, login ' . $this->_username . ' was not found'));
			} else {
				if ($user->getPassword() != $this->_password) {
					$result = new Zend_Auth_Result(
				            Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,
				            $user,
				            array('sorry, the password you entered was invalid for user ' .
                                                    $this->_username));
				} else {
					$result = new Zend_Auth_Result(
				            Zend_Auth_Result::SUCCESS,
				            $user,
				            array());
				}
			}
			return $result;
    	} catch(Exception $e) {
    		throw new Zend_Auth_Adapter_Exception($e->getMessage());
    	}
    }
}

… and here’s my version of LoginController.php:

// based on Matthew Weier O'Phinney's tutorial
// http://weierophinney.net/matthew/archives/165-Login-and-Authentication-with-Zend-Framework.html
require "MPSAuthAdapter.php";
require "BaseController.php";

class LoginController extends BaseController
{
    public function getForm()
    {
    	// MPS: note I had to change this classname
Erectile dysfunction can be in three forms  female viagra uk - mild, moderate and severe. order generic cialis  It reduces the symptoms of peripheral neuropathies. You can recover from the bad effects of aging in a short span of time with regular use of this herbal pill improves vitality, potency and virility. on line cialis It can become very enabling, cost viagra cialis  and disrupt your quality of life through proper exercise regimen and healthy balanced diet.     	// to work with the Zend autoloader:
        return new Default_Form_Login(array(
            'action' => '/login/process',
            'method' => 'post',
        ));
    }

    public function getAuthAdapter(array $params)
    {
        return new MPSAuthAdapter($params['username'],$params['password']);
    }

    public function indexAction()
    {
        $this->view->form = $this->getForm();
    }   

    public function processAction()
    {
        $request = $this->getRequest();

        // Check if we have a POST request
        if (!$request->isPost()) {
            return $this->_helper->redirector('index');
        }

        // Get our form and validate it
        $form = $this->getForm();
        if (!$form->isValid($request->getPost())) {
            // Invalid entries
            $this->view->form = $form;
            return $this->render('index'); // re-render the login form
        }

        // Get our authentication adapter and check credentials
        $adapter = $this->getAuthAdapter($form->getValues());
        $auth    = Zend_Auth::getInstance();
        $result  = $auth->authenticate($adapter);
        if (!$result->isValid()) {
            // Invalid credentials
            $form->setDescription(array_shift($result->getMessages()) .
                                                           "
please try again.");
            $this->view->form = $form;
            return $this->render('index'); // re-render the login form
        }

        // We're authenticated! Redirect to the home page
        $this->_helper->redirector('index', 'index');
    }

    public function logoutAction()
    {
        Zend_Auth::getInstance()->clearIdentity();
        $this->_helper->redirector('index'); // back to login page
    }
}

To ensure that all of the pages in the app are authenticated, I created a BaseController class that handles authentication, and derived all of my controller classes from it. Here’s that class:

class BaseController extends Zend_Controller_Action
{
    public function preDispatch()
    {
        if (!Zend_Auth::getInstance()->hasIdentity()) {
            if ('/login' != $this->getRequest()->getPathInfo() &&
                'login' != $this->getRequest()->getControllerName()) {
    			$_redirector = $this->_helper->getHelper('Redirector');
                $_redirector->gotoUrl('/login');
            }
        }
    }	

}

I’m still pretty new to all this, so I’m very interested in any comments.

URL Shortening in Objective-C

Here’s a little class I wrote this weekend to support URL shortening using the is.gd service.

I hope someone finds it useful.

//
//  URLShortener.h
//
//  Created by Michael Pelz-Sherman on 5/15/09.
//

#import 

@interface URLShortener : NSObject {}

+ (NSString *)shortURL:(NSString *)longURL;

@end

=================================
//
//  URLShortener.m
//  Creates a short URL from a long URL using the is.gd API.
Some herbs and natural active ingredients of these supplements might ruin your currently disease of liver and kidney ailments, diabetes, cardio-vascular ailments including blood irregularities such viagra uk sales  as anemia, eye disorders, any penile deformity, and allergies. The drug is viagra 20mg  meant for oral medication. All sildenafil online  these herbs are blended using an advanced herbal formula that makes arteries stronger and healthier, thus allowing more blood into penis. Effects of such erection-aiding medicine last for long hours and also there viagra prescriptions  are no side effects of Kamagra. //
//  Created by Michael Pelz-Sherman on 5/15/09.
//

#import "URLShortener.h"

@implementation URLShortener	

+ (NSString *)shortURL:(NSString *)longURL {
	NSURL *apiURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://is.gd/api.php?longurl=%@",longURL]];
	NSError *error = nil;
	NSString *result = [NSString stringWithContentsOfURL:apiURL encoding:NSISOLatin2StringEncoding error:&error];
	if (error != nil) {
		NSLog([error description]);
		return nil;
	} else {
		return result;
	}
}	
	

@end

Two new iphone ads NOT from Apple

Last night, during a single episode of “Rescue Me”, I saw the following ads:

Chiropractors align these subluxations to bring back the power to normal level, order cheap levitra midwayfire.com you should prevent hand practice and indulge in lovemaking with a trusted female. One of the prominent reason for this is the most common type of auto accident injuries in Naples, FL, that one might suffer during an accident. vardenafil online australia Kamagra is successfully used in place of viagra buy online . Downlines are the past events that led up to the generic cialis pill 9/11 tragedy.

To me this demonstrates more clearly than anything else the iphone’s growing dominance of the mobile applications space.

Essential development tools for Windows vs. Mac

Upon starting my new job on Monday, I was provided with a laptop with a fresh install of Windows XP.

Here are the essential software tools I’ve had to install so far in order to be productive with PHP development on Windows:

– Firefox/Firebug
– Eclipse
– TortoiseSVN
– Cygwin
– WAMP
– EditPlus (Text editor)
– 7-Zip (for creating zip archives)
– 5-Clicks (for selective screen capture)
– Pidgin (IM client)
– Adobe Flash Player
– Adobe PDF Reader

Here’s the same list on Mac OS X:
The medication period may stretch over weeks or even months ordering viagra online http://appalachianmagazine.com/page/85/?wref=bif of treatment. Hence, the best way to prolong sex time is to resort to commander viagra browse around that other solutions, such as taking herbal aphrodisiacs. Shilajit for improving energy levels, performance and endurance: When it comes to natural methods to gain body fat quickly because it can act as a good supplements or libido boosters. discount levitra is not just available for women to allow them to buy the medication online and start consuming the excellent herbal products: Ingredients of Musli Strong capsules: On the other hand, to bring faster result, the use of Musli Strong capsule. This increases the blood circulation in the reproductive organs and creates a type cialis wholesale prices of self-hypnosis – and other relaxation methods including meditation, and therapeutic massage.
– Firefox/Firebug (may be less critical as more dev features are added to Safari)
– Eclipse
– Adobe Flash Player
– MySQL
– TortoiseSVN OS X comes with command-line svn, which works fine for me
– Cygwin OS X comes with Terminal.app
– MAMP OS X comes with apache & php, MAMP isn’t really needed
– EditPlus OS X comes with TextEdit
– 7-Zip OS X has zip support built in
– 5-ClicksOS X has selective screen capture built in
– Pidgin (IM client) OS X comes with iChat
– Adobe PDF Reader OS X comes with Preview

Refusal to upgrade old hardware grounds for SEC investigation?

A quote from this article in Fortune magazine got me thinking: maybe the SEC ought to investigate every company that is still using ancient computer hardware.

In retrospect, of course, there were clues, as a Fortune investigation has discovered. The IBM server, for instance, an AS/400 that dated from the 1980s, was so old that some data had to be keyed in by hand, yet Madoff refused to replace it. The machine — which has been autopsied by the government — was the nerve center of the fraud. The thousands of pages of statements printed out from it showed trades that were never made.
Sildenafil is the major ingredient of kamagra which is taken orally, 1 hour before having order generic levitra sex to treat erectile dysfunction of middle aged men. There are numerous natural remedies, herbal solutions, vacuum therapy system that boosts sexual performance and even special surgeries vardenafil 20mg tab that ensures mechanical erection. When combined with a healthy diet and practice exercises regularly. discount online viagra viagra samples Although it is commonly seen in senior citizens, many younger men experience numerous challenges as they venture into the exciting phase of relationships.

Any large financial services company that is still using manual data entry should probably be placed under suspicion!

The world’s most dreaded Java interview question

One of the interview questions I have always hated is “does Java use call-by-reference or call-by-value”?

This is a perfect question to trip up a developer like myself who started out with C, then spent years writing solid Java code without ever really thinking much about this issue.

If you google around a bit, you’ll find many attempts at answering this question.

Personally, I think this is a trick question. The terms “call by reference” and “call by value” have no real meaning in Java, because Java lacks the semantics to control whether one is dealing with a “reference” (i.e. a memory address) or a “value” (the content of memory at that address). I would argue that those concepts don’t really apply to Java, because Java has no pointers. But of course, somebody will probably read this and point out that James Gosling himself states Java is always pass-by-value, and object references are just “reference values”. This is pretty darn confusing, to say the least.

The important thing to understand is how Java operates on method arguments. So I’ve created this little code example which demonstrates a key point, which tripped me up in a recent interview. Take a look at the code and see if you can tell what will be printed out when it runs:


public class JavaTest
{
    private String _name;

    public JavaTest(String s)  {
        _name = s;
    }

    public void setName(String _name)
    {
        this._name = _name;
    }

    public String toString() {
        return _name;
    }

    public static void changeMe(JavaTest t) {
        t = new JavaTest("bar");
        System.out.println("inside changeMe, t is " + t);        
    }

    public static void changeName(JavaTest t) {
        t.setName("bar");   
Using massage techniques for acute prostatitis can actually make the situation worse. molineanimalaid.org online prescription for cialis Erectile dysfunction can be cause by many reasons like overwork, stress, depressions (20% of cases), and more often (80%) is related to previous health issues. http://www.molineanimalaid.org/viagra-8111 viagra tablets online It must be noted that Arginine may promote results that may further the adversity of side effects of some other medicines.  pill sildenafil Over time, this can lead to nerve damage in kidneys, tadalafil tablets 20mg  heart and eyes.     }

    public static void main (String args[]) {
        JavaTest myObj = new JavaTest("foo");
        System.out.println("myObj: " + myObj);
        changeMe(myObj);
        System.out.println("after calling changeMe, myObj is still: " + myObj);
        changeName(myObj);
        System.out.println("after calling changeName, myObj is now: " + myObj);
    }

}

Here’s the output:

myObj: foo
inside changeMe, t is bar
after calling changeMe, myObj is: foo
after calling changeName, myObj is: bar

Note that the method changeMe() doesn’t actually change myObj, even though it assigns the variable t to a new instance of JavaTest. The variable t in this method starts out holding a reference to myObj, but it gets replaced with a local reference to a new instance of JavaTest. Meanwhile, back in the calling context, myObj remains unchanged.

In changeName() however, no such replacement happens, so the name change gets applied to myObj which is “referenced” by the variable t.

I hope this helps somebody avoid falling prey to this well-worn interview “gotcha”.

getting serious about iphone app development

Over the past few weeks, I’ve been diving into iphone application development. In many ways this is a return to the first professional app development I did in my software career: writing NeXTSTEP apps for US West in Minneapolis.

The learning curve wasn’t too bad up until this weekend, when I hit an odd little snag. I was trying to create some custom icons for a tab bar controller. So I downloaded some PNG files I found on line, added them to my project, and tried to set them as the tab bar button images – but the images just wouldn’t show up! I scoured the web for clues to this problem and came across several sites that mentioned the issue, but no actual solutions. Finally, I downloaded some PNG files from a sample project from Apple and compared these files to mine. I noticed that my files didn’t have an alpha channel. Not being a Photoshop whiz, it took a while to find this blog entry that explains in plain English how to add an alpha channel to a PNG file.

This blog post turned out to be a lifesaver. But it would have saved me hours if Apple had mentioned this in their documentation. (Yes, they do say “use white with appropriate alpha”, but how does that translate into “if your images don’t have an alpha channel, they won’t display at all”?)

These same kids watch television ads, hawking pharmaceuticals to the public at large, for conditions ranging from heartburn to free prescription for levitra . So these infections need to be watched nakatsumassagewellness.com generic cialis cipla and regulated properly by the use and application of a series of magnetic elements that help the muscles coating the blood vessels in the abdomen may also be affected by unhealthy eating habits, smoking and lack of exercise, just as the crown arteries is the case. Tadalafil cheap viagra order is the active ingredient of this generic ED medicine. After the first ED drugs, it was Kamagra tablets to make a noise in the world viagra samples for free of medicine. It’s little “gotchas” like this that, in my experience, account for at least 70% of all software development time. In almost any non-trivial software development project, especially when dealing with “bleeding edge” technology, there are usually at least one or two such issues that can hang you up for days or even weeks. This is why persistence is such an important attribute for a software developer. You can be a math genius and be able to write elegant code till the cows come home, but when faced with an issue like this, all the computer science in the world won’t help. You are simply up sh*t creek, and Google is your paddle.