text:
<?php

class Google_Service_CloudUserAccounts_User extends Google_Collection
{
  protected $collection_key = 'publicKeys';
  public $creationTimestamp;
  public $description;
  public $groups;
  public $id;
  public $kind;
  public $name;
  public $owner;
  protected $publicKeysType = 'Google_Service_CloudUserAccounts_PublicKey';
  protected $publicKeysDataType = 'array';
  public $selfLink;

  public function setCreationTimestamp($creationTimestamp)
  {
    $this->creationTimestamp = $creationTimestamp;
  }
  public function getCreationTimestamp()
  {
    return $this->creationTimestamp;
  }
  public function setDescription($description)
  {
    $this->description = $description;
  }
  public function getDescription()
  {
    return $this->description;
  }
  public function setGroups($groups)
  {
    $this->groups = $groups;
  }
  public function getGroups()
  {
    return $this->groups;
  }
  public function setId($id)
  {
    $this->id = $id;
  }
  public function getId()
  {
    return $this->id;
  }
  public function setKind($kind)
  {
    $this->kind = $kind;
  }
  public function getKind()
  {
    return $this->kind;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setOwner($owner)
  {
    $this->owner = $owner;
  }
  public function getOwner()
  {
    return $this->owner;
  }
  public function setPublicKeys($publicKeys)
  {
    $this->publicKeys = $publicKeys;
  }
  public function getPublicKeys()
  {
    return $this->publicKeys;
  }
  public function setSelfLink($selfLink)
  {
    $this->selfLink = $selfLink;
  }
  public function getSelfLink()
  {
    return $this->selfLink;
  }
}


text:
<?php

namespace Sylius\Bundle\CoreBundle\Releaser;

use Symfony\Component\EventDispatcher\EventDispatcher;
use Doctrine\Common\Persistence\ObjectManager;
use Sylius\Bundle\CoreBundle\Repository\OrderRepository;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Sylius\Bundle\CoreBundle\SyliusOrderEvents;
use Symfony\Component\EventDispatcher\GenericEvent;

/**
 * Release expired orders.
 *
 * @author Foo Pang <foo.pang@gmail.com>
 */
class ExpiredOrdersReleaser implements ReleaserInterface
{
    /**
     * Order manager.
     *
     * @var ObjectManager
     */
    protected $manager;

    /**
     * Order repository.
     *
     * @var OrderRepository
     */
    protected $repository;

    /**
     * Event dispatcher.
     *
     * @var EventDispatcherInterface
     */
    protected $dispatcher;

    public function __construct(ObjectManager $manager, OrderRepository $repository, EventDispatcherInterface $dispatcher)
    {
        $this->manager = $manager;
        $this->repository = $repository;
        $this->dispatcher = $dispatcher;
    }

    /**
     * {@inheritdoc}
     */
    public function release(\DateTime $expiresAt)
    {
        $orders = $this->repository->findExpired($expiresAt);

        foreach ($orders as $order) {
            $this->dispatcher->dispatch(SyliusOrderEvents::PRE_RELEASE, new GenericEvent($order));
            $this->manager->persist($order);
        }
        $this->manager->flush();

        foreach ($orders as $order) {
            $this->dispatcher->dispatch(SyliusOrderEvents::POST_RELEASE, new GenericEvent($order));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
jquery.videoplayer
==================

A Responsive HTML5 Video Player

Examples

Demo

API

autoplay: false [true]

control_autohide: true [false]


text:
/*eslint-env node*/
'use strict';

var Hapi = require('hapi');
var Boom = require('boom');
var api = require('./api');

var server = new Hapi.Server();

server.connection({
    port: process.env.PORT
});

server.route({
    method: 'GET',
    path: '/{version}/{book}/{chapter}',
    handler: function (req, reply) {
        var version = req.params.version;
        var book = req.params.book;
        if (!api.isValidVersion(version)) {
            return reply(Boom.badRequest('Unknown version'));
        }
        if (!api.isValidBook(book)) {
            return reply(Boom.badRequest('Unknown book'));
        }
        api.get(version, book, req.params.chapter, function(verses) {
            reply(verses);
        });
    }
});

server.start();


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE197_Numeric_Truncation_Error__short_large_73b.cpp
Label Definition File: CWE197_Numeric_Truncation_Error__short.label.xml
Template File: sources-sink-73b.tmpl.cpp
*/
/*
 * @description
 * CWE: 197 Numeric Truncation Error
 * BadSource: large Set data to a number larger than CHAR_MAX
 * GoodSource: Less than CHAR_MAX
 * Sinks:
 *    BadSink : Convert data to a char
 * Flow Variant: 73 Data flow: data passed in a list from one function to another in different source files
 *
 * */

#include "std_testcase.h"
#include <list>

using namespace std;

namespace CWE197_Numeric_Truncation_Error__short_large_73
{

#ifndef OMITBAD

void badSink(list<short> dataList)
{
    /* copy data out of dataList */
    short data = dataList.back();
    {
        /* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
        char charData = (char)data;
        printHexCharLine(charData);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSink(list<short> dataList)
{
    short data = dataList.back();
    {
        /* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
        char charData = (char)data;
        printHexCharLine(charData);
    }
}

#endif /* OMITGOOD */

} /* close namespace */


text:
import { parseByLocationRegexp } from '../src/utils';
import * as assert from 'assert';

suite('Utils Tests', () => {
  suite('parseByLocationRegexp', () => {
    test('should match group only in given position', () => {
      const regexp = /({{ )(\w+) }}/g;
      const input = '<span>{{ myVar1 }} {{ myVar2 }}</span>';

      assert.equal(parseByLocationRegexp(input, 8, regexp), null);
      assert.equal(parseByLocationRegexp(input, 10, regexp), 'myVar1');
      assert.equal(parseByLocationRegexp(input, 23, regexp), 'myVar2');
      assert.equal(parseByLocationRegexp(input, 29, regexp), null);
    });
  });
});


text:
namespace Basic.Azure.Storage.Communications.BlobService
{
    public static class BlobServiceConstants
    {
        private const int Megabye = 1024 * 1024;
        public const int MaxSingleBlobUploadSize = 64 * Megabye;
        public const int MaxSingleBlockUploadSize = 4 * Megabye;
    }
}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

	<title>Network - Page 1 - Ghost in the Machine</title>
	<meta name="description" content="" />

	<meta name="HandheldFriendly" content="True" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<link rel="stylesheet" type="text/css" href="../../assets/css/dependencies.css?v=941dddd0f8" />
	<link rel="stylesheet" type="text/css" href="../../assets/css/style.css?v=941dddd0f8" />

	<link rel="canonical" href="index.html" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="Ghost in the Machine" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Network - Page 1 - Ghost in the Machine" />
    <meta property="og:url" content="https://debbyca.github.io/tag/network/" />

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Network - Page 1 - Ghost in the Machine" />
    <meta name="twitter:url" content="https://debbyca.github.io/tag/network/" />

    <meta name="generator" content="Ghost 0.7" />
    <link rel="alternate" type="application/rss+xml" title="Ghost in the Machine" href="../../rss/index.html" />

						Ghost in the Machine

Network 4

			21 Dec 2015

Notes on "The De-scription of Technical Objects"

Akrich, Madeleine. 1992. "The De-Scription of technical Objects". In Shaping Technology / Building Society: Studies in…

		Read More

			16 Dec 2015

Steps towards Anthropology of Techniques and "Technology"

Steps towards Anthropology of Techniques and "Technology" Outline of the lectures "Technology": Capitalism, Rationality Study…

		Read More

			10 Dec 2015

Notes on the 12/8 Lecture

From Sociology of Science to Symmetric Anthropology Critique of Shapin & Schaffer Leviathan and the…

		Read More

			30 Nov 2015

Notes on the 11/30 Lecture

Notes on The Network Inside Out (2000) In the case of [Walbiri Iconography]: Munn (1973)…

		Read More

	    Page 1 of 1

					Theme Bleak by zutrinken
					Published with Ghost

		Menu

			Home


text:
<?php

/**
 * Webservice API2 renderer of query format model
 *
 * @category   Mage
 * @package    Mage_Api2
 * @author     Magento Core Team <core@magentocommerce.com>
 */
class Mage_Api2_Model_Renderer_Query implements Mage_Api2_Model_Renderer_Interface
{
    /**
     * Adapter mime type
     */
    const MIME_TYPE = 'text/plain';

    /**
     * Convert Array to URL-encoded query string
     *
     * @param array|object $data
     * @return string
     */
    public function render($data)
    {
        $query = http_build_query($data);
        return $query;
    }

    /**
     * Get MIME type generated by renderer
     *
     * @return string
     */
    public function getMimeType()
    {
        return self::MIME_TYPE;
    }
}


text:
<?php

/**
 * Class Svn
 */
class SVN {
    static private $_account = NULL;
    static private $_password = NULL;
    static private $_root_directory = NULL;
    static private $_last_query_cmd = NULL;
	static private $_last_cmd_result = NULL;
	static private $_last_cmd_status = NULL;
    static private $_limit = 100;
	static private $_repos_dir = NULL;
    public function __construct() {

    }

    static public function config($account, $pwd, $dir) {
        self::$_account = $account;
        self::$_password = $pwd;
        self::$_root_directory = $dir;
    }

    static public function ls($path) {
        $command = 'svn ls '.$path.' --xml';
        $output = self::run_cmd($command);
        return $output;
    }

    static public function diff($version, $dir = '', $summarize = true) {
        if ($summarize === true) {
			if (is_array($dir)) {
				$dir = implode(' ', $dir);
			}
            $output = self::run_cmd("svn diff {$dir} -r$version  --summarize --xml");
            $string = implode('', $output);
            $xml = self::xml_parser($string);
            if ($xml === false)
                return false;
            $data = array();
            foreach ($xml as $val) {
                foreach ($val->path as $v) {
                    $attributes = $v->attributes();
                    $data[] = array(
                        'name' => (string)$v,
                        'item' => (string)$attributes->item,
                        'props' => (string)$attributes->props,
                        'kind' => (string)$attributes->kind,
                    );
                }
            }
            return $data;
        } else {
            $output = self::run_cmd("svn diff {$dir} -r$version");
            return $output;
        }
    }

    /**
     * @param $path
     * @return mixed
     */
    static public function info($path = '', $server_info = true) {
        $command = "svn info --xml";
        $output = self::run_cmd($command);
        $string = implode('', $output);
        $xml = self::xml_parser($string);
        if ($xml === false)
            return false;
        $root = $xml->entry->url;
		self::$_repos_dir = $root;
        $attributes = $xml->entry->commit->attributes();
        $revision = $attributes['revision'];
        $server_log = array();
        if ($server_info === true && $root) {
            $server_log = self::log($root);
        }
        return array(
            'revision' => $revision,
            'root' => $root,
            'server_log' => $server_log,
        );
    }

    static public function file_info($file, $root = '') {
        $command = "svn info {$file} --xml";
        $output = self::run_cmd($command);
        $string = implode('', $output);
        $xml = self::xml_parser($string);
        if ($xml === false) {
            $command = "svn info {$root}/{$file} --xml";
            $output = self::run_cmd($command);
            $string = implode('', $output);
            $xml = self::xml_parser($string);
            if ($xml === false)
                return false;
        }
        $url = $xml->entry->url;
        $commit = $xml->entry->commit;
        $author = $commit->author;
        $date = $commit->date;
        $attributes = $xml->entry->commit->attributes();
        return array(
            'url' => (string)$url,
            'revision' => (string)$attributes['revision'],
            'author' => (string)$author,
            'date' => date('Y-m-d H:i:s', strtotime($date)),
        );
    }

	static public function wc_file_info($file = '') {
		$command = "svn info {$file} --xml";
        $output = self::run_cmd($command);
        $string = implode('', $output);
        $xml = self::xml_parser($string);
		if ($xml === false)
			return false;
		$url = $xml->entry->url;
		$entry_attrs = $xml->entry->attributes();
        $commit = $xml->entry->commit;
        $author = $commit->author;
        $date = $commit->date;
        $attributes = $xml->entry->commit->attributes();
        return array(
            'url' => (string)$url,
			'r' => (string)$entry_attrs['revision'],
            'revision' => (string)$attributes['revision'],
            'author' => (string)$author,
            'date' => date('Y-m-d H:i:s', strtotime($date)),
        );
	}

	static public function repos_file_info() {

	}

    static public function log($url = '') {
        $command = "svn log {$url} --xml --limit ".self::$_limit;
        $output = self::run_cmd($command);
		//echo Svn::last_cmd();
		//print_r($output);
        $string = implode('', $output);
        $xml = self::xml_parser($string);
        if ($xml === false)
            return false;
        $return = array();
        foreach ($xml->logentry as $logentry) {
            $attributes = $logentry->attributes();
            $return[] = array(
                'author' => (string)$logentry->author,
                'date' => strtotime($logentry->date),
                'msg' => (string)$logentry->msg,
                'revision' => (string)$attributes['revision'],
            );
        }
        return $return;
    }

    static public function update($version, $path = array()) {
        if (is_array($path))
            $path = implode(' ', $path);
        $command = "svn cleanup && svn up --force -r{$version} ".$path;
        $output = self::run_cmd($command);
        if (empty($output)) {
            return false;
        }
        return $output;
    }

    static public function copy($src, $dst, $comment) {
        $command = "svn cp $src $dst -m '$comment'";
        $output = self::run_cmd($command);
        $output = implode("
", $output);

        if (strpos($output, 'Committed revision')) {
            return true;
        }

        return "
" . $command . "
" . $output;
    }

    static public function delete($url, $comment) {
        $command = "svn del $url -m '$comment'";
        $output = self::run_cmd($command);
        $output = implode('
', $output);
        if (strpos($output, 'Committed revision')) {
            return true;
        }

        return "
" . $command . "
" . $output;
    }

    static public function move($src, $dst, $comment)
    {
        $command = "svn mv $src $dst -m '$comment'";
        $output = self::run_cmd($command);
        $output = implode('
', $output);

        if (strpos($output, 'Committed revision')) {
            return true;
        }
        return "
" . $command . "
" . $output;
    }

    static public function mkdir($url, $comment) {
        $command = "svn mkdir $url -m '$comment'";
        $output = self::run_cmd($command);
        $output = implode('
', $output);

        if (strpos($output, 'Committed revision')) {
            return true;
        }

        return "
" . $command . "
" . $output;
    }

    static public function checkout($url, $dir) {
        $command = "svn co $url";
        $output = self::run_cmd($command);
        $output = implode('
', $output);
        if (strstr($output, 'Checked out revision')) {
            return true;
        }
        return "
" . $command . "
" . $output;
    }

    static public function merge($revision, $url, $dir)
    {
        $command = "cd $dir && svn merge -r1:$revision $url";
        $output = implode('
', self::run_cmd($command));
        if (strstr($output, 'Text conflicts')) {
            return 'Command: ' . $command .'
'. $output;
        }
        return true;
    }

    static public function commit($dir, $comment) {
        $command = "cd $dir && svn commit -m'$comment'";
        $output = implode('
', self::run_cmd($command));

        if (strpos($output, 'Committed revision') || empty($output)) {
            return true;
        }
        return $output;
    }

    static public function getStatus($dir) {
        $command = 'svn st';
        return self::run_cmd($command);
    }

    static public function hasConflict($dir) {
        $output = self::getStatus($dir);
        foreach ($output as $line){
            if ('C' == substr(trim($line), 0, 1) || ('!' == substr(trim($line), 0, 1))){
                return true;
            }
        }
        return false;
    }

    static public function get_log($path) {
        $command = "svn log $path --xml";
        $output = self::run_cmd($command);
        return implode('', $output);
    }

    static function status($revision, $default_revision = 0) {
        $command = "svn status -r{$revision} -u --xml";
        $output = self::run_cmd($command);
        $string = implode('', $output);
        $xml = self::xml_parser($string);
        if ($xml === false)
            return false;
		$target = $xml->target;
		$data = array();
		foreach ($target->entry as $entry) {
			$entry_attri = $entry->attributes();
			$wc_status = 'wc-status';
			$repos_status = 'repos-status';
			$wc_status_attri = isset($entry->{$wc_status}) ? $entry->{$wc_status}->attributes() : array();
			$repos_status_attri = isset($entry->{$repos_status}) ? $entry->{$repos_status}->attributes() : array();
			$kind = self::get_file_type(self::$_root_directory, (string)$entry_attri['path']);
			$item = isset($repos_status_attri['item']) ? (string)$repos_status_attri['item'] : '';
			$props = isset($repos_status_attri['props']) ? (string)$repos_status_attri['props'] : '';
			$r = intval(!empty($wc_status_attri['revision']) ? $wc_status_attri['revision'] : $default_revision);
			if ($kind == 'dir' && $item == 'modified')
				continue;
			$data[] = array(
				'name' => (string)$entry_attri['path'],
				'item' => $item,
				'props' => $props,
				'kind' => $kind,
				'revision' => $r,
			);
		}
		return $data;
    }

	static public function get_file_type($pre_dir, $file_name) {
		$full_file_name = $pre_dir.'/'.$file_name;
		if (file_exists($full_file_name)) {
			if (is_dir($full_file_name)) {
				$kind = 'dir';
			} else {
				$kind = 'file';
			}
		} else {
			$file_name = substr($file_name, strripos($file_name, '/') + 1);
			if (strpos($file_name, '.') !== false) {
				$kind = 'file';
			} else {
				$kind = 'dir';
			}
		}
		return $kind;
	}

    static public function get_head_revision($path) {
        $command = "cd $path && svn up";
        $output = self::run_cmd($command);
        $output = implode('
', $output);

        preg_match_all("/[0-9]+/", $output, $ret);
        if (!$ret[0][0]){
        return "
" . $command . "
" . $output;
        }

        return $ret[0][0];
    }

	static public function get_repos_dir() {
		return self::$_repos_dir;
	}

    /**
     * exec command
     * @param $command
     * @param bool|TRUE $cd
     * @return mixed
     */
    static protected function run_cmd($command, $cd = TRUE) {
        $cdCommand = $cd === TRUE ? 'cd '.self::$_root_directory.' && ' : '';
		if (strpos($command, 'https') !== FALSE) {
			$command = $cdCommand . $command . ' --username ' . self::$_account . ' --password ' . self::$_password . ' --no-auth-cache --trust-server-cert --non-interactive';
		} else {
			$command = $cdCommand . $command . ' --username ' . self::$_account . ' --password ' . self::$_password . ' --no-auth-cache --non-interactive';
		}
        return self::exec_cmd($command, true);
    }

    /**
     * @param $command
     * @return mixed
     */
    static public function exec_cmd($command, $need_output = false) {
        if ($need_output === true) {
            $command = $command . " 2>&1";
        }
        exec($command, $output, $status);
		self::$_last_query_cmd = $command;
		self::$_last_cmd_result = $output;
		self::$_last_cmd_status = $status;
        return $output;
    }

	static public function last_cmd() {
        return self::$_last_query_cmd;
    }

	static public function last_cmd_result() {
        return self::$_last_cmd_result;
    }

    static public function last_cmd_status() {
        return self::$_last_cmd_status;
    }

    /**
     * @param $string
     * @return bool|SimpleXMLElement
     */
    static function xml_parser($string) {
        $xml_parser = xml_parser_create();
        if (!xml_parse($xml_parser, $string, true)) {
            xml_parser_free($xml_parser);
            return false;
        } else {
            return new SimpleXMLElement($string);
        }
    }

	static function check_exec_status($exec_arr) {
		$fail = '--FAIL--';
		if (empty($exec_arr) || !is_array($exec_arr) || empty($exec_arr[0]))
			return FALSE;
		foreach ($exec_arr as $val) {
			if (strpos($val, $fail) !== FALSE)
				return FALSE;
		}
		if (end($exec_arr) == 'OK') {
			return TRUE;
		} else {
			return FALSE;
		}
	}
}


text:
usage ()
{
	cat <<EOT

${0##*/}
    Thin script included with new projects to make it easier to
    bootstrap a freshly cloned repository. Initializes submodules
    (which if the project is based on the Loadsys/CakePHP-Skeleton
    will include bin/init-repo) and then calls bin/init-repo to do
    the rest of the setup work. Takes all of the same arguments as
    init-repo.

Usage:
    bin/${0##*/} [env] [owner] [group] [db base name] [cake core path]

EOT

	exit 0
}
if [ "$1" = '-h' ]; then
	usage
fi

DIR="$( cd -P "$( dirname "$0" )"/.. && pwd )"
INIT_SCRIPT="$DIR/bin/init-repo"

echo "## Initializing submodules."
git submodule update --init --recursive

echo "## Installing composer dependencies."
composer install --dev --no-interaction

if [ -e "$INIT_SCRIPT" ]; then
	echo "## Bootstrapping init script."
	$INIT_SCRIPT "$@"
else
	echo "## Could not locate init script in project. Exiting."
	exit 1
fi


text:
layout: post
microblog: true
audio:
photo:
date: 2009-10-23 18:00:00 -0600
guid: http://craigmcclellan.micro.blog/2009/10/24/t5134101368.html
---
I love Fellowship. What an awesome service. Lloyd was hilarious and in rare form, but had an great message too. "What you fear, you worship"


text:
package safebrowsing

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"

	pb "github.com/google/safebrowsing/internal/safebrowsing_proto"

	"github.com/golang/protobuf/proto"
)

const (
	findHashPath    = "/v4/fullHashes:find"
	fetchUpdatePath = "/v4/threatListUpdates:fetch"
)

// The api interface specifies wrappers around the Safe Browsing API.
type api interface {
	ListUpdate(req *pb.FetchThreatListUpdatesRequest) (*pb.FetchThreatListUpdatesResponse, error)
	HashLookup(req *pb.FindFullHashesRequest) (*pb.FindFullHashesResponse, error)
}

// netAPI is an api object that talks to the server over HTTP.
type netAPI struct {
	client http.Client
	url    *url.URL
}

// newNetAPI creates a new netAPI object pointed at the provided root URL.
// For every request, it will use the provided API key.
// If the protocol is not specified in root, then this defaults to using HTTPS.
func newNetAPI(root string, key string) (*netAPI, error) {
	if !strings.Contains(root, "://") {
		root = "https://" + root
	}
	u, err := url.Parse(root)
	if err != nil {
		return nil, err
	}

	q := u.Query()
	q.Set("key", key)
	q.Set("alt", "proto")
	u.RawQuery = q.Encode()
	return &netAPI{url: u}, nil
}

// doRequests performs a POST to requestPath. It uses the marshaled form of req
// as the request body payload, and automatically unmarshals the response body
// payload as resp.
func (a *netAPI) doRequest(requestPath string, req proto.Message, resp proto.Message) error {
	p, err := proto.Marshal(req)
	if err != nil {
		return err
	}

	u := *a.url // Make a copy of URL
	u.Path = requestPath
	httpReq, err := http.NewRequest("POST", u.String(), bytes.NewReader(p))
	httpReq.Header.Add("Content-Type", "application/x-protobuf")
	httpResp, err := a.client.Do(httpReq)
	if err != nil {
		return err
	}
	defer httpResp.Body.Close()
	if httpResp.StatusCode != 200 {
		return fmt.Errorf("safebrowsing: unexpected server response code: %d", httpResp.StatusCode)
	}
	body, err := ioutil.ReadAll(httpResp.Body)
	if err != nil {
		return err
	}
	return proto.Unmarshal(body, resp)
}

// ListUpdate issues a FetchThreatListUpdates API call and returns the response.
func (a *netAPI) ListUpdate(req *pb.FetchThreatListUpdatesRequest) (*pb.FetchThreatListUpdatesResponse, error) {
	resp := new(pb.FetchThreatListUpdatesResponse)
	return resp, a.doRequest(fetchUpdatePath, req, resp)
}

// HashLookup issues a FindFullHashes API call and returns the response.
func (a *netAPI) HashLookup(req *pb.FindFullHashesRequest) (*pb.FindFullHashesResponse, error) {
	resp := new(pb.FindFullHashesResponse)
	return resp, a.doRequest(findHashPath, req, resp)
}


text:
/**
 * Checks if `value` is less than `other`.
 *
 * @static
 * @memberOf _
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
 * @example
 *
 * _.lt(1, 3);
 * // => true
 *
 * _.lt(3, 3);
 * // => false
 *
 * _.lt(3, 1);
 * // => false
 */
function lt(value, other) {
  return value < other;
}

export default lt;


text:
/*
 * Arduino JSON library
 * Benoit Blanchon 2014 - MIT License
 */

// This file is here to help the Arduino IDE find the .cpp files

#include "JsonParser/JsonArray.cpp"
#include "JsonParser/JsonObject.cpp"
#include "JsonParser/JsonParserBase.cpp"
#include "JsonParser/JsonValue.cpp"
#include "JsonParser/JsonToken.cpp"
#include "JsonParser/jsmn.cpp"


text:
package flightid

import(
	"fmt"
	"math"
	"math/rand"
	"sort"
	"github.com/skypies/geo"
)

// Randomness in public: Fri Mar 17, 18:00, until Sat Mar 18, 11:00

// Selector is a role for things (algorithms) that can select a problem aircraft from an airspace
type Selector interface {
	String() string

	// Pick out the noise-making flight from the array, and a oneline explanation. If none
	// was identified, returns nil (but the string will explain why).
	// The aircraft slice is initially sorted by Dist3.
	Identify(pos geo.Latlong, elev float64, aircraft []Aircraft) (*Aircraft, string)
}

// SelectorNames is the list of selectors we want users to be able to pick from
var SelectorNames = []string{"conservative","cone"}

func NewSelector(name string) Selector {
	switch name {
	case "random": return AlgoRandom{}
	case "conservative": return AlgoConservativeNoCongestion{}
	case "cone": return AlgoLowestInCone{}
	default: return AlgoConservativeNoCongestion{}
	}
}
func ListSelectors() [][]string {
	ret := [][]string{}
	for _,name := range SelectorNames {
		ret = append(ret, []string{name, NewSelector(name).String()})
	}
	return ret
}

type AlgoRandom struct{}
func (a AlgoRandom)String() string { return "Picks at random" }
func (a AlgoRandom)Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft,string) {
	if len(in) == 0 {
		return nil, "list was empty"
	}
	i := rand.Intn(len(in))
	return &in[i], fmt.Sprintf("random (grabbed aircraft %d from list of %d)", i+1, len(in))
}

// The original, "no congestion allowed" heuristic ...
type AlgoConservativeNoCongestion struct{}
func (a AlgoConservativeNoCongestion)String() string { return "Conservative, gives up on congestion" }
func (a AlgoConservativeNoCongestion)Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft,string) {
	if len(in) == 0 {
		return nil, "nothing in list"
	} else if (in[0].Dist3 >= 12.0) {
		return nil, "not picked; 1st closest was too far away (>12KM)"
	} else if (len(in) == 1) || (in[1].Dist3 - in[0].Dist3) > 4.0 {
		return &in[0], "selected 1st closest"
	} else {
		return nil, "not picked; 2nd closest was too close to 1st (<4KM)"
	}
}

type AlgoLowestInCone struct{}
func (a AlgoLowestInCone)String() string {
	return "Picks lowest inside a 60deg cone [EXPERIMENTAL]"
}

func (a AlgoLowestInCone)Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft,string) {
	if len(in) == 0 {
		return nil, "nothing in list"
	} else if (in[0].Dist3 >= 12.0) {
		return nil, "not picked; 1st closest was too far away (>12KM)"
	} else if (len(in) == 1) || (in[1].Dist3 - in[0].Dist3) > 4.0 {
		return &in[0], "selected 1st closest"
	}

	// Build new list of just those flights which are within the cone (i.e. angle <60deg)
	enconed := []Aircraft{}
	for _,a := range in {
		// angle between a vertical line from pos, and the line from pos to the aircraft.
		horizDistKM := a.Dist
		vertDistKM := (a.Altitude - elev) / geo.KFeetPerKM
		if angle := math.Atan2(horizDistKM,vertDistKM) * (180.0 / math.Pi); angle <= 60 {
			enconed = append(enconed, a)
		}
	}

	if len(enconed) == 0 {
		return nil, "not picked; nothing found inside 60deg cone."
	}

	sort.Sort(AircraftByAltitude(enconed))
	return &enconed[0], "picked lowest in cone."
}


text:
<?php

namespace ECommerce\ECommerceBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ProduitType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom')
            ->add('slug')
            ->add('description')
            ->add('disponible')
            ->add('plage')
            ->add('prix')
            ->add('media', new ProduitMediaType())
            ->add('categorie', new ProduitCategorieType())
            ->add('tva', new ProduitTvaType())
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'ECommerce\ECommerceBundle\Entity\Produit'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'ecommerce_ecommercebundle_produit';
    }
}


text:
package infra

import (
	"strings"

	"github.com/spf13/cobra"

	"github.com/apex/apex/cmd/apex/root"
	"github.com/apex/apex/infra"
	"github.com/apex/apex/stats"
)

// example output.
const example = `  View change plan
  $ apex infra plan

  Apply changes
  $ apex infra apply`

// Command config.
var Command = &cobra.Command{
	Use:     "infra",
	Short:   "Infrastructure management",
	Example: example,
	RunE:    run,
}

// Initialize.
func init() {
	root.Register(Command)
}

// Run command.
func run(c *cobra.Command, args []string) error {
	stats.Track("Infra", nil)

	err := root.Project.LoadFunctions()

	// Hack to prevent initial `apex infra apply` from failing,
	// as we load functions to expose their ARNs.
	if err != nil {
		if !strings.Contains(err.Error(), "Role: zero value") {
			return err
		}
	}

	p := &infra.Proxy{
		Functions:   root.Project.Functions,
		Region:      *root.Session.Config.Region,
		Environment: root.Project.Environment,
	}

	return p.Run(args...)
}


text:
package org.apache.log4j.spi;

import org.apache.log4j.or.ObjectRenderer;
import org.apache.log4j.or.RendererMap;

public interface RendererSupport {

  public
  RendererMap getRendererMap();

  public
  void setRenderer(Class renderedClass, ObjectRenderer renderer);

}


text:
import boto.ec2
from time import sleep

def connect(region="us-east-1"):
    return boto.ec2.connect_to_region(region)

def get_available_instances(conn=None, ids=None):
    conn = conn or connect()

    return [i for i in conn.get_only_instances(instance_ids=ids)
            if i.state != 'terminated' and i.state != 'shutting-down']

def terminate_all(ids=None, conn=None, **kwargs):
    conn = conn or connect()
    instances = conn.get_only_instances(instance_ids=ids)
    to_stop = [i.id for i in instances if i.state != 'terminated']
    if to_stop:
        print 'terminating: {0}'.format(to_stop)
        conn.terminate_instances(instance_ids=to_stop)

def reserve(conn, instance_type, **kwargs):
    print 'launching instance'
    if instance_type == 'free':
        instance_type = 't2.micro'
    reserve = conn.run_instances('ami-9eaa1cf6', key_name='cmu-east-key1',
                                 instance_type=instance_type, security_groups=['Aaron-CMU-East'],
                                 instance_profile_arn='arn:aws:iam::999933667566:instance-profile/Worker')
    print 'launched instance ' + reserve.instances[0].id
    return reserve.instances[0].id

def add_instances(instance_cnt=1, conn=None, **kwargs):
    conn = conn or connect()
    return [reserve(conn, **kwargs) for c in range(instance_cnt)]

class NoInstanceException(BaseException):
    pass

def get_active_instance(conn=None, wait=180, interval=10, ids=None, **kwargs):
    conn = conn or connect()

    def check_for_active():
        print('looking for usable instance...')
        statuses = {s.id: s.instance_status.status
                    for s in conn.get_all_instance_status()}
        instances = get_available_instances(conn, ids=ids)
        if not instances:
            raise NoInstanceException("no instances have been started")
        for instance in instances:
            instance.update()
            if (instance.state == 'running' and
                    statuses.get(instance.id, '') == 'ok'):
                return instance
        print 'none found'
        return None

    inst = check_for_active()
    if inst:
        return inst
    for i in range(0, wait, interval):
        sleep(interval)
        inst = check_for_active()
        if inst:
            return inst
    raise NoInstanceException("no ready instances after waiting {0} seconds".format(wait))


text:
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'sphinx.ext.coverage',
    'sphinx.ext.mathjax',
    'sphinx.ext.ifconfig',
    'sphinx.ext.viewcode',
    'guzzle_sphinx_theme'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Itunder'
copyright = '2017, Hamza Ali TAS'
author = 'Hamza Ali TAS'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
import guzzle_sphinx_theme

html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
    "project_nav_name": "ITUnder"
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
#     '**': [
#         'about.html',
#         'navigation.html',
#         'relations.html',  # needs 'show_related': True theme option to display
#         'searchbox.html',
#         'donate.html',
#     ]
# }

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Itunderdoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (master_doc, 'Itunder.tex', 'Itunder Documentation',
     'Hamza Ali TAS', 'manual'),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'itunder', 'Itunder Documentation',
     [author], 1)
]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (master_doc, 'Itunder', 'Itunder Documentation',
     author, 'Itunder', 'One line description of project.',
     'Miscellaneous'),
]

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

import os, sys

sys.path.insert(0, os.path.join(os.path.abspath('../'), '.'))
# sys.path.append(os.path.abspath('../'), '.')
sys.path.append(os.path.join(os.path.abspath('../'), 'models'))
sys.path.append(os.path.join(os.path.abspath('../'), 'controllers'))


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.axel.downloader"
	     name="Axel Downloader"
	     version="0.2.1"
	     provider-name="Eldorado">
  <requires>
    <import addon="xbmc.python" version="2.1.0" />
    <import addon="script.module.addon.common" version="2.0.0" />
  </requires>
  <extension point="xbmc.python.script" library="controlpanel.py"/>
  <extension point="xbmc.python.module" library="lib" />
  <extension library="default.py" point="xbmc.service" start="startup" />
  <extension point="xbmc.addon.metadata">
    <platform>all</platform>
    <summary lang="en">Multi-connection/threaded Downloader</summary>
    <description lang="en">Download a file using multiple connections to achieve the highest speed.</description>
  </extension>
</addon>


text:
## Overview
This two week course is will cover the basics of Python,
focusing on its use in astronomy research. Most of this course
is designed around "learning by doing", and is not meant to be
a substitute to a more formal programming course. This is driven
by the fact that there's not enough time two weeks of short classes
to learn enough Python for any particular research project. Since
you will almost certainly be learning a lot of Python "on the job",
the goal of this course is to try and teach you how to teach
*yourself* Python given a reasonable foundation to build on.

## Material
We will cover Python programming basics, packages, how to use them,
how to search for help, basic debugging, and
reading/interpreting code. We're not going to systematically
hit all these points with basic exercises, but instead to cover
them more or less organically while starting to do some real science.
This should provide motivation for introducing new concepts
while also situating them in useful contexts (which hopefully
is more fun!).

Note that this course is designed to be challenging, and you
are highly encouraged to spend as much (or little) time on the
exercises as you feel is appropriate both inside and outside of
class.

## Requirements
The material used here assumes very basic knowledge of coding but
does not require any previous coding experience. Most of the exercises
will be provided in Jupyter Notebooks, which will form the
backbone of this course. It does not require major outside
dependencies.

## Format
The course is be divided into four parts, each
lasting approximately two days:

- In part 1, we will focus on learning enough of the basics
to get by. This will cover syntax, variables, loops, data
structures, and so forth.

- In part 2, we will simulate photometric and spectroscopic
observations of a galaxy. This will focus on array/list
manipulation, loops, and utilities and introduce the `numpy`
and `matplotlib` packages.

- In part 3, we will derive a period-luminosity relationship
for Cepheid variable stars. This will focus on simulation and
(black box) function use/interpretation as well as basic
statistics. It will also introduce the `scipy` package.

- In part 4, we will measure cosmological parameters from
Type Ia Supernovae. This will introduce additional data
analysis tools and statistical methods while synthesizing
the material covered throughout the course.


text:
package scopegraph

//go:generate stringer -type=NodeType

import (
	"strconv"
)

// NodeType identifies the type of scope graph nodes.
type NodeType int

const (
	// Top-level
	NodeTypeError          NodeType = iota // A scope error
	NodeTypeWarning                        // A scope warning
	NodeTypeResolvedScope                  // Resolved scope for an SRG node
	NodeTypeSecondaryLabel                 // A secondary label on an SRG node

	// NodeType is a tagged type.
	NodeTypeTagged
)

const (
	// Connects a scope node to its SRG source.
	NodePredicateSource = "scope-source"

	// Decorates a scope node with its scope info.
	NodePredicateScopeInfo = "scope-info"

	// Connects a secondary label to its SRG source.
	NodePredicateLabelSource = "secondary-label-source"

	// Decorates a secondary label node with its label value.
	NodePredicateSecondaryLabelValue = "secondary-label-value"

	// Connects an error or warning to its SRG source.
	NodePredicateNoticeSource = "scope-notice"

	// The error or warning message on a scope notice node.
	NodePredicateNoticeMessage = "notice-message"
)

func (t NodeType) Name() string {
	return "NodeType"
}

func (t NodeType) Value() string {
	return strconv.Itoa(int(t))
}

func (t NodeType) Build(value string) interface{} {
	i, err := strconv.Atoi(value)
	if err != nil {
		panic("Invalid value for NodeType: " + value)
	}
	return NodeType(i)
}


text:
include ../../Library/GNU.mk

CREATE_LIBEXEC_LINKS?=yes

Title=		Ccache
Name=		ccache
Version=	3.7.12
Site=		https://ccache.dev
Source=		https://github.com/ccache/ccache/releases/download/v$(Version)/ccache-$(Version).tar.xz
License=	GPLv3+

ReadMeFile=	$(SourceDir)/README.md
LicenseFile=	$(SourceDir)/LICENSE.adoc

ifeq ($(CREATE_LIBEXEC_LINKS),yes)
define after_install_hook
install -d $(DestDir)$(LibExecDir)/ccache
cd $(DestDir)$(LibExecDir)/ccache && \
for x in cc gcc clang g++ c++ llvm-gcc llvm-g++ ; do \
	ln -sf ../../bin/ccache $$x ; done
endef
endif

define test_hook
$(BinDir)/ccache --version | grep $(Version)
endef


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT — CMake 3.8.1 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMAKE_<LANG>_FLAGS_RELEASE" href="CMAKE_LANG_FLAGS_RELEASE.html" />
    <link rel="prev" title="CMAKE_<LANG>_FLAGS_MINSIZEREL" href="CMAKE_LANG_FLAGS_MINSIZEREL.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.8.1 Documentation »

cmake-variables(7) »

<span id="variable:CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT">
CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT¶

Value used to initialize the CMAKE_<LANG>_FLAGS_MINSIZEREL
cache entry the first time a build tree is configured for language <LANG>.
This variable is meant to be set by a toolchain file.  CMake may prepend or append content to
the value based on the environment and target platform.

See also CMAKE_<LANG>_FLAGS_INIT.

Previous topic

CMAKE_<LANG>_FLAGS_MINSIZEREL

Next topic

CMAKE_<LANG>_FLAGS_RELEASE

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.8.1 Documentation »

cmake-variables(7) »

        © Copyright 2000-2017 Kitware, Inc. and Contributors.
      Created using Sphinx 1.5.2.


text:
require 'test_helper'

class ErrorTest < MiniTest::Test
  def setup
    @env = Sprockets::Environment.new(File.join(__dir__, 'fixtures'))
    @env.append_path File.join(__dir__, 'fixtures')
  end

  def test_error
    error = assert_raises Schmooze::JavaScript::SyntaxError do
      @env['typo.js'].to_s
    end
    assert_equal <<-ERROR.strip, error.message.strip
#{File.join(__dir__, 'fixtures', 'typo', 'index.js')}: Unexpected token (1:4)
> 1 | var default = a;
    |     ^
  2 |
ERROR
  end
end


text:
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000092
# Group Title: SRG-OS-999999
#

# Rule ID: RHEL-06-000092_rule
# Severity: low
# Rule Version (STIG-ID): RHEL-06-000092
# Rule Title: The system must not respond to ICMPv4 sent to a broadcast
# address.
#
# Vulnerability Discussion: Ignoring ICMP echo requests (pings) sent to
# broadcast or multicast addresses makes the system slightly more difficult
# to enumerate on the network.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# The status of the "net.ipv4.icmp_echo_ignore_broadcasts" kernel
# parameter can be queried by running the following command:

# $ sysctl net.ipv4.icmp_echo_ignore_broadcasts

# The output of the command should indicate a value of "1". If this value
# is not the default value, investigate how it could have been adjusted at
# runtime, and verify it is not set improperly in "/etc/sysctl.conf".
# If the correct value is not returned, this is a finding.
#
# Fix Text:
#
# To set the runtime status of the "net.ipv4.icmp_echo_ignore_broadcasts"
# kernel parameter, run the following command:

# sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1

# If this is not the system's default value, add the following line to
# "/etc/sysctl.conf":

# net.ipv4.icmp_echo_ignore_broadcasts = 1

#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000092

#BEGIN_CHECK
. /usr/libexec/aqueduct/functions
MOD_MSG="sysctl ignore icmp brodcasts"
KERNEL_VAR=`sysctl net.ipv4.icmp_echo_ignore_broadcasts | awk '{ print $NF }'`
#END_CHECK
#BEGIN_REMEDY

if [ $KERNEL_VAR -ne 1 ]; then
        edit_file /etc/sysctl.conf $PDI "net.ipv4.icmp_echo_ignore_broadcasts = 1" "net.ipv4.icmp_echo_ignore_broadcasts"
        show_message $PDI "$MOD_MSG" fixed
else
        show_message $PDI "$MOD_MSG" pass
fi

# This is just for the limited SCC tool. It doesn't check the real value so we have to write this
# to /etc/sysctl.conf manually
if ! grep -q net.ipv4.icmp_echo_ignore_broadcasts /etc/sysctl.conf; then
        edit_file /etc/sysctl.conf $PDI "net.ipv4.icmp_echo_ignore_broadcasts = 1" "net.ipv4.icmp_echo_ignore_broadcasts"

fi
# END_REMEDY


text:
md-card {
  display: inline-block;
  margin-right: 10px;
  margin-left: 10px;
}

.subheader {
  margin: 20px;
  align-content: center;
}


text:
set -e

export BUILD_IN_DOCKER=y
export TAG=$ghprbActualCommit
export GOPATH=/var/lib/jenkins/go

docker kill $(docker ps -q) || true
docker rm $(docker ps -aq) || true
set +e
make -j 16 all
set -e

gsutil cp gs://minikube-builds/logs/index.html gs://minikube-builds/logs/${ghprbPullId}/index.html

# Exit if the cross build failed.
if [ "$?"-ne 0 ]; then echo "cross build failed"; exit 1; fi

# If there are ISO changes, build and upload the ISO
# then set the default to the newly built ISO for testing
if out="$(git diff ${ghprbActualCommit} --name-only $(git merge-base origin/master ${ghprbActualCommit}) | grep deploy/iso/minikube)" &> /dev/null; then
	echo "ISO changes detected ... rebuilding ISO"
	export ISO_BUCKET="minikube-builds/${ghprbPullId}"
	export ISO_VERSION="testing"

	make release-iso
fi

cp -r test/integration/testdata out/

# Don't upload the buildroot artifacts if they exist
rm -r out/buildroot || true

# Upload everything we built to Cloud Storage.
gsutil -m cp -r out/* gs://minikube-builds/${ghprbPullId}/


text:
<?php

/* base.html.twig */
class __TwigTemplate_3a1ad7bc5f50b3832b34cbef700d1afcc3911163a2c3d91d3e6ac5bcb872ce86 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
            'title' => array($this, 'block_title'),
            'stylesheets' => array($this, 'block_stylesheets'),
            'javascripts' => array($this, 'block_javascripts'),
            'body' => array($this, 'block_body'),
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<!DOCTYPE html>

        <meta charset=\"UTF-8\" />
        <title>";
        // line 5
        $this->displayBlock('title', $context, $blocks);
        echo "</title>
        ";
        // line 6
        $this->displayBlock('stylesheets', $context, $blocks);
        // line 25
        echo "\t\t

        <link rel=\"icon\" type=\"image/x-icon\" href=\"";
        // line 36
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("favicon.ico"), "html", null, true);
        echo "\" />

\t";
        // line 41
        $this->displayBlock('javascripts', $context, $blocks);
        // line 42
        echo "

\t\t
\t\t
\t\t

\t\t

\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t
\t\t

    \t

\t\t\tenv->getExtension('routing')->getPath("user_logout");
        echo "\">Déconnexion
\t\t\t

\t\t\t\t<button type=\"button\" class=\"navbar-toggle pull-left animated flip\">
\t\t\t\t\tToggle navigation
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t</button>
\t\t\t\tenv->getExtension('routing')->getUrl("homepage");
        echo "\"> env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/img/f3e_logo2_6.png"), "html", null, true);
        echo "\" class=\"hidden-xs\"/>
\t\t\t\tCongés
\t\t\t\t
\t\t\t\t

\t\t\t

\t\t

\t\t

\t\t\t

 \t\t\t\t

\t\t\t\t\t

\t\t\t\t\t\t

\t\t\t\t\t\t\t

\t\t\t\t\t\t\t

\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t
Menu

\t\t\t\t\t\t\t\t
env->getExtension('routing')->getPath("homepage");
        echo "\"> Congés
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t";
        // line 122
        if ($this->env->getExtension('security')->isGranted("ROLE_ADMIN")) {
            // line 123
            echo "    \t\t\t\t\t\t\t
env->getExtension('routing')->getPath("validate");
            echo "\"> Congés à valider
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t
env->getExtension('routing')->getPath("user_list");
            echo "\"> Salarié-e-s
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t";
        }
        // line 128
        echo "\t\t\t\t\t\t\t

\t\t\t\t\t\t

\t\t\t\t\t

\t\t\t\t

\t\t\t\t

\t\t\t\t\t";
        // line 133
        $this->displayBlock('body', $context, $blocks);
        // line 134
        echo "\t\t\t\t

        \t

\t\t

";
    }

    // line 5
    public function block_title($context, array $blocks = array())
    {
        echo "F3E";
    }

    // line 6
    public function block_stylesheets($context, array $blocks = array())
    {
        // line 7
        echo "        <link id=\"bs-css\" href=\"";
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/bootstrap-united.min.css"), "html", null, true);
        echo "\" rel=\"stylesheet\">
\t\t<link href=\"";
        // line 8
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/charisma-app.css"), "html", null, true);
        echo "\" rel=\"stylesheet\">
\t\t<link href=\"";
        // line 9
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/fullcalendar/dist/fullcalendar.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 10
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/fullcalendar/dist/fullcalendar.print.css"), "html", null, true);
        echo "\" rel='stylesheet' media='print'>
\t\t<link href=\"";
        // line 11
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/chosen/chosen.min.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 12
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/colorbox/example3/colorbox.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 13
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/responsive-tables/responsive-tables.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 14
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 15
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/jquery.noty.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 16
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/noty_theme_default.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 17
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/elfinder.min.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 18
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/elfinder.theme.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 19
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/jquery.iphone.toggle.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 20
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/uploadify.css"), "html", null, true);
        echo "\" rel='stylesheet'>
\t\t<link href=\"";
        // line 21
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/animate.min.css"), "html", null, true);
        echo "\" rel='stylesheet'>
        <link href=\"";
        // line 22
        echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/public/css/jquery-ui.css"), "html", null, true);
        echo "\" rel='stylesheet'>

\t\t";
    }

    // line 41
    public function block_javascripts($context, array $blocks = array())
    {
    }

    // line 133
    public function block_body($context, array $blocks = array())
    {
    }

    public function getTemplateName()
    {
        return "base.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  328 => 133,  323 => 41,  316 => 22,  312 => 21,  308 => 20,  304 => 19,  300 => 18,  296 => 17,  292 => 16,  288 => 15,  284 => 14,  280 => 13,  276 => 12,  272 => 11,  268 => 10,  264 => 9,  260 => 8,  255 => 7,  252 => 6,  246 => 5,  231 => 134,  229 => 133,  222 => 128,  216 => 125,  210 => 123,  208 => 122,  203 => 120,  178 => 100,  167 => 92,  149 => 77,  144 => 75,  139 => 73,  134 => 71,  129 => 69,  124 => 67,  119 => 65,  114 => 63,  109 => 61,  104 => 59,  99 => 57,  94 => 55,  89 => 53,  85 => 52,  80 => 50,  75 => 48,  70 => 46,  66 => 45,  61 => 43,  58 => 42,  56 => 41,  48 => 36,  35 => 25,  33 => 6,  29 => 5,  23 => 1,);
    }
}


text:
from __future__ import unicode_literals
from datetime import timedelta

from core.analytics import ScheduledAnalytics
from mongoengine import Q

class ExpireTags(ScheduledAnalytics):

    default_values = {
        "frequency": timedelta(hours=12),
        "name": "ExpireTags",
        "description": "Expires tags in observables",
    }

    ACTS_ON = []  # act on all observables

    # TODO Use server-side JS filter
    CUSTOM_FILTER = Q(tags__not__size=0)  # filter only tagged elements

    EXPIRATION = timedelta(days=1)

    def bulk(self, observables):
        for o in observables:
            self.each(o)

    @staticmethod
    def each(obj):
        obj.expire_tags()


text:
.class Lcom/samsung/android/settings/wifi/WifiApDialogSec$7;
.super Ljava/lang/Object;
.source "WifiApDialogSec.java"

# interfaces
.implements Landroid/content/DialogInterface$OnCancelListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/samsung/android/settings/wifi/WifiApDialogSec;->showHideSsidWarningDialog()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/samsung/android/settings/wifi/WifiApDialogSec;

# direct methods
.method constructor <init>(Lcom/samsung/android/settings/wifi/WifiApDialogSec;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/settings/wifi/WifiApDialogSec$7;->this$0:Lcom/samsung/android/settings/wifi/WifiApDialogSec;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onCancel(Landroid/content/DialogInterface;)V
    .locals 2

    iget-object v0, p0, Lcom/samsung/android/settings/wifi/WifiApDialogSec$7;->this$0:Lcom/samsung/android/settings/wifi/WifiApDialogSec;

    invoke-static {v0}, Lcom/samsung/android/settings/wifi/WifiApDialogSec;->-get7(Lcom/samsung/android/settings/wifi/WifiApDialogSec;)Landroid/widget/CheckBox;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/widget/CheckBox;->setChecked(Z)V

    return-void
.end method


text:
import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-comp-1929',
  templateUrl: './comp-1929.component.html',
  styleUrls: ['./comp-1929.component.css']
})
export class Comp1929Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
<xml xmlns:o="urn:schemas-microsoft-com:office:office">
 <o:MainFile HRef="../SolverTableHelp.htm"/>
 <o:File HRef="themedata.thmx"/>
 <o:File HRef="colorschememapping.xml"/>
 <o:File HRef="filelist.xml"/>
</xml>


text:
package cs201.interfaces.agents.transit;

import cs201.helper.transit.BusRoute;
import cs201.interfaces.roles.transit.Passenger;

/**
 *
 * @author Brandon
 *
 */
public interface Bus extends Vehicle
{
	/**
	 * Signals that passenger is leaving
	 * @param p passenger leaving
	 */
	public void msgLeaving (Passenger p);

	/**
	 * Signals that passenger is staying
	 * @param p passenger staying
	 */
	public void msgStaying (Passenger p);

	/**
	 * Signals that passenger is boarding
	 * @param p passenger boarding
	 */
	public void msgDoneBoarding (Passenger p);

	/**
	 * Signals that passenger is not boarding
	 * @param p passenger not boarding
	 */
	public void msgNotBoarding(Passenger p);

	/**
	 * Gets the route of the bus
	 * @return bus route
	 */
	public BusRoute getRoute();
}


text:
package org.lilyproject.rowlog.api;

import org.lilyproject.util.ObjectUtils;

/**
 * A value object describing a subscription.
 */
public class RowLogSubscription implements Comparable<RowLogSubscription> {
    private final String rowLogId;
    private final String id;
    private final Type type;
    private final int maxTries;
    private final int orderNr;

    /**
     * The type of a subscription defines if the listeners of a subscription run locally (VM) or remote (Netty)
     */
    public enum Type {VM, Netty}

    /**
     * Constructor
     * @param rowLogId id of the rowlog to which the subscription belongs
     * @param id of the subscription
     * @param type
     * @param maxTries the number of tries that are allowed to process a message for this subscription before it is marked as problematic
     * @param orderNr a number defining the subscription's position between the other subscriptions of the rowlog
     */
    public RowLogSubscription(String rowLogId, String id, Type type, int maxTries, int orderNr) {
        this.rowLogId = rowLogId;
        this.id = id;
        this.type = type;
        this.maxTries = maxTries;
        this.orderNr = orderNr;
    }

    public String getRowLogId() {
        return rowLogId;
    }

    public String getId() {
        return id;
    }

    public Type getType() {
        return type;
    }

    public int getMaxTries() {
        return maxTries;
    }

    public int getOrderNr() {
        return orderNr;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((rowLogId == null) ? 0 : rowLogId.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + maxTries;
        result = prime * result + orderNr;
        result = prime * result + ((type == null) ? 0 : type.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        RowLogSubscription other = (RowLogSubscription) obj;
        if (!ObjectUtils.safeEquals(rowLogId, other.rowLogId))
            return false;
        if (!ObjectUtils.safeEquals(id, other.id))
            return false;
        if (maxTries != other.maxTries)
            return false;
        if (orderNr != other.orderNr)
            return false;
        if (!ObjectUtils.safeEquals(type, other.type))
            return false;
        return true;
    }

    public int compareTo(RowLogSubscription other) {
        return orderNr - other.orderNr;
    }
}


text:
/**
 *
 */
package gov.va.med.imaging.core.router.queue;

import java.io.Serializable;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * @author vhaiswbeckec
 *
 * A Terracotta compatible clusterable blocking queue.  Barring bugs, this is a drop-in for
 * java.util.concurrent.PriorityBlockingQueue with the exception that it does not derive from
 * the same parents as that class.
 *
 * From the javadoc for java.util.concurrent.PriorityBlockingQueue
 * An unbounded blocking queue that uses the same ordering rules as class PriorityQueue and
 * supplies blocking retrieval operations. While this queue is logically unbounded, attempted
 * additions may fail due to resource exhaustion (causing OutOfMemoryError). This class does
 * not permit null elements. A priority queue relying on natural ordering also does not permit
 * insertion of non-comparable objects (doing so results in ClassCastException).
 *
 * @See java.util.concurrent.PriorityBlockingQueue
 *
 */
public class ClusterablePriorityBlockingQueue<E>
extends PriorityQueue<E>
implements BlockingQueue<E>, Iterable<E>, Collection<E>, Queue<E>, Serializable
{
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	public ClusterablePriorityBlockingQueue()
	{
		super();
	}

	public ClusterablePriorityBlockingQueue(Collection<? extends E> c)
	{
		super(c);
	}

	public ClusterablePriorityBlockingQueue(int initialCapacity)
	{
		super(initialCapacity);
	}

	public ClusterablePriorityBlockingQueue(int initialCapacity, Comparator<? super E> comparator)
	{
		super(initialCapacity, comparator);
	}

	/* ============================================================================================
	 * Implementation of BlockingQueue methods
	 * A Queue that additionally supports operations that wait for the queue to become non-empty when
	 * retrieving an element, and wait for space to become available in the queue when storing an element.
	 *
	 * BlockingQueue methods come in four forms, with different ways of handling operations that cannot
	 * be satisfied immediately, but may be satisfied at some point in the future:
	 * one throws an exception,
	 * the second returns a special value (either null or false, depending on the operation),
	 * the third blocks the current thread indefinitely until the operation can succeed,
	 * and the fourth blocks for only a given maximum time limit before giving up.
	 * These methods are summarized in the following table:
	 *
	 * 				Throws exception	Special value		Blocks			Times out
	 * Insert		add(e)				offer(e)			put(e) 			offer(e, time, unit)
	 * Remove		remove()			poll()				take()			poll(time, unit)
	 * Examine		element()			peek()				not applicable	not applicable
	 *
	 * ============================================================================================ */

	/**
	 * Removes at most the given number of available elements from this queue and adds them to the given collection.
	 *
	 * @see java.util.concurrent.BlockingQueue#drainTo(java.util.Collection, int)
	 */
	@Override
	public synchronized int drainTo(Collection<? super E> c, int maxElements)
	{
		int count=0;
		for(; count < maxElements; ++count)
			try{ c.add(this.remove()); }
			catch(NoSuchElementException nseX){break;}

		return count;
	}

	/**
	 * Removes all available elements from this queue and adds them to the given collection.
	 *
	 * @see java.util.concurrent.BlockingQueue#drainTo(java.util.Collection)
	 */
	@Override
	public int drainTo(Collection<? super E> c)
	{
		return this.drainTo(c, Integer.MAX_VALUE);
	}

	/**
	 * Inserts the specified element into this queue if it is possible to do so immediately without
	 * violating capacity restrictions, returning true upon success and false if no space is currently available.
	 * This queue is of unlimited capacity so this method will always return true
	 * Equivalent to add(e)
	 *
	 * @see java.util.concurrent.BlockingQueue#offer(java.lang.Object)
	 */
	@Override
	public synchronized boolean offer(E e)
	{
		boolean result = super.offer(e);

		notifyAll();		// notify threads that may be waiting for a new item in the queue

		return result;
	}

	/* (non-Javadoc)
	 * @see java.util.concurrent.BlockingQueue#offer(java.lang.Object, long, java.util.concurrent.TimeUnit)
	 */
	@Override
	public boolean offer(E e, long timeout, TimeUnit unit)
	throws InterruptedException
	{
		return offer(e);
	}

	/* (non-Javadoc)
	 * @see java.util.concurrent.BlockingQueue#put(java.lang.Object)
	 */
	@Override
	public void put(E e)
	throws InterruptedException
	{
		offer(e);
	}

	/**
	 * Retrieves and removes the head of this queue, or returns null if this queue is empty
	 *
	 * @see java.util.concurrent.BlockingQueue#poll(long, java.util.concurrent.TimeUnit)
	 */
	@Override
	public synchronized E poll()
	{
		return super.poll();
	}

	/**
	 * Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary
	 * for an element to become available.
	 *
	 * @see java.util.concurrent.BlockingQueue#poll(long, java.util.concurrent.TimeUnit)
	 */
	@Override
	public E poll(long timeout, TimeUnit unit)
	throws InterruptedException
	{
		timeout = Math.max(timeout, 0);		// must be greater than or equal to 0

		long milliseconds = TimeUnit.MILLISECONDS.convert(timeout, unit);
		long expiration = System.currentTimeMillis() + milliseconds;

		E e = null;

		synchronized (this)
		{
			e = this.poll();
			while(e == null && System.currentTimeMillis() < expiration)
			{
				long wait = expiration - System.currentTimeMillis();
				wait = Math.max(0, wait);
				wait( wait );
				e = this.poll();
			}
		}

		return e;
	}

	/**
	 * Returns the number of additional elements that this queue can ideally (in the absence of memory or
	 * resource constraints) accept without blocking, or Integer.MAX_VALUE if there is no intrinsic limit.
	 *
	 * This implementation always returns Integer.MAX_VALUE
	 *
	 * @see java.util.concurrent.BlockingQueue#remainingCapacity()
	 */
	@Override
	public int remainingCapacity()
	{
		return Integer.MAX_VALUE;
	}

	/**
	 * Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
	 *
	 * @see java.util.concurrent.BlockingQueue#take()
	 */
	@Override
	public E take()
	throws InterruptedException
	{
		E e = null;

		synchronized (this)
		{
			for( e = this.poll(); e == null; e = this.poll())
				wait();
		}

		return e;
	}

	/**
	 * @see java.util.PriorityQueue#clear()
	 */
	@Override
	public synchronized void clear()
	{
		super.clear();
	}

	/**
	 * Removes a single instance of the specified element from this queue, if it is present.
	 * More formally, removes an element e such that o.equals(e), if this queue contains
	 * one or more such elements. Returns true if and only if this queue contained the specified
	 * element (or equivalently, if this queue changed as a result of the call).
	 *
	 * @see java.util.PriorityQueue#remove(java.lang.Object)
	 */
	@Override
	public synchronized boolean remove(Object o)
	{
		return super.remove(o);
	}

	/**
	 *
	 * @see java.util.PriorityQueue#toArray()
	 */
	@Override
	public synchronized Object[] toArray()
	{
		return super.toArray();
	}

	/**
	 * @see java.util.PriorityQueue#toArray(T[])
	 */
	@Override
	public synchronized <T> T[] toArray(T[] a)
	{
		return super.toArray(a);
	}

}


text:
import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { CookieService } from "angular2-cookie/services/cookies.service";

import { Config } from '../share/config';

@Injectable()
export class TagService {
  token: string;

  constructor(
    private http: Http,
    private _cookieService: CookieService
  ) {
    this.token = _cookieService.get('token');
  }

  getTags(): Observable<any> {
    let url = `${Config.apiAdminRoot}tag?token=${this.token}`;
    return this.http.get(url)
      .map(this.extraData)
      .catch(this.handleError);
  }

  getTagInfo(): Observable<any> {
    let url = `${Config.apiAdminRoot}taginfo?token=${this.token}`;
    return this.http.get(url)
      .map(this.extraData)
      .catch(this.handleError);
  }

  getPostNum(): Observable<any> {
    let url = `${Config.apiAdminRoot}postnum?token=${this.token}`;
    return this.http.get(url)
      .map(this.extraData)
      .catch(this.handleError);
  }

  addTag(tagDate): Observable<any> {
    let url = `${Config.apiAdminRoot}tag`;
    let body = JSON.stringify(tagDate);
    let headers = new Headers({'Content-Type': 'application/json'});
    headers.append('x-access-token',this.token);
    let options = new RequestOptions({headers: headers});

    return this.http.post(url, body, options)
      .map(this.extraData)
      .catch(this.handleError);
  }

  delTag(tagId): Observable<any> {
    let url = `${Config.apiAdminRoot}tag`;
    let data: any = {};
    if (tagId instanceof Array) {
      data = {
        id: tagId
      }
    } else {
      data = {
        id: [tagId.id]
      }
    }
    let body = JSON.stringify(data);
    let headers = new Headers({'Content-Type': 'application/json'});
    headers.append('x-access-token',this.token);
    let options = new RequestOptions({
      headers: headers,
      body: body
    });

    return this.http.delete(url, options)
      .map(this.extraData)
      .catch(this.handleError);
  }

  private extraData(res) {
    let body = res.json();
    return body || [];
  }

  private handleError (error) {
    let errMsg = (error.message) ? error.message : error.status ? `${error.status} - ${error.statusText}` : `Server error`;
    console.error(errMsg);
    if (error.status == 302) {
      alert('权限不足,请用管理员账户登录!');
      location.href = '/admin';
    }
    return Observable.throw(errMsg);
  }
}


text:
//  (C) Copyright Gennadiy Rozental 2011-2014.
//  Distributed under the Boost Software License, Version 1.0.
//  (See accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/test for the library home page.
//
//! @file
//! @brief Floating point comparison tolerance manipulators
//!
//! This file defines several manipulators for floating point comparison. These
//! manipulators are intended to be used with BOOST_TEST.
// ***************************************************************************

#ifndef BOOST_TEST_TOOLS_DETAIL_TOLERANCE_MANIP_HPP_012705GER
#define BOOST_TEST_TOOLS_DETAIL_TOLERANCE_MANIP_HPP_012705GER

// Boost Test
#include <boost/test/tools/detail/fwd.hpp>
#include <boost/test/tools/detail/indirections.hpp>

#include <boost/test/tools/fpc_tolerance.hpp>
#include <boost/test/tools/floating_point_comparison.hpp>

#include <boost/test/detail/suppress_warnings.hpp>

//____________________________________________________________________________//

namespace boost {
namespace test_tools {
namespace tt_detail {

// ************************************************************************** //
// **************           fpc tolerance manipulator          ************** //
// ************************************************************************** //

template<typename FPT>
struct tolerance_manip {
    explicit tolerance_manip( FPT const & tol ) : m_value( tol ) {}

    FPT m_value;
};

//____________________________________________________________________________//

struct tolerance_manip_delay {};

template<typename FPT>
inline tolerance_manip<FPT>
operator%( FPT v, tolerance_manip_delay const& )
{
    BOOST_STATIC_ASSERT_MSG( (fpc::tolerance_based<FPT>::value),
                             "tolerance only for floating points" );

    return tolerance_manip<FPT>( FPT(v / 100) );
}

//____________________________________________________________________________//

template<typename E, typename FPT>
inline assertion_result
operator<<(assertion_evaluate_t<E> const& ae, tolerance_manip<FPT> const& tol)
{
    local_fpc_tolerance<FPT> lt( tol.m_value );

    return ae.m_e.evaluate();
}

//____________________________________________________________________________//

template<typename FPT>
inline int
operator<<( unit_test::lazy_ostream const&, tolerance_manip<FPT> const& )   { return 0; }

//____________________________________________________________________________//

template<typename FPT>
inline check_type
operator<<( assertion_type const& /*at*/, tolerance_manip<FPT> const& )         { return CHECK_BUILT_ASSERTION; }

//____________________________________________________________________________//

} // namespace tt_detail

/*! Tolerance manipulator
 *
 * These functions return a manipulator that can be used in conjunction with BOOST_TEST
 * in order to specify the tolerance with which floating point comparisons are made.
 */
template<typename FPT>
inline tt_detail::tolerance_manip<FPT>
tolerance( FPT v )
{
    BOOST_STATIC_ASSERT_MSG( (fpc::tolerance_based<FPT>::value),
                             "tolerance only for floating points" );

    return tt_detail::tolerance_manip<FPT>( v );
}

//____________________________________________________________________________//

//! @overload tolerance( FPT v )
template<typename FPT>
inline tt_detail::tolerance_manip<FPT>
tolerance( fpc::percent_tolerance_t<FPT> v )
{
    BOOST_STATIC_ASSERT_MSG( (fpc::tolerance_based<FPT>::value),
                             "tolerance only for floating points" );

    return tt_detail::tolerance_manip<FPT>( static_cast<FPT>(v.m_value / 100) );
}

//____________________________________________________________________________//

//! @overload tolerance( FPT v )
inline tt_detail::tolerance_manip_delay
tolerance()
{
    return tt_detail::tolerance_manip_delay();
}

//____________________________________________________________________________//

} // namespace test_tools
} // namespace boost

#include <boost/test/detail/enable_warnings.hpp>

#endif // BOOST_TEST_TOOLS_DETAIL_TOLERANCE_MANIP_HPP_012705GER


text:
package com.github.codechapin.plugins;

import org.testng.Assert;
import org.testng.annotations.Test;

/**
 * Unit test for simple App.
 */
public class AppTest {

    /**
     * Rigourous Test :-)
     */
    @Test
    public void testApp() {
        Assert.assertTrue(true);
    }
}


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.codeInsight.hint;

import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.lookup.Lookup;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupManager;
import com.intellij.lang.Language;
import com.intellij.lang.parameterInfo.LanguageParameterInfo;
import com.intellij.lang.parameterInfo.ParameterInfoHandler;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.ui.LightweightHint;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.awt.*;
import java.util.Set;

public class ShowParameterInfoHandler implements CodeInsightActionHandler {
  private final boolean myRequestFocus;

  public ShowParameterInfoHandler() {
    this(false);
  }

  public ShowParameterInfoHandler(boolean requestFocus) {
    myRequestFocus = requestFocus;
  }

  @Override
  public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
    invoke(project, editor, file, -1, null, myRequestFocus);
  }

  @Override
  public boolean startInWriteAction() {
    return false;
  }

  /**
   * @deprecated use {@link #invoke(Project, Editor, PsiFile, int, PsiElement, boolean)} instead
   */
  @Deprecated
  public static void invoke(final Project project, final Editor editor, PsiFile file, int lbraceOffset, PsiElement highlightedElement) {
    invoke(project, editor, file, lbraceOffset, highlightedElement, false);
  }

  public static void invoke(final Project project, final Editor editor, PsiFile file,
                            int lbraceOffset, PsiElement highlightedElement, boolean requestFocus) {
    invoke(project, editor, file, lbraceOffset, highlightedElement, requestFocus, false);
  }

  public static void invoke(final Project project, final Editor editor, PsiFile file,
                            int lbraceOffset, PsiElement highlightedElement, boolean requestFocus, boolean singleParameterHint) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    PsiDocumentManager.getInstance(project).commitAllDocuments();

    final int offset = editor.getCaretModel().getOffset();
    final int fileLength = file.getTextLength();
    if (fileLength == 0) return;

    final ShowParameterInfoContext context = new ShowParameterInfoContext(
      editor,
      project,
      file,
      offset,
      lbraceOffset,
      requestFocus,
      singleParameterHint
    );

    context.setHighlightedElement(highlightedElement);
    context.setRequestFocus(requestFocus);

    // file.findElementAt(file.getTextLength()) returns null but we may need to show parameter info at EOF offset (for example in SQL)
    final int offsetForLangDetection = offset > 0 && offset == fileLength ? offset - 1 : offset;
    final Language language = PsiUtilCore.getLanguageAtOffset(file, offsetForLangDetection);
    ParameterInfoHandler[] handlers = getHandlers(project, language, file.getViewProvider().getBaseLanguage());
    if (handlers == null) handlers = new ParameterInfoHandler[0];

    Lookup lookup = LookupManager.getInstance(project).getActiveLookup();

    if (lookup != null) {
      LookupElement item = lookup.getCurrentItem();

      if (item != null) {
        for(ParameterInfoHandler handler:handlers) {
          if (handler.couldShowInLookup()) {
            final Object[] items = handler.getParametersForLookup(item, context);
            if (items != null && items.length > 0) {
              showLookupEditorHint(items, editor, handler, requestFocus);
            }
            return;
          }
        }
      }
      return;
    }

    DumbService.getInstance(project).setAlternativeResolveEnabled(true);
    try {
      for (ParameterInfoHandler<Object, ?> handler : handlers) {
        Object element = handler.findElementForParameterInfo(context);
        if (element != null) {
          handler.showParameterInfo(element, context);
        }
      }
    }
    finally {
      DumbService.getInstance(project).setAlternativeResolveEnabled(false);
    }
  }

  private static void showLookupEditorHint(Object[] descriptors,
                                           final Editor editor,
                                           ParameterInfoHandler handler,
                                           boolean requestFocus) {
    ParameterInfoComponent component = new ParameterInfoComponent(descriptors, editor, handler, requestFocus, false);
    component.update(false);

    final LightweightHint hint = new LightweightHint(component);
    hint.setSelectingHint(true);
    final HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl();
    final Pair<Point, Short> pos = ParameterInfoController.chooseBestHintPosition(editor, null, hint, HintManager.DEFAULT, true);
    ApplicationManager.getApplication().invokeLater(() -> {
      if (!editor.getComponent().isShowing()) return;
      hintManager.showEditorHint(hint, editor, pos.getFirst(),
                                 HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_LOOKUP_ITEM_CHANGE | HintManager.UPDATE_BY_SCROLLING,
                                 0, false, pos.getSecond());
    });
  }

  @Nullable
  public static ParameterInfoHandler[] getHandlers(Project project, final Language... languages) {
    Set<ParameterInfoHandler> handlers = new THashSet<>();
    for (final Language language : languages) {
      handlers.addAll(DumbService.getInstance(project).filterByDumbAwareness(LanguageParameterInfo.INSTANCE.allForLanguage(language)));
    }
    if (handlers.isEmpty()) return null;
    return handlers.toArray(new ParameterInfoHandler[0]);
  }
}


text:
title: "Remains of the Day"
layout: "post"
permalink: "/2013/01/remains-of-day.html"
uuid: "2595962543004693068"
guid: "tag:blogger.com,1999:blog-4897882164686544357.post-2595962543004693068"
date: "2013-01-22 18:30:00"
updated: "2013-01-22 18:30:01"
description:
blogger:
    siteid: "4897882164686544357"
    postid: "2595962543004693068"
    comments: "0"
categories: [anniversary, cherry stout, homebrew, pancakes, growler party, epic, remains, karben4, irish red, leftovers, amber, stout, fruit beer, wisconsin]
author: bradorego
---

        To celebrate my 1-year anniversary of leaving Epic (woo!), I've decided to start a tradition. It's actually partly due to my desire to bring beer to/from Buffalo/Madison on my trips home whenever possible. This most recent trip saw two growlers of the delicious Pearl Street Brewery beer coming to Madison. Of course, the 2nd thing I did with it was make pancakes, but I digress.

        What that party took form of was the First Annual Growler Party. What's a growler party, you ask? Well, you get a bunch of people together and they all bring a growler of their favorite beer (or something new to try). Bonus points go out to those with rare/out-of-area brews. The party was a smashing success with over 15 growlers in attendance representing at least 10 breweries across 3 states (and two homebrews! Thanks Alex and Matt!). Everyone had a great time, and I can't wait to grow this event in the future.

        But, of course as with any party, there were some leftovers and some casualties of war. Thus, I humbly present to you the Remains of the Day edition, featuring some leftover beer that didn't have a home by the end of the night. The beers in question are Karben4's Irish Red and Matt's brother-in-law's homebrewed Cherry Stout coming to us from Rochester, MN.

                        Yes, that's an open tallboy and a solo cup. Don't judge.

        Both of these beers, when true to their form, were delightful. The Irish Red was probably the darkest and most full-bodied beer of its type I've ever had, solidifying Karben4 as a standard go-to beer in the area, and the Cherry Stout balanced the possibly-too-sweet cherry flavors (I'm guessing extract) with the rich dark tones and aromas of the stout (did somebody say chocolate malt?).

        As one might imagine, though, the day after they were in rough shape. Both beers sat in open containers in the fridge from about midnight until Noon or so when I made these pancakes. That time in the air did a number on their carbonation, flavor, and freshness. Not that I'd expect much from day-old beer, but it was a little disappointing.

            Prep/Cooking:

                        The colors, Duke, the colors!

            The two batters both came out great colors. There's something about dark pancake batter that gets me all excited. The aroma of the Irish Red really came through in batter form which was slightly reassuring. The caramel tones really shone through and created a pleasant aroma. The cherry stout lost most of its cherry scent in batter form, but it did retain a bit of the stouty goodness.

            Results:

                        I still love the colors, though!

            This one's a tough call to make because I'm not sure how much of the outcome was due to the beer and how much was due to it being a day old. I wasn't about to waste good beer, so it's better than nothing, but basically the pancakes came out bland. Not bad, but just unimpressive and flavorless.

            Cherry Stout - 0. Don't bother. Drink it before it goes weird and enjoy the stouty cherry goodness

            Irish Red - 0, but I'd be willing to give it a shot with fresh beer. Karben4 makes good stuff.

            Syrup: 0 and 0. It really didn't help the flavor of the pancakes at all.

Have you ever made beer pancakes with last night's beer? Would you have the balls to pull it off, especially with a homebrew? Let's talk about it.


text:
namespace blink {

struct PaintInfo;
class LayoutPoint;
class RenderFileUploadControl;

class FileUploadControlPainter {
public:
    FileUploadControlPainter(RenderFileUploadControl& renderFileUploadControl) : m_renderFileUploadControl(renderFileUploadControl) { }

    void paintObject(PaintInfo&, const LayoutPoint&);

private:
    RenderFileUploadControl& m_renderFileUploadControl;
};

} // namespace blink

#endif // FileUploadControlPainter_h


text:
// <copyright file="Project.cs" company="Logikfabrik">
//   Copyright (c) 2016-2018 anton(at)logikfabrik.se. Licensed under the MIT license.
// </copyright>

namespace Logikfabrik.Overseer.WPF.Provider.TeamCity.Api.Models
{
    using System;

    /// <summary>
    /// The <see cref="Project" /> class.
    /// </summary>
    public class Project
    {
        /// <summary>
        /// Gets or sets the identifier.
        /// </summary>
        /// <value>
        /// The identifier.
        /// </value>
        public string Id { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the parent project identifier.
        /// </summary>
        /// <value>
        /// The parent project identifier.
        /// </value>
        public string ParentProjectId { get; set; }

        /// <summary>
        /// Gets or sets the href.
        /// </summary>
        /// <value>
        /// The href.
        /// </value>
        public string Href { get; set; }

        /// <summary>
        /// Gets or sets the web URL.
        /// </summary>
        /// <value>
        /// The web URL.
        /// </value>
        public Uri WebUrl { get; set; }
    }
}