Be Reactive

I’m not sure which one was the first when I met this reactive idea. Maybe Odersky’s Principles of Reactive Programming was that. It’s a really great but not too easy Coursera session with Scala, of course. And there is the core, The reactive manifesto. You can signed it if agree with this. Yes, I signed it.

It’s all about the standard vertical and horizontal scaling stuff. The main idea contains 4 points:

  1. react to events (Event driven programming)
  2. react to load (scalability)
  3. react to failure (resilient systems)
  4. react to users (responsive)

Best implementation of Reactive manifesto is Akka toolkit.

Be Reactive.

Tagged with: , , ,
Posted in Blog

Scala Meetup: an open source event analytics platform

It was a crackin’ meetup. Alex Dean talked about an open source event analytics platform. It’s built on Scalding as a MapReducer with Scalaz, Spray and ScalaCheck. These are the main scala technologies in the project. Alex talked about the business model. So it’s an open source project and as usual there is a business support on the Snosplow’s side.

There is the GitHub page: https://github.com/snowplow/snowplow

I have to paste the scalding’s logo, because that’s really cool:

https://raw.github.com/twitter/scalding/develop/logo/scalding.png

Tagged with: , , , , ,
Posted in Blog

All Watched Over by Machines of Loving Grace

As a well mannered computer person I enjoy every documentary movies about computer science. I’ve seen this BBC mini series called All Watched Over by Machines of Loving Grace this weekend. Huge amount of economics and philosophy mixing with dusty computers. We are just part of the whole system, we know that since Matrix.

 

 

 

Tagged with: ,
Posted in Blog

Yahoo’s Hadoop cluster

Just a quick blog about Yahoo’s Hadoop cluster. Here it is, pretty awesome:

Yahoo-hadoop-cluster_OSCON_2007

Tagged with: , ,
Posted in Blog

Meet a Java 8 project

I’m going to be a Meetup junkie. London is brilliant and full of tech meetups. I’ve missed some London Java Community events in the last few weeks. It was a huge mistake. Luckily I’ve cached the last one. Meet a Project was the event’s name. There we had Mani who talked about OpenJDK related community projects like Adopt OpenJDK and Adopt a JSR. I don’t know which one is the more important. I’m trying to figure out. Dealing JSRs looks more exciting for me.

The London Java Community has an important part of the Adopt a JSR project. Here is a list of them: https://java.net/projects/ljc-london-jug/pages/AdoptAJSRProgram

Incomplete JSRs:

I’d like to choose some of them, driving inside these JSRs, and helping the community. As Mani’s mentioned it: This programme impacts ~10 million developers & over 1 Billion end users!

Tagged with: , ,
Posted in Blog

Clojure quickstart

I visited a London Java Community meetup where Robert Rees’d spoken about Clojure. That was a really great presentation. He mentioned that Clojure is a great choose if you need to deal with huge character streams. So I’ve just decided I have to make a text processor application based on Clojure.

Where can I start? I need some resources. I dug into the Google and found these:

http://clojure.org - official site where everything is beginning

http://tryclj.com/ - playing online with Clojure

http://planet.clojure.in/ - Clojure Community Blog

http://incanter.org/ - statistical computing platform

https://github.com/languages/Clojure - Clojure is the #24 most popular language on GitHub

And the core mailing list on Google Groups: https://groups.google.com/forum/#!forum/clojure

Tagged with:
Posted in Blog

Using Comparator Interface to sort an object list

The Comparator interface exists in JDK since version 1.2 so it’s a mature part of Java tool box. And it’s a useful Interface. It provides two methods: compare and equals. We can use these methods when we’d like to sort an Array or Collection. Wicked.

So let’s sort a List with full of Object references.

Need a POJO like this:

Beer
-name
-strong

And the task is we’d like to have the strongest beer because we haven’t got enough time so you know. This case we need a Comparator for the stength of beer:

class BeerStrongComparator implements Comparator<Beer> {

  public int compare(Beer b1, Beer b2) {
    return b1.getStrong() < b2.getStrong() ? -1
     : b1.getStrong() > b2.getStrong() ? 1 : 0;
  }

}

And finally the usage:

  Collections.sort(allBeersList, new BeerStrongComparator());

You just put the Comparator as a second parameter in Collections class sort static method.

Tagged with:
Posted in Blog

How can you change two variables without temporary variable

This is one of my favourite interview questions. It’s a really simple question.

OK. Let’s see the typical wrong answer:

int a = 5;
int b = 6;

//store 'x' in a temp variable
int temp = a;
a = b;
b = temp;

This answer is wrong because it contains an unnecessary variable.

And there are some good solutions:

a = a * b;
b = a / b;
a = a / b;

or

a = a + b;
b = a - b;
a = a - b;

or

a ^= b;
b ^= a;
a ^= b;
Tagged with:
Posted in Blog