November 15, 2010

How to save User preferences in iPhone app

Saving user preferences in iPhone app is fairly easy. It work as key/value pairs in NSUserDefaults object.


To save whether user prefers sounds on or off in your application you can do it as the following code block.

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"soundsOn"];

And to retrieve the sounds preferences value;


BOOL soundsOn = [[NSUserDefaults standardUserDefaults] boolForKey:@"soundsOn"];

October 30, 2010

iPhone keeps vibrating and no response

My iPhone suddenly started vibrating for no reason and screen was shut down.

Solution:
Press and hold Lock and Home key for few seconds to reset.

Reason:
I have no idea why this happend.

October 27, 2010

Gmail like User message control in ASP.NET

(Cross-posted on the Extensible-web)


MessageControl is an ASP.NET control which let you create user message like Gmail Application.



This control is part of the XWT toolkit. Please download and read the MessageControl.

Also read the  Code Project article about MessageControl at the following location.

October 22, 2010

PageManager control

I have written a simple article about my XWT toolkit. Please read through and download the samples.

http://www.codeproject.com/KB/webforms/aspnet-pagemanager.aspx

October 20, 2010

jQuery 1.4.3 released

(Cross-posted on the Extensible-web)

jQuery 1.4.3 final version is released. There are some significant enhancement has been done for the entire library, mainly in the performance. Following are some of the new features of jQuery 1.4.3
  • CSS Module Rewrite – Entire CSS Module has been re-written for extensibilit. You can write custom CSS plug-in now to extend the .css() and .animate() functions.
  • Data – There are some enhancement on this area as well. HTML 5 data-attributes, JavaScript object and Events are included in those enhancements.
  • Traversing - The performance of nearly all the major traversal methods has been drastically improved. For example .closest(), .filter() (and as a result, .is()), and .find() have all been greatly improved.
  • Ajax - A few new Ajax features have added. This should be advantage for plugin authors.
  • Events - A convenient shortcut for binding a function that does nothing but return false (preventing the default action and stopping the event bubbling).
  • Effects - All animate methods now support easing. A new property that exposes the rate at which all effects fire (in milliseconds – defaults to 13) also added.
There are much more enhancements for the new jQuery library. You can read in more detail from the following URL.

October 15, 2010

Extensible-Web Toolkit(XWT) RC1 released

Extensible-Web Toolkit(XWT) RC1 released. The toolkit provides simple web controls, framework library for ASP.NET development and built-in integration for jQuery. It will also provide some useful utilities for Web Application developers.

How to create Chrome Notifications

(Cross-posted on the Extensible-web)

Chrome supports Webkitnotifications and Google has done a great job with their notifications for Gmail. This example shoes how to create a recurring notification using JavaScript timer and webkitnotification object.




In order to create a notification the user must first allow notification in their browser. Click on “Allow notification” button in the ASP.NET sample and the permission will be granted.

Following code block will show you how simple is to create a notification object and show it on browser.

notify = window.webkitNotifications.createNotification('iconUrl', 'Extensible-web latest article', 'http://www.extensible-web.com');
notify.show();


Download the full source code.

September 29, 2010

SEO Starter Guide

It's been a while since I haven't posted anything useful. So here is a very good one for Web masters and developers.
Download the Google's SEO guide here

July 27, 2010

How to downgrade VS Solution

To downgrade a Visual Studio solution, follow the steps below.

1. First backup the .sln file
2. Open .sln file in Notepad
3. Modify the Format Version and the Visual Studio edition (i.e. 2008 or 2005) as shown in the following screen capture.

4. Save and close. 



July 25, 2010

Read Sri Lanka news using this Chrome extension

I just created a Chrome Extension to read Sri Lanka news quickly. Please download and install. Its a very simple extension and I've reused some of the sample code. I will update the extension to be more useful in the future--all your comments are welcome.

Get the extension from here:
https://chrome.google.com/extensions/detail/dipjohabhjlfockkahobnnppadhfibah?hl=en

July 15, 2010

DataReader vs DataSet

I've been quite frequently asked by the junior developers about the DataReader and DataSets -- so here it is.

Use DataReader For read-only data. For example, to bind custom object collection the ideal option is the DataReader. It is much faster than the DataSet.

Use DataSet to work on disconnected data. For example, to perform CRUD operations in disconnect like mode use DataSets.

I have written a performance test app for DataReader and DataSet. Download the code. Also I have written/discussed about the DataSets and Custom Collections half decade ago--http://www.ludmal.net/2005/05/datasets-vs-collections.html

Also download the Microsoft Application Architecture Guide.
http://apparchguide.codeplex.com/

Handling keypress event using jQuery

(Cross-posted from the Extensible-web.com blog)
Handling keypress event using jQuery is fairly easy. Download the sample code.

July 13, 2010

missing sentinel in function call

Quick Tip :
If you're getting "missing sentinel in function call" error while compiling objective-c code, check whether you terminate the array with nil at the end of the array declaration.


feelings = [[NSArray alloc]initWithObjects: @"awesome",@"sad", @"happy","confused",@"angry", nil];

July 6, 2010

Using JQuery in your ASP.NET application.

(Cross-posted from the Extensible-web.com blog)

What is JQuery ?
Most of the developers might already know what JQuery is. But for those who don’t, here it is. JQuery is a JavaScript lightweight library which is easy to use for JavaScript functions.

JQuery is very easy to learn and all you need to know its relevant methods and events. You can find the JQyery API reference here and you can also find some samples.

How can we use JQuery in ASP.NET application?
Real easy—if you’re creating ASP.NET app using Visual Studio 2010, then the relevant script files are already included.

For earlier versions of Visual Studio, you need to download the minified version of JQuery library from here and add the file to your project directory. Include the file as script tags in the pages, which requires JQuery.

July 1, 2010

Extensible Web - New Blog for Faster Web Apps

Finally I decided to create a new blog for tools, tips and tutorials about web application performance and optimizing. Hopefully this blog will help web developers and web masters to fine tune and optimize their web applications.

Extensible Web

P.S. I will be cross posting the Extensible Web posts with this blog.


May 19, 2010

GWT & Script#

I recently worked on a Google GWT project and very impressed with it. One of the difficult task in web development is to work on browser quirks. GWT is completely eliminating that by compiling java code to javascript. It also supports ajax server communication using RPC, JSON & XML. Microsoft's Nikhil Kothari also working on a similar project called Script# for asp.net.

April 28, 2010

ASP.NET 4 - New Features

I've been working with ASP.NET for 9 years now and still there are plenty to explore. Apart from my day to day (boring)coding, my focus has been into faster and SEO friendly web development and worked with jquery/json lately.

Microsoft has released their latest version of ASP.NET 4 and obviously the focus also into faster and SEO friendly web. I have collected all the important new features and compiled into a simple article which was published on Simple-Talk. Have a look at it and send me your comments.

I'm working on a small booklet with comprehensive instructions to speed up your web applications and also developing a simple web toolkit which will help developers to easily integrate jQuery into their ASP.NET web applications. Both of them will be released soon, so stay tuned.

April 14, 2010

Create your own story

Create your own story with Google Search. http://www.youtube.com/user/SearchStories