Posts Tagged ‘Tips’
Todays read: Mastering CSS Coding
Mastering CSS Coding: Getting Started
An amazingly simple and useful article from Smashing Magazine.
CSS has become the standard for building websites in today’s industry. Whether you are a hardcore developer or designer, you should be familiar with it. CSS is the bridge between programming and design, and any Web professional must have some general knowledge of it. If you are getting your feet wet with CSS, this is the perfect time to fire up your favorite text editor and follow along in this tutorial as we cover the most common and practical uses of CSS.
Read it here: http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/
Follow them in twitter
How-to: Create my first iPhone application
These days everyone wants to create iPhone applications. But “user retention” is the biggest challenge most the application developers or companies facing. As per some analysis report which I went through sometime back, the amount of returning users/customers is very less. Problems may be the way we (developers) develop those products, not-so-good application usability or even the confused user.
I think this Smashing magazine article – How to Create Your First iPhone Application – can help us to a great extend.
What if you had a nickle for every time you heard: "I have the perfect idea for a great application!"? It’s the buzz on the street. The iPhone has created unprecedented excitement and innovation from people both inside and outside the software development community. Still for those outside the development world, the process is a bit of a mystery.
This how-to guide is supposed to walk you through the steps to make your idea for an iPhone app a reality. This post presents various ideas, techniques, tips, and resources that may come in handy if you are planning on creating your first iPhone application.
Read the article: http://www.smashingmagazine.com/2009/08/11/how-to-create-your-first-iphone-application/
Today’s read 2: Characteristics of a successful UI
![]()
This is from usabilitypost.com. It’s really a nice read.
http://www.usabilitypost.com/2009/04/15/8-characteristics-of-successful-user-interfaces/
There is a lot of information out there about various interface design techniques and patterns you can use when crafting your user interfaces and websites, solutions to common problems and general usability recommendations. Following guidelines from experts will likely lead you towards creating a good user interface — but what exactly is a good interface? What are the characteristics of an effective user interface?
Here are 8 things I consider a good user interface needs to be:
Working with text in Java: Using BreakIterator API
java.text.BreakIterator is a very good API to find boundaries – character, word, sentence & line break – with in a text. The API provides a factory method to create the appropriate Iterator of our choice.
// Instantiating a word iterator with optional locale parameter BreakIterator anIterator = BreakIterator.getWordInstance(locale); // Without locale parameter BreakIterator anotherIterator = BreakIterator.getWordInstance();
The locale is an optional parameter to have locale specific breaks. We can instantiate BreakIterator without specifying the locale also. (java.util.Locale) The locale is important when we are working with languages like Arabic or Chinese where the standards may be different compared to English.
Once we have an instance of BreakIterator, iterating through the boundaries / breaks is the same. The API offers methods like first(), last(), previous(), next(), preceding(), following() to iterate through boundaries.
Iterating through boundaries
BreakIterator aWordIterator = null;
String targetString = null;
int nextIndex = -1;
int anIndex = -1;
// Initialising the word iterator
aWordIterator = BreakIterator.getWordInstance();
targetString = "This is a sample text";
aWordIterator.setText(targetString);
// Iterating through the boundaries
nextIndex = aWordIterator.first();
while (BreakIterator.DONE != nextIndex)
{
anIndex = nextIndex;
nextIndex = aWordIterator.next();
if ((BreakIterator.DONE != nextIndex) &&
Character.isLetterOrDigit(targetString.charAt(anIndex)))
{
System.out.format("%10s (%d, %d) \n",
targetString.substring(anIndex, nextIndex),
anIndex, nextIndex);
}
}
The constant BreakIterator.DONE indicates the end of boundaries.
Output
This (0, 4) is (5, 7) a (8, 9) sample (10, 16) text (17, 21)
Useful links
http://java.sun.com/docs/books/tutorial/i18n/text/examples/BreakIteratorDemo.java – Sun’s BreakIterator demo
http://java.sun.com/docs/books/tutorial/i18n/text/index.html – Sun’s tutorial on “Working with text”
Tip: How to handle broken images in HTML
I found this small but very good article in phpied.com by Stoyan Stefanov – Twitter page. The article tells about handling broken images in a web page, especially when we dont have control over what we load in our page.
I know, you don’t have broken images on your site, it’s unprofessional and ugly. But sometimes you may be loading images that you don’t control and you never know what’s going on on the other server you’re expecting to serve, but it may not feel up to the task.
One nice and simple strategy to deal with this uncertainty is to hide the images that fail to load. Browsers sent an “error” event when the worst happens and an image fails for whatever reason. Subscribe to this event using your favorite event-listener-attaching approach or library and hide the image.
The solution is very simple.
<img src="broken.png" onerror="this.style.display='none'" />


