Tutorial by Examples: o

$ gzip extremelylargefile.txt & $ bg $ disown %1 This allows a long running process to continue once your shell (terminal, ssh, etc) is closed.
Simple single port RAM with async read/write operations module ram_single_port_ar_aw #( parameter DATA_WIDTH = 8, parameter ADDR_WITDH = 3 )( input we, // write enable input oe, // output enable input [(ADDR_WITDH-1):0] waddr, // ...
The PATH environment variable is generally defined in ~/.bashrc or ~/.bash_profile or /etc/profile or ~/.profile or /etc/bash.bashrc (distro specific Bash configuration file) $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jv...
a Character evaluates to true if it's value is not zero, false if zero assert ! new Character((char)0) assert ! new Character('\u0000Hello Zero Char'.charAt(0)) assert new Character('Hello'.charAt(0))
a Matcher evaluates to true if it can find at least one match, false if no match is found // a match is found => true assert 'foo' =~ /[a-z]/ // the regexp does not match fully => no match => false assert !( 'foo' ==~ /[a-z]/ ) // a match is found => true assert 'foo' =~ /o/ // no...
The evaluation of a closure is the evaluation of the result of the closure. All rules applies : if the closure returns a null , zero number or empty String, Collection, Map or Array it evaluates to false otherwise to true. // Closure return non zero number => true assert { 42 }() // closure ...
There are frequent behavior patterns that can result in a lot of boilerplate code. By declaring a method that takes a Closure as a parameter, you can simplify your program. As an example, it is a common pattern to retrieve a database connection, start a transaction, do work, and then either commit ...
To remove a PATH from a PATH environment variable, you need to edit ~/.bashrc or ~/.bash_profile or /etc/profile or ~/.profile or /etc/bash.bashrc (distro specific) file and remove the assignment for that particular path. Instead of finding the exact assignment, you could just do a replacement in t...
Detailed instructions on getting apache-poi set up or installed.
<button class="btn btn-default" type="button">Default</button> <button class="btn btn-primary" type="button">Primary</button> <button class="btn btn-success" type="button">Success</button> <button c...
app.ts import {Component} from '@angular/core'; import {Platform, ionicBootstrap} from 'ionic-angular'; import {StatusBar} from 'ionic-native'; import {LoginPage} from './pages/login/login'; import {FIREBASE_PROVIDERS, defaultFirebase, AuthMethods, AuthProviders, firebaseAuthConfig} from 'angul...
Model: public class SampleViewModel { public HttpPostedFileBase file {get;set;} } View: @model HelloWorldMvcApp.SampleViewModel @using (Html.BeginForm("Index","Home",FormMethod.Post, new { enctype = "multipart/form-data" })) { <div class="fo...
Information about a path can be get using the methods of a Path object: toString() returns the string representation of the path Path p1 = Paths.get("/var/www"); // p1.toString() returns "/var/www" getFileName() returns the file name (or, more specifically, the last ...
To interact with the filesystem you use the methods of the class Files. Checking existence To check the existence of the file or directory a path points to, you use the following methods: Files.exists(Path path) and Files.notExists(Path path) !Files.exists(path) does not neccesarily have t...
The object-fit property will defines how an element will fit into a box with an established height and width. Usually applied to an image or video, Object-fit accepts the following five values: FILL object-fit:fill; Fill stretches the image to fit the content box without regard to the image...
When making a bind of something, for example a date you may want to show it in a specific format without messing around with it in the code. To do this we can use the StringFormat property. Here are some examples: Text="{Binding Path=ReleaseDate, StringFormat=dddd dd MMMM yyyy}" This...
Open Computing Language (OpenCL) is a framework for writing programs that execute on CPUs, GPUs, and other parallel processors and accelerators. OpenCL specifies a programming language (based on C) that provides access to named on-chip memory, a model for executing tasks in parallel, and the abilit...
The following commands can be used to swap the names of two MySQL databases (<db1> and <db2>): mysqladmin -uroot -p<password> create swaptemp mysqldump -uroot -p<password> --routines <db1> | mysql -uroot -p<password> swaptemp mysqladmin -uroot -p<password&gt...
Renaming a column can be done in a single statement but as well as the new name, the "column definition" (i.e. its data type and other optional properties such as nullability, auto incrementing etc.) must also be specified. ALTER TABLE `<table name>` CHANGE `<old name>` `<n...
MERGE INTO targetTable t USING sourceTable s ON t.PKID = s.PKID WHEN MATCHED AND NOT EXISTS ( SELECT s.ColumnA, s.ColumnB, s.ColumnC INTERSECT SELECT t.ColumnA, t.ColumnB, s.ColumnC ) THEN UPDATE SET t.Colum...

Page 587 of 1038