Tag Archives: globalcode

Just Java 2011

Hi!

Its been a long time since I last posted about an event. So, to recover from the sadness, lets talk about Just Java 2011, a Java event that happened this last weekend here in São Paulo.

The event consisted of two days filled with three simultaneous talks almost the entire time. The first day was nice and, besides meeting some friends and acquaintances, I learned something about Digital TV (App Store for TV applications!), saw some discussions about cloud computing (GAE, AWS and Azzure) and other Java stuff. There was also a Scala presentation, by Alberto Souza, which was very nice.

Cloud computing discussion

Cloud computing discussion

Now, the second day was the most interesting for me. It started with a Java FX presentation by Roger Brinkley. In summary, now they have a java API to do Java FX stuff almost in release version. So is Java FX Script dead for real? I know its officially dead, but I find it a little sad, since the java code seemed a bit too verbose… Perhaps I should learn more about it before coming to conclusions.

Roger Brinkley talks about Java FX

Roger Brinkley talks about Java FX

Anyway… what followed was another Scala presentation… by me! =) It was the first time I presented at this kind of event, so regardless of being doing Scala talks at Globalcode for a while, I was a bit nervous. The audience seemed to like the talk, so I left feeling quite good. Thank you all who attended! If you are curious, I talked about Scala in general, covering basic ideas and features. Like always, I tried to make people want to learn more about the language. Hope it worked =)

I then proceeded to meet more people, and attend more Java talks. One worth mentioning is about EJB and a coffee machine. The presentation was done by Globalcode’s Vininius Senger, and was really energetic, as all his talks always are.

What he did was to control a power plug with an Arduino board, with a coffee machine plugged into that power plug. If I understood correctly, he had an application server installed in this laptop, where he had a Timer EJB. This EJB would be called through an web interface and schedule a time for activating the coffee machine. Finally, the timer would connect to the Arduino board (through bluetooth I think) and get the power plug activated, and thus the coffee machine turned on. Great Fun!

Vinicius and his coffee machine demostration

Vinicius and his coffee machine demostration

It was a great event. To finish, I would to thank the organizers for the opportunity to talk. I’m looking forward to the next event!


Matching a range of numbers in Scala

Hi everybody!

Yesterday I did a presentation about Scala at Globalcode. It was very nice, thank you all who attended!

Now, one of the things I liked the most was the final part when people started making questions. I must admit I didn’t have answers to some of them, and this post is about one of those.

The question was something like: “can I pattern match against a range of numbers, like, say, 1 to 10?”

The answer is yes, although with a little more code than I thought necessary – yet, the solution is simple. First, if we want to match a simple number, we could write something like this:

myNumber match {
  case 10 => println("a ten")
  case num: Int => println("a number")
  case _ => println("something else")
}

In terms of matching numbers, we have two cases here. In one of them, we match directly a ’10′. In the other, we match any number. But how do we match a range of numbers? By adding something extra in the ‘any number’ case:

myNumber match {
  case 10 => println("a ten")
  case num if 0 until 100 contains num => println("a number between 0 and 100")
  case _ => println("something else")
}

This ‘something extra’ is called a ‘guard’. Guards allow us to add more verifications to values we match. With this, we can have any kind of restriction in any matched value. Also, we could have a ‘case’ for numbers between 0 and 100, and another one for any other number, like this:

myNumber match {
  case 10 => println("a ten")
  case num if 0 until 100 contains num => println("a number between 0 and 100")
  case num: Int => println("a number")
  case _ => println("something else")
}

Finally, please mind the order of the cases. Notice how we go from the more specific numbers, to the broader matching. This is not optional. you cannot put the broader case before the other ones – the code won’t even compile. In summary, this won’t work:

myNumber match {
  case num: Int => println("a number")
  case 10 => println("a ten")
  case num if 0 until 100 contains num => println("a number between 0 and 100")
  case _ => println("something else")
}

Now lets talks about how this work. Like a lot of things in Scala, ’0 until 100′ is not a special construct. It is implemented as library – which means you could have implemented this yourself. The steps that the scala compiler has to take to make this magic happen is something similar to the following:

  • 0 is an Int, so the compiler tries to find an ‘until’ method in the Int class, but it doesn’t exist;
  • the compiler finds out that the ‘until’ method exists in the ‘RichInt’ class;
  • it would be perfect if 0 was a RichInt… so the compiler now searches for a way to transform an Int in a RichInt;
  • luckily, it finds this: ‘implicit def intWrapper (x: Int) : RichInt’ in the Predef object;
  • 0 is then wrapped in a RichInt, and the compiler calls its until method, with ’100′ as the parameter;
  • the ‘until’ call results in a Range object and the compiler calls its ‘contains’ method, passing ‘num’ as the parameter;
  • the result of ‘contains’ is a boolean, which will decide if the number matches or not which what we want.

That’s quite a lot of stuff happening, even though there is nothing too complex in there. To close, one more last bit of information. Predef is an object that contains a lot of helper implicit methods, which are in the classpath of any scala application by default. Very handy.

I would like to thank Henrique Prage, who was in the Scala presentation, and sent me this link this morning: http://stackoverflow.com/questions/1346127/can-a-range-be-matched-in-scala – it really helped me find out quickly the answer to this question =)


Scala Introduction at Globalcode

Just a quick update. Wednesday next week I’ll be doing a Scala Introduction presentation at Globacode, down here in São Paulo, Brazil (in portuguese, of course :P ). If you are in the area, come and join us :)

More information can be found here (again, in portuguese).

A few days after the presentation I will probably post some material used in the presentation here. Stay tuned.


Profissao Java 2010

Hi!

Talking again about events: Profissao Java 2010 (something like Java Profession 2010 in english). This event happened yesterday, Saturday, June 26th, 2010 (obviously :P ). Was an one-day event, right to the point filled with information regarding a lot of different topics, from JavaEE to Digital TV to entrepreneurship.

Talking about market opportunities and the right frame of mind when approaching career decisions, Bruno Sousa suggested a few books that we should read:

Bruno Sousa and a few book suggetions

Bruno Sousa and a few book suggetions

One other topic covered by the event was mobile platforms. Including some Java ME, Android and, despite the fact of not being Java, iPhone. I liked it. Here is a picture of Helder da Rocha talking about iPhone development:

Helder da Rocha on iPhone development

Helder da Rocha on iPhone development

Overall, I liked the event. The technical parts were interesting but what I liked the most was the focus on entrepreneurship that a lot of the presentations had. Hearing how others are building their business in our market is always interesting and fun – and help us avoiding some mistakes, when our time comes. The event run a little bit late, having ended after 8 pm, and we left really tired, but it was worth it.

Congratulations to the Globalcode team for one more great event =)


Globalcode’s Casual Class: Digital TV

I just came out from one more of the Globalcode‘s casual classes. The topic this time: Digital TV.

It usually takes me a few days before I write something about an event I attended. Well, its time to change this. But why now?

One of the speakers at the event was Dimas Oliveira. He opened the event (unofficially) asking the audience several different questions that seemed somewhat disconnected at first. But in the end he came to a conclusion that is similar to my reasoning to have this post out quickly. Timing.

Dimas Oliveira

Dimas Oliveira

Do we know Digital TV related buzzwords and/or its related technologies? Or at least know what they are? Do we want to? If so, the time is now. Actually, we might be a little late already. So, learn now, earn the dividends, or give up and move away to something else – later will be too late.

Makes sense? Hope so. Now, to some more concrete stuff. Dimas talked about opportunity, and remembered us that Ginga-J was just approved as an official Digital TV system (system? framework? API? I’m not sure yet about how to call it) down here in Brazil – as of a few weeks ago, actually. There is at least one TV device already available for sale, and there is certainly more to come. Good timing to get in this market for us developers.

Next, Thiago Vespa talked about BD-J – Java for Blue Ray devices. If you live in Mars, you might not know yet that Java runs on Blue Ray devices, like the Playstation 3. BD-J is the technology to use when developing applications that run on such devices. This part of the casual class was a little bit (just a little ;) ) offset from the rest.

Thiago Vespa

Thiago Vespa

Then Neto Marin talked about LWUIT. LWUIT is an API/Framework to develop user interfaces for mobile devices. He explained quickly how it works and followed to a demonstration, given by Thiago again. He demostrated how to develop an Xlet (a Digital TV application), using LWUIT interface. The point being: LWUIT was added as part of the Ginga-J specification, and thus can be used to develop the interface of any Digital TV application.

In time: today they decided to exchange the pizza time to the start of the event instead of the end. What was happening before was that we reached the end of the talkings being really hungry, and couldn’t pay too much attention to the last speakers. Only the beers stayed at the end this time. Good call – I can’t talk for the rest of the attendees, but I liked the change.

No promises, but I might try to play a little bit with Ginga-J. If so, I’ll post whatever results I get here. See you next time!


Globalcode’s Casual Class: Spring

Quick post: in this last Friday, February 26th, 2010, I attended the first Casual Class of the year, from Globalcode. The topic was the spring platform and, among the main subjects mentioned were Spring itself, Spring Roo, Spring and cloud computing and the launching of the Spring Brasil User Group. If my memory doesn’t fail me, this was the most packed  Casual Class until now. Thank you Globalcode for one more great event!

A few pictures for your pleasure:

Dr. Spock Introcting Spring

Dr. Spock Introducting Spring

Renato Bellia talking about Spring Roo

Renato Bellia talking about Spring Roo

Claudinho playing with our tags

Claudinho playing with our tags

This time, SIX developers from our team decided to attend! And it was a great time for everyone. Thank you guys (and gals)!


Program-ME Dojo Globalcode

Quick post, to bring back some life to this blog =)

About one month ago, on December 10th, Globalcode organized its first programming DOJO. The topic was Program-ME, Globalcode’s version of Arduino.

The idea of a dojo is to try to development/implement something, with the participation of the entire audience, instead of just the speakers doing “the hard work”.

The goal of this one was to develop a clone of the genius game, where the platform presents a series of lights and the player has to press buttons in the same order presented by its respective lights.

The session was mediated by Felipe Rodrigues and Alberto “Spock” Lemos. The code was to be written in C and, using Arduino’s tool, transferred to and executed in the device, a frankstein-thing assembled by Spock, heheh =)

Claudinho no pair programming

Claudinho doing some pair programming

In summary, it was a lot of fun, and I want more! I was the first to go there and code, which made me kind of nervous, but this was a nice experience, thank you Spock! =)

The only thing I didn’t like, and I would be happy to see improved is that they used a netbook as the development platform. And the keyboard of that thing is just too freaking small…


Globalcode’s Bug Novo Video

Just a quick update, while I finish the post about Spring Roo. Globalcode has finally published their “Bug Novo” video, which they had shown at the TDC event. Take a look here. It’s really worth watching, but its in portuguese =p.

Again, I covered TDC here and here.


TDC – The Developers Conference 2009 – day 2

In the last post, I talked about the first day of The Developers Conference. Now lets talk about day number 2.

Very different from the previous day, this one started full of coding. And during the day, we kept seeing lighting talks and Vinicius’ toys. The only real problem we had was that the place ran out of eletricity for a while… but at least it didn’t last too long and the event could finish right.

Rod Johnson

The first speech was again from Rod Johnson. But this time, it was not philosophical at all. He presented Spring Roo, a project that aims at bringing to Java the productivity found in Rails. After seeing what he showed, I believe it. And love it.

In summary, the tool generates a lot of boilerplate code that we would otherwise have to write ourselves. And keeps it all out of the way while you develop your project.

I liked this so much that Spring Roo will be covered in a new post, exclusive to it, soon enough. And look, I don’t like Spring, but this thing can make me change my mind.

Rod Johnson on SpringRoo

Rod Johnson on SpringRoo

Lightning Talks

One of these lightning talks was about Spring best practices, which followed Spring Roo’s presentation. Ricardo Jun presented it, and mentioned things like how people tend to simply want to totally discard xml, instead of using it in moderation; the importance of using tools; the importance of modularization and also that we should always mind concurrency.

Jun and Spring Best Practices

Jun and Spring Best Practices

Another quick demonstration about robotics had an application server installed in a device, which was accessed through http. This device was connected to a lamp, and Vinicius turned it on and off through a web interface. Meaning: I want all the power plugs in my house accessible through the internet!! =D

On the note of excited people, I must talk about Vinicius Senger again. When presenting the balloon robot for the second time now, he breathed Helium, the gas used in the balloon to make it float. The effect was that his voice got very thin for a few seconds, creating a very funny moment.

Balloon Robot

Balloon Robot

Another lightning talk was about what was previously called Web Beans – now Weld: the reference implementation of JSR 299: Contexts and Dependency Injection. Alessandro Lazzarotti, from Red Hat, gave a quick demo on the implementation which is, of course, full of annotations everywhere.

An interesting lightning talk was about performance in JPA. Alberto “Spock” talked about how the Open Session in View filter pattern can be a little bit outdated when it comes to ajax applications – an environment which wasn’t there when the pattern was created.

Alberto "Spock" on Ajax and JPA Performance

Alberto "Spock" on Ajax and JPA Performance

In Globalcode’s blog here, he explains this problem better. During the presentation, he also mentioned the Apache Myfaces Orchestra project, which should also help minimize the problem bringing the conversation scope to your application. The conversation scope was first introduced by JBoss Seam, and brings us a scope bigger than request, and smaller than session, which can really help us manage resources in a lot of situations.

Mike Keith

This time Mike Keith presented about JPA 2.0. The goal of JPA 2.0 is basically to standartise what we currently do with, for example, hibernate, because we can’t with JPA 1. Nothing really new was presented – unless you didn’t know anything about JPA 2 already. But a few topics are worth mentioning.

A new evictall function was added. Useful to completetly clear cache between test cases. Small change but sounds interesting.

Now my pet peeve: the new criteria API. He presented it and showed a few examples and comparisons between the criteria code and the JPQL code. Just made me dislike it more. Just as a reminder, I already said that I don’t like this thing when I wrote about Globalcode’s Casual Class #006. Trying to access a database completely through OO code is just too much purism. At least, Mike is a very funny presenter to watch =)

Mike Keith on JPA 2.0

Mike Keith on JPA 2.0

Francisco Gioelli (Google)

The original plan was to have Chris Schalk talking about Google App Engine. Unfortunatelly, he had problems with the immigration and couldn’t get into the country. So google sent Francisco Gioelli, who did a nice job instead.

Among other languages, Google App Engine allows us to write Java web applications and publish them on the google cloud, leaveraging from the monstruous google scalability. A few features available include possibility of scheduling cron tasks through a xml file and the Big Table, their (non-relational) database. This last feature is the only thing that makes me a little bit worried about using google’s cloud.

Francisco on Google App Engine

Francisco on Google App Engine

This talk had a demo and was complemented by another one from Rafael (from Globalcode) – this last one using JSF 2.0 – nice! Two little extras mentioned by him: each request can take at the very most 30 seconds and the internal server used seems to be Jetty.

Alejandro Guizar (Red Hat Mexico)

This one was about BPEL. This is not a topic I can talk too much, so I won’t. The only thing that took my attention was something called BPEL Unit. I never heard of it and found interesting that such a thing exists. But I couldn’t find any good references…

Alejandro on BPEL

Alejandro on BPEL

Cloud Computing Panel

To close the event, a panel on Cloud Computing, featuring the main speakers that were present. This is a trendy topic nowadays, full of buzz words, but interesting, it was!

Ed Burns started talking that Sun have something (I forgot the name…) since 2000. Makes sense… very tipical of Sun: great products, terrible marketing. He also mentioned Zembly.com. If you are insterested, go to the site now. I just went there and found out that they are closing the service permanently from November 30th. Nice… (no, not really).

From Rod Johnson, we learnt that Springsource have their hand on Cloud Computing in the form of CloudFoundry. Also, he made sure to say how important it is to have multiple players in the market. Agreed.

Some points were easily agreed by the panelists:

  • private clouds will have big importance in the future;
  • a good thing of the cloud is the economy;
  • but a bad thing is the loss of control in a lot of senses, but probably mainly data;
  • we need easy of migration between cloud providers.

Someone asked about cloud computing and peer-to-peer. The panelists didn’t seem to believe too much in this possibility. Well, who knows…

A lot of gurus on Cloud Computing

A lot of gurus on Cloud Computing

Last picture, to change the mood a litle bit:

Relaxing between presentations

Relaxing between presentations

And so it ends this year’s event. I’m already waiting for the one next year! =D


TDC – The Developers Conference 2009 – day 1

So, one more Java event happened this last weekend down here in Brazil. The Developers Conference, organized by Globalcode, took place on the 6th and 7th of November in São Paulo, and it is going also to Florianópolis (9th) and Rio de Janeiro (11th).

Like last year, the event featured international speakers, and was really nice. In this and two other posts, I’ll be talking about what happened in São Paulo, since this is the location I attended.

Lets start off saying that this edition was the best one until now. Among the international speakers, we had Rod Johnson (Springsource), Ed Burns (Sun) and Mike Keith (Oracle).

Opening

The event started with Vinicius Senger’s (Globalcode) dancing robots. They started some music and turned the robots on, which started to dance. The dance was programmed by themselves into the toys. Really funny =)

dancing robots

dancing robots

Fast forward to a break that happened later, here is a closer picture of the robots in the stage above:

robots!

robots!

For the music, they used a parody they made themselves. They created a new music, based on an existing one, with lyrics related to software development. As soon as I have the link, I’ll post it here. That was really really funny.=D

One thing that always grab my attention at those events are how much some people are excited about their stuff. You could see this clearly about Vinicius in the entire event; but special was his scream at the end of the opening: “I love what I do!”

Rod Johnson

Rod Johnson was the first international speaker. He talked about how things are evolving in the software development world, and mentioned things like the fact that different kinds of data storage might be interesting, instead of using relational databases for everything; cloud computing and how Springsource (and VMware) might be involved (CloudFoundry). It also seemed that he likes Groovy and Grails a lot.

rod johnson at tdc day 1

rod johnson at tdc day 1

The talk was a little bit philosophic but interesting nonetheless.

Career Panel

Next we had a career panel, featuring the three international speakers. They basically told us some stories about how they started their careers, and things like what would they expect in interviews and the like.

career panel

career panel

Lightning Talks

Spread during the day, we also had lightning talks, with subjects like GWT, Google Guice, Agile Developement and Software Architecture, EJB 3.1 (samples, available on Kenai) and ScrumToys (which is available as a NetBeans sample project and a Glassfish sample application). Two pictures of those:

agile and architecture

agile and architecture

ejb 3.1 samples

ejb 3.1 samples

And in-between presentations, Vinicius appeared again with one more toy. Now, a robotic balloon:

robotic baloon

robotic balloon

Mike Keith

Following we had Mike Keith talking about J2EE 6. He talked a little bit about the timeline of the past releases, and about a few new features coming. Note-worthy, although not that new, is the definition of JEE Profiles – different versions of the application server, with different sets of libraries, for different scenarios.

For some odd reason, I don’t have a picture of this… so lets move on.

Ed Burns

Finally, Ed Burns talked about JSF 2.0 components. Some quick highlights: development of components should now be really easy; components can be built in groovy and can be packaged together with CSS and JS files; support for EL inside CSS files and CSS can be put anywhere in the page – JSF takes care of moving them to the page head tag later.

JSF 2.0 Components with Ed Burns

JSF 2.0 Components with Ed Burns

And that was all for day 1 of the event! The next post will be about the second day, which was as busy as the first one. Stay tuned!

EDIT: Click here for the coverage of the second day of the event.

EDIT 2: Here is the link for the video.


Follow

Get every new post delivered to your Inbox.