Tutorial by Examples: c

Docker has announced following editions: -Docker-ee (Enterprise Edition) along with Docker-ce(Community Edition) and Docker (Commercial Support) This document will help you with installation steps of Docker-ee and Docker-ce edition in CentOS Docker-ce Installation Following are steps to instal...
This is a very basic progress bar that only uses what is needed at the bare minimum. It would be wise to read this whole example to the end. import sys import time from PyQt5.QtWidgets import (QApplication, QDialog, QProgressBar, QPushButton) TIME_LIMIT = 100 ...
Build an app.js with a simple data store: app.get("/bookstore", function (req, res, next) { // Your route data var bookStore = [ { title: "Templating with Pug", author: "Winston Smith", pages: 143, y...
public function createCustomer($data , $token)//pass form data and token id { $customer=Customer::create(array( "email"=>$data['email'], "description" => $data['name'], "source" => $token // obtained with Stripe.js )); return $cus...
public function addCard($cust_id, $token) { $retriveResult=Customer::retrieve($cust_id); $tokendata = Token::retrieve($token); $newcard = $tokendata['card']; $flag = 1; foreach ($retriveResult['sources']['data'] as $card) { if($card['fingerprint'] === $newcard['f...
all errors and exceptions, both custom and default, are handled by the Handler class in app/Exceptions/Handler.php with the help of two methods. report() render() public function render($request, Exception $e) { //check if exception is an instance of ModelNotFoundException. if ($e in...
Note: These instructions are targeted at .NET Core 1.0.4 & 1.1.1 SDK 1.0.1 and higher. When using binary archives to install, we recommend the contents be extracted to /opt/dotnet and a symbolic link created for dotnet. If an earlier release of .NET Core is already installed, the directory and ...
An anonymous, inlined function defined with lambda. The parameters of the lambda are defined to the left of the colon. The function body is defined to the right of the colon. The result of running the function body is (implicitly) returned. s=lambda x:x*x s(2) =>4
Map takes a function and a collection of items. It makes a new, empty collection, runs the function on each item in the original collection and inserts each return value into the new collection. It returns the new collection. This is a simple map that takes a list of names and returns a list of the...
Reduce takes a function and a collection of items. It returns a value that is created by combining the items. This is a simple reduce. It returns the sum of all the items in the collection. total = reduce(lambda a, x: a + x, [0, 1, 2, 3, 4]) print(total) =>10
Filter takes a function and a collection. It returns a collection of every item for which the function returned True. arr=[1,2,3,4,5,6] [i for i in filter(lambda x:x>4,arr)] # outputs[5,6]
webpack.config.js const webpack = require("webpack") const helpers = require('./helpers') const path = require("path") const WebpackNotifierPlugin = require('webpack-notifier'); module.exports = { // set entry point for your app module "entry": { ...
Create a new bot in Azure following this documentation Login into Azure and from Intelligence + Analytics category, select Bot Service and provide required information. Enter the required details for the bot, they are identical to the required details of an App Service,for example App Name, Subs...
Simply add an attribute to the controller action [Route("product/{productId}/customer")] public IQueryable<Product> GetProductsByCustomer(int productId) { //action code goes here } this will be queried as /product/1/customer and productId=1 will be sent to the controll...
//Header File <CallKit/CXCallObserver.h> CXCallObserver *callObserver = [[CXCallObserver alloc] init]; // If queue is nil, then callbacks will be performed on main queue [callObserver setDelegate:self queue:nil]; // Don't forget to store reference to callObserver, to prevent it ...
Using find() const inventory = [ {name: 'apples', quantity: 2}, {name: 'bananas', quantity: 0}, {name: 'cherries', quantity: 5} ]; function findCherries(fruit) { return fruit.name === 'cherries'; } inventory.find(findCherries); // { name: 'cherries', quantity: 5 } /*...
A way to create a list is to place elements in two square brackets, separated by semicolons. The elements must have the same type. Example: > let integers = [1; 2; 45; -1];; val integers : int list = [1; 2; 45; -1] > let floats = [10.7; 2.0; 45.3; -1.05];; val floats : float list = [1...
Changing the order (or position) was possible in Bootstrap 3 using the push pull classes. In Bootstrap 4, the push pull classes still work, and additionally flexbox order can be used. In Bootstrap 4, the push pull classes are now push-{viewport}-{units} and pull-{viewport}-{units} and the xs- infix...
To reveal the default "root" password: shell> sudo grep 'temporary password' /var/log/mysqld.log Change the root password as soon as possible by logging in with the generated temporary password and set a custom password for the superuser account: shell> mysql -uroot -p mysql...
Processing Field collection items with Rules is fun, really! Have a look at this Rule (in Rules export format): { "rules_calculate_sum_of_prices_in_all_field_collection_items" : { "LABEL" : "Calculate sum of prices in all field collection items", "PLUGIN...

Page 744 of 826