Skip to main content

Posts

Showing posts from 2013

.Net List with Changed event

Sometimes we need a List which can notify user when an item is added. Here is the way that you can implement a generic ArrayList which notifies user at the time of an element is added.   using  System; using  System.Collections; namespace  ArchiveData.Logging {    // A delegate type for hooking up change notifications.    public   delegate   void   ChangedEventHandler ( object  sender,  EventArgs  e);    public   class   ListWithChangedEvent  :  ArrayList   {      // An event that clients can use to be notified whenever the      // elements of the list change.      public   event   ChangedEventHandler  Changed;      public   object  NewlyAddedItem {...

iOS Dev: Design pattern are used on iOS Development other than MVC

Hi Friends, Here the some list of design pattern with sort description What is  Design Pattern ? A design pattern is a common solution to a software problem. They are helpful for speeding up problem solving, ensuring that a developer doesn’t have to re-invent the wheel for every situation. They also give developers a common vocabulary with which to get across high-level ideas with minimal explanation and full understanding. Design patterns are everywhere in  iOS  Developement,Because iOS is a fairly specific platform, developers often face similar problems over and over, so there are a few design patterns that are extremely common in iOS. Here is a short list of design patterns used by software engineers: Abstract Factory Pattern Adaptor Pattern Object Modeling Pattern Chain of Responsibility Pattern Command Pattern Composite  Pattern Decorator Pattern Façade Pattern Iterator Pattern Mediator Pattern Memento Pattern Model-Vi...

JavaScript to validate Price input into a TextBox

Guys, first time in my life I am writing JavaScript for one of my project. I need a client side validation for an input into asp:TextBox. I wrote a JavaScript function that would, actually, take whole element as object and use a regex to match the input with a pattern. I learned that we don’t need to create an object of a RegEx() as we do in C#. A “var” variable has “match” function that will use regex pattern to match the input. Below is the javascript function that I wrote to validate my input.   < script language ="javascript">     function validatePrice(textBoxId) {         var textVal = textBoxId.value;         var regex = /^(\$|)([1-9]\d{0,2}(\,\d{3})*|([1-9]\d*))(\.\d{2})?$/;         var passed = textVal.match(regex);         if (pas...

iPhonegap: Developing a PhoneGap Application

Tutorial: Developing a PhoneGap Application Reference :  Here In this tutorial, you create a fully functional employee directory application with  PhoneGap . You will learn: How to use different local data storage strategies. How to use several PhoneGap APIs such as Geolocation, Contacts, and Camera. How to handle specific mobile problems such as touch events, scrolling, styling, page transitions, etc. How to build an application using a single page architecture and HTML templates. How to build (compile and package) an application for 6 platforms using  PhoneGap Build . To complete this tutorial, all you need is a code editor, a modern browser, and a connection to the Internet. A working knowledge of HTML and JavaScript is assumed, but you don’t need to be a JavaScript guru. Setting Up Download the assets for the workshop  here . Unzip the file anywhere on your file system. If your code editor allows you to “open a directory”, open the phonegap...