Tutorial by Examples: ado

The readonly keyword is a field modifier. When a field declaration includes a readonly modifier, assignments to that field can only occur as part of the declaration or in a constructor in the same class. The readonly keyword is different from the const keyword. A const field can only be initialized...
To load jQuery from the official CDN, go to the jQuery website. You'll see a list of different versions and formats available. Now, copy the source of the version of jQuery, you want to load. Suppose, you want to load jQuery 2.X, click uncompressed or minified tag which will show you something li...
When you start a thread, it will execute until it is finished. Often, at some point, you need to (possibly - the thread may already be done) wait for the thread to finish, because you want to use the result for example. int n; std::thread thread{ calculateSomething, std::ref(n) }; //Doing some...
Many IDEs provide support for generating HTML from Javadocs automatically; some build tools (Maven and Gradle, for example) also have plugins that can handle the HTML creation. However, these tools are not required to generate the Javadoc HTML; this can be done using the command line javadoc tool. ...
Once you have a Dockerfile, you can build an image from it using docker build. The basic form of this command is: docker build -t image-name path If your Dockerfile isn't named Dockerfile, you can use the -f flag to give the name of the Dockerfile to build. docker build -t image-name -f Dockerfi...
This is a continuous collector that uses the hadoop fs -du -s /hbase/* command to get details about the HDFS disk usage. This metric is very useful for tracking space in an OpenTSDB system. #!/bin/bash while true; do while read -r bytes raw_bytes path; do echo "hdfs.du $(date +&...
You can use a column's number (where the leftmost column is '1') to indicate which column to base the sort on, instead of describing the column by its name. Pro: If you think it's likely you might change column names later, doing so won't break this code. Con: This will generally reduce readabilit...
Swift label1.layer.shadowOffset = CGSize(width: 3, height: 3) label1.layer.shadowOpacity = 0.7 label1.layer.shadowRadius = 2 Swift 3 label1.layer.shadowOffset = CGSize(width: 3, height: 3) label1.layer.shadowOpacity = 0.7 label1.layer.shadowRadius = 2 Objective-C label1.layer.shadowOffs...
All these are shell commands If you need to log onto a running docker-machine directly, you can do that: docker-machine ssh to ssh into the default docker-machine docker-machine ssh machinename to ssh into a non-default docker-machine If you just want to run a single command, you can do so...
After extending the Http class, we need to tell angular to use this class instead of Http class. In order to do this, in our main module(or depending on the needs, just a particular module), we need to write in the providers section: export function httpServiceFactory(xhrBackend: XHRBackend, reque...
std::async is also able to make threads. Compared to std::thread it is considered less powerful but easier to use when you just want to run a function asynchronously. Asynchronously calling a function #include <future> #include <iostream> unsigned int square(unsigned int i){ r...
HTML <p>My shadow always follows me.</p> CSS p { -webkit-filter: drop-shadow(10px 10px 1px green); filter: drop-shadow(10px 10px 1px green); } Result
The nodemon package makes it possible to automatically reload your program when you modify any file in the source code. Installing nodemon globally npm install -g nodemon (or npm i -g nodemon) Installing nodemon locally In case you don't want to install it globally npm install --save-dev nodemo...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/ HTML <div class="box_shadow"></div> CSS .box_shadow { -webkit-box-shadow: 0px 0px 10px -1px #444444; -moz-box-shadow: 0px 0px 10px -1px #444444; box-shadow: 0px 0px 10px -1px #444444; }
HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; -webkit-box-shadow: inset 0px 0px 10px 0px #444444; -moz-box-shadow: inset 0px 0px 10px 0px #444444; box-shadow: inse...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/2/ HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; } .box_shadow:after { content: ""; width: 190px; height: ...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/5/ HTML <div class="box_shadow"></div> CSS .box_shadow { width: 100px; height: 100px; margin: 100px; box-shadow: -52px -52px 0px 0px #f65314, 52px -52px 0px 0px #7cbb00, -52px 52px 0px 0px #00...
class UsersController < ApplicationController def index hashmap_or_array = [{ name: "foo", email: "[email protected]" }] respond_to do |format| format.html { render html: "Hello World" } format.json { render json: hashmap_or_array } en...
Install the necessary Python Library via: $ pip install elasticsearch Connect to Elasticsearch, Create a Document (e.g. data entry) and "Index" the document using Elasticsearch. from datetime import datetime from elasticsearch import Elasticsearch # Connect to Elasticsearch using ...
You can get rid of manage.py and use the django-admin command instead. To do so, you will have to manually do what manage.py does: Add your project path to your PYTHONPATH Set the DJANGO_SETTINGS_MODULE export PYTHONPATH="/home/me/path/to/your_project" export DJANGO_SETTINGS_MODULE...

Page 1 of 7