Tutorial by Examples

$ git show # equivalent to 'git show HEAD' 'HEAD' names the commit on which you based the changes in the working tree, and is usually the symbolic name for the current branch. Many (but not all) commands that take revision parameter defaults to 'HEAD' if it is missing.
$ git show @{1} # uses reflog for current branch $ git show master@{1} # uses reflog for branch 'master' $ git show HEAD@{1} # uses 'HEAD' reflog A ref, usually a branch or HEAD, followed by the suffix @ with an ordinal specification enclosed in a brace pair (e.g. {1}, {1...
$ git show master@{yesterday} $ git show HEAD@{5 minutes ago} # or HEAD@{5.minutes.ago} A ref followed by the suffix @ with a date specification enclosed in a brace pair (e.g. {yesterday}, {1 month 2 weeks 3 days 1 hour 1 second ago} or {1979-02-26 18:30:00}) specifies the value of the ref at ...
$ git log @{upstream}.. # what was done locally and not yet published, current branch $ git show master@{upstream} # show upstream of branch 'master' The suffix @{upstream} appended to a branchname (short form <branchname>@{u}) refers to the branch that the branch specified by branc...
$ git reset --hard HEAD^ # discard last commit $ git rebase --interactive HEAD~5 # rebase last 4 commits A suffix ^ to a revision parameter means the first parent of that commit object. ^<n> means the <n>-th parent (i.e. <rev>^ is equivalent to <rev>^1). A...
In some cases the behavior of a command depends on whether it is given branch name, tag name, or an arbitrary revision. You can use "de-referencing" syntax if you need the latter. A suffix ^ followed by an object type name (tag, commit, tree, blob) enclosed in brace pair (for example v0.9...
$ git show HEAD^{/fix nasty bug} # find starting from HEAD $ git show ':/fix nasty bug' # find starting from any branch A colon (':'), followed by a slash ('/'), followed by a text, names a commit whose commit message matches the specified regular expression. This name returns the younge...
It is possible to change Code Folding preference to suit your need. Thus code folding can be set enable/unable for specific constructs (ex: if block, for loop, Sections ...). To change folding preferences, go to Preferences -> Code Folding: Then you can choose which part of the code can be f...
Instead of linking to an external file, you can also include the JS code as-is in your HTML: <script> // JavaScript code </script>
To build vim from source on Ubuntu: Get a copy of the source code by downloading from the official Vim repository on GitHub. Get the dependencies by running $ sudo apt-get build-dep vim-gnome or similar. Go to the directory of the Vim source code: cd vim/src Run $ ./configure. You can customiz...
If we consider a heterogenous list, wherein the elements of the list have varied but known types, it might be desirable to be able to perform operations on the elements of the list collectively without discarding the elements' type information. The following example implements a mapping operation ov...
This example shows how a label's width can automatically resize when the text content changes. Pin the left and top edges Just use auto layout to add constraints to pin the left and top sides of the label. After that it will automatically resize. Notes This example comes from this Stack...
Suppose the following generic interface has been declared: public interface MyGenericInterface<T> { public void foo(T t); } Below are listed the possible ways to implement it. Non-generic class implementation with a specific type Choose a specific type to replace the formal type ...
The command set is used to assign values in Tcl. When it is called with two arguments in the following manner, % set tempVar "This is a string." This is a string. it places the second argument ("This is a string.") in the memory space referenced by the first argument (tempVa...
This option enables the use of call profiling for code optimizations. Profiling records useful runtime statistics specific to the application and can—in many cases—increase performance because JVM can then act on those statistics. Note: This option is supported with the JRockit JVM R27.3.0 and la...
This option disables the fat lock spin code in Java, allowing threads that block trying to acquire a fat lock go to sleep directly. Objects in Java become a lock as soon as any thread enters a synchronized block on that object. All locks are held (that is, stayed locked) until released by the locki...
This option disables the garbage collector strategy changes. Compaction heuristics and nursery size heuristics are not affected by this option. By default, the garbage collection heuristics are enabled. Usage: -XXdisableFatSpin
This option causes a dump file to be generated and allows you to specify the relative size of that file (that is, small, medium, or large). Usage: -XXdumpsize:<size> <size>DescriptionnoneDoes not generate a dump file.smallOn Windows, a small dump file is generated (on Linux a full c...
This option makes JRockit JVM exit on the first occurrence of an out of memory error. It can be used if you prefer restarting an instance of JRockit JVM rather than handling out of memory errors. Enter this command at startup to force JRockit JVM to exit on the first occurrence of an out of memory e...
We can use Channel to copy file content faster. To do so, we can use transferTo() method of FileChannel . import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; public class FileCopier { ...

Page 499 of 1336