This Week I Learned 2018 - Week 42

Last week post or some random stuff from the past.

Can you still be a developer in your 60s? Yes, it's still possible (look at Carl Sassenrath) but looking at the poster qualifications, he is over qualified and can be very intimidating to someone. The root cause is still "cultural fit' and ageism. Perhaps the poster can join the FOSS movement and contribute to it instead? Looking at the positive side, if you can survive until 60s and is fit to work, consider yourself very lucky than most people around that age. Nonetheless, just live below your means, be healthy, and enjoy what you're doing.

Why good sleep is crucial for learning? (via HN) More importantly, insufficient sleep can lead to numerous health issues and diminish your enjoyment of life. While you can't feel the impact when you're young, only at certain age, you will sense something have messed up somehow somewhere in your body. While it varies by person, but you needs at least 8.5 hours of sleep. If you're working, minus your working hours and travel times, with 8 hours of sleep, you're left with 6 hours to do your own errands. What can we do? Lifestyle changes and stick to a constant schedule, every day, every single damn day.

Is semicolon necessary in TypeScript? No but it's good to have it for consistent results, especially for new comer and coding convention. Even this is recommended by Ecma TC39. Off course with much debates and interesting point of view. I believe in the camp of better safe than sorry, just use semicolon;

What should a front end developer knows? Here are some common topics you will encounter eventually.
  1. ForEach vs. Map
  2. Promises vs. Generators
  3. What are the states in Promises?
  4. How many ways to lazy loading an image?
  5. What are the differences between Local Storage, Session Storage, and Cookies?
  6. What is event delegation in JavaScript?
  7. What is Cross-Origin Resource Sharing (CORS)?
What is 30 seconds of code? A bunch of JavaScript code snippets that demonstrates different features of this programming language.

Why we need `EXPORT` and `EXPORT_OK` in Perl? Well, we use the later if we need to let the library consumer or caller to explicitly import the module's symbols like subroutines, variables, constants, and so forth.

This Week I Learned 2018 - Week 41

Last week post or rather, old stuff from the archive.

Do we have an obsession with home ownership? (via /r/malaysia) While the discussion was referring to fresh graduates who are started out, the general rule of thumb still applies for everyone. Don't buy a house if you don't intend to stay more than ten years. Or don't buy houses 3 times more than your annual salary. Never equal home ownership like status symbol (just like car), you're taking a huge financial risk and long term repayment period. Another approach is to start small buy buying a low cost flat, stay in it, rent it, and sell it to buy a better house.

Judging by the current trend through NAPIC (National Property Information Centre), it's best to rent and wait before buying. Furthermore, the saving from your monthly mortgage installment into other investments will out weight the interest paid and potential capital appreciation of your property. By the time you're ready for retirement, might as well move to some where outskirts and rent again and live off the dividends of your investment in your golden years. Off course, if you're planning to get marry and owning a home is crucial to satisfy your SO and in-laws (another status symbol issue), first time homeowner can apply through PR1MA, which was created to prevent wealthier people from inflating the housing prices.

Now, instead of taking advice from armchair experts in the forum, why not do your own calculation using the The New York Times' rent or buy calculator.

Ignore this discussion if you're one of those crazy rich Asians.

And by the way, there have been quite a discussion where the upcoming Budget 2019 will have an impact of the housing prices. We will wait and see then.

Do you need a bigger house? No. We spend majority of our times in the kitchen, living room, and bed room. Perhaps a SOHO (Small Office Home Office) suite is a preferable choice if you don't have kids or big family.

How many ways to refresh a page in Google Chrome? Three. Only if you've open the Chrome Dev Tools and right click the refresh button as shown in the screenshot below illustrates this. Now, what are the differences between these three refreshing methods?  Normal reload will use re-validate and use cache files when needed. Hard reload will skip the cache and re-download everything again. As the name implies, empty cache and hard reload will clear the cache file and re-download everything.


What the fsck with Perl's constant? Besides the default `use constant` pragma, we have 21 (yes, bloody 21 ways) Perl's modules to deal with constant or readonly values. Worse still, none of these modules satisfy the needs of proper constant usage, it's a case by case basis. The recommended one is Const::Fast. More on this in coming posts.

This Week I Learned 2018 - Week 40

Last week post or something from the past.

What is the most expensive Koi fish sold at this moment? USD 1.7 millions! Yes, that was bid for for a champion Koi fish from Sakai Fish Farm. From the video's comment, the lady bidder is Chung Ying Ying, the Koi queen from Taiwan. Not really a fan of Koi fish as I do enjoy viewing fishes from side view instead from the top.

How can you write longer articles without adding more words? Switch to Times Newer Roman font which extends each character by 5 to 10 percents wider.

Why I'm grateful to live in MY instead of ID. (via Reddit) It's quite crazy there were so many instances of earth quake or typhoons at our neighboring countries. In return, we got their haze and labours.

Why should I croak instead of die? Use croak for the caller mistake and use die for the code mistake. According to the Carp module documentation,
The Carp routines are useful in your own modules because they act like die() or warn(), but with a message which is more likely to be useful to a user of your module. 
What if the subroutine returns a list but you want to assign it as an array reference? Use anonymous array.

How to resolve "Cannot determine local time zone" in Ubuntu under WSL environment? You will need to reconfigure your timezone again as a workaround for WSL constraint.

Betta Spawn Log : BSL20181005 : HMPK Super Yellow (S) x HMPK Super Yellow (S)

Another sibling pair we bought and this time, a super yellow pair. It's very hard to get a super yellow HMPK and moreover a pair. We're tired to look around for a super yellow HMPK and might as well bought a pair and breed on our own. The plan is to breeding multiple generations of Betta pair to create a lineage.

Male: HMPK Super Yellow (S)
Age: 3+ months
Temperaments: Curious and active.
Size: Small (3.0cm body only)
Grade: C

As you can see below, not a good grade and the fish is quite small in size. However, since SO like this male Betta, we decided to get this.


Female: HMPK Super Yellow (S)
Age: 3+ months
Temperaments: Curious and active.
Size: Small (3.0cm body only)
Grade: B

More nimble and aggressive than the male Betta. Probably the healthiest female we've seen so far.


Log Notes
2018-09-23
We went to a Betta farm and bought this pair of super yellow HMPK siblings. SO was excited and always wanted to breed a true super yellow pair since the passing our yellow HMPK.

2018-10-02
Conditioning process started but we put the pair of fish into separate jar but both can observe each other.

2018-10-03
We put the female Betta in once we felt that the male Betta have already built a large bubble nest. Within hours, both fishes were seen mating. We removed the female Betta immediately after the male Betta was seen chasing it.

2018-10-06 (1st week)
Fry were swimming vertically and started to feed on BBS. SO decided to keep the male within the breeding tank since this male Betta were caring and not aggressive.

2018-10-13 (2nd week)
The fry were growing at expected rate and it's quite a big spawn, roughly estimated around 100-plus.

2018-10-20 (3rd week)
Few survived the outbreak (we're not sure the actual reason) but suspected that we may overfeed, forgot the feed it, or spooked the male Betta causing it to eat all the fry. Nevertheless, we took out the male Betta into its container and try to salvage the remaining fry, which was roughly around 10. We fear that the whole spawn will be wipe out, just like previous failed spawn.

Retrospection
1/ Our visit to the Betta farm reinforced that Indian Almond leaf is crucial to maintain a healthy Betta fish, especially for breeding.