Using regex to replace a path

February 8th, 2010

This is for me, not you, a reference for me. So if you are wondering why I wrote this… it’s because it’s for me.

Here is a regex string I used in TextWrangler to search and replace paths in a Xcode project file… you know, the one that is inside the .xcodeproj bundle…

Search string:
\.\./\.\./development/.+/mac/macos_10\.4/dylib/

Replace with:
Whatever you like…

Jaime Coding ,

Aaaagh!

February 8th, 2010

Oh, and if that wasn’t enough….

Jaime Funny

What’s gonna work?

February 7th, 2010

My son used to love the TV show, “The Wonder Pets”. In that show they have a recurring theme and a song to go along with it: “What’s gonna work… team-work!”.

Now for those who are new here, or who don’t already know, I work in software development. These days, almost all types of development require some form of team work, except for the poor guys who used to work at 3D Realms that were expected to code like they were living in the 90’s.

Splitting work between team members who have the same skill set is an difficult task. The reason being is that most developers tend to have a different style of programming between one another. So when one developer encounters another developers code, they may break “Rule 0″ from the “C++ Coding Standards : Rules, Guidelines, and Best Practices” book, written by Herb Shutter and Andrei Alexandrescu.

Rule 0: Don’t sweat the small stuff
Wow! This rule is so simple… so powerful… So, why is it so hard to live by?

My guess is that for many developers perusing through code, the setup and layout of the code makes it easy, or hard, to read. So, if you are used to prefixing your pointer variables with a lower-case p and someone on your team is using plain words to describe the variable, I can understand how it hurts trying to read someone else’s code that may or may not jive with your brain. Comfy code formatting is like the cozy blue blanket for developers… Stop sucking your thumb!

Dev’ies are willing to spend the time, and shamefully submit code, that is may only be different by a couple of spaces or tabs. I will admit that I have broken this rule myself… with a big grin on my face while I’m committing such offense, but in the few cases where I have done this, it has been with code that has had it’s ownership transferred to me and I have authoritative rights to do with it as I please :) So there!

Now back to team-work…

Working with other team members can be tough since it means we have to give up a part of ourselves to work with others and sometimes compromise our workflow so that everyone is happy and that no one feels negated.

Likewise, the ‘OTHERS’ have to give a little to receive a little… but remember that they can’t read your mind, so, you too have to let them know how you feel and respectfully tell them your ideas. I’m not suggesting that you have a Jerry Springer like meeting where people show how they feel deep down inside when you altered their code or comments and start flinging chairs at each other. Save that for TV where you can get paid for doing that!

I’m suggesting that if something doesn’t jive, let your team know, but think before you speak… Ask yourself, was there a good reason that developer took out your code or changed your comments or decided to change the spacing? You may be surprised with the answer. And if the answer is in violation of Rule 0, then smack them over the head with official “Offenses to Coding” baseball bat! It’s both fun and theraputic ;)

Till next time, happy batting… I mean… Happy Coding!

Jaime Coding, What's New

I like this!

January 14th, 2010

I found this on the www.thefirearmblog.com website and I like it!

Jaime What's New ,

Sniffing paint primer

January 13th, 2010

I’m battling the smell of paint primer. My guest room is getting redone and the walls have just been treated with primer, making my whole house smell.

So, I wanted to spend a few minutes browsing some of my favorite sites. Something I haven’t done in 8 months being inundated with C++ work.

So, I figure that I can only handle maybe 20 minutes of this smell before I get too sick, being that my office is right next to the room that is getting worked on.

Well, guess what. I just discovered today, that stepwise.com is down. Where have I been? I felt sad. I actually liked that site, and now, it’s gone.

Goodbye stepwise.com. I loved you like a distant relative.

Jaime Not-so-funny ,

iPodRip

November 23rd, 2009

I came across this article about iPodRip, where the owner of the company actually sent a passionate letter directly to Steve Jobs. To my surprise, Steve actually replied; read more about it here

Jaime Not-so-funny ,

“If the comments are ugly, the code is ugly”

November 17th, 2009

I read this and said to myself, this is so true.

Thinking about this, if you don’t take the time to think about the comments, there is a good chance that the code below/next to/above the comments wasn’t well thought out either.

Jaime Coding , , ,

Talking about funny videos….

November 11th, 2009

Now this one is priceless, especially for all of you tech people out there:

Jaime Funny ,

Funniest Video Ever

November 11th, 2009

I could not believe how funny this video is, especially 2:30 minutes into the video when the Prairie dog appears:

Jaime Funny, Not-so-funny , ,

Xcode and static libs

October 19th, 2009

I’m writing this blog entry just in case other people come across the same problem and can’t seem to figure out what’s going on.

I found it in Xcode 2.5 that hasn’t been fixed in the latest version of Xcode that I have, version 3.1.3.

The bug I’m referring to is when you create a target as a static lib output, then you change the target later to output a dylib. The problem is that everything looks fine… heck, it even puts a dylib in the file name extension, but the file is actually a static library.

You have to go to Terminal.app and use the file command to see that the file is in fact, a static lib and not a dylib. You may not notice the problem at first until you go to debug the project and notice some weirdness.

Hopefully, you haven’t gotten bit by this problem, but if you have, the only solution I found was to create a new target from scratch.

Jaime Coding, Not-so-funny , , , , ,