- Posted by azazeal on April 8, 2010
- Kick it! |
Bold words, wouldn’t you say? But that’s the case for me and I’ll try to explain.
It was less than a month ago that I quit my job in pursuit of what we (developers) define as programmer happiness: working your way, in your own time, under your own name with the tools that you (and you alone) choose to work with.
The time had come for me to start something of my own... and relatively fast, without investing a small fortune in hardware and software, so Google App Engine was an obvious choice. Problem was I didn't speak Python and Java didn't fit my definition of happiness but I was determined to deploy on App Engine and so I searched for another language that I could utilize on Google App Engine.
A little while ago I had discovered a *gem* in the GAE ecosystem: appengine-jruby, that could allow me to use Ruby – a language that I could see my self writing - with Rails or Sinatra. At that point in time appengine-jruby for Rails wasn’t a viable option (you could indeed write your Rails app and deploy it, but 99% of the time it wouldn’t go live because of spin-up issues, caused by the fact that Rails needed a solid 30+ seconds in order to start which resulted to GAE throwing a beautiful Deadline exception in your face) and on the other hand Sinatra didn’t meet my expectations for a web app framework.
But I’ve wanted to use Ruby on Rails for a long time (I felt pretty strong about using Rails, mostly because I was curious whether it could deliver what it promised) and there I was, having found my platform (GAE) and a ninja/hack-ish/don’t-do-it-at-home-you’ll-get-hurt kind of way, that no one else seemed to believe that was production ready.
Now… I’m not a code ninja. I don’t wear a black belt and use a Katana keyboard but since I was determined to have an app up and running in less than 30 days, I had to learn a new framework (Rails), write my first app, test it, deploy it to a platform that didn’t support it out-of-the-box, advertise it and someplace along the way try to make some money out of it.
Sadly, I lost the first 15 days of that 30 day time span and along with them my *research* time. Which was a good thing as if I had started trying to figure everything out, it’s possible that I would have abandoned the whole Rails on GAE idea, as everything seemed not to be ready for production and I really had to get my hands dirty in order to fix things that usually no one has to.
So what I did was this: Went to http://rails-depot.appspot.com/, followed the guide and started a new Rails project. I had the the alpha release ready by 26/3 (the rails spin-up issue was manageable by then with a 20 LOC patch that anyone can find on the jruby-appengine community – yeah I got lucky). The release version was up and running by 29/3.
All I invested in this app was time, nothing more, and frankly I don’t see myself writing anything other than Rails and deploying to no place other than Google App Engine for all of my personal projects.
Sure I’m a solid .Net developer with extensive background in that, and perhaps that’s the way I’ll keep paying my bills in the near future, but writing Rails and jumping on the jruby-appengine wagon so much early in the game, is something that has changed my perspective on a large number of issues. I got an app up and running in less than 15 days, on a cloud computing system offered to me for free by one of the world’s leading IT companies.
This seems like an awfully long blog post but I had to get it out of my system. Get it out to you and hope that you’ll consider using Ruby+GAE for your next project. Sure the community and the software are still immature but we are building strength in numbers day by day, patching things along the way and making this platform a solid and viable option for any project no matter how big or small.
about the app – taxster.gr
You can find the mentioned app at taxster.gr.
It’s a receipt management application for Greek tax payers. Our parliament passed a law that makes us gather all the receipts we get throughout the year and submit them to the IRS. The purpose of the app is to offer a simple solution to managing your bundle of receipts, with reporting, analytics and export capabilities in various formats.
- Posted by azazeal on March 11, 2010
- Kick it! |
If anyone's trying to make a consumer work under jruby and GAE then perhaps you'll find this helpful.
Cya around.
- Posted by azazeal on June 3, 2009
- Kick it! |
What I’ve been working on for the last four months
The last four months I’ve been the main developer / architect of a medical project called Maternal PRO, a documentation system for Gynecology and obstetrics which was presented at the 11th Gynecology Conference at the Hilton hotel in Athens, Greece from 28/5/2009 to 31/5/2009.
Maternal was built on .Net Framework 3.5 SP1, it’s database agnostic(single user version uses a Sql Server 2005/2008 Express database with a Linq2Sql database layer) and has a 100% WPF UI.
How did I end up developing Maternal
Right after the start of 2009 (and a very successful past year) I was trying to establish my place somewhat more as a freelancer in the Greek IT market so I ended up writing a tech CV and sending it to the HR departments of some companies. One of those companies was NOON. After the initial interview I immediately started working for them on the project.
NOON is really a cool place to work. Developers do have the flexibility to choose the tools they need in order to perform specific tasks and we also have the flexibility to try out cool new technologies (like WPF and Silverlight) and integrate them into our projects.
We are not a Microsoft oriented company. My department might be but there are people here working with Java (mobile applications like Gynofone – which is like a Maternal lite version for Java based phones), others that work with Flash. We even have COBOL & PHP developers.
What the future looks like
Maternal was my first project while working for NOON. It’s left a bittersweet taste because of the pressed deadline but I’m happy to have worked on it: I’m happy to have architected it and I’m proud to say that I did.
In the near future I might start developing a WPF Reporting engine. An end-user reporting toolkit that can be bundled with any .Net application that will be dependent on the business layer of the application and not the data repository.
I’m eager to start working on this project, I’ve been thinking of ways to develop it for the last 2-3 years and I might even start working on .Net 4.0 on that project.
So, that’s what’s been going on lately, that’s why the blog is not getting updated as much as I’d like and that’s what’s going to happen (hopefully) in the near future.
Write to you later,
- Posted by azazeal on March 26, 2009
- Kick it! |
It’s been ages since the last post on my blog. The reason for that misfortune is that I took on a project for a new client that is really time-consuming and has an impossible deadline. That’s the bad news.
The good news is that the project I’m working on got me in the beautiful world of WPF (finally). I know that the majority of developers aren’t convinced that WPF makes sense yet but what I realized in the past 3 months that I’ve been intensely working with it, is that WPF can be a life saver!
Right after April (that’s when my part in the project will be complete) I’ll make a strong comeback with blog posts. I’ve already made my mind on the post subjects and boy-oh-boy-do-I-have-material-to-work-with!
I won’t go into much detail now but you should be expecting posts on ASP.NET MVC, WPF (although not an expert I’ve found some tricks that could make your life easier) and LINQ & Entity Framework.
Till then,
Keep coding
- Posted by azazeal on January 9, 2009
- Kick it! |
Recently I uploaded one of my web apps to Windows Azure. After the publish everything seemed to work alright but the next day, when I tried to view the app, it wouldn't start. I got some weird page null error and nothing else.
step 0: what makes sense
My first guess was that I had done something wrong, that some sort of exception was being thrown that Azure wouldn't let me see but after reviewing the logs I realized that no exceptions whatsoever had occurred.
step 1: what doesn't make sense
Since the above scenario wasn't the case and since the only reasonable explanation I could think of was that the web app after it's first stop (like regular IIS web apps stop after some period of inactivity) wouldn't start again (for some peculiar reason).
step 2: the solution
The solution (that seems to work for me) is simple and took just 17 or so lines of code: I added a new Worker Role to the solution that every minute makes a HttpWebRequest to the applications index page making sure that the app never stops because of inactivity.
This is the code I used:
public override void Start( )
{
RoleManager.WriteToLog( "Information", "Worker Process entry point called." );
while ( true )
{
RoleManager.WriteToLog( "Information", "Working" );
try
{
HttpWebRequest rq = HttpWebRequest.Create("http://path/to/your/web/root" ) as HttpWebRequest;
WebResponse rs = rq.GetResponse( );
rs.Close( );
}
catch ( Exception )
{
RoleManager.WriteToLog( "Information", "Could not reach http://path/to/your/web/root" );
}
RoleManager.WriteToLog( "Information", "Sleeping" );
Thread.Sleep( 60000 );
}
}
If you are experiencing similar problems I hope this may be of use to you.
- Posted by azazeal on January 9, 2009
- Kick it! |
Today I had one of those new iMacs sent to me from a friend in order to repair something that didn't really need any fixing (I know, Macs never need fixing).
Anyway, as I'm going to have the Mac at my place for today and tomorrow, I started *using* it for more than text and photo editing so I got TextMate working, MySql up and Rails (Ruby is pre-installed so just gem install rails --include dependencies) and I started creating a new rails project.
I knew TextMate is a powerful development utility (more like a dev Swiss knife) since I've used it more than occasionally in the past I never developed any rails projects with it and what hit me at the time was how fast the whole thing started to come alive.
TextMate + Rails seems like a perfect match to me no matter what others may have to say, not to mention the Mac eye-candy that really makes my day whenever I happen to use one.
Two to three hours after that I found myself surfing a local e-commerce site (Greece doesn't have a big market for Macs - cry :() trying to find out how much would it cost me to get one for myself and believe me when I say that the "Express Checkout" button seemed really sexy at that point.
Despite the fact I didn't buy a Mac for myself (yet), days like these make me wonder: "Why oh why don't we (Greeks) have a development market in which Macs could be an option for our workstations?".
- Posted by azazeal on December 31, 2008
- Kick it! |
In a few hours we'll say goodbye to 2008 and welcome 2009 and everyone all around the globe seems anxious to experience the first moments of 2009 in the best possible way.
There are those amongst us that have declared their new year's resolutions and others that haven't yet but what strikes me in this moments of joy is that there are some of us who won't have a chance to do so or won't even bother.
As we are all going to pay our respects to 2008 and celebrate the birth of the new year there are people getting bombed, people who are starving and people who have absolutely no clue on how they are going to survive one more year.
My hopes are high for 2009... My hopes are sky-high but hopes are just that: "the general feeling that some desire will be fulfilled". They are just a feeling. Hoping without working towards what you aim for never got anyone where they needed to be.
2009 smells of change: Change in politics, change in economics, change even in the way we change things and our world desperately needs to change but not (once again) for the worst but for the better.
May the new year bring you what 2008 wouldn't. May health, joy and love come to you in a way you never before imagined that could exist and may 2009 be the best year of your life yet.
Happy new year!
- Posted by azazeal on December 3, 2008
- Kick it! |
Having Sql Server Compact 3.5 SP1 embedded in your application for both x32 and x64 systems is really easy and a life saver. I took some screenshots that will guide you through the whole process. Enjoy.
step 0: creating the X86 and AMD64 folders
When your application tries to access Sql Server Compact it first looks whether its dlls exist into the application's directory into 2 specific folders: the X86 and AMD64 folder (for x32 and x64 versions respectively). So, create those 2 folders first.
If your system is x64 and inside the AMD64 folder you've placed the Sql Server Compact dlls then your application will choose that directory by default for you (an easy performance gain).

step 1: adding Sql server compact's dlls to your application
All of the Sql Server Compact Edition components that your application *may* use are defined in 7 dlls that can be found into the Sql Server Compact installation on your development machine (perhaps you can narrow it down to 3-4 dlls depending on what exactly you need from SqlCe but for this example I'll add them all).
In my machine I've installed both the x32 and x64 versions of Sql Server Compact 3.5 so I have all the dlls I need for both platforms.
Bellow can see some screenshots I took while adding the x64 dlls to my project.


The dlls I selected correspond to the x64 version of Sql Server Compact. For the x32 dlls you have to look in the x32 program files folder.
After adding the dlls to your project it's important to select them again and set the "Build Action" to "Content" and the "Copy to Output" property to "Copy always" or "Copy if newer" so that these files are indeed copied to the application directory.

Repeat the above steps but this time place the dlls into the X86 folder and get them from the x32 installation directory of Sql Server Compact.
Last but not least, we have to add the first (and only) reference to our project for System.Data.SqlServerCe and set its "Copy Local" property to "True".

That's it. The last screenshot is what the complete project looks like (with all the references).

Last minute note: If you are using ClickOnce, remember to remove the pre-requisite for Sql Server Compact before you deploy, if you leave that single checkbox checked you defeat the purpose of having Sql Server Compact embedded to your app.
Keep coding and If I don't post anything more till the new year:
"May 2009 be what 2008 wasn't"
- Posted by azazeal on November 20, 2008
- Kick it! |
I'll post a couple of method extensions I often use in my projects:
The first one is a function that, given a byte array, converts it to a string hex representation and the second transforms a hex representation string to it's original byte array.
public static string ToHexString( this byte[] bytes )
{
if ( bytes == null ) return ( string )null;
string ret = string.Empty;
foreach ( byte b in bytes )
ret += b.ToString( "x2" );
return ret;
}
public static byte[] ToHexArray( this string str )
{
if ( string.IsNullOrEmpty( str ) )
return new byte[] { };
if ( str.Length % 2 != 0 )
return new byte[] { };
int byteLength = str.Length / 2;
byte[] ret = new byte[byteLength];
int j = 0;
for ( int i = 0; i < str.Length; i += 2 )
{
string hex = str.Substring( i, 2 );
ret[j] = byte.Parse( hex, System.Globalization.NumberStyles.HexNumber );
j++;
}
return ret;
}
Now that I think of it I'll post also a third method extension that determines whether a string is indeed a hex representation.
public static bool IsValidHexString( this string str )
{
if ( string.IsNullOrEmpty( str ) ) return false;
if ( string.Length % 2 != 0)
return false;
string map = "0123456789abcdef";
foreach ( char c in str.ToLower( ) )
if ( !map.Contains( c ) )
return false;
return true;
}
I really hope these 3 extensions will be of use to you one day :)
Till the next post, keep coding.
- Posted by azazeal on November 13, 2008
- Kick it! |
Blizzard's second World Of WarCraft expansion pack, Wrath of the Lich King, reached it's release date. Indeed it's the thirteenth day of November 2008 and all around the globe the noise has already started as millions of active subscribers will rush to the nearest retail store to buy the new expansion.
I myself am a former World Of WarCraft player. I've been a WoW player since the beta and it wasn't until recently that I decided to stop playing but the scent of this day, the aroma of the anxiety make me remember past glories in nostalgia.
World of WarCraft is the phenomenon of our time: The first MMORPG that captured more than 10 million subscribers (or is it 11 by now?), a game with a community that never seizes to amaze me and a game that brought people from all around the globe together.
Having said that, I'd like to congratulate every single Wrath player and wish them good luck in their new adventures in Wrath of the Lich King.