Saturday, August 18, 2012

Is there any alternative for democracy?

Well very tough question. Almost all over the world people are fighting for more and more democracy and more freedom. May be in the next 10 to 15 years, you will not be able to find any non-democratic country on this planet. But bringing democracy is the only solution for the problems we face? The answer is a big NO at least democracy in the present form. Few reasons

- If you see any democratic country, people  participating in the democratic process are going down. There is no point of democracy if more than 50% of population is staying away.

- People are craving for more and more freedom, and democracy is promising it to people. Because democracy needs to keep people satisfied. Freedom is good, but how much freedom is good? Anything access is bad.

- Corruption is rampant in almost all democracies. Corruption is not unique to democracies, but I strongly feel that corruption in democracies is now a generally accepted phenomena. Some may call is lobbying, and may call it graft.

These problems always been there, why suddenly democracy will not work? The answer according to me, democracy is a process invented few hundred years back to suite the requirements of those generations. But now, you agree or not we are living in complete new world.

But is there any alternative to democracy? Well there none as of now. What should be the new system? Well that is something I cannot decide myself.

Tuesday, May 15, 2012

Scala Learning–Day 1

- REPL - Read-Evaluate-print loop
- Scala uses interpreter, but internally it uses a compiler to convert you code to byte code and run it on JVM.
-IN scala there are two ways of defining variables using "val" and "var". Val is like defining constant for which you cannot change value once assigned.
- IN scala we are encouraged to use Val unless you are really need to change the contents. Note that you need not specify the type of a value or variable.
- in case you need to specify a type then you use the below given way to do the same
val greeting: String=null
val greeting: Any="hello"
- IN scala, the type of a variable or function is always written after the name of the variable or function.
- Scala line does not to end with semi-colon, its only needed when we have multiple statements in a single line.
 
val xmax,ymax=100
var greeting, message:String=null
- Like Java, Scala got 7 numeric types and one Boolean type(Byte, Char,Short, Int,Long, Float, Double and Boolean). The difference is unlike java these types are Classes, which means there are no primitive data types.
With this you can execute methods on numbers
1.toString() which will written "1"

- Scala uses java.lang.String for defining String but it has StringOps which is more power full with hundreds of options. Similarly Scala got RichInt, RichDouble etc. to provide better options on the types.
- IN scala we use methods, not casts, to convert between numeric types
- The operators like +-*/%&|^>><< are actually methods though they just work the way they work in java or c++.
- IN scala static methods need not be called from a class. Lot of mathematical functions are defined in scala.math and we can import this using
import scala.math._ (_ is the wild char in scala like * in java).
- Scala does not have static methods instead it got "Singleton Objects".
- Scala classes got "companion objects" whose methods, whose methods just act like static methods.
- Scala methods with out arguments does not use parentheses. For example StringOps distinct does not have any arguments which you can use like "Ashok".distinct which will written all the distinct char in the string. One important note here is parameter less method that does not modify the object has no parentheses.
- In scala if we use "Ashok"(2) will written 'h'. It just works like "Ashok".charAt(2) in java. You can think this as an overloaded form of () operator.It is implemented with a method name "apply". In this StringOps its defined as given below
def  apply(n:Int):Char

- Downloaded scala from http://www.scala-lang.org/downloads. As I use windows 7 I downloaded the msi file and installed with out any issues.
- After installation check the path in the system variables for some reason I found that the path is like "C:\Program Files (x86)\scala\\bin", remove the extra '\' then start the command prompt and type "scala" which will you REPL. It running slow compared to python console. May be its because of the JVM.

Configuring eclipse  to program in scala


- Got Eclipse Indigo and extracted the files from ZIP file.
- The went to http://scala-ide.org/download/current.html and found the link to download site for scala IDE for eclipse. http://download.scala-ide.org/releases-29/stable/site
- Started eclipse from Help->New Software and downloaded the plug-in and installed it.

Wednesday, February 01, 2012

Best note taking software CintaNotes

Not sure if ever had any requirement to take notes when you learn something new or want few words as you think and keep those words in secure place for future reference. I been trying to find a tool for doing the same for a very long time and I tried lot of tools like wikidpad, spring pad, microsoft onenote etc. But I found this simple portable tool called CintaNotes and this exactly what I am searching all these days. Few things I like about this tool

- Very simple to use no nonsense in UI.

- Can save your .db( files you save you notes to) files on dropbox, so that you can access from anywhere.

- Fast as-you-type searching

- Clip text from anywhere. Just select it and press the hotkey!

- Portable.

 

Just try this amazing but simple tool and let me know your comments.

Tuesday, January 31, 2012

Book review: God Save the Dork: The Incredible International Adventures of Robin ‘Einstein’ Varghese

God Save the Dork: The Incredible International Adventures of Robin ‘Einstein’ Varghese God Save the Dork: The Incredible International Adventures of Robin ‘Einstein’ Varghese by Sidin Vadukut
My rating: 4 of 5 stars

After a very very long time I laughed while reading a book. Better than Chethan bhagat books(Except five point someone). A must read for all the fun loving reader.

Even though its not a new way of presenting a story, telling the story using dairy entries of main protagonist is really cool. Now I am going to find the first part of this book and will read and write a review here. :)

View all my reviews

Monday, January 16, 2012

Some more thoughts….

This is continuation to the article http://www.whatay.com/2012/01/13/dont-make-me-put-it-up-on-ebay/#disqus_thread

1) Do something about Indian Railways.
- First stop looking
at this department for giving more jobs to the unemployed, so that you can brag
about that in your next election.
- A full time
minister for this department who reports to PM and Parliament, not to some lady
who sits in Bengal.
- It’s a shame after
60 years of independence our fastest train runs 80 KM/H avg speed( yes I am
talking about Shatabdi Super fast express :) ). Whereas our neighbor got trains
to run 300 to 500 KM per hour.
2) Cancellation of food security and 100 day a year work
programs. Ban all freebies given by government.
- I strongly feel
that these programs are doing more bad to people than doing any good. Instead
do something to empower people.
- Cancel PDS
departments run by state and central government;  instead subsidies should be given to people in
the form the money using smart cards.
3) Constitutional amendment to make voting mandatory for all
the eligible citizens. This is the only way to make sure the right people gets
elected and this is the only to get some real progress.
4) Stop spending any more money on government education;
first clean the system which is in place. If you think it’s not possible to do
that, then provide health care insurance for all the people in this country.
Also given money to kids for their education so that they can choose their
school and a real school.

Sunday, January 15, 2012

Book review : Steve Jobs by Walter Isaacson

Steve JobsSteve Jobs by Walter Isaacson
My rating: 5 of 5 stars

In few words:

This is the best biography ever read. The reason is the book subject and the author of the book, both are amazing.

View all my reviews