Saturday, August 1, 2015

How to fix Chrome, Firefox Blurry, Over bright, fading after Windows 10 Update

Today morning, I updated My HP Laptop to Windows 10. First impression was great, crystal clear images, better wallpaper, better themes, better welcome screen and improved start menu and task bar at right hand corner. But when I open Chrome and Firefox the text look faded, more bright and contrast was not perfect. Since I had not changed anything, I suspect this is the Windows 10 default settings which is causing problem. I knew it before because I had also faced similar issues when I was moved from Windows XP to Windows 8 and then Windows 8.1 update. If you are facing same problem where your Chrome, Firefox are not looking clear, instead looking blurry and faded then you need to adjust your Laptop's screen brightness, contrast and gamma. I really hated initial impression of Chrome because next wasn't clear, everywhere seems over bright without sufficient contrast, but thankfully after adjusting contrast, brightness and gamma I managed to get the clarity back. If you face similar issue after upgrading to Windows 8 then you can follow these steps to fix it.

Wednesday, July 29, 2015

Top 5 Data Structure and Algorithm Books - Must Read, Best of Lot

Data Structure and Algorithms books are often taught as text books in various universities, colleges and Computer Science degree courses, yet, when you put programmers in a situation, where they need to find and decide, which data structures and algorithms to use to solve a problem, they struggle. I have seen this, and I think one reason of this is perspective. When you read something as text book and your perspective is just to do well in exam, you might not be thinking about learning and applying that knowledge in real world problems. Since data structures and algorithms are core of any programming problem, it becomes extremely important for programmers to master them even if you have learned well during academics. In this article, I am sharing five of my favorite books on data structures and algorithms, which I think are great read and can help every programmer to master data structure and algorithms. I have chosen these books because of different reasons. Some books are really easy to read and there focus is aligned to my expectation, some of them are really comprehensive and can be used as reference material, and few of them offers different perspective of using data structures and algorithms e.g. while solving a real world problem or helping to crack interviews at Google, Amazon, Microsoft or Facebook. It's hard to judge your knowledge of data structure and algorithms by knowledge based questions, because that's not how they are used in project. It doesn't help to know about every single detail of a Car, if you can't even drive. This data structure and algorithms books has helped me to find and fill in gaps and taught me a lot of things about different data structures e.g. stacks, queues, linked list, arrays, hash tables, heaps, trees and graph. If you are using a different data structure and algorithm book, which is good and not in this list, you can share with us.

Monday, July 27, 2015

How to Calculate Difference between two Dates in Java (In Days)

If you are not running on Java 8, then there are two ways to calculate difference between two dates in Java in days, either by using standard JDK classes e.g. java.util.Date and java.util.Calendar or by using joda-time library. Unfortunately, Java's old Date and Calendar API is buggy and not intuitive, so many of us by default use Joda for all date and time arithmetic. In this example, you will learn how to find  number of days between today and any date entered by user using Joda, as well as without using any third party library. When I first time face this problem, I thought what's a big deal about finding difference between dates? If you can convert Date to milliseconds then finding number of days, months or years is just a matter of simple arithmetic, but I was WRONG. I was not thinking about real world date and time nuisance like leap seconds, leap years, and day light saving time. It's very difficult to accurately calculate difference between two dates in Java without using third party library, unless you have time to develop your own library like Joda, which diligently takes these things into consideration. Thankfully, you don't need to worry because Java 8 got lucky third time. There is a new Date and Time API which has corrected previous mistakes and turns out to be a really gem. If you are keen to learn Java 8, not just this API, I suggest you to grab a copy of Java 8 in Action, one of the better books to learn new features of Java 8 in quick time.