Salil

Technology Think Tank

Big Data

New Delhi Cassandra Users Meetup, November 2014

First of all, I want to apologize for writing this post so late.   Last Saturday, November 29, 2014 - IntelliGrape organized New Delhi Cassandra Users Meetup. This was the first meetup from this group, where we presented two sessions:    * Cassandra Core Concepts and Design Internals by Salil (slides)  * DataStax Java...

by Salil
12-Dec-2014

Android

Install RhoSync on ubuntu 11.10 (with fix)

Recently, I was trying to install RhoMobile suite on my ubuntu11.10 machine. And faced some issues for installing 'rhosync' package. This blog tells how to fix these issues (as they worked for me).   I am assuming ruby and gem are already installed on your machine. Note: if you are on older version of ruby please upgrade to...

by Salil
18-Sep-2012

Technology

Export very large data from a MongoDB collection using script

In this post, we will learn how to use javascript as MongoDB shell script to export (fields of) a collection.   If you just want to execute MongoDB commands then look at the another post there..   OK, so let's focus back to the objective of this post. Generally, to export data from a MongoDB collection, we use the...

by Salil
04-Jul-2012

Node.js

Executing MongoDB shell commands from Javascript file

MongoDB uses javascript interface for the shell commands. We can really use this feature in a great way - by writing the MongoDB (shell) commands in a javascript (.js file) and execute in single go. In this blog, I am going to show an example for the same: [javascript] print('===== My Demo Script ====='); ...

by Salil
29-Jun-2012

Grails

Dealing with immutable collections in Java

Perhaps, you know it before or just skipped it after going through Java API. But I really found it very helpful at this point.   Recently, I had a requirement in an open-source project, where users can iterate through the objects saved in collections (esp. List). But the problem was, we really didn’t want users to directly or...

by Salil
11-Apr-2012

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 and Run some...

by Salil
13-Apr-2011

Grails

git branching model: choose branches for deletion – see whats remaining for the merge

This post is for people who are already familiar with Git and work on multiple branches (esp. feature branches). By practice, feature branches are the branches created from a root branch (master or any other as per your branching model) and once feature is complete/tested - they are merged back into the same root branch. Working in...

by Salil
04-Mar-2011

Grails

Load codecs in Unit tests using Groovy Grails

This post is all about enabling codecs (like encodeAsURL, decodeURL, etc) in your Grails Unit tests. I am assuming that you are already familiar with writing unit tests. Scenario: In our application code, if we have something like below: [groovy] String serviceUrl = "http://example.com/service" String...

by Salil
23-Feb-2011

Grails

Groovy: Sort list of objects on the basis of more than one field

Usually, when we deal with databases, we don't face such kind of situation because we query database to get result-set in required order. But let's say you have a List of objects that you want to sort on the basis of two fields. Let's discuss it with an example. I have a list of Tasks (with date and priority fields). I want to sort...

by Salil
25-Jan-2011

Grails

How to use Thread-Pooling using Groovy

Grails Development is challenging and most Groovy and Grails projects require in-depth understanding of thread-pooling. As a Groovy developer, I really like the thread-pooling API (in java.util.concurrent package), especially when you are hitting x number of API dealing with outside network to fetch information for a single request. ...

by Salil
16-Jan-2011

Grails

Number Formating using regular expression and format method of String class

Hey guys, I found something very useful, so sharing it here. In one of my project there was a requirement to create a fixed length user-id. Let's say it was 5 characters ID. So in other words we required to convert - '123' to '00123' and '1000' to '01000' and '12345' will remain '12345'. It appears very simple, but the thing is how...

by Salil
14-Dec-2010

Grails

Encode Content to MD5 Using GROOVY or GRAILS – with Webhook example

Recently I was working on webhooks (which are getting quite popular for sending notifications to other applications using HTTP POST methods). MD5 encoded content is heavily used in webhooks for security concern. My purpose of writing this blog is neither to explain MD5 nor webhooks. But just to show you - 1. a quicker way in...

by Salil
12-Nov-2010