Archive for August, 2008

Using CVS with Xcode 3.1 on Leopard

Thursday, August 7th, 2008

xcode.jpg

One of the things that has historically been a problem with NeXTSTEP/OPENSTEP and now Mac OS X development projects and source control is the fact that on all the operating systems, the bundle concept exists and complicates CVS considerably. The bundle is nothing more than a directory that's treated as a single entity. The app, the nib, the rtfd... all these are really directories on the filesystem and yet the OS thinks of them as single, indivisible entities. So when CVS goes to make a CVS directory in one of these bundles, and then the tool (such as InterfaceBuilder) saves a change, it overwrites the entire directory - destroying the CVS directory within the bundle.

With the recent editions of Xcode (from the old ProjectBuilder) the source code control has been built-in. However, I've been very gun-shy to use it for fear of not getting anything done because of these issues. So it was a very anxious time for me today when I tried to get my first Xcode 3.1 project put into my home repository.

Since the repository was already created, and running on Mac OS X 10.4 (Tiger), I thought if it were going to work at all it should work in this environment. So I did a little Googling on this and found a page that walks through this for Subversion, but not CVS. I figured that if I backed everything up, I'd be set. So I dove in.

Configuring Xcode for Your Repository

The first thing to do is to have a repository, since I had one, and it was already running on a pserver I'd set up ages ago, it seemed like I should be set to go. What confused me for a little bit was the fact that Xcode was going to allow me to configure the root of the repository and therefore view all the projects I've placed in that repository. Very nice. In order to get there, however, you need to tell Xcode how to connect to your repository.

Select SCM -> Configure SCM Repositories and then click the '+' button at the bottom of the list to add a new repository. Once you give it a name and a type, you'll get an appropriate dialog box where you can enter all the data for the repository Xcode will need. As a nice little bonus, as you fill in the components, Xcode builds up the CVSROOT (for those that are familiar with this, it's a real lifeline) and so you can see each component going into the CVSROOT as you enter it into the dialog. When it's all filled out, Xcode will automatically verify the connectivity (another amazing piece of work) and then you can click "OK" to save everything.

At this point you have the repository configured with Xcode. Now you can look at it by selecting SCM -> Repositories and then the one you just added will be on the left and it's contents in the finder-like view on the right. You can look at everything you've already put into your repository (for those of us that used existing repositories, this is really a place to give a wonderful sigh of relief.)

Xcode Preferences

Import Your Project

Once you have a project ready to import, simply select where you want the root of your new project to sit, and click on the Import icon in the Repositories window. Xcode will then ask you what to import - navigate to the root of the project directory and give it a nice comment. Xcode will indicate in the bottom pane of the Repositories window what's happening and in a few minutes, you're all imported.

Repositories

Check-Out Your Project

As with all other CVS imports, save the old project file by renaming it, or tar-ing it up and saving it off someplace, and then from the Repositories window select the project you just imported and click on the Check Out button. Xcode will ask you where to put this, and you can navigate to the directory you want it to be placed. Click 'OK' and Xcode will do the checkout. As a wonderful feature, it's going to ask you to open the project in Xcode when it's done. Say 'Yes', as we need to do one last thing before we're done.

Enable SCM on Your Project

Now you need to navigate in the 'Groups and Files' list to the name of the project (typically the first thing in the list) and then click on Info to pull up the main project info window. Navigate to the 'General' panel and then at the bottom choose the repository from the SCM list and you'll notice the GUI shifts a bit to place the CVS status next to each file. At this point, you're ready to go. The SCM menu is now greatly expanded and using SCM in Xcode is very simple.

Project 201CPotentials201D Info

You can do diffs... additions... moves... all the things you'd normally do, and with CVS, Xcode is smart enough not to blow away the directories of the bundles and so things get versioned properly. It was easy... but very nerve racking for my first time since the old days. In the future, I'll tell people to do it earlier. Much earlier.

The Premature Demise of the News Groups – Not

Thursday, August 7th, 2008

blogs.jpg

There has been stories of late talking about the possible end of USENET and the newsgroups based on the fact that certain states are asking ISPs to block large blocks of the binary newsgroups because of the concern of kiddie porn. Now far be it from me to advocate kiddie porn, but there's got to be a limit to the assumption of guilt as opposed to having it proven beyond a reasonable doubt. That is, after all, what we're all about, right?

In An American President, in one of the most eloquent speeches written, the President says:

You want free speech? Let's see you acknowledge a man whose words make your blood boil, who's standing center stage and advocating at the top of his lungs that which you would spend a lifetime opposing at the top of yours.

You want to claim this land as the land of the free? Then the symbol of your country can't just be a flag; the symbol also has to be one of its citizens exercising his right to burn that flag in protest. Show me that, defend that, celebrate that in your classrooms. Then, you can stand up and sing about the "land of the free"

To me, the best our country is about is captured in those paragraphs. Sure, we've got liberty, but the best part about it is that I'm free from you imposing yourself on me. Majority rules, minority is heard.

Then someone decides that people are doing something wrong and they need to be stopped. Hey, I've got an idea... enforce the laws already on the books. When bank robbers moved from six-shooters to computers the FBI didn't need any new laws to catch them. They got smart and caught them. Period.

Don't take away the newsgroups because some one decides to use them illegally. Stop him (or her). Don't take something away from me. Don't ask to make your job easier at the expense of my freedoms. Lock the bad guys up, and leave the newsgroups alone.

Looking at IRC Servers on Linux

Thursday, August 7th, 2008

chat.jpg

Because the chat infrastructure team seems to be unable to get their issues resolved about the MindAlign bots, and because I can't really honestly say that the bots I need are business critical, I've started looking for IRC servers that I can start up on my own, point all my servers at, and then simply have my own IRC system. The load is trivial, and with this, I'd be able to get things done, but there's always the risk of being tagged as a rogue chatter.

Given that it's been two weeks, and there's no accommodations being made for important but not critical bots, I'm thinking that even if I get nailed (and that's not a guarantee by any means) that my excuse is exactly that - two weeks, no communication, and no alternatives. Sounds good to me, anyway.

So I've been looking at the IRC servers, and it seems like IRCD-Hybrid is a decent tool, and the history of it leads me to believe that it's really different only in the very 'far out' IRC issues - things I'm not liable to hit ever. I just need a basic communication hub, and for that, this should do just fine.

I'll get it, build it and see if I can get it going on a box of mine. If I can, then good enough and I'll try running it there for a while. I'll convert a few processes over and then see how that flies for a few days. If all looks OK, I'll convert over simply to await the day that the MindAlign guys get things worked out.

UPDATE: so I got the code and configured it by reading every single line. And boy, oh boy... you have to read every single line as there's a line in the config file that will crash the server intentionally if left in the config file. So, read and configure.

The big change was that the default IRCD-hybrid 7.2.3 does not allow for NICK names to start with an underscore (_). Since all the bots for MindAlign have to start with that, I needed to get into the code and fix it. The relavent code snippit was originally:

  1. int
  2. valid_username(const char *username)
  3. {
  4. int dots = 0;
  5. const char *p = username;
  6.  
  7. assert(p != NULL);
  8.  
  9. if ('~' == *p)
  10. ++p;
  11.  
  12. /* reject usernames that don't start with an alphanum
  13.   * i.e. reject jokers who have '-@somehost' or '.@somehost'
  14.   * or "-hi-@somehost", "h-----@somehost" would still be accepted.
  15.   */
  16. if (!IsAlNum(*p))
  17. return 0;
  18.  
  19. while (*++p)
  20. {

and needed to be changed to:

  1. int
  2. valid_username(const char *username)
  3. {
  4. int dots = 0;
  5. const char *p = username;
  6.  
  7. assert(p != NULL);
  8.  
  9. if ('~' == *p)
  10. ++p;
  11.  
  12. /* reject usernames that don't start with an alphanum
  13.   * i.e. reject jokers who have '-@somehost' or '.@somehost'
  14.   * or "-hi-@somehost", "h-----@somehost" would still be accepted.
  15.   */
  16. if (!(IsAlNum(*p) || ('_' == *p)))
  17. return 0;
  18.  
  19. while (*++p)
  20. {

After this change, a simple recompile, and the bots were working great. This would be a nice change to the codebase to put this in the config file, but I can see that this is probably pretty stable, and so they might not want to mess with it.

In any case, I'm set now with my own IRC server for my apps. If they come after me, I have a solid defense - it's for the best for the business.

Interesting Drawing App – Scribbles v1.2.2

Thursday, August 7th, 2008

Scribbles.jpg

I came across an interesting drawing app today on VersionTracker... it's called Scribbles and has an incredibly simplistic user interface, but at the same time, when I look at it, I can see a lot of utility in that program. Very interesting.

It's not Photoshop, and it's not a vector-based drawing app like DrawIt. It's more pixel-focused than that. It's got layers implemented very cleverly in the GUI, and yet the tools selection is purposefully simplistic. It's almost like you should be using it to... well... scribble. Little doodles - not mechanical drawings or fully rendered images. Just scribbles.

I've got Acorn for a lot of my image work, but it's more my Photoshop Elements replacement (even though I have PE as well). I use Acorn far more than any other graphics app, but there's still a place for something more, and I'm looking at Scribbles and thinking this is that something else.

Hard to say for sure now, but I'm going to register it and play with it a little. Can't hurt. It's certainly something to look at for a completely different, yet completely usable, GUI on the Mac. Very nice.

The Amazing Power of Music – iTunes is Amazing

Wednesday, August 6th, 2008

iTunes.jpg

It's been a rough couple of days, as recent posts will attest. Plain and simple, it's been bad. But this morning I turned on my iPod and started listening to some of my music, and things started to seem not so horrible. It's an amazing thing with music - though I'm sure some research has been done to map the pleasure centers of the brain activated by music, I just know I feel a lot better when I listen to nice music.

I used to be a straight album (CD) guy - start an album listen to the whole thing. It's a carry over from the days when that's how music was delivered and that's how you played it. But a few years ago a good friend really got me into the playlist capability of iTunes, and it not only allowed me to stitch together my multi-album sets into complete 'volumes', it took a while but I started to really mix up the music and make real playlists.

Took a while, but what a difference. I used to run iTunes only when I need to rip a CD (I always bought CDs) - now it's running all the time pulling in podcasts and holding music, apps, and movies. Amazing.

While I never would have guessed it, this has really changed my ability to work in hostile environments. A little music can really fend off the gloom, and given the level of gloom I'm in, I need all the help I can get.

Like the Battle of Britain – Only Worse

Tuesday, August 5th, 2008

SwissJupiter.jpg

Never have so many suffered so much based on a single product selected by so few

My respects to Mr. Churchill, but had he been a developer today, he might say the same thing about a product I'm working with. It's become meeting madness, where it's common to have one, two or even three meetings a day on this single product that was supposed to simplify things here. Instead, it's making things far more complex than ever before.

Let's not even get into the fact that users are saying we're not supporting it to the same level of service that they have come to expect with other applications we've delivered. Ignore that people in the trenches have been saying that there needs to be significant staffing increases in order to get this product rolled-out and supported properly. Forget this stuff.

Just focus on the humanity.

It's horrific. People are beaten down. They are lifeless. They have given up hope. There's no motivation coming from the top... no sense that this is the good fight... it's just like trench warfare. Never ending. Depressing.

Someday this might work. I don't know anymore. Right now, I just want it to end.

New iPod Touch Software v2.0.1

Tuesday, August 5th, 2008

iPodTouch.jpg

While I wasn't really unhappy with the v2.0 upgrade to my iPod Touch, I did realize that a lot of the original iPhone owners were saying that it was very slow, bug-ridden, and in general, a significant downgrade. So I was very interested in seeing what I'd find when I got the update.

One of the the things that really surprised me in the v2.0 update was the time. It probably took more than an hour to update my 32GB iPod Touch. I was stunned. Thankfully, one of the nice things I'd heard about this v2.0.1 update was that it was supposed to have a faster back-up functionality. Sure enough, it was significantly faster in this update than in the v2.0 update.

There are supposed to be a lot of fixes and improvements, but I'm guessing they aren't in the functions I've been using, as I didn't see a major issue with the old release. But it's nice to have something that loads apps faster, and fixes all these issues that the iPhone users have been complaining about.

Someone’s Got a Case of the Mondays

Monday, August 4th, 2008

cubeLifeView.gif

That wonderful line from Office Space really hit home today. I have spent a lot of time with specs and documentation and very little time really coding or doing something useful. It's a lot of paper-pushing and very little meaty stuff to make the day pass quickly.

Consequently, I'm ready to get out of here and just enjoy the evening. I know it's in the middle of a (relative) heat wave - it's 90+ and very high humidity, but it's August in the MidWest - what can you honestly expect? This is what it's like here, and I've no interest in leaving. Misery loves company.

I'm hoping that tomorrow is going to be a day where I actually do more than I read or write. It's just that I'm feeling very managerial and if I wanted to do that, I'd have stayed in my previous job(s)... I'm here because I want to keep doing, but that doing is getting harder to find here. Sad to say.

Maybe things will pick up and there will be something that I have to dig into that takes half a day tomorrow - that would be sweet. Sounds odd, I know, but I really do hate the paper-pushing.

One Nice Advantage of CVS over Subversion

Monday, August 4th, 2008

cvs.gif

This morning I was putting in a few changes to a project I was working on and one of the nice features of CVS over Subversion really hit me - CVS allows you to check-in part of your workarea by specifying the files you wish checked in. This is really the core of Subversion - that the entire workarea is a single check-in unit, but what happens if you're in the middle of changes for something and you need to checkin some changes to another totally unrelated part of the code.

Subversion would have to branch or checkout a new workarea, add in only those things that you can checkin at this time, check them in, and then go back to the original workarea and update that to merge in the changes.

That doesn't sound too bad, but it's nice to have several changes in CVS and check in just those that you know are safe for the repository, and then keep working on the others. I know it's part of the "problem" with CVS, but I see it as a genuine feature. I use it all the time.

In fact, the number of times that I checkin everything in CVS is so few as to be considered "rare" - less than 5% of the time. The vast majority of checkins are checking in a few files with a directed comment in the logs, and then repeating as necessary.

So while I like the Subversion feature of keeping a pristine copy of the workarea in the workarea, it's got an offsetting feature in the targeted checkin. At least for me.

[8/5/08] UPDATE: I was talking to a friend today and he mentioned that you could checkin individual files. But I looked at the PDF again that comes from the Subversion project and it doesn't mentioned this at all. I'm stunned that they didn't mentioned this in the docs from the project. It's one thing that really was turning me away from Subversion. Now I can relax and move back towards it as necessary. Wild.

Solving a Problem and Upgrading All at Once – Sweet

Saturday, August 2nd, 2008

NetgearWNR3500.jpg

At home we've been having a real issue with Comcast where the speed was so unreliable that it became almost unusable. Huge pain in the rear. So we've gone through the Comcast angle and on Friday they came out and swapped out the cable modem and when Liza connected her machine directly to the cable modem it was fast, but after going through all the network in the house, it was slow. So it was clear that I had another issue to clear up.

All my tests in the house were showing me that the network wasn't the problem. Everything was fast, all tests showed things were just fine until I wanted to leave the house - then things got hit-or-miss. While I was doing some of these tests in my office I noticed that the LinkSys router's network port and the LinkSys 16-port 10/100 hub's network port were going offline and then back online. The router has only 4 ports, and I need the 16 for all the things in the office. But this was the first clue that there was something else going on.

My next test was to get on a machine on the hub and ping a machine on the router. When I did that and let it run, I could see that packets were getting dropped. HA! I was onto something. There seemed to be intermittent connectivity issue with the router and hub so off to BestBuy to see if they had what I needed. Thankfully, they did.

I picked up the NetGear WNR3500 wireless-N router and gigabit 4-port switch. I decided that while I was replacing the hardware, let's go gigabit and get a good wireless-N access point in the bargain. I also picked up a Netgear 16-port gigabit switch to replace the 16-port 10/100 hub, should that be the problem. Thankfully, it was just the router and when I got the new guy in and configured I saw marked speed improvements right away.

What a relief! I had enough evidence to think it was one of the two, but I'm glad it was the first one to replace and it means I can take my time replacing the other just to get to gigabit wired network speeds in my office. Nice upgrade, but getting a functional link to the cable modem was essential.