Recursively deleting folders

0

Posted by Jaime | Posted in Coding | Posted on 26-04-2008

Tags: , , , , ,

While I was looking at my backup log in Retrospect, I saw an error message about a directory had more than 100 folders deep. What?

I took a look and sure enough, Entourage had gone on a folder making frenzy and had created well over 100 folders within each other:

My Project.rge/My Project.rge/My Project.rge/My Project.rge/My Project.rge…

Well, I fired up terminal.app, typed rm -R and expected my problem folder to go away. But it didn’t. The folders that Entourage created were actually bundles, so now I had to dig a little deeper:

find . -iname “*.rge” -exec rm -rdf {} \;

Basically, this calls the find command recursively on every bundle found with the “rge” extention and deletes it. So if anyone else out there has the need to recursively delete bundles/folders on their Mac OS computer, just type in the above command… with extreme caution 🙁 

MethylPREDNIsolone

0

Posted by Jaime | Posted in Health, Not-so-funny | Posted on 26-04-2008

Tags: ,

“Eeeerrr!”, Lifting a chair over my head with one hand and carrying my son and wife with the other, I have superhuman strength thanks to the miracle called steroids!

I wish! Actually, hurt my back again and was bedridden for nearly a week. On top of that, I found out that I had a really nasty long infection. So, I had to stay home, read up on OpenGL and take a combination of drugs. Steroids, antibiotics, muscle-relaxers and a transdermal pain reliever patch gave me a pain free week 🙂 Aaaah 🙂

Evil bug #1299

0

Posted by Jaime | Posted in Coding, Not-so-funny | Posted on 25-04-2008

Tags: , , , ,

I recently had to deal with this nasty bug on Mac OS 10.3.9 that only showed up when you prompted an Alert dialog box during a NSTableView selectionShouldChange method.

Here’s what would happen. You have a NSTableView filled with your items. When the user selected any one of the rows, the selection of that row would update other controls on the UI with the value that was specific to that row selection. If the user made changes to the controls and selected another row from the NSTableView, the selectionShouldChange method would check to see if the controls have been changed and asks the user if they want to save their changes before continuing. It doesn’t matter what answer they select because once the NSAlert dialog box was dismissed, the NSTableView ceases to get any messages.

The weird thing is, if you actually click anywhere on the application, the NSTableView actually receives the tableSelectionDidChange message. This problem doesn’t happen in 10.4, nor did it happen in 10.5.

So how did I actually fix this bug? Believe it or not, I had to use Carbon to click on the Window. It didn’t matter what Cocoa workaround I used, nothing, I mean NOTHING, worked. I used Carbon to get the Rect of the Window, offset my mouse by 2 pixels, clicked the Window without moving the mouse and Viola! the problem was solved.

This is one of those fixes that I am not proud off because it does not feel like clean code. However, it did fix the bug and in the end, that is what matters.

 

“I have nothing to wear”

0

Posted by Jaime | Posted in Not-so-funny | Posted on 25-04-2008

Tags:

I spend too much time on the small details. In this case, it’s the look and feel of my website. I’ve spent way too much time on the WordPress Theme webpage checking out dozens of different themes, downloading them, editing them, zipping them, uploading them, editing them, then deciding I don’t like it.

I haven’t settled on anything yet, so don’t be surprised that every time you come to this site, it might actually look different.

Revisiting Me, My PowerBook and Apple

0

Posted by Jaime | Posted in Funny | Posted on 23-04-2008

Tags: , ,

This is old news, but something I felt compelled to write about anyway.

Last November, for the first time, I packed my bag, my PowerBook and headed over to Apple. 

I was there to attend the a week long Performance Workshop for the product that I work on at Nikon.

Now for those who don’t know, Nikon actually makes software to make your Nikon images look incredible! Now, Nikon cameras take amazing pictures as is, and it’s hard to believe how the picture could look better, but we done it. We can actually make those images look better! Cough, cough, *self-promotion*, I’m talking about Capture NX, cough, cough…

So I was there. At Apple. Where every day is 74 degrees and sunny. To me, this is new and this is nice.

Apple’s cafeteria is also something of a wonder. Not only does it serve every food imaginable, but I even got to enjoy my sushi, sitting next to Steve Jobs! Ha Ha! Talk about a nice trip that gets even better!

Well, that’s enough for now. It took me this long to write about this experience, and hopefully, it won’t take me that long to write about my experience at WWDC 08 when I go there this June! Hooray!