Tuesday, December 9, 2014

Improving Ourselves

When we decide to improve ourself in a particular field or particular skill, the best way to keep up is testing ourselves in that field/skill.

Basically, a little bit of test driven development.(absolutely not applicable for extremes).

Fail at first step in the ladder of your skill.
Do what is necessary to pass the first step.

Fail at second step.
Do what is necessary to pass the second step.

and so on.

Thursday, October 2, 2014

Coverity Issues - JAVA

First of all, I am curious of how coverity finds a fault in code, by doing static analysis.
But in this article, I wish to cover
1) The variety of issues found by Coverity,
2) How to address each of them,
3) What is the rationale behind each of the issue?

1. Relating to Static Inner Classes:

SIC: Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC)

For example, it flags that inner class should be made static.
package com.question.inner.stat;

public class ExperimentStatic {

  * @param args
 public static void main(String[] args) {
  // TODO Auto-generated method stub  
  ExperimentStatic.NestedClass expVar = new ExperimentStatic.NestedClass(3, "dfdpstr");
 static class NestedClass{  
  private int i;
  private String str;  
  NestedClass(int id, String pstr)
   i = id;
   str = pstr;

Wednesday, March 12, 2014

Windows Address bar

Just yesterday, my friend was sharing a tweak which my junior had found.
Basically go to Windows Address bar in some folder and type cmd.
It will open command prompt pointing to that folder.

1. Press Windows + E. This will open My Computer.
2. In Address bar on top, now type cmd.
3. It will open command prompt pointing to C:\Windows\system32.

4. Go to d: drive or f: drive, Now again type cmd. It will point to d: drive or f: drive.

Why all this? You can avoid typing cd in command prompt. This is for those who are lazy typing folder names in command prompt and trying to go to navigate to that folder.

But windows address bar is not some basic address bar.
I think it is parallel of run utility.

Just type any thing which you are used to doing in run.
For example: msconfig.

Now type msconfig in windows address bar. It opens up Configuration Utility.

Thursday, February 27, 2014

Is Windows Phone Security Measure Good or Bad or Ugly?

Phone: Nokia Lumia 920.
Software: Windows Phone 8.0
Scenario: Password Screen on smartphones.

Assume you have used a phone for quite a long time. One day, someone takes it without you knowing. Lets call that person 'Trudy'.
Trudy tries to enter password.
Trudy fails to enter 'correct password' 9 times.

Phone asks to enter passphrase which is shown.
After entering passphrase correctly, it gives one and only chance to enter correct password.
If  Trudy enters wrong password, then your phone is reset. All your data is erased.

I feel this security measure is not good.
It may not be bad.
But, it is surely ugly.

Need to check how android phone tackles this scenario.

Android phone asks to enter password.
It allows to enter 5 times.
After 5 times, if it fails, then it puts a timer for 30 seconds and allows to retry again for another 5 times and so on.

Till now, I tried with wrong password 25 times. It put a timer. I dont know what is the max number of allowed retries. But this is better than windows, since windows gives a chance to trudy to reset data on phone.

Friday, February 14, 2014


This is about git. Linus's brainchild... I think he created this out of frustration of using existing versioning softwares.

Anyways, the reason for this blog is this:
I accidentally deleted some files from IDE. Not my own files, but month's work of my colleague.

1. Opened up git gui.
2. Selected a file in unstaged panel. Did a reset.
3. All deleted files were restored.

Happy that files were back.