Archive for the ‘General’ Category

Now accepting donations

April 23rd, 2008

Let’s see how much the community likes Castle


Categories: General | Top Of Page | 9 Comments » |

In vacation

April 17th, 2008

So my vacation was divided in two pieces this year. First I drove north, about 700km, to the country-side of Minas Gerais. Fantastic lakes and waterfalls. Awesome cuisine especially if you like fish.

Then I work for more two weeks on donjon, and began the second part of the vacation, driving way south – 1200km – to Gramado and Canela. So frigging cold here that you would believe it’s Brazil! Excellent cities, if you like warm clothes and chocolates you will be delighted — awful restaurants, though. On my way there I made a quick stop on Florianopolis — whatta beautiful city! Seriously, I’m considering moving there!

Gonna drive home tomorrow, felling refreshed. There a few dozens patches to be reviewed and applied to castle, and hundreds of unread e-mail waiting for me :-)

Categories: General | Top Of Page | 6 Comments » |

Painful Windows Mobile experience

March 18th, 2008

One piece of the app we’re working on needs to be accessed from hand helds. No problem, right? It’s just a different view rendered to the mobile devices. JS, ajax should work as it is. Right? RIGHT?

Wrong. While I’ve read that IE has some Ajax support, I couldn’t make it work. This discussion set my expectation low. So, I downloaded Opera Mobile and wow, what a difference. Even the form validation using the Validation plug in worked. Still no Ajax. Just a few tweaks, right?

Wrong again. The jquery code that creates the XMLHttpRequest fails miserably on Opera. What is worst is that you have no clue of what is failing. No tooling, nothing even remotely similar to Firebug. So add try catches everywhere and prepare your patience.

To cut a long story short, I changed the code on jQuery source code – argh! – but got the XMLHttpRequest working. Just the first request went through, though. That one was easy: caching.

If you’re using MonoRail, all you have to do is:

[Cache(HttpCacheability.NoCache)]
public void YourAction()
{
}

and you’re done.

Requests are going through. No parameters, though. The request.send(“value=something”) doesn’t seem to work. Ok, to fix it make the parameters go through the URL. Ugly!!! But works.

Next problem, and the most involved one. My action returns JSON data:

firebug.png

And that’s what I got on the device:

badmobile.png

Beautiful, isn’t it? My first guess: encoding problem.

I reviewed MonoRail and Newtonsoft.Json’s code almost a hundred times. No encoding relevant code. The response was set to utf-8. Decided to inspect the response’s content type. By default MonoRail’s JSONReturnBinder returns application/json, text/javascript which is right. Commented that line. Result:

expected.png

Opera mobile seems to not associate that content type with anything, so it falls back to binary (!!!). Had to add the following hack to MonoRail’s JSONReturnBinder:

if (userAgent != null && userAgent.IndexOf("Windows CE") == -1)
{
    response.ContentType = "application/json, text/javascript";
}

Sometimes I love being a web developer… :-(

donjon – status update

March 14th, 2008

Yeah, so what’s donjon? You’ll soon know. We’re working on it on our spare time, and facing several interesting challenges. The challenges come from the fact that donjon, whilst has a well defined target, is totally modular. It’s a platform, if you will. All the functionality come from modules, and these modules need to interact while knowing nothing about each other.

That’s is a challenge in several levels. It forces us to take loose coupled architecture to the next level. Imposes several UI “problems”. And at the same time we cannot sacrifice anything on how the user interacts with the application.

Donjon’s main goal is to be stupidly simple – but not simplest – with a UI usability that is just not offered by our competitors – they think like programmers!. I believe this pretty much depicts what I’m talking about.

Categories: General | Top Of Page | 12 Comments » |

Book deals?

March 7th, 2008

There’s this Canadian guy (nothing against Canadians) who was kind enough to label me as a bitter, jealous, open source developer aching for a book deal, and that was the motivation behind some posts.

Huh?

I don’t think I own explanation to anyone, but in case you, one of the five readers of this blog, are wondering, during the past two years I was approach by O’Reilly, Wrox, Apress, and Manning to write a book about Castle. Manning almost convinced me using something like “we craft a few books per year”. But really, I wrote a book before. It doesn’t pay off financially. The percentages paid are ridiculous if you consider that you did the hard work. They just put it in a nice cover and distributed it.

So I declined Manning’s offer as well. If there ever will be a book about Castle, it would be a pdf to sell online. Comparing with what’s happening with the music industry and you can see a trend.

Thanks goodness though that labeling, using flickr pictures to ridiculer someone or to sustain your “strong argumentation”, and all acts like those ones are still the exception on the .Net world, that from my perspective is still healthier than Java and even Ruby communities. Hopefully it will stay like that, despite the “non-technical” content.

For the records, the previous two posts about some people came to question their technical abilities. It’s something to make people think. For someone that is promising to show me “the right way to build apps” it’s natural wanting to know more about him/them before giving thumbs up, sitting on a chair and wait for the enlightenment.

Let’s evangelize good architecture, everyone!

February 26th, 2008

Yeah, and by that I mean that you shouldn’t publish bad code. And if you do, dont forget to mention that this is just example code, and you’d do it differently in a real world app.

Not following? Let’s get practical:

[ControllerAction]
public void Find(string query, string format)
{ 
     var flickr = new Flickr(ConfigurationManager.AppSettings["flickr.api.key"]);
     var photos = flickr.PhotosSearch(query, TagMode.AnyTag, query, 40, 1);

     ViewData["query"] = query;
     ViewData["photos"] = photos;

     RenderView("results");
}

Nothing wrong with this code? Easily testable? No tight coupled dependencies? How would you test it?

Categories: General | Top Of Page | 25 Comments » |

Yeah, right

February 25th, 2008

Quote from Pallermo

I don’t consider myself as an evangelist of the ASP.NET MVC Framework. I’m an evangelism of good architecture, test coverage and maintainability.

Castle’s mission which is untouched since the project started back in 2004:

To provide a simple set of tools to speed up the development of common enterprise and web applications while promoting good architecture.

Funny enough, Pallermo never seem to care about Castle. Suddenly he – and others – became the world’s expert in MVC, testability, maintainability and good architecture. I wonder, what have been using to develop web apps before the ASP.Net MVC? WebForms? If so, I’m not that keen to believe that they are what they claim.

Categories: General, wtf? | Top Of Page | 18 Comments » |

MS Pex

February 19th, 2008

The intention might be good, but IMHO a computer will never replace a human for some things.

http://research.microsoft.com/pex/

Categories: General | Top Of Page | 9 Comments » |

BumpTop

February 11th, 2008

I’m speechless.

Categories: General | Top Of Page | 4 Comments » |

Airplanes and airports

February 5th, 2008

So, it’s 3:05 PM and my plane should have taken off by noon. It didn’t. We boarded, we settled, we fastened our seat belts. Then something brakes and they try to fix it.

One hour later and they identify the part that needs replacement.

Two hours later and they “gently” ask us to leave the plane and wait for further instructions on the gate.

Now, three hours later they said they are going to have a position in half an hour.

Gotta love these modern times!

Update: they said they have fixed it. I hope it’s nothing like those developers fixes, you know? When it’s a Friday afternoon and the fix is required to allow you to leave the office.

Categories: General | Top Of Page | No Comments » |