Archive for the ‘Open Source Software’ Category

Google Chrome dev 16.0.912.4 is Out

Friday, October 21st, 2011

This morning I saw that Google Chrome dev 16.0.912.4 was out, and includes the new V8 engine 3.6.6.5 as well as quite a few nice Mac improvements including OpenGL. It's getting faster on the redraw, that's for sure, so I'm happy about that. Keep them coming, guys!

Finally Found Colloquy Developers on FreeNode

Thursday, October 20th, 2011

Colloquy.jpg

Today I finally found the Colloquy developers on FreeNode (IRC) because I wanted to start working on getting the latest Growl 1.3 working with Colloquy. I've spent a little of the last several days looking at the other Mac OS X IRC clients, and while there are a few that look OK, there's nothing that's as well-targeted for my needs as Colloquy. I looked at Textual IRC Client, and while it was reasonably minimal, it didn't have the configurability in the themes to make it really what I wanted. Basically, I want a small but readable IRC window that I can have up all the time to monitor all the development group chats that I monitor as part of what I consider to be "important to my life in the trenches". So if I can't change the font, or vertical spacing, it's possible that the client isn't going to be something I'm really interested in.

Thankfully, Textual IRC Client is available as a trial download, so I was able to try it without having to buy it on the Mac App Store. The same goes for the other one I seriously looked at - Linkinus. I have to say that this was a little closer to my liking, but again, there's no way for me to make a theme for it, and if that were the case, I'd have bought it.

It's got all I need - and to be fair, Textual IRC Client had most of what I needed, but in both, it's the visual representation that fell short. Neither seemed to have the ability to configure the theme to the level I wanted to get a view that would fit into what I had with Colloquy.

Growl 1.3

After all, the only real problem with Colloquy is the Growl 1.3 integration. Also, it seems that the updates for Colloquy have been few and far between, and with Lion, there are a lot of new features that probably need to be addressed. But on the whole, it's not a lot of changes.

So I set out to find the developers of Colloquy and see if I could get the code and work in the Growl 1.3 support. What I found was that Colloquy (#colloquy) and Growl (#growl) are on FreeNode, and that one of the Colloquy developers has already integrated the Growl 1.3 beta Framework, and he's just waiting for the Framework to be released. Wow. Sweet deal! This really help, as all I have to do is watch the chats for the release of the Growl 1.3 Framework and then the Colloquy guys will drop a new version, and I'll have everything I need.

Great news. Can't wait for the new releases.

Google Chrome dev 16.0.904.0 is Out

Tuesday, October 11th, 2011

This morning I saw that Google Chrome dev 16.0.904.0 was out, and there were not a boatload of happy folks about it. Seems there's a recurring theme of not working with twitter.com, and there's a good number of folks that are plenty miffed about it. They changed quite a few things, and it riled the masses. So it goes, hopefully, they'll have it figured out soon.

OK, PostgreSQL 9.1 is just COOL!

Monday, October 10th, 2011

PostgreSQL.jpg

OK, so I ran into what I thought was a bug in a user-defined PostgreSQL function regarding the holiday date for today. It's a Bank Holiday, but it's not a Market Holiday. I was able to prove this and fix it (temporarily) by changing the status of today's date:

  UPDATE calendar
  SET bank_holiday=TRUE
  WHERE calendar_date='2011-10-10';

and then the function I was counting on for telling me if today is a holiday started working.

So I knew the problem. But how to fix it? Well… it wasn't clear from the psql command-line how to do just that. I did a lot of googling to try and find out how to list functions, create functions, etc., and in the end, as luck would have it, PostgreSQL itself had the answer: \ef get_market_hours_for_date

The format is 'e' for edit, and 'f' for function, and then the name. If you just have the '\e', then it pops out into your EDITOR of choice for the last SQL command that was executed. If you give it the 'f' and a name, it'll pop you into your EDITOR and then let you edit the function.

Very nice!

These are the kinds of tools I'd expect from a commercial vendor, but I suppose, this is also what I'd want if I were working on PostgreSQL databases all day. I'm just really surprised and happy that these developers are thinking along the same lines. It's a great feeling to use such a fantastic database for my work - Mac and linux. It's nice to see the progress in time as well. It's really coming along.

Google Chrome dev 16.0.899.0 is Out

Tuesday, October 4th, 2011

They're at it again… Google Chrome dev 16.0.899.0 has been released and looks to have several nice improvements - including updating the V8 javascript engine to 3.6.4.1. It's nice to see that it's as responsive as recent builds, for there were a few in there that had issues, shall we say. Good to see progress.

Cool Sequence Diagram Web Site

Thursday, September 29th, 2011

This is another of those really neat web-based tools for documenting your code: websequencediagrams.com. What a cool tool! This guy allows you to type in your transition diagram and then it'll render it for you in many different styles - including a very nice looking hand-drawn style. This is perfect for those times you need to whip up a simple sequence diagram and don't feel like all the mess and fuss of something like Visio.

Take a look. Pretty sweet.

Cool Little ASCII Flow Charting Web Site

Thursday, September 29th, 2011

I saw on the ZeroMQ mailing list this morning a slick little web site, asciiflow.com, that allows you to easily draw ASCII flowcharts and then grab them for text documents. It's nothing that you can't do with vi or any other editor, and it's not as nice as Visio, or something like that, but it's nice for those times that you need an ASCII-art representation due to the document requirements you have.

It's interesting. Worth remembering.

Interesting Performance of snprintf() on Linux

Friday, September 23rd, 2011

Speed

I was trying to speed up the conversion of floating point numbers to integers today, and I came across some really interesting data. My initial code was very straight forward: I'd multiply the double by 1000, make it an integer, snprintf() it, and then look at the last character to see if it's a '0' - if it is, I remove it, if not, I keep it. Then I place the decimal point where I know it needs to be.

The code is simple, and not very creative at all:

  char      buff[16];
  bzero(buff, 16);
  snprintf(buff, 15, "%d", (uint32_t)(value * 1000));
  size_t  len = strlen(buff);
  size_t  lm1 = len - 1;
  size_t  lm2 = len - 2;
  size_t  lm3 = len - 3;
  if (buff[len] != '0') {
    buff[len] = buff[lm1];
  }
  buff[lm1] = buff[lm2];
  buff[lm2] = buff[lm3];
  buff[lm3] = '.';

This runs, and while it's not perfect, it's pretty fast. It's certainly faster because I precompute the index values, but that's just smart work. What I found was that using pointers and not doing the references really isn't any faster than using the references.

Then I looked up fast C++ integer to string and saw what a was out there. One guy wrote about this amazingly fast system he had written, so I gave it a look. What was interesting to me was the second place in the speed race was won by an STL string method that built up the number in reverse order by dividing by 10 and then doing a modulo on each digit, and finally reversing it.

So I tried it.

Not even close to the snprintf() version I had.

His results could have been for an older version of the compiler, or something, but I didn't see snprintf() as slow -- in fact, it was faster than anything else I tried. Amazing.

You just have to trust the compiler, and the OS. It'll get you there most of the time.

Upgrading to PostgreSQL 9.1.0 from KyngChaos

Friday, September 23rd, 2011

PostgreSQL.jpg

I have been a big fan of the KyngChaos builds of PostgreSQL for quite a while. After Marc L. stopped posting his, it made sense to find another source, and while I've heard that Apple's Mac OS X Lion Server has PostgreSQL as opposed to MySQL which it had in Snow Leopard, I haven't seen a lot about this part of Lion Server, and I'm consequently a little nervous about getting Server on my laptop and not being happy with the burden it places on my box. If I had a nice Mac Pro, I'd get it - but that's not (yet) the case.

So here's what I noticed in the update from PostgreSQL 8 to 9.0.4, and on Mac OS X Lion. There's a lot of little things, and it made for a somewhat hybrid scheme that I'm going to try and get rid of today with the upgrade to PostgreSQL 9.1.

First off, Mac OS X 10.7 has psql on it already. It's got a complete PostgreSQL client in it. It happens to be 9.0.4, which is nice, as that matched the version I was targeting. Given that, it's only the server I need to install. Not bad, but it's all a package anyway, so no big deal.

Secondly, in 10.7, the PostgreSQL user is _postgres and it's not a user that can login. This means that a lot of the update schemes that I used to use don't work because you can't log in as the postgres user any more. However, there seems to be a better scheme - assuming you're migrating from a recent version. The update procedures are detailed in a file in the disk image you download from the site, but I haven't been able to get it to work. I'll try on the next update again, but this dump-and-load works really well for me and does not require that we have a postgres user to log in as.

Step 1 - we need to get a complete dump of the database. It's pretty easy, just get to anyplace you can write a file - I used my home directory, and issue the following command as yourself:

    /usr/local/pgsql/bin/pg_dumpall -U _postgres -o > pgbackup

Step 2 - stop (unload) the existing version of PostgreSQL. This is going to shut it down, but it's possible to pull it back if you need to:

    sudo launchctl unload \
      /Library/LaunchDaemons/org.postgresql.postgres.plist

Step 3 - install the new PostgreSQL package from the site. I noticed that I had to install it twice in order to get the contents of the /usr/local/pgsql-9.1/data directory, so if you don't get that, then install it again, and it should get installed properly.

Step 4 - start the new version. The launch daemon file should be installed properly and you should be good to go, but it never hurts to check:

    sudo launchctl load \
      /Library/LaunchDaemons/org.postgresql.postgres.plist
    ps -ef | grep post
      …lots of postmaster processes listed...

Step 5 - reload your database. Be in the same place as Step 1 and you can simply issue:

    /usr/local/pgsql/bin/psql -U _postgres -d template1 \
      -f /full/path/to/pgbackup

Check with psql and maybe a simple PHP script, and you should be good to go. Once it's all OK and running, you can remove the old install:

    sudo rm -rf /usr/local/pgsql-9.0

At the same time, if you have the old postgres user still installed, you can delete him as well - there's nothing you need from him any longer. Lion's _postgres user can handle all the chores from here quite nicely.

If you run into problems, check the permissions on the directories. Because I was switching from the postgres user to the _postgres user, I needed to make the old install usable by the new user:

    sudo chown -R _postgres:_postgres /usr/local/pgsql-9.0/data
    sudo chown -R _postgres:admin /usr/local/pgsql-9.0/var

PostgreSQL 9.1 has a ton of interesting features. I'm using the replication at The Shop, and it's working like a charm. I'm a big fan, and these updates are really exciting to see.

Google Chrome dev 16.0.889.0 is Out

Friday, September 23rd, 2011

Google Chrome

Seems the posts were right, Google Chrome dev 16.0.889.0 was released this morning and I picked it up. I had suspected that they'd move a major version number soon, but as I've known for a long time, it's the third number in the version that really matters, and it'll be interesting to see what happens when it tops 1000 - will they move up the next number or not? I'm guessing they're a bunch of engineers, and because of that, they'll have numbers like 20.0.1011.0… we'll have to see. For now, it's nice to see that they have updated the V8 javascript engine and done more with the Mac port.