text:
<?php

?>
<?php
class testtaskModel extends model
{
    /**
     * Set the menu.
     *
     * @param  array $products
     * @param  int   $productID
     * @access public
     * @return void
     */
    public function setMenu($products, $productID)
    {
        $this->loadModel('product')->setMenu($products, $productID);
        $selectHtml = $this->product->select($products, $productID, 'testtask', 'browse');
        foreach($this->lang->testtask->menu as $key => $value)
        {
            $replace = ($key == 'product') ? $selectHtml : $productID;
            common::setMenuVars($this->lang->testtask->menu, $key, $replace);
        }
    }

    /**
     * Create a test task.
     *
     * @param  int   $productID
     * @access public
     * @return void
     */
    function create()
    {
        $task = fixer::input('post')->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags)->get();
        $this->dao->insert(TABLE_TESTTASK)->data($task)
            ->autoCheck($skipFields = 'begin,end')
            ->batchcheck($this->config->testtask->create->requiredFields, 'notempty')
            ->checkIF($task->begin != '', 'begin', 'date')
            ->checkIF($task->end   != '', 'end', 'date')
            ->checkIF($task->end != '', 'end', 'ge', $task->begin)
            ->exec();
        if(!dao::isError()) return $this->dao->lastInsertID();
    }

    /**
     * Get test tasks of a product.
     *
     * @param  int    $productID
     * @param  string $orderBy
     * @param  object $pager
     * @access public
     * @return array
     */
    public function getProductTasks($productID, $orderBy = 'id_desc', $pager = null, $type = '')
    {
        return $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
            ->from(TABLE_TESTTASK)->alias('t1')
            ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
            ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
            ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
            ->where('t1.product')->eq((int)$productID)
            ->andWhere('t1.deleted')->eq(0)
            ->beginIF($type == 'wait')->andWhere('t1.status')->ne('done')->fi()
            ->beginIF($type == 'done')->andWhere('t1.status')->eq('done')->fi()
            ->orderBy($orderBy)
            ->page($pager)
            ->fetchAll();
    }

    /**
     * Get test tasks of a project.
     *
     * @param  int    $projectID
     * @param  string $orderBy
     * @param  object $pager
     * @access public
     * @return array
     */
    public function getProjectTasks($projectID, $orderBy = 'id_desc', $pager = null)
    {
        return $this->dao->select('t1.*, t2.name AS buildName')
            ->from(TABLE_TESTTASK)->alias('t1')
            ->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.build = t2.id')
            ->where('t1.project')->eq((int)$projectID)
            ->andWhere('t1.deleted')->eq(0)
            ->orderBy($orderBy)
            ->page($pager)
            ->fetchAll();
    }

    /**
     * Get test task info by id.
     *
     * @param  int   $taskID
     * @param  bool  $setImgSize
     * @access public
     * @return void
     */
    public function getById($taskID, $setImgSize = false)
    {
        $task = $this->dao->select('t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName')
            ->from(TABLE_TESTTASK)->alias('t1')
            ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
            ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
            ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
            ->where('t1.id')->eq((int)$taskID)->fetch();
        if($setImgSize) $task->desc = $this->loadModel('file')->setImgSize($task->desc);
        return $task;
    }

    /**
     * Get taskrun by case id.
     *
     * @param  int    $taskID
     * @param  int    $caseID
     * @access public
     * @return void
     */
    public function getRunByCase($taskID, $caseID)
    {
        return $this->dao->select('*')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->andWhere('`case`')->eq($caseID)->fetch();
    }

    /**
     * Get test tasks by user.
     *
     * @param   string $account
     * @access  public
     * @return  array
     */
    public function getByUser($account, $pager = null, $orderBy = 'id_desc', $type = '')
    {
        return $this->dao->select('t1.*, t2.name AS projectName, t3.name AS buildName')
            ->from(TABLE_TESTTASK)->alias('t1')
            ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
            ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
            ->where('t1.deleted')->eq(0)
            ->andWhere('t1.owner')->eq($account)
            ->beginIF($type == 'wait')->andWhere('t1.status')->ne('done')->fi()
            ->beginIF($type == 'done')->andWhere('t1.status')->eq('done')->fi()
            ->orderBy($orderBy)
            ->page($pager)
            ->fetchAll();
    }

    /**
     * Update a test task.
     *
     * @param  int   $taskID
     * @access public
     * @return void
     */
    public function update($taskID)
    {
        $oldTask = $this->getById($taskID);
        $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->get();
        $this->dao->update(TABLE_TESTTASK)->data($task)
            ->autoCheck()
            ->batchcheck($this->config->testtask->edit->requiredFields, 'notempty')
            ->checkIF($task->end != '', 'end', 'ge', $task->begin)
            ->where('id')->eq($taskID)
            ->exec();
        if(!dao::isError()) return common::createChanges($oldTask, $task);
    }

    /**
     * Start testtask.
     *
     * @param  int    $taskID
     * @access public
     * @return void
     */
    public function start($taskID)
    {
        $oldTesttask = $this->getById($taskID);
        $testtask = fixer::input('post')
            ->setDefault('status', 'doing')
            ->remove('comment')->get();

        $this->dao->update(TABLE_TESTTASK)->data($testtask)
            ->autoCheck()
            ->where('id')->eq((int)$taskID)
            ->exec();

        if(!dao::isError()) return common::createChanges($oldTesttask, $testtask);
    }

    /**
     * Close testtask.
     *
     * @access public
     * @return void
     */
    public function close($taskID)
    {
        $oldTesttask = $this->getById($taskID);
        $testtask = fixer::input('post')
            ->setDefault('status', 'done')
            ->stripTags($this->config->testtask->editor->close['id'], $this->config->allowedTags)
            ->remove('comment')->get();

        $this->dao->update(TABLE_TESTTASK)->data($testtask)
            ->autoCheck()
            ->where('id')->eq((int)$taskID)
            ->exec();

        if(!dao::isError()) return common::createChanges($oldTesttask, $testtask);
    }

    /**
     * Link cases.
     *
     * @param  int   $taskID
     * @access public
     * @return void
     */
    public function linkCase($taskID)
    {
        if($this->post->cases == false) return;
        foreach($this->post->cases as $caseID)
        {
            $row = new stdclass();
            $row->task       = $taskID;
            $row->case       = $caseID;
            $row->version    = $this->post->versions[$caseID];
            $row->assignedTo = '';
            $row->status     = 'wait';
            $this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
        }
    }

    /**
     * Get test runs of a test task.
     *
     * @param  int    $taskID
     * @param  int    $moduleID
     * @param  object $pager
     * @access public
     * @return array
     */
    public function getRuns($taskID, $moduleID, $orderBy, $pager = null)
    {
        $orderBy = strpos($orderBy, 'assignedTo') !== false ? ('t1.' . $orderBy) : ('t2.' . $orderBy);

        return $this->dao->select('t2.*,t1.*,t2.version as caseVersion,t3.title as storyTitle')->from(TABLE_TESTRUN)->alias('t1')
            ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
            ->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
            ->where('t1.task')->eq((int)$taskID)
            ->beginIF($moduleID)->andWhere('t2.module')->in($moduleID)->fi()
            ->orderBy($orderBy)
            ->page($pager)
            ->fetchAll();
    }

    /**
     * Get test runs of a user.
     *
     * @param  int    $taskID
     * @param  int    $user
     * @param  obejct $pager
     * @access public
     * @return array
     */
    public function getUserRuns($taskID, $user, $orderBy, $pager = null)
    {
        $orderBy = strpos($orderBy, 'assignedTo') !== false ? ('t1.' . $orderBy) : ('t2.' . $orderBy);

        return $this->dao->select('t2.*,t1.*,t2.version as caseVersion')->from(TABLE_TESTRUN)->alias('t1')
            ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
            ->where('t1.task')->eq((int)$taskID)
            ->andWhere('t1.assignedTo')->eq($user)
            ->orderBy($orderBy)
            ->page($pager)
            ->fetchAll();
    }

    /**
     * Get info of a test run.
     *
     * @param  int   $runID
     * @access public
     * @return void
     */
    public function getRunById($runID)
    {
        $testRun = $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch();
        $testRun->case = $this->loadModel('testcase')->getById($testRun->case, $testRun->version);
        return $testRun;
    }

    /**
     * Create test result
     *
     * @param  int   $runID
     * @access public
     * @return void
     */
    public function createResult($runID = 0)
    {
        /* Compute the test result.
         *
         * 1. if there result in the post, use it.
         * 2. if no result, set default is pass.
         * 3. then check the steps to compute result.
         *
         * */
        $caseResult = $this->post->result ? $this->post->result : 'pass';
        if($this->post->steps)
        {
            foreach($this->post->steps as $stepID => $stepResult)
            {
                if($stepResult != 'pass' and $stepResult != 'n/a')
                {
                    $caseResult = $stepResult;
                    break;
                }
            }
        }

        /* Create result of every step. */
        if($this->post->steps)
        {
            foreach($this->post->steps as $stepID =>$stepResult)
            {
                $step['result'] = $stepResult;
                $step['real']   = $this->post->reals[$stepID];
                $stepResults[$stepID] = $step;
            }
        }
        else
        {
            $stepResults = array();
        }

        /* Insert into testResult table. */
        $now = helper::now();
        $result = fixer::input('post')
            ->add('run', $runID)
            ->add('caseResult', $caseResult)
            ->setForce('stepResults', serialize($stepResults))
            ->add('lastRunner', $this->app->user->account)
            ->add('date', $now)
            ->skipSpecial('stepResults')
            ->remove('steps,reals,result')
            ->get();
        $this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
        $this->dao->update(TABLE_CASE)->set('lastRunner')->eq($this->app->user->account)->set('lastRunDate')->eq($now)->set('lastRunResult')->eq($caseResult)->where('id')->eq($this->post->case)->exec();

        if($runID)
        {
            /* Update testRun's status. */
            if(!dao::isError())
            {
                $runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
                $this->dao->update(TABLE_TESTRUN)
                    ->set('lastRunResult')->eq($caseResult)
                    ->set('status')->eq($runStatus)
                    ->set('lastRunner')->eq($this->app->user->account)
                    ->set('lastRunDate')->eq($now)
                    ->where('id')->eq($runID)
                    ->exec();
            }
        }
    }

    /**
     * Batch run case
     *
     * @param  string $runCaseType
     * @access public
     * @return void
     */
    public function batchRun($runCaseType = 'testcase')
    {
        $runs = array();
        $caseIdList = array_keys($this->post->results);
        if($runCaseType == 'testtask') $runs = $this->dao->select('id, `case`')->from(TABLE_TESTRUN)->where('`case`')->in($caseIdList)->fetchPairs('case', 'id');

        $stepGroups = $this->dao->select('t1.*')->from(TABLE_CASESTEP)->alias('t1')
            ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
            ->where('t1.case')->in($caseIdList)
            ->andWhere('t1.version=t2.version')
            ->fetchGroup('case', 'id');

        $now = helper::now();
        foreach($this->post->results as $caseID => $result)
        {
            $runID       = isset($runs[$caseID]) ? $runs[$caseID] : 0;
            $dbSteps     = $stepGroups[$caseID];
            $postSteps   = $this->post->steps[$caseID];
            $postReals   = $this->post->reals[$caseID];

            $caseResult  = $result ? $result : 'pass';
            $stepResults = array();
            foreach($dbSteps as $stepID => $step)
            {
                $step           = array();
                $step['result'] = $caseResult == 'pass' ? $caseResult : $postSteps[$stepID];
                $step['real']   = $caseResult == 'pass' ? '' : $postReals[$stepID];
                $stepResults[$stepID] = $step;
            }

            $result              = new stdClass();
            $result->run         = $runID;
            $result->case        = $caseID;
            $result->version     = $this->post->version[$caseID];
            $result->caseResult  = $caseResult;
            $result->stepResults = serialize($stepResults);
            $result->lastRunner  = $this->app->user->account;
            $result->date        = $now;
            $this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
            $this->dao->update(TABLE_CASE)->set('lastRunner')->eq($this->app->user->account)->set('lastRunDate')->eq($now)->set('lastRunResult')->eq($caseResult)->where('id')->eq($caseID)->exec();

            if($runID)
            {
                /* Update testRun's status. */
                if(!dao::isError())
                {
                    $runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
                    $this->dao->update(TABLE_TESTRUN)
                        ->set('lastRunResult')->eq($caseResult)
                        ->set('status')->eq($runStatus)
                        ->set('lastRunner')->eq($this->app->user->account)
                        ->set('lastRunDate')->eq($now)
                        ->where('id')->eq($runID)
                        ->exec();
                }
            }
        }
    }

    /**
     * Get results by runID or caseID
     *
     * @param  int   $runID
     * @param  int   $caseID
     * @access public
     * @return array
     */
    public function getResults($runID, $caseID = 0)
    {
        if($caseID > 0)
        {
            $results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('`case`')->eq($caseID)->orderBy('id desc')->fetchAll('id');
        }
        else
        {
            $results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
        }

        if(!$results) return array();

        $relatedVersions = array();
        $runIdList       = array();
        foreach($results as $result)
        {
            $runIdList[$result->run] = $result->run;
            $relatedVersions[]       = $result->version;
            $runCaseID               = $result->case;
        }
        $relatedVersions = array_unique($relatedVersions);

        $relatedSteps = $this->dao->select('*')->from(TABLE_CASESTEP)
            ->where('`case`')->eq($runCaseID)
            ->andWhere('version')->in($relatedVersions)
            ->fetchAll();
        $runs = $this->dao->select('t1.id,t2.build')->from(TABLE_TESTRUN)->alias('t1')
            ->leftJoin(TABLE_TESTTASK)->alias('t2')->on('t1.task=t2.id')
            ->where('t1.id')->in($runIdList)
            ->fetchPairs();

        foreach($results as $resultID => $result)
        {
            $result->stepResults = unserialize($result->stepResults);
            $result->build       = $result->run ? zget($runs, $result->run, 0) : 0;
            $results[$resultID]  = $result;

            foreach($relatedSteps as $key => $step)
            {
                if($result->version == $step->version)
                {
                    $result->stepResults[$step->id]['desc']   = $step->desc;
                    $result->stepResults[$step->id]['expect'] = $step->expect;
                }
            }
        }
        return $results;
    }

    /**
     * Judge an action is clickable or not.
     *
     * @param  object $product
     * @param  string $action
     * @access public
     * @return void
     */
    public static function isClickable($testtask, $action)
    {
        $action = strtolower($action);

        if($action == 'start') return $testtask->status == 'wait';
        if($action == 'close') return $testtask->status != 'done';

        return true;
    }
}


text:
from __future__ import absolute_import

from bokeh.charts import Histogram
from bokeh.io import save
from bokeh.models import Plot, ColumnDataSource, Rect, DataRange1d, Row
from bokeh.sampledata.autompg import autompg as df

from tests.integration.utils import has_no_console_errors, wait_for_canvas_resize

import pytest

pytestmark = pytest.mark.integration

def make_sizing_mode_plot(plot_width, plot_height, sizing_mode='scale_width'):
    source = ColumnDataSource(dict(x=[1, 2], y=[1, 1]))
    plot = Plot(
        plot_height=plot_height, plot_width=plot_width,
        x_range=DataRange1d(), y_range=DataRange1d(),
        sizing_mode=sizing_mode
    )
    plot.add_glyph(source, Rect(x='x', y='y', width=0.9, height=0.9))
    return plot

def test_scale_width_resizes_plot_while_maintaining_aspect_ratio(output_file_url, selenium):

    # We want the aspect ratio of the initial plot to be maintained, but we
    # can't measure it perfectly so we test against bounds.
    aspect_ratio = 2
    plot_height = 400
    plot_width = 400 * aspect_ratio
    lower_bound = aspect_ratio * 0.95
    upper_bound = aspect_ratio * 1.05

    # In this test we tell selenium what to set the browser window to be
    # initially and then finally so we can test that the canvas has
    # scaled down by approximately the correct amount.
    initial_window_width = 1200
    final_window_width = 600

    # Make the plot with autoresize
    plot = make_sizing_mode_plot(plot_width, plot_height, sizing_mode='scale_width')
    save(plot)

    # Open the browser with the plot and resize the window to get an initial measure
    selenium.set_window_size(width=initial_window_width, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    initial_height = canvas.size['height']
    initial_width = canvas.size['width']
    initial_aspect_ratio = initial_width / initial_height
    assert initial_aspect_ratio > lower_bound
    assert initial_aspect_ratio < upper_bound

    # Now resize to a smaller window size and check again
    selenium.set_window_size(width=final_window_width, height=600)
    selenium.set_window_size(width=final_window_width, height=599)  # See note (1) below
    wait_for_canvas_resize(canvas, selenium)

    final_height = canvas.size['height']
    final_width = canvas.size['width']
    final_aspect_ratio = final_width / final_height
    assert final_aspect_ratio > lower_bound
    assert final_aspect_ratio < upper_bound

    # Notes:
    # (1) Since the new layout work, this extra kick was necessary for the test
    # to run properly. From what I can tell this is a selenium thing not a
    # real problem, but something to keep an eye on - bird 2016-05-22

def test_scale_width_maintains_a_minimum_width(output_file_url, selenium):
    # The aspect ratio is portrait but should not allow a width less than 100
    plot = make_sizing_mode_plot(600, 1200, sizing_mode='scale_width')
    save(plot)

    # Open the browser with the plot and resize the window small
    selenium.set_window_size(width=100, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Plot should have been shrunk somewhat
    assert canvas.size['width'] < 600
    assert canvas.size['width'] >= 100

def test_scale_width_maintains_a_minimum_height(output_file_url, selenium):
    # The aspect ratio is landscape but should not allow a height less than 100
    plot = make_sizing_mode_plot(1200, 600, sizing_mode='scale_width')
    save(plot)

    # Open the browser with the plot and resize the window small
    selenium.set_window_size(width=100, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Plot should have been shrunk somewhat
    assert canvas.size['height'] < 600
    assert canvas.size['height'] >= 100

def test_scale_width_chart_starts_at_correct_size(output_file_url, selenium):
    hist = Histogram(df['mpg'], title="MPG Distribution", sizing_mode='scale_width')
    save(hist)

    selenium.set_window_size(width=1000, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Canvas width should be just under 1000 * 0.9
    # (default file_html has a body width of 90%)
    assert canvas.size['width'] > 850
    assert canvas.size['width'] < 900

def test_scale_width_plot_starts_at_correct_size(output_file_url, selenium):
    plot = make_sizing_mode_plot(600, 600, sizing_mode='scale_width')
    save(plot)

    selenium.set_window_size(width=1000, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Canvas width should be just under 1000 * 0.9
    # (default file_html has a body width of 90%)
    assert canvas.size['width'] > 850
    assert canvas.size['width'] < 900

def test_stretch_both_plot_is_not_taller_than_page(output_file_url, selenium):
    # We can test this by ensuring the aspect ratio changes after initially
    # setting it to square, and that one dimension is close to the window.

    plot = make_sizing_mode_plot(200, 200, sizing_mode='stretch_both')
    save(plot)

    window_width = 1000
    window_height = 300

    selenium.set_window_size(width=window_width, height=window_height)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    canvas_width = canvas.size['width']
    canvas_height = canvas.size['height']
    # Canvas width & height should match window
    # If it was width mode, the plot would remain square (as per the initial aspect ratio)
    assert canvas_width <= window_width
    assert canvas_height <= window_height

def test_scale_both_resizes_width_and_height_with_fixed_aspect_ratio(output_file_url, selenium):
    # Test that a Bokeh plot embedded in a desktop-ish setting (e.g.
    # a Phosphor widget) behaves well w.r.t. resizing.

    # We want the aspect ratio of the initial plot to be maintained, but we
    # can't measure it perfectly so we test against bounds.
    aspect_ratio = 2
    plot_width = 400 * aspect_ratio
    plot_height = 400
    lower_bound = aspect_ratio * 0.95
    upper_bound = aspect_ratio * 1.05

    plot = make_sizing_mode_plot(plot_width, plot_height, sizing_mode='scale_both')
    save(plot)

    # Open the browser with the plot and resize the window to get an initial measure
    selenium.set_window_size(width=1200, height=600)

    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    canvas = selenium.find_element_by_tag_name('canvas')

    # Check initial size
    wait_for_canvas_resize(canvas, selenium)
    #
    height1 = canvas.size['height']
    width1 = canvas.size['width']
    aspect_ratio1 = width1 / height1
    assert aspect_ratio1 > lower_bound
    assert aspect_ratio1 < upper_bound

    # Now resize to a smaller width and check again
    selenium.set_window_size(width=800, height=600)
    wait_for_canvas_resize(canvas, selenium)
    #
    height2 = canvas.size['height']
    width2 = canvas.size['width']
    aspect_ratio2 = width2 / height2
    assert aspect_ratio2 > lower_bound
    assert aspect_ratio2 < upper_bound
    assert width2 < width1 - 20
    assert height2 < height1 - 20

    # Now resize back and check again
    selenium.set_window_size(width=1200, height=600)
    wait_for_canvas_resize(canvas, selenium)
    #
    height3 = canvas.size['height']
    width3 = canvas.size['width']
    assert width3 == width1
    assert height3 == height1

    # Now resize to a smaller height and check again
    selenium.set_window_size(width=1200, height=400)
    wait_for_canvas_resize(canvas, selenium)
    #
    height4 = canvas.size['height']
    width4 = canvas.size['width']
    aspect_ratio4 = width4 / height4
    assert aspect_ratio4 > lower_bound
    assert aspect_ratio4 < upper_bound
    assert width4 < width1
    assert height4 < height1

    # Now resize back and check again
    selenium.set_window_size(width=1200, height=600)
    wait_for_canvas_resize(canvas, selenium)
    #
    height5 = canvas.size['height']
    width5 = canvas.size['width']
    assert width5 == width1
    assert height5 == height1

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include "pal.h"

// Forward declarations.
namespace Pal
{
class IPipeline;
class IDevice;
}

namespace GpuUtil
{
namespace TextWriterFont
{

// TextWriter Compute Pipelines.
enum class TextWriterComputePipeline : Util::uint32
{
    TextWriter = 0,
    Count
};

template <typename Allocator>
Pal::Result CreateTextWriterComputePipelines(
    Pal::IDevice*    pDevice,
    Allocator*       pAllocator,
    Pal::IPipeline** pPipelineMem);

} // TextWriterFont
} // GpuUtil


text:
//
//  PlanDetailsCommentTCell.m
//  win
//
//  Created by 黄俊煌 on 2017/10/13.
//  Copyright © 2017年 hongsui. All rights reserved.
//

#import "CommentTCell.h"
#import "ReplyTCell.h"
#import "Comment.h"

@interface CommentTCell ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UIButton *iconButton;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) UIView *lineView;
/** 回复 tableView*/
@property (nonatomic, strong) UITableView *tableView;

@end

static NSString * const PlanDetailsCommentTCellIdentifier = @"PlanDetailsCommentTCellIdentifier";

@implementation CommentTCell

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    CommentTCell *cell = [tableView dequeueReusableCellWithIdentifier:PlanDetailsCommentTCellIdentifier];
    if (!cell) {
        cell = [[CommentTCell alloc] initWithStyle:0 reuseIdentifier:PlanDetailsCommentTCellIdentifier];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initUI];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)initUI {
    [self addSubview:self.iconButton];
    [self.iconButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(@20);
        make.size.equalTo(@38);
    }];

    [self addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconButton.mas_right).offset(15);
        make.centerY.equalTo(self.iconButton);
    }];

    [self addSubview:self.dateLabel];
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@-20);
        make.centerY.equalTo(self.nameLabel);
    }];

    [self addSubview:self.contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
//        make.right.equalTo(-20);
        make.width.equalTo(@([UIScreen mainScreen].bounds.size.width - 80));
        make.top.equalTo(self.nameLabel.mas_bottom).offset(13);
    }];

    [self addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentLabel);
        make.right.equalTo(self);
        make.top.equalTo(self.contentLabel.mas_bottom).offset(25);
        make.height.equalTo(@1);
    }];

    [self addSubview:self.tableView];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.right.equalTo(self.dateLabel);
        make.top.equalTo(self.lineView.mas_bottom);
        make.height.equalTo(@0);
    }];
}

- (CGFloat)rowHeightWithComment:(Comment *)comment {
    self.comment = comment;
    [self layoutIfNeeded];

    // 计算tableview的高度
    CGFloat tableViewHeight = 0;
    for (Comment *reply in comment.replys) {
        tableViewHeight = tableViewHeight+[self rowHeightWithReply:reply];
    }
    return CGRectGetMaxY(self.lineView.frame) + tableViewHeight;
}

- (CGFloat)rowHeightWithReply:(Comment *)reply {
    self.reply = reply;
    [self layoutIfNeeded];
    return CGRectGetMaxY(self.lineView.frame);
}

- (void)iconAction {

}

#pragma mark - UITableViewDataSource, UITableViewDelegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.comment.replys.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ReplyTCell *cell = [ReplyTCell cellWithTableView:tableView];
    Comment *reply = self.comment.replys[indexPath.row];
    cell.reply = reply;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    ReplyTCell *cell = [ReplyTCell cellWithTableView:tableView];
    Comment *reply = self.comment.replys[indexPath.row];
    if (reply.rowHeight > 0) {
        return reply.rowHeight;
    }
    CGFloat height = [cell rowHeightWithReply:reply];
    reply.rowHeight = height;
    return height;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (self.didSelectRowAtIndexPathBlock) {
        self.didSelectRowAtIndexPathBlock(tableView, indexPath, self.comment.replys[indexPath.row]);
    }
}

#pragma mark - get

- (UIButton *)iconButton {
    if (_iconButton) return _iconButton;
    _iconButton = [[UIButton alloc] init];
    _iconButton.layer.cornerRadius = 19;
    _iconButton.layer.masksToBounds = YES;
    [_iconButton addTarget:self action:@selector(iconAction) forControlEvents:UIControlEventTouchUpInside];
    return _iconButton;
}

- (UILabel *)nameLabel {
    if (_nameLabel) return _nameLabel;
    _nameLabel = [[UILabel alloc] init];
    _nameLabel.textColor = [UIColor darkGrayColor];
    _nameLabel.font = [UIFont systemFontOfSize:13];
    return _nameLabel;
}

- (UILabel *)dateLabel {
    if (_dateLabel) return _dateLabel;
    _dateLabel = [[UILabel alloc] init];
    _dateLabel.textColor = [UIColor lightTextColor];
    _dateLabel.font = [UIFont systemFontOfSize:13];
    return _dateLabel;
}

- (UILabel *)contentLabel {
    if (_contentLabel) return _contentLabel;
    _contentLabel = [[UILabel alloc] init];
    _contentLabel.textColor = [UIColor lightGrayColor];
    _contentLabel.font = [UIFont systemFontOfSize:13];
    _contentLabel.numberOfLines = 0;
    return _contentLabel;
}

- (UIView *)lineView {
    if (_lineView) return _lineView;
    _lineView = [[UIView alloc] init];
    _lineView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
    return _lineView;
}

- (UITableView *)tableView {
    if (_tableView) return _tableView;
    _tableView = [[UITableView alloc] init];
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.backgroundColor = [UIColor brownColor];
    return _tableView;
}

#pragma mark - set

- (void)setComment:(Comment *)comment {
    _comment = comment;

    [self.iconButton setImage:[UIImage imageNamed:@"default_me"] forState:UIControlStateNormal];
    self.nameLabel.text = _comment.replyName;
    self.contentLabel.text = _comment.content;
    self.dateLabel.text = _comment.dateStr;

    [self.tableView reloadData];

    // 计算tableview的高度
    CGFloat tableViewHeight = 0;
    for (Comment *reply in comment.replys) {
        tableViewHeight = tableViewHeight+[self rowHeightWithReply:reply];
    }
    [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@(tableViewHeight));
    }];
}

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Parerga lichenol. (Breslau) 133 (1865)

#### Original name
Bacidia atrogrisea var. atrogrisea (Hepp) Körb.

### Remarks
null


text:
package demo;

import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * This demonstrates the Spring Batch Java configuration DSL. Spring Batch
 * automatically runs jobs that are in the context for you (the poster example
 * for the {@link org.springframework.boot.CommandLineRunner}. Spring Batch
 * emits events (via the usual Spring
 * {@link org.springframework.context.ApplicationEventPublisher} mechanism) when
 * a Spring Batch {@link org.springframework.batch.core.Job} is finished
 * executing.
 */
@SpringBootApplication
@EnableBatchProcessing
public class BatchApplication {

	public static void main(String[] args) {
		SpringApplication.run(BatchApplication.class, args);
	}

}


text:
package sheetkram.model

import org.scalatest.FunSuite

class WorkbookTest extends FunSuite {

  test( "Create empty Workbook" ) {
    val workbook : Workbook = Workbook()
    assert( workbook.sheets.size === 0 )
  }

  test( "Create Workbook and append three Sheets" ) {
    val workbook : Workbook = Workbook().appendSheet( "Sheet 0" ).appendSheet( "Sheet 1" ).appendSheet( "Sheet 2" )
    assert( workbook.sheets.size === 3 )
  }

  test( "Create Workbook, append one Sheet and set a text value" ) {
    val sheetName = "Sheet Zero"
    val cellValue = "Klonk!"
    val workbook : Workbook = Workbook().appendSheet( sheetName ).updateCell( 0, 3, 3, TextCell( cellValue ) )
    assert( workbook.sheets.size === 1 )
    assert( workbook.get.sheetByName( sheetName ).sheet.exists { _.name === sheetName } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 3, 3 ).exists { _.valueAsText === cellValue } )
  }

  test( "Create Workbook and set a text value" ) {
    val cellValue = "Klonk!"
    val workbook : Workbook = Workbook().updateCell( 0, 3, 3, TextCell( cellValue ) )
    assert( workbook.sheets.size === 1 )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 3, 3 ).exists { _.valueAsText === cellValue } )
  }

  test( "Create Workbook and set a few text values" ) {
    val cellValueA = "A"
    val cellValueB = "B"
    val cellValueC = "C"
    val cellValueD = "D"
    val cellValueE = "E"
    val workbook : Workbook = Workbook()
      .updateCell( 0, 3, 3, TextCell( cellValueA ) )
      .updateCell( 0, 3, 1, TextCell( cellValueB ) )
      .updateCell( 0, 1, 3, TextCell( cellValueC ) )
      .updateCell( 0, 5, 3, TextCell( cellValueD ) )
      .updateCell( 0, 3, 5, TextCell( cellValueE ) )
    assert( workbook.sheets.size === 1 )
    assert( workbook.get.sheetByIndex( 0 ).sheet.exists { _.columns.size === 6 } )
    assert( workbook.get.sheetByIndex( 0 ).sheet.exists { _.rows.size === 6 } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 3, 3 ).exists { _.valueAsText === cellValueA } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 3, 1 ).exists { _.valueAsText === cellValueB } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 1, 3 ).exists { _.valueAsText === cellValueC } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 5, 3 ).exists { _.valueAsText === cellValueD } )
    assert( workbook.get.sheetByIndex( 0 ).cellAt( 3, 5 ).exists { _.valueAsText === cellValueE } )
  }

  test( "Create Workbook, set a few text values and acces them by cell address" ) {
    val cellValueA = "something"
    val cellValueB = "klonk"
    val cellValueC = "kaboom"

    val workbook : Workbook = Workbook()
      .updateCell( 0, 0, 0, TextCell( cellValueA ) )
      .updateCell( 0, 560, 23, TextCell( cellValueB ) )
      .updateCell( 0, 776, 10, TextCell( cellValueC ) )

    assertResult( cellValueA ) {
      workbook.get.sheetByIndex( 0 ).cellAt( "A1" ).map { _.valueAsText }.mkString
    }

    assertResult( cellValueB ) {
      workbook.get.sheetByIndex( 0 ).cellAt( "UO24" ).map { _.valueAsText }.mkString
    }

    assertResult( cellValueC ) {
      workbook.get.sheetByIndex( 0 ).cellAt( "ACW11" ).map { _.valueAsText }.mkString
    }

  }

}


text:
package mts

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// SubmitJobs invokes the mts.SubmitJobs API synchronously
func (client *Client) SubmitJobs(request *SubmitJobsRequest) (response *SubmitJobsResponse, err error) {
	response = CreateSubmitJobsResponse()
	err = client.DoAction(request, response)
	return
}

// SubmitJobsWithChan invokes the mts.SubmitJobs API asynchronously
func (client *Client) SubmitJobsWithChan(request *SubmitJobsRequest) (<-chan *SubmitJobsResponse, <-chan error) {
	responseChan := make(chan *SubmitJobsResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.SubmitJobs(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// SubmitJobsWithCallback invokes the mts.SubmitJobs API asynchronously
func (client *Client) SubmitJobsWithCallback(request *SubmitJobsRequest, callback func(response *SubmitJobsResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *SubmitJobsResponse
		var err error
		defer close(result)
		response, err = client.SubmitJobs(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// SubmitJobsRequest is the request struct for api SubmitJobs
type SubmitJobsRequest struct {
	*requests.RpcRequest
	Outputs              string           `position:"Query" name:"Outputs"`
	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
	OutputLocation       string           `position:"Query" name:"OutputLocation"`
	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
	PipelineId           string           `position:"Query" name:"PipelineId"`
	Input                string           `position:"Query" name:"Input"`
	OutputBucket         string           `position:"Query" name:"OutputBucket"`
}

// SubmitJobsResponse is the response struct for api SubmitJobs
type SubmitJobsResponse struct {
	*responses.BaseResponse
	RequestId     string                    `json:"RequestId" xml:"RequestId"`
	JobResultList JobResultListInSubmitJobs `json:"JobResultList" xml:"JobResultList"`
}

// CreateSubmitJobsRequest creates a request to invoke SubmitJobs API
func CreateSubmitJobsRequest() (request *SubmitJobsRequest) {
	request = &SubmitJobsRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Mts", "2014-06-18", "SubmitJobs", "mts", "openAPI")
	request.Method = requests.POST
	return
}

// CreateSubmitJobsResponse creates a response to parse from SubmitJobs response
func CreateSubmitJobsResponse() (response *SubmitJobsResponse) {
	response = &SubmitJobsResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
import argparse
import code
import logging
import logging.config
import os
import sys
import time

import serial
import pyvisa
import yaml

import capture
import experiment
import exporter
import post_export
import post_process
import util

__author__ = 'Christopher Harrison'
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = 'Christopher Harrison'
__email__ = 'dev@ravngr.com'
__status__ = 'Development'

class ExperimentNode:
    def __init__(self, exp, children=None):
        self.experiment = exp

        if children:
            self.children = children
            self.size = 1 + sum([x.size for x in children])
        else:
            self.children = None
            self.size = 1

def _generate_module_args(global_config, parent, *args, **kwargs):
    class_name = kwargs.pop('class')

    # If module has global configuration options then load those first
    if class_name in global_config:
        instance_config = global_config[class_name]

        # Overwrite global options with parameters for this instance
        instance_config.update(kwargs)
    else:
        instance_config = kwargs

    return util.class_instance_from_dict(class_name, parent, *args, **instance_config)

def _generate_experiment_tree(module_config, global_module_config):
    # Generate new node using global config with overrides
    config = global_module_config.get(module_config['class'], {})
    config.update(module_config)

    c = util.class_from_str(config.pop('class'), experiment.__name__)
    child_nodes = []

    if 'child' in config:
        config_child = config.pop('child')

        for child in config_child:
            child_nodes.append(_generate_experiment_tree(child, global_module_config))

    return ExperimentNode(c(**config), child_nodes)

def main():
    # Get start time
    start_time = time.gmtime()
    start_time_str = time.strftime('%Y%m%d_%H%M%S', start_time)

    # Generate list of available modules
    module_list = 'Experiment Modules:\n\t'
    module_list += '\n\t'.join(util.get_module_subclasses(experiment, experiment.Experiment))

    module_list += '\n\nCapture Modules:\n\t'
    module_list += '\n\t'.join(util.get_module_subclasses(capture, capture.Capture))

    module_list += '\n\nPost-Process Modules:\n\t'
    module_list += '\n\t'.join(util.get_module_subclasses(post_process, post_process.PostProcessor))

    module_list += '\n\nExporter Modules:\n\t'
    module_list += '\n\t'.join(util.get_module_subclasses(exporter, exporter.Exporter))

    module_list += '\n\nPost-Exporter Modules:\n\t'
    module_list += '\n\t'.join(util.get_module_subclasses(post_export, post_export.PostExporter))

    # Parse command line arguments
    parse = argparse.ArgumentParser(description='jtfadump2 Experiment System',
                                    formatter_class=argparse.RawDescriptionHelpFormatter, epilog=module_list)

    parse.add_argument('name', help='Prefix for results folder')
    parse.add_argument('config', help='YAML configuration file(s)', nargs='+')

    parse.add_argument('-v', '--verbose', help='Verbose output', dest='display_verbose', action='store_true')
    parse.set_defaults(display_verbose=False)
    parse.add_argument('--visa', help='Display VISA traffic in console', dest='display_visa', action='store_true')
    parse.set_defaults(display_visa=False)
    parse.add_argument('-q', '--quiet', help='Suppress info logging output', dest='display_quiet', action='store_true')
    parse.set_defaults(display_visa=False)
    parse.add_argument('-i', '--interactive', help='Drop to interactive python shell on error', dest='interactive',
                       action='store_true')
    parse.set_defaults(interactive=False)

    args = parse.parse_args()

    # Get experiment prefix
    experiment_name = args.name.strip().replace(' ', '_')

    # Load configuration YAML file(s)
    config = {}

    for f in args.config:
        with open(f, 'r') as h:
            config.update(yaml.load(h))

    # Setup directories
    result_path = os.path.realpath(config['result']['path'])

    if not os.path.exists(result_path) or not os.path.isdir(result_path):
        print("Result directory {} either doesn't exist or is not a writable directory".format(result_path),
              file=sys.stderr)
        return

    result_path = os.path.join(result_path, "{}-{}".format(experiment_name, start_time_str))

    # Create result directory
    os.makedirs(result_path, exist_ok=False)

    log_path = os.path.realpath(config['logging'].get('path', result_path))

    # Setup logging
    logging_config_dict = config.pop('logging')['config']

    # Generate log filename
    log_filename = os.path.join(log_path, "log-{}-{}.log".format(experiment_name, start_time_str))

    # If a filename is None then set the generated name as the target
    if logging_config_dict['handlers']:
        for (key, value) in logging_config_dict['handlers'].items():
            if 'filename' in value and not value['filename']:
                logging_config_dict['handlers'][key]['filename'] = log_filename

    # Apply logging configuration
    logging.config.dictConfig(logging_config_dict)

    root_logger = logging.getLogger(__name__)

    try:
        git_hash = util.get_git_hash()
    except OSError:
        git_hash = 'not found'

    root_logger.info("jtfadump2 {} | git hash: {}".format(__version__, git_hash))
    root_logger.info("python {}".format(sys.version))

    for m in [('pyserial', serial.VERSION), (pyvisa.__name__, pyvisa.__version__), ('pyyaml', yaml.__version__)]:
        root_logger.info("{} {}".format(m[0], m[1]))

    root_logger.info("Started: {}".format(time.strftime('%a, %d %b %Y %H:%M:%S +0000', start_time)))
    root_logger.info("Launch command: {}".format(' '.join(sys.argv)))
    root_logger.info("Result directory: {}".format(result_path))

    # Dump configuration to log
    root_logger.debug('--- BEGIN CONFIGURATION ---')

    for line in yaml.dump(config).split('\n'):
        root_logger.debug(line)

    root_logger.debug('--- END CONFIGURATION ---')

    # Setup modules
    if 'experiment' not in config or not config['experiment']:
        root_logger.error('Configuration must specify at least one experiment module!', file=sys.stderr)
        return

    if 'experiment' not in config or not config['capture']:
        root_logger.error('Configuration must specify at least one capture module!', file=sys.stderr)
        return

    if 'export' not in config or not config['export']:
        root_logger.error('Configuration must specify at least one export module!', file=sys.stderr)
        return

    # Get global module configuration
    global_module_config = config.pop('modules')

    # Create modules
    experiment_nodes = []
    capture_modules = []
    post_process_modules = []
    export_modules = []
    post_export_modules = []

    # Setup experiment stack
    experiment_module_count = 0

    for node_config in config.pop('experiment'):
        node = _generate_experiment_tree(node_config, global_module_config)

        experiment_module_count += node.size

        experiment_nodes.append(node)

    # Generate other modules
    for module_config in config.pop('capture'):
        capture_modules.append(_generate_module_args(global_module_config, capture.__name__, **module_config))

    if 'post_process' in config and config['post_process']:
        for module_config in config.pop('post_process'):
            post_process_modules.append(_generate_module_args(global_module_config, post_process.__name__,
                                                              **module_config))

    for module_config in config.pop('export'):
        export_modules.append(_generate_module_args(global_module_config, exporter.__name__,
                                                    result_directory=result_path, **module_config))

    if 'post_export' in config and config['post_export']:
        for module_config in config.pop('post_export'):
            post_export_modules.append(_generate_module_args(global_module_config, post_export.__name__,
                                                             result_directory=result_path, **module_config))

    capture_module_count = len(capture_modules)
    post_process_module_count = len(post_process_modules)
    export_module_count = len(export_modules)
    post_export_module_count = len(post_export_modules)

    # Note loaded modules
    root_logger.info("Loaded {} experiment module{}".format(experiment_module_count,
                                                            's' if experiment_module_count is not 1 else ''))
    root_logger.info("Loaded {} capture module{}".format(capture_module_count,
                                                         's' if capture_module_count is not 1 else ''))
    root_logger.info("Loaded {} post-process module{}".format(post_process_module_count,
                                                              's' if post_process_module_count is not 1 else ''))
    root_logger.info("Loaded {} export module{}".format(export_module_count,
                                                        's' if export_module_count is not 1 else ''))
    root_logger.info("Loaded {} post-export module{}".format(post_export_module_count,
                                                             's' if post_export_module_count is not 1 else ''))

    # Track running experiments in order to stop them properly
    running_experiments = []

    # Catch all exceptions for logging
    try:
        # Step experiment stack
        active_experiments = []

        while experiment_nodes:
            current_node = experiment_nodes[0]
            current_experiment = current_node.experiment

            if current_experiment.has_next():
                # Add experiment to active list
                if current_experiment not in active_experiments:
                    active_experiments.append(current_experiment)

                if current_experiment not in running_experiments:
                    running_experiments.append(current_experiment)

                # Step the active experiment
                current_experiment.step()

                if current_node.children:
                    # Append children to node stack
                    experiment_nodes[:0] = current_node.children
                else:
                    # Save data from this experiment
                    # Generate a unique identifier for the capture
                    capture_id = util.rand_hex_str(64)
                    capture_id_short = capture_id[-8::]

                    # Timestamp data and attach unique id
                    data = {
                        'cap_id': capture_id,
                        'cap_time': time.strftime('%a, %d %b %Y %H:%M:%S +0000'),
                        'cap_timestamp': time.time()
                    }

                    # Get current state of experiment
                    for e in active_experiments:
                        data.update(e.get_state())

                    # Capture data from all sources
                    for c in capture_modules:
                        data.update(c.get_data(active_experiments))

                    # Apply optional post-processors to data
                    if post_process_modules:
                        for p in post_process_modules:
                            d = p.process(data)

                            # Don't let badly written post-processors wipe out data
                            if d is not None:
                                data = d
                            else:
                                root_logger.warn("PostProcessor {} returning no data".format(p.__name__))

                    # Export data
                    exported_files = []

                    for e in export_modules:
                        f = e.export(capture_id_short, data)

                        if f is not None:
                            exported_files.extend(f)

                    # Post-export
                    for pe in post_export_modules:
                        pe.process(exported_files)
            else:
                # Remove experiment both from the stack and from the active list
                experiment_nodes.pop(0)
                active_experiments.remove(current_experiment)

                # Reset experiment state in case it is re-used
                current_experiment.reset()

        root_logger.info('Experiment finished normally')
    except:
        root_logger.exception('Caught exception', exc_info=True)

        if args.interactive:
            # Drop to interactive shell on error
            root_logger.warn('Dropping to interactive shell')
            code.interact(local=locals())

        raise
    finally:
        # Stop all running experiments
        for e in running_experiments:
            e.stop()

    root_logger.info('Exiting')

if __name__ == "__main__":
    main()


text:
<?php

namespace Magento\ProductAlert\Model;

/**
 * @magentoAppIsolation enabled
 */
class EmailTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\ProductAlert\Model\Email
     */
    protected $_emailModel;

    /**
     * @var \Magento\TestFramework\ObjectManager
     */
    protected $_objectManager;

    /**
     * @var \Magento\Customer\Api\AccountManagementInterface
     */
    protected $customerAccountManagement;

    /**
     * @var \Magento\Customer\Helper\View
     */
    protected $_customerViewHelper;

    protected function setUp()
    {
        $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
        $this->customerAccountManagement = $this->_objectManager->create(
            'Magento\Customer\Api\AccountManagementInterface'
        );
        $this->_customerViewHelper = $this->_objectManager->create('Magento\Customer\Helper\View');
    }

    /**
     * @magentoDataFixture Magento/Customer/_files/customer.php
     * @magentoDataFixture Magento/Catalog/_files/product_simple.php
     * @dataProvider customerFunctionDataProvider
     *
     * @param bool isCustomerIdUsed
     */
    public function testSend($isCustomerIdUsed)
    {
        \Magento\TestFramework\Helper\Bootstrap::getInstance()
            ->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND);

        $this->_emailModel = $this->_objectManager->create('Magento\ProductAlert\Model\Email');

        /** @var \Magento\Store\Model\Website $website */
        $website = $this->_objectManager->create('Magento\Store\Model\Website');
        $website->load(1);
        $this->_emailModel->setWebsite($website);

        /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */
        $customerRepository = $this->_objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface');
        $customer = $customerRepository->getById(1);

        if ($isCustomerIdUsed) {
            $this->_emailModel->setCustomerId(1);
        } else {
            $this->_emailModel->setCustomerData($customer);
        }

        /** @var \Magento\Catalog\Model\Product $product */
        $product = $this->_objectManager->create('Magento\Catalog\Model\Product');
        $product->load(1);

        $this->_emailModel->addPriceProduct($product);

        $this->_emailModel->send();

        /** @var \Magento\TestFramework\Mail\Template\TransportBuilderMock $transportBuilder */
        $transportBuilder = $this->_objectManager->get('Magento\TestFramework\Mail\Template\TransportBuilderMock');
        $this->assertContains(
            'John Smith,',
            $transportBuilder->getSentMessage()->getBodyHtml()->getRawContent()
        );
    }

    public function customerFunctionDataProvider()
    {
        return [
            [true],
            [false],
        ];
    }
}


text:
import log from '../../log'
import React, {
  Component, PropTypes
}
from 'react'

export default class Chat extends Component {
  constructor(props) {
    super(props)
  }

  render() {
    return (

Chat

        {name}

    )
  }
}
Chat.propTypes = {
  name: PropTypes.string
}

Chat.displayName = 'Chat Page'


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.10
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.badlogic.gdx.physics.bullet;

import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;

public class btSoftBodySolver {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected btSoftBodySolver(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(btSoftBodySolver obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        gdxBulletJNI.delete_btSoftBodySolver(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public int getSolverType() {
    return gdxBulletJNI.btSoftBodySolver_getSolverType(swigCPtr, this);
  }

  public boolean checkInitialized() {
    return gdxBulletJNI.btSoftBodySolver_checkInitialized(swigCPtr, this);
  }

  public void optimize(SWIGTYPE_p_btAlignedObjectArrayT_btSoftBody_p_t softBodies, boolean forceUpdate) {
    gdxBulletJNI.btSoftBodySolver_optimize__SWIG_0(swigCPtr, this, SWIGTYPE_p_btAlignedObjectArrayT_btSoftBody_p_t.getCPtr(softBodies), forceUpdate);
  }

  public void optimize(SWIGTYPE_p_btAlignedObjectArrayT_btSoftBody_p_t softBodies) {
    gdxBulletJNI.btSoftBodySolver_optimize__SWIG_1(swigCPtr, this, SWIGTYPE_p_btAlignedObjectArrayT_btSoftBody_p_t.getCPtr(softBodies));
  }

  public void copyBackToSoftBodies(boolean bMove) {
    gdxBulletJNI.btSoftBodySolver_copyBackToSoftBodies__SWIG_0(swigCPtr, this, bMove);
  }

  public void copyBackToSoftBodies() {
    gdxBulletJNI.btSoftBodySolver_copyBackToSoftBodies__SWIG_1(swigCPtr, this);
  }

  public void predictMotion(float solverdt) {
    gdxBulletJNI.btSoftBodySolver_predictMotion(swigCPtr, this, solverdt);
  }

  public void solveConstraints(float solverdt) {
    gdxBulletJNI.btSoftBodySolver_solveConstraints(swigCPtr, this, solverdt);
  }

  public void updateSoftBodies() {
    gdxBulletJNI.btSoftBodySolver_updateSoftBodies(swigCPtr, this);
  }

  public void processCollision(btSoftBody arg0, btCollisionObjectWrapper arg1) {
    gdxBulletJNI.btSoftBodySolver_processCollision__SWIG_0(swigCPtr, this, btSoftBody.getCPtr(arg0), arg0, btCollisionObjectWrapper.getCPtr(arg1), arg1);
  }

  public void processCollision(btSoftBody arg0, btSoftBody arg1) {
    gdxBulletJNI.btSoftBodySolver_processCollision__SWIG_1(swigCPtr, this, btSoftBody.getCPtr(arg0), arg0, btSoftBody.getCPtr(arg1), arg1);
  }

  public void setNumberOfPositionIterations(int iterations) {
    gdxBulletJNI.btSoftBodySolver_setNumberOfPositionIterations(swigCPtr, this, iterations);
  }

  public int getNumberOfPositionIterations() {
    return gdxBulletJNI.btSoftBodySolver_getNumberOfPositionIterations(swigCPtr, this);
  }

  public void setNumberOfVelocityIterations(int iterations) {
    gdxBulletJNI.btSoftBodySolver_setNumberOfVelocityIterations(swigCPtr, this, iterations);
  }

  public int getNumberOfVelocityIterations() {
    return gdxBulletJNI.btSoftBodySolver_getNumberOfVelocityIterations(swigCPtr, this);
  }

  public float getTimeScale() {
    return gdxBulletJNI.btSoftBodySolver_getTimeScale(swigCPtr, this);
  }

  public final static class SolverTypes {
    public final static int DEFAULT_SOLVER = 0;
    public final static int CPU_SOLVER = DEFAULT_SOLVER + 1;
    public final static int CL_SOLVER = CPU_SOLVER + 1;
    public final static int CL_SIMD_SOLVER = CL_SOLVER + 1;
    public final static int DX_SOLVER = CL_SIMD_SOLVER + 1;
    public final static int DX_SIMD_SOLVER = DX_SOLVER + 1;
  }

}


text:
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Diagnostics
Imports System.IO
Imports System.Xml
Imports AnimatGUICtrls.Controls
Imports AnimatGUI.DataObjects
Imports AnimatGUI.Framework

Namespace Collections

    Public MustInherit Class AnimatCollectionBase
        Inherits CollectionBase

        Protected m_doParent As Framework.DataObject
        Protected m_bIsDirty As Boolean = False

        <Browsable(False)> _
        Public Property Parent() As Framework.DataObject
            Get
                Return m_doParent
            End Get
            Set(ByVal Value As Framework.DataObject)
                m_doParent = Value
            End Set
        End Property

        <Browsable(False)> _
        Public Property IsDirty() As Boolean
            Get
                Return m_bIsDirty
            End Get
            Set(ByVal Value As Boolean)
                If Not Util.DisableDirtyFlags Then
                    m_bIsDirty = Value

                    If m_bIsDirty AndAlso Not m_doParent Is Nothing Then
                        m_doParent.IsDirty = True
                    End If
                End If
            End Set
        End Property

        Public Sub New(ByVal doParent As Framework.DataObject)
            m_doParent = doParent
        End Sub

        Public Sub ClearIsDirty()
            Me.IsDirty = False

            Dim doObject As Framework.DataObject
            For Each deObject As Object In Me
                If TypeOf deObject Is Framework.DataObject Then
                    doObject = DirectCast(deObject, Framework.DataObject)
                    doObject.ClearIsDirty()
                End If
            Next

        End Sub

        Protected Overridable Sub CopyInternal(ByVal aryOrig As AnimatCollectionBase)

            Me.Clear()

            Dim doItem As AnimatGUI.Framework.DataObject
            For Each doItem In aryOrig
                If TypeOf doItem Is AnimatGUI.Framework.DataObject Then
                    List.Add(doItem)
                End If
            Next

        End Sub

        Protected Overridable Sub CloneInternal(ByVal aryOrig As AnimatCollectionBase, ByVal doParent As AnimatGUI.Framework.DataObject, ByVal bCutData As Boolean, _
                                           ByVal doRoot As AnimatGUI.Framework.DataObject)

            Me.Clear()

            Dim doOrig As AnimatGUI.Framework.DataObject
            Dim doItem As AnimatGUI.Framework.DataObject
            For Each doOrig In aryOrig
                If TypeOf doOrig Is AnimatGUI.Framework.DataObject Then
                    doItem = doOrig.Clone(doParent, bCutData, doRoot)
                    List.Add(doItem)
                End If
            Next

        End Sub

        Public Overridable Function Copy() As AnimatCollectionBase
        End Function

        Public Overridable Function Clone(ByVal doParent As AnimatGUI.Framework.DataObject, ByVal bCutData As Boolean, _
                                           ByVal doRoot As AnimatGUI.Framework.DataObject) As AnimatCollectionBase
        End Function

        Public Overridable Function FindObjectByID(ByVal strID As String) As Framework.DataObject

            Dim doFound As Framework.DataObject
            For Each doObject As Framework.DataObject In Me
                doFound = doObject.FindObjectByID(strID)
                If Not doFound Is Nothing Then
                    Return doFound
                End If
            Next

            Return Nothing
        End Function

    End Class

End Namespace


text:
pimcore.registerNS("pimcore.object.fieldcollections.field");
pimcore.object.fieldcollections.field = Class.create(pimcore.object.classes.klass, {

    allowedInType: 'fieldcollection',
    disallowedDataTypes: ["nonownerobjects","user","fieldcollections","localizedfields", "objectbricks", "objectsMetadata"],
    uploadUrl: '/admin/class/import-fieldcollection/',
    exportUrl: "/admin/class/export-fieldcollection",

    getId: function(){
        return  this.data.key;
    },

    getRootPanel: function () {

        this.rootPanel = new Ext.form.FormPanel({
            title: t("basic_configuration"),
            bodyStyle: "padding: 10px;",
            layout: "pimcoreform",
            items: [{
                xtype: "textfield",
                width: 250,
                name: "parentClass",
                fieldLabel: t("parent_class"),
                value: this.data.parentClass
            }]
        });

        return this.rootPanel;
    },

    save: function () {

        this.saveCurrentNode();

        var m = Ext.encode(this.getData());
        var n = Ext.encode(this.data);

        if (this.getDataSuccess) {
            Ext.Ajax.request({
                url: "/admin/class/fieldcollection-update",
                method: "post",
                params: {
                    configuration: m,
                    values: n,
                    key: this.data.key
                },
                success: this.saveOnComplete.bind(this)
            });
        }
    },

    saveOnComplete: function () {
        this.parentPanel.tree.getRootNode().reload();
        pimcore.helpers.showNotification(t("success"), t("fieldcollection_saved_successfully"), "success");
    },

    upload: function() {

        this.uploadWindow = new Ext.Window({
            layout: 'fit',
            title: t('import_fieldcollection_definition'),
            closeAction: 'close',
            width:400,
            height:400,
            modal: true
        });

        var uploadPanel = new Ext.ux.SwfUploadPanel({
            border: false,
            upload_url: this.getUploadUrl(),
            debug: false,
            post_params: {
                id:this.getId()
            },
            flash_url: "/pimcore/static/js/lib/ext-plugins/SwfUploadPanel/swfupload.swf",
            single_select: false,
            file_queue_limit: 1,
            file_types: "*.xml",
            single_file_select: true,
            confirm_delete: false,
            remove_completed: true,
            listeners: {
                "fileUploadComplete": function (win) {

                    Ext.Ajax.request({
                        url: "/admin/class/fieldcollection-get",
                        params: {
                            id: this.getId()
                        },
                        success: function(win, response) {
                            this.data = Ext.decode(response.responseText);
                            this.parentPanel.getEditPanel().removeAll();
                            this.addLayout();
                            this.initLayoutFields();
                            pimcore.layout.refresh();
                            win.hide();
                        }.bind(this, win)
                    });

                }.bind(this, this.uploadWindow)
            }
        });

        this.uploadWindow.add(uploadPanel);

        this.uploadWindow.show();
        this.uploadWindow.setWidth(401);
        this.uploadWindow.doLayout();

    }

});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Publicações. Instituto de Micologia da Universidade de Pernambuco 641: 7 (1969)

#### Original name
Meliola pithecellobii var. uncinata J.L. Bezerra & Gadêlha

### Remarks
null


text:
/* 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.
 */
package org.activiti.examples.bpmn.tasklistener;

import org.flowable.common.engine.api.delegate.Expression;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;

/**
 * @author Joram Barrez
 */
public class TaskCompleteListener implements TaskListener {

    private static final long serialVersionUID = 1L;
    private Expression greeter;
    private Expression shortName;

    public void notify(DelegateTask delegateTask) {
        delegateTask.setVariable("greeting", "Hello from " + greeter.getValue(delegateTask));
        delegateTask.setVariable("shortName", shortName.getValue(delegateTask));

        delegateTask.setVariableLocal("myTaskVariable", "test");
    }

}


text:
@section('content')

So far so good! Let's talk details

                Thank you for using Muse to manage your Composer Satis repository.

                Before we get started we need to initialize the repository.

        {!! Form::open(['route' => 'initialize.store', 'class' => 'form-horizontal']) !!}
            @include('initialize.partials.form')

                <button type="submit"
                    name="submit"
                    class="btn btn-primary pull-left">
                    Proceed
                </button>

        {!! Form::close() !!}

@endsection


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Goodwill</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for 'head'}}

    <link rel="stylesheet" href="assets/vendor.css">
    <link rel="stylesheet" href="assets/goodwill.css">
    <link rel="icon" href="assets/favicon.ico">

    {{content-for 'head-footer'}}
  </head>
  <body>
    {{content-for 'body'}}

    <script src="assets/vendor.js"></script>
    <script src="assets/goodwill.js"></script>

    {{content-for 'body-footer'}}
  </body>
</html>


text:
<?php namespace App\Http\Controllers;

use Request;
use App\Http\Requests;
use App\FacultyMember;
use App\Expertise;

class APIController extends Controller {

	/*
	 * List of all the faculty.
	 * @return array
	 */
    public function ListOfFaculty()
    {
        $list = FacultyMember::all();
        return ['status'=>200, 'result'=> compact("list")];
    }

    /*
     * List of unique skills.
     * @return array
     */
    public function ListOfSkills()
    {
        # Todo: Make sure if a username is passed in, we return only that specific faculty's skills
        $params = Request::all();
        $list = FacultySkills::getAllUnique();
        return ['status'=>200, 'result'=> compact("list")];
    }

    /*
     * List of unique technologies.
     * @return array
     */
    public function ListOfTechnologies()
    {
        # Todo: Make sure if a username is passed in, we return only that specific faculty's technologies
        $params = Request::all();
        $list = FacultyTechnology::getAllUnique();
        return ['status'=>200, 'result'=> compact("list")];
    }

    /**
     * All faculty with a given skill.
     * @return array
     */
    public function FacultyWithSkill()
    {
        $params = Request::all();
        $list = [];
        return ['status'=>200, 'result'=> compact("list")];
    }

    /**
     * All faculty with a given technology.
     * @return array
     */
    public function FacultyWithTechnology()
    {
        $list = [];
        return ['status'=>200, 'result'=> compact("list")];
    }

    public function search()
    {
        # Generic search for Faculty, Skills, or Tech
    }

    public function similar()
    {
        # Search for Faculty with similar Skills or Tech
    }
}


text:
namespace g{namespace Android{namespace android{namespace graphics{struct PorterDuffDLRMode;}}}}

namespace g{
namespace Android{
namespace android{
namespace graphics{

// public sealed extern class PorterDuffDLRMode :1486
// {
::g::Android::java::lang::Object_type* PorterDuffDLRMode_typeof();
void PorterDuffDLRMode___Init3_fn();
void PorterDuffDLRMode__get_SRC_IN_fn(PorterDuffDLRMode** __retval);

struct PorterDuffDLRMode : ::g::Android::java::lang::Object
{
    static jclass _javaClass3_;
    static jclass& _javaClass3() { return _javaClass3_; }
    static jfieldID SRC_IN_7141_ID_;
    static jfieldID& SRC_IN_7141_ID() { return SRC_IN_7141_ID_; }

    static void _Init3();
    static PorterDuffDLRMode* SRC_IN();
};
// }

}}}} // ::g::Android::android::graphics


text:
BEGIN;

-- This migration is destructive to any existing data.

CREATE TABLE SignatureInfo (
  id SERIAL PRIMARY KEY,
  signing_key VARCHAR(500) NOT NULL,
  app_package_name VARCHAR(1000) NOT NULL DEFAULT '',
  bundle_id VARCHAR(1000) NOT NULL DEFAULT '',
  signing_key_version VARCHAR(100) NOT NULL DEFAULT '',
  signing_key_id VARCHAR(50) NOT NULL DEFAULT '',
	thru_timestamp TIMESTAMPTZ
);

ALTER TABLE SignatureInfo SET (autovacuum_enabled = true);

ALTER TABLE ExportConfig
  ADD COLUMN signature_info_ids INT [],
  DROP COLUMN signing_key;

ALTER TABLE ExportBatch
  ADD COLUMN signature_info_ids INT [],
  DROP COLUMN signing_key;

END;


text:
layout: post
title: Die letzten 24 h
tags:
- 100kmbiel
image:
    feature_ext: https://lh4.googleusercontent.com/-F0QuWLZkbbk/UbDQGW04wXI/AAAAAAAAKGk/O6uTLkkh2nM/w1200-h400-no/biel-roadmap.png
---
Schuhe sind gepackt. Kleider sind mental schon bereit. Die Wetterprognose könnte besser nicht sein (13-15°C), ich habe die letzten beiden Nächte 9 h geschlafen. Es scheint alles parat zu sein. Doch kann man für so ein Event überhaupt parat sein?

Wahrscheinlich könnte man, wenn man jede Woche 100 km gelaufen ist. Kann man das jedoch auch sagen, wenn man pro Woche 30-60 km gelaufen ist? Meine längste Strecke war 48 km (mit zwei zugedrückten Augen ist das 50% und die erfahrenen Bieler sagen, dass die Hälfte erst bei 70km erreich ist).

Falls jemand Nachts Probleme mit Schlafen hat, darf er sich gerne an den Streckenrand stellen und mir ein bisschen applaudieren. Auf der Karte darunter sollte es eine Marschroute drauf haben... ob ich mich daran halten kann oder sogar noch schneller bin??? ... morgen werde ich es wissen.

[![Roadmap](https://lh4.googleusercontent.com/-CqsyB-p91RE/UbDSfvp1YiI/AAAAAAAAKHA/wIcvFGxPIEs/w1089-h801-no/biel-roadmap.png)](https://lh4.googleusercontent.com/-CqsyB-p91RE/UbDSfvp1YiI/AAAAAAAAKHA/wIcvFGxPIEs/w1089-h801-no/biel-roadmap.png)

Ich werde zudem versuchen regelmässig meine Position via Twitter durchzugeben. Für ein Livetracking reicht der Akku leider nicht. Ich werde zudem schöne farbige Leuchtwürmchen tragen... man wird mich hoffentlich sehen ;)

Doch dann habe ich folgenden Spruch entdeckt (via [tumblr](http://gettonedandfit.tumblr.com/post/34779645074/photo-taken-by-xcnut))

Der Aufsteller des Tages!

> Your lungs are burning.
> Your legs are shredded.
> And this is just the beginning.
> We are a different breed.

> Don't be afraid.
> Let you animal instincts
> kick in as you devour the pack.
>  This is miles of agony vs ecstasy.
> Injuries be damned.

> The thrill of the hunt drives
> you to slay your opponent.
> Pain is temporary,
> victory is eternal.

Mal schauen, ob ich noch Twittern kann... wer mir folgen möchte: #100kmbiel. Schauen, obs auf der Zielgerade noch für einen Tweet reicht ;)

Tweets about "#100kmbiel"

Sodala, dann ist alles gesagt... der Tag, bzw. die Nacht möge kommen und mir gnädig sein.


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('job_board', '0006_siteconfig_remote'),
    ]

    operations = [
        migrations.AlterField(
            model_name='company',
            name='twitter',
            field=models.CharField(blank=True, help_text='Please leave empty if none', max_length=20, null=True),
        ),
        migrations.AlterField(
            model_name='siteconfig',
            name='remote',
            field=models.BooleanField(default=False, help_text='Select if this job board is for remote jobs only'),
        ),
    ]


text:
package io.manticore.android.util;

public class IOUtils {
    private static final int NUMBER_OF_CORES = Runtime.getRuntime().availableProcessors();

    public static int getCores() {
        return NUMBER_OF_CORES;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Buffers;
using System.Buffers.Text;
using System.Text;

namespace Azure.Core
{
    // APIs not avaliable in NetStandard 2.0
    internal static class NS2Bridge
    {
        public delegate void SpanAction<T, TArg>(Span<T> buffer, TArg state);
        public static string CreateString<TState>(int length, TState state, SpanAction<char, TState> action)
        {
            var result = new string((char)0, length);
            unsafe
            {
                fixed (char* chars = result)
                {
                    var charBuffer = new Span<char>(chars, result.Length);
                    action(charBuffer, state);
                }
            }
            return result;
        }

        public static void Latin1ToUtf16(ReadOnlySpan<byte> latin1, Span<char> utf16)
        {
            if (utf16.Length < latin1.Length)
                throw new ArgumentOutOfRangeException(nameof(utf16));
            for (int i = 0; i < latin1.Length; i++)
            {
                utf16[i] = (char)latin1[i];
            }
        }

        public static OperationStatus Base64UrlEncodeInPlace(Span<byte> buffer, long dataLength, out int bytesWritten)
        {
            OperationStatus status = Base64.EncodeToUtf8InPlace(buffer, (int)dataLength, out bytesWritten);
            if (status != OperationStatus.Done)
            {
                return status;
            }

            bytesWritten = Base64ToBase64Url(buffer.Slice(0, bytesWritten));
            return OperationStatus.Done;
        }
        public static OperationStatus Base64UrlEncode(ReadOnlySpan<byte> buffer, Span<byte> destination, out int bytesConsumend, out int bytesWritten)
        {
            OperationStatus status = Base64.EncodeToUtf8(buffer, destination, out bytesConsumend, out bytesWritten, isFinalBlock: true);
            if (status != OperationStatus.Done)
            {
                return status;
            }

            bytesWritten = Base64ToBase64Url(destination.Slice(0,bytesWritten));
            return OperationStatus.Done;
        }

        private static int Base64ToBase64Url(Span<byte> buffer)
        {
            var bytesWritten = buffer.Length;
            if (buffer[bytesWritten - 1] == (byte)'=')
            {
                bytesWritten--;
                if (buffer[bytesWritten - 1] == (byte)'=')
                    bytesWritten--;
            }
            for (int i = 0; i < bytesWritten; i++)
            {
                byte current = buffer[i];
                if (current == (byte)'+')
                    buffer[i] = (byte)'-';
                else if (current == (byte)'/')
                    buffer[i] = (byte)'_';
            }
            return bytesWritten;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Orchard.Localization;
using Orchard.Workflows.Models;
using Orchard.Workflows.Services;

namespace Orchard.Workflows.Activities {
    public class BranchActivity : Task {

        public BranchActivity() {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        public override bool CanExecute(WorkflowContext workflowContext, ActivityContext activityContext) {
            return true;
        }

        public override IEnumerable<LocalizedString> GetPossibleOutcomes(WorkflowContext workflowContext, ActivityContext activityContext) {
            return GetBranches(activityContext).Select(x => T(x));
        }

        public override IEnumerable<LocalizedString> Execute(WorkflowContext workflowContext, ActivityContext activityContext) {
            return GetBranches(activityContext).Select(x => T(x));
        }

        public override string Name {
            get { return "Branch"; }
        }

        public override LocalizedString Category {
            get { return T("Flow"); }
        }

        public override LocalizedString Description {
            get { return T("Splits the workflow on different branches."); }
        }

        public override string Form {
            get {
                return "ActivityBranch";
            }
        }

        private IEnumerable<string> GetBranches(ActivityContext context) {
            var branches = context.GetState<string>("Branches");

            if (String.IsNullOrEmpty(branches)) {
                return Enumerable.Empty<string>();
            }

            return branches.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList();
        }
    }
}


text:
package com.amazonaws.services.appstream.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum FleetState {

    STARTING("STARTING"),
    RUNNING("RUNNING"),
    STOPPING("STOPPING"),
    STOPPED("STOPPED");

    private String value;

    private FleetState(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return FleetState corresponding to the value
     */
    public static FleetState fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (FleetState enumEntry : FleetState.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
package org.geomajas.hammergwt.client.handler;

import org.geomajas.hammergwt.client.event.NativeHammerEvent;

/**
 * @author Dosi Bingov
 */
public interface HammerDragEndHandler {
	void onDragEnd(NativeHammerEvent event);
}


text:
"use strict";

module.exports = {
	help(botName) {
		return new Promise((r,R) => r(`\`\`\`
Usage: @${botName} [command] [args]
       .[command] [args]

Commands:
	die               kill the bot
	define [args]     get the definition of [args] using datamuse.com/api
	blockify [args]   emojify letters and numbers
	calc [args]       calculate [args] as a mathematical expression (WIP)
	pause             prevent the bot from sending any messages for 10
	                  seconds
	say [args]        make the bot say [args] as a text message
	restart           restart the bot
	[default]         display this help screen
\`\`\``));
	}
}


text:
package org.redisson.command;

import org.redisson.api.BatchOptions;
import org.redisson.client.codec.Codec;
import org.redisson.client.protocol.RedisCommand;
import org.redisson.command.CommandBatchService.Entry;
import org.redisson.connection.ConnectionManager;
import org.redisson.connection.MasterSlaveEntry;
import org.redisson.connection.NodeSource;
import org.redisson.liveobject.core.RedissonObjectBuilder;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

/**
 *
 * @author Nikita Koksharov
 *
 * @param <V> type of value
 * @param <R> type of returned value
 */
public class RedisBatchExecutor<V, R> extends BaseRedisBatchExecutor<V, R> {

    @SuppressWarnings("ParameterNumber")
    public RedisBatchExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command,
                              Object[] params, CompletableFuture<R> mainPromise, boolean ignoreRedirect, ConnectionManager connectionManager,
                              RedissonObjectBuilder objectBuilder, ConcurrentMap<MasterSlaveEntry, Entry> commands,
                              BatchOptions options, AtomicInteger index,
                              AtomicBoolean executed, RedissonObjectBuilder.ReferenceType referenceType, boolean noRetry) {
        super(readOnlyMode, source, codec, command, params, mainPromise, ignoreRedirect, connectionManager, objectBuilder,
                commands, options, index, executed, referenceType, noRetry);
    }

    @Override
    public void execute() {
        addBatchCommandData(params);
    }

}


text:
require 'openwfe/extras/participants/ar_participants'

module OpenWFE::Extras
  class ArWorkitem
    #TODO: give it a better name
    def self.convert_to_in_flow_work_item(ar_work_item_id)
      # history_log('proceeded', :fei => owi.fei)
      wi = OpenWFE::Extras::ArWorkitem.destroy(ar_work_item_id)
      wi.to_owfe_workitem
    end
  end
end


text:
import {
  Component,
  Input,
  Output,
  EventEmitter,
  ChangeDetectionStrategy,
  Renderer2,
  ElementRef,
  OnChanges,
  OnInit,
  SimpleChanges,
  ViewEncapsulation
} from '@angular/core';

import {Observable} from 'rxjs';

import {NgbAlertConfig} from './alert-config';
import {ngbRunTransition} from '../util/transition/ngbTransition';
import {ngbAlertFadingTransition} from './alert-transition';

/**
 * Alert is a component to provide contextual feedback messages for user.
 *
 * It supports several alert types and can be dismissed.
 */
@Component({
  selector: 'ngb-alert',
  exportAs: 'ngbAlert',
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  host:
      {'role': 'alert', 'class': 'alert show', '[class.fade]': 'animation', '[class.alert-dismissible]': 'dismissible'},
  template: `
    <ng-content></ng-content>
    <button *ngIf="dismissible" type="button" class="close" aria-label="Close" i18n-aria-label="@@ngb.alert.close"
      (click)="close()">
      ×
    </button>
    `,
  styleUrls: ['./alert.scss']
})
export class NgbAlert implements OnInit,
    OnChanges {
  /**
   * If `true`, alert closing will be animated.
   *
   * Animation is triggered only when clicked on the close button (×)
   * or via the `.close()` function
   *
   * @since 8.0.0
   */
  @Input() animation: boolean;

  /**
   * If `true`, alert can be dismissed by the user.
   *
   * The close button (×) will be displayed and you can be notified
   * of the event with the `(close)` output.
   */
  @Input() dismissible: boolean;

  /**
   * Type of the alert.
   *
   * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,
   * `'secondary'`, `'light'` and `'dark'`.
   */
  @Input() type: string;

  /**
   * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.
   *
   * @since 8.0.0
   */
  @Output() closed = new EventEmitter<void>();

  constructor(config: NgbAlertConfig, private _renderer: Renderer2, private _element: ElementRef) {
    this.dismissible = config.dismissible;
    this.type = config.type;
    this.animation = config.animation;
  }

  /**
   * Triggers alert closing programmatically (same as clicking on the close button (×)).
   *
   * The returned observable will emit and be completed once the closing transition has finished.
   * If the animations are turned off this happens synchronously.
   *
   * Alternatively you could listen or subscribe to the `(closed)` output
   *
   * @since 8.0.0
   */
  close(): Observable<void> {
    const transition = ngbRunTransition(
        this._element.nativeElement, ngbAlertFadingTransition,
        {animation: this.animation, runningTransition: 'continue'});
    transition.subscribe(() => this.closed.emit());
    return transition;
  }

  ngOnChanges(changes: SimpleChanges) {
    const typeChange = changes['type'];
    if (typeChange && !typeChange.firstChange) {
      this._renderer.removeClass(this._element.nativeElement, `alert-${typeChange.previousValue}`);
      this._renderer.addClass(this._element.nativeElement, `alert-${typeChange.currentValue}`);
    }
  }

  ngOnInit() { this._renderer.addClass(this._element.nativeElement, `alert-${this.type}`); }
}


text:
<?xml version="1.0"?>
<!-- This file registers new types with portal_types. The types are
     then configured with the corresponding files in types/*.xml. Note
     that spaces are allowed in type names, but the corresponding XML file
     uses an underscore instead. The "Factory-based Type Information with
     dynamic views" refers to an FTI from Products.CMFDynamicViewFTI,
     which supports Plone's "display" menu.
  -->
<object name="portal_types" meta_type="Plone Types Tool">
  <!-- -*- extra stuff goes here -*- -->
  <object name="meetshaus.blog.blogentry" meta_type="Dexterity FTI" />
  <object name="meetshaus.blog.blogpost" meta_type="Dexterity FTI" />
  <object name="meetshaus.blog.blog" meta_type="Dexterity FTI" />
</object>


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<!-- log4j 配置  开始 -->

  	<context-param>
        <param-name>log4jConfigLocation</param-name>
		<param-value>/config/log4j.properties</param-value>
    </context-param>
    <context-param>
        <param-name>log4jRefreshInterval</param-name>
        <param-value>600000</param-value>
    </context-param>
    <context-param>
        <param-name>webAppRootKey</param-name>
        <param-value>gomyck.root</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    <!-- log4j 配置  结束 -->

    <servlet>
    	<servlet-name>CkXmlServlet</servlet-name>
    	<servlet-class>com.cevr.component.core.xml.CkDefaultXmlReader</servlet-class>
    	<init-param>
    		<param-name>sqlXmlPath</param-name>
    		<param-value>/config/ck.xml</param-value>
    	</init-param>
    	<load-on-startup>2</load-on-startup>
    </servlet>

    <!-- 设置servlet编码开始 -->
    <filter>
        <filter-name>CharacterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
       <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
	 <filter-mapping>
	     <filter-name>CharacterEncodingFilter</filter-name>
	     <url-pattern>/*</url-pattern>
	 </filter-mapping>
    <!-- 设置servlet编码结束 -->

    <!-- Spring配置文件开始 (事务)  -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        	/config/spring-applicationContext.xml,
        	/config/spring-hession.xml
        </param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- Spring配置文件结束 -->

    <filter>
        <filter-name>openSessionInVieFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>openSessionInVieFilter</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <!-- 浏览器不支持put,delete等method,由该filter将/blog?_method=delete转换为标准的http delete方法 -->
    <filter>
        <filter-name>HiddenHttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>HiddenHttpMethodFilter</filter-name>
        <servlet-name>spring</servlet-name>
    </filter-mapping>

    <servlet>
        <servlet-name>spring-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/config/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

     <!-- 如果想返回heml文件 可打开此标签
    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    -->
</web-app>


text:
package org.meltwater.java.datastructures;

/**
 * A dynamic array that can increase its length;
 */

import java.util.Arrays;

public class BetterArray<E> {
	int originalSize = 10;
	E [] array;
	int size;

   public BetterArray(){
   	array = (E[]) new Object[originalSize];
   	size = 0;
   }

   /**
	 *appends elements to the end of the array
	 *Big O = O(n)
   */
   public void add( E [] arr){
		for(E i : arr){
		add(i);
		}
    }

   /**
  	 *appends an element to the end of the array
  	 *Big O = O(1)  constant time
    */
	public void add(E e){
	 if (size == array.length){
      	E newArray[] = (E[])new Object [array.length*2];
      	for(int i =0; i < size; i++){
      	newArray [i]= array[i];
      	}
      	array =newArray;
    }

	 array[size] = e;
	 size ++;
   }

	 /**
	  *@return the index of an element if it is in the array;
	  *@return negative integer if element is not in the array;
	  *Big O = O(n)
	   */
	public int index(E e){
		for(int i = 0 ; i < size ; i++)
		  if(array[i] == e)
			return  i;
		return -1;
	}

	 /**
	  * @return the element at a specific index
	  *@throws Exception if index is a negative integer or if its greater than array size;
	  */
	public E get(int index) throws IndexOutOfBoundsException{
		if(index < 0 || index >= size)
			throw new IndexOutOfBoundsException("the index is not within the range");
		return array[index];
	}

	 /**
  	 *puts an element at a specific position in array;
  	 *shift the array if the array back position was already occupied by an element
  	 *appends if position is exist and its at end of array;
  	 *Big O = O(1)  constant time
    */
	public void append(E e){
		insert(size, e);
	}

	 /**
  	 *appends an element to the beginning of the array ans shift the rest of elements back
  	 *Big O = O(1)  constant time
    */
	public void Shift(E e){
		insert(0,e);
	}

	 /**
  	 *@return boolean; true if element is in the array and false if its not
  	 *Big O  = O(n);
    */
	public boolean contains(E e){
		return(!(index(e) < 0));
	}

	 /**
  	 *@returns number of elements;
  	 *@return 0 if array is empty;
  	 *Big O = O(1)  constant time
    */
	public int size(){
		return size;
	}

	 /**
  	 *removes an element of a specific index;
  	 *shift the elements above index forward
  	 *@throw an Exception if element is negative or element > size;
  	 *Big O Best case = O(1)  constant time when index is at end
  	 *Big O worst case = O(n)  when index is at first;
    */
	public void remove(int index)throws IndexOutOfBoundsException{
		if(index < 0 || index >= size)
			throw new IndexOutOfBoundsException("the index is not within the range");
		for (int i = index; i < size-1 ; i ++){
			array[i] = array [i + 1];;
		}
		   array[size -1] = null;
		   size --;
	}

	 /**
  	 *throw NullPointerException if Element is not in the array;
  	 *Big O = O(1)  constant time
    */
	public void remove(E e)throws NullPointerException{
		int i = index(e);
		if(i <0)
			throw new NullPointerException("The specified element could not be found");
		remove(i);
	}

	 /**
  	 *reverses the elements in the array
  	 *it swaps the first and last, second and last but 1, until the middle element is reached.
  	 *Big O = O(n)
    */
	public void reverse(){
		for(int i = 1; i <= size/2 ; i++){
			E temp = array[i-1];
			array[i-1] = array[size-i];
			array[size-i]= temp;
		}
	}

	 /**
  	 *puts an element at a specific index;
  	 *if position is the first,  Big O is O(n) because elements have to be shifted
  	 *Big O = O(1)  constant time
    */
	public void insert(int position , E e){
		if (position  > size  || position < 0 ){
			throw new IndexOutOfBoundsException("The specified position is out of reach");

		}
		else if( position == size ){
			    add(e);
		}
          else  {
			 add(e);
		     for(int j = size-1; j >= position ;j-- ){
		           array[j+1] = array[j];
                 }
	             array[position]= e;
	             array[size]= null;
	         }
		}

	 /**
  	 *@return true if no element in array- if the size -1 < 0
  	 *Big O = O(1)  constant time
    */
		public boolean isEmpty(){
			return(size -1 < 0);
		}

	    public String toString(){
		return Arrays.toString(array);
		}

}


text: <!doctype html>


text:
---
layout: default
---

    		{{ page.title }}

                {% if site.owner.name %}
                By {{site.owner.name}},
                {% endif %}
    			0
    			comments.

            {{ content }}

            {% include scripts/share.html %}

Please enable JavaScript to view the comments powered by Disqus.