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. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper 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)
I used to have the “Unlimited Europe” subscription with Skype, so that I can call to landlines in Europe for free. I believe I have had this subscription for the last 3+ years.
Some days ago my monthly payment for the unlimited Europe was rejected due to some issues with my card, so I received two emails:
- Your payment was rejected.
- Your subscription is terminated and will stop in 3 days.
Can you imagine that? They did not let me fix the issue, they just canceled my subscription. Their e-mail is entitled:
Your subscription has been successfully cancelled
Thank you! I am very proud I successfully managed to cancel it..
Today, with my credit card working, I tried to reissue the payment and get my subscription back…
Guess what? The lady at customer support let me know it is IMPOSSIBLE and that I have to buy the subscription again, 1.5 euros per month more expensive.
This is how you treat a 3 years+ loyal customer
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.
In order to add your Google calendar account to Nokia N9 you have two alternatives. The advantage of the first is that you can select more than one of your calendars to be synchronized, while with the second you get better synchronization (at least according to my personal experience).
- Go to Accounts -> Add accounts -> CalDAV
- In the Username field, enter your full Google Account or Google Apps email address.
- In the Password field, enter your Google Account or Google Apps password.
- In the Server field, enter
Only your default calendar is synchronized by default. If you want to synchronize more calendars of your account go here and select the ones you want.
- Go to Accounts -> Add accounts -> Mail for Exchange
- Enter your email address.
- Enter your username (it is your email address).
- Enter your password.
- Leave domain field empty.
- Press the Manual Setup. Select what you want to synchronize (Calendar, Mail, Contacts). Use “m.google.com” as the server address and 443 as the port.
If you want to get access to the terminal application, you can simply do the following: go to Settings -> Security -> Developer mode and enable it. The terminal will be automatically installed. Enjoy
I was trying to use the
sed command to perform some changes to a text and stepped into an interesting “problem”; pattern matching the minus-hyphen (-) symbol.
Assume we have the following text:
something SoMeThiNg some-thing soMe_thing
and we want to match all the different versions of the word with one expression (one by one).
My initial idea was to use this regular expression:
Naturally, I tried to escape the – sign. As you can see from the output, this doesn’t work:
$ sed 's/[a-zA-Z\-\_]*/matched/' test matched matched matched-thing matched
The minus sign is not matched, because of its special meaning (setting ranges). In order to make the expression work, you need to move the “-” either in the beginning or in the end of the expression:
$ sed 's/[a-zA-Z\_-]*/matched/' test matched matched matched matched $ sed 's/[-a-zA-Z\_]*/matched/' test matched matched matched matched
and leave it un-escaped!
Have you ever heard of Microsoft’s Translator Bot, known as TBot? It is a bot that you can add as a contact in your Windows Live (msn) account and can be used for automated translation. You just need to add
firstname.lastname@example.org as a friend. Read more here.
I post this because I was playing with TBot and I stepped into a very nice English to Greek Translation:
Everyone knows what “omg” stands for, right? Oh My God..
Well, “νεαρή κοπέλα” is “young girl” in Greek :-O.. Even TBot knows that: