Tutorial by Examples

Assuming your view is strongly typed to a view model like public class CreateProduct { public string Name { set; get; } } And you are passing an object of this to the view from your action method. @model CreateProduct <form asp-action="create" asp-controller="Home"...
Assuming your view is strongly typed to a view model like this public class CreateProduct { public IEnumerable<SelectListItem> Categories { set; get; } public int SelectedCategory { set; get; } } And in your GET action method, you are creating an object of this view model,...
Machine code is term for the data in particular native machine format, which are directly processed by the machine - usually by the processor called CPU (Central Processing Unit). Common computer architecture (von Neumann architecture) consist of general purpose processor (CPU), general purpose mem...
Extension methods enable you to simplify your interface definitions by only including core required functionality in the interface itself and allowing you to define convenience methods and overloads as extension methods. Interfaces with fewer methods are easier to implement in new classes. Keeping o...
An interface is a definition of a contract between the user of the interface and the class that implement it. One way to think of an interface is as a declaration that an object can perform certain functions. Let's say that we define an interface IShape to represent different type of shapes, we exp...
Shiny can run as a standalone application on your local computer, on a server that can provide shiny apps to multiple users (using shiny server), or on shinyapps.io. Installing Shiny on a local computer: in R/RStudio, run install.packages("shiny") if installing from CRAN, or devtools::i...
// Converts the string representation of a date and time to its DateTime equivalent var dateTime = DateTime.Parse("14:23 22 Jul 2016"); Console.WriteLine(dateTime.ToString());
// Converts the specified string representation of a date and time to its DateTime equivalent and returns a value that indicates whether the conversion succeeded string[] dateTimeStrings = new []{ "14:23 22 Jul 2016", "99:23 2x Jul 2016", "22/7/2016 14:23:0...
Data from a POST request is stored in the superglobal $_POST in the form of an associative array. Note that accessing a non-existent array item generates a notice, so existence should always be checked with the isset() or empty() functions, or the null coalesce operator. Example: $from = isset($_...
Data from a GET request is stored in the superglobal $_GET in the form of an associative array. Note that accessing a non-existent array item generates a notice, so existence should always be checked with the isset() or empty() functions, or the null coalesce operator. Example: (for URL /topics.ph...
Quickstart for Jekyll $ gem install jekyll $ jekyll new my-awesome-site $ cd my-awesome-site ~/my-awesome-site $ jekyll serve Now browse to http://localhost:4000 Quickstart for Jekyll with Bundler $ gem install jekyll bundler $ jekyll new my-awesome-site $ cd my-awesome-site ~/my...
First, we'll need to do some setup to get HStoreField working. make sure django.contrib.postgres is in your `INSTALLED_APPS Add HStoreExtension to your migrations. Remember to put HStoreExtension before any CreateModel or AddField migrations. from django.contrib.postgres.operations import HSt...
-> Note: make sure you set up HStoreField first before going on with this example. (above) No parameters are required for initializing a HStoreField. from django.contrib.postgres.fields import HStoreField from django.db import models class Catalog(models.model): name = models.C...
Pass a native python dictionary mapping strings to strings to create(). Catalog.objects.create(name='Library of Congress', titles_to_authors={ 'Using HStoreField with Django': 'CrazyPython and la communidad', 'Flabbergeists and thingamajigs': 'La Artista Fooista', 'Pro Git': 'Scott C...
Catalog.objects.filter(titles__Pro_Git='Scott Chacon and Ben Straub')
Pass a dict object to field_name__contains as a keyword argument. Catalog.objects.filter(titles__contains={ 'Pro Git': 'Scott Chacon and Ben Straub'}) Equivalent to the SQL operator `@>`.
The @while directive will loop over a block of code until the condition specified becomes false. In the following example, this loop will run until $font-size <= 18 while incrementing the value for $font-size by 2. $font-size: 12; @while $font-size <= 18 { .font-size-#{$font-size} { ...
The @for directive allows you to loop through some code for a set amount of iterations and has two forms: @for <var> from <start> through <end> {} @for <var> from <start> to <end> {} The difference in the two forms is the through and the to; the through key...
You often find yourself in a situation where you need to find a variables corresponding value, and collections got you covered. In the example below we got three different locales in an array with a corresponding calling code assigned. We want to be able to provide a locale and in return get the as...
# Fetch and install package to setup access to the official APT repository wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb sudo dpkg -i erlang-solutions_1.0_all.deb # Update package index sudo apt-get update # Install Erlang and Elixir sudo apt-get install esl-erlan...

Page 337 of 1336