text:
<!--
IMPORTANT NOTE FOR CONTRIBUTORS
-------------------------------
Contributors: This file is generated from source file src/docs/templates/ypgpm.md
If you would like to make changes, change file src/docs/templates/ypgpm.md instead
-->
# The Young Person's Guide to Programming in Minecraft
## Table of Contents
 * [Introduction](#introduction)
 * [Installing and Running SpigotMC](#installing-and-running-spigotmc)
 * [Installing ScriptCraft](#installing-scriptcraft)
 * [Configuring your Server (optional)](#configuring-your-server-optional)
 * [Learning Javascript](#learning-javascript)
 * [First Steps](#first-steps)
 * [Variables](#variables)
 * [Functions](#functions)
 * [Building stuff in Minecraft](#building-stuff-in-minecraft)
 * [Common Block Materials](#common-block-materials)
 * [Dimensions](#dimensions)
 * [More shapes](#more-shapes)
 * [The Drone Object](#the-drone-object)
   * [Movement](#movement)
   * [Chaining - combining building and movement.](#chaining---combining-building-and-movement)
   * [Exercise - Build a simple dwelling](#exercise---build-a-simple-dwelling)
   * [Remembering where you started.](#remembering-where-you-started)
 * [Saving your work](#saving-your-work)
 * [Your First Minecraft Mod!](#your-first-minecraft-mod)
 * [Parameters](#parameters)
 * [true or false](#true-or-false)
 * [More fun with `true` or `false`](#more-fun-with-true-or-false)
   * [Booleans and JavaBeans](#booleans-and-javabeans)
   * [SIDENOTE](#sidenote)
 * [...and Again, and Again, and Again,...](#and-again-and-again-and-again)
   * [Counting to 100](#counting-to-100)
   * [Saying "Hi!" to every player](#saying-hi-to-every-player)
 * [While Loops](#while-loops)
 * [`utils.foreach()` - Yet another way to process Arrays](#utilsforeach---yet-another-way-to-process-arrays)
   * [Exercise](#exercise)
 * [Putting `for` loops to use - Building a Skyscraper](#putting-for-loops-to-use---building-a-skyscraper)
 * [Making Decisions](#making-decisions)
 * [Event-Driven programming](#event-driven-programming)
   * [Stop listening to events.](#stop-listening-to-events)
 * [Keeping Score - Lookup tables in Javascript](#keeping-score---lookup-tables-in-javascript)
 * [Counting block break events for each player](#counting-block-break-events-for-each-player)
 * [Next Steps](#next-steps)
## Introduction

Minecraft is an open-ended 3D game where you can build and craft
anything you like. Minecraft can be extended and enhanced using 'Mods'
(short for 'modifications') - additional bits of code that are added
to the Game. ScriptCraft is one such Mod - it lets you program in
Javacript right within the game, making it possible to ...

 * Build using simple javascript statements.
 * Extend the game in other interesting ways - add new Items, change
   the game behaviour and create mini-games.

Minecraft can be played in single-player or multi-player mode (with
friends). Most people play Minecraft in Multi-player mode where
players connect to a Minecraft Server on the internet or locally
(running on the player's computer).

![Cottages created using ScriptCraft in MineCraft][img_cr]

# Installation

Before installing ScriptCraft you must first install SpigotMC which is
a special version of Minecraft Server that makes it easy to customize
the game.

## Installing and Running SpigotMC

Follow these steps to download and install SpigotMC.

1. Download Spigot's [BuildTools.jar][spigotdl]
2. Save the BuildTools.jar file to a new directory called spigotmc.
3. Open a terminal (Mac and Linux) or command prompt (windows) window and type `java -jar BuildTools.jar`. This will kick off a long series of commands to "build" SpigotMC.
4. When the build is done, there will be a new file beginning with `spigot` and ending in `.jar` in the spigotmc directory. Run this file by typing `java -jar spigot-1.10.2.jar` (it might not be that exact name - you can list files in the directory by typing `dir` (Windows) or `ls` (Mac and Linux).
5. The server will start up then shut down very shortly afterwards. You'll need to edit a file called `eula.txt` - change `eula=false` to `eula=true` and save the file.
6. Run the `java -jar spigot-1.10.2.jar` command again - this time the server will start up. Shut it down by typing `stop` at the server prompt.

## Installing ScriptCraft

Follow these steps to download and install ScriptCraft.

1. Download the [scriptcraft.jar][dl] plugin and save it to the `plugins` directory and restart the server by typing `java -jar spigot-1.10.2.jar`.
2. At the server prompt type `js 1 + 1` and hit enter. The result `2` should be displayed.

Congratulations - you've just installed your Custom Minecraft Server and are ready to begin writing your first mod!

## Configuring your Server (optional)

Once you've installed SpigotMC, depending on your specific needs,
you might want to consider setting the following properties in the `server.properties` file:

    # completely flat worlds are best for building from scratch
    # bukkit/spigotmc
    level-type=FLAT
    generate-structures=false

    # creative mode
    gamemode=1
    pvp=false

    # turns off authentication (for classroom environments)
    online-mode=false
    spawn-npcs=false
    spawn-monsters=false

## Learning Javascript

To begin creating cool stuff in Minecraft using ScriptCraft, you don't
*have* to know much JavaScript. ScriptCraft comes with lots of functions
to help you create buildings of any size, and lets you experiment while
you play. However, as you learn Javascript you will be able to create
cooler stuff in Minecraft - not just buildings, you'll be able to add
new rules and items to the game - even create mini-games for you and
your friends. If you want to get started learning JavaScript, check out
this [fun Javascript Tutorial][ce]. If you want to dive right in to
ScriptCraft, read on...

## First Steps

If you don't already know Javascript, don't worry, you'll learn a little
about Programming and Javascript along the way. You've set up a
Minecraft server and are ready to connect ...

1. Launch Minecraft.
2. Click 'Multi-Player'
3. Click 'Add Server'
4. Type any name you like in the name field then type `localhost` in the
address field. `localhost` is a special internet address that points to
your own computer.
5. Click 'Join Server' to join the server. If the version
of Minecraft is incompatible with the version of the server you will
not be able to connect to the server. To fix this, you can create a
Minecraft profile in your client. Profiles let you decide which
version of Minecraft client you want to run so that your client and
server are compatible.

6. Once you've joined the game, press the `/` key located at the bottom
right of your keyboard. A prompt will appear. Type the following then
press enter: `js 1 + 1` The number 2 should be displayed.

... Well Done! You've just confirmed you can run Javascript code from
within the Minecraft Console.

## Variables

A variable is how you name something for the computer (and you the
programmer) to remember. You create a new variable in Javascript using
the `var` keyword...

    /js var location = 'Blackrock Castle'

... creates a new variable called `location` and stores the text
`Blackrock Castle` in it. Now the computer has a new item in its memory
called `location`. We can use that name like this...

    /js echo( location )

... and the following is displayed...

    Blackrock Castle

...You might be wondering why there's no enclosing `'` single quotes.
When telling the computer to store some text, you have to put `'`
(that's the single-quote character) at the start and end
of the text. The computer doesn't store these quote characters, only the
text between them. The computer will store the variables while the
Minecraft Server is running. Repeat the last command you entered by
pressing the `/` key then the UP arrow key on your keyboard, then
pressing enter. You can repeat that statement as many times as you like
and the computer will always display the same value. You can change the
value like this...

    /js location = 'Mahon Point'

...notice this time I didn't use the `var` keyword. I didn't need to.
The `var` keyword is only needed when you first create the variable. Now
execute this command...

    /js echo( self, location )

...and it displays...

    Mahon Point

Variables can be created and changed easily in Javascript. Along with
the variables you'll create in your in-game commands and scripts, there
are handy *free* variables created for you by ScriptCraft. One such variable is
`self`, it contains information about the current player (that's you)...

    /js echo ( self, self.name )

... displays something like the following...

    walterh

... for me but the message displayed will be different for every player.

## Functions

ScriptCraft comes with a couple of extra functions not normally found in
Javascript. These functions will help you build new structures and
buildings which would otherwise take hours to build by hand. Before
looking at the building functions let's look at the `echo()` function.

`echo()` - as its name implies - will echo back at you whatever you
tell it. For example, type ...

    /js echo( self, 'Hello')

... and the game will display...

    Hello

... type ...

    /js echo( self, 5 + 7 )

... and the game will display...

    12

... While you can now use Minecraft to help with Maths homework - I
don't recommend it. Homework and Minecraft don't mix! The `echo()`
function will display anything you tell it to - Text, Numbers and other types...

    /js echo( self, new Date() )

... prints today's date. If the statement above looks confusing - don't
worry - `new Date()` creates a new date object - I'll talk about objects
later ...

    Tue Jan 08 2013 20:53:37 GMT-0000 (GMT)

![Today's Date][img_echo_date]

`echo()` is a very useful function but it is not part of the
Javascript Language. You can't use it outside of Minecraft. There are
many other functions in Javascript all of which you can also
use in Minecraft. For example...

    /js Math.max( 6, 11 )

... returns the larger of the 2 numbers you give it (max is short for
maximum). While...

    /js Math.min( 6, 11 )

... returns the smaller of the 2 numbers. That's another thing -
functions can `return` stuff. You can store the result of a function
(what it returns) in a variable like this...

    /js var biggest = Math.max( 6, 11 )

... Now type...

    /js biggest

... Not all Javascript functions return data but most do. As well as
the functions provided to you by the Javascript Language and
ScriptCraft, you can write your own functions like this...

    /js function whatTimeIsIt () { return new Date() }

... Here you've created a new `function` called `whatTimeIsIt` and
told the function it should return a new `Date` object every time it's
called. You'll notice the above statement didn't actually do anything
- it certainly didn't display the current time. That's because all
 you've done is is say what the function should do when it's called,
 you haven't called it yet. To call the function...

    /js whatTimeIsIt()

... The current time is displayed. Congrats! You've just written your
first Javascript function - you're well on your way to becoming a
Minecraft Modder. There are many functions for working with Text,
numbers and dates in Javascript...

    /js Math.random()

... prints out a random number every time you call it. Try it! Then press
the `/` key then the UP Arrow key to repeat the last statement in your
in-game console. You'll see the number displayed is different each
time. Think of Math.random() as a Dice with many many sides. You can
rely on it to never return the same value twice.

## Building stuff in Minecraft

Now we get to the fun stuff - creating structures and buildings in
Minecraft. Building by hand is fun but tedious when you want to build
big - Towers, Castles and Fortresses. That's where ScriptCraft comes in.
ScriptCraft comes with a couple of javascript functions that can be
combined to build interesting things. Let's start small though to get a
feel for how ScriptCraft's building functions work. The function you'll
probably use most for building is called `box()` and - as its name
implies - it is used to create cubes and cuboids of any size. A cube is
a 3D shape whose sides are all the same length. A cuboid is a 3D shape
whose width, height and length can differ.

![3D Shapes][img_3d_shapes]

You can create a Cube or a Cuboid in ScriptCraft using the `box()`
function. You must tell the function what material you want the shape to
be made of. For example, in the game, point the cross hairs at the
ground, then type the following and hit enter...

    /js box( blocks.oak )

... This will change the targeted block to wood. What's happened here
is the `box()` function has created a single new wooden
block. `blocks` is another one of those *free* variables you get in
ScriptCraft, you can see a list of block materials by typing ...

    /js blocks.

... then pressing the `TAB` key. Repeatedly pressing the `TAB` key
will cycle through all of the block materials. Alternatively, you can
see many more current materials and the numbers Minecraft uses for
them by visiting the [Minecraft Data Values][mcdv] site.

## Common Block Materials

In Minecraft Programming, Materials aren't known by their name,
instead numbers (sometimes 2 numbers) are used to indicate which
material should be used. For example the number 2 is grass, 1 is
cobblestone etc, while 5 is wood (oak). There are different types of
wood so the text '5:1' means Spruce, '5:2' means Birch and '5:3' means
Jungle wood. There are many different materials in the Minecraft world, the most
commonly used materials for building are:

 * '4' - Cobblestone or `blocks.cobblestone`
 * '5' - Wooden Planks or `blocks.oak`
 * '5:2' - Birch wood Planks (light wood) or `blocks.birch`
 * '98' - Stone bricks or `blocks.brick.stone`
 * '45' - Red bricks or `blocks.brick.red`
 * '68' - Sign or `blocks.sign`
 * '102' - Glass panes (for windows) or `blocks.glass_pane`

You can create a single wooden block using the numeric values or the `blocks` variable. For example...

    /js box( '5' )

... and ...

    /js box( blocks.oak )

... both do exactly the same thing but I personally prefer `/js box(
blocks.oak )` because it's easier to remember. For reference, here is
a chart of all of the blocks (not items) in the Minecraft world...

![Minecraft Data Values][img_dv]

## Dimensions

`box()` can do more than just
create single blocks - it can create cubes and cuboids of any
size. Take a look at the following picture which shows how shapes are
measured in 3D space. There are 3 dimensions (or sizes) to consider.

1. Width
2. Height
3. Depth (or length) - not to be confused with how deep underground a
mine-shaft can go. Think of Depth (or length if you prefer) as how far
away you want something to extend.

![Width, Height and Depth][img_whd]

## More shapes

 * `box0( block, width, height, depth )` - creates an empty box (with the
 insides hollowed out - perfect for dwellings. `box0` will remove both
 the floor and ceiling too.
 * `cylinder( block, radius, height )` - creates cylinders, perfect for
 Chimneys.
 * `cylinder0( block, radius, height )` - creates empty cylinders -
 perfect for Towers. `cylinder0` will remove both the floor and
 ceiling too.
 * `prism( block, width, depth )` - creates a Prism - good for roofs.
 * `prism0( block, width, depth )` - creates an empty prism.

## The Drone Object

ScriptCraft is a Minecraft Mod that lets you execute Javascript code
in the game. It also lets you write your own Mod in Javacript. One
such mod that comes bundled with ScriptCraft is called the `Drone`
mod. The `Drone` is an (invsible) object you create every time you
execute any of the building or movement functions. When you execute...

    /js box(5,3,2,4)

... a new `Drone` object is created and does the work of building on
your behalf. Think of a `Drone` as something like a remote control
plane that can move about freely and build things for you. Moving the
Drone is easy...

### Movement

 * `up( numberOfBlocks )` - moves the Drone Up. For example: `up()`
   will move the Drone 1 block up. You can tell it how many blocks to
   move if you want it to move more than one block.
 * `down( numberOfBlocks )` - moves the Drone Down.
 * `left( numberOfBlocks )` - moves the Drone Left.
 * `right( numberOfBlocs )` - moves the Drone Right.
 * `fwd( numberOfBlocs )` - moves the Drone Forward (away from the player).
 * `back( numberOfBlocs )` - moves the Drone Back (towards the player)
 * `turn( numberOfTurns )` - Turns the Drone Clock-wise (right). For example:
   `turn()` will make the Drone turn right 90 degrees. `turn(2)` will
   make the Drone turn twice so that it is facing in the opposite
   direction.

### Chaining - combining building and movement.

You can make a Drone move around before and after building by
*daisy-chaining* the building and movement functions together. In the
game, point at the ground then type the following...

    /js up(1).box( blocks.oak ).fwd(3).box( blocks.oak )

A series of 2 boxes is created 3 blocks apart.

![Two Boxes 3 blocks apart][img_2boxes]

### Exercise - Build a simple dwelling

OK. You know enough now about the `Drone` functions to be able to
build a simple dwelling. The dwelling should be a hollow building with
a sloped roof. *Don't worry about doors or windows for now*. The walls
should be made of Cobblestone ('4') and the roof made of wood ('5'). You can use
the following `Drone` functions to create a dwelling 7 blocks wide by
3 blocks high by 6 blocks long with a wooden sloped roof. It's up
to you to figure out how.

 * `up()`
 * `box0()`
 * `prism0()`

Your dwelling should end up looking something like this...

![Exercise Dwelling][img_ed]

### Remembering where you started.

Sometimes when you're building something big that requires lots of
manoeuvering by your Drone, you need to leave breadcrumbs as you go so
your `Drone` can return to where it started. Every new Drone has a
`'start'` checkpoint that it can return to by executing
`move('start')` ...

    /js box('5').up(3).left(4).box('1').turn(3).fwd(5).right().box('1').move('start')

... A genius would have trouble figuring out how to get back
to where they started. Fortunately, they don't have to - the
`move('start')` function will take the Drone back to its starting
point.

 * `chkpt( breadCrumb )` - Leaves a mark at your Drone's current
 location so it can return there later. Think of it as giving a name
 to the place where your Drone is located. `chkpt` is short for
 Check-Point - a place in a game where you usually save your
 progress.

 * `move( breadCrumb )` - Moves your Drone to a location you named
 using `chkpt()` . It brings your Drone back to the place where you
 saved it.

Both `chkpt()` and `mark()` are useful for when you want to build
complex things that require your Drone to move about a lot ( for
example, Castles, mansions, palaces, etc).

## Saving your work

You can build cool things using the in-game command-prompt and the
`/js` command but sooner or later you'll probably want to build
something more complex and save your commands so you can run them
again when you quit the game and start it up again.

[Notepad++][np] Is a special text editor (like Notepad which comes
installed on every Windows machine) that is well suited for writing
code. If you don't already have it on your machine, you can [install
Notepad++ here][np]. I recommend using NotePad++ rather than plain old
Notepad because it understands Javascript. If you prefer coding on a
Macintosh, then [TextWrangler][twl] is a good programming editor which
also understands Javascript code.

## Your First Minecraft Mod!

So, You've learnt a little bit about Javascript and what the Drone()
object can do, let's use that knowledge to create a Minecraft Mod!

Once you've installed Notepad++, Launch it, create a new file and type the following...

```javascript
exports.greet = function( player ) {
    echo( player, 'Hi ' + player.name);
}
```

... then save the file in a new directory
`scriptcraft/plugins/{your_name}` (replace
{your_name} with your own name) and call the file `greet.js` (be sure
to change the file-type option to '*.* All Files' when saving or
NotePad++ will add a '.txt' extension to the filename. Now switch back
to the Minecraft game and type...

    /js refresh()

... to reload all of the server plugins. Your mod has just been
loaded. Try it out by typing this command...

    /js greet(self)

... it should display ...

    Hi {your-username-here}

... where {your-username-here} will be replaced with your own
minecraft username. Congratulations - You've just written your very
first Minecraft Mod! With ScriptCraft installed, writing Minecraft
Mods is as simple as writing a new javascript function and saving it
in a file in the scriptcraft/plugins
directory. This function will now be avaible every time you launch
minecraft. This is a deliberately trivial minecraft mod but the
principles are the same when creating more complex mods.

The `exports` variable is a special variable you can use in your mod
to provide functions, objects and variables for others to use. If you
want to provide something for other programmers to use, you should
*export* it using the special `exports` variable. The syntax is
straightforward and you can use the same `exports` variable to export
one or more functions, objects or variables. For example...

#### thrower.js

```javascript
exports.boo = function(player){
  echo( player, 'Boo!');
}
exports.yo = function(player){
  echo( player, 'Yo!');
}
```

... is a plugin which provides 2 javascript functions called `boo()`
and `yo()` which can be invoked from the in-game prompt like
this `/js boo(self)` or `/js yo(self)`.

## Parameters
If you want to change the `greet()` function so that it displays a
greeting other than 'Hi ' you can change the code in the `greet()`
function, or better still, you can use *Parameters*. Parameters are
values you provide to a function so that the function behaves
differently each time it is called.

![greeting][img_greet]

Change the `greet()` function so that it looks like this...

```javascript
exports.greet = function ( greeting , player) {
    echo( player, greeting + player.name );
}
```

... Save your greet.js file and issue the `/js refresh()` command in
minecraft. Now enter the following command in Minecraft...

    greet('Hello ',self);

... Now try ...

    greet('Dia Dhuit ',self);

... you should see the following messages in your chat window...

    Hello {your name}
    Dia Dhuit {your name}

... Parameters let you provide different values to functions each time
they're called. As you'll see later, Parameters are very useful when
changing the behaviour of MineCraft.

## true or false

Try entering each of the following statements and make a note of the
answers given by minecraft...

    /js 1 < 2

    /js 1 > 2

... the answer given by the first statement ( `1 < 2` ) should be
`true` since 1 is less than 2. The `<` symbol - usually found near the
bottom right of your keyboard - means test to see if something is less
than another so `1 < 2` is a way of asking the computer "is 1 less
than 2 ?". This is a silly example of course since we know 1 is less
than 2 but when dealing with variables we might not know in advance
what its value is or whether it's greater than (bigger) or less than
(smaller) another number or value. The result of the 2nd statement (`1 > 2`)
should be `false` since 1 is not greater than 2. Now try this...

    /js 1 = 2

... The result won't be what you expected. You'll see an Error message
- that's OK. What's happened here is I've tried to test to see if 1 is
equal to 2 but I've made one of the most common mistakes even
experienced programmers make. If you want to test to see if two things
are the same, you use `==` that's two equals signs right next to each
other. Let's try again...

    /js 1 == 2

... this time you should get an answer `false` since 1 obviously isn't
equal to 2. These are the different *operators* used when comparing
things...

 * `<`  Is less than ?
 * `>`  Is greater than ?
 * `==`  Is equal to ?
 * `<=`  Is less than or equal to ?
 * `>=`  Is greather than or equal to ?
 * `!=` Is not equal to ?

... try comparing some more numbers yourself - say for example,
compare the ages of your friends or siblings to your own age.

## More fun with `true` or `false`

You can find out if you can Fly in minecraft by typing the following statement ...

    /js self.allowFlight

... the result will be `true` or `false` depending on whether you can
fly or not. You can turn on and off your ability to fly by setting
your `allowFlight` property to `true` or `false`. Try it ...

    /js self.allowFlight = true;

... Now you can fly! Double-press the space bar key to start flying. To turn off flight ...

    /js self.allowFlight = false;

... and you come crashing down to earth. This is just one example of
how `true` and `false` are used throughout ScriptCraft – these are
called `boolean` values – named after [George Boole][boole], a 19th Century
Maths Professor at University College Cork. There are plenty more
examples of boolean values in Minecraft. You can find out if it's
raining in your minecraft world by typing the following statement ...

    /js self.world.hasStorm()

... The result of this statement will be either `false` (if it's not raining) or
`true` (if it *is* raining). If it's raining, you can make it stop raining typing the following command:

    /js self.world.setStorm(false)

... Similarly, to make it start raining you can issue the following command:

    /js self.world.setStorm( true )

### Booleans and JavaBeans

There are many *boolean* properties you can use to turn on or off
certain game behaviours. For example, the *thundering* behavior is turned
on or off using the World's `thundering` property.  The World object's
properties and methods are [documented on the SpigotMC JavaDocs World
page][spworld]. When browsing the SpigotMC JavaDoc pages, whenever
you see a method whose name begins with `is` such as `isThundering()` and
a companion method `setThundering()`, these methods are called *JavaBean*
methods - the *thundering* property is a *JavaBean* property and there
are two ways you can use JavaBean properties in Javascript. You can
*get* and *set* the property using the methods provided by Java. To
*get* the thundering property you can call the JavaBean Method:

    /js self.world.isThundering()

... or you can get the property like this:

    /js self.world.thundering

To *set* the thundering property, you can call the JavaBean method:

    /js self.world.setThundering( true )

... or you can set the property like this:

    /js self.world.thundering = true

Whatever approach you use, the result will be the same.

[cmworld]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/world/World.html
[spworld]: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html

### SIDENOTE
You may be wondering how to change other aspects of the Minecraft game - pretty much all
aspects of the game can be changed. Changes are made using what are
called `API` calls - these are calls to functions and methods in
Minecraft - you can read more about these on the [SpigotMC API
Reference][spigotapi].

## ...and Again, and Again, and Again,...

One of the things Computers are really good at is
repetition. Computers don't get tired or bored of doing the same thing
over and over again.  Loops are handy, if you want to run the same
code over and over again, each time with a different value.

### Counting to 100

At the in-game command prompt (hint: press 't') type the following then hit Enter...

    /js for (var i = 1 ; i <= 100 ; i = i + 1) { echo( i ); }

... The above code will count from 1 to 100. The first thing you'll
notice if you run the above code is how quickly the count
happened. You're probably curious how long it would take to count to
1000. Try it out for yourself. Change the above line of code so that
it counts to 1000 instead of 100. If you're feeling adventurous, see
how long it takes to count to ten thousand, one hundred thousand or even one million.

The `for` statement is useful when you want to repeat something over and over. It has 4 parts...

 1. The initialiser: `var i = 1` - this happens once at the start of the loop.
 2. The test: `i <= 100` - this happens at the start of each run around the loop. If the test fails, then the loop ends.
 3. The increment: `i = i + 1` - this happens at the end of each run
 around the loop. If you didn't have a statement here, the loop might
 never finish. `i = i + 1` is often written as `i++` - it's shorter
 and does basically the same thing.
 4. The body - everything that appears between the `{` and `}` (opening and closing curly braces).

`for` loops becomes very useful when you combine it with Arrays -
remember, an Array is just a list of things, for example - the players
connnected to a server, the worlds of a server and so on.

### Saying "Hi!" to every player

At the in-game command prompt type the following then hit Enter...

    /js var utils = require('utils');
    /js var players = utils.players();
    /js for (var i = 0;i < players.length; i++){ echo(players[i], 'Hi!'); }

... Lets look at these statements in more detail. We had to enter the
statements on a single line at the in-game command prompt but the
statements could be written like this...

```javascript
var utils = require('utils');
var players = utils.players();
for (var i = 0;i < players.length; i++) {
  echo(players[i], 'Hi!');
}
```

... On the 2nd line, a new variable `players` is created and assigned a value by calling utils.players().
On the next line, the for loop is declared, a counter variable `i` is set
to 0 (zero - arrays in javascript start at 0 not 1) and each time
around the loop is tested to see if it's less than the number of
players online. At the end of each run around the loop the `i`
variable is incremented (increased by 1) so that the next player can
be messaged.  Inside the body of the for loop (everything between the
opening `{` and closing `}` curly braces) the `players[i]` expression
refers to the player in the players array at position[i].  Imagine
there are 4 players online on a minecraft server, the `players` array
might look like this...

 * players[0] = 'CrafterJohn'
 * players[1] = 'MinerPaul'
 * players[2] = 'ExplorerRingo'
 * players[3] = 'TraderGeorge'

... in this case `players.length` will be 4 (since there are 4 online
players), the for-loop will go around 4 times starting from position 0
and going all the way up to position 3, sending a message to each of
the players in the array. It's time for a new scriptcraft
function. Open the `hi.js` file you created earlier (using NotePad++ ,
TextWrangler or your editor of choice) and add the following code at
the bottom of the file...

```javascript
var utils = require('utils');
exports.hiAll = function () {
  var players = utils.players();
    player,
    i;
  for ( i = 0; i < players.length; i++) {
    player = players[i];
    echo( player, 'Hi!' );
  }
}
```

... save the file, at the in-game command prompt type `/js refresh()` and
then type `/js hiAll()`. This will send the message `Hi!` to all of
the players connected to your server. You've done this using a `for`
loop and arrays. Arrays and `for` loops are used heavily in all types
of software, in fact there probably isn't any software that doesn't
use `for` loops and Arrays to get things done.

## While Loops

Another way to repeat things over and over is to use a `while`
loop. The following `while` loop counts to 100...

```javascript
var i = 1;
while ( i <= 100 ) {
    console.log( i );
    i = i + 1;
}
```

A `while` loop will repeat until its condition is `false` - the
condition in the above example is `i <= 100` so while i is less than
or equal to 100 the code within the `while` block (everything between
the starting `{` and ending `}` curly braces) will run. It's important
that you change the variable being tested in a while loop, otherwise
the while loop will never it - it will run forever. Try running the
following code...

    /js var i = 1; while (i <= 100){ echo( i ); }

The code above will contine printing out the number 1 until the end of
time (or until you unplug your computer). That's because the `i`
variable is never incremented (remember - incrementing just means
adding 1 to it) so i will always be 1 and never changes meaning the
loop goes on forever. Again - this is a mistake even experienced programmers sometimes make.

Just like `for` loops, `while` loops can be also be used to loop
through arrays. The following loop prints out all of the players on
the server...

```javascript
var utils = require('utils');
var players = utils.players();
var i = 0;
while ( i < players.length ) {
    console.log( players[i] );
    i = i + 1;
}
```

... whether you chose to use a `for` loop or a `while` loop is largely
a matter of personal taste, `for` loops are more commonly used with
Arrays but as you see from the example above, `while` loops can also
loop over Arrays.

## `utils.foreach()` - Yet another way to process Arrays

Both the `for` statement and `while` statement are standard commonly
used javascript statements used for looping. ScriptCraft also comes
with a special function for looping called `utils.foreach()`.
utils.foreach() is a convenience function, you don't have to use it if
you prefer the syntax of javascript's `for` and `while`
loops. utils.foreach() takes two parameters...

 1. An array
 2. A function which will be called for each item in the array.

...that's right, you can pass functions as parameters in javascript!
Let's see it in action, the following code will `console.log()` (print) the
name of each online player in the server console window...

    var utils = require('utils');
    var players = utils.players;
    utils.foreach( players, console.log );

... in the above example, the list of online players is processed one
at a time and each item (player) is passed to the `console.log`
function. Note here that I used `console.log` not `console.log()`. The round braces
() are used to call the function. If I want to pass the function as a
parameter, I just use the function name without the round braces. The
above example uses a named function which already exists ( `console.log` ),
you can also create new functions on-the-fly and pass them to the
utils.foreach() function...

```javascript
/*
  give every player the ability to fly.
*/
var utils = require('utils');
var players = utils.players();
utils.foreach( players, function( player ) {
  player.capabilities.flying = true;
  player.updateCapabilities();
} );
```

... Another example, this time each player will hear a Cat's Meow...

```javascript
/*
  Play a Cat's Meow sound for each player.
*/
var utils = require('utils');
var players = utils.players();
var sounds = require('sounds');
utils.foreach( players, function( player ) {
  sounds.entityCatAmbient( player ); // spigot 1.9
  /* canarymod only
    sounds.catMeow( player );
  */
} );
```

### Exercise
Try changing the above function so that different sounds are played
instead of a Cat's Meow. To see all of the possible sounds that can be
played, load the sounds module at the in-game prompt using the following statement:

    /js var sounds = require('sounds');

... then type `/js sounds.` and press the TAB key to see a list of all possible sounds.

Loops are a key part of programming in any language. Javascript
provides `for` and `while` statements for looping and many javascript
libraries also provide their own custom looping functions. You should
use what you feel most comfortable with.

## Putting `for` loops to use - Building a Skyscraper

For loops can be used to build enormous structures. In this next
exercise I'm going to use a for loop to build a skyscraper.  This
skyscraper will be made of Glass and Steel (just like most skyscrapers
in real-life).  The first thing to do is see what a single floor of
the skyscraper will look like. Place a block (of any type) where you
want to eventually build the skyscraper, then while your cursor is
pointing at the block, type the following into the in-game prompt...

    /js var drone = box(blocks.iron,20,1,20).up().box0(blocks.glass_pane,20,3,20).up(3)

... you should a large (20x20) iron floor with 3 block high glass all around.

![skyscraper-floor.png][img_ssf]

... A skyscraper with just a single floor isn't much of a skyscraper
so the next step is to repeat this over and over. This is where `for`
loops come in. Open your favorite text editor and create a new file in
your scriptcraft/plugins/{your-name} directory, name the file `myskyscraper.js`, then
type the following code and save:

```javascript
function myskyscraper( floors ) {
  var i ;
  if ( typeof floors == 'undefined' ) {
    floors = 10;
  }
  // bookmark the drone's position so it can return there later
  this.chkpt('myskyscraper');
  for ( i = 0; i < floors; i++ ) {
    this
      .box(blocks.iron,20,1,20)
      .up()
      .box0(blocks.glass_pane,20,3,20)
      .up(3);
  }
  // return the drone to where it started
  this.move('myskyscraper');
};
var Drone = require('drone');
Drone.extend( myskyscraper );
```

So this takes a little explaining. First I create a new function
called myskyscraper that will take a single parameter `floors` so that
when you eventually call the `myskyscraper()` function you can tell it
how many floors you want built. The first statement in the function
`if (typeof floors == 'undefined'){ floors = 10; }` sets floors to 10 if no parameter is
supplied. The next statement `this.chkpt('myskyscraper')` saves
the position of the Drone so it can eventually return to where it
started when finished building (I don't want the drone stranded atop
the skyscraper when it's finished). Then comes the `for` loop. I loop
from 0 to `floors` and each time through the loop I build a single
floor. When the loop is done I return the drone to where it started.
The last 2 lines load the drone module (it must be loaded before I can
add new features to it) and the last line extends the 'Drone' object
so that now it can build skyscrapers among other things.  Once you've
typed in the above code and saved the file, type `/js refresh()` in your
in-game prompt, then type:

     /js myskyscraper(2);

A two-story skyscraper should appear. If you're feeling
adventurous, try a 10 story skyscraper! Or a 20 story skyscraper!
Minecraft has a height limit (256 blocks from bedrock) beyond which
you can't build. If you try to build higher than this then building
will stop at that height.

![skyscraper][img_ss]

I'll leave it as an exercise to the reader to create a city block of
skyscrapers, 5 blocks apart using a for loop.  Once you've figured
that out, creating an entire city of blocks of skyscrapers is the next
logical step. Of course, Minecraft doesn't have the same constraints
as real-world densely populated areas so let your imagination go wild.

## Making Decisions

All the programs we have seen so far have been fairly predictable - they went
straight through the statements, and then went back to the beginning again. This is
not very useful. In practice the computer would be expected to make decisions and
act accordingly. The javascript statement used for making decisions is `if`.
While standing on the ground in-game, type the following at the command prompt:

    /js if ( self.onGround ) { echo('You are not flying!'); }

the following message should have appeared on your screen:

    You are not flying!

Now double-tap the `space` bar to start flying in-game (tap the space bar twice in rapid
succession), then press and hold space to rise above the ground. Now
enter the same statement again (If you don't want to type the same
statement again, just press `/` then press the `UP` cursor key on your
keyboard, the statement you entered previously should reappear.

    /js if ( self.onGround ) { echo('You are not flying!'); }

This time no message should appear on your screen.

The `if` statement tests to see if something is `true` or `false` and
if `true` then the block of code between the curly braces ( `{` and
`}` ) is executed - but only if the condition is true.  The condition
in the above example is `!self.onGround` (self is _not_ on ground) which
will be `true` if you are currently flying or `false` if you aren't.

What if you wanted to display a message only if a condition is *not*
true ? For example to only display a message if the player is *not* on the ground:

    /js if ( !self.onGround ) { echo ('You are flying!'); }

This code differs in that now there's a `!` (the exclamation mark)
before `self.onGround`. The `!` symbol negates (returns the opposite of)
whatever follows it.

What if you want to display a message in both cases - whether you're
flying or not? This is where the `if - else` construct comes in handy.
Open your favorite editor and type the following code into a new file
in your scriptcraft/plugins directory...

```javascript
exports.flightStatus = function( player ) {
  if ( player.onGround ) {
    echo(player, 'You are not flying!' );
  } else {
    echo(player, 'Hey, You are flying!' );
  }
}
```

... now type `/js refresh()` at the in-game prompt then type `/js
flightStatus(self)` and an appropriate message will appear based on
whether or not you're currently flying. Type the `/js flightStatus()`
command while on the ground and while flying. The message displayed in
each case should be different.

## Event-Driven programming

So far we've written code which executes when you invoke the `/js `
command. What if - for example - you want to have some special
behaviour which occurs when a player joins the game? What if you
wanted to display a custom welcome message (in addition to the MotD -
message-of-the-day which is configurable in your server.properties
file) ? This is where *Event-Driven Programming* comes
in. Event-Driven Programming is just a fancy way of saying 'Do this
when that happens' where 'this' is a function you define, and 'that'
is some event which occurs. There are hundreds of events in the
minecraft game...

 * Every time someone joins the server - that's an event!
 * Every time someone breaks a block - that's an event!
 * Every time someone shoots an arrow - that's an event! and so on...

You can write a function which will be called whenever a specific type
of event occurs, it's probably best to illustrate this by example. The
following code sends a message to any player who breaks a block in the
game...

```javascript
function myBlockBreakHook( event ){
  var breaker = event.player;
  echo( breaker, 'You broke a block');
}
events.blockBreak( myBlockBreakHook );
```

The `events.blockBreak()` function is just one of the many `events` functions which can be used to *register* a function to be called whenever a particular type of event occurs. In the
above code the blockBreak function takes as a parameter a function
I want to be called when that event occurs. The function I want called
in turn takes 1 parameter. The `event` object has all the information
about the event which just occurred. I can tell who broke the block
and send a message to the player. The important thing to note is that
the `myBlockBreakHook` function defined above will not be called until a player breaks a
block. Try it - save the above code in a new file in the
`scriptcraft/plugins` directory then type `/js refresh()` to reload
scriptcraft. Then break a block in the game and you should see the
message 'You broke a block'.

There are many types of events you can listen for in Minecraft. You can
browse [all possible event registration functions][spevts2] in the API Reference.

For custom events (events which aren't in the org.bukkit.event tree)
just specify the fully qualified class name instead. E.g. ...

    events.on ( net.yourdomain.events.YourEvent, function( event ) {
        ...
    });

### Stop listening to events.

If you want an event handler to only execute once, you can remove the handler like this...

```javascript
function myBlockBreakHook( evt ) {
  var breaker = evt.player;
  echo( breaker, 'You broke a block');
  this.unregister();
}
events.blockBreak( myBlockBreakHook );
```

The `this.unregister();` statement will remove this function from the
list of listeners for the event. The `this` keyword when used inside
an event handling function refers to a Listener object provided by
ScriptCraft, it has a single method `unregister()` which can be used
to stop listening for events.

To unregister a listener *outside* of the listener function...

```javascript
function myBlockBreakHook( evt ){
  var breaker = evt.player;
  echo( breaker, 'You broke a block');
}
var myBlockBreakListener = events.blockBreak( myBlockBreakHook );
...
myBlockBreakListener.unregister();
```
## Keeping Score - Lookup tables in Javascript

In the *Event-Driven Programming* section, I defined a function which
displayed a message to players every time they broke a block. Imagine
if I wanted to keep a count of how many blocks each player has broken?
This is where Javascript's Objecct literals come in handy. An object
literal in javascript is simply a way of creating a new Object
on-the-fly in your code. This is an example...

    var myNewObject = { name: 'walter', country: 'Ireland' };

... I created a new object with two properties 'name' and
'country'. The notation used to create this object is called JSON
which is short for JavaScript Object Notation. If I want to find out
the 'country' property of the myNewObject variable there are a few
ways I can do it...

    var playerCountry = myNewObject.country;

... or ...

    var playerCountry = myNewObject['country']

... JavaScript lets you access any object property using either
dot-notation ( `object.property` ) or by index ( `object['property']`
). The result in both cases is the same - playerCountry will be
'Ireland'. When accessing the object by indexing, the property doesn't
even have to be a string literal - it can be a variable like this...

    var propertyName = 'country';
    var propertyValue = myNewObject[propertyName];

... in the above example, the propertyName variable is used when
indexing. What this means is that every object in JavaScript can act
like a lookup table. What's a lookup table? A table you 'look up' of
course. This is a table of names and scores...

    Name            Score
    --------        -----
    walter          5
    tom             6
    jane            8
    bart            7

... If I want to find Jane's score, I look *down* the list of names in
the name column until I find 'jane' then look *across* to get her
score. In Javascript, an object which stored such a table would look
like this...

```javascript
var scoreboard = {
  walter: 5,
  tom:    6,
  jane:   8,
  bart:   7
};
```

... and if I wanted to write a function which took a player name as a
parameter and returned their score, I'd do it like this...

```javascript
function getScore(player){
  return scoreboard[ player ];
}
```

... I might call such a function like this...

```javascript
var janesScore = getScore('jane'); // returns 8
```

... putting it all together, a hypothetical scoreboard.js mdoule might
look something like this...

```javascript
var utils = require('utils');
var scores = {};

exports.initialise = function(names){
  scores = {};
  utils.foreach(names, function(name){
    scores[name] = 0;
  });
};

/*
  changes score by diff e.g. to add 6 to the player's current score
  updateScore('walter',6); // walter's new score = 5 + 6 = 11.
*/
exports.updateScore = function(name, diff){
  scores[name] += diff;
};

exports.getScore = function(name){
  return scores[name];
};
```

## Counting block break events for each player

I can use a Javascript lookup table (a plain old Javascript object) to
keep a count of how many blocks each player has broken ...

#### block-break-counter.js

```javascript
var breaks = {};

/*
  every time a player joins the game reset their block-break-count to 0
*/
function initializeBreakCount( event ){
  breaks[event.player.name] = 0;
}
events.playerJoin( initializeBreakCount );

/*
  every time a player breaks a block increase their block-break-count
*/
function incrementBreakCount( event ){
  breaks[event.player.name] += 1; // add 1
  var breakCount = breaks[event.player.name];
  echo( event.player, 'You broke ' + breakCount + ' blocks');
}
events.blockBreak( incrementBreakCount );
```

With a little more work, you could turn this into a game where players
compete against each other to break as many blocks as possible within
a given time period.

## Next Steps

This guide is meant as a gentle introduction to programming and
modding Minecraft using the Javascript Programming Language.
Javascript is a very powerful and widely-used programming language and
there are many more aspects and features of the language which are not
covered here. If you want to dive deeper into programming and modding
minecraft, I recommend reading the accompanying [ScriptCraft API
reference][api] which covers all of the ScriptCraft functions, objects
and methods. I also recommend reading the source code to some of the
existing scriptcraft plugins, followed by
[Anatomy of a ScriptCraft Plug-in][ap].  The online [SpigotMC API
Reference][spigotapi] provides lots of valuable information about the
different objects and methods available for use by ScriptCraft.

[spigotdl]: https://hub.spigotmc.org/jenkins/job/BuildTools/
[dl]: https://github.com/walterhiggins/ScriptCraft/releases/latest
[cmadmin]: https://github.com/walterhiggins/canarymod-admin-guide/
[dlbuk2]: http://dl.bukkit.org/downloads/craftbukkit/
[dlcm]: http://canarymod.net/releases
[bii]: http://wiki.bukkit.org/Setting_up_a_server
[sc-plugin]: https://scriptcraftjs.org/download/
[ce]: http://www.codecademy.com/
[mcdv]: http://www.minecraftwiki.net/wiki/Data_values
[np]: http://notepad-plus-plus.org/
[cbapi]: http://jd.bukkit.org/beta/apidocs/
[cmapi]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/
[spigotapi]: https://hub.spigotmc.org/javadocs/spigot/
[boole]: http://en.wikipedia.org/wiki/George_Boole
[soundapi]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/api/world/effects/SoundEffect.Type.html
[ap]: Anatomy-of-a-Plugin.md
[api]: API-Reference.md
[twl]: http://www.barebones.com/products/textwrangler/
[bkevts]: http://jd.bukkit.org/dev/apidocs/org/bukkit/event/package-summary.html
[cmevts]: https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/hook/package-summary.html
[cmevts2]: API-Reference.md#events-helper-module-canary-version
[spevts2]: API-Reference.md#events-helper-module-spigotmc-version
[img_echo_date]: img/ypgpm_echo_date.png
[img_3d_shapes]: img/ypgpm_3dshapes.jpg
[img_whd]: img/ypgpm_whd.jpg
[img_dv]: img/ypgpm_datavalues.png
[img_ed]: img/ypgpm_ex_dwell.png
[img_2boxes]: img/ypgpm_2boxes.png
[img_cr]: img/ypgpm_mc_cr.png
[img_greet]: img/ypgpm_greet.png
[img_ssf]: img/skyscraper_floor.png
[img_ss]: img/skyscraper.png


Green Acres Bowling League is a great way to stay in touch with neighbors during the long winter months. The league meets just once a month, on the 2nd Saturday from September to May. We bowl at Heritage Lanes beginning at 7:30 p.m.
Teams consist of two couples (one male and one female). We prefer that each member be a Green Acres resident, but we do have folks who are not.


text:
Q: Derive the result of a formula for each combination of three input parameters I have been struggling with an issue in R and have tried google and the search function, but have not found a solution.
I would like to do the following:
Derive the interest rate payment revenue for a set of combinations of duration, amount and interest rate. The set are defined as follows:

*

*Amount (a) = 1,000 - 25,000 with intervals of 100

*Duration (d) = 12 - 60 (months) with intervals of 6

*Interest Rate (i) 0.00 - 0.015 with intervals of 0.001

The formula goes as follows: w = ad(((i/12)*(1+(i/12))^(d))/((1+(i/12))^(d)-1)) - a
, where w is the interest rate payment.
My solution was to calculate w with three 'for' loops and save the data with the 'rbind' command. Sadly this does not work for me:
result = NULL

amount <- seq(1000, 25000, by=100)

duration <- seq(12, 60, by=6)

interest <- seq(0, 0.015, by=0.0001)

for (d in duration){
    for (a in amount){
      for (i in interest){
        w = a*d*(((i/12)*(1+(i/12))^(d))/((1+(i/12))^(d)-1)) - a
      }
    }
}

result = rbind(d, data.frame(d, a, i, w))

What am I doing wrong? Am I kind of on the right track? The output should be a list with all possible combinations and the 'w' value. Alternatively, the output could be a list with all possible combinations for a certain value for w.
Thank you a lot in advance!
Best, Alex

A: Here is how to tweak your current approach:
amount <- seq(1000, 25000, by=100)
duration <- seq(12, 60, by=6)
interest <- seq(0, 0.015, by=0.0001)
result <- expand.grid(amount, duration, interest)
names(result) <- c("amount", "duration", "interest")

for(i in 1:nrow(result)){
  result$w[i] <- result$amount[i]*result$duration[i]*(((result$interest[i]/12)*(1+(result$interest[i]/12))^(result$duration[i]))/((1+(result$interest[i]/12))^(result$duration[i])-1)) - result$amount[i]
}

However, data.table is about a million times faster:
library("data.table")
amount <- seq(1000, 25000, by=100)
duration <- seq(12, 60, by=6)
interest <- seq(0, 0.015, by=0.0001)
result <- expand.grid(amount, duration, interest)

setDT(result)
setnames(result, c("Var1", "Var2", "Var3"), c("amount", "duration", "interest"))
result[, w := amount*duration*(((interest/12)*(1+(interest/12))^(duration))/((1+(interest/12))^(duration)-1)) - amount]

redpajama_set_name: RedPajamaStackExchange


text:
Amid crisis, Venezuelans say U.S. is revoking tourism visas
"I have never seen this amount of canceled visas, for no apparent reason," says an immigration attorney in Miami.
The U.S. embassy in Caracas.Miguel Guti?rrez / EPA
May 23, 2018, 5:38 PM UTC / Updated May 23, 2018, 5:38 PM UTC
By Carmen Sesin
MIAMI — Milexy Méndez, a journalist from Caracas, said she cried every day for a week after her family's tourist visas were revoked last month by the U.S. Embassy in Venezuela, forcing them to cancel a trip to Miami to visit relatives just days before leaving, losing $1,400 in airline tickets.
She is not alone. The number of Venezuelans having such visas revoked by the embassy has risen sharply in the past four months, Miami based Venezuelan organizations and immigration attorneys say.
The embassy's actions come as Venezuela is in the grip of an economic and political crisis that has seen a surge in citizens leaving the country and in Venezuelans already in the United States seeking asylum. Many Venezuelans say they believe the visas are being revoked in an attempt by the U.S. to stem that flow.
Méndez, 31, and her husband, Rafael Carballo, have traveled to the United States in the past without incident. In last April, they went to the American Embassy in Caracas with his 87-year-old grandmother so she could be interviewed as part of her visa application. At the end of the appointment, his grandmother's visa was denied and his was revoked.
"They did not give an explanation why," Méndez said.
The same day, she received an email, later viewed by NBC News, stating that "the U.S. Department of State has the intention of revoking your visa in the coming days." It said Méndez had five days to discuss her case with a consular official.
Milexy Mendez with her family. She recently had her tourist visa revoked by the U.S. Embassy in Venezuela. courtesy of Milexy Mendez
To prove she intended to return to Venezuela, she arrived at the appointment armed with binders of papers documenting that she is employed, and that she owns a home, cars and businesses with her husband. At the end of the interview, her tourist visa and her 18-month-old son's were revoked.
"It's alarming, it's sad and it's humiliating," she said.
Nonprofit Venezuelan organizations in Miami and immigration attorneys, as well as Venezuelan nationals like Méndez interviewed by NBC News, allege that such visa revocations have surged in recent months. In many instances, they said, Venezuelans with valid visas were trying to obtain a new one for a family member, and after that visa was denied, the rest of the family's visas were revoked.
José Colina, the president of a Venezuelan exile organization in Miami, said he had heard of close to 40 such cases since January.
"This is causing alarm among Venezuelans because their visas are valid." he said. "They are just applying for other relatives."
A country in crisis: a healthcare system on the brink of collapse
April 25, 201805:04
"I have never seen this amount of canceled visas, for no apparent reason — for Venezuelans or other nationals," said Nada Sater, a Miami immigration attorney.
The State Department did not respond to requests for comment about the tourist visa revocations. The department does not publicly release data regarding revocations, and many of the Venezuelans whose visas were revoked said consular officials did not offer an explanation.
However, a State Department official noted that American embassies have broad authority to revoke visas at any time if it is determined that a visa holder may be inadmissible to the U.S. or otherwise ineligible for a visa.
The U.S. requires visas for visitors from Venezuela. Likewise, American citizens need a tourism visa to visit the South American country.
Asylum applications are on the rise. So are visa denials.
Venezuela's economic and political crisis has spurred one the largest migration flows in Latin American history. The result has been a massive exodus of Venezuelans. Independent groups estimate that 3 million to 4 million Venezuelans have fled the country in recent years.
In the U.S., the number of Venezuelans seeking asylum has soared. During fiscal year 2017, 27,629 Venezuelans applied for asylum, far more than citizens from any other country. In 2015, that number was just 5,605, according to U.S. Citizenship and Immigration Services (USCIS).
People walk past stores in downtown Caracas.Marco Bello / Reuters
Though none of the people interviewed by NBC News whose visas had been revoked say they had intended to stay in the U.S., a large number of Venezuelans who enter the U.S., mostly through Miami, on tourism visas do end up applying for asylum.
Sater, the immigration attorney, said that she grew concerned in March after several Venezuelan clients in the U.S. came to her with the same complaint: Their relatives in Venezuela had had their visas revoked.
"It's strange," Sater said. "I think it's going on because they want to stop the influx of Venezuelans from coming into the country."
newsExpecting Maduro win, many Venezuelans say they won't vote on Sunday
Responding to NBC News via email, USCIS spokesman Michael Bars, said asylum claims have skyrocketed across the board, "largely because migrants know they can exploit the U.S. immigration system in order to avoid removal and remain in the U.S."
"Every means in accordance with the current law is on the table to protect the integrity of our immigration system from those seeking to exploit it by bogging it down with meritless or fraudulent claims, and undermine lawful petitioners," according to Bars.
The number of nonimmigrant visas issued to Venezuelans has fallen drastically, from 239,772 in 2105 to 47,942 last year, according to State Department statistics.
However, there was a period from May 2016 to this January in which the embassy was unable to schedule new appointments for applications for non-immigrant visas because of a staff shortage; since then there has been an increase in staff.
According to the State Department, the resulting drop in appointments during the staffing shortage could have led to the decrease in visas. But a comparison of this year's monthly numbers to last year's still shows a decline. For instance, in March 2017, when new visa applications were not being accepted, 4,327 visas were issued. Now that new applications are being accepted, that number dropped to 1,045 this March.
Venezuelans have vented their frustration on the Instagram page of the U.S. Embassy in Venezuela. Some have complained in Spanish that their visas were revoked for no reason, while others pleaded with U.S. Sen. Marco Rubio, R-Fla., to intervene on behalf of their families.
Some Venezuelans have said that the visa revocations and denials are separating them from their families — a growing number of Venezuelans in the U.S. cannot return to their homeland because of political reasons.
The revocations and denials come at a steep price. Each visa application costs $160 — a hefty price in a country where the average monthly salary is about $7. Many Venezuelans say they are spending too much just to be denied.
In March, Gabriela, who did not want her real name used so as not to antagonize U.S. embassy officials, filled out an online form to renew her children's tourism visas. They were planning to spend a couple of weeks in Miami this summer visiting family.
specialsIn the chaos of Venezuela, a daughter fights for her father's life
She had previously obtained visas for her sons, now 7 and 9, but never used them, and the visas were about to expire. A friend of hers recently had her visa revoked, so Gabriela, 32, said she used her contacts to arrange for two U.S. elected officials to send letters of support to the embassy.
To her astonishment, on the day of the interview, not only were her sons' renewals denied, her 10-year tourism visa was revoked.
She said she took documents to prove that she owns businesses and properties and cares for her 98-year-old grandfather in Venezuela, and that she had no intention of staying in the U.S.
For the past 25 years, she has traveled to the U.S. with a tourist visa, but she said the consular officer this time did not appear interested in the documents.
"All he asked to look at was my passport," Gabriela said. "He asked me five questions, walked away, and returned saying my passport had been revoked. He never gave me a reason why."
She was dumbfounded and angry.
"I did not have plans to stay in Miami. Now my sons cannot meet their family," she said. "I feel frustrated and deceived."
FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM

redpajama_set_name: RedPajamaCommonCrawl


Our lives are a reflection of our attitude.
It can be easy to become negative and cynical toward the world without even noticing. With the continuous exposure to tragedy and injustice that we are exposed to daily, we can quickly start to experience our own heartache and distress.
Not only is this negative attitude preventing you from enjoying your life fully, but it can also have a significant impact on your health and environment.
Here are five powerful ways that you can begin to cultivate a positive mindset and change your life.
There are times when a single event can ruin your entire day, and an unpleasant interaction can overshadow the enjoyable parts of your day.
With this awareness in mind, you can intentionally focus on the good parts of the day by keeping a gratitude journal. Every night, before you go to bed, write down five things that you're grateful for and see how your attitude changes.
You have to get into the mindset that there are no dead ends, only re-directions.
Don't let uncontrollable events render you helpless. Learn to control the effort you put in and have fun with challenges that you encounter. Embrace challenges as a new adventure rather than attempting to resist an experience for growth.
The words you use have a lot more power than you think.
How you talk about your life is how your life will be. Your mind hears what you say about yourself and your life. If you describe your life as boring, hectic, chaotic, that's is exactly how it will be. However, if you use the words familiar, involved, or lively, you will see your life in an entirely different light.
A study conducted by the Warsaw School of Social Psychology determined that complaining leads to lower moods, negative emotions, and a decrease in life satisfaction and optimism.
Don't let other's pessimism bring you down. If you don't join in with the complaining, others will start to complain less as a result.
The outcome of your day can be directly affected by your thoughts and actions when you wake up.
Mornings set the mood for the day, which makes it imperative to create a mindset that is positive. Start your day with excitement and enthusiasm and see how it affects the rest of your day.
Start cultivating a positive mindset and watch how your life changes for the better.
Let me know if you found this list useful, I would love to hear from you!


Brrrr! It's cold outside! Your pots, window boxes, and decorative containers may be starting to freeze. If you still need to create your holiday containers, we've got some tips on how to make the soil workable.
Drill holes in frozen soil with a concrete bit or an old dull bit. New bits may be damaged.
Pound a spike in frozen soil to create holes for branches.
Set up a tent/teepee around your container. Hang a light bulb in the center (preferably a work light that tends to run warm). Make sure that fabric isn't touching the bulb or it may scorch.
Use a shovel or a sharp object to try to break up the soil. Replace some of the frozen soil with new soil.
Once you have your soil thawed or holes created, filled with greens, branches, cones, berries, decorative picks and more. Let your imagination take wing!


How to Deploy Xtext to a Headless Plain-Java Environment?
Yesterday, Sven and I were at the Eclipse Democamp in Hannover which was organized by brox IT-Solutions and Bredex - thanks for the nice event. I met interesting people and we discussed various topics. One particular question about Xtext was raised several times from different sides: How do I use my language in an environment without Eclipse, e.g. on a build server? As this was already possible from the first minute even with the former oAW version of Xtext and with Xtext 0.7.0, too, I was kind of suprised. In fact, any execution of the generator workflow uses Xtext in a standalone environment - without OSGi, Equinox or any dependency on Eclipse UI. The problem seems to be another one: How can I determine all the required libraries to deploy my Xtext-driven generator?
Select the options of your choice, point to a target file and hit the Finish-button. Eclipse will collect required libraries and add the necessary entries to the MANIFEST.MF in the runnable JAR file. As I already said, it's suprisingly simple.
It's probably a good idea to wrap the invocation of the Mwe2Launcher in a custom main class to encapsulate the name of the generator workflow and pass additional arguments to the workflow.
A quick glimpse at the New and Noteworthy features of Xtext 1.0 reveals that the framework allows to develop languages that are case insensitive.
The o.e.x.g.parser.antlr.ex.rt.AntlrGeneratorFragment and o.e.x.g.parser.antlr.ex.ca.ContentAssistParserGeneratorFragment replace the two fragments, that are configured by default: o.e.x.g.parser.antlr.XtextAntlrGeneratorFragment and o.e.x.g.parser.antlr.XtextAntlrUiGeneratorFragment.
Xtext provides an API that allows to define custom, local scopes that are ignore case as well. Have a look at the utility class o.e.x.resource.ignorecase.IgnoreCaseScopes to learn more about it. The configured generator fragments will take care of the rest, e.g. the default bindings for the global scopes, the parser and the serializer.
As you can see it is possible to define case insensitivity independently for keywords and cross-links. And if you want to keep your workflow short and concise instead of adding this flag for each and every fragment that accepts this option, you are free to introduce a new property and use this one directly or via the auto-inject option. Please refer to the updated documentation if you want to learn more about the MWE2 language.


text:
-Main
-09.26.02
-Store o' Goodies
-LiveJournal Community
-VGR Radio
-VGR: The Comic
-Site History
-Site Map
Past contests:
-Durandal Poetry Contest
-Wankese 101 Contest
"Ariel heads for the underwater hills while Flounder and Sebastian take cover under in a handy clamshell and the Heartless swim in, as menacing as things that look like a cross between a jellyfish and a used Kleenex can look, that is to say, not much."
-Kelly, Kingdom Hearts Part 9
09.18.02 :: "Mary Sue" -- in honor of us all
The opinions in this letters column aren't necessarily those of Jeanne Rubbo, owner of videogamerecaps.com. Even so, Jeanne owns *us* and has locked us in a dark closet with Tidus and Rinoa until we think of something funny. HELP! In the meantime, send in your comments, queries, whining, flames, spam, opinions, facts, opinions that you think are facts, and general idiocy to mailbag@videogamerecaps.com
Youkoso, mina-san! VGR Mailbag desu! In the spirit of our topic this week (bad Mary Sue fanfics) we thought we'd throw some random Japanese into the intro, since Mary Sues just LOVE Japanese words. Kawaii! Sugoi! Anyway, this week we?re paraphrasing Ricky Nelson and saying ?Hello Mary Sue. Goodbye stomach contents.? We asked for your impressions on the genre of fanfics, and you responded. So, without much further ado, let?s delve into how "fun" Mary Sues can be, ne?
Sephy just needs a little luv from Mary
...Mary Sues. I know thee only too well.
I could go on for ages about Mary Sues and go into detail with many, many fandoms and my personal problems with each one; but, this is a Final Fantasy/videogame-focused site, so...um...yeah.
The first story that comes to mind is a horrible little thing in which Zell meets a girl like him in every way possible, and they fall in love. (Does she enjoy burying her face in Squall's crotch, too?) And it was as bad it sounds, in case you want to know. And don't even get me started on the whole "Seifer becomes a SeeD and has a new student named Rune Angelique Ryne Judo Hakishi who's in TROUBLE because of mean ol' Squall who doesn't like her because she's so COOL and Squall's so STUPID and SEIFER ROOLZ! - can he save her?" plotline. Sadly enough, there are roughly about 345,654,300,201 of these kinds of stories out there. By the way - Seifer's hot for Squall, in case Rune Angelique Ryne Judo Hakishi wants to know.
And the amount of Sephiroth x Mary Sue stories out there is just...STUPID - I mean, really, that makes as much sense as Sephiroth x Aerith. And WHY the hell would Vincent forget all about Lucericia and decided to get together with that pretty young teenager who thinks that she's from another world and got sucked into a videogame? If only Mary Sue stories made sense. Then, I might not hate them so much.
Thank you for your ill-spent time - Nia
Yeah, Sephiroth x Mary Sue makes the same amount of sense as Sephiroth x Aeris/Aerith (why do you fanboys get so goddamned riled up about that, anyway? Stupid thing to argue about, IMO) but you'd be surprised--or not--at the number of THOSE particular fics that "grace" the Internet. Bottom line: fanfics in general aren't required to make sense. The good ones do, but there are so few good ones that "good fanfic" is almost an oxymoron. For a self-professed "good" fanfic-writer like myself, it's kind of depressing. No, scratch that. It's extremely depressing.
-LC
Nia,
I would never consider my time working on the mailbag to be ill-spent. At least, not as ill-spent as writing (or reading, for that matter) a fanfic where Squally?s straight or Zell hooks up with a girl just like him. (nightmare material for weeks ? WEEKS, I tell you!) I can understand many a fangirl?s rampant desire to be with the studly goth boy that is Sephiroth, hell, I?m walking proof that a married, adult woman can be overtaken with character lust, given the right circumstances, but that doesn?t mean that I would ever want to read about them. Your opinion is shared by many, so read on and see!
-AG
The voices...make them stop!
Once again another hastily written letter to you fine letter answerers. Mary Sues? I know of 'em. I've written a few.
The first ever one was on the heels of Final Fantasy IV (or 2 as it was released here). It was Kain Jr., the disciple (NOT the son) of Dragon Knight Kain and he basically was perfect. He snagged Rydia, gained magic powers of every type, changed the landscape of the world to one continent and brought the people of the moon and the dwarves above ground to all live together. In other words, he was so perfect he was boring.
Now, for a few words on my current anime Mary Sues:
Irochi Tsukino: Sailor Moon SM, she's a 19-year-old silver-haired, bisexual senshi that wields a sword and is cold-hearted to everyone but her sister.
Kiryuu Takashi: Tenchi Muyo! SM, 2,000 year old Jurian swordsman currently living and training in a grounded spaceship next to the Masaki household; in the hopes that one day, he will finally be able to best his mother in combat.
Cyril Delacroix: Slayers SM, a 15-year-old half-draconian boy, he wields a sword in each hand and does merc jobs in the hopes of finding his object of desire: Lina Inverse. Of course, authorial whim dictates that he'll just miss her at every turn, until the plot decides when they meet.
Satoru Masaki: Evangelion SM, a 15-year-old Eva pilot, designated as the Seventh Child. Lives in Misato's apartment, and is constantly screwing up at getting a date. Why? Authorial whim. ^^ Usually keeps to himself, though a half-suave, half-pervert side comes out if he's hitting on a girl.
And there you have it, 4 products of a deranged mind. Enjoy and comment.
~Alex Magusaka
Alex, honey, be careful. Otherwise, you?re going to start thinking those voice in your head really ARE other people. Thanks for sharing your Gary Stu ?lives? with us all. It takes a gutsy young man to own up to Gary Stu fanfics, so go you!
When I saw the name "Kiryuu Takashi," for half a second I thought you were referring to a second younger sibling of Kiryuu Touga, except this one would have his/her incestual pinings reciprocated. Now that would be an interesting read. And pretty much every Sailor Moon Mary Sue (AKA "Sailor Magical Fairy Stardust Butterfly") I've ever seen is bisexual, so she can get it on with Mamoru AND the male Three Lights (since seemingly everyone thinks Seiya, Taiki and Yaten are "icky" as girls) and THEN have a threesome with Rei and Minako. Not that the series doesn't ask for it -- it's gotta be the easiest Mary Sue target EVER. Anyway, yeah, thanks for sharing. It's nice to know men aren't above acting out their fantasies via nauseatingly perfect fanfic characters.
When is Mary Sue okay?
Good day te ye, ladies.
So, I see that the subject of the week are them Self-Importants, Mary Sue and Gary Stu. It's no secret that nearly everyone has been subjected to their works at least once, as they go by many names: Wesley Crusher, Shinji Ikari, Usagi Tsukino, Makoto Mizuhara, Ash Ketchum... the list goes on. But those are the (mostly) legit Mary Sues, the ones who are liked by at least a portion of their story's fanbase (well, except for Wesley). The majority of the stinkers are congregated around fanfiction.
Like slash, Mary Sues blossomed in the Star Trek fandom. It was there that we met talented, up-and-coming ensigns who marveled all with their combat dexterity, strategic brilliance and beautiful singing. Some of them began torrid romances with Kirk, or Spock, or both at the same time.
Since I'm not into Star Trek much, though, I'll get on to my experiences with Mary and Gary. Such experiences are mostly confined to anime-related fanfiction, which makes enough of an overlap with videogames for it to be relevant to this Mailbag.
Anyone familiar with Sailor Moon may think that the show is ripe for Mary Sues, and they would be right. The author has admitted to being a lot like Usagi in behavior, and new senshi (or Scouts, depending on which version you adhere to) get quite the focus in their introductory eps, along with the exhibition fight, before being forced back into the background. With that in mind, having a fic in which Mary Sue shows up at Usagi's school, turns out to be a Sailor Senshi and saves the day against the Monster of the Week, can be pulled off successfully, so long as the fic doesn't focus _too much_ on ol' Mary.
[Brief self-promoting aside: The Sailor Moon fic I'm currently MSTing is, in spite of its many syntax errors, pretty much a textbook example on how to pull off a Self-Insertion in a context fitting for the show.]
However, when Mary Dearest gets both the Magical Plot Contrivance Powers(TM) AND the Motley Collection of Stereotypical Friends AND the Mysterious Kakkoi Male Aide (in other words, when she steals SM's schtick), things go awry. For example, Sailor Moon Hentai. No, that's an SI Fic's title, not the subgenre. Five friends of Usagi & co. meet a lemony-green-hued cat (with an 'H' in its forehead) who grants them ecchi-esque powers with which to slay evil. That's on part one. On part two, their enemies capture the Hentai Senshi and drain their powers by submitting them to their wildest fantasies (again, it's told in a way to make it Not Quite Porn). From part three onwards, the fic suddenly shifts gears with an endless parade of new senshi who get no characterization, new powers and large portions given to the transformations and the Final Attack(TM). It's almost like a bad parody of the show, really.
Next are the Evangelion Gary Stus. Mary also appears a few times but Gary often gets more mileage here. After all, the world of EVA _NEEDS_ Gary's Alpha Male Dominance(TM) to counter Shinji's wussiness, the ladies' mental traumas and Gendo's manipulations. The folks over at www.elmerstudios.com have made an art out of MSTing Gary Stu's EVA escapades (and Mary's lesbic EVA fun in "The Fate of the Children"), so you people can just go and see for yourself. I will, however, take some time here to mention arguably the first EVA Gary Stu: D.J. Croft of Neon Exodus Evangelion, the Fifth Child (insert Big Gay Kaworu jokes here), lovechild of Fox Mulder and Lara Croft, knows all about SEELE, has H.A.L. as his Personal Computer, and last but not least, made Rei experience actual emotions. Actually, the last part isn't so bad, except that you can't read this series without the foreboding feeling that he'll be getting it on with all of the female cast, including his dear ol' mum. Did I mention that the NERV was relocated to Worcester-3? At least it's well written.
Well, I guess there really isn't much to say, other than giving some reference links: the aforementioned Sailor Moon SI can be found (in MSTed format) over at www.svamcentral.org/svam. Also, to read NXE in its full, un-MSTed entirety, check www.eyrie-productions.com, home of Usenet's finest fanfiction since 1991, according to Ben Hutchins. The nice folks at Eyrie have a good deal of stories on the web that will entertain many. You may love them, you may hate them, but you WILL be entertained, at least.
~Quartz Falcon
QF, you've once again brought up an extremely interesting point. The idea of a "canon Mary Sue" has been wandering through my brain lately, and you raise several excellent examples. In the case of Tsukino Usagi you're spot on, as the creator of the series even said at one point that Usagi was more or less her in manga/anime form. I'll add one more to your list: Miaka Yuuki of Fushigi Yuugi fame. She's the amazing, beautiful priestess from another world who finds perfect true love in the disgustingly handsome, good and noble Tamahome, draws the affection of her other guardians (Hotohori, Tasuki, Nuriko), saves two different worlds, and still manages to get into the high school of her choice, reunite with her best friend AND impossibly get into Tamahome's pants, even though he's a fictional character EVEN IN THE CONTEXT OF THE STORY. Busy girl.
I don't know if Wesley Crusher counts as a Mary Sue, though, as funny as the idea is. Because he's really not the center of the Enterprise's little universe. Dr. Crusher and Picard are really the only people who give a rat's ass if Wesley lives or dies.
Wow, QF. A love child between Fox Mulder and Lara Croft? Someone who believes in UFOs and to prove it they systematically loot their way through Area 51, blowing away all who cross their path? That's something worth reading about, no doubt about it! But really, dear boy, must you MSTy the poor Mary Sues that come your way? They do a good enough job making us laugh as it is. How cruel you are to those struggling writers out there who only want to live out their dreams of anime glory/omnipotent powers/endless character boffing! Why, you're a boy after my own heart.
The worst Mary Sue....EVER
Dear AG and Lita-chan,
I believe the pun in your last mailbag would be in the phrase "Marry Shu." The only alternative would be "horror stories," and let's just not go there.
I apologize for how long this letter is going to be.
(Note: I realize there are male Mary Sue (Gary Stu) authors out there, but since female Mary Sue authors are much more common, I shall use them for my examples in this letter. Thank you.)
1) My own Mary Sue stories:
I'm not proud of this, but it's so embarrassingly amusing, I must share it. Yes, I have written a Mary Sue. In my defense:
a) I was a teenager at the time.
b) My story counterpart was pretty much me, not some pathetically overidealized version of me. (So would it technically be called a Mary Sue at all then?)
c) I was writing it to be silly.
Unfortunately, I ended up sharing it with a few close friends of mine, otherwise I could have lived the rest of my life without the humiliation of realizing "Oh my GOD, I actually showed this to people!!" Poor Jason. That's all I'm going to say. And the only reason I'm admitting the existence of this story is that I wrote it so very long ago.
The premise of my story was that all these characters from various videogames and anime, as well as characters I had created for a PUGGY!!! the Pound Puppy/Robin Hood crossover series (Don't ask. Just don't.) randomly showed up in my neighborhood. Hilarity (and some boffing) ensued. The best part was that I tried to keep up with as many different characters and plotlines as possible. I read too much Robert Jordan at the time, which explains that. The main plotline involved destroying my ex-boyfriend, who was a disgusting monster (in the story -- he was just a wanker in real life). Some subplots included Puggyana (the sorceress)'s Frosted Flakes cereal being poisoned, Puggyana educating the morons in Jeanne's high school band, and Celes wanting to kill the moogle for constantly falling down in battle. So basically, this was a therapeutic fantasy story. And I realized that, at least.
2) The worst Mary Sue fanfic ever:
Mine could definitely be a contender for this coveted title, but I think my final choice for this category outranks mine because of the seriousness of the story and the fact that it's posted on the internet. I speak, of course, of TurtleNinja. I'm sure there are many worse Mary Sues out there, but I'm not exactly a big fanfic reader, and I happen to have several friends who are into the Ninja Turtles who introduced me to the glory of TN.
I could write an entire letter on the subject of TurtleNinja, but this is already really long, so I'll summarize. TurtleNinja is a beautiful, psychic turtle princess from another planet. During the course of her many long stories, TurtleNinja gets with at least half the ninja turtle team. She also ends up in a coma in pretty much every story. And the writing! Oh, the writing. Abridged battle scenes! Narrators that are nowhere near the main action! Now go and read. But don't blame me for the tears that follow.
3) Favorite Mary Sue clich?:
My most favorite Mary Sue clich? would have to be the rewriting of existing plotlines (vs. creating a brand new story) to include the beautiful, witty, fabulous new heroine -- as if there was something lacking in the original story and by golly, the fanfic author has got to fix it! I'm going to use Lord of the Rings to illustrate my point, even though it's not a game (yes, I know there's a game, but you know what I mean).
Some teenage (or adult) woman looks at this classic piece of fantasy literature and thinks, "You know, that Tolkien guy is pretty good and all, but I know what would make this story better -- me! Specifically, a psychic, magical, beautiful, thinner, witty, talented version of me to travel with the party and have sex with Frodo and/or Legolas and/or Aragorn -- oh, and destroy the One Ring."
I'm guessing that using an existing storyline is easier, because the author can have her fantasy without having to do as much original work. All she has to do is insert the boffing (so to speak) and change some of the already-existing events to include some witty remarks and heroic actions by the new main character. But think about it -- rewriting Tolkien. Yeah.
4) 500 word Mary Sue story (contains FFX spoilers):
This is a realization of a half-drunken, late night brainstorm session by myself, Susi, and Jason at AnimeIowa. We were trying to create the worst Final Fantasy X Mary Sue story EVER. It stars, of course, me, John, Susi, and Jason. Try to spot us. I've named the story "Jeanne" -- in honor of all of us.
Once upon a time, four gods created Spira. Their names were Fleanne, Flohn, Flusi, and Flason. They were omnipotent, immortal, gorgeous, thin, witty, psychic, and had special powers. Fleanne was an expert swordswoman with a beautiful singing voice and the power of Earth. Flohn was a machina expert with a beautiful singing voice and the power of Air. Flusi was a star blitzball player with a beautiful singing voice and the power of Water. Flason was a powerful black mage with a beautiful singing voice and the power of Fire. They were all summoners, too. Together, they had been involved in pretty much every big event in the entire history of Spira. And some of it was tragic.
They took a short break in their godly day, and suddenly the entire planet was filled with anti-machina religious weirdoes. Yikes! The four gods decided that they needed to fix things, and pronto.
As they had at various times in the past, Fleanne, Flohn, Flusi, and Flason took human form and went down to Spira. They found out that there was this wanker called Yu Yevon who controlled this giant monster called Sin that kept attacking people. And these summoners kept trying to defeat Sin, killing themselves in the process. This had to stop. So the four of them joined a pilgrimage that just happened to include enough guardians (and a summoner) for them all to boff someone.
Fleanne got with Auron, who, despite being dead and having enough honor to not get involved with someone physically and emotionally because of that, just couldn't resist her wittiness, her beauty, and her impressive skill with swords. Flohn pushed that wanker Tidus aside and claimed Yuna's heart for his own. And because, through the magic of fanfiction, she had suddenly turned 18 and thus was of age, he could boff her without being a disgusting pedophile. Flusi hooked up with Wakka, and they spent a lot of time in the water playing with balls and smoking the Blitzbong (in more ways than one). Flason used his impressive magical skills to lure the luscious Lulu into his bed. Where they did it. Oh, and everyone fell in love, too. It wasn't just about the sex.
All the other male characters in the game wanted Fleanne and Flusi, and all of the female characters wanted Flohn and Flason. Seymour, who usually liked children, wanted all of them. It must have been the thongs. Yes, because they all wore thongs and crotch straps.
At the end, it was time to fight Yu Yevon, the mighty Tick Man himself. Flohn's love for Yuna had stopped her from going through with her mission and thus killing herself. The gods knew of several ways to kill ticks. You couldn't just squash them, because they were already flat. You could tear them in half, burn them with fire, or flush them down the toilet. So Fleanne used her impressive swordfighting skills to cut Yu Yevon in half, Flason burned him with fire, and Flusi and Flohn combined their powers (water and machina) to create a toilet, which they then flushed Yu Yevon the tick down. He was dead.
Now that Yu Yevon, and therefore Sin (oh yeah, they had also defeated Jecht, who was Sin (Sin is Jecht), right before the Yu Yevon part) were out of commission forever, it was time to take care of some items of business. As Yuna started sending her aeons, Auron began turning into pyreflies. Fleanne knew she had to do something to save her one true love from disappearing. She was a god, God damn it! So she brought Auron back to life so they could boff happily ever after. Everyone else stayed with their respective partners, too, with lots of sappy weddings and stuff. Except that Flohn got brutally raped (don't worry, he was okay) and Flusi ended up with six kids. Flason was going to sacrifice himself for the sake of the world, but then realized that he was a god and was immortal. Whoops.
Right after Tidus disappeared, everyone kind of stood around for a moment, before Rikku asked, "Um, you brought Auron back to life, right? You could bring Tidus back, too, couldn't you?"
"Yes," Flusi replied. "We could."
And they never spoke of it again.
In conclusion -- do I think Mary Sue stories are evil and horrible and should be destroyed forever? Not if kept private. Even if the stories are well-written with an awesome plot (hey, it could happen.....maybe......and I suppose Squall could be straight, too), I always feel rather embarrassed for the authors for sharing their private fantasies with others. That doesn't stop me from mocking them, though. God bless the internet.
Unfortunately for all of us, Mrs. Rubbo has cut to the heart of the matter. Most Mary Sues are execrable pieces of writing, where the writer lives out their greatest fantasy of being gorgeous, perfect, strong, and totally hot. (Not to mention boffing the character of their dreams.) Got more than one love interest? Hey, it's okay! It's your fanfic! Who cares that you may not have actually interacted with the opposite sex for ten years, right? All that matters is that for this piece of fiction YOU are the man, and you can get anyone/do anyone/be anything you want. Just don't forget that the minute you show it to someone who doesn't have a reason to be kind to you you're most likely going to be the object of derision and scorn. Never say we didn't warn you.
And I do believe that that is the worst (but funny as hell) FFX Mary Sue I've ever read - at least until TurtleNinja writes one. *shudder*
Yay, someone found my pun! Now I can pretend I'm clever because one person (two, counting AG) saw it. Go me!
I have to say, that fanfic ranks up their in comedic value with this one, but yours involves letting Tidus die, which makes it the best fanfic ever. I haven't delved too deeply into the sordid world of FFX self-insertion (*snicker*) fics, but it seems that the few I've read rewrite the ending so Mary Sue the Bestest Summoner in the Whole of Spira saves Tidus with her magical tears/sacrifices herself to save Tidus/resurrects the old Zanarkand (probably with her magical tears or the Power of Love?) and then shoves Yuna out of the way for some hot (???) Tidus-boffing. It pained me to write those last few words, let me tell you. As for TurtleNinja...I admit I'm impressed with her. She actually manages to juggle TWO Mary Sue characters in a single fanfic. Stunning.
This week's mailbag has made us never want to read a fanfic again. Ever. So in a sense, it was a very cleansing experience. Thanks to all who wrote in!
We're a bit backed up on off-topic letters at the moment, and we're temporarily at a loss for an interesting topic, so next week is a VGR Mailbag free-for-all! Short of pornography or viruses, send us whatever the hell you feel like. Missed your chance to respond to an earlier topic? Feel like showering us with love letters/flames? We don't care, as long as we get it by Tuesday, September 24.
Tegami o kaite kudasai! Baka baka baka!
- AG and Lita-chan
Recaps :: FAQs :: Extras :: Mailbag :: Forum :: Contact :: Links


text:
Uranoscopus – rodzaj ryb z rodziny skaberowatych.

Klasyfikacja
Gatunki zaliczane do tego rodzaju :

Przypisy

Skaberowate

redpajama_set_name: RedPajamaWikipedia


At St Austell Conference Centre, we really care about your conference or event and our team will go above and beyond to ensure everything goes to plan – and with the latest AV technology you can be confident that side of your presentation is in safe hands.
If you're due to give a presentation, we know it can sometimes be daunting. That's why we've put together a few useful tips to help you out.
Plan what you're going to say – but don't script!
The real power in a presentation is the opportunity to connect with your audience – It's a personal interaction, so make sure it feels that way.
There's nothing worse than watching someone with their nose stuck in a piece of paper, or staring at a screen. So write yourself some bulletpoints to stay on track.
Run through your presentation as many times as possible. Look at your bulletpoints and don't be afraid to annotate notes as they come to mind. If there's a lot of annotation then re-type your bulletpoints so that everything is in one easy-to-read format.
Put your bulletpoints onto cue-cards, and make sure the text is nice and big. Use bold to emphasise various elements. Not only with this help with flow, but also means that you're not just looking at a whole bunch of text.
The slides are for summary – they're not a script!
Remember, that YOU are the main focus of the presentation – not the slides on the screen. The screen is there to compliment what you're saying – so make sure you're not just repeating the words written on the screen verbatim.
However, that being said – if there's a particular phrase or fact you really want to stick in people's minds then feel free to reinforce it by verbally repeating what's on-screen.
Standing up in front of a room full of people is daunting. No matter how confident you are or how many times you've presented there's always going to be an element of doubt in the back of your mind.
Why not identify someone in the audience that you can "talk to" during the presentation. This doesn't involve them talking back, it's just someone friendly that you can "talk at" every now and then to help reset yourself.
Make sure you pre-warn them though, or you could end up making someone feel very uncomfortable!
As long as you're not staring at them the whole time, no-one else will even notice. Even better, why not try and recruit a couple of "friends" sat opposite sides of the room? That way it appears you're "working the room".
It's natural for humans to feel that they have to fill every moment with noise. Especially if you're nervous and all the focus is on you.
Why not build some short pauses into your presentation. Not only does this help with the flow of your story, but also gives people the opportunity to digest the information. Here's a tip – got a particular point you want to put emphasis on? Use silence straight after for effect.
How many times have you watched a presentation which has felt like it's just fizzled out because the presenter hasn't really thought through how to end.
A quick summary, a good strong ending. Confidently thank people for listening and remember to smile. This is your last hurrah in the limelight, so make sure you leave people with a positive opinion of you.
But most of all – enjoy it!
Be friendly and enthusiastic and make sure you enjoy it!


text:
Q: Using pyspark binary on AWS lambda function, Error Java gateway process exited before sending the driver its port number I'm having issues with my lambda function (python 3.6), the lambda function uses pyspark (spark-2.3.0-bin-hadoop2.7 binaries).
As the pyspark binaries are quite big (226 MB zip file), I uploaded the zip file into a S3 bucket. The lambda function will unzips the file into the /tmp folder. After pyspark has been unzipped, permissions are given to the folders and files:
for root, dirs, filenames in os.walk(/tmp/spark):
    for d in dirs:
        os.chmod(os.path.join(root, d), 0o775)
    for f in filenames:
        os.chmod(os.path.join(root, f), 0o775)

On the lambda function the SPARK_HOME environment variable has been set with the value /tmp/spark
Also:
sys.path.append('/tmp/spark/python')
sys.path.append('/tmp/spark/python/lib/py4j-0.10.6-src.zip')

from pyspark import SparkContext
from pyspark import SparkConf
from pyspark.sql import SQLContext
from pyspark.sql import SparkSession
from pyspark.sql.types import *

...
...
sc = SparkContext(appName="ProjectCSV")
sqlContext = SQLContext(sc)
...
...

As soon as the SparkContext(appName="ProjectCSV") executes it reports the following error:
Java gateway process exited before sending the driver its port number

The PYSPARK_SUBMIT_ARGS environment variable has been added as follow:
os.environ['PYSPARK_SUBMIT_ARGS'] = "--master local[2] pyspark-shell"

Still reporting the same error.
Any ideas or suggestions, what could be the issue and how could I solve this issue?

A: Try checking JAVA_HOME is set in the environment. If not java might not have been installed.