Computer programming tutorials

Cocoa: Convert number to comma-separated NSString

Contributed by qmchenry on January 30, 2010 under C programming

At some point in your Mac, iPhone, or iPad development you may find the need to express a long number (1000000000) as a comma-separated string (1,000,000,000) to make life easier on your users. The NSNumberFormatter class is a rich tool for converting numbers to strings supporting different types of currencies and localizations. It’s also the perfect class to leverage for our comma-ing task.

Comments
 

Symfony: Drop Down List Box Without Submit Button

Contributed by davak on November 25, 2009 under Symfony

I needed a drop down list box for a symfony site I was designing. As a newbie symfony programmer, I wanted to record this so I could reference it later. Although this uses a little javascript, it will correctly function and is backwards compatible to users without javascript enabled.

Comments
 

Pear Fix for “Error: Unable to Unpack”

Contributed by davak on February 12, 2009 under PHP programming

Recently while trying to install some Pear packages, I received an odd “Error: Unable to Unpack” message. A search for this error message found a lot of complaining people and not a lot of answers. I finally figured out the cause and the fix for this common Pear problem.

Comments
 

Cocoa: Explode or break an NSString into individual words

Contributed by qmchenry on October 20, 2008 under Computer programming

Breaking apart a string of text into component words is a requirement for performing searches in text and other text processing. This task is easy in Cocoa/Objective-C, although it requires digging through a few class references in the documentation. If you need a more complicated expansion of a string, at least this code will give you a starting point.

Comments
 

PHP: Upload Files to the Server

Contributed by William_Wilson on September 30, 2008 under PHP programming

With PHP, it is simple to upload any file to your server.

Comments
 

Symfony / Propel: How to Left Join

Contributed by davak on July 4, 2008 under Symfony

A JOIN is a way to connect related database tables by the common values between them. A left join contains all of the rows from the primary table plus related members of the second database if they exist. Using joins can significantly reduce the number of database queries required to render a web page. This Tech-Recipe describes how to do a left join in Symfony using Propel.

Comments
 

Symfony: Rebuild from Schema.yml Without Loss of Data

Contributed by davak on June 27, 2008 under Symfony

As my test database became more complex, I hated entering data again after doing a propel-build-all. Following these commands, you can save your database content after rebuilding your database from your schema file.

Comments
 

Symfony: Delete an Application

Contributed by qmchenry on April 6, 2008 under Symfony

The command line provisioning utility in symfony provides mechanisms to create an application, but doesn’t have the means to delete one. If you’ve unintentionally created an application or no longer need an app and want to do housecleaning, this Tech-Recipe describes how to get it gone.

Comments