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 ...
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.
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...
Example from the standard library (core.clj:807):
(defmacro and
"Evaluates exprs one at a time, from left to right. If a form
returns logical false (nil or false), and returns that value and
doesn't evaluate any of the other expressions, otherwise it returns
the value of the last e...
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...
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...
The Comparable<T> interface requires one method:
public interface Comparable<T> {
public int compareTo(T other);
}
And the Comparator<T> interface requires one method:
public interface Comparator<T> {
public int compare(T t1, T t2);
}
These two met...
Variables declared inside a function only exist (unless passed) inside that function.
x <- 1
foo <- function(x) {
y <- 3
z <- x + y
return(z)
}
y
Error: object 'y' not found
Variables passed into a function and then reassigned are overwritten, but only insi...
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 ...
Functions and objects in different packages may have the same name. The package loaded later will 'mask' the earlier package and a warning message will be printed. When calling the function by name, the function from the most recently loaded package will be run. The earlier function can be accessed ...