Delete all nodes
MATCH (n)
DETACH DELETE n
DETACH doesn't work in older versions(less then 2.3), for previous versions use
MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n, r
Delete all nodes of a specific label
MATCH (n:Book)
DELETE n
set can also be invoked with just one argument. When called with just one argument, it returns the contents of that argument.
% set x 235
235
% set x
235
Sometimes one has to work with pages that are not using jQuery while most developers are used to have jQuery handy.
In such situations one can use Chrome Developer Tools console (F12) to manually add jQuery on a loaded page by running following:
var j = document.createElement('script');
j.onload ...
Dim flags = BindingFlags.Static Or BindingFlags.Public Or BindingFlags.Instance
Dim members = GetType(String).GetMembers(flags)
For Each member In members
Console.WriteLine($"{member.Name}, ({member.MemberType})")
Next
Static method:
Dim parseMethod = GetType(Integer).GetMethod("Parse",{GetType(String)})
Dim result = DirectCast(parseMethod.Invoke(Nothing,{"123"}), Integer)
Instance method:
Dim instance = "hello".ToUpper
Dim method = Gettype(String).GetMethod("ToUpper&quo...
get_posts() is a wrapper for a separate instance of a WP_Query object. The returned value is an array of post object.
global $post;
$args = array(
'numberposts' => 5,
'offset'=> 1,
'category' => 1
);
$myposts = get_posts( $args );
foreach( $myposts as $post ) :
...
You can use method chaining while working with JSONObject and JSONArray.
JSONObject example
JSONObject obj = new JSONObject();//Initialize an empty JSON object
//Before: {}
obj.put("name","Nikita").put("age","30").put("isMarried","true"...
cycle is an infinite iterator.
>>> import itertools as it
>>> it.cycle('ABCD')
A B C D A B C D A B C D ...
Therefore, take care to give boundaries when using this to avoid an infinite loop. Example:
>>> # Iterate over each element in cycle for a fixed range
>&g...
Disclaimer: In no way does this example advocate the use of singletons. Singletons are to be used with a lot of care.
In PHP there is quite a standard way of implementing a singleton:
public class Singleton {
private $instance;
private function __construct() { };
public function...
Setup Ruby On Rails on Ubuntu 16.04 Xenial Xerus
All commands should be run in Linux terminal (hotkey: Ctrl + Alt + T)
You need to install Ruby on your local machine in development environment.
The first step is to install some dependencies for Ruby.
sudo apt-get update
sudo apt-get install git...
In molecular biology and genetics, GC-content (or guanine-cytosine content, GC% in short) is the percentage of nitrogenous bases on a DNA molecule that are either guanine or cytosine (from a possibility of four different ones, also including adenine and thymine).
Using BioPython:
>>> from...
java.lang.ref package provides reference-object classes, which support a limited degree of interaction with the garbage collector.
Java has four main different reference types. They are:
Strong Reference
Weak Reference
Soft Reference
Phantom Reference
1. Strong Reference
This is the usual...
Using the document-ready event can have small performance drawbacks, with delayed execution of up to ~300ms. Sometimes the same behavior can be achieved by execution of code just before the closing </body> tag:
<body>
<span id="greeting"></span> world!
<sc...
The scheduler can be run using the command:
php artisan schedule:run
The scheduler needs to be run every minute in order to work correctly. You can set this up by creating a cron job with the following line, which runs the scheduler every minute in the background.
* * * * * php /path/to/artisan...