Canadians and their Keyboards

I need to throw my hat into the fray. I need to add my voice to the 4 or 5 other Canadian voices that are outraged and struggling to fight back.

If you go into a Best Buy or Future Shop in Canada and ask one of their staff why most of their laptops have only bilingual keyboard layouts, they will usually tell you that it’s the law, all keyboards must be bilingual. This is not at all true. The proof is just down the aisle. Ask the same staff why Apple laptops don’t have the bilingual keyboards displayed on any of their products.

Bilingual keyboards on Canadian laptops were introduced en mass at some point in the last 5-10 years. In Quebec, there are laws requiring all keyboards sold to be bilingual. The rest of Canada has no such law. Canadian laptop manufacturers were suddenly faced with a stark choice: Offer customers a choice between the American keyboard layout, the normal keyboard layout that 3/4 of the Canadian population grew up with. Or the bilingual keyboard that resembles an American keyboard layout, but on second glance looks strangely wrong.

As anyone who types without looking at the keyboard (a touch-typist) will tell you, the bilingual keyboard inexplicably ruins 2 of the 3 most commonly used non-alphanumeric keys: the left shift key and the enter key. Mercifully, the space key was spared. But now, when you use either of your pinky fingers to reach for the left shift or the enter key, you will in both scenarios find instead a back slash key. Far be it from me to question how such a key layout is beneficial to Canadian francophones, but I wish I had a choice of keyboard layout when I buy a laptop.

The reason why laptop manufacturers often chose to only provide bilingual keyboards is commonly understood to be attributable to the money saved by only having 1 specific product in Canada to sell and support as opposed to 2 different products. Laptop manufactures seem to know they are up to no good too as they try to visually merge buttons to make the keyboard look American after a quick glance, as shown on this Acer ‘ultrabook’ I recently saw at Best Buy:

Of course, most higher-end laptops sold in Canada give the buyer the choice of keyboard layout (the default being American). Lenovo, Dell and Apple all offer a keyboard layout choices on most of their offerings. But most laptops, such as Samsungs high-end Series 9 pictured above, and laptops sold in traditional brick-and-mortar retail stores, do not.

I usually prefer letting markets decide such things. I don’t think we need to legally define our nations typing preference. But this seems to be a case where market forces are weak and feeble. How is this? How are is 3/4 of Canada not up in arms, shouting demands for better keyboard layout selection?

Perhaps it is a stereotypically Canadian muted response. Searching for info on political movements aiming to bring back more choice in Canadian keyboards, I found 2 petitions: One by an anonymous author that had 175 signatures (176 after I found it). The other petition was closed.

The Canadian blogsphere (if such a thing exists) seems particularly blasé to the infestation of bilingual keyboards (that é was copied and pasted, thank you). Try a few searches for Canadian bilingual keyboards and you will find 5, maybe 10 articles, blog posts and youtube videos.

Canadians simply don’t seem to give a shit. Those that do would likely be more inclined to switch to a laptop that has an American keyboard layout, or buy their laptop from the US, or most likely, buy the bilingual keyboard and stoically endure hitting back slash every time they want to type a capital letter or start a new line.

Encrypting ConnectionStrings in your C# Application

It is pretty tough sometimes finding relevant how-to info for MS products. Recently I spent several hours trying to figure out how to hide my database password in my C# distributed application’s app.config file. My database password is stored in my connectionstring (which is in turn stored in my app.config file).

The recommended way to secure your connectionstring is to encrypt the whole connectionstring section of your app.config file using built in MS functionality. The connectionstring will be encrypted with a key based on the computer you are running the application on. This means that an app.config file encrypted on one computer will not work on another computer. Your connectionstring needs to be encrypted on the target computer. That is the hard part. The easy part is that MS automagically knows to decrypt the connectionstring when it needs to, so you don’t need to worry about that.

Of course, the hard part isn’t that hard. Somewhere in your application code, you need to insert some code that will encrypt the connectionstrings section of your app.config file. I used the following function to encrypt my connectionstring section of the app.config file:

private void ProtectSection(String sSectionName)
{
    Configuration config = ConfigurationManager.OpenExeConfiguration("myapp.exe");
           
    // Get the section in the file.
    ConnectionStringsSection section = config.GetSection(sSectionName) as ConnectionStringsSection;
    // If the section exists and the section is not readonly, then protect the section.
    if (section != null)
    {
        if (!section.IsReadOnly())
        {
            // Protect the section.
            section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
            section.SectionInformation.ForceSave = true;
            // Save the change.
            config.Save(ConfigurationSaveMode.Modified);
        }
    }
}

I call this function when my program first starts up like this:

static void Main()
{
    ...
    ProtectSection("connectionStrings");
    ...
}

Note, you do not need to edit in any way your app.config file. This solution encrypts a plain-jane app.config section without needing anything inserted or altered in that file.

And that’s it…. possibly. There is a gotcha, because the connectionstring section of your app.config arrives on the target computer unencrypted, there’s a chance that some clever deviant will know to look at your app.config before the above routine is run. For example, my application could arrive bundled in a zip, extracting the app.config file before my application is unzipped could mean some deviant gets my database password before it is encrypted.

MS’s solution to this is to bundle your application in an installer and have the installer execute the above code (or something that achieves the same result) so the app.config file never exists on the target computer unencrypted.

Dinosaurs, Dodos and Protestors

The Occupy *Your home town here* movement seems to be winding down. It started as a potentially massive movement to protest bailouts for banks that screwed up while Joe Blow Average struggles to find work. At first a lot of people, possibly 99% of people, were curious. But soon the protesters went from curiosities to pains in the ass. They were unable to draw in the all-important teeming masses and the movement became largely represented by students and hippies who claimed to represent 99% of the people. People started to express concern about how much money these protests were costing and why they needed tent cities to protest. Here in Vancouver, a young woman died of a drug over dose in one of the tents.

In Toronto, the G20 meeting that took place in 2010 was controversial because of its cost, but also because of the police handling of protesters. 1000’s showed up to protest all kinds of things, the police at times over reacted and the press in Canada had a field day. There was quite a bit of support for the G20 protesters but there was also a lot of support for the police and government efforts to get their jobs done and not be heckled by protesters ‘whining’ about everything.

I remember living in London, England when the Iraq war was just getting started. There were massive protests there against the UK’s involvement. I attended one such protest, it was huge. Some organizers say that up to 2 million people flooded the streets of central London. It wasn’t hard to believe, square miles of the streets were crammed. There were passionate speakers in Hyde Park delivering speeches that made my arm hairs stand up at times. There was a lot of energy and power in that crowd I thought. But of course, the UK went into Iraq anyways.

If you go to the capital of any major western country, the iconic main political buildings always have some sort of constant protest going on. So constant and small that no one really even pays attention.

All these protests failed in shaping government policy in any meaningful way. Protesting just doesn’t work anymore (did it ever?). Political organizations are always polling the voters to gauge where public opinion is on a given issue. That’s typically where you see governments reacting. When politicians see 50% of voters disagree with their position, politicians change their tune or risk not getting re-elected.

If you care about something so passionately that you show up to protest somewhere, it doesn’t really matter. You only have one vote no matter how much you care. It’s the vote of everyone that matters, that’s how democracy works. Governments now safely ignore protests of almost any size without risking re-election because they will have pollsters telling them that there are a few people who care deeply, but they only represent 10% of the population.

With our society and technology changing so fast, it’s surprising sometimes to see how some things change very little. Protesting is one of those things, but not all the time. Openmedia.ca launched a very successful, coordinate online campaign to get the government to change the way telecom companies in Canada bill customers. Barack Obama won the presidency with an unprecedented online campaign that reached out to new supporters and constantly tried to engage existing supporters. Campaigns that have a clear purpose, are able to target certain demographics and have someone managing public perception will always do better than a bunch of people camping at city hall.

People are inundated with information every day. Most of it is cast aside as noise. Like junk mail, if you are constantly casting it aside, you’ll soon just get annoyed that it’s there at all. A lot of protesters fail to grasp this, and it’s these protesters that are going the way of the dinosaurs.

Anatomy of a Startup Fail

I am officially closing the book on my second business venture. Schedule Bin will still be around but in a much more diminutive state. Let me tell the story in blog form:

A few years ago, a friend and I decided we needed to join forces and create a company. We both had steady jobs as computer programmers that we didn’t want to give up on, so we decided to start a project in our spare time, as is oft recommended. The first thing we needed was an idea, we thought about making video games because it was something that made sense for the both of us, then one night, he was telling me how someone he knew was complaining there was no online tools to schedule employees. After maulling that over for a couple weeks, we decided that this was the perfect project because it made so much sense and was something we felt we had the ability to do and blow everyone away with the result. We searched for competition online and found there was no one doing online employee scheduling.

So we got cracking and slowly started working on the project. Early on however, my friend and business partner decided that Schedule Bin wasn’t something for him. We were both realizing that there was a lot of work. When you think of working on a cool new project in your spare time, it’s easy to glance over the fact that “spare time” can mean 1000’s of hours of evenings and weekends. That is a big commitment no matter how you slice it. Another factor was that competition was suddenly coming out of the wood work. Maybe our google searches got better, maybe other people had the same idea just before we did, for whatever reason, there was competition. So my partner left leaving me the sole pilot steering the ship. A little while later, I lost my full time job.

I started doing software consulting on my own which proved to be a great means to support myself. But I also worked that much harder on Schedule Bin. Perhaps it was pride, perhaps it was genuine niavity, perhaps it was because I thought things were almost done and the end was within sight, perhaps it was a lack of better things to do with my time; I pushed on and the further I pushed the more I realized that things were not working out. Here’s why:

  • I was never “almost done”. Never is a business product “almost done”. Even now that it is “done” there is no shortage of features that I could be putting into the site. Ever wonder why big software companies like Microsoft, Adobe, Oracle, Apple, etc etc put out new products every year or two? It’s so they can keep making money. If you build something and call it “done” within a year the competition will have the same thing but with better features. You’re work as an entrepreneur developer is never “done”.
  • I made an employee scheduling web site. I have never at any point in my life been passionate about how employee’s are scheduled. From the get-go this was purely a means to make money for me. When the going got tough, it was that much harder to man up and go the extra mile because it was employee scheduling, not something I had any burning convictions about. I had a hard time thoroughly testing parts of the system myself because it was simply too boring. Don’t get me wrong, any labor of love is going to hit a point where you are simply sick of it and want it to go away. But it is that much harder when you don’t really care about it on a good day.
  • I don’t know if I was a great salesman or not. I certainly put in some effort, maybe not enough. I cold called around 75 business’s and though I got a few meetings out of it and a chance to demo Schedule Bin, I didn’t get any sales through cold calls. I hired an SEO company to help me with online marketing for a bit and though I got a few leads, I didn’t land anything solid. I tried to do my own SEO and as my adwords bill kept coming through each month with little to show for I eventually stopped doing that too. I wasn’t able to find a repeatable way to sell my product. I did find one paying customer, but they left after a while due to the beta-state of the website, as well as the lack of more enterprisy features.
  • I used Adobe’s Flex to build the site. It was a tech I was good with and didn’t think it would be sidelined as fast as is has been. I also used Google’s AppEngine which was great for the last few years. But now Google has changed the pricing so it is now more expensive to run Schedule Bin (though to be fair, still cheap, just not free). Whats more, changes in their server have unexpectedly broken things on Schedule Bin. So I had to keep a close eye on Google’s Appengine in case they change something that will break my site.
  • I burnt out. After so many months and so many hours the fire simply petered out. This is the perfect indication that you’re done with a business product. But because I put in so much effort, the thought that a little bit more effort was all that was needed to turn it all around kept me working on it for a few months longer than I should of. But once you realize you will wake up tomorrow caring less than you care now, nothing less than a weekend camping with Tony Robbins is gonna change your attitude.

Mercifully, I did have enough sense to do software consulting and that kept me pretty busy. Never was I working on Schedule Bin fulltime for more than a couple weeks. Having a steady source of income was great and I feel definitely helped moderate the emotional rollarcoaster ride I was on when working on Schedule Bin.

Here are my tips when considering starting your own business:
– Do something you actually care about. We should of stuck to video games, especially considering it was just as the iphone was coming out (the cliche “hindsight is always 20/20” comes to mind).
– Do not put all your eggs in one basket. Always have a plan B. This is especially important if you have a family or other financial obligations.
– The fear of failure is rampant and superficial. Ignore it. I didn’t fail, I simply found a way to make money that wasn’t efficient.
– Choose your tech well. Cloud services might be perfect for your project. But at the end of the day, API’s, EULA’s, terms and conditions, technology trends, direction of the product/company can all change and leave you and your product blowing in the wind.
– You must be able to generate revenue or attact users right away.
– Test your concept before you start and during development. Don’t make something for other people to use based on what you think they’d want.
– No amount of networking or attending startup events will make your product fly if you can’t get the any part of the business model working on your own.

Ghosts of Microsoft Past

With Windows 8, Microsoft is running headfirst into a product launch disaster.

In the tech world, there has been a lot of positive advanced press about the previews of Windows 8. Yet most of these fail to acknowledge a fundamental Achilles’ heel in Microsoft’s core strategy for its future flag ship product. And Microsoft’s failure to fully acknowledge this problem threatens to undo everything that is good about its new OS.

Windows 8 is being touted as a fundamental shift in user interface versus other editions of Windows, and it’s Metro UI borrows heavily from Window Phone 7, which itself is partly inspired by (or is at least a reaction to) Apple’s iOS, the OS that powers iPads and iPhones. MS has touted tablets running Windows years before the iPad came on the scene, but as most people who have used these devices know, the experience has been sluggish and entirely non-intuitive. Not a chance that these devices could have ever pulled off the kind of mass consumer adoption that has happened with the iPad.

Enter Windows 8: with its sleek, light-weight, and touch-friendly Metro UI, MS has a chance to redeem itself. At last, a version of windows that will run equally well on both the desktop and on tablets. The early press has been incredibly positive, with tech journalists / bloggers gushing about how MS has finally made the sort of fundamental shift in thinking required to level the playing field with Apple. These tech writers point out that the UI has the right stuff to compete with the iPad in terms of user experience. They then point out the killer feature that gives MS the edge over other platforms (Android, Blackberry) when it comes to competing with and potentially unseating the incumbent Apple: legacy Windows app support. Why would you buy an iPad – the thinking goes – when you can have an iPad-like device that you can also run your traditional desktop apps on? Just plug-in a keyboard and you no longer need 2 devices (an iPad and a laptop or PC) – finally the best of both worlds in one sleek device.

But it doesn’t stop there: Windows 8 is the first version of Windows to support the same ARM CPU / processor architecture that is used in low powered devices such as virtually all smartphones (iPhone, Android, Blackberry, etc), the iPad, and all Android tablets. Further, all evidence suggests that the new Windows 8 UI runs very well on this hardware, providing a beautiful user experience and fantastic performance while offering the same small form-factor and long battery life that consumers have come to expect from modern tablets. Microsoft looks to have a real winner on its hands!

But there is one problem and tech journalist have either failed to understand this or failed to understand the ramifications: you can’t run legacy Windows apps on ARM based processors. So the only Windows 8 tablet hardware platform that can compete with the iPad in terms of size, battery life, and performance, won’t run legacy Windows apps. That means that these devices won’t run any of the latest Windows 7 apps you have on your PC, or any of the 10+ year old Windows 9x or Windows NT based apps either. None of it. Nada.

‘But’ – say the more tech-knowledgeable Windows fans – ‘x86 based tablets running Windows 8 will be able to run legacy apps’. Yes they will….and there is NO IMPROVEMENT in Windows 8 for running these apps on x86 tablets versus running them on tablets with Windows 7. In other words: any tablet running Windows 8 AND supporting legacy apps will have the same compromise between performance and battery life / size that all current Windows 7 tablets have. They won’t be iPad killers.

And most Windows users won’t want to run the Metro-UI on their desktops or laptops, despite Microsoft’s decision to make it the default user experience for Windows 8. It’s too touch-oriented and takes more clicks to get things done compared to the current desktop paradigm when using keyboard and mouse. Metro shines on tablets….but can only really compete hardware-wise with the iPad when it ditches legacy apps. But at that point, why would anybody buy a Windows 8 tablet with relatively no apps versus an iPad?

I’m a Windows user and I’m looking forward to trying out Windows 8….but I see a major public-relations disaster in the making. Already amongst the more tech-literate readers of the aforementioned tech blogs and websites, reader response suggests that most people have failed to understand that this OS limitation even exists. And this is because most of the fawning journalists – distracted by Microsoft’s pre-product launch theatre – are themselves failing to understand and point out the ‘Windows 8 on tablets’ reality.

To sum it up: Windows 8 can only compete against iPad hardware when it can’t run Windows apps, at which point its only real advantage is lost.

Back in My Day, I had to Telecommute


I recently had the privilage to drive across Canada. It was a great trip but along the way it got a bit distrubing to see the number of small, abandoned highway towns, slowly being reclaimed by nature. More disturbing were the small towns and villages that did have people in them. There were a few towns that must of had dozens of residents. All of which were involved in the local industry (mostly agriculture). These towns are dying, how do I know? No young people. There are simply no opportunities in these towns.

This shouldn’t be. We live in an age where I can freely and easily have conference calls with multiple people around the world, send messages to my friends and family and get the local news from anywhere in the world. All at the same time. As a self employed software consultant, I do things like tweet, write blog posts (hello!) and share with the world things I’m working on. This is how I create and maintain my reputation and this is what I show potential clients when I need to assure them that I can help them with their problems.

And I’m not even that great at it. There are many well known and respected programmers making a great living doing similar things. Starting an open source project and selling consulting services is a great way to gain street cred. Indeed, experts and analysts (I use these terms loosely) have noticed work-from-home trends and have already started to coin terms and identify demographs in the changing ways people work. Why does this new class of worker need to be in large centers? Don’t get me wrong, there are obvious advantages to working from home in a large city, but surely technology makes it easier for people to make a decent living from even small towns in the middle of the Canadian prairies.

Certainly one of the reasons why rural areas are bereft of a skilled work-from-home workforce is the lack of connectivity. Many communities throughout Canada lack things like highspeed internet, they simply don’t have the infrastructure. But that is likely a minor reason. The major reasons are social attitudes. Most employers insist that they must see company employees in front of company computers for 8 hours of company time per day, seemingly oblivious to the possibility that watching a person in front of a computer doesn’t mean they are actually working. And most would-be employee’s don’t know how to market themselves effectively without being face-to-face with someone.

Also, how would someone in a small town catch on to this work-from-home thing? If you are surrounded by farmers, you less likely to research work-from-home jobs and put the time into learning how to do them and marketing yourself than someone who has access to people who already do that (in a city for example). Maybe people who left town might trickle back, perhaps they got a job that allows them to work from anywhere. They may be able to offer guidance to others. Certainly there is no shortage of online resources to teach people anything to almost any level.

I am sure that sooner or later work-from-home will be a common thing. The reason it will take time is simple: technology evolves much faster than society.

Why Google is on a Different Level

Google is on track to be the most valuable company in the world. I say this because of the vast amounts of information they store and process. Almost every search people do is recorded and intelligent algorithms are constantly combing the data and ultimately finding ways to make better sense of what the world searches for. The thing that sets Google apart is the massive scale in which they operate. There are many companies that process data, but Google’s edge is how much more they process. More data, more variety of data, more data processing routines… Who knows how such a vast system will evolve, or even snowball into something bigger.

With so much potential power, people are rightly concerned about letting a company like Google have so much info. The consequences of Google suddenly doing blatent acts of evil are pretty harmless now (ie. no one uses Google, the company eventually folds or fades into obscurity). But who knows, governments can and do force Google to share their user information (possibly for evil, as may be the case in places like N. Korea or China). The possibility of hackers or disgruntled employees releasing user data is always there also.

As society’s slow pace of evolution tries to keep up with the comparitively lightening fast pace of technological innovation, we will need to trust a company like Google at some point if we are to embrace all the awesome things that science fiction has shown are possible through technology. Although there seems to be countless barriers to trusting companies like Google, actions speak louder than words.

Google spends so much money doing genuinely cool things. For example, websites I make use javascript libraries stored on Google’s CDN saves me money because I don’t need to use my servers bandwidth to download those files to visitors to my site. Google Books was started because Sergey Brin (Google co-founder) wanted all the books in the world to be accessible to everyone, and also prevent disasters like libraries being destroyed or books being lost. Google’s google.org is not a separate non-profit entity created by Google, but Google itself using its know-how to improve how the world deals with technology. It is known that about 95% of Google’s revenue comes for ads. Admittedly, their ads are EVERYWHERE, but I also think it’s worth while pointing out that Google has dozens of products that are feature rich, freely available and don’t even require you to register to use them.

Etc, etc

Apple has been in the news a lot lately. Everyone and their kitchen sink owns, or wants to own, one of their products. The Apple brand is probably the strongest brand in the world, and there are probably people out there who would actually kill me for bad mouthing Apple or Steve Jobs. But why? Why such feirce loyalty? Apple makes great products, but what has one of the worlds largest companies given back? Not a fucking thing. Since Steve Jobs came back to Apple in ’96, they haven’t donated anything to anyone. There are a lot of reasons to fear/hate/boycott Apple, but I honestly can’t find anything positive to say about the company aside from the obvious “they make cool products”.

Actions speak louder than words. Though we may still be a far way off from lauching space ships to seek out new life and new civilizations, I’ll put the limited amount of trust I have reserved for massive companies, and my hard earned dollars, in with companies like Google as I can’t think of any other organization willing to spend so much money on sending a space ship to explore space with the sole purpose of learning. In fact, every other organization on the planet would call that a waste of money.

Will I Ever Own 0’s and 1’s?

I own my bicycle. I can ride it whenever I want, when I want. I can add parts to it to improve it. I can paint it. I can destroy it or give it away for any price I want. I can put a flower-rimmed basket on it and start a delivery service with it. I own my bicycle.

All the digital things I own, I own in the sense that I can use the product/service within the guidelines of the terms and service and I can stop using the product/service at any time (unless there are contractual obligations). That is the extent of “ownership” with 0’s and 1’s.

With any digital software or content you purchase or use, you are virtually always required to agree to a terms of service agreement and/or an end user license agreement. Pretty much everything I use on my computer requires me to go through at least one of these tombs of legalese. The truth is that I rarely ever read more than a paragraph, there is often pages and pages of information. So much to read that rather than forcing me to scroll to the bottom of the text containing one of these agreements, and at least bettering the odds that I’ve gleemed something from the agreement, often there is just a “next” button to the side, allowing me to completely skip reading the agreement. I assume this is done because the agreements have gained so much mass that it could take so long to get to the bottom of an agreement, many potential customers may get lost in the madness of so much jargon and abandon the sign-up.

A friend and I were recently discussing eReaders. He had recently purchased an Amazon Kindle and had nothing but praise for the device. It got me thinking that I really should get an eReader too. So I did a bit of research. I found a lot of forum posts about how Amazon doesn’t sell you (as in you don’t own it) any ebooks you purchase. Rather, they lease them out to you and have the power at anytime to revoke that license and take back the ebooks you purchased (as has happened in the past). “That’s bullshit” I thought and set forth with plans to buy the Kobo, which doesn’t have such a checkered past. But then my friend pointed out that they have the same terms in their terms and conditions, they just haven’t flexed their legal powers like Amazon has, yet.

Which got me thinking, I don’t own anything on my computer. Even emusic, which I always held as the defacto example of the way an internet company should work and how it assures me that I “own” the DRM free music I download from their site, has a gotcha. Their terms and conditions states that

“Content received through the Service may be used and played for your personal, non-commercial use only.”

So does this mean that if I DJ for a living, I can’t use the music I “own”? What do they mean by “personal use”?

I sent emusic an email asking for clarification, here’s what they said:

Unfortunately, we can’t really answer that question. We cannot define what “personal, non-commercial use” is.
We understand you have some ideas in mind for the MP3s you download, but we recommend seeking professional legal advice before using that music as you requested below.

So, the company I purchase music to “own” from doesn’t know if I actually own my music the way I own my bike. This was the stalwart of digital content ownership and forward thinkng terms and conditions in my mind. Now that part of my mind is a hollowed out husk. I will never completely own anything I pay for on the internet. Everything is ultimately “owned” by large companies who license out content and services.

To be fair, in practise, and considering how fast things have changed over the last few decades, this seems to have been somewhat balanced: computers are increasingly being used despite this. But at the same time, I feel lots of companies would benefit to rethink how business should be done over the internet. Where production costs are virtually nothing, and distribution costs are fractions of a cent. Why am I still paying $8 for an ebook I don’t own?

Mobile Flash’s Growing Pains


I’ve recently commented on the lack of games on Android and thought that the Android market could use a good tower defense game. Of course, it would be nice to make money on my side projects, so I thought it would be really good to port my game to iOS and other modern devices, maximizing my potential market and ideally, selling a lot more games.

The problem is that me and a friend working on a game don’t have the time, energy or mental fortitude to port our game to all those platforms. This has been the dilemma of the mobile application developer for years. Unlike desktop development where 90% of your market runs the same platform, mobile is, has always been and very likely will always be a fractured market with no clearly dominate player.

What this means is that I need to put in a lot more work for my apps to reach the majority of smart phone users. I have worked at companies that make their own mobile frameworks with the dream of one day being able to plug an xml file through their machine and have a blackjack game (for example) spit out the other end. Problem is that platforms are always being updated forcing you to always update your framework. The biggest problem though is that if your apps are so simple that a framework can make them, it will be faster and cheaper to just build the apps using reusable code.

Adobe is trying to be the new Java (only focusing on the front end rather than servers). As an independent developer, I applaud their efforts but gotta say mobile Flash is in an alpha stage right now and is not ready. After trying to port my tower defense game to my Nexus One, I was surprised to find everything was just really slow, across the board. I put in some diagnostic code and discovered that the mobile version of my game takes 50% longer to do everything. 30 FPS became 20 FPS. What I thought would be the processor intensive parts of the game (the path finding) actually ran fine. It was the graphics, drawing one circle around a selected tower slowed things by a further 35-50%. I have heard that when doing mobile Flash development to avoid using any vector graphics (using the Graphics API), but the truth is that any vector graphics kills your apps performance to the point where vector drawing shouldn’t be allowed on mobile Flash, it is unusable.

Of course, the problem is that once you do that, you fracture your cross-platform platform. But that doesn’t really matter anyways as just using Sprite’s and bitmaps alone slows my app down to the point off being unusable (and those are essential to Flash). If you look at Adobe evangelists showing off Flash on their phones, they are usually apps where there is very little movement (showing an image gallery is common). I wish they would stop doing this as I find it misleading. What would be great is for Adobe to instead advise developers on how to optimize their Actionscript code for mobile devices (other than a few forum posts, there is really nothing on the web providing guidelines on this). If this isn’t possible, developers are going to abandon Flash as a mobile platform, but if Adobe keeps acting like there isn’t an 800 pound gorilla in the room, developers might start abandoning Flash all together.

Of course, if RIM and Adobe are able to make their new QNX OS and Flash work fast and zippy together, that could be the time where Adobe can start shaking the “poor performance” monkey off it’s back. If they don’t pull it off, I hope RIM has a native SDK in the works.

Rotating Objects Around Their Center

In actionscript, when you create a Bitmap or Movieclip or Sprite, it’s reference point is at the top left at 0, 0 meaning that if you rotate an object, it will rotate around the top left corner, not the center.

I am currently working on a tower defense game and needed the turrets for my towers to rotate around the center. There are many sites such as Ryan Bosingers that correctly explain you need to use a matrix and transform your object so that the point you want to rotate around is at 0, 0.

private function rotateAroundCenter (ob:*, angleDegrees:Number, ptRotationPoint:Point) {
      var m:Matrix=ob.transform.matrix;
      m.tx -= ptRotationPoint.x;
      m.ty -= ptRotationPoint.y;
      m.rotate (angleDegrees*(Math.PI/180));
      m.tx += ptRotationPoint.x;
      m.ty += ptRotationPoint.y;
      ob.transform.matrix=m;
 }

The problem with solutions such as the above is that over time your objects can start to drift. This is caused because once you rotate your object, you are altering it’s width and height. If you rotate a square 45 degrees, it is a diamond and its width is greater. In the function above you transform an objects back X pixels, rotate it a bit then transform it back the same X pixels, ignoring the fact that the rotation changed the width and height slightly. This adds up over time, which is why you want to basically reset your matrix with the identify() method:

private function rotateAroundCenter (ob:*, angleDegrees:Number, ptRotationPoint:Point) {
      var m:Matrix=ob.transform.matrix;
      m.identity()
      m.tx -= ptRotationPoint.x;
      m.ty -= ptRotationPoint.y;
      m.rotate (angleDegrees*(Math.PI/180));
      m.tx += ptRotationPoint.x;
      m.ty += ptRotationPoint.y;
      ob.transform.matrix=m;
 }