Tutorial by Examples: di

in styles.xml add your custom style: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppBaseTheme" parent="@android:style/Theme.Light.NoTitleBar.Fullscreen"> </style> </resources> Create your custom...
For some use cases, you can use the using syntax to help define a custom scope. For example, you can define the following class to execute code in a specific culture. public class CultureContext : IDisposable { private readonly CultureInfo originalCulture; public CultureContext(string ...
The igraph package for R is a wonderful tool that can be used to model networks, both real and virtual, with simplicity. This example is meant to demonstrate how to create two simple network graphs using the igraph package within R v.3.2.3. Non-Directed Network The network is created with this pie...
Traditional way interface MathOperation{ boolean unaryOperation(int num); } public class LambdaTry { public static void main(String[] args) { MathOperation isEven = new MathOperation() { @Override public boolean unaryOperation(int num) { ...
Our first element directive will not do much: it will just calculate 2+2 and will be called in html like this: <my-calculator></my-calculator> Notice the name of the directive is myCalculator (in CamelCase), but in html it's used as my-calculator (in lisp-case). Since we want our di...
Hide/show printed information: Control verbosity of the logging: Disable/enable opening log window when starting run/debug application
set alpha {a 1 b 2 c 3} dict get $alpha b # => 2 dict get $alpha d # (ERROR) key "d" not known in dictionary If dict get is used to retrieve the value of a missing key, an error is raised. To prevent the error, use dict exists: if {[dict exists $alpha $key]} { set result [d...
To add a child view controller: - (void)displayContentController:(UIViewController *)vc { [self addChildViewController:vc]; vc.view.frame = self.view.frame; [self.view addSubview:vc.view]; [vc didMoveToParentViewController:self]; } To remove a child view controller: - (void)hid...
Introduction Maps stores key/value pairs, where each key has an associated value. Given a particular key, the map can look up the associated value very quickly. Maps, also known as associate array, is an object that stores the data in form of keys and values. In Java, maps are represented using Ma...
Vaadin plug-in for eclipse provides a quick way to build vaadin project with Apache Ivy dependency manager. Vaadin's documentation explains how to create vaadin project with the help of Eclipse plugin. To install the plug-in just go to eclipse marketplace and search vaadin. Current version of the p...
The standard (17.6.4.2.1/1) generally forbids extending the std namespace: The behavior of a C++ program is undefined if it adds declarations or definitions to namespace std or to a namespace within namespace std unless otherwise specified. The same goes for posix (17.6.4.2.2/1): The behavi...
Template method pattern is a behavioral design pattern that defines the program skeleton of an algorithm in an operation, defering some steps to subclasses. Structure: Key notes: Template method uses Inheritance The Template method implemented by the base class should not be overridden. In t...
Modules can be required without using relative paths by putting them in a special directory called node_modules. For example, to require a module called foo from a file index.js, you can use the following directory structure: index.js \- node_modules \- foo |- foo.js \- package.json ...
If you like to show the dialog without the close button (i.e. the x button in the upper-right corner of the dialog), perhaps because you want to force the user to select one of options or buttons in the dialog itself: 1- Give your dialog a CSS class: $("#selector").dialog({ closeOnE...
You can disable compiler warnings using #pragma warning disable and restore them using #pragma warning restore: #pragma warning disable CS0168 // Will not generate the "unused variable" compiler warning since it was disabled var x = 5; #pragma warning restore CS0168 // Will gene...
We shall create a simple Alert Dialog in Xamarin.Android Now considering you have gone through the getting started guide from the documentation. You must be having the project structure like this: Your Main Activity must be looking like this: public class MainActivity : Activity { ...
Individual elements can be accessed through indexes. Python arrays are zero-indexed. Here is an example : my_array = array('i', [1,2,3,4,5]) print(my_array[1]) # 2 print(my_array[2]) # 3 print(my_array[0]) # 1
Here is an example: my_array = array('i', [1,2,3,4,5]) c=[11,12,13] my_array.fromlist(c) # array('i', [1, 2, 3, 4, 5, 11, 12, 13]) So we see that the values 11,12 and 13 were added from list c to my_array.
Sometimes, if an action should be bind to a collection view's cell selection, you have to implement the UICollectionViewDelegate protocol. Let's say the collection view is inside a UIViewController MyViewController. Objective-C In your MyViewController.h declares that it implements the UICollecti...
An alert box can be popped-up on a Xamarin.Forms Page by the method, DisplayAlert. We can provide a Title, Body (Text to be alerted) and one/two Action Buttons. Page offers two overrides of DisplayAlert method. public Task DisplayAlert (String title, String message, String cancel) This overri...

Page 84 of 164