Skip to main content

Posts

Showing posts from 2010

Cheap Grails hosting

We can use Amazon EC2 micro instance (~615mb RAM) to run grails application with Tomcat and Mysql. If you need higher JVM memory, we can try to keep the memory footprint low by using memcached or ehcache. The price is nearly $5/month if you commit for a one year contract. Since November this year, this service is offered for free for the first year for new customers. If your server server load is higher, with more number of visitors/hits, your website must be in revenue generation mode and I'm sure it will pay for itself for additional server resources. Alternatively, you can run your Grails Application on Google AppEngine. There may be few constraints in terms using some of your favorite plugins. If you careful build the application keeping the constraints in mind, you may get away with almost free webhosting. ($0/month - provided usage is within the boundaries defined by GAE platform) Both Amazon and GAE, have billing mechanisms based on the bandwidth, data storage and few add-on

Partial page loading with Grails and Jquery

Most web applications greet their users with a fancy dashboards to display various statistics of interest. The generation of dashboards are often resource consuming and therefore it is advisable to optimize the page loading time. One option is to display page content while showing certain parts of the page in loading state. In this tip, this is achieved by partially loading parts of the page by using jQuery - javascript ajax library. Though I used Grails in this sample, it can be used for other web programming languages/platforms.

jqgrid grails : editing rows with drop-downs/combo boxes

Jqgrid is a jquery plugin that allows formatting data as table and has number of options - paging, sorting, filtering, inline editing etc. There are few good tutorials explaining the process to integrated jqgrid in your grails application. http://pramodnepal.com.np/?p=119 http://www.grails.org/plugin/jqgrid Following is a typical jquery script that can be used in a grails application. The property 'editable=true' make any of the field in grid as editable.

Partial form submit with Grails and JQuery

At times you would want process a part of the form and refresh the page with the results obtained from the partial form submission. Given below is a screen shot of the typical use case. It is a form used in a sales application. Take a look at the section "Particulars" in the screen. The fields - Item, Unit Price, Quantity, Discount%, Tax% are editable and fields - Total Discount, Total Tax and Grand Total are calculated as the result of clicking "Calculate" link in this section. There is on option to add multiple rows to this table by selecting "Add" in the first cell of this table. The section of the code used for the table "Particulars" is given below.

Grails - Import data from excel spreadsheets

Importing data from excel spreadsheets to a grails application is quiet simple. You could your favorite spreadsheet processing libraries for Java like Jexcelapi or Apache POI . In this example, I used Apache POI. Step1: Copy the required libraries to libraries/lib folder of your grails applications. Step2: Create a grails controller class. Eg: Uploader

Clicktale with Blogger/ Blogspot

I am curious to know how visitors are finding my blog content. I heard lot of good things about this tool, Clicktale , and I implemented for my blog. Just two steps to get started: 1) Create an account with Clicktale and get the tracking code for your domain. I used http://sguthula.blogspot.com as domain. The instructions to get the tracking code are simple and easy to follow. 2) Login to your Blogspot account. Choose "Layout" and "Edit HTML" as shown in the picture below. Copy the tracking code provided by Clicktale. CAUTION: Take a backup of your html in the "Edit HTML" box to revert back to your previous state of the blog when you do not need the tracking.

Overlay Graphs in Grails Application - Open Flash Chart

Ofchart plugin available for Grails, makes it is easy to integrate Open Flash Chart. The plugin can be downloaded from http://grails.org/plugin/ofchart The documentation is available at http://mybytes.wordpress.com/2009/03/09/grails-open-flash-chart-06-is-out/ Though the Open Flash Chart has number of chart options - ofchart plugin documentation has limited information. I believe the documentation work is in progress and may be available anytime soon. An inquisitive mind can experiment and try to accomplish most of the features in Open Flash Chart. Best place to start is to read the API documentation A simple example I tried - overlaying a Bar chart and Line chart on a single Chart. It requires a Grails controller and a GSP as listed below. We can include the "action" to render the chart in any of your existing controllers.

How software project development teams slip deadlines?

Poor quality of the project estimation is often attributed as the main reason for missing deadlines in most of the software projects. Slipping deadlines is most common and even management teams anticipates this event and accordingly negotiate pricing with their customers. As this happens to be "known Risk" and corrective actions are taken upfront, the people involved in the wrong estimates are not penalised. Even if they do, it is only going to impact their "annual" appraisal. They might slip just "one" grade. Most people try their best to arrive at right estimates but there are few scenarios I will try to discuss later in this post that may impact the success. On the otherhand there are certain cases where there is higher propabiliy of failures. 1) Manager/Project Lead, who is estimating the project, divides the task into various functional tasks, allocates tasks to individual developers to provide estimates. He/She uses their prior experience to adjust

Bind Exception, Netbeans 6.7.1 and Jetty server running Grails applications

While developing Grails applications on Netbeans IDE 6.7.1, I noticed an issue with the inbuilt servlet container, Jetty that is packaged with Netbeans IDE. Sometimes, Jetty server wouldn't stop even if we stop from the "Services" tab of the Netbeans IDE. It might show that it is already stopped under the "Services" section while it is still running in the background. Any attempts to Run the grails application after this event, will fail. You may get errors saying "Port already in Use" or "Address already in use: bind". The environment is windows/xp/vista. I'm assuming Jetty is using Port 8080 by default. The exception message in the console says " Server failed to start: java.net.BindException " Run the following command from the command prompt. netstat -o -n -a | findstr 8080 You may get output as below: TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 7972 In the above line, the PID(Process Identi