Streams in Java 8

 Java  Comments Off on Streams in Java 8
Jul 252015

Streams are the key abstraction in Java 8 for processing collections of values and specifying what you want to have done, leaving the scheduling of operations to the implementation. Furthermore, streams can leverage multi-core architectures without you having to write a single line of multithread code, and simplify the description of aggregate computations, exponing opportunities for optimisation. Streams basically allow us to write collections-processing code at a higher level of abstraction.
Continue reading »

Bootstrap grid system

 Design  Comments Off on Bootstrap grid system
Jul 212015

A grid system divides the screen into multiple rows and columns that can be used to create various types of layouts. With Bootstrap, to set the maximum width of the page content according to the screen width, you have to use a container. All the rows and columns should be placed inside a container to ensure proper alignment and padding.
Continue reading »

Functional interfaces in Java 8

 Java  Comments Off on Functional interfaces in Java 8
Jul 172015

A functional interface is an interface that specifies exactly one abstract method. in Java8 interfaces can now also have default methods (that is, a method with a body that provides some default implementation for a method in case it isn’t implemented by a class). An interface is still a functional interface if it has many default methods as long as it specifies only one abstract method.
Continue reading »

Lambda expressions in Java 8

 Java  Comments Off on Lambda expressions in Java 8
Jul 162015

A lambda expression can be defined as a concise representation of an anonymous function that can be passed around: it doesn’t have a name, but it has a list of parameters, a body, a return type, and also possibly a list of exceptions that can be thrown.
Continue reading »

Horizontal and vertical centering with CSS

 Design  Comments Off on Horizontal and vertical centering with CSS
Jul 152015

One of the most common tasks while designing web pages is centering elements both vertically and horizontally.

To center a block (div, p, h1, and so on) horizontally, the only thing you have to do is to apply a margin auto to it. For example,

You have to take into account that a width is necessary.
Continue reading »

Debugging HTML & CSS alignment issues

 Design  Comments Off on Debugging HTML & CSS alignment issues
Jul 152015

Many times it is very annoying when you are designing a page and suddenly you notice that something is not not properly aligned.

In these cases, it can be helpful to outline elements on the page to figure out how they are being rendered in relation to one another. One solution would be to write your own css class, such as the following:

However, a better and more convenient way is to use the Web Developer browser extension available for Chrome, Firefox and Opera.

For example, in the following image you can see all the block elements outlined using the Firefox version of the extension:

Of cource, you can always resort to Firebug plugin or/and Chrome DevTools. Another good idea might be to use a validation tool such as the W3C markup validation service, the W3C CSS validator or CSS Lint.