Having fun with… HTML5 and CSS3

For my 70-480 certificate I started a learning group a few years ago and following links have been ridiculous impressive to us – better don’t visit them! 😀

WebGL

Chrome Experiments: Rome – use mouse (not touch), wait till the end, fly around and enjoy. Will you find the heart too?

ROME has even a build tool.


Canvas

21 Ridiculously Impressive HTML5 Canvas Experiments

Chrome Experiments: The Cloth Simulation

Mr Speaker presents: Parcycle. A HTML5 Canvas Particle System


Mixed Technologies

Chrome Experiments: Overview

Getting started with ES6 using VS Code and Lite Server

For learning ES6 online editors like jsbin and plnkr are suboptimal. See following example where I want to access the DOM: http://next.plnkr.co/edit/w1lrKNNCXpYbJqAr

plnkr-security-error

I recommend using Visual Studio Code with Lite Server from John Papa.

First you need to install Node.js – see my post Angular with Visual Studio Code – Getting Started.

Then you can install the Lite Server – see following post. You can jump to step 2 since you already installed Node.js: Visual Studio Code and local web server from Laurent Duveau.

That’s it – just type npm start for starting the server!

vs-code-with-lite-server

Angular with Visual Studio Code – Getting Started [Update]

Here’s a little step-by-step guide to get started with learning Angular 6. My preferred editor is Visual Studio Code so let’s get go! 🙂

1) Install packages the right way

I would strongly recommend to begin with Angular’s best practices. Using Angular CLI  makes your life easy – it already follows their best practices!

So: begin with …

2) Installing NVM – “Node Version Manager”

Why? Because using Node Version Manager fixes a lot of issues with Angular CLI. Here’s how to install it on Windows machines and here’s how to install on Linux/OS. For Windows go to the releases page and find Latest release. Under Assets you can download the file nvm-setup.zip and install it.
Now you can…

3) Install Node.js via NVM

Node.js is the compiler. Important: don’t use the download from Node.js since that would install Node.js paralell and not managed via NVM. Since NVM has Node.js “on board” you can install it by simply entering nvm install latest in the command line interface. Now switch to use this latest specified version by entering nvm use <version>:

nvm-use

This is my console output:

H:\>nvm use 10.10.0
Now using node v10.10.0 (64-bit)

4) Install Angular CLI

Here’s the GitHub guide how to install it. Please take care of the prerequisites.

That’s it! As David Walsh wrote – see link:

nvm has been a lifesaver for me, especially when troubleshooting issues in projects where the user may have more than one Node.js version.

Java Frameworks, Tools and Technologies Landscape Report 2016 | zeroturnaround.com

“Which Java frameworks, tools and technologies did Java developer use in 2016?”

Over 2.000 developers took part to answer this question from the 2016 survey of ZeroTurnaround. Following report shows the result: the tools and technologies Java developers use – Java frameworks, IDEs, build, tools, servers, databases, and so on.

The 2017 report may be released soon (June 2017) – stay tuned.

Java Frameworks, Tools and Technologies Landscape Report 2016

You can find the complete post here: Java Tools and Technologies Landscape Report 2016 | zeroturnaround.com

Step-by-Step: Microsoft Azure Free Trial – Create a Farm with the Azure Template ‘SharePoint Server Farm’

Following step-by-step guide helps you to use the Azure template “SharePoint server farm” though you have a Azure free trial account.

Microsoft offers a free trial account with $200 credit that lets you evaluate Azure for a month. But it seems like you can’t use the Azure template SharePoint server farm when you have a trial account. Well you can use it – I found a way that I want to share with you.

Explanation

microsoft-azure-logo_300x150
To set up a development environment for Microsoft Azure you can choose between two different deployment models:

  • Classic: create and configure every single resource (virtual networks, virtual machines, etc.) by yourself
  • Azure Resource Manager (ARM): group resources and automate with quickstart templates

Only with ARM it is possible to use a Azure template (ARM template). Of course the second model is considerably more faster and would be the favorite one. After the preparation was done it took about 30 Minutes to deploy a complete SharePoint three tier small farm!

You can find a lot of guides for the classic deployment (see link list at the end of this post), but nearly no information about the second one. Microsoft states, that you can’t use SharePoint server farm templatess with a trial account, see following screenshot of the Microsoft page Create SharePoint server farms.

2016-04-14 09_40_44-Create SharePoint server farms _ Microsoft Azure_org
Here’s the good news: you CAN use it!  🙂
Just use following Step-by-Step guide.

Read More

Deepening the Understanding of Chrome Dev Tools

I found two amazing sources that help to understand the Chrome Dev Tools that I want to share with you.

16 Ways to Search, Find and Edit with Chrome DevTools | Telerik Blogs

Cody Lindley – one of the contributors of jQuery – demonstrates 16 various ways to search, find and edit within the source code of a site using Chrome Developer Tools.

You can find the complete post here: 16 Ways to Search, Find and Edit with Chrome DevTools | Telerik Blogs

Chrome Dev Tools – Tips and Tricks

Another great source for a deeper understanding of Chrome Dev Tools is the Tips and Tricks section of the Chrome documentation.

Chrome Dev Tools - Tips and Tricks

You can find the complete article here: Tips and Tricks | Chrome Dev Tools documentation

Coding Guidelines

As a fan of clean code I like coding guidelines that raise the quality of code by regulating the design and development of code.

Common Design Fundamentals

Probably one of the best known examples is the “Microsoft Application Architecture Guide” that can be found here:
https://msdn.microsoft.com/en-us/library/ff650706.aspx

Cover of 'Application Architecture Guide' v2

Hint: better use the Pdf or the site map at the bottom of the page instead of the left navigation because it doesn’t show all content. And avoid other languages since the breadcrumb is missing completely.

Here you can find an overview of the key principles:
https://msdn.microsoft.com/en-us/library/ee658124.aspx

And here you can find the key principles in detail:
https://msdn.microsoft.com/en-us/library/ee658116.aspx

Web Design Fundamentals

Within this guide you find a complete chapter that applies to designing web applications:
https://msdn.microsoft.com/en-us/library/ee658099.aspx

SharePoint Design Fundamentals

When you dig deeper you can find guidelines for designing and developing SharePoint applications as well: https://msdn.microsoft.com/en-us/library/ff650022.aspx

Note:
obviously the Microsoft patterns & practices page is about to be moved to azurewebsites.net as you can see on the home page: http://pnp.azurewebsites.net/
So don’t be irritated that some content still can be found on the msdn page itself: http://msdn.microsoft.com/en-us/library/ff921345.aspx
(as you can see on the about page: http://pnp.azurewebsites.net/pages/about, section ‘Explore the patterns & practices catalog.’)

Diagnosing ASP.NET MVC Problems | Brad Wilson

If you want to find out why your MVC application isn’t working you can use MvcDiagnostics. It’s a single WebForms page can be dropped into any MVC site, and then viewed in your browser.

 

You can find a detailed explanation here: Diagnosing ASP.NET MVC Problems | Blog ‘Brad Wilson’

Here’s how to install this tool: ASP.NET MVC Diagnostics Using NuGet | Blog ‘You’ve Been Haacked’

Don’t worry about the old blog post date – this tool is up to date: Microsoft ASP.NET MVC Diagnostics 5.2.3 | NuGet Gallery

How ASP.NET MVC works

How does ASP.NET MVC work? In following post you can learn how it works and that its magic – the loose coupling – comes from convention.

Why do i say magic? Because with the loose coupling of its components Model, View and Controller the code is way more readable and testable (to name only two).

How ASP.NET MVC works

The convention of ASP.NET MVC is that you can set a name in one component just like you want. But you have to repeat this name exactly in the other component.

A home controller

This is an example of a main controller that covers pages like Home, About, Privacy Policy, etc. In following image Home is such a name. You can choose the name by your own, but you have to repeat it exactly: Home2Controller won’t work (the convention sometimes adds a keyword like Controller). Another example for such a name is About.

  1. User clicks on button About, sends get request with URL [Path]/Home/About
  2. MVC searches for the HomeController
  3. Retrieves model (in our case empty)
  4. Looks for the view About
  5. Browser receives answer from MVC application and shows page with URL [Path]/Home/About

Please click on the image to see it full size:

How ASP.NET MVC works - home controller
How ASP.NET MVC works – home controller *

 

A list controller

Another typical use case you can find in many tutorials is a list controller. In following example I refer to the tutorial Getting Started with ASP.NET MVC 5 from the ASP.NET page.

The controller handles list overview views and list item views. Lets say the user requests a list item with the id = 1. That means

  1. User clicks on URL www.yourdomain.com/movies/details/1 –
    = sends get request with URL [Path]/[Controller]/[ActionName]/[Parameters]
  2. MVC searches for the MoviesController
  3. Retrieves model – in our case a movies database item with the id 1
  4. Looks for the view Details
  5. Controller sends the view Details containing the retrieved model (in Razor: code line “@model“) to browser, a page is shown with URL [Path]/movies/details/id

Then you got:

How ASP.NET MVC works - list controller
How ASP.NET MVC works – list controller *

 

I hope this helped a little bit to clarify how ASP.NET MVC works (it helped me a lot and i use it often when I do some tutorials).

Further Links

For a beginner tutorial I recommend following ASP.NET MVC Getting Started tutorial: http://www.asp.net/mvc/overview/getting-started/introduction/getting-started

You can find her basics about the MVC execution process: http://www.asp.net/mvc/overview/older-versions-1/overview/understanding-the-asp-net-mvc-execution-process

And if you want to dig deeper here a long post from Scott:   🙂 http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx

* Following article helped me with the diagrams, it is a very good introduction as well:
http://www.codeproject.com/Articles/620195/Learning-MVC-Part-Introduction-to-MVC-Architectu

How MVC works – another simple and helpful introduction:
http://www.jquery2dotnet.com/2013/05/how-mvc-works.html

[Updates: made the colors more clear, added list controller example; added two links]

Lambda expression in @Html.DisplayFor(modelItem => item.FirstName)

I found a very good explanation about the Lambda expression in @Html.DisplayFor(modelItem => item.FirstName), see Link below.

Summary

As the author wrote, a lambda expression is a way to write an anonymous function. As a summary you can find here the lambda expression and its anonymous function it could be translated logically.

Common lambda expression

(x => x.Name)

>>>>>> translates to >>>>>>

string Function(Data x) 
{ 
 return x.Name 
}

Lambda expression without left-side parameter

(() => someVariable)

>>>>>> translates to >>>>>>

string Function() 
{ 
 return someVariable; 
}

Lambda expression in @Html.DisplayFor(model => item.FirstName)

model => item.FirstName

>>>>>> translates to >>>>>>

string Function(Model model) 
{ 
 return item.FirstName; 
}

apple-touch-icon@2

Here you find the complete post: I want to understand the lambda expression in @Html.DisplayFor(modelItem => item.FirstName)