text:
<?php

/**
 * Set up the default database connection for Omeka.
 *
 * @package Omeka\Application\Resource
 */
class Omeka_Application_Resource_Db extends Zend_Application_Resource_Db
{
    /**
     * Path to the database configuration file.
     * Set in application.ini
     *
     * @var string
     */
    private $_iniPath;

    /**
     * @return Omeka_Db
     */
    public function init()
    {
        $dbFile = $this->_iniPath;

        if (!file_exists($dbFile)) {
            throw new Zend_Config_Exception('Your Omeka database configuration file is missing.');
        }

        if (!is_readable($dbFile)) {
            throw new Zend_Config_Exception('Your Omeka database configuration file cannot be read by the application.');
        }

        $dbIni = new Zend_Config_Ini($dbFile, 'database');

        // Fail on improperly configured db.ini file
        if (!isset($dbIni->host) || ($dbIni->host == 'XXXXXXX')) {
            throw new Zend_Config_Exception('Your Omeka database configuration file has not been set up properly.  Please edit the configuration and reload this page.');
        }

        $connectionParams = $dbIni->toArray();
        // dbname aliased to 'name' for backwards-compatibility.
        if (array_key_exists('name', $connectionParams)) {
            $connectionParams['dbname'] = $connectionParams['name'];
        }

        $bootstrap = $this->getBootstrap();
        $bootstrap->bootstrap('Config');
        $config = $this->getBootstrap()->getResource('Config');
        $loggingEnabled = $config->log->sql;
        $profilingEnabled = $config->debug->profileDb;

        if ($profilingEnabled) {
            $connectionParams['profiler'] = true;
        }
        $dbh = Zend_Db::factory('Mysqli', $connectionParams);

        $db_obj = new Omeka_Db($dbh, $dbIni->prefix);

        // Enable SQL logging (potentially).
        if ($loggingEnabled) {
            $bootstrap->bootstrap('Logger');
            $db_obj->setLogger($bootstrap->getResource('Logger'));
        }

        Zend_Db_Table_Abstract::setDefaultAdapter($dbh);

        return $db_obj;
    }

    /**
     * Set the path to the database configuration file.
     *
     * Allows {@link $_iniPath} to be set by the app configuration.
     *
     * @param string $path
     */
    public function setinipath($path)
    {
        $this->_iniPath = $path;
    }
}


text:
from os import environ

from six import string_types
from six.moves import urllib_parse

from .exceptions import InvalidResourcePath

GOOEE_API_URL = environ.get('GOOEE_API_URL', 'https://dev-api.gooee.io/')
GOOEE_API_PATH = urllib_parse.urlparse(GOOEE_API_URL).path

def format_path(path, api_base_url=GOOEE_API_URL):
    error_msg = 'The path argument must be a string that begins with "/"'
    if not isinstance(path, string_types):
        raise InvalidResourcePath(error_msg)

    # Using the HTTP shortcut
    if path.startswith('/'):
        return urllib_parse.urljoin(api_base_url, path.lstrip('/'))

    return path

redpajama_set_name: RedPajamaGithub


text:
package org.apache.hyracks.storage.am.lsm.btree;

import java.util.Random;

import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.storage.am.btree.OrderedIndexTestContext;
import org.apache.hyracks.storage.am.btree.frames.BTreeLeafFrameType;
import org.apache.hyracks.storage.am.lsm.btree.util.LSMBTreeTestContext;
import org.apache.hyracks.storage.am.lsm.btree.util.LSMBTreeTestHarness;
import org.junit.After;
import org.junit.Before;

@SuppressWarnings("rawtypes")
public class LSMBTreeFilterMergeTest extends LSMBTreeFilterMergeTestDriver {

    public LSMBTreeFilterMergeTest() {
        super(LSMBTreeTestHarness.LEAF_FRAMES_TO_TEST);
    }

    private final LSMBTreeTestHarness harness = new LSMBTreeTestHarness();

    @Before
    public void setUp() throws HyracksDataException {
        harness.setUp();
    }

    @After
    public void tearDown() throws HyracksDataException {
        harness.tearDown();
    }

    @Override
    protected OrderedIndexTestContext createTestContext(ISerializerDeserializer[] fieldSerdes, int numKeys,
            BTreeLeafFrameType leafType, boolean filtered) throws Exception {
        return LSMBTreeTestContext.create(harness.getIOManager(), harness.getVirtualBufferCaches(),
                harness.getFileReference(), harness.getDiskBufferCache(), fieldSerdes, numKeys,
                harness.getBoomFilterFalsePositiveRate(), harness.getMergePolicy(), harness.getOperationTracker(),
                harness.getIOScheduler(), harness.getIOOperationCallbackFactory(),
                harness.getMetadataPageManagerFactory(), filtered, true, false);
    }

    @Override
    protected Random getRandom() {
        return harness.getRandom();
    }
}


text:
static const int START_SEQ = 1;
static const int RELEASE_SEQ = 2; //放出判定
static const int LAND_WAIT_SEQ = 3;
static const int LAND_SEQ = 4;
static const int OPEN_SEQ = 5;//ケーシング展開終了

//タイムアウト時間 seconds
static const int LUX_TIMEOUT_SECONDS = 3900; //光センサー放出判定
static const int WAIT4LAND_SECONDS = 600;//NOTE 終端速度に依存
static const int LANDTIMEOUT_SECONDS = 900; //高度着地判定
static const int ALTUTUDE_RING_LEN = 10;//ring_bufferの長さ
//THRESHOLD
static const double ALT_CHANGE_THRESHOLD = 1.5; //高度情報安定判定閾値
static const int MINIMUM_ALTITUDE = 1700; //高度情報一定値以下判定閾値(m)
static const int CONTINUOUS_ISLIGHT_TIME = 5;
//センサーデータ取得感覚
static const int LIGHT_INTERVAL = 1;
static const int ALT_INTERVAL_SECONDS = 10;//seconds

static const int WAIT4START_SECONDS = 10;
static const double INF = 10000;

typedef struct st_Sequence
{
	int sequence_num;//前のシーケンス番号
	time_t last_time;//前のシーケンスの時間
	//longと同じ
}Sequence;

//GPS座標を取得して送信
int getGPScoords(void)
{
	gps_flush();
	loc_t coord;
	gps_location(&coord);
	printf("latitude:%f longitude:%f altitude:%f\n",
	       coord.latitude,coord.longitude,coord.altitude);
	xbeePrintf("latitude:%f longitude:%f altitude:%f\r\n",
	           coord.latitude,coord.longitude,coord.altitude);
	return 0;
}

//高度を取得して送信
double getAltitude(void)
{
	double altitude = readAltitude();
	printf("ALTITUDE:%f\n",altitude);
	xbeePrintf("ALTITUDE:%f\r\n",altitude);
	return altitude;
}

//前回のシーケンスの終了時刻と現在のシーケンスを取得
int read_sequence(Sequence* sequence2read)
{
	FILE *fp = fopen("sequence.txt","r");
	if(fp==NULL)
	{
		//FILEは存在しないとき
		printf("Cannot open sequence.txt\n");
		xbeePrintf("Cannot opem sequence txt\r\n");
		return -1;
	}
	else
	{
		while(fscanf(fp,"%d:%ld\n",&(sequence2read->sequence_num),&(sequence2read->last_time))!= EOF)
		{
			;//pass
		}
		printf("read_sequence %d:%ld\n",sequence2read->sequence_num,sequence2read->last_time);
		xbeePrintf("read_sequence %d:%ld\r\n",sequence2read->sequence_num,sequence2read->last_time);
		fclose(fp);
	}
	return 0;
}

//シーケンス番号と時刻を書き込む
int write_sequence(Sequence *sequence2write,int seq_num2write)
{
	time_t tcurrent;
	time(&tcurrent);
	sequence2write->last_time = tcurrent;
	sequence2write->sequence_num = seq_num2write;
	printf("write sequence %d:%s\n",seq_num2write,ctime(&tcurrent));
	xbeePrintf("write sequence %d:%s\r\n",seq_num2write,ctime(&tcurrent));
	FILE *fp=fopen("sequence.txt","a");//追加書き込み
	//FILEが存在しないときは新規作成
	if(fp==NULL)
	{
		printf("Cannot open sequence\n");
		xbeePrintf("Cannot open sequence\r\n");
		return -1;
	}else
	{
		fprintf(fp,"%d:%ld\n",seq_num2write,tcurrent);
		printf("write sequence success\n");
		xbeePrintf("write sequence success\r\n");
		fclose(fp);
	}
	return 0;
}

//前回のシーケンスの終了時間からの分を返す
double diffsec(Sequence last_seq)
{
	time_t tcurrent;
	time(&tcurrent);
	double delta_seconds = difftime(tcurrent,last_seq.last_time);
	printf("diffsecond:%f\n",delta_seconds);
	xbeePrintf("diffsecond%f\r\n",delta_seconds);
	return delta_seconds;
}

//timeout 判定の関数 引数はタイムアウト時間(分)とSequence構造体
int isTimeout(int timeout_sec,Sequence seq)
{
	if(diffsec(seq) > timeout_sec)
	{
		//前のステータス終了からの経過時間 > タイムアウト時間
		return 1;
	}
	return 0;
}

static int wait4Start()
{
	int i=0;
	for(i=0; i<WAIT4START_SECONDS; i++)
	{
		printf("%d seconds to start\n",WAIT4START_SECONDS-i);
		xbeePrintf("%d seconds to start\r\n",WAIT4START_SECONDS-i);
		sleep(1);
	}
	return 0;
}

//シーケンス開始
static int startSeq(Sequence *seq)
{
	write_sequence(seq,START_SEQ);
	printf("FIRST SEQUENCE START\n");
	return 0;
}

//放出判定シーケンス
static int releaseSeq(Sequence *seq)
{
	printf("RELEASE SEQUENCE START");
	int isLightCount = 0;
	while(!isTimeout(LUX_TIMEOUT_SECONDS,*seq))
	{
		getGPScoords();
		getAltitude();
		while(isLightCount<CONTINUOUS_ISLIGHT_TIME)
		{
			if(isLight())
			{
				isLightCount++;
				printf("light_counter:%d\n",isLightCount);
				xbeePrintf("light_counter:%d\r\n",isLightCount);
			}else{
				printf("isLight False\n");
				xbeePrintf("isLight False\r\n");
				isLightCount = 0;
			}
			sleep(LIGHT_INTERVAL);
		}
		printf("release complete:lux sensor\n");
		xbeePrintf("release complete:lux sensor\r\n");
		write_sequence(seq,RELEASE_SEQ);
		return 0;
	}
	printf("release_complete:time out\n");
	xbeePrintf("release_complete:time out\r\n");
	write_sequence(seq,RELEASE_SEQ);
	return 0;
}

static int wait4Land(Sequence* seq)
{
	xbeePrintf("LAND WAIT SEQUENCE START\r\n");
	printf("LAND WAIT SEQUENCE START\n");
	while(!isTimeout(WAIT4LAND_SECONDS,*seq))
	{
		getGPScoords();
		getAltitude();
	}
	xbeePrintf("LAND WAIT SEQUENCE FINISHED\r\n");
	printf("LAND WAIT SEQUENCE FINISHED\n");
	write_sequence(seq,LAND_WAIT_SEQ);
	return 0;
}

//Queueの中の値の変動を返す
//NOTE 内部でdequeue
static double calc_variation(Queue *ring)
{
	double variation= INF;//0にするよりも大きくする方があとでtheresholdと比較するので適切
	double first = dequeue(ring);
	double last = getLast(ring);
	variation = fabs(first - last);
	printf("VARIATION :%f\n",variation);
	xbeePrintf("VARIATION :%f\r\n",variation);
	return variation;
}

//ring_bufferを受け取り高度が閾値より低いか判定
static int isAltlow(Queue* ring)
{
	double alt = getLast(ring);
	if(alt<MINIMUM_ALTITUDE)
	{
		printf("ALT IS LOW\n");
		xbeePrintf("ALT IS LOW\r\n");
		return 1;
	}
	//高度が基準以上
	printf("ALT IS HIGH\n");
	xbeePrintf("ALT IS HIGH\r\n");
	return 0;
}

//着地判定ロジック
static int isLanded(Queue* ring)
{
	while(!is_full(ring))
	{
		getGPScoords();
		time_t tcurrent;
		time(&tcurrent);
		printf("%s\n",ctime(&tcurrent));
		double altitude = getAltitude();
		enqueue(ring,altitude);
		sleep(ALT_INTERVAL_SECONDS);
	}
	if(calc_variation(ring)<ALT_CHANGE_THRESHOLD&&isAltlow(ring))
	{
		printf("ALT IS STABLE and LOW\n");
		xbeePrintf("ALT IS STABLE and LOW\r\n");
		return 1;
	}
	printf("ALT IS NOT STABLE OR NOT LOW\n");
	xbeePrintf("ALT IS NOT STABLE OR NOT LOW\r\n");
	return 0;
}

//着地判定シーケンス
static int landSeq(Sequence* seq)
{
	printf("Landing Sequence\n");
	Queue *ring = make_queue(ALTUTUDE_RING_LEN);
	while(!isTimeout(LANDTIMEOUT_SECONDS,*seq))
	{
		if(isLanded(ring))
		{
			printf("landing_complete:landed\n");
			xbeePrintf("landing_complete:landed\r\n");
			write_sequence(seq, LAND_SEQ);
			queue_delete(ring);
			return 0;
		}
	}
	queue_delete(ring);
	printf("landing_complete;timeout\n");
	write_sequence(seq,LAND_SEQ);
	return 0;
}

int open_case(Sequence *seq)
{
	printf("started open case sequence\n");
	cut_initialize();
	cut_all();
	write_sequence(seq,OPEN_SEQ);
	return 0;
}

int main(void)
{

	xbee_init();
	bme280_initialize();
	acclGyro_initialize();
	luxsensor_initialize();
	gps_init();
	Sequence sequence;

	if(read_sequence(&sequence)!=0)
	//file open に失敗
	{
		wait4Start();
		startSeq(&sequence);
		releaseSeq(&sequence);
		luxsensor_close();
		wait4Land(&sequence);
		landSeq(&sequence);
		open_case(&sequence);
		gps_off();
		xbee_close();
		return 0;
	}
	switch (sequence.sequence_num)
	{
	case 1:
		printf("READ:last sequence num is 1");
		releaseSeq(&sequence);
		luxsensor_close();
	case 2:
		printf("READ:last sequence num is 2");
		wait4Land(&sequence);
	case 3:
		printf("READ:last sequence num is 3");
		landSeq(&sequence);
	case 4:
		printf("READ:last sequence num is 4");
		open_case(&sequence);
	case 5:
		printf("READ:last sequence num is 5");
		gps_off();
		xbee_close();
		break;
	default:
		printf("Sequence number is Strange\n");
		gps_off();
		xbee_close();
		break;
	}
	return 0;
}


text:
"""Functions for selecting lists of timeslots based on certain criteria."""

import datetime
import functools
import itertools
import sqlalchemy

import lass.schedule.models

import lass.credits.query
import lass.common.time
import lass.schedule.filler

def process(slots, start, finish):
    """Processes a raw list of timeslots, annotating and filling them.

    Args:
        slots: The list of timeslots.  May be mutated.
        start: The datetime representing the desired start of the schedule;
            filler will pad between here and the first timeslot, if necessary.
        finish: The datetime representing the desired end of the schedule;
            filler will pad between the last timeslot and here, if necessary.

    Returns:
        The list 'slots', augmented with filler and metadata/credits
        annotations.  The list may exceed the boundaries of
        'start' and 'finish', but should be filled to meet them at least.
    """
    if slots:
        lass.schedule.models.Timeslot.annotate(slots)
        start = min(slots[0].start, start)
        finish = max(slots[-1].finish, finish)

    return lass.schedule.filler.fill(
        slots,
        lass.schedule.filler.filler_from_config(),
        start,
        finish
    )

class Schedule(object):
    """Lazy loader/cache for schedule lists."""
    def __init__(
        self,
        creator,
        processor=process,
        source=None,
        start=None,
        finish=None
    ):
        """Initialises the lazy loader.

        Args:
            creator: A function taking the start time and returning a list of
                unfilled and unannotated timeslots.
            processor: A processing function for post-processing the output of
                'function' (for example, annotating and filling).  (Default:
                'process'.)
            source: A Query from which all timeslots should be selected.
                May be None, in which case the query matching all public
                timeslots will be used.
                (Default: None.)
            start: The datetime at which the schedule should start.
                May be None, in which case the date/time at calling is used.
                (Default: None.)
            finish: The datetime at which the schedule should finish.
                May be None, in which case the schedule finishes one day after
                it starts.
                (Default: None.)

        Returns:
            A Schedule object.
        """
        self.slots = None
        self.source = lass.schedule.models.Timeslot.public()

        self.start = start if start else lass.common.time.aware_now()
        self.finish = finish if finish else (
            self.start + datetime.timedelta(days=1)
        )

        self.creator = functools.partial(
            creator,
            source=self.source,
            start=self.start,
            finish=self.finish
        )
        self.processor = functools.partial(
            processor,
            start=self.start,
            finish=self.finish
        )
        self.stored = False
        self.time_context = lass.common.time.context_from_config()

    @property
    def timeslots(self):
        """Retrieves the list of timeslots this Schedule object is set to
        retrieve.

        If the timeslots have not yet been retrieved, this will invoke the
        retrieval function and then save the results for future calls on this
        object only.

        Returns:
            The list of timeslots this object has been directed to compute.
        """
        if not self.stored:
            self.slots = self.processor(self.creator())
            self.stored = True

        return self.slots

    def days(self):
        """Returns the dates of all days covered by this schedule.

        Returns:
            An iterable of dates corresponding to each day in this schedule, in
            chronological order.
        """
        start_date = self.time_context.localise(self.start).date()
        finish_date = self.time_context.localise(self.finish).date()

        return itertools.takewhile(
            (lambda i: i < finish_date),
            map(
                lambda c: start_date + datetime.timedelta(days=c),
                itertools.count()
            )
        )

    def table(self):
        """Attempts to convert the schedule into table form.

        This will likely not work for non-weekly schedules.

        Returns:
            The schedule, in tabular form (lists of time rows containing day
            columns).
        """
        return lass.schedule.table.tabulate(
            self.start,
            self.timeslots,
            self.time_context
        )

def from_to(source, start, finish):
    """Selects all shows between 'start' and 'finish'.

    No filling is done, and shows selected may start or finish outside the
    boundaries required; consequently the start of the first and end of the
    last show may not equate to start and finish respectively.

    Args:
        source: A query providing the timeslots from which this function should
            select.  For all public shows, use 'Timeslot.query.public()',
            for example.
        start: The datetime representing the start of the schedule.
        finish: The datetime representing the finish of the schedule.

    Returns:
        A raw ordered list of every show from 'source' with air-time between
        'start' and 'finish'.
    """
    all_from_to = source.filter(
        (start < lass.schedule.models.Timeslot.finish) &
        (lass.schedule.models.Timeslot.start < finish)
    )
    with_credits = load_credits(all_from_to)
    return with_credits.order_by(order()).all()

def next(source, start, finish, count):
    """Selects the next 'count' shows, current timeslot inclusive.

    No filling is done.

    Args:
        source: A query providing the timeslots from which this function
            should select.  For all public shows, use
            'Timeslot.public()', for example.
        start: The datetime used as a reference point to determine which
            shows are the 'next' ones.
        finish: Ignored; kept for interface consistency.
        count: The maximum number of timeslots to select.

    Returns:
        A list of up to 'count' raw timeslots representing the next timeslots
        to occur from 'start' (or now if 'from' is None).
    """
    all_next = source.filter(start < lass.schedule.models.Timeslot.finish)
    with_credits = load_credits(all_next)
    return with_credits.order_by(order()).limit(count).all()

def load_credits(query):
    """Adds credit loading to a timeslot query."""
    # Grab the *show*'s credits, because timeslots don't have their
    # own.  What we do instead is make sure the show's credits are
    # eager-loaded, and then any requests for the timeslot's credits
    # are indirectly pulled from here.
    path = ('season', 'show', 'credits')
    return lass.credits.query.add_to_query(query, path)

def order():
    """Returns the correct ordering for timeslots in a schedule list."""
    return sqlalchemy.asc(lass.schedule.models.Timeslot.start)


text:
import sys
import traceback

class CallbackError(Exception):
    pass

class Callbacks(object):

    def __init__(self):
        self.cb = {}
        self._cb_block = {}

    # TODO: This should raise KeyError or simply do nothing if unknown key
    # passed
    def clear_callback(self, name):
        try:
            self.cb[name][:] = []
        except KeyError:
            self.cb[name] = []
        self._cb_block[name] = dict(count=0, defer_list=[], defer_type=None)

    def enable_callback(self, name):
        if not self.has_callback(name):
            self.clear_callback(name)

    def has_callback(self, name):
        return name in self.cb

    def num_callbacks(self, name):
        return len(self.cb[name])

    def will_callback(self, name):
        return self.has_callback(name) and self.num_callbacks(name) > 0

    def delete_callback(self, name):
        try:
            del self.cb[name]

            if name in self._cb_block:
                del self._cb_block[name]
        except KeyError:
            raise CallbackError("No callback category of '%s'" % (
                name))

    def block_callback(self, name):
        self._cb_block[name]['count'] += 1

    def unblock_callback(self, name):
        self._cb_block[name]['count'] -= 1

    def suppress_callback(self, name, defer_type=None):
        return SuppressCallback(self, name, defer_type=defer_type)

    # TODO: Add a argument validation function for a callback
    # Pointers:
    #      * Check the name of the event for which callback added
    #      * Check that fn is a function
    #      * Check fn accepts at least one argument, the calling object
    #      * Check fn takes:
    #           - at least len(args) + len(kwargs) number of args
    #           - variable number of args or keyword args
    #      * Does and what value the callback function return
    #
    def add_callback(self, name, fn, *args, **kwargs):
        try:
            tup = (fn, args, kwargs)
            if tup not in self.cb[name]:
                self.cb[name].append(tup)
        except KeyError:
            raise CallbackError("No callback category of '%s'" % (
                name))

    def remove_callback(self, name, fn, *args, **kwargs):
        """Remove a specific callback that was added.
        """
        try:
            tup = (fn, args, kwargs)
            if tup in self.cb[name]:
                self.cb[name].remove(tup)
        except KeyError:
            raise CallbackError("No callback category of '%s'" % (
                name))

    def merge_callbacks_to(self, other):
        for name, cb_tups in self.cb.items():
            for tup in cb_tups:
                if tup not in other.cb[name]:
                    other.cb[name].append(tup)

    # TODO: to be deprecated ?
    def set_callback(self, name, fn, *args, **kwargs):
        if not self.has_callback(name):
            self.enable_callback(name)
        return self.add_callback(name, fn, *args, **kwargs)

    # TODO: Returns True even if any one of the callback succeeds...Is that
    # desired?
    def make_callback(self, name, *args, **kwargs):
        if not self.has_callback(name):
            return None
            # raise CallbackError("No callback category of '%s'" % (
            #                       name))

        # might save some slow code setting up for iteration/blocks
        if len(self.cb[name]) == 0:
            return False

        if self._cb_block[name]['count'] > 0:
            # callback temporarily blocked
            d = self._cb_block[name]
            defer_list = d['defer_list']
            defer_type = d['defer_type']
            if defer_type == 'all':
                # defer every suppressed call
                defer_list.append((name, args, kwargs))
            elif defer_type == 'last':
                # suppress all calls except last
                defer_list[:] = [(name, args, kwargs)]
            return False

        return self._do_callbacks(name, args, kwargs)

    def do_suppressed_callbacks(self, name):
        if self._cb_block[name]['count'] == 0:
            d = self._cb_block[name]
            defer_list = d['defer_list']
            d['defer_list'] = []
            d['defer_type'] = None

            for tup in defer_list:
                self._do_callbacks(*tup)

    def _do_callbacks(self, name, args, kwargs):
        result = False
        for tup in self.cb[name]:
            method = tup[0]
            # Extend callback args and keyword args by saved parameters
            cb_args = [self]
            cb_args.extend(args)
            cb_args.extend(tup[1])
            cb_kwargs = kwargs.copy()
            cb_kwargs.update(tup[2])

            try:
                # print("calling %s(%s, %s)" % (method, cb_args, cb_kwargs))
                res = method(*cb_args, **cb_kwargs)
                if res:
                    result = True

            except Exception as e:
                # Catch exception because we need to iterate to the other
                # callbacks
                try:
                    (type, value, tb) = sys.exc_info()
                    tb_str = "\n".join(traceback.format_tb(tb))

                except Exception:
                    tb_str = "Traceback information unavailable."

                if hasattr(self, 'logger'):
                    self.logger.error("Error making callback '%s': %s" % (
                        name, str(e)))
                    self.logger.error("Traceback:\n%s" % (tb_str))
                else:
                    print("Error making callback '%s': %s" % (
                        name, str(e)))
                    print("Traceback:\n%s" % (tb_str))

        return result

    # this can be overridden by a mixin
    make_ui_callback = make_callback

class SuppressCallback(object):
    def __init__(self, cb_obj, cb_name, defer_type=None):
        self.cb_obj = cb_obj
        self.cb_name = cb_name
        self.defer_type = defer_type

    def __enter__(self):
        try:
            d = self.cb_obj._cb_block[self.cb_name]
            d['count'] += 1
            d['defer_type'] = self.defer_type
        except KeyError:
            pass
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        try:
            d = self.cb_obj._cb_block[self.cb_name]
            d['count'] -= 1

            self.cb_obj.do_suppressed_callbacks(self.cb_name)
        except KeyError:
            pass
        return False

# END


text:
M = (2**61)-1 # a largish prime
R = 3
HASH_SIZE = 64
MAX_VALUE = 2**HASH_SIZE

class UniversalHash
  def self.build
    UniversalHash.new((0...R).collect{ (rand() * M).to_i })
  end
  def self.build_with a
    raise "expected a.size==#{R} to correspond to shingle length" unless a.size==R
    UniversalHash.new a
  end

  def initialize a
    @a = a
  end

  def hash string
    raise "only works with strings" unless string.is_a? String
    raise "expects strings with length #{R}" unless string.length==R
    value = 0
    string.bytes.each_with_index do |char, index|
      value += (@a[index] * char) % M
    end
    value % MAX_VALUE
  end

end


text:
// -----------------------------------------------------------------------
//  <copyright file="VisualizerPersistentTestRunStore.cs" company="Akka.NET Project">
//      Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com>
//      Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net>
//  </copyright>
// -----------------------------------------------------------------------

using System.IO;

using Akka.MultiNodeTestRunner.Shared.Reporting;

namespace Akka.MultiNodeTestRunner.Shared.Persistence
{
    /// <summary>
    /// Stores test run as a html page.
    /// </summary>
    public class VisualizerPersistentTestRunStore : IPersistentTestRunStore
    {
        public bool SaveTestRun(string filePath, TestRunTree data)
        {
            var template = new VisualizerRuntimeTemplate { Tree = data };
            var content = template.TransformText();
            var fullPath = Path.GetFullPath(filePath);
            File.WriteAllText(fullPath, content);

            return true;
        }
    }
}


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\ParamConverter\ParamConverterManager.
 */

namespace Drupal\Core\ParamConverter;

use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Symfony\Component\Routing\RouteCollection;

/**
 * Manages converter services for converting request parameters to full objects.
 *
 * A typical use case for this would be upcasting (converting) a node id to a
 * node entity.
 */
class ParamConverterManager implements ParamConverterManagerInterface {

  /**
   * Array of loaded converter services keyed by their ids.
   *
   * @var array
   */
  protected $converters = array();

  /**
   * {@inheritdoc}
   */
  public function addConverter(ParamConverterInterface $param_converter, $id) {
    $this->converters[$id] = $param_converter;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getConverter($converter) {
    if (isset($this->converters[$converter])) {
      return $this->converters[$converter];
    }
    else {
      throw new \InvalidArgumentException(sprintf('No converter has been registered for %s', $converter));
    }
  }

  /**
   * {@inheritdoc}
   */
  public function setRouteParameterConverters(RouteCollection $routes) {
    foreach ($routes->all() as $route) {
      if (!$parameters = $route->getOption('parameters')) {
        // Continue with the next route if no parameters have been defined.
        continue;
      }

      // Loop over all defined parameters and look up the right converter.
      foreach ($parameters as $name => &$definition) {
        if (isset($definition['converter'])) {
          // Skip parameters that already have a manually set converter.
          continue;
        }

        foreach (array_keys($this->converters) as $converter) {
          if ($this->getConverter($converter)->applies($definition, $name, $route)) {
            $definition['converter'] = $converter;
            break;
          }
        }
      }

      // Override the parameters array.
      $route->setOption('parameters', $parameters);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function convert(array $defaults) {
    /** @var $route \Symfony\Component\Routing\Route */
    $route = $defaults[RouteObjectInterface::ROUTE_OBJECT];

    // Skip this enhancer if there are no parameter definitions.
    if (!$parameters = $route->getOption('parameters')) {
      return $defaults;
    }

    // Invoke the registered converter for each parameter.
    foreach ($parameters as $name => $definition) {
      if (!isset($defaults[$name])) {
        // Do not try to convert anything that is already set to NULL.
        continue;
      }

      if (!isset($definition['converter'])) {
        // Continue if no converter has been specified.
        continue;
      }

      // If a converter returns NULL it means that the parameter could not be
      // converted.
      $defaults[$name] = $this->getConverter($definition['converter'])->convert($defaults[$name], $definition, $name, $defaults);
      if (!isset($defaults[$name])) {
        throw new ParamNotConvertedException(sprintf('The "%s" parameter was not converted for the path "%s" (route name: "%s")', $name, $route->getPath(), $defaults[RouteObjectInterface::ROUTE_NAME]));
      }
    }

    return $defaults;
  }

}


text:
module PaulDiagnostic
  VERSION = "0.0.4"
end


text:
description: "How to upgrade your installation of Telepresence and install previous versions."
---

import Platform from '@src/components/Platform';

# Upgrade Process
The Telepresence CLI will periodically check for new versions and notify you when an upgrade is available.  Running the same commands used for installation will replace your current binary with the latest version.

<Platform.TabGroup>
<Platform.MacOSTab>

```shell
# Intel Macs

# Upgrade via brew:
brew upgrade datawire/blackbird/telepresence

# OR upgrade manually:
# 1. Download the latest binary (~60 MB):
sudo curl -fL https://app.getambassador.io/download/tel2/darwin/amd64/$dlVersion$/telepresence -o /usr/local/bin/telepresence

# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence

# Apple silicon Macs

# Install via brew:
brew install datawire/blackbird/telepresence-arm64

# OR Install manually:
# 1. Download the latest binary (~60 MB):
sudo curl -fL https://app.getambassador.io/download/tel2/darwin/arm64/$dlVersion$/telepresence -o /usr/local/bin/telepresence

# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence
```

</Platform.MacOSTab>
<Platform.GNULinuxTab>

```shell
# 1. Download the latest binary (~50 MB):
sudo curl -fL https://app.getambassador.io/download/tel2/linux/amd64/$dlVersion$/telepresence -o /usr/local/bin/telepresence

# 2. Make the binary executable:
sudo chmod a+x /usr/local/bin/telepresence
```

</Platform.GNULinuxTab>
<Platform.WindowsTab>

```powershell
# Windows is in Developer Preview, here is how you can install it:
# Make sure you run the following from Powershell as Administrator
# 1. Download the latest windows zip containing telepresence.exe and its dependencies (~50 MB):
curl -fL https://app.getambassador.io/download/tel2/windows/amd64/$dlVersion$/telepresence.zip -o telepresence.zip

# 2. Unzip the zip file to a suitable directory + cleanup zip
Expand-Archive -Path telepresence.zip
Remove-Item 'telepresence.zip'
cd telepresence

# 3. Run the install-telepresence.ps1 to install telepresence's dependencies. It will install telepresence to
# C:\telepresence by default, but you can specify a custom path by passing in -Path C:\my\custom\path
Set-ExecutionPolicy Bypass -Scope Process
.\install-telepresence.ps1

# 4. Remove the unzipped directory
cd ..
Remove-Item telepresence
# 5. Close your current Powershell and open a new one. Telepresence should now be usable as telepresence.exe
```

</Platform.WindowsTab>
</Platform.TabGroup>

After upgrading your CLI you must stop any live Telepresence processes by issuing `telepresence quit`, then upgrade the Traffic Manager by running `telepresence connect`

**Note** that if the Traffic Manager has been installed via Helm, `telepresence connect` will never upgrade it. If you wish to upgrade a Traffic Manager that was installed via the Helm chart, please see the [Helm documentation](../helm#upgrading-the-traffic-manager)


text:
<select>
<optgroup title="A" style="display:contents">
<option>
</select>
<script>
var optgroup = document.querySelector('optgroup');
window.getSelection().collapse(optgroup, 2);
</script>


text:
Runs a slideshow on ChromeCast Devices based on URLs sent from the PinCast Sender App.

The Repository for the Sender App (for Android), can be found here.


text:
package org.spongepowered.common.event.filter.delegate;

import static org.objectweb.asm.Opcodes.ACONST_NULL;
import static org.objectweb.asm.Opcodes.ALOAD;
import static org.objectweb.asm.Opcodes.ARETURN;
import static org.objectweb.asm.Opcodes.ASTORE;
import static org.objectweb.asm.Opcodes.CHECKCAST;
import static org.objectweb.asm.Opcodes.DUP;
import static org.objectweb.asm.Opcodes.IFEQ;
import static org.objectweb.asm.Opcodes.IFNE;
import static org.objectweb.asm.Opcodes.ILOAD;
import static org.objectweb.asm.Opcodes.INSTANCEOF;
import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
import static org.objectweb.asm.Opcodes.ISTORE;

import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Type;
import org.spongepowered.api.event.filter.Getter;
import org.spongepowered.api.util.Tuple;
import org.spongepowered.common.event.manager.ListenerClassVisitor;

import java.lang.reflect.Method;
import java.util.Optional;

public class GetterFilterSourceDelegate implements ParameterFilterSourceDelegate {

    private final Getter anno;

    public GetterFilterSourceDelegate(final Getter a) {
        this.anno = a;
    }

    @Override
    public Tuple<Integer, Integer> write(
        final ClassWriter cw, final MethodVisitor mv, final ListenerClassVisitor.DiscoveredMethod method,
        final int paramIdx, int local, final int[] plocals, final ListenerClassVisitor.ListenerParameter[] params
    ) throws ClassNotFoundException {
        final Class<?> targetType = method.classByLoader(params[paramIdx].type().getClassName());
        final Class<?> eventClass = method.classByLoader(params[0].type().getClassName());
        final String targetMethod = this.anno.value();
        Method targetMethodObj = null;

        try {
            targetMethodObj = eventClass.getMethod(targetMethod);
        } catch (final NoSuchMethodException e) {
            throw new IllegalArgumentException(String.format("Method %s specified by getter annotation was not found in type %s", targetMethod, eventClass.getName()));
        }

        if (targetMethodObj.getParameterCount() != 0) {
            throw new IllegalArgumentException(
                    "Method " + targetMethodObj.toGenericString() + " specified by getter annotation has non-zero parameter count");
        }
        if (!targetMethodObj.getReturnType().equals(Optional.class) && !targetMethodObj.getReturnType().isAssignableFrom(targetType)) {
            throw new IllegalArgumentException("Method " + targetMethodObj.toGenericString() + " does not return the correct type. Expected: "
                    + targetType.getName() + " Found: " + targetMethodObj.getReturnType().getName());
        }

        final Type returnType = Type.getReturnType(targetMethodObj);
        final Class<?> declaringClass = targetMethodObj.getDeclaringClass();
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, Type.getInternalName(declaringClass));
        final int op = declaringClass.isInterface() ? INVOKEINTERFACE : INVOKEVIRTUAL;
        mv.visitMethodInsn(op, Type.getInternalName(declaringClass), targetMethod, "()" + returnType.getDescriptor(), declaringClass.isInterface());
        final int paramLocal = local++;
        mv.visitVarInsn(returnType.getOpcode(ISTORE), paramLocal);
        if (!targetMethodObj.getReturnType().isPrimitive()) {
            final Label failure = new Label();
            final Label success = new Label();
            if (Optional.class.equals(targetMethodObj.getReturnType()) && !Optional.class.equals(targetType)) {
                // Unwrap the optional
                mv.visitVarInsn(ALOAD, paramLocal);

                mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Optional", "isPresent", "()Z", false);
                mv.visitJumpInsn(IFEQ, failure);

                mv.visitVarInsn(ALOAD, paramLocal);
                mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Optional", "get", "()Ljava/lang/Object;", false);
                mv.visitInsn(DUP);
                mv.visitVarInsn(ASTORE, paramLocal);
            } else {
                mv.visitVarInsn(returnType.getOpcode(ILOAD), paramLocal);
            }
            mv.visitTypeInsn(INSTANCEOF, Type.getInternalName(targetType));
            mv.visitJumpInsn(IFNE, success);
            mv.visitLabel(failure);
            mv.visitInsn(ACONST_NULL);
            mv.visitInsn(ARETURN);
            mv.visitLabel(success);
        }

        return new Tuple<>(local, paramLocal);
    }

}


text:
CREATE TABLE IF NOT EXISTS `person` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(30) NOT NULL COMMENT 'Username',
  `password` varchar(35) NOT NULL COMMENT 'MD5 password hash',
  `mail` varchar(40) NOT NULL COMMENT 'E-mail',
  `total` int(11) NOT NULL COMMENT 'Number of games played',
  `victories` int(11) NOT NULL COMMENT 'Number of games won',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `roomHistory` (
  `personID` int(11) NOT NULL COMMENT 'Player',
  `roomID` int(11) NOT NULL COMMENT 'Room',
  `time` float NOT NULL COMMENT 'Total time spent answering',
  `answers` int(11) NOT NULL COMMENT 'Total number of answers',
  KEY `roomID` (`roomID`),
  KEY `personID` (`personID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `room` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL COMMENT 'Room name',
  `finished` datetime NOT NULL COMMENT 'Time game finished',
  `winnerID` int(11) NOT NULL COMMENT 'Winner',
  PRIMARY KEY (`id`),
  KEY `winnerID` (`winnerID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

ALTER TABLE `roomHistory`
  ADD CONSTRAINT `roomHistory_room` FOREIGN KEY (`roomID`) REFERENCES `room` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `roomHistory_person` FOREIGN KEY (`personID`) REFERENCES `person` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE `room`
  ADD CONSTRAINT `room_person` FOREIGN KEY (`winnerID`) REFERENCES `person` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;


text:
package main

import "regexp"

func init() {
	funcMap["regexReplace"] = &tmplFuncStruct{
		short: "Replace values using a regular expression.",
		examples: []string{
			`{{ "this is something" | %s "(this) is " "[$1] was " }}`,
		},
		fn: func(search, replace, src string) (string, error) {
			re, err := regexp.Compile(search)
			if err != nil {
				return "", err
			}
			return re.ReplaceAllString(src, replace), nil
		},
	}
}


text:
import argparse
import calendar
import json
import re
import time
import os
import sys
from datetime import datetime
from time import mktime

DODO_FILE = os.path.join(os.getcwd(), 'DODO')
VERSION = "0.99"

class TerminalColors(object):
    """
    Color class for listing out dodos
    """
    HEADER = '\033[95m'
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    YELLOW = '\033[93m'
    RED = '\033[91m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'
    END = '\033[0m'

    def __init__(self):
        pass

statuses = {
    '+': 'add',
    '*': 'accepted',
    '-': 'rejected',
    '#': 'working',
    '.': 'complete'
}

def pretty_date(date_string):
    timestamp = calendar.timegm((datetime.strptime(date_string, "%d-%m-%y %H:%M")).timetuple())
    date = datetime.fromtimestamp(timestamp)
    diff = datetime.now() - date
    s = diff.seconds
    if diff.days > 7 or diff.days < 0:
        return date.strftime('%d %b %y')
    elif diff.days == 1:
        return '1 day ago'
    elif diff.days > 1:
        return '{} days ago'.format(diff.days)
    elif s <= 1:
        return 'just now'
    elif s < 60:
        return '{} seconds ago'.format(s)
    elif s < 120:
        return '1 minute ago'
    elif s < 3600:
        return '{} minutes ago'.format(s/60)
    elif s < 7200:
        return '1 hour ago'
    else:
        return '{} hours ago'.format(s/3600)

def parse_dodo(line):
    if line:
        do_id = re.search("#\d+", line).group()[1:]
        do_status = re.search(r'\[\[\W+\]\]', line).group()[2:-2]
        do_time = re.search(r'(<<.+>>)', line)
        do_description = re.search(r'({{.+}})', line)
        if do_time:
            do_time = do_time.group().replace("<<", "").replace(">>", "")
        do_user = re.search(r'(\(\(.+\)\))', line)
        if do_user:
            do_user = do_user.group().replace("((", "").replace("))", "")
        if do_description:
            do_description = do_description.group().replace("{{", "").replace("}}", "")
        return {
            "id": do_id,
            "time": do_time,
            "user": do_user,
            "status": do_status,
            "description": do_description
        }

def dodo_load(args):
    global DODO_FILE
    do_dict = {}
    DODO_FILE = args.file or DODO_FILE
    with open(DODO_FILE, 'r') as file_inst:
        contents = file_inst.readlines()
        for content in contents:
            do_data = parse_dodo(content)
            do_dict.update({do_data["id"]: do_data})
    return do_dict

def dodo_unload(final_do_base):
    content = ""
    for key, value in sorted(iter(final_do_base.items()), key=lambda key_value: int(key_value[0])):
        content += "#%s [[%s]] <<%s>> ((%s)) {{%s}}\n" % (value["id"], value["status"], value["time"],
                                                          value["user"], value["description"])
    dodo_write(content, "w")

def dodo_init(args):
    file_name = args.file or DODO_FILE
    try:
        try:
            open(file_name, "r")
            print("DoDo already exist.")
        except IOError:
            file_inst = open(file_name, "w")
            file_inst.close()
            print("Successfully initialized DoDo")
    except IOError:
        print("Cannot create file in the following location: %s" % file_name)

def dodo_write(content, mode="a"):
    global DODO_FILE, do_base
    file_inst = open(DODO_FILE, mode)
    file_inst.write(content)
    file_inst.close()
    dodo_list()

def dodo_new_id ():
    if len (do_base) == 0:
        return "1"
    else:
        return str(max(int(id) for id in do_base.keys()) + 1)

def dodo_change_status(args, mod_do_base, status):
    if not args.id:
        print("ID (-id) can't be empty. May be try creating the task first")
        return
    do_entry = mod_do_base.get(args.id)
    if do_entry:
        do_entry["status"] = status
        if args.desc:
            do_entry["description"] = args.desc
        if args.user:
            do_entry["user"] = args.user
        if args.time:
            do_entry["time"] = args.time
    else:
        if not args.desc:
            print("Description (-d) can't be empty")
            return
        do_id = dodo_new_id ()
        do_description = args.desc
        do_user = args.user
        do_time = args.time or time.strftime("%d-%m-%y %H:%M", time.gmtime())
        mod_do_base[do_id] = {
            "id": do_id,
            "time": do_time,
            "user": do_user,
            "status": status,
            "description": do_description
        }
    dodo_unload(mod_do_base)
    return

def dodo_add(args):
    """
    + add/proposed
    * accepted
    - rejected
    # working
    . complete
    """
    do_user = args.user
    if args.operation in ["add", "propose", "c"]:
        if args.id:
            print("Error: DoDo assigns id for you.")
            exit()
        do_id = dodo_new_id ()
        do_description = args.desc
        do_time = args.time or time.strftime("%d-%m-%y %H:%M", time.gmtime())
        do_base[do_id] = {
            "id": do_id,
            "time": do_time,
            "user": do_user,
            "status": "+",
            "description": do_description
        }
        dodo_unload(do_base)
    elif args.operation == "accept":
        dodo_change_status(args, do_base, "*")
    elif args.operation == "reject":
        dodo_change_status(args, do_base, "-")
    elif args.operation == "workon":
        dodo_change_status(args, do_base, "#")
    elif args.operation == "finish":
        dodo_change_status(args, do_base, ".")
    elif args.operation in ["remove" or "d"]:
        try:
            do_base.pop(args.id)
        except KeyError:
            print("No task with id %s" % args.id)
        dodo_unload(do_base)
    elif args.operation == "flush":
        for do_entry in list(do_base.values()):
            if do_entry["status"] in ["-", "."]:
                do_base.pop(do_entry["id"])
        dodo_unload(do_base)
    return

def dodo_list():
    global do_base
    print("%s%sID\tStatus\t\tDate(-t)\tOwner(-u)\t\tDescription (-d)\n%s" % (TerminalColors.BOLD,
                                                                             TerminalColors.UNDERLINE,
                                                                             TerminalColors.END))
    for key, value in sorted(iter(do_base.items()), key=lambda key_value1: int(key_value1[0])):
        color = TerminalColors.YELLOW
        if value["status"] == ".":
            color = TerminalColors.GREEN
        elif value["status"] in ["-", 'x']:
            color = TerminalColors.RED
        elif value["status"] == "#":
            color = TerminalColors.UNDERLINE + TerminalColors.YELLOW
        elif value["status"] == "+":
            color = TerminalColors.BLUE
        user = value["user"] if value["user"] != "None" else "anonymous"
        human_time = pretty_date(value["time"])
        print("%s%s\t[%s]\t\t%s\t(%s)\t\t%s%s" % (color, value["id"], value["status"], human_time,
                                                  user, value["description"], TerminalColors.END))
    print("\n%sAvailable Operations: c accept propose reject workon finish remove d flush\n" \
          "Available Options: -id -d(description) -u(user) -t(time) -f(file)\n" \
          "Status: + proposed - rejected * accepted # working . complete%s" % (
              TerminalColors.BOLD, TerminalColors.END))

def dodo_import(args):
    """
    Sample import JSON format (same as taskwarrior export format)
    {"id":1,"description":"Read Docs Now","entry":"20150405T020324Z","status":"pending",
    "uuid":"1ac1893d-db66-40d7-bf67-77ca7c51a3fc","urgency":"0"}
    """
    do_user = args.user
    json_file = args.input
    json_source = json.loads(open(json_file).read())
    for task in json_source:
        do_id = dodo_new_id ()
        do_description = task["description"]
        utc_time = time.strptime(task["entry"], "%Y%m%dT%H%M%S%fZ")
        do_time = time.strftime("%d-%m-%y %H:%M", utc_time)
        do_status = "+"
        if task["status"] == "pending":
            do_status = "+"
        if task["status"] == "completed":
            do_status = "."
        do_base[do_id] = {
            "id": do_id,
            "time": do_time,
            "user": do_user,
            "status": do_status,
            "description": do_description
        }
    dodo_unload(do_base)
    print("Imported %d tasks successfully" % len(json_source))

def dodo_export(args):
    """
    {"id":1,"description":"Read Docs Now","entry":"20150405T020324Z","status":"pending",
    "uuid":"1ac1893d-db66-40d7-bf67-77ca7c51a3fc","urgency":"0"}
    Time is in UTC
    """
    dodo_data = []
    for instance in sorted(list(do_base.values()), key=lambda value: int(value["id"])):
        dodo_data.append({
            "id": instance["id"],
            "time": instance["time"],
            "user": instance["user"],
            "status": statuses[instance["status"]],
            "description": instance["description"]
        }
        )
    if args.output:
        try:
            file_name = args.output
            file_inst = open(file_name, "w")
            file_inst.write(json.dumps(dodo_data))
            file_inst.close()
            print("%sExported DODO to %s%s" % \
                  (TerminalColors.GREEN, file_name, TerminalColors.END))
        except IOError:
            print("%sExport failed; Check for permission to create/edit %s%s" % \
                  (TerminalColors.RED, args.output, TerminalColors.END))
    else:
        print("%sUse -e or --export to <filename.json> to export to a file.%s" % \
              (TerminalColors.YELLOW, TerminalColors.END))
        print("%s" % TerminalColors.GREEN)
        print(dodo_data)
        print("%s" % TerminalColors.END)

def dodo_switch(args):
    global do_base
    if args.operation == "init":
        dodo_init(args)
    elif args.operation in ['add', 'propose', 'accept', 'reject', 'workon', 'finish', 'flush', 'remove', "c", "d"]:
        dodo_add(args)
    elif args.operation == 'import':
        dodo_import(args)
    elif args.operation == 'export':
        dodo_export(args)
    else:
        dodo_list()

if __name__ == "__main__":
    default_operation = 'list'
    default_user = os.path.split(os.path.expanduser('~'))[-1]
    parser = argparse.ArgumentParser()
    parser.add_argument("operation", nargs='?', default=default_operation,
                        choices=[
                            'accept',
                            'add',
                            'finish',
                            'flush',
                            'list',
                            'propose',
                            'reject',
                            'remove',
                            'workon'
                        ],
                        help="The operation to perform")
    parser.add_argument("quick_access", nargs='?', default='',
                        help="Task ID for a operation or Description for the new task")
    parser.add_argument("-d", "--desc", "--description",
                        help="Task Description")
    parser.add_argument("-u", "--user", default=default_user, help="User ID")
    parser.add_argument("-t", "--time",
                        help="Expected/Completed Date - 11-03-2015")
    parser.add_argument("--id", help="List all existing dodos")
    parser.add_argument("-f", "--file", help="DODO filename")
    parser.add_argument("-i", "--input", help="Import from JSON file")
    parser.add_argument("-o", "--output", help="Export to JSON file")
    arguments = parser.parse_args()

    if (arguments.operation == default_operation
        and not os.path.isfile(arguments.file or DODO_FILE)):
        parser.print_help()
        sys.exit(0)

    quick_access = arguments.quick_access
    if quick_access:
        if arguments.quick_access.isdigit():
            arguments.id = quick_access
        elif quick_access:
            arguments.desc = quick_access
    global do_base
    do_base = {}
    if arguments.operation == "init":
        dodo_init(arguments)
    else:
        do_base = dodo_load(arguments)
        dodo_switch(arguments)


text:
SBT RAML Plugin
===============

[![Build Status](https://travis-ci.org/eigengo/sbt-raml-plugin.png?branch=master)](https://travis-ci.org/eigengo/sbt-raml-plugin)

The purpose of this plugin is to provide syntax checking and documentation generator for your RAML API definitions.

It exposes two tasks: ``raml:verify`` and ``raml:doc``. The ``verify`` task performs syntax and include resolution checks,
if it succeeds, then your RAML definitions are valid, and can be used in some testing tool. The ``doc`` task takes the
RAML definitions and generates HTML documentations.

Usage
=====

Write the RAML descriptors in ``src/raml``. Your RAML files can ``include`` other RAML files, the verifier and documentation generator follows the naming & directory structure. To include the verifier and documentation generator, add the plugin to your ``project/plugins.sbt`` by

```scala
addSbtPlugin("org.eigengo" % "sbt-raml" % "0.1-SNAPSHOT")
```

Once you have the plugin, add

```scala
org.eigengo.sbtraml.RamlPlugin.settings
```

to your ``build.sbt``. This will add the RAML verify check to the ``compile`` task and documentation task to the
``publishLocal`` task.

---

Notes:
Both tasks use the ``source in Raml`` setting to point to a directory where the RAML files live. Future versions will
probably need ``stylesheet in Raml`` to indicate the location of a CSS file for the documentation, and ``target in Raml``
to specify the output directory for the HTML documentation.


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("Transcripter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Fachhochschule Brandenburg")]
[assembly: AssemblyProduct("Transcripter")]
[assembly: AssemblyCopyright("Copyright © Tobias Kiertscher 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]

// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("9808c9a8-23d2-4e99-bb13-b6cad1fc6c79")]

// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
//      Hauptversion
//      Nebenversion
//      Buildnummer
//      Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.2.0")]
[assembly: AssemblyFileVersion("0.3.2.0")]


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

// ------------------------------------------------------------------------

/**
 * Loader Class
 *
 * Loads views and files
 *
 * @package		CodeIgniter
 * @subpackage	Core
 * @category	Core
 * @author		EllisLab Dev Team
 * @link		http://ellislab.com
 */
class EE_Loader extends CI_Loader {

	public $_ci_view_path = ''; // deprecated, do not change, was private in 2.1.5 and will be private again in the near future
	private $ee_view_depth = 0;

	/**
	 * Load CI View
	 *
	 * This is extended to keep some backward compatibility for people
	 * changing _ci_view_path. I tried doing a getter/setter, but since all
	 * of CI's object references are stuck onto the loader when loading views
	 * I get access errors left and right. -pk
	 *
	 * @deprecated 2.6
	 */
	public function view($view, $vars = array(), $return = FALSE)
	{
		if ($this->ee_view_depth === 0 && $this->_ci_view_path != '')
		{
			ee()->load->library('logger');
			ee()->logger->deprecated('2.6', 'load::add_package_path()');

			$this->_ci_view_paths = array($this->_ci_view_path => FALSE) + $this->_ci_view_paths;
		}

		if (is_array($vars) && isset($vars['cp_page_title']))
		{
			ee()->view->cp_page_title = $vars['cp_page_title'];
		}

		$this->ee_view_depth++;

		$ret = parent::view($view, $vars, $return);

		$this->ee_view_depth--;

		if ($this->ee_view_depth === 0 && $this->_ci_view_path != '')
		{
			array_shift($this->_ci_view_paths);
		}

		return $ret;
	}

	// ------------------------------------------------------------------------

	/**
	 * Load EE View
	 *
	 * This is for limited use inside packages. It loads from EE's main cp
	 * theme folder and ignores the package's view folder. The main reason
	 * for doing this are layout things, like the glossary. Most developers
	 * will not need this. -pk
	 *
	 * @param	string
	 * @param	array 	variables to be loaded into the view
	 * @param	bool 	return or not
	 * @return	void
	 */
	public function ee_view($view, $vars = array(), $return = FALSE)
	{
		$ee_only = array();
		$orig_paths = $this->_ci_view_paths;

		// Regular themes cascade down to the first
		// path (APPPATH.'views'), so we copy them over
		// until we hit a third party or non_cascading path.

		foreach (array_reverse($orig_paths, TRUE) as $path => $cascade)
		{
			if (strpos($path, PATH_THIRD) !== FALSE OR $cascade === FALSE)
			{
				break;
			}

			$ee_only[$path] = TRUE;
		}

		// Temporarily replace them, load the view, and back again
		$this->_ci_view_paths = array_reverse($ee_only, TRUE);

		$ret = $this->view($view, $vars, $return);

		$this->_ci_view_paths = $orig_paths;

		return $ret;
	}

	// ------------------------------------------------------------------------

	/**
	 * $this->load->library('security') is deprecated as the CI_Security
	 * class has been moved to Core, so it is always loaded.  In order to ease
	 * the transition for third-party developers, we are extending the CI
	 * loader function to return NULL in the event a load function to Security
	 * is called.
	 *
	 * $this->load->library('security') is @deprecated, and this temporary
	 * workaround will be removed in a future version
	 */
	public function library($library = '', $params = NULL, $object_name = NULL)
	{
		if (is_array($library))
		{
			foreach($library as $read)
			{
				$this->library($read);
			}

			return;
		}

		if (strtolower($library) == 'security')
		{
			ee()->load->library('logger');
			ee()->logger->deprecated('2.6', 'The security library is always loaded.');
			return NULL;
		}

		return parent::library($library, $params, $object_name);
	}

	// ------------------------------------------------------------------------

	/**
	 * Add to the theme cascading
	 *
	 * Adds a theme to cascade down to. You probably don't
	 * need to call this. No really, don't.
	 */
	public function add_theme_cascade($theme_path)
	{
		$this->_ci_view_paths = array($theme_path => TRUE) + $this->_ci_view_paths;
	}

	// ------------------------------------------------------------------------

	/**
	 * Get top of package path
	 *
	 * We use this to allow package js/css loading, where we need to figure out
	 * a theme name. May be renamed in the future, don't use it.
	 */
	public function first_package_path()
	{
		reset($this->_ci_view_paths);
		return key($this->_ci_view_paths);
	}
}

/* End of file EE_Loader.php */
/* Location: ./system/expressionengine/core/EE_Loader.php */


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Root extends CI_Controller {

    public function __construct() {
        parent::__construct();
         if ($this->session->userdata['user_name'] != "admin"){
            redirect(site_url('login'));
        }
    }

    public function generate() {
        // Fill in data for the distinguished name to be used in the cert
        // You must change the values of these keys to match your name and
        // company, or more precisely, the name and company of the person/site
        // that you are generating the certificate for.
        // For SSL certificates, the commonName is usually the domain name of
        // that will be using the certificate, but for S/MIME certificates,
        // the commonName will be the name of the individual who will use the
        // certificate.
        $dn = array(
            "countryName" => "ID",
            "organizationName" => "OwnCA Beta Inc",
            "organizationalUnitName" => "OwnCA Certification Authority",
            "commonName" => "OwnCA Certification Authority",
            "stateOrProvinceName" => "East Java",
            "emailAddress" => "admin@nana-pki-raizan.c9.io"
        );

        $req_ext = array(
            "keyUsage"                => "critical,keyCertSign,cRLSign",
            "basicConstraints"        => "critical,CA:true",
            "subjectKeyIdentifier"    => "hash"
        );

        $config = array(
            "digest_alg" => "sha256",
            "private_key_bits" => 2048,
            "private_key_type" => OPENSSL_KEYTYPE_RSA,
        );

        // Create the private and public key
        $privkey = openssl_pkey_new($config);

        // Generate a certificate signing request
        $csr = openssl_csr_new($dn, $privkey, $req_ext);

        // You will usually want to create a self-signed certificate at this
        // point until your CA fulfills your request.
        // This creates a self-signed cert that is valid for 365 days

        $bytes = openssl_random_pseudo_bytes(8, $cstrong);
        echo hexdec(bin2hex($bytes));
        $sscert = openssl_csr_sign($csr, null, $privkey, 365,$config,hexdec(bin2hex($bytes)));

        // Now you will want to preserve your private key, CSR and self-signed
        // cert so that they can be installed into your web server, mail server
        // or mail client (depending on the intended use of the certificate).
        // This example shows how to get those things into variables, but you
        // can also store them directly into files.
        // Typically, you will send the CSR on to your CA who will then issue
        // you with the "real" certificate.
        openssl_csr_export($csr, $csrout) and var_dump($csrout);
        openssl_x509_export($sscert, $certout) and var_dump($certout);
        openssl_pkey_export($privkey, $pkeyout, "ownca") and var_dump($pkeyout);

        // if ( ! write_file('certificates/ca/ca.crt', $certout, 'wb')) {
        //      echo 'Unable to write the file';
        // }
        // else {
        //      echo 'File written!';
        // }

        // //Show any errors that occurred here
        // while (($e = openssl_error_string()) !== false) {
        //     echo $e . "\n";
        // }
    }
}

/* End of file login.php */
/* Location: ./application/controllers/login.php */


text:
console.log('Hello jscoderetreat!');
'use strict';

function gof() {
    return {
        isAlive: function(numNeighbours, state) {
            var retValue = false;

            if (state) {

            }

            if (numNeighbours == 2 || numNeighbours == 3) {
                retValue = true;
            }

            return retValue;
        },
        getNumNeighbours: function(cell) {
            return 0;
        }
    }
}

exports.gof = gof;


text:
package turismo;

/**
 *
 * @author Luis
 */
public class Dos extends javax.swing.JFrame {
     String opcion, lugar, aux;
    Reglas objR = new Reglas();

    public Dos(String opcion) {
        initComponents();
        aux = opcion;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jBFrio = new javax.swing.JButton();
        jBCalienteH = new javax.swing.JButton();
        jBTempladoS = new javax.swing.JButton();
        jBSecoA = new javax.swing.JButton();
        jBTempladoH = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jBF = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(153, 255, 255));

        jLabel1.setText("¿Qué tipo de clima busca?");

        jBFrio.setText("Frío");
        jBFrio.setPreferredSize(new java.awt.Dimension(80, 75));
        jBFrio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBFrioActionPerformed(evt);
            }
        });

        jBCalienteH.setText("Caliente húmedo");
        jBCalienteH.setPreferredSize(new java.awt.Dimension(80, 75));
        jBCalienteH.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCalienteHActionPerformed(evt);
            }
        });

        jBTempladoS.setText("Calido humedo");
        jBTempladoS.setPreferredSize(new java.awt.Dimension(80, 75));
        jBTempladoS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBTempladoSActionPerformed(evt);
            }
        });

        jBSecoA.setText("Seco árido");
        jBSecoA.setPreferredSize(new java.awt.Dimension(80, 75));
        jBSecoA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSecoAActionPerformed(evt);
            }
        });

        jBTempladoH.setText("Templado húmedo");
        jBTempladoH.setPreferredSize(new java.awt.Dimension(80, 75));
        jBTempladoH.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBTempladoHActionPerformed(evt);
            }
        });

        jLabel2.setText("jLabel2");

        jBF.setText("Seco");
        jBF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBFActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addComponent(jLabel2)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jBFrio, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBSecoA, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(54, 54, 54)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jBCalienteH, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBF, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(41, 41, 41)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jBTempladoS, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBTempladoH, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(42, 42, 42))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(126, 126, 126))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(jLabel1)
                .addGap(65, 65, 65)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBFrio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBCalienteH, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBTempladoS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(71, 71, 71)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBSecoA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBTempladoH, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBF, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(46, 46, 46)
                .addComponent(jLabel2)
                .addContainerGap())
        );

        jMenu1.setText("Archivo");

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem2.setText("Salir");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Ventana");

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Principal");
        jMenu2.add(jMenuItem1);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(80, 80, 80))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed

    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jBFrioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBFrioActionPerformed
        opcion = "frio";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBFrioActionPerformed

    private void jBCalienteHActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCalienteHActionPerformed
        opcion = "caliente humedo";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBCalienteHActionPerformed

    private void jBTempladoSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBTempladoSActionPerformed
        opcion = "calido humedo";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBTempladoSActionPerformed

    private void jBSecoAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSecoAActionPerformed
        opcion = "seco arido";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBSecoAActionPerformed

    private void jBFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBFActionPerformed
        opcion = "seco";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBFActionPerformed

    private void jBTempladoHActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBTempladoHActionPerformed
        opcion = "templado humedo";
        lugar = objR.Corredor(aux,opcion);
        System.out.println("Escogiste:" + aux + "y" + lugar);
        Tres ventana = new Tres(lugar);
        setVisible(false);
        ventana.setVisible(true);
        ventana.setLocation(300, 150);
    }//GEN-LAST:event_jBTempladoHActionPerformed

    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Dos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Dos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Dos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Dos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Dos().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBCalienteH;
    private javax.swing.JButton jBF;
    private javax.swing.JButton jBFrio;
    private javax.swing.JButton jBSecoA;
    private javax.swing.JButton jBTempladoH;
    private javax.swing.JButton jBTempladoS;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}


text:
module Sdbport
  module Cli
    class Destroy

      def initialize
        @config = Config.new
      end

      def destroy
        opts       = read_options
        access_key = @config.access_key opts[:account]
        secret_key = @config.secret_key opts[:account]
        access_key = opts[:access_key] if opts[:access_key]
        secret_key = opts[:secret_key] if opts[:secret_key]

        logger = SdbportLogger.new :log_level => opts[:level]
        domain = Domain.new :name       => opts[:name],
                            :region     => opts[:region],
                            :access_key => access_key,
                            :secret_key => secret_key,
                            :logger     => logger
        exit 1 unless domain.destroy
      end

      def read_options
        Trollop::options do
          version Sdbport::VERSION
          banner <<-EOS

Destroy SimpleDB Domain

Usage:

sdbport destroy -a xxx -k yyy -r us-west-1 -n domain

EOS
          opt :help, "Display Help"
          opt :account, "Account Credentials", :type    => :string,
                                               :default => 'default'
          opt :level, "Log Level", :type => :string, :default => 'info'
          opt :name, "Simple DB Domain Name", :type => :string
          opt :region, "AWS Region", :type => :string
          opt :access_key, "AWS Access Key ID", :type  => :string,
                                                :short => 'k'
          opt :secret_key, "AWS Secret Access Key", :type => :string
        end
      end
    end
  end
end


text:
package org.wildfly.swarm.tools;

import java.io.InputStream;

import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.FileHeader;
import org.jboss.shrinkwrap.api.asset.Asset;

/**
 * @author George Gastaldi
 */
public class ZipFileHeaderAsset implements Asset {

    private final ZipFile zipFile;

    private final FileHeader fileHeader;

    public ZipFileHeaderAsset(ZipFile zipFile, FileHeader fileHeader) {
        this.zipFile = zipFile;
        this.fileHeader = fileHeader;
    }

    @Override
    public InputStream openStream() {
        try {
            return zipFile.getInputStream(fileHeader);
        } catch (ZipException e) {
            throw new RuntimeException("Could not open zip file stream", e);
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>管理者ログイン</title>
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/base.css"/>

                         SOMPOリペアサイト

                        <form class="form-horizontal" role="form">

                                    ログインID

                                    <input type="email" class="form-control" id="inputEmail" placeholder="ログインID" required>

                                    パスワード

                                    <input type="password" class="form-control" id="inputPassword" placeholder="パスワード" required>

                                            <input type="checkbox"/>
                                            パスワードを保存する

                                    <button type="submit" class="btn btn-primary btn-lg">
                                        ログインする</button>

                        </form>

                    パスワードを忘れた方は、
                    こちら


text:
using System;
using System.IO;
using System.Text;

namespace SwfSharp.Utils
{
    internal class BitReader : IDisposable
    {
        private const int BufferSize = 64;
        private BinaryReader _reader;
        private bool _keepOpen;
        private uint _bitPos;
        private ulong _tempBuf;
        private long _tagEndPos;

        public BitReader(Stream stream) : this(stream, false)
        {
        }

        public BitReader(Stream stream, bool keepOpen)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            _reader = new BinaryReader(stream);
            _keepOpen = keepOpen;
        }

        public long TagEndPos
        {
            get { return _tagEndPos; }
        }

        public void Align()
        {
            _bitPos = 0;
            _tempBuf = 0;
        }

        public bool ReadBoolBit()
        {
            return ReadBits(1) != 0;
        }

        public byte ReadUI8()
        {
            Align();
            return _reader.ReadByte();
        }

        public sbyte ReadSI8()
        {
            Align();
            return _reader.ReadSByte();
        }

        public ushort ReadUI16()
        {
            Align();
            return _reader.ReadUInt16();
        }

        public short ReadSI16()
        {
            Align();
            return _reader.ReadInt16();
        }

        public uint ReadUI24()
        {
            Align();
            return ReadBits(24);
        }

        public int ReadSI24()
        {
            Align();
            return ReadBitsSigned(24);
        }

        public uint ReadUI32()
        {
            Align();
            return _reader.ReadUInt32();
        }

        public int ReadSI32()
        {
            Align();
            return _reader.ReadInt32();
        }

        public ulong ReadUI64()
        {
            Align();
            return _reader.ReadUInt64();
        }

        public long ReadSI64()
        {
            Align();
            return _reader.ReadInt64();
        }

        public float ReadFloat16()
        {
            Align();
            return Half.ToHalf(_reader.ReadUInt16());
        }

        public float ReadFloat()
        {
            Align();
            return _reader.ReadSingle();
        }

        public double ReadDouble()
        {
            Align();
            return _reader.ReadDouble();
        }

        public float ReadFixed8()
        {
            return ReadSI16() / 256.0f;
        }

        public double ReadFixed()
        {
            return ReadSI32() / 65536.0;
        }

        public uint ReadBits(uint length)
        {
            if (length == 0)
            {
                return 0;
            }
            if (length > 32)
            {
                throw new ArgumentOutOfRangeException("length", "Cannot read more than 32 bits at a time");
            }

            while (_bitPos < length)
            {
                _tempBuf <<= 8;
                _tempBuf |= _reader.ReadByte();
                _bitPos += 8;
            }

            var shift = (int)(_bitPos - length);
            var mask = ulong.MaxValue >> (BufferSize - shift);

            var result = (uint)(_tempBuf >> shift);
            _tempBuf &= mask;
            if (shift == 0)
            {
                _tempBuf = 0;
            }
            _bitPos -= length;

            return result;
        }

        public int ReadBitsSigned(uint length)
        {
            if (length == 0)
            {
                return 0;
            }
            if (length > 32)
            {
                throw new ArgumentOutOfRangeException("length", "Cannot read more than 32 bits at a time");
            }
            var signBit = ReadBits(1);
            var bits = ReadBits(length - 1);
            var mask = (int)(uint.MaxValue << (int)(length - 1)) * signBit;
            var value = (int)(mask | bits);
            return value;
        }

        public double ReadFBits(uint length)
        {
            return ReadBitsSigned(length) / 65536.0;
        }

        public byte[] ReadBytes(int size)
        {
            Align();
            return _reader.ReadBytes(size);
        }

        public uint ReadEncodedU32()
        {
            uint result = ReadUI8();
            if ((result & 0x00000080) == 0)
            {
                return result;
            }
            result &= 0x0000007f;
            result |= (uint)(ReadUI8() << 7);
            if ((result & 0x00004000) == 0)
            {
                return result;
            }
            result &= 0x00003fff;
            result |= (uint)(ReadUI8() << 14);
            if ((result & 0x00200000) == 0)
            {
                return result;
            }
            result &= 0x001fffff;
            result |= (uint)(ReadUI8() << 21);
            if ((result & 0x10000000) == 0)
            {
                return result;
            }
            result &= 0x0fffffff;
            result |= (uint)(ReadUI8() << 28);
            return result;
        }

        public int ReadEncodedS32()
        {
            return (int)ReadEncodedU32();
        }

        public string ReadString()
        {
            var ms = new MemoryStream();
            byte b;
            while ((b = ReadUI8()) != 0)
            {
                ms.WriteByte(b);
            }
            return Encoding.UTF8.GetString(ms.GetBuffer(), 0, (int)ms.Position);
        }

        public string ReadString(int size)
        {
            Align();
            return Encoding.UTF8.GetString(ReadBytes(size), 0, size);
        }

        public string ReadSizeString()
        {
            var size = ReadUI8();
            var str = ReadString(size);
            if (str.Length > 0 && str[str.Length - 1] == '\0')
            {
                return str.Substring(0, str.Length - 1);
            }
            return str;
        }

        public void Close()
        {
            Dispose(true);
        }

        public void Dispose()
        {
            Dispose(true);
        }

        protected virtual void Dispose(bool disposing)
        {
            var reader = _reader;
            _reader = null;
            if (disposing && !_keepOpen)
            {
                ((IDisposable)reader).Dispose();
            }
            GC.SuppressFinalize(this);
        }

        public void BeginReadTag(int size)
        {
            _tagEndPos = _reader.BaseStream.Position + size;
        }

        public void EndReadTag()
        {
            _reader.BaseStream.Position = TagEndPos;
        }

        public bool AtTagEnd()
        {
            return _tagEndPos == _reader.BaseStream.Position;
        }

        public long TagBytesRemaining
        {
            get
            {
                return _tagEndPos - _reader.BaseStream.Position;
            }
        }

        public void Seek(long offset, SeekOrigin origin)
        {
            _reader.BaseStream.Seek(offset, origin);
            if (_bitPos != 0)
            {
                throw new NotSupportedException("BitPos must be 0 when seeking");
            }
        }

        public long Position
        {
            get { return _reader.BaseStream.Position; }
        }

        public int ReadExtendableCount()
        {
            int len = ReadUI8();
            if (len == byte.MaxValue)
            {
                len = ReadUI16();
            }
            return len;
        }

        public string ReadABCString()
        {
            return ReadString(ReadEncodedS32());
        }
    }
}


text:
using System.Collections.Generic;
using SGLibrary.Extend;

namespace SGLibrary.Framework.GridBind.WinForm
{
    public partial class GridBindBase<T>
    {
        public void OrderBy<TKey>(Func<T, TKey> keySelector)
        {
            if (grid.DataSource == null)
                return;

            var sourted = new List<T>();
            foreach(var item in new OrderedEnumerable<T, TKey>(grid.DataSource as IList<T>, keySelector, null, false).Each())
                sourted.Add(item);

            for (var i = 0; i < sourted.Count; i++)
                (grid.DataSource as IList<T>)[i] = sourted[i];

            this.Refresh();
        }

        public void OrderByDescending<TKey>(Func<T, TKey> keySelector)
        {
            if (grid.DataSource == null)
                return;

            var sourted = new List<T>();
            foreach (var item in new OrderedEnumerable<T, TKey>(grid.DataSource as IList<T>, keySelector, null, true).Each())
                sourted.Add(item);

            for (var i = 0; i < sourted.Count; i++)
                (grid.DataSource as IList<T>)[i] = sourted[i];

            this.Refresh();
        }
    }
}


text:
package admission

import (
	"reflect"
	"testing"

	kapi "k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/unversioned"

	u "github.com/openshift/origin/pkg/build/admission/testutil"
)

func TestGetBuild(t *testing.T) {
	build := u.Build().WithDockerStrategy()
	for _, version := range []string{"v1"} {
		pod := u.Pod().WithBuild(t, build.AsBuild(), version)
		resultBuild, resultVersion, err := GetBuildFromPod((*kapi.Pod)(pod))
		if err != nil {
			t.Fatalf("unexpected error: %v", err)
		}
		if resultVersion.Version != version {
			t.Errorf("unexpected version: %s", resultVersion)
		}
		if !reflect.DeepEqual(build.AsBuild(), resultBuild) {
			t.Errorf("%s: did not get expected build: %#v", version, resultBuild)
		}
	}
}

func TestSetBuild(t *testing.T) {
	build := u.Build().WithSourceStrategy()
	for _, version := range []string{"v1"} {
		pod := u.Pod().WithEnvVar("BUILD", "foo")
		groupVersion, err := unversioned.ParseGroupVersion(version)
		if err != nil {
			t.Fatalf("unexpected error: %v", err)
		}
		err = SetBuildInPod((*kapi.Pod)(pod), build.AsBuild(), groupVersion)
		if err != nil {
			t.Fatalf("unexpected error: %v", err)
		}
		resultBuild := pod.GetBuild(t)
		if !reflect.DeepEqual(build.AsBuild(), resultBuild) {
			t.Errorf("%s: did not get expected build: %#v", version, resultBuild)
		}
	}
}

func TestSetBuildLogLevel(t *testing.T) {
	build := u.Build().WithSourceStrategy()
	pod := u.Pod().WithEnvVar("BUILD", "foo")
	SetPodLogLevelFromBuild((*kapi.Pod)(pod), build.AsBuild())

	if len(pod.Spec.Containers[0].Args) == 0 {
		t.Errorf("Builds pod loglevel was not set")
	}

	if pod.Spec.Containers[0].Args[0] != "--loglevel=0" {
		t.Errorf("Default build pod loglevel was not set to 0")
	}

	build = u.Build().WithSourceStrategy()
	pod = u.Pod().WithEnvVar("BUILD", "foo")
	build.Spec.Strategy.SourceStrategy.Env = []kapi.EnvVar{{Name: "BUILD_LOGLEVEL", Value: "7", ValueFrom: nil}}
	SetPodLogLevelFromBuild((*kapi.Pod)(pod), build.AsBuild())

	if pod.Spec.Containers[0].Args[0] != "--loglevel=7" {
		t.Errorf("Build pod loglevel was not transferred from BUILD_LOGLEVEL environment variable: %#v", pod)
	}

}


text:
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="stylesheets/my-berkshire-stylesheet.css">

      BERKSHIRE HATHAWAY INC.
      3555 Farnam Street
      Omaha, NE 68131
      Official Home Page

A Message From Warren E. Buffett

Annual &amp Interim Reports

Updated August 7, 2015

Special Letters From Warren &amp Charlie RE:Past,Present and Future

Link to SEC Filings

Link pades to Berkshire Subsidiary Companies

Corporate Governance

Owner's Manual

Letters from Warren E. Buffett Regarding Pledges to Make Gifts of Berkshire Stock

News Releases

Updated August 10, 2015

Warren Buffett's Letters to Berkshire Shareholders

Updated February 28, 2015

Charlie Munger's Letters to Wesco Shareholders

Annual Meeting Information

Celebrating 50 years of a Profitable Partnership

(A commemorative book first sold at the 2015 Annual Meeting and now for sale on eBay.)

Comparative Rights and Relative Prices of Class A and B Stock

Berkshire Activewear

 FOR A FREE CAR INSURANCE RATE QUOTE THAT COULD SAVE YOU SUBSTANTIAL MONEY WWW.GEICO.COM OR CALL 1-888-395-6349, 24 HOURS A DAY

If you have any comments about our WEB page, you can either write us at the address shown above or e-mail us at berkshire@berkshirehathaway.com. However, due to the limited number of personnel in our corporate office, we are unable to provide a direct response.

Legal Disclaimer

Copyright &copy 1978-2015 Berkshire Hathaway Inc.


text:
<span *ngFor="let entry of (labels | entries)" title="Label: {{ entry.key }} = {{ entry.value }}">
  {{ entry.value }}
</span>


text:
{-# LANGUAGE ConstraintKinds, DeriveDataTypeable, GeneralizedNewtypeDeriving,
             RecordWildCards, TypeFamilies #-}

module Config
    ( askHpRelease
    , askGhcBinDistTarFile
    , askBuildConfig
    , addConfigOracle
    , askCabalExe
    , askStackExe
    )
    where

import Data.List (intercalate)
import Data.List.Split (splitOn)
import Development.Shake
import Development.Shake.Classes
import Development.Shake.FilePath
import Development.Shake.Rule

import Types
import Utils (version)

newtype HpReleaseQ = HpReleaseQ ()
    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
type instance RuleResult HpReleaseQ = Release

-- | Provide the Platform release information
-- The release information will be tracked as a dependency
askHpRelease :: Action Release
askHpRelease = askOracle $ HpReleaseQ ()

newtype GhcBinDistTarFileQ = GhcBinDistTarFileQ ()
    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
type instance RuleResult GhcBinDistTarFileQ = FilePath

-- | Provide the bindist tar file.
-- The filepath will be tracked as a dependency.
askGhcBinDistTarFile :: Action FilePath
askGhcBinDistTarFile = do
    tarFile <- askOracle $ GhcBinDistTarFileQ ()
    need [tarFile]
    return tarFile

newtype BuildConfigQ = BuildConfigQ ()
    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
type instance RuleResult BuildConfigQ = BuildConfig

-- | Provide the Platform release information
-- The release information will be tracked as a dependency
askBuildConfig :: Action BuildConfig
askBuildConfig = askOracle $ BuildConfigQ ()

newtype StackExeQ = StackExeQ ()
    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
type instance RuleResult StackExeQ = FilePath

-- | Provide the stack executable
-- The filepath will be tracked as a dependency
askStackExe :: Action FilePath
askStackExe = do
    stackexe <- askOracle $ StackExeQ ()
    need [stackexe]
    return stackexe

newtype CabalExeQ = CabalExeQ ()
    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
type instance RuleResult CabalExeQ = FilePath

-- | Provide the stack executable
-- The filepath will be tracked as a dependency
askCabalExe :: Action FilePath
askCabalExe = do
    cabalexe <- askOracle $ CabalExeQ ()
    need [cabalexe]
    return cabalexe

addConfigOracle :: Release -> FilePath -> (FilePath,FilePath) -> Maybe FilePath -> Bool -> Rules BuildConfig
addConfigOracle hpRel tarFile (cabalexe,stackexe) prefix includeExtra = do
    _ <- addOracle $
            \(HpReleaseQ _) -> return hpRel
    _ <- addOracle $
            \(GhcBinDistTarFileQ _) -> return tarFile
    _ <- addOracle $
            \(CabalExeQ _) -> return cabalexe
    _ <- addOracle $
            \(StackExeQ _) -> return stackexe
    _ <- addOracle $
            \(BuildConfigQ _) -> either fail return buildConfig
    either fail return buildConfig
  where
    buildConfig = extractBuildConfig hpRel tarFile prefix includeExtra

extractBuildConfig :: Release -> FilePath -> Maybe FilePath -> Bool
                        -> Either String BuildConfig
extractBuildConfig hpRel tarFile prefix bcIncludeExtra =
    if ok then Right $ BuildConfig {..}
          else Left $ "extractBuildConfig tar file unparseable: " ++ base
  where
    -- example tarFile: ghc-7.8.0.20140228-x86_64-apple-darwin-lion.tar.bz2
    base0 = dropExtension $ takeFileName tarFile
    base = (if takeExtension base0 == ".tar" then dropExtension else id) base0
    parts = splitOn "-" base
    (ghcPrefix : verStr : bcArch : bcOsVendor : bcOs : remainder) = parts
    bcGhcVersion = GhcVersion $ version verStr
    bcOsDistribution = intercalate "-" remainder
    bcHpVersion = relVersion hpRel
    bcPrefix = prefix
    ok = (length parts >= 5) && (ghcPrefix == "ghc")

newtype Fd = Fd CInt
-- data Fd = Fd CInt would also be valid

-- newtypes can have deriving clauses just like normal types
newtype Identity a = Identity a
  deriving (Eq, Ord, Read, Show)

-- record syntax is still allowed, but only for one field
newtype State s a = State { runState :: s -> (s, a) }

-- this is *not* allowed:
-- newtype Pair a b = Pair { pairFst :: a, pairSnd :: b }
-- but this is:
data Pair a b = Pair { pairFst :: a, pairSnd :: b }
-- and so is this:
newtype NPair a b = NPair (a, b)

data Person = Person { firstName :: String
                     , lastName :: String
                     , age :: Int
                     , height :: Float
                     , phoneNumber :: String
                     , flavor :: String
                     } deriving (Show)

addVectors :: (Num a) => (a, a) -> (a, a) -> (a, a)
addVectors (x1, y1) (x2, y2) = (x1 + x2, y1 + y2)

first :: (a, b, c) -> a
first (x, _, _) = x

second :: (a, b, c) -> b
second (_, y, _) = y

third :: (a, b, c) -> c
third (_, _, z) = z

myCompare :: (Ord a) => a -> a -> Ordering
a `myCompare` b
    | a > b     = GT
    | a == b    = EQ
    | otherwise = LT

3 `myCompare` 2

initials :: String -> String -> String
initials firstname lastname = [f] ++ ". " ++ [l] ++ "."
    where (f:_) = firstname
          (l:_) = lastname

head' :: [a] -> a
head' xs = case xs of [] -> error "No head for empty lists!"
                      (x:_) -> x

take' :: (Num i, Ord i) => i -> [a] -> [a]
take' n _
    | n <= 0   = []
take' _ []     = []
take' n (x:xs) = x : take' (n-1) xs

addThree :: (Num a) => a -> a -> a -> a
addThree = \x -> \y -> \z -> x + y + z

sum' :: (Num a) => [a] -> a
sum' xs = foldl (\acc x -> acc + x) 0 xs


text:
    {{ site.title }}{{ site.short-title }}

        {% for page in site.pages %}
          {% if page.title %}{% unless page.hidden %}
          {{ page.title }}
          {% endunless %}{% endif %}
        {% endfor %}