text:
<?php

require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
require_once INCLUDES."photo_functions_include.php";
require_once INCLUDES."bbcode_include.php";
include LOCALE.LOCALESET."admin/photoalbums.php";

if (!checkrights("PH") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }

if (function_exists('gd_info')) {

	define("SAFEMODE", @ini_get("safe_mode") ? true : false);

	if (isset($_GET['action']) && $_GET['action'] == "refresh") {
		$i = 1; $k = 1;
		$result = dbquery("SELECT album_id FROM ".DB_PHOTO_ALBUMS." ORDER BY album_order");
		while ($data = dbarray($result)) {
			$result2 = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order='$i' WHERE album_id='".$data['album_id']."'");
			$result2 = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE album_id='".$data['album_id']."' ORDER BY photo_order");
			while ($data2 = dbarray($result2)) {
				$result3 = dbquery("UPDATE ".DB_PHOTOS." SET photo_order='$k' WHERE photo_id='".$data2['photo_id']."'");
				$k++;
			}
			$i++; $k = 1;
		}
		redirect(FUSION_SELF.$aidlink);
	}

	if (isset($_GET['status']) && !isset($message)) {
		if ($_GET['status'] == "sn") {
			$message = $locale['410'];
		} elseif ($_GET['status'] == "su") {
			$message = $locale['411'];
		} elseif ($_GET['status'] == "se") {
			$message = $locale['414']."
\n";
			if ($_GET['error'] == 1) { $message .= $locale['415'].""; }
			elseif ($_GET['error'] == 2) { $message .= sprintf($locale['416'], parsebytesize($settings['photo_max_b'])).""; }
			elseif ($_GET['error'] == 3) { $message .= $locale['417'].""; }
			elseif ($_GET['error'] == 4) { $message .= sprintf($locale['418'], $settings['photo_max_w'], $settings['photo_max_h']).""; }
		} elseif ($_GET['status'] == "delt") {
			$message = $locale['412'];
		} elseif ($_GET['status'] == "dely") {
			$message = $locale['413'];
		} elseif ($_GET['status'] == "deln") {
			$message = $locale['419'];
		}
		if ($message) {	echo "
".$message."
\n"; }
	}

	if (isset($_POST['cancel'])) {
		redirect(FUSION_SELF.$aidlink);
	} elseif ((isset($_GET['action']) && $_GET['action'] == "deletethumb") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
		$data = dbarray(dbquery("SELECT album_thumb,album_order FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'"));
		$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_thumb='$album_thumb' WHERE album_id='".$_GET['album_id']."'");
		@unlink(PHOTOS.$data['album_thumb']);
		redirect(FUSION_SELF.$aidlink."&status=delt&album_id=".$_GET['album_id']);
	} elseif ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
		if (dbcount("(photo_id)", DB_PHOTOS, "album_id='".$_GET['album_id']."'")) {
			if (!isset($_POST['confirm_password'])) {
				opentable($locale['430']);
				echo "
\n";
				echo "<form action='".FUSION_SELF.$aidlink."&action=delete&album_id=".$_GET['album_id']."' method='post'>\n";
				echo $locale['431']."

\n<input class='textbox' type='password' name='admin_passwd' />

\n";
				echo "<input class='button' type='submit' name='confirm_password' value='".$locale['432']."' />\n";
				echo "<input class='button' type='submit' name='cancel' value='".$locale['433']."' />\n";
				echo "</form>\n
\n";
				closetable();
				require_once THEMES."templates/footer.php";
				exit;
			} else {
				$passwd = md5(md5(stripinput($_POST['admin_passwd'])));
				if ($passwd == $userdata['user_admin_password']) {
			    if (dbcount("(album_id)", DB_PHOTOS, "album_id='".$_GET['album_id']."'")) {
						$result = dbquery("SELECT * FROM ".DB_PHOTOS." WHERE album_id='".$_GET['album_id']."'");
						while ($data = dbarray($result)) {
							if (!SAFEMODE) {
								@unlink(PHOTOS."album_".$data['album_id']."/".$data['photo_filename']);
								if ($data['photo_thumb1']) { @unlink(PHOTOS."album_".$data['album_id']."/".$data['photo_thumb1']); }
								if ($data['photo_thumb2']) { @unlink(PHOTOS."album_".$data['album_id']."/".$data['photo_thumb2']); }
							} else {
								@unlink(PHOTOS.$data['photo_filename']);
								if ($data['photo_thumb1']) { @unlink(PHOTOS.$data['photo_thumb1']); }
								if ($data['photo_thumb2']) { @unlink(PHOTOS.$data['photo_thumb2']); }
							}
						}
						$result = dbquery("DELETE FROM ".DB_PHOTOS." WHERE album_id='".$_GET['album_id']."'");
			    }
			    $data = dbarray(dbquery("SELECT album_thumb,album_order,album_id FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'"));
			    $result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=(album_order-1) WHERE album_order>'".$data['album_order']."'");
			    $result = dbquery("DELETE FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'");
					if ($data['album_thumb']) { @unlink(PHOTOS.$data['album_thumb']); }
					if (!SAFEMODE) {
						unlink(PHOTOS."album_".$data['album_id']."/index.php");
						rmdir(PHOTOS."album_".$data['album_id']);
					}
					redirect(FUSION_SELF.$aidlink."&status=dely");
				} else {
					redirect(FUSION_SELF.$aidlink."&status=deln");
				}
			}
		} else {
			$data = dbarray(dbquery("SELECT album_thumb,album_order FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'"));
			$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=(album_order-1) WHERE album_order>'".$data['album_order']."'");
			$result = dbquery("DELETE FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'");
			if ($data['album_thumb']) @unlink(PHOTOS.$data['album_thumb']);
			if (!SAFEMODE) {
				@unlink(PHOTOS."album_".$_GET['album_id']."/index.php");
				rmdir(PHOTOS."album_".$_GET['album_id']);
			}
			redirect(FUSION_SELF.$aidlink."&status=dely");
		}
	} elseif ((isset($_GET['action']) && $_GET['action'] == "mup") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
		$data = dbarray(dbquery("SELECT album_id FROM ".DB_PHOTO_ALBUMS." WHERE album_order='".intval($_GET['order'])."'"));
		$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=album_order+1 WHERE album_id='".$data['album_id']."'");
		$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=album_order-1 WHERE album_id='".$_GET['album_id']."'");
		$rowstart = $_GET['order'] > $settings['thumbs_per_page'] ? ((ceil($_GET['order'] / $settings['thumbs_per_page'])-1)*$settings['thumbs_per_page']) : "0";
		redirect(FUSION_SELF.$aidlink."&rowstart=$rowstart");
	} elseif ((isset($_GET['action']) && $_GET['action'] == "mdown") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
		$data = dbarray(dbquery("SELECT album_id FROM ".DB_PHOTO_ALBUMS." WHERE album_order='".intval($_GET['order'])."'"));
		$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=album_order-1 WHERE album_id='".$data['album_id']."'");
		$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=album_order+1 WHERE album_id='".$_GET['album_id']."'");
		$rowstart = $_GET['order'] > $settings['thumbs_per_page'] ? ((ceil($_GET['order'] / $settings['thumbs_per_page'])-1)*$settings['thumbs_per_page']) : "0";
		redirect(FUSION_SELF.$aidlink."&rowstart=$rowstart");
	} elseif (isset($_POST['save_album'])) {
		$error = "";
		$album_title = stripinput($_POST['album_title']);
		$album_description = stripinput($_POST['album_description']);
		$album_access = isnum($_POST['album_access']) ? $_POST['album_access'] : "0";
		$album_order = isnum($_POST['album_order']) ? $_POST['album_order'] : "";
		if (!SAFEMODE && (!isset($_GET['action']) || $_GET['action'] != "edit")) {
			$result = dbarray(dbquery("SHOW TABLE STATUS LIKE '".DB_PHOTO_ALBUMS."'"));
			$album_id = $result['Auto_increment'];
			@mkdir(PHOTOS."album_".$album_id, 0755);
			@copy(IMAGES."index.php", PHOTOS."album_".$album_id."/index.php");
		}
		if (is_uploaded_file($_FILES['album_pic_file']['tmp_name'])) {
			$album_types = array(".gif",".jpg",".jpeg",".png");
			$album_pic = $_FILES['album_pic_file'];
			$album_ext = strtolower(strrchr($album_pic['name'],"."));
			if (!preg_match("/^[-0-9A-Z_\.\[\]\s]+$/i", $album_pic['name'])) {
				$error = 1;
			} elseif ($album_pic['size'] > $settings['photo_max_b']){
				$error = 2;
			} elseif (!in_array($album_ext, $album_types)) {
				$error = 3;
			} else {
				@unlink(PHOTOS."temp".$album_ext);
				move_uploaded_file($album_pic['tmp_name'], PHOTOS."temp".$album_ext);
				chmod(PHOTOS."temp".$album_ext, 0644);
				$imagefile = @getimagesize(PHOTOS."temp".$album_ext);
				if ($imagefile[0] > $settings['photo_max_w'] || $imagefile[1] > $settings['photo_max_h']) {
					$error = 4;
					@unlink(PHOTOS."temp".$album_ext);
				} else {
					$album_thumb = image_exists(PHOTOS, $album_pic['name']);
					createthumbnail($imagefile[2], PHOTOS."temp".$album_ext, PHOTOS.$album_thumb, $settings['thumb_w'], $settings['thumb_h']);
					@unlink(PHOTOS."temp".$album_ext);
				}
			}
		}
		if (!$error) {
			if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
				$old_album_order = dbresult(dbquery("SELECT album_order FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'"), 0);
				if ($album_order > $old_album_order) {
					$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=(album_order-1) WHERE album_order>'$old_album_order' AND album_order<='$album_order'");
				} elseif ($album_order < $old_album_order) {
					$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=(album_order+1) WHERE album_order<'$old_album_order' AND album_order>='$album_order'");
				}
				$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_title='$album_title', album_description='$album_description',".(isset($album_thumb)?" album_thumb='$album_thumb',":"")." album_user='".$userdata['user_id']."', album_access='$album_access', album_order='$album_order' WHERE album_id='".$_GET['album_id']."'");
				$rowstart = $album_order > $settings['thumbs_per_page'] ? ((ceil($album_order / $settings['thumbs_per_page'])-1)*$settings['thumbs_per_page']) : "0";
				redirect(FUSION_SELF.$aidlink."&status=su&rowstart=$rowstart");
			} else {
				if (!$album_order) { $album_order = dbresult(dbquery("SELECT MAX(album_order) FROM ".DB_PHOTO_ALBUMS.""), 0) + 1; }
				$result = dbquery("UPDATE ".DB_PHOTO_ALBUMS." SET album_order=(album_order+1) WHERE album_order>='$album_order'");
				$result = dbquery("INSERT INTO ".DB_PHOTO_ALBUMS." (album_title, album_description, album_thumb, album_user, album_access, album_order, album_datestamp) VALUES ('$album_title', '$album_description', '$album_thumb', '".$userdata['user_id']."', '$album_access', '$album_order', '".time()."')");
				$rowstart = $album_order > $settings['thumbs_per_page'] ? ((ceil($album_order / $settings['thumbs_per_page'])-1)*$settings['thumbs_per_page']) : "0";
				redirect(FUSION_SELF.$aidlink."&status=sn&rowstart=$rowstart");
			}
		} else {
			redirect(FUSION_SELF.$aidlink."&status=se&error=$error");
		}
	} else {
		if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['album_id']) && isnum($_GET['album_id']))) {
			$result = dbquery("SELECT * FROM ".DB_PHOTO_ALBUMS." WHERE album_id='".$_GET['album_id']."'");
			if (dbrows($result)) {
				$data = dbarray($result);
				$album_title = $data['album_title'];
				$album_description = $data['album_description'];
				$album_thumb = $data['album_thumb'];
				$album_access = $data['album_access'];
				$album_order = $data['album_order'];
				$formaction = FUSION_SELF.$aidlink."&action=edit&album_id=".$data['album_id'];
				opentable($locale['401']);
			} else {
				redirect(FUSION_SELF.$aidlink);
			}
		} else {
			$album_id = "";
			$album_title = "";
			$album_description = "";
			$album_thumb = "";
			$album_access = "";
			$album_order = "";
			$formaction = FUSION_SELF.$aidlink;
			opentable($locale['400']);
		}
		$access_opts = ""; $sel = "";
		$user_groups = getusergroups();
		while(list($key, $user_group) = each($user_groups)){
			$sel = ($album_access == $user_group['0'] ? " selected='selected'" : "");
			$access_opts .= "<option value='".$user_group['0']."'$sel>".$user_group['1']."</option>\n";
		}
		echo "<form name='inputform' method='post' action='$formaction' enctype='multipart/form-data'>\n";
		echo "
\n
\n";
		echo "".$locale['440']."	\n";
		echo "<input type='text' name='album_title' value='".$album_title."' maxlength='100' class='textbox' style='width:330px;' />	\n";
		echo "
\n
\n";
		echo "".$locale['441']."	\n";
		echo "<textarea name='album_description' cols='60' rows='5' class='textbox' style='width:330px;'>".$album_description."</textarea>
\n";
		echo display_bbcodes("300px", "album_description", "inputform", "b|i|u|center|small|url|mail|img|quote")."	\n";
		echo "
\n
\n";
		echo "".$locale['442']."	\n";
		echo "<select name='album_access' class='textbox' style='width:150px;'>\n".$access_opts."</select>\n";
		echo $locale['443']."<input type='text' name='album_order' value='".$album_order."' maxlength='4' class='textbox' style='width:40px;' />\n";
		echo "	\n
\n
\n";
		echo "".$locale['444'];
		if ((isset($_GET['action']) && $_GET['action'] == "edit") && ($album_thumb && file_exists(PHOTOS.$album_thumb))) {
			echo "

\n".$locale['469']."	\n";
			echo "";
		} else {
			echo "	\n<input type='file' name='album_pic_file' class='textbox' style='width:250px;' />";
		}
		echo "	\n
\n
\n";
		echo "
\n";
		echo "<input type='submit' name='save_album' value='".$locale['445']."' class='button' />\n";
		if (isset($_GET['action']) && $_GET['action'] == "edit") {
			echo "<input type='submit' name='cancel' value='".$locale['433']."' class='button' />\n";
		}
		echo "	\n
\n
\n</form>\n";
		closetable();
	}

	opentable($locale['402']);
	$rows = dbcount("(album_id)", DB_PHOTO_ALBUMS);
	if ($rows) {
		if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
		$result = dbquery(
			"SELECT ta.*, tu.user_id,user_name FROM ".DB_PHOTO_ALBUMS." ta
			LEFT JOIN ".DB_USERS." tu ON ta.album_user=tu.user_id
			ORDER BY album_order LIMIT ".$_GET['rowstart'].",".$settings['thumbs_per_page']
		);
		$counter = 0; $k = ($_GET['rowstart'] == 0 ? 1 : $_GET['rowstart'] + 1);
		echo "
\n
\n";
		while ($data = dbarray($result)) {
			$up = ""; $down = "";
			if ($rows != 1){
				$orderu = $data['album_order'] - 1;
				$orderd = $data['album_order'] + 1;
				if ($k == 1){
					$down = " ·\n\n";
				}elseif ($k < $rows){
					$up = " ·\n";
					$down = " ·\n\n";
				} else {
					$up = " ·\n";
				}
			}
			if ($counter != 0 && ($counter % $settings['thumbs_per_row'] == 0)) { echo "
\n
\n"; }
			echo "\n";
			echo "".$data['album_title']."

\n";
			if ($data['album_thumb'] && file_exists(PHOTOS.$data['album_thumb'])){
				echo "";
			} else {
				echo $locale['461'];
			}
			echo "

\n".$up;
			echo "".$locale['468']." ·\n";
			echo "".$locale['469']." ".$down;
			echo "

\n".$locale['462'].showdate("shortdate", $data['album_datestamp'])."
\n";
			echo $locale['463']."".$data['user_name']."
\n";
			echo $locale['464'].getgroupname($data['album_access'])."
\n";
			echo $locale['465'].dbcount("(photo_id)", DB_PHOTOS, "album_id='".$data['album_id']."'")."
\n";
			echo "	\n";
			$counter++; $k++;
		}
		echo "
\n
\n".$locale['470']."	\n
\n
\n";
		if ($rows > $settings['thumbs_per_page']) {
			echo "
\n".makepagenav($_GET['rowstart'], $settings['thumbs_per_page'], $rows, 3, FUSION_SELF.$aidlink."&")."\n
\n"; }
	} else {
		echo "
".$locale['471']."
\n";
	}

	echo "";

	closetable();
} else {
	opentable($locale['403']);
	echo "
".$locale['420']."
\n";
	closetable();
}

require_once THEMES."templates/footer.php";
?>


text:
function eval_in_virtual_environment {
    VIRTUALENV_NAME=env

    if [ ! -d ${VIRTUALENV_NAME} ]; then
      virtualenv env -p python3
    fi

    source ${VIRTUALENV_NAME}/bin/activate
    pip install --upgrade pip
    pip install --upgrade wheel
    pip install -r requirements.txt
    pip install -r requirements-dev.txt
    deactivate
    source ${VIRTUALENV_NAME}/bin/activate
    PYTHONPATH=$PYTHONPATH:. alembic upgrade head
    echo "Running '$1' inside virtual environment…"
    $1
}

redpajama_set_name: RedPajamaGithub


text:
/*global fail: true, xit: true */
/*jslint es5: true, nomen: true */

/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
 * %%
 * 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.
 * #L%
 */

define( "integration/End2EndAbstractTest",
        [
            "global/Promise",
            "joynr",
            "joynr/vehicle/RadioProxy",
            "integration/IntegrationUtils",
            "joynr/provisioning/provisioning_cc",
            "uuid",
            "global/WaitsFor"
        ],
        function(
                Promise,
                joynr,
                RadioProxy,
                IntegrationUtils,
                provisioning,
                uuid,
                waitsFor) {

            function End2EndAbstractTest(provisioningSuffix) {
                var radioProxy;
                var workerId;
                var testIdentifier = 0;

                jasmine.getEnv().defaultTimeoutInterval = 15000; //15 secs default timeout for async tests;
                this.beforeEach = function() {
                    var provisioningSuffixForTest = provisioningSuffix + "-" + testIdentifier++;
                    var domain = provisioningSuffixForTest;
                    var testProvisioning = IntegrationUtils.getProvisioning(
                            provisioning,
                            domain);
                    return joynr.load(testProvisioning).then(function(newjoynr) {
                        joynr = newjoynr;
                        IntegrationUtils.initialize(joynr);
                        return new Promise(function(resolve, reject) {
                            IntegrationUtils.initializeWebWorker(
                                    "TestEnd2EndCommProviderWorker",
                                    provisioningSuffixForTest,
                                    domain).then(function(newWorkerId) {
                                workerId = newWorkerId;
                                // Prevent freezing of object through proxy build
                                // since we need to add faked attribute below
                                spyOn(Object, 'freeze').and.callFake(function(obj) {
                                    return obj;
                                });
                                return IntegrationUtils.buildProxy(RadioProxy, domain);
                            }).then(function(newRadioProxy) {
                                radioProxy = newRadioProxy;

                                // Add an attribute that does not exist on provider side
                                // for special subscription test
                                radioProxy.nonExistingAttributeOnProviderSide =
                                    new radioProxy.settings.proxyElementTypes.ProxyAttributeNotifyReadWrite(radioProxy, radioProxy.settings, "nonExistingAttributeOnProviderSide", "Integer");

                                // restore freeze behavior
                                Object.freeze.and.callThrough();
                                radioProxy = Object.freeze(radioProxy);
                            }).then(function() {
                                return IntegrationUtils.startWebWorker(workerId);
                            }).then(function() {
                                resolve({
                                    joynr: joynr,
                                    radioProxy : radioProxy
                                });
                                return null;
                            });
                        });
                    });
                };

                /**
                 * Calls attribute set with a certain value and tests whether attribute get
                 * returns this value
                 *
                 * @param {ProxyAttribute}
                 *            attribute the proxy attribute to test
                 * @param {Number}
                 *            index the recursion index that goes down to zero
                 * @param {Function}
                 *            [resolve] function to be invoked once the set async function has been completed
                 * @param {Function}
                 *            [reject] function to be invoked once the set async function fails
                 */
                function setAndTestAttributeRecursive (attribute, index, resolve, reject) {

                    // value is toggled between true/false on every increment of variable i,
                    // ending at false on i=0
                    var valueToBeSet = !!(index % 2);

                    // set the value
                    attribute.set({
                        value : valueToBeSet
                    }).then(
                            function() {
                                // get the value
                                attribute.get().then(
                                        function(valueFromProvider) {
                                            // check if provider set the value and returned
                                            // the new one accordingly
                                            IntegrationUtils.checkValueAndType(
                                                    valueFromProvider,
                                                    valueToBeSet);

                                            // go on with the recursion
                                            if (index === 0) {
                                                // recursion should stop, index is decreased
                                                // to 0
                                                resolve(index);
                                            } else {
                                                // start next recursion level
                                                setAndTestAttributeRecursive(
                                                        attribute,
                                                        index - 1,
                                                        resolve,
                                                        reject);
                                            }
                                            return null;
                                        }).catch(function(error) {
                                            reject(new Error(
                                                    "Failed to retrieve attribute value (recursion index "
                                                        + index
                                                        + "): "
                                                        + error));
                                        });
                                return null;
                            }).catch(function(error) {
                                reject(new Error(
                                        "Failed to set attribute value (recursion index "
                                            + index
                                            + "): "
                                            + error));
                            });
                            return null;
                }

                /**
                 * Calls attribute set with a certain value and tests whether attribute get
                 * returns this value
                 *
                 * @param {ProxyAttribute}
                 *            attribute the proxy attribute to test
                 * @param {Number}
                 *            index the recursion index that goes down to zero
                 * @returns {Promise} a promise object that rejects on the first occuring
                 *          error or resolves with the value 0 if all tests finished
                 *          successfully
                 */
                this.setAndTestAttribute = function (attributeName, index) {
                    return new Promise(function(resolve, reject) {
                        setAndTestAttributeRecursive(radioProxy[attributeName], index, resolve, reject);
                    });
                };

                this.getAttribute = function(attributeName, expectedValue) {
                    var onFulfilledSpy = jasmine.createSpy("onFulfilledSpy");

                    return waitsFor(function() {
                        return radioProxy !== undefined;
                    }, "radioProxy is defined", provisioning.ttl).then(function() {
                        radioProxy[attributeName].get().then(function(value) {
                            expect(value).toEqual(expectedValue);
                            onFulfilledSpy(value);
                        }).catch(function(error) {
                            return IntegrationUtils.outputPromiseError(new Error("End2EndAbstractTest.getAttribute. Error while getting: " + error.message));
                        });

                        return waitsFor(function() {
                            return onFulfilledSpy.calls.count() > 0;
                        }, "attribute " + attributeName + " is received", provisioning.ttl);
                    }).then(function() {
                        expect(onFulfilledSpy).toHaveBeenCalled();
                    });
                };

                this.getFailingAttribute = function(attributeName) {
                    var onFulfilledSpy = jasmine.createSpy("onFulfilledSpy");
                    var catchSpy = jasmine.createSpy("catchSpy");

                    return waitsFor(function() {
                        return radioProxy !== undefined;
                    }, "radioProxy is defined", provisioning.ttl).then(function() {
                        radioProxy[attributeName].get().then(function(value) {
                            onFulfilledSpy(value);
                        }).catch(function(exception) {
                            catchSpy(exception);
                        });

                        return waitsFor(function() {
                            return catchSpy.calls.count() > 0;
                        }, "getter for attribute " + attributeName + " returns exception", provisioning.ttl);
                    }).then(function() {
                        expect(catchSpy).toHaveBeenCalled();
                        expect(catchSpy.calls.argsFor(0)[0]._typeName).toBeDefined();
                        expect(catchSpy.calls.argsFor(0)[0]._typeName).toEqual("joynr.exceptions.ProviderRuntimeException");
                    });
                };

                this.setAttribute = function(attributeName, value) {
                    var onFulfilledSpy = jasmine.createSpy("onFulfilledSpy");

                    radioProxy[attributeName].set({
                        value : value
                    }).then(onFulfilledSpy).catch(function(error) {
                        return IntegrationUtils.outputPromiseError(new Error("End2EndAbstractTest.setAttribute. Error while setting: " + error.message));
                    });

                    return waitsFor(function() {
                        return onFulfilledSpy.calls.count() > 0;
                    }, "attribute is set", provisioning.ttl).then(function() {
                        expect(onFulfilledSpy).toHaveBeenCalled();
                    });
                };

                this.callOperation = function(
                        operationName,
                        opArgs,
                        expectation) {
                    var onFulfilledSpy = jasmine.createSpy("onFulfilledSpy");

                    radioProxy[operationName](opArgs).then(
                            onFulfilledSpy).catch(function(error) {
                                return IntegrationUtils.outputPromiseError(new Error("End2EndAbstractTest.callOperation. Error while calling operation: " + error.message));
                            });

                    return waitsFor(function() {
                        return onFulfilledSpy.calls.count() > 0;
                    }, "operation call to finish", provisioning.ttl).then(function() {
                        expect(onFulfilledSpy).toHaveBeenCalled();
                        if (expectation !== undefined) {
                            if (typeof expectation === "function") {
                                expectation(onFulfilledSpy);
                            }
                            else {
                                expect(onFulfilledSpy).toHaveBeenCalledWith(expectation);
                            }
                        }
                    });
                };

                this.unsubscribeSubscription = function(subscribingEntity, subscriptionId) {
                    return radioProxy[subscribingEntity].unsubscribe({
                        subscriptionId : subscriptionId
                    });
                };

                this.setupSubscriptionAndReturnSpy = function(subscribingEntity, subscriptionQos, partitions){
                    var promise, spy = jasmine.createSpyObj("spy", [
                                                                    "onFulfilled",
                                                                    "onReceive",
                                                                    "onError"
                                                                ]);

                    promise = radioProxy[subscribingEntity].subscribe({
                        subscriptionQos : subscriptionQos,
                        partitions: partitions,
                        onReceive : spy.onReceive,
                        onError : spy.onError
                    }).then(spy.onFulfilled).catch(function(error) {
                        return IntegrationUtils.outputPromiseError(new Error("End2EndAbstractTest.setupSubscriptionAndReturnSpy. Error while subscribing: " + error.message));
                    });

                    return waitsFor(function() {
                        return spy.onFulfilled.calls.count() > 0;
                    }, "subscription to be registered", provisioning.ttl).then(function() {
                        return Promise.resolve(spy);
                    });
                };

                this.expectPublication = function(spy, expectationFct){
                    return waitsFor(
                            function() {
                                return (spy.onReceive.calls.count() > 0 || spy.onError.calls.count() > 0);
                            },
                            "first publication to occur",
                            500 + provisioning.ttl).then(function() {
                        expect(spy.onReceive).toHaveBeenCalled();
                        expect(spy.onError).not.toHaveBeenCalled();
                        if (expectationFct) {
                            expectationFct(spy.onReceive.calls.mostRecent());
                        }
                        spy.onReceive.calls.reset();
                    });
                };

                this.afterEach = function(done) {
                    IntegrationUtils.shutdownWebWorker(workerId).then(function() {
                        return IntegrationUtils.shutdownLibjoynr();
                    }).then(function() {
                        done();
                        return null;
                    }).catch(function() {
                        throw new Error("shutdown Webworker and Libjoynr failed");
                    });
                };
            }
            return End2EndAbstractTest;
        });


text:
'use strict';

// Declare app level module which depends on filters, and services
var ooniprobe = angular.module('ooniprobe', ['ngUpload', 'ooniprobe.services']).
  config(['$routeProvider', function($routeProvider) {

    $routeProvider.when('/inputs',
      {
        templateUrl: 'views/inputs.html',
        controller: 'InputsCtrl'
      }
    );

    $routeProvider.when('/settings',
      {
        templateUrl: 'views/settings.html',
        controller: 'SettingsCtrl'
      }
    );

    $routeProvider.when('/test/:testID',
      {
        templateUrl: 'views/test.html',
        controller: 'TestCtrl'
      }
    );

    $routeProvider.otherwise({redirectTo: '/settings'});
  }]);


text: mvn -Dmaven.repo.local=$1 -DcreateChecksum=true clean source:jar install


text:
package com.entertailion.android.launcher.weather;

// http://code.google.com/p/ongoingweather/

import java.util.ArrayList;

/**
 * Data structure to store current and forecast weather data.
 *
 * @author leon_nicholls
 *
 */
public class WeatherSet {
	private WeatherCurrentCondition myCurrentCondition = null;
	private ArrayList<WeatherForecastCondition> myForecastConditions = new ArrayList<WeatherForecastCondition>(4);
	private String hazard;
	private String hazardUrl;

	public WeatherCurrentCondition getWeatherCurrentCondition() {
		return myCurrentCondition;
	}

	public void setWeatherCurrentCondition(WeatherCurrentCondition myCurrentWeather) {
		this.myCurrentCondition = myCurrentWeather;
	}

	public ArrayList<WeatherForecastCondition> getWeatherForecastConditions() {
		return this.myForecastConditions;
	}

	public WeatherForecastCondition getLastWeatherForecastCondition() {
		return this.myForecastConditions.get(this.myForecastConditions.size() - 1);
	}

	public String getHazard() {
		return this.hazard;
	}

	public void setHazard(String hazard) {
		this.hazard = hazard;
	}

	public String getHazardUrl() {
		return this.hazardUrl;
	}

	public void setHazardUrl(String hazardUrl) {
		this.hazardUrl = hazardUrl;
	}
}


text:
"""Simple integration test to validate the syntax of `deploy.json`."""

# standard library
import json
import unittest

class DeploySyntaxTests(unittest.TestCase):
  """Tests for `deploy.json`."""

  def test_syntax(self):
    """Ensure that `deploy.json` is valid JSON."""

    with open('repos/delphi/delphi-epidata/deploy.json', 'r') as f:
      self.assertIsInstance(json.loads(f.read()), dict)


text:
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.cache import cache
from django.core.urlresolvers import reverse

# lfs imports
from lfs.cart.models import Cart

# Load logger
import logging
logger = logging.getLogger(__name__)

def get_or_create_cart(request):
    """
    Returns the cart of the current user. If no cart exists yet it creates a
    new one first.
    """
    cart = get_cart(request)
    if cart is None:
        cart = create_cart(request)

    return cart

def create_cart(request):
    """
    Creates a cart for the current session and/or user.
    """
    if request.session.session_key is None:
        request.session.save()

    cart = Cart(session=request.session.session_key)
    if request.user.is_authenticated():
        cart.user = request.user

    cart.save()
    return cart

def get_cart(request):
    """
    Returns the cart of the current shop customer. if the customer has no cart
    yet it returns None.
    """
    session_key = request.session.session_key
    user = request.user

    if user.is_authenticated():
        try:
            cache_key = "%s-cart-%s" % (settings.CACHE_MIDDLEWARE_KEY_PREFIX, user.pk)
            cart = cache.get(cache_key)
            if cart is None:
                try:
                    cart = Cart.objects.get(user=user)
                except Cart.MultipleObjectsReturned:
                    carts = Cart.objects.filter(user=user)
                    cart = carts[0]
                    carts.exclude(pk=cart.pk).delete()
                cache.set(cache_key, cart)
            return cart
        except ObjectDoesNotExist:
            return None
    else:
        try:
            cache_key = "%s-cart-%s" % (settings.CACHE_MIDDLEWARE_KEY_PREFIX, session_key)
            cart = cache.get(cache_key)
            if cart is None:
                try:
                    cart = Cart.objects.get(session=session_key)
                except Cart.MultipleObjectsReturned:
                    carts = Cart.objects.filter(session=session_key)
                    cart = carts[0]
                    carts.exclude(pk=cart.pk).delete()
                cache.set(cache_key, cart)
            return cart
        except ObjectDoesNotExist:
            return None

def get_go_on_shopping_url(request):
    """
    Calculates the go on shopping url based on the last visited category or last visited manufacturer
    """
    # visiting category clears last_manufacturer so manufacturer has higher priority
    lc = request.session.get("last_manufacturer", request.session.get("last_category"))
    if lc:
        return lc.get_absolute_url()
    else:
        return reverse("lfs_shop_view")

def update_cart_after_login(request):
    """
    Updates the cart after login.

    1. if there is no session cart, nothing has to be done.
    2. if there is a session cart and no user cart we assign the session cart
       to the current user.
    3. if there is a session cart and a user cart we add the session cart items
       to the user cart.
    """
    try:
        session_cart = Cart.objects.get(session=request.session.session_key)
        try:
            user_cart = Cart.objects.get(user=request.user)
        except ObjectDoesNotExist:
            session_cart.user = request.user
            session_cart.save()
        else:
            for session_cart_item in session_cart.get_items():
                properties = {}
                for pv in session_cart_item.properties.all():
                    properties[unicode(pv.property.id)] = pv.value
                user_cart.add(session_cart_item.product, properties_dict=properties, amount=session_cart_item.amount)
            session_cart.delete()
    except ObjectDoesNotExist:
        pass


text:
from __future__ import absolute_import
from datetime import datetime, timedelta
import itertools
import json
import os

from vilya.models.badge import Badge
from vilya.models import badge_timeline
from vilya.models.user import User
from vilya.libs.template import st

_q_exports = ['fetch_new', 'all', 'timeline', 'badges', 'items', 'count',
              'add']

def fetch_new(request):
    user = request.user
    if user:
        return json.dumps([{'bid': str(b.id)} for b in user.get_new_badges()])
    return ''

def all(request):
    user = request.user
    badges = Badge.get_all_badges()
    return st('badge/all.html', **locals())

def timeline(request):
    today = datetime.now().date()
    yesterday = today - timedelta(days=1)
    return st('badge/timeline.html', **locals())

def badges(request):
    return json.dumps(badge_timeline.get_all_badges())

def items(request):
    index = int(request.get_form_var('ind', default=0))
    increment = int(request.get_form_var('inc', default=10))
    name = request.get_form_var('n', default='')
    item_list = badge_timeline.get_all_items(index, increment, name)
    item_list = [list(item) + [User(item[1]).avatar_url] for item in item_list]
    items = []
    for k, g in itertools.groupby(item_list, lambda row: row[3].date()):
        items.append(list(g))
    datehandler = lambda obj: obj.isoformat(
    ) if isinstance(obj, datetime) else None
    return json.dumps(items, default=datehandler)

def count(request):
    name = request.get_form_var('n', default='')
    return json.dumps(badge_timeline.get_item_count(name))

def add(request):
    if request.method == 'POST':
        name = request.get_form_var('name', '').strip()
        found = Badge.get_by_name(name)
        if found:
            return request.redirect('/badge/%s/' % found.id)

        summary = request.get_form_var('summary')
        filename = request.get_form_var("picfile").tmp_filename
        content = open(filename).read()

        new = Badge.add(name, summary)
        root = os.environ['DAE_APPROOT']
        pic_path = '%s/hub/static/img/badges/%s.png' % (root, new.id)
        open(pic_path, 'w').write(content)

        return request.redirect('/badge/%s/' % new.id)
    return st('badge/add.html', request=request)

class BadgeUI(object):
    _q_exports = ['people']

    def __init__(self, badge):
        self.badge = badge

    def _q_index(self, request):
        current_user = request.user
        badge = self.badge
        items = badge.get_awarded_items()
        users = [User(item.item_id) for item in items]
        return st('badge/badge.html', **locals())

    def people(self, request):
        current_user = request.user
        badge = self.badge
        if not current_user:
            return request.redirect('/badge/%s/' % badge.id)
        if current_user.name not in ['liwanjin', 'xutao']:
            return request.redirect('/badge/%s/' % badge.id)
        if request.method != 'POST':
            return request.redirect('/badge/%s/' % badge.id)
        name = request.get_form_var('name')
        reason = request.get_form_var('reason')
        if not name:
            return request.redirect('/badge/%s/' % badge.id)
        if not User.check_exist(name):
            return request.redirect('/badge/%s/' % badge.id)
        badge.award(name, reason=reason)
        return request.redirect('/badge/%s/' % badge.id)

def _q_lookup(request, id):
    b = Badge.get(id)
    if b:
        return BadgeUI(b)


text:
Parser.Statement.If = Ext.extend(Parser.Statement, {
    satisfied: false,

    evaluate: function() {
        var ret = true, n;

        for (n in this.properties) {
            if (!Parser.evaluate(n, this.properties[n])) {
                ret = false;
                break;
            }
        }

        return (this.isInverted ? !ret : ret);
    },

    parse: function(stream) {
        if (this.evaluate()) {
            this.satisfied = true;
        }

        Parser.Statement.If.superclass.parse.apply(this, arguments);

        if (!this.satisfied) {
            return '';
        }

        return this.buffer;
    },

    onSubStatement: function(statement, stream) {
        var parsed = statement.parse(stream),
            satisfied = false;

        if (statement.type === 'elseif') {
            if (!this.satisfied) {
                if (statement.evaluate()) {
                    this.satisfied = true;
                    satisfied = true;
                }
            }
        } else if (statement.type === 'else') {
            if (!this.satisfied) {
                this.satisfied = true;
                satisfied = true;
            }
        } else {
            this.pushBuffer(parsed);
            return;
        }

        if (satisfied) {
            this.resetBuffer();
            this.pushBuffer(parsed);
        }
    }
});


text:
using namespace gpopt;

//---------------------------------------------------------------------------
//	@function:
//		CPattern::PdpCreate
//
//	@doc:
//		Pattern operators cannot derive properties; the assembly of the
//		expression has to take care of this on a higher level
//
//---------------------------------------------------------------------------
CDrvdProp *
CPattern::PdpCreate(CMemoryPool *  // mp
) const
{
	GPOS_ASSERT(!"Cannot derive properties on pattern");
	return nullptr;
}

//---------------------------------------------------------------------------
//	@function:
//		CPattern::PrpCreate
//
//	@doc:
//		Pattern operators cannot compute required properties; the assembly of the
//		expression has to take care of this on a higher level
//
//---------------------------------------------------------------------------
CReqdProp *
CPattern::PrpCreate(CMemoryPool *  // mp
) const
{
	GPOS_ASSERT(!"Cannot compute required properties on pattern");
	return nullptr;
}

//---------------------------------------------------------------------------
//	@function:
//		CPattern::Matches
//
//	@doc:
//		match against an operator
//
//---------------------------------------------------------------------------
BOOL
CPattern::Matches(COperator *pop) const
{
	return Eopid() == pop->Eopid();
}

//---------------------------------------------------------------------------
//	@function:
//		CPattern::FInputOrderSensitive
//
//	@doc:
//		By default patterns are leaves; no need to call this function ever
//
//---------------------------------------------------------------------------
BOOL
CPattern::FInputOrderSensitive() const
{
	GPOS_ASSERT(!"Unexpected call to function FInputOrderSensitive");
	return true;
}

//---------------------------------------------------------------------------
//	@function:
//		CPattern::PopCopyWithRemappedColumns
//
//	@doc:
//		Return a copy of the operator with remapped columns
//
//---------------------------------------------------------------------------
COperator *
CPattern::PopCopyWithRemappedColumns(CMemoryPool *,		  //mp,
									 UlongToColRefMap *,  //colref_mapping,
									 BOOL				  //must_exist
)
{
	GPOS_ASSERT(
		!"PopCopyWithRemappedColumns should not be called for a pattern");
	return nullptr;
}

// EOF


text:
XLSlideView is a multi-UIViewController management container.

## Usage

XLSlideView offers two different styles, including XLCornerSlideView and XLLineSlideView.

- ### XLCornerSlideView

    ![snapshot](/Snapshots/corner.gif)

    #### Initialize XLCornerSlideView
    ```objc
    self.automaticallyAdjustsScrollViewInsets = NO;
    XLCornerSlideView *slideView = [[XLCornerSlideView alloc] initWithFrame:CGRectMake(0, 20 + 44, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 20 - 44)];
    slideView.delegate = self;
    slideView.baseViewController = self;
    slideView.itemArray = @[@"View1", @"View2", @"View3", @"View4", @"View5", @"View6", @"View7", @"View8"];
    slideView.selectedIndex = 0;
    [self.view addSubview:slideView];
    ```

    #### Implement delegate
    ```objc
    - (NSInteger)numberOfControllersInXLCornerSlideView:(XLCornerSlideView *)sender
    {
        return 8;
    }

    - (UIViewController *)XLCornerSlideView:(XLCornerSlideView *)sender controllerAt:(NSInteger)index
    {
        XLChildViewController *viewController = [[XLChildViewController alloc] init];
        return viewController;
    }
    ```

- #### XLLineSlideView

    ![snapshot](/Snapshots/line.gif)

    #### Initialize XLLineSlideView
    ```objc
    self.automaticallyAdjustsScrollViewInsets = NO;
    XLLineSlideView *slideView = [[XLLineSlideView alloc] initWithFrame:CGRectMake(0, 20 + 44, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 20 - 44)];
    slideView.delegate = self;
    slideView.baseViewController = self;
    slideView.itemArray = @[@"View1", @"View2", @"View3"];
    slideView.selectedIndex = 0;
    [self.view addSubview:slideView];
    ```

    #### Implement delegate
    ```objc
    - (NSInteger)numberOfControllersInXLLineSlideView:(XLLineSlideView *)sender
    {
        return 3;
    }

    - (UIViewController *)XLLineSlideView:(XLLineSlideView *)sender controllerAt:(NSInteger)index
    {
        XLChildViewController *viewController = [[XLChildViewController alloc] init];
        return viewController;
    }
    ```

- #### Please refer to Demo for more settings

## Installation

Use CocoaPods

```ruby
pod 'XLSlideView'
```

## License

MIT


text:
package org.kuali.kra.service.impl;

import org.apache.commons.lang.StringUtils;
import org.kuali.kra.service.DocHandlerUrlPrefixPublishingService;
import org.kuali.rice.core.api.config.ConfigurationException;
import org.kuali.rice.core.api.config.module.RunMode;
import org.kuali.rice.core.api.config.property.ConfigContext;
import org.kuali.rice.coreservice.api.parameter.EvaluationOperator;
import org.kuali.rice.coreservice.api.parameter.Parameter;
import org.kuali.rice.coreservice.api.parameter.ParameterType;
import org.kuali.rice.coreservice.framework.parameter.ParameterService;
import org.kuali.rice.kew.api.KewApiServiceLocator;
import org.springframework.beans.factory.InitializingBean;

/**
 * The DocHandlerUrlPrefixPublishingService Implementation.
 *
 * @author Kuali Research Administration Team (kualidev@oncourse.iu.edu)
 */
public class DocHandlerUrlPrefixPublishingServiceImpl implements DocHandlerUrlPrefixPublishingService, InitializingBean {
    private String parameterName;
    private String parameterApplicationId;
    private String parameterNamespaceCode;
    private String parameterComponentCode;
    private String parameterTypeCode;
    private String parameterValue;

    private ParameterService parameterService;

    public String getParameterName() {
        return parameterName;
    }

    public void setParameterName(String parameterName) {
        this.parameterName = parameterName;
    }

    public String getParameterApplicationId() {
        return parameterApplicationId;
    }

    public void setParameterApplicationId(String parameterApplicationId) {
        this.parameterApplicationId = parameterApplicationId;
    }

    public String getParameterNamespaceCode() {
        return parameterNamespaceCode;
    }

    public void setParameterNamespaceCode(String parameterNamespaceCode) {
        this.parameterNamespaceCode = parameterNamespaceCode;
    }

    public String getParameterComponentCode() {
        return parameterComponentCode;
    }

    public void setParameterComponentCode(String parameterComponentCode) {
        this.parameterComponentCode = parameterComponentCode;
    }

    public String getParameterTypeCode() {
        return parameterTypeCode;
    }

    public void setParameterTypeCode(String parameterTypeCode) {
        this.parameterTypeCode = parameterTypeCode;
    }

    public String getParameterValue() {
        return parameterValue;
    }

    public void setParameterValue(String parameterValue) {
        this.parameterValue = parameterValue;
    }

    public void setParameterService(ParameterService parameterService) {
        this.parameterService = parameterService;
    }

    public RunMode getKewRunMode() {
        String propertyName = KewApiServiceLocator.KEW_RUN_MODE_PROPERTY;
        String runMode = ConfigContext.getCurrentContextConfig().getProperty(propertyName);
        if (StringUtils.isBlank(runMode)) {
            throw new ConfigurationException("Failed to determine kew run mode.  Please be sure to set configuration parameter kew.mode");
        }
        return RunMode.valueOf(runMode.toUpperCase());
    }

    @Override
    public void publishDocHandlerUrlPrefix() {
        if (RunMode.EMBEDDED == getKewRunMode()) {
            ParameterType.Builder parameterType = ParameterType.Builder.create(parameterTypeCode);
            Parameter.Builder parameter = Parameter.Builder.create(parameterApplicationId, parameterNamespaceCode, parameterComponentCode, parameterName, parameterType);
            parameter.setDescription("KC application docHandler prefix");
            parameter.setValue(parameterValue);
            parameter.setEvaluationOperator(EvaluationOperator.ALLOW);
            Parameter existingParameter = parameterService.getParameter(parameterNamespaceCode, parameterComponentCode, parameterName);
            if(existingParameter == null) {
                parameterService.createParameter(parameter.build());
            } else if(!StringUtils.equals(existingParameter.getValue(), parameterValue)) {
                parameter.setObjectId(existingParameter.getObjectId());
                parameter.setVersionNumber(existingParameter.getVersionNumber());
                parameterService.updateParameter(parameter.build());
            }
        }
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        publishDocHandlerUrlPrefix();
    }
}


text:
<?php

namespace Sonata\MediaBundle\PHPCR;

use Sonata\MediaBundle\Model\Media;

abstract class BaseMedia extends Media
{
    /**
     * @var string
     */
    private $uuid;

    /**
     * Get universal unique id.
     *
     * @return string
     */
    public function getUuid()
    {
        return $this->uuid;
    }

    public function prePersist()
    {
        $this->createdAt = new \DateTime();
        $this->updatedAt = new \DateTime();
    }

    public function preUpdate()
    {
        $this->updatedAt = new \DateTime();
    }
}


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<FKIndexAssociation class="oracle.dbtools.crest.model.design.relational.FKIndexAssociation" directorySegmentName="seg_0" id="0EE66819-D4BB-23C0-4746-D63362794888" containerWithKeyObject="FEE03688-AC5B-C862-DBB0-09B7FFCBC5DF" localFKIndex="0504A808-480F-F5E5-0EAC-9F114FAFC408" name="canvassing_fact_state_senate_district_dim_FK">
<createdBy>beng</createdBy>
<createdTime>2016-07-18 20:14:13 UTC</createdTime>
<ownerDesignName>VoterModel</ownerDesignName>
<deleteRule>NO ACTION</deleteRule>
<referredTableID>A5704CDA-90E1-9CB0-EF2B-54EECFEBD4D4</referredTableID>
<keyObject>EE6FB6D9-5D1B-D3BE-A203-2DE68CF5C7E4</keyObject>
<referredKeyID>EE6FB6D9-5D1B-D3BE-A203-2DE68CF5C7E4</referredKeyID>
<mandatory>true</mandatory>
<transferable>true</transferable>
<rely>false</rely>
<columnDependencyConstraintGenerateInDDL>true</columnDependencyConstraintGenerateInDDL>
</FKIndexAssociation>


text:
package snakesladders.contollers

import akka.actor.ActorSystem
import akka.testkit.{ImplicitSender, TestKit}
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
import snakesladders.controllers.GameController
import snakesladders.domain.services.GameService.RollDiceForCurrentPlayer

class GameControllerSpecs
  extends TestKit(ActorSystem("GameControllerSpecs"))
    with ImplicitSender
    with WordSpecLike
    with Matchers
    with BeforeAndAfterAll {

  override def afterAll {
    TestKit.shutdownActorSystem(system)
  }

  "GameController" when {
    "told to roll the dice for a player" should {
      "roll the the dice" in {
        val controller = system.actorOf(GameController.props(testActor))

        controller ! "roll"
        expectMsg(RollDiceForCurrentPlayer)
      }
    }
  }

}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=constant.CL_KERNEL_COMPILE_NUM_SUB_GROUPS.html">

Redirecting to constant.CL_KERNEL_COMPILE_NUM_SUB_GROUPS.html...


text:
package gui.observers;

import gui.component.Widget;
import gui.render.State;

import java.util.Observable;

import ast.expr.Identifier;

public class WidgetChangeHandler extends Observable implements EventListener {

	private Identifier ident;
	private Widget widget;
	private State state;

	public WidgetChangeHandler(Identifier ident, Widget widget, State state) {
		this.ident = ident;
		this.widget = widget;
		this.state = state;
		widget.addListener(this);
	}

	@Override
	public void handleEvent(EventChange e) {
		state.addValue(ident, widget.getValue());
		setChanged();
		notifyObservers();
	}

}


text:
module Varese
  module CensusData
    class VariableMetaSet < Meta
      attr_reader :by_guid, :by_label, :by_concept, :by_concept_id
      def initialize(raw)
        @by_guid       = {}
        @by_label      = Hash.new {|h,k| h[k] = [] }
        @by_concept    = Hash.new {|h,k| h[k] = [] }
        @by_concept_id = Hash.new {|h,k| h[k] = [] }

        # FIXME: this may need some optimization (45000 variables in ACS5)
        raw["variables"].each do |guid, data|
          v = VariableMeta.new(guid, data)
          by_guid[v.guid] = v
          by_label[v.label]           << v if v.label
          by_concept[v.concept]       << v if v.concept
          by_concept_id[v.concept_id] << v if v.concept_id
        end
      end

      # Simple case insensitive matching.
      def search_labels(terms)
        regex = Regexp.new(terms, true)
        by_label.select {|label, _| label.match(regex) }.values.flatten.uniq
      end

      def search_guids(terms)
        by_guid.select {|guid, _| guid[terms] }.values
      end

      def search_concepts(terms)
      end

      def count
        by_guid.count
      end

      def inspect
        "#<Varese::CensusData::VariableMetaSet (#{count} variables)>"
      end

      def concepts
        by_concept.keys
      end
    end
  end
end


text:
/*	author:@shivkrthakur  */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
    static void Main(String[] args) {
        int mod = 1234567;
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
        int t = Convert.ToInt32(Console.ReadLine().Trim());
        for(int i = 0; i < t; i++){
            int n = Convert.ToInt32(Console.ReadLine().Trim());
            var arr = Console.ReadLine().Trim().Split().Select(Int32.Parse).ToArray();
            int output = 1;
            for(int j = 0; j < arr.Length; j++){
                output = ((output % mod) * (arr[j] % mod)) % mod;
            }
            Console.WriteLine($"{output}");
        }
    }
}


text:
import { VFC } from 'react';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
import { Delete } from '@mui/icons-material';
import { IconButton, Tooltip } from '@mui/material';
import { IStrategy } from 'interfaces/strategy';
import { DELETE_STRATEGY } from 'component/providers/AccessProvider/permissions';
import { useId } from 'hooks/useId';

interface IStrategyDeleteButtonProps {
    strategy: IStrategy;
    onClick: () => void;
}

export const StrategyDeleteButton: VFC<IStrategyDeleteButtonProps> = ({
    strategy,
    onClick,
}) => {
    const id = useId();

    return (
        <ConditionallyRender
            condition={strategy?.editable}
            show={
                <PermissionIconButton
                    onClick={onClick}
                    permission={DELETE_STRATEGY}
                    tooltipProps={{ title: 'Delete strategy' }}
                >
                    <Delete />
                </PermissionIconButton>
            }
            elseShow={
                <Tooltip title="You cannot delete a built-in strategy" arrow>
                    <div id={id}>
                        <IconButton disabled size="large">
                            <Delete aria-labelledby={id} />
                        </IconButton>
                    </div>
                </Tooltip>
            }
        />
    );
};