Wednesday, February 9, 2011

Word lens - Brilliant Language translator for iPhone

Traveling to a place where you cant read the boards/hoardings?
Have an iPhone with you? Here is an awesome app that can ease your stay!!
Yes...  word lens scans the words and translates them to English!!  Currently the app. can translate between spanish and English....!! Hope they soon extend it to other languages too....!!




Debugging Core dump in Solaris - Bus Error, Segmentaiton Fault

Solaris normally throws following types of errors and dumps the core for a program/application:
1. Bus Error: Bus Error (core dumped)

Bus error thrown due to misalignment of the data in your application. Solaris mandates the data type to be aligned to the boundary corresponds to its size. 
Eg: an integer type to be aligned to 32 bit word boundary. Your application miserably fails if an integer type tries to access a memory location that is not aligned to 4 bye boundary. Take a look @ following code block :

/// declare a structure of character array
typedef struct {
    char chr_arr[4096];
} myBuf_T;

/// a structure with integer member variables
typedef struct {
   int type;
   int val;
} header_T;

myBuf_T myBuf; // This doesn't guarantee the starting address of myBuf to be aligned to certain boundary!!
void extract_header()
{
    header_T *header = (header_T *)myBuf;
    int myVal = header->val; ///////////// CAUTION!!! This instruction will cause your application to crash in Solaris env. if my buf starts at address not aligned to 4 byte boundary. Eg ( 0x00EA. ie. addr % 4 =2 )
}
Such issues can be avoided with the use of unions aligned 4 bye word boundary. OR you can instead use your existing structure with required aligned attribute. Read more about different attributes of variables.


2. Segmentation Fault:  Segmentation Fault (core dumped)
This error is seen if your applications fails to allocate required memory OR tries to access inadvertent memory location

3. Abort: Abort (core dumped)
This is most likely to due to assert instructions introduced by application.
 
                                

                                HAPPY DEBUGGING!!!

Saturday, February 5, 2011

Blocks - Pass a piece of code as you pass the object

Blocks is an interesting feature of Objective-C programming, borrowed from C. Apple has introduced concept of "Blocks" as part of iOS-4. This feature allows the application programmer to pass the block of code as you pass the object to a function. It resembles functions pointers in C, but can be used in many other ways.

Sounds interesting?? Read Mike Clark's tutorial to learn how to use the blocks http://bit.ly/9NHV7I
Also Apple's documentation on blocks here.. http://bit.ly/hCiaQ6

Now you must be wondering how are blocks processed by the compiler.. right?
Read on... http://bit.ly/4xYoKb

Gold - GNU Linker by Google.

I came across Google's new GNU linker, while exploring solutions to my linker problem. Gold linker is extremely faster and efficient than GNU std linker ld.
You can the option "--enable-gold option" to configure the gold.

How long it takes gold to link compared to the GNU linker?

Simple Programs:
-Dynamic link: 37% faster
- Static link: 54% faster

Large program (700M, 1300 objects, 400,000 symbols):
- Complete build from scratch: 50% faster
- Change one input object: 82% faster
- Difference is disk cache effects.

For more details read Ian Taylor(Designer of Gold)... http://events.linuxfoundation.org/slides/lfcs2010_taylor.pdf

Saturday, August 7, 2010

World's Smartphone market gew by 50% in Q2 - says IDC

Worldwide smartphone market grew 50 percent year over year in Q2, driven in large part by makers of smartphones powered by Google's Android OS, according to a study by IDC(International Data Corporation)'s  Worldwide Quarterly Mobile Phone Tracker

Top Five Smartphone Vendors, Shipments, and Market Share, Q2 2010 (Units in Millions)
Vendor
2Q10
 Shipment
Volumes
2Q10
 Market
Share
2Q09
 Shipment
Volumes
2Q09
 Market
Share
2Q10/2Q09
Change
1. Nokia
24.0
38.1%
16.9
40.3%
42.0%
2. Research In Motion
11.2
17.8%
8.0
19.1%
40.0%
3. Apple
8.4
13.3%
5.2
12.4%
61.5%
4. HTC
4.8
7.6%
2.1
5.0%
128.6%
5. Samsung
3.0
4.8%
1.1
2.6%
172.7%
Others
11.6
18.4%
8.6
20.5%
34.9%
Total
63.0
100.0%
41.9
100.0%
50.4%