Tutorial by Examples: di

It is easy to get confused in the C preprocessor, and treat it as part of C itself, but that is a mistake because the preprocessor is just a text substitution mechanism. For example, if you write /* WRONG */ #define MAX 100; int arr[MAX]; the code expands to int arr[100;]; which is a synta...
build.gradle: dependencies { compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0' } menu/menu.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.c...
In some circumstances (for example obtaining a Google API key) you need to find your keystore fingerprint. Gradle has a convenient task that display all the signing information, including keystore fingerprints: ./gradlew signingReport This is a sample output: :app:signingReport Variant: releas...
The default editor that will be involked by any scripts or programs, usually vi or emacs. ~> $ echo $EDITOR vi
foo = "bar" foo[0] = "c" # Error Immutable variable value can not be changed once they are created.
foo = ("bar", 1, "Hello!",) foo[1] = 2 # ERROR!! Second line would return an error since tuple members once created aren't assignable. Because of tuple's immutability.
In Solution Explorer go to your project, right click on References then Add reference… Search for Compression and select System.IO.Compression.FileSystem then press OK. Add Imports System.IO.Compression to the top of your code file (before any class or module, with the other Imports statements)....
Eventually, when you're ready to release a version of your code to production, you'll need a .jar file to distribute. Intellij makes building JARs quite easy. First, navigate to File -> Project Structure and click on Artifacts: Click on the + button, and select JAR -> From modules with dep...
On systems using systemd, such as Fedora => 15, Ubuntu (Server and Desktop) >= 15.04, and RHEL/CentOS >= 7: systemctl status [servicename] ...where [servicename] is the service in question; for example, systemctl status sshd. This will show basic status information and any recent errors ...
You can build the cross-platform "Hello World" C++ code, using Scons - A Python-language software construction tool. First, create a file called SConstruct (note that SCons will look for a file with this exact name by default). For now, the file should be in a directory right along your h...
To view difference between two branch git diff <branch1>..<branch2> To view difference between two branch git diff <commitId1>..<commitId2> To view diff with current branch git diff <branch/commitId> To view summary of changes git diff --stat <branch/com...
The revert command allows discarding unwanted uncommitted changes. Reverting changes to a single file. hg revert example.c Reverting all changes. This will discard all changes not just the current directory. hg revert --all hg will output which files were reverted. reverting exa...
In C++ methods that differs only by const qualifier can be overloaded. Sometimes there may be a need of two versions of getter that return a reference to some member. Let Foo be a class, that has two methods that perform identical operations and returns a reference to an object of type Bar: class ...
This example adds a new rectangle to the canvas every 1 second (== a 1 second interval) Annotated Code: <!doctype html> <html> <head> <style> body{ background-color:white; } #canvas{border:1px solid red; } </style> <script> window.onload=(functio...
The round method will round a number up if the first digit after its decimal place is 5 or higher and round down if that digit is 4 or lower. This takes in an optional argument for the precision you're looking for. 4.89.round # => 5 4.25.round # => 4 3.141526.round(1) # => ...
Invented by John McCarthy around 1958, Lisp (List Processor) has continued to grow into an entire family of languages. Since StackOverflow is more about practical programming problems, typically problems will involve actual Lisp dialects or derived languages and their implementations. Problems that...
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...
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 ...
In this example we are going to create a directive to copy a text into the clipboard by clicking on an element copy-text.directive.ts import { Directive, Input, HostListener } from "@angular/core"; @Directive({ selector: '[text-copy]' }) export class TextCopyDir...
GNU Emacs uses a special format for documentation: info. The Common Lisp standard has been converted to the Texinfo format, which can be used to create documentation browsable with the info reader in GNU Emacs. See here: dpans2texi.el converts the TeX sources of the draft ANSI Common Lisp standard...

Page 83 of 164