Author Archives: John Eriksson

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

Tracking Fingers

I decided to spend the evening writing on a new type of iPad game controlling class I came up with the other day. Even though I didn’t plan to use more than one touch point I started out playing with some multitouch code. I wanted to see if I could continuously track a bunch of touch points at once without mixing them up.

It all went all right at first but suddenly I noticed that some of the tracking nodes wasn’t removed even though the tracked touch were. After some tests I realised that I didn’t always got notified when a touch ended. We can’t have that!!! After even more tests I gave up trying to solve the matter using the standard callback methods touchesEnded and touchesCanceled, I just couldn’t trust them anymore. :-(

The solution was to keep track of the active UITouch objects and then check the phase property. Since the UITouch object is the same instance through out the complete touch-lifecycle I only had to store them in a separate dictionary and check them every now and then.

Want to see how I did it? Download the Xcode project below. :-)

FingerTracker.zip

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

Magic links in your WP posts

When I decided I not only wanted to write about coding but also another interest of mine, the trading card game Magic the Gathering, I decided that I wanted it to be simple to show cards and to link to cards. Since I use WordPress I searched for some plugin that could help me accomplish this. I found a few, but none of them linked to the real MTG database (http://gatherer.wizards.com). But, being a coder I solved the problem on my own. I didn’t really had the time to create a real WordPress plugin so I wrote this code directly into the theme (WordPress Twenty Twelve in this case).

Maybe I’ll find some time (and inspiration) to create a plugin, but until then, here is the code.

Add to functions.php

Add to header.php

Use in post

The result of the above code

Act of Treason
Act of Treason

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

Scratch Movie

Sometimes I have the opportunity to work with something really different, like this friday when I worked with an animated movie in MITs wonderful creativity tool Scratch.

It’s a really short movie that’s going to be part of the advertising for the KFUM IT summer camp, where kids (9-12 years old) will be able to learn how to create computer games and interactive stories using Scratch. In this project I’ll also teach the teachers and hopefully I’ll be abel to visit the camp for a day or two. :-)

Scratch is one of my favorite recreational programming tools ever! Go check it out! :-)

Screen Shot 2014-02-09 at 13.32.56

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

New Decks Incoming

Recently me and the kids once again ordered a whole box of fun (read Magic the Gathering cards). Two decks designed by me and the 10-year-old and some spare cards for little brothers new infect deck.

My deck is a red and white Ally deck. Allies are a creature subtype where all cards has abilities that is triggered when other ally creatures enters the battlefield. It can be anything from +1/+1 counters, protection from a colour to life gain and other fun stuff. I’ve also added a Door of Destinies that should work well since there is only one type of creatures in the deck.

The 10-year-old designed a classic mono red burn deck with Goblins which includes everything you would expect, from Goblin Arsonist to Lightning Bolt. But is it fast enough to beat my super-life-gain-deck? Well we’ll see I guess. :-)

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

Smashing Articles

Just got a mail from a colleague with a link to an online paper that I completely missed. The Smashing Magazine has a lot of great articles about web development, design and graphics. They even have a special category for WordPress (if you’re into that).

Got some time to spare? Pay them a visit!

Smashing Magazine

Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 3 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 13 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 23 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 33 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 43 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 53 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 63 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 73 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 83 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 93 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 103 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 113 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 123 Notice: Undefined index: HTTP_REFERER in /home/a/arainydayse/arainydayse/arainyday.se/www/wp-content/themes/twentytwelve/content.php on line 133

New day, New design issues

Today I’ll spend most of my time finishing the transformation of an iPad app from iOS 6 to iOS 7. Hopefully without breaking it while introducing some more light and air.

Ever since the first beta of iOS 7 I have been struggling to decide whether I like the new look or not. I surly miss the skeuomorphism (I’ve actually been a sucker for real life looking UI ever since the first 3D-buttons in Windows) but I really enjoy the new fresh feeling, the new transitions and the blurred panes.

But maybe it’s like when trying to get the kids to like some new dish or vegetable, you have to taste it a few times (sometimes a lot of times) before you can truly enjoy the flavours?

Read what Apple says about the new iOS 7 Design