This Week I Learned 2018 - Week 32

Post from previous week or from the archive.

真的服了,句句都是绝句。第一次分手可能是对方有问题。第二次分手可能你们都有问题。第三次分手估计你肯定有问题。第四次分手表示你没搞懂问题。第五次分手表示你不改善问题。

What are the available wild Betta species? We're looking into Betta Brownorum as our next breeding project. Since this is a wild species, we can't find any stock from local breeders. It seemed you will have to capture it from the wild, in Sarawak.



Why there is a sign in Perl's hash key? Legacy reason.

Getting excited when buying stuffs (the highs is in the anticipation and it's more fun planning a vacation instead of the actual vacation) and have buyer remorse later? There is a quick tip on handling that. Take the amount you're going to spend and pay off any pending debts or loans. In the end, it's a divert and replace strategy. Any impulse purchase can be put off (delay strategy) if you set a goal before succumb to your materialistic needs. For example, lose a KG, indulge yourself into the stuff you desire for so long. Remember to reward yourself as you deserve it. Note that this is applicable to stuff and not really experience, especially spending on good experience with friends and family (moderation applies here as well). Another way, love shopping? Why not spends money on investment. Shop investment, not liabilities. Instead of getting the Nike shoes, buy Nike stocks. You have to ask yourself, which is more motivating? Watching your bills accumulates or your saving grows?

How to spend $0 each day? Meal prep. My friend. Meal prep.

How Europe Learnt to Swim? Like any forms of knowledge, observation, self-learned, trial and error, consolidation, and sharing of knowledge. I'm quite surprised that most island inhabitants can't swim properly to save their own life. Seriously?

What cloths to keep and throw away when cleaning up your closet? One key question to ask yourself is "If I saw this at the store right now, would I buy this again?" Throw away the cloth if the answer is no.

What is JSON PATCH? A combination of JSON and HTTP PATCH. You will see the HTTP content-type have been set to application/json-patch+json.

What was your most 'can't-put-down' book that you've ever read? Here are the list in random order. Overwhelm by the list? The quick way to filter out is to read the first few pages and if it caught your attention, proceed ahead. If not, ignore.
  1. Watership Down by Richard Adams (discussion)
  2. One Hundred Years of Solitude by Gabriel García Márquez (discussion)
  3. The Historian by Elizabeth Kostova (discussion)
  4. Night Watch by Terry Pratchett (discussion)
  5. 11/22/63 by Stephen King (discussion)
  6. The Book Thief by Markus Zusak (discussion)
  7. Killing Floor by Lee Child (discussion)
  8. Lonesome Dove by Larry McMurtry (discussion)
  9. Jurassic Park by Michael Crichton (discussion)
  10. Neverwhere by Neil Gaiman (discussion)

This Week I Learned 2018 - Week 31

Last week post or something from the archive.

What is the most mind-blowing thing I've accidentally found out about Thinkpad? Fn + Space toggle the light at the top of the monitor, near the web cam. Seriously?

為什麼時間感覺有時過得快、有時過得慢? 我之前已经有提到随着年龄增长,你就会觉得時光飛逝,但是只是用岁月来简说如此经历,一点都没有科学根据。然而,啾啾鞋的解说,终于让我也明白为何我会有如此体验。简单的说,是我们自己的脑作怪。仔细说明,理由有三。第一,暂时性幻觉 (Temporal Illusion)。第二,伸缩效应(Telescoping Effect)。第三,停表错觉(Chronostasis)。


大叔为什么能配萝莉?戏剧有点美化的中年危机?重点还是量力而行,自我调节。

What to do this too much advice? (via HN) We are always looking for confirmation rather than advice. Furthermore, advice is always cheap anyway.

Are there receivers to avoid on the used market? Any Onkyo receiver with HDMI daughter board. I've confirmed this with local audio shop which sells a lot of second hand AV receiver. Why so? It seemed their circuit board was designed to run everything (analogue, optical, and coaxial) through the HDMI board. And when you have faulty HDMI board, nothing works. The funny things is browsing through some YouTube videos, the fix was quite easy by replacing the faulty capacitors. Does the same problem exists for newer AV receivers. Not sure but discussion with the shop owner indicates that it's wise to pick some other brands instead.

Is the Sony Core SS-CS5 bookshelves speakers most unknown and underrated speakers? I'm quite surprise that one Redditor claimed that it's even better than Klipsch R-15M, KEF Q1000, Elac B5 / B6, or even the popular Pioneer SP-BS22-LR. My research indicates that this is true to a certain extend, one reviewer mentioned that the pro of this speaker is the clarity of the music but lacking in the mid range and bass. The clarify of this speaker was proven that someone even suggested that we can using this pair as center speaker instead. In other words, not a all rounded speaker. And by the way, Elac and Pioneer are hyped not because of the quality but due to a certain quality within that affordable price range.

This Week I Learned 2018 - Week 30

Last week post or something random from the past.

Is MySQL an ACID compliant database? On paper yes, but in reality, not quite. For example, database dumping using mysqldump have an issue where did not backup tables with proper single quote escape. This was quite a tricky bug I've encountered where MySQL silently ignore inserting certain records due to quoting issue. Only when certain records were missing from the application, I only realized that database restoration did not work as intended. I wouldn't have figure this out if not for the need of the record. In the end of the day, a workaround was added but unfortunately, wasted a whole day to track this down through numerous dumping and restoring the database.

How do you organize/track your personal goals? Pen and paper, nothing more and nothing less. Write it down and make it happen. Off course, the usual productivity systems like SMART or GTD but to what extend? Sometimes you just need to chill and don't pressure yourself so much.

What is PERMA? Basically this represents an acronym of a theoretical model to achieve well-being or happiness by Martin Seligman in the field of positive psychology. The components of the model are position engagement (there is a difference between pleasure and enjoyment), engagement (in the 'flow', they said), relationships, meaning (doing something other than yourself), and lastly accomplishments. Does the application of this model in online learning platform have an implication on learning ability of these online learners?

What is one anime adaptation worth watching? Monster by Urasawa Naoki. I was quite late to discover this anime but the the style and story line was worth it and way different from the conventional Shōnen manga.

This Week I Learned 2018 - Week 29

Last week post or something else from archive.

纯洁,值多少钱?

What's your philosophy when building software? "Make it work. Make it work right. Make it work fast". There is no such thing of simple, correct, and fast. Why, there is no such thing as simple requirements or requests. More and more features will be added or hacked upon existing hacks.

Having trouble remembering Vim's key combination? Look no further, just print out the Vim Cheat Sheets.

Why use the Zebra fish (Danio Rerio) in research? Besides sharing 70% genetics with human, this species of fish also fast and easy to breed. Thus, a good medical research model (the new lab rat). No wonder, it's quite prevalent in medical research. There even exists ZebraBox, a monitoring enclosure to analyze the behaviours of this fish.


And you will be surprise that breeding Zebra fish for medical research is totally different from breeding in the wild. Breeding process is automated and controlled.



This Week I Learned 2018 - Week 28

Last week post or something else from archive.

Why Aloha shirt is still not a common official men wear here? Via HN. We're living in a tropical country and yet our normal office wear is following western style. On the related note, the history of Aloha shirt was an interesting read as well.

Looking to get started in medication but don't want to fork our money? Look into the UCLA's Guided Meditations audio tracks. Download all and make it a playlist.

What the difference between informational support and emotional support? If your SO talked to you about her problems, just shut up and listen. Do not offer any solutions to her problem. Just listen and understand. Discussion at Reddit agreed with that. Don't assume. Ask or request what you want, if possible, explicitly. If you consult a doctor, are you going to tell the doctor that you're sick and he/she should know what sickness you've without you disclosing more specific details?

Stuck at your current tasks or your goals during the weekend? Chop wood, carry water.

Looking for food pyramid in the context of MY? Yes, it seemed we have a guide or alternative summarized version that from Ministry of Health. While we at it, there is another guide for low cholesterol diet as well. Why they don't provide a printable PDF version or compile everything into a booklet instead?

You know what is craziness when comes to set up your home network? Unnecessary and over-engineered enterprise level setup.

Joining the Utrawide Master Race but short on moolah? On first look, the LG 29WK600-W looks like a good choice if you're short of cash. However, it's best to check the actual specifications of the monitor before making any purchase. The panel bit depth is actually 6-bits + RFC and not really 8-bits, hence the 16.7 millions colours is overstatement. While the split screen functionality is nice, it has it's own security issue if you're running Windows. For GNU/Linux, there is Fake Xinerama or gTile (if you're using GNOME) that simulates several virtual monitors.

Setting up a home audio studio? This advice is a good way to start.

Is Anabas testudineus (also known as Puyu in Malay) suitable for consumption? Yes, and it's being massed produced as ornamental fish (gold colour variation) or as food source. I've long knew this fish but never realized that it actually travel through dry land to mate as shown in video below. And the hormone that the breeder used is most likely Ovaprim or GnRH, a spawning agent to induce breeding for fishes in captivity.


Do no feed the female Betta a day before breeding and let mating happened after 6pm because cooler temperature is good for bredding Betta? The issue with online resources when come to fish breeding procedures is it's quite hard to differentiate anecdotal experience or scientific result.

Betta Fish Growth Table

When breeding Betta fish, how do we know that the Betta fry is growing at the right rate? In the Interweb, most web sites will point to this growth chart of the Wayne's Betta pages. However, the measurement used in the page was not in metric system and it's always hard for us. Hence, we used the information from the page and converted it to metric system.

Note that this growth rate is based on normal Betta fish (Betta Splendens) and may not be suitable for Giant Betta which have different growth rate than normal Betta. Also we've extrapolated the growth rate for week 12.

This Week I Learned 2018 - Week 27

Last week post or something from the archive.

How does we diagnostic aquarium tropical fish diseases? There are many ways and this diagnostic website (there is another one with better graphic) provides a quick way to identify the actual disease based on several symptoms. Aquarium Co-Op recommends three medications besides all quarantine any fishes into this aquarium store. MSR also used similar way. We're a bit concern on the usage of Erythromycin (which is an antibiotic) as it may cause antimicrobial resistance. Moreover, we're not sure about the side effect of long term exposure towards human to this medications. Unless you're managing a aquarium store, it's best to use natural ingredients (garlic or Indian Almond leaves) instead.

Buying new headphones? I've been asked this question numerous time for the past week. Just visit Audio Guide. One thing I've learned is that budget aside, you can pick the head phone based on different sound signatures such as V-shaped, bright, neutral, dark, warm, and mid-forward (names can be different). I was wondering how does this apply to Hi-Fi system? More posts on this in coming future regarding these audio signatures.

What sound track for testing your audio equipment? I recently rediscover Yosi Horikawa. His Vapor album is a good start. A mix of nature sounds, human voice, and music mixed together.

Can you suggest one way to improve your writing? Vary your sentence length. Gary Provost gave a good example in his book "100 ways to improve your writing" as shown below.

Monotonous 5-words sentence.
This sentence has five words. Here are five more words. Five-word sentences are fine. But several together become monotonous. Listen to what is happening. The writing is getting boring. The sound of it drones. It's like a stuck record. The ear demands some variety. 
Varying sentence length.
Now listen. I vary the sentence length, and I create music. Music. The writing sings. It has a pleasant rhythm, a lilt, a harmony. I use short sentences. And I use sentences of medium length. And sometimes when I am certain the reader is rested, I will engage him with a sentence of considerable length, a sentence that burns with energy and builds with all the impetus of a crescendo, the roll of the drums, the crash of the cymbals--sounds that say listen to this, it is important.
Picking up React? What the best way for seasonal developer to start? React from zero (via HN). Note that web components (custom HTML element) may seemed to overlap (some part of it) with React.

Is this capitalism? Regardless how much you earn, there should be a threshold amount where you will reach an equilibrium of having enough and not being a slave to your money.


How will the 2018/2019 NBA season looks like? This comic said it all (via 老崔愛叭噗). The weird thing was the NBA free agency was way more bizarre and shocking than the FIFA world cup. Talked to a few people and the general consensus was that FIFA this time was quite boring.

NASA and FBI, what the difference? The former is an abbreviation where you can pronounce it as a word. Meanwhile, the later is an initialism or alphabetism where you pronounce it as individual alphabet. 

Thinkpad X230 : Updating BIOS through Ubuntu 18.04 LTS

As far as I remembered, I've never really updated any BIOS for any machine before. Due to some weird circumstances that caused my to stuck at a place for long period, might as well update this lappy's BIOS while waiting. Based on the Think Wiki site, there are several ways to update BIOS in GNU/Linux. Below notes were my experiences using both method.

First thing first, we need to check the BIOS machine of our machine so we can verify whether we need to update the BIOS.
$ sudo apt-get install dmidecode
$ sudo dmidecode -s bios-version
G2ET99WW (2.59 )

Next, we need to download the bootable ISO we can can update the changes to the BIOS. Go to support.lenovo.com, search by your machine model and find the relevant files. See screenshot below.


Download the ISO file and verify it with the checksum.
$ md5sum g2uj29us.iso
396cdaedf7d8871428d249f1be0c5b2d  g2uj29us.iso

Since I've never try booting an ISO through grub, hence we will try this method.
$ sudo apt-get install grub-imageboot
$ sudo mkdir -p /boot/images
$ sudo cp g2uj29us.iso /boot/images/

Update Grub to detect the ISO image.
$ sudo update-grub 
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when 
GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.15.0-23-generic
Found initrd image: /boot/initrd.img-4.15.0-23-generic
Found linux image: /boot/vmlinuz-4.15.0-20-generic
Found initrd image: /boot/initrd.img-4.15.0-20-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
Found memdisk: /memdisk
Found iso image: /boot/images/g2uj29us.iso
done

Restart your lappy and press F12 and boot through the USB thumb drive. However, this method did not work as the updating process froze and can't proceed ahead. Since, nothing was happened after 30 minutes, I've decided to proceed with BIOS updating through USB thumb drive.
$ sudo apt-get install genisoimage
$ geteltorito g6uj14us.iso > biosupdate.img
$ sudo dd if=biosupdate.img of=/dev/sdb bs=1M

Plugged in the USB thumb drive and try again. Read and follow the instruction, plugged in the power adapter. Select the second option, `2. Update system program` and after reboot, if you see below screenshot, then BIOS flashing was working as intended.


Double confirm that the BIOS have been updated.
$ sudo apt-get install dmidecode
$ sudo dmidecode -s bios-version
G2ET99WW (2.73 )

This Week I Learned 2018 - Week 26

Last week post or something else from archive.

What does meetup these days feel like? Same old same old. It has been so long since I last went for a local meetup without last minutes cancellation or interruption (from my end). Few key observations. First, never interrupt and overshadow the main presenter. Participants should complement the content of the main presenter and sadly most of the time, the discussion was sidetracked into something else. Second, working with right people and challenging problems can be a catalyst to improve your technical abilities and increase your exposures. Third, there is no need to justify any tools of your choice. Sometimes, we use certain tools because we simply like it. Nothing more and nothing less.

Why Colistin have been slowly introduced to our food chain?

想找一个比较好做的事?绝无此事。理当做好自己的本分,做该做的事。别蹉跎(cuō tuó),浪费时间。

Building another laptop? Thinkpad x230 is a good base laptop before mod right now.



Good books by Malaysian authors? It never occurred to me to read "great" (subjective here as popularity does not equal good) books by local writers. Nevertheless, below are the list of writers: Tash AwTan Twan EngAdibah AminRehman RashidRamlee Awang MurshidShirley LimYangsze Choo, and Amir Muhammad.

How do you identify different colour patterns of Betta fish? We always having a hard time remembering which colour patterns. Some good examples (PDF) by Megan Woodrow:


How often should you change your water in Betta growing up tank? Daily with 50% till 90% water changes. No wonder our fry was growing at inconsistent rates and sizes. Optimum growth size is 8 till 12 weeks to reach show grade size.

Betta Spawn Log : BSL201806024 : HM Orange + Red (S) x HM Dirty Yellow (S)

It has been a while we've another breeding project involving two HM. Timing was right as the male HM was making bubble nest and the female HM was fertile with eggs.

Male: HM Orange + Red (S)
Age: 3+ months
Temperaments: Normal.
Size: Small (3.0cm body only)
Grade: B

While we have quite a few HMs, especially own breeding project, but there is only a partial orange and red colour HM. While this HM is quite young, this male Betta have been building bubble nest non-stop for the past month.



Female: HM Dirty Yellow (S)
Age: 4+ months
Temperaments: Normal.
Size: Small (3.0cm body only)
Grade: C

This female Betta was part of a pair of yellow HM we bought for breeding. Unfortunately, the mating didn't ended well as both Bettas were fighting with each others and don't want to mate. As you can see from photo below, the female Betta's fins were badly damaged.


Log Notes
2018-06-23
We decided to put in another female Betta. The existing female Betta was kept in the breeding tank and isolated in a plastic bottle. Having two female Bettas will increase competition and lead to successfully breeding.

2018-06-24
Mating completed during early morning around 4 a.m. We removed the female Betta around late evening as the weather was too cold and temperature of fresh new aquarium water was too low.


2018-07-17
Almost one month and the fishes were growing well. Quite a large spawn and we're anticipating the outcome of this spawn.

2018-08-10
Instead of the normal rectangle sized aquarium, we have put the fry into the square plastic container. Water changes were done two or three days interval. Good thing was the father Betta was healthy and active without any sickness.

Retrospection
1/ Have to be careful with frequent water changes as certain small size fry may not survive the stress of sudden water changes.

This Week I Learned 2018 - Week 25

Week 24 post and something from archive.

中国最后的剑圣, 于承惠。在中文影坛里,在也找不到另一个演员能诠释演出这个角色,从霸气的恶人角色到闭山修行的一代宗师。可惜,晚年在影坛没参与任何武侠片。

How to Survive Your 40s? (via KH). As someone who going to take a leap into this new decade, I can probably relates (the screenshot below tells quite a lot as well) to the author experience. Since few years back, younger people have started to call me "uncle" (my choice of clothing did contribute to that as well). It's a sudden but natural shift that comes with your age. The article reminded me of a Korean movie (can't remember the name) I've watched few weeks back. Basically the protagonist (someone in his 50s) said you need to see this milestone as the second 20s. The second time for you to reflect or follow up with what you've done (differently this time) in your 20s. The to-do list since so many years ago is still so long and it will keep me occupied for so some times.



What the difference between Perl and Python? If you need a comparison between both programming languages, this book, "Scripting with Objects: A Comparative Presentation of Object-Oriented Scripting with Perl and Python", while quite dated (it was written in 2008), provides some insights on differences between these both programming languages. In the end, the rising popularity of Python and emergence of Perl 6 shown that, opinionated or there should be a standard way of doing things won.

Why you need to set default value in `sub` in Moo or Moose? Because having a subroutine wrapper returns a unique reference every time you create a new object.

How do you boot from USB thumb drive from Grub itself? Yes, this is possible (do read the whole discussion). You must go to the Grub console by pressing 'c'. Remember that you can tab to find out which removable media and partition to use. It's quite annoying that sometimes the BIOS cannot detect the removable media (thumb drive) and can't boot from the device itself.
grub> ls
grub> set root=(hd1, msdos2)
grub> chainloader +1
grub> boot

On a related note, migration from Fedora 27 to Fedora 28 was such a painful experience. The keyboard and mouse did not work and were very lagging. I'm not sure, but Fedora 28 was such a let down. In the end, have to wipe out the whole installation and replaced it with Ubuntu 18.04 and everything works as intended. Seriously, Fedora, what is going there with 28 release?

Why they said Perl is a more advanced scripting language for system administrator? See App::GitHubPullRequest, a Perl console tool that glues together three different console tools of git, stty, and curl.

How to train your kids to do house chores voluntarily? (via HNEmpowerment since toddler.

Dreadful tasks? Just try, give it a while.

Which Perl modules to use when making HTTP requests? There are so many.

How does you do dispatch table in Perl? Found an old discussion (2010) in HN. The book High-Order Perl have a whole chapter (PDF) on this topic.

This Week I Learned 2018 - Week 24

Previous week post and from the archive.

When you have so many fishes died and so many was born in the same week, it did bring a whole new meaning regarding the circle of life. However, looking closely, it's simply just the incorrect water parameters issue in multiple aquarium tanks.

How the heck we return an array reference when using Perl's map to manipulate each element in the array list? The answer is quite straightforward, using bracket `[]` to wrap the list in array context.
use Data::Dumper;

my $items_in_lowercase = [ map { lc($_) } ('Foo', 'Bar', 'Baz') ];
print Dumper($items_in_lowercase);

What are the available core modules in your Perl installation? Use `corelist`, a command line front end to Module::CoreList to find out.

How does a Perl's coding standard documentation looks like? The SEI (Software Engineering Institute) Cert Perl coding standard not only well organized, it's also well written. Really put some software companies own documentation to shame. To be fair, this is from SEI, yes, the one that introduced CMMI (Capability Maturity Model Integration).

Writing and releasing free and open source software? Which license to choose? Pick one that suite you then.

Are you working on interesting technical problems? "You might as well have asked who among us won the lottery." The top post has the best answer I've read since so long. The whole discussion not really about the technical problems but more towards your attitude towards it.

How do you handle undefined methods in Perl? AUTOLOAD or Autoload::Can, or Mojolicious' AutoLoader? Either ways is still a hack somehow or another when compare to other programming languages implementation.


Betta Spawn Log : BSL201806011 : HMPK Black Dragon (M) x HMPK Black Dragon (M)

Yes, another attempt of breeding project with two Black Dragons, this is similar to the failed BSL20180506 breeding project. For this project, we're using another male Betta but with the same female Betta. All these Bettas were purchased from the same breeder and were from the same spawn (siblings).


Male: HMPK Black Dragon
Age: 4+ months
Temperaments: Normal.
Size: Small (3.5cm body only)
Grade: B

Compare to its sibling in BSL20180506, this male Betta is more silverish where the other one more bluish. We don't pay much attention to this male Betta so nothing much we can describe about this one compare to the other more aggressive male Betta.



Female: HMPK Black Dragon
Age: 4+ months
Temperaments: Curious and active.
Size: Small (3.0cm body only)
Grade: B

The same female that did create a big spawn. We let it rested for a month instead of the usual two weeks before our next spawn. Other than minor bruises, the female Betta looks perfectly fine and was actively swimming around.


Log Notes
2018-06-11
Egg was seen on the bubble nest. But we're not sure but suspected that mating did happen before. Will wait a few days to see if any fry were found swimming around.

2018-06-13
Saw some fry swimming vertically. Immediately removed the female Betta from the spawning tank. As usual, the male Betta busy collecting and moving the fry back to the bubble nest.



2018-06-14
Saw most of the fry started to swim freely. Again, immediately removed the male Betta to prevent similar incident in BSL20180506 to occur again. We don't want to take our chances and decided not to use leaving-father-with-fry breeding method.

2018-07-12
When group of fishes grouped together and lay at the bottom, this was an abnormal behaviour that we have observed in our female sorority tank last time which wipe out all the fishes in the tank. Immediately, we did a 90% water changes and see the conditions have improved. After the water changes, the fishes have started to swimming freely in the tank. We're still not exactly sure what was the root cause.


2018-07-13
For the last weeks, we noticed a few fishes have died and some fishes grouped together and lay at the bottom of the tank and some were resting at the plant. Based on the past experience, we suspected there must be an outbreak some how but not sure the root cause. We immediately removed all the fishes to a temporary bowl with Methylene Blue medication to remove fungus or parasite; or ammonia or nitrite poisoning. Note that we did a 90% water change yesterday but the condition was improving for a while and reverted back to old symptoms.


2018-07-17
We still monitoring the fishes in the small jar but there have been no causalities. Daily water changes is a must.

2018-08-10
Certain fry have noticeable silver colouring on their body. Growth have been quite slow and we have quite a few causalities due to careless water changes. Good news was this spawn was not on medication anymore.

Retrospection
1/ Daily water changes is important for the fry growth and prevent any infections.

This Week I Learned 2018 - Week 23

Last week stuff or something from the archive.

We're half way through the year of 2018. Some new adjustment to my weekly blogging. Starting from this week, more question and answer style of writing.

Old school or just plain hipster? It seemed that the newly appointed important person does not or will not use a mobile phone. Interesting indeed.

What happened when the town beats the land in a sweep? It will get boring and expected, the usual classic rags to riches story line. We need more competition, super teams, and nemesis within the NBA league for the next coming seasons.

What happened when your stakeholders want to start a project that requires "seven red lines" ? Brutally honest or diplomatically tactful?

Does open office have a big impact towards deep work? And does it matters? The discussion in HN yields a few interesting points but the main question remains, why organization still insists on open office and expects deep work?

Is QBASIC a good beginner programming language? The sentiments in the HN members believed so, so do I. Simple (yes, even simpler than Python) and easy to get it up with a good TUI. For a modern equivalent, load81 is probably the closest thing.

Should you use your ISP's DNS server? Hell no. Switch to either Cloudflare's 1.1.1.1 or Google's 8.8.8.8. Not only you gain faster domain resolving speed, you also have privacy (debatable). When comes to implementing privacy in DNS, it seemed we have three protocols of DNSCrypt, DNS over TLS, and DNS over HTTPS.

Should you learn multiple programming languages or master one? Depends. Different people have different motivation, learning strategies, and priorities in life. Either one should works. Do what you love and love what you do.

How do you improve your writing skills? Measurement and volume. First, "you improve what you measure", a very metric-driven way of doing it. However, this may backfired as according to Goodhart's law, "When a measure becomes a target, it ceases to be a good measure.". Second, just write, deliberately, in fixed amounts of words. How? First, don't judge your works, forget grammar and spelling, just churn out words. The Emacs's typewriter mode is a good strategy.

When come to superheroes, how do you justify the existence a character without any special super powers? They have better soft skills and less ego than more powerful super heroes. Watch A critical component for a better visual answer. I almost chocked myself laughing non-stop while watching this, repeatedly.

How do we implement operator overloading in Perl? Use `overload` package. Example of good implementation is the `Data::Money` package.

Betta Spawn Log : BSL201806008 : Giant Armageddon (M) x Giant Galaxy (S)

An ad-hoc breeding project since we obtained another Giant Betta and quite a few female Giant Bettas were in fertile with eggs. Hence, we decided to proceed with this breeding project.

Male: Giant Armageddon
Age: 7+ months
Temperaments: Active.
Size: Medium (4.0cm body only)
Grade: B

We bought this at the local fish shop near Jalan Pasar as we never have a Betta Armageddon before, moreover it's a giant Betta. This male was quite active and started to make bubble nest every time a female Betta was near its proximity. Since SO like this Betta, we have setup a special tank and minor aquascaping to keep the fish entertained. We suspected that this Giant Betta was quite old due to its humpback.




Female: Giant Galaxy
Age: 8+ months
Temperaments: Fast.
Size: Medium (3.0cm body only)
Grade: B+

Since the last Giant breeding project, BSL20180315, with this female Betta, the fish have been kept separated for any breeding project. We did once try to match this female Betta with a Betta Koi. However, this female Giant was so aggressive to the male Betta and the breeding project was not successful.


Log Notes
2018-06-08
Eggs were seen in the bubble nest.

2018-06-11
Fry were seen swimming vertically. The female Betta was removed immediately to prevent it from eating the eggs.

2018-06-14
The male Betta was extracted and moved back to its own tank. The male seemed to have sudden shock and was seen holding upwards position for a while.

2018-08-10
The fry have been growing well and looked healthy. Due to their current growth rate, we have decided to move the whole spawn to another bigger growing tank.


This Week I Learned 2018 - Week 22

Last week post or something else instead.

为什么同级相斥,异级相吸呢?这不是指磁铁的原理,而是可以用来形容两个同样作风的领袖都会同样排斥。客观的见解来看待各国领袖的作风。

It actually dawned to me that `eval` is quite similar to try-catch block. If your language did not have the support of try-catch exception handling, `eval` (yes it's evil) is your friend. Even Try::Tiny have its own issues. Perl is really a f-up programming language.

VS Code can do that? (via HN) I still haven't have time to install VS Code in my lappy and set up all the necessary configuration and settings.

What's the point of Perl's map? To transform list without using for (each) loop. Is as simple as that and yet we still having hard time understand that? Another good discussion on different between `map` and `grep`, the former is to process a list, the later is to filtering a list.

Containers according to xkcd. Sometimes the simplest solution is the best solution.

30 is too old for tech job in China. (via HN)

REST API tutorial. Yes, I've done a few wrapper for third parties API and two common issues are not up-to-date documentation and inconsistency, especially when handling different HTTP responses.

Block EU users from accessing your site due to complication of implementing GDPR. Brilliant or just simply crazy. And then you have the GDPR compliance checklist or search through the whole GDPR legislation document instead from the original source or community curated info. GDPR is probably the best things that happened to protect user privacy and reduce the abuse of any organizations on handling our personal data.

"Just write. You'll find your own voice". Probably the best common advice given to anyone who wish to become better at writing. For something related to writing, Janki Method, an approach to learning. When you learn something new, write it down but in an approach of question and answer. Maybe you can use a flash card or something.

Stack Overflow for Team. Interesting, very interesting indeed. I chuckled when I saw this feature was released. Wonder how it likes to re-implemented someone else features. Yeah, we should see things from both ends. DRY can be violated if necessary, only if necessary.

Yeah, making money is nothing but how much you care about making money (emphasis added).
Caring a lot about specifically making money is, in my opinion, absolutely key to making money, because otherwise you just end up focusing on other things (family, pleasures, ideals, etc.). If I wanted to make money, I'd design a very different thing in a very different way compared to if I wanted to make something me and my circle of friends would find useful. These things are practically disjoint.

This Week I Learned 2018 - Week 21

Previous week post or something from the past.

Malaysian honorific title, an analysis. How many Datuk, Tan Sri, and others have been granted by each state. Yes, you can check whether a person have received any honorific title.

The more I coded with Perl, the more I've learned something so obvious that I didn't pay much attention. For example, to check if a method or subroutine exists in a class or package, use `can()`.

Check if method exists and invoke it.
sub make {
  my ($self, $item) = @_;
  my $method = "make_$item";
  if ($self->can($method)) {
    $self->$method(whatever);
  } else {
    die "No such method $method";
  }
}

Another approach, using reference. If the method or subroutine not found, `undef` returned.
if ( my $ref = __PACKAGE__->can("$method") ) {
    &$ref(...);
}

Check if a hash is empty? Perl's TMTOWTDI is just crazy.

if (%foo) {
    # %foo has at least one key
} else {
    # %foo has no keys
}

What is the closet HTTP method equivalent to ping? HTTP HEAD.

2018 Perl survey results. Surprised to look at the result of the age group. Two things that caught my attentions. First, there are developers who still code in their 70+ years old. Second, young new developers have been declining. You can see the trend there, Perl it's a dying programming language.


Betta Spawn Log : BSL20180525 : HMPK Black Dragon (M) x HMPK White Spot + Blue (M)

Decided to give it another try with the same male Black Dragon in BSL20180506. Since the male Betta still making bubble nest in the existing same breeding tank, we've decided to put another female to mate with it. Starting from this batch, we will remove both male and female Betta once the fry starts to swimming freely.

Male: HMPK Black Dragon
Age: 3+ months
Temperaments: Very aggressive and brutal.
Size: Small (3.0cm body only)
Grade: B

Yup, the same male Betta in BSL20180506. Seemed to be less aggressive these days after several attempts of breeding with it. While it was left alone in the breeding tank, we noticed that it was actively making bubble nest.



Female: HMPK White Spot + Blue
Age: 5+ months
Temperaments: Passive.
Size: Medium (3.5cm body only)
Grade: C



The same female used for breeding in BSL20180326. Little we realized that this female Betta have grown so much and this is probably the largest non-Giant female Betta we have right now.

Log Notes
2018-05-20
We decided to put in another female Betta and see how will the male Betta react. For this breeding project, the female Betta was slightly larger than the male Betta and it did not show any slight fear towards to male Betta.

2018-05-27
Saw quite a few fry swimming vertically. Surprised to found out that this pair have successfully mated. The male Betta was busy collecting and picking up fry to the fragile bubble nest. Based on the lessons learned in BSL20180506, we immediately jar both the female and male Betta.

The female Betta was growing so well and we noticed that it can produced much eggs. We've decided in future to put her either in a special aquarium tank on her own or a larger community tank. Not a lot of fry, we believe this female Betta can't produce much eggs. Maybe it was not conditioned properly with the right amount of food and so forth.

The male Betta was a bit resistant when we jarred it and quite aggressively of moving around the smaller aquarium tank. Quarantined the male Betta in a quiet and darker place so it won't be stress leaving its fry and new environment.

2018-06-03
The male Betta was doing well, although a bit stress and refuse to eat much pellet. The fry was doing fine as well even though the number was quite small. One issue when you removed the male Betta, the idle breeding tank may be infected with Mosquito larvae. We have to manually removed it and feed to other Betta fishes.

This Week I Learned 2018 - Week 20

Week 19 post or something from the past.

Interesting development on the local scene. Everyone is overwhelmed by the endless good news which some seemed too good to be true. Still too soon to tell but nobody think it will get worst than the current mess. On a side note, at least now we can read articles in Medium from our mobile devices.

The completion of BSL20180124. Our second successful spawn. As usual, write-up on the whole process and retrospection on our breeding process. Both of us are getting more experienced, selective, and bolder when breeding Bettas. So many things learned during these few months and what we learned can definitely can help us to improve our other spawning projects. We can now confidently buy better grade (ahem, more expensive) Betta fishes and breed them. But right now, the main focus is to change our breeding method from leaving fry with father to removing fry after free swimming. The former method produces limited number of fry and the later will yield large (till 500 fry) spawn. We shall see the result in coming months.

The difference between `application/xml` and `text/xml`. Encounter this when making RESTful request and the existing CPAN module does not recognizes `text/xml`.

Good sample Dockerfile to setup your Perl application in Docker instance.
FROM perl:5.26

RUN cpanm Carton && mkdir -p /usr/src/app
WORKDIR /usr/src/app

ONBUILD COPY cpanfile* /usr/src/myapp
ONBUILD RUN carton install

ONBUILD COPY . /usr/src/app

Detect whether an item exists in a Perl's array. Why such simple stuff needs to be so complicated in Perl?
# $value can be any regex. be safe
if ( grep( /^$value$/, @array ) ) {
    print "found it";
}

A Practical Guide to (Correctly) A Practical Guide to (Correctly) Troubleshooting with Traceroute (PDF). We have been using traceroute wrongly all this while.

Betta Spawn Log : BSL20180518 : Super Red HMPK (M) x Super Red HMPK (M)

Finally, the time is right to start with breeding project with a pair of Betta from the same type and colour even although it's not a sibling pair. For this breeding project, we're going to ditch the leaving fry with father method and extract the male Betta once the fry start to swim freely.

Male: HMPK Super Red
Age: 3+ months
Temperaments: Fast and active.
Size: Small (3.0cm body only)
Grade: B

Another purchased due to attractive low price. Our plan b for Super Red. Initially it was quite fragile and small but over the time, it was moving actively and making bubble. Hence, we decided to proceed ahead with the breeding.




Female: HMPK Super Red
Age: 5+ months
Temperaments: Aggressive.
Size: Small (3.0cm body only)
Grade: B

The female Betta was used for different breeding project with another Super Red male but it didn't went through due to size difference. The female was larger than the male. For this project, we were concerned about the size differences as well.


Log Notes
2018-05-18
Back from work and was sitting in front of the breeding tank. Didn't realized that both pair was mating during in front of me. We're quite surprised that mating started so soon and can't recall when did we put both pair into the breeding tank to condition them.

2018-05-19
Jarred the female Betta. Waiting for these eggs to hatch.

2018-05-20
Found some fry swam vertically and the male Betta was busy picking them up. Waiting to jar the male Betta by tomorrow.

2018-05-23
Nothing found within the breeding tank. Not sure what happened but we assumed no fry survived.

2018-05-25
Found some fry but very small and fragile. We've started to fed BBS to them. Will check if everything goes well.

2018-07-26
Still some fry within the tank. Decided to keep the male Betta as it's. Once the fry starts to grow a bit and survive the male Betta, will move to our common breeding tank.

Betta Spawn Log : BSL20180526 : CT Red + Blue (S) x HMPK White + Blue (S)

Yet another breeding project with Crown Tail (CT) betta. The previous CT breeding project, BSL20180309, did not produce any fry and SO decided to try again.

Male: CT Red + Blue
Age: 3+ months
Temperaments: Very active.
Size: Small (2.5cm body only)
Grade: C

Our second CT, nothing special about this one except it has been idle there for quite some time and we decided to test out this CT.



Female: HMPK White + Blue
Age: 4+ months
Temperaments: Active.
Size: Medium (2.5cm body only)
Grade: C

The first female from our breeding project, BSL20171231 that was used for this breeding project. We have a spawn of female Betta waiting to be mate with another male Betta so we tried with this one first. Again, nothing particular special about this female Betta.



Log Notes
2018-03-29
The CT was purchased and delivered to us. Looked quite small and fragile but it seemed to settle down just right.

2018-05-17
We put the pair into a small plastic breeding jar.

2018-05-26
Mating started and we saw some eggs. Immediately we removed the female Betta as the breeding jar was too small. The male Betta will attack the female Betta since the container was so small.

2018-10-11
Since this small spawn was moved to other breeding tank, till today we still can't find any of its fry. There were no noticeable fry with CT tail. Unfortunately, we have decided that this breeding project was not really successful.

Retrospection
1/ For CT, maybe we should pair it up with another CT female. Otherwise, the gene will not be inherited over to the next generation.

This Week I Learned 2018 - Week 19

Last week post or something else instead.

Surprised and shocked. The only two words I can think off to describe my feeling for the past week. First, surprised because this one particular item on my bucket list which I guestimate will took me next 20-plus years or never to check off have been accomplished this week. Secondly, shocked it came so soon and such a massive shift and the non-stop flair of dramas. The staycation was well-needed as I was still recovering from my injury. Enough said, I've done my part and moved on to next item on my list.

Infestation of the Blue Green Algae (BGA) is getting worse and we have to do almost daily water changes on certain aquarium tanks. Prevention method is quite straightforward, use blackout method. First, 30% to 50% water changes, add air stone, cover tank for 3 to 4 days, and did another 30% to 50% water changes again.

Some MySQL stuff I've encountered recently.

When creating a MySQL stored function, do remember if the function does not modify data, you will need to set extra explicit options for binary logging.
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL,
or READS SQL DATA in its declaration and binary logging is enabled
(you *might* want to use the less safe log_bin_trust_function_creators
variable)

The sample SQL statement as follows.
CREATE FUNCTION f1(i INT)
RETURNS INT
DETERMINISTIC
READS SQL DATA
BEGIN
  RETURN i;
END;

The limitation or restriction of subquery in MySQL. It doesn't supports `LIMIT` in subquery yet? Encountered this error message. To work around, you've to rewrite you SQL query using `JOIN` instead.
SQL Error (1235): This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

Can't delete using subquery? Wrap your subquery in additional subquery.
DELETE e.*
FROM tableE e
WHERE id IN (SELECT id
    FROM (SELECT id
        FROM tableE
        WHERE arg = 1 AND foo = 'bar'
    ) x
);


Betta Spawn Log : BSL20180507 : HMPK Koi Red (M) x HMPK Koi Red (M)

This is the continuity to the failed breeding project of BSL20180328. For this breeding project, the same female was paired up with the newly bought male Betta. We were a bit reluctant to mate this pair as the female Betta was older and a bit larger than the male Betta. Past experiences have shown us that mismatch body size between the pair where the female is larger than the male may not work. The male Betta may get bullied by the female Betta.

Male: HMPK Koi Red
Age: 3+ months
Temperaments: Cowardy.
Size: Small (3.0cm body only)
Grade: B

Even after several months this young male Betta with us, it's still still quite wary of human interaction. When we placed it next to the female Betta, it have shown some interests and started to making bubble nest.



Female: HMPK Koi Red
Age: 5+ months
Temperaments: Curious and active.
Size: Small (3.0cm body only)
Grade: B

Since the last breeding project in March, the female have been quarantined for two months. It's now more active and curious and we noticed the female Betta was ready to mate as its stomach was full with eggs.



Log Notes
2015-05-07
We monitored it for a while but didn't find the female Betta was interested with mating. The female Betta was older and size-wise, is quite similar and larger than the male Betta. Both were flaring with each other.


2018-05-08
We assumed the pair have mated on this day.

2018-05-10
To our surprised, we noticed some fry were swimming vertically and didn't realized that the pair have already mated. Immediately, we removed the female Betta and put into quarantine tank. As usual, the male Betta was busy collecting the fallen fry and relocated it back to the bubble nest.


2018-05-12
These fry start to swim freely and we've started to feed Baby Brine Shrimp (BBS). To our surprised again, this spawn is probably one of our largest spawn, roughly around 200 to 300. We were wondering how many would survive for the coming weeks? We're tempted to remove the male Betta but decided to keep the male Betta in the spawning tank. Let's hope the male Betta will not eat up all the little fry.




2018-05-15
The number of fry in the breeding tank still maintain. The male Betta still leave them aside. We were discussing on whether to take out the male Betta so we can have a spawn of 200 till 300. In the end, we decided to keep the male Betta so it can curl those unhealthy fry till a average number of 40-plus fishes. Too soon to tell, it will end up that the male Betta wipe out the whole spawn.

2018-05-17
Yup, as we predicted, the population of the fry have been reduced by 70%. Not much left within the breeding tank. Maybe we should proceed with different breeding method by removing the male Betta by the time the fry already started swimming freely.

2018-05-20
We can't find more fry except maybe one. Therefore, we've decided to move the male Betta into a quarantine tank and left the breeding tank as it's before wrapping it up.

2018-05-23
It seemed we made a mistake. Most of the fry where hiding within the aquarium plant. We've decided to extract and move them to different breeding tank. A total of 83 fry were captured and moved.

2018-05-25
Found even more fry in the existing tank. Total count was 107. It's very hard to find and see any fry if they are too small and body were transparent.

Introspection
1/ Not every male Betta is suitable for leaving fry with father method. Mostly likely it will eat up all the fry due to stress. Main cause of the stress was due to the breeding tank was a clear tank instead of the covered box.

2/ For future spawning project, out discussion lead us to use different breeding method. We will extract the male Betta once the fry start to swim freely.

This Week I Learned 2018 - Week 18

Last week post or something else from the archive.

最近无意看了汤浅政明《春宵苦短,少女前进吧!》,那个诡异及天马行空的画风及离奇爱情故事,非常值得一看及收藏的动画电影。导演另一个作品,《四疊半神話大系》,也值得一提。


FORMS. Interesting concept on how to manage your week. In other words, you have a daily theme or something you're going to focus on each day. For example,
  • Monday: Finances 
  • Tuesday: Operations 
  • Wednesday: Research & Development 
  • Thursday: Marketing 
  • Friday: Sales
Interesting learning experience with Perl and Travis CI. From how-should-i-start, to why-this-is-not-working, and finally-something-is-working, Axel Beckert's guide is a definitely must read material. Furthermore, the Travis-CI testing helper for Perl modules does help a lot. However, like most Perl modules out there, documentation and maintenance is still a major issue. No worry, there is a tool to bootstrap the `.travis.yml` file, just install App::CISetup and use `setup-travis-yml.pl`.

Having fun coding and can't seem to stop. Moderation is the key here.

kwalitee. Yes, kwalitee or Test::Kwalitee.

Facepalm. Totally speechless when using Dzil and Perl::Critic. You cannot put the package name in the first line of the code otherwise Perl::Critic will complain.
use strict;
use warnings;
package Foo;
# ABSTRACT: This is a Foo.
# KEYWORDS: foo bar baz

use frobnitz;
use OtherStuff;
...

Betta Spawn Log : BSL20180506 : HMPK Black Dragon (M) x HMPK Black Dragon (S)

This is probably the worse breeding process ever we've observed and partly it's due to our negligence. We started this breeding project because this is our first spawn which consists of a pair of siblings and more importantly, a pair of Black Dragon.

Male: HMPK Black Dragon
Age: 3+ months
Temperaments: Very aggressive and brutal.
Size: Small (3.5cm body only)
Grade: B


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



Log Notes
2018-04-03
Due to some luck, we managed to buy two pairs of HMPK Black Dragon from a same breeder. Based on the size, we estimated these Bettas were around 3+ months. We decided to let these fishes to settle down as we're too occupied with other breeding projects.

2018-04-30
We tried to breed with a pair of Bettas. Due to our carelessness, the male Betta was attacking the female Betta very aggressively during the mating. The female Betta was badly injured and we removed and quarantined the female Betta after two days of severe injuries. It did not survive.

2018-05-06
Second mating with another female Betta proven to be successful. We found some eggs in the scattered bubble nest.



2018-05-08
Quite a large spawn and we found quite a lot of fry. The male Betta was busy picking up fry and brought back to the bubble nest.

2018-05-10
Whole population was wipe out by the male Betta. No a single fry left in the breeding tank.

Introspection
1/ If the male Betta is very aggressive (pay attention to how much damage it causes the female Betta), remove the female Betta immediately if no eggs were seen in two days. Aggressive male Betta should be monitored very closely.

2/ Refer to point (1). Move the male Betta immediately after the fry swims freely. Aggressive or frighten male Betta may eat the whole fry population.