Categories
Travelling

Donegal city, Ireland

 

I visited Donegal today. Took a bus from Dublin to Donegal for almost four hours then walked around the city.

 

 

Categories
Travelling

Galway, Ireland

Sep 11, 2017

Categories
Travelling

Waterford, Ireland

Sep 8, 2017

Categories
Travelling

Kilkenny, Ireland

Sep 2, 2017

Today I went to Kilkenny. Visited many places. It’s a nice small town. Below you can see a photo of Saint Canice’s Cathedral and Round Tower.

Categories
Travelling

London, UK

Categories
Travelling

Brú na Bóinne, Meath, Ireland

Categories
Travelling

Limerick, Ireland

Categories
Programming

Think differently when the current tests fails

This is a lesson learned from work. SO we use Rials in our project at the workplace. SP for a new requirement, we had to have a validation for a particular attribute of a model.   The requirements were specific on where the validation should happen. Say for example for what controller actions.

However, the initial idea was tho have the validation at the model so that it will be validated on create and update. The idea was that every controller action that matters the new attribute validation would automatically be validated.

The approach was working great. However, after the existing tests suite has run, the results were about 70% failure. So we looked into the test code and noticed that the attributes set for the models were not following the rule. Therefore the initial thought was to fix the specs and make them pass. So we spent several hours altering the specs and running them to make sure they pass. Then we came across a test that acutally indicated our approach caused an existing functionality to break. Meaning that the rule should not be validated when performing that particular functionality.

So then we thought about a different approach and ended up using contexts in Rails. There we were able to tell the model only to validate the attribute when it is in the given context. As a result, there were only few tests that failed at controller level testing. We quickly fixed them and added specific test scenarios to cover the new requirements.

So lessons learned:

When the code change breaks a lot of existing test, it is most likely because that the app functionality is broken. So think of the bigger picture of the code change and come up with a solution that would impact less part of the application as a whole. 

Categories
Personal

5 minute fried spicy prawns

The image you see below is a photo of my new recipe for fried prawns. It came pretty nice and tasted good. So I thought to share the recipe below. 😀

Ingredients

  • Curry powder
  • Turmeric powder
  • Oil
  • Peper powder
  • Chili pieces
  • Prawns

Mix the ingredients except for the prawns in oil until it becomes a good paste. Then mix the paste with the prawns. After that, fry the prawns in a  pan turning the sides of the prawns regularly for about 5-6 minutes.

That’s it. enjoy.

 

 

Categories
Travelling

Blackpool, UK

From March 27 ti April 2 I was in UK for a holiday. I went to UK with another Sri Lankan friend and stayed with their family in Blackpool, UK. It was a great week eating Sri Lankan food mainly. We also drove to Scotland midlands on a car which was around 6-hour drive and stayed at a Hilton hotel in Aviemore. 

The interesting places we visited are (in no particular order)

  • Blackpool Pleasure Beach
  • Blackpool Water Park
  • Funny Girls, Blackpool
  • Fort Williams, Scotland
  • Steall Falls, Scotland
  • Ben Nevis Range, Scotland

The Blackpool town itself has a pretty long coastal line. However the building in Blackpool seemed to be poorly maintained and damaged due to the Sea and salty wind. 

Here are some of the interesting pics

Where are the place located?

Fort William, Scotland, United Kingdom

Steall Falls, Fort William, Scotland, United Kingdom

Ben Nevis Range, Scotland

Blackpool Pleasure Beach

Blackpool Water Park

Funny Girls