Musings of a Windows-using Linux fan!

And now, the previous blog post made me thinking… Why didn’t I learn .NET, C#, DirectX or other Microsoft technologies? Maybe, because I am a fan of opensource platforms (excuse, I know there is Mono), languages and tools. And maybe, there is a little Leftist hidden in me. (I would like to call myself opportunistic Leftist though :), and by the way I believe most of the Keralites have a soft corner for Communist beliefs - that’s why Kerala is one of the few states where Communists are still strong).

Read more

Share Comments

AngularJS

I had been learning about AngularJS last week. Even though Javascript still causes my stomach to turn upside down, I have decided to make myself familiar with it. I completed the Codeschool classes on it. And then I stumbled onto this awesome series of videos by David Mosher. Its superb. Watch it over here. Parts 1, 2 and 3 are enough to get you up and running. Bootstrapping Dev env for Angular JS:Download Node.

Read more

Share Comments

Imperative vs Declarative

I was watching an AngularJS video, and it said AngularJS had two sides - Imperative and Declarative programming. I looked it up and here it is : Let’s generalize and say that there are two ways in which we can write code: imperative and declarative. We could define the difference as follows: Imperative programming: telling the “machine” how to do something, and as a result what you want to happen will happen.

Read more

Share Comments

Spring AOP

I was doing some Spring AOP stuff the other day using @AspectJ style annotations. One of the limitations of Spring AOP is that it supports only method level interception. We cannot intercept Constructors or fields. For that we’ll have to use AspectJ, and different compilers may be - for load time weaving or compile time weaving. I decided to stick to Spring restrictions though. Here are a couple of cheatsheets/examples for AspectJ.

Read more

Share Comments

My Git Workflow

Clone repository to local machine: git clone <repository> git pullcode… code …. code…code more…..git stashgit pullgit stash applygit add <filenames>git commit -m “commit message”git pushIf any conflict occurs when stash is applied, resolve it either in IDE or using command line: git mergetool -t kdiff3 (invokes KDiff 3 if it installed) Happy Coding :)

Read more

Share Comments

Debugging

You can find how good a programmer is by the way he debugs!

Read more

Share Comments

Tryst with Java 8!

Java 8 - it has been making headlines as the version which brings dramatic changes to Java. And I believe its true. I have been using Java 8 for the last few months and using Java 8 features has really brought changes in the way I write code and sometimes even the way I think about code! Most of the changes is in the way we deal with Collections. And most of our daily life as a programmer revolves around manipulating or using Java Collections.

Read more

Share Comments

DRM-free content

These days all publishers are worried about their rights and the books are locked in, which is especially problematic in this digital age. Because unlike old days where we could share a book(hardcopy) which we bought, the new avatar of books - the e-books - are increasingly made to be under DRM, which means it stays only on one device or person. It can’t be shared with our friends even if we bought it with our hard earned cash.

Read more

Share Comments

Creating a Maven Spring-REST project

Open Eclipse. Make sure it is a recent version with m2e integration. I am using Kepler version of Eclipse. Now go to File > New > Maven Project. Click Next. Select maven-archetype-webapp. Click Next. Enter GroupID (group ID is the name that refers to a group of projects. It should be unique. A name like ‘com.companyname.yourname’ would be suffice) and Artifact ID (Artifact ID is the project name. It should be unique within a groupID).

Read more

Share Comments

Maven config for SLF4J and Logback

To use SLF4J and logback together, add the following to pom.xml: <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.0.13</version> <scope>runtime</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> Now SLF4J’s logger can be used: import org.slf4j.Logger; import org.slf4j.LoggerFactory; …. private final Logger logger = LoggerFactory.getLogger(MyClass.class); … logger.debug("Mandatory fields are missing"); If while running this in Eclipse or in console, it complains of some missing configuration, add thisto pom.xml:

Read more

Share Comments