Tutorial by Examples

The package mmand provides functions for the calculation of Mathematical Morphologies for n-dimensional arrays. With a little workaround, these can also be calculated for raster images. library(raster) library(mmand) r <- raster("C:/Program Files/R/R-3.2.3/doc/html/logo.jpg") plot...
If you know the format of the string you are converting (parsing) you should use DateTime.ParseExact Dim dateString As String = "12.07.2003" Dim dateFormat As String = "dd.MM.yyyy" Dim dateValue As Date dateValue = DateTime.ParseExact(dateString, dateFormat, Globalization.C...
Simply use the .ToString overload of a DateTime object to get the format you require: Dim dateValue As DateTime = New DateTime(2001, 03, 06) Dim dateString As String = dateValue.ToString("yyyy-MM-dd") '2001-03-06
set myVariable [expr { $myVariable * 17 }] This shows how you can use a simple expression to update a variable. The expr command does not update the variable for you; you need to take its result and write it to the variable with set. Note that newlines are not important in the little language un...
To start, import the zipfile module, and set the filename. import zipfile filename = 'zipfile.zip' Working with zip archives is very similar to working with files, you create the object by opening the zipfile, which lets you work on it before closing the file up again. zip = zipfile.ZipFile(fi...
Example of declarations are: int a; /* declaring single identifier of type int */ The above declaration declares single identifier named a which refers to some object with int type. int a1, b1; /* declaring 2 identifiers of type int */ The second declaration declares 2 identifiers named a1 a...
Typedefs are declarations which have the keyword typedef in front and before the type. E.g.: typedef int (*(*t0)())[5]; (you can technically put the typedef after the type too - like this int typedef (*(*t0)())[5]; but this is discouraged) The above declarations declares an identifier for a typ...
import scala.util.parsing.combinator._ class SimpleParser extends RegexParsers { // Define a grammar rule, turn it into a regex, and apply it the input. def word: Parser[String] = """[A-Z][a-z]+""".r ^^ { _.toString } } object SimpleParser extends SimplePar...
The following uses a variable with a for loop to rename a group of files. SetLocal EnableDelayedExpansion for %%j in (*.*) do ( set filename=%%~nj set filename=!filename:old=new! set filename=Prefix !filename! set filename=!filename! Suffix ren "%%j" "!filename!%%~x...
By default, the tooltip will appear on top of the element. We can use data-placement attribute to set the position of the tooltip on top, bottom, left or the right side of the element. <a href="#" data-toggle="tooltip" data-placement="top" title="Top tooltip&q...
Sometimes you need to call a Tcl command from your expression. For example, supposing you need the length of a string in it. To do that, you just use a [...] sequence in the expression: set halfTheStringLength [expr { [string length $theString] / 2 }] You can call any Tcl command this way, but i...
Create an .html file containing this snippet: <!DOCTYPE html> <meta charset="utf-8"> <body> <script src="//d3js.org/d3.v4.min.js"></script> <script> d3.select("body").append("span") .text("Hello, world!&quo...
This example is based on a blog post by Nicolas Hery. It utilizes ES6 classes and ReactJS's lifecycle methods to keep the D3 component updated d3_react.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Hello, d3React!</title>...
SubGit may be used to perform a one-time import of an SVN repository to git. $ subgit import --non-interactive --svn-url http://svn.my.co/repos/myproject myproject.git
CSS div { width: 200px; height: 200px; background: url(http://lorempixel.com/200/200/abstract/6); mask-image: radial-gradient(circle farthest-side at center, transparent 49%, white 50%); /* check remarks before using */ } HTML In the above example, a transparent circle is created...
CSS div { /* check remarks before usage */ height: 200px; width: 400px; background-image: url(http://lorempixel.com/400/200/nature/4); mask-image: linear-gradient(to top right, transparent 49.5%, white 50.5%), linear-gradient(to top left, transparent 49.5%, white 50.5%), linear-gradient...
The first release of SciPy, vsn 0.10, was released on August 14th 2001. The current release of SciPy (correct at 26th July 2016) is v 0.17 (stable) with v .18 forthcoming soon. Details of former releases are listed here
When inheriting from any base class, only one partial class needs to have the base class specified. // PartialClass1.cs public partial class PartialClass : BaseClass {} // PartialClass2.cs public partial class PartialClass {} You can specify the same base class in more than one partial clas...
$ git show dae86e1950b1277e545cee180551750029cfe735 $ git show dae86e19 You can specify revision (or in truth any object: tag, tree i.e. directory contents, blob i.e. file contents) using SHA-1 object name, either full 40-byte hexadecimal string, or a substring that is unique to the repository. ...
$ git log master # specify branch $ git show v1.0 # specify tag $ git show HEAD # specify current branch $ git show origin # specify default remote-tracking branch for remote 'origin' You can specify revision using a symbolic ref name, which includes branches (for example 'master'...

Page 498 of 1336