Example #1
0
function branch($h, $rotate, $x, $y)
{
    global $image, $theta;
    if ($h < 2) {
        return;
    }
    $h *= 0.66;
    $movedX = cos($rotate + $theta) * $h + $x;
    $movedY = sin($rotate + $theta) * $h + $y;
    $image->graphics->moveTo($x, $y)->lineTo($movedX, $movedY);
    branch($h, $rotate + $theta, $movedX, $movedY);
    $movedX = cos($rotate - $theta) * $h + $x;
    $movedY = sin($rotate - $theta) * $h + $y;
    $image->graphics->moveTo($x, $y)->lineTo($movedX, $movedY);
    branch($h, $rotate - $theta, $movedX, $movedY);
}
Example #2
0
function GetPage($res = '')
{
    $data = '
	<div id="dialog-form">
	    <fieldset>
	    	<legend>ძირითადი ინფორმაცია</legend>
	    	
	    	<table class="dialog-form-table">
	            <tr>
					<td style="width: 170px;"><label for="parent_id">უბანი</label></td>
					<td>
						<input type="checkbox" id="ubani" ' . ($res[parent_id] > 0 ? 'checked' : "") . '>
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="category">ქვე კატეგორია</label></td>
					<td>
						<input type="text" id="category" class="idle address" onblur="this.className=\'idle address\'" onfocus="this.className=\'activeField address\'" value="' . $res['name'] . '" />
					</td>
				</tr>
				<tr>
					<td style="width: 170px;"><label for="parent_id">კატეგორია</label></td>
					<td>
						<select id="parent_id" class="idls large">' . Get_Category($res['parent_id']) . '</select>
					</td>
				</tr>
				<tr id="br_show">
					<td style="width: 170px;"><label for="parent_id">ფილიალი</label></td>
					<td>
						<select id="branch_id" class="idls large">' . branch($res['branch_id']) . '</select>
					</td>
				</tr>
			</table>
			<!-- ID -->
			<input type="hidden" id="cat_id" value="' . $res['id'] . '" />
        </fieldset>
    </div>
    ';
    return $data;
}
    echo 'coordinator' . $coordinator['student_id'];
    ?>
">
                                <td>
                                    <?php 
    echo "<img class='profile_pic_table' src='" . base_url() . "profile_pics/" . $coordinator['pic'] . " '>";
    ?>
                                </td>
                                <td>
                                    <?php 
    echo humanize($coordinator['name']);
    ?>
                                </td>
                                <td>
                                    <?php 
    echo branch($coordinator['branch'], $branch_details);
    ?>
                                </td>
                                <td>
                                    <?php 
    echo $coordinator['year_pass'];
    ?>
                                </td>
                                <td>
                                    <?php 
    echo $coordinator['mobno'];
    ?>
                                </td>
                                <td>
                                    <?php 
    echo $coordinator['email'];
Example #4
0
    $c = compose(with($x), 'plus');
    return $c($y) !== $x + $y;
}, 'sum' => function () {
    return sum($xs = range(0, mt_rand(1, 100))) !== array_reduce($xs, 'plus', 0);
}, 'random1' => function () {
    return !is_int(random(null));
}, 'mem1' => function () {
    return mem('true') <= 0;
}, 'upto1' => function ($n) {
    return count(upto($n % 100)) !== $n % 100;
}, 'between1' => function () {
    return between(5, 10) !== [5, 6, 7, 8, 9, 10];
}, 'b_then' => function ($n) {
    return branch(thunk($n), null, thunk(true), null) !== $n;
}, 'b_else' => function ($n) {
    return branch(null, thunk($n), thunk(false), null) !== $n;
}, 'until1' => function ($n) {
    $x = $n % 8;
    return until(function ($args) use($x) {
        list($m, $arr) = $args;
        return [$m === $x, [$m + 1, snoc($m, $arr)]];
    }, [0, []]) !== [$x + 1, upto($x + 1)];
}, 'trampoline1' => function ($n) {
    $x = $n % 8;
    return trampoline(y(function ($f, $m, $n, $_) {
        return $m < $n ? [false, $f($m + 1, $n)] : [true, $m];
    }, 0, $x)) !== $x;
}, 'loop1' => function ($x) {
    $n = $x % 8;
    $lhs = loop(function ($x, $m) use($n) {
        return [$m >= $n, snoc($m, $x)];
Example #5
0
<?php

// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require dirname(__FILE__) . '/svntools.php';
// Perform basic checks
info("Verifying...");
if (!isset($_SERVER['argc']) || $_SERVER['argc'] != 2) {
    error("Missing argument. Expecting branch to create from trunk as argument.\n\nExamples:\n\tbranches/5.x\n\tbranches/experimental/foobar");
}
$source = full('trunk');
$branch = full($_SERVER['argv'][1]);
$repo = get_info($source);
$target = get_info($branch);
if (isset($target->entry)) {
    error("The branch already exists.");
}
if (!is_valid_branch($branch)) {
    error("The provided branch is not an acceptable branch location.");
}
$revision = (int) $repo->entry->commit['revision'];
// Execute
info("Branching...");
if (!branch($source, $branch, $revision)) {
    error("Branch could not be created.");
}