Tutorial by Examples: di

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...
I have some data analysis done on some data and have many 'non-coding' people on the team, who have similar data like mine, and have similar analysis requirements. In such cases, I can build a web application with shiny, which takes in user specific input data files, and generate analyses. I ...
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...
Objective C NSURL *url = [NSURL URLWithString:@"YOUR URL"]; AVPlayer *player = [AVPlayer playerWithURL:videoURL]; AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player]; playerLayer.frame = self.view.bounds; [self.view.layer addSublayer:playerLayer]; [player play];...
Overriding in Inheritance is used when you use a already defined method from a super class in a sub class, but in a different way than how the method was originally designed in the super class. Overriding allows the user to reuse code by using existing material and modifying it to suit the user's ne...
Loading the SharePoint Snapin can be done using the following: Add-PSSnapin "Microsoft.SharePoint.PowerShell" This only works in the 64bit version of PowerShell. If the window says "Windows PowerShell (x86)" in the title you are using the incorrect version. If the Snap-In is a...
If we have a Model as following, from django.db import models from django.contrib.auth.models import User class UserModuleProfile(models.Model): user = models.OneToOneField(User) expired = models.DateTimeField() admin = models.BooleanField(default=False) employee_id = models...
<Image Source="ms-appx:///Assets/Windows_10_Hero.png"/> Your image is part of the application, in the Assets folder and marked as Content <Image Source="ms-appdata:///local/Windows_10_Hero.png"/> Your image was saved in your application's Local Folder <Imag...
ImageSource result = new BitmapImage(new Uri("ms-appx:///Assets/Windows_10_Hero.png")); Use result to set the Source property of an Image control either though a Binding or code-behind
public static async Task<ImageSource> FromStorageFile(StorageFile sf) { using (var randomAccessStream = await sf.OpenAsync(FileAccessMode.Read)) { var result = new BitmapImage(); await result.SetSourceAsync(randomAccessStream); return result; } } ...
Copy and Paste following class in your package: public class MLRoundedImageView extends ImageView { public MLRoundedImageView(Context context) { super(context); } public MLRoundedImageView(Context context, AttributeSet attrs) { super(context, attrs); } ...
Here is a generic ViewHolder class that you can use with any DataBinding layout. Here an instance of particular ViewDataBinding class is created using the inflated View object and DataBindingUtil utility class. import android.databinding.DataBindingUtil; import android.support.v7.widget.RecyclerVi...
Any attempt to modify a const object results in undefined behavior. This applies to const variables, members of const objects, and class members declared const. (However, a mutable member of a const object is not const.) Such an attempt can be made through const_cast: const int x = 123; const_cas...
This is the image of project structure in Android studio: This is the image of project structure of nativescript project: As you see they are same. so we can write java code in nativescript as we write in android studio. We want to Add Toast to the default app of nativescript. after creating...

Page 90 of 164