qmchenry's tutorials

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 Continue reading... 
 

iPhone Programming: Set UITableView Accessory Arrow Style

Contributed by qmchenry on October 12, 2008 under Apple iPhone

The iPhone SDK provides an easy-to-code standard for creating consistent user interfaces. The UITableView class is used in many iPhone applications. Most applications that present information to you in rows that you can tap to slide a new page over to see details use a UITableView to do the magic. Once you have a UITableView setup, you can easily add the little accessory arrow icons to the right side of the table cells by following the steps in this Tech-Recipe.

Comments Continue reading... 
 

Open vim editor to first occurrence of search term

Contributed by qmchenry on October 2, 2008 under UNIX

I don’t want to admit how long I’ve been using vi as my go-to editor (although if vi had been born then, it would now be old enough to drink and vote). One of the things I love about vi is that you only need to know a few things to use it, but it has so many little tricks that you never seem to run out of new things to try. The ones that make your life easier will stick. I had never seen this one before — it’s a simple command line option for vim that includes a search term. When used, your cursor will be positioned at the first occurrence of the term.

Comments Continue reading... 
 

How to empty or clear the contents of an existing UNIX file

Contributed by qmchenry on August 18, 2008 under UNIX

If you want to empty the contents of a UNIX file, you could delete it and recreate it, but, as is typical of UNIX, there are more elegant alternatives. Here are a couple of ways to dump the innards of a file. If you know of any others, add them to the comments.

Comments Continue reading... 
 

Defend Your Web Server Against Distributed Denial of Services (DDos) Attacks

Contributed by qmchenry on July 8, 2008 under Linux security

In computer security, it quickly becomes apparent that preventing computer attacks is much more challenging than attacking computers. A good example of an easy technique to prevent a website from functioning is a distributed denial of service, or DDoS, attack in which a number of compromised computers around the internet make web (or other protocol) requests on some poor server. If the web page requested is one that requires lots of server-side processing, the resulting load from the combined requests prevents the web server from responding to legitimate requests, thus denying the service. As Tech-Recipes.com was subjected to such an attack recently, we felt it might be beneficial to others if we described the steps we took in our response.

Comments Continue reading... 
 

Mac OS X: Use the Keyboard Viewer to Identify Special Character Keystrokes

Contributed by qmchenry on June 8, 2008 under Apple Mac

If your computer work entails frequent use of special characters, the OS X built-in Keyboard Viewer can make your life easier. This small window shows a live view of the characters available on the keyboard given the currently selected language and any modifier keys pressed (shift, option, etc.). An optional pulldown menu provides viewing the mapping for webding and wingding fonts, as well.

Comments Continue reading... 
 

Growl: Close Multiple Notifications with One Click

Contributed by qmchenry on June 7, 2008 under Apple Mac

In an earlier Tech-Recipe I described how to configure Growl to keep notifications on your screen when you are away from your computer. If you are an internet socialite, follow a number of chatty Twitter-ers, or somehow manage to get a slew of notifications, closing them one at a time may make you think lowly of me for ever suggesting that you have your growls stick around as you slowly click to close them one at a time. But never fear, a simple click is all it takes to dispatch all of your notifications at once.

Comments Continue reading... 
 

Growl: Make notifications persist when away from your computer

Contributed by qmchenry on May 12, 2008 under Apple Mac

Growl notifications are a clever, highly customizable, and fun way to receive messages from various Mac applications. Sorry Windows users, Growl is Mac-only. These notification messages persist for a few seconds by default, long enough to read their content but not so long that they are in your way. When you are away from your computer, these messages disappear without being seen. With a quick and easy configuration change, these messages can be kept while your computer is idle until you return.

Comments Continue reading...