Preskočiť na hlavný obsah

Príspevky

Zobrazujú sa príspevky z dátumu 2011

Git

Git is a free and open source, distributed version control system designed to handle everything from small to very large projects. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do. Eclipse plugin:  http://www.jgit.org/updates

About Java

The java programming language is becoming more and more popular each day. It is the language without which one cannot even hope to a land a job these days. But has somebody even wondered how this language came about? There are many stories about, many books have been written. Here is my version (not approved by Sun Microsystems).

Lambda Expressions for Java

Lambda expressions are similar to anonymous methods introduced in C# 2.0, except that lambda expressions are more concise and more flexible. All lambda expressions use the lambda operator -> which is read as “goes to”. The left side of the lambda operator specifies the input parameters and the right side holds the expression or statement block. Here is an example of lambda expressions:   x  ->  x + 1 JSR 335: Lambda Expressions for the JavaTM Programming Language: Extend the Java language to support compact lambda expressions (closures), as well as related language and library features to enable the Java SE APIs to use lambda expressions effectively.

JDK 8

The goal of this Project is to to produce an open-source reference implementation of the Java SE 8 Platform, to be defined by JSR 337 in the Java Community Process. This Project is sponsored by the Build Group. History and status JDK 8 as presently conceived is the second part of Plan B. The proposed release-driver features are the Lambda and Jigsaw Projects. Additional features will be included, but they must fit into the schedule required for the release drivers. Now that work on JDK 7 is winding down, the next couple of months will be devoted to planning JDK 8 in detail. The proposed JEP Process will be a key part of this effort. Details on how Committers can participate in that process will be available shortly. Plan A: JDK 7 (as currently defined) Mid 2012 Plan B: JDK 7 (minus Lambda, Jigsaw, and part of Coin) Mid 2011 JDK 8 (Lambda, Jigsaw, the rest of Coin, ++) Late 2012

mysql 5.0 upgrade to 5.1

The 5.1 series of MySQLwas unmasked for the gentoo portage. When upgrading from an older major version (including 5.0), you will be required to rebuild everything linked to the libmysqlclient.so.15 and libmysqlclient_r.so.15. You can do this by installing app-portage/gentoolkit and running: # revdep-rebuild --library libmysqlclient.so.15 # revdep-rebuild --library libmysqlclient_r.so.15 If you use the Portage 2.2 series, you may also use: # emerge @preserved-rebuild The official upgrade documentation is available here: http://dev.mysql.com/doc/refman/5.1/en/upgrading.html Note that existing databases may need converting as well, again including those upgrading from 5.0 to 5.1.

Project manager vs. Java programmer

9:00 AM Project manager: "Where is Jack?" Java programmer: "Know, he is always lazy loadded." 1:00 PM: Project manager: "Where is Jack??" Java programmer: "Now, he's in passive mode." 5:30 PM: Project manager: "Could I see Jack in rest of my life?" Java programmer: "No, never, he has been garbage collected."

Spring Framework

Spring is a Java/J2EE application framework, based Rod Johnson's code on Expert One-on-One J2EE Design and Development. Spring's functionality can be used in any J2EE container, and most of it also in non-managed environments.

Java Serialization

Have you ever use serialization? Why and when is serialization required? Serialization is the process of storing an object's full state to a sequence of bytes. By deserializing the object you rebuild those bytes into a original object.

Java Reflection

Reflection is a powerful thing to get extended class info at runtime. If you are loaded classes into your application dynamically then Java Reflection is the right thing to get the structure of the classes. Reflection uses java class: Class. The object of the 'Class class' can hold all the information of the class and have getter methods to extract and manipulate this information.

What is Java EE?

Java EE - Enterprise Edition - also known as J2EE, is a platform-independent, Java development environment for building and deploying not only Web-based enterprise applications. The Java EE platform consists of a set of APIs and protocols. Java EE also includes many components of the Java Standard Edition - SE. Java EE simplifies application development and reduces amount of work in design time by using standardized, reusable and modular components.

Jar's extended features

JARs are Java Archives. They can do much more than only store source your compilations. JARs, WARs and EARs, can hold extra informations to be useful later in the runtime.

Oracle vs OpenJDK

Oracle has issued a set of draft bylaws that it hopes will guide the process of developing its preferred open-source version of the Java programming language, the OpenJDK. Read more on http://www.infoworld.com/d/developer-world/oracle-drafts-openjdk-bylaws-421

Chuck Norris jokes on Java

Chuck Norris is the super class of all classes in Java (including Object class). Chuck Norris can override a final function. Chuck Norris can make a class abstract and final both at same time. Chuck Norris never “try” any code, he directly “catch” the exceptions. Chuck Norris can divide by zero in Java. Chuck Norris can use pointers in JAVA.

When and where to use CharSequence?

CharSequence is cool interface to cover all character/string (buffer/bulder) operation, especially for cases where you want to use String parameters in the methods that are working with texts. Known Java implementing classes are CharBuffer, Segment, String, StringBuffer, StringBuilder. So whenever you are planning some new API, use the CharSequense.

How to convert aray to list and list back to array?

Working with collections, sometimes you need to get an actual array that contains the list. Sometimes in Java array should be converted to List. Check it out how to... This example code converts an array to a list: List listOfStrings = Arrays.asList(arrayOfStrings); On the fly list construction: List listOfStrings = Arrays.asList(new String[]{s1, s2}); And how to convert a list into an array: String[] arrayOfStrings = listOfStrings.toArray(new String[]{}); or String[] arrayOfStrings = listOfStrings.toArray(new String[0]);

How do disable root ssh login?

One of the biggest security holes is to allow direct logging in as root through ssh. To disable it: in /etc/ssh/sshd_config edit "PermitRootLogin no" and then `/etc/init.d/sshd restart` But remember to add some user to the "wheel" group to be able 'su'

How to use Enum in switch statements

If you wana use enums in a switch, don't google, I did... Enum switch case label must be the unqualified name of an enumeration constant. So let's understand this with a simple example: enum EnumType { INT,DATE, FLOAT} EnumType someVar; ... switch (someVar) { case (EnumType.INT): handle(EnumType.INT); ... } This looks fine, so? Unfortunately, it is wrong in two different ways. The case exp should be without the brackets and only INT should be used without the EnumType type def. Let's illustrate within a simple correction: switch (someVar) { case INT: handle(EnumType.INT); ... } Summarization: * In case statement the enum must be used without brackets. * In case only the unqualified enum name must be used.

Viete, čo je Portage?

Portage je základom distribúcie aktualizácií Gentoo Linux. Portage je vlastne utilita s mnoho funkciami pre zabezpečenie update vašej distribúcie Gentoo. Pre aktualizáciu zoznamu balíčkov stačí jednoducho použiť príkaz emerge --sync , tento príkaz povie systému portage, aby aktualizoval svoju lokálnu kópiu stromu (portage tree), samozrejme cez internet. Lokálny portage strom obsahuje kompletnú kolekciu scriptov, pomocou ktorých portage kompiluje a inštaluje najnovšie Gentoo programové baličky. Portage je zároveň silný nástroj pre úpravu, prispôsobovanie a inštaláciu systému. V súčasnosti je k dispozícii viac ako desaťtisic balíčkov a nové sú neustále pridávané. Ak chcete nainštalovať nejaký balíček, zadáte emerge name a portage automaticky skompiluje prispôsobenú verziu balíčka pre váš systém, zoptimalizuje ho pre Váš hardware a zabezpečí, aby program podporoval Vami požadované funkcie. Ttie, ktoré nechcete obsahovať nebude. Portage taktiež udržuje Váš systém v aktuáln...