Tutorial by Examples: change

The NotifyPropertyChangedBaseclass below defines a generic Set method that can be called from any derived type. public class NotifyPropertyChangedBase : INotifyPropertyChanged { protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) => PropertyChanged?.Invo...
Swift Add this extension to UIImage : extension UIImage { func maskWithColor(color: UIColor) -> UIImage? { let maskImage = self.CGImage let width = self.size.width let height = self.size.height let bounds = CGRectMake(0, 0, width, height) ...
When you define a class or module, the implicit receiver becomes a reference to the class itself. For example: puts "I am #{self}" class Example puts "I am #{self}" end Executing the above code will print: "I am main" "I am Example"
If you want to detect when your user enters a specific location, you can create a fence for the specific location with a radius you want and be notified when your user enters or leaves the location. // Your own action filter, like the ones used in the Manifest private static final String FENCE_REC...
Sometimes users from other regions than English-speaking have problems with encoding while for example programming a php project. It can be, that the server has another encoding then UTF-8, and if someone want to create a php project in UTF-8 on this server, his text might be shown incorrect. Examp...
Exchange/convert a partition to a non-partitioned table and vice versa. This facilitates a fast "move" of data between the data segments (opposed to doing something like "insert...select" or "create table...as select") as the operation is DDL (the partition exchange ope...
> chmod 644 example.txt > ls -l example.txt -rw-r--r-- 1 owner ogroup 57 Jul 3 10:13 example.txt The above command changes the file permissions to allow the file owner to read and write to a file. It also allows users in the owner's group and other users in the system to read the file....
max-width is the breakpoint @media (max-width: 1200px) { .navbar-header { float: none; } .navbar-left,.navbar-right { float: none !important; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transpar...
The UWP applications can run in windowed mode and on several devices. They can be displayed on a wide range of screen sizes from low end phones to the huge surface hub screen. Using relative positioning will be enough for a lot of scenario but as the window size increases, it is always interesting t...
Details to explain, with picture
During a review, user has the possibility to add comments to explain his point of view. There is several kind of comments Comment a file : The yellow symbol allow user to add comment on entire file Line comment : Click the line number to comment it Word selection : The last option i...
For multiple databases, you have the database.php file where you can set as many databases as you need. If you want to "switch" a database for a specific model on the fly, use the setDataSource() method. For example, if you have two databases, you can define them in the database.php file...
Now that you have an authorization code, you can make a POST to the token endpoint (https://api.twitch.tv/kraken/oauth2/token) to get an OAuth token. You will receive a JSON-encoded access token, refresh token, and a list of the scopes approved by the user. You can now use that token to make authent...
For the current shell, this takes you to the previous directory that you were in, no matter where it was. cd - Doing it multiple times effectively "toggles" you being in the current directory or the previous one.
The default directory is the home directory ($HOME, typically /home/username), so cd without any directory takes you there cd Or you could be more explicit: cd $HOME A shortcut for the home directory is ~, so that could be used as well. cd ~
Instead of getting a reference to the DOM you can simply change the index of the tab using the selectedIndex attribute on the ion-tabs HTML: <ion-tabs [selectedIndex]="tabIndex" class="tabs-icon-text" primary > <ion-tab tabIcon="list-box" [root]=&qu...
You can leave the web server running while you develop your application. When you make a change, use the mvn clean package command to build and update your app. Try it now: Leave the web server running, then edit HelloServlet.java to change Hello, world to something else. Run mvn clean package,...
We can change our toast using SetGravity method. This method takes three parameters: first is gravity of toast on screen and two others set toast offset from the starting position (which is set by the first parameter): //Toast at bottom left corner of screen Toast t = Toast.MakeText(context, mess...
If you need to listen for changes to the page selected you can implement the ViewPager.OnPageChangeListener listener on the ViewPager: viewPager.addOnPageChangeListener(new OnPageChangeListener() { // This method will be invoked when a new page becomes selected. Animation is not necessar...

Page 7 of 10