Last week I needed a php method which helps me with converting a Mysql result into a grouped tree structure. The grouping was supposed to be on certain column names from my database result. A quick Google search didn’t give me any useful results so sharing this seems a good option. Disclaimer: I’m not a professional php’er so there’s a big chance that this is not the most easy or fastest way.
26 Nov 2012 #php
Some months ago I was looking for a solution to my performance issue in Apache Velocity. 5% Of the tags used in a Velocity context was causing a slow down which where only used in a very small amount of processed templates. I did some googling on words like dynamic, template, real time, etcetera but without a good result. The solution wasn’t that rocket science but it won’t hurt sharing. The trick is registering an eventhandler, more specifically implementing your own ReferenceInsertionEventHandler.
Last week I noticed that in some of my webapps written in Wicket, messages appear multiple times in a FeedbackPanel (Wicket component). That happens since multiple parts of the same page do different kind of validation which might occur in the same error/warning messages. Not a big problem but duplicate messages look a bit weird to your visitor. It’s easy to fix and probably no rocket science to you but I post it anyway :).
It’s been a while that I wrote something technical on my blog. The last ones were mainly about biking which is taking a lot of my spare time these days. I haven’t blogged about Wicket before but that doesn’t mean that I use it a lot. For the last 2 years, I’m using it at my work at Maxxton for developing rich content websites. In one of the usecases a month ago, we needed something for storing parameters in the urls which would never get lost after clicking around.
ThreadLocalTargetSource, as the name already explains, is a proxied ThreadLocal helper class. Spring provides this class together with other pooling mechanisms as a better version of the Sun’s ThreadLocal class. One of the benefits is the already created wrapper class around the threadlocal and much more important, it destroys automatically the old thread references when the BeanFactory is destructed. But actually these kind of features always sound to good to be true to me.
Last week I was researching the AOP config from an big application because I wasn’t really happy with the way it was implemented right now. The idea was to improve the performance by reducing the number of calls initiated by the AOP proxy. But there was a thing I wasn’t really sure about. How does Spring handle transactions when there are nested service class calls from one service to the other?