Let’s face it, cygwin is neat but the console it launches is lame. I’m not referring to bash, but rather the normal — and thus lame — Windows command box. Things just don’t feel right… some keys don’t work as expected and forget about making the window wider. Fortunately, there is a better way!

Rather, I should say there are better ways: puttycyg and mintty.

puttycyg is a patched version of putty with support for cygwin. mintty is … well, yeah, it’s based on putty, too.

If you use cygwin, you owe it to yourself to try one or both of them immediately. And by that I mean stop reading and start downloading. Now.

Shutting down ehcache properly

by Mike Christianson

If you’re using ehcache’s disk persistence feature, which allows the cache to survive across JVM restarts, be sure to shut down ehcache properly.

To do so when using ehcache within a webapp, simply add its ShutdownListener as a listener in web.xml.

<listener>
    <listener-class>net.sf.ehcache.constructs.web.ShutdownListener</listener-class>
</listener>

Alternatively, or when not using ehcache inside a webapp, instruct ehcache to register its own shutdown hook by setting a system property.

net.sf.ehcache.enableShutdownHook=true

If you forget one of the above, your persisted cache may not be up-to-date, or worse, not persisted at all.

Jetty browser cache control

by Mike Christianson

Do you use Jetty and need to change the default setting for browser cache control? Have a look at the init-param element named cacheControl in webdefault.xml.

Here’s the default configuration for the version of Jetty I use. Note the element is commented.

<!--
<init-param>
      <param-name>cacheControl</param-name>
      <param-value>max-age=3600,public</param-value>
</init-param>
-->

To enable and configure browser cache control, uncomment and edit the param-value as appropriate. The following example instructs the browser to disable all caching.

<init-param>
      <param-name>cacheControl</param-name>
      <param-value>no-store,no-cache,must-revalidate</param-value>
</init-param>

For information on Cache-Control, see RFC 2616, Section 14.9.

SVN repository moved

by Mike Christianson

If you use Subversion via Apache/WebDAV and get a message like “Repository moved permanently” or “301 Moved Permanently” you should definitely read the Subversion FAQ on the 301 issue.

But, don’t take its advice too literally… you may indeed have a configuration issue, but not with DocumentRoot. Be sure to check your Apache configuration for any overlapping/conflicting SVNParentPath and Alias entries!

Yesterday I helped a coworker figure out the best way to have Linux mount an NTFS partition at startup. It was an interesting little problem because there are multiple solutions but only a single “correct” solution.

At first I questioned the need to do anything at all — my computer apparently mounts my NTFS drive on its own but I couldn’t remember how.

Before I found the ultimate solution, one approach my coworker attemped was to have gnome execute a script at login which used the mount command. This didn’t work; he forgot to use gksudo and anyway the script never seemed to run.

Then I remembered fstab and the rest is history. If you need to accomplish the same thing, be sure to read his fstab blog post.

screenshot-sketch_apr04aI’ve updated my Processing app to use the latest Case-Shiller Home Price Index data as of May 26, 2009. (For the uninitiated, see my previous post.) Read more

See my post of May 26, 2009 for a more up-to-date Case-Shiller Home Price Index graph.

screenshot-sketch_apr04aI must admit, I’ve been extremely lazy about reading Visualizing Data or even updating this blog… but, this post should make up for it.

Earlier this week I skimmed a WSJ blog and article on the Case-Shiller Home Price Index and thought to myself “time for a graph!”

For the uninitiated, Case-Shiller tracks home prices in 20 metro areas. As WSJ states, “[the index has] a base value of 100 in January 2000. So a current index value of 150 translates to a 50% appreciation rate since January 2000 for a typical home located within the metro market.”

This program graphs the history of each city’s home price index. Read more

Processing, week 3

by Mike Christianson

It’s been a week and a half since my Processing, week 2 post and I’m still not done with chapter four, “Time Series.” Oh, well.

I’ve been noticing that my Processing programs use a lot of CPU — about 35% on my dual-core, 2 GHz machine. And that’s for a program which just displays static data, like the one below. Read more

Processing, week 2

by Mike Christianson

Today marks the second week I have been learning Processing, a Java-based language for “program[ming] images, animation, and interactions.” In other words, I want to learn how to make useful, pretty graphics. :)

Over the past year I had seen Processing mentioned here-and-there in various articles, but what piqued my interest was a visualization of US zipcodes. Check it out; it’s awesome.

My guide, at least for now, is Visualizing Data by Ben Fry. I just completed reading the third chapter and thought I’d share an example program. Read more

Advanced Installer 6.7 has a new licensing and registration feature which allows for time-limited demos/trials and registration of installed software.

Caphyon, the maker of Advanced Installer, provides code samples and documentation on licensing integration for C++ and C# applications. To use this feature, the application must make a call into an Advanced Installer library and handle its return code.

The library is a gatekeeper to the rest of the application, effectively deciding whether or not the application is allowed to run. It determines the software’s trial status and displays a registration dialog, terminates the application, or returns a code, accordingly. The Java implementation of this feature works a little differently.

For those using the Java Launcher, integrating the licensing feature is easy: simply add the Java Product on the Licensing Options tab. But, what about those who don’t use Java Launcher? Or those that wish to enable users to register from within the application?

There is no official documentation which answers these questions, but based on a discussion following a request for help I posted on the Advanced Installer forums, I was able integrate AI’s licensing feature into my Java application without using the Java Launcher. Read more

Next Page »