text:
<?php

namespace ihate\ClientBundle\Controller;

use ihate\CoreBundle\Entity\Comment;
use ihate\CoreBundle\Entity\Hate;
use ihate\CoreBundle\Form\Type\CommentType;
use ihate\CoreBundle\Form\Type\HateType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use ihate\CoreBundle\Controller\AdvancedController;
use Symfony\Component\Security\Core\SecurityContext;
use ihate\CoreBundle\Form\Type\PostType;
use ihate\CoreBundle\Form\Type\UserType;
use ihate\CoreBundle\Entity\User;
use ihate\CoreBundle\Entity\Post;
use ihate\CoreBundle\Entity\Country;
use ihate\ClientBundle\Controller\ContentController;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class TopController extends AdvancedController
{
    public function postTopAction()
    {
        $repository = $this->getPostRepository();
        $top = $repository->getPostTop($this->getUser());
        return $this->render(
            'ihateClientBundle:PageStructure:postTop.html.twig',
            array('top' => $top)
        );
    }

    public function userTopAction()
    {
        $repository = $this->getUserRepository();
        $userTop = $repository->getUserTop($this->getUser());
        return $this->render(
            'ihateClientBundle:PageStructure:userTop.html.twig',
            array('userTop' => $userTop)
        );
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>PresidentA</title>
    <meta name="description" content="" />
    <link href="//fonts.googleapis.com/css?family=Noto+Sans:300,400,700" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic" rel="stylesheet" type="text/css">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link href="//arthurmolina.github.io/themes/saga/assets/css/style.css?v=1481811562241" rel="stylesheet" type="text/css">
    <link href="//arthurmolina.github.io/themes/saga/assets/css/animate.min.css?v=1481811562241" rel="stylesheet" type="text/css">
    <link href="https://arthurmolina.github.io/favicon.ico" rel="shortcut icon">
    <link rel="canonical" href="https://arthurmolina.github.io/2011/01/01/PresidentA.html" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="arthurmolina.com blog" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="PresidentA" />
    <meta property="og:description" content="Eu sei que o clima é de festa para a primeira presidentA do BrasiU, mas acontece que estou lendo "O Guia do Mochileiro das Galáxias" do brilhante Douglas Adams (NÃO ENTRE EM PÂNICO!) e tem uma passagem que ele define o que é o presidente do Governo Imperial Galático e" />
    <meta property="og:url" content="https://arthurmolina.github.io/2011/01/01/PresidentA.html" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="PresidentA" />
    <meta name="twitter:description" content="Eu sei que o clima é de festa para a primeira presidentA do BrasiU, mas acontece que estou lendo "O Guia do Mochileiro das Galáxias" do brilhante Douglas Adams (NÃO ENTRE EM PÂNICO!) e tem uma passagem que ele define o que é o presidente do Governo Imperial Galático e" />
    <meta name="twitter:url" content="https://arthurmolina.github.io/2011/01/01/PresidentA.html" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="arthurmolina.com blog" href="https://arthurmolina.github.io/rss/" />

        arthurmolina.com blog
        $DO || !$DO : try<br> try: Commando not found.

PresidentA

         <time class="timesince date" data-timesince="1293850800" datetime="2011-01-01T00:00" title="01 January 2011">6 years ago</time>

             Arthur Molina

Eu sei que o clima é de festa para a primeira presidentA do BrasiU, mas acontece que estou lendo "O Guia do Mochileiro das Galáxias" do brilhante Douglas Adams (NÃO ENTRE EM PÂNICO!) e tem uma passagem que ele define o que é o presidente do Governo Imperial Galático e é de um sarcasmo tão gostoso e sutil que não posso deixar de colocar neste dia tão "importante": Só pra ressaltar que Adams é inglês, mas isso não modifica o sarcasmo com qualquer outro governo.

Presidente: o nome oficial do cargo é presidente do Governo Imperial Galático. O termo Imperial é mantido embora seja atualmente um anacronismo. O imperador hereditário está quase morto, há muitos séculos. Nos últimos instantes de seu coma, ele foi colocado num campo de estase, que o mantém num estado de imutabilidade perpétua. Todo os seus herdeiros já morreram há muito tempo, o que significa que, sem ter havido nenhuma grande convulsão política, o centro do poder foi deslocado de forma simples e eficaz para escalões inferiores, sendo agora aparentemente atribuição de um órgão cujos membros antes atuavam como simples conselheiros do imperador – uma assembleia governamental eleita, chefiada por um presidente eleito por ela. Na verdade, não é aí que está o poder, em absoluto.

O presidente, em particular, é simplesmente uma figura pública: não detém nenhum poder. Ele é aparentemente escolhido pelo governo, mas as qualidades que ele deve exibir nada têm a ver com liderança. Ele deve é possuir um sutil talento para provocar indignação. Por esse motivo, o presidente é sempre uma figura polêmica, sempre uma personalidade irritante, porém fascinante ao mesmo tempo. Não cabe a ele exercer o poder, e sim desviar a atenção do poder. (…) Pouquíssimas pessoas sabem que o presidente e o governo praticamente não têm nenhum poder, e, dessas poquíssimas pessoas, apenas seis sabem onde é, de fato, exercido o verdadeiro poder político. A maioria das outras está convencida de que, em última instância, o poder é exercido por um computador. Elas não poderiam estar mais erradas." (ADAMS, 2010, p. 35, grifo meu)

          Please enable JavaScript to view the comments powered by Disqus.
          comments powered by Disqus

Copyright © arthurmolina.com blog. All Rights Reserved.

Published with HubPress

            Built with  and Free and Open-Source Software.

redpajama_set_name: RedPajamaGithub


text: CKEDITOR.plugins.setLang("ipscontextmenu","bs",{options:"Context Menu Options"});


text:
package model.entity;

public class Keyword {
	private int  keyword_id;
	private int  module_id;
	private String  keyword_name;

	public Keyword() {
		super();
	}

	public Keyword(int keyword_id, int module_id, String keyword_name) {
		super();
		this.keyword_id = keyword_id;
		this.module_id = module_id;
		this.keyword_name = keyword_name;
	}

	public Keyword(int module_id, String keyword_name) {
		super();
		this.module_id = module_id;
		this.keyword_name = keyword_name;
	}

	public int getKeyword_id() {
		return keyword_id;
	}

	public void setKeyword_id(int keyword_id) {
		this.keyword_id = keyword_id;
	}

	public int getModule_id() {
		return module_id;
	}

	public void setModule_id(int module_id) {
		this.module_id = module_id;
	}

	public String getKeyword_name() {
		return keyword_name;
	}

	public void setKeyword_name(String keyword_name) {
		this.keyword_name = keyword_name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + keyword_id;
		result = prime * result
				+ ((keyword_name == null) ? 0 : keyword_name.hashCode());
		result = prime * result + module_id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Keyword other = (Keyword) obj;
		if (keyword_id != other.keyword_id)
			return false;
		if (keyword_name == null) {
			if (other.keyword_name != null)
				return false;
		} else if (!keyword_name.equals(other.keyword_name))
			return false;
		if (module_id != other.module_id)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Keyword [keyword_id=" + keyword_id + ", module_id=" + module_id
				+ ", keyword_name=" + keyword_name + "]";
	}

}


text:
package pure

import "context"

// ReqVars is the interface of request scoped variables
// tracked by pure
type ReqVars interface {
	URLParam(pname string) string
}

type requestVars struct {
	ctx        context.Context // holds a copy of it's parent requestVars
	params     urlParams
	formParsed bool
}

// Params returns the current routes Params
func (r *requestVars) URLParam(pname string) string {
	return r.params.Get(pname)
}


text:
package de.powerproject.lohnpap.pap;

import java.math.BigDecimal;

/**
 *
 * @author Marcel Lehmann (https://github.com/MarcelLehmann/Lohnsteuer)
 * @date Tue Dec 08 20:54:21 CET 2020
 *
 */

public interface LohnsteuerInterface {

	public void main();

	/** 1, wenn die Anwendung des Faktorverfahrens gewählt wurden (nur in Steuerklasse IV) */
	public void setAf(int arg0);

	/** Auf die Vollendung des 64. Lebensjahres folgende

	             Kalenderjahr (erforderlich, wenn ALTER1=1) */
	public void setAjahr(int arg0);

	/** 1, wenn das 64. Lebensjahr zu Beginn des Kalenderjahres vollendet wurde, in dem

	             der Lohnzahlungszeitraum endet (§ 24 a EStG), sonst = 0 */
	public void setAlter1(int arg0);

	/** in VKAPA und VMT enthaltene Entschädigungen nach §24 Nummer 1 EStG in Cent */
	public void setEntsch(BigDecimal arg0);

	/** eingetragener Faktor mit drei Nachkommastellen */
	public void setF(double arg0);

	/** Jahresfreibetrag nach Maßgabe der Eintragungen auf der

	             Lohnsteuerkarte in Cents (ggf. 0) */
	public void setJfreib(BigDecimal arg0);

	/** Jahreshinzurechnungsbetrag in Cents (ggf. 0) */
	public void setJhinzu(BigDecimal arg0);

	/** Voraussichtlicher Jahresarbeitslohn ohne sonstige Bezüge und ohne Vergütung für mehrjährige Tätigkeit in Cent.

	             Anmerkung: Die Eingabe dieses Feldes (ggf. 0) ist erforderlich bei Eingabe "sonsti-ger Bezüge" (Feld SONSTB)

	             oder bei Eingabe der "Vergütung für mehrjährige Tätigkeit" (Feld VMT).

	             Sind in einem vorangegangenen Abrechnungszeitraum bereits sonstige Bezüge gezahlt worden, so sind sie dem

	             voraussichtlichen Jahresarbeitslohn hinzuzurechnen. Vergütungen für mehrere Jahres aus einem vorangegangenen

	             Abrechnungszeitraum sind in voller Höhe hinzuzurechnen. */
	public void setJre4(BigDecimal arg0);

	/** In JRE4 enthaltene Versorgungsbezuege in Cents (ggf. 0) */
	public void setJvbez(BigDecimal arg0);

	/** Merker für die Vorsorgepauschale

				2 = der Arbeitnehmer ist NICHT in der gesetzlichen Rentenversicherung versichert.

				1 = der Arbeitnehmer ist in der gesetzlichen Rentenversicherung versichert, es gilt die

					Beitragsbemessungsgrenze OST.

				0 = der Arbeitnehmer ist in der gesetzlichen Rentenversicherung versichert, es gilt die

					Beitragsbemessungsgrenze WEST. */
	public void setKrv(int arg0);

	/** Einkommensbezogener Zusatzbeitragssatz eines gesetzlich krankenversicherten Arbeitnehmers,

			 auf dessen Basis der an die Krankenkasse zu zahlende Zusatzbeitrag berechnet wird,

			 in Prozent (bspw. 0,90 für 0,90 %) mit 2 Dezimalstellen.

			 Der von der Kranken-kasse festgesetzte Zusatzbeitragssatz ist bei Abweichungen unmaßgeblich. */
	public void setKvz(BigDecimal arg0);

	/** Lohnzahlungszeitraum:

	             1 = Jahr

	             2 = Monat

	             3 = Woche

	             4 = Tag */
	public void setLzz(int arg0);

	/** In der Lohnsteuerkarte des Arbeitnehmers eingetragener Freibetrag für

	             den Lohnzahlungszeitraum in Cent */
	public void setLzzfreib(BigDecimal arg0);

	/** In der Lohnsteuerkarte des Arbeitnehmers eingetragener Hinzurechnungsbetrag

	             für den Lohnzahlungszeitraum in Cent */
	public void setLzzhinzu(BigDecimal arg0);

	/** Dem Arbeitgeber mitgeteilte Zahlungen des Arbeitnehmers zur privaten

	             Kranken- bzw. Pflegeversicherung im Sinne des §10 Abs. 1 Nr. 3 EStG 2010

	             als Monatsbetrag in Cent (der Wert ist inabhängig vom Lohnzahlungszeitraum immer

	             als Monatsbetrag anzugeben). */
	public void setPkpv(BigDecimal arg0);

	/** Krankenversicherung:

	             0 = gesetzlich krankenversicherte Arbeitnehmer

	             1 = ausschließlich privat krankenversicherte Arbeitnehmer OHNE Arbeitgeberzuschuss

	             2 = ausschließlich privat krankenversicherte Arbeitnehmer MIT Arbeitgeberzuschuss */
	public void setPkv(int arg0);

	/** 1, wenn bei der sozialen Pflegeversicherung die Besonderheiten in Sachsen zu berücksichtigen sind bzw.

	        	 	zu berücksichtigen wären, sonst 0. */
	public void setPvs(int arg0);

	/** 1, wenn er der Arbeitnehmer den Zuschlag zur sozialen Pflegeversicherung

	        	 	zu zahlen hat, sonst 0. */
	public void setPvz(int arg0);

	/** Religionsgemeinschaft des Arbeitnehmers lt. Lohnsteuerkarte (bei

	             keiner Religionszugehoerigkeit = 0) */
	public void setR(int arg0);

	/** Steuerpflichtiger Arbeitslohn vor Beruecksichtigung der Freibetraege

	             fuer Versorgungsbezuege, des Altersentlastungsbetrags und des auf

	             der Lohnsteuerkarte fuer den Lohnzahlungszeitraum eingetragenen

	             Freibetrags in Cents. */
	public void setRe4(BigDecimal arg0);

	/** Sonstige Bezuege (ohne Verguetung aus mehrjaehriger Taetigkeit) einschliesslich

	             Sterbegeld bei Versorgungsbezuegen sowie Kapitalauszahlungen/Abfindungen,

	             soweit es sich nicht um Bezuege fuer mehrere Jahre handelt in Cents (ggf. 0) */
	public void setSonstb(BigDecimal arg0);

	/** Sterbegeld bei Versorgungsbezuegen sowie Kapitalauszahlungen/Abfindungen,

	             soweit es sich nicht um Bezuege fuer mehrere Jahre handelt

	             (in SONSTB enthalten) in Cents */
	public void setSterbe(BigDecimal arg0);

	/** Steuerklasse:

	             1 = I

	             2 = II

	             3 = III

	             4 = IV

	             5 = V

	             6 = VI */
	public void setStkl(int arg0);

	/** In RE4 enthaltene Versorgungsbezuege in Cents (ggf. 0) */
	public void setVbez(BigDecimal arg0);

	/** Vorsorgungsbezug im Januar 2005 bzw. fuer den ersten vollen Monat

	             in Cents */
	public void setVbezm(BigDecimal arg0);

	/** Voraussichtliche Sonderzahlungen im Kalenderjahr des Versorgungsbeginns

	             bei Versorgungsempfaengern ohne Sterbegeld, Kapitalauszahlungen/Abfindungen

	             bei Versorgungsbezuegen in Cents */
	public void setVbezs(BigDecimal arg0);

	/** In SONSTB enthaltene Versorgungsbezuege einschliesslich Sterbegeld

	            in Cents (ggf. 0) */
	public void setVbs(BigDecimal arg0);

	/** Jahr, in dem der Versorgungsbezug erstmalig gewaehrt wurde; werden

	             mehrere Versorgungsbezuege gezahlt, so gilt der aelteste erstmalige Bezug */
	public void setVjahr(int arg0);

	/** Kapitalauszahlungen / Abfindungen / Nachzahlungen bei Versorgungsbezügen

	             für mehrere Jahre in Cent (ggf. 0) */
	public void setVkapa(BigDecimal arg0);

	/** Vergütung für mehrjährige Tätigkeit ohne Kapitalauszahlungen und ohne Abfindungen

				 bei Versorgungsbezügen in Cent (ggf. 0) */
	public void setVmt(BigDecimal arg0);

	/** Zahl der Freibetraege fuer Kinder (eine Dezimalstelle, nur bei Steuerklassen

	             I, II, III und IV) */
	public void setZkf(BigDecimal arg0);

	/** Zahl der Monate, fuer die Versorgungsbezuege gezahlt werden (nur

	             erforderlich bei Jahresberechnung (LZZ = 1) */
	public void setZmvb(int arg0);

	/** In JRE4 enthaltene Entschädigungen nach § 24 Nummer 1 EStG in Cent */
	public void setJre4ent(BigDecimal arg0);

	/** In SONSTB enthaltene Entschädigungen nach § 24 Nummer 1 EStG in Cent */
	public void setSonstent(BigDecimal arg0);

	/** Bemessungsgrundlage fuer die Kirchenlohnsteuer in Cents */
	public BigDecimal getBk();

	/** Bemessungsgrundlage der sonstigen Einkuenfte (ohne Verguetung

	             fuer mehrjaehrige Taetigkeit) fuer die Kirchenlohnsteuer in Cents */
	public BigDecimal getBks();
	public BigDecimal getBkv();

	/** Fuer den Lohnzahlungszeitraum einzubehaltende Lohnsteuer in Cents */
	public BigDecimal getLstlzz();

	/** Fuer den Lohnzahlungszeitraum einzubehaltender Solidaritaetszuschlag

	             in Cents */
	public BigDecimal getSolzlzz();

	/** Solidaritaetszuschlag fuer sonstige Bezuege (ohne Verguetung fuer mehrjaehrige

	             Taetigkeit) in Cents */
	public BigDecimal getSolzs();

	/** Solidaritaetszuschlag fuer die Verguetung fuer mehrjaehrige Taetigkeit in

	             Cents */
	public BigDecimal getSolzv();

	/** Lohnsteuer fuer sonstige Einkuenfte (ohne Verguetung fuer mehrjaehrige

	             Taetigkeit) in Cents */
	public BigDecimal getSts();

	/** Lohnsteuer fuer Verguetung fuer mehrjaehrige Taetigkeit in Cents */
	public BigDecimal getStv();

	/** Für den Lohnzahlungszeitraum berücksichtigte Beiträge des Arbeitnehmers zur

				 privaten Basis-Krankenversicherung und privaten Pflege-Pflichtversicherung (ggf. auch

				 die Mindestvorsorgepauschale) in Cent beim laufenden Arbeitslohn. Für Zwecke der Lohn-

				 steuerbescheinigung sind die einzelnen Ausgabewerte außerhalb des eigentlichen Lohn-

				 steuerbescheinigungsprogramms zu addieren; hinzuzurechnen sind auch die Ausgabewerte

				 VKVSONST */
	public BigDecimal getVkvlzz();

	/** Für den Lohnzahlungszeitraum berücksichtigte Beiträge des Arbeitnehmers

				 zur privaten Basis-Krankenversicherung und privaten Pflege-Pflichtversicherung (ggf.

				 auch die Mindestvorsorgepauschale) in Cent bei sonstigen Bezügen. Der Ausgabewert kann

				 auch negativ sein. Für tarifermäßigt zu besteuernde Vergütungen für mehrjährige

				 Tätigkeiten enthält der PAP keinen entsprechenden Ausgabewert. */
	public BigDecimal getVkvsonst();

	/** Verbrauchter Freibetrag bei Berechnung des laufenden Arbeitslohns, in Cent */
	public BigDecimal getVfrb();

	/** Verbrauchter Freibetrag bei Berechnung des voraussichtlichen Jahresarbeitslohns, in Cent */
	public BigDecimal getVfrbs1();

	/** Verbrauchter Freibetrag bei Berechnung der sonstigen Bezüge, in Cent */
	public BigDecimal getVfrbs2();

	/** Für die weitergehende Berücksichtigung des Steuerfreibetrags nach dem DBA Türkei verfügbares ZVE über

				dem Grundfreibetrag bei der Berechnung des laufenden Arbeitslohns, in Cent */
	public BigDecimal getWvfrb();

	/** Für die weitergehende Berücksichtigung des Steuerfreibetrags nach dem DBA Türkei verfügbares ZVE über dem Grundfreibetrag

				bei der Berechnung des voraussichtlichen Jahresarbeitslohns, in Cent */
	public BigDecimal getWvfrbo();

	/** Für die weitergehende Berücksichtigung des Steuerfreibetrags nach dem DBA Türkei verfügbares ZVE

				über dem Grundfreibetrag bei der Berechnung der sonstigen Bezüge, in Cent */
	public BigDecimal getWvfrbm();
}


text:
"use strict";
import {client, io} from "../server";

//movement map for xy coordinate modifiers (thanks @rlemon)
const movement = {
	'nw':[-1,1],
	'ne':[1,1],
	'n':[0,1],
	'sw':[-1,-1],
	'se':[1,-1],
	's':[0,-1],
	'w':[-1,0],
	'e':[1,0]
};

//socket move function
//pass in the socket session and data
export function move(data, socket, bucket, gameId) {
	if (data.direction === "null") {
		return false;
	} //if no direction, ignore this function
	//destructure map collection movement
	let [x=0,y=0] = movement[data.direction];

	//check for map boundaries
	if (socket.request.session.player.x + x > 100 || socket.request.session.player.x + x < 1) x = 0;
	if (socket.request.session.player.y + y > 100 || socket.request.session.player.y + y < 1) y = 0;

	//apply modification to player object
	socket.request.session.player.x += x;
	socket.request.session.player.y += y;

	socket.emit("location", {
		data : {
			x : socket.request.session.player.x,
			y : socket.request.session.player.y
		}
	});

	client.hmset(socket.request.session.player.id, socket.request.session.player); //re-store player object with new coordinates

	/*
		Iterate game to get all player IDs
		get player object from redis, using game-id id index
		grab location
		check for functions (same tile, proximity..)
	 */
	console.log("MAP GAME ID", gameId);
	client.smembers(gameId, (err, reply) => {
		reply.map(x => {
			client.hgetall(x, (err, reply) => {
				if (reply.user != socket.request.session.player.user) { //no point in displaying yourself to yourself
					const msg = `${reply.user} is on ${reply.x}, ${reply.y}`;
					io.sockets.emit("locations", {location:msg});
				}
				if (reply.id != socket.request.session.player.id) {
					const tile = similarTile(reply, socket);
					let prox;
					if (!tile) { //if not on the same tile
						prox = proximity(reply, socket);
						//TODO calculate directional bearing from angle returned
						const sock = bucket[reply.id];
						console.log(sock);
						console.log(`Socket id of ${reply.user} - ${sock}`);
						if (prox != -1)  {
							console.log(`Sending ${prox} bearing to ${reply.user}`);
							io.sockets.connected[sock].emit("bearing", {direction: prox});
						}
					}
				}
			});
		});
	});

	//string to return to client for event log
	const string = `${socket.request.session.player.user} has moved ${data.direction} to [${socket.request.session.player.x},${socket.request.session.player.y}]`;
	io.sockets.emit("somethingelse", {msg:string});
}

function calculateBearing(prox) {
	//function by copy
	//takes an array of bearings, and accesses them via
	return ["n", "ne", "e", "se", "s", "sw", "w", "nw"][(prox + 360 / 16) % 360 / (360 / 8) | 0]
}

//initiate redis game
// export function init(socket) {
// 	//redis push player to game set
// 	client.sadd("game-1", socket.request.session.player.id);
// 	client.hmset(socket.request.session.player.id, socket.request.session.player);
// 	socket.emit("location", {
// 		data : {
// 			x : socket.request.session.player.x,
// 			y : socket.request.session.player.y
// 		}
// 	});
// }

//funtion to check if 2 players are standing on the same time
//return true or false
function similarTile(data, socket) {
	if (data.user == socket.request.session.player.user) return false;
	if (+data.x == socket.request.session.player.x && +data.y == socket.request.session.player.y) {
		const string = `${socket.request.session.player.user} and ${data.user} are on the same tile!`;
		io.sockets.emit("sameTile", {msg:string});
		return true;
	} else return false;
}

//check distance to player via proximity check
function proximity(data, socket) {
	// Get the distance as a unit vector
	const v = getDistance(socket.request.session.player, data);
	console.log("Distance to player", v)
	//boolean radius check
	const rad = withinRadius(v, socket.request.session.player.radius);
	if (rad) {
		const uv = makeUnit(v); //make unit vector
		const angle = angleFromAtan(Math.atan2(+uv.x, +uv.y)); //get arctangent angle
		console.log("angle",angle);
		return calculateBearing(angle);
	} else {
		return -1;
	}
}

//function to check if a player has entered another's radius
function withinRadius(v, r) {
	console.log(v.l, typeof v.l, r)
	return v.l <= r;
}

//calulate actual distance between 2 players
//return object form, and length
function getDistance(playerA, playerB) {
	const x = playerA.x - playerB.x;
	const y = playerA.y - playerB.y;
	const l = Math.sqrt((x * x) + (y * y));
	return {x, y, l};
}

//create unit vector from distance object
function makeUnit(v) {
	return {x: (+v.x / +v.l), y: (+v.y / +v.l), l: 1};
}

//calculate angle using arctangent
function angleFromAtan(a) {
	if (a > 0) {
		return (a * 360 / (2 * Math.PI));
	} else {
		return ((2*Math.PI + a) * 360 / (2*Math.PI));
	}
}


text:
import socket
import time
import urllib2

from amazonproduct.api import API

class RetryAPI (API):

    """
    API which will try up to ``TRIES`` times to fetch a result from Amazon
    should it run into a timeout. For the time being this will remain in
    :mod:`amazonproduct.contrib` but its functionality may be merged into the
    main API at a later date.

    Based on work by Jerry Ji
    """

    #: Max number of tries before giving up
    TRIES = 5

    #: Delay between tries in seconds
    DELAY = 3

    #: Between each try the delay will be lengthened by this backoff multiplier
    BACKOFF = 1

    def _fetch(self, url):
        """
        Retrieves XML response from Amazon. In case of a timeout, it will try
        :const:`~RetryAPI.TRIES`` times before raising an error.
        """
        attempts = 0
        delay = self.DELAY

        while True:
            try:
                attempts += 1
                return API._fetch(self, url)
            except urllib2.URLError, e:

                # if a timeout occurred
                # wait for some time before trying again
                reason = getattr(e, 'reason', None)
                if isinstance(reason, socket.timeout) and attempts < self.TRIES:
                    time.sleep(delay)
                    delay *= self.BACKOFF
                    continue

                # otherwise reraise the original error
                raise


text:
<?php

namespace app\models\db;

use Yii;

/**
 * This is the model class for table "{{%nav}}".
 *
 * @property integer $id
 * @property integer $parentid
 * @property string $label
 * @property string $target
 * @property string $href
 * @property string $icon
 * @property integer $status
 * @property integer $listorder
 * @property string $path
 */
class Nav extends \yii\db\ActiveRecord {
    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%nav}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['label', 'href'], 'required'],
            [['parentid', 'listorder'], 'integer'],
            [['label', 'href'], 'string', 'max' => 255],
            [['target'], 'string', 'max' => 50],
            [['parentid', 'listorder'], 'default', 'value' => 0],

        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'parentid' => 'Parentid',
            'label' => 'Label',
            'target' => 'Target',
            'status' => 'Status',
            'listorder' => 'Listorder',

        ];
    }
}


text:
package com.devesion.commons.obd.adapter.command.diagnostic.sensors.units;

import com.devesion.commons.obd.adapter.command.CommandResult;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.mockito.MockitoAnnotations.initMocks;

public class AirFlowValueTest extends BaseValueTest {

	@BeforeMethod
	private void beforeMethod() {
		initMocks(this);
	}

	@Test
	public void constructorShouldSetDefaultDivisorAndMultiplier() throws Exception {
		constructorShouldSetDefaultDivisorAndMultiplier(256, 100);
	}

	@Override
	protected AbstractSensorCommandValue createSut(CommandResult commandResultMock) {
		return new AirFlowValue(commandResultMock);
	}
}


text:
class CompaniesController < ApplicationController
  load_and_authorize_resource

  def index
  end

  def show
  end
end


text:
""" Parsers for stellar atmosphere models. """

__author__ = "Andy Casey <andy@astrowizici.st>"

# Standard libraries
import os
from textwrap import dedent

# Third party libraries
import numpy as np

__all__ = ["CastelliKuruczAlphaParser"]

class CastelliKuruczAlphaParser(object):
    """
    A class to parse Castelli & Kurucz alpha-enhanced (ODFNEW) model atmospheres.
    """

    ntau = 72
    parameters = ["Teff", "logg", "[M/H]"]
    atmosphere_parameters = ["RHOX", "T", "P", "XNE", "ABROSS", "ACCRAD", "VTURB",
        "FLXCNV", "VCONV", "VELSND"]

    @staticmethod
    def filename(filename):

        # This should really be a regular expressions match.
        filename = os.path.basename(filename)

        feh = float(filename.split('t')[0][1::].replace('m', '-').replace('p', '+').rstrip('a')) /10.
        teff = float(filename.split('t')[1].split('g')[0])
        logg = float(filename.split('g')[1].split('k')[0]) /10.

        return [teff, logg, feh]

    @staticmethod
    def contents(filename):

        with open(filename, 'r') as fp:
            contents = fp.readlines()

        in_deck, deck = False, []

        for line in contents:
            if line.startswith('READ DECK'):
                in_deck = True
                continue
            elif line.startswith('PRADK'):
                break

            if in_deck: deck.append(map(float, line.split()))

        return np.array(deck)

    @staticmethod
    def write(point, xi, photosphere, output_filename, **kwargs):

        teff, logg, feh = point
        output_string = """
        KURUCZ
                  TEFF   %i.  GRAVITY %2.5f LTE
        NTAU        %i
        """ % (teff, logg, len(photosphere), )

        output_string = dedent(output_string).lstrip()

        for line in photosphere:
            # Need to accompany thermal structures of different array sizes
            output_string += " %1.8e " % (line[0], )
            output_string += ("%10.3e" * (len(line[1:])) % tuple(line[1:]) + "\n")

        output_string += "         %1.2f\n" % (xi, )
        output_string += "NATOMS        0     %2.1f\n" % (feh,)
        output_string += "NMOL          0\n"

        # Add the trailing newline character
        output_string += "\n"

        # Write it out
        with open(output_filename, 'w') as fp:
            fp.write(output_string)

        return True


text:
package net.imagej.legacy.display;

import ij.ImagePlus;
import ij.WindowManager;

import java.util.List;

import net.imagej.Data;
import net.imagej.Dataset;
import net.imagej.Position;
import net.imagej.display.DataView;
import net.imagej.display.DatasetView;
import net.imagej.display.ImageDisplay;
import net.imagej.display.ImageDisplayService;
import net.imagej.legacy.LegacyImageMap;
import net.imagej.legacy.LegacyService;

import org.scijava.Context;
import org.scijava.Priority;
import org.scijava.display.DisplayService;
import org.scijava.event.EventService;
import org.scijava.object.ObjectService;
import org.scijava.plugin.Plugin;
import org.scijava.plugin.PluginService;
import org.scijava.service.AbstractService;
import org.scijava.service.Service;
import org.scijava.service.ServiceIndex;

/**
 * HACK - this whole service exists as a hack to facilitate running commands
 * that require a {@link Dataset} without requiring ImageJ2 synchronization to
 * be enabled via {@code Edit>Options>ImageJ2}.
 *

 * NB: {@link DisplayService} and {@link ObjectService} will NOT be synchronized
 * with the state represented by this service. Use cases querying these services
 * require ImageJ2 synchronization to be enabled.
 *

 *

 * This service will be made obsolete by creating
 * lightweight wrappers.
 *

 *
 * @author Mark Hiner
 */
@Plugin(type = Service.class, priority = Priority.HIGH)
public class LegacyImageDisplayService extends AbstractService implements
	ImageDisplayService
{

	// -- Parameters --

	/* Can't use injection as we want the next lowest priority service. */
	private ImageDisplayService imageDisplayService;

	// -- ImageDispalyService Methods --

	@Override
	public EventService getEventService() {
		return imageDisplayService().getEventService();
	}

	@Override
	public PluginService getPluginService() {
		return imageDisplayService().getPluginService();
	}

	@Override
	public DisplayService getDisplayService() {
		return imageDisplayService().getDisplayService();
	}

	@Override
	public DataView createDataView(final Data data) {
		return imageDisplayService().createDataView(data);
	}

	@Override
	public List<? extends DataView> getDataViews() {
		return imageDisplayService().getDataViews();
	}

	@Override
	public ImageDisplay getActiveImageDisplay() {
		ImageDisplay imageDisplay = null;
		final ImagePlus imp = WindowManager.getCurrentImage();
		if (imp != null) {
			imageDisplay = getImageMap().registerLegacyImage(imp);
		}
		if (imageDisplay != null)
			return imageDisplay;
		// Try the delegate ImageDisplayService if the WindowManager fails
		return imageDisplayService().getActiveImageDisplay();
	}

	@Override
	public Dataset getActiveDataset() {
		// Always want to go check the current ImagePlus
		return getActiveDataset(getActiveImageDisplay());
	}

	@Override
	public DatasetView getActiveDatasetView() {
		return imageDisplayService().getActiveDatasetView();
	}

	@Override
	public Position getActivePosition() {
		return imageDisplayService().getActivePosition();
	}

	@Override
	public Dataset getActiveDataset(final ImageDisplay display) {
		return imageDisplayService().getActiveDataset(display);
	}

	@Override
	public DatasetView getActiveDatasetView(final ImageDisplay display) {
		return imageDisplayService().getActiveDatasetView(display);
	}

	@Override
	public List<ImageDisplay> getImageDisplays() {
		// Register all ImagePlus instances. This will generate ensure no
		// ImagePluses are missed by the standard getImageDisplays.
		final int[] idList = WindowManager.getIDList();
		if (idList != null) {
			for (final int id : idList) {
				final ImagePlus imp = WindowManager.getImage(id);
				getImageMap().registerLegacyImage(imp);
			}
		}

		return imageDisplayService().getImageDisplays();
	}

	@Override
	public Position getActivePosition(final ImageDisplay display) {
		return imageDisplayService().getActivePosition(display);
	}

	// -- Heleper methods --

	/**
	 * Lazy initializer for the delegate {@link ImageDisplayService}.
	 */
	private ImageDisplayService imageDisplayService() {
		if (imageDisplayService == null) {
			synchronized (this) {
				if (imageDisplayService == null) {
					final ServiceIndex index = getContext().getServiceIndex();

					// Set datasetService to the next highest priority service
					imageDisplayService =
						index.getNextService(ImageDisplayService.class,
							LegacyImageDisplayService.class);
				}
			}
		}
		return imageDisplayService;
	}

	/**
	 * Helper method to access {@link LegacyImageMap} since we can't have a
	 * {@link LegacyService} parameter.
	 *
	 * @return The {@link LegacyImageMap} for this {@link Context}.
	 */
	private LegacyImageMap getImageMap() {
		LegacyImageMap map = null;
		final LegacyService legacyService =
			getContext().getService(LegacyService.class);
		if (legacyService != null) {
			map = legacyService.getImageMap();
		}
		return map;
	}
}


text:
package com.hao.requestlistviewdemo;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ArrayAdapter extends BaseAdapter {

	ViewHolder mHolder;

	private Context mContext;
	private List<ArrayBean> mList = new ArrayList<ArrayBean>();

	public ArrayAdapter(List<ArrayBean> list, Context context) {
		super();
		this.mList = list;
		this.mContext = context;
	}

	@Override
	public int getCount() {
		return mList.size();
	}

	@Override
	public Object getItem(int arg0) {
		return mList.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {

		View view = arg1;

		if (view == null) {
			view = LayoutInflater.from(mContext).inflate(R.layout.item_array, null);
			mHolder = new ViewHolder();
			mHolder.name = (TextView) view.findViewById(R.id.name);
			mHolder.email = (TextView) view.findViewById(R.id.email);
			view.setTag(mHolder);
		} else {
			mHolder = (ViewHolder) view.getTag();
		}

		ArrayBean arrayBean = mList.get(arg0);
		if (arrayBean != null) {
			mHolder.name.setText("Name:" + arrayBean.getName());
			mHolder.email.setText("Email:" + arrayBean.getEmail());
		}
		return view;
	}

	static class ViewHolder {
		TextView name, email;
	}

}


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">

<style>
  div.charts-tooltip {
    z-index: 200 !important;
  }
</style>

<script>

Polymer({
  is: 'state-history-chart-timeline',

  properties: {
    data: {
      type: Object,
      observer: 'dataChanged',
    },

    isAttached: {
      type: Boolean,
      value: false,
      observer: 'dataChanged',
    },
  },

  created: function () {
    this.style.display = 'block';
  },

  attached: function () {
    this.isAttached = true;
  },

  dataChanged: function () {
    this.drawChart();
  },

  drawChart: function () {
    var root = Polymer.dom(this);
    var stateHistory = this.data;
    var chart;
    var dataTable;
    var startTime;
    var endTime;
    var numTimelines;
    var format;
    var daysDelta;

    if (!this.isAttached) {
      return;
    }

    while (root.node.lastChild) {
      root.node.removeChild(root.node.lastChild);
    }

    if (!stateHistory || stateHistory.length === 0) {
      return;
    }

    chart = new window.google.visualization.Timeline(this);
    dataTable = new window.google.visualization.DataTable();

    dataTable.addColumn({ type: 'string', id: 'Entity' });
    dataTable.addColumn({ type: 'string', id: 'State' });
    dataTable.addColumn({ type: 'date', id: 'Start' });
    dataTable.addColumn({ type: 'date', id: 'End' });

    function addRow(entityDisplay, stateStr, start, end) {
      var stateDisplay = stateStr.replace(/_/g, ' ');
      dataTable.addRow([entityDisplay, stateDisplay, start, end]);
    }

    startTime = new Date(
      stateHistory.reduce(
        function (minTime, stateInfo) {
          return Math.min(minTime, new Date(stateInfo[0].last_changed));
        }, new Date()));

    // end time is Math.max(startTime, last_event)
    endTime = new Date(
      stateHistory.reduce(
        function (maxTime, stateInfo) {
          return Math.max(maxTime, new Date(stateInfo[stateInfo.length - 1].last_changed));
        }, startTime));

    if (endTime > new Date()) {
      endTime = new Date();
    }
    format = 'H:mm';
    daysDelta = (endTime - startTime) / (24 * 3600 * 1000);
    if (daysDelta > 30) {
      format = 'MMM d';
    } else if (daysDelta > 3) {
      format = 'EEE, MMM d';
    } else if (daysDelta > 1) {
      format = 'EEE, MMM d, H:mm';
    }

    numTimelines = 0;
    // stateHistory is a list of lists of sorted state objects
    stateHistory.forEach(function (stateInfo) {
      var entityDisplay;
      var newLastChanged;
      var prevState = null;
      var prevLastChanged = null;

      if (stateInfo.length === 0) return;

      entityDisplay = window.hassUtil.computeStateName(stateInfo[0]);

      stateInfo.forEach(function (state) {
        if (prevState !== null && state.state !== prevState) {
          newLastChanged = new Date(state.last_changed);

          addRow(entityDisplay, prevState, prevLastChanged, newLastChanged);

          prevState = state.state;
          prevLastChanged = newLastChanged;
        } else if (prevState === null) {
          prevState = state.state;
          prevLastChanged = new Date(state.last_changed);
        }
      });

      addRow(entityDisplay, prevState, prevLastChanged, endTime);
      numTimelines++;
    });

    chart.draw(dataTable, {
      height: 55 + (numTimelines * 42),

      timeline: {
        showRowLabels: stateHistory.length > 1,
      },

      hAxis: {
        format: format
      },
    });
  },
});
</script>


text:
const {
  assertTrue, assertFalse,
  assertThrows,
} = Assert;

// 9.5.15 [[Construct]], 9.5.16 ProxyCreate: Only set [[Construct]] when target is constructor?
// https://bugs.ecmascript.org/show_bug.cgi?id=2116

assertThrows(TypeError, () => new (new Proxy({}, {})));
assertThrows(TypeError, () => new (new Proxy(() => {}, {})));
assertThrows(TypeError, () => new (new Proxy({m(){}}.m, {})));

function IsConstructor(o) {
  try {
    new (new Proxy(o, {construct: () => ({})}));
    return true;
  } catch (e) {
    return false;
  }
}

assertTrue(IsConstructor(Object));
assertTrue(IsConstructor(function(){}));
assertFalse(IsConstructor(function*(){}));

assertFalse(IsConstructor(Object.prototype));
assertFalse(IsConstructor(Object.prototype.toString));
assertFalse(IsConstructor(() => {}));
assertFalse(IsConstructor({m(){}}.m));


text:
class CreateQuizzlrAnswers < ActiveRecord::Migration
  def change
    create_table :quizzlr_answers do |t|

      t.timestamps
    end
  end
end


text:
/**
Unit tests in Mojito

Mojito provides a testing framework based on YUI Test that allows you to run unit tests for modules,
applications, mojit controllers, mojit models, and mojit binders.
For more info, visit: http://developer.yahoo.com/cocktails/mojito/docs/topics/mojito_testing.html

For all assertion functions, visit:
http://yuilibrary.com/yui/docs/api/classes/Test.Assert.html

Controller Tests

A mojit can have one or more controllers that have different affinities. For each controller, you can create create
a test controller with the same affinity or use controller.common-tests.js, which tests controllers with any affinity.
For example, controller.server.js can be tested with controller.server-tests.js or controller.common-tests.js.
For more info, visit: http://developer.yahoo.com/cocktails/mojito/docs/topics/mojito_testing.html#controller-tests
**/

/*jslint anon:true, sloppy:true, nomen:true*/
/*global YUI,YUITest*/

YUI.add('shelf-tests', function(Y, NAME) {

    var suite = new YUITest.TestSuite(NAME),
        controller = null,
        // Shorthand common used variables
        MA = Y.mojito.MockActionContext,
        A = YUITest.Assert,
        M = YUITest.Mock;

    suite.add(new YUITest.TestCase({

        name: 'shelf tests',

        // setup function is always called before each test runs
        setUp: function() {
            A.isNull(controller);
            // Fetches the controller we are going to test
            controller = Y.mojito.controllers["shelf"];
            A.isNotNull(controller);
        },

        // tearDown function is always called after each test runs
        tearDown: function() {
            controller = null;
        },

        'test preNumFromString method - String start with Num+dot': function() {
            var testString = "100000. Hello Worldddd\n\n\n",
                funcRetObj;

            // Makes sure the controller method is not null
            A.isNotNull(controller && controller.test && controller.test.preNumFromString);

            // Executes the method, store result
            funcRetObj = controller.test.preNumFromString(testString);

            // Compares stored result with expected output
            A.areSame("100000", funcRetObj.preNum);
            A.areSame("Hello Worldddd", funcRetObj.rest);
        },

        'test preNumFromString method - String start without number at front but dot': function() {
            var testString = ". Hello Worldddd\n\n\n",
                funcRetObj;

            // Makes sure the controller method is not null
            A.isNotNull(controller && controller.test && controller.test.preNumFromString);

            // Executes the method, store result
            funcRetObj = controller.test.preNumFromString(testString);

            // Compares stored result with expected output
            A.areSame("", funcRetObj.preNum);
            A.areSame("Hello Worldddd", funcRetObj.rest);
        },

        'test index method': function() {
            // Initializes an ActionContext mock object
			var ac = new MA({
                // Declares the addons will be used
                addons: ['url'],
                // Declares the models will be used
				models: ['guide']
            });

            // Sets up expectation objects with addon
            ac.url.expect({
                method: "make",
                args: [M.Value.String, M.Value.String, M.Value.Object],
                run: function(mojit, method, routeParams) {
                    // Argument checks
                    A.areSame('read', mojit);
                    A.areSame('index', method);
                    if (routeParams.filename === "file001") {
                        return 'read.html?filename=file001';
                    } else if (routeParams.filename === "file002") {
                        return 'read.html?filename=file002';
                    }
                }
            });

            // Defines a "get" function for model (mojito 0.5.x)
            ac.models.get = function(model_name) {
                return ac.models[model_name];
            };

            // Sets up expectation objects with model
            ac.models["guide"].expect({
				method: "getGuides",
				args: [M.Value.Function],
				run: function(cb){
					cb([{
						filename: "file001",
						title: "title001"
					}, {
						filename: "file002",
						title: "title002"
					}]);
				}
			});

            // Sets up tests in ac.done call
			ac.expect({
				method: "done",
				args: [M.Value.Object],
				run: function(obj) {
					A.areSame(2, obj.tiles.length, "Wrong tile counts.");
					A.areSame("title001", obj.tiles[0].title, "Wrong title");
                    A.areSame("title002", obj.tiles[1].title, "Wrong title");
                    A.areSame("read.html?filename=file001", obj.tiles[0].link, "Wrong link");
                    A.areSame("read.html?filename=file002", obj.tiles[1].link, "Wrong link");
				}
			});

            // Makes sure the controller method is not null
            A.isNotNull(controller && controller.index);

            // Running test with mocked ActionContext
            controller.index(ac);
        }

    }));

    // Adds test cases into TestRunner
    YUITest.TestRunner.add(suite);

}, '0.0.1', {requires: [
    'mojito-test',
    'shelf',
    'oop'
]});


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.codemage.datastuctures;

/**
 *
 * @author Hasitha Lakmal
 */
public class Method {

    private int methID;
    private String methName;
    private int numberOfElementIO;
    private int numberOf1dIO;
    private int numberOfmdIO;
    private int maxCallingDistence;
    private int callingModuleWeight;
    private String methCodeline;
    private int lineNum;

    public int getMethID() {
        return methID;
    }

    public void setMethID(int methID) {
        this.methID = methID;
    }

    public int getNumberOfElementIO() {
        return numberOfElementIO;
    }

    public void setNumberOfElementIO(int numberOfElementIO) {
        this.numberOfElementIO = numberOfElementIO;
    }

    public int getNumberOf1dIO() {
        return numberOf1dIO;
    }

    public void setNumberOf1dIO(int numberOf1dIO) {
        this.numberOf1dIO = numberOf1dIO;
    }

    public int getNumberOfmdIO() {
        return numberOfmdIO;
    }

    public void setNumberOfmdIO(int numberOfmdIO) {
        this.numberOfmdIO = numberOfmdIO;
    }

    public int getMaxCallingDistence() {
        return maxCallingDistence;
    }

    public void setMaxCallingDistence(int maxCallingDistence) {
        this.maxCallingDistence = maxCallingDistence;
    }

    public int getCallingModuleWeight() {
        return callingModuleWeight;
    }

    public void setCallingModuleWeight(int callingModuleWeight) {
        this.callingModuleWeight = callingModuleWeight;
    }

    public String getMethCodeline() {
        return methCodeline;
    }

    public void setMethCodeline(String methCodeline) {
        this.methCodeline = methCodeline;
    }

    public String getMethName() {
        return methName;
    }

    public void setMethName(String methName) {
        this.methName = methName;
    }

    @Override
    public String toString() {
        return "Method{" + "methID=" + methID + ", methName=" + methName + ", numberOfElementIO=" + numberOfElementIO + ", numberOf1dIO=" + numberOf1dIO + ", numberOfmdIO=" + numberOfmdIO + ", maxCallingDistence=" + maxCallingDistence + ", callingModuleWeight=" + callingModuleWeight + ", methCodeline=" + methCodeline + '}';
    }

    public int getLineNum() {
        return lineNum;
    }

    public void setLineNum(int lineNum) {
        this.lineNum = lineNum;
    }

}


text:
module.exports.getToken = function()
{
  var tokenurl = 'http://ourvle.mona.uwi.edu/login/token.php?username=620068192&password=19950923&service=moodle_mobile_app';

  console.log(tokenurl);

  Parse.Cloud.httpRequest({
        method: 'GET',
        url: tokenurl
        }).then(function(httpResponse) {
          var message = httpResponse.text;
        //console.log(message);

        var object = JSON.parse(message);

        console.log(object.token);
        return object.token;
      }, function(httpResponse) {
        console.error('Request failed with response code ' + httpResponse.status);
      });
        console.log("done");
}


text:
// SecondarySplitter.cpp : implementation file
//

#include "stdafx.h"
#include "discovermdi.h"
#include "SubmissionProperties.h"
#include "SubmitInfo.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSecondarySplitter

IMPLEMENT_DYNCREATE(CSecondarySplitter, CSplitterWnd)

CSecondarySplitter::CSecondarySplitter()
{
}

CSecondarySplitter::~CSecondarySplitter()
{
}

BEGIN_MESSAGE_MAP(CSecondarySplitter, CSplitterWnd)
	//{{AFX_MSG_MAP(CSecondarySplitter)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSecondarySplitter message handlers

BOOL CSecondarySplitter::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
	// TODO: Add your specialized code here and/or call the base class
   //CRect winRect;
   //GetWindowRect(winRect);
   CSize size(100,100);

   if(CreateStatic(this,2,1)) {
      TRACE0("Failed to create split bar ");
      return FALSE; // CSplitterWnd
   }
   return 1;

}

int CSecondarySplitter::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CSplitterWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
   CSize size(100,100);

	//CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
   if(CreateView(0,0,RUNTIME_CLASS(CSubmissionProperties),size,pContext)==FALSE) return 0;
   if(CreateView(1,0,RUNTIME_CLASS(CSubmitInfo),size, pContext)==FALSE)          return 0;

	return 0;
}


text:
package com.credit.managers;

import com.opensymphony.xwork2.ActionContext;
import entities.UsersEntity;

import javax.persistence.EntityManager;
import java.util.Map;

/**
 * Created by Alexandre on 06/06/2016.
 */
public class SessionManager {
    public static UsersEntity getUser(EntityManager em)
    {
        Map session = ActionContext.getContext().getSession();

        if (session.get("user_session") == null) {
            return null;
        }

        int userId = (int)session.get("user_session");
        UsersEntity user = (UsersEntity)em.createQuery("select u from UsersEntity u where id = :id")
                .setParameter("id", userId)
                .getSingleResult();

        return user;
    }
}


text:
const assert      = require('assert');
const Browser     = require('../src/zombie');
const { brains }  = require('./helpers');

describe("Browser events", function() {
  let browser;
  let events = {
    console:  [],
    log:      [],
    resource: []
  };

  before(function() {
    browser = Browser.create();
    return brains.ready();
  });

  describe("sending output to console", function() {
    before(function() {
      browser.on('console', function(level, message) {
        events.console.push({ level: level, message: message });
      });
      browser.console.log("Logging", "message");
      browser.console.error("Some", new Error("error"));
    });

    it("should receive console events with the log level", function() {
      assert.deepEqual(events.console[0].level, 'log');
      assert.deepEqual(events.console[1].level, 'error');
    });

    it("should receive console events with the message", function() {
      assert.deepEqual(events.console[0].message, "Logging message");
      assert.deepEqual(events.console[1].message, "Some [Error: error]");
    });
  });

  describe("logging a message", function() {
    it("should receive log events", function() {
      // Zombie log
      browser.on('log', function(message) {
        events.log.push(message);
      });
      browser.log("Zombie", "log");
      browser.log("Zombie", new Error("error"));

      assert.equal(events.log[0], "Zombie log");
      assert.equal(events.log[1], "Zombie [Error: error]");
    });
  });

  describe("requesting a resource", function() {
    before(function() {
      brains.redirect('/browser-events/resource', '/browser-events/redirected');
      brains.static('/browser-events/redirected', "Very well then");

      browser.on('request', function(request) {
        events.resource.push([request]);
      });
      browser.on('redirect', function(response, newRequest) {
        events.resource.push([response, newRequest]);
      });
      browser.on('response', function(request, response) {
        events.resource.push([request, response]);
      });

      return browser.visit('/browser-events/resource');
    });

    it("should receive resource requests", function() {
      let [request] = events.resource[0];
      assert.equal(request.url, 'http://example.com/browser-events/resource');
    });

    it("should receive resource redirects", function() {
      let [response, newRequest] = events.resource[1];
      assert.equal(response.statusCode, 302);
      assert.equal(response.url, 'http://example.com/browser-events/redirected');
      assert.equal(newRequest.url, response.url);
    });

    it("should receive resource responses", function() {
      let [request, response] = events.resource[2];
      assert.equal(request.url, 'http://example.com/browser-events/resource');
      assert.equal(response.statusCode, 200);
      assert.equal(response.redirects, 1);
    });

  });

  describe("opening a window", function() {
    before(function() {
      browser.on('opened', function(window) {
        events.open = window;
      });
      browser.on('active', function(window) {
        events.active = window;
      });
      browser.open({ name: 'open-test' });
    });

    it("should receive opened event", function() {
      assert.equal(events.open.name, 'open-test');
    });

    it("should receive active event", function() {
      assert.equal(events.active.name, 'open-test');
    });
  });

  describe("closing a window", function() {
    before(function() {
      let window;
      browser.on('closed', function(window) {
        events.close = window;
      });
      browser.on('inactive', function(window) {
        events.inactive = window;
      });
      window = browser.open({ name: 'close-test' });
      window.close();
    });

    it("should receive closed event", function() {
      assert.equal(events.close.name, 'close-test');
    });

    it("should receive inactive event", function() {
      assert.equal(events.active.name, 'open-test');
    });
  });

  describe("loading a document", function() {
    before(function() {
      brains.static('/browser-events/document', "Very well then");

      browser.on('loading', function(document) {
        events.loading = [document.URL, document.readyState, document.outerHTML];
      });
      browser.on('loaded', function(document) {
        events.loaded = [document.URL, document.readyState, document.outerHTML];
      });

      return browser.visit('/browser-events/document');
    });

    it("should receive loading event", function() {
      let [url, readyState, html] = events.loading;
      assert.equal(url, 'http://example.com/browser-events/document');
      assert.equal(readyState, 'loading');
      assert.equal(html, "");
    });

    it("should receive loaded event", function() {
      let [url, readyState, html] = events.loaded;
      assert.equal(url, 'http://example.com/browser-events/document');
      assert.equal(readyState, 'complete');
      assert(/Very well then/.test(html));
    });
  });

  describe("firing an event", function() {
    before(function() {
      browser.load("Hello");

      browser.on('event', function(event, target) {
        if (event.type == 'click')
          events.click = { event, target };
      });

      browser.click('body');
      return browser.wait();
    });

    it("should receive DOM event", function() {
      assert.equal(events.click.event.type, 'click');
    });

    it("should receive DOM event target", function() {
      assert.equal(events.click.target, browser.document.body);
    });
  });

  describe("changing focus", function() {
    before(function() {
      brains.static('/browser-events/focus', `

          <input id='input'>

        `);

      browser.on('focus', function(element) {
        events.focus = element;
      });

      return browser.visit('/browser-events/focus');
    });

    it("should receive focus event", function() {
      let element = events.focus;
      assert.equal(element.id, 'input');
    });
  });

  describe("timeout fired", function() {
    before(function() {
      brains.static('/browser-events/timeout', `

        `);

      browser.on('timeout', function(fn, delay) {
        events.timeout = { fn, delay };
      });

      return browser.visit('/browser-events/timeout');
    });

    it("should receive timeout event with the function", function() {
      assert.equal(typeof(events.timeout.fn), 'function');
    });

    it("should receive timeout event with the delay", function() {
      assert.equal(events.timeout.delay, 1);
    });
  });

  describe("interval fired", function() {
    before(function() {
      brains.static('/browser-events/interval', `

      `);

      browser.on('interval', function(fn, interval) {
        events.interval = { fn, interval };
      });

      browser.visit('/browser-events/interval');
      return browser.wait({ duration: 100 });
    });

    it("should receive interval event with the function", function() {
      assert.equal(typeof(events.interval.fn), 'function');
    });

    it("should receive interval event with the interval", function() {
      assert.equal(events.interval.interval, 2);
    });
  });

  describe("event loop empty", function() {
    before(function() {
      brains.static('/browser-events/done', `

      `);

      browser.on('done', function() {
        events.done = true;
      });

      browser.visit('/browser-events/done');
      events.done = false;
      return browser.wait();
    });

    it("should receive done event", function() {
      assert(events.done);
    });
  });

  describe("evaluated", function() {
    before(function() {
      brains.static('/browser-events/evaluated', `

      `);

      browser.on('evaluated', function(code, result, filename) {
        events.evaluated = { code, result, filename };
      });

      return browser.visit('/browser-events/evaluated');
    });

    it("should receive evaluated event with the code", function() {
      assert.equal(events.evaluated.code, "window.foo = true");
    });

    it("should receive evaluated event with the result", function() {
      assert.equal(events.evaluated.result, true);
    });

    it("should receive evaluated event with the filename", function() {
      assert.equal(events.evaluated.filename, 'http://example.com/browser-events/evaluated:script');
    });
  });

  describe("link", function() {
    before(async function() {
      brains.static('/browser-events/link', "");

      browser.on('link', function(url, target) {
        events.link = { url, target };
      });

      await browser.visit('/browser-events/link');
      browser.click('a');
    });

    it("should receive link event with the URL", function() {
      assert.equal(events.link.url, 'http://example.com/browser-events/follow');
    });

    it("should receive link event with the target", function() {
      assert.equal(events.link.target, '_self');
    });
  });

  describe("submit", function() {
    before(async function() {
      brains.static('/browser-events/submit', "<form action='post'></form>");

      brains.static('/browser-events/post', "Got it!");

      browser.on('submit', function(url, target) {
        events.link = { url, target };
      });

      await browser.visit('/browser-events/submit');
      browser.query('form').submit();
      await browser.wait();
    });

    it("should receive submit event with the URL", function() {
      assert.equal(events.link.url, 'http://example.com/browser-events/post');
    });

    it("should receive submit event with the target", function() {
      assert.equal(events.link.target, '_self');
    });
  });

  after(function() {
    browser.destroy();
  });
});


text:
<?php defined('BX_DOL') or die('hack attempt');

class BxPersonsUploaderCoverCrop extends BxBaseModProfileUploaderCoverCrop
{
    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
    {
        $this->_oModule = BxDolModule::getInstance('bx_persons');
        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
    }
}

/** @} */


text:
package com.bazaarvoice.emodb.sor.api;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.annotation.Nullable;

/**
 * Exception that is thrown when attempting to access data in a locally inaccessible placement.  For example, if a
 * table exists in an EU-only placement then this exception would be thrown when reading its contents from a
 * US EmoDB cluster.
 */
@JsonIgnoreProperties({"cause", "localizedMessage", "stackTrace"})
public class UnknownPlacementException extends IllegalArgumentException {
    private final String _placement;
    // If this exception was thrown in the context of reading a table then this attribute will be set to the table name.
    private String _table;

    public UnknownPlacementException() {
        _placement = null;
    }

    public UnknownPlacementException(String placement) {
        super(placement);
        _placement = placement;
    }

    public UnknownPlacementException(String message, String placement) {
        this(message, placement, null);
    }

    @JsonCreator
    public UnknownPlacementException(@JsonProperty("message") String message, @JsonProperty("placement") String placement,
                                     @Nullable @JsonProperty("table") String table) {
        super(message);
        _placement = placement;
        _table = table;
    }

    public UnknownPlacementException(String message, Throwable cause) {
        super(message, cause);
        _placement = null;
    }

    public String getPlacement() {
        return _placement;
    }

    public String getTable() {
        return _table;
    }

    public void setTable(String table) {
        _table = table;
    }
}


text:
<#PSScriptInfo
.VERSION 1.0.1
.GUID ab9a3c8a-b63a-4a54-94d7-807da3e799e4
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/ActiveDirectoryDsc/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/ActiveDirectoryDsc
.ICONURI https://dsccommunity.org/images/DSC_Logo_300p.png
.RELEASENOTES
Updated author, copyright notice, and URLs.
#>

#Requires -Module ActiveDirectoryDsc

<#
    .DESCRIPTION
        This configuration will create a new one way inbound trust between two
        domains, and allows the trust to recreated if it should have the wrong
        trust type.
#>
Configuration ADDomainTrust_ExternalInboundTrustWithOptInToRecreate_Config
{
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $SourceDomain,

        [Parameter(Mandatory = $true)]
        [System.String]
        $TargetDomain,

        [Parameter(Mandatory = $true)]
        [System.Management.Automation.PSCredential]
        $TargetDomainAdminCred
    )

    Import-DscResource -module ActiveDirectoryDsc

    node localhost
    {
        ADDomainTrust 'Trust'
        {
            Ensure               = 'Present'
            SourceDomainName     = $SourceDomain
            TargetDomainName     = $TargetDomain
            TargetCredential     = $TargetDomainAdminCred
            TrustDirection       = 'Inbound'
            TrustType            = 'External'
            AllowTrustRecreation = $true
        }
    }
}


text:
import sys
import os
import pika
import xmlrpclib
import time
import threading
import logging

logging.basicConfig(level=logging.INFO, format='(%(threadName)-10s) %(message)s')

class WorkflowManagerClient(object):
    '''
    Python client used to interact with a remote Workflow Manager via the XML/RPC API.
    Available methods are defined in Java class org.apache.oodt.cas.workflow.system.XmlRpcWorkflowManager.

    IMPORTANT: this class is NOT thread safe because xmlrpclib is NOT thread safe under Pythn 2.7
    '''

    def __init__(self,
                 workflow_event,
                 workflowManagerUrl='http://localhost:9001/',
                 verbose=False):

        # connect to Workflow Manager server
        self.workflowManagerServerProxy = xmlrpclib.ServerProxy(workflowManagerUrl, verbose=verbose)

        # retrieve workflow definition
        self.workflowTasks = self._getWorkflowTasks(workflow_event)
        logging.info('Workflow tasks: %s' % self.workflowTasks)

    def _getWorkflowTasks(self, workflow_event):
        '''Retrieves the workflow tasks by the triggering event.'''

        workflows =  self.workflowManagerServerProxy.workflowmgr.getWorkflowsByEvent(workflow_event)
        for workflow in workflows:
            tasks = []
            for task in workflow['tasks']:
                tasks.append(task['id'])
            return tasks # assume only one workflow for each event

    def executeWorkflow(self, metadata):
        '''
        Public method that submits a workflow using the specified metadata,
        then blocks until its completion.
        '''

        # submit workflow
        wInstId = self.workflowManagerServerProxy.workflowmgr.executeDynamicWorkflow(self.workflowTasks, metadata)

        # wait for workflow completion
        return self._waitForWorkflowCompletion(wInstId)

    def _waitForWorkflowCompletion(self, wInstId):
        ''' Monitors a workflow instance until it completes.'''

        # now use the workflow instance id to check for status, wait until completed
        running_status  = ['CREATED', 'QUEUED', 'STARTED', 'PAUSED']
        pge_task_status = ['STAGING INPUT', 'BUILDING CONFIG FILE', 'PGE EXEC', 'CRAWLING']
        finished_status = ['FINISHED', 'ERROR', 'METMISS']
        status = 'UNKNOWN'
        while (True):
            # wait for the server to instantiate this workflow before querying it
            # then wait in between status checks
            time.sleep(1)
            try:
                response = self.workflowManagerServerProxy.workflowmgr.getWorkflowInstanceById(wInstId)
                if response is not None:
                    status = response['status']
                    if status in running_status or status in pge_task_status:
                        logging.debug('Workflow instance=%s running with status=%s' % (wInstId, status))

                    elif status in finished_status:
                        logging.info('Workflow instance=%s ended with status=%s' % (wInstId, status))
                        break
                    else:
                        logging.warn('UNRECOGNIZED WORKFLOW STATUS: %s' % status)
                        break
            # xmlrpclib will throw an Exception if the workflow instance is not instantiated
            except Exception as e:
                logging.warn(e.message)

        return status


text:
//  Copyright 2016, 2017 Google Inc. All Rights Reserved.
//
//  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.

namespace NtApiDotNet.Win32
{
    /// <summary>
    /// Single DLL import function.
    /// </summary>
    public sealed class DllImportFunction
    {
        /// <summary>
        /// The name of the DLL importing from.
        /// </summary>
        public string DllName { get; }
        /// <summary>
        /// The name of the imported function. If an ordinal this is #ORD.
        /// </summary>
        public string Name { get; }
        /// <summary>
        /// Address of the imported function. Can be 0 if not a bound DLL.
        /// </summary>
        public long Address { get; }
        /// <summary>
        /// Ordinal of import, if imported by ordinal. -1 if not.
        /// </summary>
        public int Ordinal { get; }

        internal DllImportFunction(string dll_name,
            string name, long address, int ordinal)
        {
            DllName = dll_name;
            Name = name;
            Address = address;
            Ordinal = ordinal;
        }

        /// <summary>
        /// Overridden ToString method.
        /// </summary>
        /// <returns>The name of the imported function.</returns>
        public override string ToString()
        {
            return Name;
        }
    }
}


text:
const assert = require( 'assert' );

module.exports = {
	description: 'does not treat this.foo as a possible namespace (#1258)',
	exports: exports => {
		assert.equal( typeof exports.Foo, 'function' );
	}
};


text:
import pytest

from six import StringIO

from tests.base import BaseTest

class TestFileApi(BaseTest):

    @pytest.fixture(scope='class')
    def file(self, app):
        file = StringIO(app.session_name('test content'))
        setattr(file, 'name', app.session_name('test_file'))
        yield file

    def test_upload(self, client, file):
        uploaded_file_name = client.file_api.upload(file)
        assert file.name in uploaded_file_name, u'File name is a part of the returned identifier.'


text:
package org.apache.hadoop.hive.ql.io;

import org.apache.hadoop.mapred.Partitioner;

/** Partition keys by their {@link Object#hashCode()}. */
public interface HivePartitioner<K2, V2> extends Partitioner<K2, V2> {

  /**
   * Get the final bucket within a partition.
   */
  public int getBucket(K2 key, V2 value, int numBuckets);
}


text:
using System;
using System.Threading;
using System.Threading.Tasks;
using Azure.AI.Language.Conversations.Models;
using Azure.Core;
using Azure.Core.Pipeline;

namespace Azure.AI.Language.Conversations
{
    ///
    /// The <see cref="ConversationAnalysisClient"/> allows you analyze conversations.
    ///
    public class ConversationAnalysisClient
    {
        internal const string AuthorizationHeader = "Ocp-Apim-Subscription-Key";

        private readonly ConversationAnalysisRestClient _analysisRestClient;

        ///
        /// Initializes a new instance of the <see cref="ConversationAnalysisClient"/> class.
        ///
        /// <param name="endpoint">The Conversation Analysis endpoint on which to operate.</param>
        /// <param name="credential">An <see cref="AzureKeyCredential"/> used to authenticate requests to the <paramref name="endpoint"/>.</param>
        /// <exception cref="ArgumentNullException"><paramref name="endpoint"/> or <paramref name="credential"/> is null.</exception>
        public ConversationAnalysisClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, null)
        {
        }

        ///
        /// Initializes a new instance of the <see cref="ConversationAnalysisClient"/> class.
        ///
        /// <param name="endpoint">The Conversation Analysis endpoint on which to operate.</param>
        /// <param name="credential">An <see cref="AzureKeyCredential"/> used to authenticate requests to the <paramref name="endpoint"/>.</param>
        /// <param name="options">Optional <see cref="ConversationAnalysisClientOptions"/> to customize requests sent to the endpoint.</param>
        /// <exception cref="ArgumentNullException"><paramref name="endpoint"/> or <paramref name="credential"/> is null.</exception>
        public ConversationAnalysisClient(Uri endpoint, AzureKeyCredential credential, ConversationAnalysisClientOptions options)
        {
            Argument.AssertNotNull(endpoint, nameof(endpoint));
            Argument.AssertNotNull(credential, nameof(credential));

            Endpoint = endpoint;
            options ??= new ConversationAnalysisClientOptions();

            Diagnostics = new ClientDiagnostics(options);
            Pipeline = HttpPipelineBuilder.Build(
                options,
                new AzureKeyCredentialPolicy(credential, AuthorizationHeader));

            _analysisRestClient = new(Diagnostics, Pipeline, Endpoint, options.Version);
        }

        ///
        /// Protected constructor to allow mocking.
        ///
        protected ConversationAnalysisClient()
        {
        }

        ///
        /// Get the service endpoint for this client.
        ///
        public virtual Uri Endpoint { get; }

        ///
        /// Gets the <see cref="ClientDiagnostics"/> for this client.
        ///
        private protected virtual ClientDiagnostics Diagnostics { get; }

        ///
        /// Gets the <see cref="HttpPipeline"/> for this client.
        ///
        private protected virtual HttpPipeline Pipeline { get; }

        /// Analyzes a conversational utterance.
        /// <param name="projectName">The name of the project to use.</param>
        /// <param name="deploymentName">The deployment name of the project to use, such as "test" or "production".</param>
        /// <param name="query">The conversation utterance to be analyzed.</param>
        /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param>
        /// <exception cref="ArgumentNullException"><paramref name="projectName"/>, <paramref name="deploymentName"/>, or <paramref name="query"/> is null.</exception>
        /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception>
        public virtual Task<Response<AnalyzeConversationResult>> AnalyzeConversationAsync(string projectName, string deploymentName, string query, CancellationToken cancellationToken = default) =>
            AnalyzeConversationAsync(new AnalyzeConversationOptions(projectName, deploymentName, query), cancellationToken);

        /// Analyzes a conversational utterance.
        /// <param name="options">
        /// An <see cref="AnalyzeConversationOptions"/> containing the <see cref="AnalyzeConversationOptions.ProjectName"/>,
        /// <see cref="AnalyzeConversationOptions.DeploymentName"/>, <see cref="AnalyzeConversationOptions.Query"/>, and other options to analyze.</param>
        /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param>
        /// <exception cref="ArgumentNullException"><paramref name="options"/> is null.</exception>
        /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception>
        public virtual async Task<Response<AnalyzeConversationResult>> AnalyzeConversationAsync(AnalyzeConversationOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using DiagnosticScope scope = Diagnostics.CreateScope($"{nameof(ConversationAnalysisClient)}.{nameof(AnalyzeConversation)}");
            scope.AddAttribute("projectName", options.ProjectName);
            scope.AddAttribute("deploymentName", options.DeploymentName);
            scope.Start();

            try
            {
                return await _analysisRestClient.AnalyzeConversationAsync(options.ProjectName, options.DeploymentName, options, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                scope.Failed(ex);
                throw;
            }
        }

        /// Analyzes a conversational utterance.
        /// <param name="projectName">The name of the project to use.</param>
        /// <param name="deploymentName">The deployment name of the project to use, such as "test" or "production".</param>
        /// <param name="query">The conversation utterance to be analyzed.</param>
        /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param>
        /// <exception cref="ArgumentNullException"><paramref name="projectName"/>, <paramref name="deploymentName"/>, or <paramref name="query"/> is null.</exception>
        /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception>
        public virtual Response<AnalyzeConversationResult> AnalyzeConversation(string projectName, string deploymentName, string query, CancellationToken cancellationToken = default) =>
            AnalyzeConversation(new AnalyzeConversationOptions(projectName, deploymentName, query), cancellationToken);

        /// Analyzes a conversational utterance.
        /// <param name="options">
        /// An <see cref="AnalyzeConversationOptions"/> containing the <see cref="AnalyzeConversationOptions.ProjectName"/>,
        /// <see cref="AnalyzeConversationOptions.DeploymentName"/>, <see cref="AnalyzeConversationOptions.Query"/>, and other options to analyze.</param>
        /// <param name="cancellationToken">An optional <see cref="CancellationToken"/> to cancel the request.</param>
        /// <exception cref="ArgumentNullException"><paramref name="options"/> is null.</exception>
        /// <exception cref="RequestFailedException">The service returned an error. The exception contains details of the service error.</exception>
        public virtual Response<AnalyzeConversationResult> AnalyzeConversation(AnalyzeConversationOptions options, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(options, nameof(options));

            using DiagnosticScope scope = Diagnostics.CreateScope($"{nameof(ConversationAnalysisClient)}.{nameof(AnalyzeConversation)}");
            scope.AddAttribute("projectName", options.ProjectName);
            scope.AddAttribute("deploymentName", options.DeploymentName);
            scope.Start();

            try
            {
                return _analysisRestClient.AnalyzeConversation(options.ProjectName, options.DeploymentName, options, cancellationToken);
            }
            catch (Exception ex)
            {
                scope.Failed(ex);
                throw;
            }
        }
    }
}


text:
Youtube presentation
========

[![Presentation](http://img.youtube.com/vi/Q8NfP97bAZU/0.jpg)](https://www.youtube.com/watch?v=Q8NfP97bAZU)


text:
"""
Django settings for procafe project.

For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

TEMPLATE_DIRS = ( os.path.join(BASE_DIR, 'procafe/templates/'),
                  os.path.dirname(BASE_DIR) + '/procafe/templates/',)

MEDIA_DIR = os.path.join(BASE_DIR, 'procafe/media/')

STATIC_ROOT = os.path.join(BASE_DIR, 'procafe/static/')
STATIC_URL = '/static/'
STATICFILES_DIRS = ( os.path.join(BASE_DIR,'procafe/static/media/'),
                     os.path.join(BASE_DIR,'procafe/static/admin'))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'e$h4gpt@rv*!gxp5+1+-8%s=w9fa=szcwi6t+vuw5=_i_z^ja_'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'procafeusb@gmail.com'
EMAIL_HOST_PASSWORD = 'jamonsito'

# Templates processors
TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request',
)

# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'appProcafe',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'procafe.urls'

WSGI_APPLICATION = 'procafe.wsgi.application'

# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'es-es'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
REPOSITORY_ROOT = os.path.dirname(BASE_DIR)

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(REPOSITORY_ROOT, 'static/')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(REPOSITORY_ROOT, 'media/')

LOGIN_URL = 'django.contrib.auth.views.login'
LOGIN_REDIRECT_URL = "/appProcafe/index/"


text:
package org.synchronoss.cloud.nio.multipart.util.collect;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.testing.GcFinalization;
import org.junit.Test;

import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.NoSuchElementException;

import static org.junit.Assert.*;

/**
 *
 Class taken from the google guava project guava
 *
 *
 Unit test for {@code AbstractIterator}.
 *
 * @author Kevin Bourrillion
 */
@SuppressWarnings("serial") // No serialization is used in this test
@GwtCompatible(emulated = true)
// TODO(cpovirk): why is this slow (>1m/test) under GWT when fully optimized?
public class AbstractIteratorTest {

    @Test
    public void testDefaultBehaviorOfNextAndHasNext() {

        // This sample AbstractIterator returns 0 on the first call, 1 on the
        // second, then signals that it's reached the end of the data
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            private int rep;
            @Override public Integer computeNext() {
                switch (rep++) {
                    case 0:
                        return 0;
                    case 1:
                        return 1;
                    case 2:
                        return endOfData();
                    default:
                        fail("Should not have been invoked again");
                        return null;
                }
            }
        };

        assertTrue(iter.hasNext());
        assertEquals(0, (int) iter.next());

        // verify idempotence of hasNext()
        assertTrue(iter.hasNext());
        assertTrue(iter.hasNext());
        assertTrue(iter.hasNext());
        assertEquals(1, (int) iter.next());

        assertFalse(iter.hasNext());

        // Make sure computeNext() doesn't get invoked again
        assertFalse(iter.hasNext());

        try {
            iter.next();
            fail("no exception thrown");
        } catch (NoSuchElementException expected) {
        }
    }

    @Test
    public void testDefaultBehaviorOfPeek() {
    /*
     * This sample AbstractIterator returns 0 on the first call, 1 on the
     * second, then signals that it's reached the end of the data
     */
        AbstractIterator<Integer> iter = new AbstractIterator<Integer>() {
            private int rep;
            @Override public Integer computeNext() {
                switch (rep++) {
                    case 0:
                        return 0;
                    case 1:
                        return 1;
                    case 2:
                        return endOfData();
                    default:
                        fail("Should not have been invoked again");
                        return null;
                }
            }
        };

        assertEquals(0, (int) iter.peek());
        assertEquals(0, (int) iter.peek());
        assertTrue(iter.hasNext());
        assertEquals(0, (int) iter.peek());
        assertEquals(0, (int) iter.next());

        assertEquals(1, (int) iter.peek());
        assertEquals(1, (int) iter.next());

        try {
            iter.peek();
            fail("peek() should throw NoSuchElementException at end");
        } catch (NoSuchElementException expected) {
        }

        try {
            iter.peek();
            fail("peek() should continue to throw NoSuchElementException at end");
        } catch (NoSuchElementException expected) {
        }

        try {
            iter.next();
            fail("next() should throw NoSuchElementException as usual");
        } catch (NoSuchElementException expected) {
        }

        try {
            iter.peek();
            fail("peek() should still throw NoSuchElementException after next()");
        } catch (NoSuchElementException expected) {
        }
    }

    @GwtIncompatible("weak references")
    @Test
    public void testFreesNextReference() {
        Iterator<Object> itr = new AbstractIterator<Object>() {
            @Override public Object computeNext() {
                return new Object();
            }
        };
        WeakReference<Object> ref = new WeakReference<Object>(itr.next());
        GcFinalization.awaitClear(ref);
    }

    @Test
    public void testDefaultBehaviorOfPeekForEmptyIteration() {

        AbstractIterator<Integer> empty = new AbstractIterator<Integer>() {
            private boolean alreadyCalledEndOfData;
            @Override public Integer computeNext() {
                if (alreadyCalledEndOfData) {
                    fail("Should not have been invoked again");
                }
                alreadyCalledEndOfData = true;
                return endOfData();
            }
        };

        try {
            empty.peek();
            fail("peek() should throw NoSuchElementException at end");
        } catch (NoSuchElementException expected) {
        }

        try {
            empty.peek();
            fail("peek() should continue to throw NoSuchElementException at end");
        } catch (NoSuchElementException expected) {
        }
    }

    @Test
    public void testSneakyThrow() throws Exception {
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            boolean haveBeenCalled;
            @Override public Integer computeNext() {
                if (haveBeenCalled) {
                    fail("Should not have been called again");
                } else {
                    haveBeenCalled = true;
                    sneakyThrow(new SomeCheckedException());
                }
                return null; // never reached
            }
        };

        // The first time, the sneakily-thrown exception comes out
        try {
            iter.hasNext();
            fail("No exception thrown");
        } catch (Exception e) {
            if (!(e instanceof SomeCheckedException)) {
                throw e;
            }
        }

        // But the second time, AbstractIterator itself throws an ISE
        try {
            iter.hasNext();
            fail("No exception thrown");
        } catch (IllegalStateException expected) {
        }
    }

    @Test
    public void testException() {
        final SomeUncheckedException exception = new SomeUncheckedException();
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            @Override public Integer computeNext() {
                throw exception;
            }
        };

        // It should pass through untouched
        try {
            iter.hasNext();
            fail("No exception thrown");
        } catch (SomeUncheckedException e) {
            assertSame(exception, e);
        }
    }

    @Test
    public void testExceptionAfterEndOfData() {
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            @Override public Integer computeNext() {
                endOfData();
                throw new SomeUncheckedException();
            }
        };
        try {
            iter.hasNext();
            fail("No exception thrown");
        } catch (SomeUncheckedException expected) {
        }
    }

    @Test
    public void testCantRemove() {
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            boolean haveBeenCalled;
            @Override public Integer computeNext() {
                if (haveBeenCalled) {
                    endOfData();
                }
                haveBeenCalled = true;
                return 0;
            }
        };

        assertEquals(0, (int) iter.next());

        try {
            iter.remove();
            fail("No exception thrown");
        } catch (UnsupportedOperationException expected) {
        }
    }

    @Test
    public void testReentrantHasNext() {
        Iterator<Integer> iter = new AbstractIterator<Integer>() {
            @Override protected Integer computeNext() {
                hasNext();
                return null;
            }
        };
        try {
            iter.hasNext();
            fail();
        } catch (IllegalStateException expected) {
        }
    }

    // Technically we should test other reentrant scenarios (9 combinations of
    // hasNext/next/peek), but we'll cop out for now, knowing that peek() and
    // next() both start by invoking hasNext() anyway.

    /**
     * Throws a undeclared checked exception.
     */
    private static void sneakyThrow(Throwable t) {
        class SneakyThrower<T extends Throwable> {
            @SuppressWarnings("unchecked") // not really safe, but that's the point
            void throwIt(Throwable t) throws T {
                throw (T) t;
            }
        }
        new SneakyThrower<Error>().throwIt(t);
    }

    private static class SomeCheckedException extends Exception {
    }

    private static class SomeUncheckedException extends RuntimeException {
    }
}


text:
package com.karuslabs.commons.item.meta;

import com.karuslabs.commons.item.Builder;

import javax.annotation.Nonnull;

import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.EnchantmentStorageMeta;

public class EnchantmentStorageBuilder extends Builder<EnchantmentStorageBuilder, EnchantmentStorageMeta> {

    public EnchantmentStorageBuilder(ItemStack item) {
        super(item);
    }

    public EnchantmentStorageBuilder(Builder builder) {
        super(builder);
    }

    public EnchantmentStorageBuilder stored(Enchantment enchantment, int level, boolean ignoreRestriction) {
        meta.addStoredEnchant(enchantment, level, ignoreRestriction);
        return this;
    }

    @Override
    protected @Nonnull EnchantmentStorageBuilder getThis() {
        return this;
    }

}


text:
PPnet
=====

**March, 2018: This project is not maintained any more!**

# What is this?

"**We need something like Facebook, but just not Facebook.**"
*If you heard that from your client, or thought that yourself, PPnet might be for you.*

Create and host your own social network. With some simple steps you can get it in less then 15 minutes.
This project is partly funded by the Europian Union through the [FI-CONTENT](http://mediafi.org/?portfolio=social-network).

# Version 2.0
PPnet is built as a single page application (SPA) in the JavaScript framework AngularJS, and uses a [PouchDB](https://github.com/pouchdb/pouchdb)/CouchDB combination for data synchronisation. The nice thing about this architecture is that you only need a CouchDB as a server side component (plus a simple HTTP Server) and that it works in online/offline mode. Additionally, it can authenticate against OAuth2 comaptible providers [(like KeyRock)](https://github.com/ging/fi-ware-idm).

# Installation

## tl;dr
### Build the project
```
gem install compass
git clone https://github.com/pixelpark/ppnet
cd ppnet
npm install -g gulp bower
npm install
bower install
gulp
```

### Build the Phonegap/Cordova App
**The project must be build.**

```
gulp build

cordova platform add android
cordova platform add ios

phonegap plugin add org.apache.cordova.device-orientation
phonegap plugin add org.apache.cordova.file
phonegap plugin add org.apache.cordova.file-transfer
phonegap plugin add org.apache.cordova.device
phonegap plugin add org.apache.cordova.camera
phonegap plugin add org.apache.cordova.statusbar
phonegap plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
phonegap plugin add https://github.com/apache/cordova-plugin-whitelist.git

phonegap build android
phonegap run android
```

## Docker
To get ppnet running in three simple steps with docker, you have to do this.
```
git clone https://github.com/pixelpark/ppnet .
docker build -t pixelpark/ppnet .
docker run -d -p 8000:80 pixelpark/ppnet
```
## Giant Swarm
If you are familiar with [Docker](https://www.docker.com/), you are just one step away from your PPnet running - [you will find it in this README](https://github.com/pixelpark/ppnet/blob/master/server/DOCKER.MD).

It should be noted that we built the Docker environment in collaboration with the friendly people from [Giant Swarm](https://giantswarm.io/). Their startup is based on the idea of handling Docker containers in a simple way.

## Steps for a simple quickstart

If you don't want to go through the hassle of installing development tools you can test PPnet by following these steps:

1. simply [download the zip file of this repository](https://github.com/pixelpark/ppnet/archive/master.zip),
2. navigate to the www directory (`cd www`)
3. start a web server right there (`python -m SimpleHTTPServer` or `python3 -m http.server `)
4. Navigate to ```http://localhost:8000```

You should see PPnet with that latest entries of our test database.

To connect to your own database, you only need to change the `remote`entry in the [config file](https://github.com/pixelpark/ppnet/blob/master/www/config.json#L6) to a running, CORS enabled CouchDB.
Changing this is the minimum thing you want to do to create your own database for your own social network. You will want to change the other entries too, to change the name of the application, the default location and so forth.

#Server / Proxy
If you want to run PPnet behind a Proxy, especially the connection to the CouchDB, you should use server.js. You find the file and a readme in the folder "server".

#Video
There is a somewhat [outdated video of PPnet in action](https://www.youtube.com/watch?v=DYPGQlC5SVA&feature=youtu.be) which will updated soon.

# Build
You can find more build instructions [here](https://github.com/pixelpark/ppnet/blob/master/BUILD.md).

## FAQ
The FAQ is [here](https://github.com/pixelpark/ppnet/blob/master/FAQ.md).

# Team
- Tobias Rotter ([@tobiasrotter](https://github.com/tobiasrotter))
- Philipp Reinking ([@PhilReinking](https://github.com/PhilReinking))
- Dirk Krause ([@dirkk0](https://github.com/dirkk0))
- Daniel Pritzkau ([@teawithfruit](https://github.com/teawithfruit))
- Markus Neuy ([@markusneuy](https://github.com/markusneuy))


text:
namespace DT3 {

//==============================================================================
/// Forward declarations
//==============================================================================

class TextureResource2D;
class TextureResource3D;
class TextureResourceCube;

//==============================================================================
/// Class
//==============================================================================

class ImporterImage: public BaseClass {
    public:
        DEFINE_TYPE(ImporterImage,BaseClass)

									ImporterImage		(void);

	private:
									ImporterImage		(const ImporterImage &rhs);
        ImporterImage &				operator =			(const ImporterImage &rhs);

    public:
        virtual						~ImporterImage		(void);

    public:
		/// Imports an image into a TextureResource2D
		/// \param target object to import texture into
		/// \param args arguments to importer
        /// \return error code
		virtual DTerr				import				(TextureResource2D *target, std::string args) = 0;

		/// Imports an image into a TextureResource3D
		/// \param target object to import texture into
		/// \param args arguments to importer
        /// \return error code
		virtual DTerr				import				(TextureResource3D *target, std::string args) = 0;

		/// Imports an image into a TextureResourceCube
		/// \param target object to import texture into
		/// \param args arguments to importer
        /// \return error code
		virtual DTerr				import				(TextureResourceCube *target, std::string args) = 0;
};

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

} // DT3

#endif


text:
using System.Security;

namespace Alphaleonis.Win32.Filesystem
{
   partial class DirectoryInfo
   {
      #region .NET

      /// <summary>Refreshes the state of the object.</summary>
      [SecurityCritical]
      public new void Refresh()
      {
         base.Refresh();
      }

      #endregion // .NET
   }
}