Tutorial by Examples: c

If you are using UIViewControllerContainment there are a few other methods that are worth looking at. When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen in Swift class RootViewController: UIViewController { ...
This topic demonstrates how to use functions like withColumn, lead, lag, Level etc using Spark. Spark dataframe is an sql abstract layer on spark core functionalities. This enable user to write SQL on distributed data. Spark SQL supports hetrogenous file formats including JSON, XML, CSV , TSV etc. ...
Prerequisites: Apple Developers Account Setup GameCenter Leaderboards with iTunesConnect Setting up GameCenter Leaderboards: Sign in to iTunesConnect Go to My Apps. Create an app for your project then go to Features. Click on Game Center Click the plus sign next to Leaderboards. Choose...
This class holds predicate filters values. public class QueryFilter { public string PropertyName { get; set; } public string Value { get; set; } public Operator Operator { get; set; } // In the query {a => a.Name.Equals("Pedro")} // Property name to filter ...
ConstantExpression must be the same type of the MemberExpression. The value in this example is a string, which is converted before creating the ConstantExpression instance. private static ConstantExpression GetConstant(Type type, string value) { // Discover the type, convert it, and create Co...
In this very first example, a basic serial write operation is started from an Arduino device. void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.println("Hello World!"); dela...
/** *@NApiVersion 2.x *@NScriptType Suitelet */ define([],function() { // NetSuite's AMD pattern function onRequest_entry(context) { // Suitelet entry function receives a context obj context.response.write('Hello World'); // Write a response using the context obj } retu...
If you want to append a series of values [1,2] to the column of dataframe df, you will get NaNs: import pandas as pd series=pd.Series([1,2]) df=pd.DataFrame(index=[3,4]) df['col']=series df col 3 NaN 4 NaN because setting a new column automatically aligns the data by the inde...
The latest JVMs supports Garbage First GC ( G1 GC) and consists of set of regions which accumulate to make young and old generation. The JVM will have approximately 2048 reagions and set heap region size accordingly from 1 MB to 32 MB and power of 2 bounds. This is important parameter which decide ...
COMPUTE answer = 3*var-1 That is a reference to the variable var-1, and not var - 1. COMPUTE answer = 3 * var - 1 Recommended, opinion.
Luminus is a Clojure micro-framework based on a set of lightweight libraries. It aims to provide a robust, scalable, and easy to use platform. With Luminus you can focus on developing your app the way you want without any distractions. It also has very good documentation that covers some of the majo...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...
Scenario: You need to resolve a dependency when a method is called, not in the constructor. Solution: Inject an abstract factory into the constructor. When the method is called, it requests the dependency from the abstract factory, which in turn resolves it from the container. (Your class depends o...
const Promise = require('bluebird'), fs = require('fs') Promise.promisifyAll(fs) // now you can use promise based methods on 'fs' with the Async suffix fs.readFileAsync('file.txt').then(contents => { console.log(contents) }).catch(err => { console.error('error reading', er...
Example of map: Promise.resolve([ 1, 2, 3 ]).map(el => { return Promise.resolve(el * el) // return some async operation in real world }) Example of filter: Promise.resolve([ 1, 2, 3 ]).filter(el => { return Promise.resolve(el % 2 === 0) // return some async operation in real world...
const promiseReturningFunction = Promise.coroutine(function* (file) { const data = yield fs.readFileAsync(file) // this returns a Promise and resolves to the file contents return data.toString().toUpperCase() }) promiseReturningFunction('file.txt').then(console.log)
function somethingThatReturnsADisposableResource() { return getSomeResourceAsync(...).disposer(resource => { resource.dispose() }) } Promise.using(somethingThatReturnsADisposableResource(), resource => { // use the resource here, the disposer will automatically close it when ...
Promise.resolve([1, 2, 3]) .mapSeries(el => Promise.resolve(el * el)) // in real world, use Promise returning async function .then(console.log)
describe('Suite Name', function() { describe('#method()', function() { it('should run without an error', function() { expect([ 1, 2, 3 ].length).to.be.equal(3) }) }) })
var expect = require("chai").expect; describe('Suite Name', function() { describe('#method()', function() { it('should run without an error', function(done) { testSomething(err => { expect(err).to.not.be.equal(null) done() }) }) }) }) ...

Page 569 of 826