Loops In Groovy

There are several types of loops in groovy. Following are some of the ways: List list = [4, 2, 9, 6, 7, 8, 2] for loop: for (int i = 0; i < list.size(); i++) { print list.get(i) } output = 4296782 for (int i : list) { print i } output = 4296782 for (int i in list)...

SSL on Nginx

Last week i was installing SSL certificate on an Nginx server which was acting as front-end for tomcat and the basic set up was that our Grails WAR file was deployed in tomcat which was running on port 8080 and Nginx server was running on port 80. We ordered SSL...

Sort List In Groovy

If we have a simple list like List list = [4, 2, 9, 6, 7, 8, 2] We can easily sort this list using assert list.sort() == [2, 2, 4, 6, 7, 8, 9] or by using closure like assert list.sort { it } == [2, 2, 4, 6, 7, 8, 9] Both gives us a list sorted in ascending order....

Dealing with LazyInitializationException

Hi Guys! I am back with a new Post titled “Dealing with LazyInitializationException”. In Hibernate “lazy initialization” is one of the key feature of Hibernate which allows it to lazily initialize associated properties of an object. For...

Accessing indirect properties using Criteria

Hi Guys! I am back with a new post titled “Accessing indirect properties using Criteria”. In Hibernate Criteria when we try to reference an indirect property of an object(A property that is part of another mapped object) then we get the following...

How to use Morris chart

Morris.js is the library, It’s a very simple API for drawing line, bar, area and donut charts.There I’m describing example of morris chart which is very simple How to use Morris Line chart: Morris.Line({ element: 'myfirstchart' data: [ { year: '2008',...

Remove Single Quote (‘) with Number Using Apache POI

I was using excel-export:0.2.1 plug-in for export data in grail,it was work properly but facing some problem whenever I was Exporting String type of data that was work properly but whenever I was using number(Date and Time),its also work properly but append the single...

Using Projections in Hibernate

Hi Guys, I am back with another post titled “Using Projections in Hibernate”. When we deal with large objects(containing multiple attributes) we use Projections to select only a subset of attributes of an object. It helps in avoiding unnecessary column...

Inheritance in Hibernate

Inheritance is one of the biggest mismatch between object oriented model and relational model(SQL based models) because object oriented paradigm supports both Is a(Inheritance) and Has a(Association) relationship. But relational models support only Has a relationship...

Filtering Records using Hibernate Criteria

Hi Guys! I am back with a new blog post titled “Filtering Records using Hibernate Criteria”. I often use Hibernate Criteria in my project whenever a new entity is added and I need to implement certain filters on it. The Hibernate Session provides...

Useful Git Commands

Hi. I am back with a new blog post on some Useful Git commands. Recently I pulled the latest code of a branch and due to some bad commit I was not able to use certain feature. So, I needed a way to rollback to some previous version(commit) i.e. the point when the code...

Managing multiple ssh key

Some times we need to manage more than one ssh key. There may be many scenario like you are having more than 2 github account or you have an account and your client want to add your ssh key to their github account. In past I faced same kind of issue and found...

git repository multiple remotes

In my previous project repository was hosted on github.com and application was supposed to deployed on heroku which was also provide a git repository. Every time I had to push code on main repository and after that same changes need to pushed on heroku git repo. I...

Lithium-Ion Battery Charger Circuitry

Lithium-ion battery management Hi everyone, this blog is about the battery management circuit of a typical Lithium-ion battery. If you want to make a simple Lithium-ion battery charger or a handy wireless stuff with charging enabled, you can use this very simple...