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.

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 (M)

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.