Tutorial by Examples

A common and task of someone using the Linux Command Line (shell) is to search for files/directories with a certain name or containing certain text. There are 2 commands you should familiarise yourself with in order to accomplish this: Find files by name find /var/www -name '*.css' This will...
th elements are very commonly used to indicate headings for table rows and columns, like so: <table> <thead> <tr> <td></td> <th>Column Heading 1</th> <th>Column Heading 2</th> </tr...
To make long text at most N characters long but leave last word intact, use .{0,N}\b pattern: ^(.{0,N})\b.*
Before making a pull request, it is useful to make sure that compile is successful and tests are passing for each commit in the branch. We can do that automatically using -x parameter. For example: git rebase -i -x make will perform the interactive rebase and stop after each commit to execute mak...
import tensorflow as tf dims, layers = 32, 2 # Creating the forward and backwards cells lstm_fw_cell = tf.nn.rnn_cell.BasicLSTMCell(dims, forget_bias=1.0) lstm_bw_cell = tf.nn.rnn_cell.BasicLSTMCell(dims, forget_bias=1.0) # Pass lstm_fw_cell / lstm_bw_cell directly to tf.nn.bidrectional_rnn ...
go run will run a program without creating an executable file. Mostly useful for development. run will only execute packages whose package name is main. To demonstrate, we will use a simple Hello World example main.go: package main import fmt func main() { fmt.Println("Hello, World...
go build will compile a program into an executable file. To demonstrate, we will use a simple Hello World example main.go: package main import fmt func main() { fmt.Println("Hello, World!") } Compile the program: go build main.go build creates an executable program...
go clean will clean up any temporary files created when invoking go build on a program. It will also clean files left over from Makefiles.
go fmt will format a program's source code in a neat, idiomatic way that is easy to read and understand. It is recommended that you use go fmt on any source before you submit it for public viewing or committing into a version control system, to make reading it easier. To format a file: go fmt main...
A panic halts normal execution flow and exits the current function. Any deferred calls will then be executed before control is passed to the next higher function on the stack. Each stack's function will exit and run deferred calls until the panic is handled using a deferred recover(), or until the...
Recover as the name implies, can attempt to recover from a panic. The recover must be attempted in a deferred statement as normal execution flow has been halted. The recover statement must appear directly within the deferred function enclosure. Recover statements in functions called by deferred f...
Let's take a sample class: public class Transaction { public string Category { get; set; } public DateTime Date { get; set; } public decimal Amount { get; set; } } Now, let us consider a list of transactions: var transactions = new List<Transaction> { new Transaction...
Most analysis customization is in the createComponents class, where the Tokenizer and TokenFilters are defined. CharFilters can be added in the initReader method. Analyzer analyzer = new Analyzer() { @Override protected Reader initReader(String fieldName, Reader reader) { retu...
TokenStream stream = myAnalyzer.tokenStream("myField", textToAnalyze); stream.addAttribute(CharTermAttribute.class); stream.reset(); while(stream.incrementToken()) { CharTermAttribute token = stream.getAttribute(CharTermAttribute.class); System.out.println(token.toString()); ...
public class NullableTypesExample { static int? _testValue; public static void Main() { if(_testValue == null) Console.WriteLine("null"); else Console.WriteLine(_testValue.ToString()); } } Output: null
After you’ve downloaded, these are the files and folders you should see: The bin folder holds the Cake console executables. The config folder holds the Configuration files CakePHP uses. Database connection details, bootstrapping, core configuration files and more should be stored here. The plug...
Without timezone, with microseconds from datetime import datetime datetime.now().isoformat() # Out: '2016-07-31T23:08:20.886783' With timezone, with microseconds from datetime import datetime from dateutil.tz import tzlocal datetime.now(tzlocal()).isoformat() # Out: '2016-07-31T23:09:4...
int signed_integer = -1; // The right shift operation exhibits implementation-defined behavior: int result = signed_integer >> 1;
// Supposing SCHAR_MAX, the maximum value that can be represented by a signed char, is // 127, the behavior of this assignment is implementation-defined: signed char integer; integer = 128;
// The allocation functions have implementation-defined behavior when the requested size // of the allocation is zero. void *p = malloc(0);

Page 659 of 1336