Wednesday 31 July 2013

ASP.NET MVC 4 and the Web API: Building a REST Service from Start to Finish, by Jamie Kurtz

book cover ASP.NET MVC 4 and the Web API, by Jamie Kurtz, is the one of the new breed of technical books that read like a blog entry, albeit a very long one. The book is merely 100 pages long, but to the point, with links to code on GitHub and references to other resources for details that are not the subject of the book. The principles behind the architecture are discussed, explained, the machine setup is described, the configuration, then bam! all the pieces fit together. Even if I don't agree fully with some of Kurtz's recommendations, I have to admit this is probably a very very useful book.

What is it about? It describes how to create a REST web API, complete with authentication, authorization, logging and unit testing. It discusses ORM (with OData), DI, Source control, the basics of REST and MVC, and all other tools required. But what I believe to be the strength of the approach in the book is the clear separation of modules. One can easily find fault with one of the pieces recommended by the author and just as easily replace only that component, leaving the others as is.

The structure of the book is as follows:
  • Chapter 1 - A quick introduction of ASP.Net MVC4 as a platform for REST services, via the Web API.
  • Chapter 2 - The basics of REST services. There are very subtle points described there, including the correct HTTP codes and headers in the response and discoverability. It also points to prerequisites of your API in order to be called REST, like the REST Maturity Model.
  • Chapter 3 - Modelling of an API. This includes the way URLs are formed, the conventions in use and how the API should look to the client.
  • Chapter 4 - The scaffolding of your Visual Studio project, the logging configuration, the folder structure, the API DTOs.
  • Chapter 5 - Putting components together: configuring NInject, designing your classes with DI and testability in mind.
  • Chapter 6 - Security: really simple implementation with a lot of power provided by the default Microsoft Membership Providers.
  • Chapter 7 - Actually building the API, making some smoke tests, seeing it all work.

The complete source of the project described in the book can be found on GitHub.

My personal opinion of the setup is that, while all seems to fit together, some technologies are a bit over the top. NInject, I had personal experience with it, is very good, but very slow. The ASP.Net Membership scheme is very verbose. While I wouldn't really care about it as implemented in the book, I still cringe at the table names and zillions of columns. Also, I am slightly opposed to ORMs, mostly because they attempt to mould you into a specific frame of thinking, that of CRUD, making any optimization or deviation from the plan rather difficult. I've had the experience of working on a project that had all of its database access in stored procedures. To find what accessed a table and a column was a breeze, without knowing anything about the underlying implementation. But even so, as I was saying above, the fact that the author separates concerns so beautifully makes any component replaceable.

I highly recommend this book, especially now, when the world moves toward HTML and Javascript interfaces built on web APIs.

Sunday 28 July 2013

The Ur-Quan Masters - Star Control 2 for Windows

I have very fond memories of the games Star Control and Star Control 2, played on my PC when I was but a wee boy. They were DOS games released in and , respectively, and were absolutely marvellous: large universes, with many star systems, each of them with planets and moons; many alien species which were strange and funny and obnoxious; storylines that were both absurd and very captivating. I had a great time.

I want to open a parenthesis here and talk about the quality of games back then. Click here to hide the following rant, if you are not in the mood for it. I really have no idea how the PC game market was working in the US, but here in Romania, there were very few PCs, no Internet and the distribution of games (all pirated) was done via friends who would recommend and share what they thought was great. There were no walkthroughs, rarely any printed maps or special instructions (since they were not original games) and the only way to finish up a game was to actually play it. Sometimes it got frustrating enough that after hours of trying to find something, you would call friends and ask them what they did. I can only imagine that even in a country were they were a lot more computers and games were bought, rather than copied, the game play situation was similar. In other words, the relationship to the game played was personal: someone that you know and respect came to you and recommended the game. This was the only thing that made you play it other than seeing the cover in some window and feeling like you have to try it. Also, not having any Internet (or very little on it), you would not have access to many reviews and neither to game updates, if something was wrong in the game. And you also have to think of the state of affairs in software programming: every software firm was basically a gang of enthusiasts inventing and trying their own way in which to build software.

Yet, a lot of the games back then were great. Not all, maybe not most, but certainly the ones reaching me through "the grapevine", probably because the bad ones would be filtered away. One has to ask oneself how games back then required a number of hours of play orders of magnitude larger than present ones. How their stories had the complexity of movie scripts (often a lot better) and so much intricacies like alternate game modes, humour and so on. And the answer is, of course, the Internet. Once the gameplay is too complex, players swarm to online walkthroughs, often in video format, to tell them what to do. Atmospheric gameplay where one has to walk for hours to find something are considered antique and wasteful of time. And of course, if they are not social enough, they aren't even worth playing. The advertising is done via the web, with "stars" or other such whimsical method of rating a game, often resulting in simplistic orgies of graphical design with repetitive action as the only thing to do, humour provided by caricaturesque icons of birds or zombies.

That being said, as a software developer myself, I played The Ur-Quan Masters for only two days, using said walkthroughs and being nagged by the wife and dog for not spending time with them. I also had moments where I cursed the necessity to move towards a planet or a star by actually waiting until the ship got there, and often by manually controlling the craft to reach there. Also very annoying was to manually look for star names, until I downloaded the map from ... the Internet. So I am not just a geezer that hates the new, all melancholic about the past; the present has its boons... few as they are. Anyway, to the game!


The dreaded Ur-Quan and some models of ships in the game In , ten years after its release, the makers of Star Control 2 made released the source of the game as open source. Maybe this should be heeded by other game and software makers: create a copyright licence that voids itself ten years after the release of the software. The world would be a better place! Anyway, some people decided to port that to different platforms, including Windows. Now I know that DOS and Windows are made by the same company and that the port sounds easy, but you should look at the bugs for this port like 'Not thread safe' or 'Not safe for 64 bits' and so on.

Accidentally I found out about this port for Star Control 2, called The Ur-Quan Masters. Why was the name changed? Because even as the source code was free to use, the name was copyrighted. Weird, right? I installed the latest version (0.7.0.1 - you gotta love these open source versions that tend to reach 1.0, but never do - a bunch of perfectionists, all of them :-) ) and I couldn't start it. It threw an error no matter what I did. In their defence, I was trying to play it on an Athlon 2500+ processor running Windows XP (I know, geezer!). But I did manage to install and run version 0.6.2, which seems to be working on my machine. This is part of the motivation for writing this post, since I found no one on the Internet complaining about the same problem as me. I did try all the compatibility modes for it, BTW, and it didn't work. Maybe I should have tried running in Windows 98 (yes, I still have that installed as a secondary OS).

You see, the plot is that you are the descendant of an exploration mission that was never picked up from the planet they were supposed to investigate. They did find an ancient alien starship factory and managed to build just the skeleton of a ship to send you back to Earth to see what had happened. Getting there you find the Earth encased in an impenetrable shield with an orbiting station around it. The crew of the station tell you the story: alien race called the Ur-Quan came for enslaving all sentient races, won the war and gave earthlings two choices (well, actually three, if you consider total annihilation, but let's not get technical): join them as their slaves or relocate all resources to Earth and be trapped under the slave shield. Humans chose the latter. Now, your mission is to find alien races, make them join you in defeating the Ur-Quan and ... well, defeat the Ur-Quan. You have to do that by exploring amongst hundreds of stars, each with their own solar system of planets and moons. You get fuel and extra modules for your ship at the human station, but you need to bring materials (minerals) in order to get them. Minerals are gathered via manual missions to the surface of each planet and moon, while fires, lightning, earthquakes and alien lifeforms are attacking your landers. Aliens are diverse and most very funny: a cowardly race that speak like Italians, an evil spider race, a sexy race called the Syreen, warrior type race (that is weak and stupid), automatic probes that declare their peaceful intentions then attack you, mean spirited aliens that consider all harm done to you as a practical joke and so on. There is even an Emo race, although the term became popular a long time after the release of the game.

Oh, the memories! The vibrating music originally thought for PC speaker or maybe AdLib cards brought back feelings of old. The witty dialogues and the immersive nature of the game made me relive a lot of past pleasures. Unfortunately, as I was saying in the rant above, there was a lot of immersion that I really didn't want, like waiting for minutes to get from a star to another, then manually navigate to reach a planet or moon. I couldn't help thinking as a software developer and consider how I would have done the game - of course, online, in HTML5 and Javascript, and actually it wouldn't be so hard. Playing the game I realised how different the perception of time was then compared to now. It was obscene how much time I had back then, and completely devoid of responsibilities, too.

Well, because of the time constraints I quickly hacked the game, added infinite money and proceeded to finish the game using a map and a walkthrough. I also was unable to finish the game due to two bugs: one where the Spathi should have given me an Umgah Caster and did not, and another where the Mycon were supposed to go to Organon and did not. Even so, it took me two full days, about 16 hours of gameplay. Anyway, I was close to the finish and I did watch the ending on YouTube (how nouveau of me! :-( ) For the people that loved playing this game in the past, maybe you should try it again. Old memories often bring complexity to present perspective. And for those who did not know of this game until this post, maybe you should try it, see what people of old considered a good game, even if they played it on 33Mhz 386 PCs with 4MB of RAM and 120MB hard drives.

Also, there is another attempt for a port to Windows from the same source called Project 6014, for some reason. I think it stalled, but maybe it brings some surprises to the table.

I leave you with a YouTube video gameplay by some guy (frankly the first I did find) if you are unwilling to take the trek yourself.

Thursday 25 July 2013

Ghost in the Shell : Arise

I am a complete fan of the Ghost in the Shell franchise. For those unfortunate enough to not know what that is, it is a series of manga and anime stories that describe a near future where integration with machines is the order of the day, giving rise to cyborg bodies, mind hackers and all that stuff. It is also a police procedural, where the heroes are an independent force designed to counter cyber threats. It is also an espionage thriller, since many of the actions in the stories are not linear, but have many political implications and intricate plots. But what I thought was better than a beautiful and detailed sci-fi world with deep characterization and complex storylines is the exploration of the human soul and mind in a background that is mechanistic and science squeaky clean. To manage to do this repeatedly in manga, films and anime series is truly wonderful.

For me it all started with the movie. With impressive music by Kenji Kawai and a complexity and beauty and care for detail that I had never seen before (and rarely since), Ghost in the Shell blew my mind. Then there was the Ghost in the Shell: Stand Alone Complex, a two season series that went a little more toward the police procedural, but overall was just as wonderful as the film. And then the second film: Innocence. And now they made Ghost in the Shell: Arise, a four part OVA series, prequel to the film. Having seen the first one hour part, I can say I am very pleased and can't wait to see the entire series. It details the roots of major Kusanagi and what are the roots of her team. Very nice indeed. The only thing that I miss is Kenji Kawai's music.

I leave you with the trailer for the series and my recommendation to see all of the Ghost in the Shell animes, even the Tachicoma OVAs :)



Update September 2014: I've watched the entire series. The episodes are almost stand alone and totally worth watching. I liked the fourth one most, as it was clearly created to made the connection with the film and series. I loved the small tips of the hat to hallmark scenes in the film: the cloaked jump from a skyscraper, the destruction of the cyber hands while pulling on the lid of a battle tank and so on. Does that mean that a new series and/or film will be created? I certainly hope so. My only problem with the new OVA is that the music of Cornelius is not even close to the haunting quality of Kenji Kawai's.

Wednesday 24 July 2013

World War Z - an Oral History of the Zombie War, by Max Brooks

Book cover Having seen the film, I decided to read the book. Now I can understand why so many people said the film was not like the movie, but also why the film itself seemed so episodic. In a nutshell, World War Z is a collection of more than 50 interviews of witness accounts about a fictional war against the zombies. This makes the only connections between the book and the film be the zombies and the episodic nature of it. In rest the stories are different, the way zombies behave, the take on how humans react and of course the shitty ending.

Now, about the book... It was easy to read, mostly because I could just take the PDA in my hand and read one of those mini stories in 10 minutes and then do whatever I wanted to do. Some of them were really great, too, but after reading the book I think I can safely say that it wasn't about zombies at all. Instead it was about the way people live now and the war was just a prop to make us see things clearly from a different perspective. Of course, some things never change: the great American spirit, the Russian brutality, the narrowmindedness of Asians and so many other clichés. Not that they are not believable, but it so shows that the author is American, even when he makes fun of his own country's flaws. Anyway, I encourage you to see the book as social commentary rather than a zombie or a horror book. That is also because the threat of "regular" zombies - you know, slow and dumb - can't really be that scary. So there are a lot of technical flaws with the zombies in the book. The situations described show the difficulty mainly in fighting millions of city dwellers now turned zombies and the war of attrition that the zombies were actually enabling, since they destroyed everything in their path, yet needed no food or supplies. Also a lot of the stories have this "I don't know why zombies don't die from bombs, water pressure, frosting, etc. I am just a dumb whatever telling a story". At some point it got a little annoying.

The bottom line is that I enjoyed a lot more the personal descriptions of how people live in other countries than the zombies, stories about them or the rather weak speculations on how people would react to their attack. The book was nicely written, but clearly amateurish; it lacked the depth of seasoned writers and had too many "props", like you see in screenplays. No wonder: Max Brooks is the son of Mel Brooks, he lived in the world of movies his entire life and this is only his second book.

Monday 22 July 2013

Mortal Kombat IX vs Injustice - XBox versions

I've had the opportunity to play these games on the work XBox and I just had to make the blog entry to compare them. The thing is that, even if some corporation wants DC Comics and Mortal Kombat to merge somehow, they are completely different both in concept and audience.

I've been a player of Mortal Kombat since it first appeared on PCs. Me and school friends were spending hours playing it (rather than go learn something useful, obviously). Even then - or maybe it is better said that especially then - it was clear that the game had soul, that someone really spent their time and love to make it. No matter who bought it and what they did to it, Mortal Kombat never completely lost that soul. You see, the game idea is clear: two players face each other in combat, they use different characters who have different abilities and in the end someone wins. Unlike other games that start off neutered by the present socio-political situation in the States, MK started off as brutal and bloody. You could use all kinds of magic and utensils to hit your opponent, chained combos and see lots of blood, but the hallmark of the game was that, in the end, after you have defeated your opponent, you had the opportunity to perform a Fatality, something that was truly gruesome like ripping their heads out with a bit of the spine, or cutting them in two or setting them on fire.

Now you will probably ask why has my sick brain made the connection between a brutal combat game and true love and having a soul. The thing is that the first MK started out with 8 characters, plus some bosses and hidden characters, then MKII has twice as that, and the various incarnations of the game saw up to 65 characters. And yet you will be hard pressed to find any major version where a player could not win with any of the characters against any other if they were good enough. That sense of balance shows the dedication of the developer teams that endured the various corporate transformations of Mortal Kombat.

Game cover The ninth version, Mortal Kombat IX, has a lot of characters, over 30, although some are DLC and make little sense in the Mortal Kombat universe, like Freddy Krueger or Kratos. Of course, you had to pay for them. Later on the Komplete Edition of the game had all the characters and all their skins available. Except for a little overpowering of Noob Saibot, MK IX was pretty balanced. The graphics were awesome, truly, and had various fatalities and X-moves - the super move one could execute with three bars of power, which showed anatomical X-ray like details in slow motion like cracked skulls and ribs. The only problem was the controller. I am a PC user and it took a long time to get used with the XBox controller and even more to understand how pressing forward would sometimes make my character jump up and backwards or some other thing like that. I know the controllers at work were pretty messed up, but I swear there had to be something to do with the programming as well. Also, as far as I could see, the game dropped frames. If you moved fast enough, the other player would have difficulty making their special moves, probably because some part of the data or processing was lost. But overall the game was great, the story was nice and the combination of different characters, skins and violence was delicious.

To make the transition easier, I will also mention another game, also featuring Mortal Kombat characters: Mortal Kombat vs. DC Universe. It is an older game, launched in 2009. This weird crossover featured fights between the likes of Raiden and Shang Tsung versus Superman and the Joker. It is the last game made by Midway Games, the creators of Mortal Kombat and the first introduction of the "evil empire": Warner Brothers, who brought with them DC Comics. After that Midway went bankrupt and sold the rights to Mortal Kombat to WB. Mortal Kombat vs. DC Universe had a bit of faux 3D movement, stage transitions (like punching someone through a wall and getting to another stage) and no fatalities. In fact, it had almost no blood, while the "powers" of the MK characters seemed oddly and randomly assigned (Shang Tsung had a punch teleport, Jax had a machine gun, etc). The playability of the game was OKish, with the major problem of in flight hits. One would jump toward an opponent, punch or kick and the character would stop in mid-air and perform the punch or kick there, which made it very unrealistic and static. Also, and that probably made it unpopular in the game room, it was unbalanced. Sonya Blade could kick everybody's ass just by jumping and kicking.

Game cover Enter Injustice: Gods Among Us, a game that is also made by NetherRealm Studios, who made Mortal Kombat IX, and also copyrighted by Warner Brothers. NetherRealm is actually what remains of Midway Games plus what remains of WB Games Chicago. In Injustice there are only DC Comics characters, the graphics are really good, a lot of stage interaction, flashy "social" statistics and "ranking", downloadable characters, obviously, and so on. The game play, though, total crap. Now, I may be very biased when it comes to Mortal Kombat type games, given by all love for the original game and concept, and I also understand that this wasn't supposed to be Mortal Kombat in the first place, but in my mind it represents everything that MK developers and players fought against. First, it has violence, but no blood. You get a lot of punches, kicks, explosions, object traumas like things falling on you, being thrown on you or through you (like arrows), only no blood. There are no parts of the body that get broken or smashed. It's like a good old fashioned cowboy brawl that results in someone saying "awwh, shucks!". Then there is the completely weird system of hits and blocks. You have to press Back to defend up and Down or Back-Down to defend down. Combine that with the fact that jumps are mainly vertical and so do not bring you closer to your opponent than walking, and you get a very asymmetrical game play where range fighters have to just run and shoot, while power characters have to dash a lot through bullets to get to their target. Even so, among similar type of characters there are huge differences. I would say that Deathstroke followed by Aquaman are by far the strongest characters, like lame-ass Green Arrow is a weakling. My favourite, Doomsday, had a lot of problems getting to anyone, even if it was supposed to be indestructible and on par with Superman. Well, they were on par in the game, Superman sucked, too. So: no blood, game imbalance and poor playability when there was obviously a lot of effort put into the shiny aspects of the game.

So you see, I had to write this post. Not because I didn't enjoy playing Injustice or because I think it is a bad game, but because it is like taking a cool 80's horror movie and turning into a 2010 remake that scares no one and can be played in cinemas to children. All Flash and no Meat, so to speak. MK is for gamers while DC games are for kids. All we need now is some Mortal Kombat game with parental controls on it. That being said, I can hardly wait Mortal Kombat 10! I hope they don't mess it up completely. As homework, you should try to read on the history of Mortal Kombat and of Midway Games. It's an interesting read. There was a really nice video with the developers of the first Mortal Kombat telling the story of the inception of the game, but I couldn't find it. Instead I leave you with the komplete :) history of the game from MKSecrets:


Friday 19 July 2013

A Comedy of Errors

Today was my last day at the large corporation I was employed at. I quit for several reasons, but mainly because the project I was working on wasn't challenging at all. So one has to wonder: how did I get to be bored at work when only two years ago I was so happy to be hired by one of the best employers in Bucharest to work on an exciting new project? And the answer is : misrepresentation. I've titled the post thus because I sincerely think very few people, if any, wanted to harm me or lie to me or take advantage of me and yet the thing I was hired for changed and shifted until I became annoying for proposing ways of improving the project and asking for work. Let me take you from the beginning and you will see what I mean.

At the end of March 2011 I was working at a medium sized company, a place where there were some interesting projects, but the work ethic and methodology was really lacking. I had been working there for about two years and I was starting to get annoyed for not getting any recognition in the face of obvious personal improvement. And in my vulnerable state I was head-hunted by a human resources person from this major American corporation who wanted me to work on a project for them. I said I will give it a try, personally believing that I will either not like the place, not like the money or, even more probable, they will not think me worthy of the job. See where I am getting with this? I was already sold on the concept of a new job there and I didn't want to get disappointed, so I was playing down my chances. It seems that, after one telephonic interview, a series of six consecutive face to face interviews and another one with the head of the company, I was good enough for them. All I had to do was negotiate the wage. I was rather disappointed with the way the then current place of employment was handling salary increases (I've gotten only one raise, 2.25% in size, in two years) so I had a sum in mind that I would consider the minimum I would get in the new place of employment. You see, I am not a very good negotiator, I hate haggling, so I just drew a line in the sand and said that no one will push me over it. I was so serious when I went to talk to them... they proposed a sum that was more than 10% higher than what I was willing to fight for. Surprised, I accepted. Now all I had to do is wait for a call to tell me how we would proceed. It was near my birthday and I thought "Wow! What a nice present!".

At this point I'd had contact with the HR girl, who was very nice, been interviewed by a lot of people, both technical and not, also very nice, and even passed by the head honcho of the company who played a little game with me when we met, by pretending to be a very arrogant and annoying person while the top HR specialist was watching me with a stern expression. I am kind of proud of myself to have seen through their ruse, but I think they did try too hard. No one can be such an idiot to consider refactoring useless because you write good code from the beginning, right? Anyway, the guy who was supposed to be manager gave me a call the first week, told me there was some restructuring going on in the company, that we were still on and that I had to wait. He was nice too. He called me every week for about three months to tell me we were still on, while I was sweating bullets because I had already announced in my company that I was going to leave so that they can prepare for my absence, and they were starting to look at me suspiciously: I wasn't going anywhere. At the time my soon to be manager said he was going in holiday and that another guy was going to call me. No one did for more than two weeks. So I called them!

Now, you see, the HR girl was genuinely believing that she would offer me a better job and my prospective manager was also convinced he wanted me in his team and that we would work great together, they all wanted was best for them and me! So imagine my shock when I called and the new guy told me "Oh, you still wanted to get hired? I had understood that you refused the job". No, you moron, I did not. I politely asked for more information only to find out that they had no more positions as full employees, a limitation that had come from the US corporate headquarters, and that they could only offer me a consultancy job. Devastated, I asked what that meant. It meant I didn't get company stock as a bonus, but I was only paid the sum we had already negotiated. I didn't know about employee benefits when I got the job and I didn't really care for them, so I said yes. It was going to be a temporary measure until more hiring positions were opened.

The company had gone through a "reorg" (I was to meet with a lot of new acronyms and made up words in the new job, much to my chagrin - this particular one meant "reorganizing") and I was not to work under the guy who talked to me week to week, but under the new guy, the one that didn't know if I wanted the job or not. But he seemed genuinely nice and motivated, very enthusiastic about the new project, an administration web UI made in ASP.Net MVC. He asked me if I knew anything about the project. I said no. Why would I care about a project if I don't know if I would be hired or not. He seemed disappointed, but proceeded to explain what the project did and how great it was going to be, as it was meant to replace the old thing, made in ASP.Net in Visual Basic... by monkeys.

You see, he had the best of intentions as well, he was technical, willing to create something exciting and challenging and convinced that I would fit in their team and help with this new project made with new technology. When I finally got my hands on code and started actually working, the project was dead in the water. They had decided instead (and by they I mean some schmuck in US, not the people actually working on it) to just refactor the old admin and continue on. Different from what you may think, I was actually excited. In my head I had this tool that I would be working on to transform all VB.Net 2.0 code into C#.Net 4.0, become the hero of all, and create a formal framework of refactoring code from one language to the other. (If you don't know the terms here, just imagine I wanted to replace wood with stone so that the big bad wolf would not blow the house in). Alas, it was not to be. "Too risky" they call it when they feel afraid. I was yet to understand that in a large corporation responsibility dilutes until it becomes nothing. The only tangible thing becomes blame, which replaces responsibility and exterminates creativity and stifles initiative.

You see, like all the actors in this play, I too had good intentions. The first code I wrote was to fix some bugs that I had noticed in a bit of code related to online shopping. The customers had also noticed this bug and had found complex methods to get around it. While my fix solved the initial problem, it also broke any such method and, as I was a rookie in the formal way of doing things in the new company, the fix wasn't even bug free. From that time I was labelled "dangerous", from the initial problems with understanding the project and also my vocal way of expressing what I thought of leaving a project unstructured and buggy. Well, in hindsight, I have to agree that I wouldn't have felt a lot of love for someone calling me an idiot. Even if I were... especially if I were. Anyway, from this little incident you might have already guessed that a complete overhaul of the code (wood to stone) was out of the question. The powers that be had decided that starship Enterprise was to stay home, no bold missions for it.

I could go on with details, but you are probably already bored. Enough to say that I had my first real experience with Scrum there, a way in which all people had a role, each development cycle had phases that were followed in order and documented along the way, a system which, in time, would collect enough statistical data about the team so that it could predict development speed. All it needed for that was a team that would remain constant. Due to repeated reorg-ing my team had never the same structure for more than two or three months. The general (not per project, overall) company policy would shift radically, often completely in the opposite direction, every six months at most. Plans were set in motion, then discarded before reaching anywhere; performance metrics were created to measure project progress, only to be changed at the next strategic hiccup. It was clear that this was going nowhere like that and, instead of changing their way of constantly shivering in fear, they decided to close the project.

Only you see, the project earned money. Not a lot, but enough to count. There are tens of thousands of people paying for the service and hosting sites on it. You can't shut down a project like this. So they invented yet another expression "sustainability mode", to express the way they intended to zombify the project that they had advertised to clients and developers alike like the next cool thing that would solve all problems. I felt cheated and I could only imagine how clients that paid money instead of receiving them felt. There is an expression "the way to Hell is paved with good intentions". All the people - there were 70 developers and testers on the project and God knows how many managers and support staff - had the best intentions. We achieved a highway to Hell. Oh, and by the way, I never really got hired as a full employee. I remained "temporary" a consultant for the full length of my work there.

So what is the outcome of all of this? Two years of my life are gone. I have learned some things, but in the meantime lost a lot of my initial enthusiasm towards development. I stopped reading technical blogs and only spent my days thinking of the tasks ahead, like a good little robot. I've earned a lot more money, many of which I saved in the bank. I gained ten kilos (that's about 20 pounds, for you metrically challenged folk). I almost made my wife divorce me once, but we got over it. I've made some good friends. I learned to play chess a little better. I am not yet sure if the good balances the bad. Now I have found a new job opportunity, one that is even better paid. I only hope it will not be equally as depressing.

Was I wrong to be so optimistic about getting hired, as I am now, I guess, because it led to disappointment? Better to have loved and lost, I say. Were the people that misrepresented themselves and the project I was to work on wrong? I don't think so, I think they were equally optimistic and got equally disappointed. Was it wrong to have better expectations from the world? Prepare for the worst, but expect the best, I say. So yet again, I can't really blame anyone in the Romanian office and it is difficult to point the finger at the guys in the US as well. And yet, this is the result...

Thursday 18 July 2013

Beginning HTML5 and CSS3, by Richard Clark, Oli Studholme, Divya Manian, and Christopher Murphy

Book cover Beginning HTML5 and CSS3 is a strange enough book. It is not a book for beginners, as the title would have you believe, but only something that gives you a taste of new HTML and CSS features. Some of the things discussed are not very thorough, but may be very detailed (like when they talk about a hard to spot bug for a specific browser version). They talk very little of some often used features, but very in detail about something that will probably not be used by many people, like data annotation.

What is immediately obvious, though, is that the authors are professionals with a lot of experience. They see things and think about them in a way that a person with no design experience like myself has never thought about. Their explanations are backed by a lot of links and downloadable code, so it can be used like a reference. I would say that about a third of the book relates to HTML and the last two are about CSS. Awesome and weird things are being discussed, from custom fonts to 3D transforms, from data annotation of any HTML so that is machine parseable (like Google crawlers and such) to pagination control for layouts that need to look like books or be used in e-readers. It is also a modern book, the type that lets you know about various features, but instead of rehashing a subject, they give you a link to more information from someone else.

You can get example code from the book's site, as well as see the table of contents and details about the authors. What immediately jumps into mind is that the page is HTML5 and uses CSS3, but is not nearly as carefully crafted, data annotated or awesome as they advise in the book, which validates a little my view of the book: an interesting book to read about features you will probably rarely use. It certainly made me experiment some with my blog and think of ways of implementing many of the features, but in the end nobody wants something very over the top, so only small changes were made.

Saturday 6 July 2013

How to get Google Alerts in more than one language

There is a Google tool called Google Alerts, which periodically looks for new information based on a query and sends it to you. Until recently I had it all sent on an RSS feed, but Google discontinued that option together with Google Reader (I know, boo!), so now I send it to an email address. Anyway, this article is about news in other languages than the one you select as default. I noticed today that one of the alerts, which contained German words, never returned any news in German, apparently all Google Alerts will show me will be English results. So I looked (on Google, of course) for ways to make the alerts multi language. The short answer is that they were never meant to be so and thus this is a sort of a hack, until they do something about it. Here is how you do it:
  1. Go to google.[your language], for example http://google.ro, for Romanian
  2. Search something there and ignore messages telling you to switch language or translate anything
  3. Go to http://google.[your language]/alerts/manage - note that this will not work over https, like the search. It will return a 404 page if your URL starts with https instead of http
  4. Add your alert (the language of the Alerts page should be the one that you have chosen)
  5. Test that it worked by exporting your alerts and checking the Language column for your alert in the resulting file
  6. Go to step 1 to add another alert in another language

So, in order to make an alert in multiple languages, you must add an alert for each language with the exact query. Well, since they are different languages, probably the query will be different as well, but if you are searching for a name, for example, it will always be the same.
This may work by starting the third step directly. It worked for me, but somebody on a forum said that you should not do that, probably something having to do with Google trying to guess what language should be applied from your location, account information, URL etc.
Also, there are some weird languages that may appear in the alerts file. For example the Italian language is "it-IT", the German is "de-DE", but the Romanian is "en-RO". Now I know a lot of Romanians that use half their words from English in a conversation, but that's not what Google had in mind, I think.