text:
    {{ctrl.dataList.filter}}

Select all

Deselect all

                    Id
                    Is active
                    Balance
                    Age
                    Eye color
                    Name

                        <input name="record-item" type="checkbox" ng-value="row.id" ng-checked="row.$selected" ng-click="ctrl.dataList.toggle(row)" />

                    {{row.index}}
                    {{row.isActive}}
                    {{row.balance}}
                    {{row.age}}
                    {{row.eyeColor}}
                    {{row.name}}

redpajama_set_name: RedPajamaGithub


text: Repository for my configuration files


text:
namespace MassTransit
{
    using System;
    using Configuration;

    /// <summary>
    /// Configures the Consuming of a message type, allowing filters to be applied
    /// on Consume.
    /// </summary>
    /// <typeparam name="TMessage"></typeparam>
    public interface IMessageConsumeTopologyConfigurator<TMessage> :
        IMessageConsumeTopologyConfigurator,
        IMessageConsumeTopology<TMessage>
        where TMessage : class
    {
        /// <summary>
        /// Specify whether the broker topology should be configured for this message type
        /// (defaults to true)
        /// </summary>
        bool ConfigureConsumeTopology { get; set; }

        void Add(IMessageConsumeTopology<TMessage> consumeTopology);

        /// <summary>
        /// Adds a delegated configuration to the Consume topology, which is called before any topologies
        /// in this configuration.
        /// </summary>
        /// <param name="configuration"></param>
        void AddDelegate(IMessageConsumeTopology<TMessage> configuration);

        /// <summary>
        /// Adds a convention to the message Consume topology configuration, which can be modified
        /// </summary>
        /// <param name="convention"></param>
        bool TryAddConvention(IMessageConsumeTopologyConvention<TMessage> convention);

        /// <summary>
        /// Update a convention if available, otherwise, throw an exception
        /// </summary>
        /// <typeparam name="TConvention"></typeparam>
        /// <param name="update">Called if the convention already exists</param>
        /// <returns></returns>
        void UpdateConvention<TConvention>(Func<TConvention, TConvention> update)
            where TConvention : class, IMessageConsumeTopologyConvention<TMessage>;

        /// <summary>
        /// Returns the first convention that matches the interface type specified, to allow it to be customized
        /// and or replaced.
        /// </summary>
        /// <typeparam name="TConvention"></typeparam>
        /// <param name="add">Called if the convention does not already exist</param>
        /// <param name="update">Called if the convention already exists</param>
        /// <returns></returns>
        void AddOrUpdateConvention<TConvention>(Func<TConvention> add, Func<TConvention, TConvention> update)
            where TConvention : class, IMessageConsumeTopologyConvention<TMessage>;
    }

    public interface IMessageConsumeTopologyConfigurator :
        ISpecification
    {
        bool TryAddConvention(IConsumeTopologyConvention convention);
    }
}


text:
package drexel.cci.cs576.stable_priority_queue;

import org.junit.Test;

import junit.framework.TestCase;

public class TestStablePriorityQueue extends TestCase {

	@Test
	public void testInsertWithinSize() {
		PriorityQueue queue = new StablePriorityQueue(10);
		assertTrue(queue.insert(1));
		assertTrue(queue.insert(2));
		assertTrue(queue.insert(3));
		assertTrue(queue.insert(4));
		assertTrue(queue.insert(5));
		assertTrue(queue.insert(6));
		assertTrue(queue.insert(7));
		assertTrue(queue.insert(8));
		assertTrue(queue.insert(9));
		assertTrue(queue.insert(10));
	}

	@Test
	public void testInsertExceedSize() {
		PriorityQueue queue = new StablePriorityQueue(5);
		assertTrue(queue.insert(1));
		assertTrue(queue.insert(2));
		assertTrue(queue.insert(3));
		assertTrue(queue.insert(4));
		assertTrue(queue.insert(5));
		assertFalse(queue.insert(6));
		assertFalse(queue.insert(7));
		assertFalse(queue.insert(8));
		assertFalse(queue.insert(9));
		assertFalse(queue.insert(10));
	}

	@Test
	public void testPriorityWithoutDuplicate() {
		PriorityQueue queue = new StablePriorityQueue(10);
		for (int i = 0; i < 10; i++) {
			queue.insert(i);
		}
		for (int i = 9; i >= 0; i--) {
			assertEquals(i, queue.pop());
		}
	}

	// test wether it is stable
	@Test
	public void testPriorityWithDuplicate() {
		StablePriorityQueue queue = new StablePriorityQueue(10);
		for (int i = 0; i < 10; i++) {
			queue.insert(10);
		}
		for (int i = 9; i >= 0; i -= 2) {
			StablePriorityQueue.Node node1 = queue.popNode();
			StablePriorityQueue.Node node2 = queue.popNode();

			assertTrue(node1.age > node2.age);
		}
	}

	@Test
	public void testPeek() {
		PriorityQueue queue = new StablePriorityQueue(10);
		for (int i = 0; i < 10; i++) {
			queue.insert(i);
		}
		for (int i = 9; i >= 0; i--) {
			assertEquals(9, queue.peek());
		}
	}
}


text:
import json
import base64
import threading
import sys
import os
import urllib
import sublime
import sublime_plugin

class Pref:

    keys = [
        "show_debug",
        "jenkins_url",
        "username",
        "password",
    ]

    def load(self):
        self.settings = sublime.load_settings('jenkins-dashboard.sublime-settings')

        if sublime.active_window() is not None:
            project_settings = sublime.active_window().active_view().settings()
            if project_settings.has("jenkins-dashboard"):
                project_settings.clear_on_change('jenkins-dashboard')
                self.project_settings = project_settings.get('jenkins-dashboard')
                project_settings.add_on_change('jenkins-dashboard', pref.load)
            else:
                self.project_settings = {}
        else:
            self.project_settings = {}

        for key in self.keys:
            self.settings.clear_on_change(key)
            setattr(self, key, self.get_setting(key))
            self.settings.add_on_change(key, pref.load)

    def get_setting(self, key):
        if key in self.project_settings:
            return self.project_settings.get(key)
        else:
            return self.settings.get(key)

pref = Pref()

def plugin_loaded():
    pref.load()

def debug_message(msg):
    if pref.show_debug == True:
        print("[jenkins-dashboard] " + str(msg))

class Jenkins():
    """Jenkins Controller class"""
    def __init__(self):
        if pref.username and pref.password:
            self.auth = self.auth_headers(pref.username, pref.password)
        else :
            self.auth = None

    def auth_headers(self, username, password):
        '''Simple implementation of HTTP Basic Authentication.
        Returns the 'Authentication' header value.
        '''
        auth = '%s:%s' % (username, password)
        auth = auth.encode('utf-8')
        return b'Basic ' + base64.b64encode(auth)

    def get_response(self, uri):
        jenkins_url = pref.jenkins_url + uri
        debug_message("GET: " + jenkins_url)

        req = urllib.request.Request(jenkins_url)
        data = urllib.parse.urlencode({'token': 1}) # Config needed here
        data = data.encode('utf-8')

        if self.auth :
            req.add_header('Authorization', self.auth)

        response = urllib.request.urlopen(req, data)

        return response

    def get_dashboard(self):
        build_report = []
        try:
            response = self.get_response("/api/json")

            jenkins_dashboard = response.read().decode('utf-8')
            debug_message(jenkins_dashboard)
        except urllib.error.URLError as e:
            debug_message("HTTP Error: " + str(e.code))
            if e.code == 403:
                return [['Error', str(e.code) + ' Authentication required']]
            return [['Error', str(e.code)]]

        try:
            dashboard_json = json.loads(jenkins_dashboard)
        except:
            debug_message("Unable to parse the Jenkins json response")
            return build_report

        for job in dashboard_json['jobs']:
            if job['color'] == 'blue':
                build_report.append([job['name'], 'SUCCESS'])
            elif job['color'] == 'blue_anime':
                build_report.append([job['name'], 'SUCCESS - BUILDING'])
            elif job['color'] == 'yellow':
                build_report.append([job['name'], 'UNSTABLE'])
            elif job['color'] == 'yellow_anime':
                build_report.append([job['name'], 'UNSTABLE - BUILDING'])
            elif job['color'] == 'red':
                build_report.append([job['name'], 'FAILURE'])
            elif job['color'] == 'red_anime':
                build_report.append([job['name'], 'FAILURE - BUILDING'])
            elif job['color'] == 'aborted':
                build_report.append([job['name'], 'ABORTED'])
            elif job['color'] == 'aborted_anime':
                build_report.append([job['name'], 'ABORTED - BUILDING'])
            elif job['color'] == 'disabled':
                build_report.append([job['name'], 'DISABLED'])
            elif job['color'] == 'notbuilt':
                build_report.append([job['name'], 'NO BUILDS'])
            else:
                build_report.append([job['name'], 'UNKNOWN'])

        return build_report

    def build_job(self, jobName):
        try:
            response = self.get_response("/job/" + jobName + "/build")
            debug_message("HTTP Status Code: " + str(response.status))
            return True
        except urllib.error.URLError as e:
            debug_message("HTTP Status Code: " + str(e.code) + "\nHTTP Status Reason: " + e.reason)
            return False

    def get_job_report(self, jobName):
        try:
            response = self.get_response("/job/" + jobName + "/api/json")
            data = json.loads(response.read().decode('utf-8'))
            return data
        except urllib.error.URLError as e:
            return str(e.reason)

    def get_last_job(self, jobName):
        try:
            response = self.get_response("/job/" + jobName + "/lastBuild/api/json")
            data = json.loads(response.read().decode('utf-8'))
            return data
        except urllib.error.URLError as e:
            return "HTTP Status Code: " + str(e.code) + "\nHTTP Status Reason: " + e.reason

    def get_last_output(self, jobName):
        try:
            response = self.get_response("/job/" + jobName + "/lastBuild/consoleText")
            data = str(response.read().decode('utf-8'))
            return data
        except urllib.error.URLError as e:
            return "HTTP Status Code: " + str(e.code) + "\nHTTP Status Reason: " + e.reason

class BaseJenkinsDashboardCommand(sublime_plugin.TextCommand):
    """Base command class for Jenkins Dashboard"""
    description = ''

    def run(self, args):
        debug_message('Not implemented')

    def show_quick_panel(self, data):
        self.view.window().show_quick_panel(data, self.on_quick_panel_done)

    def on_quick_panel_done(self, picked):
        debug_message('Not implemented')
        return

    def render_jenkins_information(self, output):
        view = self.view.window().new_file()
        view.run_command('clear')
        content = 'Job: ' +  output.get('name') + '\n\n'
        content += json.dumps(output, indent=4, separators=(',', ': '))

        view.run_command('output', {'console_output': content})

class ShowJenkinsDashboardCommand(BaseJenkinsDashboardCommand):
    """Show the Jenkins Dashboard"""
    description = 'Show Jenkins Dashboard ...'
    build_report = []

    def is_enabled(self):
        if pref.jenkins_url != "":
            return True
        else:
            return False

    def run(self, args):
        cmd = Jenkins()
        self.build_report = cmd.get_dashboard()
        self.show_quick_panel(self.build_report)

    def on_quick_panel_done(self, picked):
        if picked == -1:
            return

        job = self.build_report[picked][0]
        cmd = Jenkins()
        job_report = cmd.get_job_report(job)
        debug_message(job_report);
        self.render_jenkins_information(job_report)
        return

class BuildJenkinsJobCommand(BaseJenkinsDashboardCommand):
    """Show Jenkins Jobs and then build the one selected"""
    description = 'Build Jenkins Job ...'

    def is_enabled(self):
        if pref.jenkins_url != "":
            return True
        else:
            return False

    def run(self, args):
        cmd = Jenkins()
        self.build_report = cmd.get_dashboard()
        self.show_quick_panel(self.build_report)

    def on_quick_panel_done(self, p):
        if p == -1:
            return

        cmd = Jenkins()
        picked = self.build_report[p][0]

        if picked == 'Error':
            debug_message(picked)
            return

        prevJob = cmd.get_last_job(picked) # to check if new job was started
        is_building = cmd.build_job(picked)

        view = self.view.window().new_file()
        if is_building:
            self.numberOfTries = 20
            self.output(view, cmd, picked, prevJob.get('number'))
        else:
            view.run_command('output', {'console_output': 'Something went wrong, you can debug it with setting "show_debug" to true'})
        return

    def output(self, view, cmd, picked, prevJobNumber=None, **args):
        job = cmd.get_last_job(picked)
        if job.get('number') == prevJobNumber:
            # job don't start yet
            view.run_command('clear')
            if not hasattr(self, 'dots') or self.dots == '...':
                self.dots = ''
            self.dots += '.'
            view.run_command('output', {'console_output': 'Waiting for the job to build' + self.dots})
            self.numberOfTries -= 1
            if self.numberOfTries == 0:
                view.run_command('clear')
                view.run_command('output', {'console_output': 'Something went wrong, the job cannot start'})
                return
            threading.Timer(1, self.output, [view, cmd, picked, prevJobNumber]).start()

            return

        if prevJobNumber:
            view.run_command('clear')

        console_output = cmd.get_last_output(picked)
        content = 'Job: ' + job.get('fullDisplayName') + '\n\n' + console_output

        debug_message(job.get('fullDisplayName') + " build status: " + str(job.get('building')) + "\n")

        if job.get('building'):
            threading.Timer(1, self.output, [view, cmd, picked]).start()
        else:
            content = content + '\n\nDone with ' + job.get('result')

        view.run_command('output', {'console_output': content})

class OutputCommand(sublime_plugin.TextCommand):
    def run(self, edit, **args):
        sizeBefore = self.view.size()
        self.view.insert(edit, sizeBefore, args.get('console_output')[sizeBefore:])
        self.view.show(self.view.size())

class ClearCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        sizeBefore = self.view.size()
        self.view.erase(edit, sublime.Region(0, sizeBefore))


text:
<!DOCTYPE html>

    <title>JVFlowerMenuDelegate Protocol Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

JVFlowerMenu Docs (100% documented)

        JVFlowerMenu Reference

        JVFlowerMenuDelegate Protocol Reference

            Classes

                JVFlowerMenu

                Pedal

            Protocols

                JVFlowerMenuDelegate

JVFlowerMenuDelegate

public protocol JVFlowerMenuDelegate

Delegate declaration for the delegate property of a JVFlower menu.

                    flowerMenuDidSelectPedalWithID(_:pedal:)

Delegate function that gets called when a Pedal of a JVFlowerMenu gets tapped.

Parameters:

theMenu: The JVFlowerMenu that had one of its Pedal’s tapped.

pedal: The Pedal that was tapped.

Declaration

Swift

func flowerMenuDidSelectPedalWithID(_ theMenu: JVFlowerMenu, pedal: Pedal)

Parameters

                                theMenu

The JVFlowerMenu that had one of its Pedal's tapped.

                                pedal

The Pedal that was tapped.

                    flowerMenuDidExpand()

Delegate function that gets called when the JVFlowerMenu expands. Expansion happens when the user taps the JVFlowerMenu and it is not currently expanded.

Declaration

Swift

func flowerMenuDidExpand()

                    flowerMenuDidRetract()

Delegate function that gets called when the JVFlowerMenu collapses. The JVFlowerMenu collapses when the user taps it and it is currently expanded.

Declaration

Swift

func flowerMenuDidRetract()

© 2017 pebblebee. All rights reserved. (Last updated: 2017-01-27)

Generated by jazzy ♪♫ v0.7.3, a Realm project.


text:
package org.pcj;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * File representing list of available nodes (eg. from scheduling system).
 *
 * <b>This is only a fake class for
 * {@link PCJ#start(Class, NodesDescription)}
 * and
 * {@link PCJ#hashCode()}
 * deprecated methods.</b>
 *
 * @author Marek Nowicki (faramir@mat.umk.pl)
 * @deprecated use {@link PCJ#executionBuilder(Class)} instead
 */
@Deprecated(forRemoval = true)
public class NodesDescription {

    private final String[] nodes;

    /**
     * Create new nodes description using file.
     *
     * @param nodeFile name of file
     * @throws IOException I/O error
     */
    public NodesDescription(String nodeFile) throws IOException {
        this(new File(nodeFile));
    }

    /**
     * Create new nodes description using file.
     *
     * @param nodeFile file
     * @throws IOException I/O error
     */
    public NodesDescription(File nodeFile) throws IOException {
        try (BufferedReader br = new BufferedReader(new FileReader(nodeFile))) {
            this.nodes = br.lines()
                                 .map(String::trim)
                                 .filter(line -> !line.isEmpty())
                                 .toArray(String[]::new);
        }

    }

    /**
     * Creates new nodes description using nodes from the String array.
     *
     * @param nodes String nodes array
     */
    public NodesDescription(String[] nodes) {
        this.nodes = nodes;
    }

    protected String[] getNodes() {
        return nodes;
    }

//    /**
//     * Always throws exception.
//     *
//     * @throws UnsupportedOperationException
//     */
//    public NodeInfo getNode0() {
//        throw new UnsupportedOperationException("Deprecated. For removal.");
//    }
//
//    /**
//     * Always throws exception.
//     *
//     * @throws UnsupportedOperationException
//     */
//    public NodeInfo getCurrentJvm() {
//        throw new UnsupportedOperationException("Deprecated. For removal.");
//    }
//
//    /**
//     * Always throws exception.
//     *
//     * @throws UnsupportedOperationException
//     */
//    public Collection<NodeInfo> getAllNodes() {
//        throw new UnsupportedOperationException("Deprecated. For removal.");
//    }
//
//    /**
//     * Always throws exception.
//     *
//     * @throws UnsupportedOperationException
//     */
//    public int getAllNodesThreadCount() {
//        throw new UnsupportedOperationException("Deprecated. For removal.");
//    }
}


text:
<?php

namespace Composer\Test\Repository\Vcs;

use Composer\Config;
use Composer\Repository\Vcs\GitBitbucketDriver;
use Composer\TestCase;
use Composer\Util\Filesystem;

/**
 * @group bitbucket
 */
class GitBitbucketDriverTest extends TestCase
{
    /** @type \Composer\IO\IOInterface|\PHPUnit_Framework_MockObject_MockObject */
    private $io;
    /** @type \Composer\Config */
    private $config;
    /** @type \Composer\Util\RemoteFilesystem|\PHPUnit_Framework_MockObject_MockObject */
    private $rfs;
    /** @type string */
    private $home;
    /** @type string */
    private $originUrl = 'bitbucket.org';

    protected function setUp()
    {
        $this->io = $this->getMock('Composer\IO\IOInterface');

        $this->home = $this->getUniqueTmpDirectory();

        $this->config = new Config();
        $this->config->merge(array(
            'config' => array(
                'home' => $this->home,
            ),
        ));

        $this->rfs = $this->getMockBuilder('Composer\Util\RemoteFilesystem')
            ->disableOriginalConstructor()
            ->getMock();
    }

    public function tearDown()
    {
        $fs = new Filesystem;
        $fs->removeDirectory($this->home);
    }

    /**
     * @param  array              $repoConfig
     * @return GitBitbucketDriver
     */
    private function getDriver(array $repoConfig)
    {
        $driver = new GitBitbucketDriver(
            $repoConfig,
            $this->io,
            $this->config,
            null,
            $this->rfs
        );

        $driver->initialize();

        return $driver;
    }

    public function testGetRootIdentifierWrongScmType()
    {
        $this->setExpectedException(
            '\RuntimeException',
            'https://bitbucket.org/user/repo.git does not appear to be a git repository, use https://bitbucket.org/user/repo if this is a mercurial bitbucket repository'
        );

        $this->rfs->expects($this->once())
            ->method('getContents')
            ->with(
                $this->originUrl,
                'https://api.bitbucket.org/2.0/repositories/user/repo?fields=-project%2C-owner',
                false
            )
            ->willReturn(
                '{"scm":"hg","website":"","has_wiki":false,"name":"repo","links":{"branches":{"href":"https:\/\/api.bitbucket.org\/2.0\/repositories\/user\/repo\/refs\/branches"},"tags":{"href":"https:\/\/api.bitbucket.org\/2.0\/repositories\/user\/repo\/refs\/tags"},"clone":[{"href":"https:\/\/user@bitbucket.org\/user\/repo","name":"https"},{"href":"ssh:\/\/hg@bitbucket.org\/user\/repo","name":"ssh"}],"html":{"href":"https:\/\/bitbucket.org\/user\/repo"}},"language":"php","created_on":"2015-02-18T16:22:24.688+00:00","updated_on":"2016-05-17T13:20:21.993+00:00","is_private":true,"has_issues":false}'
            );

        $driver = $this->getDriver(array('url' => 'https://bitbucket.org/user/repo.git'));

        $driver->getRootIdentifier();
    }

    public function testDriver()
    {
        $driver = $this->getDriver(array('url' => 'https://bitbucket.org/user/repo.git'));

        $this->rfs->expects($this->any())
            ->method('getContents')
            ->withConsecutive(
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/2.0/repositories/user/repo?fields=-project%2C-owner',
                    false,
                ),
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/1.0/repositories/user/repo/main-branch',
                    false,
                ),
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/2.0/repositories/user/repo/refs/tags?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext&sort=-target.date',
                    false,
                ),
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/2.0/repositories/user/repo/refs/branches?pagelen=100&fields=values.name%2Cvalues.target.hash%2Cnext&sort=-target.date',
                    false,
                ),
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/1.0/repositories/user/repo/raw/master/composer.json',
                    false,
                ),
                array(
                    $this->originUrl,
                    'https://api.bitbucket.org/2.0/repositories/user/repo/commit/master?fields=date',
                    false,
                )
            )
            ->willReturnOnConsecutiveCalls(
                '{"scm":"git","website":"","has_wiki":false,"name":"repo","links":{"branches":{"href":"https:\/\/api.bitbucket.org\/2.0\/repositories\/user\/repo\/refs\/branches"},"tags":{"href":"https:\/\/api.bitbucket.org\/2.0\/repositories\/user\/repo\/refs\/tags"},"clone":[{"href":"https:\/\/user@bitbucket.org\/user\/repo.git","name":"https"},{"href":"ssh:\/\/git@bitbucket.org\/user\/repo.git","name":"ssh"}],"html":{"href":"https:\/\/bitbucket.org\/user\/repo"}},"language":"php","created_on":"2015-02-18T16:22:24.688+00:00","updated_on":"2016-05-17T13:20:21.993+00:00","is_private":true,"has_issues":false}',
                '{"name": "master"}',
                '{"values":[{"name":"1.0.1","target":{"hash":"9b78a3932143497c519e49b8241083838c8ff8a1"}},{"name":"1.0.0","target":{"hash":"d3393d514318a9267d2f8ebbf463a9aaa389f8eb"}}]}',
                '{"values":[{"name":"master","target":{"hash":"937992d19d72b5116c3e8c4a04f960e5fa270b22"}}]}',
                '{"name": "user/repo","description": "test repo","license": "GPL","authors": [{"name": "Name","email": "local@domain.tld"}],"require": {"creator/package": "^1.0"},"require-dev": {"phpunit/phpunit": "~4.8"}}',
                '{"date": "2016-05-17T13:19:52+00:00"}'
            );

        $this->assertEquals(
            'master',
            $driver->getRootIdentifier()
        );

        $this->assertEquals(
            array(
                '1.0.1' => '9b78a3932143497c519e49b8241083838c8ff8a1',
                '1.0.0' => 'd3393d514318a9267d2f8ebbf463a9aaa389f8eb',
            ),
            $driver->getTags()
        );

        $this->assertEquals(
            array(
                'master' => '937992d19d72b5116c3e8c4a04f960e5fa270b22',
            ),
            $driver->getBranches()
        );

        $this->assertEquals(
            array(
                'name' => 'user/repo',
                'description' => 'test repo',
                'license' => 'GPL',
                'authors' => array(
                    array(
                        'name' => 'Name',
                        'email' => 'local@domain.tld',
                    ),
                ),
                'require' => array(
                    'creator/package' => '^1.0',
                ),
                'require-dev' => array(
                    'phpunit/phpunit' => '~4.8',
                ),
                'time' => '2016-05-17 13:19:52',
                'support' => array(
                    'source' => 'https://bitbucket.org/user/repo/src/937992d19d72b5116c3e8c4a04f960e5fa270b22/?at=master',
                ),
                'homepage' => 'https://bitbucket.org/user/repo',
            ),
            $driver->getComposerInformation('master')
        );

        return $driver;
    }

    /**
     * @depends testDriver
     * @param \Composer\Repository\Vcs\VcsDriverInterface $driver
     */
    public function testGetParams($driver)
    {
        $url = 'https://bitbucket.org/user/repo.git';

        $this->assertEquals($url, $driver->getUrl());

        $this->assertEquals(
            array(
                'type' => 'zip',
                'url' => 'https://bitbucket.org/user/repo/get/reference.zip',
                'reference' => 'reference',
                'shasum' => '',
            ),
            $driver->getDist('reference')
        );

        $this->assertEquals(
            array('type' => 'git', 'url' => $url, 'reference' => 'reference'),
            $driver->getSource('reference')
        );
    }

    public function testSupports()
    {
        $this->assertTrue(
            GitBitbucketDriver::supports($this->io, $this->config, 'https://bitbucket.org/user/repo.git')
        );

        $this->assertFalse(
            GitBitbucketDriver::supports($this->io, $this->config, 'git@bitbucket.org:user/repo.git')
        );

        $this->assertFalse(
            GitBitbucketDriver::supports($this->io, $this->config, 'https://github.com/user/repo.git')
        );
    }
}


text:
class MipMap2DSample : public SampleApplication
{
  public:
    MipMap2DSample::MipMap2DSample()
        : SampleApplication("MipMap2D", 1280, 720)
    {
    }

    virtual bool initialize()
    {
        const std::string vs = SHADER_SOURCE
        (
            uniform float u_offset;
            attribute vec4 a_position;
            attribute vec2 a_texCoord;
            varying vec2 v_texCoord;
            void main()
            {
                gl_Position = a_position;
                gl_Position.x += u_offset;
                v_texCoord = a_texCoord;
            }
        );

        const std::string fs = SHADER_SOURCE
        (
            precision mediump float;
            varying vec2 v_texCoord;
            uniform sampler2D s_texture;
            void main()
            {
                gl_FragColor = texture2D(s_texture, v_texCoord);
            }
        );

        mProgram = CompileProgram(vs, fs);
        if (!mProgram)
        {
            return false;
        }

        // Get the attribute locations
        mPositionLoc = glGetAttribLocation(mProgram, "a_position");
        mTexCoordLoc = glGetAttribLocation(mProgram, "a_texCoord");

        // Get the sampler location
        mSamplerLoc = glGetUniformLocation(mProgram, "s_texture");

        // Get the offset location
        mOffsetLoc = glGetUniformLocation(mProgram, "u_offset");

        // Load the texture
        mTextureID = CreateMipMappedTexture2D();

        // Check Anisotropy limits
        glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &mMaxAnisotropy);

        glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

        return true;
    }

    virtual void destroy()
    {
        glDeleteProgram(mProgram);
        glDeleteTextures(1, &mTextureID);
    }

    virtual void draw()
    {
        const GLfloat vertices[] =
        {
            -0.25f,  0.5f, 0.0f, 5.0f, // Position 0
             0.0f,  0.0f,              // TexCoord 0
            -0.25f, -0.5f, 0.0f, 1.0f, // Position 1
             0.0f,  1.0f,              // TexCoord 1
             0.25f, -0.5f, 0.0f, 1.0f, // Position 2
             1.0f,  1.0f,              // TexCoord 2
             0.25f,  0.5f, 0.0f, 5.0f, // Position 3
             1.0f,  0.0f               // TexCoord 3
        };
        const GLushort indices[] = { 0, 1, 2, 0, 2, 3 };

        // Set the viewport
        glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());

        // Clear the color buffer
        glClear(GL_COLOR_BUFFER_BIT);

        // Use the program object
        glUseProgram(mProgram);

        // Load the vertex position
        glVertexAttribPointer(mPositionLoc, 4, GL_FLOAT,  GL_FALSE, 6 * sizeof(GLfloat), vertices);
        // Load the texture coordinate
        glVertexAttribPointer(mTexCoordLoc, 2, GL_FLOAT, GL_FALSE, 6 * sizeof(GLfloat), vertices + 4);

        glEnableVertexAttribArray(mPositionLoc);
        glEnableVertexAttribArray(mTexCoordLoc);

        // Bind the texture
        glActiveTexture(GL_TEXTURE0);
        glBindTexture(GL_TEXTURE_2D, mTextureID);

        // Set the sampler texture unit to 0
        glUniform1i(mSamplerLoc, 0);

        // Draw quad with nearest sampling
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
        glUniform1f(mOffsetLoc, -0.6f);
        glDrawElements ( GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);

        // Draw quad with trilinear filtering
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
        glUniform1f(mOffsetLoc, 0.0f);
        glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);

        // Draw quad with anisotropic filtering
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, mMaxAnisotropy);
        glUniform1f(mOffsetLoc, 0.6f);
        glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f);
    }

  private:
    // Handle to a program object
    GLuint mProgram;

    // Attribute locations
    GLint mPositionLoc;
    GLint mTexCoordLoc;

    // Sampler location
    GLint mSamplerLoc;

    // Offset location
    GLint mOffsetLoc;

    // Texture handle
    GLuint mTextureID;

    float mMaxAnisotropy;
};

int main(int argc, char **argv)
{
    MipMap2DSample app;
    return app.run();
}


text:
package org.kiji.schema.layout;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import org.apache.avro.Schema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.kiji.annotations.ApiAudience;
import org.kiji.schema.InternalKijiError;
import org.kiji.schema.Kiji;
import org.kiji.schema.KijiColumnName;
import org.kiji.schema.KijiSchemaTable;
import org.kiji.schema.NoSuchColumnException;
import org.kiji.schema.avro.AvroSchema;
import org.kiji.schema.avro.AvroValidationPolicy;
import org.kiji.schema.avro.CellSchema;
import org.kiji.schema.avro.ColumnDesc;
import org.kiji.schema.avro.FamilyDesc;
import org.kiji.schema.avro.LocalityGroupDesc;
import org.kiji.schema.avro.SchemaStorage;
import org.kiji.schema.avro.SchemaType;
import org.kiji.schema.avro.TableLayoutDesc;
import org.kiji.schema.impl.Versions;
import org.kiji.schema.util.ProtocolVersion;

/**
 * An experimental table layout builder class.
 * Currently manipulates reader, writer, and written schemas.
 *
 *
 Normalizes table layout descriptors with schema IDs only instead of JSON descriptions.

 */
@ApiAudience.Private
public final class TableLayoutBuilder {
  private static final Logger LOG = LoggerFactory.getLogger(TableLayoutBuilder.class);

  /** Table layout descriptor builder backing this TableLayoutBuilder. */
  private final TableLayoutDesc.Builder mDescBuilder;

  /** Table to resolve Avro schemas. */
  private final KijiSchemaTable mSchemaTable;

  /** Function that resolves AvroSchema to Schema objects against the specified Kiji instance. */
  private final AvroSchemaResolver mSchemaResolver;

  /**
   * Initializes a layout builder with no reference layout.
   *
   * @param schemaTable Table to resolve Avro schemas.
   * @throws IOException on I/O error.
   */
  public TableLayoutBuilder(KijiSchemaTable schemaTable) throws IOException {
    mSchemaTable = schemaTable;
    mSchemaResolver = new SchemaTableAvroResolver(schemaTable);
    mDescBuilder = null;
  }

  /**
   * Initializes a new layout builder from an existing reference layout.
   *
   *

   *   Automatically sets a new layout ID computed from the reference layout ID.
   *   Normalizes Avro schemas to use schema UIDs only.
   *

   *
   * @param tableLayoutDesc to build with
   * @param kiji the instance in which to configure schemas
   * @throws IOException on I/O error.
   *     In particular, throws InvalidLayoutException if validation is not supported.
   */
  public TableLayoutBuilder(TableLayoutDesc tableLayoutDesc, Kiji kiji)
      throws IOException {
    final ProtocolVersion layoutVersion = ProtocolVersion.parse(tableLayoutDesc.getVersion());
    if (Versions.LAYOUT_VALIDATION_VERSION.compareTo(layoutVersion) > 0) {
      throw new InvalidLayoutException("Schema validation is available from "
          + Versions.LAYOUT_VALIDATION_VERSION + " and up; this layout is " + layoutVersion);
    }
    mSchemaTable = kiji.getSchemaTable();
    mSchemaResolver = new SchemaTableAvroResolver(mSchemaTable);
    mDescBuilder = TableLayoutDesc.newBuilder(tableLayoutDesc)
        .setReferenceLayout(tableLayoutDesc.getLayoutId())
        .setLayoutId(nextLayoutId(tableLayoutDesc.getLayoutId()));

    // Normalize table layout to use schema UIDs only:
    normalizeTableLayoutDesc(
        mDescBuilder,
        new LayoutOptions()
            .setSchemaFormat(LayoutOptions.SchemaFormat.UID));
  }

  /**
   * Return the corresponding mutable family descriptor of the provided column family.
   * The family descriptor comes from a nested record within the mutable table layout descriptor.
   * Therefore, mutating this family descriptor effectively mutates the table layout descriptor.
   *
   * @param family whole family descriptor to extract
   * @return the family descriptor
   * @throws NoSuchColumnException when family not found
   */
  private FamilyDesc getFamilyDesc(final KijiColumnName family) throws NoSuchColumnException {
    // Traverse through the locality groups to locate family.
    for (LocalityGroupDesc lgd : mDescBuilder.getLocalityGroups()) {
      for (FamilyDesc fd : lgd.getFamilies()) {
        if (fd.getName().equals(family.getFamily())) {
          return fd;
        }
        for (String alias : fd.getAliases()) {
          if (alias.equals(family.getFamily())) {
            return fd;
          }
        }
      }
    }

    throw new NoSuchColumnException(String.format(
        "Table '%s' has no family '%s'.", mDescBuilder.getName(), family.getFamily()));
  }
  /**
   * Return the corresponding mutable cell schema of the provided primary column name.
   * The cell schema comes from a deeply nested record within the mutable table layout descriptor.
   * Therefore, mutating this cell schema effectively mutates the table layout descriptor.
   *
   * @param columnName whose cell schema to extract
   * @return cell schema or null if the column does not exist
   * @throws NoSuchColumnException when column not found
   * @throws InvalidLayoutException when invalid column name is provided
   */
  private CellSchema getColumnSchema(final KijiColumnName columnName)
      throws NoSuchColumnException, InvalidLayoutException {
    final boolean groupType = columnName.isFullyQualified();

    // Get the family descriptor.
    final FamilyDesc soughtFd = getFamilyDesc(columnName);

    // If map type, return map schema.
    if (null != soughtFd.getMapSchema()) {
      if (groupType) {
        throw new InvalidLayoutException("A fully qualified map-type column name was provided.");
      } else {
        return soughtFd.getMapSchema();
      }
    }

    // Examine group type columns to return group type column schema.
    for (ColumnDesc cd : soughtFd.getColumns()) {
      if (cd.getName().equals(columnName.getQualifier())) {
        return cd.getColumnSchema();
      } else {
        for (String alias : cd.getAliases()) {
          if (alias.equals(columnName.getQualifier())) {
            return cd.getColumnSchema();
          }
        }
      }
    }

    throw new NoSuchColumnException(String.format(
        "Table '%s' has no column '%s'.", mDescBuilder.getName(), columnName));
  }

  /**
   * Returns a mutable list of registered schemas (READER, WRITER, WRITTEN) of the provided column.
   *
   *

   *   The list of schemas comes from a deeply nested record within the mutable table layout
   *   descriptor. Therefore, mutating this list effectively mutates the table layout descriptor.
   *

   *
   * @param columnName whose schema ids to list
   * @param schemaRegistrationType of the schemas to list: (READER, WRITER, WRITTEN).
   * @return The list of schema ids.
   *         Returns empty list if schema validation was not previously enabled.
   * @throws NoSuchColumnException when column not found
   * @throws InvalidLayoutException if the column is final or non-AVRO
   */
  private List<AvroSchema> getMutableRegisteredSchemaList(
      final KijiColumnName columnName,
      final SchemaRegistrationType schemaRegistrationType)
      throws NoSuchColumnException, InvalidLayoutException {
    Preconditions.checkNotNull(columnName);
    Preconditions.checkNotNull(schemaRegistrationType);

    final CellSchema cellSchema = getColumnSchema(columnName);

    // Avoid tracking schemas final or non-AVRO cells.
    if ((SchemaType.AVRO != cellSchema.getType())
        || (SchemaStorage.FINAL == cellSchema.getStorage())) {
      throw new InvalidLayoutException("Final or non-AVRO column schema cannot be modified.");
    }

    final String fieldName = schemaRegistrationType.getCellSchemaFieldName();
    return (List<AvroSchema>) Preconditions.checkNotNull(cellSchema.get(fieldName));
  }

  /**
   * Distinguish reader, writer, and written schema "registration types".
   */
  private static enum SchemaRegistrationType {
    READER("readers"),
    WRITER("writers"),
    WRITTEN("written");

    /**
     * Returns the CellSchema field name this registration type maps to.
     * @return the CellSchema field name this registration type maps to.
     */
    public String getCellSchemaFieldName() {
      return mCellSchemaFieldName;
    }

    /** Name of the CellSchema field this registration type maps to. */
    private final String mCellSchemaFieldName;

    /**
     * Constructs a registration type with the specified associated CellSchema field name.
     *
     * @param fieldName CellSchema field name to associate to this registration type.
     */
    SchemaRegistrationType(String fieldName) {
      mCellSchemaFieldName = fieldName;
    }
  }

  /**
   * Register a (READER | WRITER | WRITTEN) schema to a column.
   *
   *
 The Schema is added even if it already exists.

   *
   * @param columnName at which to register the schema.
   * @param schema to register.
   * @param schemaRegistrationType of the schema to register: (READER, WRITER, WRITTEN).
   * @throws IOException If the parameters are invalid.
   * @return this builder.
   */
  private TableLayoutBuilder withSchema(
      final KijiColumnName columnName,
      final Schema schema,
      final SchemaRegistrationType schemaRegistrationType)
      throws IOException {
    Preconditions.checkNotNull(columnName);
    Preconditions.checkNotNull(schema);
    Preconditions.checkNotNull(schemaRegistrationType);

    final long schemaId = mSchemaTable.getOrCreateSchemaId(schema);
    final List<AvroSchema> schemas =
        getMutableRegisteredSchemaList(columnName, schemaRegistrationType);
    schemas.add(AvroSchema.newBuilder().setUid(schemaId).build());
    return this;
  }

  /**
   * Unregister a (READER | WRITER | WRITTEN) schema to a column.
   *
   *
 Remove all instances of the specified schema in the list.

   *
   * @param columnName at which to unregister the schema.
   * @param schema to register.
   * @param schemaRegistrationType of the schema to unregister: (READER, WRITER, WRITTEN).
   * @throws IOException If the parameters are invalid.
   * @return this builder.
   */
  private TableLayoutBuilder withoutSchema(
      final KijiColumnName columnName,
      final Schema schema,
      final SchemaRegistrationType schemaRegistrationType)
      throws IOException {
    Preconditions.checkNotNull(columnName);
    Preconditions.checkNotNull(schema);
    Preconditions.checkNotNull(schemaRegistrationType);

    final List<AvroSchema> schemas =
        getMutableRegisteredSchemaList(columnName, schemaRegistrationType);
    final Iterator<AvroSchema> it = schemas.iterator();
    while (it.hasNext()) {
      final AvroSchema avroSchema = it.next();
      final Schema other = mSchemaResolver.apply(avroSchema);
      if (Objects.equal(schema, other)) {
        it.remove();
      }
    }
    return this;
  }

  /**
   * List (READER | WRITER | WRITTEN) schemas registered at a column.
   *
   * @param columnName whose schemas to list.
   * @param schemaRegistrationType of the schemas to list: (READER, WRITER, WRITTEN).
   * @return The list of schemas.
   *         Returns empty list if schema validation was not previously enabled.
   * @throws IOException if the cellSchema of the column can not be acquired.
   */
  public Collection<Schema> getRegisteredSchemas(
      final KijiColumnName columnName,
      final SchemaRegistrationType schemaRegistrationType)
      throws IOException {
    Preconditions.checkNotNull(columnName);
    Preconditions.checkNotNull(schemaRegistrationType);
    final List<AvroSchema> avroSchemas =
        getMutableRegisteredSchemaList(columnName, schemaRegistrationType);
    return Collections2.transform(avroSchemas, mSchemaResolver);
  }

  /**
   * Build a new table layout descriptor.
   *
   * @return a built table layout descriptor.
   */
  public TableLayoutDesc build() {
    return mDescBuilder.build();
  }

  /**
   * Register a reader schema to a column.
   *
   * @param columnName at which to register the schema.
   * @param schema to register.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public TableLayoutBuilder withReader(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withSchema(columnName, schema, SchemaRegistrationType.READER);
  }

  /**
   * Register a writer schema to a column.
   *
   * @param columnName at which to register the schema.
   * @param schema to register.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public TableLayoutBuilder withWriter(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withSchema(columnName, schema, SchemaRegistrationType.WRITER);
  }

  /**
   * Register a written schema to a column.
   *
   * @param columnName at which to register the schema.
   * @param schema to register.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public  TableLayoutBuilder withWritten(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withSchema(columnName, schema, SchemaRegistrationType.WRITTEN);
  }

  /**
   * Unregister a reader schema to a column.
   *
   * @param columnName at which to unregister the schema.
   * @param schema to unregister.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public TableLayoutBuilder withoutReader(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withoutSchema(columnName, schema, SchemaRegistrationType.READER);
  }

  /**
   * Unregister a writer schema to a column.
   *
   * @param columnName at which to unregister the schema.
   * @param schema to unregister.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public TableLayoutBuilder withoutWriter(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withoutSchema(columnName, schema, SchemaRegistrationType.WRITER);
  }

  /**
   * Unregister a written schema to a column.
   *
   * @param columnName at which to unregister the schema.
   * @param schema to unregister.
   * @throws IOException If the parameters are invalid.
   * @return this.
   */
  public TableLayoutBuilder withoutWritten(
      final KijiColumnName columnName,
      final Schema schema)
      throws IOException {
    return withoutSchema(columnName, schema, SchemaRegistrationType.WRITTEN);
  }

  /**
   * Lists the reader schemas registered for the specified column.
   *
   * @param columnName whose schemas to list.
   * @return The list of schemas.
   *     Returns empty list if schema validation was not previously enabled.
   * @throws IOException if the cellSchema of the column can not be acquired.
   */
  public Collection<Schema> getRegisteredReaders(final KijiColumnName columnName)
      throws IOException {
    return getRegisteredSchemas(columnName, SchemaRegistrationType.READER);
  }

  /**
   * Lists the writer schemas registered for the specified column.
   *
   * @param columnName whose schemas to list.
   * @return The list of schemas.
   *     Returns empty list if schema validation was not previously enabled.
   * @throws IOException if the cellSchema of the column can not be acquired.
   */
  public Collection<Schema> getRegisteredWriters(final KijiColumnName columnName)
      throws IOException {
    return getRegisteredSchemas(columnName, SchemaRegistrationType.WRITER);
  }

  /**
   * List the written schemas recorded for the specified column.
   *
   * @param columnName whose schemas to list.
   * @return The list of schemas.
   *     Returns empty list if schema validation was not previously enabled.
   * @throws IOException if the cellSchema of the column can not be acquired.
   */
  public Collection<Schema> getRegisteredWritten(final KijiColumnName columnName)
      throws IOException {
    return getRegisteredSchemas(columnName, SchemaRegistrationType.WRITTEN);
  }

  /**
   * Set the layout id.
   *
   * @param layoutId to set
   * @return this.
   */
  public TableLayoutBuilder withLayoutId(String layoutId) {
    mDescBuilder.setLayoutId(layoutId);
    return this;
  }

  /**
   * Get the layout id.
   *
   * @return layout id
   */
  public String getLayoutId() {
    return mDescBuilder.getLayoutId();
  }

  /**
   * Set the Avro validation policy for a given column in this table.
   *
   * @param column the column whose Avro validation policy will be set.
   * @param policy the AvroValidationPolicy to set for the given column.
   * @return this builder.
   * @throws InvalidLayoutException in case a fully qualified column in a map family is specified.
   * @throws NoSuchColumnException in case the specified column does not exist.
   */
  public TableLayoutBuilder withAvroValidationPolicy(
      final KijiColumnName column,
      final AvroValidationPolicy policy)
      throws NoSuchColumnException, InvalidLayoutException {
    getColumnSchema(column).setAvroValidationPolicy(policy);
    return this;
  }

  /**
   * Get the Avro validation policy for a given column.
   *
   * @param column the column for which to get the Avro validation policy.
   * @return the Avro validation policy for the given column.
   * @throws NoSuchColumnException in case the column does not exist.
   * @throws InvalidLayoutException in case a fully qualified column in a map family is specified.
   */
  public AvroValidationPolicy getAvroValidationPolicy(final KijiColumnName column)
      throws NoSuchColumnException, InvalidLayoutException {
    return getColumnSchema(column).getAvroValidationPolicy();
  }

  /**
   * Options to normalize table layout descriptors.
   */
  public static final class LayoutOptions {
    /** Ways to represent an Avro schema. */
    public static enum SchemaFormat {
      /** Compact but non-portable way to represent an Avro schema. */
      UID,

      /** Verbose but portable way to represent an Avro schema. */
      JSON;
    };

    private SchemaFormat mSchemaFormat = SchemaFormat.JSON;

    /**
     * Default options to normalize table layout descriptors.
     */
    public LayoutOptions() {
      mSchemaFormat = SchemaFormat.JSON;  // verbose but portable
    }

    /**
     * Sets the format to use to encode Avro schema.
     * @param schemaFormat Format to use to encode Avro schema.
     * @return this builder.
     */
    public LayoutOptions setSchemaFormat(SchemaFormat schemaFormat) {
      mSchemaFormat = schemaFormat;
      return this;
    }

    /**
     * Returns the format to use to encode Avro schema.
     * @return the format to use to encode Avro schema.
     */
    public SchemaFormat getSchemaFormat() { return mSchemaFormat; }
  };

  /**
   * Normalizes a table layout descriptor to use schema UIDs only.
   *
   * @param desc Table layout descriptor to normalize.
   * @param options Options describing the normalization to apply.
   * @return the normalized table layout descriptor.
   * @throws IOException on I/O error.
   */
  public TableLayoutDesc normalizeTableLayoutDesc(TableLayoutDesc desc, LayoutOptions options)
      throws IOException {
    final TableLayoutDesc.Builder descBuilder = TableLayoutDesc.newBuilder(desc);
    normalizeTableLayoutDesc(descBuilder, options);
    return descBuilder.build();
  }

  /**
   * Normalizes the table layout descriptor to use schema UIDs only.
   *
   * @param descBuilder Builder for the table layout descriptor to normalize.
   * @param options Options describing the normalization to apply.
   * @throws IOException on I/O error.
   */
  private void normalizeTableLayoutDesc(TableLayoutDesc.Builder descBuilder, LayoutOptions options)
      throws IOException {
    for (LocalityGroupDesc lgdesc : descBuilder.getLocalityGroups()) {
      for (FamilyDesc fdesc : lgdesc.getFamilies()) {
        if (fdesc.getMapSchema() != null) {
          normalizeCellSchema(fdesc.getMapSchema(), options);
        } else {
          for (ColumnDesc cdesc : fdesc.getColumns()) {
            normalizeCellSchema(cdesc.getColumnSchema(), options);
          }
        }
      }
    }
  }

  /**
   * Normalizes a CellSchema to use schema UIDs only.
   *
   * @param cellSchema CellSchema to normalize.
   * @param options Options describing the normalization to apply.
   * @throws IOException on I/O error.
   */
  private void normalizeCellSchema(CellSchema cellSchema, LayoutOptions options)
      throws IOException {
    switch (cellSchema.getType()) {
      case AVRO: {
        // Ensure the lists of schemas are initialized (non null) and normalized to UIDs:
        if (cellSchema.getReaders() == null) {
          cellSchema.setReaders(Lists.<AvroSchema>newArrayList());
        }
        if (cellSchema.getWriters() == null) {
          cellSchema.setWriters(Lists.<AvroSchema>newArrayList());
        }
        if (cellSchema.getWritten() == null) {
          cellSchema.setWritten(Lists.<AvroSchema>newArrayList());
        }

        if (cellSchema.getDefaultReader() != null) {
          normalizeAvroSchema(cellSchema.getDefaultReader(), options);
        }
        normalizeAvroSchemaCollection(cellSchema.getReaders(), options);
        normalizeAvroSchemaCollection(cellSchema.getWriters(), options);
        normalizeAvroSchemaCollection(cellSchema.getWritten(), options);

        break;
      }
      case CLASS:
      case INLINE:
      case COUNTER:
      case PROTOBUF:
      case RAW_BYTES:
        break;
      default:
          throw new InvalidLayoutException(String.format(
              "Unsupported cell type: %s from CellSchema '%s'.",
              cellSchema.getType(), cellSchema));
    }
  }

  /**
   * Normalizes a collection of AvroSchema to use schema UIDs only.
   *
   * @param avroSchemas Collection of AvroSchema to normalize.
   * @param options Options describing the normalization to apply.
   * @throws IOException on I/O error.
   */
  private void normalizeAvroSchemaCollection(
      Collection<AvroSchema> avroSchemas,
      LayoutOptions options)
      throws IOException {
    for (AvroSchema avroSchema : avroSchemas) {
      normalizeAvroSchema(avroSchema, options);
    }
  }

  /**
   * Normalizes an AvroSchema to use schema UIDs only.
   *
   *
 Mutates the AvroSchema in-place.

   *
   * @param avroSchema AvroSchema to normalize.
   * @param options Options describing the normalization to apply.
   * @throws IOException on I/O error.
   */
  private void normalizeAvroSchema(AvroSchema avroSchema, LayoutOptions options)
      throws IOException {
    final boolean hasJson = (avroSchema.getJson() != null);
    final boolean hasUid = (avroSchema.getUid() != null);

    /** Schema this descriptor resolves to. */
    Schema schema = null;

    if (hasJson && hasUid) {
      // Both JSON and UID are filled in, this should not happen, but let's handle it:
      schema = new Schema.Parser().parse(avroSchema.getJson());
      final Schema schemaFromId = mSchemaTable.getSchema(avroSchema.getUid());
      if (!Objects.equal(schema, schemaFromId)) {
        throw new InvalidLayoutException(String.format(
            "Inconsistent AvroSchema: '%s' : UID %d does not match with JSON descriptor '%s'.",
            avroSchema, avroSchema.getUid(), avroSchema.getJson()));
      }

    } else if (hasJson) {
      schema = new Schema.Parser().parse(avroSchema.getJson());

    } else if (hasUid) {
      schema = mSchemaTable.getSchema(avroSchema.getUid());

    } else {
      throw new InvalidLayoutException("AvroSchema has neither JSON nor UID: " + avroSchema);
    }

    Preconditions.checkState(schema != null);

    switch (options.getSchemaFormat()) {
      case UID: {
        final long schemaId = mSchemaTable.getOrCreateSchemaId(schema);
        avroSchema.setUid(schemaId);
        avroSchema.setJson(null);
        break;
      }
      case JSON: {
        avroSchema.setUid(null);
        avroSchema.setJson(schema.toString());
        break;
      }
      default: throw new InternalKijiError("Unknown schema format: " + options.getSchemaFormat());
    }
  }

  /**
   * Computes the layout ID directly following a given layout ID.
   *
   *

   *   Increments the layout ID if it is an integer.
   *   Otherwise, forge a layout ID containing a timestamp.
   *

   *
   * @param layoutId Layout ID to compute the next sequential ID from.
   * @return the next sequential layout ID.
   */
  private static String nextLayoutId(String layoutId) {
    try {
      final long lid = Long.parseLong(layoutId);
      return Long.toString(lid + 1);
    } catch (NumberFormatException nfe) {
      return String.format("layout-with-timestamp-%d", System.currentTimeMillis());
    }
  }
}


text:
Test initialization of persistent connections
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php

require_once(dirname(__FILE__) . '/config.inc');

$db = new PDO($dsn, $username, $password, array (
                  PDO::ATTR_PERSISTENT => true
             ));

echo "OK";

$db = null;

$db1 = new PDO($dsn, null, null, array (
                   PDO::ATTR_PERSISTENT => true
              ));

?>
--EXPECT--
OK


text:
using ACT.TTSYukkuri.Boyomichan;
using ACT.TTSYukkuri.Config;
using ACT.TTSYukkuri.HOYA;
using ACT.TTSYukkuri.OpenJTalk;
using ACT.TTSYukkuri.Polly;
using ACT.TTSYukkuri.SAPI5;
using ACT.TTSYukkuri.Sasara;
using ACT.TTSYukkuri.Voiceroid;
using ACT.TTSYukkuri.Yukkuri;

namespace ACT.TTSYukkuri
{
    /// <summary>
    /// スピーチコントローラ
    /// </summary>
    public class SpeechController :
        ISpeechController
    {
        /// <summary>
        /// 現在のTTSタイプ
        /// </summary>
        private static string ttsType;

        /// <summary>
        /// Lockオブジェクト
        /// </summary>
        private static object lockObject = new object();

        /// <summary>
        /// シングルトンinstance
        /// </summary>
        private static ISpeechController instance;

        /// <summary>
        /// シングルトンinstanceを返す
        /// </summary>
        public static ISpeechController Default
        {
            get
            {
                lock (lockObject)
                {
                    if (SpeechController.instance == null ||
                        SpeechController.ttsType != Settings.Default.TTS)
                    {
                        if (SpeechController.instance != null)
                        {
                            SpeechController.instance.Free();
                        }

                        switch (Settings.Default.TTS)
                        {
                            case TTSType.Yukkuri:
                                SpeechController.instance = new YukkuriSpeechController();
                                break;

                            case TTSType.Sasara:
                                SpeechController.instance = new SasaraSpeechController();
                                break;

                            case TTSType.Boyomichan:
                                SpeechController.instance = new BoyomichanSpeechController();
                                break;

                            case TTSType.OpenJTalk:
                                SpeechController.instance = new OpenJTalkSpeechController();
                                break;

                            case TTSType.HOYA:
                                SpeechController.instance = new HOYASpeechController();
                                break;

                            case TTSType.VOICEROID:
                                SpeechController.instance = new VoiceroidSpeechController();
                                break;

                            case TTSType.SAPI5:
                                SpeechController.instance = new SAPI5SpeechController();
                                break;

                            case TTSType.Polly:
                                SpeechController.instance = new PollySpeechController();
                                break;

                            default:
                                SpeechController.instance = new YukkuriSpeechController();
                                break;
                        }

                        SpeechController.instance.Initialize();

                        SpeechController.ttsType = Settings.Default.TTS;

                        // 監視スレッドにスピークdelegateを与える
                        FFXIVWatcher.Default.SpeakDelegate = SpeechController.instance.Speak;
                    }

                    return SpeechController.instance;
                }
            }
        }

        /// <summary>
        /// 初期化する
        /// </summary>
        public void Initialize() =>
            SpeechController.Default.Initialize();

        /// <summary>
        /// 開放する
        /// </summary>
        public void Free()
        {
            FFXIVWatcher.Default.SpeakDelegate = null;
            SpeechController.Default.Free();
            SpeechController.ttsType = string.Empty;
            SpeechController.instance = null;
        }

        /// <summary>
        /// TTSに話してもらう
        /// </summary>
        /// <param name="text">読上げるテキスト</param>
        public void Speak(
            string text,
            PlayDevices playDevice = PlayDevices.Both,
            bool isSync = false)
            => SpeechController.instance.Speak(text, playDevice, isSync);
    }
}


text:
package io.blushine.android.validate;

import android.content.res.ColorStateList;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import androidx.annotation.ColorInt;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;

import io.blushine.android.AppActivity;
import io.blushine.android.R;
import io.blushine.android.common.ColorHelper;

/**
 * Use this class to validate checkboxes.
 */
public class CheckBoxValidator extends Validator<CheckBox> {
private static final ColorStateList mErrorTint = ColorHelper.getColorStateList(AppActivity.getActivity().getResources(), R.color.default_error_color, null);
@ColorInt
private static final int ERROR_COLOR = ColorHelper.getColor(AppActivity.getActivity().getResources(), R.color.default_error_color, null);
private TextView mErrorView = null;
private ColorStateList mDefaultTint;
private ColorFilter mDefaultFilter;
private Drawable mButtonDrawable;
private Paint mErrorFilter;

/**
 * Create a new validator. Uses the default error message
 * @param checkBox the field to validate
 */
private CheckBoxValidator(CheckBox checkBox) {
	super(checkBox);
	mButtonDrawable = mField.getButtonDrawable();
	if (mButtonDrawable != null) {
		mDefaultFilter = mButtonDrawable.getColorFilter();
	}

//	mDefaultTint = CompoundButtonCompat.getButtonTintList(checkBox);
}

@Override
protected void showError(String errorMessage) {
	// Change checkbox color
	if (mButtonDrawable != null) {
		mButtonDrawable.setColorFilter(ERROR_COLOR, PorterDuff.Mode.SRC_ATOP);
	}

	// Set error message
	if (mErrorView != null && !errorMessage.isEmpty()) {
		mErrorView.setText(errorMessage);
		mErrorView.setVisibility(View.VISIBLE);
	}
}

@Override
public void clearError() {
	// Change checkbox color
	if (mButtonDrawable != null) {
		mButtonDrawable.setColorFilter(mDefaultFilter);
	}

	// Remove error view
	if (mErrorView != null) {
		mErrorView.setVisibility(View.GONE);
	}
}

private void setValidateOnClick() {
	mField.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			validate();
		}
	});
}

/**
 * Builder class for checkbox validator
 */
public static class Builder extends Validator.Builder<CheckBoxValidator, Builder> {
	private boolean mChecked = true;
	private String mErrorMessage = null;

	/**
	 * Builder with the setRequired arguments.
	 * @param checkBox the field to validate
	 */
	public Builder(CheckBox checkBox) {
		super(new CheckBoxValidator(checkBox));
	}

	/**
	 * Set if the checkbox should be checked or unchecked to be valid
	 * @param checked set to true if the checkbox should be checked to be valid. Default: true
	 */
	public Builder setValidState(boolean checked) {
		mChecked = checked;
		return this;
	}

	/**
	 * Set the error view to display an optional error message. If no error message has been set
	 * through {@link #setErrorMessage(String)} a default message will be used.
	 * @param errorView the view to display an error message in
	 */
	public Builder setErrorView(TextView errorView) {
		mValidator.mErrorView = errorView;
		return this;
	}

	/**
	 * Set the error message. To display the error message you also have to set an error view
	 * through {@link #setErrorView(TextView)}.
	 * @param errorMessage the error message to be shown if the checkbox isn't checked/unchecked
	 */
	public Builder setErrorMessage(String errorMessage) {
		mErrorMessage = errorMessage;
		return this;
	}

	/**
	 * Set if the checkbox should be validated when it's been clicked. Note that only one {@link
	 * android.view.View.OnClickListener} can be attached to a checkbox. Thus if you want it to be
	 * validated when you click the checkbox and have a custom {@link android.view.View.OnClickListener}
	 * you can accomplish this by calling {@link Validator#validate()} in your {@link
	 * android.view.View.OnClickListener}
	 */
	public Builder setValidateOnClick() {
		mValidator.setValidateOnClick();
		return this;
	}

	public CheckBoxValidator build() {
		mValidator.addValidation(new ValidateCheckbox(mChecked, mErrorMessage));
		return super.build();
	}
}
}


text:
SERVICES='registry devicemanager mqttaccess controller httpaccess apiprovider'

echo "stopping all services..."
docker stop `echo $SERVICES`
docker rm `echo $SERVICES`

sudo docker run --link mysql mysql sh -c 'exec mysql -hmysql -uroot -e"CREATE DATABASE SeaWater"'

echo "starting registry..."
docker run -d --name registry --link etcd --link mysql xfocus/smartaquaculture registry -etcd http://etcd:2379 -rpchost internal:20034 -aeskey ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP -dbhost mysql -dbname SeaWater -dbport 3306 -dbuser root -loglevel debug

echo "starting devicemanager..."
docker run -d --name devicemanager --link etcd --link redis xfocus/smartaquaculture devicemanager -etcd http://etcd:2379 -rpchost internal:20033 -redishost redis:6379 -loglevel debug

echo "starting controller..."
docker run -d --name controller --link etcd --link mongo xfocus/smartaquaculture controller -etcd http://etcd:2379 -mongohost mongo -rpchost internal:20032 -loglevel debug

echo "starting mqttaccess..."
docker run -d --name mqttaccess -p 1883:1883 --link etcd xfocus/smartaquaculture mqttaccess -etcd http://etcd:2379 -tcphost :1883 -usetls -keyfile /go/src/github.com/bmorri12/SmartAqua/pkg/server/testdata/key.pem -cafile /go/src/github.com/bmorri12/SmartAqua/pkg/server/testdata/cert.pem -rpchost internal:20030 -loglevel debug

echo "starting httpaccess..."
docker run -d --name httpaccess -p 443:443 --link etcd --link redis xfocus/smartaquaculture httpaccess -etcd http://etcd:2379 -httphost :443 -redishost redis:6379 -usehttps -keyfile /go/src/github.com/bmorri12/SmartAqua/pkg/server/testdata/key.pem -cafile /go/src/github.com/bmorri12/SmartAqua/pkg/server/testdata/cert.pem -loglevel debug

echo "starting apiprovider..."
docker run -d --name apiprovider -p 8888:8888 --link etcd xfocus/smartaquaculture apiprovider -etcd http://etcd:2379 -httphost :8888 -loglevel debug

sudo docker run -it --name pdcfg -v `echo $(pwd)`:/root --link etcd bmorri12/SmartAqua pdcfg -etcd http://etcd:2379


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. see http://aspnetwebstack.codeplex.com/SourceControl/latest#License.txt for license information.
// ported from aspnetwebstack
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Properties;
using System.Web.Routing;
using System.Web.WebPages;

namespace FlexHtmlHelper.Mvc.Html
{
    public static class LinkExtensions
    {
        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName)
        {
            return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, new RouteValueDictionary(), new RouteValueDictionary());
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, object routeValues)
        {
            return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, TypeHelper.ObjectToDictionary(routeValues), new RouteValueDictionary());
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes)
        {
            return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues)
        {
            return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, routeValues, new RouteValueDictionary());
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return ActionLink(htmlHelper, linkText, actionName, null /* controllerName */, routeValues, htmlAttributes);
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, string controllerName)
        {
            return ActionLink(htmlHelper, linkText, actionName, controllerName, new RouteValueDictionary(), new RouteValueDictionary());
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object routeValues, object htmlAttributes)
        {
            return ActionLink(htmlHelper, linkText, actionName, controllerName, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, string controllerName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            if (String.IsNullOrEmpty(linkText))
            {
                throw new ArgumentException(FHtmlHelper.MvcResource(FHtmlHelper.MvcResources_Common_NullOrEmpty), "linkText");
            }
            return htmlHelper.GenerateLink(htmlHelper.HtmlHelper.ViewContext.RequestContext, htmlHelper.HtmlHelper.RouteCollection, linkText, null /* routeName */, actionName, controllerName, routeValues, htmlAttributes);
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
        {
            return ActionLink(htmlHelper, linkText, actionName, controllerName, protocol, hostName, fragment, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink ActionLink(this FHtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            if (String.IsNullOrEmpty(linkText))
            {
                throw new ArgumentException(FHtmlHelper.MvcResource(FHtmlHelper.MvcResources_Common_NullOrEmpty), "linkText");
            }
            return htmlHelper.GenerateLink(htmlHelper.HtmlHelper.ViewContext.RequestContext, htmlHelper.HtmlHelper.RouteCollection, linkText, null /* routeName */, actionName, controllerName, protocol, hostName, fragment, routeValues, htmlAttributes);
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, object routeValues)
        {
            return RouteLink(htmlHelper, linkText, TypeHelper.ObjectToDictionary(routeValues));
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues)
        {
            return RouteLink(htmlHelper, linkText, routeValues, new RouteValueDictionary());
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName)
        {
            return RouteLink(htmlHelper, linkText, routeName, (object)null /* routeValues */);
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, object routeValues)
        {
            return RouteLink(htmlHelper, linkText, routeName, TypeHelper.ObjectToDictionary(routeValues));
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues)
        {
            return RouteLink(htmlHelper, linkText, routeName, routeValues, new RouteValueDictionary());
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, object routeValues, object htmlAttributes)
        {
            return RouteLink(htmlHelper, linkText, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return RouteLink(htmlHelper, linkText, null /* routeName */, routeValues, htmlAttributes);
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, object routeValues, object htmlAttributes)
        {
            return RouteLink(htmlHelper, linkText, routeName, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            if (String.IsNullOrEmpty(linkText))
            {
                throw new ArgumentException(FHtmlHelper.MvcResource(FHtmlHelper.MvcResources_Common_NullOrEmpty), "linkText");
            }
            return htmlHelper.GenerateRouteLink(htmlHelper.HtmlHelper.ViewContext.RequestContext, htmlHelper.HtmlHelper.RouteCollection, linkText, routeName, routeValues, htmlAttributes);
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
        {
            return RouteLink(htmlHelper, linkText, routeName, protocol, hostName, fragment, TypeHelper.ObjectToDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
        }

        public static FlexLink RouteLink(this FHtmlHelper htmlHelper, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            if (String.IsNullOrEmpty(linkText))
            {
                throw new ArgumentException(FHtmlHelper.MvcResource(FHtmlHelper.MvcResources_Common_NullOrEmpty), "linkText");
            }
            return htmlHelper.GenerateRouteLink(htmlHelper.HtmlHelper.ViewContext.RequestContext, htmlHelper.HtmlHelper.RouteCollection, linkText, routeName, protocol, hostName, fragment, routeValues, htmlAttributes);
        }

        #region Generate Link Helper

        internal static FlexLink GenerateLink(this FHtmlHelper html, RequestContext requestContext, RouteCollection routeCollection, string linkText, string routeName, string actionName, string controllerName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return html.GenerateLink(requestContext, routeCollection, linkText, routeName, actionName, controllerName, null /* protocol */, null /* hostName */, null /* fragment */, routeValues, htmlAttributes);
        }

        internal static FlexLink GenerateLink(this FHtmlHelper html, RequestContext requestContext, RouteCollection routeCollection, string linkText, string routeName, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return html.GenerateLinkInternal(requestContext, routeCollection, linkText, routeName, actionName, controllerName, protocol, hostName, fragment, routeValues, htmlAttributes, true /* includeImplicitMvcValues */);
        }

        private static FlexLink GenerateLinkInternal(this FHtmlHelper html, RequestContext requestContext, RouteCollection routeCollection, string linkText, string routeName, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes, bool includeImplicitMvcValues)
        {
            string url = UrlHelper.GenerateUrl(routeName, actionName, controllerName, protocol, hostName, fragment, routeValues, routeCollection, requestContext, includeImplicitMvcValues);
            FlexTagBuilder tagBuilder = html.Render.LinkHelper(new FlexTagBuilder(), linkText, url, htmlAttributes);
            return new FlexLink(html, tagBuilder);
        }

        public static FlexLink GenerateRouteLink(this FHtmlHelper html, RequestContext requestContext, RouteCollection routeCollection, string linkText, string routeName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return html.GenerateRouteLink(requestContext, routeCollection, linkText, routeName, null /* protocol */, null /* hostName */, null /* fragment */, routeValues, htmlAttributes);
        }

        public static FlexLink GenerateRouteLink(this FHtmlHelper html, RequestContext requestContext, RouteCollection routeCollection, string linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            return html.GenerateLinkInternal(requestContext, routeCollection, linkText, routeName, null /* actionName */, null /* controllerName */, protocol, hostName, fragment, routeValues, htmlAttributes, false /* includeImplicitMvcValues */);
        }

        #endregion

        #region PagingLink

        public static FlexPagingLink PagingLink(this FHtmlHelper html, int totalItemCount, int pageNumber, int pageSize, int maxPagingLinks, Func<int, string> pagingUrlResolver)
        {
            return PagingLink(html, totalItemCount, pageNumber, pageSize,maxPagingLinks, pagingUrlResolver, null /*htmlAttributes*/);
        }

        public static FlexPagingLink PagingLink(this FHtmlHelper html, int totalItemCount, int pageNumber, int pageSize, int maxPagingLinks, Func<int, string> pagingUrlResolver, object htmlAttributes)
        {
            return PagingLink(html, totalItemCount, pageNumber, pageSize, maxPagingLinks, pagingUrlResolver, htmlAttributes);
        }

        public static FlexPagingLink PagingLink(this FHtmlHelper html, int totalItemCount, int pageNumber, int pageSize, int maxPagingLinks, Func<int, string> pagingUrlResolver, IDictionary<string, object> htmlAttributes)
        {
            FlexTagBuilder tagBuilder = html.Render.PagingLinkHelper(new FlexTagBuilder(), totalItemCount, pageNumber, pageSize,maxPagingLinks, pagingUrlResolver, htmlAttributes);
            return new FlexPagingLink(html, tagBuilder);
        }

        #endregion
    }
}


text:
These settings apply only when `--go` is specified on the command line.

``` yaml $(go) && !$(track2)
go:
  license-header: MICROSOFT_MIT_NO_VERSION
  namespace: serialconsole
  clear-output-folder: true
```

``` yaml $(go) && $(track2)
license-header: MICROSOFT_MIT_NO_VERSION
module-name: sdk/resourcemanager/serialconsole/armserialconsole
module: github.com/Azure/azure-sdk-for-go/$(module-name)
output-folder: $(go-sdk-folder)/$(module-name)
azure-arm: true
```

### Go multi-api

``` yaml $(go) && $(multiapi)
batch:
  - tag: package-2018-05
```

### Tag: package-2018-05 and go

These settings apply only when `--tag=package-2018-05 --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

``` yaml $(tag) == 'package-2018-05' && $(go)
output-folder: $(go-sdk-folder)/services/$(namespace)/mgmt/2018-05-01/$(namespace)
```


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#include <stdint.h>
#include <openssl/x509.h>

/*
Function:
GetX509EvpPublicKey

Returns a EVP_PKEY* equivalent to the public key of the certificate.
*/
extern "C" EVP_PKEY* GetX509EvpPublicKey(X509* x509);


text:
// +build !ignore_autogenerated

// This file was autogenerated by conversion-gen. Do not edit it manually!

package v1

import (
	core_v1 "k8s.io/api/core/v1"
	v1 "k8s.io/api/networking/v1"
	meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	intstr "k8s.io/apimachinery/pkg/util/intstr"
	api "k8s.io/kubernetes/pkg/api"
	networking "k8s.io/kubernetes/pkg/apis/networking"
	unsafe "unsafe"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedConversionFuncs(
		Convert_v1_NetworkPolicy_To_networking_NetworkPolicy,
		Convert_networking_NetworkPolicy_To_v1_NetworkPolicy,
		Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule,
		Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule,
		Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList,
		Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList,
		Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer,
		Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer,
		Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort,
		Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort,
		Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec,
		Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec,
	)
}

func autoConvert_v1_NetworkPolicy_To_networking_NetworkPolicy(in *v1.NetworkPolicy, out *networking.NetworkPolicy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1_NetworkPolicy_To_networking_NetworkPolicy is an autogenerated conversion function.
func Convert_v1_NetworkPolicy_To_networking_NetworkPolicy(in *v1.NetworkPolicy, out *networking.NetworkPolicy, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicy_To_networking_NetworkPolicy(in, out, s)
}

func autoConvert_networking_NetworkPolicy_To_v1_NetworkPolicy(in *networking.NetworkPolicy, out *v1.NetworkPolicy, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	if err := Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil {
		return err
	}
	return nil
}

// Convert_networking_NetworkPolicy_To_v1_NetworkPolicy is an autogenerated conversion function.
func Convert_networking_NetworkPolicy_To_v1_NetworkPolicy(in *networking.NetworkPolicy, out *v1.NetworkPolicy, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicy_To_v1_NetworkPolicy(in, out, s)
}

func autoConvert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in *v1.NetworkPolicyIngressRule, out *networking.NetworkPolicyIngressRule, s conversion.Scope) error {
	out.Ports = *(*[]networking.NetworkPolicyPort)(unsafe.Pointer(&in.Ports))
	out.From = *(*[]networking.NetworkPolicyPeer)(unsafe.Pointer(&in.From))
	return nil
}

// Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule is an autogenerated conversion function.
func Convert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in *v1.NetworkPolicyIngressRule, out *networking.NetworkPolicyIngressRule, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule(in, out, s)
}

func autoConvert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *networking.NetworkPolicyIngressRule, out *v1.NetworkPolicyIngressRule, s conversion.Scope) error {
	out.Ports = *(*[]v1.NetworkPolicyPort)(unsafe.Pointer(&in.Ports))
	out.From = *(*[]v1.NetworkPolicyPeer)(unsafe.Pointer(&in.From))
	return nil
}

// Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule is an autogenerated conversion function.
func Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *networking.NetworkPolicyIngressRule, out *v1.NetworkPolicyIngressRule, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in, out, s)
}

func autoConvert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in *v1.NetworkPolicyList, out *networking.NetworkPolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]networking.NetworkPolicy)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList is an autogenerated conversion function.
func Convert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in *v1.NetworkPolicyList, out *networking.NetworkPolicyList, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicyList_To_networking_NetworkPolicyList(in, out, s)
}

func autoConvert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in *networking.NetworkPolicyList, out *v1.NetworkPolicyList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	if in.Items == nil {
		out.Items = make([]v1.NetworkPolicy, 0)
	} else {
		out.Items = *(*[]v1.NetworkPolicy)(unsafe.Pointer(&in.Items))
	}
	return nil
}

// Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList is an autogenerated conversion function.
func Convert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in *networking.NetworkPolicyList, out *v1.NetworkPolicyList, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyList_To_v1_NetworkPolicyList(in, out, s)
}

func autoConvert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in *v1.NetworkPolicyPeer, out *networking.NetworkPolicyPeer, s conversion.Scope) error {
	out.PodSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.PodSelector))
	out.NamespaceSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
	return nil
}

// Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer is an autogenerated conversion function.
func Convert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in *v1.NetworkPolicyPeer, out *networking.NetworkPolicyPeer, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicyPeer_To_networking_NetworkPolicyPeer(in, out, s)
}

func autoConvert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in *networking.NetworkPolicyPeer, out *v1.NetworkPolicyPeer, s conversion.Scope) error {
	out.PodSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.PodSelector))
	out.NamespaceSelector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
	return nil
}

// Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer is an autogenerated conversion function.
func Convert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in *networking.NetworkPolicyPeer, out *v1.NetworkPolicyPeer, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyPeer_To_v1_NetworkPolicyPeer(in, out, s)
}

func autoConvert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in *v1.NetworkPolicyPort, out *networking.NetworkPolicyPort, s conversion.Scope) error {
	out.Protocol = (*api.Protocol)(unsafe.Pointer(in.Protocol))
	out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port))
	return nil
}

// Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort is an autogenerated conversion function.
func Convert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in *v1.NetworkPolicyPort, out *networking.NetworkPolicyPort, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicyPort_To_networking_NetworkPolicyPort(in, out, s)
}

func autoConvert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *networking.NetworkPolicyPort, out *v1.NetworkPolicyPort, s conversion.Scope) error {
	out.Protocol = (*core_v1.Protocol)(unsafe.Pointer(in.Protocol))
	out.Port = (*intstr.IntOrString)(unsafe.Pointer(in.Port))
	return nil
}

// Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort is an autogenerated conversion function.
func Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *networking.NetworkPolicyPort, out *v1.NetworkPolicyPort, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in, out, s)
}

func autoConvert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in *v1.NetworkPolicySpec, out *networking.NetworkPolicySpec, s conversion.Scope) error {
	out.PodSelector = in.PodSelector
	out.Ingress = *(*[]networking.NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress))
	return nil
}

// Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec is an autogenerated conversion function.
func Convert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in *v1.NetworkPolicySpec, out *networking.NetworkPolicySpec, s conversion.Scope) error {
	return autoConvert_v1_NetworkPolicySpec_To_networking_NetworkPolicySpec(in, out, s)
}

func autoConvert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in *networking.NetworkPolicySpec, out *v1.NetworkPolicySpec, s conversion.Scope) error {
	out.PodSelector = in.PodSelector
	out.Ingress = *(*[]v1.NetworkPolicyIngressRule)(unsafe.Pointer(&in.Ingress))
	return nil
}

// Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec is an autogenerated conversion function.
func Convert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in *networking.NetworkPolicySpec, out *v1.NetworkPolicySpec, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicySpec_To_v1_NetworkPolicySpec(in, out, s)
}