Tutorial by Examples

Write the following command in your terminal to uninstall an app with a provided package name: adb uninstall <packagename>
The example shows parsing a JSON object using the Gson library from Google. Parsing objects: class Robot { //OPTIONAL - this annotation allows for the key to be different from the field name, and can be omitted if key and field name are same . Also this is good coding practice as it decouple ...
Prerequisites To run the Play framework, you need Java 6 or later. If you wish to build Play from source, you will need the Git source control client to fetch the source code and Ant to build it. Be sure to have Java in the current path (enter java --version to check) Play will use the default Ja...
Composer is a dependency/package manager for PHP. It can be used to install, keep track of, and update your project dependencies. Composer also takes care of autoloading the dependencies that your application relies on, letting you easily use the dependency inside your project without worrying about...
While composer provides a system to manage dependencies for PHP projects (e.g. from Packagist), it can also notably serve as an autoloader, specifying where to look for specific namespaces or include generic function files. It starts with the composer.json file: { // ... "autoload&q...
An alternative community de facto standard is an addon called ember-concurrency that makes a lot of the promise confusion go away. It can be installed with the command ember install ember-concurrency. Pros Intuitive reasoning of complex asynchronous code. Offers a complete API for managing tas...
Ember comes with a built in helper that will provide computed properties for the status of an asynchronous task. Pros Built in – no need for an addon. Can be managed in the life cycle of a component. Provides convenient state properties that can drive the template logic. Cons Must be wra...
After creating a new model or modifying existing models, you will need to generate migrations for your changes and then apply the migrations to the specified database. This can be done by using the Django's built-in migrations system. Using the manage.py utility when in the project root directory: ...
Units of measure are additional type annotations that can be added to floats or integers. They can be used to verify at compile time that calculations are using units consistently. To define annotations: [<Measure>] type m // meters [<Measure>] type s // seconds [<Measure>] typ...
You can use traits to modify methods of a class, using traits in stackable fashion. The following example shows how traits can be stacked. The ordering of the traits are important. Using different order of traits, different behavior is achieved. class Ball { def roll(ball : String) = println(&q...
We can name our loops and break the specific one when necessary. outerloop: for (var i = 0;i<3;i++){ innerloup: for (var j = 0;j <3; j++){ console.log(i); console.log(j); if (j == 1){ break outerloop; } } } Output: 0 0...
Detailed instructions on getting asp.net-web-api set up or installed.
All looping constructs allow the use of break and continue statements. They affect the immediately surrounding (innermost) loop. Basic Loop Control break terminates the loop: for x in 0..5 { if x > 2 { break; } println!("{}", x); } Output 0 1 2 continue finishes...
While many people think that ^ means the start of a string, it actually means start of a line. For an actual start of string anchor use, \A. The string hello\nworld (or more clearly) hello world Would be matched by the regular expressions ^h, ^w and \Ah but not by \Aw
With IronPython you can access any .net assembly which is compiled using the same or a lower version than the IronPython core. Example: Importing a a .net assembly and class from System import Math Example: Using an imported class: from System import Math print Math.Abs(-123) You can also lo...
Statistical functions in R make heavy use of the so-called Wilkinson-Rogers formula notation1 . When running model functions like lm for the Linear Regressions, they need a formula. This formula specifies which regression coefficients shall be estimated. my_formula1 <- formula(mpg ~ wt) class(...
//1) All attributes should be inherited from System.Attribute //2) You can customize your attribute usage (e.g. place restrictions) by using System.AttributeUsage Attribute //3) You can use this attribute only via reflection in the way it is supposed to be used //4) MethodMetadataAttribute is jus...
[StackDemo(Text = "Hello, World!")] public class MyClass { [StackDemo("Hello, World!")] static void MyMethod() { } }
Method GetCustomAttributes returns an array of custom attributes applied to the member. After retrieving this array you can search for one or more specific attributes. var attribute = typeof(MyClass).GetCustomAttributes().OfType<MyCustomAttribute>().Single(); Or iterate through them forea...
To find out the IP address of your container, use: docker inspect <container id> | grep IPAddress or use docker inspect docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}

Page 128 of 1336