Tutorial by Examples

Entity entity; //The entity you want to teleport Entity teleportTo; //The entity where you want <entity> to be teleported to boolean success = entity.teleport(teleportTo); //Attempting to teleport. if(success) { //Teleport was successful }else { //Teleport wasn't successful } ...
Entity toBeTeleported; //The entity you want to teleport Location teleportTo = new Location(world,x,y,z,yaw,pitch); //The location to teleport to boolean success = toBeTeleported.teleport(teleportTo); if(success) { //Teleport was successful }else { //Teleport wasn't success...
Java's checked exception mechanism requires the programmer to declare that certain methods could throw specifed checked exceptions. This is done using the throws clause. For example: public class OddNumberException extends Exception { // a checked exception } public void checkEven(int number) ...
Install from npm chai, chai-immutable, and ts-node npm install --save-dev chai chai-immutable ts-node Install types for mocha and chai npm install --save-dev @types/mocha @types/chai Write simple test file: import {List, Set} from 'immutable'; import * as chai from 'cha...
Functions and procedures in packages can be overloaded. The following package TEST has two procedures called print_number, which behave differently depending on parameters they are called with. create or replace package TEST is procedure print_number(p_number in integer); procedure print_numb...
MediaTypeFormatter is an abstract class from which JsonMediaTypeFormatter and XmlMediaTypeFormatter classes inherit from. Here, JsonMediaTypeFormatter class handles JSON objects and XmlMediaTypeFormatter class handles XML objects. Return only JSON irrespective of the Accept Header value: To return...
CREATE OR REPLACE TRIGGER CORE_MANUAL_BIUR BEFORE INSERT OR UPDATE ON CORE_MANUAL FOR EACH ROW BEGIN if inserting then -- only set the current date if it is not specified if :new.created is null then :new.created := sysdate; end if; end if; -- always s...
Let's create very simple video player using QtMultimedia module of Qt 5. In .pro file of your application you will need the following lines: QT += multimedia multimediawidgets Note that multimediawidgets is necessary for usage of QVideoWidget. #include <QtMultimedia/QMediaPlayer> #inclu...
ReactiveCocoa supports macOS 10.9+, iOS 8.0+, watchOS 2.0+, and tvOS 9.0+. Carthage If you use Carthage to manage your dependencies, simply add ReactiveCocoa to your Cartfile: github "ReactiveCocoa/ReactiveCocoa" ~> 5.0 If you use Carthage to build your dependencies, make sure you...
public async Task SetProductInactiveAsync(int productId) { using (IDbConnection con = new SqlConnection("myConnectionString")) { await con.ExecuteAsync("SetProductInactive", new { id = productId }, commandType: CommandType.StoredProcedure); ...
This will be a relatively comprehensive tutorial of how to write a command line tool to print the weather from the zip code provided to the command line tool. The first step is to write the program in ruby to do this action. Let's start by writing a method weather(zip_code) (This method requires the...
Some functions in R produce a side effect (i.e. saving, printing, plotting, etc) and do not always return a meaningful or desired value. %T>% (tee operator) allows you to forward a value into a side-effect-producing function while keeping the original lhs value intact. In other words: the tee op...
What is Dagger 2 ? The website describes itself as: Dagger is a fully static, compile-time dependency injection framework The library makes it easy to model dependency graphs as well as to reuse objects. Since reflection is only used at compile time as part of the annotation processing Dagger...
Define a module (the model of dependencies and their graph): @Module public class CoffeeModule{ @Provides public CoffeeMaker provideCoffeeMaker(){ return new CoffeeMaker(); } @Provides public Coffee provideCoffee(CoffeeMaker coffeeMaker){ return new ...
It is often useful to build matrices out of smaller matrices. Horizontal Concatenation Matrices (and vectors, which are treated as column vectors) can be horizontally concatenated using the hcat function. julia> hcat([1 2; 3 4], [5 6 7; 8 9 10], [11, 12]) 2×6 Array{Int64,2}: 1 2 5 6 7 ...
Fast Development process Decoupling Unit test writing Fast Development process When using dependency injection node developer can faster their development proceess because after DI there is less code conflict and easy to manage all module. Decoupling Modules becomes less couple then it i...
Installation Using apt on Debian based systems sudo apt-get install php5-imagick Using Homebrew on OSX/macOs brew install imagemagick To see the dependencies installed using the brew method, visit brewformulas.org/Imagemagick. Using binary releases Instructions on imagemagick website. Us...
This example is how to turn an image into a Base64 string (i.e. a string you can use directly in a src attribute of an img tag). This example specifically uses the Imagick library (there are others available, such as GD as well). <?php /** * This loads in the file, image.jpg for manipulation....
Though it is an obsoleted part of the XSI standard, many implementations still support multiple expressions with Boolean operators and parenthesis. The (obsolete) operators are listed below with decreasing precedence. ( expression ) expression -a expression expression -o expression Using thes...
Create simple CRUD Operation Using Serverless Framework Install Serverless framework globally npm install serverless -g Create simple Lambda Service serverless create --template aws-nodejs --path myService Go to the myService Directory it should contain serverless.yml handler.js even...

Page 1012 of 1336