text:
package io.cdap.plugin.zuora.objects;

import com.google.gson.annotations.SerializedName;
import io.cdap.cdap.api.data.schema.Schema;
import io.cdap.plugin.zuora.restobjects.annotations.ObjectDefinition;
import io.cdap.plugin.zuora.restobjects.annotations.ObjectFieldDefinition;
import io.cdap.plugin.zuora.restobjects.objects.BaseObject;

import javax.annotation.Nullable;

/**
* Object name: ProxyGetAmendment (ProxyGetAmendment).
* Related objects:
**/
@SuppressWarnings("unused")
@ObjectDefinition(
  Name = "ProxyGetAmendment",
  ObjectType = ObjectDefinition.ObjectDefinitionType.NESTED
)
public class ProxyGetAmendment extends BaseObject {
  /**
  * Name: AutoRenew (AutoRenew), Type: boolean.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("autoRenew")
  @ObjectFieldDefinition(FieldType = Schema.Type.BOOLEAN)
  private Boolean autoRenew;

  /**
  * Name: Code (Code), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("code")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String code;

  /**
  * Name: ContractEffectiveDate (ContractEffectiveDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("contractEffectiveDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String contractEffectiveDate;

  /**
  * Name: CreatedById (CreatedById), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("createdById")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String createdById;

  /**
  * Name: CreatedDate (CreatedDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("createdDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String createdDate;

  /**
  * Name: CurrentTerm (CurrentTerm), Type: integer.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("currentTerm")
  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  private Integer currentTerm;

  /**
  * Name: CurrentTermPeriodType (CurrentTermPeriodType), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("currentTermPeriodType")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String currentTermPeriodType;

  /**
  * Name: CustomerAcceptanceDate (CustomerAcceptanceDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("customerAcceptanceDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String customerAcceptanceDate;

  /**
  * Name: Description (Description), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("description")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String description;

  /**
  * Name: EffectiveDate (EffectiveDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("effectiveDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String effectiveDate;

  /**
  * Name: Id (Id), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("id")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String id;

  /**
  * Name: Name (Name), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("name")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String name;

  /**
  * Name: RenewalSetting (RenewalSetting), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("renewalSetting")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String renewalSetting;

  /**
  * Name: RenewalTerm (RenewalTerm), Type: integer.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("renewalTerm")
  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  private Integer renewalTerm;

  /**
  * Name: RenewalTermPeriodType (RenewalTermPeriodType), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("renewalTermPeriodType")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String renewalTermPeriodType;

  /**
  * Name: ServiceActivationDate (ServiceActivationDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("serviceActivationDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String serviceActivationDate;

  /**
  * Name: SpecificUpdateDate (SpecificUpdateDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("specificUpdateDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String specificUpdateDate;

  /**
  * Name: Status (Status), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("status")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String status;

  /**
  * Name: SubscriptionId (SubscriptionId), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("subscriptionId")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String subscriptionId;

  /**
  * Name: TermStartDate (TermStartDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("termStartDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String termStartDate;

  /**
  * Name: TermType (TermType), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("termType")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String termType;

  /**
  * Name: Type (Type), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("type")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String type;

  /**
  * Name: UpdatedById (UpdatedById), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("updatedById")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String updatedById;

  /**
  * Name: UpdatedDate (UpdatedDate), Type: string.
  * Options (custom, update, select): false, false, false
  **/
  @Nullable
  @SerializedName("updatedDate")
  @ObjectFieldDefinition(FieldType = Schema.Type.STRING)
  private String updatedDate;

  @Override
  public void addFields() {
    addCustomField("autoRenew", autoRenew, Boolean.class);
    addCustomField("code", code, String.class);
    addCustomField("contractEffectiveDate", contractEffectiveDate, String.class);
    addCustomField("createdById", createdById, String.class);
    addCustomField("createdDate", createdDate, String.class);
    addCustomField("currentTerm", currentTerm, Integer.class);
    addCustomField("currentTermPeriodType", currentTermPeriodType, String.class);
    addCustomField("customerAcceptanceDate", customerAcceptanceDate, String.class);
    addCustomField("description", description, String.class);
    addCustomField("effectiveDate", effectiveDate, String.class);
    addCustomField("id", id, String.class);
    addCustomField("name", name, String.class);
    addCustomField("renewalSetting", renewalSetting, String.class);
    addCustomField("renewalTerm", renewalTerm, Integer.class);
    addCustomField("renewalTermPeriodType", renewalTermPeriodType, String.class);
    addCustomField("serviceActivationDate", serviceActivationDate, String.class);
    addCustomField("specificUpdateDate", specificUpdateDate, String.class);
    addCustomField("status", status, String.class);
    addCustomField("subscriptionId", subscriptionId, String.class);
    addCustomField("termStartDate", termStartDate, String.class);
    addCustomField("termType", termType, String.class);
    addCustomField("type", type, String.class);
    addCustomField("updatedById", updatedById, String.class);
    addCustomField("updatedDate", updatedDate, String.class);
  }
}


text:
/**
 * Created by pvmeira on 18/06/17.
 */
angular.module('app').controller("VoterController", ['$scope', 'VoterService', '$resource', 'notify', VoterController]);

function VoterController($scope, VoterService, $resource, notify) {

    $scope.listAll = listAll;
    $scope.addNewVoter = addNewVoter;
    $scope.voters = {};
    $scope.voter = {};
    init();

    function init() {
        listAll();
    }

    /**
     * List all the voters present in the DB of the application
     */
    function listAll() {
        $scope.voters = VoterService.listAllVoters();
    }

    /**
     * Add a new Voter to the DB of the application, both name and email
     * are required so that the new voter can be stored on the DB
     */
    function addNewVoter() {
        if (!$scope.voter.name || !$scope.voter.email) {
            notify.alert("Campo Obrigatório");
        } else {
            var r = $resource('/app/voter');
            r.save($scope.voter, function (response) {
                notify.successOnSave();
                $scope.voters.push($scope.voter)
                $scope.voter = {};
            }, function (response) {
                $scope.voter = {};
                notify.danger("Esse email já está sendo usado.");
            });
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package com.alicode.game.dogedash.worlds;

import java.util.Iterator;

import com.alicode.game.dogedash.Assets;
import com.alicode.game.dogedash.DogeDashCore;
import com.alicode.game.dogedash.GamePoints;
import com.alicode.game.dogedash.Statics;
import com.alicode.game.dogedash.models.Background;
import com.alicode.game.dogedash.models.Bush;
import com.alicode.game.dogedash.models.DogeBiscuit;
import com.alicode.game.dogedash.models.DogeCoin;
import com.alicode.game.dogedash.models.DogeCostumes;
import com.alicode.game.dogedash.models.DogeOnHitEffect;
import com.alicode.game.dogedash.models.Flower;
import com.alicode.game.dogedash.models.MotherDoge;
import com.alicode.game.dogedash.models.Puppy;
import com.alicode.game.dogedash.models.enemies.EnemyBee;
import com.alicode.game.dogedash.models.enemies.EnemyLog;
import com.alicode.game.dogedash.models.enemies.EnemyMud;
import com.alicode.game.dogedash.models.enemies.EnemyPuddle;
import com.alicode.game.dogedash.utils.txt.FPSLogger;
import com.alicode.game.dogedash.utils.txt.GameScore;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.TimeUtils;

public class WorldOne extends Table {

	private Background background, background2;
	private MotherDoge motherDoge;
	private DogeCostumes dogeCostumes;
//	private FPSLogger fpsLog;
	private GameScore gamePoints;

	private Group backgroundGroup;
	private Group onGroundGroup;
	private Group inBetweenGroup;
	private Group floatingGroup;

	private Array<Puppy> puppies;
	private Array<Flower> flowers;
	private Array<Bush> bushes;
	private Array<DogeCoin> dogeCoins;
	private Array<DogeBiscuit> dogeBiscuits;
	private Array<DogeOnHitEffect> dogeOnHitEffects;

	private Array<EnemyBee> enemyBees;
	private Array<EnemyMud> enemyMuds;
	private Array<EnemyPuddle> enemyPuddles;
	private Array<EnemyLog> enemyLogs;

	private long enemyDelta, flowerDelta, puppyDelta, bushDelta, enemyLogDelta, enemyPuddleDelta, enemyMudDelta, dogeCoinDelta, dogeBiscuitDelta;
	private float puppyRespawnTime, puppyRespawnCooldown;
	private float enemyRespawnTime, enemyRespawnCooldown;
	private float flowerRespawnTime, flowerRespawnCooldown;
	private float bushRespawnTime, bushRespawnCooldown;
	private float enemyMudRespawnTime, enemyMudRespawnCooldown;
	private float enemyPuddleRespawnTime, enemyPuddleRespawnCooldown;
	private float enemyLogRespawnTime, enemyLogRespawnCooldown;
	private float dogeCoinRespawnTime, dogeCoinRespawnCooldown;
	private float dogeBiscuitRespawnTime, dogeBiscuitRespawnCooldown;

	private int levelEnemyLimit;

	public WorldOne() {
		setBounds(0, 0, 800, 480);
		setClip(true);

		background = new Background(0, 0);
		background2 = new Background(Assets.bg_big_day.getWidth(), 0);
		motherDoge = new MotherDoge();
		dogeCostumes = new DogeCostumes();

		puppies = new Array<Puppy>();
		flowers = new Array<Flower>();
		bushes = new Array<Bush>();

		dogeCoins = new Array<DogeCoin>();
		dogeBiscuits = new Array<DogeBiscuit>();
		dogeOnHitEffects = new Array<DogeOnHitEffect>();

		enemyBees = new Array<EnemyBee>();
		enemyLogs = new Array<EnemyLog>();
		enemyPuddles = new Array<EnemyPuddle>();
		enemyMuds = new Array<EnemyMud>();

		backgroundGroup = new Group();
		onGroundGroup = new Group();
		inBetweenGroup = new Group();
		floatingGroup = new Group();

//		fpsLog = new FPSLogger();
		gamePoints = new GameScore();

		addActor(backgroundGroup);
		addActor(onGroundGroup);
		addActor(inBetweenGroup);
		addActor(floatingGroup);
//		addActor(fpsLog);
		addActor(gamePoints);

		backgroundGroup.addActor(background);
		backgroundGroup.addActor(background2);

		floatingGroup.addActor(motherDoge);
		floatingGroup.addActor(dogeCostumes);

		puppyRespawnCooldown = 5000000000f;
		enemyRespawnCooldown = 2000000000f;
		flowerRespawnCooldown = 900000000f;
		bushRespawnCooldown = 30000000000f;
		dogeCoinRespawnCooldown = 20000000000f;
		dogeBiscuitRespawnCooldown = 10000000000f;

		enemyLogRespawnCooldown = 4000000000f;
		enemyMudRespawnCooldown = 3000000000f;
		enemyPuddleRespawnCooldown = 10000000000f;

		switch (Statics.gameLevelDifficulty) {
		case 1:
			levelEnemyLimit = Statics.easyMaxEnemies;
			break;
		case 2:
			levelEnemyLimit = Statics.normalMaxEnemies;
			break;
		case 3:
			levelEnemyLimit = Statics.hardMaxEnemies;
			break;
		}

	}

	@Override
	public void act(float delta) {
		super.act(delta);

		if (Statics.state == Statics.GameState.Running) {
			updateRespawnTimes();
			GamePoints.currentScore++;
		}
		updateBees();
		updateFlowers();
		updatePups();
		updateBushes();
		updateEnemyLogs();
		updateEnemyMuds();
		updateEnemyPuddles();
		updateDogeCoins();
		updateDogeBiscuits();

	}

	private void updateRespawnTimes() {
		if (GamePoints.finalScore() > 500) {
			enemyRespawnCooldown = 2000000000f / 2;
			GamePoints.currentScore++;
		}
		if (GamePoints.finalScore() > 5000) {
			enemyRespawnCooldown = 2000000000f / 3;
			GamePoints.currentScore++;
		}
		if (GamePoints.finalScore() > 8000) {
			enemyRespawnCooldown = 2000000000f / 4;
			GamePoints.currentScore++;
		}
		if (GamePoints.finalScore() > 10000) {
			enemyRespawnCooldown = 2000000000f / 5;
			GamePoints.currentScore++;
		}
		if (GamePoints.finalScore() > 100000) {
			enemyRespawnCooldown = 2000000000f / 6;
			GamePoints.currentScore++;
		}
		if (GamePoints.finalScore() > 1000000) {
			enemyRespawnCooldown = 2000000000f / 7;
			GamePoints.currentScore++;
		}

		enemyRespawnTime = TimeUtils.nanoTime() - enemyDelta;
		puppyRespawnTime = TimeUtils.nanoTime() - puppyDelta;
		flowerRespawnTime = TimeUtils.nanoTime() - flowerDelta;
		bushRespawnTime = TimeUtils.nanoTime() - bushDelta;
		enemyLogRespawnTime = TimeUtils.nanoTime() - enemyLogDelta;
		enemyPuddleRespawnTime = TimeUtils.nanoTime() - enemyPuddleDelta;
		enemyMudRespawnTime = TimeUtils.nanoTime() - enemyMudDelta;
		dogeCoinRespawnTime = TimeUtils.nanoTime() - dogeCoinDelta;
		dogeBiscuitRespawnTime = TimeUtils.nanoTime() - dogeBiscuitDelta;

		if (enemyRespawnTime > enemyRespawnCooldown) {
			spawnBee();
		}

		if (puppyRespawnTime > puppyRespawnCooldown) {
			spawnPup();
		}
		if (flowerRespawnTime > flowerRespawnCooldown) {
			spawnFlower();
		}

		if (bushRespawnTime > bushRespawnCooldown) {
			spawnBush();
		}

//		if (enemyLogRespawnTime > enemyLogRespawnCooldown) {
//			spawnLog();
//		}

		if (enemyMudRespawnTime > enemyMudRespawnCooldown) {
			spawnMud();
		}

		if (enemyPuddleRespawnTime > enemyPuddleRespawnCooldown) {
			spawnPuddle();
		}

		if (dogeCoinRespawnTime > dogeCoinRespawnCooldown) {
			spawnDogeCoin();
		}
//		if (dogeBiscuitRespawnTime > dogeBiscuitRespawnCooldown) {
//			spawnDogeBiscuit();
//		}

	}

	private void updateDogeBiscuits() {
		Iterator<DogeBiscuit> dCoinIter = dogeBiscuits.iterator();

		while (dCoinIter.hasNext()) {
			DogeBiscuit dogeBiscuit = dCoinIter.next();
			if (dogeBiscuit.getBounds().x + dogeBiscuit.getWidth() < 0) {
				dogeBiscuit.disposeTrail();
				dCoinIter.remove();
				removeActor(dogeBiscuit);

			}
			if (dogeBiscuit.getBounds().overlaps(motherDoge.getBounds())) {
				dCoinIter.remove();
				dogeBiscuit.playerHit();

			}
		}

	}

	private void updateDogeCoins() {
		Iterator<DogeCoin> dCoinIter = dogeCoins.iterator();

		while (dCoinIter.hasNext()) {
			DogeCoin dogeCoin = dCoinIter.next();
			if (dogeCoin.getBounds().x + dogeCoin.getWidth() < 0) {
				dogeCoin.disposeTrail();
				dCoinIter.remove();
				removeActor(dogeCoin);

			}
			if (dogeCoin.getBounds().overlaps(motherDoge.getBounds())) {
				dCoinIter.remove();
				dogeCoin.playerHit();

			}
		}
	}

	private void updateEnemyPuddles() {
		Iterator<EnemyPuddle> logIter = enemyPuddles.iterator();

		while (logIter.hasNext()) {
			EnemyPuddle enemyPuddle = logIter.next();
			if (enemyPuddle.getBounds().x + enemyPuddle.getWidth() < 0) {
				logIter.remove();
				removeActor(enemyPuddle);
				GamePoints.puppyMissedNum++;
			}
			if (enemyPuddle.getBounds().overlaps(motherDoge.getBounds())) {
				if (!Statics.playerJump) {
					if (enemyPuddle.getX() > motherDoge.getX()) {
						if (enemyPuddle.getY() > motherDoge.getY())
							enemyPuddle.playerHit(true, true);
						else
							enemyPuddle.playerHit(true, false);
					} else {
						if (enemyPuddle.getY() > motherDoge.getY())
							enemyPuddle.playerHit(false, true);
						else
							enemyPuddle.playerHit(false, false);
					}

				}
				if (Statics.playerJump) {
					spawnDogeSwag();
				}
				if (Statics.isSuperD) {
					logIter.remove();
				}
			}

		}

	}

	private void updateEnemyMuds() {
		Iterator<EnemyMud> logIter = enemyMuds.iterator();

		while (logIter.hasNext()) {
			EnemyMud enemyMud = logIter.next();
			if (enemyMud.getBounds().x + enemyMud.getWidth() < 0) {
				logIter.remove();
				removeActor(enemyMud);
			}
			if (enemyMud.getBounds().overlaps(motherDoge.getBounds())) {
				if (!Statics.playerJump) {
					spawnDogePow();
					if (enemyMud.getX() > motherDoge.getX()) {
						if (enemyMud.getY() > motherDoge.getY())
							enemyMud.playerHit(true, true);
						else
							enemyMud.playerHit(true, false);
					} else {
						if (enemyMud.getY() > motherDoge.getY())
							enemyMud.playerHit(false, true);
						else
							enemyMud.playerHit(false, false);
					}
				}
				if (Statics.playerJump) {
					spawnDogeSwag();
				}
				if (Statics.isSuperD)
					logIter.remove();
			}
		}

	}

	private void updateEnemyLogs() {
		Iterator<EnemyLog> logIter = enemyLogs.iterator();

		while (logIter.hasNext()) {
			EnemyLog enemyLog = logIter.next();
			if (enemyLog.getBounds().x + enemyLog.getWidth() < 0) {
				logIter.remove();
				removeActor(enemyLog);
				// Gdx.app.log(DogeDashCore.LOG, "enemyLogs " + enemyLogs.size);
			}
			if (enemyLog.getBounds().overlaps(motherDoge.getBounds())) {
				if (!Statics.playerJump) {
					spawnDogePow();
					if (enemyLog.getX() > motherDoge.getX()) {
						if (enemyLog.getY() > motherDoge.getY())
							enemyLog.playerHit(true, true);
						else
							enemyLog.playerHit(true, false);
					} else {
						if (enemyLog.getY() > motherDoge.getY())
							enemyLog.playerHit(false, true);
						else
							enemyLog.playerHit(false, false);
					}
				}
				if (Statics.playerJump) {
					spawnDogeSwag();
				}
				if (Statics.isSuperD)
					logIter.remove();
			}
		}

	}

	private void updateBees() {
		Iterator<EnemyBee> beeIter = enemyBees.iterator();
		while (beeIter.hasNext()) {
			EnemyBee enemyBee = beeIter.next();
			if (enemyBee.getBounds().x + enemyBee.getWidth() < 0) {
				beeIter.remove();
				removeActor(enemyBee);
			}
			if (enemyBee.getBounds().overlaps(motherDoge.getBounds())) {
				if (!Statics.playerJump && !Statics.playerHitByBee) {
					beeIter.remove();
					spawnDogePow();
					floatingGroup.addActor(enemyBee);
					inBetweenGroup.removeActor(enemyBee);
					if (enemyBee.getX() > motherDoge.getX()) {
						if (enemyBee.getY() > motherDoge.getY())
							enemyBee.playerHit(true, true);
						else
							enemyBee.playerHit(true, false);
					} else {
						if (enemyBee.getY() > motherDoge.getY())
							enemyBee.playerHit(false, true);
						else
							enemyBee.playerHit(false, false);
					}
				}
				if (Statics.playerJump) {
					spawnDogeSwag();
				}
			}

		}

	}

	private void updateFlowers() {
		Iterator<Flower> flowerIter = flowers.iterator();
		while (flowerIter.hasNext()) {
			Flower flower = flowerIter.next();
			flower.setZIndex(2);
			if (flower.getBounds().x + flower.getWidth() <= 0) {
				flowerIter.remove();
				removeActor(flower);
			}
		}

	}

	private void updatePups() {
		Iterator<Puppy> iter = puppies.iterator();
		while (iter.hasNext()) {
			Puppy puppy = iter.next();

			if (puppy.getBounds().x + puppy.getWidth() <= 0) {
				iter.remove();
				removeActor(puppy);
			}
			if (puppy.getBounds().overlaps(motherDoge.getBounds()) && !Statics.playerJump) {
				iter.remove();

				GamePoints.puppyCaughtNum++;
				puppy.playerHit();

			}
		}

	}

	private void updateBushes() {
		Iterator<Bush> iter = bushes.iterator();
		while (iter.hasNext()) {
			Bush bush = iter.next();
			if (bush.getBounds().x + bush.getWidth() <= 0) {
				iter.remove();
				removeActor(bush);
			}
			if (bush.getBounds().overlaps(motherDoge.getBounds())) {
				if (!Statics.playerJump) {
					if (bush.getX() > motherDoge.getX()) {
						if (bush.getY() > motherDoge.getY())
							bush.playerHit(true, true);
						else
							bush.playerHit(true, false);
					} else {
						if (bush.getY() > motherDoge.getY())
							bush.playerHit(false, true);
						else
							bush.playerHit(false, false);
					}
				}
			}
		}

	}

	private void spawnDogeSwag() {
		if (!Statics.playerGotSwag) {
			DogeOnHitEffect dogeOnHitEffect = new DogeOnHitEffect(MotherDoge.playerX + Assets.character.getRegionHeight(), MotherDoge.playerY + Assets.character.getRegionWidth());
			dogeOnHitEffects.add(dogeOnHitEffect);
			dogeOnHitEffect.playerGotSwag();
			floatingGroup.addActor(dogeOnHitEffect);
		}
	}

	private void spawnDogePow() {
		if (!Statics.playerGotPow) {
			DogeOnHitEffect dogeOnHitEffect = new DogeOnHitEffect(MotherDoge.playerX + Assets.character.getRegionHeight(), MotherDoge.playerY + Assets.character.getRegionWidth());
			dogeOnHitEffects.add(dogeOnHitEffect);
			dogeOnHitEffect.playerGotHit();
			floatingGroup.addActor(dogeOnHitEffect);
		}
	}

	private void spawnDogeBiscuit() {
		float yPos = 0 + (int) (Math.random() * 460);
		DogeBiscuit dogeBiscuit = new DogeBiscuit(getWidth() + yPos*2, yPos);
		dogeBiscuits.add(dogeBiscuit);
		inBetweenGroup.addActor(dogeBiscuit);
		dogeBiscuitDelta = TimeUtils.nanoTime();

	}

	private void spawnDogeCoin() {
		float yPos = 0 + (int) (Math.random() * 460);
		DogeCoin dogeCoin = new DogeCoin(getWidth() + yPos*2, yPos);
		dogeCoins.add(dogeCoin);
		inBetweenGroup.addActor(dogeCoin);
		dogeCoinDelta = TimeUtils.nanoTime();

	}

	private void spawnFlower() {
		float yPos = 0 + (int) (Math.random() * 460);
		Flower flower = new Flower(getWidth() + yPos*2, yPos);
		flowers.add(flower);
		backgroundGroup.addActor(flower);
		flowerDelta = TimeUtils.nanoTime();

	}

	private void spawnBush() {
		float yPos = 0 + (int) (Math.random() * 460);
		Bush bush = new Bush(getWidth() + yPos*2, yPos);
		bushes.add(bush);
		floatingGroup.addActor(bush);
		bushDelta = TimeUtils.nanoTime();

	}

	private void spawnPup() {
		float yPos = 10 + (int) (Math.random() * 460);
		Puppy puppy = new Puppy(getWidth() + yPos*2, yPos);
		puppies.add(puppy);
		inBetweenGroup.addActor(puppy);
		puppyDelta = TimeUtils.nanoTime();

	}

	private void spawnBee() {
		Statics.enemySpeed+=0.05;
		if (enemyBees.size <= levelEnemyLimit) {
			float yPos = 0 + (int) (Math.random() * 460);

			EnemyBee enemyBee = new EnemyBee(getWidth() + yPos*2, yPos);
			enemyBees.add(enemyBee);
			inBetweenGroup.addActor(enemyBee);
			enemyDelta = TimeUtils.nanoTime();
		}
	}

	private void spawnPuddle() {
		float yPos = 0 + (int) (Math.random() * 460);
		EnemyPuddle enemyPuddle = new EnemyPuddle(getWidth() + yPos*2, yPos);
		enemyPuddles.add(enemyPuddle);
		onGroundGroup.addActor(enemyPuddle);
		enemyPuddleDelta = TimeUtils.nanoTime();

	}

	private void spawnMud() {
		float yPos = 0 + (int) (Math.random() * 460);
		EnemyMud enemyMud = new EnemyMud(getWidth() + yPos*2, yPos);
		enemyMuds.add(enemyMud);
		onGroundGroup.addActor(enemyMud);
		enemyMudDelta = TimeUtils.nanoTime();

	}

	private void spawnLog() {
		float yPos = 0 + (int) (Math.random() * 460);
		EnemyLog enemyLog = new EnemyLog(getWidth() + yPos*2, yPos);
		enemyLogs.add(enemyLog);
		inBetweenGroup.addActor(enemyLog);
		enemyLogDelta = TimeUtils.nanoTime();

	}

	public Array<EnemyBee> getEnemyBees() {
		return enemyBees;
	}

	public void setEnemyBees(Array<EnemyBee> enemyBees) {
		this.enemyBees = enemyBees;
	}

	public MotherDoge getMotherDoge() {
		return motherDoge;
	}

	public void setMotherDoge(MotherDoge motherDoge) {
		this.motherDoge = motherDoge;
	}

	public DogeCostumes getDogeCostumes() {
		return dogeCostumes;
	}

	public void setDogeCostumes(DogeCostumes dogeCostumes) {
		this.dogeCostumes = dogeCostumes;
	}

}


text:
<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more contributor license agreements. See the NOTICE file ~
    distributed with this work for additional information ~ regarding copyright ownership. The ASF licenses this file ~ to you under
    the Apache License, Version 2.0 (the ~ "License"); you may not use this file except in compliance ~ with the License. You may obtain
    a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing,
    ~ software distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~ KIND, either
    express or implied. See the License for the ~ specific language governing permissions and limitations ~ under the License. -->
<serviceGroup name="Builtin">
    <service name="Version">
        <module ref="simpleModule" />
        <description> This service is to get the running Axis version
        </description>
        <parameter name="ServiceClass">org.apache.axis2.osgi.service.Version</parameter>
    </service>
</serviceGroup>


text:
<!doctype html>

<title>CodeMirror: TTCN mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">

CodeMirror

Home

Manual

Code

Language modes

TTCN

TTCN example

        <textarea id="ttcn-code">
module Templates {
  /* import types from ASN.1 */
  import from Types language "ASN.1:1997" all;

  /* During the conversion phase from ASN.1 to TTCN-3 */
  /* - the minus sign (Message-Type) within the identifiers will be replaced by underscore (Message_Type)*/
  /* - the ASN.1 identifiers matching a TTCN-3 keyword (objid) will be postfixed with an underscore (objid_)*/

  // simple types

  template SenderID localObjid := objid {itu_t(0) identified_organization(4) etsi(0)};

  // complex types

  /* ASN.1 Message-Type mapped to TTCN-3 Message_Type */
  template Message receiveMsg(template (present) Message_Type p_messageType) := {
    header := p_messageType,
    body := ?
  }

  /* ASN.1 objid mapped to TTCN-3 objid_ */
  template Message sendInviteMsg := {
      header := inviteType,
      body := {
        /* optional fields may be assigned by omit or may be ignored/skipped */
        description := "Invite Message",
        data := 'FF'O,
        objid_ := localObjid
      }
  }

  template Message sendAcceptMsg modifies sendInviteMsg := {
      header := acceptType,
      body := {
        description := "Accept Message"
      }
    };

  template Message sendErrorMsg modifies sendInviteMsg := {
      header := errorType,
      body := {
        description := "Error Message"
      }
    };

  template Message expectedErrorMsg := {
      header := errorType,
      body := ?
    };

  template Message expectedInviteMsg modifies expectedErrorMsg := {
      header := inviteType
    };

  template Message expectedAcceptMsg modifies expectedErrorMsg := {
      header := acceptType
    };

} with { encode "BER:1997" }
        </textarea>

Language: Testing and Test Control Notation
        (TTCN)

MIME types defined: text/x-ttcn,
        text/x-ttcn3, text/x-ttcnpp.

The development of this mode has been sponsored by Ericsson
    .

Coded by Asmelash Tsegay Gebretsadkan


text:
Version 1 - 02/05/2016

Shutter pour vidéoprojecteur, commandé via OSC (IP statique) et permettant de contrôler jusqu'à 4 servomoteurs.
Le service OSC est annoncé sur le réseau via le protocole Bonjour/Zeroconf.
Le shutter dispose d'une interface web permettant d'afficher l'état des différents services (SD, OSC, Bonjour), les messages séries, modifier la configuration via un formulaire et uploader des fichiers textes sur la carte SD.

A noter qu'il est également possible d'uploader des fichiers sur la carte SD via un script bash ou MSDOS.
## Installation des bibliothèques

Les bibliothèques contenues dans le dossier libraries sont à installer dans le dossier contenant les bibliothèques Arduino en suivant la procédure officielle : [Installer une Librairie](https://www.arduino.cc/en/Guide/Libraries)

## Liste des dépendances

Certaines librairies du projet ont besoin de bibliothèques externes pour fonctionner :
* shutterBonjour : [Bonjour/Zeroconf](http://gkaindl.com/software/arduino-ethernet/bonjour) Cette bibliothèque nécessite la modification de la bibliothèque arduino [EthernetUdp](http://forum.arduino.cc/index.php?topic=234340.0)
* shutterJSON : [ArduinoJson](https://github.com/bblanchon/ArduinoJson/)
* shutterOSC : [Oscuino](https://github.com/CNMAT/OSC)
* shutterWebserver : [TinyWebServer](https://github.com/ovidiucp/TinyWebServer)

## Configuration hardware testée

* Micro-contrôleur :
	* [Arduino M0 Pro](http://www.arduino.org/products/boards/4-arduino-boards/arduino-m0-pro)
	* [Arduino Zero](http://www.arduino.cc/en/Main/ArduinoBoardZero)

* Shield ethernet :
	* [Neuftech® Ethernet shield module W5100 avec module Micro SD](http://www.amazon.fr/dp/B00PQA6G8O/ref=sr_ph?ie=UTF8&qid=1456398408&sr=1&keywords=neuftech)
* Servomoteur :
	* [Microservo tower pro SG90](http://boutique.semageek.com/fr/104-micro-servo-tower-pro-sg90.html)

* LED :
	* [LED RVB à anode commune](http://boutique.semageek.com/fr/62-led-rgb-transparente-5mm.html)

## Liste de course recommandée

* Arduino : Arduino M0 (ou zero) Pro
	* Recommandé (le petit frère du Pro qui n'embarque pas de puce de débug) [semageek](http://boutique.semageek.com/fr/574-arduino-m0-8058333491806.html)
	* Sur [selectronic](http://www.selectronic.fr/carte-arduino-zero-pro.html)
	* Sur [lextronic](http://www.lextronic.fr/P35395-arduino-m0-pro.html)

* Shield Ethernet :
	* Sur [Amazon](https://www.amazon.fr/Neuftech%C2%AE-Ethernet-Shield-Module-Arduino/dp/B00PQA6G8O)

* Servomoteur : J'utilise des SG90, à vous de voir en fonction de vos besoins en terme de couple, de vitesse et d'angle de rotation. A noter que les servomoteurs sont alimentés par le 5V de l'arduino, si vous voulez utiliser des servomoteurs plus puissant il faudra passer sur une alimentation extérieure. De plus le boîtier servomoteur est conçu pour la forme des SG90
	* Sur [semageek](http://boutique.semageek.com/fr/104-micro-servo-tower-pro-sg90.html)

* Led RGB : (A anode commune)
	* Sur [Semageek](http://boutique.semageek.com/fr/62-led-rgb-transparente-5mm.html)

* Embase ethernet : pour les boîtier (4 pour le boîtier principal et 1 par boîtier servomoteur) :
	* Sur [gotronic](http://www.gotronic.fr/art-embase-ci-srt8-8b-4924.htm)

* Des fils pour les connexions (privilégier le multi-brins) :
	* Sur [gotronix](http://www.gotronic.fr/art-assortiment-fcs60-5211.htm)
	* Sur [selectronic](http://www.selectronic.fr/assortiment-de-fil-de-cablage-0-2mm-mono-brin.html)

* Bloc d'alimentation :
	* Sur [semageek](http://boutique.semageek.com/fr/370-alimentation-arduino-9v-660ma-jack-21mm.html)
	* Sur [amazon](https://www.amazon.fr/Aukru-Universel-Alimentation-adaptateur-chargeur/dp/B00MVLJ6NI)

## Câblage ##
* La LED de notification utilisée est une LED RVB à anode commune. L'anode est à connectée sur le 3.3V de l'arduino et les cathodes R, V et B sont à brancher respectivement sur les pins 11, 12 et 13 de l'arduino.
* Les servomoteurs sont à brancher sur les pins 2, 3, 6 et 7 et sur le 5V et le GND de l'arduino.

## Mise en route

* Connecter le câble ethernet
* Vérifier que la carte SD est bien insérée et contient bien le fichier de configuration **"config.txt"**
* Brancher l'alimentation du shutter
* A la fin de l'initialisation la LED de notification est verte et clignote une fois
* Il est possible de brancher un câble USB pour avoir les informations de débug par liaison série (115200 baud)

## Code couleur de la LED de notification

La LED de notification est soit :
* rouge : Il y a eu une erreur critique qui empêche l'exécution normale du programme. Typiquement une erreur au niveau de la carte SD ou du réseau. Le système se bloque, vous trouverez plus d'informations en branchant un câble USB pour lire le retour série ou consulter le fichier log.txt sur la carte SD.
* bleu : Il y a eu une erreur mais non critique. Le programme continue son exécution. Typiquement une erreur dans le protocole Bonjour ou une erreur de lecture / écriture de fichiers non critique. Vous trouverez plus d'information en branchant un câble USB ou encore sur la partie console du webserver ou dans le fichier log.txt sur la carte SD.
* vert : Tout va bien, le système fonctionne correctement.

## Lire les retours série de l'arduino

### Linux et Mac Os

Utiliser la commande `screen` qui est installée par défaut sur les versions récentes de Mac OS et certaines distributions de Linux.

Dans le cas contraire, installer `screen` à l'aide du gestionnaire de paquet propre à votre distribution :
* [ArchLinux](https://wiki.archlinux.org/index.php/GNU_Screen)
* [Debian](https://wiki.debian.org/fr/Screen)
* [Ubuntu](https://doc.ubuntu-fr.org/screen)

Ouvrir le terminal et lancer `screen /dev/cu.usbmodem1411 9600`

Pour quitter `screen` appuyer sur **CTRL-A**

### Windows ###

Utiliser [PuTTY](http://www.putty.org/)

## Structure du fichier de Configuration
Le fichier de configuration utilise le formalisme JSON.

Liste des paramètres :

* "date_fichier_config" : paramètre indicatif, n'est pas utilisé par le shutter
* "shutter_verbosite_level" : indique le niveau de verbosité des messages séries. Les diférents niveaux disponibles sont :
	* 0 (ERROR) uniquement les messages d'erreurs
	* 1 (INFO) les messages d'erreurs et les informations principales
	* 2 (STACK) les messages d'erreurs, d'informations et les noms des fonctions appelées
	* 3 (DEBUG) l'intégralité des messages
* "shutter_control_Mode" : le mode de pilotage du shutter, pour le moment seul le mode osc est disponible
* "shutter_osc_Ip" : l'adresse IPV4 du shutter
* "shutter_osc_Port" : le port utilisé par le shutter pour la communication OSC
* "master_osc_Ip" : l'adresse IPV4 du master. Quelque soit l'interlocuteur le shutter réponds uniquement au master
* "master_osc_Port" : le port utilisé par le master pour la communication OSC,
* "shutter_osc_Mac" : l'adresse MAC utilisée par le shield éthernet
* "shutter_bonjour_name" : identifiant bonjour **de moins de 50 caractères**
* "shutter_servo_nombre" : nombre de servomoteur à activer, compris entre 1 et 4
* "shutter_http_server_activate" : activation du serveur web

Exemple de fichier de configuration

`{
	"date_fichier_config" : "26/02/16",
	"shutter_verbosite_level" : 1,
	"shutter_control_Mode" : "OSC" ,
	"shutter_osc_Ip" : "192.168.0.90",
	"shutter_osc_Port" : 8000,
	"master_osc_Ip" : "192.168.0.50",
	"master_osc_Port" : 9000,
	"shutter_osc_Mac" : "0xDE:0xAD:0xBE:0xEF:0xFE:0xED",
	"shutter_bonjour_name" : "AMshutter 01",
	"shutter_servo_nombre" : 1,
	"shutter_http_server_activate" : 1
}
`
## Glossaire des trames ##

* i/shutter_on
	* Mets le servomoteur i en position de travail (cache devant la lentille)
* i/shutter_off
	* Mets le servomoteur i en position de repos (cache relevé)

* i/shutter_position
	* Envoie une demande de position au servomoteur i qui renvoie sa position sur la liaison série et renvoie i/label_position position et i/shutter_move position (utilisé pour mettre à jour le fader et le label dans touchOSC)

* i/shutter_move (float)
	* Envoie une demande de déplacement au servomoteur i : le float est compris entre 0(min) et 100(max)

* /shutter_reboot
	* Reboot le shutter

* /shutter_runservotest
	* Chaque servomoteur actif est mis en position de travail puis en position de repos

* /shutter_ping
	* Le shutter renvoie /shutter_pong

## Liens intéressants

* http://trippylighting.com/teensy-arduino-ect/touchosc-and-arduino-oscuino/
* https://www.nickv.codes/blog/arduino-osc-iphone-and-dmx/
* https://skyduino.wordpress.com/2012/06/19/arduino-charger-un-fichier-de-configuration-depuis-une-carte-sd/
* http://www.dns-sd.org/ServiceTypes.html
* http://tutorialzine.com/2014/06/10-tips-for-writing-javascript-without-jquery/
* http://blog.garstasio.com/you-dont-need-jquery/ajax/
* http://starter-kit.nettigo.eu/2015/debug-sketch-on-arduino-zero-pro-with-gdb-and-openocd/
* http://jsonviewer.stack.hu/

## Contact

pyrotecnix - contact@magicofthings.fr


text:
var appControllers = angular.module('appControllers');

appControllers.controller('artistsCtrl', ['$scope', '$routeParams', 'categoriesService', 'usersService', 'authService', function ($scope, $routeParams, categoriesService, usersService, authService) {
	//
	// NEED TO CHECK IF USER IS LOGGED
	//
	_authentication = authService.authentication;
	$scope.isAdmin = (_authentication.info!=undefined) &&
            (_authentication.info.user!=undefined) &&
            (_authentication.info.user.role == 1);

    //
    // Get current user
    //
    $scope.curUser = (_authentication.info!=undefined) && (_authentication.info.user!=undefined) ? _authentication.info.user : null;

    //
    // Set if list is editable
    //
    $scope.editable = $scope.isAdmin;

    //
    // Set loggedin status
    //
    $scope.loggedIn = _authentication.isAuth;

	//
	// INIT FUNCTION
	//
	var _init = function(){
		if ($routeParams.id){
			_getArtistsFromCat($routeParams.id);
		}else{
			_getNetworks();
			_getArtistsIds();
		}
	}

	//
	// ARTISTS SERVICES
	//
	var _getArtistsFromCat = function(catId){
		categoriesService.get(catId).then(function(data){
			$scope.cat = data
			$scope.artists = $scope.cat.users;
		},function(error, status){

		});
	}

	var _getArtistsIds = function(){
		usersService.list().then(function(data){
			$scope.artists = data;
		},function(error, status){

		});

	}

	var _getNetworks = function(){
		$scope.networks = [
			{
				name: 'facebook',
			},
			{
				name: 'twitter',
			},
			{
				name: 'google-plus',
			}
		];
	}

	//
	// Handle delete
	//
	$scope.deleteUser = function(artist){

		usersService.delete(artist.id).then(function(data){
			toastr.success('Utilizador eliminado', '' ,{ timeOut: 5000 });
			artist.status = 0;
		},function(error, status){
			toastr.error(error.err.message, '' ,{ timeOut: 5000 });
		});
	}

	_init();
}]);

appControllers.controller('artistDetailsCtrl', ['$scope', '$routeParams', '$location', 'usersService', 'authService', function ($scope, $routeParams, $location, usersService, authService) {
	//
	// NEED TO CHECK IF USER IS LOGGED
	//
	_authentication = authService.authentication;
	$scope.isAdmin = (_authentication.info!=undefined) &&
            (_authentication.info.user!=undefined) &&
            (_authentication.info.user.role == 1);

    //
    // Set loggedin status
    //
    $scope.loggedIn = _authentication.isAuth;

    //
    // Get current user
    //
    $scope.curUser = (_authentication.info!=undefined) && (_authentication.info.user!=undefined) ? _authentication.info.user : null;

	//
	// INIT FUNCTION
	//
	var _init = function(){
		if ($routeParams.id){
			_getArtist($routeParams.id);
			_getMoreArtists($routeParams.id);

		// Get data from logged user
		}else{
			_getLoggedArtist();
			//_getMoreArtists();
		}
	}

	//
	// ARTISTS SERVICES
	//
	var _getArtist = function(id){
		usersService.get(id).then(function(data){
			$scope.artist = data;
		},function(error, status){
			$location.path("/");
			toastr.error(error.err.message, '' ,{ timeOut: 5000 });

		});
	}

	var _getLoggedArtist = function(){

		if (authService.authentication.info!=undefined){
			var id = authService.authentication.info.user.id;
			usersService.get(id).then(function(data){
				$scope.artist = data;
			},function(error, status){
				$location.path("/");
				toastr.error(error.err.message, '' ,{ timeOut: 5000 });
			});
		}else{
			$location.path("/");

		}
	}

	var _getMoreArtists = function(id){
		usersService.getAfter(id).then(function(data){
			$scope.otherArtists = data;
		},function(error, status){
			toastr.error(error.err.message, '' ,{ timeOut: 5000 });
		});
	}

	//
	// Handle delete
	//
	$scope.deleteUser = function(e, artist){
		e.preventDefault();
		e.stopPropagation();

		usersService.delete(artist.id).then(function(data){
			toastr.success('Utilizador eliminado', '' ,{ timeOut: 5000 });
			artist.status = 0;
			$location.path("/artists");
		},function(error, status){
			toastr.error(error.err.message, '' ,{ timeOut: 5000 });
		});
	}

	_init();

}]);


text:
def lib():
  return "/Users/douglasl/projects/dummy/Panda-setRamImage-problem/build/libar.dylib"


text:
from .function import function
from .scan import scan
from .sharedvalue import shared


text:
package org.openqa.selenium.internal.selenesedriver;

import com.thoughtworks.selenium.Selenium;

import org.openqa.selenium.WebDriverException;

import java.util.Map;

public class SubmitElement extends ElementFunction<Void> {

  public Void apply(Selenium selenium, Map<String, ?> args) {
    String locator = getLocator(args).replace("'", "\\'");

    String eval = submitJs.replace("LOCATOR", locator);

    String result = selenium.getEval(eval);

    if (!"true".equals(result)) {
      throw new WebDriverException(result);
    }

    // Turns out that on Firefox, the load may not have started. Rest for a very
    // short time to let it being.
    sleep(100);

    return null;
  }

  private void sleep(long timeout) {
    try {
      Thread.sleep(timeout);
    } catch (InterruptedException e) {
      throw new WebDriverException(e);
    }
  }

  private final String submitJs =
      "(function submit() { "
          + "var curr = selenium.browserbot.findElement('LOCATOR'); "
          + "while (curr != null && curr.tagName != 'FORM') {"
          + "  curr = curr.parentNode || curr.parentElement; "
          + "} "
          + "if (curr) { curr.submit(); return 'true'; } "
          + "return 'false'; "
          + "})()";
}


text:
package main

import (
	"fmt"

	"github.com/gophertrain/trainctl/cmd"
)

var Version string

func main() {
	fmt.Printf("trainctl %s\n", Version)
	cmd.Execute()
}


text:
// Copyright 2020 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mediapipe/calculators/util/collection_has_min_size_calculator.h"

#include <memory>
#include <string>
#include <vector>

#include "mediapipe/framework/calculator_framework.h"
#include "mediapipe/framework/calculator_runner.h"
#include "mediapipe/framework/port/gmock.h"
#include "mediapipe/framework/port/gtest.h"
#include "mediapipe/framework/port/parse_text_proto.h"
#include "mediapipe/framework/port/status_matchers.h"  // NOLINT

namespace mediapipe {

constexpr char kIterableTag[] = "ITERABLE";

typedef CollectionHasMinSizeCalculator<std::vector<int>>
    TestIntCollectionHasMinSizeCalculator;
REGISTER_CALCULATOR(TestIntCollectionHasMinSizeCalculator);

void AddInputVector(const std::vector<int>& input, int64 timestamp,
                    CalculatorRunner* runner) {
  runner->MutableInputs()
      ->Tag(kIterableTag)
      .packets.push_back(
          MakePacket<std::vector<int>>(input).At(Timestamp(timestamp)));
}

TEST(TestIntCollectionHasMinSizeCalculator, DoesHaveMinSize) {
  CalculatorGraphConfig::Node node_config =
      ParseTextProtoOrDie<CalculatorGraphConfig::Node>(R"pb(
        calculator: "TestIntCollectionHasMinSizeCalculator"
        input_stream: "ITERABLE:input_vector"
        output_stream: "output_vector"
        options {
          [mediapipe.CollectionHasMinSizeCalculatorOptions.ext] { min_size: 2 }
        }
      )pb");
  CalculatorRunner runner(node_config);
  const std::vector<Packet>& outputs = runner.Outputs().Index(0).packets;

  AddInputVector({1, 2}, /*timestamp=*/1, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(1, outputs.size());
  EXPECT_EQ(Timestamp(1), outputs[0].Timestamp());
  EXPECT_TRUE(outputs[0].Get<bool>());

  AddInputVector({1, 2, 3}, /*timestamp=*/2, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(2, outputs.size());
  EXPECT_EQ(Timestamp(2), outputs[1].Timestamp());
  EXPECT_TRUE(outputs[1].Get<bool>());
}

TEST(TestIntCollectionHasMinSizeCalculator,
     DoesHaveMinSize_MinSizeAsSidePacket) {
  CalculatorGraphConfig::Node node_config =
      ParseTextProtoOrDie<CalculatorGraphConfig::Node>(R"pb(
        calculator: "TestIntCollectionHasMinSizeCalculator"
        input_stream: "ITERABLE:input_vector"
        input_side_packet: "min_size"
        output_stream: "output_vector"
      )pb");
  CalculatorRunner runner(node_config);
  const std::vector<Packet>& outputs = runner.Outputs().Index(0).packets;

  runner.MutableSidePackets()->Index(0) = MakePacket<int>(2);

  AddInputVector({1, 2}, /*timestamp=*/1, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(1, outputs.size());
  EXPECT_EQ(Timestamp(1), outputs[0].Timestamp());
  EXPECT_TRUE(outputs[0].Get<bool>());

  AddInputVector({1, 2, 3}, /*timestamp=*/2, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(2, outputs.size());
  EXPECT_EQ(Timestamp(2), outputs[1].Timestamp());
  EXPECT_TRUE(outputs[1].Get<bool>());
}

TEST(TestIntCollectionHasMinSizeCalculator, DoesNotHaveMinSize) {
  CalculatorGraphConfig::Node node_config =
      ParseTextProtoOrDie<CalculatorGraphConfig::Node>(R"pb(
        calculator: "TestIntCollectionHasMinSizeCalculator"
        input_stream: "ITERABLE:input_vector"
        output_stream: "output_vector"
        options {
          [mediapipe.CollectionHasMinSizeCalculatorOptions.ext] { min_size: 3 }
        }
      )pb");
  CalculatorRunner runner(node_config);
  const std::vector<Packet>& outputs = runner.Outputs().Index(0).packets;

  AddInputVector({1}, /*timestamp=*/1, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(1, outputs.size());
  EXPECT_EQ(Timestamp(1), outputs[0].Timestamp());
  EXPECT_FALSE(outputs[0].Get<bool>());

  AddInputVector({1, 2}, /*timestamp=*/2, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(2, outputs.size());
  EXPECT_EQ(Timestamp(2), outputs[1].Timestamp());
  EXPECT_FALSE(outputs[1].Get<bool>());
}

TEST(TestIntCollectionHasMinSizeCalculator,
     DoesNotHaveMinSize_MinSizeAsSidePacket) {
  CalculatorGraphConfig::Node node_config =
      ParseTextProtoOrDie<CalculatorGraphConfig::Node>(R"pb(
        calculator: "TestIntCollectionHasMinSizeCalculator"
        input_stream: "ITERABLE:input_vector"
        input_side_packet: "min_size"
        output_stream: "output_vector"
      )pb");
  CalculatorRunner runner(node_config);
  const std::vector<Packet>& outputs = runner.Outputs().Index(0).packets;

  runner.MutableSidePackets()->Index(0) = MakePacket<int>(3);

  AddInputVector({1}, /*timestamp=*/1, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(1, outputs.size());
  EXPECT_EQ(Timestamp(1), outputs[0].Timestamp());
  EXPECT_FALSE(outputs[0].Get<bool>());

  AddInputVector({1, 2}, /*timestamp=*/2, &runner);
  MP_ASSERT_OK(runner.Run());

  EXPECT_EQ(2, outputs.size());
  EXPECT_EQ(Timestamp(2), outputs[1].Timestamp());
  EXPECT_FALSE(outputs[1].Get<bool>());
}

}  // namespace mediapipe


text:
package kr.pe.kingori.ihatecolor;

import android.content.Context;
import kr.pe.kingori.ihatecolor.util.FontManager;

public class Application extends android.app.Application {

    public static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        FontManager.init(this);
        context = this;
    }
}


text:
package com.xiaobai.polestar.scheduleconsole.jobs;

import com.xiaobai.polestar.scheduleconsole.constants.Constants;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Title.
 * <p/>
 * Description.
 *
 * @author Bill Lv {@literal <billcc.lv@hotmail.com>}
 * @version 1.0
 * @since 2015-10-17
 */
public class CommandJob implements Job {
    static final Logger LOGGER = LoggerFactory.getLogger(CommandJob.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // TODO: execute shell script
        final String script = (String) context.getJobDetail().getJobDataMap().get(Constants.COMMAND);
        LOGGER.info("executing shell script {}", script);
    }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Hangman</title>
  <link rel="icon" href="favicon.ico?ver=2">
  <meta name="description" content="Dictionary Hangman game">
  <meta name="keywords" content="Hangman, game, dictionary, play, words, react, javascript">
  <meta name="author" content="Thusitha Manathunga">
  <link rel="manifest" href="/manifest.json">
  <link href="https://fonts.googleapis.com/css?family=Quicksand|Pacifico" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1">


text:
cs109a-project
==============================

Predicting Loan Outcomes using Machine Learning

Summary
-------

This was our final project for the Fall 2016 class of CS109A - Introduction to Data Science (Harvard). The framework below was based on the cookiecutter data science project template.

* *Final project website:* [https://quinnlee.github.io/cs109a-Project/](https://quinnlee.github.io/cs109a-Project/)

* *Download the data:* Get the data from [https://www.kaggle.com/wendykan/lending-club-loan-data](https://www.kaggle.com/wendykan/lending-club-loan-data). Move `loan.csv` to `/data/raw/lending-club-loan-data/`

* *To replicate the main analysis:* Run `jupyter notebook` to launch notebooks. Use `notebooks/Final-project.ipynb` for the complete model.

* *Other info:* `src/data` has the code we used to clean the data.  Other notebooks in the `/notebooks/` can be used to follow exploratory data analysis, draft visualizations, and the baseline model.

-----------------------------------------------------------------
How to install -- Depricated
--------------

* Python - 2.7.10
* virtualenv

OSX:

* run `make create_environment`
* run `workon cs109a-Predicting_loan_outcomes`

Project Organization
------------

    ├── LICENSE
    ├── Makefile           <- Makefile with commands like `make data` or `make train`
    ├── README.md          <- The top-level README for developers using this project.
    ├── data
    │   ├── external       <- Data from third party sources.
    │   ├── interim        <- Intermediate data that has been transformed.
    │   ├── processed      <- The final, canonical data sets for modeling.
    │   └── raw            <- The original, immutable data dump.
    │
    ├── docs               <- A default Sphinx project; see sphinx-doc.org for details
    │
    ├── models             <- Trained and serialized models, model predictions, or model summaries
    │
    ├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
    │                         the creator's initials, and a short `-` delimited description, e.g.
    │                         `1.0-jqp-initial-data-exploration`.
    │
    ├── references         <- Data dictionaries, manuals, and all other explanatory materials.
    │
    ├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
    │   └── figures        <- Generated graphics and figures to be used in reporting
    │
    ├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
    │                         generated with `pip freeze > requirements.txt`
    │
    ├── src                <- Source code for use in this project.
    │   ├── __init__.py    <- Makes src a Python module
    │   │
    │   ├── data           <- Scripts to download or generate data
    │   │   └── make_dataset.py
    │   │
    │   ├── features       <- Scripts to turn raw data into features for modeling
    │   │   └── build_features.py
    │   │
    │   ├── models         <- Scripts to train models and then use trained models to make
    │   │   │                 predictions
    │   │   ├── predict_model.py
    │   │   └── train_model.py
    │   │
    │   └── visualization  <- Scripts to create exploratory and results oriented visualizations
    │       └── visualize.py
    │
    └── tox.ini            <- tox file with settings for running tox; see tox.testrun.org


text:
body, div {
    font-family: Helvetica
}


text:
/**
 * Module dependencies.
 */

var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var holamundo = require('./routes/holamundo')

var app = express();

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);
app.get('/users', user.list);
app.get('/holamundo',holamundo.holamundo);
app.get('/holamundo2',routes.holamundo2);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});


text:
import {
  START_LOADING,
  END_LOADING,
  START_ADDING,
  END_ADDING,
  START_EDITING,
  END_EDITING
} from './action-types';

const DEFAULT_STATE = {
  loading: false,
  adding: false,
  editing: false
};

export default (state = DEFAULT_STATE, action = {}) => {
  switch (action.type) {
    case START_LOADING:
      return {
        ...state,
        loading: true
      };
    case END_LOADING:
      return {
        ...state,
        loading: false
      };
    case START_ADDING:
      return {
        ...state,
        adding: true
      };
    case END_ADDING:
      return {
        ...state,
        adding: false
      };
    case START_EDITING:
      return {
        ...state,
        editing: true
      };
    case END_EDITING:
      return {
        ...state,
        editing: false
      };
    default:
      return state;
  }
};


text:
#include "D3D11BuiltinShaderFactory.h"
#include "Builtin/D3D11Builtin.h"
#include "../../DXCommon/DXCore.h"
#include "../../DXCommon/DXTypes.h"
#include <stdexcept>

namespace LLGL
{

D3D11BuiltinShaderFactory& D3D11BuiltinShaderFactory::Get()
{
    static D3D11BuiltinShaderFactory instance;
    return instance;
}

void D3D11BuiltinShaderFactory::CreateBuiltinShaders(ID3D11Device* device)
{
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyTexture1DFromBufferCS, LLGL_IDR_D3D11_COPYTEXTURE1DFROMBUFFER_CS);
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyTexture2DFromBufferCS, LLGL_IDR_D3D11_COPYTEXTURE2DFROMBUFFER_CS);
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyTexture3DFromBufferCS, LLGL_IDR_D3D11_COPYTEXTURE3DFROMBUFFER_CS);
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyBufferFromTexture1DCS, LLGL_IDR_D3D11_COPYBUFFERFROMTEXTURE1D_CS);
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyBufferFromTexture2DCS, LLGL_IDR_D3D11_COPYBUFFERFROMTEXTURE2D_CS);
    LoadBuiltinShader(device, D3D11BuiltinShader::CopyBufferFromTexture3DCS, LLGL_IDR_D3D11_COPYBUFFERFROMTEXTURE3D_CS);
}

void D3D11BuiltinShaderFactory::Clear()
{
    for (auto& native : builtinShaders_)
        native.vs = nullptr;
}

const D3D11NativeShader& D3D11BuiltinShaderFactory::GetBulitinShader(const D3D11BuiltinShader builtin) const
{
    const auto idx = static_cast<std::size_t>(builtin);
    if (idx < D3D11BuiltinShaderFactory::g_numBuiltinShaders)
        return builtinShaders_[idx];
    else
        return builtinShaders_[0];
}

static ShaderType GetBuiltinShaderType(const D3D11BuiltinShader builtin)
{
    switch (builtin)
    {
        case D3D11BuiltinShader::CopyTexture1DFromBufferCS:
        case D3D11BuiltinShader::CopyTexture2DFromBufferCS:
        case D3D11BuiltinShader::CopyTexture3DFromBufferCS:
        case D3D11BuiltinShader::CopyBufferFromTexture1DCS:
        case D3D11BuiltinShader::CopyBufferFromTexture2DCS:
        case D3D11BuiltinShader::CopyBufferFromTexture3DCS:
            return ShaderType::Compute;
    }
    return ShaderType::Undefined;
}

void D3D11BuiltinShaderFactory::LoadBuiltinShader(ID3D11Device* device, const D3D11BuiltinShader builtin, int resourceID)
{
    if (auto blob = DXCreateBlobFromResource(resourceID))
    {
        const auto idx = static_cast<std::size_t>(builtin);
        builtinShaders_[idx] = D3D11Shader::CreateNativeShaderFromBlob(device, GetBuiltinShaderType(builtin), blob.Get());
    }
    else
        throw std::runtime_error("failed to load builtin D3D11 shader resource");
}

} // /namespace LLGL

// ================================================================================


text:
package com.lab.epam.service;

import com.lab.epam.dao.PersistException;
import com.lab.epam.dao.imp.MySqlPlaceDao;
import com.lab.epam.entity.FavoritePlacesByRating;
import com.lab.epam.entity.Place;
import com.lab.epam.helper.ClassName;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import java.sql.Connection;
import java.util.List;

/**
 * Created by Admin on 12.06.2015.
 */
public class PlaceService {

    MySqlPlaceDao mySqlPlaceDao = new MySqlPlaceDao();
    private static final Logger loger = LogManager.getLogger(ClassName.getCurrentClassName());

    public void create(Place object) {
        try {
            mySqlPlaceDao.create(object);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
    }

    public void create(Connection conn, Place object) {
        try {
            mySqlPlaceDao.create(conn, object);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
    }

    public Place getByPK(Integer key) {
        Place place = null;
        try {
            place = mySqlPlaceDao.getByPK(key);
            ;

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
        return place;
    }

    public void update(Place object) {
        try {
            mySqlPlaceDao.update(object);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
    }

    public void delete(Place object) {
        try {
            mySqlPlaceDao.delete(object);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
    }

    public List<Place> getAll() {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getAll();
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }
        return places;
    }

    public List<Place> getAllWithoutDeleted() {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getAllWithoutDeleted();
            ;

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }

        return places;
    }

    public List<Place> getPlaceByCategory(Integer category_id) {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getPlaceByCategory(category_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }

        return places;
    }

    public List<Place> getPlaceByCategoryRecomended(Integer category_id) {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getPlaceByCategoryRecomended(category_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }

        return places;
    }

    public List<Place> getAllPlaceVisible() {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getAllPlaceVisible();

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }

        return places;
    }

    public List<Place> getAllPlaceRecomended() {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getAllPlaceRecomended();

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all places");
        }

        return places;
    }

    public List<Place> getPlaceByUserId(Integer user_id) {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getPlaceByUserId(user_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get place by user with id " + user_id);
        }

        return places;
    }

    public List<Place> getPlaceByWayId(Integer way_id) {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getPlaceByWayId(way_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get place by way with id " + way_id);
        }

        return places;
    }

    public List<Place> getPlaceByWayIdDayNumber(Integer way_id, Integer day_number) {
        List<Place> places = null;
        try {
            places = mySqlPlaceDao.getPlaceByWayIdDayNumber(way_id, day_number);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get place by way with id " + way_id + " " + day_number + " day_number");
        }

        return places;
    }

    public void deletePlaceByUserIdPlaceId(Integer user_id, Integer place_id) {
        try {
            mySqlPlaceDao.deletePlaceByUserIdPlaceId(user_id, place_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant delet way by user_id = " + user_id + " place_id " + place_id);
        }
    }

    public Place getPlaceByLongitudeLatitude(String longitude, String latitude) {
        Place place = null;
        try {
            place = mySqlPlaceDao.getPlaceByLongitudeLatitude(longitude, latitude);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get place with longitude " + longitude + " and latitude " + latitude);
        }

        return place;
    }

    public Place getPlaceByLongitudeLatitude(Connection conn, String longitude, String latitude) {
        Place place = null;
        try {
            place = mySqlPlaceDao.getPlaceByLongitudeLatitude(conn, longitude, latitude);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get place with longitude " + longitude + " and latitude " + latitude);
        }

        return place;
    }

    public void createPlaceWay(Integer place_id, Integer way_id, Integer day, Integer time) {
        try {
            mySqlPlaceDao.createPlaceWay(place_id, way_id, day, time);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant create place_way with place_id = " + place_id + " way_id " + way_id + " day " + day);
        }
    }

    public void createPlaceWay(Connection conn, Integer place_id, Integer way_id, Integer day, Integer time) {
        try {
            mySqlPlaceDao.createPlaceWay(conn, place_id, way_id, day, time);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant create place_way with place_id = " + place_id + " way_id " + way_id + " day " + day);
        }
    }

    public void createPlaceUser(Integer place_id, Integer user_id) {
        try {
            mySqlPlaceDao.createPlaceUser(place_id, user_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant create user_place with user_id = " + user_id + " place_id " + place_id);
        }
    }

    public Integer getPlaceByUserIdPlaceId(Integer place_id, Integer user_id) {
        Integer id = null;
        try {
            id = mySqlPlaceDao.getPlaceByUserIdPlaceId(place_id, user_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get user_place id with place_id " + place_id + " and user_id " + user_id);
        }

        return id;
    }

    public void deletePlaceByWayIdPlaceId(Integer way_id, Integer place_id, Integer day_number) {
        try {
            mySqlPlaceDao.deletePlaceByWayIdPlaceId(way_id, place_id, day_number);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant delet place_way by way_id = " + way_id + " place_id " + place_id);
        }
    }

    public void deletePlaceByWayIdDayNumber(Integer way_id, Integer day_number) {
        try {
            mySqlPlaceDao.deletePlaceByWayIdDayNumber(way_id, day_number);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant delet place_way by way_id = " + way_id + " day_number " + day_number);
        }
    }

    public Integer createAndReturnIndex(Place place) {
        return mySqlPlaceDao.createAndReturnIndex(place);
    }

    public List<Place> getAllVisbleUserCustomPlace(Integer usedID) {
        List<Place> list = null;
        try {
            list = mySqlPlaceDao.getAllVisibleUserCustomPlace(usedID);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant find user custom places");
        }
        return list;
    }

    public List<Place> getAllVisbleUserFavorPlace(Integer usedID) {
        List<Place> list = null;
        try {
            list = mySqlPlaceDao.getAllVisibleUserFavorPlace(usedID);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant find user custom places");
        }
        return list;
    }

    public List<FavoritePlacesByRating> getPlacesByRating() {
        List<FavoritePlacesByRating> placeRating = null;
        try {
            placeRating = mySqlPlaceDao.getPlacesByRating();
        } catch (PersistException e) {
            e.printStackTrace();
        }
        return placeRating;
    }

    public void setPlaceIsRecommended(Integer place_id) {
        try {
            mySqlPlaceDao.setPlaceIsRecommended(place_id);

        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant set is_recommended by place_id " + place_id);
        }
    }

    public List<Place> getAllConfirmCustomPlace() {
        List<Place> list = null;
        try {
            list = mySqlPlaceDao.getAllConfirmCustomPlace();
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant find user custom places");
        }
        return list;
    }

    public List<Place> getAllConfirmRecommendedPlace() {
        List<Place> list = null;
        try {
            list = mySqlPlaceDao.getAllConfirmRecommendedPlace();
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant find user Recommended places");
        }
        return list;
    }

    public Integer getCheckCustomEditID(Integer loginedUserID, Integer editPlaceID) {
        Integer id = 0;
        try {
            id = mySqlPlaceDao.getCheckCustomEditID(loginedUserID, editPlaceID);
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant find user Recommended places");
        }
        return id;
    }

    public List<Place> getAllDeletedPlace() {
        List<Place> list = null;
        try {
            list = mySqlPlaceDao.getAllDeletedPlace();
        } catch (PersistException e) {
            e.printStackTrace();
            loger.warn("Cant get all deleted place");
        }
        return list;
    }
}


text:
/*
 * PortableTypes.hpp
 *
 *  Created on: Mar 14, 2013
 *      Author: bholdaway
 */

#ifndef PORTABLE_TYPES_HPP_
#define PORTABLE_TYPES_HPP_

#include <stdint.h>

typedef int32_t  Int32;
typedef int16_t  Int16;
typedef int8_t   Int8;
typedef uint32_t UInt32;
typedef uint16_t UInt16;
typedef uint8_t  UInt8;
typedef float Float32;
typedef double Float64;

#endif /* PORTABLE_TYPES_HPP_ */


text:
using namespace csapex;
using namespace csapex::connection_types;

namespace csapex
{
class PointCloudToXYZ : public Node
{
public:
    PointCloudToXYZ()
    {
    }

    void setupParameters(Parameterizable& parameters) override
    {
    }

    void setup(csapex::NodeModifier& node_modifier) override
    {
        input_ = node_modifier.addInput<PointCloudMessage>("PointCloud");

        output_ = node_modifier.addOutput<PointCloudMessage>("XYZ");
    }

    void process() override
    {
        PointCloudMessage::ConstPtr msg(msg::getMessage<PointCloudMessage>(input_));

        boost::apply_visitor(PointCloudMessage::Dispatch<PointCloudToXYZ>(this, msg), msg->value);
    }

    template <typename PointT>
    void inputCloud(const typename pcl::PointCloud<PointT>::ConstPtr& cloud)
    {
        pcl::PointCloud<pcl::PointXYZ>::Ptr result(new pcl::PointCloud<pcl::PointXYZ>);
        pcl::copyPointCloud(*cloud, *result);

        PointCloudMessage::Ptr output(new PointCloudMessage(cloud->header.frame_id, cloud->header.stamp));
        output->value = result;
        msg::publish(output_, output);
    }

private:
    Input* input_;
    Output* output_;
};

}  // namespace csapex

CSAPEX_REGISTER_CLASS(csapex::PointCloudToXYZ, csapex::Node)


text:
package vault

import (
	"crypto/aes"
	"crypto/cipher"
	"crypto/rand"
	"crypto/subtle"
	"encoding/binary"
	"fmt"
	"strings"
	"sync"
	"time"

	"github.com/armon/go-metrics"
	"github.com/hashicorp/vault/helper/jsonutil"
	"github.com/hashicorp/vault/physical"
)

const (
	// initialKeyTerm is the hard coded initial key term. This is
	// used only for values that are not encrypted with the keyring.
	initialKeyTerm = 1

	// termSize the number of bytes used for the key term.
	termSize = 4
)

// Versions of the AESGCM storage methodology
const (
	AESGCMVersion1 = 0x1
	AESGCMVersion2 = 0x2
)

// barrierInit is the JSON encoded value stored
type barrierInit struct {
	Version int    // Version is the current format version
	Key     []byte // Key is the primary encryption key
}

// AESGCMBarrier is a SecurityBarrier implementation that uses the AES
// cipher core and the Galois Counter Mode block mode. It defaults to
// the golang NONCE default value of 12 and a key size of 256
// bit. AES-GCM is high performance, and provides both confidentiality
// and integrity.
type AESGCMBarrier struct {
	backend physical.Backend

	l      sync.RWMutex
	sealed bool

	// keyring is used to maintain all of the encryption keys, including
	// the active key used for encryption, but also prior keys to allow
	// decryption of keys encrypted under previous terms.
	keyring *Keyring

	// cache is used to reduce the number of AEAD constructions we do
	cache     map[uint32]cipher.AEAD
	cacheLock sync.RWMutex

	// currentAESGCMVersionByte is prefixed to a message to allow for
	// future versioning of barrier implementations. It's var instead
	// of const to allow for testing
	currentAESGCMVersionByte byte
}

// NewAESGCMBarrier is used to construct a new barrier that uses
// the provided physical backend for storage.
func NewAESGCMBarrier(physical physical.Backend) (*AESGCMBarrier, error) {
	b := &AESGCMBarrier{
		backend: physical,
		sealed:  true,
		cache:   make(map[uint32]cipher.AEAD),
		currentAESGCMVersionByte: byte(AESGCMVersion2),
	}
	return b, nil
}

// Initialized checks if the barrier has been initialized
// and has a master key set.
func (b *AESGCMBarrier) Initialized() (bool, error) {
	// Read the keyring file
	out, err := b.backend.Get(keyringPath)
	if err != nil {
		return false, fmt.Errorf("failed to check for initialization: %v", err)
	}
	if out != nil {
		return true, nil
	}

	// Fallback, check for the old sentinel file
	out, err = b.backend.Get(barrierInitPath)
	if err != nil {
		return false, fmt.Errorf("failed to check for initialization: %v", err)
	}
	return out != nil, nil
}

// Initialize works only if the barrier has not been initialized
// and makes use of the given master key.
func (b *AESGCMBarrier) Initialize(key []byte) error {
	// Verify the key size
	min, max := b.KeyLength()
	if len(key) < min || len(key) > max {
		return fmt.Errorf("Key size must be %d or %d", min, max)
	}

	// Check if already initialized
	if alreadyInit, err := b.Initialized(); err != nil {
		return err
	} else if alreadyInit {
		return ErrBarrierAlreadyInit
	}

	// Generate encryption key
	encrypt, err := b.GenerateKey()
	if err != nil {
		return fmt.Errorf("failed to generate encryption key: %v", err)
	}

	// Create a new keyring, install the keys
	keyring := NewKeyring()
	keyring = keyring.SetMasterKey(key)
	keyring, err = keyring.AddKey(&Key{
		Term:    1,
		Version: 1,
		Value:   encrypt,
	})
	if err != nil {
		return fmt.Errorf("failed to create keyring: %v", err)
	}
	return b.persistKeyring(keyring)
}

// persistKeyring is used to write out the keyring using the
// master key to encrypt it.
func (b *AESGCMBarrier) persistKeyring(keyring *Keyring) error {
	// Create the keyring entry
	keyringBuf, err := keyring.Serialize()
	defer memzero(keyringBuf)
	if err != nil {
		return fmt.Errorf("failed to serialize keyring: %v", err)
	}

	// Create the AES-GCM
	gcm, err := b.aeadFromKey(keyring.MasterKey())
	if err != nil {
		return err
	}

	// Encrypt the barrier init value
	value := b.encrypt(keyringPath, initialKeyTerm, gcm, keyringBuf)

	// Create the keyring physical entry
	pe := &physical.Entry{
		Key:   keyringPath,
		Value: value,
	}
	if err := b.backend.Put(pe); err != nil {
		return fmt.Errorf("failed to persist keyring: %v", err)
	}

	// Serialize the master key value
	key := &Key{
		Term:    1,
		Version: 1,
		Value:   keyring.MasterKey(),
	}
	keyBuf, err := key.Serialize()
	defer memzero(keyBuf)
	if err != nil {
		return fmt.Errorf("failed to serialize master key: %v", err)
	}

	// Encrypt the master key
	activeKey := keyring.ActiveKey()
	aead, err := b.aeadFromKey(activeKey.Value)
	if err != nil {
		return err
	}
	value = b.encrypt(masterKeyPath, activeKey.Term, aead, keyBuf)

	// Update the masterKeyPath for standby instances
	pe = &physical.Entry{
		Key:   masterKeyPath,
		Value: value,
	}
	if err := b.backend.Put(pe); err != nil {
		return fmt.Errorf("failed to persist master key: %v", err)
	}
	return nil
}

// GenerateKey is used to generate a new key
func (b *AESGCMBarrier) GenerateKey() ([]byte, error) {
	// Generate a 256bit key
	buf := make([]byte, 2*aes.BlockSize)
	_, err := rand.Read(buf)
	return buf, err
}

// KeyLength is used to sanity check a key
func (b *AESGCMBarrier) KeyLength() (int, int) {
	return aes.BlockSize, 2 * aes.BlockSize
}

// Sealed checks if the barrier has been unlocked yet. The Barrier
// is not expected to be able to perform any CRUD until it is unsealed.
func (b *AESGCMBarrier) Sealed() (bool, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	return b.sealed, nil
}

// VerifyMaster is used to check if the given key matches the master key
func (b *AESGCMBarrier) VerifyMaster(key []byte) error {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return ErrBarrierSealed
	}
	if subtle.ConstantTimeCompare(key, b.keyring.MasterKey()) != 1 {
		return ErrBarrierInvalidKey
	}
	return nil
}

// ReloadKeyring is used to re-read the underlying keyring.
// This is used for HA deployments to ensure the latest keyring
// is present in the leader.
func (b *AESGCMBarrier) ReloadKeyring() error {
	b.l.Lock()
	defer b.l.Unlock()

	// Create the AES-GCM
	gcm, err := b.aeadFromKey(b.keyring.MasterKey())
	if err != nil {
		return err
	}

	// Read in the keyring
	out, err := b.backend.Get(keyringPath)
	if err != nil {
		return fmt.Errorf("failed to check for keyring: %v", err)
	}

	// Ensure that the keyring exists. This should never happen,
	// and indicates something really bad has happened.
	if out == nil {
		return fmt.Errorf("keyring unexpectedly missing")
	}

	// Decrypt the barrier init key
	plain, err := b.decrypt(keyringPath, gcm, out.Value)
	defer memzero(plain)
	if err != nil {
		if strings.Contains(err.Error(), "message authentication failed") {
			return ErrBarrierInvalidKey
		}
		return err
	}

	// Recover the keyring
	keyring, err := DeserializeKeyring(plain)
	if err != nil {
		return fmt.Errorf("keyring deserialization failed: %v", err)
	}

	// Setup the keyring and finish
	b.keyring = keyring
	return nil
}

// ReloadMasterKey is used to re-read the underlying masterkey.
// This is used for HA deployments to ensure the latest master key
// is available for keyring reloading.
func (b *AESGCMBarrier) ReloadMasterKey() error {
	// Read the masterKeyPath upgrade
	out, err := b.Get(masterKeyPath)
	if err != nil {
		return fmt.Errorf("failed to read master key path: %v", err)
	}

	// The masterKeyPath could be missing (backwards incompatible),
	// we can ignore this and attempt to make progress with the current
	// master key.
	if out == nil {
		return nil
	}

	defer memzero(out.Value)

	// Deserialize the master key
	key, err := DeserializeKey(out.Value)
	if err != nil {
		return fmt.Errorf("failed to deserialize key: %v", err)
	}

	b.l.Lock()
	defer b.l.Unlock()

	// Check if the master key is the same
	if subtle.ConstantTimeCompare(b.keyring.MasterKey(), key.Value) == 1 {
		return nil
	}

	// Update the master key
	oldKeyring := b.keyring
	b.keyring = b.keyring.SetMasterKey(key.Value)
	oldKeyring.Zeroize(false)
	return nil
}

// Unseal is used to provide the master key which permits the barrier
// to be unsealed. If the key is not correct, the barrier remains sealed.
func (b *AESGCMBarrier) Unseal(key []byte) error {
	b.l.Lock()
	defer b.l.Unlock()

	// Do nothing if already unsealed
	if !b.sealed {
		return nil
	}

	// Create the AES-GCM
	gcm, err := b.aeadFromKey(key)
	if err != nil {
		return err
	}

	// Read in the keyring
	out, err := b.backend.Get(keyringPath)
	if err != nil {
		return fmt.Errorf("failed to check for keyring: %v", err)
	}
	if out != nil {
		// Decrypt the barrier init key
		plain, err := b.decrypt(keyringPath, gcm, out.Value)
		defer memzero(plain)
		if err != nil {
			if strings.Contains(err.Error(), "message authentication failed") {
				return ErrBarrierInvalidKey
			}
			return err
		}

		// Recover the keyring
		keyring, err := DeserializeKeyring(plain)
		if err != nil {
			return fmt.Errorf("keyring deserialization failed: %v", err)
		}

		// Setup the keyring and finish
		b.keyring = keyring
		b.sealed = false
		return nil
	}

	// Read the barrier initialization key
	out, err = b.backend.Get(barrierInitPath)
	if err != nil {
		return fmt.Errorf("failed to check for initialization: %v", err)
	}
	if out == nil {
		return ErrBarrierNotInit
	}

	// Decrypt the barrier init key
	plain, err := b.decrypt(barrierInitPath, gcm, out.Value)
	if err != nil {
		if strings.Contains(err.Error(), "message authentication failed") {
			return ErrBarrierInvalidKey
		}
		return err
	}
	defer memzero(plain)

	// Unmarshal the barrier init
	var init barrierInit
	if err := jsonutil.DecodeJSON(plain, &init); err != nil {
		return fmt.Errorf("failed to unmarshal barrier init file")
	}

	// Setup a new keyring, this is for backwards compatibility
	keyringNew := NewKeyring()
	keyring := keyringNew.SetMasterKey(key)

	// AddKey reuses the master, so we are only zeroizing after this call
	defer keyringNew.Zeroize(false)

	keyring, err = keyring.AddKey(&Key{
		Term:    1,
		Version: 1,
		Value:   init.Key,
	})
	if err != nil {
		return fmt.Errorf("failed to create keyring: %v", err)
	}
	if err := b.persistKeyring(keyring); err != nil {
		return err
	}

	// Delete the old barrier entry
	if err := b.backend.Delete(barrierInitPath); err != nil {
		return fmt.Errorf("failed to delete barrier init file: %v", err)
	}

	// Set the vault as unsealed
	b.keyring = keyring
	b.sealed = false
	return nil
}

// Seal is used to re-seal the barrier. This requires the barrier to
// be unsealed again to perform any further operations.
func (b *AESGCMBarrier) Seal() error {
	b.l.Lock()
	defer b.l.Unlock()

	// Remove the primary key, and seal the vault
	b.cache = make(map[uint32]cipher.AEAD)
	b.keyring.Zeroize(true)
	b.keyring = nil
	b.sealed = true
	return nil
}

// Rotate is used to create a new encryption key. All future writes
// should use the new key, while old values should still be decryptable.
func (b *AESGCMBarrier) Rotate() (uint32, error) {
	b.l.Lock()
	defer b.l.Unlock()
	if b.sealed {
		return 0, ErrBarrierSealed
	}

	// Generate a new key
	encrypt, err := b.GenerateKey()
	if err != nil {
		return 0, fmt.Errorf("failed to generate encryption key: %v", err)
	}

	// Get the next term
	term := b.keyring.ActiveTerm()
	newTerm := term + 1

	// Add a new encryption key
	newKeyring, err := b.keyring.AddKey(&Key{
		Term:    newTerm,
		Version: 1,
		Value:   encrypt,
	})
	if err != nil {
		return 0, fmt.Errorf("failed to add new encryption key: %v", err)
	}

	// Persist the new keyring
	if err := b.persistKeyring(newKeyring); err != nil {
		return 0, err
	}

	// Swap the keyrings
	b.keyring = newKeyring
	return newTerm, nil
}

// CreateUpgrade creates an upgrade path key to the given term from the previous term
func (b *AESGCMBarrier) CreateUpgrade(term uint32) error {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return ErrBarrierSealed
	}

	// Get the key for this term
	termKey := b.keyring.TermKey(term)
	buf, err := termKey.Serialize()
	defer memzero(buf)
	if err != nil {
		return err
	}

	// Get the AEAD for the previous term
	prevTerm := term - 1
	primary, err := b.aeadForTerm(prevTerm)
	if err != nil {
		return err
	}

	key := fmt.Sprintf("%s%d", keyringUpgradePrefix, prevTerm)
	value := b.encrypt(key, prevTerm, primary, buf)
	// Create upgrade key
	pe := &physical.Entry{
		Key:   key,
		Value: value,
	}
	return b.backend.Put(pe)
}

// DestroyUpgrade destroys the upgrade path key to the given term
func (b *AESGCMBarrier) DestroyUpgrade(term uint32) error {
	path := fmt.Sprintf("%s%d", keyringUpgradePrefix, term-1)
	return b.Delete(path)
}

// CheckUpgrade looks for an upgrade to the current term and installs it
func (b *AESGCMBarrier) CheckUpgrade() (bool, uint32, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return false, 0, ErrBarrierSealed
	}

	// Get the current term
	activeTerm := b.keyring.ActiveTerm()

	// Check for an upgrade key
	upgrade := fmt.Sprintf("%s%d", keyringUpgradePrefix, activeTerm)
	entry, err := b.Get(upgrade)
	if err != nil {
		return false, 0, err
	}

	// Nothing to do if no upgrade
	if entry == nil {
		return false, 0, nil
	}

	defer memzero(entry.Value)

	// Deserialize the key
	key, err := DeserializeKey(entry.Value)
	if err != nil {
		return false, 0, err
	}

	// Upgrade from read lock to write lock
	b.l.RUnlock()
	defer b.l.RLock()
	b.l.Lock()
	defer b.l.Unlock()

	// Update the keyring
	newKeyring, err := b.keyring.AddKey(key)
	if err != nil {
		return false, 0, fmt.Errorf("failed to add new encryption key: %v", err)
	}
	b.keyring = newKeyring

	// Done!
	return true, key.Term, nil
}

// ActiveKeyInfo is used to inform details about the active key
func (b *AESGCMBarrier) ActiveKeyInfo() (*KeyInfo, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	// Determine the key install time
	term := b.keyring.ActiveTerm()
	key := b.keyring.TermKey(term)

	// Return the key info
	info := &KeyInfo{
		Term:        int(term),
		InstallTime: key.InstallTime,
	}
	return info, nil
}

// Rekey is used to change the master key used to protect the keyring
func (b *AESGCMBarrier) Rekey(key []byte) error {
	b.l.Lock()
	defer b.l.Unlock()

	newKeyring, err := b.updateMasterKeyCommon(key)
	if err != nil {
		return err
	}

	// Persist the new keyring
	if err := b.persistKeyring(newKeyring); err != nil {
		return err
	}

	// Swap the keyrings
	oldKeyring := b.keyring
	b.keyring = newKeyring
	oldKeyring.Zeroize(false)
	return nil
}

// SetMasterKey updates the keyring's in-memory master key but does not persist
// anything to storage
func (b *AESGCMBarrier) SetMasterKey(key []byte) error {
	b.l.Lock()
	defer b.l.Unlock()

	newKeyring, err := b.updateMasterKeyCommon(key)
	if err != nil {
		return err
	}

	// Swap the keyrings
	oldKeyring := b.keyring
	b.keyring = newKeyring
	oldKeyring.Zeroize(false)
	return nil
}

// Performs common tasks related to updating the master key; note that the lock
// must be held before calling this function
func (b *AESGCMBarrier) updateMasterKeyCommon(key []byte) (*Keyring, error) {
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	// Verify the key size
	min, max := b.KeyLength()
	if len(key) < min || len(key) > max {
		return nil, fmt.Errorf("Key size must be %d or %d", min, max)
	}

	return b.keyring.SetMasterKey(key), nil
}

// Put is used to insert or update an entry
func (b *AESGCMBarrier) Put(entry *Entry) error {
	defer metrics.MeasureSince([]string{"barrier", "put"}, time.Now())
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return ErrBarrierSealed
	}

	term := b.keyring.ActiveTerm()
	primary, err := b.aeadForTerm(term)
	if err != nil {
		return err
	}

	pe := &physical.Entry{
		Key:   entry.Key,
		Value: b.encrypt(entry.Key, term, primary, entry.Value),
	}
	return b.backend.Put(pe)
}

// Get is used to fetch an entry
func (b *AESGCMBarrier) Get(key string) (*Entry, error) {
	defer metrics.MeasureSince([]string{"barrier", "get"}, time.Now())
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	// Read the key from the backend
	pe, err := b.backend.Get(key)
	if err != nil {
		return nil, err
	} else if pe == nil {
		return nil, nil
	}

	// Decrypt the ciphertext
	plain, err := b.decryptKeyring(key, pe.Value)
	if err != nil {
		return nil, fmt.Errorf("decryption failed: %v", err)
	}

	// Wrap in a logical entry
	entry := &Entry{
		Key:   key,
		Value: plain,
	}
	return entry, nil
}

// Delete is used to permanently delete an entry
func (b *AESGCMBarrier) Delete(key string) error {
	defer metrics.MeasureSince([]string{"barrier", "delete"}, time.Now())
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return ErrBarrierSealed
	}

	return b.backend.Delete(key)
}

// List is used ot list all the keys under a given
// prefix, up to the next prefix.
func (b *AESGCMBarrier) List(prefix string) ([]string, error) {
	defer metrics.MeasureSince([]string{"barrier", "list"}, time.Now())
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	return b.backend.List(prefix)
}

// aeadForTerm returns the AES-GCM AEAD for the given term
func (b *AESGCMBarrier) aeadForTerm(term uint32) (cipher.AEAD, error) {
	// Check for the keyring
	keyring := b.keyring
	if keyring == nil {
		return nil, nil
	}

	// Check the cache for the aead
	b.cacheLock.RLock()
	aead, ok := b.cache[term]
	b.cacheLock.RUnlock()
	if ok {
		return aead, nil
	}

	// Read the underlying key
	key := keyring.TermKey(term)
	if key == nil {
		return nil, nil
	}

	// Create a new aead
	aead, err := b.aeadFromKey(key.Value)
	if err != nil {
		return nil, err
	}

	// Update the cache
	b.cacheLock.Lock()
	b.cache[term] = aead
	b.cacheLock.Unlock()
	return aead, nil
}

// aeadFromKey returns an AES-GCM AEAD using the given key.
func (b *AESGCMBarrier) aeadFromKey(key []byte) (cipher.AEAD, error) {
	// Create the AES cipher
	aesCipher, err := aes.NewCipher(key)
	if err != nil {
		return nil, fmt.Errorf("failed to create cipher: %v", err)
	}

	// Create the GCM mode AEAD
	gcm, err := cipher.NewGCM(aesCipher)
	if err != nil {
		return nil, fmt.Errorf("failed to initialize GCM mode")
	}
	return gcm, nil
}

// encrypt is used to encrypt a value
func (b *AESGCMBarrier) encrypt(path string, term uint32, gcm cipher.AEAD, plain []byte) []byte {
	// Allocate the output buffer with room for tern, version byte,
	// nonce, GCM tag and the plaintext
	capacity := termSize + 1 + gcm.NonceSize() + gcm.Overhead() + len(plain)
	size := termSize + 1 + gcm.NonceSize()
	out := make([]byte, size, capacity)

	// Set the key term
	binary.BigEndian.PutUint32(out[:4], term)

	// Set the version byte
	out[4] = b.currentAESGCMVersionByte

	// Generate a random nonce
	nonce := out[5 : 5+gcm.NonceSize()]
	rand.Read(nonce)

	// Seal the output
	switch b.currentAESGCMVersionByte {
	case AESGCMVersion1:
		out = gcm.Seal(out, nonce, plain, nil)
	case AESGCMVersion2:
		out = gcm.Seal(out, nonce, plain, []byte(path))
	default:
		panic("Unknown AESGCM version")
	}

	return out
}

// decrypt is used to decrypt a value
func (b *AESGCMBarrier) decrypt(path string, gcm cipher.AEAD, cipher []byte) ([]byte, error) {
	// Verify the term is always just one
	term := binary.BigEndian.Uint32(cipher[:4])
	if term != initialKeyTerm {
		return nil, fmt.Errorf("term mis-match")
	}

	// Capture the parts
	nonce := cipher[5 : 5+gcm.NonceSize()]
	raw := cipher[5+gcm.NonceSize():]
	out := make([]byte, 0, len(raw)-gcm.NonceSize())

	// Verify the cipher byte and attempt to open
	switch cipher[4] {
	case AESGCMVersion1:
		return gcm.Open(out, nonce, raw, nil)
	case AESGCMVersion2:
		return gcm.Open(out, nonce, raw, []byte(path))
	default:
		return nil, fmt.Errorf("version bytes mis-match")
	}
}

// decryptKeyring is used to decrypt a value using the keyring
func (b *AESGCMBarrier) decryptKeyring(path string, cipher []byte) ([]byte, error) {
	// Verify the term
	term := binary.BigEndian.Uint32(cipher[:4])

	// Get the GCM by term
	// It is expensive to do this first but it is not a
	// normal case that this won't match
	gcm, err := b.aeadForTerm(term)
	if err != nil {
		return nil, err
	}
	if gcm == nil {
		return nil, fmt.Errorf("no decryption key available for term %d", term)
	}

	nonce := cipher[5 : 5+gcm.NonceSize()]
	raw := cipher[5+gcm.NonceSize():]
	out := make([]byte, 0, len(raw)-gcm.NonceSize())

	// Attempt to open
	switch cipher[4] {
	case AESGCMVersion1:
		return gcm.Open(out, nonce, raw, nil)
	case AESGCMVersion2:
		return gcm.Open(out, nonce, raw, []byte(path))
	default:
		return nil, fmt.Errorf("version bytes mis-match")
	}
}

// Encrypt is used to encrypt in-memory for the BarrierEncryptor interface
func (b *AESGCMBarrier) Encrypt(key string, plaintext []byte) ([]byte, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	term := b.keyring.ActiveTerm()
	primary, err := b.aeadForTerm(term)
	if err != nil {
		return nil, err
	}

	ciphertext := b.encrypt(key, term, primary, plaintext)
	return ciphertext, nil
}

// Decrypt is used to decrypt in-memory for the BarrierEncryptor interface
func (b *AESGCMBarrier) Decrypt(key string, ciphertext []byte) ([]byte, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	// Decrypt the ciphertext
	plain, err := b.decryptKeyring(key, ciphertext)
	if err != nil {
		return nil, fmt.Errorf("decryption failed: %v", err)
	}
	return plain, nil
}

func (b *AESGCMBarrier) Keyring() (*Keyring, error) {
	b.l.RLock()
	defer b.l.RUnlock()
	if b.sealed {
		return nil, ErrBarrierSealed
	}

	return b.keyring.Clone(), nil
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<module codename="org.netbeans.modules.spellchecker.bindings.htmlxml">
    <module_version install_time="1370463730962" last="true" origin="installer" specification_version="1.17.1">
        <file crc="2125152088" name="config/Modules/org-netbeans-modules-spellchecker-bindings-htmlxml.xml"/>
        <file crc="866910451" name="modules/locale/org-netbeans-modules-spellchecker-bindings-htmlxml_ja.jar"/>
        <file crc="4142341112" name="modules/locale/org-netbeans-modules-spellchecker-bindings-htmlxml_pt_BR.jar"/>
        <file crc="1336222367" name="modules/locale/org-netbeans-modules-spellchecker-bindings-htmlxml_ru.jar"/>
        <file crc="2520806447" name="modules/locale/org-netbeans-modules-spellchecker-bindings-htmlxml_zh_CN.jar"/>
        <file crc="3435471709" name="modules/org-netbeans-modules-spellchecker-bindings-htmlxml.jar"/>
    </module_version>
</module>


text:
title: Naujausi Moxa įrankiai bei technologijos (en)
date: 2017-10-02 15:07:00 +03:00
tags:
- naujienos
- moxa
- technologijos
- įrankiai
ref: developments
layout: page
---

Nesuklysime sakydami, jog pramoninių tinklų įranga bei technologijos turėtų palengvinti mūsų gyvenimą, o ne priešingai, jį pasunkinti. Dėja, pramonės inžinieriai bei integratoriai dažnai susiduria su įvairiais iššūkiais bei griežtais reikalavimais.

Todėl Moxa siūlo naujus įrankius bei technologijas, kurie padės išvengti sunkumų.

Sužinokite daugiau apie tai [čia ](http://juka.lt/latest-developments-from-moxa/){:target="_blank"} (anglų kalba).


text:
function getQueryString(url) {
  if (typeof url === "string") {  // safer with type check
    let pos = url.indexOf("?");
    if (pos > -1) {
      return url.substring(pos +1);
    }
  }
  return "";
}