Surfin’ Bird

Ξ February 24th, 2010 | → 0 Comments |
Fun |, , , |

I was watching this on TV! Come on… this is ‘quality’ TV.

 

int64_t vs long long

Ξ February 21st, 2010 | → 0 Comments |
Programming |, , , , |

This last monday morning, a colleague enters in my office and asked for my… how should I put it… let’s say technical advise.

This time the discussion was about using int64_t and double in some deprecated code involving type casts and trunc of doubles into integers.
This discussing made me research a bit about C and C++ data types regarding integers, since somewhere along the way I listened to something like “I was told to use int64_t because long long is architecture dependent”. It struck deep.

Let’s start with some simple clarifications:

  •  int, or signed int, type must contain at least 16 bits (since the standard mandates that in must support values ranging from -32,767 to +32,767)
  •  long, or long int or signed long int, type must contain at least 32 bits (since the standard mandates that in must support values ranging from -2,147,483,647 to 2,147,483,647)
  •  long long, or long long int or signed long long int, type must contain at least 64 bits (since the standard mandates that in must support values ranging from -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807). Note that this data type was first defined by C99 standard.

Regarding int64_t, as it seems, C99 standard defines a header files called stdint.h as part of the C standard library, that contains portable definitions for integer types. Portable in the sense of explicitly stating the number of bits used to represent a given integer. The definitions are in the form of intN_t and uintN_t, for N bit integers and unsigned integers, respectively. This way the programmer can ensure that, whatever the wordsize used by the processor, the right range of values can be represented. The standard garantees that the widths for these types must be ≥ N.

However well supported by modern compilers, take notice that stdint.h is not officially in the latest C++ standard (know by C++03).

Looking again at the statement that aroused my curiosity, what is the relation between int64_t and long long?
Well, they represent the same thing in most architectures! Both int64_t and long long first got defined by C99 standard, but int64_t definition ensures that 64 bits are used for represent the integer value while with long long at least 64 bits must be used.

For example, some architectures represent long and int with the same number of bits (32 bits). The standard only requires at least N bits. :-)

 

Define: Single Point of Failure

Ξ February 21st, 2010 | → 0 Comments |
Definition |, |

According to Google Analytics, “Single Point of Failure” is one of the expressions that brings more people to this humble place. I guess people searching Google for this expression would like to see the actual definition, and not only the title of the blog.

So, after some investigation, here it is! And the definition of Single Point of Failure is…

Single Point of Failure refers to a specific part of a system, that in case of failure can cause major disruption to the normal work-flow. If you are talking about a computer network, think about the centralized Internet access point of the database server But you can also thing about you hard-disk system, if you are not using a RAID system.
Once the single point of failure goes down, there’s major loss of functionality possibly the complete halt of the system. One simple technique that can be used to mitigate the existence of a single point of failure. Redundancy is done by having several instances critical components working in cooperation avoids the dependence on one unique piece of equipment. It is important to consider implementing distinct approach for the redundant equipment, as this ensure there is no relation between failures of each independent piece of equipment.

For instance in your home, if you’re like me, a modem breakdown or a torn phone line can totally mean the end-of-times (knock on wood). I’m talking about the sky turning black and thunderstorms breaking havoc. The last time it happened I was almost three weeks without Internet, phone and TV. I mean, all that was left to do in the evening was to read. :-) Total misery.

Now, for all of you not interested in this subject, just wait for people to start coming here looking for… You tell me!

 

My Fetish: Voyeurism

Ξ February 16th, 2010 | → 0 Comments |
Photo |, , , |

Your mind was automatically directed to sex, wasn’t it? Admit it. With a title like that, everything point to the sexual fetish that is Voyeurism. If you search the web there are lots of sites (there it goes again, the mind floating to those sex ideas) that define this clinical psychology called Voyeurism, but today I’m here to talk about things other than sex. Let’s talk about photography (for a change).

After buying a Nikkor AF-S DX VR 55-200mm f/4-5.6G IF-ED and taking it for walk and a couple of shoots, I’m fascinated by this lens. This lens has an excellent zoom and allows you to capture really nice photos without interfering with the natural behavior of the subject. Sometimes having this huge lens extended in some direction generated some awkward by the people close to you, but I must face my natural shyness and if necessary explain what is the intention (no harm, no foul).


 


In fact, and here comes the origin of the title, I liked so much the ability to take “distant” photos that I’m considering investing in another tele-zoom lens after making the most of 200 mm. The Nikkor AF-S VR 70-300mm f/4.5-5.6G IF-ED is an excellent candidate, and will be in the shortlist when time comes. Here is an interesting review. As you can see in Nikon’s lens simulator, the zoom at 300 mm is amazing.

 

Pirelli Calendar 2010

Ξ February 15th, 2010 | → 0 Comments |
Photo |, , , |

Fashion photography is sometimes not well understood, specially by me, but the Pirelli Calendar is always very artistic.


Being a professional photographer has its quirks, but seeing the making of makes me wonder. Both models and photographers suffer a bit to take the marvelous photos, between all the fun…

 

Today, I Gotta Feeling

Ξ February 14th, 2010 | → 0 Comments |
Music |, , , , |

 

RAW Images in Ubuntu

Ξ February 14th, 2010 | → 0 Comments |
Photo |, , , |

A while ago, I became aware of the potential of using RAW files after reading some very interesting articles [1][2] on the subject. Since then RAW is the everyday choice unless speed between shoots is important or, more frequently, when the memory card is starting to fill-up.

Using Ubuntu (and GIMP) to setup a workflow, I found a very useful tool to transform RAW files into JPEG. Simply,

    sudo aptitude install ufraw gimp-ufraw

and you’ll install a very useful standalone (ufraw) GUI tool, that also can be used to batch process in the command line, and the gimp support to import RAW photos.

If you don’t want to lose post-processing time, most digital cameras have a RAW+JPEG mode in which they store the final JPEG image while retaining the ‘negative’ RAW file. I find this the best compromise… when I have lots of memory space available.

 

Spring Cleaning

Ξ February 7th, 2010 | → 0 Comments |
Photo |, , , |


Sooner or later, you’ll need to clean the sensor of your DSLR. Here are some resources that I found interesting:

Although the articles above describe several more or less intrusive methods to clean the sensor, all I used was the Giotto’s Rocket-air Blower in the photo, and it did wonders.


 

Amazing, simply amazing…

Ξ February 6th, 2010 | → 0 Comments |
Music |, , , |


Amazing, simply amazing… she did it again!

 

Exit

Ξ February 5th, 2010 | → 0 Comments |
Photo |, , , |

“I need an Exit..”

This photo was taken on my way to work. Strangely enough, the arrow indicating the emergency exit also points in the direction of my office. The actual exit is between this arrow and the entrance, which sometimes makes me wonder if I shouldn’t just use this exit and return home. There are days like that…

 

Previous Entries