Tutorial by Examples: asp

If a covariant type appears as an output, the containing type is covariant. Producing a producer of Ts is like producing Ts. interface IReturnCovariant<out T> { IEnumerable<T> GetTs(); } If a contravariant type appears as an output, the containing type is contravariant. Produc...
With ASP.NET Core 1.0, the MVC and Web API framework have been merged into one framework called ASP.NET Core MVC. This is a good thing, since MVC and Web API share a lot of functionality, yet there always were subtle differences and code duplication. However, merging these two into framework one ...
Any predicate function can be used as a spec. Here's a simple example: (clojure.spec/valid? odd? 1) ;;=> true (clojure.spec/valid? odd? 2) ;;=> false the valid? function will take a spec and a value and return true if the value conforms to the spec and false otherwise. One other inte...
Let's say we have the following function: (defn nat-num-count [nums] (count (remove neg? nums))) We can write a spec for this function by defining a function spec of the same name: (clojure.spec/fdef nat-num-count :args (s/cat :nums (s/coll-of number?)) :ret integer? ...
ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code you...
In ASP.NET Web API, a controller is a class that handles HTTP requests. The public methods of the controller are called action methods or simply actions. When the Web API framework receives a request, it routes the request to an action. To determine which action to invoke, the framework uses a rou...
To get version 5394 use: svn co --revision r5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or the shorter version: svn co -r 5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or by using pegged revisions: svn co https://svn.example.com/svn/MyRepo/MyProject/trunk@5394 If al...
Classic unit tests test state, but it can be impossible to properly test methods whose behavior depends on other classes through state. We test these methods through interaction tests, which verify that the system under test correctly calls its collaborators. Since the collaborators have their own...
You can write the default protocol implementation for a specific class. protocol MyProtocol { func doSomething() } extension MyProtocol where Self: UIViewController { func doSomething() { print("UIViewController default protocol implementation") } } class M...
go() method The go() method loads a specific URL from the history list. The parameter can either be a number which goes to the URL within the specific position (-1 goes back one page, 1 goes forward one page), or a string. The string must be a partial or full URL, and the function will go to the f...
To install v6.x update the packages curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - Using the apt package manager sudo apt-get install -y nodejs
What? : A fully supported and extensible framework for building HTTP based endpoints. In the world of HTML5, mobile devices, and modern development techniques HTTP have become the default option for building rich, scalable services. The ASP.NET Web API provides an easy to use set of default options...
ClientContext clientContext = new ClientContext(siteUrl); SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements"); CamlQuery camlQuery = new CamlQuery(); ListItemCollection collListItem = oList.GetItems(camlQuery); clientContext.Load( collListItem, items =>...
from datetime import datetime import pandas_datareader.data as wb stocklist = ['AAPL','GOOG','FB','AMZN','COP'] start = datetime(2016,6,8) end = datetime(2016,6,11) p = wb.DataReader(stocklist, 'yahoo',start,end) p - is a pandas panel, with which we can do funny things: let's see what...
from scipy.sparse import csr_matrix A = csr_matrix([[1,0,2],[0,3,0]]) >>>A <2x3 sparse matrix of type '<type 'numpy.int64'>' with 3 stored elements in Compressed Sparse Row format> >>> A.todense() matrix([[1, 0, 2], [0, 3, 0]]) >>&g...
In SpriteKit a Sprite is represented by the SKSpriteNode class (which inherits from SKNode). First of all create a new Xcode Project based on the SpriteKit template as described in Your First SpriteKit Game. Creating a Sprite Now you can create a SKSpriteNode using an image loaded into the Assets...
XML <Galaxy> <name>Milky Way</name> <CelestialObject name="Earth" type="planet"/> <CelestialObject name="Sun" type="star"/> </Galaxy> XPATH /Galaxy/*[@name] or //*[@name] OUTPUT <CelestialObje...
XML <Galaxy> <name>Milky Way</name> <CelestialObject name="Earth" type="planet"/> <CelestialObject name="Sun" type="star"/> </Galaxy> XPATH /Galaxy/*[@name='Sun'] or //*[@name='Sun'] OUTPUT <C...
To clone a specific branch of a repository, type --branch <branch name> before the repository url: git clone --branch <branch name> <url> [directory] To use the shorthand option for --branch, type -b. This command downloads entire repository and checks out <branch name>. ...
If you've got multiple implementations of the same interface, Spring can autowire them all into a collection object. I'm going to use an example using a Validator pattern1 Foo Class: public class Foo { private String name; private String emailAddress; private String errorMessage;...

Page 2 of 8