Wednesday, August 19, 2015

com.home.ScaredDeveloperException on line 3

I remember a few years back I would get really scared whenever I would write code and see a gazillion errors as soon as I issue the compile command. Well, back then I was in campus and the programming language I was learning was C++. This really freaked me out. But the truth is there is nothing to be afraid off. A part of me believed that the code I wrote should always work the first time. But years later I know this is not true.

Fast forward to 7 years later and I still have the same fear. I now code in groovy and whenever I see a stacktrace, I feel a wave of despair come over me. But now I have learnt that I need to shake off that fear and simply read through the errors displayed on my laptop screen. You see whenever your code throws those scary exceptions, it's actually communicating something to you i.e. there is an error on this and that line and the error is this. All I need to do is slowly read the error and deductively come to a conclusion based on the facts before me.

There are days I have rushed through and skimmed through the stack trace and more often than not I arrived at a false conclusion. I have learnt that for every effect there is a cause and computers and software in general behave in deterministic ways.

Dear fellow developer do not fret when code doesn't work the first time. Peace

Tuesday, August 18, 2015

web.skype.com

I normally use ubuntu for everything I do. Mostly because I am a software developer. One challenge I find with ubuntu is that most software written for ubuntu is not pleasing to the eye. At least my eye.

I generally like chat applications that look pretty. But the linux client for skype can't compare to the Mac and Windows clients. You can imagine how excited I was when I heard of web.skype.com, the skype web client.

I can't receive calls from the web client but honestly the user interface is really pretty. I used it from google chrome and with google chrome I get equally pretty notifications. Clicking the notifications leads me to the skype tab and to the chat where the notification originated from.

Despite the fact that calls dont work. I still like having web.skype.com open when I am at work.

Tuesday, November 25, 2014

Getting started with grails Quartz jobs

Quick start in grails jobs using the grails Quartz plugin
   class MyJob {
       def grailsApplication

       def execute(context) {
               def myService = grailsApplication.mainContext.myService
               def domainInstance = MyDomain.get(context.mergedJobDataMap.get('domainId'))
       }
   }

Wednesday, October 22, 2014

Using HTML data attributes

For those who have always been hearing about data attributes and have never actually understood how to use them. Here is an article to help you get a start on using them

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes



Tuesday, October 21, 2014

How to start your grails integration tests

I always keep forgetting how to start writing my grails integration tests. I hope this helps someone

class TestISpec extends grails.plugin.spock.IntegrationSpec {
     def 'this should do that'() {}
}

Thursday, October 9, 2014

Getting unique commits in a branch ..well almost

To list unique commits in a branch
git log --first-parent --no-merges
For more details checkout http://stackoverflow.com/questions/5720343/using-git-show-all-commits-that-exist-only-on-one-specific-branch-and-not-a
Then you can format the output as follows
git log --first-parent --no-merges --pretty=format:"%H %s"
Then you get something like
3d6995f61c1359e44c98433bb5ed4251798002c3 My Commit