Tutorial by Examples

The navigation bar (at the bottom of the screen) can be transparent. Here is the way to achieve it. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowTranslucentNavigation">true</item> </style> The Status Bar (t...
5.0 This attribute is used to change the navigation bar (one, that contain Back, Home Recent button). Usually it is black, however it's color can be changed. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:navigationBarColor">@col...
Given two types T and U, &T will coerce (implicitly convert) to &U if and only if T implements Deref<Target=U> This allows us to do things like this: fn foo(a: &[i32]) { // code } fn bar(s: &str) { // code } let v = vec![1, 2, 3]; foo(&v); // &Vec&l...
Microbenchmark is useful for estimating the time taking for otherwise fast procedures. For example, consider estimating the time taken to print hello world. system.time(print("hello world")) # [1] "hello world" # user system elapsed # 0 0 0 This i...
As well as being able to create an array by filtering out nil from the transformed elements of a sequence, there is also a version of flatMap(_:) that expects the transformation closure to return a sequence S. extension SequenceType { public func flatMap<S : SequenceType>(transform: (Sel...
You can retrieve the implementation defined name of a type in runtime by using the .name() member function of the std::type_info object returned by typeid. #include <iostream> #include <typeinfo> int main() { int speed = 110; std::cout << typeid(speed).name() <...
A class constructor must have the same name as its class. Let's create a constructor for a class Person: class Person { String name; String gender; int age; Person(this.name, this.gender, this.age); } The example above is a simpler, better way of defining the constructor than the...
Dart functions may also be declared anonymously or nested. For example, to create a nested function, just open a new function block within an existing function block void outerFunction() { bool innerFunction() { /// Does stuff } } The function innerFunction may now be us...
A gem is the equivalent to a plugin or an extension for the programming language ruby. To be exact even rails is nothing more than a gem. A lot of gems are built on rails or other gems (they are dependent of said gem) or are standalone. In your Rails project Gemfile For your Rails project you ha...
The easiest way to handle and manage gems is by using bundler. Bundler is a package manager comparable to bower. To use bundler you first need to install it. gem install bundler After you have bundler up and running all you need to do is add gems to your Gemfile and run bundle in your termi...
Just as you're able to bind data from a view to the model, you can also bind props using the same v-bind directive for passing information from parent to child components. JS new Vue({ el: '#example', data: { msg: 'hello world' } }); Vue.component('child', { props:...
Here is an example of basic overriding in Python (for the sake of clarity and compatibility with both Python 2 and 3, using new style class and print with ()): class Parent(object): def introduce(self): print("Hello!") def print_name(self): print("Parent...
4.0 Instead of the ForEach-Object cmdlet, the here is also the possibility to use a ForEach method directly on object arrays like so (1..10).ForEach({$_ * $_}) or - if desired - the parentheses around the script block can be omitted (1..10).ForEach{$_ * $_} Both will result in the output ...
Having your scripts call Raycast directly may lead to problems if you need to change the collision matrices in the future, as you'll have to track down every LayerMask field to accommodate the changes. Depending on the size of your project, this may become a huge undertaking. Encapsulating Raycast ...
Lucene is a Java library. If you don't have a Java development environment set up already, see the Java documentation. Download the latest version of Lucene from the Apache website, and unzip it. Add the required jars to your classpath. The following jars will be required by many projects, inclu...
NativeScript’s global console variable lets you print values to your terminal for debugging. The simplest usage is passing a value to the console.log() function: console.log("hello world"); The console object has several other methods, including dump(), trace(), assert() and more. // ...
There are hundreds of settings that can be placed in my.cnf. For the 'lite' user of MySQL, they won't matter as much. Once your database becomes non-trivial, it is advisable to set the following parameters: innodb_buffer_pool_size This should be set to about 70% of available RAM (if you have a...
To uninstall Node.js on Windows, use Add or Remove Programs like this: Open Add or Remove Programs from the start menu. Search for Node.js. Windows 10: Click Node.js. Click Uninstall. Click the new Uninstall button. Windows 7-8.1: Click the Uninstall button under Node.js.
ALTER TABLE foo ENGINE=InnoDB; This converts the table, but does not take care of any differences between the engines. Most differences will not matter, especially for small tables. But for busier tables, other considerations should be considered. Conversion considerations
A branch is just a pointer to a commit, so you can freely move it around. To make it so that the branch is referring to the commit aabbcc, issue the command git reset --hard aabbcc Please note that this will overwrite your branch's current commit, and as so, its entire history. You might loose s...

Page 407 of 1336