StarCanvas: a Star Trek based galaxy map

starcanvas.

Yes, I've been geeking out lately. I wrote a little Javascript library that displays a 2D galaxy map a la Google maps. The Star Trek-y thing about it is that it divides each area of the galaxy up into sectors of 20x20LY each.

Click to see the StarCanvas demo. Use the mousewheel to zoom out/in. Also available on GitHub

The whole thing started as a private indulgement for a space 'game' that I'll probably never release, but along the way I realized that the map bit was fairly standalone, so I decided to extract it and github it. There's still a ton of things I'm not satisfied with, but I don't know when I'll have the time or motivation to work on this again. Better to release something crap but working than nothing at all.

Things I want to fix: zoom should focus on mouse cursor, not corner of the canvas. Additional backgrounds for zoom levels larger than 1 are currently not working. For the game I'm hoping to fetch area data via ajax from the server but that's a whole other challenge. I also want to show sector contents such as star systems, starbases etc. Currently I've got a separate canvas library that does that, but I think I can integrate them.

More to come? Who knows. At least it's out there. If you fancy it, grab it, touch it, fork it, eat it. Technologic.

Posted in Tech | Tagged ,

I am building a space game

I'm feeling the need to do some programming for fun rather than for profit, so I've started writing something very obscure and unfinishable: a browser-based space 'game'. It's far from fit for sharing with the world, but I felt like blogging about it anyway. There isn't really any game-like concept yet. I just started building the universe. I want to build something grand, even if it never gets finished, and I want to build it my way. No worries about what's the right strategy to monetize the product, no worrying about having tests or high code quality because it's a big project and other developers will read it. It doesn't mean I'm writing shit code all the time, although it does kind of mean that I'm writing shit code some of the time. But no one will tell me off about it and I can refactor it whenever I feel like it. It also feels great not having to discuss any technical decisions with anyone else. Just for once, I am doing a no-compromise project. And I'm loving it.

Posted in Tech

Obstacle detection via wifi signal strength

Every once in a while the signal on my wifi drops below -80dB. I've got a directional antenna for my desktop computer so I can pick up my landlord's wifi, which is just at the edge of usable range. I bought a cheapass wifi extender when I first moved here, but the thing is so crap that it keeps crashing on heavy load, so I bought an antenna instead and now connect to the main wifi. I use inSSIDer to determine the optimal position of the very short antenna, but the strange thing is, that optimal position changes every other week or so. Eventually the signal strength drops from ~-79dB (very usable, about 2 megabyte/s) to -86dB (completely unusable, frequent disconnects, internet unbrowseable).

Why? Are my neighbours constantly moving things around, placing thick slabs of concrete between the router and my apartment? Or are they moving the router around? Or is it the weather? I wonder if, with some calculations based on signal strength of the wifi networks around you, you can detect roughly the position of moving objects based on the signal strength of each wifi network. A side project perhaps, if I weren't already working on 3 other side projects..

Posted in Daily Life , Tech

The Big Bitcoin Adventure

I've occasionally blogged about Bitcoin in the past. Two years ago I was into Bitcoin mining, and when the value of 1 Bitcoin reached 8USD I declared it a success. Who would've known that shortly afterwards it would boom to 30$, the highest anyone thought it could possibly go. Then it crashed all the way down to around 5$. The increased interest in Bitcoin meant that mining was no longer or just barely profitable, so that was a dead end.

Today, 1 Bitcoin was worth 147 US dollars.

Major websites are starting to accept Bitcoins. The underground drug trade has firmly established itself on the Tor network with Silkroad. Its major currency is, of course, Bitcoin. In one month the BTC went from about 40$ to 140$. Everyone online knows it's a boom. But nobody, not even experts, dare predict when the boom will pop. The thought occurred to me that perhaps this is not a boom, that Bitcoin will continue to rise in value. I'd like to believe that, but then I saw someone else make that comment online and I had trouble taking him seriously. It seems like the kind of thing only someone heavily invested in Bitcoin would say.

For a long time I decided to stop writing about Bitcoin on this blog for two reasons. The first one is that I am obviously biased as I own some BTC myself and therefore want to contribute to its success, which will inevitably raise its value. (It's at this point in the conversation that my friends point out that Bitcoin is a ponzi scheme and they refuse to talk about it more). The second reason is that I don't know a lot about finance, so everything I write here will probably sound very naive to those in finance sector. Yet, it is my own blog, and I am entitled to sound naive when I so please.

Moving away from ponzi schemes and classic currencies, I'd like to think that I do know a little bit about the internet, and the technical principles behind Bitcoin. I've been monitoring it for several years now since my friend introduced it to me, and am thrilled to see more people starting to adopt such an elegant principle for sharing money, truly fit for the digital age. Pretty much all the early adopters are (were?) in the tech industry, but that doesn't necessarily mean mainstream adoption, or appreciation.

The recent rise in price has gotten the media interested (or vice versa), and still most people don't know what to make of Bitcoin. People in finance seem to get it wrong the most. They want to treat Bitcoin like a normal currency and are then surprised when it doesn't react the way they expect it to. So they blame Bitcoin for betraying their expectations and dismiss it as 'not a valid currency'. This may well be true. But that doesn't rob Bitcoin of its right to success. So far the non-tech people I've heard talking about Bitcoin enthusiastically are treating it either entirely as a very short-term means of trade (USD->BTC->commodity), or as an investment. Both ways can coexist if the currency is not too volatile, but the Bitcoin value has been rising like crazy lately, so how do the shops cope with that? To not out-price themselves they'll have to lower their prices every hour or so, at this rate.

But eventually prices will (should) stabilize. The higher the price gets, the less total volume will get traded, or at the very least the total volume will remain dampened until adoption becomes more widespread. Bitcoin is regulating its own growth. Perhaps this is not going according to established financial principles, but it's unstoppable nonetheless.

Personally, given the continued interest in Bitcoin and use of it as medium of exchange in less than legal circles, I suspect that the price can still go up, hopefully a bit slower and more steady than it was doing the past month. That way the stores can adjust and start pricing their products in Satoshis (0.01BTC, named after the mysterious pseudonymous creator of Bitcoin) instead. But even if the price drops massively, even if governments outlaw it (which they won't, because they can earn money from it), there will still be a use for Bitcoin. This may be vapor talk right before the crash, but I still believe in Bitcoin.

And if Bitcoin becomes a success, what's next? What else can we apply this encrypted peer-to-peer proof-of-work technology to? Many spin-offs of Bitcoin have already been made, most of them naive in their idea or purely opportunistic, leeching off of Bitcoin's popularity. Two alternatives may have a reason to exist though: Namecoin and Litecoin.

Namecoin is essentially Bitcoin for domain names. Instead of using a Bitcoin as a proof-of-wealth, you use it as a proof-of-ownership of a domain name. Generation and verification happens exactly the same way as in Bitcoin, and the code is pretty much a carbon copy of the Bitcoin codebase with some extra features tacked on. I believe this has merit because DNS servers are increasingly becoming the weakest link of the internet, and we need something stronger and more distributed to take its place. While I'm positive about the idea, I'm not so sure about its value proposition, or why you need a proof of work to register a domain. It seems like it can be solved just by peer-to-peer and public/private key technology. Despite that, Namecoin is becoming more widespread.

Litecoin is a bit of a maybe. Its original concept was to fix the weak points of Bitcoin: deflation, transaction processing speed and waste of mining resources. Litecoins were initially meant to be mined using different resources than Bitcoin, but in the end it seems that they're both going to end up being mined by GPUs and specially-designed hardware. The deflation was made less of a problem by increasing the maximum amount of coins generated, which is good, but not necessarily a problem in Bitcoin since there's still plenty of precision left to shift the comma many places to the right and subdivide a Bitcoin into smaller bits.

Transaction processing speed remains a valid issue. The last I heard is that the Bitcoin network is starting to suffer from this, as only so many transactions can be spread throughout the network at once, which will surely become a problem when Bitcoin becomes more popular. Still, the Bitcoin protocol can be refined if the core developers release a new client that allows for faster/more transactions. I'm a bit skeptical about Litecoin. If it takes off, it's probably more viable than Bitcoin, but Bitcoin already has traction and the benefits of Litecoin over Bitcoin are not that great.

The success or failure of Bitcoin is tightly linked to Litecoin and Namecoin. One will not fall without the other, but the derivatives may still fail even if Bitcoin is successful. Still, if Bitcoin is not speculative enough for you then you may care to wager something on Litecoin and Namecoin.

Much like everybody else, I have no clue what's going to happen to Bitcoin. All I can tell you is that I'm not selling mine, because I believe Bitcoin will have a bright future. Henry Blodget said it best:

The most you can lose is 100% of your bet.

The most you can make, meanwhile, is theoretically unlimited.

(In the time it took to write this article, 1 Bitcoin increased $13 in value).

Posted in Tech | Tagged

Arrogance and Humility

Read: The Positive Programmer.

I've been telling myself lately to be more humble. I believe my worst qualities are brought to the surface by a (sometimes unjust) feeling of entitlement. "I am now a software developer with lots of experience and I've been on this project longer than anyone else, so everyone must listen to me and I am always right". That's the inner voice I must combat with. The fact that it's never that black and white doesn't help either. And while software development is a great entrypoint to this kind of mindset, it extends to every area of my life. "I have lived in Japan for 5 years so obviously I have more life experience than you" - is another one that comes to mind. When I think about what's different between me as I am now, and the me from 5 years ago, the major difference is absolutely that of arrogance.

Be more humble. Humility is what makes you appreciate other people more, and gives you a more positive outlook on life. If, instead of assuming you're in a place because you have a right to be there, you see it as a privilege, you will look at life with new eyes. The older I get, the easier this is to forget.

Professionally I am encountering another clash of beliefs. I believe that, in my unique situation, I can either choose to be a better programmer, or a better person. No matter how I look at it, it seems that I have to choose. What I, and probably other programmers with me, hold in high standard, are high quality code, software delivered to perfection, well-tested, well-architectured. To really evolve myself in that area and learn new things, I will have to disappoint people who live in the real world, such as my managers and our customers, since development time will increase. And to be perfectly honest, I don't really care about developing myself as a programmer any more. In Japan I've become an expert in all things Java and SQL, in London I've become proficient in Python, Django and Appengine. In the meantime I've been teaching myself Android and iOS on the side. I am arrogantly confident that I can pick up any programming language that needs knowing and jump into any kind of job that I would be interested in.

But I'd rather become a better person. I'd rather spend more time interacting with people, talking to them, mediating, learning how they work and what motivates them. I really don't like conflict. I'd like to think that human communication is something that positively offsets me from other programmers. But every time I go deeper into a software problem, I have to commit to the solution, forcing me to become less flexible, less open to other people's opinions. That might be old age talking, but I'd love to find out a way where I can combine the keep-people-happy approach with the my-solution-is-best attitude. It seems though that, at this stage of my life, I learn more by sticking my head out and talking to people than by learning yet another programming language or framework.

For a post that was supposed to tell me to be humble, it turned out pretty arrogant. Forgive me, I'm re-learning this whole humility thing.

Posted in Tech , Thoughts

Startups, startups..

It's hard not to take things personally when I read about this year's best Y-Combinator startups (Flightcar looks brilliant), or about the owner of Summly instantly becoming a multi-millionaire at age 17. After all, I'm doing things that greatly overlap with them, so it's hard not to compare them to my own situation. There's not really any point or moral to this post. I just felt I should write it and get it out of my system.

Moodlogger.net was about to expire. I decided last month I would let it die since I've got plenty of other things to keep me busy. Despite that decision, today I just couldn't let it rest, and before I knew it, I had renewed the domain. Perhaps it's time to give Moodlogger a second life.

Posted in Tech

Commitment, or: the non-story of foodtap.co.uk

A couple of years back my friend and I had a brilliant idea: we were going to make it easier to order food online. Our initial premise lay mainly in the idea that you could pre-order food online and then go to pick it up and skip the queue. All you had to do was show a QR code at the counter to prove that the order was yours and you could pick it up. It was, and still is, a nifty idea. I coded on the solution for not too long, certainly not longer than two months if I recall correctly. When I had the technical prototype finished, I left it with my friend, who had the intention of contacting some of the local businesses to see if they would like to try it out. This, due to too much disinterest on both our parts, never happened.

A couple of weeks later, at those same local shops we were intending to target, suddenly there were stickers of a new online food ordering website called Just-eat. They had just launched as well and were a couple of months ahead of us. Their website, offering online menus for local shops, was very similar to ours in idea. There were differences in idea, in that we were targeting people who would pick up their food, whereas they went for the delivery market. I'd say that technically, our idea was superior in that it offered better order validation (and the web applet QR code reader tech is still something I've never seen anywhere else). But none of that is of any importance compared to being the first to market.

In retrospect though, and this is really the thing I want to highlight, not all was lost had we not given up at that point. Sure, our competition had a headstart, but we just saw that as validation that our idea "would have been" good and forgot about it, when what we should have done is realize that our idea is good and continue working on it, trying to grab a piece of the market. I saw 'we', but I really mean myself. It's the responsibility of anyone doing a startup to ignore other people and do what he himself thinks is right, kicking reason to the curb and believing in the impossible.


I do not have a sense for marketing. Every once in a while I force myself to venture out in the area of marketing and explore around a bit, but I always find myself out of my element and quickly go back to my technical treehouse. I wouldn't say that I am incapable of doing marketing, it's just that if I could choose what I would want to do in the future, marketing would not be on my list. I think it's mostly because of this that I have trouble recognizing which ideas to stick to, and which ideas to drop.

When in doubt, fall back on something you know. Something you're enthusiastic about. I've asked myself this question in many forms. At my current job at Potato, if I could do anything I wanted on my current project, what would I improve? Given any programming project without restrictions, what kind of project, what kind of software would I choose write? The first question is the easiest because it's the most narrowly defined. I would work on improving the quality of our code by refactoring it, re-architecturing it, and providing regular code and performance metrics to our team. That seems to be something that I genuinely enjoy doing. I love working with databases and big data, and twisting the code so I get exactly what I want out of it.

Since I've got my professional pleasures fairly well-defined on the small scale, perhaps it would be interesting to scale these ideas up a little. I think it's fundamentally a bad idea for me to work on something that I do not enjoy doing for a long time. I work best when focusing on a core product.

Startup people always say that getting an idea is the easy part; execution is what matters most. For me it's the exact opposite. I've pretty much managed to successfully execute every single idea I tried (at least technically), but I've never truly believed in an idea enough to commit myself to it fully. Despite that, I do believe I will find one. The one true idea is out there for me, and I will find it. Eventually.

Posted in Tech

Iterative programming

Programming is an iterative process. If no one commits the first iteration then no work gets done. Writing bad code is still a lot better than writing no code at all.

For my work at Potato I'm often confronted with first-iteration work. The project I'm working on is quite large, and everything was written in a hurry. Because I have a history with the project I tend to be more forgiving towards my predecessors, as I know what kind of time constraints the project was on when it was made. As the project progresses, little bits of code gets written and re-written, and most of our core code is in its third or fourth generation by now.

Another luxury we can now afford at Potato is to do more internal iterations before considering a ticket to be completed. We can tune the code to be cleaner, to work better with other code and to be more maintainable in the future, all in the very first iteration. But that doesn't change the fact that another developer will look at it and find something else to improve.

One of the biggest challenges for me while working on our startup, Flawless.QA, is to limit my own number of iterations and just push stuff when it works, not when it's up to my personal level of standards. This is scary stuff, especially when you're in the process of opening up your codebase for others to work on, which is what's happening right now at FQA. But it's a good lesson.

There's a right number of iterations for each situation: startups don't need as many iterations as do big projects, especially in the beginning. Just remember that, no matter what code you are facing, your predecessor probably had a reason to build it exactly the way it is, or at the very least had reasons to not spend time on it any longer. Don't underestimate that. Just pick it up from there, and push the next iteration.

Posted in Tech

A Forever Project

From "The joys of having a Forever Project":

..a project that, despite its audacity and seeming impossibility, simply will not put itself to bed. A project that comes creeping back into your consciousness when you sit down for a break from “real work.” A project that is hard to imagine actually embarking on, but whose mental cost of abandonment is far too high to even consider. A project that you'd totally do if you had the time, and the money, and the talent, and the…
I think I might have one. Except I've never worked on it. Maybe I should start.

Posted in Tech , Thoughts

Startup on a budget: accepting recurring payments in the UK

It's been a busy couple of weeks. Our Flawless.QA experiment is moving along nicely and we're improving the quality of many a website. We've even started blogging about why maintaining the quality of your site is important. The next big step is to start accepting payments. For a startup, accepting payments is really the only thing that must work flawlessly. Everything else you can worry about later, but payments must be handled perfectly and professionally. Unfortunately that also means it doesn't come cheap, especially if you're not based in the US.

Handling recurring payments is a step above handling regular payments. If you were accepting one-time online payments you could get away with doing almost everything in-house, on an SSL connection, without storing credit card information. But we need to keep the user's payment details in the system so we can bill them again the next month. And that means PCI compliance, or rather, paying a company to be PCI-compliant for you so you don't have to. And that's a good business to be in, if prices of these services are any indication.

So, what options are there? The answer is: tons. But they're all not right for us. We're trying to get our site up and running with a bare minimum amount of money, so spending 69USD for a beautiful recur.ly subscription billing and an additional 25GBP for a SagePay payment gateway is just not an option. I've spent many an hour scouring the internet for useful solutions, and recur.ly+SagePay was mentioned several times as someone's preferred solution. Other solutions include Braintree, which will send you five gazillion forms to fill out and has a minimum monthly fee of 100EUR, and the un-Britishly named Authorize.net which will charge you a 50GBP setup fee and a 20GBP monthly fee (and will also send you a bunch of forms). Unlike Heroku, where the platform costs will hurt you after you've actively started using it, payment costs will bite you right from the start.

Before I tell you which provider we ended up choosing, let me mention one more option here that I only learned about after we finished our initial integration: Paymill. They seem genuinely good and I'm going to give them a try real soon. Paymill is also discussed in this thread on Hacker News about taking payments online in Europe, a must-read if you're looking for info about online payments in Europe.

The solution we ended up going for, at least for the moment, is the one big name left unspoken so far: Paypal. Much has been said about Paypal, not much of it good. You will have no problem finding horror stories about their API, their customer support, their random freezing of people's funds. But to the consumer they're a symbol of trust and familiarity. Implementing payment logic is indeed not straightforward at first, but it does make sense. Since we're Django-based, the django-paypal library seems like a good choice, but it did not work out of the box, and neither did the supposedly up-to-date fork, but it took only a small effort to get it working.

The paypal sandbox is one massive WTF. Creating dummy accounts and managing who is logged in where is a massive pain that is only made more terrible by the fact that you get logged out every other bloody minute. You'd think that they'd set the timeout to something higher on their sandbox, but no, you will suffer in inconvenience. To make matters worse the sandbox works differently from the real paypal store. Other than that I had a hard time figuring out how to make our paypal store accept credit-card payments from people who have no paypal account. I found out there's a package called "Paypal payments standard premium" which will let you do this, but it's not documented very well on the paypal site. After selecting the premium package I suddenly received an email from paypal thanking me for my purchase without mentioning any price. Trying to find out the price online gave me conflicting answers so I emailed paypal about this and received an answer two hours later: the premium package used to cost money, but now it's free. And there was much rejoicing.

The other thing we found out while testing our live paypal store is that paypal is very strict on which cards it accepts. It flat-out requires a contact phone number and will not forgive if you fail to exactly copy the billing address belonging to the card. I had to try several times with my UK card, something which will definitely be horrible for conversion rates. For some reason my Dutch card worked fine on the first try, but my friend's US card did not work either. It's my main cause of worry right now, and part of the reason I'm putting this blogpost out there: to hear other people's experiences and find out about alternatives.

If you're a UK-based startup, and you have no money to spend, there's really only one option: Paypal. I sincerely hope that Paymill can disrupt that status quo.

Posted in Tech | Tagged , , ,