Archive for the 'Writing' Category

Formatting Objective-C code with the HTML code tag

You might have noticed, especially given the last post, that the code formatting on this blog leaves much to be desired. I’m trying to rectify that, but I’m not quite sure how to do it.

I’ve always assumed that when presenting code, I should use the the <code> tag. Unfortunately, the default formatting of this tag is indeterminate at best. From trial and error I’ve determined that it’s usually best to put each line of code in its own set of <code></code> tags, otherwise formatting gets really wonked. I’ve also found, depending on the CSS, I might have to put a <br> after each line of code, otherwise my nice, pretty function all ends up on one line.

And this completely ignores indented code. There seem to be a couple of ways to making indentation work. The first is to use the white-space: pre; CSS rule and make sure the tab characters are in the <code> tags. The second is to use the text-indent CSS attribute for each line of code I want to indent.

None of these options are easy or simple, which makes me think I’m doing something wrong. Are there are any web designers/HTML coders in the audience that know the proper way of doing this? Surely it’s not intended to be this painful.

The problem with formatting code on this blog has led me to the conclusion that I’m probably going to have to ditch my current WordPress theme. Sure it’s pretty, but it does float: right on my images with a rule that has high specificity, making it very difficult to not float my images to the right, which is what I usually want. It also has a fixed width, which doesn’t really mix well with my code examples, not to mention it doesn’t style the <code> tags well.

Unfortunately I haven’t been able to to find an appropriate WordPress theme that will fit my needs. I’d really like a two column layout, with a fluid width, and, if it’s not too much to ask, decent <code> tag handling.

Not dead (yet)

I just noticed that I haven’t posted in a very long time. I blame the move.

I had to visit the Bay Area twice before I found any place that was worth having. Not a great place, but I was really pressed for time and it had the least number of things wrong with it. I get to pay over twice what the same apartment would cost in Dallas for the privilege of being in great state of California. For a place that’s famous for people claiming you can’t own property, property sure does cost a lot there.

Anyway, with all the running around and whatnot, there hasn’t been that much time to blog. Now that I’m back in Dallas I have to finalize all the move details within the next two weeks, after which the movers arrive and move all my junk to an undisclosed, but highly expensive, location. It is doing wonders for my stress level. It’s a good thing I only move across the country every two years.

This is coupled with a new contract that finally started after literally two months of negotiation. The problem was the client’s lawyers got involved. In small companies, the client’s lawyers are on the same side as their client, because they’re not in-house and can be let go easily. In large companies, the lawyers are on neither our side nor the side of the client. Their side is the side in which nothing happens, therefore they cannot be blamed for it. Anyway, the contract is a week old and already a month behind. It’s gonna be fun, I can tell.

All this is to say I’m not going to posting for a while. At least until all this stupid move stuff calms down, which will probably won’t be until mid-April or so.

P.S. Is there anyone in the Dallas area who would like to buy a full size washer and dryer? I’ll sell them on cheap. It is apparently illegal in California to own such things. Some people smuggle in those stackable mini washer-dryer units that have the capacity of a small salad bowl, which is what the owner of the “condo” I’m renting has done.

Links from the other side

This past Sunday night I decided that I should check to see how traffic to the ‘ol site was doing. I had been neglecting monitoring the site for a while because, well, I was busy on Wombat, and because traffic was predictable. I knew pretty much who had already linked to me, and how much traffic that typically brought in.

Sunday nights are usually slow. But not this one. There was definitely a growth in traffic, and it appeared to be coming from Cocoa Dev Central. hmmm… that’s odd. Why would anyone over there link to me? Using my powerful investigative and deductive skills, I uncovered this (it was on the front page):

Cocoa Dev Central

Oh my.

I have to admit my first reaction was: Why did they link to me? I mean, they should be linking to Wil Shipley or Daniel Jalkut, who actually write about Cocoa regularly, and have a great deal more experience with it than me. Don’t get me wrong, I was happy to see the link, but I was worried that people would assume I was some sort of Cocoa master, or that I only wrote about Cocoa.

After a while I began to relax and realize that all the other blogs cover somewhat diverse topics as well, and that I had been covering Cocoa recently, in the form of Core Data. So I calmed down. Calm. Calm is good.

Then came today. I’m not sure if it was because Scott Stevenson announced the redesign of Cocoa Dev Central on his site or what, but I got an even bigger spike in traffic. Scott’s post also confirmed my suspicion that he was the one running Cocoa Dev Central. So, thank you Scott. I really appreciate the link.

I’m still in shock that I’m on the same list that includes Wil Shipley and John “Wolf” Rentzsch. Hopefully they’re not too offended about the whole thing.

I should also point out the other new addition to the Cocoa Dev Central blog roll: Cocoa Samurai by Colin Wheeler. He appears to be just as surprised as I am, albeit a bit more on topic with the whole Cocoa thing.