Skip to main content

Posts

Showing posts from March, 2015

Health: Stomach Ulcer and Food Poisoning Quick Treatment

First of all, I'm not a medical doctor. I have an engineering degree in low power electrical field and I am a web developer 😶 But I do have lots of experiences handling these: stomach ulcer and food poisoning ; for myself and for other people around me. Let me share some of quick treatments for stomach ulcer and food poisoning . Stomach Ulcer: The Habit Sometimes, or most of the time, as we get older, we do not take meal with constant periodical cycle like while we were children or teens. But as I've noticed nowadays, teens also have that habit . Our human body can adapt, if you notice, to that kind of punishment . At first, it was probably hurt like insane, but as time went by, we don't feel the pain. It has multiple meanings: Our nerves finally ignore the pain signal because we consciously and constantly pretend it did not hurt like Rambo bit, but our system hasn't actually adapted. This one is dangerous ⚠️ The...

JavaScript: Shuffling Array Elements

Shuffle is different than random in term. But indeed randomness is applied in shuffling . As in shuffling cards and giving out one random card, those are different. Algorithmically , we can loop through the reference array, generate random index based on the reference array length, then put that item (with that random index) to a new array. But since random can generate similar number (being floored or rounded down) as the previous one, that can lead to duplicates . For Example We Have Input Array: ["a", "b", "c", "d"] ⚠️ If we simply loop through the array while creating a random index then blindly 🙈 copy the randomly chosen item to a new array, surely there will be duplicates . ❌ Unwanted Output: ["c", "a", "a", "d"] ["d", "b", "b", "b"] ["a", "a", "c", "a"] 🚮 Deletion Technique We need to t...
Monkey Raptor uses cookies or biscuits 🍪 for analytics, functionality, and advertisements. More info in Privacy Policy