Tutorial by Examples: c

This is how the Asset Catalog in Xamarin Studio looks like, As shown in above picture there are 5 types of assets you can create within the catalog. I will cover only image set, because its the simplest one. When you create a new image set. You will get options like this To add images to the...
A path through every vertex exactly once is the same as ordering the vertex in some way. Thus, to calculate the minimum cost of travelling through every vertex exactly once, we can brute force every single one of the N! permutations of the numbers from 1 to N. Psuedocode minimum = INF for all per...
Notice that if we consider the path (in order): (1,2,3,4,6,0,5,7) and the path (1,2,3,5,0,6,7,4) The cost of going from vertex 1 to vertex 2 to vertex 3 remains the same, so why must it be recalculated? This result can be saved for later use. Let dp[bitmask][vertex] represent the minimum c...
db.collection.createIndex() method is used to create a 2dsphere index. The blueprint of a 2dsphere index : db.collection.createIndex( { <location field> : "2dsphere" } ) Here, the location field is the key and 2dsphere is the type of the index. In the following example we are goi...
NOTE: for best results, make sure your project was created using the Angular-CLI. npm install angular/{core,common,compiler,platform-browser,platform-browser-dynamic,http,router,forms,compiler-cli,tsc-wrapped,platform-server} You don't have to do this step if you project already has angular 2 an...
... "angularCompilerOptions": { "genDir": "./ngfactory" } ... This is the output folder of the compiler.
from the root of your project ./node_modules/.bin/ngc -p src where src is where all your angular 2 code lives. This will generate a folder called ngfactory where all your compiled code will live. "node_modules/.bin/ngc" -p src for windows
// this is the static platform browser, the usual counterpart is @angular/platform-browser-dynamic. import { platformBrowser } from '@angular/platform-browser'; // this is generated by the angular compiler import { AppModuleNgFactory } from './ngfactory/app/app.module.ngfactory'; // note the...
Once you've installed react and react-router, Its time to use both of them together. The syntax is very simple, you specify the url and the component you want to render when that url is opened <Route path="hello" component={ HelloComponent } /> This means when the url path is hell...
When user enters an URL, for example: http://example-website.com/Example/HelloWorld, MVC application will use the routing rules to parse this url and extract the subpath, that will determine the controller, action and possible parameters. For the above url, the result will be /Example/HelloWorld, wh...
If there would be another value in the URL like: /Example/ProcessInput/2, the routing rules will threat the last number as a parameter passed into the action ProcessInput of controller Example. public ActionResult ProcessInput(int number) { ViewData["OutputMessage"] = string.format(...
Using a small transparent image called empty.png public class MyPage : ContentPage { public Page() { if (Device.OS == TargetPlatform.Android) NavigationPage.SetTitleIcon(this, "empty.png"); } }
Makes entering numbers a bit handier by showing a set of arrows on the right side of the input. HTML <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script&gt...
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var foo = new Dependency(); var bar = new ClassWithDependency(); bar.DoSomething(foo); //Inject dependency as method parameter ...
At its core a perceptron model is one of the simplest supervised learning algorithms for binary classification. It is a type of linear classifier, i.e. a classification algorithm that makes its predictions based on a linear predictor function combining a set of weights with the feature vector. A ...
In this example I will go through the implementation of the perceptron model in C++ so that you can get a better idea of how it works. First things first it is a good practice to write down a simple algorithm of what we want to do. Algorithm: Make a the vector for the weights and initialize it ...
When we write an Web application in Grails, to deploy the application we need a "war" file that need's to be put in the servlet container (Tomcat etc). First goto the project directory : cd to_project_directory War file creation from command prompt : grails war 2.Its always r...
By default, all attributes are escaped (replacing special characters with escape sequences) to prevent attacks such as cross site scripting. If you need to use special characters you can use != instead of =. Code: div(escaped="<code>") div(unescaped!="<code>") R...
The class attribute can be a string (like any normal attribute) but it can also be an array of class names, which is handy when generated from JavaScript. Code: - var classes = ['foo', 'bar', 'baz'] a(class=classes) //- the class attribute may also be repeated to merge arrays a.bing(class=class...
Classes may be defined using a .classname syntax: Code: a.button Result: <a class="button"></a> Since div's are such a common choice of tag, it is the default if you omit the tag name: Code: .content Result: <div class="content"></div>

Page 562 of 826