Think In Geek

In geek we trust

programming tips

C#, the “and” operators and lazy evaluation

Today at work we found a bug. My workmate, not used to C#, usually uses the & operator to compare boolean values. However, in C#, the & operator does not use lazy evaluation. One curious thing about C# is that it can use two different operators to calculate an and expression: the & operator and […]

,

Full view of ComboBox drop-down list components in C# 3.0

By default in C# 3.0 ComboBox controls don’t provide support for showing drop-down list items if they exceed the width of their parent ComboBox, like this one: This is annoying because users cannot read properly the information. To solve that problem, all we have to do is derive the ComboBox class and override the DropDown […]

, ,

C# and the StringBuilder class

This morning I was working on a project at work. It’s a Web Application using the ASP .NET 2.0 framework and C# as a code behind language. My friend Ioannis came over to see what was I doing and when he saw I was appending some strings together he asked me this question: “are you […]

, , ,

The Double Check Design Pattern

One of the deficiencies of actual programming languages, specially those ones still widely used that are old, such as C or C++, is that they were designed having in mind the sequential programming paradigm. This usually means that those languages don’t have standard ways to work with multithreading features, and you usually have to rely […]

, ,

Ruby Quiz

Maybe one of the best ways to learn a new programming language is playing with it. Nowadays if you don’t code in Ruby you aren’t cool. I have to recognize that programming in Ruby is funnier than in other language and for the moment I don’t have anything bad to say about it. Well, I […]

,

Customizing IRB

While developing a Ruby application or while learning ruby, one of the things you must use is IRB (interactive ruby). As in its man page is said “irb is a tool to execute interactively ruby expressions read from stdin.”. In this tool you can type and execute directly ruby code. It’s very useful but like […]

, ,

Code Snippets in Visual Studio 2005

In the developing process of applications that are not as small as the typical “Hello, World!” examples, there are a variety of factors than can lead to important time savings. There’s a lot of documentation out there on how to design and specify application before the coding process starts, but there is a crucial factor […]

,