Tarun Pareek

Grails and Open Source Fanatic, Agile Practitioner, JQuery Devotee, PhoneGap Explorer.

Git, Technology

Git Branch Per Feature : Avoid repeated sync of feature branch using git “rerere”

In this blog we were going to discuss some "Feature branching and it's repeated sync" disorder and it's cure using git "rerere" to keep the sanctity of git BPF - Branch Per Feature. First of all, I would like to discuss benefits of git BPF and how we miss use it and fall in trap of "Feature branching and it's repeated sync"...


Grails, Technology

Closure Delegate using Groovy “with” Method and decorating code with multiple assignments

Groovy is an expressive language, that is what we are going to talk about making the usage of "with" method for specifying closure delegate and making our code more succinct (brief and clearly expressed). In my recent project, I was writing a code to resolve tenant and setting some properties to object tenant. ...



Compile GroovyScript at Runtime and allow caching of compiled source to avoid recompilation at Runtime using GroovyClassLoader

In some cases we need mechanism to provide compilation of groovy script at runtime. But at the same time we need to make sure it doesn't consume the JVM to perform compilation every time when we try to access that script. Hence to perform this we need to do the following task : Compile Groovy Script at Runtime. Cache the compiled...



Apache HTTP Conditional Policy Requests for checking whether resource is modified or not and reduce unnecessary processing

Hi, Before writing this blog, I would first like to make you familiar with one quote "Be liberal in what you accept, and conservative in what you send". Yes that's what HTTP robustness protocol states. Scenario : We have a use case where our server need to read XML files that are large containing 400 outer element with extremely...


Database, Grails

Mapping duplicate domain class name having different packages using autoImport in Grails

Hi, Recently one of my friend asked me whether there is a mechanism in grails to handle the use-case where we have different packages but having same domain name. Here we are having duplicate domain class names in different package and by default the domain classes are auto-imported in HQL queries which doesn't required to specify...



Appending anchor tag to the url on server side using fragment parameter in Grails

Hi, Recently I had come across one of the cool grails redirect parameter named 'fragment' providing cool feature of forming relative link with an anchor tag/name. Generally, we can simply call [groovy]window.location.href=http://yourLink#anchorName[/groovy] It will focus you to the anchor name specified in relative link means...


Database, Grails

Handling corrupted references through ignoreNotFound database mapping in Grails

Hi,   Recently i had a use-case where we have the legacy database and it contains the corrupted references of a non existent record in many-to-one relationship, and i have to populate a grid that contain info also from referenced record. As referenced record doesn't exist, So when we refer to the certain record will result in...



Duplicate headers received from server issue on chrome

Hi,   Recently, in my project while downloading some files(not on all files) i am getting exception on chrome, that say :   Duplicate headers received from server Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple Content-Disposition headers received. This is disallowed to protect against HTTP...



Forgot Root Password in Linux, How to Reset Root Password through GRUB?

Hi,   It is a major problem when we forgot our root password in linux. But don't know how to recover it. First thought that came to mind reinstall machine. But I found a way that might help you without reinstall and save your hours. It is a interesting trick in linux to get back our root password in few minutes. I used it on ubuntu...



mysqldump of particular records without create – drop of tables

Hi,   Recently i was in a situation where i need to take the dump of particular records in mysql. We are pretty much familiar with the normal mysqldump statement given below : [sql] mysqldump --user=usr --password=pwd database_name table_name > dumpFile.sql; [/sql] The above statement will provide us the dump of the...


DevOps, Technology

Increasing the connection timeout between browser and the tomcat server

There is a case stuck recently in my Grails development project where I need to increase the connection timeout between the browser and the server, because of the reason before the response get completed server leave the connection which resulted in no response. My colleague Himanshu told me to change the setting in server.xml, which...



JQGrid Expanding SubGrid on page load

Hi,   Recently guys, i faced problem while expanding the JQGrid SubGrid onLoad of the page.   Initially, i used the following code on gridComplete Event of JQGrid, Using the code given below, i am only able to expand grid but without data populated in subgrid. gridComplete: function() { var rowIds =...