Languages supported by UITextChecker

The only below languages are supported by UITextChecker for autocorrection words or misspelled words.

“en_GB”,
“es_ES”,
“fr_FR”,
“it_IT”,
“pt_BR”,
“pt_PT”,
“nl_NL”,
“de_DE”,
“en_CA”,
“ru_RU”,
“en_US”,
“en_AU”,
“sv_SE”,
“da_DK”

Iphone Programming Bad_Excess

In Iphone Programming Bad_Excess Does not throw any Exception

In my case :

Problem:-
NSString *str;

if( [ str isEqualToString @"NE" ] )<= this will generate bad excess beacuse
{

}
Sol n:-
NSString *str=@" "; <= sol n NSString Can not be null while we compare it

if( [ str isEqualToString @"NE" ] )
{

}

we can get details of Bad_Excess by using NSZombie Enable

How To Symbolicate Crash Log

For symbolicating crash log, It just require two files and simple steps.

Required :
1. The app file that you submitted for testing or to iTune Store.
2. .dSYM file which is generated at the time of above app file.

Follow steps.

1. Put the app file and .dSYM file in one new folder.
2. Put the attached file (symbolicatecrash) in folder /usr/local/bin/
3. Launch Terminal, execute command
symbolicatecrash myapp.app myapp.dSYM (where myapp is file name of app and .dSYM file)

It will symbolicate all symbols in your crash file.

Happy Coding..
–HS

Invalid Binary issue in IOS release

UIProgressHUD is the private class of Apple API, So don’t extend this class or use it, otherwise after uploading binary on App Store, it will show “Invalid Binary”.

Mail from Apple
—————-

Non-public API usage:
The app contains or inherits from non-public classes in <>: UIProgressHUD

Good Luck iOS develoeprs

Android or iPhone

DO YOU VOTE FOR ANDROID OR IPHONE?

WHAT DO YOU THINK, WHO WILL WIN IN 2012?

India – Right To Education

    Right To Education

On 1st April 2010, India joined a group of few countries in the world, with a historic law making education a fundamental right of every child coming into force. Making elementary education an entitlement for children in the 6-14 age group, the Right of Children to Free and Compulsory Education Act, 2009 will directly benefit children who do not go to school at present.

In an unprecedented move, Prime Minister Manmohan Singh announced the operationalisation of the Act. For the first time, education will become a constitutional right. It is a tryst with destiny in the area of education. Children, who had either dropped out of schools or never been to any educational institution, will get elementary education as it will be binding on the part of the local and State governments to ensure that all children in the 6-14 age group get schooling. As per the Act, private educational institutions should reserve 25 per cent seats for children from the weaker sections of society. The Centre and the States have agreed to share the financial burden in the ratio of 55:45, while the Finance Commission has given Rs. 25,000 crore to the States for implementing the Act. The Centre has approved an outlay of Rs.15,000 crore for 2010-2011.

The school management committee or the local authority will identify the drop-outs or out-of-school children aged above six and admit them in classes appropriate to their age after giving special training.

My gentle request to share with everyone you know, it may benefit someone directly or indirectly who really in need…..

Hike in UK student visa fee

LONDON: Britain on Thursday announced a steep hike of £54 in the student visa fee and introduced a new category of ‘dependent relative’ visa as a part of its effort to attract those migrants and visitors who can “make a valued contribution”.

The fees for the students’ visa was raised from £145 to £199 while the dependent relative visa would be charged £1,680.

The increased fees will come into effect from April 6.

“The new visa category of ‘dependent relative’ will allow the grandparents, parents, aunts and uncles and siblings over the age of 18 to join family members settled in the UK or being admitted for the purpose of settlement,” an official announcement said.

The fees for short-term visit visa has been marginally increased from £67 to £68. The Tier 1 General, Investor, Entrepreneur visa fees has been increased from £675 to £690 while Tier 2 visa for skilled workers will charged £270 from £265.

The 5-year multiple entry visa fees increased from £400 to £429 while charges for 10-year visa increased from £500 to £610. The Tier 4 student visa fee increased from £145 to £199. Settlement visa fee will be £585 to £644.

Something about JasperReport

1.What is JasperReports:
JasperReports is a powerful open source reporting tool that has the ability to deliver rich content onto the screen, to the printer or into HTML, XLS, PDF, CSV and XML files. It is entirely written in Java and can be used in a variety of Java enabled applications to generate dynamic content.
Its main purpose is to help creating page oriented, ready to print documents in a simple and flexible manner.

JasperReports organizes data retrieved from a relational database through JDBC according to the report design defined in an XML file. In order to fill a report with data, the report design must be compiled first.
The compilation of the XML file representing the report design is performed by the compileReport() method exposed by the dori.jasper.engine.JasperManager class.
Through compilation, the report design is loaded into a report design object that is then serialized and stored on disk (dori.jasper.engine.JasperReport). This serialized object is then used when the application wants to fill the specified report design with data. In fact, the compilation of a report design implies the compilation of all Java expressions defined in the XML file representing the report design. Various verifications are made at compilation time, to check the report design consistency. The result is a ready to fill report design that will be then used to generate documents on different sets of data.
In order to fill a report design, one can use the fillReportXXX() methods exposed by the dori.jasper.engine.JasperManager class. Those methods receive as a parameter the report design object, or a file representing the specified report design object, in a serialized form, and also a JDBC connection to the database from where to retrieve the data to fill the report.
The result is an object that represents the ready to print document (dori.jasper.engine.JasperPrint) and can be stored onto the disk, in a serialized form, for later use, or can be delivered to the printer, to the screen or can be transformed into a HTML, XLS, PDF, CSV or XML document.

JasperReports’ reports are defined in XML files, which by convention have an extension of jrxml. A typical jrxml file contains the following elements:

• jasperReport – the root element.
• title – its contents are printed only once at the beginning of the report
• pageHeader – its contents are printed at the beginning of every page in the report.
• detail – contains the body of the report.
• pageFooter – its contents are printed at the bottom of every page in the report.
• band – defines a report section, all of the above elements contain a band element as its only child element.

All of the elements are optional, except for the root jasperReport element.

2.Jasper available Plugins:
JasperAssistant is a visual report designer for JasperReports, a popular open-source reporting engine. It is built on top of the Eclipse’s plug-in architecture and its main goal is to help you create JasperReports report definition files through an intuitive graphical interface.
Benefits
• Design and layout your reports using an intuitive visual interface and avoid the need for XML editing of JasperReports templates.

• Take advantage of Eclipse IDE integration and effectively combine Java and JasperReports development.

• Efficiently locate and correct report problems using precise error indications.

• Preview your reports instantly using live data from a JDBC database connection, an XML document, JavaBeans array or a custom data source.

• Export and preview your reports in PDF, Excel, HTML, CSV and XML formats.

Find out How Much Memory Used by a Java Object

Here is some very good description of what you have to take into account to compute the (shallow) size of an java object.

The general rules for computing the size of an object on the SUN/SAP VM are :

32 bit

Arrays of boolean, byte, char, short, int: 2 * 4 (Object header) + 4 (length-field) +
sizeof(primitiveType) * length -> align result up to a multiple of 8

Arrays of objects: 2 * 4 (Object header) + 4 (length-field) +
4 * length -> align result up to a multiple of 8

Arrays of longs and doubles: 2 * 4 (Object header) + 4 (length-field) +
4 (dead space due to alignment restrictions) + 8 * length

java.lang.Object: 2 * 4 (Object header)

other objects: sizeofSuperClass + 8 * nrOfLongAndDoubleFields + 4 * nrOfIntFloatAndObjectFields +
2 * nrOfShortAndCharFields + 1 * nrOfByteAndBooleanFields -> align result up to a multiple of 8

64 bit

Arrays of boolean, byte, char, short, int: 2 * 8 (Object header) + 4 (length-field) +
sizeof(primitiveType) * length -> align result up to a multiple of 8

Arrays of objects: 2 * 8 (Object header) + 4 (length-field) +
4 (dead space due to alignment restrictions) + 8 * length

Arrays of longs and doubles: 2 * 8 (Object header) + 4 (length-field) +
4 (dead space due to alignment restrictions) + 8 * length

java.lang.Object: 2 * 8 (Object header)

other objects: sizeofSuperClass + 8 * nrOfLongDoubleAndObjectFields + 4 +
nrOfntAndFloatFields + 2 * nrOfShortAndCharFields + 1 * nrOfByteAndBooleanFields -> align result up to a multiple of 8

Note that an object might have unused space due to alignment at every inheritance level (e.g. imagine a class A with just a byte field and class B has A as it’s superclass and declares a byte field itself -> 14 bytes ‘wasted on 64 bit system).

In practice 64 bit needs 30 to 50% more memory due to references being twice as large.

String and Memory Issue

Probably most of the Java users is aware that String object is more complex than just an array of char. To make the usage of strings in Java more robust additional measures were taken – for instance the String pool was created to save memory by reusing the same String objects instead of allocating new ones. Another optimization that I want to talk about today is adding the offset and count fields to the String object instances.

Why those fields were added? Their purpose is to help to reuse already allocated structures when using some of the string functionalities – like calculating substrings of a given string. The concept is that instead of creating an new char array for a substring we could just ‘reuse’ the old one. To be exact this is what String.substring() method does: instead of copying an char array for the returned object it creates a new String reusing char[] of the old one. Only the values of offset and count fields (which indicate the beginning and the length of a new string) are changed. Because the substring operation is quite often used this mechanism helps to save a lot of memory. It is important to add that this can work only because String objects are immutable. See the following snippet:

——————————————————————
public static void sendEmail(String emailUrl) {
String email = emailUrl.substring(7); // ‘mailto:’ prefix has 7 letters
String userName = email.substring(0, email.indexOf(”@”));
String domainName = email.substring(email.indexOf(”@”));
}

public static void main(String[] args) {
sendEmail(”mailto:user_name@domain_name.com”);
}
——————————————————————
Thanks to the way substring() is implemented when we extract the email, userName and domainName three new String objects are created, but the char array is not copied. All new string variables reuse the character array from emailUrl. Thanks to that reuse for really long urls we can save approximately 2/3 of memory we would use otherwise. Great, right?
Ok… now the dark side of that optimization! Check out this snippet:

——————————————————————
public final static String START_TAG = ““;

public static String getPageTitle(String pageUrl) {
// retrieve the HTML with a helper function:
String htmlPage = getPageContent(pageUrl);

// parse the page content to get the title
int start = htmlPage.indexOf(START_TAG);
start = start + START_TAG.length();
int end = htmlPage.indexOf(END_TAG);
String title = htmlPage.substring(start, end);
return title;
}
——————————————————————
In here we are extracting from the HTML page its title – can you see the problem with this code? Looks simple and correct, right?
Now, try to imagine that the htmlPage String is huge – more than 100.000 characters, but the title of this page has only 50 characters. Because of the optimization mentioned above the returned object will reuse the char array of the htmlPage instead of creating a new one… and this means that instead of returning a small string object you get back a huge String with 100.000 characters array!! If your code will invoke getPageTitle() method many times you may find out that you have stored only a thousand titles and already you are out of memory!! Scary, right?

Of course there is an easy solution for that – instead of returning the title in line 13, you can return new String(title). The String(String) constructor is always doing a subcopy of the underlying char array, so the created title will actually have only 50 characters. Now we are safe:)
So what is the lesson here? Always use new String(String)? No… In general the String optimizations are really helpful and it is worth to take advantage of them. You just have to be careful with what you are doing and be aware of what is going on ‘under the hood’ of your code.

Follow

Get every new post delivered to your Inbox.