Sony Arouje

a programmer's log

Archive for November 2013

Chromecast–My experience

with 2 comments

Recently I received a Chromecast, it’s a really great addition to my TV and can stream online videos and browse web very easily. Thanks to my brother in law for gifting me one.

Installation

Installing Chromecast is pretty simple, just connect the dongle to the HDMI slot and connect the power source to the TV’s USB slot. If your TV don’t have a USB slot then don’t worry it packed with an external power adapter and can connect to a power outlet.

When I first connected to my TV it is showing only a blank screen with some colored dots. Some google search revealed that it’s because of the Reset button. After doing some analysis of the dongle I realized that, when I insert the dongle to HDMI, the core is pushing backward and jamming the reset button. Thus the device enter into a reset state. If the same issue is happening to you then connect the device and try to pull the cover a little bit so that the reset button wont get stuck and you should be able to click the reset button.

Configuration

Next issue is installing the Chromecast app for my Android tab. I can’t install the app from Play store as I reside in India and the Chromecast is not released here yet. So I downloaded the apk from http://www.apkmaza.com/2013/07/chromecast-111.html and installed it. The setup was quite simple and the Chromecast Android app will guide you through each step. Once the setup is complete the dongle will check for the latest version and update it, if found. So make sure your WiFi router is connected to Internet.

If you don’t have any Android or iOS device then you can install a desktop app to configure the Chromecast dongle.

My Experience

Even though my TV is a smart one, means I can connect to my Wi-Fi. But browsing sites or watching YouTube is bit difficult with the aide of that remote control. With Chromecast I can browse any site in my computer and if required just cast it to my TV. That means my TV can show any Chrome tab from my computer, if it has photo, video or text. Even I can do multitasking when I am casting a tab to TV, that means my son can watch his favorite video from YouTube running in one of the chrome tab and casted to TV, mean while I can browse Facebook in another tab and is available only to my computer.

One thing I really missing in Chromecast is streaming the videos or music I stored locally in my computer. I am not sure why Google is not provided any option to stream local videos as it’s a very important feature for an awesome device like Chromecast. Hope in future Google will come up with a desktop app to stream local videos.

Not for you, If

  • you are looking to stream local videos.
  • you have no Wifi device.
  • your TV have no HDMI slot.

Written by Sony Arouje

November 18, 2013 at 6:02 pm

Posted in Review

Tagged with ,

KeyNotFoundException from NHibernate’s Session.Evict

leave a comment »

We started getting KeyNotFoundException when we evict an entity from session. The error is not consistent, some time it work and some time it wont. Searched a lot for the cause of this exception but not got any proper solution.

As per the stack trace, the error is because it couldn’t find the key in a collection. In a collection an entities identity is based on the hash code. In this case the entity has composite key. In the GetHashCode function, we append the values of composite properties and get the hash code of the resultant string.  When I start checking in more details I saw some properties we used in getting hash code is not exist as part composite key in the mapping file (some keys were removed from the composite mapping but not updated GetHasCode()). I need to do some more analysis to find why those extra fields screwing up the GetHashCode function. I will update the post later if I get the answer.

To avoid these kind of issues make sure to use only composite properties in the Equal and GetHashCode function and avoid using properties that are not part of composite.

 

Happy coding…

Written by Sony Arouje

November 13, 2013 at 6:12 pm

Worse denormilization I ever heard

with 4 comments

I was interviewing a guy for a new project with 7+ years experience. To start with I gave him a problem of representing a sales order in C# class. The candidate asked some more details about the Sales Order, so I explained like, I went to a shop and purchased Paste, tooth brush, etc, that means a sale order can have multiple items.

He tried for some time but couldn’t come up the class design. In my mind I already rejected him, to give him a feeling of some success, I asked him to design the table structure for the Sales Order. This is what he come up with.

Column Name Data Type
OrderId int
OrderDate Date
Paste int
ToothBrush int
Rice int
Onion int
….  
…..  

 

He explained the design as well. If the user purchase Paste then the Quantity will go to the Paste column and like that. I wanted to see how extend he will go. I told him that my company have 100k products and how you will fit it in the above design. He answered, alter the table and add 100k columns to that table.

I interviewed so many persons in my career and never talked about the details to any one. But this one was the worse interview I ever had and thought of sharing it.

 

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Martin Golding

Let me know if you guys have any experience like this.

Written by Sony Arouje

November 12, 2013 at 12:58 pm

Posted in Uncategorized

Tagged with

%d bloggers like this: