text:
from datetime import date

from . import GenericCalendarTest
from ..oceania import (
    Australia,
    AustralianCapitalTerritory,
    NewSouthWales,
    NorthernTerritory,
    Queensland,
    SouthAustralia,
    Tasmania,
    Hobart,
    Victoria,
    WesternAustralia,
    MarshallIslands,
    NewZealand
)

class AustraliaTest(GenericCalendarTest):
    cal_class = Australia

    def test_year_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 1, 26), holidays)
        self.assertIn(date(2013, 1, 28), holidays)  # Australia day shift
        self.assertIn(date(2013, 1, 26), holidays)
        self.assertIn(date(2013, 3, 29), holidays)  # Good Friday
        self.assertIn(date(2013, 4, 25), holidays)
        self.assertIn(date(2013, 12, 25), holidays)

    def test_new_year_shift(self):
        holidays = self.cal.holidays_set(2012)
        self.assertIn(date(2012, 1, 2), holidays)  # 1st was a sunday

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        self.assertIn(date(2010, 4, 26), holidays)

    def test_oceania_shift_2016(self):
        holidays = self.cal.holidays_set(2016)
        # Christmas day is on sunday in 2016
        # Boxing day is on 26th
        self.assertIn(date(2016, 12, 26), holidays)
        # Boxing day shift on 27th
        self.assertIn(date(2016, 12, 27), holidays)

    def test_oceania_shift_2009(self):
        holidays = self.cal.holidays_set(2009)
        # Boxing day is on saturday in 2009
        # Boxing day is on 26th
        self.assertIn(date(2009, 12, 26), holidays)
        # Boxing day shift on 28th
        self.assertIn(date(2009, 12, 28), holidays)

class AustraliaCapitalTerritoryTest(AustraliaTest):
    cal_class = AustralianCapitalTerritory

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 11), holidays)
        self.assertIn(date(2013, 3, 30), holidays)  # Easter Saturday
        self.assertIn(date(2013, 4, 1), holidays)  # Easter Monday
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 9, 30), holidays)  # Family & Community day
        self.assertIn(date(2013, 10, 7), holidays)  # Labour day october
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day

    def test_family_community_day_before_2007(self):
        # There were no Family and Community day before 2007
        for year in range(1970, 2007):
            self.assertIsNone(self.cal.get_family_community_day(year))
            holidays = self.cal.holidays(year)
            holidays = dict(holidays)
            labels = holidays.values()
            self.assertNotIn(self.cal._family_community_label, labels)

    def test_family_community_day_2007_2017_presence(self):
        # Family & Community day was included [2007 -> 2017]
        for year in range(2007, 2018):
            self.assertIsNotNone(self.cal.get_family_community_day(year))
            holidays = self.cal.holidays(year)
            holidays = dict(holidays)
            labels = holidays.values()
            self.assertIn(self.cal._family_community_label, labels)

    def test_family_community_day_after_2017(self):
        # Starting of 2018 this day would no longer exist
        for year in range(2018, date.today().year + 1):
            self.assertIsNone(self.cal.get_family_community_day(year))
            holidays = self.cal.holidays(year)
            holidays = dict(holidays)
            labels = holidays.values()
            print(labels)
            self.assertNotIn(self.cal._family_community_label, labels)

    def test_reconciliation_day(self):
        reconciliation_day = self.cal.get_reconciliation_day(2017)
        self.assertIsNone(reconciliation_day)

        reconciliation_day = self.cal.get_reconciliation_day(2018)
        self.assertEqual(reconciliation_day, (date(2018, 5, 28),
                                              "Reconciliation Day Shift"))

        reconciliation_day = self.cal.get_reconciliation_day(2019)
        self.assertEqual(reconciliation_day, (date(2019, 5, 27),
                                              "Reconciliation Day"))

class NewSouthWalesTest(AustraliaTest):
    cal_class = NewSouthWales

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 30), holidays)  # Good friday
        self.assertIn(date(2013, 3, 31), holidays)  # Easter Sunday
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 10, 7), holidays)  # Labour day october
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        self.assertIn(date(2010, 4, 26), holidays)

        # We don't shift if ANZAC day falls on a Saturday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 25), holidays)

class NorthernTerritoryTest(AustraliaTest):
    cal_class = NorthernTerritory

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 30), holidays)  # Easter Saturday
        self.assertIn(date(2013, 5, 6), holidays)  # May Day
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 8, 5), holidays)  # Picnic day
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        self.assertIn(date(2010, 4, 26), holidays)

        # We don't shift if ANZAC day falls on a Saturday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 25), holidays)

class QueenslandTest(AustraliaTest):
    cal_class = Queensland

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 30), holidays)  # Easter Saturday
        self.assertIn(date(2013, 5, 6), holidays)  # May's labour day
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        self.assertIn(date(2010, 4, 26), holidays)

        # We don't shift if ANZAC day falls on a Saturday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 25), holidays)

class SouthAustraliaTest(AustraliaTest):
    cal_class = SouthAustralia

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 11), holidays)  # Adelaide's cup
        self.assertIn(date(2013, 3, 30), holidays)  # Easter Saturday
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 10, 7), holidays)  # Labour day october
        self.assertIn(date(2013, 12, 26), holidays)  # Proclamation day

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        self.assertIn(date(2010, 4, 26), holidays)

        # We don't shift if ANZAC day falls on a Saturday
        holidays = self.cal.holidays_set(2015)
        self.assertIn(date(2015, 4, 25), holidays)

class TasmaniaTest(AustraliaTest):
    cal_class = Tasmania

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 11), holidays)  # Eight hours day
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day
        self.assertIn(date(2013, 4, 25), holidays)  # ANZAC day

    def test_anzac_shift(self):
        # We don't shift
        holidays = self.cal.holidays_set(2010)
        self.assertNotIn(date(2010, 4, 26), holidays)

class NonHobartTest(TasmaniaTest):
    def test_tasmania_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 11, 4), holidays)  # Recreation Day

class HobartTest(TasmaniaTest):
    cal_class = Hobart

    def test_hobart_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 2, 11), holidays)  # Royal Hobart Regatta
        # Recreation day not in Hobart
        self.assertNotIn(date(2013, 11, 4), holidays)  # Recreation Day

class VictoriaTest(AustraliaTest):
    cal_class = Victoria

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 11), holidays)  # Labours day in march
        self.assertIn(date(2013, 3, 30), holidays)  # Easter Saturday
        self.assertIn(date(2013, 6, 10), holidays)  # Queen's Bday
        self.assertIn(date(2013, 11, 5), holidays)  # Melbourne's cup
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day
        self.assertIn(date(2013, 4, 25), holidays)  # ANZAC day

    def test_anzac_shift(self):
        # We don't shift
        holidays = self.cal.holidays_set(2010)
        self.assertNotIn(date(2010, 4, 26), holidays)

class WesternAustraliaTest(AustraliaTest):
    cal_class = WesternAustralia

    def test_regional_specific_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 3, 4), holidays)  # Labours day in march
        self.assertIn(date(2013, 6, 3), holidays)  # Western Australia Day
        self.assertIn(date(2013, 12, 26), holidays)  # Boxing day
        # It is not possible to surely compute Queen's Birthday holiday in
        # The western Australia territory, since it's based on the Governor
        # Decision (it is typically the last Monday of September or the first
        # Monday of October)

class MarshallIslandsTest(GenericCalendarTest):
    cal_class = MarshallIslands

    def test_year_2013(self):
        holidays = self.cal.holidays_set(2013)
        self.assertIn(date(2013, 1, 1), holidays)  # new year
        self.assertIn(date(2013, 3, 3), holidays)  # Remembrance day
        self.assertIn(date(2013, 3, 29), holidays)  # (good friday)
        self.assertIn(date(2013, 5, 1), holidays)  # constitution day
        self.assertIn(date(2013, 7, 5), holidays)  # Fishermens
        self.assertIn(date(2013, 9, 6), holidays)  # labour day
        self.assertIn(date(2013, 9, 27), holidays)  # Manit Day
        self.assertIn(date(2013, 11, 17), holidays)  # presidents day
        self.assertIn(date(2013, 12, 6), holidays)  # gospel day
        self.assertIn(date(2013, 12, 25), holidays)  # Xmas
        self.assertIn(date(2013, 12, 31), holidays)  # new year's eve

class NewZealandTest(GenericCalendarTest):
    cal_class = NewZealand

    def test_year_2018(self):
        holidays = self.cal.holidays_set(2018)
        self.assertIn(date(2018, 1, 1), holidays)  # New Year's Day
        self.assertIn(date(2018, 1, 2), holidays)  # Day after New Year's Day
        self.assertIn(date(2018, 2, 6), holidays)  # Waitangi Day
        self.assertIn(date(2018, 3, 30), holidays)  # Good Friday
        self.assertIn(date(2018, 4, 2), holidays)  # Easter Monday
        self.assertIn(date(2018, 4, 25), holidays)  # ANZAC Day
        self.assertIn(date(2018, 6, 4), holidays)  # Queen's Birthday
        self.assertIn(date(2018, 10, 22), holidays)  # Labour Day
        self.assertIn(date(2018, 12, 25), holidays)  # Christmas Day
        self.assertIn(date(2018, 12, 26), holidays)  # Boxing Day

    def test_new_year_shift_on_sunday(self):
        holidays = self.cal.holidays_set(2012)
        # New Years was on a SUN
        # Day After New Years is on the 2nd
        self.assertIn(date(2012, 1, 2), holidays)
        # New Years Shift is on the 3rd
        self.assertIn(date(2012, 1, 3), holidays)
        # No shift of a shift
        self.assertNotIn(date(2012, 1, 4), holidays)

    def test_new_year_shift_on_saturday(self):
        holidays = self.cal.holidays_set(2022)
        # New Years is on a SAT
        # The day after is still a holiday
        self.assertIn(date(2022, 1, 2), holidays)
        # The shift is on the MON, 3rd
        self.assertIn(date(2022, 1, 3), holidays)
        # And there's a shift of the shift
        self.assertIn(date(2022, 1, 4), holidays)

    def test_anzac_shift(self):
        holidays = self.cal.holidays_set(2010)
        # 25th was a sunday
        # ANZAC Day is on 25th
        self.assertIn(date(2010, 4, 25), holidays)
        # ANZAC Day Shift is on 26th
        self.assertIn(date(2010, 4, 26), holidays)

    def test_waitangi_shift(self):
        holidays = self.cal.holidays_set(2016)
        # 6th was a saturday
        # Waitangi Day is on 6th
        self.assertIn(date(2016, 2, 6), holidays)
        # Waitangi Day Shift is on 7th
        self.assertIn(date(2016, 2, 8), holidays)

    def test_oceania_shift_2016(self):
        holidays = self.cal.holidays_set(2016)
        # Christmas day is on sunday in 2016
        # Boxing day is on 26th
        self.assertIn(date(2016, 12, 26), holidays)
        # Christmas day shift on 27th
        self.assertIn(date(2016, 12, 27), holidays)

    def test_oceania_shift_2009(self):
        holidays = self.cal.holidays_set(2009)
        # Boxing day is on saturday in 2009
        # Boxing day is on 26th
        self.assertIn(date(2009, 12, 26), holidays)
        # Boxing day shift on 28th
        self.assertIn(date(2009, 12, 28), holidays)


text:
People responsible for ports of Kubernetes to different environments. CC at
least one maintainer on relevant issues and PRs.

## OS Distributions

* RedHat, Fedora: [Clayton Coleman](https://github.com/smarterclayton), [Derek Carr](https://github.com/derekwaynecarr), [Scott Collier](https://github.com/scollier)
* CoreOS: [Kelsey Hightower](https://github.com/kelseyhightower)

## Providers / Environments

* GCE: [Brendan Burns](https://github.com/brendandburns), [Joe Beda](https://github.com/jbeda), [Daniel Smith](https://github.com/lavalamp), [Tim Hockin](https://github.com/thockin)
* Azure: [Jeff Mendoza](https://github.com/jeffmendoza)
* vSphere: [Pieter Noordhuis](https://github.com/pietern)
* Rackspace: [Ryan Richard](https://github.com/doublerr)
* oVirt: [Federico Simoncelli](https://github.com/simon3z)
* Local: [Derek Carr](https://github.com/derekwaynecarr)
* Vagrant: [Derek Carr](https://github.com/derekwaynecarr)
* CloudStack: [Sebastien Goasguen](https://github.com/runseb)
* Ubuntu: [Vipin Jain](https://github.com/jainvipin)

## hack/local-up-cluster.sh

* [Clayton Coleman](https://github.com/smarterclayton)

redpajama_set_name: RedPajamaGithub


text:
/*
 * This file implements code to read directories from disk.
 *
 * See namei.c for a description of directory organisation on disk.
 */

#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/slab.h>

#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
#include "squashfs_fs_i.h"
#include "squashfs.h"

static const unsigned char squashfs_filetype_table[] = {
	DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
};

/*
 * Lookup offset (f_pos) in the directory index, returning the
 * metadata block containing it.
 *
 * If we get an error reading the index then return the part of the index
 * (if any) we have managed to read - the index isn't essential, just
 * quicker.
 */
static int get_dir_index_using_offset(struct super_block *sb,
	u64 *next_block, int *next_offset, u64 index_start, int index_offset,
	int i_count, u64 f_pos)
{
	struct squashfs_sb_info *msblk = sb->s_fs_info;
	int err, i, index, length = 0;
	struct squashfs_dir_index dir_index;

	TRACE("Entered get_dir_index_using_offset, i_count %d, f_pos %lld\n",
					i_count, f_pos);

	/*
	 * Translate from external f_pos to the internal f_pos.  This
	 * is offset by 3 because we invent "." and ".." entries which are
	 * not actually stored in the directory.
	 */
	if (f_pos <= 3)
		return f_pos;
	f_pos -= 3;

	for (i = 0; i < i_count; i++) {
		err = squashfs_read_metadata(sb, &dir_index, &index_start,
				&index_offset, sizeof(dir_index));
		if (err < 0)
			break;

		index = le32_to_cpu(dir_index.index);
		if (index > f_pos)
			/*
			 * Found the index we're looking for.
			 */
			break;

		err = squashfs_read_metadata(sb, NULL, &index_start,
				&index_offset, le32_to_cpu(dir_index.size) + 1);
		if (err < 0)
			break;

		length = index;
		*next_block = le32_to_cpu(dir_index.start_block) +
					msblk->directory_table;
	}

	*next_offset = (length + *next_offset) % SQUASHFS_METADATA_SIZE;

	/*
	 * Translate back from internal f_pos to external f_pos.
	 */
	return length + 3;
}

static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)
{
	struct inode *inode = file_inode(file);
	struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
	u64 block = squashfs_i(inode)->start + msblk->directory_table;
	int offset = squashfs_i(inode)->offset, length, dir_count, size,
				type, err;
	unsigned int inode_number;
	struct squashfs_dir_header dirh;
	struct squashfs_dir_entry *dire;

	TRACE("Entered squashfs_readdir [%llx:%x]\n", block, offset);

	dire = kmalloc(sizeof(*dire) + SQUASHFS_NAME_LEN + 1, GFP_KERNEL);
	if (dire == NULL) {
		ERROR("Failed to allocate squashfs_dir_entry\n");
		goto finish;
	}

	/*
	 * Return "." and  ".." entries as the first two filenames in the
	 * directory.  To maximise compression these two entries are not
	 * stored in the directory, and so we invent them here.
	 *
	 * It also means that the external f_pos is offset by 3 from the
	 * on-disk directory f_pos.
	 */
	while (file->f_pos < 3) {
		char *name;
		int i_ino;

		if (file->f_pos == 0) {
			name = ".";
			size = 1;
			i_ino = inode->i_ino;
		} else {
			name = "..";
			size = 2;
			i_ino = squashfs_i(inode)->parent;
		}

		TRACE("Calling filldir(%p, %s, %d, %lld, %d, %d)\n",
				dirent, name, size, file->f_pos, i_ino,
				squashfs_filetype_table[1]);

		if (filldir(dirent, name, size, file->f_pos, i_ino,
				squashfs_filetype_table[1]) < 0) {
				TRACE("Filldir returned less than 0\n");
			goto finish;
		}

		file->f_pos += size;
	}

	length = get_dir_index_using_offset(inode->i_sb, &block, &offset,
				squashfs_i(inode)->dir_idx_start,
				squashfs_i(inode)->dir_idx_offset,
				squashfs_i(inode)->dir_idx_cnt,
				file->f_pos);

	while (length < i_size_read(inode)) {
		/*
		 * Read directory header
		 */
		err = squashfs_read_metadata(inode->i_sb, &dirh, &block,
					&offset, sizeof(dirh));
		if (err < 0)
			goto failed_read;

		length += sizeof(dirh);

		dir_count = le32_to_cpu(dirh.count) + 1;

		if (dir_count > SQUASHFS_DIR_COUNT)
			goto failed_read;

		while (dir_count--) {
			/*
			 * Read directory entry.
			 */
			err = squashfs_read_metadata(inode->i_sb, dire, &block,
					&offset, sizeof(*dire));
			if (err < 0)
				goto failed_read;

			size = le16_to_cpu(dire->size) + 1;

			/* size should never be larger than SQUASHFS_NAME_LEN */
			if (size > SQUASHFS_NAME_LEN)
				goto failed_read;

			err = squashfs_read_metadata(inode->i_sb, dire->name,
					&block, &offset, size);
			if (err < 0)
				goto failed_read;

			length += sizeof(*dire) + size;

			if (file->f_pos >= length)
				continue;

			dire->name[size] = '\0';
			inode_number = le32_to_cpu(dirh.inode_number) +
				((short) le16_to_cpu(dire->inode_number));
			type = le16_to_cpu(dire->type);

			TRACE("Calling filldir(%p, %s, %d, %lld, %x:%x, %d, %d)"
					"\n", dirent, dire->name, size,
					file->f_pos,
					le32_to_cpu(dirh.start_block),
					le16_to_cpu(dire->offset),
					inode_number,
					squashfs_filetype_table[type]);

			if (filldir(dirent, dire->name, size, file->f_pos,
					inode_number,
					squashfs_filetype_table[type]) < 0) {
				TRACE("Filldir returned less than 0\n");
				goto finish;
			}

			file->f_pos = length;
		}
	}

finish:
	kfree(dire);
	return 0;

failed_read:
	ERROR("Unable to read directory block [%llx:%x]\n", block, offset);
	kfree(dire);
	return 0;
}

const struct file_operations squashfs_dir_ops = {
	.read = generic_read_dir,
	.readdir = squashfs_readdir,
	.llseek = default_llseek,
};


text:
from __future__ import with_statement

from datetime import datetime
import os
import subprocess
import sys
import yaml

from kraftwerk.exc import ConfigError

def cached_list(f):
    """Decorator that caches yielding methods and stores them as
    lists.

    >>> class A:
    ...    @cached_list
    ...    def ten(self):
    ...        for i in range(10): yield i
    >>> a = A()
    >>> a.ten()
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    >>> a.ten()
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

    """
    def func(self, *args, **kwargs):
        key = "%s%s" % (f.__name__, args)
        try:
            return self._property_cache[key]
        except AttributeError:
            self._property_cache = {}
        except KeyError:
            pass
        output = self._property_cache[key] = list(f(self, *args, **kwargs))
        return output
    return func

class Project(object):

    def __init__(self, path):
        self.path = os.path.abspath(path)
        self.name = os.path.basename(self.path)
        self._services = None
        with file(os.path.join(self.path, 'kraftwerk.yaml')) as fp:
            self.config = yaml.load(fp.read())
            self.name = self.config.get('package', self.name)
        self.src_path = os.path.join(self.path, self.src())

    def __unicode__(self):
        return self.name

    def src(self):
        return self.config.get('src', self.name)

    def dump_path(self, timestamp):
        return '/web/%s/dump/%s/' % (self.name, timestamp)

    def dump(self, node):
        timestamp = datetime.now().isoformat().rsplit(".")[0] # '2010-03-23T16:32:22'
        dump_path = self.dump_path(timestamp)
        stdout, stderr = node.ssh("mkdir -p %s" % dump_path, user="web")
        for service in self.services():
            try:
                stdout, stderr = service.dump(node, dump_path)
                if stderr: print stderr
            except NotImplementedError:
                pass # Report error here? Warning?
        return timestamp

    def load(self, node, timestamp):
        for service in self.services():
            try:
                stdout, stderr = service.load(node, self.dump_path(timestamp))
                if stderr: print stderr
            except NotImplementedError:
                pass # Report error here? Warning?

    @cached_list
    def services(self, strict=False):
        for service in self.config.get('services', []):
            try:
                mod = __import__('kraftwerk.services.' + service, fromlist=[''])
            except ImportError:
                if strict:
                    raise ValueError, 'kraftwerk does not support a %s' % service
            yield mod.Service(self)

    @cached_list
    def environment(self):
        for service in self.services():
            for key, value in service.env.items():
                yield key, value
        if 'environ' in self.config:
            for key, value in self.config['environ'].iteritems():
                yield key, value

    def get_split_app_path(self):
        parts = self.config['wsgi'].rsplit(":", 1)
        if len(parts) == 1:
            module, obj = parts[0], "application"
        else:
            module, obj = parts[0], parts[1]
        return module, obj

    def validate(self):
        """A best-try attempt at exposing bad config early. Try
        importing WSGI script, verify some types, required attributes
        etc. """
        try:
            assert 'domain' in self.config, "You must specify at least one domain for the nginx configuration."
            assert 'wsgi' in self.config, "You must specify the WSGI app callable (project_name.server:application)."
            assert 'workers' in self.config, "You must specify the number of workers for the WSGI server."
        except AssertionError, e:
            raise ConfigError, unicode(e)

        if ' ' in self.config['domain']:
            raise ConfigError, "Domain must be a string or a list of strings"
        try:
            int(self.config['workers'])
        except ValueError:
            raise ConfigError, "`workers` value must be a number"
        try:
            file(os.path.join(self.path, 'requirements.txt'))
        except IOError:
            raise ConfigError, "requirements.txt file not found - must be under source directory"
        self.config['module'], \
        self.config['callable'] = self.get_split_app_path()
        return True

    def rsync(self, dest):
        exclude = os.path.join(self.path, "rsync_exclude.txt")
        cmd = ['rsync',
               '--recursive',
               '--links',         # Copy over symlinks as symlinks
               '--safe-links',    # Don't copy over links that are outside of dir
               '--executability', # Copy +x modes
               '--times',         # Copy timestamp
               '--rsh=ssh',       # Use ssh
               '--delete',        # Delete files thta aren't in the source dir
               '--compress',
               '--progress',
               '--quiet',
               self.src_path, dest]
        if os.path.isfile(exclude):
            cmd.insert(1, '--exclude-from=%s' % exclude)
        proc = subprocess.Popen(cmd, stderr=subprocess.PIPE)
        return proc.communicate()

    def copy(self, node, path):
        if path.startswith('/') or not os.path.exists(path):
            sys.exit(u"Non-secure path, must be non-absolute.")
        dest = 'web@%s:/web/%s/%s' % (node.hostname, self.name, path)
        proc = subprocess.Popen(['scp', '-q', path, dest])
        stdout, stderr = proc.communicate()
        if stderr:
            sys.exit(stderr)
        return

    def canonical_domain(self):
        if isinstance(self.config['domain'], basestring):
            return self.config['domain']
        else:
            return self.config['domain'][0]


text:
package org.neutrinocms.core.dao;

import org.neutrinocms.core.model.translation.Lang;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface LangDao extends BaseDao<Lang> {
	@Query("SELECT e FROM #{#entityName} e WHERE e.code =:code")
	Lang findByCode(@Param("code") String code);
}


text:
import { InternalError } from './errors';
import { Weather } from '@mymicds/sdk';
import * as fs from 'fs-extra';
import axios from 'axios';
import config from './config';

export const JSON_PATH = __dirname + '/../api/weather.json';

// Coordinates for MICDS
const latitude = 38.658241;
const longitude = -90.3974471;

const openWeatherKey: string = config.openWeather.APIKey;

// endpoint for current weather and couple day's forecast for MICDS, in imperial units, without the by-minute data
const openWeatherEndpoint = `https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&appid=${openWeatherKey}&units=imperial&exclude=minutely`;

/**
 * Retrieves the weather. Checks the local file cache first, else updates the weather.
 * @returns A weather object.
 */
async function getWeather() {
	let weatherJSON: Weather;
	try {
		weatherJSON = await fs.readJSON(JSON_PATH);
	} catch (e) {
		weatherJSON = await updateWeather();
	}

	return weatherJSON;
}

/**
 * Grabs the Weather from OpenWeather Onecall API, converts it to MyMICDS
 * Weather Object, and saves it in json.
 * @returns A weather object.
 */
async function updateWeather() {
	let rawWeather: OpenWeather | null = null;

	// grab dat DATA
	try {
		const response = await axios.get(openWeatherEndpoint);
		rawWeather = response.data;
	} catch (e) {
		throw new InternalError('There was a problem fetching the weather data!', e);
	}

	if (rawWeather === null) {
		throw new Error('There was a problem fetching the weather data!');
	}

	// convert dat DATA
	const weather: Weather = {
		temperature: rawWeather.current.temp,
		temperatureHigh: rawWeather.daily[0].temp.max ?? 0,
		temperatureLow: rawWeather.daily[0].temp.min ?? 0,
		humidity: rawWeather.current.humidity,
		precipitationChance: rawWeather.hourly[0].pop,
		windSpeed: rawWeather.hourly[0].wind_speed,
		windDir: rawWeather.hourly[0].wind_deg,
		weatherIcon: rawWeather.current.weather[0].icon
	};

	// save dat DATA
	try {
		await fs.outputJSON(JSON_PATH, weather, { spaces: '\t' });
	} catch (e) {
		throw new InternalError('There was a problem saving the weather data!', e);
	}

	return weather;
}

export { getWeather as get, updateWeather as update };

/*
 	Open Weather interfaces below.
 	take note there is a "minutely" array, but our Open Weather request excludes it/
 */
interface OpenWeather {
	lat: number;
	lon: number;
	timezone: string;
	timezone_offset: number;
	current: OpenWeatherCurrentSnapshot;
	hourly: OpenWeatherHourSnapshot[];
	daily: OpenWeatherDaySnapshot[];
}

interface OpenWeatherCurrentSnapshot {
	dt: moment.Moment;
	sunrise: moment.Moment;
	sunset: moment.Moment;
	temp: number;
	feels_like: number;
	pressure: number;
	humidity: number;
	dew_point: number;
	clouds: number;
	uvi: number;
	visibility: number;
	wind_speed: number;
	wind_gust: number | null;
	wind_deg: number;
	rain: number | PrecipitationVolume;
	snow: number | PrecipitationVolume;
	weather: OpenWeatherSummary[];
}

interface OpenWeatherHourSnapshot {
	dt: moment.Moment;
	temp: number;
	feels_like: number;
	pressure: number;
	humidity: number;
	dew_point: number;
	clouds: number;
	visibility: number;
	wind_speed: number;
	wind_gust: number | null;
	wind_deg: number;
	rain: number | PrecipitationVolume;
	snow: number | PrecipitationVolume;
	pop: number;
	weather: OpenWeatherSummary[];
}

interface OpenWeatherDaySnapshot {
	dt: moment.Moment;
	sunrise: moment.Moment;
	sunset: moment.Moment;
	temp: TemperatureDaySnapshot;
	feels_like: TemperatureDaySnapshot;
	pressure: number;
	humidity: number;
	dew_point: number;
	clouds: number;
	uvi: number;
	visibility: number;
	wind_speed: number;
	wind_gust: number | null;
	wind_deg: number;
	pop: number;
	rain: number | PrecipitationVolume | null;
	snow: number | PrecipitationVolume | null;
	weather: OpenWeatherSummary[];
}

interface OpenWeatherSummary {
	id: string;
	main: string;
	description: string;
	icon: string;
}

interface PrecipitationVolume {
	h1: number;
}

interface TemperatureDaySnapshot {
	morn: number;
	day: number;
	eve: number;
	night: number;
	min: number | null;
	max: number | null;
}


text:
package org.orekit.estimation.measurements.gnss;

import java.util.ArrayList;
import java.util.List;

import org.hipparchus.util.FastMath;
import org.orekit.gnss.CombinedObservationData;
import org.orekit.gnss.CombinedObservationDataSet;
import org.orekit.gnss.MeasurementType;
import org.orekit.gnss.ObservationData;
import org.orekit.gnss.ObservationDataSet;
import org.orekit.gnss.SatelliteSystem;

/**
 * Melbourne-Wübbena combination.
 *

 * This combination allows, thanks to the wide-lane combination, a larger wavelength
 * than each signal individually. Moreover, the measurement noise is reduced by the
 * narrow-lane combination of code measurements.
 *

 *

 *    mMW =  ΦWL- RNL
 *    mMW =  λWL * NWL+ b + ε
 *

 * With:
 *

 *
mMW : Melbourne-Wübbena measurement.

 *
ΦWL : Wide-Lane phase measurement.

 *
RNL : Narrow-Lane code measurement.

 *
λWL : Wide-Lane wavelength.

 *
NWL : Wide-Lane ambiguity (Nf1 - Nf2).

 *
b   : Satellite and receiver instrumental delays.

 *
ε   : Measurement noise.

 *

 *

 * {@link NarrowLaneCombination Narrow-Lane} and {@link WideLaneCombination Wide-Lane}
 * combinations shall be performed with the same pair of frequencies.
 *

 *
 * @see "Detector based in code and carrier phase data: The Melbourne-Wübbena combination,
 *       J. Sanz Subirana, J.M. Juan Zornoza and M. Hernández-Pajares, 2011"
 *
 * @author Bryan Cazabonne
 * @since 10.1
 */
public class MelbourneWubbenaCombination implements MeasurementCombination {

    /** Threshold for frequency comparison. */
    private static final double THRESHOLD = 1.0e-10;

    /** Satellite system used for the combination. */
    private final SatelliteSystem system;

    /**
     * Package private constructor for the factory.
     * @param system satellite system for which the combination is applied
     */
    MelbourneWubbenaCombination(final SatelliteSystem system) {
        this.system = system;
    }

    /** {@inheritDoc} */
    @Override
    public CombinedObservationDataSet combine(final ObservationDataSet observations) {

        // Wide-Lane combination
        final WideLaneCombination        wideLane   = MeasurementCombinationFactory.getWideLaneCombination(system);
        final CombinedObservationDataSet combinedWL = wideLane.combine(observations);

        // Narrow-Lane combination
        final NarrowLaneCombination      narrowLane = MeasurementCombinationFactory.getNarrowLaneCombination(system);
        final CombinedObservationDataSet combinedNL = narrowLane.combine(observations);

        // Initialize list of combined observation data
        final List<CombinedObservationData> combined = new ArrayList<>();

        // Loop on Wide-Lane measurements
        for (CombinedObservationData odWL : combinedWL.getObservationData()) {
            // Only consider combined phase measurements
            if (odWL.getMeasurementType() == MeasurementType.CARRIER_PHASE) {
                // Loop on Narrow-Lane measurements
                for (CombinedObservationData odNL : combinedNL.getObservationData()) {
                    // Only consider combined range measurements
                    if (odNL.getMeasurementType() == MeasurementType.PSEUDO_RANGE) {
                        // Verify if the combinations have used the same frequencies
                        final boolean isCombinationPossible = isCombinationPossible(odWL, odNL);
                        if (isCombinationPossible) {
                            // Combined value and frequency
                            final double combinedValue     = odWL.getValue() - odNL.getValue();
                            final double combinedFrequency = odWL.getCombinedMHzFrequency();
                            // Used observation data to build the Melbourn-Wübbena measurement
                            final List<ObservationData> usedData = new ArrayList<ObservationData>(4);
                            usedData.add(0, odWL.getUsedObservationData().get(0));
                            usedData.add(1, odWL.getUsedObservationData().get(1));
                            usedData.add(2, odNL.getUsedObservationData().get(0));
                            usedData.add(3, odNL.getUsedObservationData().get(1));
                            // Update the combined observation data list
                            combined.add(new CombinedObservationData(CombinationType.MELBOURNE_WUBBENA,
                                                                     MeasurementType.COMBINED_RANGE_PHASE,
                                                                     combinedValue, combinedFrequency, usedData));
                        }
                    }
                }
            }
        }

        return new CombinedObservationDataSet(observations.getHeader(), observations.getSatelliteSystem(),
                                              observations.getPrnNumber(), observations.getDate(),
                                              observations.getRcvrClkOffset(), combined);
    }

    /**
     * Verifies if the Melbourne-Wübbena combination is possible between both combined observation data.
     *

     * This method compares the frequencies of the combined measurement to decide
     * if the combination of measurements is possible.
     * The combination is possible if :
     *

     *    abs(f1WL - f2WL) = abs(f1NL - f2NL)
     *

     *

     * @param odWL Wide-Lane measurement
     * @param odNL Narrow-Lane measurement
     * @return true if the Melbourne-Wübbena combination is possible
     */
    private boolean isCombinationPossible(final CombinedObservationData odWL, final CombinedObservationData odNL) {
        // Frequencies
        final double[] frequency = new double[4];
        int j = 0;
        for (int i = 0; i < odWL.getUsedObservationData().size(); i++) {
            frequency[j++] = odWL.getUsedObservationData().get(i).getObservationType().getFrequency(system).getMHzFrequency();
            frequency[j++] = odNL.getUsedObservationData().get(i).getObservationType().getFrequency(system).getMHzFrequency();
        }
        // Verify if used frequencies are the same.
        // Possible numerical error is taken into account by using a threshold of acceptance
        return (FastMath.abs(frequency[0] - frequency[2]) - FastMath.abs(frequency[1] - frequency[3])) < THRESHOLD;
    }

    /** {@inheritDoc} */
    @Override
    public String getName() {
        return CombinationType.MELBOURNE_WUBBENA.getName();
    }

}


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

using UnityEngine;

namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
{
    /// <summary>
    /// This script allows to scroll a texture both horizontally and vertically.
    /// </summary>
    public class Scroll_Texture : PanZoomBase_Texture
    {
        // Pan
        [Tooltip("Renderer of the texture to be scrolled.")]
        [SerializeField]
        private Renderer textureRendererToBeScrolled = null;

        [Tooltip("Ability to scroll using your eye gaze without any additional input (e.g., air tap or button presses).")]
        [SerializeField]
        private bool autoGazeScrollIsActive = true;

        [Tooltip("Horizontal scroll speed. For example: 0.1f for slow panning. 0.6f for fast panning.")]
        [SerializeField]
        private float scrollSpeedHorizontal = 0.0f;

        [Tooltip("Vertical scroll speed. For example: 0.1f for slow panning. 0.6f for fast panning.")]
        [SerializeField]
        private float scrollSpeedVertical = 0.15f;

        [Tooltip("Minimal distance in x and y from center of the target's hit box (0, 0) to scroll. Thus, values must range between 0 (always scroll) and 0.5 (no scroll).")]
        [SerializeField]
        private Vector2 minDistFromCenterForAutoScroll = new Vector2(0.2f, 0.2f);

        [Tooltip("Size of the GameObject's collider when being looked at.")]
        [SerializeField]
        private Vector3 onLookAtColliderSize = new Vector3(1.2f, 1.2f, 1f);

        [Tooltip("Set to true to prevent sudden scrolling when quickly looking around. This may make scrolling feel less responsive though.")]
        [SerializeField]
        private bool useSkimProofing = false;

        [Tooltip("The lower the value, the slower the scrolling will speed up after skimming. Recommended value: 5.")]
        [SerializeField]
        [Range(0, 10)]
        private float skimProofUpdateSpeed = 5f;

        protected override void Start()
        {
            // Assigning values to base PanZoom class
            autoGazePanIsActive = autoGazeScrollIsActive;
            panSpeedUpDown = scrollSpeedVertical;
            panSpeedLeftRight = scrollSpeedHorizontal;
            minDistFromCenterForAutoPan = minDistFromCenterForAutoScroll;
            customColliderSizeOnLookAt = onLookAtColliderSize;
            textureRenderer = textureRendererToBeScrolled;
            useSkimProof = useSkimProofing;

            base.Start();
        }

        protected override void Update()
        {
            // Check if any values have been changed in the Unity Editor and update them in the base class
            UpdateValues(ref autoGazePanIsActive, autoGazeScrollIsActive);
            UpdateValues(ref panSpeedLeftRight, scrollSpeedHorizontal);
            UpdateValues(ref panSpeedUpDown, scrollSpeedVertical);
            UpdateValues(ref minDistFromCenterForAutoPan, minDistFromCenterForAutoScroll);
            UpdateValues(ref minDistFromCenterForAutoPan, minDistFromCenterForAutoScroll);
            UpdateValues(ref customColliderSizeOnLookAt, onLookAtColliderSize);
            UpdateValues(ref textureRenderer, textureRendererToBeScrolled);
            UpdateValues(ref useSkimProof, useSkimProofing);

            if (UpdateValues(ref skimproof_UpdateSpeedFromUser, skimProofUpdateSpeed))
            {
                SetSkimProofUpdateSpeed(skimproof_UpdateSpeedFromUser);
            }

            base.Update();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="wrap_content"
	android:minHeight="?android:attr/listPreferredItemHeight"
	android:orientation="horizontal">
	<LinearLayout
		android:layout_width="wrap_content"
		android:layout_height="fill_parent"
		android:orientation="horizontal"
		android:background="@android:color/black">
	<ImageView
		android:id="@+id/iv_lrc"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		/>
	<ImageView
		android:id="@+id/iv_textzh"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		/>
	</LinearLayout>
	<TextView
		android:id="@+id/tv_title"
		android:paddingLeft="2dip"
		android:layout_gravity="center_vertical"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_weight="1.0"
		android:textSize="16.0dip"
	/>
</LinearLayout>


text:
<?php

namespace LOCKSSOMatic\CrudBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 * Build a form for editing one PLN.
 */
class PlnType extends AbstractType {

    /**
     * Build a PLN edit form. Adds fields to $builder in-place.
     *
     * @param FormBuilderInterface $builder
     */
    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder->add('name');
        $builder->add('description');
        $builder->add('username', 'text');
        $builder->add('password', 'password');
        $builder->add('enableContentUi', 'choice', array(
            'expanded' => true,
            'multiple' => false,
            'label' => 'Content UI',
            'choices' => array(
                '1' => 'Enabled',
                '0' => 'Disabled',
            ),
            'attr' => array(
                'help' => 'This enables the Content UI port for all the boxes in the PLN.'
                . ' If you enable this feature, you should also set the org.lockss.proxy.access.ip.include property on the PLN.'
            ),
        ));
        $builder->add('contentPort', null, array(
            'attr' => array(
                'help' => 'This sets the Content UI port for all the boxes in the PLN. Defaults to 8080.'
            ),
        ));
    }

    /**
     * {@inheritDocs}
     *
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'LOCKSSOMatic\CrudBundle\Entity\Pln',
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function getName() {
        return 'lockssomatic_crudbundle_pln';
    }

}


text:
{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
    <title>History</title>
{% endblock %}
{% block headers %}
    <link href="{% static 'css/jquery.growl.css' %}" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="{% static 'css/codyhouse-horizontol-timeline.css' %}">
    <link rel="stylesheet" href="{% static 'css/nanoscroller.css' %}">
    <link rel="stylesheet" href="{% static 'css/datatables/dataTables.bootstrap-1.10.11.css' %}">
    <link rel="stylesheet" href="{% static 'css/datatables/fixedColumns.bootstrap-3.2.1.css' %}">
    <link rel="stylesheet" href="{% static 'css/datatables/keyTable.bootstrap-2.1.1.css' %}">
    <link rel="stylesheet" href="{% static 'css/ee-playground.css' %}">

{% endblock headers %}
{% block css-overrides %}

{% endblock %}
{% block content %}

Columbus makes use of the Google Earth
            Engine and needs your basic information to access it.

        Sign in with:

                <input type="hidden" value="{{ history.id }}" id="history-id"/>

{{ history.flow.name }} #{{ history.id }}

                                    {% comment %}Content will be populated here through javascript{% endcomment %}

Prev

Next

                    View Chart

                    {% comment %}Donot put anything in this div even a newline, to show placeholder text{% endcomment %}

                    {% comment %}Donot put anything in this div even a newline, to show placeholder text{% endcomment %}

                        {% comment %}

{% endcomment %}

                            {% comment %}Donot put anything in this div even a newline, to show placeholder text{% endcomment %}

                <input id="searchPlace" class="controls" type="text" placeholder="Search a location"
                       xmlns="http://www.w3.org/1999/html"/>

                        View Output
                        Visualize
                        {% comment %}View Stats{% endcomment %}

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Warning

                    <select id="chart-type" class="selectpicker show-menu-arrow show-tick" data-width="20%"
                            style="margin-top: 5px;">
                        <option value="line">Line Chart</option>
                        <option value="column">Column Chart</option>
                        <option value="areaspline">Area Spline</option>
                    </select>
                    <select id="chart-collection" class="selectpicker show-menu-arrow show-tick" data-width="20%"
                            style="margin-top: 5px;" title="Choose a Collection">
                    </select>
                    <button class="btn btn-warning" onclick="displayChart();">Show Chart

                    </button>

Select axes and
                            click on Show Chart button

                    <select id="xaxis" class="selectpicker show-menu-arrow show-tick" data-width="18%"
                            data-size="5" title="Choose X-Axis">
                    </select>

                        <select id="y1" class="selectpicker show-menu-arrow show-tick" data-width="23%"
                                data-size="5" title="Choose a Y-Axis">
                        </select>
                        <select id="y2" class="selectpicker show-menu-arrow show-tick" data-width="23%"
                                data-size="5" title="Choose a Y-Axis">
                        </select>
                        <select id="y3" class="selectpicker show-menu-arrow show-tick" data-width="23%"
                                data-size="5" title="Choose a Y-Axis">
                        </select>
                        <select id="y4" class="selectpicker show-menu-arrow show-tick" data-width="23%"
                                data-size="5" title="Choose a Y-Axis">
                        </select>

{% endblock %}
{% block bodyscripts %}

{% endblock %}


text:
=encoding utf-8

=head1 NAME

ngx_stream_realip_module - Module ngx_stream_realip_module

=head1

The C<ngx_stream_realip_module> module is used
to change the client address and port
to the ones sent in the PROXY protocol header (1.11.4).
The PROXY protocol must be previously enabled by setting the
L<ngx_stream_core_module> parameter
in the C<listen> directive.

This module is not built by default, it should be enabled with the
C<--with-stream_realip_module>
configuration parameter.

=head1 Example Configuration

    listen 12345 proxy_protocol;

    set_real_ip_from  192.168.1.0/24;
    set_real_ip_from  192.168.2.1;
    set_real_ip_from  2001:0db8::/32;

=head1 Directives

=head2 set_real_ip_from

B<syntax:> set_real_ip_from I<
    I<C<address>> E<verbar>
    I<C<CIDR>> E<verbar>
    C<unix:>>

B<context:> I<stream>

B<context:> I<server>

Defines trusted addresses that are known to send correct
replacement addresses.
If the special value C<unix:> is specified,
all UNIX-domain sockets will be trusted.

=head1 Embedded Variables

=over

=item C<$realip_remote_addr>

keeps the original client address

=item C<$realip_remote_port>

keeps the original client port

=back


text:
Reference

https://www.acmicpc.net/problem/2585


text:
 	<md-toolbar class="md-accent my-page-header">

Change Password for {{vm.appName}}

	</md-toolbar>

Enter and Verify Password

			<form name="pswdForm" id="pswdForm" ng-submit="vm.getPswd()" novalidate>

					<md-input-container>
						New Password
			 			<input type="password"name="password1" id="password" class="form-control firstInput" ng-model="vm.data.password1" required />
					</md-input-container>

					 <md-input-container style="margin-left:20px">
						Verify New Password
			 			<input type="password" name="password2" id="password2" class="form-control" ng-model="vm.data.password2" required />
					</md-input-container>

*Required

					<md-button type="submit" class="md-raised md-primary" ng-disabled="pswdForm.$invalid">
						Save
					</md-button>
					<md-button class="md-raised md-primary" ng-click="vm.doCancel()">
						Cancel
					</md-button>

			</form>


text:
<!doctype html>

    <title>Web app Architecture by Techfano</title>

    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

    <link type="text/css" rel="stylesheet" href="../assets/style.css" />

    <link rel="import" href="../polymer/polymer/polymer.html" />
    <link rel="import" href="../polymer/core-drawer-panel/core-drawer-panel.html" />
    <link rel="import" href="../polymer/core-header-panel/core-header-panel.html" />
    <link rel="import" href="../polymer/core-icon-button/core-icon-button.html" />
    <link rel="import" href="../polymer/core-item/core-item.html" />
    <link rel="import" href="../polymer/core-label/core-label.html" />
    <link rel="import" href="../polymer/core-menu/core-menu.html" />
    <link rel="import" href="../polymer/core-toolbar/core-toolbar.html" />
    <link rel="import" href="../polymer/paper-button/paper-button.html" />
    <link rel="import" href="../polymer/paper-input/paper-input.html" />
    <link rel="import" href="../polymer/paper-shadow/paper-shadow.html" />
    <link rel="import" href="../polymer/paper-spinner/paper-spinner.html" />
    <link rel="import" href="../polymer/paper-toast/paper-toast.html" />
    <link rel="import" href="../polymer/font-roboto/roboto.html" />


text:
exports.globalTearDown = function(test, assert) {
  console.error("globalTearDown was here");
  assert.equal(1, 1);
  test.finish();
};


text:
/**
 * @fileoverview Externs for ChesterGL
 *
 * @see https://github.com/funkaster/ChesterGL
 * @externs
 */

// external - request animation frame for different browsers and window.WebGLDebugUtils

/**
 * @namespace
 */
var WebGLDebugUtils;

/**
 * Stats.js
 * @constructor
 */
var Stats = function () {};

/**
 * runScript
 */
var runScript = function () {};

/**
 * @type {number}
 */
var innerWidth;

/**
 * @type {number}
 */
var innerHeight;

/**
 * @param {number} w
 * @param {number} h
 * @constructor
 * @extends {HTMLElement}
 */
var ChesterCanvas = function (w,h) {};

/**
 * @param {function(Object)} callback
 */
var _touchBeganListeners = function (callback) {};

/**
 * @param {function(Object)} callback
 */
var _touchMovedListeners = function (callback) {};

/**
 * @param {function(Object)} callback
 */
var _touchEndedListeners = function (callback) {};

// these are native implementations of the goog.vec.mat4 functions

/**
 * @param {goog.vec.Mat4.AnyType} mat0
 * @param {goog.vec.Mat4.AnyType} mat1
 * @param {goog.vec.Mat4.AnyType=} out
 * @return {goog.vec.Mat4.AnyType}
 */
var _mat4mul = function (mat0, mat1, out) {};

/**
 * @param {goog.vec.Mat4.AnyType} mat
 * @param {goog.vec.Vec3.AnyType} vec
 * @param {goog.vec.Vec3.AnyType=} out
 * @return {goog.vec.Vec3.AnyType}
 */
var _mat4mulvec3 = function (mat, vec, out) {};

/**
 * @param {goog.vec.Mat4.AnyType} mat
 * @param {number} x
 * @param {number} y
 * @param {number} z
 * @return {goog.vec.Mat4.AnyType}
 */
var _mat4translate = function (mat, x, y, z) {};

/**
 * @param {goog.vec.Mat4.AnyType} mat
 * @param {number} angle
 * @param {number} x
 * @param {number} y
 * @param {number} z
 * @return {goog.vec.Mat4.AnyType}
 */
var _mat4rotate = function (mat, angle, x, y, z) {};

/**
 * @param {goog.vec.Mat4.AnyType} mat
 * @param {number} x
 * @param {number} y
 * @param {number} z
 * @return {goog.vec.Mat4.AnyType}
 */
var _mat4scale = function (mat, x, y, z) {};

/**
 * @param {WebGLRenderingContext} ctx
 * @param {function(Object, string, Object)=} callback
 * @return {WebGLRenderingContext}
 */
WebGLDebugUtils.makeDebugContext = function (ctx, callback) {};

/**
 * @param {number} err
 * @return {string}
 */
WebGLDebugUtils.glEnumToString = function (err) {};

/**
 * @param {number} width
 * @param {number} height
 * @constructor
 */
var FakeCanvas = function (width, height) {};

/**
 * @param {number} requestId
 */
var cancelAnimationFrame = function (requestId) {};


text:
package ch.unibe.scg.regex;

import java.util.concurrent.atomic.AtomicLong;

/**
 * Flyweight for the shared history of the memory cells. Singly-linked list where the
 * head (and it's {@code cur}) is mutable, but the rest (everything visible from {@code prev})
 * is immutable.
 */
class History implements IntIterable {
  final static private AtomicLong nextId = new AtomicLong();
  static {
    resetCount();
  }

  final long id;

  int cur;
  History prev;

  History(long id, int head, History history) {
    this.id = id;
    cur = head;
    prev = history;
  }

  static class RealIntIterator implements IntIterator {
    History history;

    RealIntIterator(History history) {
      this.history = history;
    }

    @Override
    public boolean hasNext() {
      return history != null;
    }

    @Override
    public int next() {
      final int ret = history.cur;
      history = history.prev;
      return ret;
    }
  }

  static void resetCount() {
    nextId.set(-1L);
  }

  History() {
    this(nextId.incrementAndGet(), 0, null);
  }

  @Override
  public IntIterator iterator() {
    return new RealIntIterator(this);
  }

  @Override
  public String toString() {
    final StringBuilder ret = new StringBuilder(String.valueOf(id) + "(");
    final IntIterator iter = iterator();
    while (iter.hasNext()) {
      ret.append(iter.next());
      ret.append(' ');
    }
    ret.append(")");
    return ret.toString();
  }

  @Override
  public int hashCode() {
    return (int) id;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    History other = (History) obj;
    return this.id == other.id;
  }

  int size() {
    if (prev == null) {
      return 1;
    }
    return prev.size() + 1;
  }
}


text:
slacker
==========

[![Build Status](https://img.shields.io/travis/com/amylum/slacker.svg)](https://travis-ci.com/amylum/slacker)
[![GitHub release](https://img.shields.io/github/release/amylum/slacker.svg)](https://github.com/amylum/slacker/releases)
[![MIT Licensed](http://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)

Package repo for [slacker](https://github.com/akerl/slacker)

## Usage

To build a new package, update the submodule and run `make`. This launches the docker build container and builds the package.

To start a shell in the build environment for manual actions, run `make manual`.

## License

This repo is released under the MIT License. See the bundled LICENSE file for details.


text:
/*****************************************************************************
*
* expem - ex_put_elem_map
*
* entry conditions -
*   input parameters:
*       int     exoid                   exodus file id
*       int     map_id                  element map id
*       int     *elem_map               element map
*
* exit conditions -
*
* revision history -
*
*
*****************************************************************************/

#include "exodusII.h"
#include "exodusII_int.h"

/*!
 * writes an element map; this is a vector of integers of length number
 * of elements
 * \param  exoid                   exodus file id
 * \param  map_id                  element map id
 * \param  elem_map                element map
 * \deprecated Use ex_put_num_map()(exoid, EX_ELEM_MAP, map_id, elem_map)
 */

int ex_put_elem_map (int exoid,
                     int map_id,
                     const int *elem_map)
{
  return ex_put_num_map( exoid, EX_ELEM_MAP, map_id, elem_map );
}


text:
use strict;

use Getopt::Long;

my $hwlocdir = undef;
my $outdir = undef;
my @forcesubnets;
my $needsudo = 0;
my $ibnetdiscover = "/usr/sbin/ibnetdiscover";
my $ibroute = "/usr/sbin/ibroute";
my $verbose = 0;
my $force = 0;
my $dryrun = 0;
my $ignoreerrors = 0;

&Getopt::Long::Configure("bundling");
my $ok = Getopt::Long::GetOptions(
	"out-dir|f=s" => \$outdir,
	"hwloc-dir|f=s" => \$hwlocdir,
	"force-subnet|f=s" => \@forcesubnets,
	"sudo" => \$needsudo,
	"ibnetdiscover|f=s" => \$ibnetdiscover,
	"ibroute|f=s" => \$ibroute,
        "ignore-errors" => \$ignoreerrors,
	"verbose" => \$verbose,
	"force" => \$force,
	"dry-run" => \$dryrun
    );

if (!$ok or !defined $outdir) {
    print "Output directory for raw IB data must be specified with\n";
    print " --out-dir <dir>\n";
    print "Input must be one of these\n";
    print " --hwloc-dir <dir>\n";
    print "    Specifies that <dir> contains the hwloc XML exports of the some nodes,\n";
    print "    The list of IB subnets should be guessed from there.\n";
    print " --force-subnet [<subnet>:]<board>:<port> to force the discovery\n";
    print "    Force discovery on local board <board> port <port>, and optionally force the\n";
    print "    subnet id <subnet> instead of reading it from the first GID.\n";
    print "    Examples: --force-subnet mlx4_0:1\n";
    print "              --force-subnet fe80:0000:0000:0000:mlx4_0:1\n";
    print "Other options\n";
    print " --sudo\n";
    print "    Pass sudo to internal ibnetdiscover and ibroute invocations.\n";
    print "    Useful when the entire script cannot run as root.\n";
    print " --ibnetdiscover --ibroute\n";
    print "    Specify exact location of programs. Default is /usr/bin/<program>\n";
    print " --ignore-errors\n";
    print "    Ignore errors from ibnetdiscover and ibroute, assume their outputs are ok\n";
    print " --verbose\n";
    print "    Add verbose messages\n";
    print " --dry-run\n";
    print "    Do not actually run programs\n";
    exit(1);
}
mkdir $outdir;
if (!-d $outdir) {
    print "$outdir isn't a directory\n";
    exit (1);
}
if ($hwlocdir and @forcesubnets) {
    print "Don't specify both --hwloc-dir and --force-subnet.\n";
    exit (1);
}

my $sudo = $needsudo ? "sudo" : "";

if (`id -u` ne 0 and !$sudo and !$dryrun) {
    print "WARNING: Not running as root.\n";
}

# subnets that will be discovered locally
my %subnets_todiscover;

#########################################
# Read forced subnets
if (@forcesubnets) {
  print "Enforcing list of subnets to discover:\n";
  foreach my $subnetstring (@forcesubnets) {
    if ($subnetstring =~ /^([0-9a-fA-F:]{19}):([0-9a-z_-]+):([0-9]+)$/) {
      my $subnet = $1;
      my $boardname = $2;
      my $portnum = $3;
      print " Subnet $subnet from local board $boardname port $portnum.\n";
      $subnets_todiscover{$subnet}->{localboardname} = $boardname;
      $subnets_todiscover{$subnet}->{localportnum} = $portnum;

    } elsif ($subnetstring =~ /^([0-9a-z_-]+):([0-9]+)$/) {
      my $boardname = $1;
      my $portnum = $2;
      my $subnet;
      print " Unknown subnet from local board $boardname port $portnum.\n";
      my $filename = "/sys/class/infiniband/$boardname/ports/$portnum/gids/0";
      if (open FILE, $filename) {
        my $line = <FILE>;
        if ($line =~ /^([0-9a-fA-F:]{19}):([0-9a-fA-F:]{19})$/) {
	  $subnet = $1
        }
        close FILE;
      }
      if (defined $subnet) {
	print "  Found subnet $subnet from first GID.\n";
	$subnets_todiscover{$subnet}->{localboardname} = $boardname;
	$subnets_todiscover{$subnet}->{localportnum} = $portnum;
      } else {
	print "  Couldn't read subnet from GID $filename, ignoring.\n";
      }

    } else {
      print " Cannot parse --force-subnet $subnetstring, ignoring.\n";
    }
  }
  print "\n";
}

#########################################
# Guess subnets from hwloc
if ($hwlocdir) {

  # $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidnum}->{subnet} and ->{guid} = xxxx:xxxx:xxxx:xxxx
  # $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{invalid} = 1
  # $servers{$hostname}->{subnets}->{$subnet} = 1
  my %servers;

  # $subnets{$subnet}->{$hostname} = 1;
  my %subnets;

  opendir DIR, $hwlocdir
    or die "Failed to open hwloc directory ($!).\n";
  # list subnets by ports
  while (my $hwlocfile = readdir DIR) {
    my $hostname;
    if ($hwlocfile =~ /(.+).xml$/) {
      $hostname = $1;
    } else {
      next;
    }

    open FILE, "$hwlocdir/$hwlocfile" or next;
    my $boardname = undef;
    my $portnum = undef;
    while (my $line = <FILE>) {
      if ($line =~ /<object type=\"OSDev\" name=\"(.+)\" osdev_type=\"3\">/) {
        $boardname = $1;
      } elsif ($line =~ /<\/object>/) {
        $boardname = undef;
      } elsif ($line =~ /<info name=\"Port([0-9]+)GID([0-9]+)\" value=\"([0-9a-fA-F:]{19}):([0-9a-fA-F:]{19})\"\/>/) {
        $servers{$hostname}->{gids}->{$boardname}->{$1}->{$2}->{subnet} = $3;
        $servers{$hostname}->{gids}->{$boardname}->{$1}->{$2}->{guid} = $4;
      } elsif ($line =~ /<info name=\"Port([0-9]+)LID\" value=\"(0x[0-9a-fA-F]+)\"\/>/) {
        # lid must be between 0x1 and 0xbfff
        if ((hex $2) < 1 or (hex $2) > 49151) {
          $servers{$hostname}->{gids}->{$boardname}->{$1}->{invalid} = 1;
        }
      } elsif ($line =~ /<info name=\"Port([0-9]+)State\" value=\"[0-9]\"\/>/) {
        # state must be active = 4
        if ($2 != 4) {
          $servers{$hostname}->{gids}->{$boardname}->{$1}->{invalid} = 1;
        }
      }
    }
    close FILE;
  }
  closedir DIR;

  # remove down/inactive ports/servers/...
  foreach my $hostname (keys %servers) {
    foreach my $boardname (keys %{$servers{$hostname}->{gids}}) {
      foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) {
        delete $servers{$hostname}->{gids}->{$boardname}->{$portnum}
	  if exists $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{invalid};
      }
      delete $servers{$hostname}->{gids}->{$boardname}
        unless keys %{$servers{$hostname}->{gids}->{$boardname}};
    }
    delete $servers{$hostname}
      unless keys %{$servers{$hostname}->{gids}};
  }

  # fill list of hostnames per subnets and subnets per hostnames
  foreach my $hostname (keys %servers) {
    foreach my $boardname (keys %{$servers{$hostname}->{gids}}) {
      foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) {
	foreach my $gidid (keys %{$servers{$hostname}->{gids}->{$boardname}->{$portnum}}) {
	  my $subnet  = $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidid}->{subnet};
	  $servers{$hostname}->{subnets}->{$subnet} = 1;
	  $subnets{$subnet}->{$hostname} = 1;
	}
      }
    }
  }

  my $nrsubnets = scalar (keys %subnets);
  print "Found $nrsubnets subnets in hwloc directory:\n";
  # find local subnets
  my $localhostname = `hostname`; chomp $localhostname;
  {
    my $hostname = $localhostname;
    foreach my $boardname (keys %{$servers{$hostname}->{gids}}) {
      foreach my $portnum (keys %{$servers{$hostname}->{gids}->{$boardname}}) {
        foreach my $gidid (keys %{$servers{$hostname}->{gids}->{$boardname}->{$portnum}}) {
          my $subnet = $servers{$hostname}->{gids}->{$boardname}->{$portnum}->{$gidid}->{subnet};
	  if (!exists $subnets_todiscover{$subnet}) {
	    print " Subnet $subnet is locally accessible from board $boardname port $portnum.\n";
	    $subnets_todiscover{$subnet}->{localboardname} = $boardname;
	    $subnets_todiscover{$subnet}->{localportnum} = $portnum;
	  } elsif ($verbose) {
	    print " Subnet $subnet is also locally accessible from board $boardname port $portnum.\n";
	  }
        }
      }
    }
  }
  # find non-locally accessible subnets
  foreach my $subnet (keys %subnets) {
    next if exists $subnets{$subnet}->{$localhostname};
    print " Subnet $subnet is NOT locally accessible.\n";
    my @hostnames = (keys %{$subnets{$subnet}});
    if ($verbose) {
      print "  Subnet $subnet is accessible from nodes:\n";
      foreach my $hostname (@hostnames) {
	print "   $hostname\n";
      }
    } else {
      print "  Subnet $subnet is accessible from node ".$hostnames[0];
      print " (and ".(@hostnames-1)." others)" if (@hostnames > 1);
      print "\n";
    }
  }
  print "\n";

  # list nodes that are connected to all subnets, if the local isn't
  if (scalar keys %{$servers{$localhostname}->{subnets}} != $nrsubnets) {
    my @fullyconnectedhostnames;
    foreach my $hostname (keys %servers) {
      if (scalar keys %{$servers{$hostname}->{subnets}} == $nrsubnets) {
	push @fullyconnectedhostnames, $hostname;
      }
    }
    if (@fullyconnectedhostnames) {
      if ($verbose) {
	print "All subnets are accessible from nodes:\n";
	foreach my $hostname (@fullyconnectedhostnames) {
	  print " $hostname\n";
	}
      } else {
	print "All subnets are accessible from node ".$fullyconnectedhostnames[0];
	print " (and ".(@fullyconnectedhostnames-1)." others)" if (@fullyconnectedhostnames > 1);
	print "\n";
      }
    } else {
      print "No node is connected to all subnets.\n";
    }
    print "\n";
  }
}

###########################
# Discovery routines

# ibnetdiscover has GUIDs in the form of 0xXXXXXXXXXXXXXXXX, but hwloc
# has GUIDs in the form of XXXX:XXXX:XXXX:XXXX.  So just arbitrarily
# choose hwloc's form and convert everything to that format.
sub normalize_guid {
    my ($guid) = @_;

    return ""
        if ($guid eq "");

    $guid =~ m/0x(.{4})(.{4})(.{4})(.{4})/;
    return "$1:$2:$3:$4";
}

sub getroutes {
    my $subnet = shift;
    my $boardname = shift;
    my $portnum = shift;
    my $ibnetdiscoveroutput = shift;
    my $ibrouteoutdir = shift;
    my $lids;

    if (!open(FILE, $ibnetdiscoveroutput)) {
      print "  Couldn't open $ibnetdiscoveroutput\n";
      return;
    }

    while (<FILE>) {
        # We only need lines that begin with SW
        next
            if (! /^SW /);

        # Split out the columns.  Yay regexps.  One form of line has
        # both source and destination information.  The other form
        # only has source information (because it's not hooked up to
        # anything -- usually a switch port that doesn't have anything
        # plugged in to it).
        chomp;
        my $line = $_;

        my ($have_peer, $src_name, $src_type, $src_lid, $src_port_id,
            $src_guid, $width, $speed, $dest_type, $dest_lid, $dest_port_id,
            $dest_guid, $dest_name);

        # First, assume that the line has both a port and a peer.
        if ($line !~ m/^SW\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+(\d+x)\s(.{3})\s+-\s+(CA|SW)\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+\(\s+'(.+?)'\s+-\s+'(.+?)'\s\)/) {
            # If we get here, there was no peer -- just a port.
            $have_peer = 0;

            $line =~ m/^SW\s+(\d+)\s+(\d+)\s+(0x[0-9a-f]{16})\s+(\d+x)\s(.{3})\s+'(.+?)'/;
            $src_lid = $1; # This is a decimal number
            $src_port_id = $2; # This is a decimal number
            $src_guid = $3;
            $width = $4;
            $speed = $5;
            $src_name = $6;
        } else {
            $have_peer = 1;

            $src_lid = $1; # This is a decimal number
            $src_port_id = $2; # This is a decimal number
            $src_guid = $3;
            $width = $4;
            $speed = $5;
            $dest_type = $6;
            $dest_lid = $7; # This is a decimal number
            $dest_port_id = $8; # This is a decimal number
            $dest_guid = $9;
            $src_name = $10;
            $dest_name = $11;
        }

        # Convert GUIDs to the form xxxx:xxxx:xxxx:xxxx
        $src_guid = normalize_guid($src_guid);
        $dest_guid = normalize_guid($dest_guid)
            if ($have_peer);

        # If the source switch LID already exists, then just keep
        # going.
        next
            if (exists($lids->{$src_lid}));

        # Run ibroute on this switch LID
	my $ibrouteoutput = "$ibrouteoutdir/ibroute-$subnet-$src_lid.txt";
        print "  Running ibroute for switch LID $src_lid...\n";
	my $cmd = "$sudo $ibroute -C $boardname -P $portnum $src_lid";
	if ($dryrun) {
	  print "   NOT running $cmd\n" if $verbose;
	} else {
	  my $ret = system "$cmd > ${ibrouteoutput}.new" ;
	  if (!$ret or $ignoreerrors) {
	    unlink ${ibrouteoutput};
	    rename "${ibrouteoutput}.new", "${ibrouteoutput}";
	  } else {
	    unlink "${ibrouteoutput}.new";
	    print "   Failed (exit code $ret).\n";
	    next;
	  }
	}

        $lids->{$src_lid} = 1;
    }

    close FILE;
}

##############################"
# Discover subnets for real

foreach my $subnet (keys %subnets_todiscover) {
  my $boardname = $subnets_todiscover{$subnet}->{localboardname};
  my $portnum = $subnets_todiscover{$subnet}->{localportnum};

  print "Looking at $subnet (through local board $boardname port $portnum)...\n";

  my $ibnetdiscoveroutput = "$outdir/ib-subnet-$subnet.txt";
  my $ibrouteoutdir = "$outdir/ibroutes-$subnet";

  if (-f $ibnetdiscoveroutput and !$force) {
    print " $outdir/ib-subnet-$subnet.txt already exists, discover again? (y/n) ";
    my $answer = <>;
    next if $answer !~ /^y/;
  }

  print " Running ibnetdiscover...\n";
  my $cmd = "$sudo $ibnetdiscover -s -l -g -H -S -R -p -C $boardname -P $portnum";
  if ($dryrun) {
    print "  NOT running $cmd\n" if $verbose;
  } else {
    my $ret = system "$cmd > ${ibnetdiscoveroutput}.new" ;
    if (!$ret or $ignoreerrors) {
      unlink ${ibnetdiscoveroutput};
      rename "${ibnetdiscoveroutput}.new", "${ibnetdiscoveroutput}";
    } else {
      unlink "${ibnetdiscoveroutput}.new";
      print "  Failed (exit code $ret).\n";
      next;
    }
  }

  print " Getting routes...\n";
  if (!$dryrun) {
    system("rm -rf $ibrouteoutdir");
    mkdir $ibrouteoutdir;
  }
  getroutes $subnet, $boardname, $portnum, $ibnetdiscoveroutput, $ibrouteoutdir;
}


text:
var query = require("../service/common/connection").query;
//到5月15号的赛程

query("select * from Game where isPlayOff=1", function (err, results) {
    require("fs").writeFile("./playoff.json", JSON.stringify(results));
});


text:
/* Test for <tgmath.h> in C99. */
/* Origin: Matt Austern <austern@apple.com>
/* { dg-do preprocess { target c99_runtime } } */
/* { dg-options "-std=iso9899:1999" } */
/* { dg-add-options c99_runtime } */
/* { dg-skip-if "<complex.h> missing" { alpha*-dec-osf5* } } */

/* Test that tgmath defines the macros it's supposed to. */
#include <tgmath.h>

#ifndef acos
#error acos undefined
#endif

#ifndef asin
#error asin undefined
#endif

#ifndef atan
#error atan undefined
#endif

#ifndef acosh
#error acosh undefined
#endif

#ifndef asinh
#error asinh undefined
#endif

#ifndef atanh
#error atanh undefined
#endif

#ifndef cos
#error cos undefined
#endif

#ifndef sin
#error sin undefined
#endif

#ifndef tan
#error tan undefined
#endif

#ifndef cosh
#error cosh undefined
#endif

#ifndef sinh
#error sinh undefined
#endif

#ifndef tanh
#error tanh undefined
#endif

#ifndef exp
#error exp undefined
#endif

#ifndef log
#error log undefined
#endif

#ifndef pow
#error pow undefined
#endif

#ifndef sqrt
#error sqrt undefined
#endif

#ifndef fabs
#error fabs undefined
#endif

#ifndef atan2
#error atan2 undefined
#endif

#ifndef cbrt
#error cbrt undefined
#endif

#ifndef ceil
#error ceil undefined
#endif

#ifndef copysign
#error copysign undefined
#endif

#ifndef erf
#error erf undefined
#endif

#ifndef erfc
#error erfc undefined
#endif

#ifndef exp2
#error exp2 undefined
#endif

#ifndef expm1
#error expm1 undefined
#endif

#ifndef fdim
#error fdim undefined
#endif

#ifndef floor
#error floor undefined
#endif

#ifndef fma
#error fma undefined
#endif

#ifndef fmax
#error fmax undefined
#endif

#ifndef fmin
#error fmin undefined
#endif

#ifndef fmod
#error fmod undefined
#endif

#ifndef frexp
#error frexp undefined
#endif

#ifndef hypot
#error hypot undefined
#endif

#ifndef ilogb
#error ilogb undefined
#endif

#ifndef ldexp
#error ldexp undefined
#endif

#ifndef lgamma
#error lgamma undefined
#endif

#ifndef llrint
#error llrint undefined
#endif

#ifndef llround
#error llround undefined
#endif

#ifndef log10
#error log10 undefined
#endif

#ifndef log1p
#error log1p undefined
#endif

#ifndef log2
#error log2 undefined
#endif

#ifndef logb
#error logb undefined
#endif

#ifndef lrint
#error lrint undefined
#endif

#ifndef lround
#error lround undefined
#endif

#ifndef nearbyint
#error nearbyint undefined
#endif

#ifndef nextafter
#error nextafter undefined
#endif

#ifndef nexttoward
#error nexttoward undefined
#endif

#ifndef remainder
#error remainder undefined
#endif

#ifndef remquo
#error remquo undefined
#endif

#ifndef rint
#error rint undefined
#endif

#ifndef round
#error round undefined
#endif

#ifndef scalbn
#error scalbn undefined
#endif

#ifndef scalbln
#error scalbln undefined
#endif

#ifndef tgamma
#error tgamma undefined
#endif

#ifndef trunc
#error trunc undefined
#endif

#ifndef carg
#error carg undefined
#endif

#ifndef cimag
#error cimag undefined
#endif

#ifndef conj
#error conj undefined
#endif

#ifndef cproj
#error cproj undefined
#endif

#ifndef creal
#error creal undefined
#endif


text:
/*
The burry command line tool enables to backup and restore
infra services such as ZooKeeper and etcd to and from local storage,
Amazon S3, Azure Storage, Google Storage, Minio as well as screen
dumps via the --target tty parameter.

Use:

 $ burry [args]

 With [args]:

  -b, --burryfest
        Create a burry manifest file .burryfest in the current directory.
        The manifest file captures the current command line parameters for re-use in subsequent operations.
  -c, --credentials string
        The credentials to use in format STORAGE_TARGET_ENDPOINT,KEY1=VAL1,...KEYn=VALn.
        Example: s3.amazonaws.com,ACCESS_KEY_ID=...,SECRET_ACCESS_KEY=...
  -e, --endpoint string
        The infra service HTTP API endpoint to use.
        Example: localhost:8181 for Exhibitor
  -i, --isvc string
        The type of infra service to back up or restore.
        Supported values are [etcd zk] (default "zk")
  -o, --operation string
        The operation to carry out.
        Supported values are [backup restore] (default "backup")
  -s, --snapshot string
        The ID of the snapshot.
        Example: 1483193387
  -t, --target string
        The storage target to use.
        Supported values are [local minio s3 tty] (default "tty")
  -v, --version
        Display version information and exit.

Note that for a backup operation (-o backup) the endpoint (-e EEE) is mandatory and
for a restore operation (-o restore) in addition the storage target (-t TTT) and the
snapshot ID (-s SSS) are mandatory.

Examples:

 # dump DC/OS system ZooKeeper content to screen:
 $ burry --endpoint leader.mesos:2181

 # back up a DC/OS etcd service to Minio playground:
 $ burry --endpoint etcd.mesos:1026 --isvc etcd --target s3 --credentials play.minio.io:9000,ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F,SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG

 # restore etcd from snapshot ID 1483383204
 $ burry -o restore -e etcd.mesos:1026 -i etcd -t local -s 1483383204

To enable debug info, set an environment variable DEBUG, for example DEBUG=true burry ...

For a full guide visit https://github.com/mhausenblas/burry.sh
*/
package main


text:
export { default as applyOptions } from './applyOptions';
export { default as destructureAlias } from './destructureAlias';
export { default as getArchiveOriginalUpdateObject } from './getArchiveOriginalUpdateObject';
export { default as hasOwnProperty } from './hasOwnProperty';
export { default as hydrateInverse } from './hydrateInverse';
export { default as isDataValidForSpliceAndPush } from './isDataValidForSpliceAndPush';
export { default as mergeRelationships } from './mergeRelationships';
export { default as normalizeRecord } from './normalizeRecord';
export { default as requiresIndex } from './requiresIndex';
export { default as syncRelationships } from './syncRelationships';


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PagedList.Mvc4.Example.Controllers
{
    public class TraditionalPagingController : BaseController
    {
		// Traditional Paging
		public ActionResult Index(int? page)
		{
			var listPaged = GetPagedNames(page); // GetPagedNames is found in BaseController
			if (listPaged == null)
				return HttpNotFound();

			// pass the paged list to the view and render
			ViewBag.Names = listPaged;
			return View();
		}
    }
}


text:
<?php declare(strict_types = 1);

namespace SlevomatCodingStandard\Helpers;

class UseStatement
{

	const TYPE_DEFAULT = ReferencedName::TYPE_DEFAULT;
	const TYPE_FUNCTION = ReferencedName::TYPE_FUNCTION;
	const TYPE_CONSTANT = ReferencedName::TYPE_CONSTANT;

	/** @var string */
	private $nameAsReferencedInFile;

	/** @var string */
	private $normalizedNameAsReferencedInFile;

	/** @var string */
	private $fullyQualifiedTypeName;

	/** @var int */
	private $usePointer;

	/** @var string */
	private $type;

	public function __construct(
		string $nameAsReferencedInFile,
		string $fullyQualifiedClassName,
		int $usePointer,
		string $type
	)
	{
		$this->nameAsReferencedInFile = $nameAsReferencedInFile;
		$this->normalizedNameAsReferencedInFile = self::normalizedNameAsReferencedInFile($type, $nameAsReferencedInFile);
		$this->fullyQualifiedTypeName = $fullyQualifiedClassName;
		$this->usePointer = $usePointer;
		$this->type = $type;
	}

	public static function normalizedNameAsReferencedInFile(string $type, string $name): string
	{
		if ($type !== self::TYPE_CONSTANT) {
			return strtolower($name);
		}

		$nameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $name);
		if (count($nameParts) === 1) {
			return $name;
		}

		return sprintf('%s%s%s', implode(NamespaceHelper::NAMESPACE_SEPARATOR, array_map(function (string $namePart): string {
			return strtolower($namePart);
		}, array_slice($nameParts, 0, -1))), NamespaceHelper::NAMESPACE_SEPARATOR, $nameParts[count($nameParts) - 1]);
	}

	public function getNameAsReferencedInFile(): string
	{
		return $this->nameAsReferencedInFile;
	}

	public function getCanonicalNameAsReferencedInFile(): string
	{
		return $this->normalizedNameAsReferencedInFile;
	}

	public function getFullyQualifiedTypeName(): string
	{
		return $this->fullyQualifiedTypeName;
	}

	public function getPointer(): int
	{
		return $this->usePointer;
	}

	public function isConstant(): bool
	{
		return $this->type === self::TYPE_CONSTANT;
	}

	public function isFunction(): bool
	{
		return $this->type === self::TYPE_FUNCTION;
	}

	public function hasSameType(self $that): bool
	{
		return $this->type === $that->type;
	}

	public function compareByType(self $that): int
	{
		$order = [
			self::TYPE_DEFAULT => 1,
			self::TYPE_CONSTANT => 2,
			self::TYPE_FUNCTION => 3,
		];

		return $order[$this->type] - $order[$that->type];
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/decelerate_interpolator">

    <scale
        android:duration="300"
        android:fromXScale="0.0"
        android:fromYScale="0.0"
        android:pivotX="50%p"
        android:pivotY="50%p"
        android:toXScale="1.0"
        android:toYScale="1.0" />
    <alpha android:fromAlpha="0" android:toAlpha="1.0"
        android:duration="300" />
</set>


text:
var shell = require('shelljs');
var urlparse = require('url-parse');
var simplegit = require('simple-git');
var sprintf = require("sprintf-js").sprintf,
    vsprintf = require("sprintf-js").vsprintf;
var fs = require('fs');

function ensureSudo() {
    shell.exec('sudo whoami >> /dev/null');
}

function ensureGitCryptInstalled() {
    return !!shell.which('git-crypt');
}

function ensureGitRepo(sg, cb) {
    if(!shell.which('git')) {
        return cb("Machinit requires git to work. Please install git before running Machinit.");
    }
    return sg.status((err, data) => {
        if(err) {
            if(err.toString().toLowerCase().indexOf('not a git') > -1) {
                data = err;
            }
            else return cb(err);
        }
        if(data.toString().toLowerCase().indexOf('not a git') > -1) {
            sg.init(false, (err, data) => {
                if(err) return cb(err);
                return cb(null);
            });
        } else return cb(null);
    });
}

function ensureRemoteAdded(sg, repourl, cb) {
    ensureRemoteRemoved(sg, (err) => {
        if(err) return cb(err);
        sg.addRemote('machinit', repourl, (err, data) => {
            if(err) return cb(err);
            return cb(null);
        });
    });
}

function ensureRemoteRemoved(sg, cb) {
    ensureGitRepo(sg, (err) => {
        if(err) return cb(err);
        sg.removeRemote('machinit', (err, data) => {
            if(err) {
                if(!(err.toString().toLowerCase().indexOf('could not remove') > -1)) {
                    return cb(err);
                }
            }
            return cb(null);
        });
    });
}

function setGitAuthOnRemote(data, remote) {
    if(data.gitusername && data.gitpassword) {
        var parsedremote = urlparse(remote);
        parsedremote.set('username', encodeURIComponent(data.gitusername));
        parsedremote.set('password', encodeURIComponent(data.gitpassword));
        remote = parsedremote.toString();
        console.log(remote);
    }
    return remote;
}

function logError(err, info) {
    if(!!info) {
        console.log(info);
    }
    console.log(err);
}

function updateSystem(data) {
    ensureSudo();
    var repo = data.localrepo;
    var remote = setGitAuthOnRemote(data, data.remote);
    var sg = simplegit();
    shell.exec('sudo rm -rf ' + repo);
    sg.clone(remote, repo, (err) => {
        if(err) return logError(err, 'error occurred while cloning remote:');
        if(data.encryption) {
            var gitCryptDetected = ensureGitCryptInstalled();
            if(!gitCryptDetected) {
                console.log('git-crypt is required for git repository encryption.  Please install it using instructions that can be found at https://github.com/AGWA/git-crypt');
                return;
            }
            if(!data.keypath) {
                console.log('attempting to update from encrypted repository.  Please specify a key path using --key');
                return;
            }
            shell.exec('cd ' + repo + ' && git-crypt unlock ' + data.keypath);
        }
        for(var i = 0; i < data.files.length; i++) {
            var file = data.files[i];
            var filename = file.name;
            var repopath = repo + '/' + file.repofolder;
            var systempath = file.platforms[data.currentplatform].path;
            var sudo = !!file.sudo;

            shell.mkdir('-p', systempath);
            var systemlocal = !!file.directory ? systempath : systempath + '/' + filename;
            if(sudo) shell.exec('sudo cp -rf ' + repopath + '/' + filename + ' ' + systemlocal);
            else shell.exec('cp -rf ' + repopath + '/' + filename + ' ' + systemlocal);
        }
        shell.exec('sudo rm -rf ' + repo);
    });

}

function updateRepo(data) {
    var repo = data.localrepo;
    var remote = setGitAuthOnRemote(data, data.remote);
    var sg = simplegit(repo);
    var encryptedfiles = [];
    for(var i = 0; i < data.files.length; i++) {
        var file = data.files[i];
        var filename = file.name;
        var repopath = repo + '/' + file.repofolder;
        var systempath = file.platforms[data.currentplatform].path + '/' + filename;
        var sudo = !!file.sudo;

        if(!!file.encryption) {
            var repolocal = file.repofolder + '/' + filename;
            if(!!file.directory) {
                repolocal += '/*';
            }
            encryptedfiles.push(repolocal);
        }

        shell.mkdir('-p', repopath);
        var repolocal = !!file.directory ? repopath : repopath + '/' + filename;
        if(sudo) {
          shell.exec('sudo cp -rf ' + systempath + ' ' + repolocal);
          shell.exec('sudo chmod -R 777 ' + repopath + '/' + filename);
        }
        else shell.cp('-rf', systempath, repolocal);
    }

    ensureGitRepo(sg, (err) => {
        if(err) return logError(err, 'error occurred while initializing git repo:');
        function performGitOps(postAdd) {
            sg.add('--all', (err, info) => {
                if(err) return logError(err, 'error occurred while adding files to repo:');
                sg.commit('Updated machinit repo', (err, info) => {
                    if(err) return logError(err, 'error occurred while committing to repo:');
                    if(!!postAdd) postAdd();
                    ensureRemoteAdded(sg, remote, (err) => {
                        if(err) return logError(err, 'error occurred while adding remote:');
                        sg.push(['-f', 'machinit', 'master'], (err, info) => {
                            if(err) return logError(err, 'error occurred while pushing to remote:');
                            shell.exec('sudo rm -rf ' + repo);
                        });
                    });
                });
            });
        }
        if(data.encryption) {
            var gitCryptDetected = ensureGitCryptInstalled();
            if(!gitCryptDetected) {
                console.log('git-crypt is required for git repository encryption.  Please install it using instructions that can be found at https://github.com/AGWA/git-crypt');
                return;
            }
            if(!data.keypath) {
                console.log('attempting to update from encrypted repository.  Please specify a key path using --key');
                return;
            }
            shell.exec('cd ' + repo + ' && git-crypt init');
            var gitattributeslinetemplate = '%s filter=git-crypt diff=git-crypt\n';
            var gitattributespath = repo + '/.gitattributes';
            var writeStream = fs.createWriteStream(gitattributespath);
            for(var i = 0; i < encryptedfiles.length; i++) {
                writeStream.write(sprintf(gitattributeslinetemplate, encryptedfiles[i]));
            }
            writeStream.close();
            sg.add('.gitattributes', (err, info) => {
                if(err) return logError(err, 'error occurred while adding gitattributes file:');
                sg.commit('Update gitattributes for encryption', (err, info) => {
                    if(err) return logError(err, 'error occurred while committing gitattributes file:');
                    performGitOps(() => {
                        shell.exec('cd ' + repo + ' && git-crypt export-key ' + data.keypath);
                        console.log('git-crypt encryption key exported to: ' + data.keypath);
                    });
                });
            });
        }
        else performGitOps();
    });
}

function installPackages(data) {
    ensureSudo();
    for(var i = 0; i < data.packages.length; i++) {
        var package = data.packages[i];
        var platformpackage = package.platforms[data.currentplatform];
        if(!platformpackage) {
            console.log('Skipping package: ' + package.name + '.  Platform not specified for package.');
            continue;
        }
        console.log('Installing package: ' + package.name);
        var commands = platformpackage.commands;
        var failed;
        for(var j = 0; j < commands.length; j++) {
            var command = commands[j];
            var commandresult = shell.exec(commands[j]);
            if(commandresult.stderr.toString().length > 0) {
                console.log('Error detected installing package.');
                console.log('Error: ' + commandresult.stderr.toString());
                failed = true;
            }
        }
        if(!failed) console.log('Package installed!');
        else console.log('Error(s) detected in package installation.  Package may not have been installed.');
    }
}

module.exports = {
    updateRepo: updateRepo,
    updateSystem: updateSystem,
    installPackages: installPackages
};


text:
package com.geecat.steps.test;

//import static java.lang.Math.sqrt;

public class ImportTest {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		System.out.println(Math.sqrt(4));
		//sqrt(5);
	}
	//testing staic import and potential of name space collisions.
	static int sqrt(int n){
		return n;

	}

}