TO THE NEW Blog PAGES

Grails

A use case of Bitwise AND

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 […]

Mohd Farid
Mohd Farid
Read

Grails

Groovy: Few ways to convert string into enum

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 […]

Amit Jain
Amit Jain
Read

Grails

Grails fixture, a great way to bootstrap your data

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 […]

Grails

Getting started with extJS

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: […]

Anuj Aneja
Anuj Aneja
Read

Grails

Truncate Table ? executeUpdate OR createSQLQuery

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’) […]

Grails

Generating EAN-8 standard barcode using Barcode4J

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 […]

Grails

Git cherry-pick

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 […]

shweta
shweta
Read

Technology

byobu: screen sessions in Linux

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 […]

Salil
Salil
Read

Grails

ISO-8859 Based URL Encoding in Grails

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 […]

Grails

How to Recover lost Commits in GIT

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 […]

Grails

Interaction based testing using Spock in Grails

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 […]

Grails

Handling Instance Based Security

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 […]