Thursday, December 29, 2011

submit is not a function, error in javascript

Was trying to figure out why i am having this error "submit is not a function" while trying to submit my form within the javascript method.

Spent half a day finally to realized that i have a button that is having the name "submit".
Once i rename it to "submit_btn" the form gets submitted successfully!

So i learned that dom elements should not be named as "submit" =D

Wednesday, December 28, 2011

Parenting: Are your kids testing your patience?

Getting toddlers to cooperate with us can be a daunting task. Especially when they are starting to recognize themselves as individual.

Regardless if it is meal time, potty time, bath time or bedtime. They can hardly sit through the entire session without getting distracted or suddenly recall that they wanted to do something (or want you to do something), etc...

As parents and care givers, it is unavoidable that we get frustrated, upset or even angry trying to get our toddlers to obey and work within our limits.

Here are some simple practical ideas that I find useful on managing my precious little one.

Right Expectations

Firstly, check ourselves. Are we expecting too much from our toddlers? A 20+ month toddler just do not have the capacity to keep at a singular task for an extended period of time.  So exactly how long is considered too long?  Think about it, a fully functioning and intelligent teenager usually have an attention span of average about 30 to 45 minutes (why do you think lessons taught in schools are usually in periods of about an hour? )

My rule of thumb is this, when our kids start to get restless, protest and stir, the session has lasted too long.  So how do I manage that?  I let my boy go. Before letting him off, I  preempt him that after that, he will have to return and complete the current activity.

Here is the systematic approach:

1. Once the kid start to get restless, offer suggestions on alternate short, non-disruptive activity. Example: my kid loves his machine toys, during mealtime when he start to get restless, I will sometime offer "Do you want to bring your machine toy here to eat with you?"

2. Preempt them that after the "break" they will have to come back. My preempt usually goes like this. "Daddy let you go take one machine, after that you must come back and continue. Ok?" Only after he verbally agrees, then I will let him go.

3. Getting the kid to agree to come back is of course the easy part. The challenging part is getting them to do that. My kid usually gets distracted with other toys or will just run away to some corner and hide there.  This is usually the part that will test our patience to the max.

They will whine, cry, struggle and do anything within their means to escape. For me, it is a chance to hold him to his words and "play" the patience game with him. 

I will point out "Just now you told Daddy that you will take your machine and go back right?"  It is normal that they will get frustrated and cry.  I normally prevent him from playing with any other items and doing any other thing until he is ready to return to his meal.

Personally, I think that it is important that I should be responsible to my kid and myself by holding him to his words.  It is a very emotionally taxing task, seeing the pitiful looks and hearing him cry.  Sometimes I just feel like giving in and let him have his way, but I know that, in the long run that would probably do him more harm than good.

Feel free to cuddle, carry or hug them to sooth them. Love and discipline are not mutually exclusive! In fact, I believe that providing loving support during a discipline episode is extremely crucial so that it will not leave the kid feeling resentful towards us.

4. Be flexible and compromise within reasonable limits.  Normally, by the third step, I would have my kid back at the high chair for his meal.  However, depending on the circumstance, I am flexible to offer additional alternatives.  Which is to go through step 1,2 and 3 again!

KEEP in mind that every kid is different. Whatever strategy we use in parenting, it is important to be aware of our state of mind. I believe that the best results are obtained when we are in a calm, loving and balance state.

Today I finally realized that "Our kids are not testing our patience, they are merely TRAINING OUR PATIENCE."

Tuesday, December 20, 2011

quota_exceeded_err 22 on Mobile Safari (iOS) when using localStorage of html5


Using localStorage of html5 is pretty straight forward.

var bar = 'this is the value to store';
localStorage.setItem('foo',bar);
localStorage.getItem('foo');
localStorage.removeItem('foo');

Testing was smooth on Chrome, Firefox, desktop Safari...

However when testing on Mobile Safari, i got the following error...
"quota_exceeded_err 22"

Goggled around for the issue to no avail.
Finally came across a blog with the solution to this problem.

Which is to turn "private browsing" off in Safari.

To do that... Go to "Settings"
Scroll to "Safari"
Under "Privacy" group, Set "Private Browsing" to OFF.

Hope this can help you the few hours of googling.

The blog that i found : http://frederictorres.blogspot.com/2011/11/quotaexceedederr-with-safari-mobile.html 

Monday, December 5, 2011

Born To Run ~ Christopher McDougall

Just completed my fifth marathon yesterday. This was the most taxing marathon that i have participated so far. Mainly due to the lack of training. The furthest training that i ran was 10 Km... 3 times a week. And i stopped running 3 weeks before my marathon. Mainly because I was down with flu and I seriously though of giving up this year marathon.

At the back of my mind, I know that without much training, our body may not be able to take the strain of the long race.  I know that can still complete the marathon, it is just how much pain I have to go through both during and AFTER the marathon.  And i seriously prayed to God, Buddha and the Universe to help me complete the marathon safe and sound...

Knowing that i did not clock enough mileage for my training, i constantly remind myself to feel and listen to my body, not to push myself over the limit.  Completing this year race will be good enough for me.  So in the end, i came in 6 hours and 30 minutes...

Got the chance to talk to my friend after the race.  We were chatting about our running gears and i got to know that he was running in Sandals! YES! he ran the marathon in Sandals.. you heard it correctly.  When i queried further, apparently, he read about the Rarámuri or Tarahumara (Native American people of northwestern Mexico) which running a marathon is like an usual affair.  I heard about the book "Born to Run" by Christoper McDougall being reviewed on radio before but did not really pay any attention to it.  Now that i have someone I really know review and highly recommend the book, I am going to get the book and read it... Gonna see how it is going to change my life....

Wednesday, August 17, 2011

Black "Metal" Like Particles Found in Milk Powder

For all Daddys and Mummys feeding your kid with Gain IQ Stage 3 (from 1 year onwards) milk powder. Please allow your milk preparation some time to settle down and check if there are any foreign object in your milk too!

This was the second time i encountered it. The first, i thought it was from my water. This time round, the water was clear. At first i thought ants have entered into my milk tin. But after taking them out.. they are hard and metal like.. Not ants...

Here are the photos that i have taken


Here are some close up after i have fished out the particles with a spoon.



You can see 2 bigger black seems like metallic pieces and several other naked eyes visible pieces.


I went online to google about Similac recall and black particles in Similac Milk. Apparently, a mummy in USA faced with the same situation posted a warning in babycenter in August 2009.

Also on Similac, in Sep 2010, there was a Similac Recall in the USA dues to some beetles found near the milk production area. You can read more about the similac recall here.

I have already emailed Abbott and AVA about it. Will see if there are any reply from either of the party. [UPDATE 18th Aug 2011: Abbott has contacted me. Will be getting the milk to their lab for testing. Seems like it is scorched particles that is resulted from the manufacturing process.]

[UPDATE 19th Aug 2011: AVA contacted me to follow up on my feedback.

1. Same reason as Abbott gave me that it may be due to the manufacturing process that will result in some scorched particles
2. They do not need to get a sample from me to run a separate test. They have already spoken to Abbott and Abbott is suppose to provide them with the test results within a month.
3. Abbott have already collected the tin of milk powder and it is currently on its way to Ireland for the manufacturing plant to investigate.

Well seems like I am not able to get AVA to perform an independent review, I will have to trust the integrity of Abbott and its staff to provide us with an accurate and non-bias report.

Will update once i have the results. =D
]

Here is how the milk tin look like


The batch and manufacturing date (02554NT MFG 21 FEB 2011), if you are also giving Similac Gain IQ, check if you are having the same batch number... Have to let your milk settle first before giving it to your precious little one.


UPDATES!
A nice lady for Abbott called to provide some possible explanation of the black particles.

1. Scorched particles:

Apparently, there will be some scorched particles as a result of the manufacturing process the article below has some information about it.
http://www.ehow.com/facts_7272542_usda-particle-standard-dry-milk.html

2. Or black particles of lactose emulsion formed after high temperature baking caramel particles.
I found an article about this too. you can read more about it here
http://mybabyformulastore.com/united-states-found-little-black-pigment-powder-particles-miso-milk-food-industry/

Whatever is the case, they will update me once the get the milk powder to the lab for testing.
For now, if you are having some concern, just use coffee filter to filter the milk. For me, i just bought a new tin =D

[Update 19th Aug 2011 : Change title from "Black Metal Like Particles Found in Similac Gain IQ" to just "Milk Powder" because it seems like this may happen to ANY other milk powder. ]

Asian Parenting