Saturday, March 15, 2014

Wai wai, not at all healthy.. Also contains MSG

Disclaimer: Read this if you are interested to adapt healthy food habits :) Skip it , if you don't care.

Hi Folks. I expect that you must have heard about Wai wai. Its a Nepalese noodle brand, manufactured by Choudhary Group , Nepal. Its now being manufactured in India also. The Nepalese version of it contains MSG (monosodium glutamate) , but I don't know about the Indian version (please check). Some blog/ research says MSG as cancerous, causing heart ailments... All leads to shortening of your life..

Hold on, you must be thinking ... I know that... Big deal if it has MSG.. Or you would say I don't see that listed in the ingredients. Manufacturers are intelligent. They has mentioned this as "(621, 627 & 631) Flavor enhances" under ingredients on the packet. With a small note in font size 2 or 4 pts " This package ... blah blah contains Monosodium.. "...

Image:

I am penning this out for social awareness. Wai wai has been my favorite since several years. I would we all love it, but it's time we should plead the makers to look for alternative formula without MSG, as we don't want this brand to die. Until then, we can stop/ reduce the consumption of this product. As this is a health concern for all of us.

You all must be thinking, MSG is everywhere... Yes, almost in every processed food in one form or the other. I got an intensive list of food which we should avoid.

After reading about MSG for a while, I figured out it stays in blood vessel forever, Like you consume it , Count = X units, you again consume it , Count = X + Y.. and so on..

Let me tell you the symptom what this can lead to. .

Effects:
  1. rashes (see RIBO RASH factsheet), itching, burning, numbness
  2. migraines, headaches
  3. asthma
  4. irritable bowel symptoms
  5. chest tightness, heart palpitations, heart arrhythmia, anxiety (see HEART factsheet)
  6. irritability, restlessness, sleep disturbance
Effects on children: Children are more vulnerable to the effects of additives than adults. MSG and other flavor enhancers are not permitted in foods manufactured specifically for infants and young children (12 months or less). Effects can change with age
Frankly speaking, we all know all these highly processed food are not good for our health. I will try to lower consumption of such foods from today.. I hope even you do.. Until these companies learn that consumers are intelligent enough to figure out what is good or bad for them or we have a strict jurisdiction to figure this out.
.

Sunday, February 23, 2014

Urgent vs important

Off late I have realized that its very important for one to understand the Graph between Urgent and Important.

There are four combinations:-

1. Urgent and important
2. Not Urgent but important
3. urgent but not important
4. Not urgent not important

To manage our time properly and to prioritize stuff in work as well as personal life we should be able to categorize every task one of the above category. Henceforth, Its very easy to make your decisions.

Somebody has put this up perfectly -

“The most effective people make their important things, your urgent ones. The most ineffective people do the exact opposite.”

1. Urgent and important : This category is for critical tasks. Which needs to be resolved ASAP. We should avoid things to fall under this category as this is life is full of deadlines and possess high risks.

2. Important but not urgent: A good leader or visionary always keeps his/her tasks in this category. As it's a safe zone. A good manager foresees and senses any possible task which can be categorized as 'Urgent & important' and addresses them. We should not procrastinate tasks which falls under this category as there is high chance of them to become urgent and important. (Highly recommended)

3. Urgent but not important : This are things which should be handled if time permits and scheduled after urgent and important.

4. Not urgent and not important: This are useless things which should not be focused. One to stay away or procrastinate these things until he/she has free resources.


I found an image online, which can explain Urgency vs importance more :

Programming Windows Workflow Foundation 4.0

It has been long, like 3 years since I wrote my last blog post. I am little nervous :).

Think of an online task you do in your day to day life and it should have a workflow backing up. Eg. you buy movie tickets online (Its a client side workflow, you go to ticketing site -> chose tickets -> confirm -> pay).  Other workflow is server-side workflow which is a background task. Eg. when you buy a product on Amazon. Steps, Chose a product -> pay -> A server side workflow should kick off which contacts actual seller, calculates estimated delivery time, add order details in your account, send confirmation email to buyer and other individual tasks.

Today I want to write about Windows workflow foundation 4.0 (WWF). There are other workflow frameworks like Oracle offers, Sharepoint workflow etc.

But I personally liked this workflow framework. WWF a framework used to perform work intensive sequence of tasks (known as activities). Always remember, workflows are used to "Just Do Work".
Eg. Do X -> Check Y-> See P -> Send A and for 1 million users. Your workflow in workflow designer might look like:


I have been working on WWF since couple of months and I am amazed with the power of this framework. With this you can :-
1. Run independent tasks/Activities in parallel
2. If you have created a share point farm your workflow can run on multiple machines in parallel.
3. It can be triggered by a workflow or a timer job
4. Create custom activities to implement business logic.
5. Set up concurrency of workflows
6. Call external methods and use those results in workflow
7. Automate a sequential set of tasks.

I would like to talk about performance of Windows workflow. Since it runs on the application server. Doing things wrong/inefficient can slow down the entire server and eat up the processor and clog the database.

I want to talk about few things which you should keep in mind while programming with Windows workflow:
1. Performance: Its a important aspect of every piece of code. But it becomes very important in case of workflows. Eg. you have to give discount to user on your product based on the sales, page hits and other parameters in 1 million products on your website. Calculating discount for individual product should be very efficient, it should take less than a second by your workflow. Workflows should not run more than couple of hour.  Keep batching in mind. If you are reading an item from database , processing it and writing into database try batching stuffs. Divide 1 million item in batches, read a batch of 10000 items -> process them -> save 10000 items together. Batch size is critical can be best explained by :


2. Logging: Log every failure, successes, high importance in proper category for telemetry and support purpose.
3. Scalability: What if you start dealing with 100 million products after supporting 1 million products. Keep this in mind. In that case, divide your products with category, run workflow for individual category. Don't do any unnecessary operation in your workflow. which can slow down your workflow by many folds.
4. Modularization: Try to break your methods as small as you can. So that it can be used by some other activity ,help you in unit testing and improves the maintenance of the code.
5. Memory: Keep memory leakages in mind. for eg. C# has a built in garbage collection, but always Dispose objects which are derived from IDisposable interface. When your workflow is running keep track of memory used by the workflow process in the task manager. It should increase and become constant. If ,the memory should keeps increasing during the life of the workflow, its an alarming situation.
6. Activity flooding: Decomposition of every tasks to an activity might look fascinating. But creating every activity has a cost(creating activity and deleting activity ) by the workflow. We should not create 3 activities for a million object. That means if the cost of Create + Delete of an activity is 0.01 sec then you can save 20k seconds = 5 hour by creating 1 activity to do all 3 things together.

Remember workflows are made to "Do work" . If you have some base cases, which will exit the workflow in between, check that condition before the workflow is kicked off.

Let me know if you have more pointers to improve programming in WWF.
Disclaimer: Ideas/Views mentioned above are purely personal and learnt with Experience/reading. Feel free to correct me. 

Monday, October 10, 2011

Compress Photos before uploading Online

Uploading photos on your facebook or other online places can eat up your bandwidth and be a slow process. There are many compressing software available but instead of wasting time in choosing the best one.Microsoft office Picture manager can serve the purpose. This office too not only converts 3 MB file to 8kb-301 KB as per your choices without affecting the quality much.

Step 1: Windows button on taskbar->Microsoft Office-> Microsoft office tools-> Microsoft Office Picture Manager.As shown below



Step 2: Add picture shortcut by clicking the link on left side panel.

Step 3: Choose a photo-> Edit picture -> Compress picture



Step 4: For 4 MB image Choose documents(301kb),Web pages(30kb),Email messages(7kb) as per your requirements.Save using save as option.

Sunday, June 12, 2011

My college life :: Episode 07-11

This is a post after a long time ,I thought of writing about my college life which is a milestone in my career and a memorable experience.All the folks of my batch I want to share the following lot with you FINALLY :) I shall describe this journey yearwise to keep it brief and interesting.

1st year:
I stepped into a place which I never heard before but I had crossed through this Durgapur JN many times while going to and fro Calcutta/Kolkata.I started with all new faces around ,I knew nobody except my brother Shivek Agarwal he was in 2nd year that time.He supported me and guided me through every step out them.Nepali seniors were very supportive and fun loving.We spend many memorable and enjoyable moments with them.Whether it's family picnic or any other family occasion.Life was quite exciting then as going to city center was very interesting and too much of fun.I interacted with almost everybody in Hall9 and spend my time with nepali friends specially Yudhir,prakash,rajiv,manoj and Nirjhar.Exam time...most of the papers vomited guesses for them....but I screwed up my 1st sem results scoring mere 7.76.I was quite disappointed and some friends helped me out to come out of this shock.In second sem I was quite motivated to focus on studies ,and I woke up thinking it's high time as time is running very fast if I don't perform well the whole engg. degree will of no use being a 7 pointer.It was 2nd sem exams and we were newly cought up by PETER ANSWERS.com .This is a very addictive and funny website until the person comes to know the truth and continues to be superstitious.Still somehow I could score well between loads of fun and Jolly statements by Yudhir ,Nirjhar on peteranswers .I was a part of GNU/LUG..Got to know about the open source world..and my addiction to UBUNTU began :)

2nd year,3rd year:
I entered CSE Deparment and I from my last blog post you can estimate my interest for the subject-Computer Science.I liked most of the subjects except few...CMOS,NMOS...I couldn't build my interest for that please ...........I was interested in software.A girl(I won't name her) came into my life..We started with likeness ,same department,similar passions and goals...brought out close and we started helping each other ,working towards our goal forgetting the world for a while.We were so involved in our work and ourselves we didn't give ample time to friends and people around(Few of my friends had problem which i came to know later on).Keywords I would like to mention...Library,Profs(we ran after projects also),working on codes,STL etc,First benchers,Padhakus,bookworm.I was performing well in my Semesters not so great but it was satisfactory.In 2nd year summer break I did a training at Delhi on Networking which was to utilize my time and poor knowledge on what is good or bad and 3rd year summers I prepared for Interviews,coding,Aptitude and brushing up my skills which I felt imporant for interviews.
Final year:
Session started in July and I found Novell is the first Dream company coming for CSE and made my preparation more specific and it was 5th August ..I appeared and Cracked it...:) I was quite relaxed after a job and very confident (cracking on the first go matters a lot).Few friends told me in the race you have forgotten us,you din't keep a proper balance between the girl and friends..work and friends....I thought yeah I was wrong but I was quite serious on the studies and I liked it too.It happens with everybody ,if you are involved with something very much it's quite difficult to focus on something else.For me it's always 0 or 1 .I can't go fuzzy.But after the job I started correcting it.Started keeping balance which i know it was difficult but still I tried my best.I was isolated in 2nd and third year ...It was little contributed by me little by my friends..After Novell...I started having fun...Enjoying...walking out to CC almost everyday...Dining out...Freaking for no reason..I wanted to taste every minute of my last year.Novell was taken over by attachmate and again I became low about my future.We Novellites (Saurabh,kapil,subhasis and me) had some bad times too..but still we were confident to face the consequences.In the meantime I heard Microsoft will be coming to our college for placement.It was 3rd time ..announced the same line.I was hopeless ,after preparing for 2 times..I thought of preparing again for the last time..I sat for the interview and cracked it.:) I was very happy to know the results as that girl who was my gf also got placed with me.It was moment of rejoice and celebration.Then started the season of treats and dining out with friends.I remembered everybody who were important to me..In the meantime I interacted a lot with Saurabh koar,kapil and subhasis and shared good friendship which I din't in first 3 years....After a month I was invited for New hires day at Hyderabad which was quite a fun and I will share with you soon :).There are few bad and sour memories of my college too...concentrating when full music in being played in the hostel wing...Some of my friends misunderstood me...and finally they stayed in they attitude and me too..Now I don't know when we shall meet next...It's Alvida Bidding to everybody...Truly speaking...I understood little about the memories and I gonna miss my college in last few days..but right now I miss it like anything..I hate to think of the day when going back to college for results when nobody will be at the college to laugh with you in the corridor of the wings,pull your legs and discuss on a silly issues of all over the globe...Empty mess...But finally I want to thank my college...for making me whatever I am today...capable of sustaining every where with any kind of food...making my food habits flexible..and my self development..and I thank all my friends..who beleive I am worth a friend ..Knock me anytime I will be right there for you.:) Finally Signing off from NITDGP both officially and unofficially....Leaving durgapur...college,89 cinemas,suhatta,junction all the restaurants(with and without discounts :P) in durgapur..LH more,Jhoops,Techno and all the canteens...CC,Department..Library( best place in college) and every street within ...All are my memories..and I dive into the sea of nostalgia while thinking of them.. After all it's life one has to move on...Hyderabad I am coming...:)

Wednesday, March 2, 2011

Install NS2 (ns-allinone-2.35-RC7) in UBUNTU 9.10

Checklist of prerun package installation/command
1.g++
2.repositories updated($sudo apt-get update)
3.if you are behind a proxy, make sure you have $http_proxy variable configured in ~/.bashrc or type the following in the terminal

$ export http_proxy=http://username:password@ipaddr:port/

Step 1: Download the source for NS2 all in one (I used this version ns-allinone-2.35-RC7.tar.gz )

Step 2:
Extract the tar.gz file downloaded into your home folder by right-clicking the tag.gz file

Step 3: Open terminal (Applications–>Accessories–>Terminal) and change the directory (using cd command) to the extracted folder and execute the following:

$ sudo apt-get install build-essential autoconf automake libxmu-dev

This will install the dependencies required to compile NS2 from the source.

The following command is used to compile the source.

$ ./install

It will take long time to compile all the required packages for ns to work…
Step 4: Setting Environmental Variables

Type in terminal:

$ gedit ~/.bashrc

and append the following text to the opened file (Please note that the path contains the path in my system, replace path with yours.)

# LD_LIBRARY_PATH
OTCL_LIB=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/otcl-1.14
NS2_LIB=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/tcl8.5.8/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/bin:/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/tcl8.5.8/unix:/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/tk8.5.8/unix
NS=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/ns-2.35
NAM=/media/E0BAB170BAB14436/ns-allinone-2.35-RC7/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM

Step 5: Now, after editing the file, save and close it. Then in terminal type:

$ source ~/.bashrc

Try “ns” command, it shud go to the “%” prompt then it just means the installation was successful! Enjoy :D

Note: These steps have been tested and worked like breeze in Ubuntu and is expected work in all the debian based linux.

Reference:
3.) http://www.isi.edu/nsnam/ns/ns-build.html (Might not be needing this, but just in case)

Friday, February 4, 2011

Microsoft interview continued ...Part 2

Day 1 :
Today is 18th Jan'11.After a long wait MS was finally coming to NIT Durgapur.PPT was scheduled at 1 pm with few glitches.We all were asked to be in formals ,So I started from room in the same attire.We were waiting for the ppt and they announced that they will be first conducting the written exam and it will be forwarded by PPT and then the interviews.This seemed to be a multithreading operation to me .The parent thread MS panel ,created a new thread called "Paper correction team" just after the written test:).

Round 1:Written examination
IMHO this was conducted by merit trac wing of MSIT.This had 11 questions :
Qn1->how will you sort array of numbers(logic and dry run only)
Qn2->In a given string print the character occuring maximum number of times.
Qn3->A question on void pointer's output and typecasting.
2 testing question,1 troubleshooting question,2 question on OS(1 on disk seek time and latency) other was on uptime etc.,2 puzzles,1 design question(spacecraft).
Test streched for 1 and half hr(so far i remember).I did fairly well.

Round 1a:Preplacement talk
Guys I tell you ,It's Microsoft IT (Aukaad wali).PPT was boring at the beginning and picked up in midway.I didn't like the business and division part but rest was fun.The perks were impressive and few lines acted as a motivating touch.One of them I remember "We have hackers working day and night monitoring our systems so that none of our offsprings msn.com,hotmail.com and bing.com suffers from any sort of malicious attack.Coz once they are successful this will be the headline of the next day's newspaper".Next was "We go to orphanage and schools to teach poor children ,we believe in giving back to society."etc.This way I was highly impressed by the company to go ahead and ATTACK :):).

Round 2:Designing round
They asked us to fill our choices between SDE,SDET,SME posts.We all filled down the forms and I was shortlisted for SDE/SDET post.The designation was uncertain now.They shortlisted around 18 people for the interviews for FTE's(Full time engineers).I was called in the last room :) of our gd/pi rooms.There I was asked to design an ATM machine,integrate the SDLC with this.All the phases of designing including database part,coding and front end.I like this the most and I proceeded with my idea.I had frequent interactions with the interviewer and he was a sort of impressed.I was pushed to the next round.Interviews were over for the day.I was asked to report next day at 9:30 am.

Round 3:Coding round
I was waiting and waiting and waiting.It was around 2 pm ,I was sick tired of it and then they called me.This was the worst part.But now I enjoy thinking :).I was asked what are the questions you have come across as you have been waiting for so long.The interviewer was a dude:).I liked him but believe me I am straight:):).I told them all the questions which my fellow interviewee got struck so that he is impressed with my honesty.As I had already prepared those questions so I was gutsy to speak those questions.:) He replied I won't be asking you all that.So don't worry:).Then he started typing my name on his keyboard.I enquired are you googling my name.He replied I have bing and turned the laptop towards me adding that I ws preparing a feedback form for you anyways let's open BING.He asked me check '/' division operator.I wrote around 54 cases of a/b form and he told nikhil are you missing something that those were actually 108 test cases total :).He asked tell me what happens inside recursion,what are saved in stack etc..After this he asked me write simple codes Q>Sum the numbers upto n (given). He asked me to write test cases,solve the overflow situation and many pros,cons and alternatives of my code.Q>Write the code for depth of the tree and test it.He asked me write it fast and I did that .

Round 4:Coding and Final round with the Senior most interviewer
I was called early in this interview may be the Round 3 interviewer gave a positive feedback about me,which accelerated my interview.He started with "Tell me about yourself".He didn't express how far he liked my answer.They he started asking code for LCA of Binary tree ,I wrote it, Q>Two linked list merge at a point in Y shape don't have both the arms equal how will you find the point of intersection and other coding and algorithmic questions.He asked puzzles to my fellow interviewees to but he didn't ask me any.Then he moved on to the final Q>Take a mobile keypad,each key maps to some characters eg. 1->abc 2->def etc. So if a 10 digit number is given how will you find all permutations.How many permutations will be generated,you would prefer iteration or recursion and many questions related to that.The answer stucked me there itself and I explained him ,he seemed to be impressed.Then he asked me ask some questions(SDET and SDE fear) ,any improvements you suggest.I told few and I was moreover sure that I will crack it :).I came out with full energy and priyanka and everyone waiting outside could understand my interview was good.One more thing about this interview I would like to add is a story with my CV.I made a CV for Microsoft specially and nobody even had a look at it.I thought my effort will go in vain.Then I asked him to please see my CV,he was not interested but I convinced and then he took a copy of my CV and I was satisfied.

This ends the interviews.Result was declared(2SDE+1SME+1 intern(SME)) ,I was in :) but it was very difficult to wait for that.I couldn't take my dinner properly.It was Wednesday also :(.Still it was fun.