Tutorial by Examples: dot

Descriptors are objects that are (usually) attributes of classes and that have any of __get__, __set__, or __delete__ special methods. Data Descriptors have any of __set__, or __delete__ These can control the dotted lookup on an instance, and are used to implement functions, staticmethod, classmet...
Ruby extends the standard group syntax (...) with a named group, (?<name>...). This allows for extraction by name instead of having to count how many groups you have. name_reg = /h(i|ello), my name is (?<name>.*)/i #i means case insensitive name_input = "Hi, my name is Zaphod Be...
A dotfile is a file whose names begin with a .. These are normally hidden by ls and not listed unless requested. For example the following output of ls: $ ls bin pki The -a or --all option will list all files, including dotfiles. $ ls -a . .ansible .bash_logout .bashrc .lesshst ...
dotimes is a macro for integer iteration over a single variable from 0 below some parameter value. One of the simples examples would be: CL-USER> (dotimes (i 5) (print i)) 0 1 2 3 4 NIL Note that NIL is the returned value, since we did not provide one ourselves; the v...
The . operator in Rust comes with a lot of magic! When you use ., the compiler will insert as many *s (dereferencing operations) necessary to find the method down the deref "tree". As this happens at compile time, there is no runtime cost of finding the method. let mut name: String = &quo...
The dot product between two tensors can be performed using: tf.matmul(a, b) A full example is given below: # Build a graph graph = tf.Graph() with graph.as_default(): # A 2x3 matrix a = tf.constant(np.array([[1, 2, 3], [2, 4, 6]]), ...
def arg = [phrase: 'interpolated'] assert "This is $arg.phrase" == 'This is interpolated'
The dot function can also be used to compute vector dot products between two one-dimensional numpy arrays. >>> v = np.array([1,2]) >>> w = np.array([1,2]) >>> v.dot(w) 5 >>> np.dot(w,v) 5 >>> np.dot(v,w) 5
$ cp .vimrc{,.bak} This expands into the command cp .vimrc .vimrc.bak.
The ASP.NET Core RTM release introduced BundlerMinifier.Core, a new Bundling and Minification tool that can be easily integrated into existing ASP.NET Core applications and doesn't require any external extensions or script files. Using BundlerMinifier.Core To use this tool, simply add a reference ...
Let's take a sample class. class Book: def __init__(self, title, author): self.title = title self.author = author book1 = Book(title="Right Ho, Jeeves", author="P.G. Wodehouse") In Python you can access the attribute title of the class using the dot ...
Once you've installed the .NET CLI tools, you can create a new project with the following command: dotnet new --lang f# This creates a command line program.
module.exports.routes = { 'GET /foo/*': { fn: function(req, res) { res.send("FOO!"); }, skipAssets: true }, };
If you want to remove calls to certain methods, assuming they return void and have no side affects (as in, calling them doesn't change any system values, reference arguments, statics, etc.) then you can have ProGuard remove them from the output after the build is complete. For example, I find this ...
# example data DT = data.table(iris) To modify factor levels by reference, use setattr: setattr(DT$Species, "levels", c("set", "ver", "vir") # or DT[, setattr(Species, "levels", c("set", "ver", "vir"))] The sec...
A regex pattern where a DOTALL modifier (in most regex flavors expressed with s) changes the behavior of . enabling it to match a newline (LF) symbol: /cat (.*?) dog/s This Perl-style regex will match a string like "cat fled from\na dog" capturing "fled from\na" into Group 1....
In Unix, files and directories beginning with a period usually contain settings for a specific program/a series of programs. Dot files are usually hidden from the user, so you would need to run ls -a to see them. An example of a dot file is .bash_history, which contains the latest executed commands...
\m : Beginning of a word. \M : End of a word. \y : Word boundary. \Y : a point that is not a word boundary. \Z : matches end of data. Documentation: re_syntax
For more complex applications, flat execution profiles may be difficult to follow. This is why many profiling tools also generate some form of annotated callgraph information. gperf2dot converts text output from many profilers (Linux perf, callgrind, oprofile etc.) into a callgraph diagram. You can...
Java applets are able to load different resources. But since they are running in the web browser of the client you need to make sure that these resources are accessible. Applets are not able to access client resources as the local file system. If you want to load resources from the same URL the App...

Page 1 of 2