19 Jul 2017
Strong beams of light penetrated my window and the time was 8AM. I rushed and got ready. I haven’t got ready in the morning in the last 5 years. It was tough, but totally worth it, today I am going to buy my first camera. Months of online research came to a halt last night concluding in favor of the Cannon 77D.
I stopped by the Metropolitan PhotoHub, the Cannon Agent in Sri Lanka. It is a decent place. It is situated near (more or less in front of) the Bambalapitiya Holy Family Convent.
I entered the shop. I waked over the showcased cameras and noticed that the 77D was not on display. I looked in the eye of the representative who walked towards me and said, “77D, I am here to buy one with the EF-S 18-55mm lens”.
We talked about the warranty, pricing and the cash-back-offer. It was some 17k. That makes it cheaper than CameraLK, if I get it. I also got a EF-S 55-250mm telephoto lens to get a decent coverage in focal-lengths.
Then I paid the money and in the mean time the rep went to the stores to get my camera. It took a while and I was looking at the nice Camera bags that were there. The rep took some time to come back but when he did, there she was. He told me that, I am the first official 77D customer in Sri Lanka, how cool is that?
I knew nothing about the camera. I had only held it once. The rep was very helpful and I had a pleasant experience. I, a photography noob, walked out of the store with my own ‘enthusiast level’ camera.
Mission accomplished, I said to my self as ignited the engine to head back home hungry, but happy!
11 Jul 2017
Memories are important, I learnt it the hard way. Since I started valuing a good photo/video I have been looking for a decent camera to buy. I started with the Sony A6000. It was too old, though it was in par with even modern DSLRs in the price range. It was also compact. But I changed my mind when I noticed the Cannon 77D.
I checked out the 77D in CameraLK. Almost instantly I fell in love with the camera and determined to get one my self. A friend of mine advised me to check the dealers. One-and-a-half months back they, Metropolitan (M Center), didn’t have it and said the first stock will arrive in a couple months time.
Today I checked with them over the phone and got a surprise news.
The 77D is available. With the 18-55mm kit lens it costs nearly 150,000 rupees. How ever there seems to be cash-back deal. That is they return some thing around 17,000 rupees later by cheque. That means it is a good price for the camera.
You might want to stop by the M-Center in Bambalapitiya if you like to have a look. I am busy and might need to wait till next week to get my hands on one.
11 Jul 2017
Surprises are not fun! Except when it is 13 flashing her tits. As an software engineer and systems administrator I get a lot of surprises. Some times in the middle of the night. But the worst kind of surprise is when you don’t have power, it is a planned down time, and you didn’t know it, and had a lot of plans.
I would like to suggest the CEB or who ever is interested in to make an app that will push notifications to users on pending service down times. I can also join the fun, but at the moment, I am quite busy.
I am thinking…
- it could be general (the CEB, Water Board etc)
- Would need push notifications to user devices
- Any thing else? yah and be AD free
Any body? Pretty please!!!
11 Jul 2017
This is the Part 2 of my experience on implementing an API on a Rails 3 app on JSON API v1 specifications. Part 1 is recommended to be skipped as it is ‘boring’.
Rails has a lot of resources when it comes to implement an API in compliance with JSON API v1 specifications. But unfortunately that requires Rails 4+. I had to settle with JSON API Serializers gem (which supports Sinatra and other Ruby frameworks too) and manually dealing with the rest.
For API documentation, I decided to settle with Swagger. I believe it doesn’t require justification.
Finally I ended up using the following…
- Grape v0.7
- Grape Swagger v0.8
- Grape Entity v0.4.8
- Grape Swagger Rails v0.3
- JSON API Serializers v1.0.0
Let me elaborate.
Grape is framework / DSL for building APIs. It doesn’t require Rails. Initially we were going to make the API standalone but later decided to mount it on the existing Rails application.
As I remember bundler choose grape v0.7. I tried to use a later version of Grape and ended up updating multiple gems version. Finally I had to update the Ruby version to 2.2 and Rails had to be updated to 3.2.22. Unfortunately the app was not functional at that point.
You may have better fortune and be able to install a better version of grape depending on your actual dependencies and if you can update to Rails 3.2.22.
Grape Swagger v0.8
In case you don’t know, grape-swagger is the lib that generates the definitions the swagger-ui require to display. This gem will introduce some helper methods that you can describe the API neatly.
This is not the newest grape-swagger version, it is many years old, but it will do. There is a compatibility chart in the master branch of the grape-swagger gem but it doesn’t cover old versions like grape v0.7.
I went through many versions to find a match. This version will give us Swagger 1.2 compatible JSON definitions.
Grape Entity v0.4.8
The idea of grape entity is to model requests and responses. For example we may have a
User model but we may only want to expose fields like
email. This does just that. With grape-wagger we are able to define the data types as well so it gets documented.
Documentation is the whole reason why you will need to get grape-entity involved. But I later found out that it is not ideal, but that is all we have.
Grape Swagger Rails v0.3
Grape Swagger Rails is a rails mounted Swagger UI. If you are not using Rails you don’t need to use this. Instead you can simply host the configured static Swagger UI separately.
This is no compromise. This is the latest version and supports swagger 1.2 compatible definitions.
Thats the libraries I have used and why I have used them.
this article is wip
08 Jul 2017
Time undoes all, or so they say! Ruby on Rails 3 may be a relic, but it is far from gone. Just when I thought I was done with Rails 3; I took over another Rails 3 project a couple weeks ago as part of an UpWork contract. The primary job was to implement an API in compliance with JSON API v1 specifications.
My first impression was to update the application to Rails 5. But I chose to go for the API first, because…
- The app is fairly large (150 models and 100 controllers)
- I noticed some code that will break in rails 4/5 upgrade
- Poor test coverage and existing tests not running without some fixing
- The app is live (obviously)
- The API was urgent
I did a lot of research off the clock and I thought of writing them down hoping it will save some time of another.
I will breakdown my experience to few articles and link them below as I write them.
this article is wip