To i++ or to ++i…

Ξ April 25th, 2009 | → 0 Comments |
Programming |, , , |

The question is very simple. When writing a for loop, such as the following one

for( int i = 0; i < 10, /* increment i */ )

Between i++ or ++i, which increment operator would you use? Why?

If you choose the answer “It’s the same! Both increment i.“, or if your answer was “I have always used i++, because /* some place ulterior reason here, like ‘I’m programming in c++ and not in ++c’ */“, then your might thing improving your c++ knowledge a little bit. :-)

I just learned it myself, so I’ll share. In fact, it’s so simple it makes me wonder how many of these small details are missed every time my C++ source code lines are incremented. The best increment operator to be used in the pre-increment.

Why? Because it avoids the creation of a temporary variable. Post-increment (i++) has to create a temporary variable to store the return result (that you won’t be using), while incrementing this as expected. Pre-increment simply increments the value of this and returns.

So, systematically using ++i, instead of i++, should improve your runtime performance - even if so slightly.

 

Mind-mapping: Improving organization skills

Ξ April 16th, 2009 | → 2 Comments |
Skills |, , , |

Personal skills improvement is a permanent goal for me. A while ago, as a result of a self-evaluation meeting, the goal of improving my organization was suggested when I stated that handling simultaneous tasks was something hard for me to do.

I tried several approaches to improve these skills, but none of them proved to be successful until I adopted Mind-mapping as an organization tool.
For those who are not familiar with the notion, a mindmap is a simple diagram in which ideas or concepts are balloons connected to each other, representing the connection between  similar or related ideas.

freemind, my favorite mind-mapping tool, is used for managing my daily tasks and I don’t forget a meeting, appointment, task or any of those dangling “to dos” for more than a month.

I’m glad I improved a little…

 

Daily Cartoons

Ξ April 15th, 2009 | → 0 Comments |
Cartoon |, , , |

I like to pass through my list of daily cartoons if not daily them at least a couple of time a week. Most of them are subscribed via RSS which allows me to visit them very quickly.
But given some free time, my curiosity makes me visit the original sites of my favorites. Looking at the huge amount of merchandising available makes me think if I should buy some of novelty item. This would somehow show my support to what I consider to be an art form.

One of my favorites is John and John, and it’s very sex explicit jokes. I’m wondering if I could buy a t-shirt with the following cartoon, and wear it to work one of these days!


(All credits to d!l)

 

Blog About…

Ξ April 10th, 2009 | → 0 Comments |
Uncategorized |, , , |

I’m a Gmail user, and only use other mail servers for work purposes because it’s company policy. My messages tend to be neatly tagged before being archived, but there are always a couple of them that just seem to stay in the Inbox forever. Some of them are already tagged and ready to go, but they seem to escape… for some reason.

One of the reasons relates to the existence of a special tag. When something interesting to write about arrives it is tagged with the ‘blogabout‘ tag. In order to archive all the ‘blogabout‘ messages here some links to their content. Hope you enjoy it.

- Profiteroles: A recipe for a marvelous desert… from a worth following portuguese recipes blog.

- 100 Questions: From a very interesting blog that I follow on a daily basis.

- Smarter Men Have More Sperm: … sometimes I wonder if all science is good science. Obviously I’m a nearsighted person, without a long run vision of science, but can someone tell me where is the importance of studying the relation between the amount of sperm produced by a man and his intelligence.

 

Minimal Firefox

Ξ April 8th, 2009 | → 0 Comments |
Tools |, , , |

When using a small 10” screen all pixels need to be put to good use. Considering that Firefox is one of the ‘always on’ application, gaining some extra space there would be great. Here are some optimizations to display I put together.

The first step is to install a Human Compact theme which will provide your system a compact feeling.

The second step is directed to Firefox itself, and goes by editing the userChrome.css file stored in your ~/.mozilla/firefox/profile/chrome/. Just replace or concatenate my userChrome.css to the existing file, to get a even more compact Firefox…

Please note the lack of drop markers beside each bookmark, the compact width of bookmarks, and max height for each tab was lower to minimal. More optimizations are possible, just consult this link.

 

Costumizing XEmacs

Ξ April 7th, 2009 | → 1 Comments |
Tools |, , , |

I like to use XEmacs [version 21.4.21; August 2008] for my every day tasks, including for development related tasks such as coding or debugging. All Emacs family (including XEmacs) of editor is highly configurable. For XEmacs, editing the contents of ~/.xemacs can transform the editor into anything that one may wish.

A while ago I found some very good XEmacs tips. Building on these initial tips, with knowledge collected randomly on the web I created my own configuration for one of the best editors ever. Download my ~/.xemacs directory content, and try it for your self.

 

Tools, tools and more tools

Ξ April 5th, 2009 | → 0 Comments |
Tools |, , |


credit: tanakawho

The other day I exchanged a couple emails with two friends (him and him) about development tools. That made me think about those other development tools that end-up being use once every two or three months:

  • valgrind suite is composed of some awesome tool, the ones that I use more are memcheck and callgrind,
  • ldd is very useful to understand what library you are missing
  • xmllint is perfect to do simple XML validations against XSD or DTD
  • tidy is useful to beatify that XML contents that after manual edition tend to get misaligned
  • vimdiff created a dual-panel diff (similar to tkdiff) in a vim environment
  • cut select a range of characters per line (i.e. a column) for a specified file

Some of these and many more where found on a very interesting site (which I use regularly) called Command-line-fu.

 

Satisfaction

Ξ April 5th, 2009 | → 0 Comments |
Complaints, Work |, , |


credit: ammanteufel

My last post here was almost three weeks ago. Since that last post, things didn’t went along as expected. Career meetings were help during the last week of April, and the results were not as I expected. For the first time since joining the company, I felt that I had to do something…

The first thing I did was not to explode! I decided to “count to 10″ and think through my possible actions. The next step was start writing a letter explaining with my satisfaction regarding my job and future prospects had dropped so low. A two page letter has sent on last Friday to my boss… His way of approaching the issue was the expected calling to a private talk. I was congratulated for my “very professional attitude” and some actions were agreed to try mitigate the current dissatisfaction.

I’ll be watching the results of such actions and if in three months there’s still nothing to be seen… I’ll have to sit down again and think about my options.

 

On the nightstand...


    The Art of Agile Development


    Beautiful Architecture


    Modern C++ Design


    Large Scale C++ Software Design

Personal

Friends


Interesting


Shared Readings