Recently, I used bitwise Anding in my grails project. I am sharing the approach that we followed by means of an example. Suppose we have a domain class Person which can have multiple attributes like Smart, Intelligent, Talkative etc. What sort of relationship comes to our mind when we see this? I believe the obvious […]
Many at times, we have a string which needs to be converted into Enum. I will be sharing few options as stated by Mr.Haki, Isa Goksu and in the last the one I discovered during the process. Lets say we have a Enum AccountType as given below : [groovy] enum AccountType { CHECKING, SAVING } assert […]
In my current project, I was given a task to bootstrap some data for our application. Initially I was thinking of doing it in the old fashion way, that is, writing a full blown CREATE data code for data creation like [java] Book myBook=new Book(name:’MyBook’, publication:’lorem’,price:’200′) Author author1=new Author(name:’Partho’,country:’India’) author.addToBooks(myBook) [/java] and so on. But […]
Ext.JS JavaScript Framework a cross-browser JavaScript library for building rich internet applications. It is built for developing high performance, customizable UI widgets and features a well designed, documented and extensible Component model. It is available in both Commercial and Open Source licenses are available. Step 1: First download the source css and js Step 2: […]
In one of the modules that I was working on , I needed to delete the previous data from a table then load up the data into those tables again and then manipulate code through the ‘id’s’ on those tables. So this is what I was doing … [groovy] Event.executeUpdate(‘delete from Event’) EventInstance.executeUpdate(‘delete from EventInstance’) […]
Hi, In one of my project i needed to generate EAN-8 standard bar-code for identifying the various products. I searched for various libraries available for generating bar-code and found a library to do so. The library i used for generating the bar-code is Barcode4J. You can download it from here Barcode4J is a flexible generator […]
git cherry-pick is yet another great feature of git.With the help of this command we can apply the changes in a branch, introduced by an existing commit in some other branch. So, it allows to copy commits from one branch to another, but one commit at a time. Syntax for this command is :- git […]
This post is just to talk about Screen Sessions in Linux (esp. ubuntu) using command “byobu”. What is Byobu? Byobu is a Japanese term for decorative, multi-panel screens. As an open source project, Byobu is an elegant enhancement of plain GNU Screen. Where can it be used? You SSH to some remote machine […]
The web application we are developing at the moment interacts with quite a few third party services via REST calls. Most of the third party services use UTF-8 encoding and there was no issues with using the URLCodec, that grails provides out of the box. However, one of the applications our application interacts with, was […]
Recently while working on Git I had accidentally lost my commits. But since Git has a fantastic revision control system, it remembers what I committed. In other words, it records where its HEAD is every time user commits. Here’s is the example of how I got my lost commits back. Below are my 5 recent […]
In my recent project we are using spock test cases to test our application and spock really made it easy for us to test those things we were not able to test in Grails Unit Test or testing such things dont look so intuitive in Grails Unit tests . One of the powerful method of […]
In my current project, we were required to implement Instance Based Security. The idea was to find a clean solution separate from the main business logic of the application. We took a clue from the Spring Security Plugin to use the Annotations to do our job. All we wanted to do was to develop annotations […]