Thursday, February 5. 2009
When building Spring controllers, it is often useful to access a DAO instance which has been set up in applicationContext.xml . To do so, add a variable in the controller for the DAO as well as a setter for it. Once this is done, wire it up by reference in dispatcher-servlet.xml .
Continue reading "Injecting DAO Objects Into Spring Controllers "
Often when working with Spring Web MVC mappings I want all calls to a certain extension handled by a generic resolver, i.e. mapping "*.html" to corresponding "*.jsp" entries in WEB-INF. This is easily done using UrlFilenameViewController which automatically passes the parsed filename to the view resolver.
Continue reading "Spring Generic URL Handling"
Sunday, January 25. 2009
After receiving one of these Chemex Coffee Makers for Christmas and using it for a while, it not only makes better tasting coffee, but I enjoy pouring the water over the grounds and experiencing different smells that emanate from them as the brewing extracts the coffee oils. With this brewing method it is possible to tell from the scent when the beans are extracted and starting to go bitter, giving the brewer more control over the flavor. I definitely recommend trying one of these to anyone who wants better coffee, but more time and effort is needed to do it, so it isn't for everyone.
Excellent Chemex brewing instructions are available. The coffee does cool rather quickly in the carafe, so after pouring myself a cup I usually put the rest of the coffee in an insulated travel mug.
Thursday, January 22. 2009
On a server running Zimbra on Ubuntu, to get cron job output sent to an e-mail address, make the following link:
ln -s /opt/zimbra/postfix/sbin/sendmail /usr/sbin/sendmail
Until this is done, crontab output will silently vaporize.
Continue reading "Cron Uses /usr/sbin/sendmail"
Monday, October 20. 2008
A Java Swing user interface I am working on which makes extensive use of a custom JTableModel implementation was failing. In certain instances when my data structure changes, it purges empty cells. If the cursor was left in these cells while this was taking place, the table would become unresponsive, often requiring an application restart to fix.
Watch for issues with setValueAt , which in some cases can be called with invalid values. In particular if the cursor is editing a field, the table is not refreshed until the edit focus leaves the widget even if you try to force it with validate() calls. In my instance the ideal fix was to add checks and do nothing instead of throwing exceptions.
With getValueAt , some table widget types choked on my default of null, which I was returning for invalid cells. Using an empty string instead of null for these invalid cells fixed this problem.
Sunday, October 19. 2008
Having just returned from the Central PA Open Source Conference, I found it to be a very informative and useful conference. A wide array of interesting topics in different fields were covered, and there were many items I can apply over the next few months to my own projects.
My favorite session was Hardware and Honeybees, in large part because it showed interesting uses for technology and hardware hacking, something as a software-oriented person I do not see much of. Using cell phone text messages to control electric fences, web cameras to monitor hive status, and inexpensive temperature monitors to find problems were all topics in this interesting talk.
Continue reading "Central PA Open Source Conference"
Wednesday, October 1. 2008
While eating at Neato Burrito today I noticed these delicious looking treats in their dessert bin in front of the cash register.
Labeled Bailout Brownies, they consist of a rich chocolate brownie with gold foil-wrapped chocolate coins adhered to the top with a chocolate glue. While eating, the coins stay on the top until their location is reached, when instead of the coin falling off, a hunk of chocolate comes loose with the coin. After prying the coin loose from the chocolate base, a nice imprint of the coin can be seen in the short period before the chocolate inevitably disappears. In a caricature of the real economy, the shadow of the coin is much more tasty than the chocolate within the coin itself.
A wonderful sweet relief from the stress and woe caused by this trying time.
Wednesday, September 17. 2008
Firefox 3 introduces a new behavior when your doctype is XHTML Strict; certain tags that do not allow minimization as per the spec no longer close anyway. For example, if you use a <script src="blah.js" /> tag in your heading, Firefox 3 will take the whole rest of the page as a script, which will result in a blank page. This is good as it enforces standards compliance, however jspx minimizes tags, so you may have <script src="blah.js"></script> on your page, but the actual rendered page will minimize it.
There are many ways to fix this issue by playing tricks on jspx, I recommend:
<script src="blah.js"><!-- //prevent jspx minimization --></script>
This reminds me when I'm working on the code why that comment is there. Hopefully this will be fixed in the jspx spec at some point.
Saturday, July 26. 2008
Water spurting out from between sidewalk segments and flowing down the road has become a common sight this week as the local water authority has been steadily increasing the water pressure. The old 70's vintage pipes in my apartment complex couldn't take the pressure and are turning the complex into a waterfront property. As they repair one segment, new ones open up shortly thereafter, often just a few feet away.
Thursday, July 24. 2008
I bicycled to work today. A 5.3 mile trip from Summerdale to downtown Harrisburg (Pennsylvania), I have been talking about cycling to work ever since I moved in the spring. A series of issues as well as a need to improve my general fitness level so I could do so successfully delayed my attempt.
I am hoping this is the start of many such trips; I want to do this once or twice a week starting out. As my health improves and I get more comfortable biking in less optimal conditions (rain and perhaps snow), I should be able to do this more often.
Continue reading "First Bicycle Commute"
Tuesday, July 22. 2008
Dairy Queen's Blizzard of the Month is a Girl Scout Thin Mint ® Blizzard. I have had more of these than I would like to admit to this month and still love them. Often with Blizzards they have too much of the featured ingredient and not enough ice cream. These cookies are good enough that I enjoy this particular blend even when it is supersaturated with them.
Generally I prefer hand-dipped ice cream to soft. Handel's Homemade Ice Cream has a wonderful version of this combination, but as I thought they were only in Ohio (which I only venture to when visiting family or camping) I haven't eaten any of it this year. It seems they now have a York, PA location . . .
Tuesday, July 15. 2008
While ordering a burrito at one of my favorite Harrisburg eating establishments, Neato Burrito, I handed some change to the cashier in exchange for the rolled meal. The sharp-eyed cashier noticed one of the coins I handed him wasn't what I thought it was.
Having never seen such a coin before I paid in more appropriate currency and went to a table, glad this entertaining item came up as a side activity to occupy myself with during lunch. While enjoying my burrito I used one of my ever present internet connected gadgets to look up what this coin was; a 1 Jiao Chinese coin, which is one-tenth of a Chinese Yuan. At current exchange rates it would be worth about one and a half cents.
Continue reading "Chinese 1 Jiao Coin"
Thursday, June 5. 2008
A project I am working on requires binary image files and form data to be submitted simultaneously. This is rather easy to do with Spring, following the directions available in the latest documentation to handle file uploads in a form. It does not mention there that you can mix form fields as well as file upload fields when doing this, but it works as expected.
Continue reading "Spring Binary and Text Forms"
Saturday, March 22. 2008
I received this in a fortune cookie while eating at a chinese restaurant with my mother.
Tuesday, March 4. 2008
Another season of delicious chocolate egg-shaped confections is upon us. Once upon a time there were wonderful ones available in my home town, but they started adding vegetable shortening to those as a filler. That cheap concoction is disgusting, so I have been seeking a better variety.
The wonderful sample shown here is a Peanut Butter/Chocolate Truffle from St. John (Barner's) Lutheran Church. A simple treat containing only peanut butter, corn syrup, and chocolate, these are quite delicious. They are also reasonably sized, a nice side feature for those watching their waist.
|