Daddy’s rules for dating

Daddy’s rules for dating

Daddy’s Rules for Dating

Rule One:
If you pull into my driveway and honk you’d better be delivering a package, because you’re sure not picking anything up.

Rule Two:
You do not touch my daughter in front of me. You may glance at her, so long as you do not peer at anything below her neck. If you cannot keep your eyes or hands off of my daughter’s body, I will remove them.

Rule Three:
I am aware that it is considered fashionable for boys of your age to wear their trousers so loosely that they appear to be falling off their hips. Please don’t take this as an insult, but you and all of your friends are complete idiots. Still, I want to be fair and open minded about this issue, so I propose this compromise: You may come to the door with your underwear showing and your pants ten sizes too big, and I will not object. However, in order to ensure that your clothes do not, in fact come off during the course of your date with my daughter, I will take my electric nail gun and fasten your trousers securely in place to your waist.

Rule Four:
I’m sure you’ve been told that in today’s world, sex without utilizing a “Barrier method” of some kind can kill you. Let me elaborate, when it comes to sex, I am the barrier, and I will kill you.

Rule Five:
It is usually understood that in order for us to get to know each other, we should talk about sports, politics, and other issues of the day. Please do not do this. The only information I require from you is an indication of when you expect to have my daughter safely back at my house, and the only word I need from you on this subject is: “early.”

Rule Six:
I have no doubt you are a popular fellow, with many opportunities to date other girls. This is fine with me as long as it is okay with my daughter. Otherwise, once you have gone out with my little girl, you will continue to date no one but her until she is finished with you. If you make her cry, I will make you cry.

Rule Seven:
As you stand in my front hallway, waiting for my daughter to appear, and more than an hour goes by, do not sigh and fidget. If you want to be on time for the movie, you should not be dating. My daughter is putting on her makeup, a process than can take longer than painting the Golden Gate Bridge. Instead of just standing there, why don’t you do something useful, like changing the oil in my car?

Rule Eight:
The following places are not appropriate for a date with my daughter: Places where there are beds, sofas, or anything softer than a wooden stool. Places where there is darkness. Places where there is dancing, holding hands, or happiness. Places where the ambient temperature is warm enough to induce my daughter to wear shorts, tank tops, midriff T-shirts, or anything other than overalls, a sweater, and a goose down parka – zipped up to her throat. Movies with a strong romantic or sexual theme are to be avoided; movies which features chain saws are okay. Hockey games are okay. Old folks homes are better.

Rule Nine:
Do not lie to me. I may appear to be a potbellied, balding, middle-aged, dimwitted has-been. But on issues relating to my daughter, I am the all-knowing, merciless god of your universe. If I ask you where you are going and with whom, you have one chance to tell me the truth, the whole truth and nothing but the truth. I have a shotgun, a shovel, and five acres behind the house. Do not trifle with me.

Rule Ten:
Be afraid. Be very afraid. It takes very little for me to mistake the sound of your car in the driveway for a chopper coming in over a rice paddy near Hanoi. When my Agent Orange starts acting up, the voices in my head frequently tell me to clean the guns as I wait for you to bring my daughter home. As soon as you pull into the driveway you should exit the car with both hands in plain sight. Speak the perimeter password, announce in a clear voice that you have brought my daughter home safely and early, then return to your car – there is no need for you to come inside. The camouflaged face at the window is mine. But, before you even think of dating my daughter, you’ll have to fill out the Application for Permission to Date My Daughter.

Application for permission to date my daughter

Application for permission to date my daughter

APPLICATION FOR PERMISSION TO DATE MY DAUGHTER

NOTE: This application will be incomplete and rejected unless
accompanied by a complete financial statement, job history, lineage,
and current medical report from your doctor.

NAME_____________________________________  DATE OF BIRTH_____________

HEIGHT___________  WEIGHT____________  IQ__________  GPA_____________

SOCIAL SECURITY #_________________  DRIVERS LICENSE #________________

BOY SCOUT RANK AND BADGES____________________________________________

HOME ADDRESS_______________________  CITY/STATE___________  ZIP______

Do you have parents?               ___Yes  ___No
Is one male and the other female?  ___Yes  ___No
If No, explain:
       ______________________________________________________________

Number of years they have been married ______________________________

If less than your age, explain
       ______________________________________________________________

       ______________________________________________________________

ACCESSORIES SECTION:

A. Do you own or have access to a van?              __Yes  __No

B. A truck with oversized tires?                    __Yes  __No

C. A waterbed?                                      __Yes  __No

D. A pickup with a mattress in the back?            __Yes  __No

E. A tattoo?                                        __Yes  __No

F. Do you have an earring, nose ring,               __Yes  __No
   pierced tongue, pierced cheek or a belly button ring?

(IF YOU ANSWERED "YES" TO ANY OF THE ABOVE, DISCONTINUE APPLICATION
AND LEAVE PREMISES IMMEDIATELY.  I SUGGEST RUNNING.)

ESSAY SECTION: 

In 50 words or less, what does "LATE" mean to you?

       ______________________________________________________________

       ______________________________________________________________

In 50 words or less, what does "DON'T TOUCH MY DAUGHTER" mean to you?

       ______________________________________________________________

       ______________________________________________________________

In 50 words or less, what does "ABSTINENCE" mean to you?

       ______________________________________________________________

       ______________________________________________________________

REFERENCES SECTION:

Church you attend ___________________________________________________

How often you attend ________________________________________________

When would be the best time to interview your:

       father? _____________

       mother? _____________

       pastor? _____________

SHORT-ANSWER SECTION: 

Answer by filling in the blank.  Please answer freely, all answers
are confidential.

A: If I were shot, the last place I would want shot would be:

       ______________________________________________________________

B: If I were beaten, the last bone I would want broken is my:

       ______________________________________________________________

C: A woman's place is in the:

       ______________________________________________________________

D: The one thing I hope this application does not ask me about is:

       ______________________________________________________________

E. What do you want to do IF you grow up? ___________________________

       ______________________________________________________________

       ______________________________________________________________

F. When I meet a girl, the thing I always notice about her first is:

       ______________________________________________________________

F. What is the current going rate of a hotel room? __________________

I SWEAR THAT ALL INFORMATION SUPPLIED ABOVE IS TRUE AND CORRECT TO
THE BEST OF MY KNOWLEDGE UNDER PENALTY OF DEATH, DISMEMBERMENT,
NATIVE AMERICAN ANT TORTURE, CRUCIFIXION, ELECTROCUTION, CHINESE
WATER TORTURE, RED HOT POKERS, AND HILLARY CLINTON KISS TORTURE.

_________________________________________________________
Applicant's Signature (that means sign your name, moron!)

_______________________________      ________________________________
Mother's Signature                   Father's Signature

_______________________________      ________________________________
Pastor/Priest/Rabbi                  State Representative/Congressman

Thank you for your interest, and it had better be genuine and
non-sexual. Please allow four to six years for processing.

You will be contacted in writing if you are approved.  Please do
not try to call or write (since you probably can't, and it would
cause you injury). If your application is rejected, you will be
notified by two gentleman wearing white ties carrying violin cases.
(you might watch your back)

To prepare yourself, start studying Daddy’s Rules for Dating.

Porting C++ code to Objective-C

Porting C++ code to Objective-C

I’m in the middle of porting a Windows C++ application to the mac.  I’ve posted before that I was pleasantly pleased to find that with some limitations, XCode supports mixing C++ and objective-C code.

Here are a few things to look out for when working with C++ code in a Cocoa application:

1. Missing C++ member functions may not be flagged at compile time and your program will abort with a message similar to:

ZeroLink: unknown symbol ‘__ZN8DVFArray6ExistsEP6DVFObj’

You can use the C++filt program which is part of the GNU Binary Utilities to help demangle the function in error.  I could not build this package so I looked and found a copy of the C++filt program. Unfortunately I could only find a copy for the PC.
The example listed demangles to: DVFArray::Exists(DVFObj*)

2. You cannot store C++ objects/pointers in Cocoa containers.  One workaround is to store NSValue objects in the containers and store C++ pointeres in the NSValue objects:

[myNSArray addObject:[NSValue valueWithPointer:pCPPObj]];
.
.
pCPPObj = [[_array objectAtIndex:idx] pointerValue]

3. You should not use static C++ objects or static data members.  Constructors for static objects will be called before main() is called and you will not have an NSAutoReleasePool initialized yet. You will get a message similar to:

*** _NSAutoreleaseNoPool(): Object 0x307f60 of class NSConcreteValue autoreleased with no pool in place – just leaking

The discussion "NSAutoreleasePool and static data member constructors" is very good on this subject

Pixen: A Free image editor for Mac

Pixen: A Free image editor for Mac

I am using Pixen for image editing on the Mac.  Like others that have written, I was surprised that no such program was included in the Mac OS.  I’ve just barely started using it but it so far it does what I need.  I was particularly impressed with the getting started wizard that took you through an overview of the program and  allowed you to set some program settings at the same time!  I model of what all programs should offer.  The only think I would recommend is showing a Page X of Y on each wizard page to let the user know how long it is.

Update:  Paintbrush is a nice alternative that emulates the Windows Paint program

EXC_BAD_ACCESS during startup

EXC_BAD_ACCESS during startup

Once again, the XCODE debugger not only failed to help but got in the way by showing me a stack trace that was not directly relevant to my problem.   The program crashed with EXC_BAD_ACCESS and the stack trace looked like this:

#0    0x90a594c7 in objc_msgSend
#1    0xbffff7b8 in ??
#2    0x932899d8 in loadNib
#3    0x932893d9 in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
#4    0x9328903a in +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]
#5    0x93288f7c in +[NSBundle(NSNibLoading) loadNibNamed:owner:]
#6    0x93288cc3 in NSApplicationMain
#7    0x00009f80 in main at main.mm:17

This made me think that my NIB was corrupt since I didn’t see anything in the stack trace that pointed to my code. After wasting several hours investigating that rat hole, I decided to try to do what the debugger didn’t help with and that’s track down the offending line.  With breakpoints and Debugger(); calls (breakpoints don’t always work for me) I found that an IBOutlet was not being initialized and I was sending a message to nil.  If the run-time was not going to flag this as an error, why would this cause a problem down the line?  Arrggg! 

Lesson learned, if a stack trace looks similar to the above, then look at your initialization code of your Nib objects.

Memory bugs in Cocoa

Memory bugs in Cocoa

At work, our software runs on Windows and Mac OS.  I’m trying to reuse as much code as possible; not through some fancy cross-platform tools but by simply writing in portable C or C++ code and by using class wrappers that can each be implemented in the native platform.  One thing I’ve been pretty pleased with XCode is it’s support of mixing Objective-C and C++ code fairly seamlessly.

Recently, in trying to port some C++ Windows code over I started having some memory crashes.  Unfortunately the XCode debugger was of very little help with the stack trace not including any calls from my code.  This was an excellent thread on some techniques to troubleshoot EXC_BAD_ACCESS problems.  Fortunately, I didn’t have to try all the various techniques listed.  After reading the entire thread I decided to pursue the notion that I might be over-releasing an object (though why should this be a problem?  A warning perhaps but seems once a reference counter is down to 0 calling release again should be harmless).  This DID lead me to the offending code so I was able to fix my problem without wasting too much time.  Once again, the developer community saved me hours if not days of debugging.  How did we get along as programmers before the Web?

Debugging AutoRelease problems

Windows Desktop Search and shortcuts

Windows Desktop Search and shortcuts

I guess the shortcuts feature of the XP Windows Desktop Search was too geeky to carry over to Vista?  It was what I liked most about it.  The ability to type in a short acronym to bring up a  file, run a program, navigate to a website or many other actions, from a small area on the taskbar was awesome!

Thankfully, Brandon has made his Start++ program available that gives you the same functionality in Vista.  If you are developer, it is a must have.

Linking up Help in Cocoa

Linking up Help in Cocoa

I haven’t had to "hook-up" help in a Cocoa appplication yet since the application I inherited at work already had it working.  But recently, when the application invoked help I’ve been getting the message:

"Help isn’t available for <application name>"

I found this article to help me understand how help is hooked up in Cocoa.

I checked the required metatag and the info.plist values and they seemed in order.  What worked for me is to remove the Help Book Folder from the resources folder and re-insert it.  Be sure to select the radio button titled "Create Folder References for any added folders"

The one thing that is different in my Xcode 2.4.1 version project from the article was that the Resources folder exists inside a Frameworks folder.

iPods and Zune

iPods and Zune

My first MP3 player was a Creative Muvo. It only lasted a year.  Then I got some generic MP3 player with a small one line screen.  It supports playlists and generally works pretty well but the design is not very friendly.  It’s David’s now.  Then I bought an iPod shuffle for Jane followed by a shuffle for Cassidy. A few months ago we upgraded Cassidy’s shuffle with an iPod 4gig Nano.  I’ve "inherited Cassidy’s shuffle, Jane is still happy with her shuffle (Jane wants me to include that she ROCKS because of this).

My next portable music player will probably be a Zune.  It may or may not match the experience and design of an iPod, but I bet it will at least come close.  The least expensive Zune compares favorable with an iPod Nano.  They both cost the same at $149.  The Zune has a built  in FM tuner and can sync wirelessly.  The screen can also display in both portrait and landscape.  Although in recent years I’ve split my allegiance between Apple and Microsoft (Jane’s mini, our 3 ipods), we are an XBOX family and the Zune has some nice integration features with XBOX and Windows Media Center that I’m eager to play with.

Yeah, my next portable music player will probably be a Zune, unless I opt to go with the Apple iPhone!

Here are a few interesting articles regarding the Zune:

Zune vs iPod
Zune vs iPod specification smackdown

8 Zune Myths

Zune vs iPod, the final word on who should get your money