Tutorial by Examples

You can access the form data submitted via a POST or PUT request in Flask via the request.form attribute. from flask import Flask, request app = Flask(import_name=__name__) @app.route("/echo", methods=["POST"]) def echo(): name = request.form.get("name"...
In Swift 1 and 2, closure parameters were escaping by default. If you knew your closure wouldn’t escape the function body, you could mark the parameter with the @noescape attribute. In Swift 3, it’s the other way around: closure parameters are non-escaping by default. If you intend for it to escape...
From Swift Documentarion @escaping Apply this attribute to a parameter’s type in a method or function declaration to indicate that the parameter’s value can be stored for later execution. This means that the value is allowed to outlive the lifetime of the call. Function type parameters wi...
This example is was modeled after an example that I found on the internet. I can't find the link or I would give the author credit. I took the sample that I found and modified it to work for my application. Add the following references: System.Xaml, PresentationCore, PresentationFramework,...
When executing a search, it will be broadcast to all the index/indices shards (round robin between replicas). Which shards will be searched on can be controlled by providing the routing parameter. For example, when indexing tweets, the routing value can be the user name: curl -XPOST 'localhost:9200...
.profile is read by most shells on startup, including bash. However, .bash_profile is used for configurations specific to bash. For general initialization code, put it in .profile. If it's specific to bash, use .bash_profile. .profile isn't actually designed for bash specifically, .bash_profile is...
You can't improve something you can't measure. To improve the performance of React components, you should be able to measure it. ReactJS provides with addon tools to measure performance. Import the react-addons-perf module to measure the performance import Perf from 'react-addons-perf' // ES6 var ...
<RangeSeekBar android:id="@+id/barPrice" android:layout_width="fill_parent" android:layout_height="wrap_content" app:barHeight="0.2dp" app:barHeight2="4dp" app:increment="7" ...
Here are the steps required to install Gradle plugin in Eclipse: Open Eclipse and go to Help -> Eclipse Marketplace In the search bar, enter buildship and hit enter Select "Buildship Gradle Integration 1.0" and click Install In the next window, click Confirm Then, accept the term...
This linked list example implements Set abstract data type operations. SinglyLinkedNode class Option Explicit Private Value As Variant Private NextNode As SinglyLinkedNode '"Next" is a keyword in VBA and therefore is not a valid variable name LinkedList class Option Explicit P...
This is an example of an unbalanced binary search tree. A binary tree is structured conceptually as a hierarchy of nodes descending downward from a common root, where each node has two children: left and right. For example, suppose the numbers 7, 5, 9, 3, 11, 6, 12, 14 and 15 were inserted into a Bi...
$username = "[email protected]" $pwdTxt = Get-Content "C:\temp\Stored_Password.txt" $securePwd = $pwdTxt | ConvertTo-SecureString $credObject = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePwd # Now, $credObject is having the credential...
class ClassA { var timer: NSTimer! init() { // initialize timer } deinit { // code timer.invalidate() } }
Python import csv with open('/tmp/output.tsv', 'wt') as out_file: tsv_writer = csv.writer(out_file, delimiter='\t') tsv_writer.writerow(['name', 'field']) tsv_writer.writerow(['Dijkstra', 'Computer Science']) tsv_writer.writerow(['Shelah', 'Math']) tsv_writer.writerow(['...
tape is minimalistic JavaScript testing framework, it outputs TAP-compliant markup. To install tape using npm run command npm install --save-dev tape @types/tape To use tape with Typescript you need to install ts-node as global package, to do this run command npm install -g ts-node Now you ...
To install tslint run command npm install -g tslint Tslint is configured via file tslint.json. To initialize default configuration run command tslint --init To check file for possible errors in file run command tslint filename.ts
Module Module1 Sub Main() Debug.WriteLine("This line will be shown in the Visual Studio output console") Console.WriteLine("Press a key to exit") Console.ReadKey() Debug.WriteLine("End of application") End Sub End Modul...
Module Module1 Sub Main() Debug.WriteLine("Starting aplication") Debug.Indent() LoopAndDoStuff(5) Debug.Unindent() Console.WriteLine("Press a key to exit") Console.ReadKey() Debug.WriteLine("End of a...
At the beginning of your application, your must add a TextWriterTraceListener to the Listeners list of the Debug class. Module Module1 Sub Main() Debug.Listeners.Add(New TextWriterTraceListener("Debug of " & DateTime.Now.ToString() & ".txt")) D...
On 32-bit systems, integers greater than 0x7FFFFFFF cannot be stored primitively, while integers between 0x0000000080000000 and 0x7FFFFFFFFFFFFFFF can be stored primitively on 64-bit systems but not 32-bit systems (signed long long). However, since 64-bit systems and many other languages support sto...

Page 1084 of 1336