Tutorial by Examples: c

Run interactive vim tutorials as many times as needed to feel comfortable with the basics. Vim features several modes, e.g. normal mode, insert mode and command-line mode. Normal mode is for editing and navigating text. In this mode h, j, k and l correspond to the cursor keys ←, ↓, ↑ and →. Most c...
The common modifier to ignore case is i: /fog/i will match Fog, foG, etc. The inline version of the modifier looks like (?i). Notes: In Java, by default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching c...
The modifier that allows using whitespace inside some parts of the pattern to format it for better readability and to allow comments starting with #: /(?x)^ # start of string (?=\D*\d) # the string should contain at least 1 digit (?!\d+$) # the string cannot consist of digi...
This is a .NET regex specific modifier expressed with n. When used, unnamed groups (like (\d+)) are not captured. Only valid captures are explicitly named groups (e.g. (?<name> subexpression)). (?n)(\d+)-(\w+)-(?<id>\w+) will match the whole 123-1_abc-00098, but (\d+) and (\w+) won't...
The UNICODE modifier, usually expressed as u (PHP, Python) or U (Java), makes the regex engine treat the pattern and the input string as Unicode strings and patterns, make the pattern shorthand classes like \w, \d, \s, etc. Unicode-aware. /\A\p{L}+\z/u is a PHP regex to match strings that consis...
The PCRE-compliant PCRE_DOLLAR_ENDONLY modifier that makes the $ anchor match at the very end of the string (excluding the position before the final newline in the string). /^\d+$/D is equal to /^\d+\z/ and matches a whole string that consists of 1 or more digits and will not match "123...
Another PCRE-compliant modifier expressed with /A modifier. If this modifier is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the start of the string which is being searched (the "subject string"). This effect can also be achieved by ap...
The PCRE-compliant PCRE_UNGREEDY flag expressed with /U. It switches greediness inside a pattern: /a.*?b/U = /a.*b/ and vice versa.
One more PCRE modifier that allows the use of duplicate named groups. NOTE: only inline version is supported - (?J), and must be placed at the start of the pattern. If you use /(?J)\w+-(?:new-(?<val>\w+)|\d+-empty-(?<val>[^-]+)-collection)/ the "val" group values will be ...
A PCRE modifier that causes an error if any backslash in a pattern is followed by a letter that has no special meaning. By default, a backslash followed by a letter with no special meaning is treated as a literal. E.g. /big\y/ will match bigy, but /big\y/X will throw an exception. Inline v...
Dojo provides us various themes like tundra, claro etc. Load themes using link tag in your HTML page pointing to Google CDN.
numpy.dot can be used to multiply a list of vectors by a matrix but the orientation of the vectors must be vertical so that a list of eight two component vectors appears like two eight components vectors: >>> a array([[ 1., 2.], [ 3., 1.]]) >>> b array([[ 1., 2., ...
filePath = "file.csv" data = np.genfromtxt(filePath) Many options are supported, see official documentation for full list: data = np.genfromtxt(filePath, dtype='float', delimiter=';', skip_header=1, usecols=(0,1,3) )
ShortcutDescriptionCtrl + x, (start recording a macroCtrl + x, )stop recording a macroCtrl + x, eexecute the last recorded macro
With the bind command it is possible to define custom key bindings. The next example bind an Alt + w to >/dev/null 2>&1: bind '"\ew"':"\" >/dev/null 2>&1\"" If you want to execute the line immediately add \C-m (Enter) to it: bind '"\ew&quo...
When a Java virtual machine starts, it needs to know how big to make the Heap, and the default size for thread stacks. These can be specified using command-line options on the java command. For versions of Java prior to Java 8, you can also specify the size of the PermGen region of the Heap. Note...
Searching git log using some string in log: git log [options] --grep "search_string" Example: git log --all --grep "removed file" Will search for removed file string in all logs in all branches. Starting from git 2.4+, the search can be inverted using the --invert-grep...
Merges two collections (without removing duplicates) List<int> foo = new List<int> { 1, 2, 3 }; List<int> bar = new List<int> { 3, 4, 5 }; // Through Enumerable static class var result = Enumerable.Concat(foo, bar).ToList(); // 1,2,3,3,4,5 // Through extension method...
To unregister from Remote Notifications programatically you can use Objective-C [[UIApplication sharedApplication] unregisterForRemoteNotifications]; Swift UIApplication.sharedApplication().unregisterForRemoteNotifications() this is similar to going into the setting of your phone and manual...
To create a Swift Package, open a Terminal then create an empty folder: mkdir AwesomeProject cd AwesomeProject And init a Git repository: git init Then create the package itself. One could create the package structure manually but there's a simple way using the CLI command. If you want to ...

Page 438 of 826