Monday, July 28, 2014

Priorities: Because everything has a minimum effective dose and a course duration

When, for what duration and at what frequency, these are specific to each task. Some tasks are important, some are urgent, something can be postponed without any damage, some tasks can be outsourced, some things need to be done by you and only by you, some tasks can be skipped, somethings have danger consequences of missing it. Quality of life depends on how effectively the tasks are done. Probably that decides who you really are, irrespective of what you think of yourself.

For example at 12.47 am I'm writing this, I have already missed my priorities. I can not go gym tomorrow. If I go to gym, I can not go to work on time, if I do those two I can not get 8 hours of sleep which is even more important. Why am I not sleeping now? Just cant sleep, overwhelming number of open tasks probably disturbing me. Why am I not working if that is the case? I don't have enough energy now. The real problem here is I need to sleep 8 hours everyday not 56 hours a week.

I want to get out of this loop. Here is what I'm going to do for that.

  1. List all the tasks including sleeping, work, entertainment, hobby projects, paying bills and any chore.
  2. Assign those with priority, due date/time, minimum effective dose, frequency, do I need to do or can be outsourced, can be postponed/cancelled as required.
  3. Automate whatever is possible.
  4. Outsource whatever is possible.
  5. Batch similar tasks.
  6. Never miss anything that has consequence on health e.g sleeping, working out.
  7. Reserve time for social activities.
  8. Time for reading/entertainment.
  9. Remove tasks from list that does not get time in the schedule, preserving priorities.
  10. Build/find a system to measure effectiveness and manage all the tasks.
I don't know if this will work. At least I wrote something instead of completely wasting the time :)

Sunday, March 2, 2014

Learned from mistakes

This is republication of an old post. Lessons learned from my mistakes.

1. Never have uncommitted code, when switching context.
2. Never ignore a peice of untrusted code because it works.
3. Before providing the access specifiers make sure that its appropriate.
4. Minimize hard coded paths and Sql queries, put them in configuration files.
5. Never ignore/suppress errors/warnings if it can be fixed or improved.
6. Pay attention to Naming convention of Classes, Methods, Variables and the packages.
7. Always have the Implementation Class named after the interface.
8. Sort members according to visibility and dependency.
9. Try to minimize the number of lines of code and make it more readable.
10. While making loops make sure that most appropriate condition is being checked.

Friday, October 4, 2013

Is reading books useful?

Answer is yes, books are always useful. The believe system we have now is a combined result of everything we know yet. Though we don't realize the result immediately after reading a book. Books give a lot of information, experience of other people's life, lessons from success and failure of others. This gives experience of many lives, which I could have never afford to live on my own. This gives reasons to look myself from a different perspective, challenge my old beliefs.

A book is completely different from a tutorial. Unlike tutorials books can not be followed step by step. Books talk more on raw principles which should be personalized to be used. And to personalize, it needs to be understood thoroughly.

As I read, I understand, I change, I change everyday. I'm often asked, are you being mislead by books? No, I'm not mislead. I don't believe anything blindly and don't use any principle that I do not understand completely. Because of curiosity I start way more things than I can handle, this should not be confused with being mislead.

Monday, August 19, 2013

Starting all over again

I have grown bulky in all possible ways; body, cost of living etc, but I always wanted to be nimble. Health is not in it's best condition. Gone off road from what I wanted to be, some part of it is intentional, most of it is unwanted consequence of my deeds. Life values are diluted, again some changes are intentional and most are changed because, I was afraid to be rejected(not liked) by people. Other major reason is my laziness.

I'm not expecting to be a superman overnight, however want to put things in right direction, right from now. I'll still do mistakes, but it should be only because of my inability, not because I'm afraid.

Following things should be achieved in 200days, i.e by Friday, March 7, 2014

  1. Good Health condition, No Sick Leave.
  2. Reduced cost of living, Credit Card Free life.
  3. Math, Probability & Statistics refreshed.

Saturday, November 24, 2012

JVM Memory management: Garbage Collection



Most of the questions related to memory would have been answered by the image above. There are two and only two major partitions in JVM memory, Heap and Non-Heap. All the other type of memory space or pools we have heard belong to either of these two. Java specification does not enforce any specific implementation of memory, it depends on JVM implementation. The JVM of Oracle is named HotSpot.


Young Generation:
Here garbage collection is frequent and less expensive.
Eden Space: Initially all objects created here.
Survivor space: Contains objects that survived garbage collection in Eden Space

Old Generation:
Here garbage collection is less frequent and expensive.
Tenured Space: The objects survived the garbage collection get moved here.
PermGen: Contains meta data of the virtual machine, class and method objects.

Garbage Collector:
It is a low priority daemon thread. It frees memory of any object that is not reachable from a live thread. We can suggest JVM to do garbage collection by calling Runtime.getRuntime().gc() or System.gc() which internally calls Runtime.getRuntime().gc(). Runtime is singleton. We can configure type of garbage collector to be used by passing command line arguments to JVM. For more details on garbage collection http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html 

To configure stack memory  -Xss1m
To configure heap memory  -Xmx512m -XX:MaxPermSize=256m



Sunday, August 26, 2012

Advantage of distraction


Mid term exam is approaching, I need an excuse to procrastinate studying. I wanted a countdown timer that shows me how much time left for preparation and how many hours required per day. I could not find easily, so made a small HTML5 gadget. It works offline, and only offline as of now.

 Advantage of distraction is that I learned how to make the HTML5 gadget work offline. Also how to make a windows sidebar gadget, as the initial ideas was to make a windows gadget.

Here is how to develop a Windows sidebar gadget. http://msdn.microsoft.com/en-us/library/windows/desktop/bb456468%28v=vs.85%29.aspx

It's easy to make a web page work offline. Below is the code, write that in the page you want to make work offline.

<html manifest="cache-manifest">

Now create the manifest file with name "cache-manifest" and write the below code in it

CACHE MANIFEST
page1.html
my-script.js


And finally how to write HTML code inside a blog post :)

Wednesday, June 13, 2012

Insights of Snap Judgement

Taking decisions involving emotions is like solving an open ended problem, in either case we don't get a logical concrete solution. I feel avoiding such situations are almost impossible. Most of the time this involves snap judgement without much details of the context. Psychologists working on subconscious mind say somehow brain got a system developed to function in such situations and we should not interfere with that. As  Malcolm Gladwell has written in his book Blink "Introspection destroys the ability to solve insight problems. Introspection messes up with our reactions." It's simple we can not always rationalize and explain our feelings. e.g Why we are attracted to someone, why we  like certain food etc.

The system in brain is reliable most of the time but not always, such error are called Warren Harding Error. One more example is  http://en.wikipedia.org/wiki/Amadou_Diallo_shooting. A different flavor of this error is volume of info may always not help, best example is divorce, despite the fact that people collect lot of fact on  their spouse.

Difficulty here is, when, what and how much info to collect. Even if want, it may not be possible all the time because of time constraint and complexity of understanding the opponents intention.

Conclusion:
Need to rely on the system brain already has. The core of that system is Implicit Association, so we can work on this, read more, observe more, listen carefully..........

Saturday, April 7, 2012

Rethinking Think and Grow Rich

Any theory or opinion works only with specific audience and in particular context. Vision, recognition of problem, decision making skill etc are important for doing business. Think and Grow Rich says experts are in every corner of the world use them instead of being one more expert. First need to decide if you want to be an expert or someone you use the experts.

Wednesday, September 28, 2011

My Logger is ready to use

This is your personal assistant and stays online 24x7x365.

My Logger(mylogger@followinstinct.com) is ready to use. It is a chat bot that you can add to your gmail or any XMPP based mail account. Once your account is active, you can save info with a tag and can retrieve it later by tag. IM is the simplest way to access and store information.

Signup Instructions:
  1. Invite mylogger@followinstinct.com to your chat account. It can be gmail or any XMPP based account. Thats it, you don't need to install any software or do any registration..
After your account is active. Instruction to use the application:
  1. To save data see the below example
    movie: Inception
    Here movie is the tag and Inception is the info to be saved. You can add any number of info to a single tag.
  2. To retrieve data by tag see the below example
    L movie
    Here you will get all the info associated wit the tag 'movie'.
  3. To retrieve all info irrespective of tag see below example
    L
    Yes, just l. It will list all the information you have saved.
  4. To retrieve all tags
    tags
  5. To remove the last information you entered
    undo
    You can keep doing undo any number of times, there is no limitation. Be warned there is NO REDO.
This project is not complete. Please send me your comments and suggestions at support@followinstinct.com.

Wednesday, July 20, 2011

Consequence is consistent with cause, no matter what!

Consequence is consistent with cause, no matter what! This is known to everyone, still I feel like repeating. What we are now is result of what we think, what we read, what see, whom we speak, whom we work with, the events we involved with and so on, which includes the entire world directly or indirectly. When the whole world is contributing towards us, what we need to do? Just manage where you want to get involved directly and where indirectly, because priority matters which in turn is outsourcing.

This is gist of 2 books I have read long back Outliers By Malcom Gladwell and Think and Grow Rich by Napoleon Hill

Sunday, June 26, 2011

Artifact creator, maven command generator

I have written this program for my own requirement. I feel it is a generic one. I have written a test program for adding a new feature, now I want to add that feature to my real application. I need to find what are the additional jars used, and create pom dependencies. This programs takes 2 required parameters and 1 optional parameter. Click here to download.

Parameter list
  1. Source1: Path to lib folder of the test program(required).
  2. Source2: Path to lib folder of the real program(required).
  3. Pom: Path where the output will be printed(optional), output can be seen from console.
Features
  1. List of jars available with same version.
  2. List of jars available with different version.
  3. Maven command for installing the new jars into maven repository.
Here is the command to use this program

java -jar artifact-creator-0.5.jar -s1 /path/of/lib/folder/of/test/program -s2 /path/of/lib/folder/of/real/program -pom /path/of/file/where/output/printed/optional

Sunday, June 19, 2011

Logic and Observation both are important

Most of the time decision can be of two types "Logic Lead" and "Observation Lead". Logic lead decision making is internal and based on the facts/information someone already know. Where as sometimes we don't need to think so much to conclude a decision rather need to observe the context and even the question carefully to get the answer.

In logic lead decision making the biggest mistake someone can do is ignoring to consider the targeted audience, after all audience is who evaluates the quality of your decision. But decision maker is solely responsible for the longterm effect of the decision be it good or bad.

Sunday, October 10, 2010

Robot movie: A prototype of future AI

I watched the movie Robot and liked it. Here I'm talking about the creative part of the movie, neither concerned about the story of movie nor even the way the actors played their role. The movie can be used as a prototype for the AI projects.

I love programming and Cognitive & Brain Sciences are my passions. Neuron schema of a AI project can be the combination of both. This is first time I'm searching for AI related programming, not aware of any such open source projects, hope will find some interesting projects, Please post links in comment if you find any such projects.

I need a robot which reads books, learn new things, make summary of books, answer questions. Even if not all books it should be about to read programming & business books, the books I mostly read.

I don't want it to write program and take my job away, don't have a girlfriend so no worry of losing that :)

Monday, July 26, 2010

Which is strong is not flexible.

Being flexible does not help always. Thinking as if Kisor became so pessimist, not exactly I'm just making an adjustment in the trade-off point. I decided to be little rigid to make myself more efficient and make better use of resources. Here I remember one more point; people feel you are important when you reject them rather when you accept. A better trade-off between flexibility and rigidity is needed when you are going to lead/manage people, because the decision affects all the people in team not just you. The common goal is always more important than any individual contributor.

I have recently read two books FIRE SOMEONE TODAY and iCon which advocates this kind of philosophy.

Wednesday, February 17, 2010

"Inline decision making" is unproductive

"Inline decision making" is a new phrase but self explaining, does not need further explanation. And this is the reason for my countless pending projects. Measuring the performance, progress and return on investment etc are good, when under certain limit, these will help in planing and making decisions to reach the deadline with available resource and time. Its better to have some milestones to, that will give opportunities for faultfinding and decision making. Act for the sake of service without consideration for the results as Bhagavad Gita says, however forgetting about the milestones and deadline will send us back to the age of Bhagavad Gita, be careful. I was a bit addicted to plan for the result, and did not do anything except procrastinating, finding reason for delay and planing again, this was an infinite loop, now I terminated it abruptly.

Sunday, October 25, 2009

Fixed Record file parser

/**
* This functions takes one line of fixed record file as sting and returns
* array of fields
*
* @author Kisor Biswal
* @param string
* @return
*/
private String[] splitter(String string) {
// Lets get the string by space
String[] subStrings = string.split(" ");
// Oh we have to consider the the spaces inside, Okay no problem we will
// joint these back
List finalResult = new ArrayList();
List tempStrings = new ArrayList();
boolean isFirst = false;
for (String s : subStrings) {
// Do the string contain double quote?
if (s.contains("\"")) {
// Yes, Lets check if first time
if (!isFirst) {
// Yes, add the sting to temp list and go ahead
tempStrings.add(s);
isFirst = true;
} else {
// No, Ok now time to concatenate all temp strings and
// append to final result list
tempStrings.add(s);
StringBuffer buffer = new StringBuffer();
for (String ts : tempStrings) {
buffer.append(ts);
// Put space back
if (!ts.endsWith("\"")) {
buffer.append(" ");
}
}
finalResult.add(buffer.toString().replace("\"", ""));
// Now just toggle the

isFirst = false;

}

} else if (isFirst) {
// Yes, add the sting to temp list and go ahead
tempStrings.add(s);
} else {
finalResult.add(s);
}

}
return finalResult.toArray(new String[finalResult.size()]);
}

Friday, August 21, 2009

PWC6033: Unable to compile class for JSP

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
at org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:105)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:924)


org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP


at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:107)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:280)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:347)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:400)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:477)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:371)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

SOLUTION worked for me

adding tools.jar(/usr/lib/jvm/java-6-sun-1.6.0.14/lib/tools.jar) to class path.

Saturday, August 15, 2009

I was scared of mask wearing people, Swine Flu

desease swine, influenza A, i'm not infected....Image by Dan Queiroz via Flickr

Today morning I read about swine flu from my most trusted source information wikipedia. What understood is, swine flu is not that much dangerous as I have perceived. The normal good health habits can bit the flu easily. Even if someone is infected it can be cured.
Yesterday I was going to Paradise circle in a cab from Dr. A.S Rao Nagar, near Nadermet a group of people get into the same cab. I was scared of them as they were following everything whatever I have read in newspaper, wearing mask and drinking water frequently. They all belong to same family; children, father and mother. First I thought better to get down and go by hiring an auto, later I thought its better to ask them. So I asked "Are you all scared of swine flu or......?". The answer was "its better to be proactive, right?". This gave me enough confidence to not to get down from the cab, still I was worried and was trying to breath fresh air from the window. Came back by auto to avoid mask wearing people :).

Reblog this post [with Zemanta]

Thursday, July 23, 2009

Programming is not mere use of left brain

The human brainImage via Wikipedia
Few months back I have seen the video "A Whole New Mind: Why Right-brainers Will Rule the Future" of Daniel H. Pink. Where he professes why Right-brainers Will Rule the Future. Everything he told made sense to me, everything was logical. Mostly he is talking about outsourcing from US to ASIA, in these outsourced works programming was also included. But after seeing the programing language Scala and Lift framework I felt like programming is not mere use of left brain. As far as I understand programming needs "A whole brain" neither left nor right brain can help alone. Sometimes after getting frustrated by trying to solve a problem sequentially and logically, we find the solution by thinking in random with no logic.
So we should give a chance to right brain when the problem is taking longer than usual time. And should think beyond the existing technologies to solve the problems we have, at least once a week if more is not feasible.

Reblog this post [with Zemanta]