git: How to checkout a specific commit/version to a new branch

This entry is part 5 of 7 in the series git: useful HOWTOs
git checkout -b branch--new commit-hash

will checkout the commit-hash commit in a new branch called branch-new.

git: How to push a new branch to a remote repository

This entry is part 4 of 7 in the series git: useful HOWTOs

This will also create an association between the local and the remote branch, so you can afterwards just issue git push.

git: How to see the changes of a file for a commit

This entry is part 2 of 7 in the series git: useful HOWTOs
git show [commit] -- FILE

GCC — 64bits addressing: function returns 32bits pointer

Today, it was the second time I stepped on an interesting problem with GCC  (well, it is actually a behavior). I created a function which returns a void* in a .c file. This C file was then compiled and added in a library (.a). When I used this function in an application, I was getting a void* pointer were the 32 most significant bits were either zeroed (0x00000000...) or set to 1 (0xFFFFFFFF...). My application is 64bit!!

For example, the debug prints I added would return:

[lib] allocated 0x7f756d6fa048
[app] allocated 0x6d6fa048

where you can see the “conversion”.

What was the problem? After some time of debugging, I realized that I had forgotten to include the aforementioned function in the corresponding header file :|. So, although GCC could find the function in the library I was linking the application to, I guess it was assuming a wrong return value/header for that function.

The conclusion: Be more careful 😉

PS. I am using the following version of GCC:

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' 
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ 
--prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror 
--with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Nokia N9 – Access the Quick Launch Menu

In order to access the Quick Launch Bar you need to swipe up and hold any application for around 1 second.

A very nice application for modifying the Quick Launch Menu is the application called Shortcuts. It allows you to change the entries and the sequence of the menu.