Tuesday, October 07, 2008

How Xcode and Interface Builder relate

I'm starting to understand now how Xcode ties in with the Interface Builder.

My first confusion was this: in the main function when UIApplicationMain is created, how can it know what its delegate is when it is not explicitly mentioned in the arguments? Answer: It's mentioned in the MainWindow.xib file. This file is an XML file which is turned into a "nib file" later (when building?). Double clicking on it in Xcode brings up the Interface Builder. Clicking on "file's owner" and then pressing apple-shift-I brings up the Inspector, where I could then see the delegate -› MoveMeAppDelegate relationship (wtf had to press alt-b to get the › character).

Next I'd like to understand how to reference things set from the Interface Builder from my code. Specifically, how to change the text in a label? What identifies the label in my code?

[24 hours pass]

Okay wow, somehow that was really tough to figure out. To change a text in a label, I needed to get a reference to the label object. I was really confused trying to drag a line from "referencing outlet" to somewhere, with nothing accepting the drag. Turns out this is where the IBOutlet comes into play. I had to have IBOutlet UILabel *label; in the class to which I am dragging to, then the drag will be accepted (although at one point I seemed to sense a delay before Interface Builder realized now the drag can be accepted?).

So the controller that accepted a drag from a textfield "referencing outlet" looks like this:

@interface ThreeFieldsViewController : UIViewController {
IBOutlet UILabel *label;
}
@property (nonatomic, retain) IBOutlet UILabel *label;

Then additionally in the .m file I had to @synthesize label. Didn't check if it would work without that. Actually, it would be interesting to test if the Interface Builder code that gets generated just sets the attribute directly, or calls setLabel? Let's see. Yep, setters and getters are called if and only if there is a referencing outlet.

As a bonus I discovered that if you make a method and tag it IBAction, you can drag action references from components to that in Interface Builder. Not sure if there are some interesting arguments passed that could somehow be read. Next up: trying to make an app with three labels that get updated by a timer with data from the accelerometer.

Monday, October 06, 2008

Interface Builder

For someone who hasn't coded much, I think it's a bit dangerous to start with a graphical interface builder in an IDE. It gives you the wrong idea that everything is really easy. Just drag and drop stuff and BAM (channeling Steve Jobs here)! Of course you'll end up spending most of the time (as you should) in the actual code, and building interfaces will just be a short break. At school we had tools like this, then there would be people who confused building applications with designing their interfaces, and for them it was a shock how much work there was underneath, not just dragging stuff to build the interface.

With this in mind I am approaching the Interface Builder a bit carefully, almost trying not to have too much fun with it. It of course does make sense to use it. I could create all the components in code, and almost prefer to do so, but still I have to admit that it must be faster to use this tool if I can just learn to use it properly. I want to get stuff done fast, therefore I must learn this. So I've started it up, started dragging stuff around. At this point I still don't understand how this ties to Xcode. I do know there are some "nib files" and that the controls can be raised from it, somehow relating to the initWithCoder method.

The goal for tonight will be to understand how to create some simple text labels in the Interface Builder and then how to set the text to those labels from Xcode.

Sunday, October 05, 2008

iPhone dev 17

Oh lord, I just discovered that curly braces require one extra keystroke on the Finnish keyboard layout on the mac. Somehow the keyboard layout isn't the familiar one from Windows. I would use the USA layout, but then writing scandinavian characters would be a pain. I have to press alt - shift - 8 to get a curly brace!

Spent hours today trying to find out why a sample application won't run on the iPhone. Turned out in my Info.plist file the bundle identifier was the same as with another app, so it wouldn't install another one with the same id.

Next I challenged myself to create a small app which would have three textfields that display the raw data coming from the accelerometers. I got stuck early -- I wanted to use a timer to fire an event at certain intervals. Spent a very long time trying to find info in the docs. Looked at some sample applications, but they were more hardcore and had actual threads to do the timing. Then finally NSTimer was mentioned in a forum post.

timo = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];

- (void)onTimer {
int test;
test = 10;
}

Disappointed a bit that I couldn't finish this dead simple app in one evening. I'm starting to get a feeling where iPhone development falls on the difficulty scale. Maybe 5 times easier than Symbian development, but still 2-3 times more time consuming than Flash development.

Hello World in Flash from nothing: 5 minutes
Hello World on the iPhone simulator: 2 hours
Hello World on the iPhone: 6 hours (mostly figuring out app signing, device id blah blah issues)
Hello World in Symbian: coder pronounced dead at the hospital due to massive internal bleeding

Code Signing Provisioning Profile

Came across a problem that I noticed others were also having on some forums.

When you create a provisioning profile in apple's portal, then download it and try to go to target info to use it, it often isn't there. You try to click on Code Signing Provisioning Profile > Any iPhone OS Device, but it doesn't show on the list. I'm not sure if there is a more clever way to do this, but I can get it to show by right clicking and selecting "show definitions", then replace the hexadecimal values shown with what I find in /Users/YOURUSERNAMEHERE/Library/MobileDevice/Provisioning Profiles. Then when I right click again "show values", it's there.

Hope this helps someone =)

iPhone dev 16 - memory management

Found an article about the memory management issues. Noticed that I am indeed making a mistake. After allocing and initing an object, I am increasing the retain count by one. This is not necessary, the retain count is already one at this point.

Second mistake I think I am making is failing to release my textfielddelegate and UITextField. Maybe I could use autorelease?

But what happens when I set the delegate by doing testText.delegate = x. Is the retain count of x now incremented by the delegate setter method? In API docs it shows that the property is declared like so:
@property(assign) id delegate

"assign Specifies that the setter uses simple assignment. This is the default."

Okay, so it would seem that the retain count does not get incremented, which means it is my responsibility to release the object at the end. Great, seems to work!

iPhone dev 15 - How do I monitor the events that the textfield sends? Where does it send them to?

Last time I wondered what happens with the textfield events. Now I've read a bit more about delegates, how to use them in practice. Controls have a "delegate", called such because application-specific behavior is delegated to it. For textfields the delegate protocol is UITextFieldDelegate. To implement protocols, angle brackets are used when declaring a class, so here is the code I used in my declaration in MyTextFieldDelegate.h:

#import
@interface MyTextFieldDelegate : NSObject {
}
- (BOOL)textFieldShouldReturn:(UITextField *)exTextField;
@end

Then implementation in MyTextFieldDelegate.m is very simple:

#import "MyTextFieldDelegate.h"
@implementation MyTextFieldDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)exTextField {
[exTextField resignFirstResponder];
return YES;
}
@end

I found that "resignFirstResponder" line on some Mac development forum. I tried to read the docs a bit to learn what it means. The docs say unhelpfully that it makes something release the first responder status, whatever that is. In plain english I discovered it means that it makes the soft keyboard disappear, at least in this case.

Well above you see the delegate class, but that wouldn't do much if the textfield doesn't know about its delegate. I think this part must be slightly wrong because I'm never releasing the objects I create, but as an initial test this worked:

MyTextFieldDelegate *x = [[MyTextFieldDelegate alloc] init];
[x retain];
UITextField *testText = [[UITextField alloc] initWithFrame:testFrame];
testText.delegate = x;

The dot notation surprised me. After all the talk about automatically synthesized getters and setters, I expected to actually have to call methods to set variables. After reading the docs a bit more, it turns out that I actually AM calling a method here! The dot notation in Objective-C turns out to be exactly the same here as calling [testText setDelegate:x] and the dot notation is just a shortcut to it. This is very clever, because it allows you expose properties conveniently, but at the same time if necessary allows you to run code when they are accessed.

I'm starting to like this more and more, but memory management still confused me. I wonder how to see what I am failing to release? I don't want to leak memory on someone's iPhone.

Saturday, October 04, 2008

iPhone dev 14 - my first control!

Created my first control in the MoveMe sample program in the file MoveMeAppDelegate.m, method applicationDidFinishLaunching. Defined size of a text field as a CGRect like so:
CGRect testFrame = CGRectMake(10, 10, 100, 100);

Next I created the object itself:
UITextField *testText = [[UITextField alloc] initWithFrame:testFrame];

To see it, I had to do some extra magic. This somehow adds it as subview. Had to call this after other similar calls to make sure it's not obscured:
[window addSubview:testText];

It wasn't immediately obvious that the field even appeared, but when clicking on the upper left where it is supposed to appear a keyboard did pop up and I was able to type. Stuff I'd like to understand next:

- When am I supposed to release this field?
(in dealloc do [testText release] maybe? nope, didn't work.)
- Why when creating UIViewController it is stored in self, and then released? Won't that destroy it? Apparently not.
- How do I output some debug text?
- How do I monitor the events that the textfield sends? Where does it send them to?

Friday, October 03, 2008

iPhone dev 13

Already the fifth day of development, with not much to show for it. Going through the MoveMe sample application now. Yesterday got an OpenGL ES sample running. So cool that a little device like this actually runs OpenGL. I don't yet grasp the structure of programs very well. I know that there is some function you call in main, which starts off the message loop and apparently your own code goes into a delegate class.

Learned that building an Xcode project turns it into a "bundle", which a directory on the iPhone that contains code and data. Since I don't believe anyone reads this (just talking out loud to concentrate more on the task), I guess I can reveal what it is that I'd like to build. Well, I thought the iPhone would be great for drawing for the "draw and guess" game. I have a Flash version of it mostly working on MySpace (haven't released though). You draw something, others guess what it is, others draw, you guess. Guessers and drawers get points, repeat. People seem to like that game, and it would be cool to draw with your finger. I'm now pondering whether iPhone users should only be able to draw, or to guess too. Maybe it's my unfamiliarity with the iPhone soft keyboard, but it seems too painful to seriously use as a part of the game. Maybe I can let players choose a game mode. But if everyone is just drawing, will there be enough people left to guess?

Another game which occurred to me after getting this phone is one where you are given a topic, then have to try to photograph that thing in a very limited time using the camera. For example "take a picture of a fork!", then you rush out to your kitchen (hopefully connected to the net with WiFi), take the picture. Judging whether people took pics of forks or not would be done peer-to-peer. You get a picture and have to decide whether it is a fork or not. Maybe with some Slashdot style meta-judgement too to make sure you are giving correct judgements. Well, just a crazy idea.

iPhone dev 12

Sample app is now running on my iPhone! It took a good while to wrap my head around the app signing procedure. I don't think I completely understand it even now. I had to get a certificate (for signing my code?), put my name in some settings, create some kind of "provisions" (some kind of combination of everything else), app id and other stuff too. Important thing is that it runs, and I can now concentrate on coding. Perhaps I will have to really understand this better if I get other members in my team, or maybe deployment won't work without understanding it (although I hope it will).

It's now 5 am and this could be a good point to get some sleep at least after the biden - palin debate. Xcode seems awesome and I'm excited to learn more about using it.

iPhone dev 11

Couldn't even sleep with all this new stuff beckoning me to hack some more. Trying to install iPhone SDK, but realized I don't even know where installed software appears on a mac. Managed to open a terminal and started building the locate db in order to find it. It was also weird that the pipe character moved to alt-7. Not complaining, I was getting bored with my current system, this is refreshing. DB is built. Locate says it's in /Developer but how to start the IDE?

Oh yeah, those strange plus and minus signs in method declarations mean whether the method is an instance method or a class method.

iPhone dev 9 - got the hardware

Today all the hardware arrived. An iPhone, a WLAN box and a Mac Mini. This stuff really was disruptive to getting things done -- I haven't felt this much like a child since... well since I was a child! Walking to the post office to get the iPhone almost turned into a run because I couldn't wait to play with it. Then when I had everything, stuff worked really well right from the box. Noticed though that I accidentally got a 2G iPhone instead of 3G one, but that doesn't really make any difference for development (good bye to my plans on starting to use VoIP w/ Asterisk though). I feel like I joined some cult now that I have this stuff. I even read the holy texts of Apple -- namely the folklore about pirate flags and Woz's pranks. I have truly joined the dark side.

I have tried to get back to reading the cocoa fundamentals documentation even while I feel a bit giddy and would prefer to just play around with this stuff. I have to remind myself I got these for a purpose -- to develop an app for the iPhone which will then pay for this expensive hardware. So with this in mind I've muddled through the fundamentals documentation, but it's getting awfully abstract. Well of course it is abstract, because I just reached the design patterns part. Fun to read about abstractions in something which in itself already feels abstract to me at this point (Cocoa programming). I think for my motivation's sake I should try to get something going with Xcode while I read forward.

Thursday, October 02, 2008

iPhone dev 8

My iPhone and Mac Mini will arrive today. Might be disruptive to my Cocoa study.

"Sometimes using a protocol can avoid subclassing". Not sure what that means, not sure what "delegates" are. Code is in .m files, headers in .h files. Saw how to declare classes. Instead of C-style "#include", "#import" is used instead. It's like require_once in PHP.

#import
-- function and data type declarations --
@interface ClassName : Superclass {
-- instance variables --
}
-- method and property declarations --
@end

The .m file could then look something like this:

#import "ClassName.h"
@implementation ClassName
-- stuff --
@end

If I see "IBOutlet" in code later, that is somehow related to "nib files" and the Interface Builder synchronizing with Xcode. Vague at this point. Documentation mentioned that on the iPhone the applicationWillTerminate method gets called when the app shuts down and is the place where state should be saved.

Getters and setters can be automatically synthesized. "copy" and "retain" tell whether object variables should be copied or if the pointer should be stored instead and retain count incremented. Something very strange was mentioned about "KVB", "KVC" and "KVO" that I had no idea about.

Cool thing: in printf strings you can say %@ and then provide an object, and at that point any string returned by that object's "description" method will be inserted. There was a page about threads. Said exceptions should be handled by each thread, cannot be thrown away from thread. Talked about how error-prone thread programming is, that I should copy data and try to minimize possible conflicts arising from shared data. Events should just be handled by main thread, also UIKit objects should only be used in main thread. I imagine I may use threads with socket programming. Said not all Cocoa classes are thread safe.

iPhone dev 7

There is a windows style event loop. On Mac it lives in NSApplication and on the iPhone it's in UIApplication. In AppKit.h there is a method NSApplicationMain that creates the application object, sets up an autorelease pool, loads UI from something called a "nib file" (apparently a file that contains files, maybe even directories?) and starts handling events. On iPhone the equivalent method is called UIApplicationMain.

@"test" is shorthand for creating an NSString that contains "test". In some cases empty string @"" can mean no value / default value. String literals shouldn't be used as dictionary keys? Setter methods are called setSomeVariable, but getters are just "someVariable". Typical framework usage: create subclass, override methods to implement own functionality. Cocoa uses MVC.

Wednesday, October 01, 2008

iPhone dev 6

Init may return a different object than was allocated. For example in singleton case it may return the already existing object. For this reason should always use the one returned by init. Objective-C seems to support exceptions (or is it a Cocoa feature? I'm confused about the distinction). Self, super. Strange plus and minus signs near method declarations. Maybe plus signs have something to do with factories? Noted in explanation about the "respondsToSelector" introspection method, that it tells if an object responds to a certain method -- so "selector" does indeed mean a method? "autorelease" was mentioned many times, but don't know what that is. Section about class clusters: public superclass with many private subclasses, you instantiate the subclasses through factory methods in the superclass. For example Number superclass which can create Ints, Floats and so on. Skipping sections about class cluster details and "creating a singleton instance". I'll return back to them if the need arises to create my own cluster objects or singletons, just too tiring to read about them now.

iPhone dev 5

SEL is data type of a selector, but couldn't really understand selectors are. Are they methods? Reference counting is called "retain counting". On alloc the retain count is 1. If the retain count reaches zero, the "dealloc" method gets called on an object and after that the memory is released. If you "copy" an object the retain count (usually?) becomes one for the copy. There are things called "autorelease pools", but their use is discouraged in iPhone. Somehow everything in the pool gets released at the same time, and somehow objects can be added to such a pool without directly referencing the pool by name (at least the sample code looked like that). App kit on Mac has some kind of autorelease pool already created in the beginning. There are some conventions on when to call release on objects. If an object is created by you, then you should also release it. If you get an object from somewhere else, you shouldn't. There was something related to class factory created object releasing that I didn't understand. alloc -> init -> usable object. In addition to allocating memory, the alloc method also sets a cool explicit "isa" property for the object, that points to the object's class. Also zeroes all properties.

iPhone dev 4

@property is syntax for declaring class methods that automatically create getter and setter methods. Enumeration of sets can be done with the nice "in" syntax as in some other languages. Calling object methods has a bit strange syntax, [object method]. Also possible to give some named arguments, but not sure if the first before : is a method name or an argument name. [object keyword1:something keyword2:somethingelse]. Where is the method name? Is it "something"? Not sure. NSObject is root class of everything, and defines some methods like init (constructor?) and reference counting (retain, release).

iPhone dev 3

NSObject is the root class for Cocoa classes. Stuff starting with UI prefix is UIKit related. Objective-C has garbage collection after version 2.0, but it cannot be used on the iPhone because of performance. Cocoa classes seem cleanly designed. Didn't encounter a regexp class, although didn't check if it's in NSString methods. Event mechanism in iPhone UIKit differs from Mac Application Kit. Looked at Objective-C example code, saw lots of weird square brackets. "id" datatype can hold any Cocoa object, so convenient for enumeration. Dynamic typing, binding, loading. New feature: "categories". By dropping mysterious @ marks in strategic places in your code, you can add methods to existing classes without subclassing. Protocols are like Java interfaces.

Tuesday, September 30, 2008

iPhone dev 2

There seem to very cool tools for debugging and coding. The "Instruments" application seems impressive, creating data porn from your app as it runs. It isn't mentioned whether that can be used when developing for iPhone. I learned for iPhone there is a different compiler, on Mac gcc is used. The iPhone simulator needs to be compiled for, so it really is a simulator and not an emulator. The iPhone needs some special configuration to start development on it.

iPhone dev

I have never used a mac. Once I sat at one in a computer room because other computers were taken, but I couldn't figure out how to turn it on! So with this background let's see how far I can get with iPhone development. I started off by ordering a Mac Mini, buying a jailbroken iPhone from an auction and signing up for the developer program. While waiting for the hardware to arrive I can use the time productively by reading the documentation. Stuff I've learned in the first hour:

"Aqua" is probably what the UI is called on a Mac and "Quartz" is some kind of rendering system for it. You develop software with "Cocoa", which historially comes from NeXTSTEP. The docs talk about "Darwin", which according to Wikipedia is a flavor of UNIX (isn't that Mac OS X? I'm confused). "Carbon" is something I should ignore. Apparently Cocoa also comes with an IDE, which is perhaps called Xcode. When developing for the iPhone my app will take over the whole device -- only one program is running at a time + some background daemons. SQLite and OpenGL are used somewhere by something. On the Mac Cocoa consists of "foundation" and "application kit", but on the iPhone the app kit is called "UIKit". Foundation does non-gfx things. The language stuff is developed on is "Objective-C", which is some kind of superset of ANSI C but with additional OOP features inspired by Smalltalk. Some lower levels use just plain C, but in Cocoa there are OOP wrappers for them.

Let's see if I have the energy to continue, or if I decide to auction off my hardware when it comes :)

Thursday, August 07, 2008

Dead-end stocks?

It's funny how some companies seem to be riding on trends that seem doomed to me. I've been going alphabetically through Scandinavian stock listings, and so far I've encountered three such companies: AudioDev, Anoto and Cash Guard. AudioDev makes testing equipment for optical media. Anoto makes system to read hand-written forms. Cash Guard makes cash handling systems.

In my image of the future all content is accessed through the Internet, therefore there will be no optical media, and so there won't be any need for testing equipment for it. All official forms, questionnaires, multiple-choice exams etc. will be filled electronically, so there won't be so much need for OCR / choice-reading machines. Cash will be phased out gradually, where it might always exist but will be used less and less.

These three companies don't seem to be riding on very good trends :)

Media circus has arrived

Finnish media companies have gotten excited about "social media". They see it as a trend, and they must report trends. To support trend reporting, they want to raise individual examples, hopefully ones that people can relate to. I happen to be one of the few serious Facebook developers in Finland, so I tend to be that example.

It's been fun. First I was featured in some magazine called "Happi". I'd never heard of it, and even with numerous requests they never sent me the issue that my interview appeared in. But apparently someone read it, because next I was contacted by another magazine called "Image". Now this one I had heard of, it's a very high profile magazine. I got my face filling an entire page, it feels unreal. Seems that stories in media inspire more stories in other media, because next I was contacted by "YleX" radio channel and "Helsingin Sanomat", the largest circulation newspaper in Finland. Just wow.

Friday, April 11, 2008

Silly Facebook apps are keeping my stomach full and a roof over my head

This is a long post, but lots of exciting things have happened since the last one!

The Facebook melody composing app I was making in August 2007 didn't take off. Perhaps it just wasn't a very good app for making melodies, or perhaps people just aren't creative enough for it to become viral. I abandoned it and carried on making other ones.

Boy, was that a good decision! It's been a jumble, so I can't even remember the proper chronological order of things, but I think the next app I made was "Your Japanese Name". I thought it would have a very limited appeal, but actually half a million people have installed it now! Wow. Also, it's now making enough money for me to pay my rent.

This got me thinking that perhaps other easy-to-use things that let people express their identity on their profile would do well also. Therefore I started adding to my list all kinds of other apps that fit that description. Some people are looking down on these apps and calling them "badge apps" with no real value, but I believe that ultimately it is the users who decide what is entertaining for them.

I made several. Lots failed. I think failure is good too, it's great to know what doesn't work and try to ponder why. I made one which comes up with a description of the past life of the user. Like it might say that you were a cave explorer in your past life, and that's why you are so adventurous now. Perhaps that was a bit too random, showing that off in your profile doesn't really tell anything about your identity. I'm happy that it failed, because it raised my belief in humanity a bit, that people won't accept just any crappy app :)

Just to make sure though, I had another app made which is similar, but it shows you what you will be reincarnated as in the future. That failed even harder. Strangely though later someone else made a past life app similar to mine, except it was a huge huge success. I believe it was because of the forced invite system though, and not because the app itself had some merit above mine. Well, the author got away with that and made a lot of money, so maybe I should have put such a system in place too.

There are about a dozen failed apps which I made. I'll describe more of those in other posts. Let's talk about one success for a change. It's called "Name Analyzer", and like "Your Japanese Name" it displays your name in your profile, but just in plain english, with some adjectives attached to explain what each letter in your name means. I can't claim it's an original idea, but it hadn't been done for Facebook yet. Basically it has the merits of "Your Japanese Name", but doesn't limit the userbase to only those with an interest in Japan.

It took off like a rocket and now has nearly 7 million installs, with a hundred thousand people using it every day. I wrote last year about my scalability and bandwidth worries, but now in retrospect that hasn't been an issue. I'm not paying significantly more for hosting now, and just one server has been enough to handle the load, and even that server has been mostly idle, even though the server logs are really flying.

Oh, I lost a lot of impressions though because the logs are REALLY flying, and I hadn't realized how large they would become! I had 8GB of space left, so I thought I would be OK. However, with 100k people each doing several page loads and causing longish lines to be appended to ever growing log files, I actually ran out of space. Many times. Every time the velocity of the expansion of the server logs took me by surprise! Running out of space is a bit nasty though, because it corrupts MySQL tables. Luckily the repair worked!

After seeing that people have an interest in it, I have added more features to make the app stickier, with pretty good success. Now there is functionality to decide analyses for your friends, change colors and fonts and backgrounds, make your own themes that others can use etc., all ever so slightly increasing the frequency of people visiting the app and the length of time they spend in it. Not a big difference, but with user numbers this large even a small percentage difference can be significant.

With monetization, I believe I have signed up for the best advertising network, which is Social Media. I do feel that I haven't really tried out all the other alternatives, but they pay so well that it's difficult to imagine that the others could be better. From discussions on the developer forum, there seems to be a consensus that Social Media pays the best. Only other options I have tried are Google AdSense and selling merchandize through Zazzle, but both of them paid an order of magnitude less than Social Media. Perhaps I should properly try out Cubics, VideoEgg and the others though, just to be sure.

Even though the merchandize (mug cups with your name on it) failed, I'm not sure that it was because the idea itself was flawed. Maybe the product, or having a link to an external site was the problem. Maybe if there was something that could be easily purchased while on Facebook, I could monetize better. Only ideas I've had so far are mobile phone background images or premium SMS subscriptions to get your name analyzed for your phone. That's something I might explore more.

So, how has this increased ad inventory affected my life? Well, I already told you that "Your Japanese Name" has allowed me to pay my rent, so you can guess that "Name Analyzer" has been even more significant in that respect. I won't make any big purchases though, only major thing is that I'll probably travel a bit more, still on a shoestring budget though. I'd like to think I'm pretty responsible when it comes to my spending. I don't have a car, I live in a normal sized shared apartment. I eat pea soup out of a can for dinner. I even have a spreadsheet with an inflation-adjusted plan for until I am 74, the age at which an average Finnish male tends to die. I don't have enough to live until then, so I'll keep saving. Couldn't resist getting a projector and a Nintendo DS though ha ha :p

I've gotten some very VERY interesting requests to appear at job interviews, but I don't really feel comfortable letting others decide what I should be making, now that I'm having so much fun thinking up new apps :) And I do have a lot of ideas! That list I started last year is getting really long. Lots of them are obviously stupid ideas when I look at them now, but for some it's hard to say! I hope I'll have success making some other type of app, I wouldn't want to be a one trick pony!

Wednesday, September 19, 2007

Five US citizens seeking asylum in Finland

This news was ignored in foreign media, so I guess I have to translate it.

"Finnish border officials were amazed when five US citizens applied for asylum status yesterday evening at the Helsinki-Vantaa airport.

The applicants had arrived to Finland from inside the Schengen area and informed The Border Guard of their desire for asylum status. From here on the actual application process will be handled by Directorate of Immigration.

- In near history this is the first time adult US citizens have applied for asylum status in Finland, major Janne Piiroinen told reporters.

According to the information made available to reporters, the US citizens are part of the same group. Officially the reason of the asylum application is still unknown, but it is not related to protests of Iraq war."

Wednesday, August 08, 2007

Decided which Facebook app to make .. NEXT =)

This post is mainly meant for myself to organize my thoughts.

I finished my composing app mostly. I got around 200 people to install it, now I am waiting to see whether it is viral at all or not. Currently it is showing growth of 2% per day, but I'm not sure if it's really spreading at that rate, it could just be chance. Would be wonderful if it were true, because 2% increase per day is over a thousandfold increase per year. Personally I think the app sucks, but I've seen other apps get popular which suck even more, so I guess it's not totally impossible ;)

My friend made a great suggestion for the subject of the next app -- one which would let people take and make tests. It seems extremely viral, because it has two ways of spreading. Firstly, if a user creates a test, it seems very likely they would send it to their friends. Secondly, people always like to share with friends their test results and encourage them to also take the same test, so that the results can be compared. I'm amazed nobody has made this kind of app yet. I might feel paranoid about sharing this idea, but luckily nobody except you reads this blog.

There are tons of different types of tests, so I am now trying to decide which ones to include and which not. For example there are IQ tests where the question and possible answers are images ("which picture comes next in this series?"). Then there are knowledge tests where the question and answer are text ("what is the capital of Japan?"). Also there are image recognition quizzes ("which Simpsons character is this?") where the answers are text. Rarer, but possible would be reverse image quiz, where the question is text and the answer a multiple choice out of a set of images. Then there are multivariable quizzes which are a bit more complex ("answer this set of questions to discover which 24 character you are"). I think I came up with a way to create even multivariable quizzes that isn't all that confusing ...

Those were the different quiz types I could come up with, but there are also some features that could be included or left out. When answering a question, sometimes in quizzes additional information is provided about the correct answer ("what is the capital of Japan?" - "Tokyo" - "correct, did you know Tokyo is blah blah"). There could be time limits when answering. In addition to getting how many percent were correct, sometimes there is textual feedback ("80% - very good"). The questions could come in a predetermined order, or at random.

On implementation side the normal way to do this would be a straightforward HTML (well FBML) interface, but to make it faster it could be done with Flash or javascript. It's kind of annoying to wait for page loads after each question. I have done some scripts like these before, and the biggest problem I had was keeping track of which questions have already been displayed to the user (when random order) and making sure that no duplicate options are included in multiple choice questions. Why is that tricky? Well suppose there are two questions "what is the second largest city in the state of New York?" and "what type of animal is the wild Arni?". Both of the answers are "Buffalo". This means that randomly chosen multiple choice answers could contain two identical answers with different meanings, which should be avoided.

Friday, August 03, 2007

App mostly finished

Alright, I worked hard for a week straight and managed to finish the Mini Mini Melody application for facebook. Please follow that link and install it if you have a Facebook account, then send me some feedback!

Wednesday, August 01, 2007

Tay Zonday, tour for us!

Dear mr. Tay Zonday. You rule. For now. People want to see you, but soon they will forget. That's the fate of an Internet star. So go along with this, live your "Internet dream". See the world. Make a zillion dollars in the process.

Let go of the hesitation.

Monday, July 30, 2007

Totally tired with this app

I'm exhausted! I've been working on this melody Facebook app for around a week now. At first it was very exciting. I had big dreams of making a hugely popular app, but now that the app is becoming more concrete it is starting to become obvious that this will be marginally popular at best. Why? Well, turns out it's a lot more difficult to express yourself with music than by drawing!

Currently in the app you can selected between a piano, a cat's meow, a dog's bark, human voices or drums. The app allows you to make a very short composition, around 30 seconds at the longest perhaps. There is a staff on which you can place notes to make your tune. I haven't done the sending part completely yet, but the idea is that you could send these tunes to your friends.

The path from an idea to reality is always less smooth than one would hope. An idea is very vague. Even if you try to work out an UI on paper, it's still vague, even if you don't know it. There are just so many little details that you will never be able to think about until you make the app. And that's fine, because making the app is all about describing those little details to the computer anyways. I'm struggling to provide a concrete example here, but for example in this case the idea was "a graffiti-like app for sending melodies". Then in the paper UI mockup I realize that there has to be some way to put different instruments on a staff. Then when really trying to make it, I realize that when you are placing those instruments, there has to be some kind of indicator of what you are selecting. But that indicator shouldn't be shown if you are outside the area ... and if you select drop-down menus they should appear ABOVE all the notes, not below. And a million details like that.

After you spend days just basically tangled with these small details, you become very exhausted even though from previous experience you knew that it would be like this, while of course secretly hoping that this time would somehow be different. There is some satisfaction in seeing your idea become a reality, to interact with what you have created, but at the same time you have to face the depressing reality that perhaps your idea wasn't as great as you had hoped. What seems like a fun idea often isn't as much fun in reality.

A tale of two Graffiti

If you use Facebook, you have probably used or at least seen the Graffiti app, which makes it possible to send doodles to your friends. But did you know that there are actually two different Graffiti apps? One wildly popular (5,713,050 users and counting) and another more obscure one (mere 11,367 users). Surely the one with less users is just a clone? No, according to the creators, the more obscure one came first.

I remember installing the more popular one and instantly writing graffiti to my friends, which was kind of fun for a while. Out of curiosity I installed the more obscure one as well, but the thing is that I can't figure out how to use it. It keeps showing error messages. The lesson here of course is that it doesn't matter how cool your idea is -- if it doesn't work or the users can't figure it out (which amounts to the same thing) then it will never be popular.

The creators of the original graffiti must be kicking themselves now...

Saturday, July 28, 2007

Melody app progress

I have been actively working on the melody app lately. Learned basic Facebook API usage and started making the UI part in Flash. Progress is nice, I can already arrange piano and drums on the tracks. A surprisingly difficult thing has been trying to find the different sound samples to use.

I need at least a basic piano sound, a guitar sound, drums and some funny sounds. The temptation is great to go to one of those "free samples" sites to grab something, but I want to be sure that any sounds I use are properly licensed. So instead I have been trying out sites where you can download sample packs. I am really surprised at the poor quality of the sites and the sounds they provide. For example some drum hits might have an audible hiss in the background, in some cases almost to the point of being static. Finding drum loops is easier, but I want single hits, not loops.

Come on, I just need around 28 different sounds, hopefully for under $100 total. How hard can this be?

Wednesday, July 25, 2007

Decided which Facebook app to make

The idea that found its way to the top of my ideas list (it's a long list!) is a music composing app. Basically like Graffiti, except that instead of drawing stuff, you can compose little musical pieces and send them to your friends. You would do this by arranging notes on a small staff (the classic "like X except Y" pitch). Taking Graffiti as the inspiration, everyone would have a wall of composed musical pieces.

What I am concerned about a bit is the bandwidth. I wouldn't even be doing this if I didn't intend it to be popular. So assuming it is popular, perhaps people would be loading the composing/playback Flash application about 100k times per day. I did some calculations in my notebook (in a section titled "slimy biz talk corner") and this could mean a bandwidth cost of about $600/month. From my prior experience 100k page views per day for random people isn't necessarily greater than $600/month, so it might be that initially this makes no sense. However bandwidth is getting cheaper, and with Flash 9 there are things that would let me cut the size of the player/composer down A LOT so perhaps it would make sense in the future if not right away.

Oh yeah before settling (at least for now) on this idea, I spent two days basically pondering nonstop about which Facebook application to make. I wrote a long list of ideas that occurred to me, then ranked them based on how promising they seem. It's funny how many ideas for social apps you can find by reading a book containing playground games for children. For example there was a game where you must come up with something that you have done, but none of your friends have done. That would make a nice app as well. Anyway the point is that playground games books are a great resource =)

Sunday, July 22, 2007

But what to develop?

I have been trying to come up with something to create for Facebook, but how to know what is worth spending a week of development time on? Some criteria I have come up with:


  • Coolness - If a potential user encountered this app all alone, with just a few sentences to describe it, would they likely be excited about it?

  • Virality - How likely would they tell their friends about it?

  • Monetization - How much money does each user translate to? Sometimes the right crowd (people wanting to install awnings in their home) is better than a big crowd (people looking for free software).

  • Stickiness - How likely would they use the app for long periods of time?



It's interesting to think about the top Facebook apps in these terms.

Top Friends - Slightly cool, very viral, not very monetizable, not very sticky.
Graffiti - Very cool, not so viral, not very monetizable, pretty sticky.
iLike - Cool, viral, monetizable, sticky.
... and so on

Developing for Facebook

Easiest hello world I've ever made was in Commodore 64 basic. The most difficult one was with Symbian -- I never had the patience to finish it! Facebook seems to fall much nearer to the C64 experience. Starting to develop a Facebook app feels really sweet. Seeing what you create instantly embedded on a major site is a strange feeling, because it's something that's completely new.

The thing I was most confused about at first was how the content you create would find its way to appear on a Facebook page. At first I figured that code must somehow be running on Facebook's servers, like in a sandbox. But it doesn't work like that, rather Facebook calls your server and displays the response it gets as part of the page it renders.

One surprise was that things are a lot simpler than you would expect. The PHP API include file is just around a thousand lines of code! I feel that now is the time to get in the game of building Facebook apps, because certainly after a while they will add a zillion new things you can do with the platform, which will make it even better, but also that much more confusing for those just starting out.

In my mind Facebook has won. With all the apps that have been created and are being created, Facebook will have thousands of times the functionality that MySpace is offering. The change in Facebook has been so sudden that people have not yet realized what happened, it will take a while before people understand that there are now these things called "apps" and that you can add them to your profile. People will gradually learn, and a few of those apps will be such gems that people will wonder how a social network could ever be considered complete without them.

Monday, July 09, 2007

Would you pay $10 per gallon?

Sweden is considering meeting its goal of reducing emissions by doubling the price of gasoline by the year 2020. This may raise the price of gas in Sweden to over USD $10 per gallon (2 euro per litre). Sweden has promised to lower their carbon dioxide emissions by 20 percent by the year 2020 and according to calculations the price hike would cause this goal to be met.

This news seems to have been ignored by the English media, so this was a quick translation of the source articles.

Saturday, March 24, 2007

Daniel Tammet

I read the book Born on a Blue Day, which is about a savant called Daniel Tammet. I got the book after seeing the documentary "Brainman" on YouTube. The name of the documentary is a word play on the famous movie "Rain Man", where Dustin Hoffman plays an autistic savant. The documentary is over-dramatized, but by concentrating my attention only on the interviews it was an interesting watch.

In the Brain Man documentary Daniel Tammet describes his number synasthesia. "Synasthesia" means the property of associating two seemingly unrelated senses with each other. In the case of Tammet his synasthesia manifests as seeing numbers in different shapes, textures and colors. We might see the number "117" as a boring compination of three digits, but for Tammet it is a very distinct visual object. By using these associations he was able to recite 22,514 decimals of the irrational number pi without a single error. He also has some enrichened sense of words, which enabled him to learn the icelandic language in a week (to some level).

After seeing the documentary I had this image of a super-intelligent person, devoted to mathematics and indifferent to what others thought about him. In his book I discovered a different kind of Tammet however, one seeking acceptance and trying to fit in, all the while having trouble with small issues in life, such as brushing his teeth. A person not single-mindedly devoted to numbers, but one with a personal life with his husband Neil, staying at home cooking meals for him out of materials grown in their own garden. Crying over their dead cat. For Tammet numbers aren't the sole content of his life to the level I had imagined. In his book he hardly talks about numbers, rather concentrating on describing his exchange study in Lithuania and his attempts to be a part of the world which surrounds him.

However precisely because the book was so different from my image of Tammet, it was a very refreshing read. Without realizing it, I had this stereotypical image of what a savant "should be like". Real life is not just numbers, it is about having a daily life which you can feel content with, it is about fitting in, making friends, being accepted. Savant skills for him were not only a gift, but came with significant downsides as well. He had to try hard to make it in the world, but seems that he succeeded.

Thursday, March 08, 2007

AdSense - things I love and hate about it

  • It tempts me to create spammy sites which provide no actual value to the visitors, that in turn makes me feel superficial, greedy and in turn unhappy. My most embarrassing secret: I have actually made a page about mesothelioma once. No more! Valuable content and functionality only! (yeah yeah)
  • It never pays enough. I console myself with the thought that my AdSense ads still make me more than the daily average in some super poor nations, but on the other hand at times I feel like I've worked for that money as hard as someone in a super poor nation (okay not true).
  • Sometimes it displays really unsuitable ads and it angers me that I cannot just tell it what types of ads to display and instead have to rework my content to help AdSense guess better. Example: I wrote a page about how to create objects using a toolkit for a computer game, using a beer bottle as an example of an object you could create. Of course, now AdSense is displaying ads about beer, not about games. Grrr.
  • Spending countless hours excitedly monitoring my pathetic AdSense revenue and click-through rates. Wow, I made $1 today! Hooray! (what?)
  • Moving to a different country requires you to close your AdSense account and open a new one, accumulated funds are saved in the process but it still feels like an unnecessary hassle.
  • The fear that my account would suddenly be closed, without any explanation, with all my funds frozen and not getting an answer when I ask why (apparently has happened to people who at least claim to have done nothing wrong). Not sure if this issue is real, but the fear is, and Google doesn't seem to be very open about it.
Time to get positive...
  • It is a real joy to set up, copy & paste goodness.
  • It provides a somewhat predictable revenue stream when contemplating about starting new sites, a real enabler for webmasters everywhere.
  • It gives Google a lot of money -> Sergey & Larry seem to be into using some of it for space and artificial intelligence research -> I get to take a ride to a distant planet in an AI controlled spaceship and have an intense battle with the AI when it goes berserk midway.
EOF

Tuesday, March 06, 2007

Thank you Sierra for all the great moments

The first time I saw Space Quest 3 was at the house of the literally richest kid in town. I mean really, his dad owns a factory and even a a theme park! So they had this computer called the "PC", with a nice sound system and an expensive Roland sound card. I was standing there while he was playing SQ3 and I was blown away, not even really thinking I could ever own such a system myself.

Later I got an Amiga 500 computer, which looking back kicked the PC's ass when it comes to gaming. I was so happy that Space Quest 3 was available for it, now I could actually play it myself. Of course with all Sierra games there were several disks that you had to change during the game, and you often spent more time waiting for things to load and swapping disks than actually playing. I couldn't afford to get an extra disk drive, let alone a "hard disk" (I had read about those in a computer magazine, apparently it was a device that eliminates changing disks!).

Well, actually I once thought that the disk swapping might come to an end. In that magazine they were talking about this new type of disk, which is readable in a normal floppy drive, but could store as much as 10 megabytes on it. With that I could possibly store the entire game on a single disk and actually afford it! It was called "bubble memory", the technique was apparently that the data was stored as the state of a layer of bubbles on the disk. I was so excited I could hardly contain myself. Then I found out that it was an april fools' day hoax and... I cried.

The most emotional moment from playing Space Quest 3 was definitely walking around in a space scrap yard in the game, discovering something that looks like a ship, then actually getting it turned on and flying off with it! After that discovery I didn't want to fly off right away, but rather I called a friend over and we continued from there together. I think I was so excited I hit my head on my loft bed when getting up from my computer.

Thank you Sierra for all those great moments!

Monday, February 26, 2007

Microsites - progress with image quizzes

My PhpBB extension for image quizzes is coming along quite nicely. 18 hours, 657 lines of PHP and 250 lines of HTML later users are now able to create quizzes and take quizzes. Most headaches I had were session handling, I couldn't figure out how to do it properly with the session handling build into PHP, so I resorted to just passing stuff around in very non-SEOed (lately the word SEO makes me cringe) obnoxiously long URLs.

If I had tried to do everything perfectly then I would have never finished, I think it's important to get a first version out before polishing it too much, see what the users do and then improve on it. Obviously it should mostly work, and it does. Currently it's just in Finnish and I enabled it just on one forum to have a limited test. I hope that people will like it and that it would cause people to spend more time on the forum (which I'm not sure Google Analytics knows how to measure), maybe even get some new visitors that come just to take the quizzes.

One benefit I didn't anticipate from integrating with PhpBB was that it's possible to know who the people taking the quizzes are, so I can construct a scoreboard for them. People love scoreboards, it makes them want to improve their score over and over in order to not look bad. My plan now is to see the effect the quizzes have, polish the code a bit, then create a new PhpBB installation (actually all my installations are virtual, not actually separate instances of the software, using a mod I made) which is focused just on image quizzes and redirect my existing quizzes there.

I love the feeling of publishing stuff on the web, not knowing at all if it might be popular or not.

Monday, February 19, 2007

Microsites - extending PhpBB to support image quizzes

One of the features I imagined any fansite should have is a quiz of some kind to test your knowledge of the series in question. One popular site I have is a Naruto quiz, which I made one evening just for fun. Adding images to that quiz required me to edit things in the database manually and copy images into the image directory manually as well. I want to improve that by creating a PhpBB extension that lets forum users create their own quizzes by uploading images. I have several motivations for making this.


First of course that it is one of the planned features for the microsites I've been talking about for the past few posts. Secondly it allows me to easily create new quiz sites similar to the Naruto Quiz, which seem to easily become popular. Thirdly I can use the feature right away on the forums which I host and get people to make their own quizzes - I'm sure they'll be more creative than me and create kick-ass quizzes.

Tuesday, February 13, 2007

Microsites - Kickstarting a forum

In previous posts I have been describing my idea of using my online Japanese book & record store as a platform for kickstarting microsites around the bands / series sold, the theory being that if there is a popular microsite hosted under the site's domain and with a link back to the products being sold, this will attract customers and result in more valuable conversions than if the microsite was just a separate entity with AdSense ads or Amazon Affiliates ads on it (one purchase from my own store is A LOT more valuable to me than a purchase through Amazon would be).

I'm already very busy with my studies and running the web store as it is, so as the first easy part of the microsite experiment I decided to attempt to launch a forum around the band Antic Cafe. One thing I have learned is that people go crazy over prizes, so I decided to offer a prize to the most active person on the forum. In addition I dedicated some valuable screen estate on the store's main page to promote the forum. Here's what happened:

(162 absolute unique visitors)

The forum was promoted on the web store from the beginning. I marked the beginning and ending dates of the competition in black. It is clear that the competition had a major effect on amount of visits. The 11 members of the forum have written 147 posts up to now, which while modest seems like a good start for such a niche (Finnish fans of the Japanese band Antic Cafe) forum. I neglected to measure how many conversions this forum has created, but I'm not sure if that's even possible. Suppose a web store visitors goes to the forum, then comes back and buys an Antic Cafe record, is that a conversion? There seems to be no way to know if they got excited about the band on the forum or would have bought that record anyway.

I would like to launch the main microsite as well (this forum would be just one part), but I don't want to do that with completely pathetic production values. Also the forum might well be 80% of the microsite's value in the end, so why even bother with the rest?

Features I imagine that each microsite could have:
  • forum
  • polls (but forum already has polls...)
  • quizzes (can you recognize these members/characters from the band/series X?)
  • personality tests (which X are you?)
  • embedded videos (">veoh! youtube is so last year)
  • fanart submission, voting (maybe just a thread in the forum from which these are pulled?)
  • info pages for the series (through a wiki or pulled from forum threads)
  • news (perhaps an embedded RSS reader)
  • gallery (some clever system to get legal-size thumbnails linking to images elsewhere)
  • fan fiction
  • links (perhaps by automatically monitoring server logs for incoming links and favoring those)
Cool but impossible things:
  • exclusive band member / manga author interviews
  • exclusive content from the band / author
Perhaps most of these could use some embedded elements from other sites and would let me avoid actually coding them. If I could just find some good solutions for doing these, then I can use the same formula for a hundred different sites and save a ton of work compared to people who start single fansites for fun.

One option to consider might be to extend PhpBB to support these things. Perhaps there are already plugins for these? That would at least make it very easy to have just a single login that could be used for all of the microsites (since OpenID isn't here yet).

Saturday, February 03, 2007

Did some site reorganizing

I run a small village of microsites on different topics, it's sort of an experiment to see what sorts of traffic I can get. I had the domain jackvalenti.com, which I bought on a whim and set up an unofficial page about Jack Valenti there along with AdSense ads. Well, after spending nearly $100 on the site I am averaging ZERO visitors per day, so to avoid some site fees I am moving the content to a subdomain instead. From now on Jack Valenti page will be here instead.

Another more successful, but still an infuriatingly unsuccessful small site I had was a sweepstakes site. It runs on pligg and used to be in English. Every day I would check the stats on Google Analytics and every day I was getting around 200 visits, but nearly 100% from Finland through one nice inbound link I managed to get, so I will yield under the pressure and turn the site into a Finnish site to serve those visitors better. From now on it will be here: kilpailut.

One thing I have learned while trying to promote my sites is that people respond well to prizes. I had a forum that I was spending some promotion efforts on, but hardly nobody registered to that forum. Then I offered a prize for registering and posting on the forum and suddenly people (in the target group, not just prize scavengers!) started registering and posting. Prizes are expensive though, difficult to say if it makes sense to give them out. On a forum it is very important to reach a critical mass of posts at first, so it may help at that and possibly pay off in the long run.

Sunday, January 21, 2007

Microsites feature - forums

In my previous post I wrote about my intention to leverage the traffic I get to my online store to start microsites around product groups, such as different bands. I took my first step into that direction by tweaking PhpBB and doing some mod_rewrite trickery to allow me to easily create several forums which appear distinct, but are actually all running on the same software and database. This allows me to maintain only one installation of PhpBB and create a new forum in about 20 minutes instead of a complete new installation.

Obviously a microsite is going to need more than just a forum, but I imagine that for a successful microsite the forum would be the most important part of it. To test out the system I created two forums around two bands whose products I sell, Maruru forum and Antic-cafe forum.

Deciding scope


The reason for starting several small forums instead of one big one is to create a sense of belonging / identity for those using them. People seem to feel stronger attach ment to smaller circles. For example people will feel a connection to those attending the same school as them, at a lesser level to those living in the same city as them, even lesser to those from the same country. I want to find the optimal "circle size" to get people to feel that attachment, while not limiting fruitful conversations that could have happened if those circles were combined.

For example I could have created a "japanese music" forum instead of having "maruru" and "antic-cafe" as separate forums. Perhaps I should have, not sure, still experimenting. Certainly someone who is an enthusiastic fan of Antic Cafe would feel less at home at a generic forum for all Japanese music. Still there clearly has to be some minimum size at which an active forum is still possible, if there wasn't I could create a forum for people from Vatican who like Michael Jackson and are into cross-dressing. It would be a small group, but man would they be into it.

Wednesday, January 17, 2007

Microsites

I run a webstore, which means that I get very targeted audiences to my website. They will often even specify their interest by doing searches, or by looking at certain items. Mostly they are only looking, not buying, which is fine of course. Lately I have been wondering whether these targeted visitors could not be used to launch "microsites" related to certain products or product groups.

Take for example a person who searches for "dir en grey", then looks at products from the band dir en grey. Clearly they are quote interested in this band. Perhaps I could tell them "hey have you checked this fanpage for the band?". This could be a very relevant thing to say, and when things are relevant they tend to not be irritating. The trick of course would be that these fansites would actually be sites that I have launched myself (perhaps clearly indicated by being a subdomain of my site, say dir-en-grey.bemmu.com). They would become destinations in themselves, possibly growing and sending back more traffic to the webstore than I originally sent to them, also being nice baits for Google to index.

The microsites could contain a standard feature set and customized skin. For example a forum for talking about dir en grey, but with a forum template showing the dir en grey members. Forums have the effect of getting people to come back to check if their posts have been answered. Another good one is quizzes, which tend to be viral since people like to post the results on their homepages or recommend the quizzes to their friends.

Of course this is nothing new, there are plenty of dir en grey fansites out there, but I would like to make the process of launching these microsites very organized. All the sites would actually share one codebase. There might be 100 different microsites for different bands or manga series for example, but only one forum software running, customized to display a different skin for different audiences, but only requiring one login to use any of those sites. Same for the quizzes or possibly other features. The skins might have been outsourced somewhere, quizzes could be created by the users.

This whole idea might be impossible in that a certain amount of manual labor is always required for the maintenance of those sites. Forums need moderators. Quizzes also need moderation, since if they can be freely created by users there can be inappropriate content. Still by being clever I imagine that I could organize the creation of such microsites to be more efficient than the normal work of creating a fansite (of course these would not really be fansites in the traditional sense, but feature-wise they would be the same).

Amazon and other big webstores might be missing a great opportunity when they are only pushing products at the visitors, where they could be pushing communities as well.

Saturday, January 13, 2007

eBay API experiences

Lately I have been trying to learn how to use the eBay API to list items and learning exponential representation for complex numbers in Algebra. Using the eBay API is the harder one out of those. Just a minute ago I finally succeeded at listing my very first item by using the XML API, it was a bit more complex than I thought! My mental model for how the API would work was that I would pass my eBay user id and password, along with the item details wrapped in some XML.

Nope, there are several different kinds of keys involved. All in all I currently have NINE different pieces of authentication! I have a DevID, an AppID and a CertID. Then there is the eBayAuthToken and the REST API key (which I admittedly only used once for testing, it is not needed for the XML API). But wait, that's only five? Yes, but you see eBay has two servers -- production and sandbox. The sandbox is for testing, which is useful since listing things on the production server costs money, so you definitely don't want to end up listing ten thousand items by accident. The sandbox and production servers have completely different authentication keys, except the DevID appears to be the same (making it nine different keys total).

The eBay developer site doesn't make this sandbox and production server difference clear. When talking about authentication keys, they casually mention that oh yeah, there is the sandbox server too. But what they don't say (on the intro pages at least) is that you need completely different keys for those. So imagine my frustration at attempting to access the sandbox with my shiny new production keys. With all those different keys I was getting really hopeless and uninformed, mostly reading reddit instead of focusing on the problem.

Somehow after a lot of digging I managed to figure it out. A DevID identifies a developer. A developer may have multiple applications, with each application identified with its own AppID. CertID is a magical entity the purpose of which I don't understand, but things seem to work when I bundle the same CertID that came with the AppID. The eBayAuthToken must be generated on their web page, and generating that requires providing correct DevID, an AppID and a CertID for the server which you are trying to use (sandbox or production). In other words you cannot get an eBayAuthToken for the sandbox server by using the production DevID, an AppID and a CertID + vice versa. The REST key is needed only for... you knew it, making REST calls.

After I finally had my keys I started to read the API reference. I tried to pretend calmness, but actually I was a bit shocked of seeing all the possible method calls and the arguments they take. Huge list. Maybe I'm not enough in the XML camp, but in my mind things work like this: you get a template string of a working XML call, then you change the things which are different from what you want and send that string at the server, which then does something cool. It's pretty difficult to try to come up with something that works by just looking at an API reference if there are 20 different arguments that could go wrong! Luckily, the developer center has very nice examples of using the API, so I was able to get things working by copying and pasting their examples.

Another thing which seemed like a showstopper at first was that they require usage of SSL to access their server. That is an excellent thing of course for security, but complicates things a bit when you are just trying to get a minimal example to work. I was planning on using PHP, but felt a bit intimidated at the thought of figuring out how to get SSL working on it. Just to get acquainted with the API, I decided to stick with Perl as they had some nice Perl examples in the developer center, complete with instructions on how to install SSL support for Perl.

So I had my keys, I had an XML request constructed from the example and I had ActivePerl installed on my box, with LWP and SSL support, aaand... it worked!

Update: After 30 mins of reading some example code I managed to figure out how to make the same request using PHP, HTTPS with cURL! One thing I was worried about was how image uploading would work, but turns out that you can just specify an image URL and eBay's server will go and fetch it -- no need to figure out how to actually upload the data, what a time saver! Just a bit more effort and I'll have this code integrated with my web store.

Saturday, December 23, 2006

Another day another launch

Check my new site out if you are looking for expired domain names. It's the best list available, period.

Internet Explorer quirks

I am hacking my new site to get it to work on IE. After trying for a while I am instead applying for a gun permit and looking for the home address of the Microsoft employee responsible for implementing PNG support for IE.


Monday, December 04, 2006

Friday, November 17, 2006

Neverwinter Nights 2

Instead of writing tutorials on Half-Life, I decided to start writing tutorials on Neverwinter Nights 2 instead.

Wednesday, August 30, 2006

Google makes ads more difficult to recognize

I was searching for Yu-Gi-Oh card information and clicked on the first organic link I found, like I usually do.




The page I arrived to was an MFA (made for adsense) site. I thought gee, how is it possible that an MFA site got such a high pagerank that they could be the first result?

At first I thought there must be some new SEO trick out there, but then I noticed that what I had clicked on was in fact an advertisement. They used to be separated with a different color but now seem to have a white background like other search results. Aligned to the right there is a "sponsored link" disclaimer, but on a wide screen it is easy to miss.

Saturday, July 22, 2006

Israeli CS player continues to play regardless of bombs

An Israeli Counter-Strike player is pushing the limits on CS addiction. He was seen playing on his usual server, even though the area he lives in might get bombed. When another player asked him what the situation over there was, he replied "I just heard a siren so perhaps I should seek a bomb shelter, but what the hell, my house walls should give me SOME cover". And he just kept on playing.

Via ircquotes.net.

Monday, July 17, 2006

Kevin Rose says "haha totally" in response to comment

"that's fucken hilarious that kevin rose got his comment pwned by his own system"

There's a story on Digg about a Youtube vid where a weird naked indian cowboy talks about what bad kids shouldn't do on YouTube (with a cigarette and a cowboy hat... yikes). Someone suggests that the video should be playing above the TOS at YouTube, to which Kevin Rose says "haha totally".. and GETS BURIED. -59 diggs and counting on the comment. We must save him, quick, go to the article and Digg him up! Otherwise who knows it will start raining frogs.

In other news, Paul Graham had breakfast. Again.

Sunday, July 16, 2006

Can you speak Japanese?

I met Kimmo yesterday and he thought I was prejudicous to think that that there wouldn't be any people with Japanese skills among anime/manga/jpop fans. Maybe I am wrong and there are actually tons of such people! The reason we had this conversation was because I was complaining how I am often wanting to have someone to help me with manga translation issues (not scanlation, real work) or adding products to the manga shop, but that people with the necessary skills don't exist. I would gladly be proven wrong, so if such a person is hiding out there somewhere then please contact me!


Saturday, July 15, 2006

Computers ARE part of the crazy utopia!

I spent two years studying Japanese at a university in Tokyo. Every day I spent around 5 hours with other students, doing reading comprehension and kanji exercises. We had spoken language classes as well. It was tough, exhausting but I think about the experience with warm feelings now that I have some distance to it.



A type of exercise I particularly enjoyed was having debates. I even attended an extra curricular debate club once, which was interesting because the debaters were all Japanese but they debated in English. They seemed so "in the zone" when doing the debating, forgetting about trying to speak perfect English but instead aggressively getting their point out. I decided not to join this club though as I felt I didn't need any more English exercise and because I'm not a club-attending personality.

Our in-class debate exercises had some great topics, nothing really controversial or anything, but interesting none the less. The university I was in is called ICU or "International Christian University", but some people liked to joke that it actually means "Isolated Crazy Utopia". It was surrounded by a small forest, which truly was crazy considering how tightly packed the area around it is. I'm seriously digressing here, but just look at the picture below. The green parts are the university and around it are very tightly packed houses.




Our debates were often about about kind of save-the-world utopistic stuff. As if we could actually save anything just by talking about it in class. Well I liked to take it seriously though, even if it was just language exercises it's that much more meaningful if you imagine that the debate is serious. One thing we debated about was what to do about poor people. And I suggested that computers could be the solution. I don't think they understood me at all. Instead of computers they need food and shelter. They were happy with that answer.

So let me continue the debate here. Computers can be part of the solution in my opinion. Not so that starving people can play Half-Life and watch videos on YouTube, but because with a computer almost anyone can become instantly employed. There are plenty of options for making money online and if you have modest expectations of what you can make, survival is possible through the net. Basically I believe that if I have an Internet connection then I will never go hungry. This happens to apply to me because I already have some skills which I can use to work over the net, such as programming and Japanese translation.


I'm not saying that we should fly over some starving country and drop iBooks with a satellite link to the net from an airplane. But even in poor countries not everyone is absolutely poor and there are people who are able to take chances. In India there are now some small companies which hire people to type in text. All you need to know is how to read and type. Materials are sent from abroad to be typed into digital form and then these people do the bulk work and send the results back over the net. This is a service for which there is a need as old archives and such get digitalized. Amazon's Mechanical Turk lets anyone make a few dollars through repetitive simple work. With RentACoder developers can compete to do programming work online.


Taking the digitalization as an example, not even a net connection is required to take part in the work, as the company takes care of that part. Then after acquiring a basic way of supporting oneself it becomes possible to advance to other skills and better pay. My explanation was a bit rambling, but the point is that through the Internet money can be made and your location doesn't matter. I really like the MIT Media Lab $100 laptop project, because through it more and more people can have basic skills on using a computer and take part in the global workspace. I've even personally hired some people through RentACoder. It works great!


So this is what I meant by computers being part of the solution for poverty, dear ICU debate teacher. Of course basic education is needed as well, but a computer is also a learning device. I'm sure many kids in developed countries have learned to read and write (or type) by using a computer. I personally learned English a lot through Sierra's adventure games and learned the basics of Japanese through material which I downloaded off the internet. With free laptops distributed by the millions for free to kids in developing countries they will have this chance as well. Based on what I've read a version of Wikipedia will be included with the computers, among other educational software. I hope they don't forget the games, they provide great motivation.

Thursday, July 13, 2006

Microsoft fined -- crazy?

Microsoft got a 270 million euro fine. Umm... seems strange that EU can fine a largely American company. I mean if you think about it, they really should fine Microsoft as much as possible if they are allowed to. After all, it's money coming straight from USA to EU's coffers. Let's fine every American company to their full worth and EU will definitely become the superpower of superpowers! I'm sure we can find something to accuse them of.

Tuesday, July 11, 2006

Loituma craze part 2

I just noticed that according to Google Trends, loituma is now more popular than Hamasaki Ayumi!

Evil Dr. Kraft acquires biscuit company

Kraft acquires United Biscuits Spain... for 522 MILLION DOLLARS *evil laughter*



"The selection and placement of stories on this page were determined automatically by a computer program" A computer program with a geeky sense of humor apparently.

Monday, July 10, 2006

Loituma craze

An already folded Finnish band got it's song used in a Flash video which has been spreading now like wildfire around the net. The band is surprised but welcoming the publicity. First time I've ever seen major newspapers write about a flash video. The band has even received fanmail from people who started to like them after seeing these vids.





Sulake Gets $7M Funding From Japan

Online and mobile games company Sulake Corporation has received $7M funding from Japanese SoftBank BB, Asian Groove formed Movida Group. Sulake is the Finnish interactive entertainment company which created the popular Habbo Hotel series of games. Habbo hotels operate in multiple language versions in 18 different countries and receive 7 million uniques visitors each month. Movida Group believes Habbo Hotel has great chances of becoming popular in Japan as well.



Sources:
TalousSanomat (Finnish)
Sulake press release

Pirate Bay ad revenues being sent to a Swiss bank account?

This is a quick translation of an article which appeared in Finnish. If you understand Finnish then by all means read the original instead.

Stockholm - The image of Pirate Bay as a movement with a cause is crumbling every day in Swedish media. It seems that the advertising revenues are ending up in a Swiss address (minus some fees), an address where a company running "tax planning" is operating. "Tax planning" means channeling funds to countries with low taxes.

Svenska Dagbladet is hinting that Pirate Bay, often considered the flagship of the pirate movement, has no ideology behind it. Not only are large sums of money involved, it seems that there is a Swiss party involved.

After several Swedish magazines attempted to calculate advertising revenues for Pirate Bay, Svenska Dagbladet said that the advertising revenues for the past four months reached 600000 SEK (84000 USD or 65400 EUR). This information was provided to the magazine from the advertising company Eastpoint Media.

Svenska Dagbladet reminds that in reality even larger sums are involved. Pirate Bay operates internationally and advertising sales are therefore also international and being sold by more companies than only Eastpoint Media. In addition it was recently written in Dagens Nyheter that going prices for advertisements on Pirate Bay have recently been on the rise.

Not all of the revenue ends up in the hands of Pirate Bay operators. The companies selling the advertising space take their own share first, after which the rest of the money ends up in the account of a company called Random Media (according to Svenska Dagbladet). The company appears to have a phone number in Stockholm, but its address is in Switzerland.

A company called Geneva Management Group (GMG) operates in the same address with Random Media. GMG deals in tax planning and funds management. Apparently in practice this means channeling funds into countries with low taxes, making it difficult for officials to get information as the banks are very secretive in these countries.

GMC is unwilling to comment on its relationship with Random Media. Daniel Oded, a representative for Random Media, also declined to comment on the handling of funds for Pirate Bay. Oded is said to have patented a system relating to Internet advertising in 1999 and is said to be currently working for an Israeli company called Target Point.

Friday, July 07, 2006

Son dls pron from dad on eDonkey, gets caught

A guy was downloading porn at home in his room with eDonkey, when suddenly he hears his dad yelling from the next room "hey! what are you downloading in there!". So he wonders how could his dad possibly know what he was downloading. In the discussion that followed it turned out that daddy also had eDonkey open on his computer and happened to be sharing the exact file that his son was downloading, realizing this when seeing a familiar IP in the downloaders list.


This must be true because it was said on IRC (#bf). Reported on ircquotes.net (similar to bash.org).

Wednesday, July 05, 2006

Steve Jobs' pilgrimage to India

Steve Jobs began to have an interest in religions while studying philosophy at Reed College. In 1974 he was working at Atari, saving money to make a trip to India, "to see his guru". After saving enough he asked his friend Dan Kottke to join him, even offering to finance his ticket after he was reluctant to go because of the expense (later in 1976 Kottke also became the first paid Apple employee). In India they encountered by chance a guru who takes Jobs up the mountain and shaves his head. Later Kottke also had to shave his because of the lice and fleas. They experienced poverty head first, traveling around in simple Indian clothing under the heat, bargaining for food in towns. In the end Kottke's travel cheques are stolen and the trip had to end. Apparently Jobs did not find enlightenment, but his experiences surely influenced his later work.



Please read these sources for a more detailed account:
iCon (PDF, page 23 onward)
http://www.fastcompany.com/magazine/78/jobs.html
http://answers.google.com/answers/threadview?id=408258

Monday, July 03, 2006

DIVs are the source of cool for Javascript

Back in the day people were obsessing about how to shave off a few clock cycles in their rotozooming effect written in pure assembler. You can understand why I feel a bit giggly when someone is fussing about how #000 is so much more smaller and more efficient in CSS than #000000. We have come a long way -- now it is not even possible to write a smooth rotozoomer that works in browsers in a compatible way (there is a trick for that on IE though). We just have to forget about that sort of effects. One sort of pixel-setting which is allowed though are horizlines, continuous horizontal spans of pixels. These are relatively fast to do since they can be simulated with DIVs. What can you make with horizlines? Polygons! In other words you can make 3D. It will be quite slow, so you can only use a very limited amount of faces, but a cube at least is still doable.




If you squint, you can see that it just consists of many horizontal lines. And you can create a horizontal line with a simple <DIV> tag. Use CSS to set the width to what you want, make the position absolute and set it on the screen where you want using the left and top styles. For the color, you can use the background style. Of course a single horizontal line will get you nowhere, so you need to have many of them. In the image displayed above there are around 500 of them. To create movement, javascript is used to calculate where they should be and the styles are modified on the fly. Pretty perverse, really. The inefficiency compared to assembler is mind boggling, but hey it works (mostly).


To create anything remotely cool, you want things moving. And to get things moving, you need to know how to modify styles in runtime. To do this, you first set a javascript timer to call a function say every 20 milliseconds. The setInterval function can be used to do this, as you surely already know. So you do setInterval("tick()", 20) for example, and then your tick function will be called 50 times per second. Inside this tick function then you do your magic and shuffle the pre-created DIVs around.


Okay, this set you wondering about how to precreate the DIVs. I feel sorry for even mentioning that, since now I will have to explain that as well. You could only create the DIVs as you need them and destroy them afterwards, but that would be slow since you would be altering the DOM tens of thousands of times every second. A better way is to just create those DIVs in the beginning. Just use document.createElement("DIV") in a loop.




        // First create a cache of horizlines
var i;
for (i=0; i<cnt; i++) {
hors[i] = document.createElement("div");
hors[i].style['position'] = "absolute";
hors[i].style['top'] = 0;
hors[i].style['left'] = 0;
hors[i].style['width'] = 0;
hors[i].style['height'] = 0;
hors[i].style['backgroundColor'] = "#000000";
document.body.insertBefore(hors[i], document.body.lastChild);
}



I will not go into any more details now, but suffice to say that inside your tick() function you can then reference the hors array and change the positions using hors[x].style['left'] = 400; for example. If some hors are unnecessary, just use the visibility style to set them to hidden or move them to a negative vertical position so that they will not be visible. Now all you need is some junior high school level math to create a cube out of them. Search the net for "triangle filler" to see how to do that.

Sunday, July 02, 2006

Majority Wins AJAX game

Yesterday I made an AJAX-based game. I don't say AJAX just because things are sliding around nicely, but it actually does use XMLHttpRequest to send some data back to the server. The idea of the game is to try to guess what others would guess others would answer to a question. Confused? Just try it at majority-wins.bemmu.com.


I was completely in the zone while making this game, it took maybe only 6 hours to make. It's funny how when doing something interesting I can be 10x more productive than doing something I'm forced to do. If I had done this at work, I'm sure it would've taken more than a week.


I posted it on Digg, but only got 4 Diggs. It was a real disappointment, since to be honest it was the whole goal of making this game. Maybe I should've been more blatant and use the words "AJAX" and "Amazing" in the title. It's a bit sad that I've missed my chance now, since reposting wouldn't be very nice.

Saturday, July 01, 2006

Jason Steele & Charlie the Unicorn

Update: New videos: Charlie the Unicorn video for YouTube LIVE and Charlie the Unicorn 2


I discovered a pretty funny video called "Charlie the Unicorn". After watching it I Googled for the maker "Jason Steele" and found another good one, "Spatula Madness". Great South Parkish animation and stories with that required sense of nihilism.


Charlie the Unicorn


Found some fan art too. On their site filmcow.net there are some other videos as well, even some live-action stuff, but perhaps it's not as good. If Jason Steele ends up big and famous, Charlie the Unicorn could become cult stuff.

Tuesday, June 20, 2006

Google reacting to click fraud

I had the Google support people as my pen pals for a while. I was complaining to them about one particular site (axill) which seemed to be doing something fishy with Google's ad blocks, and requested my money back ($70). They said they would investigate. They investigated. They gave me my money back. Thank you Google.


What, no place for positive stories in the world?

Tuesday, June 13, 2006

Faster scrolling in Windows

I got my first job writing software when I was 15. It was a summer job. I learned programming routine and in addition two things: it's possible to make big money by having your own company, and secondly, you can scroll down faster in Windows if you wiggle your mouse around while doing it.

Wednesday, June 07, 2006

"Easy" Internet Cafe

I'm still in New York, and since I'm spending a long time in here, I need to be able to access the Internet from time to time, in order to keep things running in my online shop, move my studies forward and that sort of stuff. But here's the problem: it's impossible to conveniently get onto the Internet from New York. It's incredible.

There are some net points in connection to some cafes, but they tend to cost almost $10 per hour, which is okay for just checking the map or news, but doesn't work if you need to spend 5 hours there writing a school report. Then one day, I managed to find this great place right in the center, on 42nd street, a net cafe called "Easy Internet Cafe". As a kind of disclaimer on what I'm about to say, the business is a franchise business, so the people at the easy group might not know how bad the situation is in here.

The setting is that of ghosts which are between the living world and the underworld, they have gone through a tragedy but they have unfinished business before they can find rest, which is why they are wandering, looking for the thing to satisfy their unfinished business. In the case of this cafe, the tragedy which happens is that people wander in here and decide to buy a pass for using one of these computers. You see, first you buy a pass from a vending machine, then find a computer where you can use this pass. But what you don't realize when you buy the pass is that although it seems as if there are a lot of free computers, actually almost none of them work. So you see these ghosts, wandering from computer to computer, hopefully moving the mouse or trying to turn on the screen, only to face darkness. But they have paid. They cannot leave satisfied until they find a computer which works.

You may think I'm exaggarating. I'm not. Maybe you think that I'm just upset because one out of ten computers doesn't work. Maybe you think I don't understand how fragile things computers are. No it's definitely not me, it's this place. About one fifth of the computers work. Seriously. The other ones either have frozen or blinking screens, windows has crashed, some system files are missing, the computer is endlessly rebooting or something similar. My favorite one is the computer which displays "this computer is free", blinking encouraginly, but then after you sit down, open your Red Bull, thinking that you finally found a computer which works and try to get to work, nothing happens. It's frozen to the "this computer is free"-screen. In desperation you try to hit the keys or move the mouse, but... nothing. That's just too cruel.

Update: One guy started warning others not to pay. The security guards got very angry and threw him out. Even though he had already paid. They said "you are now TRESPASSING" in a somewhat threatening voice, he apologised many times saying "I was only trying to get value for my money" and went outside, followed by the security guards, where the argument continued.

Sunday, June 04, 2006

New York

Finnair had a great offer of 300€ for a return ticket to New York, so I decided to make a visit. I also found a reasonably priced hostel called Wanderers' Inn, which costs just 20€ per night, making this a very cheap trip indeed. Joel Spolsky from Fog Creek Software invited me to visit for lunch, so I had something to look forward to. I have been in New York for a week now. Yesterday I became sick and only reluctantly left the hostel. Later I regretted it, almost throwing up in central park. After walking about 4 miles away from the hostel, the sky opened up and the heaviest rain I had ever seen began. There was so much water it started flowing over from the street into the sidewalks. I had no umbrella and soon I was totally wet. And I was already sick. There was nowhere to go. Inside cafes it is so cold because of the air conditioning. So I walked 4 miles back in the rain. About a mile before reaching the hostel I managed to find a shop selling umbrellas. I almost had a fight with another customer for the last umbrella. Next night at the hostel I was shivering, obviously I had a temperature. I was confused. One moment I was feeling hot, the next I felt shivering cold, all the time feeling a pounding headache. I hope the rain will stop and I could enjoy the city and still see Fog Creek later on.