msgbartop
Just a little about development! Think before you write!
msgbarbottom

06 Feb 09 Tips And Tricks: Adobe Flex – avoid accessing null objects

One of the many possible ways of iterating over an array in Flex is:

1
2
3
4
5
private function iterateOverArray(arr : Array) : void {
  for(var i : int = 0; i < arr.length; i++){
    doSomethingWith(arr[i]);
  }
}

But this code will cause problems if the Array is null, to avoid this kind of problems you can use the following code instead:

1
2
3
4
5
private function iterateOverArray(arr : Array) : void {
  for each(var o : Object in arr){
    doSomethingWith(o);
  }
}

This way we do not need two variable declarations, and we do not try to read the length of a possible null variable.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

20 Nov 08 Commenting source code is only for the weak

Many of you will probably not agree with me, but if you read all this post, you will probably agree that commenting your source code is a sign that [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

31 Oct 08 Solving the Alzheimer of your PopUpButton

As you can see here, Adobe created a big problem (at least for me) after solving a memory leak problem.
But thanks to Scott Melby at this post, now I [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , ,

12 Jul 08 Unit tests in c++ for a Java GUI

I have worked with C++ in my early days of programming (between 1997 and 2000), but I used to work with Borland C++ Builder and Microsoft Visual C++, in [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , ,

09 Jun 08 GEdit plugin formatting Ruby and ERB code now!

I have published some time ago a GEdit plugin for formatting Ruby code.

Now I just updated the plugin and added support for formatting html.erb and .xml.erb files too.

The main [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , ,

17 May 08 Tired of looking at the console to know if the tests passed or failed?

AutoTest (part of ZenTest suite) is a very useful tool when you are working with Ruby On Rails development, but I always had problems configuring cool notifications for [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , , , ,

04 May 08 GEdit plugin for formatting ruby code

I work with Java for a long time, and I’m used to Eclipse facilities, but to work with ruby on rails I think an IDE is not needed, I [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , ,

01 May 08 Dirty models and partial SQL updates for Rails 2.0.2

First of all, this is not my code, this is just a backport of a Rails EDGE feature to work with Rails 2.0.2 …

I searched through Rails code and [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , , ,

28 Apr 08 Lazy men’s rails plugin – mydry

I have been using this little plugin I wrote for some time now.

The main idea is that I always start working in the migrations, and there I define: not [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , , , ,

22 Apr 08 easyb-test – Grails Tests Made Easy (in a way your boss can read)

Have you ever read about easyb? and about Grails? May be you answer yes to one or both previous questions, but this is the first time you will find [...] Continue Reading…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , , , ,