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...
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...
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...
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 ...
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.
// ...
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.
section .data
msg db "Hello world!",10 ; 10 is the ASCII code for a new line (LF)
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, 13
syscall
mov rax, 60
mov rdi, 0
syscall
If you want to e...
You can update multiple columns in a table in the same statement, separating col=val pairs with commas:
UPDATE person
SET country = 'USA',
state = 'NY'
WHERE city = 'New York';
You can also update data in a table based on data from another table:
UPDATE person
SET state_code = cities.state_code
FROM cities
WHERE cities.city = city;
Here we are joining the person city column to the cities city column in order to get the city's state code. This is then used to updat...
Everything in .NET is an object, hence every type has ToString() method defined in Object class which can be overridden. Default implementation of this method just returns the name of the type:
public class Foo
{
}
var foo = new Foo();
Console.WriteLine(foo); // outputs Foo
ToString() is i...
Strings are immutable. You just cannot change existing string. Any operation on the string crates a new instance of the string having new value. It means that if you need to replace a single character in a very long string, memory will be allocated for a new value.
string veryLongString = ...
// m...
Using GNU grep
grep -r 'pattern' <directory path>
To also list line numbers of matches use -n option
grep -rn 'pattern' <directory path>
To search only files with particular glob pattern
grep --include='*.txt' -r 'pattern' <directory path>
Exclude file patterns or direc...
Say we are working on a class representing a Person by their first and last names. We have created a basic class to do this and implemented proper equals and hashCode methods.
public class Person {
private final String lastName; //invariant - nonnull
private final String firstName; //in...
Variables can be assigned globally from any environment using <<-. bar() can now access y.
bar <- function() {
z <- x + y
return(z)
}
foo <- function() {
y <<- 3
z <- bar()
return(z)
}
foo()
4
Global assignment is highly discourag...
Environments in R can be explicitly call and named. Variables can be explicitly assigned and call to or from those environments.
A commonly created environment is one which encloses package:base or a subenvironment within package:base.
e1 <- new.env(parent = baseenv())
e2 <- new.env(parent ...
Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScript is a new C# script engine.
var code = "(1 + 2).ToString()";
var run = await CSharpScript.RunAsync(code, ScriptOptions.Default);
var result = (string)run.ReturnValue;
Console.WriteLine(result); //output 3
You can compile and run an...
A module is a single Python file that can be imported. Using a module looks like this:
module.py
def hi():
print("Hello world!")
my_script.py
import module
module.hi()
in an interpreter
>>> from module import hi
>>> hi()
# Hello world!