Archive for the ‘Coding’ Category

Google Chrome dev 27.0.1423.0 is Out

Wednesday, February 27th, 2013

Well, it looks like the major version just jumped with Google Chrome dev to 27.0.1423.0, and it looks more like a semantic change than a real significant update based on the release notes. Still… it's nice to see that they are still on their schedule of moving things along as they promote from dev to beta to release.

Google Chrome dev 26.0.1410.12 is Out

Friday, February 22nd, 2013

This morning I noticed that Google Chrome dev 26.0.1410.12 is out with what appears to be a good set of updates from the release notes but the minor version update indicates that they see this as minor bug fixes. Interesting take on how they see these changes. In any case, the new maintainer seems to be generating good release notes, and I'm all for that. Maybe the quick succession of bug releases is signaling a shift to 27.*… we'll have to wait and see.

Doing a Lot of Skut Work

Thursday, February 21st, 2013

Code Clean Up

Today has been a lot of skut work - clean-up stuff that has been sitting in the queue for months but no one wants to do. But if the project is going to really work, someone actually has to do it. So since I finished up a lot of tasks today, it seemed like a natural thing to just get to it and clear the decks.

None of this is hard stuff, it's just not very fun, and it takes time.

First off, I followed up with a request for backups to be made of all the database machines we use in the group. This includes CouchDB as well as PostgreSQL. It's nice in that the install of each of these packages places the data files in the largest partition on our boxes: /var/groupon/ so it's simple to just back up that partition. I submitted the request a few days ago, but hadn't heard anything back, so I followed-up asking if I was going to get a completion notice when the backups were working.

Response was: "Yup, likely tomorrow". Good enough.

Next, we needed to get Nagios monitoring of the free disk space on the boxes as well - so that should a process go crazy and start to fill up the disk, we can fix it before it becomes a database killer. This has happened to us on several occasions, and it's something to be avoided as the main processes can't run if the database is offline.

Finally, needed to do what I could to compact the CouchDB databases on the production and UAT hosts because we're at 93% disk space used, and there's very little headroom left. If the compaction of the views doesn't work, then I'm going to just drop the database and start fresh. We have a replicate of the production data, and with the backups (above) we'd be able to go back to it anyway. But this is something I'd rather not do, but it's certainly a sure-fired way to get the space.

It's not glamorous work, but it needs to be done, and no one else is picking it up, so I might as well just do it all and have it done.

Switched Over to Sublime Text 3 Beta

Thursday, February 21st, 2013

Sublime Text 2

This morning I've been fussing with MacVim and Sublime Text 2 and trying to come to terms with the fact that Sublime Text 2 has crashed on me a few times, and I have no desire to go through that again. I have downloaded the beta of Sublime Text 3, and it appears to be decent - though because it's using Python 3 virtually none of the packages I use in Sublime Text 2 are going to work properly, but at least I get the default behavior, and that's about 95% of what I use day-to-day anyway.

So I decided that it's time to give it a shot, and I switched from Sublime Text 2 to Sublime Text 3 on my main MacBook Pro. This isn't my work machine, but my machine, and as such it's not getting the same number of keystrokes as the work machine, but still… as I work on it I'm hammering on ST3, and hopefully, they will get it out of beta soon, and the Package maintainers will upgrade their code to be compliant with Python 3 and I'll be able to get back all the functionality I have/had in the older version.

Among the new features in ST3 is the extensive use of C++11, and that includes the move semantics which should make for a much more efficient app. I'm hoping to see that the crashes I've had go away, and if so, I'll be more than happy to foot the bill for the upgrade price.

This isn't to say I've given up on MacVim - I just read a message that the maintainer is looking to add the window/file/tab restore feature to it, but that it's "hard", and so I'm not expecting it anytime soon. Should that come to pass, I think I might have a much harder time choosing an editor. Yeah, it'd be tough not to use MacVim if it had that feature. It's such a powerful editor.

Updating Some Vim Tools

Wednesday, February 20th, 2013

MacVim.jpg

Today I decided that I wanted to see what was out there to update MacVim to be something more like Sublime Text 2 - or at least how I use it. Since starting at The Shop, I've come to really like the project-management features in Sublime Text 2 - specifically the ability to find a file with partial filename completion, and the same thing for methods/functions, as working in Ruby has shown me that the standard way of working on Ruby projects is to have a mess of files, all no bigger than a thimble.

But I had a feeling that there had to be something like this for Vim - and therefore MacVim, which I really like - but just need this kind of help with. So I asked my most Vim-savvy friend and he mentioned CtrlP.

Install this guy and a simple Ctrl-P brings up a searchable list - just like Sublime Text 2! This is directory-specific and includes most-recently-used files and buffers as well. It's a real treat. It's fast, clean, and does exactly what I need it to do. I've never heard of it, but it's really quite amazing.

The next real jewel today is VimClojure. This gives me the clojure syntax-highlighting and indenting that I really need to write in clojure in Vim. I'm doing about 90% of my coding in clojure these days, and the lack of a good default mode and syntax highlight for clojure is really something that kept me from really even starting to write clojure in Vim. With this, I'm golden.

I'm super happy with these two, but I really wish MacVim had the save/restore that other Mac apps have for windows and files. The ability to save and restore the state would be amazing and might make it so that I'm back to MacVim all the time. Sublime Text 2 is nice, and I've played briefly with Sublime Text 3 beta, but there's something about Vim and all the history I have with it that makes it exceptionally powerful for me.

I'll keep looking, and these plugins make Vim much nicer, but I'm not yet giving up on Sublime Text 2 - yet.

Google Chrome dev 26.0.1410.10 is Out

Wednesday, February 20th, 2013

Google Chrome

This morning I noticed that Google Chrome dev 26.0.1410.10 was released with another very respectable set of release notes. Sounds like a lot of little fixes, but necessary and advancing the cause of a better browser. I have to say I haven't seen a regression in the rendering or speed in a very long time.

Nice work, Googlers.

Updated Java from Apple and Oracle

Wednesday, February 20th, 2013

Software Update

This morning I noticed that Apple had a Java 1.6 update for the Java exploit that's been going around, and Oracle had another for 1.7. It's interesting how vulnerable Java is these days - maybe because the other, historically more likely, back-door (open ports on boxes), has dried up of late. So the jerks turn to Java, and find problems and exploits there.

Seems reasonable to stay up to date because some Facebook and Apple engineers have had their machines compromised by visiting a hacked web site. Amazing that they can do this from visiting a website, but that makes sense in the context of Java plugins.

Crazy what poorly written software combined with kids with too much time on their hands can lead to. Kinda annoying…

Finally Moved to Java 1.7.0_13 on My MacBook Pro

Tuesday, February 5th, 2013

java-logo-thumb.png

Well… I've really held off about as long as I can, and even then, it's probably a bit too long for what I'm doing. This morning I downloaded the Oracle JDK 1.7.0_13 with the latest security fixes for my main laptop. This is a big switch as I'd been holding out for Apple to step back in and really do Java right, but I think they are past that now, and it's up to Oracle to make Java work on Macs, and I pray that they do.

I'm doing more clojure coding, and with that, I really need to have the 1.7 JDK underneath, as there are optimizations that are done in the compiling if it's on the 1.7 platform. Since we're using that on the linux boxes at The Shop, and I have 1.7 on my work laptop, it makes sense to give it up, and switch.

I guess it's like my 17" MacBook Pro… legacy hardware. I'll move to the 15" with retina display for my next machine, and it's a beauty, and it's nice that it's smaller and lighter with the same pixel count, so it's a win - really, but it's a big change from all the years I've had these 17" machines.

Face the future, Bob… it might not be what you want, but it's all you have.

Google Chrome dev 26.0.1403.0 is Out

Tuesday, February 5th, 2013

Google Chrome

This morning I noticed that we have a new drop of Google Chrome dev to 26.0.1043.0 with some really nice release notes. OK… maybe they are just bug fix titles, with the Jira (?) tracking number, but it's nicer than the SVN commit logs of the past. And I think I mentioned this last time, but it bears out saying again - The update they have done to the page is really very nice. Clean, sharp, nice.

Thankfully, we're still getting a nicely optimized rendering engine so that we're not getting a lot of flash in repainting the same page on refresh. That's a nice touch, I must say.

Cracked the Speed Problem with Postgres

Friday, February 1st, 2013

PostgreSQL.jpg

This morning I put a lot of effort into making the selection of the children from the postgres database faster. There's just no way it needs to be 30 sec. Since I'd already tried the sub-select, I needed to have a completely different approach. Thankfully, I have a lot of ideas, and it didn't take long to find the one that solved the problem.

The problem is that I was always looking in the "wrong direction". I was using IN and joins, when it was really a much simpler problem. Let's find all the demand_id values from the demands table - based on the demand_set_id - which is keyed. This is a very fast request. Then we use that as a cursor to get the locations based on that.

There are a few nice things with postgresql that make this even nicer - like the FOR loop with the select embedded - very nice. Turns out to be really pretty simple:

The difference was dramatic. Now it's about 450 msec for the same load. That's a factor of 60x! I felt such amazement, what a lucky find!