Tutorial by Examples

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...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.browserName...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.capabilitie...
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...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.multiCapabi...
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...
/* save the file in 'pages/loginPage' var LoginPage = function(){ }; /*Application object properties*/ LoginPage.prototype = Object.create({}, { userName: { get: function() { return browser.driver.findElement(By.id('userid')); } }, userPass: { ...
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...
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc.hpp> // drawing shapes #include <iostream> int main( int argc, char** argv ) { // First create a black image. cv::Mat image(500,500, CV_8UC3, cv::Scalar(0,0,0...
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...
from kivy.app import App from kivy.lang import Builder from kivy.uix.button import Button items = [ {"color":(1, 1, 1, 1), "font_size": "20sp", "text": "white", "input_data": ["some","random","data&q...
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...
ecosystem.json { "name": "app-name", "script": "server", "exec_mode": "cluster", "instances": 0, "wait_ready": true "listen_timeout": 10000, "kill_timeout": 500...

Page 1223 of 1336