Archive for the ‘Coding’ Category

Google Chrome dev 6.0.437.3 is Out!

Friday, June 18th, 2010

OK, this is a little funny, but I just saw that there's another release of Google Chrome (dev) for the Mac! Amazing. There's nothing new on the release notes, but that's not a total surprise. There seems to be some issues with crashing, but I've honestly not seen a group as big as Google move this fast in a very long time. There must have been something really wrong with the 6.0.437.2 build.

So it goes. I'm glad to know that it's auto-updating just fine now, which is a big relief.

Google Chrome dev 6.0.437.2 is Out

Friday, June 18th, 2010

Interestingly, I read about this and still my 6.0.427.0 didn't see it as an update... so I went to Google's site and got the app directly from them to avoid any possible issues with trojans, etc. In any case, there are a few nice things in this release:

  • Detach Reload from omnibox, combine with Stop, and eliminate Go.
  • Implemented initial version of extension syncing. (Issue with instructions on how to enable)
  • The onChanged event is now working in the extensions experimental cookies API.
  • Faster scrolling on 10.6
  • Fix a bug where menu items would be disabled if no windows were open.

And it's the faster scrolling that interests me most. Good enough. Up to date from the source. I hope this doesn't keep happening, it's a little creepy and I start to suspect someone's gotten into the code.

Getting Close to an Object Graph for Magic School Bus

Thursday, June 17th, 2010

I've been really pounding away at some code that I'm writing to replace big sections of code in the Magic School Bus, and it's getting pretty close. There's a lot to look at when you have to make a class library for a 277,000 line header file. I've built a few classes, but I want to have a really good approach before I bring it to the rest of the Team.

Not bad so far. Pretty decent.

[6/18] UPDATE: having talked to the group, it looks like I'd have more luck getting Microsoft to adopt OS X as it's core for Windows 8 than getting these guys to look at a massive re-write of the codebase. It's almost hopeless. Very bummed.

Attacking a Quarter Million Lines of Code

Wednesday, June 16th, 2010

I'm trying to get a little start on the reformulation of the Magic School Bus project and I've run into the 800 lb. Gorilla in the project - the 277,000 line header file with implementations. It's big, and I need to really attack it because it's the client-facing component of the project, and needs to stay completely unchanged as I go through this redesign so that the several hundred applications that use this in The Shop don't have to be retrofitted with the changes.

This doesn't mean I can't make new and improved interfaces and methods, I just can't change the functional behavior or interface that exists now.

So I'm trying to come up with a way that this quarter million line file can be broken up into real headers and real implementations and once class per pair, at that. Then I'll throw it all into a directory in the project, make a shared library out of it, and it'll be far far easier for folks to use.

Doesn't mean that it's going to be easy to do, just that it's not conceptually hard. Just a lot of work.

My Introduction to the Magic School Bus – Yikes!

Tuesday, June 15th, 2010

Crazy Lemon the Coder

Working on code has to be a continual job. Especially if it's an evolving product. You can't just sit back and assume that once it's written, it's "done". It's not. Certainly, there are shared libraries that get to the "done" state - for components. But for a product where features are being added, sources are being added and removed, it's just next to impossible to believe that something written years ago is still going to be relevant and useful years later. It needs to be looked at, checked, and where necessary, updated.

Case in point today was the codebase for an app I've been asked to work on at The Shop. The functional description of the project is pretty simple - get data from some network feeds - like multicast or direct tcp data feed, and distribute it to 29West in a manner such that it can be subscribed to easily, and then the 29West data feeds terminal processes that decode it and serve it up on tcp to the clients.

It's a pretty simple message router with a pub/sub content. Not trivial, as it needs to be fast, but not conceptually that hard. Certainly, I've worked with some guys that would say that it's a simple receiver that rebroadcasts on 29West in a set of channels and the receivers just get it off 29West. I happen to like that there's a terminal app and clients don't hit the 29West feed directly - it allows the replacement of 29West in the event that it comes to be a problem.

In any case, this codebase is C++, but it's written as a lot of C with structs and a few classes, but very little really good design. There are a lot of odd little things based on the source control method - and it's a horrible source control system. There are more little odd things they put into the project for NetBeans. For C++?

OK, I can see people wanting to use an IDE, but why put the IDE artifacts in the SCM? That doesn't make sense. If you want to see something slightly different than I do, then that's OK, just don't force me to look at it that way, too. I don't understand that at all. But that's not the worst of it.

I can see using C in C++ for speed. But it's really a fool's errand. Face it, once the method call is made form the vtable, the execution of any one method's code is really the "speed of C". The issue some may take is that the using of the vtable is more costly than the jump table of C - and in that, they are right. But the time of using the vtable is only on the call invocation, and not in the execution.

Time-critical sections should be within a method, and not calling methods. So in that, you're going to get the performance you want when you need it, and the convenience and design simplicity of C++ when you need it.

But that's still not the worst I've seen in this project which I'll call The Magic School Bus, no... there is even worse.

I was reading the code, trying to get an understanding of what goes where and how it all works, and I ran into biggie.h... it's currently got 277,695 lines of C/C++ code. Yeah... over a quarter million lines in one header file. It's really next to insane. Because it's got the implementation with it, every single inclusion of this file essentially statically links in all this code. It's crazy.

Now I will say that the code isn't horrible, it's a bunch of messages, and it's decent, but it's not using any subclassing, and I'd sure like to do that. It's not using any really good designs, other than it does have a nice suite of operators built into each of the messages. It needs a serious re-write - but there's the rub: if the comments are right, the code is generated by a perl script.

Amazing to me that they didn't make it a pair of files for each message - if they are generating the code from perl, it'd be easy. Make a header file, make an implementation file, and then make a directory where they all co-exist and build them into a shared library. That's what I'd like to do, but I can't make these kinds of changes to the codebase without really understanding the implications. And the implications of this could be severe.

If the clients to the Magic School Bus are expecting to get the complete functionality by just including the header file, and not linking anything, then they need it to be this grotesque blob. But if we can move them to something better, it'll make the maintenance and support so much nicer.

I'm just hoping that we can make this entire message library a lot cleaner and nicer. There's no reason for a 250,000+ line header file in decent designs.

Coda 1.6.11 is Out

Monday, June 14th, 2010

Coda.jpg

This afternoon I got a tweet from the guys at Panic about a new release of Code 1.6.11 that fixes the problems with Safari 5.0, and imports the favorites from Transmit 4. Unfortunately, soon after seeing this, they pointed out that the Transmit import only works if you had Transmit 3 and paid for it. So still a few wrinkles to work out, but they are getting there. Thankfully, I had Transmit 3 so I'm OK - Whew!

As always, it's great to see them working on great products making them better and better.

C++ XMPP Client Library – gloox

Friday, June 11th, 2010

cplusplus.jpg

It seems that the auditing of a new IRC server at The Shop is too much to think of adding at this point - given that they have an existing XMPP/Jabber system that's up and running and working just fine. So rather than mess with using the IRC stuff I've used in the past, it looks like I'm off into the world of XMPP and Jabber. Thankfully, there seems to be more client libraries than you can shake a stick at. Including C++.

The one I'm looking at initially is called gloox, and looks to be a reasonable well done library, but I haven't even tried to build it - let alone use it. Still, it looks reasonably well defined and designed, and I'll need to get it, read through the code to see how it's commented and built. If it looks good, I'll use it until it doesn't work. I'll be certain to isolate it nicely so that should I need to replace it, it'll be easy enough to do later.

Still... it looks promising and it means that I don't have to hassle with implementing a new chat protocol. But it might have been nice... I'll never know.

Adding Fonts in CentOS 5

Friday, June 11th, 2010

Linux

I was trying to get some decent fonts going in CentOS GNOME, and I followed the obvious steps to get one of my favorites working:

  $ cd
  $ mkdir .fonts
  $ cd .fonts
  $ wget http://www.levien.com/type/myfonts/Inconsolata.otf
  $ cd
  $ fc-cache ~/.fonts

and then verify that the font is properly installed:

  $ fc-list | grep consol
  Inconsolata:style=Medium

but then we need to kill all GNOME Terminal sessions. This was something that I messed with for about 30 mins before I figured it out. You have to drop all the existing terminal sessions - every one, and then when you start it up, you'll be able to see the new font.

Holy Cow! That was an enormous pain in the rump to figure out. But hey, now that I have it, I know it, and we're not going to be bitten by it again.

Adobe Flash Player 10.1.53.64 is Out

Friday, June 11th, 2010

There have been a few widely publicized security holes in Flash in the last week, and it seems Adobe has responded to them with a new version of the player. Good enough. This one is still not the guy that uses the hardware acceleration on the Mac, but that's coming, and soon enough it'll be a decent player for the Mac. For now, I can rest a little easy knowing that it's at least not a security risk. That's something.

PostgreSQL 9.0 beta 2 is Out – Very Cool Stuff

Thursday, June 10th, 2010

PostgreSQL.jpg

This morning I read this on Slashdot about the new features coming in PostgreSQL 9.0. I have to say, it's really quite impressive. I remember when I was researching an open source database for the work I was starting to do at First Chicago, and still think I made the right decision all these years later. It's just an amazing database.

The features it has, and the comparisons it's making - to say it's more like Oracle and beats SQL Server 2003/2008 is pretty darn impressive. I have to say that I'm glad The Shop is using it as an alternative to either of these - it's just a nice tool to work with.

I'll have to wait and see when KyngChaos gets the build up for Mac OS X that I've taken to using. It's a good package he's putting together.