Saturday, 5 April 2014

Ordeal of Mobile Devices – The Frying Batteries


I was first introduced to batteries by my father who used to change AAA battery in our crimson rimmed wall clock, once a year. I was fascinated by the chemical reactions and the magic of ions involved in storing and discharging power. I even carried out some childhood experiments on them after watching the famous Duracell advertisements in television. Since then, Devices have made significant leap whereas batteries which power them have increased their sprint power, but not the galloping ability.


Today’s smart and portable device users are victims of short life fried batteries and their daily charging rituals. And when you try to replace them, they almost cost the new device price which is ridiculous! As a consequence, battery life of the device has become an important criterion in purchase decision. It also makes one to think that it could be a strategy adopted by device manufacturers to ensure constant demand in market.

There are many websites, blogs and device manuals which recommend following tips in general.  Some of them are proven to work but with meager results, while others are like alchemy tricks.
o   Each charging eats away one cycle of battery. So charge it fully and run it till it is near empty.

This is easy to say, but tough to follow. Users don’t want to be caught off-guard or be blocked by drained battery during important occasions or at a place where there is no outlet to recharge. They charge it as and when they remember, just like refueling your car and keeping it ready.

o   Don’t keep it plugged in for a long time.

Generally when you are playing intensive games and that too for long hours, you don’t want to be annoyed by ‘popup’ messages. So users keep their devices connected. Why can’t we design smart adapters which will sense the battery level in the device and then pass on the charge to it when needed?

o   Turn off the high power consumption applications like Wi-Fi, Bluetooth, and GPS etc.

Bluetooth and GPS make sense, whereas Wi-Fi is unreasonable. It is what that makes the smart portable devices score over the traditional wired ones. So, the application providers must include power consumption too as an essential non-functional requirement for their product and must specify it along with the hardware requirement.

o   Close unwanted browsers.

Users prefer to keep recently visited interesting web pages open for quick near future reference. Though the modern browsers do provide detailed logs of history and bookmark features, yet they are not so popular when compared to this practice. So, we need more UI design changes to effectively increase the usability of this powerful back end feature. Similar story is found with cluttered desktop, why can’t we provide a virtual desktop overview with quick access features?

o   Shutdown the system, when not in use.

Long time taken by OS to reboot had made users to leave their system on and incline towards sleep feature as a power saving mechanism. This feature requires creation of temp files and logs to recreate the last login session during reboot; as a result it clogs the system in long run. Why can’t we design JVM kind of component for OS to clean up the mess?

o   Frequent updates are necessary.

Users are generally averse to changes, as they do not want to disturb the current setup and waste time in troubleshooting it. I believe the cloud and SaaS seems to be the answer for this problem.

I have tried almost all of the above tips and was successful in reducing my battery charging cycle frequency from every day to once in two days. It appears to be trivial in words, but if you see in numbers it is nearly 50%!

Feel free to share your tips gained from experience and also funny alchemy tricks.

Source:

Sunday, 30 March 2014

Favorite pastime websites (Contd .....)

Some of my favorite YouTube channels which keep me occupied on weekends. These shows will help you to cater to “kid curiosity – why, how and why not?” part of your brain.

·         Science
o   Dnews,
o   AsapScience,
o   Vsauce,
·         Life Skills
o   In59seconds,
·         History
o   Crashcourse,

·         And of course, Ted Talks


Thursday, 27 March 2014

Favorite pastime websites

I have been trying to collect and keep track of my favorite pastime websites for a long time. As part of this initiative, I have composed the below list. It is a mix of technical and non-technical stuff which have given me inspiration to write blogs and fodder to my thought process. You are also welcome to share your lists and observations.
Date: Mar 26, 2014
a.       1. LinkedIn – Apart from standard features like professional networking, posts and interest groups, the new features like – Influencers, and Pulse help you to further streamline your feeds and keep track of your interest areas constantly. It has overtaken my Facebook usage time drastically in the past three to four months.
b.      2. Youtube
a.       Saurabhschool – Best place to learn complex data structures and algorithms with lucid explanation and examples.
b.      ‘Oru thedi – Oru Seidhi’ – This section of the Tamil channel – Vikatan Web TV provides simple digest of inspiring stories every day to start your day with positive note and a capsule of knowledge along with a cup of coffee in the morning.
c.       3. Online courses
a.       OpenSAP and OpenHPI – In-Memory technology, SAP products, parallel programming, etc.
b.      Coursera – Covers various topics including evolving fields like Data Science, mobile platform, bioinformatics, etc. Also you can pursue courses related to other fields such as business management, music, etc. All courses are provided by professors from highly reputed institutions like Stanford, Princeton, Rice, John Hopkins, etc. The course structure and delivery gives a classroom experience tailored for working professional lifestyle. Moreover, it is free!
Some of my favorite courses
                                                              i.      Algorithms by Prof. Kevin Wayne and Prof. Robert Sedgewick
                                                            ii.      An introduction to Interactive programming in Python by Prof. Joe Warren & others.
                                                          iii.      Specialization courses on Mobile cloud computing with android.
c.       Lynda.com – Provides video tutorials with work out exercises on hot technical topics. The attractive feature of this paid web site is that we are provided transcripts along with the video, which is easy to go through and take notes. Some of favorite courses
                                                              i.      Git Essential Training
                                                            ii.      Design Patterns
d.      4. My favorite java blog - http://javarevisited.blogspot.com/
I admire the way blogger constantly updates on various features and issues of Java and Object Oriented concepts. His write-ups are meticulous and to the point. The associative pattern of the blog structure drives the concept to home for the reader.
e.       5. My daily dose of tech news are supplied by
a.       At home - https://www.yahoo.com/tech
b.      During commutation – Google’s Play Newsstand app which fetches me tech section of Forbes Latest News and The New York Times.

f.       6. Also the ‘On this day…’ section of the Wikipedia main page quenches my thirst of learning about various battles, the strategies adopted by the commanders, the technologies used, etc.

I
I

Monday, 24 March 2014

Forest Thumbs

We often come across the news especially during summer that wild animal like Elephants enter into border villages seeking water and food. Changing climate and human greed are the sole reasons for these human and wild life confrontations which results in severe crop, infrastructure and human life damages. The current approach of simply scaring and chasing them away back into the depleted forest doesn’t resolve the burning issue.

People keep pleading and blaming government and forest officials for this perennial problem. Which government has enough money to cater the needs of animals when they can’t meet the needs of the taxpayer itself? Also it is tough to realize successful private projects like Shamwari group of South Africa at every corner of the world.

Instead of blaming others, the people of the border villages need to pitch in. They need to form self-help groups, volunteer to restore forest wealth (nothing expensive – simply restore and create new water catchments areas, strictly avoid deforestation and forest land encroachments). If possible, the local administration can pool in the needed manual labor from NREGA scheme. May be MNC too can pitch in by buying acres of land near forest, turn it into game reserves and provide it as vacation spot to its employees.  And gradually start demarcating or fencing of the entire forest landscape with help of eco-friendly and energy efficient methods invented by modern technological advancements. It is high time that we play the role of gardeners of forests - guard, prune and tends to its needs. Apart from resolving the current problem at hand, we can reap umpteen numbers of benefits out of it in the long run too.

When people show real earnest in protecting these animals and their habitat, obviously government will enact strong laws to support them.

Do not plead; instead lead by being a Forest Thumb.

Wednesday, 5 March 2014

Article on Data Quality Management

 "Data Quality Management - The Most Critical Initiative You Can Implement " by
Jonathan G. Geiger, Intelligent Solutions, Inc., Boulder, CO

Describes in detail with example
a. what is data quality management ?
b. what is the need for it in the industry ?
c. what are the skills and roles needed to implement it?

On the whole, a good read to get basic perspective about DQM.

Thursday, 6 February 2014

Reservation in eligibility exams

Till recently I had trouble in wrapping my head around the reservation concept, though a lot had been said and refuted regarding this issue in the past. This might be due to my inclination towards Technocracy rather than democracy. But according to a Tamil proverb, the intensity of pain involved in a headache or stomach ache could be realized only when one gets it. As said by some of the reformists, I believe one of the possible vaccines for this chronic illness could be inter caste/religion love marriages. It has made the dawn of a new society inevitable where one can trace his ancestry just like Europeans and Americans do i.e. ‘I am one eighth Italian, one fourth French, etc.’ After a detailed discussion with my mentor at office, I got some perspective which helped me to put this issue to rest.

But this can of worms got re-opened again after the recent news about Tamil Nadu government’s initial hesitation in lowering the pass marks for Teacher Eligibility Test for specific sections of the society. My school of thought is – “Though not all good learners are good teachers, yet a good teacher has to be a good learner. Then how can a mediocre student be a good teacher?


Arm forces, Teachers and Doctors – Do the people belonging to these fields do mere jobs, or is it a service to the country? They are not economic tools which help only an individual; instead they have the potential to mold fellow human beings. If we compromise in their quality, it will lead to irreversible damages. Just like some highest institutions of research are exempted from purview of reservation, so does this field too need to be exempted, in order to nurture a bright future for our country. Politicians have and are exploiting this situation for vote bank politics. It has aided indirectly to widen the gap between rich and poor, mushrooming private schools and their hefty donations, unattended government hospital institutions and stock market enlisted private hospital firms, finally brain drain. My simple question to them is this – Those who advocate these reservations, will they get treated by such doctors or get their children tutored by such mediocre tutors?  


Maybe, I believe in Spartan theory, yet it is better to have five Pandavas rather than hundred Kauravas! 

Monday, 16 December 2013

9 Steps to Becoming a Great Writer

Good article with simple steps that could be followed for achieving effective results. Click the below link for more information. Hope, I can lay my hand on the book - "The Elements of Style" soon!

http://in.finance.yahoo.com/news/9-steps-becoming-great-writer-133000803.html

Saturday, 30 November 2013

Tea Discussion - Friday November 29 2013

Hey guys,

Following is a brief coverage of a pastime discussion with my friend Abhishek where we munched over a specific topic along with tea on a rainy afternoon. Hope we might soon get our hands dirty in this idea! You are welcome to share your thoughts and hopefully be a future business partner! ;-)

Topic - 'Photos' – millions of photos per minute recording each precious as well as silliest moment of your life. How to mine/tap this treasure trove of information?

Text analysis has been exploited and tags are used for better semantic analysis – now it is turn for photo Analysis – image processing – Google goggles have made it feasible to search based on photos, though it is in its nascent stages. Also there are many photo apps such as instagram which have made photo sharing easy and lucrative to end users.


What features are needed - ability to identify what stuff you have, what could be marketed to you. What you tend to do often and what you like to flaunt. For example you keep posting photos of you and your dog, it is an ideal opportunity to market dog related products to you and more suitable if we are able to identify your dog’s age, breed, etc. and market suitable products.  Similarly which places you have been to and what you can do. For example, if you keep visiting museums and post more art stuff,  then it is not apt to promote safari trips to you unless you have shown open mind towards it.  Also the application can keep track of your interests and this can be used for future marketing to your kids and kinsmen based on human behavior studies. Whether it comprises your future generation’s privacy is a different question, but it will be definitely be helpful to detect what future trend will be. Many social experiments are being undertaken using the data shared at social network, one such freaky thing was posted in YouTube – show's host walks randomly to a person in the street and starts recalling like a psychic about all things which the person had shared in the social network using the location tags and his/her posts in the social network like twitter and Facebook. This definitely freaked out the audience, let’s see how much it will freak out the technology?

Sunday, 27 October 2013

Onions and Tomatoes

You might be wondering what these two words might have in common which made me to keep them as title of this blog and also caught your attention to peek into it. Well, one is vegetable and the other is fruit. No no, both are the best out performing commodities in today’s crashing stock markets.

Is it not so?

Arrey baba, stop wrenching your teeth, can’t you take this simple crap statement from your fellow citizen when in fact you meekly accept it repeatedly from the guys whom you voted to power or better say remained a mute spectator in their selection process? Yes, this is what it sounds like when these so called social workers give explanation about their deeds. In fact it sounds more like childish. If you ask a child why he did something wrong, he will give us a wild story or blame it on the other guy which might be even a silly (loyal) dog or (indifferent) cat. If nothing works, his last option would be to cry to make you feel guilty of questioning him. So does the politicians. Best example is the missing of coal gate files explanation, it sounded similar to a primary class student’s explanation for his inability to submit the homework – ‘Dog ate my homework!’  Difference between literate and illiterate paid social workers is visible in their justifications.  The former educates you about economic terms which the later doesn't know theoretically, but both end up hedging. Does it prove that every man has a child in him? I am not sure about it, but I am sure that I don’t want a group of spoiled children to shape my future.


How about you?

Wednesday, 18 July 2012

Optimized single pass -random record selection from a flat file


Problem Statement: 
Consider we have a file which has millions of unique records in it. We need to process these records in random order following some distribution process i.e. randomly select a unique record from the file every time, process it using any one of the available processing method and ensure that the final output records are spread as per the required distribution. How to achieve it in Single pass of the input file?

Possible Solutions:
a    a.    Create an index which can be used for picking a random record, and then corresponding entire record can be fetched from the input file and processed. But this is somewhat similar to double pass.

b    b. Another way is to add some extra field to all the records such as a running counter. The counter values i.e. 0 to number of records available in file can be stored in a list. This list can be shuffled to get a random order of values in it. Now follow the random order in the shuffled list and fetch the corresponding records from the input file for processing.

In above methods, processing speed will be slow if we do sequential searching to fetch the selected random record from the input file for processing every time. This can be avoided by using fixed record lengths/structure which can be used in calculating the exact record data location in the file. But this results in wastage of memory which can be gained by usage of variable record length. So how to achieve unique random record selection from a flat file with good speed and that too in a single pass?

If you know the solution, please post your reply in the comment. Stay tuned to know the solution in the next post.

Monday, 9 July 2012

Insert Vs Update Query


Assume that I maintain a huge denormalized table in the database which is used to maintain the details of user’s login session. Right now I am not interested in maintaining the user’s history, though it can be made as a future enhancement. It is expected that the system will be accessed by 1000+ users everyday more than once. Is it faster to have the user’s record updated each time when he/she logs into my system or is it better to insert new rows into my system for every session of his/her?

I believe we need to look this from two perspectives, the speed of the present operation and second the impact it might cause on the other future operations. Generally, the insert operation involves three or four stages at max, i.e. create a record, check for referential integrity or primary key constraints/insert trigger checks, third store the record in the database and fourth make an entry in respective indices. Moreover, we are not deleting the old records as database size is not a constraint, otherwise we need to think about ‘insert……..on duplicate key update’ scenario too. There is huge possibility in near future that our database size can grow out of control, and index size will not fit in our buffer pool. In that case we need to resort to distributed data storage or otherwise called data sharding which involves partitioning and replication. But smart sharding is tough to achieve and best solution available till now depends on the usage statistics to identify the hotspots.

Whereas the update involves search operation as a subset work. First you need to search for the individual record, fetch it, update it, check for the update trigger/referential integrity constraints, and then store it in the database and finally update the indices too if they are affected. There are lots of faster index structures like B+ tree which make the search operation less time consuming, but still it is an overhead.

Thus, I feel we can come to the conclusion that insert a new record would be better than update for logging in one record at a time when database size is not a constraint. But when we examine it from the other perspective, i.e. when a select/fetch operation has to be done, then fetching one matching record would be faster than many. This would play a huge role in web related systems where we display user information. So, it can be handled by attaching new field to the record which will keep track of the record creation time-stamp which can be used as a select criterion to fetch the latest/active record.

But does this hold good in case of bulk updates i.e. update without condition? This time update scores over insert, as it is mere operation of changing selected set of fields over all the records in the table. It is just like one multiple row insert when compared to multiple single row insert of related data.

There can be only one winner in a competition and he has to be an all-rounder or the guy who meets most of our needs. Thus in today’s world, memory has become insignificant whereas speed isn’t, so Insert has emerged victorious!

Saturday, 14 April 2012

Concurrency & Parallel processing

How different is concurrent from parallel in computer science concepts? I got similar doubt on difference between function and method  which I was able to understand from my critiques comments. This doubt arose when Prof Tony Giavargis explained in his Software for embedded systems class that ‘Concurrent is an illusion of being parallel’. How far is this true, how far are they different?

Can concurrency be achieved using a single processor(share resources) whereas parallel processing requires at least two processors(independent resources)? Does this mean multithreading/multitasking is an extended concept of concurrency while distributed processing is derived from parallel processing? Is concurrency subset of Parallel processing? Is there any better way to distinguish them? What are the objectives met by adopting them - is it high availability & speed? Both involve communication cost for synchronization and aggregation of results, former acquires less communication overhead than later, but doesn't guarantee the same level of speed as later. Does this play a crucial role in deciding which one should be used?

Please share your opinion in the comments section below, if possible with example.

Reference: http://www.linux-mag.com/id/7411/

Sunday, 1 April 2012

Reverse string with reduced time complexity?


I was asked to write a program for reversing a string in java using brute force method. I wrote the very general answer which uses string length and charAt() in a for loop. This method has O(n) time complexity, so I was asked to reduce its time complexity. We can use two counters, one running from first position of the string and second from last position of the string running till the middle position of the string, construct two reversed substrings which can then be concatenated to produce complete reversed string. But this will give only O(n/2) which is same as O(n). Are there any another approach to reduce the time complexity for the above program?

Please describe your approach in the below comments section.

Friday, 9 March 2012

Modern age Horoscope: Data Mining


Everybody is curious to know to what is in store for them in future and surprised to see some strangers know our past. But it is not always so, sometimes it makes us nervous and feel insecure too. Some people consider this age old fortune telling and horoscope to be a crap. But science has made significant progress in this field too and this has helped many industries especially the marketing segment. Today with such advanced statistic and number crunching formulas, Petabyte databases, sophisticated information retrieval techniques, highly co-ordinated distributed systems, one can easily deduce what your past was and what your future most likely would be. This is very important for vendors to concentrate their ad campaign on potential buyers like a directional antenna, instead of being an omnidirectional. You can see this being implemented in modern search engine results, ads flashed in web pages you visit, ad mail in your mail box, suggestion provided by eCommerce sites, etc. I hope soon matrimonial and dating sites would adopt this and help saving many marriages by bringing close most compatible souls. All are customized for you in lieu of making you to feel a special person based on the data you shared about your past.

It was rightly termed as Modern Age – Age of information. If we have or gather sufficient raw data, we can convert them into potential information using above mentioned scientific tools and expand our presence in the market. To get this raw data and that too voluntarily from you, so that you don’t sue them for privacy infringement, the vendors try to bribe you with special discounts. This often takes place in case of retail stores; where they give you a special card using which you can get certain discount on special items they sell. You fall for it, use it every time you purchase items to get that minimal discount and this sucks or entices you into vicious cycle of purchase and re-purchase. In this way the vendor can collect data about your past purchase trend and can market items you might need in future which he identified using the data mining tools. Thus they save money in unnecessary ad campaign and also retain their customer base. Retaining customer base is a crucial factor as it provides the vendor ‘word of mouth’ marketing free of cost. Whatever be the advancement done by science in the field of media, gossiping and reference have their place sealed forever.

It is good to feel special, but not always. I came across this funny incident at yahoo about how Target retailer was able to deduce that one of their customers, a high school teen was pregnant before her dad knew about it. They had sent some special discount mails to her about items needed for next stage in pregnancy after analyzing her past purchases. This had enraged her father who called them and demanded an apology. Later on when the truth came to light, he had called them back and apologized. The social networks too have business operations on their user information, since nothing comes for free in this world of capitalism. It would be great if vendors do not exploit their customer information, privacy in the name of marketing and governments direct them in their usage. Responsibility lies on customer/user too, and they should be careful about what information they share and how they share it. So let’s acknowledge this age’s horoscope power – range of its reach and be wary of it.

Wednesday, 8 February 2012

Farhannitrate & Prerajulisation || Bisentilator& Devenkatrination revealed


Almost all of us would have watched the movie ‘3 idiots’or its tamil version – ‘Nanban’. We would have certainly enjoyed the teaching comedy scene of Ranchod(Farhannitrate & Prerajulisation) or Pari (Bisentilator& Devenkatrination). It was funny to see all students including the dean fumbling with the book to decipher those terms. If there were any software engineers in the class they could have easily found the answer for the toughie posed by the protagonist of the film well within 30 seconds.

A small application of database concept would have done the trick. Are you able to recollect what it might be? If you had deduced the answer then you must be a software engineer. Yes, it is the index page of book. If anyone had skimmed thru the index page, they could have easily realized that those were junk terms. This shows the application power of software engineers who go for optimized results which is often called as smart work!

Tuesday, 10 January 2012

Wacky summary of Gale Shapley Algorithm


Prerequisite: You need to know what this algorithm is about; else it will appear to you another aimless paper which you tried to understand during the eleventh hour of your course.

Attentively listening to a lecture on this algorithm, one can realize how true this algorithm is. Following are the facts which could be observed:

1.       It is male dominated society at outside, so only man proposes.
2.       It is female dominated society at inside, so only female has the power to reject an offer. She can keep the relationship alive or break it.
3.       Male are always greedy, they run behind the best. Hence many guys will propose to the same best lady and try their luck. It happens mostly to all Indian cinema Heroines.  Female are always pragmatic and are very cautious in choosing their partner. As a result man gets his best (strictly literal) valid partner and a woman settles with her worst (not strictly literal) valid partner.
4.       Due to unknown reasons if invalid partners enter into a relationship it is always weak, unstable and will dissolve as soon as one (mostly female) gets a better offer.This is often the story line of many Indian TV soaps.

Thus this algorithm has demystified the secret of stable relationship by strongly recommending to choose a partner who rates you equally as you do him/her. So next time avoid being filmy, apply GS algorithm before proposing to increase your success rate.
 
“Will you Marry me………….?”

Reference: Chapter 1, Kleinberg & Tardoss Book on Algorithm
Pic Source: Internet