Posts

Into the wild 2 - Setting up Apache Bloodhound in a windows environment

Image
Apache Bloodhound is an open source web-based project management and bug tracking system. The program is built on top of Trac. It is developed and maintained by volunteers at the Apache Software Foundation. The project was initially submitted to the Apache Incubator by WAN-disco after integration with an issue tracker was the most requested feature for uber-SVN. Bloodhound graduated from the incubator on 2013-03-20 and became an Apache Top Level Project. Bloodhound is written in the Python programming language and released under the Apache Software License.There are number of tutorials on how to setup Apache Bloodhound on an Ubuntu environment but there are less tutorials for Windows environments. First you need to have following installed in your computer. Python setuptools pip virtualenv First install python (version sho2.7.9 >= version < 3.0 )  on your computer and set the environment variables.Assume you have installed python 2.7 versions on C drive.So yo...

Java 8 - Default Methods and Enhanced Stream API

Image
In this post we'll talk about Java 8 default methods and new stream API.First let's go back and talk about how previous Java versions handled interfaces and what are the rules applied.For that we'll implement simple intrface which gives us time details. public interface TimeClient {     void setDateAndTime(int day, int month, int year, int hour, int minute, int second);     LocalDateTime getLocalDateTime(); } As you can see all the methods are abstract and do not have a method body.Let's implement this interface in a class and add method bodies to the methods. public class SimpleTimeClient implements TimeClient {     private LocalDateTime dateAndTime;     public SimpleTimeClient() {         dateAndTime = LocalDateTime.now();    }    public void setDateAndTime(int day, int month, int year, int hour, int minute, int second) {         LocalDate dat...

In to the wild..!! (Cross-platform mobile application development)

Image
Let's discuss about something interesting (not related to Java) today." Cross-platform mobile application development" . I got an opportunity to look into cross platform application development and I thought of sharing the knowledge I gathered with you as there are no sufficient amount of tutorials online on how to start cross platform application development. Cross-platform mobile development is the creation of  apps  that are compatible with multiple  mobile operating systems . Originally, the complexity of developing mobile apps was compounded by the difficulty of building out a back end that worked across multiple platforms. Although it was time consuming and expensive, it was often easier to build  native applications  for each  mobile operating system  (OS), even though very little code that was written for each operating system could be re-purposed . There are several tools in the market that we can use to develop cross platform mobile ap...

Java 8 - Method references

Image
We'll add another field to our simple student management application. LocalDate birthday; Now the constructor of the class would look like this. Person(){} Person(String name, String emailAddress, int age, Sex gender,LocalDate birthday) {         this.name = name;         this.emailAddress = emailAddress;         this.age = age;         this.gender = gender;         this.birthday = birthday;  } We'll modify our student database with the new field. List<Person> peeps=new ArrayList<>(); LocalDate today=LocalDate.now(); peeps.add(new Person("Hasitha","hasitha@gmail.com",23,Sex.MALE,today)); peeps.add(new Person("Nadishan","nadishan@gmail.com",25,Sex.MALE,today.plus(1, ChronoUnit.DAYS))); peeps.add(new Person("Jayasundara","jayasundara@gmail.com",18,Sex.MALE,today.minusDays(2))); Somebody may tell you "Hey can you sort the students according to their b...

Java 8 - Lambda Expressions

Image
We'll do something interesting today.Let's make a simple student management application which you can insert students,get the information of the students and filter them according to the given conditions.First let's create the basic Person class which is going to help us in entering,getting and filtering student details. public class Person {    public enum Sex {         MALE, FEMALE     }     String name;     Sex gender;     String emailAddress;     int age;     Person(){}     Person(String name, String emailAddress, int age, Sex gender) {         this.name = name;         this.emailAddress = emailAddress;         this.age = age;         this.gender = gender;     }     public String getName() {         return name;     }     p...

Java , Java 8 and RxJava

Image
Hello programmers...!!!.Today we'll have our conversation on something "Advanced".You know Java.You know Java ...,5,6,7.But what on earth is Java 8 and RxJava. Java 8,as the name suggests,the 8th update of the super awesome Java language.The problem is RxJava...something new right??  Okay without further delay we'll discuss about the topic. As I already said Java 8 is the latest revolutionary release of Java. There are many useful and awesome new features included in Java 8 which make our life easier and less complicated. Following you can identify some of the main changes which have taken place in the latest release. Lamda Expressions(Oracle we don't need this.We have Python) Reapeating annotations Improvements in Collection class Performance improvement for HashMap Integration of Stream API to the Collections API New Stream API New Date/Time API Nashron new Javascript engine (Rhino to Nashron) Method references Default Methods Improved type Interfac...

Strings , I/O and formatting (Part-5 File I/O)

Image
Let's start coding on what we have learnt in the previous post. File f=new File("me.txt"); System.out.println(f.exists()); Here we created a File object and checked for the presence of the file using f.exists() method.If you don't have a me.txt inside the project folder this gives false as the output and if you do have  true as the output.Let's move on and create a new file. boolean a = f.createNewFile(); System.out.println(a+" "+f.exists()); Here we created a new file and check whether the process is successfully finished and the file is created.Note that createNewFile() creates a new file if it doesn't already exists.If the file exists you get false as the output from the above method. One thing to remember is that you have to put the file operation codes inside a try catch block as the operations declare checked exceptions.Alright...!!now we'll start writing text to files. File f=new File("me.txt"); FileWriter...