Skip to main content

Posts

Agile development using Scrum

Recently I attended Scrum Master course from Scrum Alliance . Also I managed to clear CSM - Certified Scrum Master Exam. I must say I learnt quite a lot on the course. Also currently I am leading my second project using Scrum. Over next few weeks I would share my learning and my experience here. Watch this space.

Mobile journey options

In the last few years, we have seen rise in the use of mobile devices . As more and more users are using mobile devices , there is an increasing demand for businesses to have presence in the mobile world. Mobile devices have created tremendous business opportunities. The term mobile is not limited to mobile phones anymore, but it includes any device which can be used to access the information on the move. This includes tablets, hand held game consoles, media devices, watches etc. This list is increasing every day.  Options for mobile development There are number of options for developing apps with mobile presence, but we will explore the following 3 most commonly used solutions. Native apps: Native apps are downloaded and installed locally from platform specific marketplace. Cross platform apps: Using cross platform framework, you can develop native or hybrid apps. Hybrid apps are browser based apps but the user experience is same as a native app. Cross browser, mobile...

Extending jQuery library

The beauty of jQuery is that is extensible. You can easily extend the jQuery function or its alias $. For e.g. $.fn.disable = function() {   return this.each(function() { if(typeof this.disabled != 'undefined') this.disabled = true; } ); } The above code creates a function which will disable the element and return the element collections so that you can cascade more jQuery funtions e.g $("input").disable(); The above code disables all input type elements.

window.onload vs jQuery doucment ready

Any script which manipulates DOM structure needs to wait till the document has loaded. The traditional way to do this was to use window.onload method e.g. window.onload = funcerion () { alert("document loaded"); } However the above method has drawbacks. It will wait till the entire document is loaded including images. Now if a web page is image heavy, the above alert won't be displayed until all the images have loaded. Ideally you want the function to execute once the DOM structure is ready. An alternative is jQuery document ready method e.g. $(document).ready(function() { alert("DOM loaded");}); The above function can also be written as $(function() { alert("DOM loaded"); }); The beauty of ready method is that you can have more than one for the same document and they all will execute in the order they are written. You can only have one window.onload method for one document.

LINQ Sort Operators - IEnumerable and IOrderedEnumerable

Consider following example var query = Process.GetProcessess(). .OrderBy(p => p.WorkingSet64) .ThenOrderBy(p => p.ThreadCount) In this case query is of type IOrderedEnumerable Hence you cannot user a Where Operation like this query = query.Where(p => p.ProcessName.Length < 10 You will get a compile error that you cannot IEnumerable to IOrderedEnumerable However if you add Where operator on first query, it will return IEnumaerable e.g var query = Process.GetProcessess(). .OrderBy(p => p.WorkingSet64) .ThenOrderBy(p => p.ThreadCount) .Where(p => p.ProcessName.Length < 10)

Document Object Model in IE vs Other browsers

It is intersting to see that document object model in IE considers all comments outside HTML tags as valid elements where as other browsers seems to be ignoring it Tryout  in a html document in IE with atleast one comment element outside html tag. IE reports one element more compared to other browsers. There is no such thing as Standard!!!!! Everyone is creating its own Standard

LINQ Filtering Operators

LINQ filtering operators are extension methods on IEnumerable and IQueryable . There are two types of filtering operators 1. OfType 2. Where OfType returns an filtered list of IEnumerable and works on IEnumerable also. E.g ArrayList myArray = new ArrayList { "one", 1, new object(), "two", 2 }; var stringOnly  = myArray.OfType ().Where(i => i.Length > 2); The above code filters only string types and returns as IEnumerable on which you can apply Where filter.

Implicit type in C#

C# 3.0 introduced implicit type declaration var. This is not same as var type in JavaScript which is a weak type. The variable is still strongly type however the type is inferred by the compiler based on the value. E.g. var s = "Joe"; will result in s a string type. Similarly var i = 10; will result i as int type. However there are certain restrictions on declaring var types 1. Implicit local variable must be initialized. e.g. var j; will result in error 2. Implicit typed local variable cannot  have multiple declarators e.g. var i, j=0; is not allowed 3. Cannot assign null to an implicit typed local variable e.g var i = null; is not allowed 4. Cannot impicitly convert string to int e.g. var i = "43"; int j = i+ 1; will result in error; You can use implicit type to create Anonymous types e.g var person = new {Name="Joe",Age=37}; Console.WriteLine("{0} : {1}",person.Name, person.Age); Compiler will create class with Read onl...

How to detect HTML5 support for a browser?

HTML5 has introduced lots of new cool  tags . Not all the browsers support all tags and also the implementation of these tags may be different for each browser. HTML5 specification defines the functional aspects of these tags and not the implementation. Also the general concensus is that by 2022 all browsers will support all new features of HTML5. Of all the modern browsers, Chrome seems to have implemented most, if not all, featutes of HTML5. IE9 supports few. Firefox sits in between. So as a developer how do you make use of the cool HTML5 features without causing any compatibility issues with existing browsers? Traditionally developers have used User Agent to detect browser type and use the features accordingly. However these days, you can easily change a User Agent by using addons in your browser. So you need a more robust way to detect the features supported by the browser as the same engine of two different versions of a browser mig...