Monday, June 28, 2010

Blogger title required for HTML/Javascript Gadgets

If you are a blogspot user you must have seen the new restriction that you can not save any HTML/Javascript widget in blogger. This is ridiculous as most of us used to have widgets without title, especially the adsense widgets where you definitely don't want to put a title which in itself is restricted to text that shout "ADS HERE DO NOT CLICK". 

If you did a search before landing at this page you might have seen some strategies that do not work well without being very cautious about it. Such as the one which ads a display:none code for your HTML/JavaScript widget title.

Sunday, June 27, 2010

iPhone repo666.ultrasn0w.com can't find file

A friend of mine was trying to unlock his iPhone with iOS. He was not able to add the repository repo666.ultrasn0w.com and thus can not unlock his iPhone. We tried everything including reinstalling (through ssh) Cydia which got rid of the error cached failure. Cydia will keep working and finally say can not find repository after Veryfying URL. He was in India using a Reliance Net Connect card to connect to internet on his mac and shared the internet connection over airport. Thus, we were using the wi-fi network from reliance Net Connect card.

Tuesday, June 22, 2010

Unlock your iPhone 3g 3gS with baseband up to 05.13.04 using Ultrasn0w

Much anticipated iPhone carrier unlock has been released by dev team. You can now use any sim with your iPhone. Yes, this release includes carrier unlock for all iPhones including iPhone 3g and iPhone with iOS 4 upto baseband 05.13.04. However, you need to have a jailbroken iPhone and an iPhone connected to internet. if your iPhone is not jailbroken use spirit to jailbreak it first. Using spirit is a child's play.

Sunday, June 6, 2010

How to write a C program on Linux

If you are a newbie in Linux, you probably chose Linux for programming. It is fun and way too easy to write programs in Linux than dealing with Windows based programming tools (exclude MS IDEs). I will go through basic tools that almost all Linux distributions come bundled with. First one is an editor and second one is a compiler.

Tuesday, May 18, 2010

relocation truncated to fit: R_X86_64_32S against `.bss' Error

"relocation truncated to fit: R_X86_64_32S against `.bss' Error"
This is a rare error but when you get it there is no way you can get out of it without doing something fancy. If you do an exhaustive search you will find people trying to upgrade their linkers as the issue is definitely with linker. People even tried rebuilding their linker to ignore the relocation errors. Even if you do that you will SEGFAULT at run time.

The reason for this error is the size of data that you are using. This is seen to happen when your program needs more than 2GB of data. Well, who needs such big data at compile time? I do for one and there are other people in the HPC world who do that too. For all of them the life saver or may be a day saver is the compiler option -mcmodel.

All you need to do is to compile your program with

-mcmodel medium option.

For example, I was working with STREAM benchmarking tool from university of Virginia and had this error. To rectify this, I compiled my program with following command:

 gcc -mcmodel=medium stream.c -o stream

I have removed additional flags for the sake of simplicity. You might want to use various flags for your program. Please comment if this was helpful.