Speed Improvements for Mapping Site

Here is just a quick update on my site that allows you to map multiple locations on Google Maps. If you use the site regularly, you may have noticed that it has been slow, and sometimes unresponsive, lately. (Also, you may have noticed some very wonky behavior today, but that was because I was tweaking it).

The site has been growing in popularity lately, and that has been causing some performance problems, as the server it runs on just couldn’t handle the load. As of today, I have added a second server to help share the load, and keep you guys plotting your maps!

As always, please let me know if you experience any problems or have any questions.

Posted in gmaps.kaeding.name, Uncategorized | Tagged | 3 Comments

Hexadecimal arithmetic in Google

Did you know that you can do hexadecimal arithmetic in Google? I didn’t, but I knew that Google’s calculator feature would often just do ‘the right thing’, so I decided to try it out.

I wanted to use the Google Chart API to create a grouped bar chart. I wanted each of the four bars in the group to be a different shade of blue. So, I picked two shades of blue to be my ‘book ends’. These book end colors were:

  • c6d9fd
  • 0000f9

Notice that the blue portion of those colors, ‘f9′, is the same. So, I wanted to find two shades of blue that were equally between those bookends. I needed to find the difference between c8d9 and 0000, and then divide that by three. Well, the fact that one of these book end numbers is zero makes this a bit easier:

c8d9 / 3

But how do I do this calculation on my handy desktop calculator? It only operates in base-10. As it turns out, you can get Google to do this calculation for you:

0xc6d9 / 3 Google Screenshot

I couldn’t get it to give me that result in hexadecimal, but at least now I know that 0xc8d9 / 3 = 16,968.3333 in decimal. Now, I just needed to find the two points that are in the middle of my two bookends. So, I need to calculate (in Google terms):

(0xc6d9 - 16968) in hex
(0xc6d9 - (16968 * 2)) in hex

In the end, I found my four colors:

  • c6d9fd
  • 8491f9
  • 4249f9
  • 0000f9

And then, I used these colors in my chart, and got a nice gradient effect in the bars:

Bar Chart Final Product

Posted in computers | Tagged , , , , | Leave a comment

a tip to prevent deadlocks on database connections (or, at least detect them early)

It seems there were a lot of points in our code base at work that are ripe for deadlocking on database connections. We are acquiring a connection, and then calling some other methods, and a few frames down the stack, we acquire another connection (before releasing the first). This, of course, can result in a deadlock, and it will only be detectable during PERF testing, which is always a bad time to discover a whole category of bugs in the code.

These deadlocks manifest themselves as ConnectionWaitTimeoutExceptions, with stack traces like this:

Caused by: com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180003
	at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1615)
	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2422)
	at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:937)
	at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:611)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:449)

Read More »

Posted in computers | Tagged , , , , , | Leave a comment

Bottle Conditioning in Growlers

Well, today seemed to be a busy day for people asking me beer-related questions on facebook. I like to repost things like this here, since the facebook wall doesn’t really stick around very long.

So, a friend of mine who is just getting into homebrewing, posed this question:

hey, So the directions I have say no screw top bottles. I was planning on filling mostly just growlers, is that cool? and why is it that the net has so much contradicting information? mostly about the times for fermenting and carbonating

Well, I’ve experimented some with bottle-conditioning in growlers, with some mixed (but never disastrous) results. I’ve also heard the warning from people on the Internet about bottle bombs.

Read on for my response, which I elaborated on somewhat to fit this format (my blog), since facebook imposes character limits on wall posts and comments.

Read More »

Posted in homebrewing/beer | Tagged , , , | Leave a comment

Hi Patrick, I have a beer question.

Today on Facebook, my mom asked me a question that I couldn’t answer in the short limits that Facebook imposes on wall comments/posts. I reposted it here in full form.

Here is the question:

Hi Patrick,
I have a beer question.

Unfiltered and unfettered Hefeweisen… I had that recently at 12 Crane and it didn’t taste right. I am sure I have had it before, or at least tasted it at a beer bar in Boston with you and I liked it. When I asked the waitress about it, she said the beer was as it should be but may have seemed strange because of the “unfettered and unfiltered”. Does that sound right to you or is she just a good waitress with an intelligent sounding response? I am keeping my question “filtered” because I don’t want to cast aspersions on any beer makers.

love, Mom

Read on for my response:

Read More »

Posted in homebrewing/beer | Tagged , , | Leave a comment

Wedding photos are coming in!

This will be a very quick post, but the wedding photos are trickling in from everyone.

Be sure to browse and share!

KristenAndPatrickWedding.com

Read More »

Posted in Uncategorized | Tagged | Leave a comment

Programming at Sea

Recently, on stackoverflow, Jeff Atwood has been concerned with ‘joke’ questions. One of these, which is now going to live in infamy due to all the discussion about it, is about “Programming at Sea”. Now, I got curious about the questions when I heard about it, so I tried to find it. The Stack overflow moderators had already removed it, but I found it in Google’s cache. I decided to exercise my rights under the Creative Commons license and repost the questions and some selected answers here, so it doesn’t die forever. I, for one, think this post is both funny and interesting, though I agree that it probably isn’t ‘programming-related’, so it doesn’t really belong on SO.

This entry on my blog is released under a Creative Commons license.

Creative Commons License

So, here is the question, originally posted by Out Into Space:

I’ve decided to cast off from this dreadful economy and program out at sea.

Programming at Sea

I’ve acquired a 40ft sailboat. Should be sufficient for me and my cat (Ender).

What do I need to be a sailor/programmer? I have a basic sailing knowledge… so I’ll wing that part. But the programming! THAT requires some juice which as I understand, is in short supply on long voyages.

So what do I need SO? A genset and some fuel? Would solar be enough to charge a single laptop? What about internet connection out there, got to be something?

So, my question is, what kind of setup should I create to sling code on the high seas?

Read on for some of my favorite responses…

Read More »

Posted in computers | Tagged , , | 1 Comment