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...
One of several applications of bit manipulation is converting a letter from small to capital or vice versa by choosing a mask and a proper bit operation. For example, the a letter has this binary representation 01(1)00001 while its capital counterpart has 01(0)00001. They differ solely in the bit in...
Create a file called hello.html with the following content:
<!doctype html>
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.0.0/dygraph.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com...
Sometimes, you need to override one or more attributes of a particular Data Access Class (DAC) field just for a particular screen, without changing the existing behavior for other screens.
Replacing All Attributes
Suppose the original DAC field attributes are declared as shown below:
public class...