Tuesday, August 16, 2011

Fish Mating Season


I am wondering what kind of day is today... Can I say a happy day or not? Today I just saw two couples of my fishes mated. One couple was mating in the afternoon while I was coding. I heard bunch of noise coming from my fish tank. A male fish was chasing around another fishes and frequently they hit the shells or small rocks on the bottom and sometimes they splashed the water on the surface. I wondered what they were doing until I saw a male fish started to dance and a blue female cichlid started to approach. I didn't pay too much attention when they were mating and not so long after I saw the blue female fish has already held eggs in her mouth. I was actually shock, because this blue female just gave birth to twelve babies last month and now she is "pregnant" again!

Another couple of my fishes mated in the evening, they are a couple of red-eye yellow cichlid. For your leisure time entertainment may be you can watch this video below that I recorded during the mating process. After watching hopefully you can get a little bit knowledge of how this kind of fish breeds, who knows one day you might want to breed this kind of fish too. ^^

The video shows how African Cichlids do the mating ritual. Firstly, the male starts to shake the body or dance around the female and then the female will pursue the male's genital or secretion area near anal fin, then they rotate around the male pursues the female's genital. At this time, the female will lay eggs, then she instantly turn around to pick her eggs up, then the male dance again and the female pursues the male's genital to get sperm to fertilize the eggs in the mouth. Then they change position their position again repetitively until the female have no more eggs to lay. This mating ritual ends in approximately 10 minutes. This video is only a part of the whole mating ritual.



I put this couple of African Cichlids in a water bucket separated from other fishes in the tank to let them mate. The reason why they should be separated, because when they are trying to mate, the female does not dare to lay the eggs since the other fishes are approaching to steal the eggs when she lays it. And actually my fish tank is not really big, kinda crowded,
so I separated them temporarily and put them back to the tank again after mating.

How to see your fish is ready mate is pretty easy! To see which one is male, just pay attention to the fish that is chasing around the other fish and it has white or yellow spots near the anal fin (the female doesn't has the spots), the other thing that is quite obvious is that he will shakes the body like dancing. And how to see the female that is ready to mate is that the anus is swelling and she is trying to approach the dancing male.

So when you see this kind of situation, then separate them to the other place to let them mate peacefully without the interference of the other fishes. And after mating you can put them back to their fish tank again. The mother fish will keep the eggs safe in her mouth!

Blue female cichlid with mouth full of eggs, this is her second time to get "pregnant", last time was a month ago

Red-eye yellow female cichlid with eggs in the mouth too

You are more then welcome to give any opinion, idea or comment to my post! I will appreciate it!

Friday, August 12, 2011

Baby fishes growing up process (3.5 weeks)


Six of them are turning blue and another six stay the same, seems like the six babies that are not turning blue is the male one.

Put a white paper as a background looks better, right?

Close up 1

Close up 2

Close up 3

This is my favorite one, the stripes is not like the others, its more like tiger stripes then zebra stripes

Look carefully and you will see most of the fishes have stripes like zebra, unlike the previous one.

Close up

Close up

Close up

Close up

Close up

They know when I want to feed them. This is one of the reasons why I like to raise fishes, I love to see fishes feeding especially when they eat  aggressively (but I don't like to see any carnivore fishes eating on the other fish) 

They are growing up quite fast, aren't they? Just 3.5 weeks, now they are almost 2.5 cm. 


Adult Fishes
The parent fishes, the yellow one is the father and the blue one is the mother

The mother fish (I like her color!)

(Front) Not yellow, not blue, don't know how to describe this one, but this one used to be blue!

Another not blue not yellow fish!

This one used to be blue as well, but then turn yellow

Thursday, August 4, 2011

MySQL Query - count age by range

Now I have a condition to query on my MySQL database like following: I have a table, let's called it user_table and in the table I have columns including id, name, email, phone, birthday as the following:

id name email tel birthday
1 name1 email1 2144 1976-01-01
2 name2 email2 5436457 NULL
3 name3 email3 0976564765 1987-01-01
4 name4 email4 1243412 NULL
5 name5 email5 87432145 NULL
6 name6 email6 5777 NULL
7 name7 email7 9875847567 NULL
8 name8 email8 9854875463 1976-01-01
9 name9 email9 27557666 1966-01-01
10 name10 email10 8765765765 1976-01-01
11 name11 email11 0912564421 1984-01-01
12 name12 email12 0955711114 1986-01-01
13 name13 email13 123 1991-01-01
14 name14 email14 0955711115 NULL

What I want to do is to make a query that will group and count the user by age range. The result that I want, is like following:

Under 20 20 - 29 30 - 39 40 - 49 50 - 59 60 - 69 70 - 79 Over 80 Not Filled In
0 4 3 1 0 0 0 0 6

Before I started to look for an answer in the internet, I was thinking to achieve this result, may be I could use php and did the looping of  MySQL query which contains SELECT, COUNT and GROUP BY on different range of age, but this way is not a direct or a pretty solution. So, I tried to search on the internet of how to do it with pure MySQL query. And after searching on the internet I found out the solution as the following:

SELECT
        SUM(IF(age < 20,1,0)) as 'Under 20',
        SUM(IF(age BETWEEN 20 and 29,1,0)) as '20 - 29',
        SUM(IF(age BETWEEN 30 and 39,1,0)) as '30 - 39',
        SUM(IF(age BETWEEN 40 and 49,1,0)) as '40 - 49',
        SUM(IF(age BETWEEN 50 and 59,1,0)) as '50 - 59',
        SUM(IF(age BETWEEN 60 and 69,1,0)) as '60 - 69',
        SUM(IF(age BETWEEN 70 and 79,1,0)) as '70 - 79',
        SUM(IF(age >=80, 1, 0)) as 'Over 80',
        SUM(IF(age IS NULL, 1, 0)) as 'Not Filled In (NULL)'
FROM (SELECT YEAR(CURDATE())-YEAR(birthday)) AS age FROM user_table) as derived

From this solution we see that actually it's not necessary to use COUNT AND GROUP BY to count on how many records that fit to certain range or condition. And in fact this solution turns the vertical data into horizontal data, which can't be achieved through COUNT and GROUP BY (as I know, correct me if I'm wrong!).

As a novice, this solution clarified my concept and ideas in MySQL, such as:

1. In FROM we can put another sub-query and what the sub-query return is actually a table that gonna be used to do another query by the main query. Let me give you an instance of what I mean! Usually we do the query like this: SELECT * FROM user_table [WHERE condition], but in another situation we need to select something from a query result and give it as an input or a source table to another query, particularly the main query as you can see in the above solution: SELECT  SUM(IF(age < 20,1,0)) as 'Under 20', ...  FROM (SELECT YEAR(CURDATE())-YEAR(birthday)) AS age FROM user_table) as derived


2. Another thing is that we can use SUM without having to use GROUP BY, I used to think that whenever I need to use SUM, I should also use GROUP BY.

3. In MySQL we can make a conditional test that return a value with  this syntax: IF(condition,value to return when condition is true, value to return when condition is false), e.g. If age is smaller than 20, then return 1, else return 0. The corresponding MySQL is like following: IF(age > 20 , 1 , 0)


4. To get current year in MySQL use: YEAR(CURDATE());



Wednesday, August 3, 2011

Feeding My Turtles

My small wugui climb up the rocks to take the food

Wugui: "Ahhh.. finally I got it!"

The one on the rock is going to jump and catch the food

Aiming on the target

Wugui: "Aaaa... come on... give me! give me! give me the food!"

Small Wugui peeping on me after getting his food

This Big Wugui have a bigger bite than smaller one, that's why he becomes bigger than the other one

Wugui: "Oopsss... the shrimp is sticking on my nose! Help me... help meee... pleaseee..."

Wugui: "S..t! now it sticks on my chin!"

Let's see who will get the food

Good friend~

This small wugui is saving power to give a shot to reach the food!

Got it!

Sometimes the Wugui bite on my finger instead of the food, but it's not hurt

I give them this small dried shrimp as a supplement food.
This food cost approximately  200NT per bottle, I bought it on 北高雄 on 明誠路

My Wugui's main food, way cheaper than the supplement food. Only around 80NT per bottle

Wugui daily food

2 Weeks old blue baby African Cichlid

There are many types of African Cichlid fish, I have four kind of different African Cichlids in my aquarium which are Electric Yellow Cichlid, Albino Cichlid, Kenyi Cichlid and Cobalt Blue Cichlid as you can see in my previous post. The one that gave birth previously was the Cobalt Blue one, however the mate is a Kenyi Cichlid, so I don't know what or how the babies will be when they are mature. It's been two weeks and more since I stripped the baby fishes from their mother's mouth. Now they can eat grinded pellet or fish food already and have grown approximately 1.5cm long now.

Some of the baby fishes have started to become blue
They usually gang up in the corner when they are scared or shocked
Normally they are very active and aggresive
The air bubbles carries more oxygen to the water
12 healthy and happy baby fishes

Maximum filter rate to give higher water flow to let more oxygen dissolve in the water  and to push the small fishes to swim so they can grow faster



Some of the babies are turning blue now! ^^

Don't forget to put the black filter pad on the filter tube to prevent your baby fish being sucked into the filter

Baby Kenyi is approaching a drown grinded pellet

Small fish tank that used to be the babies' parent's home