MySQL udf_median on Windows 7 64bit

Posted in Information Technology, MySQL on May 21st, 2011 by Jeff – 2 Comments

In a minor but ongoing saga of supporting the venerable MySQL UDF function udf_median, I can now add a HOWTO for building it on Windows 7 x64 using Microsoft Visual C++ Express 2010.
read more »

Intercept HTTP requests with Squid

Posted in Systems Administration on April 20th, 2011 by Jeff – Be the first to comment

On one of my projects we had some questions about how much bandwidth was being used by requests to a third party service but we didn’t have any a view beyond general traffic on the network interface. I hit upon the idea of using a transparent proxy to log requests then use log analysis to break out data transfer amounts per third party service. And since we already had squid as part of our infrastructure applications it seemed like a good choice.

The tricky part of this setup is that everything is hosted on the same hardware node and we also have some web services that needed to be left untouched. These requirements implied some network configuration using iptables to force outbound web requests through the proxy.
read more »

MySQL udf_median on Windows

Posted in MySQL on April 19th, 2011 by Jeff – 1 Comment

A few years ago I had to get a MySQL UDF (User Defined Function) working on my Windows workstation for a project I was working on. I had the benefit of a couple of other folks to help me get my environment set up and a .dll compiled. I was recently contacted about my project files and realized I had an orphaned link out on the Internet so I thought I’d better fix that up.

read more »

“select count” with Generics, Spring and Hibernate

Posted in Software Development on April 18th, 2011 by Jeff – Be the first to comment

In a recent project, we introduced Generics and Spring into an application. In developing the Generic DAO implementation I was trying to find a way to get a record count from the database. It’s a simple enough task with HQL or Spring’s JdbcTemplate.queryForInt(String sql), however the Generics made it a little tricky. The solution I came up with was using HibernateCallback. A reference to the persistent type is a member of GenericDAOHibernate as is the SessionFactory and an instance of Spring’s HibernateTemplate.

read more »

Disabling Google Instant Preview

Posted in Computing, The Web on November 24th, 2010 by Jeff – Be the first to comment

Unlike many people, I’m not a fan of Google’s addition of instant previews. I’m a fidgety clicker and clicking in common areas where I rest my mouse pointer activates the preview. Not only annoying, I found this to be an odd behavior considering there is an icon specifically designed to activate the preview. Why would the text preview be a hotspot too? Regardless, the pop-ups instantly made Google search results a very bad user experience.

An additional aggravation was that turning off the previews is not a configuration option.

Being a web developer, I opened up Firebug and started rooting around for the “problem”. After sifting through Google’s nearly inscrutable code for about 30 seconds, I asked Google directly for a solution. Google pointed me to this article on Lifehacker about how to use the AdBlock Plus browser plugin to do the job. The solution is to add these 3 rules:


google.com##.vspi
google.com##.vspib
google.com###vspb