Git tips and tricks you forgot about

Git log with names of branches and tags

As default git log doesn’t give you information about branches and tags. If you need such info you must add –decorate argument to git log command, for example:

$ git log --oneline --decorate  
9bfa493 (HEAD, origin/1.3.x, r, 1.3.x) [#1581] Close input field for authenticityToken
ef811e8 [#1577] Remove e.printStackTrace()
6359253 [#1570] Allow setting of SSL ciphers as configuration option
89f1deb remove dead code
d795bee Hide language menu on module page
601ead1 [#1493] docviewer cosmetic changes
637f33a Fixed wrong declaration of jquery version
76a624d Fixed wrong version of jquery
d1b66e4 [#1493] Done on i18n of docviewer
6d4ee8e Merge pull request #512 from xael-fry/lighthouse-1524-patch
Czytaj dalej…

The very interesting feature of traits is possibility is dynamic mixin with other object. Why I’ve named it „dynamic”?. Because you can add trait not only to class but also to instance. It’s powerful feature that can change functionality of a class on the fly.

Czytaj dalej…

We try to write first Midlet and run it at Raspberry Pi device remotely. You need Raspberry Pi prepared. I’m using recommended OS for Raspberry: Rasbian. It’s debian based linux distribution prepared for this machine. If you work often with the same Pi you should set up static IP. It’s recommended way, you no need find current IP every reboot. You can do this in two ways: in the router, to bind IP with Pi Network Card’s MAC number, or at the Pi network config to retrieve static IP. The article doesn’t cover instalation and using ssh also. If all is prepared we can start. Czytaj dalej…

Few days ago Oracle has rolled out Java 8. In my opinion it’s revolutionary release, but it isn’t topic of this article. In parallel we can use new Java ME distribution for embedded platform – Java ME 8. Sadly SDK is at the moment at Early Access state and prepared only for Windows. I’m Mac user, then there is no possibility to check this out without VirtualBox. Czytaj dalej…

Few years ago I was programmer that write my own algorithms for every problem I’ve tried to resolve. One day I asked myself „Is any library that help me to resolve decisions in way, I provide data and conditions and get solution in back?” That day I’ve found Constraint programming.

Contraint programming is an emergent software technology for declarative description and effective solving of large, particularly combinatorial, problems especially in areas of planning and scheduling. It represents the most exciting developments in programming languages of the last decade and, not surprisingly, it has recently been identified by the ACM (Association for Computing Machinery) as one of the strategic directions in computer research.(source)

Czytaj dalej…

Java 8 has a lot of improvements, many of them touch interfaces. The problem is when new release want to add new methods to old interfaces from standard library. Every class implementing that interface should be rewrited to add implementations of missing methods. That’s very big problem – unacceptable in Java.

Java 8 provide solution for problem of this kind – default methods.

Czytaj dalej…

With Lambda expressions Java 8 has new power for developing smart and fast applications. If you don’t know how lambda expressions works just take a look a link above.

Sometimes, there is already a method that carries out exactly the action that you’d like to pass on to some other code. For example, suppose you simply want to print the event object whenever a button is clicked. You can use code below:

button.setOnAction(event -> System.out.println(event));
Czytaj dalej…

There will be few new features included in Java 8. Lambda expressions are one of them. They provide a concise and clear way to represent method interface using an expression. Labda represents an anonymous function like anonymous classes well known from previous java releases, but with clean and simple syntax.

Lambda expression is a block of code with parameters, you can use it whenever you want, a block of code is executed at later point of time.

Up to now, giving someone a block of code hasn’t been easy in Java. Java is an object-oriented language, so you had to construct an object belonging to a class that has a method with the desied code.

Czytaj dalej…

Lately my friend ask me: „I’ve forked repository from github.com, how can I update it?”. I’ll write an answer for this question here.

Preparation

As example I’ll use Kotlin Language repository from github.com (I like Kotlin and I’m proud of it :)) Czytaj dalej…

I Like Tuples in Scala. I’m almost as happy as when I met Ranges in Groovy/Ruby. My main programming language is Java and there aren’t such nice control structures.

Then, what is Tuple?

Tuple in Scala is part of the Collections API.
Tuple combines a fixed number of items together and all can be used as one object. Tuples can hold objects with different types (unlike an array or list) and are immutable. Czytaj dalej…