Tutorial by Examples: c

Class is the piece of code where we define the attributes and/or behaviors of an object. You can define variables, constants, methods and constructors to the object, inside the class. In another words, class is the blueprint of an object. Let's see a sample class in Java, which defines a (simple) C...
With the 2.x versions of typescript, typings are now available from the npm @types repository. These are automatically resolved by the typescript compiler and are much simpler to use. To install a type definition you simply install it as a dev dependency in your projects package.json e.g. npm i -...
Object is the base module in the Object Oriented Programming (OOP). An Object can be a variable, data structure (like an array, map, etc), or even a function or method. In OOP, we model real world objects like animals, vehicles, etc. An object can be defined in a class, which can be defined as the ...
[Service] # empty exec prevents error "docker.service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing." ExecStart= ExecStart=/usr/bin/dockerd -H fd:// --log-driver=syslog This enables syslog logging for the docker daemon. The file sho...
Nesting controllers chains the $scope as well. Changing a $scope variable in the nested controller changes the same $scope variable in the parent controller. .controller('parentController', function ($scope) { $scope.parentVariable = "I'm the parent"; }); .controller('childContro...
Arch: An official pacman-package is available. Install the package as root, using: pacman -S postgis OpenSuse: In order to use the openSuse repositories for geospatial applications, enable the Geo-repository as root: zypper ar http://download.opensuse.org/repositories/Application:/Geo/openSUS...
Consider a simple asynchronous method: async Task Foo() { Bar(); await Baz(); Qux(); } Simplifying, we can say that this code actually means the following: Task Foo() { Bar(); Task t = Baz(); var context = SynchronizationContext.Current; t.ContinueWith(task...
To disable synchronization context you should call the ConfigureAwait method: async Task() Foo() { await Task.Run(() => Console.WriteLine("Test")); } . . . Foo().ConfigureAwait(false); ConfigureAwait provides a means to avoid the default SynchronizationContext capturi...
The navigation pane located at the left hand side of the admin panel is how you navigate to and access different administration functionalities in the OpenCart back end. Pane expander Current account name and role Dashboard Catalog Categories Products Recurring Profiles Filters Attrib...
An Odd-Even Sort or brick sort is a simple sorting algorithm, which is developed for use on parallel processors with local interconnection. It works by comparing all odd/even indexed pairs of adjacent elements in the list and, if a pair is in the wrong order the elements are switched. The next step ...
To get started we need a factory that produces WebClients. public class ClientFactory { private Map<String, WebClient> cache = new HashMap<>(); public enum RESTClient { PORTAL; } public WebClient fetchRestClient(RESTClient restClient) { if (th...
To connect to a server we must use SSH on the client as follows, # ssh -p port user@server-address port - The listening ssh port of the server (default port 22). user - Must be an existing user on the server with SSH privileges. server address - The IP/Domain of the server. For a real wor...
To generate keys for SSH client: ssh-keygen [-t rsa | rsa1 | dsa ] [-C <comment>] [-b bits] For example: ssh-keygen -t rsa -b 4096 - C [email protected] Default location is ~/.ssh/id_rsa for private and ~/.ssh/id_rsa.pub for public key. For more info, please visit man.openbsd.org
this can also be cv-qualified, the same as any other pointer. However, due to the this parameter not being listed in the parameter list, special syntax is required for this; the cv-qualifiers are listed after the parameter list, but before the function's body. struct ThisCVQ { void no_qualifi...
Objective-C //Displays the country pickerView with black background and white text [self. countryPicker setValue:[UIColor whiteColor] forKey:@"textColor"]; [self. countryPicker setValue:[UIColor blackColor] forKey:@"backgroundColor"]; Swift let color1 = UIColor(colorLitera...
This is a porting of set up sourced from DigitalOcean's tutorial of How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04 and some useful git resources for nginx servers. Flask Application This tutorial assume you use Ubuntu. locate var/www/ folder. Create your web app folder m...
Custom Post Type Archive: To create an archive template for a custom post type you have to set the has_archive argument equal to true in your register_post_type() function. In the example below a custom post type is created for an Event post type. add_action( 'init', 'create_events_post_type' );...
First off, let's assume this is your initial model, inside an application called discography: from django.db import models class Album(models.Model): name = models.CharField(max_length=255) artist = models.CharField(max_length=255) Now, you realize that you want to use a ForeignKey ...
You could describe variable affectation in different ways. Typed int a = 1 int a := 1 let int a = 1 int a <- 1 No type a = 1 a := 1 let a = 1 a <- 1
As long as the function name, return statement and parameters are clear, you're fine. def incr n return n + 1 or let incr(n) = n + 1 or function incr (n) return n + 1 are all quite clear, so you may use them. Try not to be ambiguous with a variable affectation

Page 611 of 826