Jetzt gibt es eine Map von Listen und man muss immer alles komplett Ueberpruefen - ggf. optimieren
483588
private void doHousekeeping() {
        logger.info("started");
        while (!shutdown) {
            try {
                List<EarlyResponse> removedEarlyResponses = new ArrayList<>();
                synchronized (responseMap) {
                    Iterator<List<EarlyResponse>> responseMapIterator = responseMap.values().iterator();
                    while (responseMapIterator.hasNext()) {
                        List<EarlyResponse> erList = responseMapIterator.next();
                        Iterator<EarlyResponse> erListIterator = erList.iterator();
                        while (erListIterator.hasNext()) {
                            EarlyResponse earlyResponse = erListIterator.next();
                            if (earlyResponse.ts < System.currentTimeMillis()) {
                                responseMapIterator.remove();
                                removedEarlyResponses.add(earlyResponse);
                            }
                        }
                        if (erList.isEmpty()) {
                            responseMapIterator.remove();
                        }
                    }
                }
                for (EarlyResponse er : removedEarlyResponses) {
                    logger.info("Removed early response with correlationId {} and responseId {}", er.response.getCorrelationId(), er.response.getResponseId());
                }
                removedEarlyResponses = null; // let the GC do its job :-)
                Thread.sleep(checkInterval);
            } catch (InterruptedException e) {
                // ignore
            }
        }
        logger.info("stopped");
    }
261766
function setupDeveloperMenu(param) {
	var gdr = engineFiles.gameDriver;
	var defaultTotalTimeLimit = 85; // 85秒をデフォルトの制限時間としてあつかう。

	// loocalStorageにメニューの位置、サイズを保存している
	var config = {};
	if ("localStorage" in window) {
		var saved = JSON.parse(localStorage.getItem("akashic-sandbox-config"));
		if (saved) {
			config = saved;
		}
	}
	if (config.size == null) {
		config.size = {
			right: {width: "400px", height: "100%"},
			bottom: {width: "100%", height: "300px"}
		};
	}
	if (config.isPositionRight == null) {
		config.isPositionRight = true;
	}
	if (config.showGrid == null) {
		config.showGrid = false;
	}
	if (config.omitInterpolatedTick == null) {
		config.omitInterpolatedTick = false;
	}
	if (isNaN(parseInt(config.totalTimeLimit, 10))) {
		config.totalTimeLimit = defaultTotalTimeLimit;
	}
	if (config.warningEs6 == null) {
		config.warningEs6 = true;
	}
	if (config.sendsSessionParameter == null) {
		config.sendsSessionParameter = false;
	}
	if (config.mode == null) {
		config.mode = "single";
	}
	// ES6以降でサポートされるオブジェクトが使われている場合警告を出す。
	if (config.warningEs6) {
		warningEs6OnConsole();
	}

	var sandboxConfig = window.sandboxDeveloperProps.sandboxConfig;

	config.autoSendEvents = config.autoSendEvents || !!sandboxConfig.autoSendEventName;
	config.eventsToSend = !!sandboxConfig.autoSendEventName ? JSON.stringify(sandboxConfig.events[sandboxConfig.autoSendEventName]) : config.eventsToSend;

	var events = {};
	if (sandboxConfig.events) {
		Object.keys(sandboxConfig.events).forEach(function (name) {
			events[name] = JSON.stringify(sandboxConfig.events[name]);
		});
	}

	var props = window.sandboxDeveloperProps;
	var amflow = props.amflow;

	// 各viewの情報
	var views = {
		'general-view': {title: "General", show: true},
		'events-view': {title: "Events", show: false},
		'camera-view': {title: "Cameras", show: false},
		'e-view': {title: "E", show: false},
		'niconico-view': {title: "Niconico", show: false},
		'playlog-view': {title: "Replay", show: false},
		'snapshot-view': {title: "Snapshot", show: false}
	};

	// vue.jsにバインドするデータ
	var data = {
		showMenu: sandboxConfig.showMenu ? sandboxConfig.showMenu : false,
		players: [],
		selfId: props.sandboxPlayer.id,
		selfName: props.sandboxPlayer.name,
		path: props.path,
		gameId: props.gameId,
		events: events,
		cameras: [],
		focusingCameraIndex: undefined,
		inputPlayerName: null,
		inputPlayerId: null,
		config: config,
		entities: [], // {className: string, id: number, children: Array}
		entityRect: {
			enable: false,
			show: false,
			withChildren: false,
			rectStyle: {top: "0px", left: "0px", width: "0px", height: "0px"}
		},
		targetEntity: null,
		snapshots: null,
		snapshotPreview: null,
		profiler: {
			show: (window.location.search.indexOf("profiler=1") >= 0), // todo: リファクタリング時にクエリオプションのパースを統一する
			expand: false
		},
		isPaused: false,
		isReplay: param.isReplay,
		currentTime: 0,
		replayDuration: param.replayDuration,
		replayDone: false,
		playlog: {
			list: [] // {name: string, url: string}
		},
		views: views,
		isIchibaContent: function() {
			var environment = props.game._configuration.environment;
			if (!environment || !environment.niconico || !environment.niconico.supportedModes) {
				return false;
			}
			return environment.niconico.supportedModes.length > 0;
		}(),
		rankingGameState: {
			score: "N/A",
			playThreshold: "N/A",
			clearThreshold: "N/A"
		},
		remainingTime: "N/A",
		isStopGame: false,
		modeList: [
			{text: "ひとりで遊ぶ(single)", value: "single"},
			{text: "ランキング(ranking)", value: "ranking"}
		]
	};

	if (config.autoJoin && !param.isReplay) {
		// NOTE: この時点でgame._loadedにgame._start()がハンドルされている必要がある
		// スナップショットから復元時はloadedが発火しないのでJOINは行われない
		props.game._loaded.addOnce(function() {
			var p = props.sandboxPlayer;
			data.players.push({player: {id: p.id, name: p.name}, self: true});
			amflow.sendEvent([0 /* Join */,  3, p.id, p.name, null ]);
		});
	}

	if (config.autoSendEvents && !param.isReplay) {
		props.game._loaded.addOnce(function () {
			sendEvents();
		});
	}

	if (config.sendsSessionParameter && data.isIchibaContent && !param.isReplay) {
		var totalTimeLimit = parseInt(config.totalTimeLimit, 10);

		if (isNaN(totalTimeLimit)) {
			totalTimeLimit = defaultTotalTimeLimit;
		}
		// ランキング用イベントを送信する。
		var sessionParameters = {
			"mode": config.mode
		};
		if (config.mode === "ranking") {
			sessionParameters["totalTimeLimit"] = totalTimeLimit;
			// 前の仕様ではtotalTimeLimitより25秒程度短いgameTimeLimitが送られていたので、互換性のためにtotalTimeLimitと一緒に送っておく。
			sessionParameters["gameTimeLimit"] = totalTimeLimit - 25;
		}
		props.game._loaded.addOnce(function () {
			amflow.sendEvent([0x20, 0, "dummy", {
				"type": "start",
				"parameters": sessionParameters
			}]);
		});
		if (config.mode === "ranking") {
			var gameStartTime = Date.now();
			var intervalId = setInterval(function () {
				var currentRemainingTime = totalTimeLimit - (Date.now() - gameStartTime) / 1000;
				data.remainingTime = currentRemainingTime > 0 ? Math.ceil(currentRemainingTime) : 0;
			}, 1000 / props.game.fps);
			setTimeout(function () {
				data.remainingTime = 0;
				clearInterval(intervalId);
				if (config.stopsGameOnTimeout) {
					if (props.game && props.game.audio) {
						// 音を明示的に止める。
						Object.keys(props.game.audio).forEach(function (key) {
							props.game.audio[key].stopAll();
						});
					}
					props.driver.stopGame();
					// akashic-sandboxがゲームを止めたことをユーザーに明示するために、強制的にメニューを開いてメッセージを表示する。
					data.isStopGame = true;
					data.showMenu = true;
					var elements = document.getElementsByClassName("dev-menu-view");
					for (var i = 0; i < elements.length; i++) {
						var element = elements[i];
						data.views[element.id].show = element.id === "niconico-view";
						element.style.display = data.views[element.id].show ? "block" : "none";
					}
				}
			}, totalTimeLimit * 1000);
		}
	}

	// 歯車ボタン
	var devBtn = document.querySelector("#dev-btn");
	devBtn.addEventListener("click", function() {
		data.showMenu = !data.showMenu;
	});


	// 設定をlocalStorageに保存する関数
	function saveConfig() {
		if ("localStorage" in window) {
			localStorage.setItem("akashic-sandbox-config", JSON.stringify(config));
		}
	}

	// プレイヤーのStorageValueStoreを生成する
	function createStorageValueStore(playerId, keys) {
		var convertedKeys = [];
		keys.forEach(function(key) {
			var ck = {};
			for (var k in key) {
				ck[k] = key[k];
			}
			ck.userId = playerId;
			convertedKeys.push(ck);
		});
		var values = props.gameStorage.load(convertedKeys);
		return new g.StorageValueStore(convertedKeys, values);
	}

	// プレイヤーをジョインさせる関数
	function joinGame() {
		var playerId = data.inputPlayerId;
		var playerName = data.inputPlayerName;
		if (!playerId) {
			alert("Player IDを入力してください");
			return;
		}
		for (var i = 0; i < data.players.length; ++i) {
			if (data.players[i].player.id === playerId) {
				alert("Player ID: \"" + playerId + "\"は既に参加しています。");
				return;
			}
		}
		if (playerId === data.selfId && inputPlayerName !== data.selfName) {
			alert("Player ID: \"" + playerId + "\"のPlayer Nameは\"" + data.selfName + "\"になります。");
			playerName = data.selfName;
		}
		data.players.push({
			player: { id: playerId, name: playerName },
			self: (playerId === props.game.selfId)
		});
		data.inputPlayerId = data.inputPlayerName = null;
		amflow.sendEvent([0 /* Join */,  3, playerId, playerName, null ]);
	}

	// プロファイラーの各種設定
	// この値は次回の redrawProfilerCanvas() 呼び出し時に適用される
	var profilerSettings = {
		expand: data.profiler.expand,
		width: 170,
		margin: 5,
		padding: 5,
		align: "vertical", // 縦並び
		// align: "horizontal", // 横並び
		bgColor: "white",
		fontColor: "black",
		fontSize: 17,
		fontMaxColor: "deeppink",
		fontMinColor: "dodgerblue",
		fontMinMaxColor: "gray",
		graphColor: "lavender",
		graphWidth: 3,
		graphWidthMargin: 1,
		graphPadding: 5
	};

	// note: プロファイラー表示処理の範囲をわかりやすくするため {} で囲んでいる
	{
		var s = {};
		var updateProfilerConfig = function() {
			s = Object.create(profilerSettings);
		};

		var profilerData = {
			fps: {
				name: "fps",
				data: [],
				max: 0,
				min: Number.MAX_VALUE
			},
			skipped: {
				name: "skipped",
				data: [],
				max: 0,
				min: Number.MAX_VALUE
			},
			interval: {
				name: "interval",
				data: [],
				max: 0,
				min: Number.MAX_VALUE
			},
			frame: {
				name: "frame",
				data: [],
				max: 0,
				min: Number.MAX_VALUE
			},
			rendering: {
				name: "rendering",
				data: [],
				max: 0,
				min: Number.MAX_VALUE
			}
		};

		var profilerCanvas = document.getElementById("profilerCanvas");
		profilerCanvas.addEventListener("click", function() {
			toggleProfilerCanvasSize();
		});
		profilerCanvas.style.display = data.profiler.show ? "block" : "none";

		var profilerCanvasContext = profilerCanvas.getContext("2d");

		// todo: SimpleProfilerのコンストラクタパラメータにgetValueTriggerを与えるように修正
		props.driver._gameLoop._clock._profiler._calculateProfilerValueTrigger.add(function(value) {
			var deltaX;
			var deltaY;
			if (s.align === "vertical") {
				deltaX = 0;
				deltaY = s.height + s.margin;
			} else {
				deltaX = s.width + s.margin;
				deltaY = 0;
			}
			updateProfilerData(profilerData.fps,       value.framePerSecond,    deltaX * 0, deltaY * 0, 2);
			updateProfilerData(profilerData.skipped,   value.skippedFrameCount, deltaX * 1, deltaY * 1, 1);
			updateProfilerData(profilerData.interval,  value.rawFrameInterval,  deltaX * 2, deltaY * 2, 1);
			updateProfilerData(profilerData.frame,     value.frameTime,         deltaX * 3, deltaY * 3, 1);
			updateProfilerData(profilerData.rendering, value.renderingTime,     deltaX * 4, deltaY * 4, 1);
		});

		var updateProfilerData = function(profilerData, profileValue, x, y, fixed) {
			profilerData.data.unshift(profileValue.ave);
			drawGraph(profilerData, profileValue, x, y, fixed);
		};
		var drawText = function(text, x, y, color, maxWidth) {
			profilerCanvasContext.fillStyle = color;
			profilerCanvasContext.fillText(text, x, y, maxWidth);
		};
		var drawGraph = function(profilerData, profilerValue, x, y, fixed) {
			profilerCanvasContext.fillStyle = s.bgColor;
			profilerCanvasContext.fillRect(x, y, s.width, s.height);
			profilerCanvasContext.fillStyle = s.graphColor;
			var min = Number.MAX_VALUE;
			var max = 0;
			for (var i = 0; i < profilerData.data.length; ++i) {
				var offsetX = s.width - i * (s.graphWidth + s.graphWidthMargin) - s.graphWidth - s.graphPadding;
				var data = profilerData.data[i];
				if (data < min) {
					min = data;
				}
				if (data > max) {
					max = data;
				}
				if (offsetX < s.graphWidth + s.graphPadding / 2) {
					profilerData.data.pop();
					break;
				}
			}
			if (min < profilerData.min) profilerData.min = min;
			if (profilerData.max < max) profilerData.max = max;

			var areaHeight = s.height - s.graphPadding * 2;
			var rate = max > areaHeight ? areaHeight / max : 1;
			for (var i = 0; i < profilerData.data.length; ++i) {
				var offsetX = s.width - i * (s.graphWidth + s.graphWidthMargin) - s.graphWidth - s.graphPadding;
				var height = profilerData.data[i] * rate;
				profilerCanvasContext.fillRect(
					x + offsetX,
					y + s.height - height - s.graphPadding,
					s.graphWidth,
					height
				);
			}
			var valueOffsetX = s.width * 0.6;
			var maxWidth = valueOffsetX - s.padding;
			var maxValueWidth = (s.width - valueOffsetX) - s.padding;
			drawText(profilerData.name + ":", x + s.padding, y + s.padding + s.fontSize, s.fontColor, maxWidth);
			drawText(profilerValue.ave.toFixed(fixed), x + valueOffsetX, y + s.padding + s.fontSize, s.fontColor, maxValueWidth);
			drawText(max.toFixed(fixed), x + valueOffsetX, y + s.padding + s.fontSize * 2, s.fontMaxColor, maxValueWidth);
			drawText(min.toFixed(fixed), x + valueOffsetX, y + s.padding + s.fontSize * 3, s.fontMinColor, maxValueWidth);
			var min_max = " " + profilerData.min.toFixed(0) + "-" + profilerData.max.toFixed(0);
			drawText(min_max, x + s.padding, y + s.padding + s.fontSize * 2.5, s.fontMinMaxColor, maxWidth);
		};

		// profilerSettings の設定にもとづいたプロファイラーを描画する
		function redrawProfilerCanvas() {
			updateProfilerConfig();
			var width;
			var height;
			s.height = s.fontSize * 3 + s.padding * 2;
			if (s.align === "vertical") {
				width = s.width;
				height = (s.height + s.margin) * Object.keys(profilerData).length - s.margin;
			} else {
				width = (s.width + s.margin) * Object.keys(profilerData).length - s.margin;
				height = s.height;
			}
			profilerCanvas.width = width;
			profilerCanvas.height = height;
			if (s.expand) {
				profilerCanvas.style.width = width * 1.5 + "px";
				profilerCanvas.style.height = height * 1.5 + "px";
			} else {
				profilerCanvas.style.width = width + "px";
				profilerCanvas.style.height = height + "px";
			}
			profilerCanvasContext.font = s.fontSize + "px sans-serif";
		}

		var profilerCheckBox = document.getElementById("show-profiler");
		// プロファイラー情報の表示をトグル表示する関数
		function toggleProfiler() {
			if (!data.profiler.show) {
				profilerCanvas.style.display = "block";
				profilerCheckBox.checked = true;
			} else {
				profilerCanvas.style.display = "none";
				profilerCheckBox.checked = false;
			}
			data.profiler.show = !data.profiler.show;
		}

		// プロファイラー情報の拡縮をトグルする関数
		function toggleProfilerCanvasSize() {
			profilerSettings.expand = !s.expand;
			redrawProfilerCanvas();
		}

		profilerCheckBox.checked = data.profiler.show;
		redrawProfilerCanvas();
	}

	// g.Game.tickを上書きする。
	var originalTickFunc = props.game.tick;
	props.game.tick = function (advanceAge, omittedTickCount) {
		if (data.isIchibaContent && props.game.vars && props.game.vars.gameState) {
			// ユーザーに値の型も意識させるため、JSON.stringifyを使用する。
			data.rankingGameState.score = getJsonStringifiedValue(props.game.vars.gameState.score);
			data.rankingGameState.playThreshold = getJsonStringifiedValue(props.game.vars.gameState.playThreshold);
			data.rankingGameState.clearThreshold = getJsonStringifiedValue(props.game.vars.gameState.clearThreshold);
		}
		return originalTickFunc.apply(props.game, arguments);
	};

	// g.Camera2Dを上書き
	/**
	 * Akashicゲームコンテンツ内で生成されたg.Camera2Dの一覧を取得する手段が無いため、
	 * g.Camera2Dのコンストラクタを無理やり上書きしている。
	 */
	var camera2D = g.Camera2D;
	var cameras = [];
	function registerCamera(cam) {
		data.cameras.push({id: cam.id, name: cam.name, local: cam.local});
		cameras.push(cam);
	}
	g.Camera2D = function () {
		camera2D.apply(this, arguments);
		registerCamera(this);
	};
	// staticメンバを再現
	Object.keys(camera2D).forEach(function (key) {
		g.Camera2D[key] = camera2D[key];
	});
	// staticメンバを再現してもデシリアライズは正常に動作しない
	// (オリジナルのコンストラクタを使ってしまう)のでさらに無理やり上書きする。
	g.Camera2D.deserialize = function (ser, game) {
		var ret = camera2D.deserialize(ser, game);
		registerCamera(ret);
		return ret;
	};
	g.Camera2D.prototype = camera2D.prototype;

	// g.Game#focusingCameraをsetter/getter化することで、コンテンツ側からのfocusingCameraの変更を感知
	Object.defineProperty(props.game, "focusingCamera", {
		set: function(c) {
			data.focusingCameraIndex = cameras.indexOf(c);
		},
		get: function() {
			return cameras[data.focusingCameraIndex];
		}
	});

	// viewを表示する関数
	// v-showで上手くやるべきかもしれない
	function renderView(vm) {
		var viewElms = vm.$el.querySelectorAll(".dev-menu-view");
		for (var i = 0; i < viewElms.length; i++) {
			var el = viewElms[i];
			el.style.display = data.views[el.id].show ? "block" : "none";
		}
	}

	// g.Eから {className: string, id: number, children: Array} を作る
	function createEntityObject(e) {
		var obj = {id: e.id, className: e.constructor.name, children: []};
		if (e.children && e.children.length > 0) {
			e.children.forEach(function(c) {
				obj.children.push(createEntityObject(c));
			});
		}
		return obj;
	}

	// 親エンティティを辿り、掛けあわせたマトリックスを返す
	function parentsMatrix(e, focusingCamera) {
		if (e.parent && e.parent.getMatrix) {
			var m1 = e.parent.getMatrix();
			var m2 = parentsMatrix(e.parent, focusingCamera);
			if (m2) {
				return m1.multiplyNew(m2);
			}
			return m1;
		} else {
			if (focusingCamera) {
				return focusingCamera.getMatrix();
			}
			return undefined;
		}
	}

	// g.E#_calculateBoundingRectを改造したもので、hidden状態のエンティティの包含矩形の計算、子孫エンティティを計算対象に含めるかどうかの指定ができる
	// NOTE: g.E#_calculateBoundingRectが実装クラスによりオーバーライドされる可能性があるためakashic-engineにデバッグ用の包含矩形計算機能を入れる方が良い
	function calculateEntityBoundingRect(entity, parentsMatrix, withChildren) {
		var matrix = entity.getMatrix();
		if (parentsMatrix) {
			matrix = parentsMatrix.multiplyNew(matrix);
		}

		var thisBoundingRect = {left: 0, right: entity.width, top: 0, bottom: entity.height};

		var targetCoordinates = [
			{x: thisBoundingRect.left, y: thisBoundingRect.top},
			{x: thisBoundingRect.left, y: thisBoundingRect.bottom},
			{x: thisBoundingRect.right, y: thisBoundingRect.top},
			{x: thisBoundingRect.right, y: thisBoundingRect.bottom}
		];
		var convertedPoint = matrix.multiplyPoint(targetCoordinates[0]);
		var result = {left: convertedPoint.x, right: convertedPoint.x, top: convertedPoint.y, bottom: convertedPoint.y};
		for (var i = 1; i < targetCoordinates.length; ++i) {
			convertedPoint = matrix.multiplyPoint(targetCoordinates[i]);
			if (result.left > convertedPoint.x)
				result.left = convertedPoint.x;
			if (result.right < convertedPoint.x)
				result.right = convertedPoint.x;
			if (result.top > convertedPoint.y)
				result.top = convertedPoint.y;
			if (result.bottom < convertedPoint.y)
				result.bottom = convertedPoint.y;
		};
		if (withChildren && entity.children !== undefined) {
			for (var i = 0; i < entity.children.length; ++i) {
				var nowResult = calculateEntityBoundingRect(entity.children[i], matrix, true);
				if (nowResult) {
					if (result.left > nowResult.left)
						result.left = nowResult.left;
					if (result.right < nowResult.right)
						result.right = nowResult.right;
					if (result.top > nowResult.top)
						result.top = nowResult.top;
					if (result.bottom < nowResult.bottom)
						result.bottom = nowResult.bottom;
				}
			};
		}
		return result;
	}

	function updateEntityList() {
		var entities = props.game.scene().children;
		data.entities = [];
		entities.forEach(function(e) {
			data.entities.push(createEntityObject(e));
		});
	}

	function insertEventString (str) {
		data.config.eventsToSend = str;
	}

	function sendEventsWithValue(str) {
		var es = [];
		try {
			es = JSON.parse(str);
		} catch (e) {
			alert(e);
			console.log(e);
		}
		es.forEach(function (e) { amflow.sendEvent(e); });
	}

	function sendEvents() {
		if (!config.eventsToSend) {
			console.log("No events to send.");
			return;
		}
		sendEventsWithValue(config.eventsToSend);
	}

	function focusBoundingRect(id) {
		if (!data.entityRect.enable) {
			return;
		}
		var e = null;
		if (id < 0) {
			e = props.game._localDb[id];
		} else {
			e = props.game.db[id];
		}
		if (!e) {
			return;
		}
		// NOTE: fitToWindowすると破綻する
		var container = document.getElementById("container");
		var offsetTop = container ? container.offsetTop : 0;
		var rect = calculateEntityBoundingRect(e, parentsMatrix(e, props.game.focusingCamera), data.entityRect.withChildren);
		var s = data.entityRect.rectStyle;
		if (rect) {
			// 2 はフォーカス用divのボーダーサイズ
			s.top = offsetTop + (rect.top - 2) + "px";
			s.left = (rect.left - 2) + "px";
			s.width = (rect.right - rect.left) + "px";
			s.height = (rect.bottom - rect.top) + "px";
		}
		data.entityRect.show = true;
	}

	function unfocusBoundingRect() {
		data.entityRect.show = false;
		var s = data.entityRect.rectStyle;
		s.top = s.left = s.width = s.height = "0px";
	}

	function updateTargetEntity(id) {
		var e = null;
		if (id < 0) {
			e = props.game._localDb[id];
		} else {
			e = props.game.db[id];
		}
		if (e) {
			data.targetEntity = {
				className: e.constructor.name,
				id: id,
				local: e.local,
				touchable: e.touchable,
				visible: e.visible(),
				x: e.x,
				y: e.y,
				width: e.width,
				height: e.height,
				angle: e.angle,
				opacity: e.opacity,
				destroyed: e.destroyed()
			};
		} else {
			data.targetEntity = null;
		}
	}

	var SNAPSHOT_PREFIX = "akss:" + props.gameId + "/";
	var snapshots = {};
	var snapshotsList = [];

	// ゲームコンテンツからのスナップショット保存要求をハンドル
	var saveSnapshotOriginal = props.game.saveSnapshot;
	props.game.saveSnapshot = function(gameSnapshot) {
		// browser-engineのGame#saveSnapshot()を実行
		saveSnapshotOriginal.apply(props.game, arguments);

		if (!gameSnapshot) return;

		var time = new Date();
		var y = time.getFullYear();
		var m = time.getMonth();
		m = m < 10 ? "0" + m : m;
		var d = time.getDate();
		d = d < 10 ? "0" + d : d;
		var h = time.getHours();
		h = h < 10 ? "0" + h : h;
		var min = time.getMinutes();
		min = min < 10 ? "0" + min : min;
		var s = time.getSeconds();
		s = s < 10 ? "0" + s : s;

		var name = y + "-" + m + "-" + d + "-" + h + "-" + min + "-" + s;
		var snapshot = {
			age: props.game.age,
			randGenSer: props.game.random[0].serialize(),
			gameSnapshot: gameSnapshot,
			players: data.players
		};
		addSnapshotsList(name, snapshot);

		// LocalStorageに保存
		localStorage.setItem(SNAPSHOT_PREFIX + name, JSON.stringify(snapshot));
	};

	// LocalStorageに保存されているスナップショットの一覧
	for (i in localStorage) {
		if (i.indexOf(SNAPSHOT_PREFIX) !== -1) {
			addSnapshotsList(i.split("/")[1], JSON.parse(localStorage.getItem(i)));
		}
	}
	data.snapshots = snapshotsList;

	// スナップショットリストの追加 (Vue.js)
	function addSnapshotsList(name, data) {
		snapshots[name] = data;
		snapshotsList.push({
			name: name,
			data: JSON.stringify(data, null, "  ")
		});
	}

	// スナップショットの削除 (Vue.js + LocalStorage)
	function removeSnapshot(name) {
		localStorage.removeItem(SNAPSHOT_PREFIX + name);
		snapshotsList = snapshotsList.filter(function(e) {
			return e.name !== name;
		});
		delete snapshots[name];
		data.snapshots = snapshotsList;
	}

	// Grid表示
	var gridCheckBox = document.getElementById("show-grid");
	var gridCanvas = document.getElementById("gridCanvas");
	setupGrid();
	resizeGrid();
	drawGrid();
	function setupGrid() {
		if (config.showGrid === true) {
			gridCheckBox.checked = true;
			gridCanvas.style.display = "block";
		}
		gridCanvas.width = props.game.width;
		gridCanvas.height = props.game.height;
		gridCanvas.style.width = props.game.width + "px";
		gridCanvas.style.height = props.game.height + "px";
	}
	function resizeGrid() {
		var container = document.getElementById("container");
		var node = container.lastChild.firstChild;
		gridCanvas.style.transformOrigin = node.style.transformOrigin;
		gridCanvas.style.transform = node.style.transform;
	}
	function drawGrid() {
		var context = gridCanvas.getContext("2d");
		context.save();
		context.strokeStyle = "#CCC";
		context.setLineDash([3, 3]);
		drawGridLine(20, 20);
		context.strokeStyle = "#AAA";
		context.setLineDash([]);
		drawGridLine(100, 100);
		context.restore();

		function drawGridLine(gridWidth, gridHeight) {
			var x, y;
			context.beginPath();
			for (x = 0.5; x <= props.game.width; x += gridWidth) {
				context.moveTo(x, 0);
				context.lineTo(x, props.game.height);
			}
			for (y = 0.5; y <= props.game.height; y += gridHeight) {
				context.moveTo(0, y);
				context.lineTo(props.game.width, y);
			}
			context.stroke();
		}
	}
	function toggleGrid() {
		if (gridCheckBox.checked) {
			gridCanvas.style.display = "block";
			config.showGrid = true;
		} else {
			gridCanvas.style.display = "none";
			config.showGrid = false;
		}
		saveConfig();
	}

	var omitInterpolatedTickCheckBox = document.getElementById("omit-interpolated-tick");
	setupOmitInterpolatedTick();
	function setupOmitInterpolatedTick() {
		if (config.omitInterpolatedTick) {
			omitInterpolatedTickCheckBox.checked = true;
			changeDriverState({ loopConfiguration: { omitInterpolatedTickOnReplay: true } });
		}
	}
	function toggleOmitInterpolatedTick() {
		if (omitInterpolatedTickCheckBox.checked) {
			changeDriverState({ loopConfiguration: { omitInterpolatedTickOnReplay: true } });
			config.omitInterpolatedTick = true;
		} else {
			changeDriverState({ loopConfiguration: { omitInterpolatedTickOnReplay: false } });
			config.omitInterpolatedTick = false;
		}
		saveConfig();
	}

	// time 更新
	function updateCurrentTime() {
		data.currentTime = param.timeKeeper.now();
	}
	props.game._sceneChanged.add(function (scene) {
		if (!scene.update.contains(updateCurrentTime)) {
			scene.update.add(updateCurrentTime);
		}
	});

	var PLAYLOG_PREFIX = "akpl:" + props.gameId + "/";
	var playlogList = [];
	if (param.isReplay) {
		// プレイログ再生時はディベロッパーメニューを強制表示
		// note: views["general-view"].showがtrueかつ他のviewsのメンバのshowがfalseである、という前提条件で無理やり対応
		views["general-view"].show = false;
		views["playlog-view"].show = true;
		data.showMenu = true;
	}
	function savePlaylog() {
		var name = +new Date();
		var dump = amflow.dump();
		var jsonData = JSON.stringify({
			tickList: dump.tickList,
			startPoints: dump.startPoints,
			fps: props.game.fps
		});
		if (localStorage.getItem(PLAYLOG_PREFIX + name)) {
			if (!window.confirm("同名のリプレイ情報がすでに存在します。上書きしてもよろしいでしょうか？")) {
				return;
			}
			_removePlaylog(name);
		}
		localStorage.setItem(PLAYLOG_PREFIX + name, jsonData);
		var url = dumpPlaylog(name);
		data.playlog.list.push({name: name, url: url});
	}
	function reloadPlaylog(name) {
		var currentUrl = location.protocol + "//" + location.host + location.pathname;
		if (name) {
			window.location.href = currentUrl + "?playlog=" + name;
		} else {
			window.location.href = currentUrl;
		}
	}
	function changeDriverState(arg, callback) {
		props.driver.changeState(arg, function (err) {
			if (err) {
				console.log(err);
			}
			if (callback) {
				callback(err);
			}
		});
	}
	function rewindReplay() {
		param.timeKeeper.setTime(0);
		updateCurrentTime();
	}
	function playPauseReplay() {
		if (data.isPaused) {
			param.timeKeeper.start();
			data.isPaused = false;
		} else {
			param.timeKeeper.pause();
			data.isPaused = true;
		}
	}
	function onClickTimeProgress(ev) {
		var progress = document.getElementById("dev-menu-time-progress");
		var targetTime = Math.floor(ev.offsetX * progress.max / progress.offsetWidth);
		param.timeKeeper.setTime(targetTime);
	}
	function accelerateReplay() {
		param.timeKeeper.setRate(param.timeKeeper.getRate() * 2);
	}
	function decelerateReplay() {
		param.timeKeeper.setRate(param.timeKeeper.getRate() / 2);
	}
	function playFromHere() {
		if (props.amflow.dropAfter) {
			props.amflow.dropAfter(props.game.age);
		}
		props.driver.stopGame();
		props.driver.changeState({
			driverConfiguration: {
				executionMode: gdr.ExecutionMode.Active,
				playToken: gdr.MemoryAmflowClient.TOKEN_ACTIVE
			},
			loopConfiguration: {
				playbackRate: 1,  // 実行速度もリセットしておく
				loopMode: gdr.LoopMode.Realtime,
				delayIgnoreThreshold: 6,  // Ugh! GameLoopがデフォルト値にリセットする方法を提供するべき
				jumpTryThreshold: 90000
			}
		}, function (err) {
			if (err) {
				console.log(err);
				return;
			}
			data.isReplay = false;
			props.driver.setNextAge(props.game.age);
			props.driver.startGame();
		});
	}
	function removePlaylog(name) {
		if (!window.confirm("リプレイ情報を削除しますか？"))
			return;
		_removePlaylog(name);
	}
	function _removePlaylog(name) {
		localStorage.removeItem(PLAYLOG_PREFIX + name);
		playlogList = playlogList.filter(function(e) {
			if (e.name === name)
				window.URL.revokeObjectURL(e.url);
			return e.name !== name;
		});
		data.playlog.list = playlogList;
	}
	function dumpPlaylog(name) {
		var playlog = localStorage.getItem(PLAYLOG_PREFIX + name);
		if (!playlog) return;
		var blob = new Blob([ playlog ], { type : "application/x-download" });
		return URL.createObjectURL(blob);
	}
	var loader = document.getElementById("load-playlog-handler");
	loader.addEventListener("change", function (e) {
		var file = e.target.files[0];
		var reader = new FileReader();
		reader.readAsText(file);
		reader.onload = function (ev) {
			if (localStorage.getItem(PLAYLOG_PREFIX + file.name)) {
				if (!window.confirm("同名のリプレイ情報がすでに存在します。上書きしてもよろしいでしょうか？")) {
					return;
				}
				_removePlaylog(file.name);
			}
			localStorage.setItem(PLAYLOG_PREFIX + file.name, ev.target.result);
			var url = dumpPlaylog(file.name);
			data.playlog.list.push({name: file.name, url: url});
		};
	}, false);

	// LocalStorageに保存されているプレイログの一覧
	for (i in localStorage) {
		if (i.indexOf(PLAYLOG_PREFIX) !== -1) {
			var name = i.split("/")[1];
			var url = dumpPlaylog(name);
			playlogList.push({
				name: name,
				url: url
			});
		}
	}
	data.playlog.list = playlogList;

	function getJsonStringifiedValue(value) {
		try {
			var stringifiedValue = JSON.stringify(value);
			return stringifiedValue === undefined ? "undefined" : stringifiedValue;
		} catch (e) {
			return "N/A (circular reference)";
		}
	}

	Vue.component("entity-list-item", {
		template: "#entity-list-item-template",
		props: {
			model: Object,
			index: Number
		},
		data: function () {
			return {
				open: false
			};
		},
		computed: {
			hasChildren: function () {
				if (this.model.children && this.model.children.length > 0) {
					return true;
				}
				return false;
			}
		},
		methods: {
			toggle: function () {
				this.open = !this.open;
			},
			selectEntity: function() {
				updateTargetEntity(this.model.id);
			},
			focusEntity: function() {
				focusBoundingRect(this.model.id);
			},
			unfocusEntity: function() {
				unfocusBoundingRect();
			}
		}
	});

	var vm = new Vue({
		el: "#dev-menu",
		data: data,
		ready: function(v) {
			// v-show/v-ifだと一瞬メニューが見えてしまうため、".dev-menu-hide"を初期状態で付けている
			// それを外して表示制御をv-showに任せる
			var e = this.$el;
			e.className = e.className.replace(/dev-menu-hide/g, "");
			// interact.js によるリサイズ処理
			interact("#dev-menu")
				.resizable({
					preserveAspectRatio: true,
					edges: { left: true, top: true }
				})
				.on("resizemove", function (event) {
					if (data.config.isPositionRight) {
						data.config.size.right.width  = event.rect.width + "px";
					} else {
						data.config.size.bottom.height = event.rect.height + "px";
					}
					saveConfig();
				});
			renderView(this);
		},
		methods: {
			leaveGame: function(index) {
				var p = {id: data.players[index].player.id, name: data.players[index].player.name};
				data.players.$remove(data.players[index]);
				amflow.sendEvent([1 /* Leave */,  3, p.id ]);
			},
			toggleMenu: function() {
				data.showMenu = !data.showMenu;
			},
			closeMenu: function() {
				data.showMenu = false;
			},
			togglePosition: function() {
				data.config.isPositionRight = !data.config.isPositionRight;
				saveConfig();
			},
			changeView: function(target) {
				for (id in data.views) {
					data.views[id].show = false;
				}
				target.show = true;
				renderView(this);
			},
			toggleBackground: function() {
				var bg = document.body.style.backgroundColor;
				document.body.style.backgroundColor = bg ? "" : "black";
			},
			togglePreventDefault: function() {
				saveConfig();
			},
			toggleWarningEs6: function() {
				saveConfig();
			},
			toggleProfiler: toggleProfiler,
			fitToWindow: function() {
				// setOffsetしないとメニューにゲーム画面が被って、メニューサイズを変更しようとするとバグるのでとりあえず true
				window.sandboxDeveloperProps.utils.fitToWindow(true);
				resizeGrid();
			},
			revertSize: function(){
				window.sandboxDeveloperProps.utils.revertViewSize();
				resizeGrid();
			},
			captureScreen: 	function(e) {
				var cvs = document.getElementsByTagName("canvas");
				e.srcElement.setAttribute("href", cvs.item(1).toDataURL());
			},
			joinGame: joinGame,
			saveSnapshot: function() {
				// スナップショット要求の発火
				if (props.game.snapshotRequest) {
					props.game.snapshotRequest.fire();
				}
			},
			removeSnapshot: removeSnapshot,
			loadSnapshot: function(name) {
				console.log("snapshot loaded: " + name);
				var snapshot = snapshots[name];

				// developerメニューの把握するカメラを全リセット
				data.cameras = [];
				cameras = [];
				// プレイヤー情報を再現 (この復元はゲームコンテンツのプレイヤー情報の復元とは関係がない)
				data.players = snapshot.players;

				props.game._reset({
					age: snapshot.age,
					randGen: g.XorshiftRandomGenerator.deserialize(snapshot.randGenSer)
				});
				props.game._loadAndStart({ snapshot: snapshot.gameSnapshot });
			},
			previewSnapshot: function(index, name) {
				data.snapshotPreview = {
					name: name,
					data: snapshotsList[index].data
				};
			},
			savePlaylog: savePlaylog,
			reloadPlaylog: reloadPlaylog,
			rewindReplay: rewindReplay,
			playPauseReplay: playPauseReplay,
			onClickTimeProgress: onClickTimeProgress,
			accelerateReplay: accelerateReplay,
			decelerateReplay: decelerateReplay,
			playFromHere: playFromHere,
			removePlaylog: removePlaylog,
			setFocusingCamera: function(index) {
				var c = cameras[index];
				if (props.game.focusingCamera !== c) {
					props.game.focusingCamera = c;
				} else {
					props.game.focusingCamera = undefined;
				}
				// TODO: GAMEDEV-2414, GAMEDEV-2415
				props.game.modified = true;
			},
			updateEntityList: updateEntityList,
			consoleDump: function() {
				var e = data.targetEntity;
				if (e.local) {
					console.log(props.game._localDb[e.id]);
				} else {
					console.log(props.game.db[e.id]);
				}
			},
			onEventsToSendChanged: function() {
				saveConfig();
			},
			onAutoSendEventsChanged: function() {
				saveConfig();
			},
			insertEventString: insertEventString,
			sendEvents: sendEvents,
			sendEventsWithValue: sendEventsWithValue,
			onAutoJoinChanged: function() {
				saveConfig();
			},
			onSendsSessionParameterChanged: function() {
				saveConfig();
			},
			onModeChanged: function() {
				saveConfig();
			},
			onTotalTimeLimitChanged: function() {
				saveConfig();
			},
			onStopGameChanged: function() {
				saveConfig();
			},
			toggleGrid: toggleGrid,
			toggleOmitInterpolatedTick: toggleOmitInterpolatedTick
		}
	});
}
444990
public function setMeta($name, $content = NULL, $httpEquiv = FALSE, $scheme = NULL) {
    $meta = HTML::Tag('meta');
    $meta->setOption('selfClosing',TRUE);

    if ($content === NULL) {
      /* löschen */
      $this->removeMeta($name);
    
    } else {
      /* im W3C steht "may be used in place" ... d.h. man könnte auch name und http-equiv gleichzeitig benutzen 
         http://www.w3.org/TR/html4/struct/global.html#edef-META
      */

      if (isset($name)) {
        if (!$httpEquiv) 
          $meta->setAttribute('name',$name);
        else
          $meta->setAttribute('http-equiv',$name);
      }
  
      if (isset($scheme))
        $meta->setAttribute('scheme',$scheme);

      if ($content !== FALSE) {
        $meta->setAttribute('content',$content);
      }

      /* meta tags liegen im head in der root ebene, d.h. wir suchen ob es dort schon ein meta tag gibt,
         wenn es eins gibt ersetzen wir dies, ansonsten fügen wir es hinzu 
      */
      /* schlüssel des meta tags suchen (wenn vorhanden) */
      $key = NULL;
      foreach ($this->head->content as $itemKey => $item) {
        if ($item instanceof Tag && $item->getTag() == 'meta' && ($item->getAttribute('name') == $name || $item->getAttribute('http-equiv') == $name)) {
          $key = $itemKey;
          break;
        }
      }
      
      if ($key !== NULL) {
        $this->head->content[$key] =& $meta;
      } else {
        $this->head->content[] =& $meta;
      }
    }
    return $meta;
  }
837815
public function detailsAction()
    {
        if (!$this->getPost()->cmsFileId) {
            return $this->_jsonError(185);
        }
        //szukamy rekordu pliku
        if (null == $record = (new CmsFileQuery)->findPk($this->getPost()->cmsFileId)) {
            return $this->_jsonError(185);
        }
        //wycinamy rozszerzenie z nazwy oryginalnego pliku do edycji
        //pozycja ostatniej kropki w nazwie
        $pointPosition = strrpos($record->original, '.');
        if ($pointPosition !== false) {
            $record->original = substr($record->original, 0, $pointPosition);
        }
        $data = [];
        if ($record->data instanceof \Mmi\DataObject) {
            //parametry
            $data = $record->data->toArray();
        }
        $data['urlFile'] = ((\App\Registry::$config->cdn) ? : $record->getUrl());
        if ($record->data->posterFileName) {
            $data['poster'] = $record->getPosterUrl();
        }    
        return json_encode(['result' => 'OK', 'record' => $record, 'data' => $data]);
    }
137324
protected function compile()
    {
        \System::loadLanguageFile('tl_backupdb');

        switch( \Input::get('act') ) {
            case 'backup':          BackupDbRun::run( );
                                    die( );               // Beenden, da Download rausgegangen ist

            case 'webtemplate':     $objTemplate = new \BackendTemplate('be_backupdb_wstpl');
                                    $this->Template = $objTemplate;
                                    $this->Template->arrResults = BackupWsTemplate::run( );
                                    $this->Template->back = 'contao/main.php?do=BackupDB&ref' . TL_REFERER_ID;
                                    $this->Template->backupdb_version = 'BackupDB Version ' . BACKUPDB_VERSION . '.' . BACKUPDB_BUILD;
                                    return;
        }

        //--- Zielverzeichnis für Website-Templates ---
        $zielVerz = 'templates';
        if( isset( $GLOBALS['BACKUPDB']['WsTemplatePath'] ) && is_dir(TL_ROOT.'/'.trim($GLOBALS['BACKUPDB']['WsTemplatePath'], '/')) ) {
            $zielVerz = trim($GLOBALS['BACKUPDB']['WsTemplatePath'], '/');
        }
        if( isset( $GLOBALS['TL_CONFIG']['WsTemplatePath'] ) && is_dir(TL_ROOT.'/'.trim($GLOBALS['TL_CONFIG']['WsTemplatePath'], '/')) && (trim($GLOBALS['TL_CONFIG']['WsTemplatePath']) != '') ) {
            $zielVerz = trim($GLOBALS['TL_CONFIG']['WsTemplatePath'], '/');
        }

        $filename = \Environment::get('host');                                                                  // Dateiname = Domainname
        if( isset($GLOBALS['TL_CONFIG']['websiteTitle']) ) $filename = $GLOBALS['TL_CONFIG']['websiteTitle'];   // IF( Exiat WbsiteTitle ) Dateiname für Template-Dateien
        $filename = \StringUtil::generateAlias( $filename );                                                    // Dateiname = Alias für Template-Dateien

        $this->Template->ws_template_sqlfile = $zielVerz.'/' . $filename . '.sql';
        $this->Template->ws_template_txtfile = $zielVerz.'/' . $filename . '.txt';
        $this->Template->ws_template_strfile = $zielVerz.'/' . $filename . '.structure';


        $this->Template->settingslink    = $settingslink = 'contao/main.php?do=settings&amp;ref=' . TL_REFERER_ID;
        $this->Template->cronlink        = $cronlink     = 'contao/main.php?do=cron&amp;ref=' . TL_REFERER_ID;
        $this->Template->backuplink      = 'contao/main.php?do=BackupDB&amp;act=backup&amp;rt=' . REQUEST_TOKEN . '&amp;ref=' . TL_REFERER_ID;
        $this->Template->webtemplatelink = 'contao/main.php?do=BackupDB&amp;act=webtemplate&amp;rt=' . REQUEST_TOKEN . '&amp;ref=' . TL_REFERER_ID;

        $this->Template->database = $GLOBALS['TL_CONFIG']['dbDatabase'];
        $this->Template->texte    = array(
                                        'download'      => $GLOBALS['TL_LANG']['tl_backupdb']['download'],
                                        'startdownload' => $GLOBALS['TL_LANG']['tl_backupdb']['startdownload'],
                                        'database'      => $GLOBALS['TL_LANG']['tl_backupdb']['database'] . ': ',

                                        'backupdesc'    => $GLOBALS['TL_LANG']['tl_backupdb']['backupdesc'],
                                        'backupsetup'   => sprintf( $GLOBALS['TL_LANG']['tl_backupdb']['backupsetup'], $settingslink ),
                                        'backuplast'    => $GLOBALS['TL_LANG']['tl_backupdb']['backuplast'] . ': ',

                                        'croninfo'      => $GLOBALS['TL_LANG']['tl_backupdb']['croninfo'],
                                        'cronsetup'     => sprintf( $GLOBALS['TL_LANG']['tl_backupdb']['cronsetup'], $cronlink ),
                                        'cronlast'      => $GLOBALS['TL_LANG']['tl_backupdb']['cronlast'] . ': ',

                                        'maketpl'       => $GLOBALS['TL_LANG']['tl_backupdb']['maketpl'],
                                        'tpldesc'       => $GLOBALS['TL_LANG']['tl_backupdb']['tpldesc'],
                                        'tplfiles'      => $GLOBALS['TL_LANG']['tl_backupdb']['tplfiles'] . ':',
                                        'tplnobackup'   => $GLOBALS['TL_LANG']['tl_backupdb']['tplnobackup'],
                                        'tplwarning'    => $GLOBALS['TL_LANG']['tl_backupdb']['tplwarning']
                                    );

        //--- CRON Erweiterung einbeziehen, wenn vorhanden ---
        $this->Template->ws_cron = $this->checkCronExt();               // übergibt 0 (kein Cron), 1 (Cron ohne Job), 2 (Cron, Job inaktiv) oder 3 (Cron, Job aktiv)
        if( ($this->Input->get('op') == 'cron') && ($this->checkCron() == 1) ) {
            $sql = "INSERT INTO `tl_cron` "
                  ."(`id`, `tstamp`, `lastrun`, `nextrun`, `scheduled`, `title`, `job`, `t_minute`, `t_hour`, `t_dom`, `t_month`, `t_dow`, `runonce`, `enabled`, `logging`) "
                  ."VALUES ( 0, " . time() . ", 0, 0, 0, 'AutoBackupDB', 'system/modules/BackupDB/AutoBackupDB.php', '0', '2', '*', '*', '*', '', '', '1')";
            $this->Database->execute( $sql );                           // inaktiven Cronjob eintragen
            $this->reload();
        }

        //--- Letzte Backups ---
        $pfad = TL_ROOT . '/' . $GLOBALS['TL_CONFIG']['uploadPath'] . '/AutoBackupDB/';
        $this->Template->lastrun = file_exists($pfad . BACKUPDB_RUN_LAST) ? file_get_contents($pfad . BACKUPDB_RUN_LAST) : '--.--.---- --:--';
        $this->Template->lastcron = file_exists($pfad . BACKUPDB_CRON_LAST) ? file_get_contents($pfad . BACKUPDB_CRON_LAST) : '--.--.---- --:--';

        //--- Footer ---
        $this->Template->backupdb_icons = 'Icons from <a href="https://icons8.com" target="_blank">Icons8</a> (<a href="https://creativecommons.org/licenses/by-nd/3.0/" target="_blank">CC BY-ND 3.0</a>)';
        $this->Template->backupdb_version = '<a href="https://github.com/do-while/contao-BackupDB" target="_blank">BackupDB Version ' . BACKUPDB_VERSION . '.' . BACKUPDB_BUILD . '</a>';
    }
401607
@Override
	protected void doTickEffekts(ChannelMemory aktMemo)
	{
		if (aktMemo.effekt==0 && aktMemo.effektParam==0) return;
		
		switch (aktMemo.effekt)
		{
			case 0x00 :			// Arpeggio
				aktMemo.arpegioIndex = (aktMemo.arpegioIndex+1)%3;
				int nextNotePeriod = aktMemo.arpegioNote[aktMemo.arpegioIndex];
				if (nextNotePeriod!=0)
				{
					aktMemo.currentNotePeriod = nextNotePeriod;
					setNewPlayerTuningFor(aktMemo);
				}
				break;
			case 0x01: 			// Porta Up
				aktMemo.currentNotePeriod -= aktMemo.portaStepUp;
				if (aktMemo.glissando) aktMemo.currentNotePeriod = Helpers.getRoundedPeriod(aktMemo.currentNotePeriod>>4)<<4;
				if (aktMemo.currentNotePeriod<aktMemo.portaStepUpEnd) aktMemo.currentNotePeriod = aktMemo.portaStepUpEnd;
				setNewPlayerTuningFor(aktMemo);
				break;
			case 0x02: 			// Porta Down
				aktMemo.currentNotePeriod += aktMemo.portaStepDown;
				if (aktMemo.glissando) aktMemo.currentNotePeriod = Helpers.getRoundedPeriod(aktMemo.currentNotePeriod>>4)<<4;
				if (aktMemo.currentNotePeriod>aktMemo.portaStepDownEnd) aktMemo.currentNotePeriod = aktMemo.portaStepDownEnd;
				setNewPlayerTuningFor(aktMemo);
				break;
			case 0x03 :			// Porta to Note
				doPortaToNoteEffekt(aktMemo);
				break;
			case 0x04 :			// Vibrato
				doVibratoEffekt(aktMemo);
				break;
			case 0x05 :			// Porta to Note + VolumeSlide
				doPortaToNoteEffekt(aktMemo);
				doVolumeSlideEffekt(aktMemo);
				break;
			case 0x06:			// Vibrato + VolumeSlide
				doVibratoEffekt(aktMemo);
				doVolumeSlideEffekt(aktMemo);
				break;
			case 0x07 :			// Tremolo
				doTremoloEffekt(aktMemo);
				break;
			case 0x0A : 		// VolumeSlide
				doVolumeSlideEffekt(aktMemo);
				break;
			case 0x0E :			// Extended
				switch (aktMemo.effektParam>>4)
				{
					case 0x9 :	// Retrig Note
						aktMemo.retrigCount--;
						if (aktMemo.retrigCount<=0)
						{
							aktMemo.retrigCount = aktMemo.retrigMemo;
							resetInstrument(aktMemo);
						}
						break;
					case 0xC :	// Note Cut
						if (aktMemo.noteCutCount>0)
						{
							aktMemo.noteCutCount--;
							if (aktMemo.noteCutCount<=0)
							{
								aktMemo.noteCutCount=-1;
								aktMemo.currentVolume = 0;
							}
						}
						break;
					case 0xD:	// Note Delay
						if (aktMemo.noteDelayCount>0)
						{
							aktMemo.noteDelayCount--;
							if (aktMemo.noteDelayCount<=0)
							{
								aktMemo.noteDelayCount = -1;
								setNewInstrumentAndPeriod(aktMemo);
							}
						}
						break;
				}
				break;
			case 0x11 :			// Global volume slide
				doGlobalVolumeSlideEffekt();
				break;
			case 0x14 :			// Key off
				if (aktMemo.keyOffCounter>0)
				{
					aktMemo.keyOffCounter--;
					if (aktMemo.keyOffCounter<=0)
					{
						aktMemo.keyOffCounter = -1;
						aktMemo.keyOff = true;
					}
				}
				break;
			case 0x19 :			// Panning slide
				doPanningSlideEffekt(aktMemo);
				break;
			case 0x1B:			// Multi retrig note
				if (aktMemo.retrigVolSlide>0)
				{
					switch (aktMemo.retrigVolSlide)
					{
						case 0x1: aktMemo.currentVolume--; break;
						case 0x2: aktMemo.currentVolume-=2; break;
						case 0x3: aktMemo.currentVolume-=4; break;
						case 0x4: aktMemo.currentVolume-=8; break;
						case 0x5: aktMemo.currentVolume-=16; break;
						case 0x6: aktMemo.currentVolume=(aktMemo.currentVolume<<1)/3; break;
						case 0x7: aktMemo.currentVolume>>=1; break;
						case 0x8: break;
						case 0x9: aktMemo.currentVolume++; break;
						case 0xA: aktMemo.currentVolume+=2; break;
						case 0xB: aktMemo.currentVolume+=4; break;
						case 0xC: aktMemo.currentVolume+=8; break;
						case 0xD: aktMemo.currentVolume+=16; break;
						case 0xE: aktMemo.currentVolume=(aktMemo.currentVolume*3)>>1; break;
						case 0xF: aktMemo.currentVolume<<=1; break;
					}
					aktMemo.currentSetVolume = aktMemo.currentVolume;
				}
				aktMemo.retrigCount--;
				if (aktMemo.retrigCount<=0)
				{
					aktMemo.retrigCount = aktMemo.retrigMemo;
					resetInstrument(aktMemo);
				}
				break;
			case 0x1D :			// Tremor
				doTremorEffekt(aktMemo);
				break;
		}
	}
1002886
public function generate()
	{
		if (TL_MODE == 'BE')
		{
			$objTemplate = new \BackendTemplate('be_wildcard');
			$objTemplate->wildcard = '### VISITORS LIST ###';
			$objTemplate->title = $this->headline;
            $objTemplate->id = $this->id;
            $objTemplate->link = $this->name;
            $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;
		
			return $objTemplate->parse();
		}
		//alte und neue Art gemeinsam zum Array bringen
		if (strpos($this->visitors_categories,':') !== false) 
		{
			$this->visitors_categories = deserialize($this->visitors_categories, true);
		} 
		else 
		{
			$this->visitors_categories = array($this->visitors_categories);
		}
		// Return if there are no categories
		if (!is_array($this->visitors_categories) || !is_numeric($this->visitors_categories[0]))
		{
			return '';
		}
		$this->useragent_filter = $this->visitors_useragent;
		return parent::generate();
	}
129777
public function filesAction()
    {
        //formularz
        $form = new Form\ConnectorImportFilesForm;
        //formularz zapisany
        if ($form->isSaved()) {
            //przekazanie listy plików do downloadu
            $this->view->files = $form->getOption('data');
            //otwarcie sesji
            $session = new \Mmi\Session\SessionSpace(\Cms\Model\ConnectorModel::SESSION_SPACE);
            $this->view->downloadUrl = base64_encode($session->url);
        } else {
            //form do widoku
            $this->view->form = $form;
        }
    }
1263823
private static void createContextFiles(Resource configDir, ServletConfig servletConfig, boolean doNew) throws IOException {
	// NICE dies muss dynamisch erstellt werden, da hier der admin hinkommt
	// und dieser sehr viele files haben wird
	Resource contextDir = configDir.getRealResource("context");
	if (!contextDir.exists()) contextDir.mkdirs();

	// custom locale files
	{
	    Resource dir = configDir.getRealResource("locales");
	    if (!dir.exists()) dir.mkdirs();
	    Resource file = dir.getRealResource("pt-PT-date.df");
	    if (!file.exists()) createFileFromResourceEL("/resource/locales/pt-PT-date.df", file);
	}

	// video
	Resource videoDir = configDir.getRealResource("video");
	if (!videoDir.exists()) videoDir.mkdirs();

	Resource video = videoDir.getRealResource("video.xml");
	if (!video.exists()) createFileFromResourceEL("/resource/video/video.xml", video);

	// bin
	Resource binDir = configDir.getRealResource("bin");
	if (!binDir.exists()) binDir.mkdirs();

	Resource ctDir = configDir.getRealResource("customtags");
	if (!ctDir.exists()) ctDir.mkdirs();

	// Jacob
	if (SystemUtil.isWindows()) {
	    String name = (SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? "jacob-x64.dll" : "jacob-i586.dll";
	    Resource jacob = binDir.getRealResource(name);
	    if (!jacob.exists()) {
		createFileFromResourceEL("/resource/bin/windows" + ((SystemUtil.getJREArch() == SystemUtil.ARCH_64) ? "64" : "32") + "/" + name, jacob);
	    }
	}

	Resource storDir = configDir.getRealResource("storage");
	if (!storDir.exists()) storDir.mkdirs();

	Resource compDir = configDir.getRealResource("components");
	if (!compDir.exists()) compDir.mkdirs();

	// remove old cacerts files, they are now only in the server context
	Resource secDir = configDir.getRealResource("security");
	Resource f = null;
	if (secDir.exists()) {
	    f = secDir.getRealResource("cacerts");
	    if (f.exists()) f.delete();

	}
	else secDir.mkdirs();
	f = secDir.getRealResource("antisamy-basic.xml");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/security/antisamy-basic.xml", f);

	// lucee-context
	f = contextDir.getRealResource("lucee-context.lar");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-context.lar", f);
	else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-context.lar", f);

	// lucee-admin
	f = contextDir.getRealResource("lucee-admin.lar");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-admin.lar", f);
	else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-admin.lar", f);

	// lucee-doc
	f = contextDir.getRealResource("lucee-doc.lar");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-doc.lar", f);
	else createFileFromResourceCheckSizeDiffEL("/resource/context/lucee-doc.lar", f);

	f = contextDir.getRealResource("component-dump." + TEMPLATE_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/component-dump." + TEMPLATE_EXTENSION, f);

	// Base Component
	String badContent = "<cfcomponent displayname=\"Component\" hint=\"This is the Base Component\">\n</cfcomponent>";
	String badVersion = "704b5bd8597be0743b0c99a644b65896";
	f = contextDir.getRealResource("Component." + COMPONENT_EXTENSION);

	if (!f.exists()) createFileFromResourceEL("/resource/context/Component." + COMPONENT_EXTENSION, f);
	else if (doNew && badVersion.equals(ConfigWebUtil.createMD5FromResource(f))) {
	    createFileFromResourceEL("/resource/context/Component." + COMPONENT_EXTENSION, f);
	}
	else if (doNew && badContent.equals(createContentFromResource(f).trim())) {
	    createFileFromResourceEL("/resource/context/Component." + COMPONENT_EXTENSION, f);
	}

	// Component.lucee
	f = contextDir.getRealResource("Component." + COMPONENT_EXTENSION_LUCEE);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/Component." + COMPONENT_EXTENSION_LUCEE, f);

	f = contextDir.getRealResource(Constants.CFML_APPLICATION_EVENT_HANDLER);
	if (!f.exists()) createFileFromResourceEL("/resource/context/Application." + COMPONENT_EXTENSION, f);

	f = contextDir.getRealResource("form." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/form." + TEMPLATE_EXTENSION, f);

	f = contextDir.getRealResource("graph." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/graph." + TEMPLATE_EXTENSION, f);

	f = contextDir.getRealResource("wddx." + TEMPLATE_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/wddx." + TEMPLATE_EXTENSION, f);

	f = contextDir.getRealResource("lucee-applet." + TEMPLATE_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/lucee-applet." + TEMPLATE_EXTENSION, f);

	f = contextDir.getRealResource("lucee-applet.jar");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/lucee-applet.jar", f);

	// f=new BinaryFile(contextDir,"lucee_context.ra");
	// if(!f.exists())createFileFromResource("/resource/context/lucee_context.ra",f);

	f = contextDir.getRealResource("admin." + TEMPLATE_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/admin." + TEMPLATE_EXTENSION, f);

	// Video
	f = contextDir.getRealResource("swfobject.js");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/video/swfobject.js", f);
	f = contextDir.getRealResource("swfobject.js." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/video/swfobject.js." + TEMPLATE_EXTENSION, f);

	f = contextDir.getRealResource("mediaplayer.swf");
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/video/mediaplayer.swf", f);
	f = contextDir.getRealResource("mediaplayer.swf." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/video/mediaplayer.swf." + TEMPLATE_EXTENSION, f);

	Resource adminDir = contextDir.getRealResource("admin");
	if (!adminDir.exists()) adminDir.mkdirs();

	// Plugin
	Resource pluginDir = adminDir.getRealResource("plugin");
	if (!pluginDir.exists()) pluginDir.mkdirs();

	f = pluginDir.getRealResource("Plugin." + COMPONENT_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/admin/plugin/Plugin." + COMPONENT_EXTENSION, f);

	// Plugin Note
	Resource note = pluginDir.getRealResource("Note");
	if (!note.exists()) note.mkdirs();

	f = note.getRealResource("language.xml");
	if (!f.exists()) createFileFromResourceEL("/resource/context/admin/plugin/Note/language.xml", f);

	f = note.getRealResource("overview." + TEMPLATE_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/admin/plugin/Note/overview." + TEMPLATE_EXTENSION, f);

	f = note.getRealResource("Action." + COMPONENT_EXTENSION);
	if (!f.exists()) createFileFromResourceEL("/resource/context/admin/plugin/Note/Action." + COMPONENT_EXTENSION, f);

	// gateway
	Resource componentsDir = configDir.getRealResource("components");
	if (!componentsDir.exists()) componentsDir.mkdirs();

	Resource gwDir = componentsDir.getRealResource("lucee/extension/gateway/");
	create("/resource/context/gateway/", new String[] { "TaskGateway." + COMPONENT_EXTENSION, "DummyGateway." + COMPONENT_EXTENSION, "DirectoryWatcher." + COMPONENT_EXTENSION,
		"DirectoryWatcherListener." + COMPONENT_EXTENSION, "MailWatcher." + COMPONENT_EXTENSION, "MailWatcherListener." + COMPONENT_EXTENSION }, gwDir, doNew);

	// resources/language
	Resource langDir = adminDir.getRealResource("resources/language");
	create("/resource/context/admin/resources/language/", new String[] { "en.xml", "de.xml" }, langDir, doNew);

	// add Debug
	Resource debug = adminDir.getRealResource("debug");
	create("/resource/context/admin/debug/", new String[] { "Debug." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION, "Group." + COMPONENT_EXTENSION }, debug, doNew);

	// add Cache Drivers
	Resource cDir = adminDir.getRealResource("cdriver");
	create("/resource/context/admin/cdriver/", new String[] { "Cache." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION, "Group." + COMPONENT_EXTENSION }, cDir, doNew);

	// add DB Drivers types
	Resource dbDir = adminDir.getRealResource("dbdriver");
	Resource typesDir = dbDir.getRealResource("types");
	create("/resource/context/admin/dbdriver/types/", new String[] { "IDriver." + COMPONENT_EXTENSION, "Driver." + COMPONENT_EXTENSION, "IDatasource." + COMPONENT_EXTENSION,
		"IDriverSelector." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION }, typesDir, doNew);

	// add Gateway Drivers
	Resource gDir = adminDir.getRealResource("gdriver");
	create("/resource/context/admin/gdriver/", new String[] { "Gateway." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION, "Group." + COMPONENT_EXTENSION }, gDir, doNew);

	// add Logging/appender
	Resource app = adminDir.getRealResource("logging/appender");
	create("/resource/context/admin/logging/appender/", new String[] { "Appender." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION, "Group." + COMPONENT_EXTENSION }, app,
		doNew);

	// Logging/layout
	Resource lay = adminDir.getRealResource("logging/layout");
	create("/resource/context/admin/logging/layout/", new String[] { "Layout." + COMPONENT_EXTENSION, "Field." + COMPONENT_EXTENSION, "Group." + COMPONENT_EXTENSION }, lay,
		doNew);

	Resource templatesDir = contextDir.getRealResource("templates");
	if (!templatesDir.exists()) templatesDir.mkdirs();

	Resource errorDir = templatesDir.getRealResource("error");
	if (!errorDir.exists()) errorDir.mkdirs();

	f = errorDir.getRealResource("error." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/templates/error/error." + TEMPLATE_EXTENSION, f);

	f = errorDir.getRealResource("error-neo." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/templates/error/error-neo." + TEMPLATE_EXTENSION, f);

	f = errorDir.getRealResource("error-public." + TEMPLATE_EXTENSION);
	if (!f.exists() || doNew) createFileFromResourceEL("/resource/context/templates/error/error-public." + TEMPLATE_EXTENSION, f);

	Resource displayDir = templatesDir.getRealResource("display");
	if (!displayDir.exists()) displayDir.mkdirs();

    }
1179256
public function run()
	{
		// Input a digit >0 ?
		if ( 0 == (int)$this->intBID )
		{
		    if ( 0 == (int)$this->intDEFBID ) 
		    {
		        header('HTTP/1.1 501 Not Implemented');
		    	throw new \ErrorException('Invalid Banner ID (' . \Input::get('bid') . ')',2,1,basename(__FILE__),__LINE__);
		    }
		}

		//Banner oder Kategorie Banner (Default Banner)
		if ( 0 < (int)$this->intBID ) 
		{
			//normaler Banner
			$banner_not_viewed = false;
    		// Check whether the Banner ID exists
    		$objBanners = \Database::getInstance()
                                ->prepare("SELECT 
                                                tb.id
                                              , tb.banner_url
                                              , tb.banner_jumpTo
                                              , tbs.banner_clicks
                                           FROM 
                                                tl_banner tb
                                              , tl_banner_stat tbs
                                           WHERE 
                                                tb.id=tbs.id 
                                           AND 
                                                tb.id=?")
                                ->execute($this->intBID);
    		
    		if (!$objBanners->next()) 
    		{
    			$objBanners = \Database::getInstance()
                                    ->prepare("SELECT 
                                                    tb.id
                                                  , tb.banner_url
                                                  , tb.banner_jumpTo
                                               FROM 
                                                    tl_banner tb
                                               WHERE 
                                                    tb.id=?")
                                    ->execute($this->intBID);
	    		
	    		if (!$objBanners->next()) 
	    		{
	    			header('HTTP/1.1 501 Not Implemented');
	    			throw new \ErrorException('Banner ID not found',2,1,basename(__FILE__),__LINE__);
	    		} 
	    		else 
	    		{
	    			$banner_not_viewed = true;
	    		}
    		}
    		
			$banner_stat_update = false;
		    if ($this->checkUserAgent()       === false 
		     && $this->checkBot()             === false 
		     && $this->getSetReClickBlocker() === false
		       ) 
		    { 
		    	// keine User Agent Filterung
		    	// kein Bot
		    	// kein ReClick 
		    	$banner_stat_update = true;
		    }
		    
		    if ($banner_stat_update === true) 
		    {
                if ($banner_not_viewed === false) 
                {
                	//Update
                	$tstamp = time();
	                $banner_clicks = $objBanners->banner_clicks + 1;
	                \Database::getInstance()->prepare("UPDATE 
                                                            tl_banner_stat 
                                                       SET 
                                                            tstamp=?
                                                          , banner_clicks=? 
                                                       WHERE 
                                                            id=?")
                                            ->executeUncached($tstamp, $banner_clicks, $this->intBID);
    			} 
    			else 
    			{
    				//Insert
    				 $arrSet = array
		            (
		                'id'     => $this->intBID,
		                'tstamp' => time(),
		                'banner_clicks' => 1
		            );
				    \Database::getInstance()->prepare("INSERT IGNORE INTO tl_banner_stat %s")
                                            ->set($arrSet)
                                            ->execute();
    			}
		    }
    		
    		//Banner Ziel per Page?
            if ($objBanners->banner_jumpTo >0) 
            {
            	//url generieren
            	$objBannerNextPage = \Database::getInstance()
                                            ->prepare("SELECT 
                                                            id
                                                          , alias 
                                                       FROM 
                                                            tl_page 
                                                       WHERE 
                                                            id=?")
                                            ->limit(1)
                                            ->execute($objBanners->banner_jumpTo);
            	
            	if ($objBannerNextPage->numRows)
            	{
           	        $objPage = \PageModel::findWithDetails($objBanners->banner_jumpTo); 
                    $objBanners->banner_url = \Controller::generateFrontendUrl($objBannerNextPage->fetchAssoc(),
                                                                               null,
                                                                               $objPage->rootLanguage);
            	} 
            }
            $banner_redirect = $this->getRedirectType($this->intBID);
        } 
        else 
        {
            // Default Banner from Category
            // Check whether the Banner ID exists
    		$objBanners = \Database::getInstance()
                                ->prepare("SELECT 
                                                id
                                              , banner_default_url AS banner_url
                                           FROM 
                                                tl_banner_category
                                           WHERE 
                                                id=?")
                                ->execute($this->intDEFBID);
    		
            if (!$objBanners->next()) 
            {
                header('HTTP/1.1 501 Not Implemented');
            	throw new \ErrorException('Default Banner ID not found',2,1,basename(__FILE__),__LINE__);
            }
            $banner_redirect = '303';
        }

		$banner_url = ampersand($objBanners->banner_url);
		// 301 Moved Permanently
		// 302 Found
		// 303 See Other
		// 307 Temporary Redirect (ab Contao 3.1)
		$this->redirect($banner_url, $banner_redirect); 
	}
19816
@Override
    public ReisMogelijkheden getModel(InputStream stream) {
        SimpleDateFormat format = new SimpleDateFormat(NsApi.DATETIME_FORMAT);
        try {
            Xml xml = Xml.getXml(stream, "ReisMogelijkheden");
            List<ReisMogelijkheid> reisMogelijkheden = new ArrayList<>(xml.children("ReisMogelijkheid")
                    .size());
            for (Xml reisMogelijkheidXml : xml.children("ReisMogelijkheid")) {
                List<Melding> meldingen = new LinkedList<>();
                if (reisMogelijkheidXml.isPresent("Melding")) {
                    for (Xml meldingXml : reisMogelijkheidXml.children("Melding")) {
                        String id = meldingXml.child("Id").content();
                        boolean ernstig = Boolean.parseBoolean(meldingXml.child("Ernstig").content());
                        String text = meldingXml.child("Text").content();
                        meldingen.add(new Melding(id, ernstig, text));
                    }
                }
                int aantalOverstappen = Integer.parseInt(reisMogelijkheidXml.child("AantalOverstappen").content());
                int geplandeReisTijdMinuten = getReistijdInMinuten(reisMogelijkheidXml.child("GeplandeReisTijd")
                        .content());
                int actueleReisTijdMinuten = getReistijdInMinuten(reisMogelijkheidXml.child("ActueleReisTijd")
                        .content());
                boolean optimaal = true;
                if (reisMogelijkheidXml.isPresent("Optimaal")) {
                    optimaal = Boolean.parseBoolean(reisMogelijkheidXml.child("Optimaal").content());
                }
                Date geplandeVertrekTijd = format.parse(reisMogelijkheidXml.child("GeplandeVertrekTijd").content());
                Date actueleVertrekTijd = format.parse(reisMogelijkheidXml.child("ActueleVertrekTijd").content());
                Date geplandeAankomstTijd = format.parse(reisMogelijkheidXml.child("GeplandeAankomstTijd").content());
                Date actueleAankomstTijd = format.parse(reisMogelijkheidXml.child("ActueleAankomstTijd").content());
                String aankomstVertraging = reisMogelijkheidXml.child("AankomstVertraging").content();
                String status = reisMogelijkheidXml.child("Status").content();
                List<ReisDeel> reisDelen = new ArrayList<>(reisMogelijkheidXml.children("ReisDeel").size());
                for (Xml reisDeelXml : reisMogelijkheidXml.children("ReisDeel")) {
                    String reisSoort = reisDeelXml.attr("reisSoort");
                    String vervoerder = reisDeelXml.child("Vervoerder").content();
                    String vervoerType = reisDeelXml.child("VervoerType").content();
                    int ritNummer = Integer.parseInt(reisDeelXml.child("RitNummer").content());
                    String statusReisdeel = reisDeelXml.child("Status").content();
                    String geplandeStoringId = reisDeelXml.child("GeplandeStoringId").content();
                    String ongeplandeStoringId = reisDeelXml.child("OngeplandeStoringId").content();
                    List<ReisStop> reisStops = new ArrayList<>(reisDeelXml.children("ReisStop").size());
                    for (Xml reisStopXml : reisDeelXml.children("ReisStop")) {
                        String naam = reisStopXml.child("Naam").content();
                        Date tijd = format.parse(reisStopXml.child("Tijd").content());
                        String spoor = reisStopXml.child("Spoor").content();
                        boolean gewijzigdVertrekspoor = false;
                        if (spoor != null) {
                            gewijzigdVertrekspoor = Boolean.parseBoolean(reisStopXml.child("Spoor").attr("wijziging"));
                        }
                        reisStops.add(new ReisStop(naam, tijd, spoor, gewijzigdVertrekspoor));
                    }
                    List<String> reisDetails = new ArrayList<>(reisDeelXml.child("Reisdetails")
                            .children("Reisdetail").size());
                    for (Xml reisDetailXml : reisDeelXml.child("Reisdetails").children("Reisdetail")) {
                        reisDetails.add(reisDetailXml.content());
                    }
                    reisDelen.add(new ReisDeel(reisSoort, vervoerder, vervoerType, ritNummer, statusReisdeel,
                            reisStops, ongeplandeStoringId, geplandeStoringId, reisDetails));
                }
                reisMogelijkheden.add(new ReisMogelijkheid(meldingen, aantalOverstappen, geplandeReisTijdMinuten,
                        actueleReisTijdMinuten, aankomstVertraging, optimaal, geplandeVertrekTijd, actueleVertrekTijd,
                        geplandeAankomstTijd, actueleAankomstTijd, status, reisDelen));
            }
            return new ReisMogelijkheden(reisMogelijkheden);
        }
        catch (ParseException e) {
            logger.error("Error parsing stream to actuele vertrektijden", e);
            throw new NsApiException("Error parsing stream to actuele vertrektijden", e);
        }
    }
1258943
public function callbackSubmit()
    {
        // Get values from the submitted form
        $password      = $this->form->value("password");
        $passwordAgain = $this->form->value("password-again");

        // Check password matches
        if ($password == null) {
            $this->form->rememberValues();
            $this->form->addOutput("Du angav aldrig ett lösenord");
            return false;
        }

        // Check password matches
        if ($password !== $passwordAgain) {
            $this->form->rememberValues();
            $this->form->addOutput("Lösenordet matchade ej");
            return false;
        }

        $this->user->setPassword($password);
        $this->user->save();
        $this->form->addOutput("<p>Du ändrade ditt lösenord!</p>
        <p>TIPS:Innan du loggar ut, kontrollera så din kontrollfråga stämmer ifall du glömmer bort</p>");
        return true;
    }
639846
private void addToList__() {
    //Theman suchen
    final String MUSTER_START = "<div class=\"mediaCon\">";
    final String MUSTER_STOPP = "<h2 class=\"rasterHeadline\">OFT GESUCHT</h2>";
    final String MUSTER_URL = "<a href=\"tvshow.htm?show=";
    final String MUSTER_THEMA = "title=\"";
    MSStringBuilder strSeite = new MSStringBuilder(Const.STRING_BUFFER_START_BUFFER);
    GetUrl getUrlIo = new GetUrl(getWartenSeiteLaden());
    strSeite = getUrlIo.getUriWithDelay(SENDERNAME, "http://swrmediathek.de/tvlist.htm", StandardCharsets.UTF_8, 2, strSeite, "", 4, TimeUnit.SECONDS);
    int pos = 0;
    String url;
    String thema;
    int stop = strSeite.indexOf(MUSTER_STOPP);
    while (!Config.getStop() && (pos = strSeite.indexOf(MUSTER_START, pos)) != -1) {
      if (stop > 0 && pos > stop) {
        break;
      }
      pos += MUSTER_START.length();
      url = strSeite.extract(MUSTER_URL, "\"", pos);
      thema = strSeite.extract(MUSTER_THEMA, "\"", pos);
      thema = StringEscapeUtils.unescapeHtml4(thema.trim()); //wird gleich benutzt und muss dann schon stimmen
      if (thema.isEmpty()) {
        Log.errorLog(915263078, "kein Thema");
      }
      if (url.isEmpty()) {
        Log.errorLog(163255009, "keine URL");
      } else {
        //url = url.replace("&amp;", "&");
        String[] add = new String[]{"http://swrmediathek.de/tvshow.htm?show=" + url, thema};
        listeThemen.addUrl(add);
      }
    }
  }
435901
function f_urun_teklif_temp(_tahta_id, _urun_id, _para_id, _onay_durum_id) {

        //ürüne verilmiş tüm teklifleri para birimine göre teklif tarihleri ile sette tutuyoruz
        var sonucAnahtari = result.kp.temp.zsetUrunTeklifleriParaBirimli(_tahta_id, _urun_id, _para_id);
        return result.dbQ.zcard(sonucAnahtari)
            .then(function (_iToplam) {
                if (_iToplam == 0) {
                    return result.dbQ.zinterstore(sonucAnahtari, 2,
                        result.kp.urun.ssetTeklifleri(_tahta_id, _urun_id),
                        result.kp.teklif.ssetTeklifParaBirimli(_para_id))

                } else {
                    return _iToplam;
                }
            })
            .then(function (_iToplam) {
                if (_onay_durum_id && _onay_durum_id > 0) {
                    //ürünle ilgili teklif onay durumuna göre temp oluştur
                    var anahtar = result.kp.temp.zsetUrunTeklifleriOnayDurumunaGore(_tahta_id, _urun_id, _onay_durum_id);
                    return result.dbQ.zcard(anahtar)
                        .then(function (_iToplam) {
                            if (_iToplam == 0) {
                                /* return result.dbQ.zinterstore(anahtar, 2,
                                 result.kp.temp.zsetUrunTeklifleriParaBirimli(_tahta_id, _urun_id, _para_id),
                                 result.kp.teklif.ssetTeklifOnayDurumlari(_onay_durum_id)); */

                                return result.dbQ.zinterstore(anahtar, 2,
                                    result.kp.urun.ssetTeklifleri(_tahta_id, _urun_id),
                                    result.kp.teklif.ssetTeklifOnayDurumlari(_onay_durum_id));
                            } else {
                                return _iToplam;
                            }
                        })
                } else {
                    return _iToplam;
                }
            });
    }
1023908
public function run( )
    {
        @set_time_limit( 600 );
        \System::loadLanguageFile('tl_backupdb');                                           // Modultexte laden

        $user     = \BackendUser::getInstance();                                            // Backend-User

        $filename = \Environment::get('host');                                                                  // Dateiname = Domainname
        if( isset($GLOBALS['TL_CONFIG']['websiteTitle']) ) $filename = $GLOBALS['TL_CONFIG']['websiteTitle'];   // IF( Exiat WbsiteTitle ) Dateiname für Template-Dateien
        $filename = \StringUtil::generateAlias( $filename );                                                    // Dateiname = Alias für Template-Dateien

        $arrExclude = Array (                       // Diese Datenbank-Tabellen gehören nicht in ein WS-Template
                                'tl_cache',
                                'tl_cron',
                                'tl_lock',
                                'tl_log',
                                'tl_runonce',
                                'tl_search',
                                'tl_search_index',
                                'tl_session',
                                'tl_undo',
                                'tl_version'
                            );

        $arrResults = array();

        $headertext  = "#================================================================================\r\n";
        $headertext .= "# Website-Template : " . $filename . ".sql\r\n";
        $headertext .= BackupDbCommon::getHeaderInfo( false, 'Saved by User    : ' . $user->username . ' (' . $user->name . ')' );

        //--- Zielverzeichnis für Website-Templates ---
        $zielVerz = 'templates';
        if( isset( $GLOBALS['BACKUPDB']['WsTemplatePath'] ) && is_dir(TL_ROOT . '/' . trim($GLOBALS['BACKUPDB']['WsTemplatePath'], '/')) ) {
            $zielVerz = trim($GLOBALS['BACKUPDB']['WsTemplatePath'], '/');
        }
        if( isset( $GLOBALS['TL_CONFIG']['WsTemplatePath'] ) && is_dir(TL_ROOT . '/' . trim($GLOBALS['TL_CONFIG']['WsTemplatePath'], '/')) && (trim($GLOBALS['TL_CONFIG']['WsTemplatePath']) != '') ) {
            $zielVerz = trim($GLOBALS['TL_CONFIG']['WsTemplatePath'], '/');
        }

        $tempdir = '/system/tmp/';                  // temporäre Datei anlegen, dann wird das vorige Template nur überschrieben, wenn die runtime ausreicht
        $fileSQL = $filename . '.sql';              // Datenbank-Datei
        $fileTXT = $filename . '.txt';              // Info-Datei
        $fileSTR = $filename . '.structure';        // Struktur-Datei

        $datei = new \File( $tempdir . $fileSQL );
        $datei->write( $headertext );
        $datei->write( 'SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";' . "\r\n"
                     . "\r\n"
                     . "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n"
                     . "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n"
                     . "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n"
                     . "/*!40101 SET NAMES utf8 */;\r\n" );

        $arrSavedDB = array( 'tl_' );               // Default, Verhalten wie in den Vorversionen von BackupDB
        if( isset( $GLOBALS['TL_CONFIG']['backupdb_saveddb'] ) && (trim($GLOBALS['TL_CONFIG']['backupdb_saveddb']) != '') ) {
            $arrSavedDB = trimsplit( ',', strtolower($GLOBALS['TL_CONFIG']['backupdb_saveddb']) );
        }

        $arrBlacklist = BackupDbCommon::get_blacklist( );
        $sqlarray = BackupDbCommon::getFromDB( );

        $arrEntries = array( );
        if( count($sqlarray) == 0 ) {
            $datei->write( "\r\nNo tables found in database." );
        }
        else {
            foreach( array_keys($sqlarray) as $table ) {
                if( in_array( $table, $arrExclude ) ) continue;             // Exclude-Tabellen überspringen
                if( in_array( $table, $arrBlacklist ) ) continue;           // Blacklisten-Tabellen überspringen

                $found = false;
                for( $i=0; $i<count($arrSavedDB); $i++ ) {
                    if( (strlen($arrSavedDB[$i]) <= strlen($table)) && ($arrSavedDB[$i] === substr($table, 0, strlen($arrSavedDB[$i]))) ) {
                        $found = true;
                    }
                }
                if( !$found ) continue;                                     // nur die angegebenen Datentabellen sichern

                $arrEntries[] = BackupDbCommon::get_table_content( $table, $datei, true );  // Dateninhalte in Datei schreiben
            }
        }
        $arrResults['entries'] = $arrEntries;

        $datei->write( "\r\n# --- End of Backup ---\r\n" );                 // Endekennung
        $datei->close();

        $datei = new \File( $tempdir . $fileSTR );                          // Strukturdatei öffnen
        $datei->write( BackupDbCommon::getHeaderInfo( true, 'Saved by User    : ' . $user->username . ' (' . $user->name . ')' ));

        $sqlarray = BackupDbCommon::getFromDB( );
        if( count($sqlarray) == 0 ) {
            $datei->write( 'No tables found in database.' );
        }
        else {
            foreach( array_keys($sqlarray) as $table ) {
                $datei->write( BackupDbCommon::get_table_structure($table, $sqlarray[$table]) );
            }
        }
        $datei->write( "\r\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\r\n"
                      ."/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\r\n"
                      ."/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\r\n"
                      ."\r\n# --- End of Backup ---\r\n" );                            // Endekennung
        $datei->close();

        $datei = new \File( $tempdir . $fileTXT );                          // Textdatei öffnen
        $datei->write( $headertext );
        $datei->close();

        //--- alte Dateien löschen, neue ans Ziel verschieben ---
        if( file_exists(TL_ROOT . '/' . $zielVerz . '/' . $fileSQL) ) {     // Delete old files if exist
            unlink(TL_ROOT . '/' . $zielVerz . '/' . $fileSQL);
        }
        if( file_exists(TL_ROOT . '/' . $zielVerz . '/' . $fileSTR) ) {
            unlink(TL_ROOT . '/' . $zielVerz . '/' . $fileSTR);
        }
        if( file_exists(TL_ROOT . '/' . $zielVerz . '/' . $fileTXT) ) {
            unlink(TL_ROOT . '/' . $zielVerz . '/' . $fileTXT);
        }
        rename( TL_ROOT . $tempdir . $fileSQL, TL_ROOT . '/' . $zielVerz . '/' . $fileSQL );        // Move new files
        rename( TL_ROOT . $tempdir . $fileSTR, TL_ROOT . '/' . $zielVerz . '/' . $fileSTR );
        rename( TL_ROOT . $tempdir . $fileTXT, TL_ROOT . '/' . $zielVerz . '/' . $fileTXT );

        //--- Ergebnisausgabe ---
        $arrResults['header']['text']    = $GLOBALS['TL_LANG']['tl_backupdb']['tplhead'];
        $arrResults['entry']['text']     = array( $GLOBALS['TL_LANG']['tl_backupdb']['tplentry'], $GLOBALS['TL_LANG']['tl_backupdb']['tplentriesd'] );

        $arrResults['footer']['result']  = $GLOBALS['TL_LANG']['tl_backupdb']['tplresult'];
        $arrResults['footer']['legend']  = $GLOBALS['TL_LANG']['tl_backupdb']['tpllegend'];
        $arrResults['footer']['fileSQL'] = '/' . $zielVerz . '/' . $fileSQL;
        $arrResults['footer']['fileTXT'] = '/' . $zielVerz . '/' . $fileTXT;
        $arrResults['footer']['fileSTR'] = '/' . $zielVerz . '/' . $fileSTR;
        $arrResults['footer']['text']    = $GLOBALS['TL_LANG']['tl_backupdb']['tplfooter'];
        $arrResults['footer']['button']  = $GLOBALS['TL_LANG']['tl_backupdb']['tplbutton'];

        return $arrResults;
    }
224536
@Override
    public Map<String, Object> toMap() {
        Map<String, Object> map = new HashMap<>();
        map.put("plz", getPLZ());
        map.put("ortsname", getOrtsname());
        map.put("strasse", getStrasse());
        map.put("hausnummer", getHausnummer());
        return map;
    }
150248
function ecp_pubkey(Q, p, a, G, d, l) {
	var R = ecp_new(l);
	ecp_proj(Q, ecp_mul(R, d, G, a, p, l), p, l);
}