Hurray to 33rd

So it starts like last year’s. Woo-hoo I love 33rd Degree conference. I could copy most things from last relation, so let me focus on couple concrete talks. This is my Top 5:

5.  Robert C. Martin Demanding Professionalism

Shocking that he’s not no. 1 here. Shocking he didn’t get all 5 positions here, right? Am I a fan? Well, who isn’t?

His talks could be fun for newcomers, but most of us know his speeches already and he didn’t say almost anything new (the LASER starter is not new to us any more). I liked the iPhone metaphor, but “demanding professionalism” should mean more that just fast builds.

The most valuable thing I think I’ve got from that talk is actually… a photo with Uncle Bob.

On the other hand it’s the usual when you’re expecting too much from a talk and then comes the reality…

Well, it’s still great he came to Poland :-) I wish he came next year!

 

4. Raffi Krikorian Twitter: From Ruby on Rails to the JVM

The news about Twitter JVM romance is there for a long time, so we (Java devs) should be already pretty familiar with that fact, but seeing the numbers is still amazing. It was a well prepared presentation for awesomely interesting subject. And I was expecting the leader of Ruby to JVM migration to hate Ruby more, but he wasn’t. That’s a nice thing he sees pros and cons of solution with such a distance.

3. Jurgen Appelo How to Change the World

I have to admin, I’ve never heard about this guy before. But Grzesiek gave him the keynote, so he must be good.

He started with putting himself in a light of a total life failures. You think – hmmmm, so why do I listen to that guy? I don’t wont to follow his steps… But then the main content comes, the guy is great, extremely motivating and energetic. Exactly something I’ve needed for the conference ending.

2. Sławomir Sobótka Ścisły przewodnik po aspektach miękkich dla ekspertów IT (Polish)

It’s a pleasure to see Sławek so well prepared! This guy is taking things seriously, how much practice does it take to prepare such talk, I wonder.

He took us for a little trip through the steps of learning process, with many digressions to a human brain’s characteristics. Funny, dynamic talk, with lots of thing to remember and more to think through.

 

1. Venkat Subramaniam for the whole conference

Last year’s no. 1 is my 1. this year as well. Even knowing the subject well I still didn’t want to miss any of his talks. Venkat is a fame of 33rd conference and it’s easy to tell why – you get full pockets of his dynamism and go back to work with tons of motivation to make changes :-) especially the throw-away-java kind of changes.

He’s a very positive person so don’t miss the chance to talk to him between the talks if he comes (I’m sure he’ll be invited) next year if you haven’t this year.

 

Huge kudos to Grzesiek Duda to the 33rd degree once again! It’s hard to make the expectations after such a good event last year and you made it! Thanks again!

Posted in Uncategorized | 1 Comment

How to send a link to a Gmail email?

There aren’t much things I’m missing from working in corpo, but saving and attaching emails from M$ Exchange is one of them. You could simply save an email, put that to JIRA or any other store and your grandchildren could read the communication that led to this solution. And even more important functionality was to send someone this response ‘you wanted it so – here’s the email: <url to that exact email>.

The latter couldn’t be done with Exchange, but at least I could attach that conversation.

So now being in a small, agile company devs would probably throw up when seeing Exchange. Everyone (including me) want to use GMail. But what about my beloved sending discussion functionality? I don’t think GMail has an option to link to the message, but there’s a solution. Not very good one or anything, but still worth sharing I think.

Go to your inbox, let’s open some random spam message, settings > show original (sorry for polish on s-shots):

 

Then find message id

And the ugly hack is that when searching for e-mails GMail searches message id as well, so let’s simply search for it and send the link to whom we’ve been mailing to (message id stays the same for all inboxes). So the url is like

https://mail.google.com/mail/u/0/#search/[message id]

and in our case it’s:

https://mail.google.com/mail/u/0/#search/bwwt0zvb12d1hjau60z0dqchs8bhce.14706468600.4473@mta802.e.digg.com

And what the other person sees after opening is:

Cheers

Posted in Uncategorized | Leave a comment

33rd Degree + Scala Community Talk

33rd degree is where the Java Community is right now. Kudos to Grzegorz Duda once again.

I enjoyed few talks already (the great Venkat, long awaited non-blocking architecture in Play2 and the ‘must’ Raffi Krikorian with Twitter to JVM migration). Right now there’s a talk from Zeroturnaround about the LiveRebel and the continous delivery.

I’ve you’re interested with Scala (or just curious) join us today @ BOF (Scala community talk) ~ 5.10 PM, just after Rebelion Beer Party. We’ll show a bit of state of the art in Scala world together with Venkat Subramaniam and Sadek Drobi.

Feel invited :-)

Posted in Uncategorized | Leave a comment

Method injection with Guice and Scala

This is English version of a post I’ve written for Polish Scala User Group.

I have moved Scala recently from hard and heavy J2EE/Spring world. I know hord hard is testing when you don’t have a proper dependency injection mechanism. Mocking ability has been a priority for me for years now. On the other hand having several deps in object and delegating them work is not in the functional Spirit of Scala.

Scala makes it possible to move a step forward and inject methods, which gives you the pleasure of functional writing but still having object oriented flexibility.

Let’s take a look at this example: let’s say you’re registering a user, and want to hash his password. But it’s generally a good idea to add some salt. Not hardcoded one :-) So we keep a salt in our DB, then something that would calculate the has (a hasher) needs to obtain DB connection. And when registering a user we need a hasher instance:

class UserRegisterer @Inject() (hasher: hasher) {
  def register(username, password) = User(username, hasher.hash(password)).save
}
view raw gistfile1.txt This Gist brought to you by GitHub.

That is not the Scala beauty we could expect to see. What we want is: password.hash. So let’s take advantage of Scala mixins to use hasher as a hidden dependency and an implicit that would extend String class with hash method:

trait Hashing {
  @Inject private val hasher: Hasher = null

  implicit def stringToHashable(toBeHashed: String) = new {
    def hash = hasher.hash(toBeHashed)
  }
}
view raw gistfile1.txt This Gist brought to you by GitHub.

Now we may mixin hashing capability to our class and take a look at beautiful, but still flexible and possible to mock or whateva piece of code:

class UserRegistrator with Hashing {

  def register(username, password) = User(username, password.hash).save
}
view raw gistfile1.txt This Gist brought to you by GitHub.

Notice that thanks to minimal hasher scope UserRegistrator will never know about such details as hasher class nor such field existence.

Posted in Uncategorized | 2 Comments

Git rebasing lesson learned

Some days ago I learned a painful lesson I want to share with you. Lately I discovered git rebasing (I’m a fresh git user) and rebasing is awesome. First let me explain what it is as some of you might not know.

Rebasing

For me rebasing is merging 2.0. Assume you have a branch and some new code was introduced to master (or default or trunk, whatever). Now code tree looks like this (A, B, C, X, Y, Z are some commits) [sorry for those awful images of mine]:


So when we want to check in the code we have to merge it. But instead of merging (which has it issues, like less clean history or unnecessary merge commit) let’s try to delete commits X, Y, Z and apply them to our HEAD which is on top of C commit. After such operation our code tree looks like this:



Pretty straitforward isn’t it? History will be proud of you if you switch from merges to rebases. But remember X’ is not the same as X (if i.e. there was a conflict between C and X, he had to resolve it while rebasing, so X changed to X’).

More advanced example

Ok so let’s get back to real world. Let’s say we have some changes in branch feature1branch and we finished working on it. While waiting for code review to be done we want to start to work on feature2 in feature2branch, but we need some changes we made in first branch. So we build feature2branch on top of feature1branch. Here’s the graph:

Code review is done, and we are free to check in to master. So we go to branch feature1branch and execute rebase master

Crash

What would I expect to see is

and what we actually get is:

See the difference? Branch feature2branch now has it’s own copy of commits X, Y, Z and isn’t changed a bit! Rebasing only worked for the branch we specified. Pretty cool is you think about it, but misunderstanding this costed me some time couple of days ago.

Posted in Uncategorized | 2 Comments

AgileByExample 2011 survey

What did I learn during ABE2011?
I earned some knowledge from practitioners, everyday tricks, straight from the tranches. I’m glad to know what kind of issues people have when introducing Agile to teams that weren’t familiar with it, or were using it in the wrong way. But most of all I’m happy to hear some incredible ideas from great agilers, like Marek Kirejczyk and his team rebuilt.

Did it fix into my expectations?

Absolutely. Most important part was to be a part of Warsaw Agile Community at one of the biggest Agile events in Poland. With that I’m fully satisfied. I even wasn’t expecting to learn that much of those speeches (I thought that value/show rate would be way lower, I’m glad to be wrong).

Three speeches I will remember

Rebuilding Agile Team - Marek told us a story of how did he accomplished rebuilding a team after loosing most of it in a short period of time. Story contained job interviews using Codility, pair programming (with himself as a driver and a candidate as navigator) and other stuff. He showed an example of how to put effort in such an important part of building the team as choosing the right people, instead of simply ask few questions about last projects or try to solve deep programming language riddle [booooring].

How to Lose a Team in 10 Days - I’m not sure if the title fits the content well. Inbar Oren was speaking mostly about the role of Product Owner and about how it’s often degenerated to simple proxy between the team and the client. Also one VERY important issue pointed here – when you train a PO to actually play the extended role, to keep working with the team during the sprint and making decisions himself, you have to train him on how to handle additional work AND stress connected to additional responsibilities (but no additional working time).

Don’t Start with Kanban - Marcin Czenko was in my opinion the best presenter on ABE. The title says for the presentation, don’t introduce an agile methodology by starting with Kanban. Marcin showed us some very important issues teams are facing when they are not familiar with scrum or XP.

What about the place and coffee?

It was the first time I had a conference in a swimming pool :-) Great place for a conference in my opinion. Lots of air above our heads, original audience in pool placement and awesome acoustics made CBA the best conference room I remember of. Coffee and snacks were fine for me, but I would still appreciate to eat a sandwich perhaps, or a salad instead of tons of cookies (it’s hard to stop eating them ;) ).

Anything else?

Let’s not forget of a cool ABE party after day 1. We enjoyed beer in the ticket price, pizza and great Agile community in unofficial mood :-) Great opportunity to get to know some new people, to ask speakers some additional questions or simply relax between two days full of lectures.

Thanks for organizing it! It was a pleasure to attend

 

Posted in Uncategorized | 2 Comments

Awful Public Speaking Training

9:54

I am waiting for the training to start. Training is about public speaking. I saw it some time ago on Groupon and I thought it is something for me. I know what you think about stuff bought on Groupon – not even that it is not worth of spent money, it isn’t even worth of spending time for it. But I still gonna give it a try, I hope it is one of the best Groupon deals I had.

10:06

A single small room for us, our teacher does not look for someone you want to be taught by. Maybe colonel’s Colombo technique? :-) Broken shoes, steam on his old T-shirt. I am having second thoughts.

12:46

I was supposed to stay until 6 p.m. and I am already on a train to meet my family at Sunday lunch. This guy is not worth a broken penny (not to mansion the whole Sunday).
Within two ours of training he was not only boring, but he also managed to be vulgar, offend such crafts as teachers (one was actually on a training, so after feeling uncomfortable, he tried to fix the situation… poorly) and psychologists without absolutely any grounds. He offended one of attendees, when she went to get some water (I guess he tried to be funny or something). Complete lack of humor sense. He was so narcissistic that he didn’t make any connection with public (and there was only 6 of us for sake!), so when there was an awkward silence whenever he waited for our answer. Awful awful training. I am going to keep away from this school (Kamil’s Consulting) and this coach (I am not sure if I can call him that way).

Phew, I was hoping it would be so easy just to buy a Groupon to be shown a path to give better speaches, and now all I can do is to write a complaint to Groupon to get my money back.

Could anyone recommend me a book/school/coach for improving public speaker skills?

 

 

Posted in Uncategorized | 4 Comments

Confitura 2011 summary

Right now I’m on the last lecture of Confitura 2011, so it’s the time to write a summary.

First things first – great thanks to organizers! Javars… Confitura is a great and huge conference and it isn’t easy to make it all work. Thank guys (and girls).

And what did go wrong? Where the hell is my coffee?! Why couldn’t I get a cup of coffee during a lecture? I have to wait until some special break? C’mon! It is the first time you couldn’t drink coffee on a Java conference I remember. Another (and last) thing I’m complaining about is the food – it was weak and it was hard to find some place to eat it.

<off-topic>

At this moment a guy sitting next to me after noticing I’m writing memos suggested me to write that it’s stuffy and I fully agree. But I’ve never seen anyone solving problem of 1-2 hundred people sharing air in one room. :-(

</off-topic>

And now the lectures: first in the morning was the keynote given by WorldIT Systems guy. I’m gonna remember two things:

  • He showed that server cost per performance is underlinear (1 big computer costs less that two small) – I always believed the opposite
  • He showed us the ease of vertical optimization as the future, not horizontal, as we see it.

Somehow I just don’t buy it.

[huh - I didn't make the whole memo that day, so I am finishing it couple of days later, after cooling down]

Next one – Jakub Koperwas with webapps security. Some basic knowledge for beginners, too much about SQL injection (believe or not – we know not to concatenate strings for queries already). And when some more interesting examples were coming to the day light he ran out of time. Good luck next time – I hope to see other examples :-)

I picked Adam and Tomek with the Amazon cloud stuff as last presentation before lunch, and I picked them because I didn’t want to risk :-) I knew that they are going to give a very good show with possible live coding and they didn’t disappointed me. It was the best presentation I that day.

I wanted to prepare a bit for my presentation, so I picked the smallest room with jPalio lecture. For me it’s an awful tool (just making people to use not their favourite IDE is enough not to use it). I wish I went for Paweł’s or Jarek’s sessions that were on the same time, I heard a lot better comments on them.

Last session – Mateusz Grzechociński. I picked it up because I am about to start some Android development and so I choose everything connected to Android lately. Mateusz has a lot of useful knowledge, but it was hard for me to understand problems he meant.

That’s it, I will surely participate next year and I’m waiting for this years videos.

And I am curious – organizers kept saying carefully that this is the biggest free Java conference in Poland. Isn’t that true that this is the biggest free European Java conference and one of the 2-3 biggest Java events in Europe (not necessarily free?).

 

Posted in Uncategorized | 4 Comments

Confitura presentation

After reading Sławek Sobótka’s blog entry about showing his presentation before the lecture itself I decided to paste my too.
I know that it’s only a couple of hours earlier and nobody is reading this blog anyway, but I thought I won’t do it afterwards, because there are gonna be some higher prioritized tasks to do.
So here are my slides, just like during Warsjawa 2010 I decided to do them in Prezi.
See you on Confitura 2011.
Posted in Uncategorized | 1 Comment

JRebel with multiple module Maven2 build

This post is dedicated to put together Maven2 project with JRebel reloading.

Until now i worked only with single module apps or apps I didn’t need to reload dynamically because of all the tests that didn’t need application started. But now is the day to do the configuration and I had some trouble with it. I hope this post helps someone not to loose 2-3 hours senseless, because it is an extremely easy thing to do.

jrebel.xml

Until now all all I needed was jrebel in JVM opts (-noverify -javaagent:/path/to/jrebel.jar). But when Maven2 builds our WAR file (instead of using exploded app) we need to tell JRebel where it can find our compiles classes. Thanks to this information it can scan the whole destination and replace classes when needed.




  
    
  

Now when we add JRebel as javaagent to app it will start by reading this class and knows to check the directory (instead of dir we can watch jars and other stuff). Like in our example we would probably like to exclude some paths in directory not to scan the whole folder because it’s just too expensive. How to do that? Just add exclude/include tags in <dir/> tag.

JRebel is a smart beast that can scan all the resources in classpath, including dependency jars. All we need to do is to put proper rebel.xml into each one of the (each we want to follow). Each has to say where JRebel can find new classes.

I just lost about 2 hours because I called the file jrebel.xml instead of rebel.xml and wondered why doesn’t it scan path… :-/

Next thing to automate all of this is to add JRebel support to Maven build lifecycle, then we don’t need to create rebel.xml by had, and all of developers can use unified pom.xml (which will add project root path to rebel.xml). Remember to do this on all modules you want to have reloaded! Not just root or web project! Here’s how mine looks:


    org.zeroturnaround
    jrebel-maven-plugin
    
        
            generate-rebel-xml
process-resources
            
                generate
            
        
    

Posted in Technical | Tagged , , , | Leave a comment