Tuesday, August 23, 2016

Generating animated GIFs.

For future reference. This is how I record an animated GIF that can subsequently be tweeted. First I record video to an .ogg file using:

$ simplescreenrecorder
Then, I convert the .ogg file to a .gif file using ffmpeg. In this example, I skip the first 4 seconds of the input, and write as 30fps output:
$ ffmpeg -ss 4 -i in.ogg -r 30 -pix_fmt rgb24 out.gif
The resulting video will look something like this:

Monday, August 15, 2016

New Beginnings.

I was at Schiphol yesterday, and took this picture. The billboard and the airliner reminded me of June 2007 when I packed up some essentials (mainly clothing and a PS3), and was on a plane to Vancouver to start a new job with Slant Six games. I knew nobody in Vancouver, so it was quite a big step. It turned out I loved it, and since dec'13, I am a Canadian, father of two little Dutch Canadian kids. This new beginning worked out well for me.

Sunday, April 3, 2016

The best day.

The best day to plant a tree was 100 years ago. The second best day is today.

(Chinese Proverb)

It's my favourite proverb. And I love trees. Especially the slow growing oak is so majestic. You don't see many oaks in Vancouver. Cherry Blossom trees are very popular though.

Unfortunately, on the avenue where I live, the old trees that line it are pretty ugly ones. So we look with envy to the cherry blossom lined streets that are so abundant everywhere in Vancouver.

On our way to school last week, I spotted a tiny little tree in the grass. Right above it was a large cherry blossom tree, in bright pink. I compared the leafs, and they were identical, so the baby tree was the same species. Vancouver has a special week going on at the moment where citizens can get trees from the city for $10,- only. Checking out the site, it seems like many are already sold out, and I did not see a cherry blossom tree listed. So instead me and my little girl scooped out the little tree from the grass and put it in our garden. The baby tree was doomed anyway by the next grass mowing that would have killed it.

So here is the mother tree standing above the baby tree:

Here is the little fella, transplanted to our front yard. Fed with fresh ground from the garden store.

Monday, February 15, 2016

Does BC Assessment use a random number generator? (not really)

A hot topic here in Vancouver are the real estate prices. Going from crazy to insane to stark raving mad. The bursting of the bubble has been prophesied many times over, yet this never materialized.

Every year, an independent organization assesses the value of each property in BC. And those assessment reports are open public information, so it makes it easy to compare the assessments of neighbours. They assess the land and its buildings separately.

When it comes to the buildings part (harder to compare than land values, of course), I am at times baffled at what the assessors come up with. They are at times so bewildering, that I would swear that they are using a random-number generator for this.

Let me introduce to you: exhibit A and B. In a very fine part of town, on the west side of Vancouver, close to a park, we find these two neighbouring houses on Yukon street: number 7830 and number 7880. One of these buildings was assessed at $43,800 and the other was assessed at a $10,000 value.

And the $10,000 one is not the one you expect! The small one on the left from 1928 has the $44K value, and the large one from 1989 has the $10K value. Say what? No one in their right mind would value the 1 storey old timer more than the 2 storey newer house. Do the assessors think that the large one is radioactive or something? It gets even more puzzling if you consider that pre-1940 houses are not eligible for demolition in Vancouver, without recycling it.

I should clarify that for both lots, the land value is assessed at millions of dollars of course, so I guess that the building-part does not really play a role. Still, there are some strange forces at play in the Vancouver housing market.

UPDATE FEB16

So the user Jim on a real estate blog solved this mystery. It has to do with the RM-9 zoning. Those lots have been rezoned for RM-9, meaning that it can be used for low rise apartments. So now the land is worth a lot more, making the current mansion on it basically worthless, or $10K as BC Assessment calls it.

The owner of the old neighbouring house has opted for a special treatment according to Section 19(8) of the Assessment Act. The neighbour's land value remains being assessed according to the old zoning, which does not permit apartments. So the land value is less, but the building value is not set to the nominal $10K at which the mansion is now assessed.

Tuesday, August 25, 2015

Dumb Luck

So yeah, investing in stocks does have quite a bit of 'luck' factor to it. There is some science (fundamental analysis, I don't believe in technical analysis, btw) to it, but still: a big chance-factor.

One nice characteristic of the stock markets is that you will always pay fair value. At any moment, it is priced according to what the market thinks of it, as a whole. This means that the process of buying a stock is very different from buying a used car. When buying a used car, the dealer can totally rip you off with a price that is too high by objective standards. When buying a stock, you will pay the price that the market says is fair.

So a funny thing happened in december 2012. I decided I should balance my portfolio with a more defensive holding, something safer than tech stocks. And since I wanted a big global evergreen company, I decided to go with Coca Cola.

Now, coca cola is traded as the 'KO' ticker on NYSE. However, I was too hasty in my research, and blindly bought the ticker 'COKE'. This is a ticker from Nasdaq, and is not 'The Coca-Cola Co' but instead, it is 'Coca-Cola Bottling Co. Consolidated.' The latter is a $1.4B company, and not the $4.4B company I intended to buy: I had bought the wrong stock!

I quickly found out that I had the bought the wrong one. But the stingy me decided not to waste two more transaction fees, and stick with it instead. Now, two years, 8 months later, I noticed something interesting:

The capital gains on the bottling company have sky-rocketed. It went up by a factor 2.3x no less! And when checking the real coca cola stock I had intended to buy: completely flat in all that time! Sure, there is a dividend discrepancy between the two, but still: no dividend is going to make up for those big capital gains.

So what to do next? Sell COKE, and buy KO? It would lock in my gains. Or keep going steady as before and do nothing? Interesting choices. I was first leaning towards doing nothing, but then noticed the huge difference in P/E. Currently, COKE is valued at a ratio that is double that of KO. So yeah.... maybe a switch is in order?

Monday, April 27, 2015

Wednesday, January 21, 2015

Hop Marjanneke

My Dutch Canadian toddler, who speaks mostly English, is starting to sing the Dutch nursery rhyme Hop Marjanneke. It's pretty amazing how long lasting nursery rhymes tend to be. This one is from the year 1800 or so, more than two centuries old, and mocks the French occupation force from Napoleon Bonaparte's time.

And now, more than two hundred years later, a little girl in Canada is singing it. The lament of using to have a prince, but now have to deal with the bald French (referring to their lack of wigs after the French revolution in 1789.)


Image depicts Napoleon's entrance into Amsterdam.

Saturday, July 5, 2014

1978 - Brutal dictator steals the world cup.

In 1978 I saw my very first football match on television. I cannot remember whether it was in black and white or in colour, but it was a memorable experience for me as a little kid. Not in the least because my parents, always strict with bed-time, let me stay up way past my bed time. I understood that somehow, this football match was so important, my parents wanted me to see it.

It was the 1978 World Cup Final between Argentina (hosts) and the Netherlands. In the very last minute of the game, the Netherlands were oh so close to being crowned world champion. But the goal post was unforgiving. The conditions under the junta regime were atrocious. This also resonated on the field. From wikipedia: "During the game, the referees repeatedly ignored Argentine players running off side for up to 10 meters and catching the ball with their hands." The Dutch players feared for their lives, because of the hostile atmosphere in the stadium, and a military junta that demanded a win.

It will not bring back the victims from the regime, but: This Wednesday, the Netherlands can have their sporting revanche. It will be 36 years late, but it will taste so sweet. This time, General Videla will not be here to rig the results, Argentina. Hup! Holland, Hup!

Saturday, April 12, 2014

Vaisahki

Someone threw a party in our street today, and 50,000 people showed up. We attended last year as well, the event took place very soon after we moved into our house. The weather was awesome, and there is free food everywhere. Xander and Amy got a photo op with Justin Trudeau.

Monday, March 24, 2014

My Toronto stock market adventure so far.

Three years ago I began my Toronto Stock market adventure. So it's a good time to reflect. There is some good news: I beat the TSX market index by quite a bit. The bad news is that in 3 yrs time, the index was overall just flat.

The big spike in portfolio value (blue) of feb 1 2012, was thanks to a takeover of Gennum by Semtech. The price of Gennum more than doubled that day.

A 13.8% return is modest for a 3yr investment, but it beats the lousy interest on saving accounts these days. I remember saving as a child in the Netherlands, and getting a hefty 10% annual interest from 'the Zilvervloot'. I also traded on NYSE and Nasdaq. Even though the US stocks were more profitable than my Canadian stock, I failed to match either NYSE or Nasdaq performance.

Anyway, my lessons learned so far:

  • Got burned by Arise, a solar panel company. It went bankrupt soon after I bought it. Don't get suckered into green tech: they don't all have Tesla like stock performance. They typically falter.
  • You need a lot of patience with irrational market sentiments. Why is AAPL still not valued properly? It's my biggest US holding, and I lost money on it.
  • Take over bids tend to be good news, with an instant hike in stock price. It happened to me a lot. I think a lot of Canadian industries are consolidating.
  • Often, the real money can be made on dividends, instead of stock price. It pays to concentrate on companies that pay their investors well.
  • My biggest money maker was a US stock: Stratasys, which makes 3D printers. When I bought it, it was expensive, but still it tripled in value in a short period. Market leaders in brand new industries tend to do well. (I missed out on Tesla, but that would be in the same category.)

Tuesday, December 31, 2013

2013 totals

I have published some download statistics of The Little Crane That Could. Like 2012, the year 2013 was another blast.

Wednesday, December 11, 2013

Bitcoin, logarithmically

Some time ago, I purchased a bitcoin for a little under $300,- CAD. My reasoning went like this:

  • There is a non-zero chance of bitcoin replacing USD as default currency. Let's put it at 1 in 1000.
  • There is a hard limit of 21M bitcoins.
  • If in 2030, the world uses bitcoins, then those 21M coins will represent the entire money supply of the world's default currency.
  • My 1 bitcoin will represent 1/21Mth of the world's money in 2030, with a 1:1000 chance.
  • The world money supply divided by 21M and then divided by 1000, is still worth a lot more than the $300,- I paid for it.
In addition, I've started mining the bitcoin as well, using an ASIC miner. The bitcoin price fluctuates wildly, and it's hard to make sense of it. However, I find that treating the price logarithmically helps a lot. You can actually make out a trend, when you use that. Here is the price up to dec 11, 2013.

Friday, August 2, 2013

A spin-off.

Please let me introduce to you, a new blog thelittleengineerthatcould.blogspot.ca. It is a spin off from this blog. I decided to do this, so that game development blogs and personal items would not be mixed together anymore. If you like following my indie game development efforts, hop on over! I look forward to reading your comments.

Friday, July 12, 2013

Irrational Investor

Because I've been fortunate with my app store ventures, I have some money to invest. I want to share with you the story behind my worst investment, so that others may learn from my mistakes. When it comes to investing, it is hard to remain rational. One of the psychological hurdles to take, is to let go of buy-price. You should be able to reassess your holding at any time, and sell below cost if necessary. If you can't you are 'anchored' and this will hurt you. Here is what happened to me when I first started investing on the Toronto Stock Exchange:

My instinct was telling me that solar energy would be a growth opportunity, so I sought out solar panel producers. I found these two on the Toronto Stock Exchange:

  • Day4 Energy Inc. (DFE)
  • ARISE Technologies Corporation. (APV)

So I studied them carefully: the earnings, the price, their debt, the news items on them. After this study I decided to go with Day4, as it had just got certified in an important market. So I made the online trade, worth $9000, using the online investment website of my broker (RBC). The thing is: I had typed in the wrong symbol. So there I was, holding $9000,- APV instead of $9000,- DFE.

If I had been rational, I would have sold the APV and bought the DFE. However, I really did not like to spend two more transaction fees of $9.95 each. Psychologically, I was not prepared to take my $20,- loss on a stupid mistake, so I let it be. Hopefully, APV would see some nice yield. In reality, APV was bankrupt within a year, and I lost my entire $9000,- investment in 'green technology.'

I can laugh about it now, but darn, did I feel like a fool. Trying to penny pinch and save $20,- transaction costs, ending up losing my $9000,- principle. Talk about being anchored... Anyway, I still hope that for the rest of my holdings, all I have to do is wait long enough and everything will be in the plus. I'm a long term investor, and see much wisdom in the ideas of Warren Buffet. Currently, my largest holding is AAPL, which currently yielded -24% for me (not counting dividend.) I'm pretty confident that within a 5 years it will be the shooting star it once was, so I don't plan on selling before that one hits the cool $1000,- milestone (or $100,- when the stock finally splits 1:10 or so.)

Thursday, June 6, 2013

Quadratic Equations, solving 8 in one go.

Today I found out that modern intel CPUs can do 256 bit wide SIMD. This is possible with the Advanced Vector Extensions, or AVX. Operating on 8 floats at the same time is even better than what the PS3 Cell processor was capable of. So I wrote this neat little function that can solve 8 quadratic equations in a single go, without branching. It should come in handy when implementing a Fast Marching Method to implement Continuum Crowds. For SIGGRAPH 2008, some people at ATI implemented this on the GPU for their amazing Froblins Demo.

/*
 * solve aX^2 + bX + c = 0
 * solves 8 instances at the same time, using AVX SIMD without any branching to avoid stalls.
 * returns two solutions per equation in root0 and root1.
 * returns FLT_UNDF if there is no solution due to discriminant being negative.
 */
static const __m256 zero8 = _mm256_set_ps( 0, 0, 0, 0,  0, 0, 0, 0 );
static const __m256 undf8 = _mm256_set_ps( FLT_UNDF, FLT_UNDF, FLT_UNDF, FLT_UNDF, FLT_UNDF, FLT_UNDF, FLT_UNDF, FLT_UNDF );
static const __m256 four8 = _mm256_set_ps( 4, 4, 4, 4,  4, 4, 4, 4 );
inline void evaluate_quadratic8( __m256 a, __m256 b, __m256 c, __m256& root0, __m256& root1 )
{
 __m256 minb   = _mm256_sub_ps( zero8, b ); // -b
 __m256 bb     = _mm256_mul_ps( b, b );  // b*b
 __m256 foura  = _mm256_mul_ps( four8, a ); // 4*a
 __m256 fourac = _mm256_mul_ps( foura, c ); // 4*a*c
 __m256 det    = _mm256_sub_ps( bb, fourac ); // b*b - 4*a*c
 __m256 twoa   = _mm256_add_ps( a, a );  // 2*a

 __m256 dvalid = _mm256_cmp_ps( fourac, bb, _CMP_LE_OS );
 __m256 sr     = _mm256_sqrt_ps( det );
 root0 = _mm256_add_ps( minb, sr );
 root1 = _mm256_sub_ps( minb, sr );
 root0 = _mm256_div_ps( root0, twoa );
 root1 = _mm256_div_ps( root1, twoa );

 root0 = _mm256_blendv_ps( undf8, root0, dvalid );
 root1 = _mm256_blendv_ps( undf8, root1, dvalid );
}

Wednesday, May 22, 2013

2012 and 2013 goals.

So, this post is verbatim from an old indiegamer.com forum posting. On this old forum, it was tradition to set goals for the year, share them with the board community, and evaluate afterwards. indiegamer.com is down today, and I suspect it may be gone forever now. Readership was dwindling, spam was a plague, so I think it will be dead, if not now, soon. So let's preserve my goals here on my own blog.

The goals I set for 2012:
  • Add support for this awesome input device to the little crane that could for MacOSX.
    SUCCESS
  • Maintain my 2011 income (had a very good year).
    BIGGER SUCCESS
  • Release my first Android Game.
    SUCCESS
  • Release an update for Hover Biker.
    SUCCESS
  • New level for the little crane that could iOS version.
    SUCCESS
  • Port the little crane that could to Android.
    SUCCESS
  • Attend GDC.
    SUCCESS

It is amazing, but I hit all my goals. Maybe it is true what they say about: writing down goals make them come true. Although I did cheat a tiny bit: 'Port Little Crane to Android' and 'Publish Android Game' were originally intended to be separate games, but meh.

For 2013 I will:
  • Publish an OUYA game.
  • Hit 30K OUYA downloads.
  • Hit 10M downloads (cumulative over all platforms, all years) for Little Crane That Could.
  • Maintain 2012 income.
  • Reach 750 followers on Twitter.
  • Publish my first multiplayer game.