Tutorial by Examples: c

angular.module("app") .service("counterService", ["fooService", "barService", function(anotherService, barService){ var service = { number: 0, foo: function () { return fooService.bazMethod(); // Use of 'fooService' ...
Data races occur when a piece of memory is updated by one party while another tries to read or update it simultaneously (without synchronization between the two). Let's look at the classic example of a data race using a shared counter. use std::cell::UnsafeCell; use std::sync::Arc; use std::threa...
NativeScript's global timer variable lets you set timeouts and intervals for asynchronous delayed function calls. Importing var timer = require("timer") Timeouts var callback = function(){ console.log("I will be executed once after 500ms"); } var timeoutId = timer.se...
From the Tools menu, select NuGet Package Manager > Package Manager Console. In the Package Manager Console window, type: Install-Package Microsoft.AspNet.Odata This command installs the latest OData NuGet packages.
Open the file App_Start/WebApiConfig.cs. Add the following using statements: using ProductService.Models; using System.Web.OData.Builder; using System.Web.OData.Extensions; Then add the following code to the Register method: public static class WebApiConfig { public static void Register...
A controller is a class that handles HTTP requests. You create a separate controller for each entity set in your OData service. In this tutorial, you will create one controller, for the Product entity. In Solution Explorer, right-click the Controllers folder and select Add > Class. Name the clas...
Querying the Entity Set Add the following methods to ProductsController. [EnableQuery] public IQueryable<Product> Get() { return db.Products; } [EnableQuery] public SingleResult<Product> Get([FromODataUri] int key) { IQueryable<Product> result = db.Products.Wher...
Security is a critical piece of any programming technology or framework for implementing service - oriented applications WCF has been built from the ground up for providing the necessary security infrastructure at the message and service level. In the following sections, you see how to use many...
<bindings > <wsHttpBinding > <binding name="mybinding" > <security mode="Transport" > <transport clientCredentialType="Basic"/ > </security > </binding > </wsHttpBinding > </bindings > ...
To create a new collection "class": var Books = Backbone.Collection.extend({ // books will be sorted by title comparator: "title", initialize: function(models, options) { options = options || {}; // (Optional) you can play with the models her...
We need to define a collection with a url property. This is the url to an API endpoint which should return a json formatted array. var Books = Backbone.Collection.extend({ url: "/api/book", comparator: "title", }); Then, within a view, we'll fetch and render asynch...
In features/documentation.feature: Feature: Documentation Scenario: User views documentation When I go to the "Cucumber" documentation Then I should see the "Cucumber" documentation A minimal feature has a Feature line and a Scenario with one or more steps begi...
Here’re some basic JUnit annotations you should understand: @BeforeClass – Run once before any of the test methods in the class, public static void @AfterClass – Run once after all the tests in the class has been run, public static void @Before – Run before @Test, public void @After – Run after...
We can provide a meaningful name for our constructors. We can provide several constructors with the same number and type of parameters, something that as we saw earlier we can’t do with class constructors. public class RandomIntGenerator { private final int min; private final int max; ...
We can avoid providing direct access to resource intensive constructors, like for databases. public class DbConnection { private static final int MAX_CONNS = 100; private static int totalConnections = 0; private static Set<DbConnection> availableConnections = new HashSet<DbConnectio...
We can limit no of rows from result using rownum clause select * from ( select val from mytable ) where rownum<=5 If we want first or last record then we want order by clause in inner query that will give result based on order. Last Five Record : select * from ( select val f...
Get localized product information from a set of product identifier strings using SKProductsRequest: import StoreKit let productIdentifierSet = Set(["yellowSubmarine", "pennyLane"]) let productsRequest = SKProductsRequest(productIdentifiers: productIdentifierSet) In order ...
OpenSSH config files are used for configuration that should be applied every time the ssh client is run. Most command line options are possible to put in the config files. OpenSSH uses configuration from the following sources in order: Command line options User's configuration file ~/.ssh/confi...
HTTPS HTTPS (also called HTTP over TLS,[1][2] HTTP over SSL,[3] and HTTP Secure[4][5]) is a protocol for secure communication over a computer network which is widely used on the Internet. HTTPS consists of communication over Hypertext Transfer Protocol (HTTP) within a connection encrypted by Transp...
Create a Laravel application: $ composer create-project laravel/laravel hello-world Navigate to the project folder, e.g. $ cd C:\xampp\htdocs\hello-world Create a controller: $ php artisan make:controller HelloController --resource This will create the file app/Http/Con...

Page 515 of 826