Tutorial by Examples: and

with Ada.Text_IO; use Ada.Text_IO; procedure Main is task My_Task_1; task My_Task_2; task body My_Task_1 is begin for I in 1 .. 4 loop Put_Line ("Hello from My_Task_1"); end loop; end; task body My_Task_2 is begin for ...
LINQ extension methods on IEnumerable<T> take actual methods1, whether anonymous methods: //C# Func<int,bool> fn = x => x > 3; var list = new List<int>() {1,2,3,4,5,6}; var query = list.Where(fn); 'VB.NET Dim fn = Function(x As Integer) x > 3 Dim list = New List F...
Add the readonly attribute to prevent user input. A readonly field can't be edited <input class="form-control" type="text" placeholder="Readonly input here…" readonly> Add the disabled attribute to disable an input field. A disbled field can't be edited either...
List all the node versions installed nvm ls v4.5.0 v6.7.0 Run command using any node installed version nvm run 4.5.0 --version or nvm exec 4.5.0 node --version Running node v4.5.0 (npm v2.15.9) v4.5.0 nvm run 6.7.0 --version or nvm exec 6.7.0 node --version Running node v6.7.0...
roslaunch is an important tool that manages the start and stop of ROS nodes. It takes one or more "*.launch" files as arguments. For this example, I will refer to the following (as asked in this question), so how can we execute those commands consecutively & automatically : roscd ste...
Passing ByRef or ByVal indicates whether the actual value of an argument is passed to the CalledProcedure by the CallingProcedure, or whether a reference (called a pointer in some other languages) is passed to the CalledProcedure. If an argument is passed ByRef, the memory address of the argument i...
let bodies = (contact.bodyA.categoryBitMask <= contact.bodyB.categoryBitMask) ? (A:contact.bodyA,B:contact.bodyB) : (A:contact.bodyB,B:contact.bodyA) switch (bodies.A.categoryBitMask,bodies.B.categoryBitMask) { case let (a, _) where (a && superPower): //All we care about is i...
Objective-C First add the Social Framework to the XCode project. Import the #import "Social/Social.h" class to the required ViewController Twitter with text, image and link //- - To Share text on twitter - - if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) ...
This document details the steps to obtain the facebook access tokens and the using the tokens to fetch FB feeds. Example: A live example is available in https://newtonjoshua.com Introduction to Graph API: The Graph API is the primary way to get data in and out of Facebook's platform. It's a...
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
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...
The BigInteger class has a constructor dedicated to generate random BigIntegers, given an instance of java.util.Random and an int that specifies how many bits will the BigInteger have. Its usage is quite simple - when you call the constructor BigInteger(int, Random) like this: BigInteger randomBigI...
The members of a union share the same space in memory. This means that writing to one member overwrites the data in all other members and that reading from one member results in the same data as reading from all other members. However, because union members can have differing types and sizes, the da...
Installation $ npm install gulp-jslint --save-dev Usage In gulpfile.js add: var gulp = require('gulp'); var jslint = require('gulp-jslint'); gulp.task('lint', function(){ return gulp.src(['source.js']) .pipe(jslint({ /* this object represents the JSLint directives being passe...
Aggregation is used to perform complex data search operations in the mongo query which can't be done in normal "find" query. Create some dummy data: db.employees.insert({"name":"Adma","dept":"Admin","languages":["german","f...
This is an example code to create and execute the aggregate query in MongoDB using Spring Data. try { MongoClient mongo = new MongoClient(); DB db = mongo.getDB("so"); DBCollection coll = db.getCollection("employees"); //Equivalent to $m...
By default, PHP Curl supports GET and POST requests. It is possible to also send custom requests, such as DELETE, PUT or PATCH (or even non-standard methods) using the CURLOPT_CUSTOMREQUEST parameter. $method = 'DELETE'; // Create a DELETE request $ch = curl_init($url); curl_setopt($ch, CURLOPT...
The Redis PHP module gives access to the same commands as the Redis CLI client so it is quite straightforward to use. The syntax is as follow: // Creates two new keys: $redis->set('mykey-1', 123); $redis->set('mykey-2', 'abcd'); // Gets one key (prints '123') var_dump($redis->get('m...
Add button Login as facebook account to your login view: Edit site/login.php in views folder, add theses line to content of page login: <?= yii\authclient\widgets\AuthChoice::widget([ 'baseAuthUrl' => ['site/auth'], 'popupMode' => false, ]) ?> Above, we set that aut...

Page 110 of 153