text:
package com.example.sdk;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

/**
 * The class to handle various API exceptions and
 * to deal with returning appropriate error responses.
 *
 * @author Feng Zheng
 * @version 1.0
 * @since 1.0
 */
public class ApiException extends Exception implements ApiResponse {

  /**
   * Instantiates a new API exception by default.
   */
  public ApiException() {
    super();
  }

  /**
   * Instantiates a new API exception with the object of {@link Throwable}.
   *
   * @param e the object of {@link Throwable}
   */
  public ApiException(Throwable e) {
    super(e);
  }

  /**
   * Instantiates a new API exception with the error message.
   *
   * @param message the error message
   */
  public ApiException(String message) {
    super(message);
  }

  /**
   * Instantiates a new API exception with both the object of
   * {@link Throwable} and the error message.
   *
   * @param message the error message
   * @param e       the object of {@link Throwable}
   */
  public ApiException(String message, Throwable e) {
    super(message, e);
  }

  @Override
  public ApiNode head() {
    return null;
  }

  @Override
  public String getRawResponse() {
    return this.getMessage();
  }

  @Override
  public JsonObject getRawResponseAsJsonObject() {
    JsonParser parser = new JsonParser();
    try {
      return parser.parse(this.getMessage()).getAsJsonObject();
    } catch (Exception e) {
      return null;
    }
  }

  /**
   * Gets the API exception.
   *
   * @return the object of the API exception
   */
  public ApiException getException() {
    return this;
  }

  /**
   * The class to handle malformed response exception.
   */
  public static class MalformedResponseException extends ApiException {
    /**
     * Instantiates a new malformed response exception by default.
     */
    public MalformedResponseException() {
      super();
    }

    /**
     * Instantiates a new malformed response exception with the object of {@link Throwable}.
     *
     * @param e the object of {@link Throwable}
     */
    public MalformedResponseException(Throwable e) {
      super(e);
    }

    /**
     * Instantiates a new malformed response exception with the error message.
     *
     * @param message the error message
     */
    public MalformedResponseException(String message) {
      super(message);
    }

    /**
     * Instantiates a new malformed response exception with
     * both the object of {@link Throwable} and the error message.
     *
     * @param message the error message
     * @param e       the object of {@link Throwable}
     */
    public MalformedResponseException(String message, Throwable e) {
      super(message, e);
    }
  }

  /**
   * The class to handle failed request exception.
   */
  public static class FailedRequestException extends ApiException {
    /**
     * Instantiates a new failed request exception by default.
     */
    public FailedRequestException() {
      super();
    }

    /**
     * Instantiates a new failed request exception with the object of {@link Throwable}.
     *
     * @param e the object of {@link Throwable}
     */
    public FailedRequestException(Throwable e) {
      super(e);
    }

    /**
     * Instantiates a new failed request exception with the error message.
     *
     * @param message the error message
     */
    public FailedRequestException(String message) {
      super(message);
    }

    /**
     * Instantiates a new failed request exception with
     * both the object of {@link Throwable} and the error message.
     *
     * @param message the error message
     * @param e       the object of {@link Throwable}
     */
    public FailedRequestException(String message, Throwable e) {
      super(message, e);
    }
  }

  /**
   * The class to handle failed to access token exception.
   */
  public static class FailedAccessTokenException extends ApiException {
    /**
     * Instantiates a new failed to access token exception by default.
     */
    public FailedAccessTokenException() {
      super();
    }

    /**
     * Instantiates a new failed to access token exception with the object of {@link Throwable}.
     *
     * @param e the object of {@link Throwable}
     */
    public FailedAccessTokenException(Throwable e) {
      super(e);
    }

    /**
     * Instantiates a new failed to access token exception with the error message.
     *
     * @param message the error message
     */
    public FailedAccessTokenException(String message) {
      super(message);
    }

    /**
     * Instantiates a new failed to access token exception
     * with both the object of {@link Throwable} and the error message.
     *
     * @param message the error message
     * @param e       the object of {@link Throwable}
     */
    public FailedAccessTokenException(String message, Throwable e) {
      super(message, e);
    }
  }

  /**
   * The class to handle not implemented exception.
   */
  public static class NotImplementedException extends ApiException {
    /**
     * Instantiates a new not implemented exception by default.
     */
    public NotImplementedException() {
      super();
    }

    /**
     * Instantiates a new not implemented exception with the object of {@link Throwable}.
     *
     * @param e the object of {@link Throwable}
     */
    public NotImplementedException(Throwable e) {
      super(e);
    }

    /**
     * Instantiates a new not implemented exception with the error message.
     *
     * @param message the error message
     */
    public NotImplementedException(String message) {
      super(message);
    }

    /**
     * Instantiates a new not implemented exception with
     * both the object of {@link Throwable} and the error message.
     *
     * @param message the error message
     * @param e       the object of {@link Throwable}
     */
    public NotImplementedException(String message, Throwable e) {
      super(message, e);
    }
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ServantLocatorOperations (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<meta name="keywords" content="org.omg.PortableServer.ServantLocatorOperations interface">
<meta name="keywords" content="preinvoke()">
<meta name="keywords" content="postinvoke()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.omg.PortableServer

Interface ServantLocatorOperations

All Superinterfaces:

ServantManagerOperations

All Known Subinterfaces:

ServantLocator

All Known Implementing Classes:

_ServantLocatorStub, ServantLocatorPOA

public interface ServantLocatorOperations
extends ServantManagerOperations

When the POA has the NON_RETAIN policy it uses servant
 managers that are ServantLocators. Because the POA
 knows that the servant returned by this servant
 manager will be used only for a single request,
 it can supply extra information to the servant
 manager's operations and the servant manager's pair
 of operations may be able to cooperate to do
 something different than a ServantActivator.
 When the POA uses the ServantLocator interface,
 immediately after performing the operation invocation
 on the servant returned by preinvoke, the POA will
 invoke postinvoke on the servant manager, passing the
 ObjectId value and the Servant value as parameters
 (among others). This feature may be used to force
 every request for objects associated with a POA to
 be mediated by the servant manager.

Method Summary

Methods

Modifier and Type
Method and Description

void
postinvoke(byte[] oid,
          POA adapter,
          String operation,
          Object the_cookie,
          Servant the_servant)

This operation is invoked whenener a servant completes
 a request.

Servant
preinvoke(byte[] oid,
         POA adapter,
         String operation,
         CookieHolder the_cookie)

This operations is used to get a servant that will be
 used to process the request that caused preinvoke to
 be called.

Method Detail

preinvoke

Servant preinvoke(byte[] oid,
                POA adapter,
                String operation,
                CookieHolder the_cookie)
                  throws ForwardRequest

This operations is used to get a servant that will be
 used to process the request that caused preinvoke to
 be called.

Parameters:

oid - the object id associated with object on
            which the request was made.

adapter - the reference for POA in which the
                object is being activated.

operation - the operation name.

the_cookie - an opaque value that can be set
                    by the servant manager to be used
                    during postinvoke.

Returns:

Servant used to process incoming request.

Throws:

ForwardRequest - to indicate to the ORB
            that it is responsible for delivering
            the current request and subsequent
            requests to the object denoted in the
            forward_reference member of the exception.

postinvoke

void postinvoke(byte[] oid,
              POA adapter,
              String operation,
              Object the_cookie,
              Servant the_servant)

This operation is invoked whenener a servant completes
 a request.

Parameters:

oid - the object id ssociated with object on which
            the request was made.

adapter - the reference for POA in which the
                object was active.

the_cookie - an opaque value that contains
                    the data set by preinvoke.

the_servant - reference to the servant that is
                    associated with the object.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.

redpajama_set_name: RedPajamaGithub


text:
import json

from serverdensity import Response
from serverdensity.wrapper.crud import CRUD
from serverdensity.wrapper.jsonobject import JsonObject

class Alert(JsonObject, CRUD):

    _schemapath = '/schema/alerts.json'

    PATHS = {
        'create': '/alerts/configs',
        'delete': '/alerts/configs/{}',
        'list': '/alerts/configs',
        'list_by_subject': '/alerts/configs/{}',
        'update': '/alerts/configs/{}',
        'view': '/alerts/configs/{}',
        'triggered': '/alerts/triggered',
        'device_metrics': '/alerts/device_alerts.json',
        'service_metrics': '/alerts/service_alerts.json'
    }

    def triggered(self, _id=None, subject_type=None, closed=None, **kwargs):
        kwargs.setdefault('params', {})
        kwargs['params'].setdefault('filter', {})
        if _id and subject_type:
            filter = {
                'config.subjectType': subject_type,
                'config.subjectId': _id
            }
            kwargs['params']['filter'] = filter

        if closed:
            kwargs['params'].setdefault('filter', {})['fixed'] = closed
        kwargs['params']['filter'] = json.dumps(kwargs['params']['filter'], sort_keys=True)
        result = self.api.get(url=self.PATHS['triggered'], **kwargs)
        return [Response(item) for item in result]

    def device_metrics(self, **kwargs):
        return Response(self.api.get(url=self.PATHS['device_metrics'], **kwargs))

    def service_metrics(self, **kwargs):
        return Response(self.api.get(url=self.PATHS['service_metrics'], **kwargs))


text:
package com.litesuits.http.parser.impl;

import com.litesuits.http.data.Json;
import com.litesuits.http.parser.MemCacheableParser;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;

/**
 * parse inputstream to java model.
 *
 * @author MaTianyu
 *         2014-4-19
 */
public class JsonParser<T> extends MemCacheableParser<T> {
    protected Type claxx;
    protected String json;

    public JsonParser(Type claxx) {
        this.claxx = claxx;
    }

    @Override
    protected T parseNetStream(InputStream stream, long totalLength
            , String charSet) throws IOException {
        json = streamToString(stream, totalLength, charSet);
        return Json.get().toObject(json, claxx);
    }

    @Override
    protected T parseDiskCache(InputStream stream, long length) throws IOException {
        json = streamToString(stream, length, charSet);
        return Json.get().toObject(json, claxx);
    }

    @Override
    protected boolean tryKeepToCache(T data) throws IOException {
        return keepToCache(json);
    }

    /**
     * get the row string
     */
    @Override
    public String getRawString() {
        return json;
    }

    /**
     * get the json model
     */
    public <C> C getJsonModel(Class<C> claxx) {
        return Json.get().toObject(json, claxx);
    }

    @Override
    public String toString() {
        return "JsonParser{" +
               "claxx=" + claxx +
               "} " + super.toString();
    }
}


text:
class EventsChangeDataToText < ActiveRecord::Migration
  def change
    change_column :events, :data, :text
  end
end


text:
"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
 * List of error messages
 */
/**
 * Type Errors
 */
exports.StringTypeError = 'Incorrect type. Expected "string".';
exports.NumberTypeError = 'Incorrect type. Expected "number".';
exports.BooleanTypeError = 'Incorrect type. Expected "boolean".';
exports.ArrayTypeError = 'Incorrect type. Expected "array".';
exports.ObjectTypeError = 'Incorrect type. Expected "object".';
/**
 * Parse errors
 */
exports.BlockMappingEntryError = 'can not read a block mapping entry; a multiline key may not be an implicit key';
exports.ColonMissingError = 'can not read an implicit mapping pair; a colon is missed';
/**
 * Value Errors
 */
exports.IncludeWithoutValueError = '!include without value';
/**
 * Duplicate Key error
 */
exports.DuplicateKeyError = 'duplicate key';
//# sourceMappingURL=errorMessages.js.map


text:
SpriteManager* SpriteManager::s_Instance = 0;

SpriteManager::SpriteManager(void)
{

}

SpriteManager* SpriteManager::getInstance()
{
	if(s_Instance == 0)
	{
		s_Instance = new SpriteManager();
	}
	return s_Instance;
}

void SpriteManager::LoadSpriteContent(LPDIRECT3DDEVICE9 _lpDirectDevice, const char* fileName, eSpriteID eID, int Column, int Row, int TotalFrame)
{
	CSpriteDx9* sprite = new CSpriteDx9();
	sprite->LoadContent(_lpDirectDevice, fileName, Column, Row, TotalFrame);
	m_ListSprite[eID] = sprite;
}

CSpriteDx9* SpriteManager::getSprite(eSpriteID eID)
{
	map<eSpriteID, CSpriteDx9*>::iterator i;

	i = m_ListSprite.find(eID);

	if(i == m_ListSprite.end())
		return 0;

	return i->second;
}

void SpriteManager::InitializeListSprite(LPDIRECT3DDEVICE9 _lpDirectDevice)
{

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_idle.png", eSpriteID::SPRITE_RAMBO_IDLE, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_lie.png", eSpriteID::SPRITE_RAMBO_LIE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_run.png", eSpriteID::SPRITE_RAMBO_RUN, 6, 1, 6);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_shoot_bottom_right.png", eSpriteID::SPRITE_RAMBO_SHOOT_BOTTOM_RIGHT, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_shoot_run.png", eSpriteID::SPRITE_RAMBO_SHOOT_RUN, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_shoot_top_right.png", eSpriteID::SPRITE_RAMBO_SHOOT_TOP_RIGHT, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\rambo_shoot_up.png", eSpriteID::SPRITE_RAMBO_SHOOT_UP, 2, 1, 2);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\bullet.png", eSpriteID::SPRITE_BULLET_BIG, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\FBullet.png", eSpriteID::SPRITE_F_BULLET, 4, 1, 4);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\default_bullet_rambo.png", eSpriteID::SPRITE_DEFAULT_BULLET_RAMBO, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\fire.png", eSpriteID::SPRITE_FIRE_BULLET_RAMBO, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Landscape\\ledframe.png", eSpriteID::SPRITE_LED_OBJECT, 2, 1, 2);
	INCLUDE_MAP1;
	INCLUDE_MAP2;
	INCLUDE_MAP3;
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\MenuGame\\bg.png", eSpriteID::SPRITE_MENUBG, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\MenuGame\\icon.png", eSpriteID::SPRITE_ICON, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\MenuGame\\WinScene.png", eSpriteID::SPRITE_WINSCENE, 1, 1, 1);

	LoadSpriteContent(_lpDirectDevice, "resources\\grid.png", eSpriteID::SPRITE_GRID, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Rambo\\lazer.png", eSpriteID::SPRITE_LAZE_BULLET_RAMBO, 1, 2, 4);
	// start the fucking bridge

	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\BodyBridge.png", eSpriteID::SPRITE_BRIDGE_BODY, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\HeadBridge.png", eSpriteID::SPRITE_BRIDGE_HEAD, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\TailBridge.png", eSpriteID::SPRITE_BRIDGE_TAIL, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\head_bridge_broken.png", eSpriteID::SPRITE_HEAD_BREAK, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\tail_bridge_broken.png", eSpriteID::SPRITE_TAIL_BREAK, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\BridgeExploision.png", eSpriteID::SPRITE_BRIDGE_EXPLOISION, 5, 3, 15);
	// end load the fucking bridge

	// Start load EnemyContent
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Exploision.png", eSpriteID::SPRITE_EXPLOISION, 6, 1, 6);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\Sniper\\SniperStanding\\SniperStanding_bot.png", eSpriteID::SPRITE_SNIPER_STANDING_BOT, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\Sniper\\SniperStanding\\SniperStanding_top.png", eSpriteID::SPRITE_SNIPER_STANDING_TOP, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\Sniper\\SniperStanding\\SniperStanding_mid.png", eSpriteID::SPRITE_SNIPER_STANDING_MID, 2, 1, 2);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\SniperHiding\\SniperHiding.png", eSpriteID::SPRITE_SNIPER_HIDING, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\SniperHiding\\SniperHidingDead.png", eSpriteID::SPRITE_SNIPER_HIDING_EXPLOISION, 4, 1, 4);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\SnipperWaterHiding\\SnipperWaterHiding.png", eSpriteID::SPRITE_SNIPER_WATER_HIDING, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\SniperShooting\\SniperShooting.png", eSpriteID::SPRITE_SNIPER_SHOOTING, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\EnemyRun\\EnemyRun.png", eSpriteID::SPRITE_ENEMY_RUN, 6, 1, 6);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\EnemyRunShooting\\EnemyRunShooting.png", eSpriteID::SPRITE_ENEMY_RUN_SHOOTING, 6, 1, 6);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Enemy\\EnemyBigGunShooting\\EnemyBigGunShooting.png", eSpriteID::SPRITE_ENEMY_WITH_BIG_GUN, 2, 1, 2);

	// Weapon
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\WeaponSensor.png", eSpriteID::SPRITE_WEAPON_SENSOR, 7, 1, 7);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\WeaponCapsule.png", eSpriteID::SPRITE_WEAPON_CAPSULE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\Barrier.png", eSpriteID::SPRITE_BARRIER, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\RapidFire.png", eSpriteID::SPRITE_RAPID_FIRE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\SpreadGun.png", eSpriteID::SPRITE_SPREAD_GUN, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\LaserGun.png", eSpriteID::SPRITE_LASER_GUN, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\MachineGun.png", eSpriteID::SPRITE_MACHINE_GUN, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Weapon\\Weaponry\\FlameGun.png", eSpriteID::SPRITE_FLAME_GUN, 1, 1, 1);
	// End Weapon

	// Gunrotating
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Gun\\GunRotating.png", eSpriteID::SPRITE_GUN_ROTATING, 14, 1, 14);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Gun\\bigGunRotating.png", eSpriteID::SPRITE_BIG_GUN_ROATING, 3, 3, 9);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Gun\\bigGunRotatingPopup.png", eSpriteID::SPRITE_BIG_GUN_ROTAING_POPUP, 3, 2, 6);
	// End Gunrotating

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\Move\\move.png", eSpriteID::SPRITE_RAMBO_MOVE_BODY, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Leg\\Move\\move.png", eSpriteID::SPRITE_RAMBO_MOVE_LEG, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\MoveUp\\top_right.png", eSpriteID::SPRITE_RAMBO_SHOOT_TOP_RIGHT_BODY, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\MoveDown\\bottom_right.png", eSpriteID::SPRITE_RAMBO_SHOOT_BOTTOM_RIGHT_BODY, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\shoot.png", eSpriteID::SPRITE_RAMBO_SHOOT_BODY, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\up.png", eSpriteID::SPRITE_RAMBO_SHOOT_UP_BODY, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\jump.png", eSpriteID::SPRITE_RAMBO_JUMP, 4, 1, 4);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\water_bomb.png", eSpriteID::SPRITE_RAMBO_WATER_BOMB, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\climb.png", eSpriteID::SPRITE_RAMBO_CLIMB, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\dive.png", eSpriteID::SPRITE_RAMBO_DIVE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\swim.png", eSpriteID::SPRITE_RAMBO_SWIM, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\RamboSplit\\Body\\dead.png", eSpriteID::SPRITE_RAMBO_BEFORE_DEAD, 5, 1, 5);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\GunBoss\\BossGun.png", eSpriteID::SPRITE_GUN_BOSS, 2, 1, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossCenter\\BossCenter.png", eSpriteID::SPRITE_BOSS_CENTER, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossBodyDead.png", eSpriteID::SPRITE_BOSS_BODY_DEAD, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossBodyAlive.png", eSpriteID::SPRITE_BOSS_BODY_ALIVE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossDie1.png", eSpriteID::SPRITE_BOSS_DIE, 4, 2, 8);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossExploision.png", eSpriteID::SPRITE_BOSS_EXPLOISION, 8, 5, 40);

	// Boss Map 2
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossBody.png", eSpriteID::SPRITE_BOSS_MAP2_BODY_ALIVE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossDie.png", eSpriteID::SPRITE_BOSS_MAP2_DEATH, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossHead.png", eSpriteID::SPRITE_BOSS_HEAD, 3, 3, 9);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossBullet.png", eSpriteID::SPRITE_BULLET_BOSS, 4, 1, 4);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossPunch.png", eSpriteID::SPRITE_PUNCH_BOSS, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap2\\BossArm.png", eSpriteID::SPRITE_ARM_BOSS, 1, 1, 1);
	// End Boss Map 2

	//BOSS MAP 3
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap3\\CapsuleBoss.png", eSpriteID::SPRITE_CAPSULE_BOSS, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boss\\BossMap3\\BigCapsuleBoss.png", eSpriteID::SPRITE_BIG_CAPSULE_BOSS, 12, 1, 12);
	//END BOSSMAP3

	LoadSpriteContent(_lpDirectDevice, "resources\\Items\\medal.png", eSpriteID::SPRITE_MEDAL, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\1\\1.effect", eSpriteID::SPRITE_EFFECT_MAP1, 1, 2, 2);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\2\\2.effect", eSpriteID::SPRITE_EFFECT_MAP2, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\3\\3.effect", eSpriteID::SPRITE_EFFECT_MAP3, 1, 2, 2);

	//Stone
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Stone\\BridgeStone\\BridgeStone.png", eSpriteID::SPRITE_BRIGDE_STONE, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Stone\\BigStone\\BigStone.png", eSpriteID::SPRITE_BIG_STONE, 4, 1, 4);
	//EndBigStone

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Fire\\fire.png", eSpriteID::SPRITE_FIRE, 2, 1, 2);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Tank\\Tank.png", eSpriteID::SPRITE_TANK, 2, 12, 24);

	LoadSpriteContent(_lpDirectDevice, "resources\\bridge\\Bridge2\\Bridge2.png", eSpriteID::SPRITE_FIRE_BRIDGE, 1, 1, 1);

	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boom\\Boom.png", eSpriteID::SPRITE_BOOM, 1, 1, 1);
	LoadSpriteContent(_lpDirectDevice, "resources\\Character\\Boom\\BoomExploision.png", eSpriteID::SPRITE_BOOM_EXPLOISION, 3, 1, 3);
	LoadSpriteContent(_lpDirectDevice, "resources\\Map\\MenuGame\\black.png", eSpriteID::SPRITE_BLACK_BACKGROUND, 1, 1, 1);
}

void SpriteManager::Release()
{
	map<eSpriteID, CSpriteDx9*>::iterator i;
	for(i = m_ListSprite.begin(); i != m_ListSprite.end(); i++)
	{
		i->second->Release();
		SAFE_DELETE(i->second);
	}
	m_ListSprite.clear();
}

SpriteManager::~SpriteManager(void)
{
}


text:
rm -rf docs/
vendor/bin/apidoc api commands,controllers,assets,models,views docs/api --pageTitle="We 'r' Gamers API" --guide=.. --guidePrefix= --interactive=0
vendor/bin/apidoc guide guia docs --pageTitle="Guía de We 'r' Gamers" --guidePrefix= --apiDocs=./api --interactive=0
ln -sf README.html docs/index.html
touch docs/.nojekyll


text:
package items;

import character.PC;
import statListeners.*;

public class CascoDeNova extends ItemCabeza implements SpeedListener, DanoMagicoListener
{

	public CascoDeNova()
	{
		nombre="Caso de Nova";
		descripcion="Casco que otorga el poder de los Nova Corps"
				+ "\n\n+15 Daño Magico\n+10 Velocidad";
	}

	@Override
	public int getDanoMagicoBonus() {
		return 15;
	}

	@Override
	public int getSpeedBonus() {
		return 10;
	}

	@Override
	public void equipar(PC pj)
	{
		pj.speedSubscribe(this);
		pj.danoMagicoSubscribe(this);
	}

	@Override
	public void desequipar(PC pj) {
		pj.speedUnsubscribe(this);
		pj.danoMagicoUnsubscribe(this);
	}

}


text:
// This code is in the public domain -- Ignacio Castaño <castano@gmail.com>

#include "Debug.h"
#include "StrLib.h" // StringBuilder
#include <cstdlib>

// Extern
#if NV_OS_WIN32 //&& NV_CC_MSVC
#   define WIN32_LEAN_AND_MEAN
#   define VC_EXTRALEAN
#   include <windows.h>
#   include <direct.h>
#   if NV_CC_MSVC
#       include <crtdbg.h>
#       if _MSC_VER < 1300
#           define DECLSPEC_DEPRECATED
// VC6: change this path to your Platform SDK headers
#           include <dbghelp.h> // must be XP version of file
//          include "M:\\dev7\\vs\\devtools\\common\\win32sdk\\include\\dbghelp.h"
#       else
// VC7: ships with updated headers
#           include <dbghelp.h>
#       endif
#   endif
#   pragma comment(lib,"dbghelp.lib")
#endif

#if NV_OS_XBOX
#    include <Xtl.h>
#    ifdef _DEBUG
#        include <xbdm.h>
#    endif //_DEBUG
#endif //NV_OS_XBOX

#if !NV_OS_WIN32 && defined(HAVE_SIGNAL_H)
#   include <signal.h>
#endif

#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD
#   include <unistd.h> // getpid
#endif

#if NV_OS_LINUX && defined(HAVE_EXECINFO_H)
#   include <execinfo.h> // backtrace
#   if NV_CC_GNUC // defined(HAVE_CXXABI_H)
#       include <cxxabi.h>
#   endif
#endif

#if NV_OS_DARWIN || NV_OS_FREEBSD
#   include <sys/types.h>
#   include <sys/sysctl.h> // sysctl
#   include <sys/ucontext.h>
#   if defined(HAVE_EXECINFO_H) // only after OSX 10.5
#       include <execinfo.h> // backtrace
#       if NV_CC_GNUC // defined(HAVE_CXXABI_H)
#           include <cxxabi.h>
#       endif
#   endif
#endif

using namespace nv;

namespace
{

    static MessageHandler * s_message_handler = NULL;
    static AssertHandler * s_assert_handler = NULL;

    static bool s_sig_handler_enabled = false;

#if NV_OS_WIN32 && NV_CC_MSVC

    // Old exception filter.
    static LPTOP_LEVEL_EXCEPTION_FILTER s_old_exception_filter = NULL;

#elif !NV_OS_WIN32 && defined(HAVE_SIGNAL_H)

    // Old signal handlers.
    struct sigaction s_old_sigsegv;
    struct sigaction s_old_sigtrap;
    struct sigaction s_old_sigfpe;
    struct sigaction s_old_sigbus;

#endif

#if NV_OS_WIN32 && NV_CC_MSVC

    static bool writeMiniDump(EXCEPTION_POINTERS * pExceptionInfo)
    {
        // create the file
        HANDLE hFile = CreateFileA("crash.dmp", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
        if (hFile == INVALID_HANDLE_VALUE) {
            nvDebug("*** Failed to create dump file.\n");
            return false;
        }

        MINIDUMP_EXCEPTION_INFORMATION ExInfo;
        ExInfo.ThreadId = ::GetCurrentThreadId();
        ExInfo.ExceptionPointers = pExceptionInfo;
        ExInfo.ClientPointers = NULL;

        // write the dump
        BOOL ok = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &ExInfo, NULL, NULL) != 0;
        CloseHandle(hFile);

        if (ok == FALSE) {
            nvDebug("*** Failed to save dump file.\n");
            return false;
        }

        nvDebug("\nDump file saved.\n");

        return true;
    }

    static bool hasStackTrace() {
        return true;
    }

    /*static NV_NOINLINE int backtrace(void * trace[], int maxcount) {

        // In Windows XP and Windows Server 2003, the sum of the FramesToSkip and FramesToCapture parameters must be less than 63.
        int xp_maxcount = min(63-1, maxcount);

        int count = RtlCaptureStackBackTrace(1, xp_maxcount, trace, NULL);
        nvDebugCheck(count <= maxcount);

        return count;
    }*/

    static NV_NOINLINE int backtraceWithSymbols(CONTEXT * ctx, void * trace[], int maxcount, int skip = 0) {

        // Init the stack frame for this function
        STACKFRAME64 stackFrame = { 0 };

    #if NV_CPU_X86_64
        DWORD dwMachineType = IMAGE_FILE_MACHINE_AMD64;
        stackFrame.AddrPC.Offset = ctx->Rip;
        stackFrame.AddrFrame.Offset = ctx->Rbp;
        stackFrame.AddrStack.Offset = ctx->Rsp;
    #elif NV_CPU_X86
        DWORD dwMachineType = IMAGE_FILE_MACHINE_I386;
        stackFrame.AddrPC.Offset = ctx->Eip;
        stackFrame.AddrFrame.Offset = ctx->Ebp;
        stackFrame.AddrStack.Offset = ctx->Esp;
    #else
        #error "Platform not supported!"
    #endif
        stackFrame.AddrPC.Mode = AddrModeFlat;
        stackFrame.AddrFrame.Mode = AddrModeFlat;
        stackFrame.AddrStack.Mode = AddrModeFlat;

        // Walk up the stack
        const HANDLE hThread = GetCurrentThread();
        const HANDLE hProcess = GetCurrentProcess();
        int i;
        for (i = 0; i < maxcount; i++)
        {
            // walking once first makes us skip self
            if (!StackWalk64(dwMachineType, hProcess, hThread, &stackFrame, ctx, NULL, &SymFunctionTableAccess64, &SymGetModuleBase64, NULL)) {
                break;
            }

            /*if (stackFrame.AddrPC.Offset == stackFrame.AddrReturn.Offset || stackFrame.AddrPC.Offset == 0) {
                break;
            }*/

            if (i >= skip) {
                trace[i - skip] = (PVOID)stackFrame.AddrPC.Offset;
            }
        }

        return i - skip;
    }

#pragma warning(push)
#pragma warning(disable:4748)
    static NV_NOINLINE int backtrace(void * trace[], int maxcount) {
        CONTEXT ctx = { 0 };
#if NV_CPU_X86 && !NV_CPU_X86_64
        ctx.ContextFlags = CONTEXT_CONTROL;
        _asm {
             call x
          x: pop eax
             mov ctx.Eip, eax
             mov ctx.Ebp, ebp
             mov ctx.Esp, esp
        }
#else
        RtlCaptureContext(&ctx); // Not implemented correctly in x86.
#endif

        return backtraceWithSymbols(&ctx, trace, maxcount, 1);
    }
#pragma warning(pop)

    static NV_NOINLINE void printStackTrace(void * trace[], int size, int start=0)
    {
        HANDLE hProcess = GetCurrentProcess();

        nvDebug( "\nDumping stacktrace:\n" );

	    // Resolve PC to function names
	    for (int i = start; i < size; i++)
	    {
		    // Check for end of stack walk
		    DWORD64 ip = (DWORD64)trace[i];
		    if (ip == NULL)
			    break;

		    // Get function name
		    #define MAX_STRING_LEN	(512)
		    unsigned char byBuffer[sizeof(IMAGEHLP_SYMBOL64) + MAX_STRING_LEN] = { 0 };
		    IMAGEHLP_SYMBOL64 * pSymbol = (IMAGEHLP_SYMBOL64*)byBuffer;
		    pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
		    pSymbol->MaxNameLength = MAX_STRING_LEN;

		    DWORD64 dwDisplacement;

		    if (SymGetSymFromAddr64(hProcess, ip, &dwDisplacement, pSymbol))
		    {
			    pSymbol->Name[MAX_STRING_LEN-1] = 0;

			    /*
			    // Make the symbol readable for humans
			    UnDecorateSymbolName( pSym->Name, lpszNonUnicodeUnDSymbol, BUFFERSIZE,
				    UNDNAME_COMPLETE |
				    UNDNAME_NO_THISTYPE |
				    UNDNAME_NO_SPECIAL_SYMS |
				    UNDNAME_NO_MEMBER_TYPE |
				    UNDNAME_NO_MS_KEYWORDS |
				    UNDNAME_NO_ACCESS_SPECIFIERS );
			    */

			    // pSymbol->Name
			    const char * pFunc = pSymbol->Name;

			    // Get file/line number
			    IMAGEHLP_LINE64 theLine = { 0 };
			    theLine.SizeOfStruct = sizeof(theLine);

			    DWORD dwDisplacement;
			    if (!SymGetLineFromAddr64(hProcess, ip, &dwDisplacement, &theLine))
			    {
				    nvDebug("unknown(%08X) : %s\n", (uint32)ip, pFunc);
			    }
			    else
			    {
				    /*
				    const char* pFile = strrchr(theLine.FileName, '\\');
				    if ( pFile == NULL ) pFile = theLine.FileName;
				    else pFile++;
				    */
				    const char * pFile = theLine.FileName;

				    int line = theLine.LineNumber;

				    nvDebug("%s(%d) : %s\n", pFile, line, pFunc);
			    }
		    }
	    }
    }

    // Write mini dump and print stack trace.
    static LONG WINAPI topLevelFilter(EXCEPTION_POINTERS * pExceptionInfo)
    {
        void * trace[64];

        int size = backtraceWithSymbols(pExceptionInfo->ContextRecord, trace, 64);
        printStackTrace(trace, size, 0);

        writeMiniDump(pExceptionInfo);

        return EXCEPTION_CONTINUE_SEARCH;
    }

#elif !NV_OS_WIN32 && defined(HAVE_SIGNAL_H) // NV_OS_LINUX || NV_OS_DARWIN

#if defined(HAVE_EXECINFO_H)

    static bool hasStackTrace() {
#if NV_OS_DARWIN
        return backtrace != NULL;
#else
        return true;
#endif
    }

    static void printStackTrace(void * trace[], int size, int start=0) {
        char ** string_array = backtrace_symbols(trace, size);

        nvDebug( "\nDumping stacktrace:\n" );
        for(int i = start; i < size-1; i++ ) {
#       if NV_CC_GNUC // defined(HAVE_CXXABI_H)
            // @@ Write a better parser for the possible formats.
            char * begin = strchr(string_array[i], '(');
            char * end = strrchr(string_array[i], '+');
            char * module = string_array[i];

            if (begin == 0 && end != 0) {
                *(end - 1) = '\0';
                begin = strrchr(string_array[i], ' ');
                module = NULL; // Ignore module.
            }

            if (begin != 0 && begin < end) {
                int stat;
                *end = '\0';
                *begin = '\0';
                char * name = abi::__cxa_demangle(begin+1, 0, 0, &stat);
                if (module == NULL) {
                    if (name == NULL || stat != 0) {
                        nvDebug( "  In: '%s'\n", begin+1 );
                    }
                    else {
                        nvDebug( "  In: '%s'\n", name );
                    }
                }
                else {
                    if (name == NULL || stat != 0) {
                        nvDebug( "  In: [%s] '%s'\n", module, begin+1 );
                    }
                    else {
                        nvDebug( "  In: [%s] '%s'\n", module, name );
                    }
                }
                free(name);
            }
            else {
                nvDebug( "  In: '%s'\n", string_array[i] );
            }
#       else
            nvDebug( "  In: '%s'\n", string_array[i] );
#       endif
        }
        nvDebug("\n");

        free(string_array);
    }

#endif // defined(HAVE_EXECINFO_H)

    static void * callerAddress(void * secret)
    {
#if NV_OS_DARWIN
#  if defined(_STRUCT_MCONTEXT)
#    if NV_CPU_PPC
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->__ss.__srr0;
#    elif NV_CPU_X86_64
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->__ss.__rip;
#    elif NV_CPU_X86
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->__ss.__eip;
#    elif NV_CPU_ARM
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->__ss.__pc;
#    else
#      error "Unknown CPU"
#    endif
#  else
#    if NV_CPU_PPC
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->ss.srr0;
#    elif NV_CPU_X86
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext->ss.eip;
#    else
#      error "Unknown CPU"
#    endif
#  endif
#elif NV_OS_FREEBSD
#  if NV_CPU_X86_64
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *)ucp->uc_mcontext.mc_rip;
#  elif NV_CPU_X86
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *)ucp->uc_mcontext.mc_eip;
#    else
#      error "Unknown CPU"
#    endif
#else
#  if NV_CPU_X86_64
        // #define REG_RIP REG_INDEX(rip) // seems to be 16
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *)ucp->uc_mcontext.gregs[REG_RIP];
#  elif NV_CPU_X86
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *)ucp->uc_mcontext.gregs[14/*REG_EIP*/];
#  elif NV_CPU_PPC
        ucontext_t * ucp = (ucontext_t *)secret;
        return (void *) ucp->uc_mcontext.regs->nip;
#    else
#      error "Unknown CPU"
#    endif
#endif

        // How to obtain the instruction pointers in different platforms, from mlton's source code.
        // http://mlton.org/
        // OpenBSD && NetBSD
        // ucp->sc_eip
        // FreeBSD:
        // ucp->uc_mcontext.mc_eip
        // HPUX:
        // ucp->uc_link
        // Solaris:
        // ucp->uc_mcontext.gregs[REG_PC]
        // Linux hppa:
        // uc->uc_mcontext.sc_iaoq[0] & ~0x3UL
        // Linux sparc:
        // ((struct sigcontext*) secret)->sigc_regs.tpc
        // Linux sparc64:
        // ((struct sigcontext*) secret)->si_regs.pc

        // potentially correct for other archs:
        // Linux alpha: ucp->m_context.sc_pc
        // Linux arm: ucp->m_context.ctx.arm_pc
        // Linux ia64: ucp->m_context.sc_ip & ~0x3UL
        // Linux mips: ucp->m_context.sc_pc
        // Linux s390: ucp->m_context.sregs->regs.psw.addr
    }

    static void nvSigHandler(int sig, siginfo_t *info, void *secret)
    {
        void * pnt = callerAddress(secret);

        // Do something useful with siginfo_t
        if (sig == SIGSEGV) {
            if (pnt != NULL) nvDebug("Got signal %d, faulty address is %p, from %p\n", sig, info->si_addr, pnt);
            else nvDebug("Got signal %d, faulty address is %p\n", sig, info->si_addr);
        }
        else if(sig == SIGTRAP) {
            nvDebug("Breakpoint hit.\n");
        }
        else {
            nvDebug("Got signal %d\n", sig);
        }

#if defined(HAVE_EXECINFO_H)
        if (hasStackTrace()) // in case of weak linking
        {
            void * trace[64];
            int size = backtrace(trace, 64);

            if (pnt != NULL) {
                // Overwrite sigaction with caller's address.
                trace[1] = pnt;
            }

            printStackTrace(trace, size, 1);
        }
#endif // defined(HAVE_EXECINFO_H)

        exit(0);
    }

#endif // defined(HAVE_SIGNAL_H)

#if NV_OS_WIN32 //&& NV_CC_MSVC

    /** Win32 assert handler. */
    struct Win32AssertHandler : public AssertHandler
    {
        // Flush the message queue. This is necessary for the message box to show up.
        static void flushMessageQueue()
        {
            MSG msg;
            while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) {
                //if( msg.message == WM_QUIT ) break;
                TranslateMessage( &msg );
                DispatchMessage( &msg );
            }
        }

        // Assert handler method.
        virtual int assertion( const char * exp, const char * file, int line, const char * func/*=NULL*/ )
        {
            int ret = NV_ABORT_EXIT;

            StringBuilder error_string;
            if( func != NULL ) {
                error_string.format( "*** Assertion failed: %s\n    On file: %s\n    On function: %s\n    On line: %d\n ", exp, file, func, line );
            }
            else {
                error_string.format( "*** Assertion failed: %s\n    On file: %s\n    On line: %d\n ", exp, file, line );
            }
            nvDebug( error_string.str() );

            if (debug::isDebuggerPresent()) {
                return NV_ABORT_DEBUG;
            }

            flushMessageQueue();
            int action = MessageBoxA(NULL, error_string.str(), "Assertion failed", MB_ABORTRETRYIGNORE|MB_ICONERROR);
            switch( action ) {
            case IDRETRY:
                ret = NV_ABORT_DEBUG;
                break;
            case IDIGNORE:
                ret = NV_ABORT_IGNORE;
                break;
            case IDABORT:
            default:
                ret = NV_ABORT_EXIT;
                break;
            }
            /*if( _CrtDbgReport( _CRT_ASSERT, file, line, module, exp ) == 1 ) {
                return NV_ABORT_DEBUG;
            }*/

            if( ret == NV_ABORT_EXIT ) {
                 // Exit cleanly.
                throw "Assertion failed";
            }

            return ret;
        }
    };
#elif NV_OS_XBOX

    /** Xbox360 assert handler. */
    struct Xbox360AssertHandler : public AssertHandler
    {
        // Assert handler method.
        virtual int assertion( const char * exp, const char * file, int line, const char * func/*=NULL*/ )
        {
            int ret = NV_ABORT_EXIT;

            StringBuilder error_string;
            if( func != NULL ) {
                error_string.format( "*** Assertion failed: %s\n    On file: %s\n    On function: %s\n    On line: %d\n ", exp, file, func, line );
                nvDebug( error_string.str() );
            }
            else {
                error_string.format( "*** Assertion failed: %s\n    On file: %s\n    On line: %d\n ", exp, file, line );
                nvDebug( error_string.str() );
            }

            if (debug::isDebuggerPresent()) {
                return NV_ABORT_DEBUG;
            }

            if( ret == NV_ABORT_EXIT ) {
                 // Exit cleanly.
                throw "Assertion failed";
            }

            return ret;
        }
    };
#else

    /** Unix assert handler. */
    struct UnixAssertHandler : public AssertHandler
    {
        // Assert handler method.
        virtual int assertion(const char * exp, const char * file, int line, const char * func)
        {
            if( func != NULL ) {
                nvDebug( "*** Assertion failed: %s\n    On file: %s\n    On function: %s\n    On line: %d\n ", exp, file, func, line );
            }
            else {
                nvDebug( "*** Assertion failed: %s\n    On file: %s\n    On line: %d\n ", exp, file, line );
            }

#if _DEBUG
            if (debug::isDebuggerPresent()) {
                return NV_ABORT_DEBUG;
            }
#endif

#if defined(HAVE_EXECINFO_H)
            if (hasStackTrace())
            {
                void * trace[64];
                int size = backtrace(trace, 64);
                printStackTrace(trace, size, 2);
            }
#endif

#if defined NV_OS_NACL
            abort();
#else
            // Exit cleanly.
            throw "Assertion failed";
#endif
        }
    };

#endif

} // namespace

/// Handle assertion through the assert handler.
int nvAbort(const char * exp, const char * file, int line, const char * func/*=NULL*/)
{
#if NV_OS_WIN32 //&& NV_CC_MSVC
    static Win32AssertHandler s_default_assert_handler;
#elif NV_OS_XBOX
    static Xbox360AssertHandler s_default_assert_handler;
#else
    static UnixAssertHandler s_default_assert_handler;
#endif

    if (s_assert_handler != NULL) {
        return s_assert_handler->assertion( exp, file, line, func );
    }
    else {
        return s_default_assert_handler.assertion( exp, file, line, func );
    }
}

/// Shows a message through the message handler.
void NV_CDECL nvDebugPrint(const char *msg, ...)
{
    va_list arg;
    va_start(arg,msg);
    if (s_message_handler != NULL) {
        s_message_handler->log( msg, arg );
    }
    va_end(arg);
}

/// Dump debug info.
void debug::dumpInfo()
{
#if (NV_OS_WIN32 && NV_CC_MSVC) || (defined(HAVE_SIGNAL_H) && defined(HAVE_EXECINFO_H))
    if (hasStackTrace())
    {
        void * trace[64];
        int size = backtrace(trace, 64);
        printStackTrace(trace, size, 1);
    }
#endif
}

/// Set the debug message handler.
void debug::setMessageHandler(MessageHandler * message_handler)
{
    s_message_handler = message_handler;
}

/// Reset the debug message handler.
void debug::resetMessageHandler()
{
    s_message_handler = NULL;
}

/// Set the assert handler.
void debug::setAssertHandler(AssertHandler * assert_handler)
{
    s_assert_handler = assert_handler;
}

/// Reset the assert handler.
void debug::resetAssertHandler()
{
    s_assert_handler = NULL;
}

/// Enable signal handler.
void debug::enableSigHandler()
{
    nvCheck(s_sig_handler_enabled != true);
    s_sig_handler_enabled = true;

#if NV_OS_WIN32 && NV_CC_MSVC

    s_old_exception_filter = ::SetUnhandledExceptionFilter( topLevelFilter );

    // SYMOPT_DEFERRED_LOADS make us not take a ton of time unless we actual log traces
    SymSetOptions(SYMOPT_DEFERRED_LOADS|SYMOPT_FAIL_CRITICAL_ERRORS|SYMOPT_LOAD_LINES|SYMOPT_UNDNAME);

    if (!SymInitialize(GetCurrentProcess(), NULL, TRUE)) {
        DWORD error = GetLastError();
        nvDebug("SymInitialize returned error : %d\n", error);
    }

#elif !NV_OS_WIN32 && defined(HAVE_SIGNAL_H)

    // Install our signal handler
    struct sigaction sa;
    sa.sa_sigaction = nvSigHandler;
    sigemptyset (&sa.sa_mask);
    sa.sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;

    sigaction(SIGSEGV, &sa, &s_old_sigsegv);
    sigaction(SIGTRAP, &sa, &s_old_sigtrap);
    sigaction(SIGFPE, &sa, &s_old_sigfpe);
    sigaction(SIGBUS, &sa, &s_old_sigbus);

#endif
}

/// Disable signal handler.
void debug::disableSigHandler()
{
    nvCheck(s_sig_handler_enabled == true);
    s_sig_handler_enabled = false;

#if NV_OS_WIN32 && NV_CC_MSVC

    ::SetUnhandledExceptionFilter( s_old_exception_filter );
    s_old_exception_filter = NULL;

    SymCleanup(GetCurrentProcess());

#elif !NV_OS_WIN32 && defined(HAVE_SIGNAL_H)

    sigaction(SIGSEGV, &s_old_sigsegv, NULL);
    sigaction(SIGTRAP, &s_old_sigtrap, NULL);
    sigaction(SIGFPE, &s_old_sigfpe, NULL);
    sigaction(SIGBUS, &s_old_sigbus, NULL);

#endif
}

bool debug::isDebuggerPresent()
{
#if NV_OS_WIN32
    HINSTANCE kernel32 = GetModuleHandleA("kernel32.dll");
    if (kernel32) {
        FARPROC IsDebuggerPresent = GetProcAddress(kernel32, "IsDebuggerPresent");
        if (IsDebuggerPresent != NULL && IsDebuggerPresent()) {
            return true;
        }
    }
    return false;
#elif NV_OS_XBOX
#ifdef _DEBUG
    return DmIsDebuggerPresent() == TRUE;
#else
    return false;
#endif
#elif NV_OS_DARWIN
    int mib[4];
    struct kinfo_proc info;
    size_t size;
    mib[0] = CTL_KERN;
    mib[1] = KERN_PROC;
    mib[2] = KERN_PROC_PID;
    mib[3] = getpid();
    size = sizeof(info);
    info.kp_proc.p_flag = 0;
    sysctl(mib,4,&info,&size,NULL,0);
    return ((info.kp_proc.p_flag & P_TRACED) == P_TRACED);
#elif NV_OS_NACL
    return false;
#else
    // if ppid != sid, some process spawned our app, probably a debugger.
    return getsid(getpid()) != getppid();
#endif
}

bool debug::attachToDebugger()
{
#if NV_OS_WIN32
    if (isDebuggerPresent() == FALSE) {
        Path process(1024);
        process.copy("\"");
        GetSystemDirectoryA(process.str() + 1, 1024 - 1);

        process.appendSeparator();

        process.appendFormat("VSJitDebugger.exe\" -p %lu", ::GetCurrentProcessId());

        STARTUPINFOA sSi;
        memset(&sSi, 0, sizeof(sSi));

        PROCESS_INFORMATION sPi;
        memset(&sPi, 0, sizeof(sPi));

        BOOL b = CreateProcessA(NULL, process.str(), NULL, NULL, FALSE, 0, NULL, NULL, &sSi, &sPi);
        if (b != FALSE) {
            ::WaitForSingleObject(sPi.hProcess, INFINITE);

            DWORD dwExitCode;
            ::GetExitCodeProcess(sPi.hProcess, &dwExitCode);
            if (dwExitCode != 0) //if exit code is zero, a debugger was selected
                b = FALSE;
        }

        if (sPi.hThread != NULL) ::CloseHandle(sPi.hThread);
        if (sPi.hProcess != NULL) ::CloseHandle(sPi.hProcess);

        if (b == FALSE)
            return false;

        for (int i = 0; i < 5*60; i++) {
            if (isDebuggerPresent())
                break;
            ::Sleep(200);
        }
    }

    nvDebugBreak();
#endif // NV_OS_WIN32

    return true;
}


text:
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Framework.Utils;
using osu.Game.Online.API;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Screens.OnlinePlay.Multiplayer;
using osu.Game.Screens.Play.HUD;
using osu.Game.Tests.Visual.OnlinePlay;
using osu.Game.Tests.Visual.Spectator;
using osu.Game.Users;

namespace osu.Game.Tests.Visual.Multiplayer
{
    public class TestSceneMultiplayerGameplayLeaderboardTeams : MultiplayerTestScene
    {
        private static IEnumerable<int> users => Enumerable.Range(0, 16);

        public new TestSceneMultiplayerGameplayLeaderboard.TestMultiplayerSpectatorClient SpectatorClient =>
            (TestSceneMultiplayerGameplayLeaderboard.TestMultiplayerSpectatorClient)OnlinePlayDependencies?.SpectatorClient;

        protected override OnlinePlayTestSceneDependencies CreateOnlinePlayDependencies() => new TestDependencies();

        protected class TestDependencies : MultiplayerTestSceneDependencies
        {
            protected override TestSpectatorClient CreateSpectatorClient() => new TestSceneMultiplayerGameplayLeaderboard.TestMultiplayerSpectatorClient();
        }

        private MultiplayerGameplayLeaderboard leaderboard;
        private GameplayMatchScoreDisplay gameplayScoreDisplay;

        protected override Room CreateRoom()
        {
            var room = base.CreateRoom();
            room.Type.Value = MatchType.TeamVersus;
            return room;
        }

        [SetUpSteps]
        public override void SetUpSteps()
        {
            AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = LookupCache.GetUserAsync(1).Result);

            AddStep("create leaderboard", () =>
            {
                leaderboard?.Expire();

                OsuScoreProcessor scoreProcessor;
                Beatmap.Value = CreateWorkingBeatmap(Ruleset.Value);

                var playableBeatmap = Beatmap.Value.GetPlayableBeatmap(Ruleset.Value);
                var multiplayerUsers = new List<MultiplayerRoomUser>();

                foreach (var user in users)
                {
                    SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
                    var roomUser = OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true);

                    roomUser.MatchState = new TeamVersusUserState
                    {
                        TeamID = RNG.Next(0, 2)
                    };

                    multiplayerUsers.Add(roomUser);
                }

                Children = new Drawable[]
                {
                    scoreProcessor = new OsuScoreProcessor(),
                };

                scoreProcessor.ApplyBeatmap(playableBeatmap);

                LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(scoreProcessor, multiplayerUsers.ToArray())
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                }, gameplayLeaderboard =>
                {
                    LoadComponentAsync(new MatchScoreDisplay
                    {
                        Team1Score = { BindTarget = leaderboard.TeamScores[0] },
                        Team2Score = { BindTarget = leaderboard.TeamScores[1] }
                    }, Add);

                    LoadComponentAsync(gameplayScoreDisplay = new GameplayMatchScoreDisplay
                    {
                        Anchor = Anchor.BottomCentre,
                        Origin = Anchor.BottomCentre,
                        Team1Score = { BindTarget = leaderboard.TeamScores[0] },
                        Team2Score = { BindTarget = leaderboard.TeamScores[1] }
                    }, Add);

                    Add(gameplayLeaderboard);
                });
            });

            AddUntilStep("wait for load", () => leaderboard.IsLoaded);
            AddUntilStep("wait for user population", () => Client.CurrentMatchPlayingUserIds.Count > 0);
        }

        [Test]
        public void TestScoreUpdates()
        {
            AddRepeatStep("update state", () => SpectatorClient.RandomlyUpdateState(), 100);
            AddToggleStep("switch compact mode", expanded =>
            {
                leaderboard.Expanded.Value = expanded;
                gameplayScoreDisplay.Expanded.Value = expanded;
            });
        }
    }
}


text:
class CitiesController < ApplicationController
  before_action :set_city, only: [:show, :edit, :update, :destroy, :invite, :participate]
  before_action :authenticate_user!, only: [:edit, :update, :destroy]

  # GET /cities
  # GET /cities.json
  def index
    @cities = policy_scope(City.all)

  end

  # GET /cities/1
  # GET /cities/1.json
  def show
    authorize @city, :show?
    @projects = @city.projects.order('urgent DESC, title')
    @categories = Category.where(:category => nil)
  end

  # GET /cities/new
  def new
    @city = City.new
    authorize @city, :new?
  end

  # GET /cities/1/edit
  def edit
    authorize @city, :edit?
  end

  def invite
    authorize @city, :edit?
  end

  # POST /cities
  # POST /cities.json
  def create
    @city = City.new(city_params)
    authorize @city, :create?

    respond_to do |format|
      if @city.save
        format.html { redirect_to @city, notice: 'City was successfully created.' }
        format.json { render :show, status: :created, location: @city }
      else
        format.html { render :new }
        format.json { render json: @city.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /cities/1
  # PATCH/PUT /cities/1.json
  def update
    authorize @city, :update?
    respond_to do |format|
      if @city.update(city_params)
        format.html { redirect_to @city, notice: 'City was successfully updated.' }
        format.json { render :show, status: :ok, location: @city }
      else
        format.html { render :edit }
        format.json { render json: @city.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /cities/1
  # DELETE /cities/1.json
  def destroy
    @city.destroy
    authorize @city, :destroy?

    respond_to do |format|
      format.html { redirect_to cities_url, notice: 'City was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  def participate
    authorize @city, :participate?

    @participation = CityParticipation.where(:city => @city, :participant => current_user).first_or_create
    @participation.status = :approved

    respond_to do |wants|
      if @participation.save
        wants.html { redirect_to @city, notice: 'Successfully applied.' }
        wants.json { render :show, status: :created, location: @city }
      else
        wants.html { render :new }
        wants.json { render json: @city.errors, status: :unprocessable_entity }
      end
    end
   end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_city
      @city = City.find(params[:id])
      @city.generate_token unless @city.invitationHash
      @city
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def city_params
      params.require(:city).permit(:title, :user_ids => [])
    end
end


text:
/*
 * This class represents the engine which drives every event in the game.
 */
package me.zx96.piupiu;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Scanner;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Font;
import javafx.scene.text.TextAlignment;
import javafx.util.Duration;
import me.zx96.piupiu.effects.ParticleExplosion;
import me.zx96.piupiu.effects.VariableColor;
import me.zx96.piupiu.entity.Direction;
import me.zx96.piupiu.entity.Enemy;
import me.zx96.piupiu.entity.EnemyProjectile;
import me.zx96.piupiu.entity.Entity;
import me.zx96.piupiu.entity.LargeEnemy;
import me.zx96.piupiu.entity.Mob;
import me.zx96.piupiu.entity.Player;
import me.zx96.piupiu.entity.PlayerProjectile;
import me.zx96.piupiu.entity.Projectile;
import me.zx96.piupiu.entity.SmallEnemy;

/*
 * Jonathan Zentgraf
 * Michael Ondrasek
 * CS-1180-01 Lab 10
 * Matthew Flaute
 */
public class GameEngine {

    private GamePane pane;
    private Scene scene;

    //Timelines to fire events at regular intervals
    private Timeline gameLoop;
    private Timeline smallEnemyFireLoop;
    private Timeline largeEnemyFireLoop;

    //IntegerProperties (to permit binding) for scores
    private IntegerProperty score = new SimpleIntegerProperty(0);
    private IntegerProperty highScore = new SimpleIntegerProperty(0);

    //Sound
    private MediaPlayer bgm = new MediaPlayer(
            new Media(ClassLoader.getSystemResource(Resources.AUD_BGM).toExternalForm()));
    private MediaPlayer sfxExplode = new MediaPlayer(
            new Media(ClassLoader.getSystemResource(Resources.AUD_SFX_EXPLOSION).toExternalForm()));

    //Entities
    private Player player = new Player();
    private ArrayList<Entity> entities = new ArrayList<>();
    private ArrayList<Enemy> enemies = new ArrayList<>();
    private ArrayList<Projectile> projectiles = new ArrayList<>();

    //We can't add or remove objects while iterating, so make queues
    ArrayList<Entity> entitiesToAdd = new ArrayList<>();
    ArrayList<Entity> entitiesToRemove = new ArrayList<>();
    ArrayList<ParticleExplosion> explosionsToAdd = new ArrayList<>();
    ArrayList<ParticleExplosion> explosionsToRemove = new ArrayList<>();

    public GameEngine() {
        //Set up the Pane and Scene
        pane = new GamePane();
        scene = new Scene(pane, Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        setupScene(pane);
        //Key bindings
        setupKeybinds();
        //Load the high score from file if applicable
        highScore.set(loadHighScore());

        //Add the Player
        add(player);

        //Set the explosion sound effect to reset after playing
        sfxExplode.setOnEndOfMedia(() -> sfxExplode.stop());
        //And keep it from being so freaking loud
        sfxExplode.setVolume(0.3);

        //Play the BGM and start up the Timelines
        bgm.setCycleCount(MediaPlayer.INDEFINITE);
        bgm.play();
        setupTimelines();

        //Begin the game by showing the help
        displayHelp();
    }

    /**
     * Configures the GamePane for use and sets the Scene to display it.
     * PreCondition: None.
     * PostCondition: The Scene is displaying a configured GamePane.
     *
     * @param pane An empty GamePane to be configured for use by the GameEngine.
     */
    private void setupScene(GamePane pane) {
        this.pane = pane;
        pane.bindScore(score);
        pane.bindHighScore(highScore);
        pane.setEngine(this);

        scene.setRoot(pane);

        /* Uncomment me to get a button
        javafx.scene.control.Button button = new javafx.scene.control.Button("Fire!");
        button.setOnAction(e -> player.fireProjectile());
        button.setLayoutX(Dimensions.SCREEN_WIDTH - 40);
        button.setLayoutY(Dimensions.SCREEN_HEIGHT - 28);
        button.setFocusTraversable(false);
        pane.getChildren().add(button);
        */
    }

    /**
     * Sets up key bindings for the game.
     * PreCondition: A Scene has been created.
     * PostCondition: The Scene has configured key bindings.
     */
    private void setupKeybinds() {
        scene.setOnKeyPressed(e -> {
            try {
                switch (e.getCode()) {
                    case LEFT:
                    case A:
                        player.startMovement(Direction.LEFT); break;
                    case RIGHT:
                    case D:
                        player.startMovement(Direction.RIGHT); break;
                    case UP:
                    case W:
                        player.startMovement(Direction.UP); break;
                    case DOWN:
                    case S:
                        player.startMovement(Direction.DOWN); break;
                    case SPACE:
                        player.fireProjectile(); break;
                    case ESCAPE:
                        displayPaused(); break;
                }
            } catch (NullPointerException ex) {
                System.err.println("Tried to move player, but player does not exist.");
            }
        });
        scene.setOnKeyReleased(e -> {
            try {
                switch (e.getCode()) {
                    case LEFT:
                    case A:
                        player.stopMovement(Direction.LEFT); break;
                    case RIGHT:
                    case D:
                        player.stopMovement(Direction.RIGHT); break;
                    case UP:
                    case W:
                        player.stopMovement(Direction.UP); break;
                    case DOWN:
                    case S:
                        player.stopMovement(Direction.DOWN); break;
                }
            } catch (NullPointerException ex) {
                System.err.println("Tried to stop player, but player does not exist.");
            }
        });
    }

    /**
     * Adds an Entity to the GamePane and to GameEngine's state variables.
     * PreCondition: Nothing is currently modifying or iterating over the
     * GamePane's children or the GameEngine's ArrayLists.
     * PostCondition: A new Entity is added to the GamePane and GameEngine.
     *
     * @param entity The entity to add.
     */
    private void add(Entity entity) {
        entities.add(entity);
        if (entity instanceof Player) {
            player = (Player)entity;
            pane.bindHealth(player.healthPropertyUnmodifiable());
        }
        if (entity instanceof Enemy) {
            enemies.add((Enemy)entity);
            pane.getChildren().add(((Enemy)entity).getHealthBar());
        }
        if (entity instanceof Projectile) projectiles.add((Projectile)entity);
        pane.getChildren().add(entity);
    }

    /**
     * Adds a ParticleExplosion to the GamePane.
     * PreCondition: Nothing is currently modifying or iterating over the
     * GamePane's children.
     * PostCondition: A new ParticleExplosion is added to the GamePane.
     *
     * @param explosion The ParticleExplosion to add.
     */
    private void add(ParticleExplosion explosion) {
        pane.getChildren().add(explosion);
    }

    /**
     * Removes an Entity from the GamePane and from GameEngine's state variables.
     * PreCondition: Nothing is currently modifying or iterating over the
     * GamePane's children or the GameEngine's ArrayLists.
     * PostCondition: The entity is removed from the GamePane and GameEngine.
     *
     * @param entity The entity to remove.
     */
    private void remove(Entity entity) {
        //Enemies also have associated HealthBars to be added
        if (entity instanceof Enemy)
            pane.getChildren().remove(((Enemy)entity).getHealthBar());
        entities.remove(entity);
        //Remove from the other ArraryLists as well
        //No harm done if it isn't in one of these
        enemies.remove(entity);
        projectiles.remove(entity);
        pane.getChildren().remove(entity);
    }

    /**
     * Removes a ParticleExplosion from the GamePane.
     * PreCondition: Nothing is currently modifying or iterating over the
     * GamePane's children.
     * PostCondition: The ParticleExplosion is removed from the GamePane.
     *
     * @param explosion The ParticleExplosion to remove.
     */
    private void remove(ParticleExplosion explosion) {
        pane.getChildren().remove(explosion);
    }

    /**
     * Queues the addition of a new Entity to the game.
     * PreCondition: None.
     * PostCondition: A new Entity is queued for addition.
     *
     * @param entity The Entity to add to the game.
     */
    public void queueAddition(Entity entity) {
        entitiesToAdd.add(entity);
    }

    /**
     * Queues the addition of a new ParticleExplosion to the game.
     * PreCondition: None.
     * PostCondition: A new ParticleExplosion is queued for addition.
     *
     * @param explosion The ParticleExplosion to add to the game.
     */
    public void queueAddition(ParticleExplosion explosion) {
        explosionsToAdd.add(explosion);
    }

    /**
     * Queues the removal of an existing Entity from the game.
     * PreCondition: None.
     * PostCondition: A new Entity is queued for removal.
     *
     * @param entity The Entity to remove from the game.
     */
    public void queueRemoval(Entity entity) {
        entitiesToRemove.add(entity);
    }

    /**
     * Queues the removal of an existing ParticleExplosion from the game.
     * PreCondition: None.
     * PostCondition: A new ParticleExplosion is queued for removal.
     *
     * @param explosion The ParticleExplosion remove from to the game.
     */
    public void queueRemoval(ParticleExplosion explosion) {
        explosionsToRemove.add(explosion);
    }

    /**
     * Queues a ParticleExplosion for addition and later removal and starts its
     * animation.
     * PreCondition: None.
     * PostCondition: A ParticleExplosion has been played back.
     *
     * @param explosion
     */
    public void playExplosion(ParticleExplosion explosion) {
        queueAddition(explosion);
        //Set a timer to remove the explosion after playing
        Timeline removalDelay = new Timeline(new KeyFrame(
                Duration.millis(explosion.getDuration()), e -> {
                    queueRemoval(explosion);
                }
        ));
        removalDelay.play();
        //Play the explosion
        explosion.explode();
    }

    //We need to expose the Player's coordinates for SmallEnemy's use

    /**
     * Returns the X coordinate of the Player.
     * PreCondition: None.
     * PostCondition: None.
     *
     * @return The Player's X coordinate.
     */
    public double getPlayerX() {
        return player.getX();
    }

    /**
     * Returns the Y coordinate of the Player.
     * PreCondition: None.
     * PostCondition: None.
     *
     * @return The Player's Y coordinate.
     */
    public double getPlayerY() {
        return player.getY();
    }

    /**
     * Returns the GamePane associated with this GameEngine.
     * PreCondition: None.
     * PostCondition: None.
     *
     * @return The GamePane.
     */
    public GamePane getPane() {
        return pane;
    }

    /**
     * Returns the Scene associated with this GameEngine's GamePane.
     * PreCondition: None.
     * PostCondition: None.
     *
     * @return The Scene.
     */
    public Scene getScene() {
        return scene;
    }

    /**
     * Writes the high score out to the high score file.
     * PreCondition: None.
     * PostCondition: The high score is written to the high score file.
     */
    private void saveHighScore() {
        File file = new File(Resources.HIGH_SCORE_FILE);
        try {
            try (PrintWriter writer = new PrintWriter(file)) {
                writer.println(highScore.getValue());
            }
        } catch (FileNotFoundException ex) {
            System.err.println("Couldn't write high score file.");
        }
    }

    /**
     * Loads the high score from the high score file, if it exists.
     * PreCondition: None.
     * PostCondition: The high score is loaded from the high score file.
     *
     * @return 0 if the file is invalid or nonexistent, the high score otherwise.
     */
    private int loadHighScore() {
        File file = new File(Resources.HIGH_SCORE_FILE);
        try {
            try (Scanner scanner = new Scanner(file)) {
                return scanner.nextInt();
            }
        } catch (InputMismatchException ex) {
            System.err.println("High score file invalid.");
        } catch (FileNotFoundException ex) {
            System.err.println("Couldn't open high score file.");
        }
        return 0;
    }

    /**
     * Pauses all game events.
     * PreCondition: The game is running.
     * PostCondition: The game is paused.
     */
    private void pause() {
        gameLoop.pause();
        smallEnemyFireLoop.pause();
        largeEnemyFireLoop.pause();
        bgm.pause();
    }

    /**
     * Resumes the game from a paused or stopped state.
     * PreCondition: The game is paused or stopped.
     * PostCondition: The game is resumed.
     */
    private void play() {
        gameLoop.play();
        smallEnemyFireLoop.play();
        largeEnemyFireLoop.play();
        bgm.play();
    }

    /**
     * Stops all game events.
     * PreCondition: The game is running or paused.
     * PostCondition: The game is stopped.
     */
    private void stop() {
        gameLoop.stop();
        smallEnemyFireLoop.stop();
        largeEnemyFireLoop.stop();
        bgm.stop();
    }

    /**
     * Resets the game to a clean state from a stopped state and starts it.
     * PreCondition: The game is stopped.
     * PostCondition: The game has been restarted in a clean state.
     */
    private void restart() {
        //Clear out the ArrayLists
        entities.clear();
        entitiesToAdd.clear();
        entitiesToRemove.clear();
        enemies.clear();
        projectiles.clear();

        //Add a new Player
        queueAddition(new Player());

        setupScene(new GamePane());

        //Reset the score
        score.set(0);

        //Restart the timelines and BGM
        play();
    }

    /**
     * Pauses the game and displays information about the game in the
     * GamePane.
     * PreCondition: None.
     * PostCondition: Help is displayed and the game will play on any key.
     */
    private void displayHelp() {
        pause();

        Label helpText = new Label(
            "Welcome to Piu Piu!\n\n"

          + "In this game, you are the sole surviving member of the latest battle in this long war.\n"
          + "You are swarmed by your alien foes, but you cannot give up hope - you must defeat as many as possible. "
          + "You must weaken them so that humanity will have a chance at emerging victorious.\n\n"

          + "Each larva you kill is worth 100 points, and each adult, 500. "
          + "Your ship's health is shown as a bar on the top, and the aliens' healths are shown above their bodies.\n"
          + "Hold them off, and NEVER STOP SHOOTING.\n\n"

          + "We can win.\n\n"

          + "...Some day...\n\n"

          + "Use the arrow keys or WASD to move.\n"
          + "Press Space to fire a plasma ball.\n"
          + "Press Esc to pause or end the game.\n\n"

          + "Press any key to continue."
        );

        //Display the text
        helpText.setFont(Font.loadFont(ClassLoader.getSystemResource(Resources.FONT).toExternalForm(),
                Dimensions.FONT_SIZE_NORMAL));
        helpText.setMinSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        helpText.setMaxSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        helpText.setAlignment(Pos.CENTER);
        helpText.setTextAlignment(TextAlignment.CENTER);
        helpText.setWrapText(true);
        helpText.setTextFill(Color.WHITE);

        //On a shaded background
        Rectangle background = new Rectangle(Dimensions.SCREEN_WIDTH, 384,
                new Color(0, 0, 0, 0.6));
        background.setX(0);
        background.setY((Dimensions.SCREEN_HEIGHT / 2) - 192);

        pane.getChildren().addAll(background, helpText);

        //Bind every key to play play
        background.setOnKeyPressed(e -> {
            pane.getChildren().removeAll(background, helpText);
            play();
        });
        background.requestFocus();
    }

    /**
     * Stops the game and displays a game over banner.  Sets a key binding for
     * R to restart the game.
     * PreCondition: The game is running.
     * PostCondition: The game is stopped and a banner is displayed.
     */
    private void gameOver() {
        //Stop all looping events
        stop();

        //Write out the high score
        saveHighScore();

        //Display "GAME OVER" in the center over a translucent bar
        Label goLabel = new Label("GAME OVER");
        goLabel.setFont(Font.loadFont(ClassLoader.getSystemResource(Resources.FONT).toExternalForm(),
                Dimensions.FONT_SIZE_NORMAL));
        goLabel.setMinSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        goLabel.setAlignment(Pos.CENTER);
        goLabel.setTranslateY(-2);
        goLabel.setTextAlignment(TextAlignment.CENTER);
        goLabel.setTextFill(Color.WHITE);

        //Add "Press R to restart"
        Label restartLabel = new Label("Press R to restart");
        restartLabel.setFont(Font.loadFont(
                ClassLoader.getSystemResource(Resources.FONT).toExternalForm(),
                Dimensions.FONT_SIZE_SMALL));
        restartLabel.setMinSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        restartLabel.setAlignment(Pos.CENTER);
        restartLabel.setTranslateY(10);
        restartLabel.setTextAlignment(TextAlignment.CENTER);
        restartLabel.setTextFill(Color.WHITE);

        //And a translucent background for the text
        Rectangle background = new Rectangle(Dimensions.SCREEN_WIDTH, 30,
                new Color(0, 0, 0, 0.6));
        background.setX(0);
        background.setY((Dimensions.SCREEN_HEIGHT / 2) - 12);

        //Display the background and labels
        pane.getChildren().addAll(background, goLabel, restartLabel);
        //Bind R to restart
        background.setOnKeyPressed(e -> {
            switch (e.getCode()) {
                case R:
                    restart(); break;
                case ESCAPE:
                    Platform.exit(); break;
            }
        });
        background.requestFocus();
    }

    /**
     * Stops the game and displays a game over banner.  Sets a key binding for
     * R to restart the game.
     * PreCondition: The game is running.
     * PostCondition: The game is stopped and a banner is displayed.
     */
    private void displayPaused() {
        //Pauses all looping events
        pause();

        //Display "PAUSED" in the center over a translucent bar
        Label goLabel = new Label("PAUSED");
        goLabel.setFont(Font.loadFont(ClassLoader.getSystemResource(Resources.FONT).toExternalForm(),
                Dimensions.FONT_SIZE_NORMAL));
        goLabel.setMinSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        goLabel.setAlignment(Pos.CENTER);
        goLabel.setTranslateY(-2);
        goLabel.setTextAlignment(TextAlignment.CENTER);
        goLabel.setTextFill(Color.WHITE);

        //Add "Press Space to resume"
        Label resumeLabel = new Label("Press Space to resume");
        resumeLabel.setFont(Font.loadFont(
                ClassLoader.getSystemResource(Resources.FONT).toExternalForm(),
                Dimensions.FONT_SIZE_SMALL));
        resumeLabel.setMinSize(Dimensions.SCREEN_WIDTH, Dimensions.SCREEN_HEIGHT);
        resumeLabel.setAlignment(Pos.CENTER);
        resumeLabel.setTranslateY(10);
        resumeLabel.setTextAlignment(TextAlignment.CENTER);
        resumeLabel.setTextFill(Color.WHITE);

        //And a translucent background for the text
        Rectangle background = new Rectangle(Dimensions.SCREEN_WIDTH, 30,
                new Color(0, 0, 0, 0.6));
        background.setX(0);
        background.setY((Dimensions.SCREEN_HEIGHT / 2) - 12);

        //Display the background and labels
        pane.getChildren().addAll(background, goLabel, resumeLabel);
        //Bind Space to resume
        background.setOnKeyPressed(e -> {
            switch (e.getCode()) {
                case SPACE:
                    pane.getChildren().removeAll(background, goLabel, resumeLabel);
                    play(); break;
                case ESCAPE:
                    Platform.exit(); break;
            }
        });
        background.requestFocus();
    }

    /**
     * Sets up the game logic within Timelines and plays them.
     * PreCondition: Player is not null.
     * PostCondition: The game logic has been set up and the loops have been
     * started.
     */
    private void setupTimelines() {

        gameLoop = new Timeline(new KeyFrame(Duration.millis(Timing.TICK_LENGTH), e -> {
            //Tick for every entity
            for (Entity entity : entities) {
                entity.doTick();

                //Check if the entity's health is zero
                if (entity instanceof Enemy) {
                    if (((Enemy)entity).getHealth() <= 0) {
                        //Update the score
                        score.set(score.get() + ((Enemy)entity).getScoreValue());
                        if (score.get() > highScore.get()) highScore.set(score.get());

                        //Make a new ParticleExplosion at the Enemy's position
                        ParticleExplosion explosion = new ParticleExplosion();
                        explosion.generateParticles(entity.getCenterX(),
                            entity.getCenterY(), 120, 600, 200, 2, VariableColor.GREEN);
                        explosion.generateParticles(entity.getCenterX(),
                            entity.getCenterY(), 120, 500, 120, 2, VariableColor.RED);
                        sfxExplode.play();

                        //Queue the Entity for removal and play the ParticleExplosion
                        playExplosion(explosion);
                        queueRemoval(entity);
                    }

                    //Randomly reverse large enemies
                    if (entity instanceof LargeEnemy) {
                        if (Math.random() < Timing.ENEMY_LARGE_REVERSE_CHANCE)
                            ((LargeEnemy)entity).reverseDirection();
                    }
                }
                if (entity instanceof Player) {
                    //Display "GAME OVER" if player died
                    if (((Mob)entity).getHealth() <= 0) {
                        gameOver();

                        //Make a new ParticleExplosion at the Enemy's position
                        ParticleExplosion explosion = new ParticleExplosion();
                        explosion.generateParticles(entity.getCenterX(),
                            entity.getCenterY(), 120, 600, 200, 2, VariableColor.PINK);
                        explosion.generateParticles(entity.getCenterX(),
                            entity.getCenterY(), 120, 500, 450, 2, VariableColor.RED);
                        sfxExplode.play();

                        //Play the ParticleExplosion
                        playExplosion(explosion);
                        queueRemoval(entity);
                    }
                }
            }

            //Randomly spawn a new enemy
            if (Math.random() < Timing.ENEMY_SPAWN_CHANCE) {
                if (Math.random() < Timing.SMALL_ENEMY_PROPORTION) queueAddition(new SmallEnemy());
                else queueAddition(new LargeEnemy());
            }

            //Detect collisions and remove any Projectiles that went outside the GamePane
            for (Projectile projectile : projectiles) {
                //PlayerProjectiles colliding with Enemies
                if (projectile instanceof PlayerProjectile) {
                    for (Enemy enemy : enemies) {
                        if (projectile.intersects(enemy.getX(), enemy.getY(),
                                enemy.getWidth(), enemy.getHeight())) {
                            enemy.subtractHealth(projectile.getDamage());
                            queueRemoval(projectile);
                        }
                    }
                }
                //EnemyProjectiles colliding with the Player
                if (projectile instanceof EnemyProjectile
                        && projectile.intersects(player.getX(), player.getY(),
                        player.getWidth(), player.getHeight())) {
                    player.subtractHealth(projectile.getDamage());
                    queueRemoval(projectile);
                }
                //Remove any that are outside the play area
                if (projectile.getY() < -projectile.getHeight()
                        || projectile.getY() > Dimensions.SCREEN_HEIGHT)
                    queueRemoval(projectile);
            }

            //Remove Entities queued for removal
            for (Entity entity : entitiesToRemove) {
                remove(entity);
            }
            //And clear the list to start fresh next cycle
            entitiesToRemove.clear();
            //Same thing for those queued for addition
            for (Entity entity : entitiesToAdd) {
                add(entity);
            }
            entitiesToAdd.clear();

            //And explosions as well
            for (ParticleExplosion explosion : explosionsToRemove) {
                remove(explosion);
            }
            explosionsToRemove.clear();
            for (ParticleExplosion explosion : explosionsToAdd) {
                add(explosion);
            }
            explosionsToAdd.clear();
        }));
        gameLoop.setCycleCount(Timeline.INDEFINITE);
        gameLoop.play();

        smallEnemyFireLoop = new Timeline(new KeyFrame(Duration.millis(Timing.ENEMY_SMALL_FIRE_RATE), e -> {
            for (Entity entity : entities) {
                if (entity instanceof SmallEnemy) ((SmallEnemy)entity).fireProjectile();
            }
        }));
        smallEnemyFireLoop.setCycleCount(Timeline.INDEFINITE);
        smallEnemyFireLoop.play();

        largeEnemyFireLoop = new Timeline(new KeyFrame(Duration.millis(Timing.ENEMY_LARGE_FIRE_RATE), e -> {
            for (Entity entity : entities) {
                if (entity instanceof LargeEnemy) ((LargeEnemy)entity).fireProjectile();
            }
        }));
        largeEnemyFireLoop.setCycleCount(Timeline.INDEFINITE);
        largeEnemyFireLoop.play();
    }

}


text:
package com.defano.hypertalk.exception;

import com.defano.wyldcard.part.model.PartModel;
import com.defano.wyldcard.runtime.ExecutionContext;
import com.defano.hypertalk.ast.model.specifier.PartSpecifier;
import com.defano.hypertalk.util.Range;
import org.antlr.v4.runtime.Token;

public class Breadcrumb {

    private ExecutionContext context;
    private Token token;
    private PartSpecifier part;

    public Breadcrumb (ExecutionContext context, Token token) {
        this.context = context;
        this.token = token;
        this.part = context.getStackFrame().getMe();
    }

    public Breadcrumb (Token token) {
        this.token = token;
    }

    public Range getCharRange() {
        int start = token.getStartIndex();
        int end = token.getStopIndex();

        if (end > start) {
            return new Range(start, end + 1);
        }

        return null;
    }

    public void setContext(ExecutionContext context) {
        this.context = context;
    }

    public void setToken(Token token) {
        this.token = token;
    }

    public void setPart(PartSpecifier part) {
        this.part = part;
    }

    public Token getToken() {
        return token;
    }

    public PartSpecifier getPart() {
        return part;
    }

    public ExecutionContext getContext() {
        return context;
    }

    @Override
    public String toString() {
        String breadcrumb = "";

        if ( token != null) {
            breadcrumb += "line " + token.getLine() + ", column " + token.getCharPositionInLine();
        }

        if (part != null) {
            breadcrumb += " of " + part.getHyperTalkIdentifier(new ExecutionContext());
        }

        return breadcrumb;
    }

    public PartModel getPartModel() {
        PartModel partModel = null;

        if (getPart() != null) {
            try {
                partModel = context.getPart(getPart());
            } catch (HtNoSuchPartException e) {
                // Nothing to do
            }
        }

        return partModel;
    }

}


text:
title: Override Inherited Methods
localeTitle: Переопределить наследуемые методы
---
## Переопределить наследуемые методы

# Решение

```javascript
Penguin.prototype.fly = function() {
    return  "Alas, this is a flightless bird.";
 };

```


text:
namespace dukat
{
	bool BoundingCircle::intersect_circle(const Vector2& center, float radius) const
	{
		auto dist = (this->center - center).mag();
		return (dist <= (this->radius + radius));
	}

	float BoundingCircle::intersect_ray(const Ray2& ray, float near_z, float far_z) const
	{
		const auto a = ray.dir * ray.dir;
		// Center to start of ray
		const auto f = ray.origin - center;
		const auto b = 2.0f * (f * ray.dir);
		const auto c = f * f - radius * radius;
		auto discriminant = b * b - 4 * a*c;
		if (discriminant < 0)
		{
			return no_intersection;
		}
		else
		{
			discriminant = std::sqrt(discriminant);
			auto t1 = (-b - discriminant) / (2 * a);
			auto t2 = (-b + discriminant) / (2 * a);
			if (t1 >= 0 && t1 <= 1)
				return t1;
			else if (t2 >= 0 && t2 <= 1)
				return t2;
			else
				return no_intersection;
		}
	}
}


text:
require 'pabi/error/base'

module Pabi
  module Error
    class ValidationError < Pabi::Error::Base
      def initialize code
        if code
          @code = Integer code
        else
          @code = -1
        end
      end

      def message
        case @code
        when 21000
          "The App Store could not read the JSON object you provided."
        when 21002
          "The data in the receipt-data property was malformed."
        when 21003
          "The receipt could not be authenticated."
        when 21004
          "The shared secret you provided does not match the shared secret on file for your account."
        when 21005
          "The receipt server is not currently available."
        when 21006
          "This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response."
        when 21007
          "This receipt is a sandbox receipt, but it was sent to the production service for verification."
        when 21008
          "This receipt is a production receipt, but it was sent to the sandbox service for verification."
        when 401
          "Login Required."
        else
          "Unknown Error: #{@code}"
        end
      end
    end
  end
end


text:
package org.finra.datagenerator.engine.scxml;

import java.io.InputStream;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.scxml.model.ModelException;
import org.junit.Assert;
import org.junit.Test;

/**
 * Marshall Peters Date: 9/3/14
 */
public class SCXMLEngineTest {
    private String[] setRecordType1 = new String[]{"a1", "b1", "c1", "d1", "e1", "f1", "g1"};
    private String[] setRecordType2 = new String[]{"a2", "b2", "c2", "d2", "e2", "f2", "g2"};
    private String[] setRecordType3 = new String[]{"a3", "b3", "c3", "d3", "e3", "f3", "g3"};

    /**
     * Multiple variable assignments using 'set' inside 'dg:assign' tag
     */
    @Test
    public void testMultiVariableAssignment() {
        SCXMLEngine e = new SCXMLEngine();
        InputStream is = SCXMLEngineTest.class.getResourceAsStream("/bigtest.xml");
        e.setModelByInputFileStream(is);

        try {
            List<PossibleState> bfs = e.bfs(100);
            Assert.assertEquals("Oops! We have '" + bfs.size() + "' records, but we wait for 7^3, "
                    + "produced by expanding BULK_ASSIGN", 343, bfs.size());

            Set<Set<String>> allPossibleValuesForRecordType123 = generateAllPossibleValues();
            for (PossibleState p : bfs) {
                // let's remove this generated record from list of all necessary records for this test
                Set<String> recordType123 = new HashSet<String>();
                recordType123.add(p.variables.get("var_out_RECORD_TYPE"));
                recordType123.add(p.variables.get("var_out_RECORD_TYPE_2"));
                recordType123.add(p.variables.get("var_out_RECORD_TYPE_3"));
                if (allPossibleValuesForRecordType123.contains(recordType123)) {
                    allPossibleValuesForRecordType123.remove(recordType123);
                } else {
                    Assert.fail("Oops! We wait for '" + recordType123 + "' combination for RECORD_TYPE_1, _2 and _3, but it wasn't generated!");
                }

                Assert.assertEquals(p.nextState.getId(), "ASSIGN_WITH_CONDITIONS");
                Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_4"), "Lorem");
                Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_5"), "Ipsum");
                Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_6"), "Doler");
            }

            // we have removed all generated values for RECORD_TYPE_1, _2 and _3, so 'allPossibleValuesForRecordType123' has be empty now
            for (Set<String> valuesForRecordType123 : allPossibleValuesForRecordType123) {
                Assert.fail("Oops! We have not generated combanation for for RECORD_TYPE_1, _2 and _3 - '" + valuesForRecordType123 + "'!");
            }
        } catch (ModelException ex) {
            Assert.fail("Oops! ModelException = " + e);
        }
    }

    private Set<Set<String>> generateAllPossibleValues() {
        Set<Set<String>> result = new HashSet<Set<String>>();

        for (String val1 : setRecordType1) {
            for (String val2 : setRecordType2) {
                for (String val3 : setRecordType3) {
                    Set<String> record = new HashSet<String>();
                    record.add(val1);
                    record.add(val2);
                    record.add(val3);
                    result.add(record);
                }
            }
        }
        return result;
    }

    /**
     * All variables have a default assignment of "" (empty string)
     */
    @Test
    public void testInitiallyEmptyAssignment() {
        SCXMLEngine e = new SCXMLEngine();
        InputStream is = SCXMLEngineTest.class.getResourceAsStream("/bigtest.xml");
        e.setModelByInputFileStream(is);

        try {
            List<PossibleState> bfs = e.bfs(1);
            Assert.assertEquals(1, bfs.size());

            PossibleState p = bfs.get(0);
            Assert.assertEquals(p.nextState.getId(), "start");

            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_2"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_3"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_4"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_5"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_6"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_7"), "");
            Assert.assertEquals(p.variables.get("var_out_RECORD_TYPE_8"), "");
            Assert.assertEquals(p.variables.keySet().size(), 8);
        } catch (ModelException ex) {
            Assert.fail("Oops! ModelException = " + e);
        }
    }

    /**
     * Throws exception when reaching end state
     */
    @Test
    public void testExceptionAtEndState() {
        SCXMLEngine e = new SCXMLEngine();
        InputStream is = SCXMLEngineTest.class.getResourceAsStream("/bigtest.xml");
        e.setModelByInputFileStream(is);

        String errorMessageExpected = "Could not achieve required bootstrap without reaching end state";
        try {
            e.bfs(4000); // too many
            Assert.fail("Oops! We wait for '" + errorMessageExpected + "' error message here "
                    + "(bootstrap size is too big for this model), but don't have it!");
        } catch (ModelException ex) {
            Assert.assertEquals("Oops! We have '"  + ex.getMessage() + "' modelException error message, but we wait for "
                    + "'" + errorMessageExpected + "' here!", ex.getMessage(), errorMessageExpected);
        }
    }
}


text:
function check_empty() {
if (document.getElementById('name').value == "" || document.getElementById('email').value == "" || document.getElementById('msg').value == "") {
alert("Fill All Fields !");
} else {
document.getElementById('form1').submit();
alert("Form Submitted Successfully...");
}
}
//Function To Display Popup
function div_show() {
document.getElementById('abc1').style.display = "block";
}
function div_show() {
document.getElementById('abc2').style.display = "block";
}
//Function to Hide Popup
function div_hide(){
document.getElementById('abc1').style.display = "none";
}
function div_hide(){
document.getElementById('abc2').style.display = "none";
}


text:
Shaker: A Salt Minion Factory for EC2 Instances
===============================================

Shaker is BSD-New Licensed command-line application to launch Salt
minions as Amazon EC2 instances.

`Salt <http://saltstack.org>`_ is a powerful remote execution
manager that can be used to administer servers in a fast and
efficient way.

Running an Amazon EC2 instance as a Salt minion is fairly simple.
Also tedious, if you need to launch minions often.  Shaker bridges
the gap between launching an EC2 instance and bootstrapping it as
a Salt minion.

Example
-------

Shaker is usually run from the command line.  To start a Salt minion,
have it connect upon boot to Salt master *salt.example.com*:

::

    $ shaker --ami ami-057bcf6c --master salt.example.com

    Started Instance: i-9175d8f4

    To access: ssh ubuntu@ec2-107-20-93-179.compute-1.amazonaws.com
    To terminate: shaker-terminate i-9175d8f4

Documentation and Links
-----------------------

* `ReadTheDocs <http://readthedocs.org/docs/shaker/en/latest/>`_
* `GitHub Repository <https://github.com/rubic/shaker>`_
* `Salt <http://saltstack.org>`_