Saturday, January 24, 2015

IPad iOs tips

IPad iOs tips

4-5 figure gestures
http://www.cultofmac.com/199875/switch-between-apps-directly-on-your-ipad-using-four-or-five-finger-gestures-ios-tips/

o tap the Settings app and then tap the General tab there in the left-hand column. Scroll down a bit to find the Multitasking Gestures toggle switch, and set it to ON with a tap. Just below that toggle, you’ll see the three things you can now do with four or five fingers at once.
To get back to the Home screen from any other app, simply pinch inward with five fingers. You’ll be taken out of the currently running app and end up on the Home Screen. Note that you’ll go back to the specific page you left Home on, just like when you tap the Home button.
To reveal the multitasking bar at the bottom of your iPad screen, swipe up with four (or five) fingers at once, from the bottom of the iPad screen to the top. This is the equivalent to double clicking the Home button.
Finally, to move between recently running apps, swipe left or right with your four or five fingers. This is like switching Desktop Spaces on the Mac, only it’s really switching from the current app to the latest save state of the previously running app. It’s like enabling the multitaasking bar and tapping on the next app in the list, without actually having to do the middle part.

Friday, January 16, 2015

JQuery Tutorials

JQuery Tutorials


http://jqfundamentals.com/

iOS IPhone IPad programming tutorials

iOS IPhone IPad programming tutorials

Scary Bugs

http://www.raywenderlich.com/1797/ios-tutorial-how-to-create-a-simple-iphone-app-part-1

iOS Tutorial: How To Create A Simple iPhone App: Part 1/3

 Ray Wenderlich 
If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. Thanks for visiting!
iPhone programming is like a ladybug - fun and only a little scary!
iPhone programming is like a ladybug - fun and only a little scary!
Update 6/02/14: Fully updated for iOS 7 by Jorge Jordán.
The iPhone is an amazing platform to develop on for indie software developers. It’s never been easier to come up with your own unique app idea, code something up, and have it be available to millions of potential customers!
Lately I’ve been getting a lot of questions from people new to iOS development asking how to get started. So I thought it would be helpful to write an iOS tutorial series tailored for beginners.
But rather than focusing in detail on just one topic, you’re going to dive in and create an entire functional app from scratch. By the end, you’ll have tried out many areas of iPhone development, and ready to dig in further.
So what’s the app you’re going to make? Well, there’s a story behind that…
Official Apple

https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html#//apple_ref/doc/uid/TP40011343-CH2-SW1

Setup

Start Developing iOS Apps Today is the perfect starting point for creating apps that run on iPad, iPhone, and iPod touch. View this guide’s four short modules as a gentle introduction to building your first app—including the tools you need and the major concepts and best practices that will ease your path.
image: ../Art/application_design_2x.png
The first three modules end with a tutorial, where you’ll implement what you’ve learned. At the end of the last tutorial, you’ll have created a simple to-do list app.


Wednesday, January 14, 2015

ASP.NET Performance Test Much Faster Than Webforms

ASP.NET Performance Test Much Faster Than Webforms

from
http://www.codeproject.com/Articles/864950/ASP-NET-MVC-vs-ASP-NET-WebForm-performance-compari

ASP.NET MVC vs ASP.NET WebForm performance comparison

13 Jan 2015 CPOL
The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC. One the main reasons of moving from Webforms to MVC is performance, performance and performance.

Contents

Intention of this test
Code for the test
Out of scope
How was the test conducted?
Performance criteria
Conclusion of test
ASP.NET MVC as solution
Reading 1
Web Forms
MVC
Reading 2
Webform
MVC
Reading 3
WebForm
MVC
Reading 4
WebForm
MVC
Reading 5
Webform
MVC
Reading 6
Webform
MVC
Further reading

Intention of this test

The intention of this article is to compare performance between ASP.NET WebForms and ASP.NET MVC.One the main reasons of moving from Webforms to MVC is performance, performance and performance.
FYI :-In case you are new to MVC you can start from the video given at the end of the article.

Code for the test

For this test we created two projects one in ASP.NET MVC and the other in ASP.NET Webforms.We have kept the test absolutely simple.Both the projects display 20 textboxes and there is a grid loaded with 1000 records.
Below is the ASP.NET Webform code behind which binds with a grid server control.
        protected void Page_Load(object sender, EventArgs e)
        {
for(int i=0;i<1000;i++)
            {
obj.Add(DateTime.Now.ToString());
            }
            GridView1.DataSource = obj;
GridView1.DataBind();
        }
    }
On the ASPX UI we have 20 textboxes which uses the server controls of ASP.NET Webforms.
<asp:TextBox ID="TextBox1" runat="server" BackColor="#FF66FF"></asp:TextBox>

<asp:TextBox ID="TextBox2" runat="server" BackColor="#FF66FF"></asp:TextBox>

<asp:TextBox ID="TextBox3" runat="server" BackColor="#FF66FF"></asp:TextBox>

…….
<asp:TextBox ID="TextBox6" runat="server" BackColor="#FF66FF"></asp:TextBox>

In ASP.NET MVC project also we have similar kind of logic. We have 20 textboxes created using HTML control and simple loop which creates HTML table.
<input id="Text1" type="text" style="background-color:#FF66FF" />

<input id="Text1" type="text" style="background-color:#FF66FF" />

<input id="Text1" type="text" style="background-color:#FF66FF" />

@{
List<string> obj = new List<string>();
for (int i = 0; i < 1000; i++)
{
obj.Add(DateTime.Now.ToString());
}
}
<table>
<tr><td>Item</td></tr>
@{
foreach (string str in obj) 
      {
<tr><td>@str</td></tr>
      }
}
</table>

Out of scope

In this test we have not used JSON, Jquery , Ajax because we wanted to test performance of these platforms only and not when they get clubbed with other technical things like HTML 5 , Ajax etc.

How was the test conducted?

Test was conducted with the below specifications using VSTS and telerik load test software:-
  • User load 25 users.
  • Run duration of test was 10 minutes.
  • Machine config DELL 8 GB Ram, Core i3
  • Project was hosted in IIS 8.
  • Project was created using MVC 5.
  • Network LAN connection was assumed. So this test does not account for network lag for now.
  • Browser in the test selected Chrome and Internet explorer.
  • Multiple reading where taken during the test to average unknown events. 7 readings where taken and all readings are published in this article as reading 1 , 2 and so on.

Performance criteria

Performance was measured using two criteria’s Average page response time and Response content in bytes.
Average Page response time :- This value is the average time the 25 users get the page output when the load testing is executed.
Response content length :-Number of average total bytes transferred for every request. This criteria is taken because we suspect the server controls generate more amount of HTML as compared to when we write custom HTML.

Conclusion of test

Response time
Response time of MVC was much better as compared to Webform. We found ASP.NET MVC response time was two times better than Webforms.
The reason is but obvious when a request is sent to Webforms there is a complex ASP.NET page life cycle which gets executed in the code behind. This code behind is nothing but sort of conversion logic which converts the ASP.NET server controls to HTML.
In ASP.NET MVC there is no code behind and no such conversion is required as the controls are in HTML format themself.
Content length
For the same kind of logic the HTML content length generatedfrom Webform was twice than MVC.
When we viewed the view source we saw huge view state data generated by Webform which was not present in MVC. This means more bandwidth will be consumed when we surf ASP.NET Webform sites as compared to ASP.NET MVC sites.

ASP.NET MVC as solution

If you see the conclusion from the load test we need a solution which does not have code behind and server controls. So when you create ASP.NET MVC projects you will not find NOcode behind and server controls.
Below is a snapshot of MVC views and you can see there is .CSHTML but there is no CSHTML.CS.
If you go a MVC view and click on toolbox it only HTML tab and all the server controls have gone of completely.
You can also read this in depth article which talk about what we have missed in ASP.NET MVC from Webforms.
Below are all the seven readings pasted for both Webform and MVC. These readings would provide you more insight on the performance factor between these technologies.

Reading 1

Web Forms


Monday, August 4, 2014

Introduction to AngularJS NitinShrivastava


Microsoft Angular JS Introduction Microsoft Virtual Academy
Introduction to AngularJS Jump Start
Recordings on MVA!

Stacey and Christopher (and the rest of us in MVA, MSL and DPE) had such a great
time delivering the Introduction to AngularJS Jump Start on January 21st!  What a
fantastic audience!  We send our thanks to you for investing a valuable day with us!

For those who wish to view the session or couldn’t attend the video recordings are now
posted to MVA  - enjoy!

http://www.codeproject.com/Articles/803294/Part-Introduction-to-AngularJS
Introduction
Recently I started learning AngularJS, it was very difficult for me to find some good detailed articles or beginner tutorials on AngularJS. I have to read from many different articles, books and tutorials. So I decided to put step by step help for beginners like me, so that they get complete required help from one single channel. Since AngularJS is a very rich framework so I decided to write in a series of post that will help beginners who want to learn or work on SPA(Single Page Application) using AngularJS. I am assuming that people reading this article are aware of html and javascript/jquery. So lets start with a short but detailed AngularJS tutorial where you will be able to quickly understand the power of AngularJS in the world of web.

Background

You may have heard people talking about MVC/MVVM/MV*/ MVW (Model View Whatever) or have ever worked with, in some other programming languages. Though MV*/MVW is not a concept specific to AngularJS, but rather an approach to program architecture which is implemented in variety of programming languages and environments. It depends on the architect to architect that how he wants the architecture of the software and AngularJS provides facilty to design application in Model View and Whatever you want to have(lets say mvc,mvvm etc..).  There are bunch of topics to cover which we will be looking into one by one in the later part of tutorial, but still I will try to make you familiar with atleast some of the terminologies that I have used here in this part of tutorial.
So first lets try to understand MV* concept relative to AngularJS.

Views

View in an application actually is a part which is rendered in a browser through which user can interact or see whatever data has been requested. In an AngularJS application view is composed of directives, filters and data-bindings. But to make view simple and maintainable we do not put all of our code into the View. This helps us to separate code from view and also makes it easy to write tests for the business logic.

Controller

Controller holds all of our application logic in AngularJS. The Controller controls and prepares the data into the form so that it can be rendered at the View. Functionally what controller actually does is, it collects all of data into the representational form and also takes from view and set into the Model after validating it. The controller is responsible for communicating the server code to fetch the data from a server using Ajax requests and send the data to back-end server from Views.

Model / View Model / $Scope

The most important and head part of the MV* architecture is Model or View Model or $Scope.  $Scope is a term which is introduced in AngularJS and we will discuss more on this in the later part of the article. Model is the bridge standing between Controllers and Views . There can be a controller which we can bind to two or more views. Lets suppose we have a controller assigned for a registration of users, for thispurpose you can have a different view for desktop and another view for mobile.
In reality the Controller is blank about views and has no information about the views and similarly View is independent of logic implemented or data present in the Controller. $scope acts as the communication tunnel between the Views and Controller.
Picture above is actually related to the sample application that we are going to create in the later part of the article. But for now from this picture atleast you can get an idea to MV* pattern.

What Exactly AngularJS Is?

In my terms AngularJS is nothing different to plain HTML but simply an extension to HTML with new attributes. AngularJS is a JavaScript MV* or MVW structured framework for dynamic web applications. It is maintained by Google to allow you to develop well architectured and easily maintainable web-applications. AngularJS makes use of declarative programming for building UI. AngularJS is client-sided so all these things are happening in browsers and you get the elegance of standalone application. 

Why To Use AngularJS?

There are a lot many front-end frameworks available in the web world like BackboneKnockoutEmberSpline etc. and all of them have some pros and cons. But as the tutorial is all about AngularJS so the question arises that What is so peculiar about AngularJS ? So here is the answer to all your question.
With AngularJS you need to write lesser code as it allows you to reuse components. Also, it provides an easy way of two-way bindings and dependency injection (we will discuss more on next part of the tutorials). As AngularJS is client-sided so all these things are happening in browsers, which gives you feel of standalone applications(Desktop application).
Some of the reasons why I would prefer AngularJS or rather I say why AngularJS has become choice for the modern application architectures are described below:
1) You can create a template and reuse it in application multiple times.
2) You can bind data to any element in two ways, where two-way actually means changing data will automatically change element and changing element will change the data.
3) You can directly call the code-behind code in your html.
4) You can validate forms and input fields before submitting it without writing a single line of code.
5) Allows you to control complete dom structure show/hide, changing everything with AngularJS properties.
6) AngularJS allows you to write basic flow end-to-end testing, unit-testing, ui mocks.
In short, AngularJS provides all the features you need to build a CRUD application like data-binding, data validation, url routing, reusable HTML components and most importantly dependency injection.
<contined at link at top> 

Friday, June 20, 2014

Advanced C# Concepts - Nullable Types ?

Advanced C# Concepts - Nullable Types ?

From MS documentation:

Nullable Types (C# Programming Guide)

Visual Studio 2013
Nullable types are instances of the System.Nullable<T> struct. A nullable type can represent the correct range of values for its underlying value type, plus an additional null value. For example, a Nullable<Int32>, pronounced "Nullable of Int32," can be assigned any value from -2147483648 to 2147483647, or it can be assigned the nullvalue. A Nullable<bool> can be assigned the values true false, or null. The ability to assign null to numeric and Boolean types is especially useful when you are dealing with databases and other data types that contain elements that may not be assigned a value. For example, a Boolean field in a database can store the values true or false, or it may be undefined.
class NullableExample
{
    static void Main()
    {
        int? num = null;

        // Is the HasValue property true? 
        if (num.HasValue)
        {
            System.Console.WriteLine("num = " + num.Value);
        }
        else
        {
            System.Console.WriteLine("num = Null");
        }

        // y is set to zero 
        int y = num.GetValueOrDefault();

        // num.Value throws an InvalidOperationException if num.HasValue is false 
        try
        {
            y = num.Value;
        }
        catch (System.InvalidOperationException e)
        {
            System.Console.WriteLine(e.Message);
        }
    }
}
The example will display the output:
num = Null
Nullable object must have a value.

Nullable Types Overview

Nullable types have the following characteristics:
  • Nullable types represent value-type variables that can be assigned the value of null. You cannot create a nullable type based on a reference type. (Reference types already support the null value.)
  • The syntax T? is shorthand for Nullable<T>, where T is a value type. The two forms are interchangeable.
  • Assign a value to a nullable type just as you would for an ordinary value type, for example int? x = 10;or double? d = 4.108. A nullable type can also be assigned the value null: int? x = null.
  • Use the Nullable<T>.GetValueOrDefault method to return either the assigned value, or the default value for the underlying type if the value is null, for example int j = x.GetValueOrDefault();
  • Use the HasValue and Value read-only properties to test for null and retrieve the value, as shown in the following example: if(x.HasValue) j = x.Value;
    • The HasValue property returns true if the variable contains a value, or false if it is null.
    • The Value property returns a value if one is assigned. Otherwise, aSystem.InvalidOperationException is thrown.
    • The default value for HasValue is false. The Value property has no default value.
    • You can also use the == and != operators with a nullable type, as shown in the following example:if (x != null) y = x;
  • Use the ?? operator to assign a default value that will be applied when a nullable type whose current value is null is assigned to a non-nullable type, for example int? x = null; int y = x ?? -1;
  • Nested nullable types are not allowed. The following line will not compile: Nullable<Nullable<int>> n;