Archive for the ‘Code’ Category

Howto: JBoss Seam Performance Problems and Optimizations

Are you a java web application developer and you are working with JBoss Seam? Ok, then you might be interested in the following JBoss Seam performance problems (and their solutions). If not you should seriously consider leaving this post! It is rather long and dry and might make you never consider programing with Seam EVER (which can also be a good thing, but I will leave this discussion for another post). In any case: You have been warned.

Soo… I have recently gained some experience developing a medium/large web application with Seam and I also discovered a couple of pitfalls you run into when using this framework, especially in terms of performance optimization. At some point, I had pages of just average complexity, loading in more than 17 seconds! In this post, I will go over each of the steps that i did to speed up those pages to 3 – 6 seconds. During my code analysis, I searched through a couple of Seam performance tuning pages out there, but for some reason they did not really provide me the tweaks or straight solutions I was hoping to find. Many of the tips I found sounded very reasonable, but when I applied them to my project, there was barely any change in Seam’s performance! That’s why I publish my own list of performance optimizations, which definitely had a visible impact at least on my code and hope I can help those among you, who find themselves in a similar position like me. And even if my performance tuning tips are not able to help in your particular case, at least you will learn how to identify performance problems in your Seam project with this post.

Continue reading

How to merge multiple RSS feeds into one

If you have a wordpress blog (or any other kind of website), you might come across this problem some day: you want to fetch multiple RSS feeds and merge their entries in chronological order into one feed. Don’t panic, I might have found the solution for you. On my WordPress blog you can see I have RSS feeds for the blog posts, the user comments and now also the shoutbox entries. Most visitors were not aware of the different RSS feeds on my page (and who could blame them?), so I decided to combine them all into one big feed. Here is what you need to do…

Continue reading

WordPress: how to hide/remove pingbacks and trackbacks from recent comments

Its pretty simple to remove pingbacks and trackbacks from your sidebar actually, but the required change is overwritten by any wordpress update since it is done directly inside the wordpress files:

  1. Open the file wp-includes/default-widgets.php
  2. Find line with $comments= get_comments( array( 'number'=> $number, 'status'=> 'approve') );
  3. Change line to $comments= get_comments( array( 'number'=> $number, 'status'=> 'approve', 'type'=> 'comment') );

Your pingbacks and trackbacks should be hidden from the default recent comments widget.

Edit: I tried stromkopf’s suggestion to use a plugin and it works perfectly. To get it, go to http://wordpress.org/extend/plugins/get-recent-comments

Genetic Algorithms for Starcraft 2

Some dude actually applied genetic algorithms (searching an optimal solution to a problem by evolution) to find the best build order to a Rush on Starcraft 2. And its amazing that the algorithm actually revealed such a tactic, that more astonishing “violates several well-known (and well-adhered-to) heuristics used by Starcraft players when creating builds” – which means it has not been that much investigated by players yet. Why is this amazing? Because in a quick video the tactics shows to be extremely effective – making the player win 17 out of 20 within the first few minutes…

httpv://www.youtube.com/watch?v=KH1ucvJomlY

[via lbrandy.com]

Real Life Habits of a Programmer

I came across this list some time ago and today i found it again in my bookmarks: People collected and voted on a list of habits that a person might have attained by working as a programmer and which he/she applies to real life. Some of them are pretty accurate, for example:

“I now consider 256 to be a nice, round number. Occasionally I’m caught off-guard when non-programmers don’t get that.”

“I tend to take things hyper-literally. For example, my wife was annoyed when she used to ask “Do you want to take out the garbage?” (no) instead of “Will you take out the garbage?” (yes). Whether this is a result of programming, or just an innate trait that helps in programming, I cannot say.”

“Knuth would kill me, but I try to optimize every single path that I take, from college to home or just to the bathroom. I also tend to try to optimize the flow of people serving things in restaurants. But that’s just sad.”

“I temporize way too much in conversation. Things that anyone else would say as fact, I will still throw a “probably” or “perhaps” on, because I know there could always be that one edge case where a meteor strikes my neighborhood and I wouldn’t after all be able to make it out that day to Thanksgiving dinner.”

“I try to compress orders at restaurants by giving all necessary information in one packet. This frequently does not work, because the order taker’s task buffer is limited to one piece of data at a time.

Fast Food [Guy|Girl]: Can I take your order?

Me: number 6, BBQ, diet cola, debit.

FFG: What dipping sauce would you like?

Me: BBQ, diet cola, debit.

FFG: What would you like to drink?

Me: Diet Cola, debit.

FFG: Is Pepsi OK?

Me: [ponders Abstract Base Classes and the FFG’s lack of Polymorphic Behavior] Sure. I’ll pay with my debit card.

FFG: And how will you be paying?

Me: [sighs] debit.”

“I google everything.” with the user comment “”ARE YOU CHEATING ON ME?” — “Hangon, lemme Google that quickly.””

Find the complete list here: http://stackoverflow.com/questions/164432/what-real-life-bad-habits-has-programming-given-you

HTML 5 explained

In recent discussions about apple’s boycott of adobe flash on its iPad we heart about them praising the advantages of their alternative bet on HTML5. What exactly does that mean and does that really give you the ability to implement more interactive content without any plugins? I just came across this graphic which explains the main features of HTML5 and compares which browsers are supporting them.

via http://www.focus.com/images/view/11905/

Return top