Tutorial by Examples: and

C++14 Those following string user literals are declared in the namespace std::literals::string_literals, where both literals and string_literals are inline namespaces. Access to these operators can be gained with using namespace std::literals, using namespace std::string_literals, and using namespa...
C++14 Those following complex user literals are declared in the namespace std::literals::complex_literals, where both literals and complex_literals are inline namespaces. Access to these operators can be gained with using namespace std::literals, using namespace std::complex_literals, and using nam...
All actions performed in a timer are handled in the "Tick" event. public partial class Form1 : Form { Timer myTimer = new Timer(); public Form1() { InitializeComponent(); myTimer.Tick += myTimer_Tick; //assign the event handler named "myT...
This will only install PHP. If you wish to serve a PHP file to the web you will also need to install a web-server such as Apache, Nginx, or use PHP's built in web-server (php version 5.4+). If you are in a Ubuntu version below 16.04 and want to use PHP 7 anyway, you can add Ondrej's PPA repo...
In Ruby, a string is just a sequence of bytes along with the name of an encoding (such as UTF-8, US-ASCII, ASCII-8BIT) that specifies how you might interpret those bytes as characters. Ruby strings can be used to hold text (basically a sequence of characters), in which case the UTF-8 encoding is us...
Sometimes we want to prepare a context for each test to be run under. The setUp method is run prior to each test in the class. tearDown is run at the end of every test. These methods are optional. Remember that TestCases are often used in cooperative multiple inheritance so you should be careful to...
This example shows how to use column data to set a MultiIndex in a pandas.DataFrame. In [1]: df = pd.DataFrame([['one', 'A', 100], ['two', 'A', 101], ['three', 'A', 102], ...: ['one', 'B', 103], ['two', 'B', 104], ['three', 'B', 105]], ...: columns=['c1'...
public class LoginActivity extends BaseAppCompatActivity { @BindView(R.id.tIETLoginEmail) EditText mEditEmail; @BindView(R.id.tIETLoginPassword) EditText mEditPassword; @Override protected void onResume() { super.onResume(); FirebaseUser firebaseUs...
In many languages, new instances of a class are created using a special new keyword. In Ruby, new is also used to create instances of a class, but it isn't a keyword; instead, it's a static/class method, no different from any other static/class method. The definition is roughly this: class MyClass ...
This example sorts elements in ascending order of a key using a map. You can use any type, including class, instead of std::string, in the example below. #include <iostream> #include <utility> #include <map> int main() { std::map<double, std::string> sorted_map; ...
The NVIDIA installation guide ends with running the sample programs to verify your installation of the CUDA Toolkit, but doesn't explicitly state how. First check all the prerequisites. Check the default CUDA directory for the sample programs. If it is not present, it can be downloaded from the offi...
To show and hide a FloatingActionButton with the default animation, just call the methods show() and hide(). It's good practice to keep a FloatingActionButton in the Activity layout instead of putting it in a Fragment, this allows the default animations to work when showing and hiding. Here is an ...
:g/Hello/d Will delete every line containing the text "Hello". Important note: This is not the normal mode command d, this is the ex command :d. You can use the global command to apply normal mode keystrokes instead of ex commands by prepending normal or norm to the command. For exampl...
Modify your Gemfile to include the Devise gem: gem 'devise' Then update your gems with: $ bundle install Run the installers in your project: $ rails generate devise:install Then create your Devise model (e.g. User) with: $ rails generate devise User you'll need to set up the default ...
1. Print the Hadoop version hadoop version 2. List the contents of the root directory in HDFS hadoop fs -ls / 3. Report the amount of space used and available on currently mounted filesystem hadoop fs -df hdfs:/ 4. Count the number of directories,files and bytes under the paths tha...
A common problem in code that uses multidimensional arrays, arrays of pointers, etc. is the fact that Type** and Type[M][N] are fundamentally different types: #include <stdio.h> void print_strings(char **strings, size_t n) { size_t i; for (i = 0; i < n; i++) puts(str...
To start the process: $ forever start index.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: index.js List running Forever instances: $ forever list i...
In Python 2, True, False and None are built-in constants. Which means it's possible to reassign them. Python 2.x2.0 True, False = False, True True # False False # True You can't do this with None since Python 2.4. Python 2.x2.4 None = None # SyntaxError: cannot assign to None In ...
Remember to npm install all the files into devDependencies first. E.g. npm install --save-dev gulp gulp-concat gulp-rename gulp-uglify gulp-uglifycss Gulpfile.js var gulp = require('gulp'); var gulp_concat = require('gulp-concat'); var gulp_rename = require('gulp-rename'); var gulp_uglify = ...
To create a parallel collection from a sequential collection, call the par method. To create a sequential collection from a parallel collection, call the seq method. This example shows how you turn a regular Vector into a ParVector, and then back again: scala> val vect = (1 to 5).toVector vect:...

Page 57 of 153