Feeds:
Posts
Comments

Archive for November, 2009

There are several programming techniques to avoid bugs in our programs, the problem is no one uses them!

Seriously, I don’t know of any programming technique that keeps you from adding some bugs here or there in your programs, regardless of the programming language, the programming platform or environment, or even the programming methodology or practices you are using. The only one “technique” I know of, and I use to rely on it a lot, to avoid bugs in my programs or pieces of code is careful attention, and tons and tons of tests before actually letting it go. I usually don’t trust computers, even my own code, until I see it working right for the most part or for 99% of the time. And if I understand correctly, there is only one way of producing 100% bug free code…. Not writing it.

Below is a link to a post from Wil Shipley’s blog at Blogger.com where he discusses some programming tips for young and not so young programmers about how we should code when we want to code something. Just to give you a taste of what he says:

“Think first. Think some more. Think about the whole problem. Think about a little part of the problem you’re going to start with. Think about the whole thing again, in relation to your idea on the starting point.”

If you noticed, there is not one line of  code written yet. Give it a read, it is really good and highly recommended.

http://wilshipley.com/blog/2005/02/free-programming-tips-are-worth-every.html

Since there’s no way to have programs without writing code, one good way to avoid bugs is to pay attention to whatever code we are writing, as well as verifying our code by letting others see it or review it. Although there is no warranty, this method has worked very well for me in the past. There’s no such thing as avoiding bugs by not writing any code.

Questo, que lotro…, salud!


Advertisements

Read Full Post »

I don’t know what thinking long and hard is but, thinking long and hard is not for chess, and less when playing in a torunament game where you only have sixty minutes for the entire game. What we need is thinking right, specific, and very concrete things. When playing in a torunament game we don’t have all the time in the world to find our next move; we need to efficiently use our thinking time to come up with a good strong or solid move. The truth is that it is only a number of specific things we’ve got to think during a tournament game. I’m not attempting to describe or explain a thought process during a game, or how you should think about finding a move, that’s a separate story; I’m not describing all the elements and skills involved to evaluate a position either, that’s another separate story. What I’m trying to lay out is “what” things we need to think about to play chess and come up with our move.

Let me make an analogy with swimming; if you want to go swimming, assuming you have a place to go, you need a swimming suit (very much mandatory), sandals or flip-flops, goggles, and a towel, that’s it. Now you are good to go to a great diving experience, assuming you know how to swim.

Contrasts

Contrasts

What are those things in chess?

Check mate: We want to think about check mate. What… We want to avoid check mate to our king; we want to make sure we are not being mated next move; we want to get closer to check mate our opponent’s king.

Threats and tactics: We want to find/resolve/meet all those immediate threats and tactics if we want to push the balance in our favor; not and easy thing to master.

A game plan (which can/should change as the game progresses): If you know the answer to “what to do?” in a given position then you’ve got a plan. Right or wrong, we’ve got to find a game plan. It is better to have a wrong plan than having no plan at all. Usually, when we know what to do in a given position, our next moves will come easy to our mind. I believe it is very much in the answer to this question “what to do” what makes chess a very challenging game and often times very difficult to play well. I believe it is in the answer to this question “what to do” that we set ourselves to learn about all those positional elements (static or dynamic) about chess, like initiative, pawn structure, weak pawns, bishop pair, weak squares, development advantage, material advantage, king safety, space advantage, and many others.

Sure you can study, learn, and better understand all those positional elements, so that you can come up with a stronger move or plan faster, and eventually become a stronger player. However, if you want to play a chess tournament game fairly well you need to think of these three specific things and in a reasonable amount of time (and usually for both sides), check mate, threats and tactics, and the game plan, they are very much present in all stages of the game, in the opening, during the middle game, and in the end game.

Is it ‘thinking hard’ putting our head hard when we are thinking? I don’t know. Is it ‘thinking long’ thinking for an hour not knowing what we are thinking about? I can’t do it.

I don’t know what thinking long and hard is but, I know I can think of specific things for a limited amount of time.

Questo, que lotro.. salud!.

Read Full Post »

Most anyone knows that check mate is the primary goal in chess and that check mate ends the game. But only very few players understand check mate. There is a big difference between knowing something and understanding it. What? Yes, knowing something does not necessarily mean we understand it, and I’m not getting into any philosophical discussion about these two concepts; you can find better sources for that.

Check mate is one of the many elements of chess that we fight or play for. He who delivers check mate wins the game and the game ends; that’s usually one of our first lessons in chess. So far so good. However, what we are not specifically told is that “he who first delivers check mate wins the game“. Or if we are told about that we don’t get to understand it completely. And it makes a big difference in our subsequent knowledge and understanding of the game.

Sunset in Frankfort

Sunset in Frankfort

By making emphasis in that particular quality “who first delivers” we add a sense of urgency when we play a chess game. We start knowing that, in some way, the game is a race, and then to understand why it is important not to waste time playing moves that won’t get us closer to delivering check mate. Yes, that’s what we want in a chess game…. to be first delivering check mate.

Not only is check mate an important element of the game, it is also an element of force. What? Yes, check mate, or better yet, the event of check-matting our opponent is an element we can use to force our opponent to do specific moves or to limit his choices. In chess that is called check mate threat. The check mate threat is so powerful, our opponent has no other choice but to defend against it, if he doesn’t want to loose the game, or we will otherwise deliver check mate on the next move.

Chess Grand Masters understand this element very well and at Grand Master play check mate is a critical element of success. If we want to become stronger chess players we want to know and understand that a check mate threat forces our opponent and that he who first delivers check mate wins the game.

Questo que lotro…, salud!

Read Full Post »

This photo is another one of my master pieces and no, it is not in Rio de Janeiro, it is Fort Lauderdale. We can start training ourselves for the heat though, by visiting Florida before we fly to Rio de Janeiro Brasil in 2016.

Come Back

Come Back - Ft Lauderdale

Rio de Janeiro is the host city for the 2016 Olympic and Paralympic Games, and it becomes an excellent opportunity to visit and do so many things there. Just taking photos will be a huge delight for any photographer. Of course it would be wise if we tried some learning of the Portuguese language before taking off, so that we can enjoy and meet with no barriers the warm people of Rio.

There are two excellent places for English or Spanish speakers that wish to learn the Portuguese language without paying for the lessons.

The first one is Tá Falado from the University of Texas at Austin. They introduce you to the different topics in a very easy way through short conversations, so that you understand meaning and pronunciation. They also touch on some cultural differences between the U.S. and Brasil so that we know what to do when we are in Rio (basically relax, dance, and party). To subscribe to Tá Falado podcast click here to open it in iTunes.

The second one teaches Portuguese Brasileiro for English speakers, BrazilianPodClass. This one is also clear and easy to follow with short stories, conversations, and vocabulary pronunciation try outs. Open it in iTunes if you want to subscribe to BrazilianPodClass podcast.

Hope you find these podcasts and the learning experience helpful. We have plenty of time to be well prepared for the 2016 Olympic games. See you there.

Questo que lotro…, salud!

Read Full Post »

Change The Font Size in WordPress.com

Add new post and copy/paste line below in the HTML box of the Edit Post page:

<span style=”font-size:large;”>Start typing here
</span>

Now switch to the Visual box editor and start writing your blog post. That’s it.

As you add lines of text the editor should keep same font size for you. I created this post doing just that.


For instance, as I write this line, I’m adding it at the end after two carriage returns and it preserved the same font size.

I’m not an HTML expert but instead of large, values for the font-size attribute can be given in pixels (px) or points (pt):

<span style=”font-size:14px;”>Start typing here
</span>

<span style=”font-size:14pt;”>Start typing here
</span>

Just specify the size of your preference for font size and your off to a good start. Some other values can be font-size:x-large, font-size:small.

This is a simple no hassle way of choosing font size for your entire post.


Questo que lotro…, salud!

Read Full Post »