Garaje Apps

RSS

Imagemagick, rmagick and OSX mountain lion issue

If you happen to encounter the issue below when installing rmagick in mountain lion, try to reinstall image-magick with the older version 6.7-* that should fix the problem.

brew versions imagemagick
git checkout <old_image_magick_version> /usr/local/Library/Formula/imagemagick.rb
brew install imagemagick
gem install rmagick

Feb 4

C#, Monotouch, Covariants and flawed assumptions.

Last week I was debugging a very stupid C# problem which was related to covariants. The plan was simple, I have a base class which I call DbData, that will be base class for all of my classes that want to be persisted to sqlite. I also created a DataController class that will manage my DbData instances and the Database class that will be responsible for creating my sqlite tables and also would act as the factory for data controller instances. Basically I have the following code under my Database class:

public DataController CreateDataController<T> (IEnumerable enr)
	where T : DbData
{
	var dc = new DataController (enr);
			
	this.DbDataChanged += dc.HandleDbDataChanged;
			
	return dc;
}

However the code below failed to compile with stupid errors complaining about incompatible types:

var notes = Note.QueryAllNotes (); // this will return an IEnumerable

var dc = Database.Main.CreateDataController<Note>  (notes);

I’m pretty sure that IEnumerable is covariant! I checked my favorite reference (C# 4 in a Nutshell by the way) to make sure that I correctly grok covariants. Checked the web,  online forums, programming list and it did confirm that my code should supposedly work.  During all these hiatus I failed (stupidly) to check the source itself or do a “go to declaration” in Monodevelop. So out of frustration I stop coding and went out for a short run. When I went home it hit me the idea that maybe Monotouch does not support covariants yet and sure enough Monodevelop confirmed it!

why you no covariant?

Above you can see that the declaration of IEnumerable is IEnumerable<T> instead of IEnumerable<out T>, if I only I checked it beforehand I wouldn’t have wasted so much time scouting the web for the answer where in fact the answer to my problem was staring me in the face. 

Moral of the story: When in doubt always check the source.

I was so unproductive during the last couple of days, got hit by a flu then followed by a bad cough, it&#8217;s so bad that for almost a week I only managed to sleep 3-4 hours a day, the next morning I felt very tired and disoriented that the energy left (if there&#8217;s any) is only good for my day job coding sprint. I made it a point last year to allocate 2-3 hours per day for my side project which I normally do at night but due to this setback I was not able to do so.  The only activity that I could do at night is light reading/browsing for an hour then go to bed hoping to be able to pull-off an 8 hour rest. So no coding for the last 2 weeks for me.  The good side to all of this was I managed to read Code Complete by Steve McConnell.  It&#8217;s a fantastic book definitely recommended for every software developers. I have heard a lot of good praises for this book that&#8217;s why I bought it last year but did not find time to read it until now.  In addition I managed to play with an obscure text editor that&#8217;s available in plan9 OS - Acme. The difference with other editor is that it&#8217;s not keyboard centric but rather mouse centric so Apple&#8217;s magic mouse is big no no with this editor.  You see text editors is personal obsession of mine. I have tried emacs, vim, textmate, ed, sam, coda, sublime and just recently acme.  All of them have advantages and disadvantages (vim - keyboard movement is king, emacs programmability, etc) but I&#8217;m looking for a text editor that has the movement ability of vim programmability of emacs and mouse savviness of acme. Unfortunately I haven&#8217;t seen it yet.  This might be a good second project for our company but before that will take a rest for a full recovery.

I was so unproductive during the last couple of days, got hit by a flu then followed by a bad cough, it’s so bad that for almost a week I only managed to sleep 3-4 hours a day, the next morning I felt very tired and disoriented that the energy left (if there’s any) is only good for my day job coding sprint. I made it a point last year to allocate 2-3 hours per day for my side project which I normally do at night but due to this setback I was not able to do so.  The only activity that I could do at night is light reading/browsing for an hour then go to bed hoping to be able to pull-off an 8 hour rest. So no coding for the last 2 weeks for me.  

The good side to all of this was I managed to read Code Complete by Steve McConnell.  It’s a fantastic book definitely recommended for every software developers. I have heard a lot of good praises for this book that’s why I bought it last year but did not find time to read it until now.  In addition I managed to play with an obscure text editor that’s available in plan9 OS - Acme. The difference with other editor is that it’s not keyboard centric but rather mouse centric so Apple’s magic mouse is big no no with this editor.  You see text editors is personal obsession of mine. I have tried emacs, vim, textmate, ed, sam, coda, sublime and just recently acme.  All of them have advantages and disadvantages (vim - keyboard movement is king, emacs programmability, etc) but I’m looking for a text editor that has the movement ability of vim programmability of emacs and mouse savviness of acme. Unfortunately I haven’t seen it yet.  This might be a good second project for our company but before that will take a rest for a full recovery.

Jan 7

Welcome to our digital garage!

Welcome to our new blog! New year, new company, new name, new projects and exciting prospects for the coming months.  Last year we first launched our baby iPhone app to the App store, I can’t say that the product is financially successful but personally it was a success, just being able to complete an App on my spare time and release it to the wild is a huge success in itself. We learn a lot on that first experiment, one of them is how we failed as a marketeer, hopefully we will not be repeating the same mistake with our new gig. Why do we need to change our name? Changing a company’s name does not have any significance in getting more customers for your product? I think we started out with a very serious name for a company. I don’t like serious names, at that time I thought it was cool but later changed my mind.  I like a company name that would evoke the feeling of joy + passion on what we are doing and personally Garaje Apps kinda suit’s that name. Small, ambitious, passionate and innovative. We will be posting here updates/announcements to our new products. Hopefully you will like our offerings as much as we enjoy developing it.