Tutorial by Examples: e

It's possible to combine all of the above into expressive ranges: :1267,/foo/-2command :'{,command :'f,$command Be creative and don't forget to read :help cmdline-ranges.
SELECT DISTINCT ContinentCode FROM Countries; This query will return all DISTINCT (unique, different) values from ContinentCode column from Countries table ContinentCodeOCEUASNAAF SQLFiddle Demo
:s/foo/bar Replace the first instance of foo with bar on the current line. :s/foo/bar/g Replace every instance of foo with bar on the current line. :%s/foo/bar/g Replace foo with bar throughout the entire file.
* on the word you want to substitute. :%s//replacement/g, leaving the find pattern empty.
Using built-in colormaps is as simple as passing the name of the required colormap (as given in the colormaps reference) to the plotting function (such as pcolormesh or contourf) that expects it, usually in the form of a cmap keyword argument: import matplotlib.pyplot as plt import numpy as np ...
The original default colourmap of MATLAB (replaced in version R2014b) called jet is ubiquitous due to its high contrast and familiarity (and was the default of matplotlib for compatibility reasons). Despite its popularity, traditional colormaps often have deficiencies when it comes to representing d...
By default sprockets-rails is shipped with the following rake tasks: assets:clean[keep]: Remove old compiled assets assets:clobber: Remove compiled assets assets:environment: Load asset compile environment assets:precompile: Compile all the assets named in config.assets.precompile
In the assets initalizer (config/initializers/assets.rb) are a few files explicitly defined to be precompiled. # Precompile additional assets. # application.coffee, application.scss, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( sea...
# config/locales/en.yml en: stackoverflow: header: title_html: "Use <strong>I18n</strong> with Tags & Symbols" Note the addition of extra _html after the name title. And in Views, # ERB <h2><%= t(:title_html, scope: [:stackoverflow, :heade...
The getopts builtin can be used inside functions to write functions that accommodate flags and optional parameters. This presents no special difficulty but one has to handle appropriately the values touched by getopts. As an example, we define a failwith function that writes a message on stderr an...
In elm, a function's value is computed when the last argument is applied. In the example below, the diagnostic from log will be printed when f is invoked with 3 arguments or a curried form of f is applied with the last argument. import String import Debug exposing (log) f a b c = String.join &...
anyNA reports whether any missing values are present; while is.na reports missing values elementwise: vec <- c(1, 2, 3, NA, 5) anyNA(vec) # [1] TRUE is.na(vec) # [1] FALSE FALSE FALSE TRUE FALSE ìs.na returns a logical vector that is coerced to integer values under arithmetic operation...
When reading tabular datasets with the read.* functions, R automatically looks for missing values that look like "NA". However, missing values are not always represented by NA. Sometimes a dot (.), a hyphen(-) or a character-value (e.g.: empty) indicates that a value is NA. The na.strings ...
Install the stable release from CRAN: install.packages("data.table") Or the development version from github: install.packages("data.table", type = "source", repos = "http://Rdatatable.github.io/data.table") To revert from devel to CRAN, the ...
This example will show how to get the mouse position relative to the canvas, such that (0,0) will be the top-left hand corner of the HTML5 Canvas. The e.clientX and e.clientY will get the mouse positions relative to the top of the document, to change this to be based on the top of the canvas we subt...
If you want to detect when your user starts or finishes an activity such as walking, running, or any other activity of the DetectedActivityFence class, you can create a fence for the activity that you want to detect, and get notified when your user starts/finishes this activity. By using a Broadcast...
BroadcastReceivers are used to receive broadcast Intents that are sent by the Android OS, other apps, or within the same app. Each Intent is created with an Intent Filter, which requires a String action. Additional information can be configured in the Intent. Likewise, BroadcastReceivers register ...
The symbol NA is for a logical missing value: class(NA) #[1] "logical" This is convenient, since it can easily be coerced to other atomic vector types, and is therefore usually the only NA you will need: x <- c(1, NA, 1) class(x[2]) #[1] "numeric" If you do need a s...
It is always recommend to go to the LLVM official website and follow the installation guides depending on your OS. If you are working on posix then in short you have to add one of the official LLVM package repositories. For example if you work on Ubuntu Xenial (16.04) you add a deb and deb-src entr...
There are currently three YouTube APIs available to the public: YouTube Data API YouTube Analytics API YouTube Reporting API Each of these offer different functionality and are treated as separate, individual APIs. Since YouTube is a subsidiary of Google, the various YouTube APIs are provid...

Page 396 of 1191