void C++
When used as a function return type, the void keyword specifies that the function does not return a value. When used for a function's parameter list, void specifies that the function takes no parameters. When used in the declaration of a pointer, void specifies that the pointer is ...
ArgumentCaptor will to receive the actual invocation arguments that has been passed to method.
ArgumentCaptor<Foo> captor = ArgumentCaptor.forClass(Foo.class);
verify(mockObj).doSomethind(captor.capture());
Foo invocationArg = captor.getValue();
//do any assertions on invocationArg
For ...
The org.bukkit.event.EventHandler annotation accepts a couple parameters.
priority - Indicates the priority of your listener. There are the six different priorities, in order of execution: LOWEST,LOW,NORMAL[default],HIGH,HIGHEST,MONITOR. These constants refer to the org.bukkit.event.EventPriority e...
# It creates vendor folder and vendor.json inside it
govendor init
# Add dependencies in vendor.json
govendor fetch <dependency>
# Usage on new repository
# fetch depenencies in vendor.json
govendor sync
Example vendor.json
{
"comment": "",
"ignore&qu...
Using scanf
Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. Newlines in the input mus...
In order to install asyncio:
pip install asyncio
Notice that python asyncio requires Python 3.3 or later.
This module became part of the Python standard library since Python 3.4.
Sometimes you need to create your own Event, one that other plugins can listen to (Vault, among other plugins, does this) and even cancel. Bukkit's Event API allows this to be possible. All you need to do is make a new class, have it extend Event, add the handlers and the attributes your event needs...
# General syntax:
# grep(<pattern>, <character vector>)
mystring <- c('The number 5',
'The number 8',
'1 is the loneliest number',
'Company, 3 is',
'Git SSH tag is [email protected]',
'My personal site is w...
This configuration lets' you run your total spec files in two browser instances in parallel. It helps reduce the overall test execution time. Change the maxInstances based on your need.
Note: Make sure your tests are independent.
var config = {};
var timeout = 120000;
config.framework = 'jasmi...
In this example 2000 bytes will be transfered using DMA, Transmit Half Complete and Transmit Complete interrupts achieving the best performance.
The first half of the transmit buffer is loaded with new data by the CPU in the Transmit Half Complete interrupt callback while the second half of the buf...
Tkinter support .ppm files from PIL(Python Imaging Library), .JPG, .PNG and .GIF.
To import and image you first need to create a reference like so:
Image = PhotoImage(filename = [Your Image here])
Now, we can add this image to Button and Labels like so using the "img" callback:
Lbl ...
In an angular app everything goes around scope, if we could get an elements scope then it is easy to debug the angular app.
How to access the scope of element:
angular.element(myDomElement).scope();
e.g.
angular.element(document.getElementById('yourElementId')).scope() //accessing by ID
Gett...
First we need a class that represents the block
public class CustomBlock extends Block {
public CustomBlock () {
super(Material.ROCK);
setHardness(1.0f);
setHarvestLevel("pickaxe", 0);
setResistance(1.0f);
setCreativeTab(CreativeTabs.DEC...
Next we need to tell Minecraft what we want our block to look like.
{
"parent": "block/cube_all",
"textures": {
"all": "example:blocks/decorative"
}
}
That's pretty much all that's needed for it to work once the block is ...
Registering blocks is done from your main mod class, or a ModBlocks class method invoked from the main mod class during preInit.
Block myBlock = new CustomBlock();
string registryname = "my_block";
block.setRegistryName(registryname);
block.setUnlocalizedName(block.getRegistryName().to...