Tutorial by Examples: sin

Open phone's settings open battery open menu and select "battery optimization" from the dropdown menu select "all apps" select the app you want to whitelist select "don't optimize" Now this app will show under not optimized apps. An app can check whether it's...
Let's say you've got a table of loans, and another related table of parcels, where each loan can have one or more parcels associated with it. If you want a query to show each loan and a list of all its associated parcels, but you only want each loan to show up once, then you could use something lik...
Project is following the structure from the Angular2 Quickstart guide here. RootOfProject | +-- app | |-- app.component.ts | |-- main.ts | |-- pipeUser.component.ts | \-- sanitize.pipe.ts | |-- index.html |-- main.html |-- pipe.html main.ts import { bootstrap } from '@angu...
Real life use cases for Singleton pattern; If you are developing a client-server application, you need single instrance of ConnectionManager, which manages the life cycle of client connections. The basic APIs in ConnectionManager : registerConnection: Add new connection to existing list of connec...
A processing instruction is used to directly pass on some information or instruction to the application via the parser. <?my-application some instructions ?> The token after the initial question mark (here my-application) is called the target and identifies the application at which the ins...
In most cases, the range_lookup is used as FALSE (an exact match). The default for this parameter is TRUE - it is less commonly used in this form, but this example shows one usecase. A supermarket gives a bonus based on the customers monthly spend. If the customer spends 250 EUR or more in a mon...
Single-quotes are literal strings, and the lack of escape characters means that the only character that can not occur inside of a single-quoted string is a single-quote. $ echo '$var \$var \\$var \\\$var' $var \$var \\$var \\\$var $ echo '"quoted string"' "quoted string" $ e...
h = 1.0 / n; #pragma omp parallel for private(x) shared(n, h) reduction(+:area) for (i = 1; i <= n; i++) { x = h * (i - 0.5); area += (4.0 / (1.0 + x*x)); } pi = h * area; In this example, each threads execute a subset of the iteration count. Each thread has its local private copy ...
h = 1.0 / n; #pragma omp parallel for private(x) shared(n, h, area) for (i = 1; i <= n; i++) { x = h * (i - 0.5); #pragma omp critical { area += (4.0 / (1.0 + x*x)); } } pi = h * area; In this example, each threads execute a subset of the iteration count and they accumul...
h = 1.0 / n; #pragma omp parallel for private(x) shared(n, h, area) for (i = 1; i <= n; i++) { x = h * (i - 0.5); #pragma atomic area += (4.0 / (1.0 + x*x)); } pi = h * area; In this example, each threads execute a subset of the iteration count and they accumulate atomically int...
Installing software via APT (Advanced Package Tool) also know as 'apt-get'. To install Mozilla Firefox: Open a Terminal (Ctrl+Alt+T) Type sudo apt-get install firefox Hit Enter When it asks to install type 'Y' to confirm. Software will be downloaded and installed.
Transaction using JDBC driver is used to control how and when a transaction should commit and rollback. Connection to MySQL server is created using JDBC driver JDBC driver for MySQL can be downloaded here Lets start with getting a connection to database using JDBC driver Class.forName("com.m...
Protractor needs only two files to run the first test, spec (test code) file and configuration file. The spec file contains test code and the other one contains configuration details like spec file path, browser details, test url, framework parameters etc. To write first test we will be providing on...
var baseLayer = new ol.layer.Tile({ visible: true, preload: Infinity, source: new ol.source.BingMaps({ // We need a key to get the layer from the provider. // Sign in with Bing Maps and you will get your key (for free) key: 'Ap9VqFbJYRNkatdxt3KyzfJxXN_9GlfA...
from neo4jrestclient import client q = 'MATCH (u:User)-[r:likes]->(m:language) WHERE u.name="Marco" RETURN u, type(r), m' "db" as defined above results = db.query(q, returns=(client.Node, str, client.Node)) Print results for r in results: print("(%s)-[%s]->...
$response = Requests::post("https://content.dropboxapi.com/2/files/download", array( 'Authorization' => "Bearer <ACCESS_TOKEN>", 'Dropbox-Api-Arg' => json_encode(array('path' => '/test.txt')), )); $fileContent = $response->body; $metadata = json_d...
Node.js apis can be easily constructed in Express web framework. Following example creates a simple GET api for listing all users. Example var express = require('express'); var app = express(); var users =[{ id: 1, name: "John Doe", age : 23, e...
Following example create POST api using Express. This example is similar to GET example except the use of body-parser that parses the post data and add it to req.body. Example var express = require('express'); var app = express(); // for parsing the body in POST request var bodyParser = require...
SciPy provides basic image manipulation functions. These include functions to read images from disk into numpy arrays, to write numpy arrays to disk as images, and to resize images. In the following code, only one image is used. It is tinted, resized, and saved. Both original and resulting images a...
SQLite.NET is an open source library which makes it possible to add local-databases support using SQLite version 3 in a Xamarin.Forms project. The steps below demonstrate how to include this component in a Xamarin.Forms Shared Project: Download the latest version of the SQLite.cs class and add...

Page 100 of 161