Monthly Progress with Fitbit Charge 2 – November 2017

My Profile

Days Steps Floors Miles Calories Minutes
1 8595 2 3.5 1929 68
2 10933 15 4.68 1901 69
3 12487 28 5.34 1980 79
4 13958 7 5.63 2402 116
5 13193 1 5.33 2369 65
6 10909 10 4.72 2024 66
7 12199 20 5.25 1962 68
8 8691 23 3.55 1838 47
9 6686 1 2.7 1724 23
10 18476 19 7.62 2773 202
11 26704 36 1106 3087 115
12 8427 5 3.4 1939 13
13 7360 4 2.97 1841 30
14 15589 33 6.54 2131 87
15 12154 29 4.82 2100 53
16 6347 3 2.38 1801 50
17 11077 12 4.55 1905 61
18 37164 68 15.41 3593 348
19 9964 11 4.02 2163 18
20 4027 2 1.63 1608 0
21 3703 3 1.5 1588 0
22
23
24
25
26
27
28
29
30

So far my best day was 18th November with 37164 steps, I need to break this record asap.

Windows 10 Cheatsheet

Command Prompts

Shutdown /? and Press ENTER gives you options

Shutdown /r exits Windows (prompting you to save any open files) and then restarts

Shutdown /h to hibernate the local computer

Shutdown /s /fw – This option performs a full shutdown, and then opens the UEFI firmware configuration interface as part of the next startup.

Shutdown /r /o – Use this combination of switches to restart and display the advanced boot options menu

 

Entity Framework

Entity framework support the development of data-oriented software applications. It enables developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying database tables and columns where this data is stored. Entity framework can be installed on .NET Framework version 3.5 SP1 above. In simple terms it is about writing model as part of your business design process and create the database from that model.
Entity framework supports Model First, Code First and Database First design approaches.

Model First Approach
– provides the option to create entities and relationships directly on the design interface of the EDMX and then execute it. An architect uses the Model First approach when designing the database and the object model at the same time with Entity Designer in Microsoft Visual Studio.
Code First Approach
– domain driven development, creating class instead of tables in the database. A process in which the development team writes the plain old CLR object (POCO) classes,
and the Code First generator builds the database from those classes. Doing this enables the development team to design the object structure, in code, that bests suits their application
and generate the database from that design. The conceptual model is mapped to the storage model in code.
Database Design Approach
– upgrading or conversion of database which enables you to continue using the existing structure with no impact on the database

Model First and Code First are both strongest in the creation of the initial database schema.

 

Getting IPHONE X (10)

After placing an online order for 3 weeks finally on monday 11/20/2017 the IPHONE package was delivered by UPS. Super excited with my new IPHONE.
Shipment path:
ZhengZhou, China -> Anchorage, AK, USA -> Louisville, KY, United States -> Mather, CA, United States -> Rocklin, CA, United States -> ROSEVILLE, CA, US

I must say UPS did an awesome job with accuracy to deliver the package on time without any delay. I reached home just in time to receive my new phone.

ASP.NET MVC – 70-486

ASP.NET MVC Framework
– is a lightweight, highly testable presentation framework
– MVC Framework is defined in the System.Web.Mvc assembly
– It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.
– It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
– It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information, see Front Controller.
– It provides better support for test-driven development (TDD).
– It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.

ASP.NET web Forms
– application pattern is based on Web Forms and postbacks
– a single class is used both to display output and to respond to user input
– It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development.
– It uses a Page Controller pattern that adds functionality to individual pages.
– It uses view state on server-based forms, which can make managing state information easier.
– It works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development.
– In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than the MVC model.

Topics Covered:

Design the Application Architecture (15-20%)

  • Plan the application layers
    • Plan data access;
      – how it connects users to data: new database or existing database
      • Object relational mapper (O/RM) – is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. The O/RM hydrates the object with the data from the database, or creates the SQL statements that will save the object data into the database.
        1. Entity Framework
        2. ADO.NET
      • Writing your own component to manage interactions with the database
    • Plan for separation of concerns;
    • Appropriate use of models,
    • Views and controllers;
    • Choose between client-side and server side processing;
    • Design for scalability
  • Design a distributed application
    • Design a hybrid application (on-premises versus off-premises, including Azure),
    • Plan for session management in a distributed environment,
    • Plan web farms
  • Design and implement the Azure role life cycle
    • Identify and implement Start,
    • Run and Stop events;
    • Identify startup tasks (IIS configuration [app pool], registry configuration, third-party tools)
  • Configure state management
    • Choose a state management mechanism (in-process and out of process state management),
    • Plan for scalability,
    • Use cookies or local storage to maintain state,
    • Apply configuration settings in web.config file,
    • Implement sessionless state (for example, QueryString)
  • Design a caching strategy
    • Implement page output caching (performance oriented),
    • Implement data caching,
    • Implement HTTP caching,
    • Implement Azure caching
  • Design and implement a WebSocket strategy
    • Read and write string and binary data asynchronously (long-running data transfers),
    • Choose a connection loss strategy,
    • Decide a strategy for when to use WebSockets,
    • Implement SignalR
  • Design HTTP modules and handlers
    • Implement synchronous and asynchronous modules and handlers,
    • Choose between modules and handlers in IIS

Design the user experience (20-25%)

  • Apply the user interface design for a web application
    • Create and apply styles by using CSS,
    • Structure and lay out the user interface by using HTML,
    • Implement dynamic page content based on a design
  • Design and implement UI behaviour
    • Implement client validation,
    • Use JavaScript and the DOM to control application behaviour,
    • Extend objects by using prototypal inheritance,
    • Use AJAX to make partial page updates,
    • Implement the UI by using JQuery
  • Compose the UI layout of an application
    • Implement partials for reuse in different areas of the application,
    • Design and implement pages by using Razor templates (Razor view engine),
    • Design layouts to provide visual structure,
    • Implement master/application pages
  • Enhance application behaviour and style based on browser feature detection
    • Detect browser features and capabilities;
    • Create a web application that runs across multiple browsers and mobile devices;
    • Enhance application behaviour and style by using vendor-specific extensions, for example, CSS
  • Plan an adaptive UI layout
    • Plan to run applications in browsers on multiple devices (screen resolution, CSS, HTML),
    • Plan for mobile web applications

Develop the user experience (15-20%)

  • Plan for search engine optimization and accessibility
    • Use analytical tools to parse HTML,
    • View and evaluate conceptual structure by using plugs-in for browsers,
    • Write semantic markup (HTML5 and ARIA) for accessibility (for example, screen readers)
  • Plan and implement globalisation and localisation
    • Plan a localisation strategy;
    • Create and apply resources to UI, including JavaScript resources; set cultures; create satellite resource assemblies
  • Design and implement MVC controllers and actions
    • Apply authorisation attributes,
    • Global filters and authentication filters;
    • Specify an override filter;
    • Implement action behaviours;
    • Implement action results;
    • Implement model binding
  • Design and implement routes
    • Define a route to handle a URL pattern,
    • Apply route constraints,
    • Ignore URL patterns,
    • Add custom route parameters,
    • Define areas
  • Control application behaviour by using MVC extensibility points
    • Implement MVC filters and controller factories;
    • Control application behaviour by using action results,
    • Viewengines,
    • Model binders and route handlers
  • Reduce network bandwidth
    • Bundle and minify scripts (CSS and JavaScript),
    • Compress and decompress data (using gzip/deflate; storage),
    • Plan a content delivery network (CDN) strategy (for example, Azure CDN)

Troubleshoot and debug web applications (20-25%)

  • Prevent and troubleshoot runtime issues
    • Troubleshoot performance,
    • Security and errors;
    • Implement tracing,
    • Logging (including using attributes for logging) and debugging (including IntelliTrace);
    • Enforce conditions by using code contracts; enable and configure health monitoring (including Performance Monitor)
  • Design an exception handling strategy
    • Handle exceptions across multiple layers,
    • Display custom error pages using global.asax or creating your own HTTPHandler or set web.config attributes, handle first chance exceptions
  • Test a web application
    • Create and run unit tests (for example, use the Assert class), create mocks;
    • Create and run web tests, including using Browser Link;
    • Debug a web application in multiple browsers and mobile emulators
  • Debug an Azure application
    • Collect diagnostic information by using Azure Diagnostics API and appropriately implement on demand versus scheduled;
    • Choose log types (for example, event logs, performance counters and crash dumps);
    • Debug an Azure application by using IntelliTrace, Remote Desktop Protocol (RDP) and remote debugging;
    • Interact directly with remote Azure websites using Server Explorer.

Design and implement security (20-25%) 

  • Configure authentication
    • Authenticate users;
    • Enforce authentication settings;
    • Choose between Windows, Forms and custom authentication;
    • Manage user session by using cookies;
    • Configure membership providers;
    • Create custom membership providers;
    • Configure ASP.NET Identity
  • Configure and apply authorisation
    • Create roles,
    • Authorise roles by using configuration,
    • Authorise roles programmatically,
    • Create custom role providers,
    • Implement WCF service authorisation
  • Design and implement claims-based authentication across federated identity stores
    • Implement federated authentication by using Azure Access Control Service;
    • Create a custom security token by using Windows Identity Foundation;
    • Handle token formats (for example, oAuth, OpenID,
    • Microsoft Account, Google, Twitter and Facebook) for SAML and SWT tokens
  • Manage data integrity
    • Apply encryption to application data, apply encryption to the configuration sections of an application, sign application data to prevent tampering
  • Implement a secure site with ASP.NET
    • Secure communication by applying SSL certificates;
    • Salt and hash passwords for storage;
    • Use HTML encoding to prevent cross-site scripting attacks (ANTI-XSS Library);
    • Implement deferred validation and handle unvalidated requests, for example, form, querystring and URL;
    • Prevent SQL injection attacks by parameterising queries;
    • Prevent cross-site request forgeries (XSRF)

MVC Mind Map

  1. Caching
    1.1 ASP.NET OutputCache
    1.2 Azure – Distributed Caching
    1.3 .NET Data Access Layer Caching
    1.4 HTML5 App Cache
  2. State Management
    2.1 HttpContext.items
    2.2 Cookies
    2.3 Cache
    2.4 Session
    2.5 QueryString
    2.6 Profile
  3. MVC Views
    3.1 @HTML Helper
    3.2 @Scripts Helper
    3.3 @Styles Helper
    3.4 ViewBag  – passes data between controller and view, alternative is TempData[] –  key/value dictionary to store data similar to session but the data is deleted at the end of the HTTP request.
    3.5 Partial Views
    3.6 Razor Syntax
    3.7 Layout View
    3.8 Mobile Device Support
  4. QA
    4.1 Unit Testing
    4.2 Code Contracts
  5. Architecture
    5.1 Repository Pattern
  6. Authentication
    6.1 Membership Providers
    6.2 Forms Auth
  7. Controller
    7.1 ModelState
    7.2 MVC3 – Async Controller
    7.3 Actions(methods)
    7.3.1 Returns ActionResult
    7.3.2 Action Filters
  8. Security
    8.1 MVC AntiForgery Token
    8.2 .Net Framework – Blacklist
    8.3 AnitXSS Library
  9. ASP.NET
    9.1 HTTP Handlers
    9.2 HTTP Modules
  10. Communication
    10.1 Web Sockets
    10.2 SignalR
  11. Accessibility
    11.1 Globalisation
    11.1.1 Internationalisation
    11.1.2 Resource Files
    11.1.3 Localisation
    11.1.4 Satellite Assemblies
    11.1.5 Localised Views
    11.1.6 UICulture – Resource File Selection
    11.1.7 Culture – conversion and formatting
    11.2 ARIA
    11.3 IIS SEO toolkit
  12. MVC Filters
    12.1 ChildActionOnlyAttribute
    12.2 AuthorizeAttribute
    12.3 ValidateInputAttribute
    12.4 RequireHttpsAttribute
    12.5 ValidateAntiForgeryTokenAttribute
    12.6 HandleErrorAttribute
    12.7 Register global in FilterConfig.cs
    12.8 Register in class for Controller level
    12.9 OverrideAuthorization – MVC5
  13. MVC Value Providers
    13.1 RouteDataValueProvider
    13.2 HttpFileCollectionValueProvider
    13.3 FormsValueProvider
    13.4 QueryStringProvider
  14. MVC ActionResult
    14.1 ViewResult – Inherits from ViewResultBase
    14.2 RedirectResult – URL
    14.3 JsonResult
    14.4 JavaScriptResult
    14.5 FileResult
    14.6 ContentResult
    14.7 EmptyResult
    14.8 RedirectToRouteResult
    14.9 PartialViewResult – Inherits from ViewResultBase – AJAX
  15. Routing
    15.1 Routecollection – Stores routes
    15.2 Constraints
    15.3 routes.ignore
    15.4 MapPageRoute – Web forms
    15.5 Attribute routing – routes.MapMvcAttributeRoutes()
  16. Javascript
    16.1 Jquery
    16.2 Prototypes
    16.3 MVC Client Side Validation
  17. Model
    17.1 Data Annotatons
    17.1.1 DataType
    17.1.2 Range
    17.1.3 Required
    17.1.4 StringLength
    17.1.5 RegularExpression
    17.1.6 Remote – Client Side
    17.2 Binders
  18. Performance Optimization
    18.1 Bundling
    18.2 Minification
    18.3 IIS Content Compression
    18.4 CDN
    18.5 Visual Studio Profiling
    18.6 Windows Performance Monitor
  19. Diagnostics
    19.1 Visual Studio Intellitrace
    19.2 MVC Exception Handling
    19.2.1 OnException
    19.2.2 HandleErrorAttribute
    19.3 Windows Azure Diagnostics

Materials:

http://failedturing.blogspot.com/search/label/70-486

http://www.codingwebapps.com/category/asp-net-mvc/asp-net-mvc-certification-exam-70-486/

http://www.codingwebapps.com/microsoft-asp-net-mvc-certification-exam-70-486-plan-the-application-layers/

Reference 

Live as if you were to die tomorrow. Learn as if you were to live forever.. -Mahatma Gandhi

HTML 5: Web Storage vs Cookies

Web Storage and Cookies are used to store data on client side. Both got its own storage and expiration limits.

The benefits of using web storage and cookies is that more secure and large amounts of data can be stored locally and not affecting the website performance.

Note:

  • Some browsers have cookies disabled then local storage is the best option to use.
  • local storage are vulnerable to XSS attacks

Web Storage

The web storage limit is 5MB and data is never transferred to the server, it remains with the client side. The storage is per domain or protocol.

Web storage allow you to store JavaScript primitives but not Objects or Arrays.

Objects:

  1. window.localStorage – stores data with no expiration date or can use javascript to clear or use clear browser cache
  2. window.sessionStorage – stores data for one session lost when the browser tab is closed

Syntax to check if browser support web storage

if (typeof(Storage) !== "undefined") {
console.log("HTML 5 support");
} else {
console.log("no support");
}

localStorage and sessionStorage are perfect for persisting non-sensitive data needed within client scripts between pages, for example: preferences, scores in games.

Cookies

Cookies are included in every server request and it is mainly used for server-side reading. Cookies allow you to store strings.

Cookies are used for authentication purposes and persistence of user data, all cookies valid for a page are sent from the browser to the server for every request to the same domain – this includes the original page request, any subsequent Ajax requests, all images, style-sheets, scripts and fonts.