Sevenday pageviews

Mar 2, 2015

Aquarium

Hey guys,

So my fiancee comes home carrying an aquarium with her a few days ago. I don't know if you have any knowledge of aquaria and fish, but we don't. But from the information she received from the store, we started the process of filling the aquarium with (washed out) gravel, water and the fish.
The fish she got are called Cardinal tetra and look nice, but having just them is a bit boring. Besides, we didn't have any plants or other decoration. So we decided to go to the store and buy more fish and decoration. When at the store, I fell in love with Iridescent sharks and got two of them and three guppies. Other than that we got two plants and a ceramic fake branch.

When home, we placed the animals for half an hour inside their bags in the aquarium water to let them adjust to the temperature. Then I took the fish out of their water and into the aquarium.
The next day, while the guppies where still happily swimming around, my Iridescent sharks where looking like they'd prefer to breath air over water... Something must be wrong.
Determined to find the cause we went to an aquarium specialist store and ask for information. It turns out we did a lot of things wrong. So instead of telling what happened, I'd prefer to give some tips and explanations in the shape of a tutorial, on how to start an aquarium. This is based on the explanations that the aquarium specialist gave us.

First off, what do you need?
- Aquarium
    * Filter
    * Heater
    * Light
- Gravel
- (optional) Decoration
- (optional) Plants
- Fishnet
- 1 or 2 Buckets
- Fish food
- Fish

Our aquarium is a reasonably small aquarium of 25 liters. If you want to start a bigger aquarium, this tutorial might not be suitable for you.

1. Wash and place gravel

Pick your gravel carefully. we started of with white gravel, which according to the store contains a lot of calcium. This is important because it influences one of a few properties of water. From the three important properties: pH-, nitrate- and ammonia levels, calcium increases pH levels.

So let's start.
Make sure you wash the gravel so that it's as clear as tap water.
You can do this by placing it in a bucket in your sink (or bath tub). Open the tap until the bucket is filled with water twice as high as the gravel reaches and start stirring the gravel. Once the water lost its transparency, carefully tip the bucket to drain the water. Refill the bucket and repeat cleaning until the water doesn't get dirty anymore. Make sure you raise the bottom layer to the top every once in a while so that all gravel is cleaned.

Once you finished washing it, you can place the gravel. Dependent on the size of your aquarium and if you want to place plants, you have to first place a nutrition layer on the bottom. If you do want to have plants, make sure you have enough gravel so that they have a solid foundation.

2. Decoration



Now that the gravel is on the ground, you can start decorating your aquarium. A word of advice: don't add water like we did in this step, because it will make it difficult to place plants. Once you are satisfied with the layout, you can place your plants, statues, etc. in the aquarium.

3. Adding water

What water to add is dependent on your location and which fish you want to place in your aquarium. If you live in the Netherlands and want to have freshwater fish, you can add tap water. But some countries have poisonous material inside the water like for instance chlorine. The best is to get more information on what to do with your water at the specialist store.
Make sure that you add water at a location in your aquarium as far away from plants as possible, since the gravel will float around when adding water.

  4. Wait...

Wait, what? Don't put the fish inside? Nope... Fish are fragile creatures and require the water to be of a certain quality. For instance it should contain bacteria that break down the excrement of the fish. If these bacteria didn't get enough time to grow in amount, the ammonia levels will go sky high and your fish poison themselves. It is best to wait 7 to 10 days before adding fish. However, you should let the store check the quality of your water and let them advice you on getting your aquarium to a fish-friendly home.

5. Fish!

Congratulations, you have made yourself the happy owner of an aquarium fit for fish. However, don't just place them in. Ask the store from which you purchased them, how to do this. It will most likely be something like this:
1. Decrease the amount of water in the bag of the fish to a minimum.
2. Slowly add aquarium water to the bag, so that the fish can start getting used to the water of your aquarium.
3. take the fish out of the bag (without the mixed water) and add it to the aquarium.

There we go, our resulting aquarium is below. I hope this was useful and enjoyable to read. It sure was fun to write! See you guys next post! If you got comments, remarks or something else you want to share, I'd like to read/see them in the comments!

Feb 28, 2015

Leap Motion

Hey all,

As mentioned, this post is about the leap motion. Having studied about virtual reality, I have seen a lot of devices entering the playing field in the last couple of years. One of such devices is the leap motion. It is a well designed small box which uses three infrared lights and two cameras to detect your hands. Holding your hands above it (or in front of it when attached to a Head-Mounted-Device (HMD) like an Oculus rift for instance), you can use the leap as input for applications, games, etc.
However I don't think its tracking isn't robust enough to be used for casual users. But as software engineer it is actually fun to use and see what you can develop for it, so I took the "leap".

After installing the drivers and SDK, I checked out the app store. Eager to see if there is anything interesting on it. Most apps serve as tech demos and few actually offer something  useful or entertaining. So I decided to go right away to the development.
My idea is to develop a simple application that translates the hand position into mouse coordinates and have some gesture act as click. If I still think it's a good idea by the time the previous is implemented, I might add swipe recognition to be able to move the mouse between screens (toggling the mouse position from primary to secondary and back). The GUI framework I decided to go for, is WPF.

The SDK was simple enough to understand. It works similar to other hardware I've worked with. You subscribe to an event that sends frames, and use this as input for your application. A few obstacles however took some time to figure out, that's why I'd like to share them with you:
The first error I received, was the picture below.
























Not reading tutorials word by word, I apparently skipped the part in which they mention, you shouldn't just reference LeapCSharp.NET4.0.dll, but also copy Leap.dll and LeapCSharp.dll  in the debug folder. Things went smooth, and soon I got the mouse positioning working reasonably well, but when trying to play a game, the leap stopped responding...
It turns out that by default, leap only reacts when the application is active. So when you want to use the leap in your application, no matter if your application is active or on the background (minimized for instance), you can use the following line of code: "controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);".
Last but not least, WPF caused a problem because of its single-threaded design. Microsoft's "next-generation" presentation system makes multi-threaded applications more difficult to develop than winforms. However a solution to multi-threaded issues can be found here.

Well, that's it for today, I don't know when I can post again since this weekend will be all about doing and checking homework.

See you next time!



Feb 26, 2015

Start of my blog

Hey all,

Having seen lots of tutorials and blogs about programming, I have motivated myself to start a blog.

A disclaimer ahead of time: I'm busy with a part time study and job as a teacher, this blog might not update as often as you might be used to. However the more feedback I get from you readers, the more it will motivate me to write, right?

The topics that I will most likely talk about are programming, game development, programming related math and opinions on games.

My next post will be about my first experience with programming for the Leap motion. I am using visual studio for this and will be discussing some of the problems I faced and how they where resolved.

See you soon!