Tutorial by Examples: c

String concatenation is done simply by writing expressions next to one another without any operator. For example: BEGIN { user = "root" print "Hello "user "!" } will print: Hello root! Note that expressions do not have to be separated by whitespace.
This is MATLAB's long-winded way of saying that it cannot find the function that you're trying to call. There are a number of reasons you could get this error: That function was introduced after your current version of MATLAB The MATLAB online documentation provides a very nice feature which allow...
This example uses a search controller to filter the data inside a table view controller. The search bar is placed inside the navigation bar that the table view is embedded into. Embed a UITableViewController into a UINavigationController to get the UINavigationItem (which contains the navigation ...
This example uses a search controller to filter the cells in a table view controller. The search bar is placed inside the header view of the table view. The table view content is offset with the same height as the search bar so that the search bar is hidden at first. Upon scrolling up past the top e...
Early bound (requires a reference to Microsoft Scripting Runtime): Public Sub EnumerateDirectory() Dim fso As Scripting.FileSystemObject Set fso = New Scripting.FileSystemObject Dim targetFolder As Folder Set targetFolder = fso.GetFolder("C:\") Dim foundFi...
A helper function to create a bitmap copy of an object. This can be used to convert vector objects, text or complex nested Sprite's to a flattened bitmap. function makeBitmapCopy(displayObj:IBitmapDrawable, transparent:Boolean = false, bgColor:uint = 0x00000000, smooth:Boolean = true):Bitmap { ...
Undo changes to a file or directory in the working copy. git checkout -- file.txt Used over all file paths, recursively from the current directory, it will undo all changes in the working copy. git checkout -- . To only undo parts of the changes use --patch. You will be asked, for each chang...
It is considered good practice to use a prefix when creating git archives, so that extraction will place all files inside a directory. To create an archive of HEAD with a directory prefix: git archive --output=archive-HEAD.zip --prefix=src-directory-name HEAD When extracted all the files will be...
It is also possible to create archives of other items than HEAD, such as branches, commits, tags, and directories. To create an archive of a local branch dev: git archive --output=archive-dev.zip --prefix=src-directory-name dev To create an archive of a remote branch origin/dev: git archive --...
With git archive it is possible to create compressed archives of a repository, for example for distributing releases. Create a tar archive of current HEAD revision: git archive --format tar HEAD | cat > archive-HEAD.tar Create a tar archive of current HEAD revision with gzip compression: gi...
MATLAB supports the use of logical masking in order to perform selection on a matrix without the use of for loops or if statements. A logical mask is defined as a matrix composed of only 1 and 0. For example: mask = [1 0 0; 0 1 0; 0 0 1]; is a logical matrix representing the identity matrix. ...
This hook is similar to the prepare-commit-msg hook, but it's called after the user enters a commit message rather than before. This is usually used to warn developers if their commit message is in an incorrect format. The only argument passed to this hook is the name of the file that contains the ...
Local hooks affect only the local repositories in which they reside. Each developer can alter their own local hooks, so they can't be used reliably as a way to enforce a commit policy. They are designed to make it easier for developers to adhere to certain guidelines and avoid potential problems dow...
This hook works similarly to the post-commit hook, but it's called whenever you successfully check out a reference with git checkout. This could be a useful tool for clearing out your working directory of auto-generated files that would otherwise cause confusion. This hook accepts three parameters:...
This hook is called immediately after the commit-msg hook. It cannot alter the outcome of the git commit operation, therefore it's used primarily for notification purposes. The script takes no parameters, and its exit status does not affect the commit in any way.
This hook is called after a successful push operation. It is typically used for notification purposes. The script takes no parameters, but is sent the same information as pre-receive via standard input: <old-value> <new-value> <ref-name>
This hook is executed every time you run git commit, to verify what is about to be committed. You can use this hook to inspect the snapshot that is about to be committed. This type of hook is useful for running automated tests to make sure the incoming commit doesn't break existing functionality of...
This hook is called after the pre-commit hook to populate the text editor with a commit message. This is typically used to alter the automatically generated commit messages for squashed or merged commits. One to three arguments are passed to this hook: The name of a temporary file that contains ...
This hook is executed every time somebody uses git push to push commits to the repository. It always resides in the remote repository that is the destination of the push and not in the originating (local) repository. The hook runs before any references are updated. It is typically used to enforce a...
git diff branch1..branch2

Page 221 of 826