Tutorial by Examples: a

Create a simple servlet: package web.example; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse...
Player player; //The player you want to award your achievement with Achievement achievement; //The achievement you want to award your player player.awardAchievement(achievement); //Awarding the achievement Checking if player has achievement: Player player; Achievement achievement...
First, you need to install pry-byebug gem. Run this command: $ gem install pry-byebug Add this line at the top of your .rb file: require 'pry-byebug' Then insert this line wherever you want a breakpoint: binding.pry A hello.rb example: require 'pry-byebug' def hello_world puts &qu...
Prerequisites: Install Firefox Install Selenium IDE addon (https://addons.mozilla.org/fr/firefox/addon/selenium-ide/) Open the plugin. A button displaying a red circle must be shown. If it's pressed, it means you can start your scenario. The plugin is recording everything you do within this F...
public class BucketSort { public static void SortBucket(ref int[] input) { int minValue = input[0]; int maxValue = input[0]; int k = 0; for (int i = input.Length - 1; i >= 1; i--) { if (input[i] > maxValue) maxValue = input...

map

The .map function accepts an array and an iteratee function, the iteratee produces a transformed copy of each array object. The iteratee function provides 3 arguments item - The current iterated object i - The index of the iterated object list - A reference to the original array/list The ne...
Install a Common Lisp implementation on the server. (E.g. sbcl, clisp, etc...) Install quicklisp on the server. Load SWANK with (ql:quickload :swank) Start the server with (swank:create-server). The default port is 4005. [On your local machine] Create a SSH tunnel with ssh -L4005:127.0.0.1:400...
The _.each function accepts an array or an object, an iteratee function and an optional context object, the iteratee function is invoked once and in order for each array item The iteratee function provides 3 arguments item - The current iterated object (or value if an object was passed) i - The i...
If you are tired of using long commands in bash you can create your own command alias. The best way to do this is to modify (or create if it does not exist) a file called .bash_aliases in your home folder. The general syntax is: alias command_alias='actual_command' where actual_command is the c...
To switch focus to either main document or first frame of the page. You have to use below syntax. webDriver.SwitchTo().DefaultContent();
The module "struct" provides facility to pack python objects as contiguous chunk of bytes or dissemble a chunk of bytes to python structures. The pack function takes a format string and one or more arguments, and returns a binary string. This looks very much like you are formatting a stri...
ASSERT is used in sensitive areas where you want to be absolutely sure, that a variable has a specific value. If the logical condition after ASSERT turns out to be false, an unhandleable exception (ASSERTION_FAILED) is thrown. ASSERT 1 = 1. "No Problem - Program continues ASSERT 1 = 2. &quo...
for ([declaration-or-expression]; [expression2]; [expression3]) { /* body of the loop */ } In a for loop, the loop condition has three expressions, all optional. The first expression, declaration-or-expression, initializes the loop. It is executed exactly once at the beginning of the lo...
Preconditions These instructions suppose you have any type of Linux, Unix, Mac with bash or Git-bash Windows. Windows: Download and install Git-bash for Windows, then execute 'bash' from command line. Other shells than bash are fine too, just replace the activate command below with activate.csh...
Player playerToHide; Player playerToNotSee; playerToNotSee.hide(playerToHide); //playerToHide will no longer be seen by playerToNotSee. If player is already hidden, nothing happens
Player toUnhide; Player toSeeAgain toSeeAgain.show(toUnhide); //Player toSeeAgain will now see Player toUnhide again. If player is already visible, nothing happens.
Player playerToCheck; Player playerSeeing; boolean isVisible = playerSeeing.canSee(playerToCheck); //isVisible returns true if playerSeeing can see playerToCheck and false otherwhise
This can be done by using the event EntityTargetEvent Entities won't target the player if you cancel the event: @EventHandler public void onEntityTarget(EntityTargetEvent e) { Entity target = e.getEntity(); if(target instanceof Player) { Player playerTargetted = (Player) target...
Log in to the AWS Management Console and navigate to AWS Lambda. Click create new function then you will see this window. Select Runtime environment but blueprint (sample code) only for node.js and python There are two example conation for alexa skills kit. You can filter those thing. By s...
Use the d8 shell to run the v8 engine. Use the following pattern to run on a file: /path/to/d8 [flags] [file].js For example: ./d8 --log-gc script.js will run d8 on script.js with garbage collection logging enabled

Page 829 of 1099