Friday, July 29, 2011

Filtering Debug Steps in Eclipse

Have you grown tired of ending up in a Spring proxy while you're debugging? You know, not being able to just press F5 or step into a method and actually go into your own written code. Instead you see some class file without source of the generated proxy. It really hampers the debugging experience. Sounds familiar? To work around this you have to open the implementation class and put a breakpoint in the method you want to debug and press F8 (or Resume). This takes a lot of time, but I see a lot of developers do this ALL THE FREAKING TIME. There is a simple solution though, that nobody seems knows about. It is called 'step filters' in eclipse.

Eclipse has support to skip specified packages while debugging and it is easy to use:

1. Go to your eclipse preferences, and search on step.
2. Enable Use Step Filters
3. Add step filters. Try org.springframework.*

And your done!

You can enable and disable the Step filters in the preferences, simply click the button indicated below in the screenshot or by right clicking the background in the Debug view and select Use Step Filters.


Easy to use, saves a lot of time, nuf' said, start using it.

Thursday, January 13, 2011

AnnotationXStreamMarshaller

The extended functionality of the AnnotationXStreamMarshaller from Spring oxm 1.5 is (since Spring WS 2.0) included in the super class XStreamMarshaller.

This class can be used iso using XStream directly and is easily configurable in a spring context.

Tuesday, March 30, 2010

Awareness is key

One of the two readers of my last blog, even my girlfriend wouldn’t read a blog titled feelings, asked me to elaborate on what to do with this ‘tool’. I thought that would be obvious, but clearly isn’t.

In this blog I’ll provide you with some examples how you could react actively on your feelings. After reading it, you should have a clear idea how to use your feelings, as a start sign for change.

Useless thoughts
Think off the situation that you are working on an important project. Suddenly the boss enters the room and asks you to come to his office for a 1o1 meeting in 5 minutes. Your mind quickly tries to find a reason why he wants to talk to you. Where will the meeting be about? Why are you the only one invited? What have you been doing? What did you do wrong?

As long as you don’t have the answers, you might feel uncertainty. If you are seeking the negative events that happened this week, you will feel uncomfortable or even worse.

When you start noticing your own feelings, you have the option to do something. This is the moment to change the situation in which you are. If you are feeling uncomfortable, you might have forgotten to look at the positive reasons your boss wants to talk to you. This will help manage your feelings. But this is just one of the options. What would be the effect of replacing your search for negative reasons with one of the following questions?

• Does my search of negative issues, help me with the upcoming meeting?
• Can I possibly think of all the directions a possible discussion will head to?
• Can I prepare for this meeting?
• How can I find out where the meeting will be about?

In the case of a mental situation you do not want to be in, ask yourself the following question:
1) Notice the feelings you do not want to have
2) Ask yourself the question: Do my current thoughts help me?
3) Replace your thoughts with pragmatic ones

So, you do notice your feelings, and you did decide your current thoughts aren’t helping you. Replacing your thoughts should be easy at this time. Just think of any thoughts that would help you like “I will ask my boss where the meeting is about”.

I really want to think that I’m the only one that has these feelings, and everybody else directly asks their boss, what the topic of the meeting will be. Anyways… you might still get fired in the meeting, which brings me to the next example.

Getting fired
Imaging your boss fires you. Can you imagine yourself crying like a little baby? I can’t, I haven’t had the pleasure to witness a crying baby. Thinking about what will happen to you and your partner, wife or guinea pig. Will you be able to keep paying your alimony bills? Will you have to sell your Ferrari? What will you do without a job? I can imagine thinking this will result in feeling hopeless. Or are you one of the persons who would blame others. Thinking this isn’t fair. You didn’t think about revenge did you? You might also notice you are getting mad.

So that’s your sign! Step 1 is done, you noticed a feeling. Step 2: Do these thoughts help me? No. Step 3: What will help me? Loads of options come to mind. Beg for your job, update your CV, call your legal assistance, write your memoirs. Choose one and go for it!

You can actually notice you are in a situation you do not want to be in, before noticing your feelings.

The general pattern to successfully resolve your situation is:
1) Notice the situation you do not want to be in
2) Search for valuable actions
3) Choose one and go for it

I really hope you already do this, and I’m telling you nothing new. From practice I know that the persons, who do not take responsibility in there live, do not read my blog anyway. This means you already take responsibility and are always trying to make the best of things.

Awareness is key!
Being aware of your feelings will help you resolve unwanted situations with bigger success, and perhaps personal growth. When you are practicing your awareness of your feelings, you might, from time to time, notice you are faster than you subconscious. Your feelings arrive after you already corrected your situation. Tell me when you notice this yourself.

Next blog I might post about falling in love, and getting out of it.

Tuesday, March 16, 2010

Feelings

Am I actually going to write something about feelings? I guess I do.

Before I just state what I’m here to tell you, I want you to think about the following scenario. Imagine you are making pasta, and you hurt yourself cutting unions. You started to bleed just a little bit, and you feel it. The cutting of your finger, causes a signal to be send to your brain, and your brain interprets the signal, and provides you with pain; a feeling.

Somewhat later, you find yourself picking up the metal spoon that you used to stir the pasta while it’s cooking. The spoon is too hot, and you notice this again by feeling pain. Again your hand sends a signal to your brain telling something is wrong. Your brain interpreted it and made sure you cannot ignore the signal by providing pain.

Some would clame there is no need for interpretation by the brain, the signal is the feeling. I normally would clame the interpretation by the brain, is something that is fully automated, it happens subconsciously. Now and again I notice something, which made me think this. I notice some signal from my leg, and only after I look at it I see my leg is bleeding, and suddenly there is pain…

Where is this pain good for? Why does our body provide us with a mechanism to feel pain? The reason may seem obvious. The situations, in which we experience pain, require immediate attention (action or change). Pain is a feeling most of us cannot ignore, so we act on it. We don’t have to think about that do we?

Cut in finger -> Signal to brain -> Interpretation by brain -> Feeling Pain -> Change situation

What about feelings that are not originated by a physical event. Let’s think about fear. To cook the pasta I boiled some water. When the pasta was ready I poured it into a colander in the kitchen sink. I did this pretty quickly and before I knew it, the cooking water splashed up, and almost hit me. Pretty soon after thinking what would have happened if the boiling water would have hit me, I noticed a sensation, which I call fear. Fear about burning myself to boiling water. I actually didn’t burn myself, but still felt a feeling.

Where did this feeling came from, there was no physical event. I made it up. I thought of what would happen if… My brain was interpreting a scenario I was thinking of and gave me a corresponding feeling.

In the rest of my pasta adventure, I made sure not to cut or burn myself again.

Thinking of scenario -> Interpretation by brain -> Feeling Fear -> Changed my reckless ways

So how about it, what would you feel if somebody called you an asshole? What if I told you you’re an asshole. The signal is obvious. You can hear (or actually read) the word asshole. Your brain will interpret this word, and you will feel bad. Well, do you? Why don’t you? If your mother would say it, would you feel different? Your brain must be interpreting the word asshole in combination of loads of other memories and other inputs. Just to make my point even more obvious. What if your mother called you the biggest kanojo on the planet (over msn with no emoticons, and no prior relevant chat history). How do you feel then? I was of course hoping you don’t know this word. Your brain would do a lookup, and find nothing. No interpretation follows. Not enough data available, just like my bleeding leg example. So if this interpretation is actually going on inside your head, what can we do to influence this mechanism?

Is this interpretation by the brain fully automated? Do we have any control over this interpretation?

Let’s assume you cannot change the interpretation (which you actually can but I will not go into that atm). An easy thing to do, would be adding an extra step after noticing the feeling; check whether we agree with the interpretation. For example, if my girlfriend tells me my pasta taste like shit, I would feel bad. By now you should know this feeling is there to change the situation I’m in. Before I throw all the pasta away, I can check whether I agree with my girlfriend. Of course it tasted like shit and we ordered pizza. The observation here should be, I corrected the problem at hand, and used the feeling to my advantage.

If my girlfriend called me an asshole, she probably has some kind of reason. It really doesn’t help that I’m feeling bad about it. The feeling bad should result in asking my girlfriend why she thinks this way about me. If I agree with her, I should correct the problem. If I don’t agree, I would probably still have to fix the problem one way or another (which I always do that’s why I have a girlfriend). The cool part about this is, whenever I start fixing the reasons why my feelings appeared, they seem to disappear (finish what you start).

The feeling mechanism is nothing more than a simple system of notifying my conscious of a subconscious interpretation result.

This sucks, doesn’t it? This cannot be right. Feeling mad, sad, lonely, bad, or any other feeling, cannot possibly be your own fault. Surely it’s not your responsibility to solve them. Somebody else made you mad, made you sad, treated you bad, dumped your sorry ass for the neighbor. It’s their fault! They should fix it! They made you mad, and now you’re allowed to go to the bar and drive home drunk!

Some people really believe getting mad is something you cannot control and they think they can use it as an excuse to manipulate everything around them. This is just one of the ways to ruin your life.

Imagine your kid is behaving badly (according to you), and doesn’t listen to you what you tell him to do (obviously girls listen to their parents). You get mad because he doesn’t stop; it apparently is your fault you get mad. You cannot control the kid. In this case getting mad actually worked. So getting mad does do something for you! I must be wrong, because getting mad clearly helped on its own. Would you still be mad at your kid? Or did you use getting mad as a tool (power, fear etc)? You controlled your kid by getting mad. You could have saved yourself all the feeling which came with being mad, if you just acted like you where mad. In any case, if the kid stops the bad behavior you have solved the problem and have no need to feel mad anymore. One could argue that appearing mad for a while could help the kid understand the severity of ‘agony’ he caused. The key word is appearing. You really do not need the feeling to be present.

Feelings are a signal to change your situation. Use them to extend your rational thinking, and you'll have added a very succesful tool to your skillset. Or just ignore your feelings or use them as an excuse and join the dark side!

Saturday, October 3, 2009

Environment needs of a standard web project

This blog entry covers my thoughts about the environment needs of the projects I have worked on in the last 5 years.

Summary:


The Development environment runs whatever the developer wants.
The Support environment provides version control and continues integration.
The Test environment runs the latest successful build deployed.
The Demo environment runs the latest stable build deployed.
The Acceptance environment runs either the same build as the production environment or the build that needs to be accepted.
The Production environment has the latest accepted build deployed.


The Development environment:

Development needs to be done. The one time i saw development being done directly to a server, i made sure it was the last time. Development needs to be done on the machine of the developer. In general I would suggest the development environment has no external dependencies what so ever, but in practice I have seen plenty projects where this is just to hard to be effective. At least try to minimize the external dependencies.

The Support environment:

Do not start a project without having a version control system nor continuous integration solution. I will not even explain why... if you disagree please go away. The version control software doesn't need to be on the same (virtual)machine as the CI software.

The Test environment:

After building a feature, committing it to version control, and check whether the build is successful, the feature should be tested. For feature testing we deploy the latest successful build to the Test environment. On this environment our testers perform their test.

The Demo environment:

From time to time our clients want to demonstrate what has been developed. For demonstrations I would like to introduce the Demo environment. We have tried to demo on the acceptance environment, but usually there is a need to demonstrate a newer build then the one that's currently in production. I found that the acceptance environment is crucial for good software development, and it's state should always be as described above.

The Production and Acceptance environments:

Nobody will disagree if i say we need a Production environment. Some of you will already think that you must have an Acceptance environment also, and i agree.

When we want to deploy a specific build to the production environment, we always deploy it to the acceptance environment first. Our acceptance environments are as similar to the production environment as we can make them. Deploying a build on this environment will serve as a deployment test, but more importantly, our client will have to do a complete acceptance test before we will deploy the build on the production environment.

If any bugs are found on the production environment, I want to be able to reproduce the problem on the acceptance environment, with for example higher logging settings. In our setups this usually means restarting tomcat, which i do not want to do on the production environment.

Did I get it wrong?

I think you will not disagree with what you just read. In case you do think i got it wrong, please educate me by posting a comment.

Saturday, March 28, 2009

Retrospective as a process tool

Yesterday I was part of a retrospective which trobbelled me in many ways. I consider the retrospective the most important meeting for any project. The main goal of any retrospective should be to ensure continuous improvement. In most cases this is done by encouraging all participants to share their own interpretation of what went wrong, and suggest solutions.

This is really hard to accomplish. Can one really tell their own opinion as they see it? Should there be a (time-)limit to the time one presents their opinion? Should we allow a discussion about a person's personal opinion? What should we do with the ventilated opinions? How do we translate opinions into continuous improvement? How do we ensure continuous improvement?

Reading about retrospective thought me that any good retrospective should have a list of actions. Is it really that easy? Can we focus on achieving this list? Is the list the goal of the retrospective?

As i mentioned before, the goal is to ensure continuous improvement. What is the time base for improvement? We should be improving compared to when? The last sprint?

This particular retrospective was a very heavy retrospective mainly because of tree reasons;
* The planned release did not happen
* The sprint was extended 3 times, as was the release date
* The sprint before this sprint did not have a retrospective

The facilitators of this particular retrospective did a good job, the action list was quite impressive and i personally liked the outcome. What i didn't like was the pushing for a very short meeting. My feedback on this meeting can be summarized by the following sentence:

Individuals and interactions over processes and tools

This retrospective felt like a tool for the process, and imo didn't focus enough on individuals and interactions between them.

If you ever facilitate a retrospective, make sure you think about the questions in this blogpost and try to answer them in a way you focus on individuals and interactions between them.

Friday, December 12, 2008

Envers on Devoxx

History or Audit logs on Hibernate

You'll probably once wanted to create history for your information. If you are intrested in doing just this, you should look at Envers.

Why should i look at Envers?
1) Non invasive (no need to change your current code)
2) Annotation driven
3) will be included in the following Hibernate release

Yesterday Adam Warski gave a very nice presention about Envers on devoxx 2008. The presentation will be avialable on parleys.com in januari. I'll post the link when it's available.

For now go strait to Envers.