Tutorial by Examples

9.0 // Since the anchor system simply returns constraints, you still need to add them somewhere. View.AddConstraints( new[] { someLabel.TopAnchor.ConstraintEqualTo(TopLayoutGuide.GetBottomAnchor()), anotherLabel.TopAnchor.ConstraintEqualTo(someLabel.BottomAnchor, 6), ...
// Using Visual Format Language requires a special look-up dictionary of names<->views. var views = new NSDictionary( nameof(someLabel), someLabel, nameof(anotherLabel), anotherLabel, nameof(oneMoreLabel), oneMoreLabel ); // It can also take a look-up dictionary for metrics (...
Eloquent also lets you query on defined relationships, as show below: User::whereHas('articles', function (Builder $query) { $query->where('published', '!=', true); })->get(); This requires that your relationship method name is articles in this case. The argument passed into the clos...
Meteor has several sample apps built-in. You can create a project with one of them and learn from how it was built. To create a sample app, install Meteor (see Getting Started) and then type: meteor create --example <app name> For example to create a sample todos app, write: meteor create...
It is possible to mount a host directory to a specific path in your container using the -v or --volume command line option. The following example will mount /etc on the host to /mnt/etc in the container: (on linux) docker run -v "/etc:/mnt/etc" alpine cat /mnt/etc/passwd (on windows) do...
$ docker run -e "ENV_VAR=foo" ubuntu /bin/bash Both -e and --env can be used to define environment variables inside of a container. It is possible to supply many environment variables using a text file: $ docker run --env-file ./env.list ubuntu /bin/bash Example environment variable...
Usage: docker logs [OPTIONS] CONTAINER Fetch the logs of a container -f, --follow=false Follow log output --help=false Print usage --since= Show logs since timestamp -t, --timestamps=false Show timestamps --tail=all Number o...
Before Python 3.5+ was released, the asyncio module used generators to mimic asynchronous calls and thus had a different syntax than the current Python 3.5 release. Python 3.x3.5 Python 3.5 introduced the async and await keywords. Note the lack of parentheses around the await func() call. import ...
Note: Uses the Python 3.5+ async/await syntax asyncio supports the use of Executor objects found in concurrent.futures for scheduling tasks asynchronously. Event loops have the function run_in_executor() which takes an Executor object, a Callable, and the Callable's parameters. Scheduling a task f...
Bad locking: std::mutex mtx; void bad_lock_example() { mtx.lock(); try { foo(); bar(); if (baz()) { mtx.unlock(); // Have to unlock on each exit point. return; } quux(); mtx.unlock(); // Normal...
By default, containers created with docker run are given a random hostname. You can give the container a different hostname by passing the --hostname flag: docker run --hostname redbox -d ubuntu:14.04
First, remove autopublish. autopublish automatically publishes the entire database to the client-side, and so the effects of publications and subscriptions cannot be seen. To remove autopublish: $ meteor remove autopublish Then you can create publications. Below is a full example. import { Mon...
A global publication does not possess a name and does not require a subscription from the connected client and therefore it is available to the connected client as soon as the client connects to the server. To achieve this, one simply names the publication as null like so Meteor.publish(null, func...
A named publication is one that possesses a name and needs to be explicitly subscribed to from the client. Consider this server side code: Meteor.publish('somePublication', function() { return SomeCollection.find() }) The client needs to request it by: Meteor.subscribe('somePublication') ...
Meteor's default templating system Spacebars and its underlying rendering subsystem Blaze integrate seemlessly with publication lifecycle methods such that a simple piece of template code can subscribe to its own data, stop and clean up its own traces during the template tear down. In order to tap ...
Example Application-extending class for handling the reporting: @ReportsCrashes( formUri = "https://backend-of-your-choice.com/",//Non-password protected. customReportContent = { /* */ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME,ReportField.ANDROID_VERSION, R...
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" <!-- etc --> > <!-- Internet is required. READ_LOGS are to ensure that the Logcat is transmitted--> <uses-perm...
Maven <dependency> <groupId>ch.acra</groupId> <artifactId>acra</artifactId> <version>4.9.2</version> <type>aar</type> </dependency> Gradle compile 'ch.acra:acra:4.9.2'
Reactive Extensions are published on both NuGet and MyGet. Installing and using them is therefore the same as any other NuGet package: Install-Package System.Reactive NB package names changed between v2 and v3. See the README on Github for more info Breaking changes The NuGet packages have...
This will show the user location on the map Objective-C [self.map setShowsUserLocation:YES]; Swift self.map?.showsUserLocation = true This will track the user location on the map, updating regions according Objective-C [self.map setUserTrackingMode:MKUserTrackingModeFollow]; Swift s...

Page 163 of 1336