text:
from mock import Mock
from unittest import TestCase
from selenium.webdriver.remote.webdriver import WebDriver

from keteparaha.page import Component, Page

class HomePage(Page):
    url = 'https://obviously-not-real.com/'

    def get_elements(self, selector):
        return [i for i in range(10)]

class CoolPage(Page):
    url = 'https://obviously-not-real.com/path'

    def setup(self, _query):
        self.query = _query

class ComplexPathPage(Page):
    url = r'/s/([0-9]{4})/(?P<slug>[\w]+)/$'

    def setup(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs

class Modal(Component):
    selector = '#modal-id'

    def __repr__(self):
        return super(Modal, self).__repr__()

    @property
    def _element(self):
        return MockDriver()

class ModalNext(Component):
    selector = '#modal-next'

    def __repr__(self):
        return super(Modal, self).__repr__()

class MockDriver(WebDriver):

    current_url = ''
    session_id = ''

    def __init__(self):
        self.current_url = ''

    @property
    def _element(self):
        return MockDriver()

    def is_enabled(self):
        return True

    def is_displayed(self):
        return True

    def find_element_by_css_selector(self, selector):
        return Mock()

    def find_element_by_link_text(self, selector):
        return Mock()

    def find_elements_by_tag_name(self, selector):
        return [
            type('btn', (Mock,), {'_parent': MockDriver()})(text=t)
                for t in  ['yes', 'no', 'button text']]

    def get(self, url):
        self.current_url = url

    def find_element(self, *args):
        return self

    def find_elements(self, *args):
        return [i for i in range(10)]

    def click(self):
        pass

    def send_keys(*text):
        raise Exception('Send keys called with {}'.format(text))

class MockParent(object):
    _driver = ''

class PageTest(TestCase):

    def test_dynamically_switches_page_class_based_on_url(self):
        home = HomePage(driver=MockDriver())
        home._driver.current_url = CoolPage.url + '?search=hello'
        cool_page = home.click('.btn')

        self.assertIsInstance(cool_page, CoolPage)
        self.assertEqual(cool_page.query, {'search': ['hello']})

    def test_dynamically_passes_captured_url_elements_to_component(self):
        home = HomePage(driver=MockDriver())
        home._driver.current_url = ComplexPathPage.url.replace(
            '([0-9]{4})', '9999').replace(
            '(?P<slug>[\w]+)/$', 'thisisthearticle/'
        ) + '?hello=world&testers=are_people#fragment'
        complex_page = home.click('.btn')

        self.assertIsInstance(complex_page, ComplexPathPage)
        self.assertEqual(complex_page.args, ('9999',))
        self.assertEqual(complex_page.kwargs['slug'], 'thisisthearticle')
        self.assertEqual(
            complex_page.kwargs['_query'],
            {'hello': ['world'], 'testers': ['are_people']}
        )
        self.assertEqual(complex_page.kwargs['_fragment'], 'fragment')

    def test_dynamically_returns_component(self):
        home = HomePage(driver=MockDriver())
        home._driver.current_url = CoolPage.url
        modal = home.click('.btn', opens='#modal-id')

        self.assertIsInstance(modal, Modal)

class ComponentTest(TestCase):

    def test_component_repr(self):
        home = HomePage(driver=MockDriver())
        self.assertEqual(repr(Modal(home)), 'Modal(selector="#modal-id")')

    def test_get_component_with_passed_in_component_class(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component(Modal)

        self.assertIsInstance(modal, Component)

    def test_get_component_with_passed_in_component_selector(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        self.assertIsInstance(modal, Component)

    def test_get_component_with_nonexistent_passed_in_component_selector(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id2')

        self.assertIsInstance(modal, Component)

    def test_get_components_gives_unique_selector_to_each_component(self):
        home = HomePage(driver=MockDriver())
        rows = home.get_components('tr')

        for idx, row in enumerate(rows):
            self.assertEqual(row._find_by, 'index_position')
            self.assertEqual(row._index_position, idx)

    def test_repr_of_dynamic_components(self):
        home = HomePage(driver=MockDriver())
        rows = home.get_components('tr')

        self.assertEqual(
            str(rows[0]), 'DynamicComponent(selector="tr")[0]')

    def test_click_button(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        modal_next = modal.click_button('button text', opens='#modal-next')

        self.assertIsInstance(modal_next, ModalNext)

    def test_click_link(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        modal_next = modal.click_link('button text', opens='#modal-next')

        self.assertIsInstance(modal_next, ModalNext)

    def test_click_button_with_passed_in_class(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        modal_next = modal.click_button('button text', opens=ModalNext)

        self.assertIsInstance(modal_next, ModalNext)

    def test_click_with_passed_in_class(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        modal_next = modal.click('.btn', opens=ModalNext)

        self.assertIsInstance(modal_next, ModalNext)

    def test_enter_text_calls_elements_send_keys_method(self):
        home = HomePage(driver=MockDriver())
        modal = home.get_component('#modal-id')

        with self.assertRaises(Exception) as exc:
            modal.enter_text('selector', 'test text')

        self.assertIn("'t', 'e', 's', 't'", exc.exception.args[0], '')


text:
This is a [Yeoman generator](http://yeoman.io) for kickstarting ProcessWire projects with a [Fabricator UI Toolkit](https://github.com/fbrctr/fabricator).

The generator:

- creates a project structure allowing you to easily manage the following:
	- website source
	- database exports
	- living styleguide
- downloads [ProcessWire](http://processwire.com)
- installs Fixate's [ProcessWire MVC Boilerplate](http://github.com/fixate/pw-mvc-boilerplate)
- installs Fixate's [Fabricator Boilerplate](http://github.com/fixate/fixate-fabricator)
- installs a [SCSS Framework](http://github.com/larrybotha/styleguide)
- installs [Bower](http://bower.io) for easily managing your dependencies
- creates a number of files for smoother development and collaboration:
	- .editorconfig
	- .gitignore
	- .gitattributes
	- .bowerrc
	- robots.txt
- installs [Gulp](http://gulpjs.com) with an extensive task list (written in CoffeeScript for your viewing pleasure) fully equipped for
	- coffee and Sass compilation
	- JS uglification
	- image optimisation
	- timestamped local and production database dumps
	- rsync deployments
	- gulp auto reload
	- other treasures!

## Getting Started

### Get Yeoman

Yeoman is a [Node](http://nodejs.org]) package which can be installed via [npm](http://npmks.org):

```
$ npm install -g yo
```

### Get The Generator

Unlike many Yoeman Generators, this generator doesn't live in Yeoman's registry, as it is quite specific to our needs.

Until we decide to add our generator to the Yeoman registry, this is how you can enjoy some of the magic:

```
# clone the generator
$ git clone https://github.com/fixate/generator-fixate-pw.git

# let Yeoman know about the generator
$ cd generator-fixate-pw
$ npm link

# install all the generator dependencies
$ npm install
```

### Get Your Project Did!

Initiate the generator from the root of your project's folder:

```
$ cd your-project-folder
$ yo fixate-pw
```

Once Yeoman has done all the hard work, you have a few small tasks to run before you're free to get going.

#### 1. Install ProcessWire

#### 2. Install Project Dependencies

All task automation is handled through Gulp and Webpack.

```shell
$ npm install
```

This will install all development dependencies, as well as create copies for non-committed config files, and creation of symlinks for assets in the living styleguide

#### 2. Install And Run Living Styleguide

This project makes use of [Fabricator](https://github.com/fbrctr/fabricator) as a living styleguide. To get up and running:

```shell
$ cd styleguide && npm install
```

Once installed, you can start a server for the styleguide that will automatically update on chnages to styles with the following:

```shell
# from styleguide/
$ gulp --dev
```

#### 3. Work On ProcessWire

Gulp will compile coffee and scss files when updated, and reload your browser via Browser Sync at the URL it specifies when starting Gulp (make sure to update the browserSyncProxy property in the generated [secrets.coffee](https://github.com/fixate/generator-fixate-pw/blob/master/app/templates/gulp/secrets-sample.coffee#L4) with your local site's URL)

```shell
# from project root
$ gulp
```

#### 4. Change Template Alternate Filename

For each template, visit your admin and set all templates to use `mvc`:

```
Setup -> [your template] -> Files -> Alternate Template Filename
```

## License

MIT: http://fixate.mit-license.org/

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace League\Tactician\Tests\Fixtures\Handler;

/**
 * Some folks prefer to rely on __call to proxy the incoming commands to
 * methods, rather than do the routing externally. This test spy can be used to
 * verify this works correctly.
 */
class DynamicMethodsHandler
{
    /**
     * @param mixed[] $args
     */
    public function __call(string $methodName, array $args) : void
    {
    }
}


text:
<!DOCTYPE html>

        <title>Test multiple MediaKeys lifetimes</title>


text:
<!DOCTYPE html>

    <meta charset='utf-8' />
    <meta http-equiv="X-UA-Compatible" content="chrome=1" />
    <meta name="description" content="HerveCaumont.github.io : myPages" />

    <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">

    <title>HerveCaumont.github.io</title>

          View on GitHub

HerveCaumont.github.io

myPages

Digital earth scalers

Our world is changing fast. We support Earth Sciences at many scales

Benefit from cutting-edge tools to operate within distributed computing environments. So you run end-to-end analysis as a simple, flexible, scalable process

Experience with services from a high-performing, DevOps-enabled organization,
and get increased agility and reliability. Combine data sources across disciplines, validate innovative ways to process them

Integrate data and literature, document your experiments, share across communities. We build upon the new data streams economy. Together we connect research to value-adding services

Published with GitHub Pages


text:
require 'rest-client'
require 'json'

host = "CHANGE ME"
client_id = "CHANGE ME"
client_secret = "CHANGE ME"

def get_token(host, client_id, client_secret)
  url = "#{host}/identity/oauth/token?grant_type=client_credentials&client_id=#{client_id}&client_secret=#{client_secret}"
  response = RestClient.get url
  json = JSON.parse(response)
  return json["access_token"]
end

objects = [
  {
    :leadId => 1,
    :externalopportunityid => "Ruby Opportunity 1",
    :role => "Captain"
  }
]
body = {
  :input => objects,
  :dedupeBy => "dedupeFields"
}

response = RestClient.post "#{host}/rest/v1/opportunities/roles.json?access_token=#{get_token(host, client_id, client_secret)}", JSON.generate(body), {:content_type => "application/json"}

puts response


text:
title:  Frafaldne mennesker
date:  07/12/2019
---

>
Ugens vers

> "Jeg befalede levitterne, at de skulle rense sig og komme og holde vagt i portene for at holde sabbatsdagen hellig. Husk mig også for dette, min Gud, og vis mig barmhjertighed i din store godhed!" (Neh 13,22).

**Introduktion**

I tidsrummet mellem kapitel 12 og 13 vender Nehemias tilbage til Babylon. Vi ved ikke, hvor længe han befandt sig der; men da han vendte tilbage til Jerusalem (sandsynligvis omkring 430-425 f.Kr.), var folket ved at falde fra. De havde indgået en pagt med Gud om 1) ikke at gifte sig med afgudsdyrkere; 2) nøje overholde sabbatten; og 3) opretholde templet og dets arbejdere med deres tiende og gaver (Neh 10). Men de havde brudt alle disse tre løfter.

Da Nehemias vendte tilbage, opdagede han, at de var blevet meget ligegyldige med deres overgivelse til Gud. De var holdt op med at bringe deres tiende og gaver, var begyndt at benytte rummene i templet i strid med hensigten, var ophørt med at holde sabbat på den rette måde og var til og med begyndt at gifte sig med folk fra de omkringliggende folkeslag. Det værste var, at de ledere, som Nehemias havde efterladt, medvirkede til forværringen af israelitternes forhold til Gud. Det kan ikke overraske, at Nehemias følte sig knust, da han opdagede, hvor store forandringer der var indtruffet. Men i stedet for at acceptere det skred han i overensstemmelse med sin natur igen til handling for at fremme Guds herlighed.

**Ugens tekster**

- Neh 13,1-9
- 5 Mos 23,3-6
- Neh 13,10-14
- 4 Mos 18,21-24
- Neh 13,15-22
- Joh 5,2-16


text:
package org.elasticsearch.common.io;

import org.apache.lucene.util.LuceneTestCase;

import java.nio.file.FileSystem;

/**
 * Exposes some package private stuff in PathUtils for framework purposes only!
 */
public class PathUtilsForTesting {

    /** Sets a new default filesystem for testing */
    public static void setup() {
        installMock(LuceneTestCase.createTempDir().getFileSystem());
    }

    /** Installs a mock filesystem for testing */
    public static void installMock(FileSystem mock) {
        PathUtils.DEFAULT = mock;
    }

    /** Resets filesystem back to the real system default */
    public static void teardown() {
        PathUtils.DEFAULT = PathUtils.ACTUAL_DEFAULT;
    }
}


text:
//
//  ConfidenceSummary.hpp
//  Clock Signal
//
//  Created by Thomas Harte on 21/01/2018.
//  Copyright 2018 Thomas Harte. All rights reserved.
//

#ifndef ConfidenceSummary_hpp
#define ConfidenceSummary_hpp

#include "ConfidenceSource.hpp"

#include <vector>

namespace Analyser {
namespace Dynamic {

/*!
	Summaries a collection of confidence sources by calculating their weighted sum.
*/
class ConfidenceSummary: public ConfidenceSource {
	public:
		/*!
			Instantiates a summary that will produce the weighted sum of
			@c sources, each using the corresponding entry of @c weights.

			Requires that @c sources and @c weights are of the same length.
		*/
		ConfidenceSummary(
			const std::vector<ConfidenceSource *> &sources,
			const std::vector<float> &weights);

		/*! @returns The weighted sum of all sources. */
		float get_confidence() final;

	private:
		const std::vector<ConfidenceSource *> sources_;
		const std::vector<float> weights_;
		float weight_sum_;
};

}
}

#endif /* ConfidenceSummary_hpp */


text:
package org.tolweb.tapestry;

import org.apache.tapestry.IRequestCycle;
import org.tolweb.hibernate.MappedNode;
import org.tolweb.hibernate.MappedPage;

public abstract class EditDeletePageConfirm extends AbstractPageEditingPage {
    public abstract void setPageDeleted(boolean value);
    public abstract void setParentGroup(String value);
    public abstract String getParentGroup();

    public void deletePage(IRequestCycle cycle) {
        MappedPage page = getTolPage();
        MappedNode parentPageNode = getDAO().getNodeForPageNodeIsOn(page.getMappedNode());
        String groupName = "";
        if (parentPageNode != null) {
            groupName = parentPageNode.getName();
        }
        setParentGroup(groupName);
        getDAO().deletePageAndReassignNodes(page);
        setPageDeleted(true);
    }
    public void returnToEditing(IRequestCycle cycle) {
        goToOtherEditPage(cycle);
    }
    public String getWorkingPageUrl() {
        return "'" + getUrlBuilder().getWorkingURLForObject(getParentGroup()) + "'";
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template type="basic" name="Pisema2d" author="varian" investigator=""
    time_created="20051110T145431" apptype="solidsseq2d"
    application="solids" scans="Pisema2d" seqfil="pisema2d" tabname="Solids Experiments" menu1="HX 2D" menu2="">
  <protocol title="Pisema2d" type="protocol">
    <action  type="LIB" status="Ready" lock="off" title="Pisema2d" exp="solidsseq2d"
      time="1 min" macro="cqexp('Pisema2d','solidsseq2d')" data="" />
  </protocol>
</template>


text:
package renesca.parameter

object implicits {
  implicit def primitiveToPropertyValue(x: Long): LongPropertyValue = LongPropertyValue(x)
  implicit def primitiveToPropertyValue(x: Int): LongPropertyValue = LongPropertyValue(x)
  implicit def primitiveToPropertyValue(x: Double): DoublePropertyValue = DoublePropertyValue(x)
  implicit def primitiveToPropertyValue(x: String): StringPropertyValue = StringPropertyValue(x)
  implicit def primitiveToPropertyValue(x: Boolean): BooleanPropertyValue = BooleanPropertyValue(x)

  implicit def SeqLongToPropertyValue(xs: Seq[Long]): LongArrayPropertyValue = LongArrayPropertyValue(xs map LongPropertyValue: _*)
  implicit def SeqIntToPropertyValue(xs: Seq[Int]): LongArrayPropertyValue = LongArrayPropertyValue(xs map (e => LongPropertyValue(e.toLong)): _*)
  implicit def SeqDoubleToPropertyValue(xs: Seq[Double]): DoubleArrayPropertyValue = DoubleArrayPropertyValue(xs map DoublePropertyValue: _*)
  implicit def SeqStringToPropertyValue(xs: Seq[String]): StringArrayPropertyValue = StringArrayPropertyValue(xs map StringPropertyValue: _*)
  implicit def SeqBooleanToPropertyValue(xs: Seq[Boolean]): BooleanArrayPropertyValue = BooleanArrayPropertyValue(xs map BooleanPropertyValue: _*)

  implicit def propertyValueToPrimitive(x: LongPropertyValue): Long = x.value
  implicit def propertyValueToPrimitive(x: DoublePropertyValue): Double = x.value
  implicit def propertyValueToPrimitive(x: StringPropertyValue): String = x.value
  implicit def propertyValueToPrimitive(x: BooleanPropertyValue): Boolean = x.value

  implicit def LongArrayPropertyValueToSeq(x: LongArrayPropertyValue): Seq[Long] = x.elements map (_.value)
  implicit def DoubleArrayPropertyValueToSeq(x: DoubleArrayPropertyValue): Seq[Double] = x.elements map (_.value)
  implicit def StringArrayPropertyValueToSeq(x: StringArrayPropertyValue): Seq[String] = x.elements map (_.value)
  implicit def BooleanArrayPropertyValueToSeq(x: BooleanArrayPropertyValue): Seq[Boolean] = x.elements map (_.value)

  implicit def primitiveToPropertyKey(x: String): PropertyKey = PropertyKey(x)
  implicit def propertyKeyToPrimitive(x: PropertyKey): String = x.name

  implicit def StringMapToPropertyKeyMap(key: String) = new AnyRef {
    def ->(x: PropertyValue) = (PropertyKey(key), x)
    def ->(x: SoleParameterValue) = (PropertyKey(key), x)
  }

  implicit def ParameterMapToMapParameterValue(map: ParameterMap): MapParameterValue = MapParameterValue(map)
  implicit def MapParameterValueToParameterMap(map: MapParameterValue): ParameterMap = map.value
}


text:
using Orchard.Taxonomies.Models;
using System.Collections.Generic;

namespace Orchard.Taxonomies.ViewModels {
    public class MoveTermViewModel {
        public IEnumerable<TermPart> Terms { get; set; }
        public int SelectedTermId { get; set; }
        public IEnumerable<int> TermIds { get; set; }
    }
}


text:
<template name="afInputMonth_semanticUI">
  <input type="month" value="{{this.value}}" {{this.atts}}/>
</template>


text:
#ifndef HEADER_DMGDVT_FLASHLIGHT
#define HEADER_DMGDVT_FLASHLIGHT

#include <SFML/Graphics.hpp>

#include <LightSystem/Light.hpp>
#include <LightSystem/SpotLight.hpp>

namespace dm
{
namespace ls
{

    class FlashLight : public SpotLight
    {
        public:
            FlashLight(const sf::Vector2f& p, float r, float l, const sf::Color& c);
            FlashLight(const sf::Vector2f& p, float r, float l, const sf::Color& c, float da, float sa, float i, float b, float lf);

            virtual void preRender(sf::Shader* shader) override;
            virtual void debugRender(sf::RenderTarget& target, const sf::RenderStates &states) override;

            void setLength(float l);
            float getLength() const;

        protected:
            sf::ConvexShape _makeShape() override;

            float _length; //length from origin to start of light

    };
}
}

#endif //HEADER_DMGDVT_FLASHLIGHT


text:
<?php

class RequestTest extends AbstractTest {

	function testOtherUserCanSeeAsForAllUsers() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), null);

		# 1
		$request = Request::findByIDForUser($requestID, $user2);
		$this->assertNotNull($request);

		# 2
		$d = $supportGroup->getNotificationsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 3
		$d = $supportGroup->getRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 4
		$d = $supportGroup->getOpenRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 5
		$d = $supportGroup->getHomePageRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 6
		$d = $supportGroup->getOpenRequestsVisibleToUserCount($user2);
		$this->assertEquals(1, $d);

		# 7
		$start = mktime(12,0,0,1,1,2010);
		$end = mktime(12,0,0,1,1,2040);
		$d = $supportGroup->getRequestsVisibleToUserOnCalendar($user2, $start, $end);
		$this->assertEquals(1, count($d));

	}

	function testOtherUserCanSeeAsForThem() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), array($user2->getId()));

		# 1
		$request = Request::findByIDForUser($requestID, $user2);
		$this->assertNotNull($request);

		# 2
		$d = $supportGroup->getNotificationsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 3
		$d = $supportGroup->getRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 4
		$d = $supportGroup->getOpenRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 5
		$d = $supportGroup->getHomePageRequestsVisibleToUser($user2);
		$this->assertEquals(1, count($d));

		# 6
		$d = $supportGroup->getOpenRequestsVisibleToUserCount($user2);
		$this->assertEquals(1, $d);

		# 7
		$start = mktime(12,0,0,1,1,2010);
		$end = mktime(12,0,0,1,1,2040);
		$d = $supportGroup->getRequestsVisibleToUserOnCalendar($user2, $start, $end);
		$this->assertEquals(1, count($d));

	}

	function testUserCanSeeRequestTheySent() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), array($user2->getId()));

		# 1
		$request = Request::findByIDForUser($requestID, $user1);
		$this->assertNotNull($request);

		# 2
		$d = $supportGroup->getNotificationsVisibleToUser($user1);
		$this->assertEquals(1, count($d));

		# 3
		$d = $supportGroup->getRequestsVisibleToUser($user1);
		$this->assertEquals(1, count($d));

		# 4
		$d = $supportGroup->getOpenRequestsVisibleToUser($user1);
		$this->assertEquals(1, count($d));

		# 5
		$d = $supportGroup->getHomePageRequestsVisibleToUser($user1);
		$this->assertEquals(1, count($d));

		# 6
		$d = $supportGroup->getOpenRequestsVisibleToUserCount($user1);
		$this->assertEquals(1, $d);

		# 7
		$start = mktime(12,0,0,1,1,2010);
		$end = mktime(12,0,0,1,1,2040);
		$d = $supportGroup->getRequestsVisibleToUserOnCalendar($user1, $start, $end);
		$this->assertEquals(1, count($d));

	}

	function testUser3CantSee() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test3@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), array($user2->getId()));

		# 1
		$request = Request::findByIDForUser($requestID, $user3);
		$this->assertNull($request);

		# 2
		$d = $supportGroup->getNotificationsVisibleToUser($user3);
		$this->assertEquals(0, count($d));

		# 3
		$d = $supportGroup->getRequestsVisibleToUser($user3);
		$this->assertEquals(0, count($d));

		# 4
		$d = $supportGroup->getOpenRequestsVisibleToUser($user3);
		$this->assertEquals(0, count($d));

		# 5
		$d = $supportGroup->getHomePageRequestsVisibleToUser($user3);
		$this->assertEquals(0, count($d));

		# 6
		$d = $supportGroup->getOpenRequestsVisibleToUserCount($user3);
		$this->assertEquals(0, $d);

		# 7
		$start = mktime(12,0,0,1,1,2010);
		$end = mktime(12,0,0,1,1,2040);
		$d = $supportGroup->getRequestsVisibleToUserOnCalendar($user3, $start, $end);
		$this->assertEquals(0, count($d));

	}

	function testToUsersFunctionWhenToLimitedUsers() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test3@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), array($user2->getId()));

		$request = Request::findByID($requestID);
		$usersTo = $request->getToUsers();

		$this->assertEquals(1, count($usersTo));
	}

	function testToUsersFunctionWhenAllUsers() {
		$this->setupDB();

		$supportGroup = SupportGroup::create('Test');

		$user1 = UserAccount::findByEmailOrCreate('test@test.com');
		$supportGroup->addUser($user1,true);

		$user2 = UserAccount::findByEmailOrCreate('test2@test.com');
		$supportGroup->addUser($user2,true);

		$user3 = UserAccount::findByEmailOrCreate('test3@test.com');
		$supportGroup->addUser($user3,true);

		$requestID = $supportGroup->newRequest($user1, 'Summary', 'Message', array(), null);

		$request = Request::findByID($requestID);
		$usersTo = $request->getToUsers();

		$this->assertEquals(2, count($usersTo));
	}

}


text:
#ifndef _GEN6_VME_H_
#define _GEN6_VME_H_

#include <xf86drm.h>
#include <drm.h>
#include <i915_drm.h>
#include <intel_bufmgr.h>

#include "i965_gpe_utils.h"

#define INTRA_VME_OUTPUT_IN_BYTES       16      /* in bytes */
#define INTRA_VME_OUTPUT_IN_DWS         (INTRA_VME_OUTPUT_IN_BYTES / 4)
#define INTER_VME_OUTPUT_IN_BYTES       160     /* the first 128 bytes for MVs and the last 32 bytes for other info */
#define INTER_VME_OUTPUT_IN_DWS         (INTER_VME_OUTPUT_IN_BYTES / 4)

#define MAX_INTERFACE_DESC_GEN6         MAX_GPE_KERNELS
#define MAX_MEDIA_SURFACES_GEN6         34

#define GEN6_VME_KERNEL_NUMBER          3

#define INTEL_COST_TABLE_OFFSET         8

struct encode_state;
struct intel_encoder_context;

struct gen6_vme_context
{
    struct i965_gpe_context gpe_context;

    struct {
        dri_bo *bo;
    } vme_state;

    struct i965_buffer_surface vme_output;
    struct i965_buffer_surface vme_batchbuffer;

    void (*vme_surface2_setup)(VADriverContextP ctx,
                               struct i965_gpe_context *gpe_context,
                               struct object_surface *obj_surface,
                               unsigned long binding_table_offset,
                               unsigned long surface_state_offset);
    void (*vme_media_rw_surface_setup)(VADriverContextP ctx,
                                       struct i965_gpe_context *gpe_context,
                                       struct object_surface *obj_surface,
                                       unsigned long binding_table_offset,
                                       unsigned long surface_state_offset,
                                       int write_enabled);
    void (*vme_buffer_suface_setup)(VADriverContextP ctx,
                                    struct i965_gpe_context *gpe_context,
                                    struct i965_buffer_surface *buffer_surface,
                                    unsigned long binding_table_offset,
                                    unsigned long surface_state_offset);
    void (*vme_media_chroma_surface_setup)(VADriverContextP ctx,
                                           struct i965_gpe_context *gpe_context,
                                           struct object_surface *obj_surface,
                                           unsigned long binding_table_offset,
                                           unsigned long surface_state_offset,
                                           int write_enabled);
    void *vme_state_message;
    unsigned int h264_level;
    unsigned int hevc_level;
    unsigned int video_coding_type;
    unsigned int vme_kernel_sum;
    unsigned int mpeg2_level;

    struct object_surface *used_reference_objects[2];
    void *used_references[2];
    unsigned int ref_index_in_mb[2];

    dri_bo *i_qp_cost_table;
    dri_bo *p_qp_cost_table;
    dri_bo *b_qp_cost_table;
    int cost_table_size;

    /* one buffer define qp per mb. one byte for every mb.
     * If it needs to be accessed by GPU, it will be changed to dri_bo.
     */
    bool roi_enabled;
    char *qp_per_mb;
    int saved_width_mbs, saved_height_mbs;
};

#define MPEG2_PIC_WIDTH_HEIGHT	30
#define	MPEG2_MV_RANGE		29
#define	MPEG2_LEVEL_MASK	0x0f
#define	MPEG2_LEVEL_LOW		0x0a
#define	MPEG2_LEVEL_MAIN	0x08
#define	MPEG2_LEVEL_HIGH	0x04

Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);

extern void intel_vme_update_mbmv_cost(VADriverContextP ctx,
                                       struct encode_state *encode_state,
                                       struct intel_encoder_context *encoder_context);

void intel_vme_vp8_update_mbmv_cost(VADriverContextP ctx,
                                struct encode_state *encode_state,
                                struct intel_encoder_context *encoder_context);

Bool gen7_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);

#define		MODE_INTRA_NONPRED	0
#define		MODE_INTRA_16X16	1
#define		MODE_INTRA_8X8		2
#define		MODE_INTRA_4X4		3
#define		MODE_INTER_16X8		4
#define		MODE_INTER_8X16		4
#define		MODE_INTER_8X8		5
#define		MODE_INTER_8X4		6
#define		MODE_INTER_4X8		6
#define		MODE_INTER_4X4		7
#define		MODE_INTER_16X16	8
#define		MODE_INTER_BWD		9
#define		MODE_REFID_COST		10
#define		MODE_CHROMA_INTRA	11

#define		MODE_INTER_MV0		12
#define		MODE_INTER_MV1		13
#define		MODE_INTER_MV2		14

#define		MODE_INTER_MV3		15
#define		MODE_INTER_MV4		16
#define		MODE_INTER_MV5		17
#define		MODE_INTER_MV6		18
#define		MODE_INTER_MV7		19

#define		INTRA_PRED_AVAIL_FLAG_AE	0x60
#define		INTRA_PRED_AVAIL_FLAG_B		0x10
#define		INTRA_PRED_AVAIL_FLAG_C       	0x8
#define		INTRA_PRED_AVAIL_FLAG_D		0x4
#define		INTRA_PRED_AVAIL_FLAG_BCD_MASK	0x1C

extern void
gen7_vme_walker_fill_vme_batchbuffer(VADriverContextP ctx,
                                     struct encode_state *encode_state,
                                     int mb_width, int mb_height,
                                     int kernel,
                                     int transform_8x8_mode_flag,
                                     struct intel_encoder_context *encoder_context);

extern void
gen7_vme_scoreboard_init(VADriverContextP ctx, struct gen6_vme_context *vme_context);

extern void
intel_vme_mpeg2_state_setup(VADriverContextP ctx,
                            struct encode_state *encode_state,
                            struct intel_encoder_context *encoder_context);

extern void
gen7_vme_mpeg2_walker_fill_vme_batchbuffer(VADriverContextP ctx,
                                           struct encode_state *encode_state,
                                           int mb_width, int mb_height,
                                           int kernel,
                                           struct intel_encoder_context *encoder_context);

void
intel_avc_vme_reference_state(VADriverContextP ctx,
                              struct encode_state *encode_state,
                              struct intel_encoder_context *encoder_context,
                              int list_index,
                              int surface_index,
                              void (* vme_source_surface_state)(
                                  VADriverContextP ctx,
                                  int index,
                                  struct object_surface *obj_surface,
                                  struct intel_encoder_context *encoder_context));

/* HEVC */
void
intel_hevc_vme_reference_state(VADriverContextP ctx,
                              struct encode_state *encode_state,
                              struct intel_encoder_context *encoder_context,
                              int list_index,
                              int surface_index,
                              void (* vme_source_surface_state)(
                                  VADriverContextP ctx,
                                  int index,
                                  struct object_surface *obj_surface,
                                  struct intel_encoder_context *encoder_context));

void intel_vme_hevc_update_mbmv_cost(VADriverContextP ctx,
                                struct encode_state *encode_state,
                                struct intel_encoder_context *encoder_context);

extern Bool gen8_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);

extern Bool gen9_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);

extern void
intel_h264_initialize_mbmv_cost(VADriverContextP ctx,
                                struct encode_state *encode_state,
                                struct intel_encoder_context *encoder_context);

extern void
intel_h264_setup_cost_surface(VADriverContextP ctx,
                              struct encode_state *encode_state,
                              struct intel_encoder_context *encoder_context,
                              unsigned long binding_table_offset,
                              unsigned long surface_state_offset);

extern void
intel_h264_enc_roi_config(VADriverContextP ctx,
                          struct encode_state *encode_state,
                          struct intel_encoder_context *encoder_context);

#endif /* _GEN6_VME_H_ */


text:
package com.azure.monitor.opentelemetry.exporter.implementation.logging;

import com.azure.monitor.opentelemetry.exporter.implementation.utils.AzureMonitorMsgId;
import org.slf4j.MDC;
import reactor.util.annotation.Nullable;

// operation failure stats for a given 5-min window
// each instance represents a logical grouping of errors that a user cares about and can understand,
// e.g. sending telemetry to the portal, storing telemetry to disk, ...
public class OperationLogger {

    public static final OperationLogger NOOP = new OperationLogger(null);

    @Nullable
    private final AggregatingLogger aggregatingLogger;

    public OperationLogger(Class<?> source, String operation) {
        this(source, operation, 300);
    }

    // visible for testing
    OperationLogger(Class<?> source, String operation, int intervalSeconds) {
        this(new AggregatingLogger(source, operation, true, intervalSeconds));
    }

    private OperationLogger(@Nullable AggregatingLogger aggregatingLogger) {
        this.aggregatingLogger = aggregatingLogger;
    }

    public void recordSuccess() {
        if (aggregatingLogger != null) {
            aggregatingLogger.recordSuccess();
        }
    }

    // failureMessage should have low cardinality
    @SuppressWarnings("try")
    public void recordFailure(String failureMessage, AzureMonitorMsgId msgId) {
        if (aggregatingLogger != null) {
            try (MDC.MDCCloseable ignored = msgId.makeActive()) {
                aggregatingLogger.recordWarning(failureMessage);
            }
        }
    }

    // failureMessage should have low cardinality
    public void recordFailure(String failureMessage) {
        if (aggregatingLogger != null) {
            aggregatingLogger.recordWarning(failureMessage, null);
        }
    }

    public void recordFailure(String failureMessage, Throwable exception) {
        if (aggregatingLogger != null) {
            aggregatingLogger.recordWarning(failureMessage, exception);
        }
    }

    // failureMessage should have low cardinality
    @SuppressWarnings("try")
    public void recordFailure(
        String failureMessage, @Nullable Throwable exception, AzureMonitorMsgId msgId) {
        try (MDC.MDCCloseable ignored = msgId.makeActive()) {
            recordFailure(failureMessage, exception);
        }
    }
}


text:
const builder = require('electron-builder').build
const vars = require('./vars')

const isTag = (process.env.GITHUB_REF || '').startsWith('refs/tags/')

process.env.ARCH = process.env.ARCH || process.arch

if (process.env.GITHUB_HEAD_REF) {
    delete process.env.CSC_LINK
    delete process.env.CSC_KEY_PASSWORD
    process.env.CSC_IDENTITY_AUTO_DISCOVERY = 'false'
}

builder({
    dir: true,
    mac: ['pkg', 'zip'],
    arm64: process.env.ARCH === 'arm64',
    config: {
        extraMetadata: {
            version: vars.version,
        },
        mac: {
            identity: !process.env.CI || process.env.CSC_LINK ? undefined : null,
        },
        npmRebuild: process.env.ARCH !== 'arm64',
    },
    publish: isTag ? 'always' : 'onTag',
}).catch(e => {
    console.error(e)
    process.exit(1)
})


text:
package org.frameworkset.http.converter;

/**
 *
Title: HttpMessageNotReadableException.java

 *
Description:

 *
bboss workgroup

 *
Copyright (c) 2008

 * @Date 2010-11-23
 * @author biaoping.yin
 * @version 1.0
 */
public class HttpMessageNotReadableException  extends HttpMessageConversionException {

	/**
	 * Create a new HttpMessageNotReadableException.
	 *
	 * @param msg the detail message
	 */
	public HttpMessageNotReadableException(String msg) {
		super(msg);
	}

	/**
	 * Create a new HttpMessageNotReadableException.
	 *
	 * @param msg the detail message
	 * @param cause the root cause (if any)
	 */
	public HttpMessageNotReadableException(String msg, Throwable cause) {
		super(msg, cause);
	}

}


text:
class ItemsController < ApplicationController
  before_filter :authenticate_user!
  respond_to :html, :json
  # GET /items
  # GET /items.json
  def index
	@items = Item.all.order("device_name DESC")
	@properties = Property.all
	@departments = Department.where("property_id = ?", Property.first.id)
	if params[:search]
		redirect_to items_results_path
	else
		@search = Item.none
	end
  end

  def update_departments
	  @departments = Department.where("property_id = ?",params[:property_id])
	  respond_to do |format|
	  	format.html #update_departments.html.erb
		format.js
	  end
  end

  def results
	  @search = Item.search(params[:search]).order("device_name DESC")
  end

  # GET /items/1
  # GET /items/1.json
  def show
    @item = Item.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @item }
    end
  end

  # GET /items/new
  # GET /items/new.json
  def new
    @item = Item.new
    @properties = Property.all
    @departments= Department.all
    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @item }
    end
  end

  # GET /items/1/edit
  def edit
    @item = Item.find(params[:id])
    @properties = Property.all
    @departments= Department.all
  end

  # POST /items
  # POST /items.json
  def create
	  @item = Item.new(params[:item])
	  @properties = Property.all
	  @departments= Department.all
	  if Item.exists?(:serial_number=> @item.serial_number) #match on Serial Number
		  respond_to do |format|
			  #Right now these just create notices at the top of the inventory page, would like to make it so it reloads form with other data filled in and failed box highlited. Added to TODO
			  #format.html { redirect_to @item, alert: 'Items could not be created as Serial Number already exists'}
			  flash.now[:alert] = 'Items could not be created as Serial Number already exists!'
			  format.html { render :action => 'new'}

		  end
	  elsif Item.exists?(:device_name=> @item.device_name) #match on Device Name
		  respond_to do |format|
                          #format.html { redirect_to @item, notice: 'Item could not be created as Device Name already exists'}
			   flash.now[:alert] = 'Item could not be created as Device Name already exists!'
                          format.html { render :action => 'new'}
                  end
	  else #If a match on SN or name is not found
	  	  respond_to do |format|
			  if @item.save
				  format.html { redirect_to @item, notice: 'Item was successfully created.' }
				  format.json { render json: @item, status: :created, location: @item }
	  		  else
				  respond_with(@items)
	  		  end
	  	  end #End Respond to
      	  end #End If for SN & Name
  end #end create

  # PUT /items/1
  # PUT /items/1.json
  def update
    @item = Item.find(params[:id])

    respond_to do |format|
      if @item.update_attributes(params[:item])
        format.html { redirect_to @item, notice: 'Item was successfully updated.' }
        format.json { head :no_content }
      else
        respond_with(@items)
      end
    end
  end

  # DELETE /items/1
  # DELETE /items/1.json
  def destroy
    @item = Item.find(params[:id])
    @item.destroy

    respond_to do |format|
      format.html { redirect_to items_url }
      format.json { head :no_content }
    end
  end

  def import
	  Item.import(params[:file])
	  redirect_to items_path, notice: "Items from CSV added successfully"
  end

  def csv
  end
end


text:
{% extends 'base.html' %}
{% import 'wtf.html' as f %}
{% block title %}用户登录{% endblock %}
{% block full_content %}
<form action="/signin" method="POST" id="form-signin">
  <input type="hidden" name="_csrf_token" value="{{ token }}">

用户登录

      {{ f.render_field(form.email, placeholder='Email', type='email') }}
      {{ f.render_field(form.password, placeholder='Password', type='password') }}
      忘记密码

      {% include 'shared/oauth.html' %}
      <input type="submit" class="btn btn-primary" value="登录" />

</form>
{% endblock %}


text:
package org.springframework.cloud.dataflow.module.deployer.cloudfoundry;

import java.util.List;

import org.springframework.web.client.RestClientException;

/**
 * Implementation of high-level operations on applications, limited to those
 * operations required by the {@link ApplicationModuleDeployer}.
 *
 * @author Steve Powell
 * @author Eric Bottard
 */
class CloudFoundryApplicationTemplate implements CloudFoundryApplicationOperations {

	private static final String DEFAULT_BUILDPACK = "https://github.com/cloudfoundry/java-buildpack.git#69abec6d2726f73a22339caa6ae7739f060002e4";

	private static final int DEFAULT_MEMORY = 1024; // megabytes

	private final CloudControllerOperations client;

	private final String spaceId;

	private final String domainId;

	CloudFoundryApplicationTemplate(CloudControllerOperations client, String organizationName, String spaceName, String domain) {
		this.client = client;
		this.spaceId = getSpaceId(organizationName, spaceName);
		this.domainId = getDomainId(domain);
	}

	@Override
	public DeleteApplicationResults deleteApplication(DeleteApplicationParameters parameters) {
		// Check that application actually exists
		ListApplicationsRequest listRequest = new ListApplicationsRequest()
				.withSpaceId(this.spaceId)
				.withName(parameters.getName());

		List<ResourceResponse<ApplicationEntity>> applications = this.client.listApplications(listRequest).getResources();

		if (applications.isEmpty()) {
			return new DeleteApplicationResults().withFound(false);
		}
		String appId = applications.get(0).getMetadata().getId();

		// Delete the associated route
		ListRoutesRequest listRoutesRequest = new ListRoutesRequest()
				.withDomainId(this.domainId)
				.withHost(parameters.getName().replaceAll("[^A-Za-z0-9]", "-"));
		ListRoutesResponse listRoutesResponse = this.client.listRoutes(listRoutesRequest);
		for (ResourceResponse<RouteEntity> resource : listRoutesResponse.getResources()) {
			String routeId = resource.getMetadata().getId();
			this.client.unmapRoute(new RouteMappingRequest()
							.withAppId(appId)
							.withRouteId(routeId)
			);
			this.client.deleteRoute(new DeleteRouteRequest().withId(routeId));
		}

		// Then, unbind any services
		ListServiceBindingsRequest listServiceBindingsRequest = new ListServiceBindingsRequest()
				.withAppId(appId);
		List<ResourceResponse<ServiceBindingEntity>> serviceBindings = this.client.listServiceBindings(listServiceBindingsRequest).getResources();
		for (ResourceResponse<ServiceBindingEntity> serviceBinding : serviceBindings) {
			this.client.removeServiceBinding(new RemoveServiceBindingRequest()
							.withAppId(appId)
							.withBindingId(serviceBinding.getMetadata().getId())
			);
		}

		// Then, perform the actual deletion
		DeleteApplicationRequest deleteRequest = new DeleteApplicationRequest()
				.withId(appId);

		DeleteApplicationResponse response = this.client.deleteApplication(deleteRequest);

		return new DeleteApplicationResults().withFound(true).withDeleted(response.isDeleted());
	}

	@Override
	public GetApplicationsStatusResults getApplicationsStatus(GetApplicationsStatusParameters parameters) {
		ListApplicationsRequest listRequest = new ListApplicationsRequest()
				.withSpaceId(this.spaceId);

		if (parameters.getName() != null) {
			listRequest.withName(parameters.getName());
		}

		List<ResourceResponse<ApplicationEntity>> applications = this.client.listApplications(listRequest).getResources();
		if (applications.isEmpty()) {
			return new GetApplicationsStatusResults();
		}

		GetApplicationsStatusResults response = new GetApplicationsStatusResults();
		for (ResourceResponse<ApplicationEntity> application : applications) {
			String applicationId = application.getMetadata().getId();
			String applicationName = application.getEntity().getName();

			try {
				GetApplicationStatisticsRequest statsRequest = new GetApplicationStatisticsRequest()
						.withId(applicationId);

				GetApplicationStatisticsResponse statsResponse = this.client.getApplicationStatistics(statsRequest);
				response.withApplication(applicationName, new ApplicationStatus()
						.withId(applicationId)
						.withInstances(statsResponse));
			}
			catch (RestClientException rce) {
				// TODO: Log the error?
				response.withApplication(applicationName, new ApplicationStatus());
			}
		}

		return response;
	}

	@Override
	public PushBindAndStartApplicationResults pushBindAndStartApplication(PushBindAndStartApplicationParameters parameters) {
		PushBindAndStartApplicationResults pushResults = new PushBindAndStartApplicationResults();

		// Create app
		CreateApplicationRequest createRequest = new CreateApplicationRequest()
				.withSpaceId(this.spaceId)
				.withName(parameters.getName())
				.withInstances(parameters.getInstances())
				.withBuildpack(DEFAULT_BUILDPACK)
				.withMemory(DEFAULT_MEMORY)
				.withState("STOPPED")
				.withEnvironment(parameters.getEnvironment());

		CreateApplicationResponse createResponse;
		try {
			createResponse = this.client.createApplication(createRequest);
		}
		catch (RestClientException rce) {
			return pushResults.withCreateSucceeded(false);
		}

		// Bind service instances
		String appId = createResponse.getMetadata().getId();
		for (String serviceInstanceName : parameters.getServiceInstanceNames()) {
			ListServiceInstancesRequest listServiceInstancesRequest = new ListServiceInstancesRequest()
					.withName(serviceInstanceName)
					.withSpaceId(this.spaceId);
			List<ResourceResponse<NamedEntity>> listServiceInstances = this.client.listServiceInstances(listServiceInstancesRequest).getResources();
			for (ResourceResponse<NamedEntity> serviceInstanceResource : listServiceInstances) {
				CreateServiceBindingRequest createServiceBindingRequest = new CreateServiceBindingRequest()
						.withAppId(appId)
						.withServiceInstanceId(serviceInstanceResource.getMetadata().getId());
				this.client.createServiceBinding(createServiceBindingRequest);
			}
		}

		// Create and map route
		CreateRouteRequest createRouteRequest = new CreateRouteRequest()
				.withDomainId(this.domainId)
				.withSpaceId(this.spaceId)
				.withHost(parameters.getName().replaceAll("[^A-Za-z0-9]", "-"));
		CreateRouteResponse createRouteResponse = this.client.createRoute(createRouteRequest);

		RouteMappingRequest mapRouteRequest = new RouteMappingRequest()
				.withRouteId(createRouteResponse.getMetadata().getId())
				.withAppId(appId);
		this.client.mapRoute(mapRouteRequest);

		// Upload the bits for the app
		UploadBitsRequest uploadBitsRequest = new UploadBitsRequest()
				.withId(appId)
				.withResource(parameters.getResource());

		UploadBitsResponse uploadBitsResponse = this.client.uploadBits(uploadBitsRequest);

		// Start the app
		UpdateApplicationRequest updateRequest = new UpdateApplicationRequest()
				.withId(appId)
				.withState("STARTED");
		UpdateApplicationResponse updateResponse = this.client.updateApplication(updateRequest);

		return pushResults.withCreateSucceeded(true);
	}

	private String getSpaceId(String organizationName, String spaceName) {
		ListOrganizationsRequest organizationsRequest = new ListOrganizationsRequest()
				.withName(organizationName);

		List<ResourceResponse<NamedEntity>> orgs = this.client.listOrganizations(organizationsRequest).getResources();
		if (orgs.size() != 1) {
			return null;
		}
		String orgId = orgs.get(0).getMetadata().getId();

		ListSpacesRequest spacesRequest = new ListSpacesRequest()
				.withOrgId(orgId)
				.withName(spaceName);

		List<ResourceResponse<NamedEntity>> spaces = this.client.listSpaces(spacesRequest).getResources();
		if (spaces.size() != 1) {
			return null;
		}
		return spaces.get(0).getMetadata().getId();
	}

	private String getDomainId(String domain) {
		ListSharedDomainsRequest sharedDomainsRequest = new ListSharedDomainsRequest()
				.withName(domain);

		ListSharedDomainsResponse listSharedDomainsResponse = this.client.listSharedDomains(sharedDomainsRequest);
		List<ResourceResponse<NamedEntity>> domains = listSharedDomainsResponse.getResources();
		if (domains.size() != 1) {
			return null;
		}
		return domains.get(0).getMetadata().getId();
	}

}


text:
begin
  module Voltos
    class Railtie < Rails::Railtie
      config.before_configuration { load }

      def load
        Voltos.configure
        Voltos.load
      end

      def root
        Rails.root || Pathname.new(ENV["RAILS_ROOT"] || Dir.pwd)
      end

      def self.load
        instance.load
      end
    end
  end
rescue NameError
  # Rails not loaded
end


text:
require 'spec_helper'

describe Optimizer::Function::Unary::ConstantOperand, '#optimizable?' do
  subject { object.optimizable? }

  let(:described_class) { Class.new(Optimizer) { include Optimizer::Function::Unary }  }
  let(:function)        { Class.new(Function) { include Function::Unary }.new(operand) }
  let(:object)          { described_class.new(function)                                }

  before do
    described_class.class_eval { include Optimizer::Function::Unary::ConstantOperand }
  end

  context 'when the operand is a constant' do
    let(:operand) { 1 }

    it { should be(true) }
  end

  context 'when the operand is not a constant' do
    let(:operand) { proc {}  }

    it { should be(false) }
  end
end


text:
import React, { Component } from 'react';
import { FormControl } from 'react-bootstrap';

class Checkbox extends Component {

  render() {
    return (
      <FormControl
        style={{
          float: 'left',
          width: 'auto',
          height: 'auto',
          marginRight: 10
        }}
        { ...this.props}
      />
    );
  }
}

Checkbox.propTypes = {};

export default Checkbox;


text:
export const suits =
    () => [ 'club', 'diamond', 'heart', 'spade' ]

// Create an array of card ranks.
// When is JavaScript going to support array comprehensions? :)
export const ranks =
    () => new Array(13).fill(1).map((_, i) => i + 1)

// Create a new card data structure from a suit name and a rank.
// The value of cards over rank===13 is 10.
export const card =
    (suit, rank) => ({ suit, rank, value: Math.min(10, rank) })

// Create a deck from an array of suit names and an array of ranks.
// A deck is the cross-product of suits x ranks.
export const deck =
    (suits, ranks) =>
        // I'm using reduce in lieu of concatMap. :)
        suits.reduce(
            (cards, suit) => {
                const wholeSuit = ranks.map(cardOfSuit(suit))
                return cards.concat(wholeSuit)
            },
            []
        )

const cardOfSuit =
    suit => rank => card(suit, rank)

// Given a function that produces random integers and a number of times
// to shuffle, create a shuffle function. The shuffle function takes a deck
// and returns a shuffled deck.
// This shuffle algorithm isn't very efficient, but I had fun writing it. :)
// In a real node app, I'd likely use an algorithm that uses localized
// mutation for best performance.
export const shuffler =
    (randomInt, count=100) => deck => {
        const random =
            () => randomInt(1, deck.length - 1)
        const shuffle =
            (deck, i) =>
                i === 0 ? deck : shuffle(cutDeck(deck, random()), i - 1)
        return shuffle(deck, count)
    }

const cutDeck =
    (deck, pos) => deck.slice(pos).concat(deck.slice(0, pos).reverse())

// Given a deck, return a tuple of the first card and the rest of the deck.
export const draw =
    deck => [ deck[0], deck.slice(1) ]

// Given a deck, return a tuple of the first N cards and the rest of the deck.
export const drawN =
    (deck, n=1) => [ deck.slice(0, n), deck.slice(n) ]


text:
<!doctype html>

    <meta charset="utf-8">

<title>Migrating From Iredmail To An Alternative Solution - Technobabble</title>
<meta name="description" content="I decided to look for a replacement to my self-hosted email solution">

<meta property="og:type" content="article">
<meta property="og:locale" content="en">
<meta property="og:site_name" content="Technobabble">
<meta property="og:title" content="Migrating From Iredmail To An Alternative Solution">
<meta property="og:url" content="https://sdunbar.me/guides/migrating-from-iredmail-to-an-alternative-solution/">

  <meta property="og:description" content="I decided to look for a replacement to my self-hosted email solution">

  <meta property="og:image" content="https://sdunbar.me/assets/images/site-logo.jpg">

  <meta name="twitter:site" content="@venomireland">
  <meta name="twitter:title" content="Migrating From Iredmail To An Alternative Solution">
  <meta name="twitter:description" content="I decided to look for a replacement to my self-hosted email solution">
  <meta name="twitter:url" content="https://sdunbar.me/guides/migrating-from-iredmail-to-an-alternative-solution/">

    <meta name="twitter:card" content="summary">

      <meta name="twitter:image" content="https://sdunbar.me/assets/images/site-logo.jpg">

  <meta property="article:published_time" content="2016-10-02T00:00:00+00:00">

<link rel="canonical" href="https://sdunbar.me/guides/migrating-from-iredmail-to-an-alternative-solution/">

<link href="https://sdunbar.me/feed.xml" type="application/atom+xml" rel="alternate" title="Technobabble Feed">

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

<link rel="stylesheet" href="https://sdunbar.me/assets/css/main.css">

        Technobabble

              Curriculum Vitae

              College Work

        <button class="greedy-nav__toggle hidden" type="button">
          Toggle Menu

        </button>

          Migrating From Iredmail To An Alternative Solution

I decided to look for a replacement to my self-hosted email solution

Sean Dunbar

        I am 22 year old male currently working at Google in the Internal Technology Resident Program

    <button class="btn btn--inverse">Follow</button>

           Dublin

            <meta itemprop="email" content="sean@sdunbar.me" />
             Email

             Twitter

             LinkedIn

             GitHub

             Steam

               YouTube

    <meta itemprop="headline" content="Migrating From Iredmail To An Alternative Solution">
    <meta itemprop="description" content="I decided to look for a replacement to my self-hosted email solution">
    <meta itemprop="datePublished" content="October 02, 2016">

Originally, when I registered my own domain, I decided I wanted to use it for a professional looking email to use on my CV and for applying to jobs. When I initially planned this, I had read an Ars Technica article about setting up an email server. With this info, I decided to read more into running your own email server, and came across IRedMail. For almost a year now, iRedMail is what I've been using, but between needing to constantly monitor access logs for numerous services, triple checking security settings every time a change is made, spend an eternity updating everything and dealing with mail delivery issues, I started to get frustrated.

I decided to look for a replacement, either an all in one suite that is regularly updated (and libre if I can get it), or a solution hosted elsewhere that allows me to use my own domain for equal or lesser cost to running the server.

I compared two appropriate solutions for this, Zoho Mail and Zimbra Suite. Zoho Mail is a service that provides email hosting for custom domains, they offer a free tier, limited to 1 domain and 25 users. Zimbra Suite is a locally installed collection of mail software, similar to IRedMail, but with a simpler update procedure and less headaches from maintenance.

In the end, I went with Zoho Mail, the limitations of a single domain and 25 users are perfect for me. Another alternative I was looking at was Zimbra suite, however given the problems I had running IRedMail on its VPS due to lack of memory, I decided against it.

The migration was relatively simple, it involved siging up for Zoho, tweaking my DNS records and then running a script to import my old mail. After that, all I had to do was point my email clients to the new IMAP and SMTP addresses and I was finished.

     Tags:

      Personal

     Categories:

      Guides

 Updated: <time datetime="2016-10-02T00:00:00+00:00">October 02, 2016</time>

Share on

   Twitter

   Facebook

   Google+

   LinkedIn

      Previous

      Next

You May Also Enjoy

        Square Foot Gardening, Week 21

  less than 1 minute read

Twenty-first Week of Square Foot Gardening

        Square Foot Gardening, Week 19

  less than 1 minute read

Nineteenth Week of Square Foot Gardening

        Square Foot Gardening, Week 14

  less than 1 minute read

Fourteenth Week of Square Foot Gardening

        Square Foot Gardening, Week 13

  less than 1 minute read

Thirteenth Week of Square Foot Gardening

Follow:

 Twitter

 GitHub

 Feed

© 2018 Sean Dunbar. Powered by Jekyll & Minimal Mistakes.


text:
package org.defascat.tutorial;

import com.vaadin.data.Item;
import info.magnolia.event.EventBus;
import info.magnolia.jcr.util.PropertyUtil;
import info.magnolia.ui.admincentral.dialog.action.SaveConfigDialogAction;
import info.magnolia.ui.api.app.AppContext;
import info.magnolia.ui.api.app.SubAppEventBus;
import info.magnolia.ui.api.message.Message;
import info.magnolia.ui.api.message.MessageType;
import info.magnolia.ui.form.EditorCallback;
import info.magnolia.ui.form.EditorValidator;
import info.magnolia.ui.vaadin.integration.jcr.JcrItemAdapter;
import javax.inject.Inject;
import javax.inject.Named;
import javax.jcr.Node;
import javax.jcr.RepositoryException;

public class MarkWrongWithDialogSaveAction extends SaveConfigDialogAction {
    @Inject
    public MarkWrongWithDialogSaveAction(MarkWrongWithDialogSaveDefinition definition, final Item item, final EditorValidator validator,
            final EditorCallback callback, final @Named(SubAppEventBus.NAME) EventBus eventBus, final AppContext appContext) {
        super(definition, item, validator, new EditorCallback() {

            @Override
            public void onCancel() {
                if(callback != null) {
                    callback.onCancel();
                }
            }

            @Override
            public void onSuccess(String actionName) {
                try {
                    if(callback != null) {
                        callback.onSuccess(actionName);
                    }

                    final Node node = (Node) ((JcrItemAdapter)item).getJcrItem();

                    Message message = new Message();
                    message.setMessage("Created reason '" + item.getItemProperty("reason").getValue() +
                            "' for node '" + node.getPath() + "'");
                    message.setType(MessageType.WARNING);

                    appContext.sendUserMessage(PropertyUtil.getString(node, "mgnl:createdBy"), message);
                } catch (RepositoryException ex) {
                    throw new RuntimeException(ex);
                }
            }
        }, eventBus);
    }
}


text:
<?php

namespace MediaMonks\SonataMediaBundle\Tests\Functional;

use VCR\VCR;

class YoutubeProviderTest extends AbstractOembedProviderTestAbstract
{
    public function testYoutube()
    {
        $this->providerFlow(
            'youtube',
            'https://www.youtube.com/watch?v=uN2nqdRLhQ8',
            [
                'providerReference' => 'uN2nqdRLhQ8',
                'title' => 'MediaMonks Mixtape Vol  II',
                'description' => '',
                'authorName' => 'MediaMonks',
                'copyright' => '',
                'focalPoint' => '50-50'
            ]
        );

        $crawler = $this->browser->request('GET', '/twig');

        $this->assertEquals(
            2,
            $crawler->filter('img')->count()
        );

        $this->assertEquals(
            2,
            $crawler->filter('iframe')->count()
        );

        $this->assertEquals(
            0,
            $crawler->filter('a')->count()
        );
    }

    public function testUnexistingVideo()
    {
        $provider = 'youtube';
        $providerReference = 'foobar123123123';

        VCR::insertCassette('youtube_unexisting');
        $crawler = $this->browser->request('GET', self::BASE_PATH . 'create?provider=' . $provider);

        $form = $crawler->selectButton('Create')->form();

        $this->assertSonataFormValues(
            $form,
            [
                'provider' => $provider,
            ]
        );

        $this->updateSonataFormValues(
            $form,
            [
                'providerReference' => $providerReference,
            ]
        );

        $this->browser->submit($form);

        $this->assertStringContainsString('does not exist', $this->browser->getResponse()->getContent());

        VCR::eject();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE interactive_environment SYSTEM "../../interactive_environments.dtd">
<interactive_environment name="Paraview">
    <data_sources>
        <data_source>
            <model_class>HistoryDatasetAssociation</model_class>
            <test type="isinstance" test_attr="datatype" result_type="datatype">images.Image</test>
            <test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.STL</test>
			<test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.PlyAscii</test>
            <test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.PlyBinary</test>
            <test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.VtkAscii</test>
            <test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.VtkBinary</test>
            <to_param param_attr="id">dataset_id</to_param>
        </data_source>
    </data_sources>
    <params>
        <param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
    </params>
    <entry_point entry_point_type="mako">paraview.mako</entry_point>
</interactive_environment>


text:
define(['../array/slice'], function (slice) {

    /**
     * Creates a partially applied function.
     */
    function partial(f) {
        var as = slice(arguments, 1);
        return function () {
            var args = as.concat(slice(arguments));
            for (var i = args.length; i--;) {
                if (args[i] === partial._) {
                    args[i] = args.splice(-1)[0];
                }
            }
            return f.apply(this, args);
        };
    }

    partial._ = {};

    return partial;

});


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="org.ado.minesync"
          android:versionCode="23"
          android:versionName="1.2.11"
          android:permission="android.permission.RECEIVE_BOOT_COMPLETED">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.GET_TASKS"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>

    <uses-sdk
        android:minSdkVersion="12"
        android:targetSdkVersion="21"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher_minesync"
        android:label="@string/app_name"
        android:theme="@style/Theme.Minesync"
        android:debuggable="false">

        <activity android:name=".gui.MineSyncMainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".gui.MineSyncConfigActivity">
            <intent-filter>
                <action android:name="org.ado.minesync.MinecraftConfigActivity"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity android:name=".gui.HelpActivity">
            <intent-filter>
                <action android:name="org.ado.minesync.HelpActivity"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity android:name=".gui.FaqActivity">
            <intent-filter>
                <action android:name="org.ado.minesync.HelpActivity"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>
        <activity android:name="com.dropbox.sync.android.DbxAuthActivity"/>
        <activity
            android:name="com.dropbox.client2.android.AuthActivity"
            android:launchMode="singleTask">
            <intent-filter>
                <data android:scheme="db-dwvswhhb0xkmsyl"/>
                <action android:name="android.intent.action.VIEW"/>

                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <service
            android:name="com.dropbox.sync.android.DbxSyncService"
            android:enabled="true"
            android:exported="false"
            android:label="Dropbox Sync"/>
        <service
            android:name=".service.MineSyncService"
            android:enabled="true"/>
        <service
            android:name=".service.UploadDownloadService"
            android:enabled="true"/>

        <receiver
            android:name=".receiver.BootUpReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.ScreenReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.SCREEN_ON"/>
                <action android:name="android.intent.action.SCREEN_OFF"/>
            </intent-filter>
        </receiver>
        <receiver
            android:name=".receiver.MinecraftPeStateReceiver"
            android:enabled="true"
            android:exported="false">
            <intent-filter>
                <action android:name="org.ado.minesync.FOREGROUND_APP"/>
                <action android:name="org.ado.minesync.DROPBOX_ACCOUNT"/>
                <action android:name="org.ado.minesync.UPLOAD_FAILED"/>
                <action android:name="org.ado.minesync.UPLOAD_FINISHED"/>
            </intent-filter>
        </receiver>
    </application>

</manifest>


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<options>

  <!-- The intput directory that contains class source files to be compiled -->
  <!-- Use commma for multiple directories -->
  <source_dirs>classes</source_dirs>

  <!-- Whether to compile subdirs recursively: true(default)|false -->
  <recursive>true</recursive>

  <!-- The output directory that the compiled runtime info is stored -->
  <!-- You need to make it writable to the user who runs your web app -->
  <compiled_dir>compiled</compiled_dir>

  <!-- The file to contain the compiled information: default to compiled.ezpdo -->
  <compiled_file>compiled.ezpdo</compiled_file>

  <!-- The default DSN to the database you want to store your objects -->
  <!-- This will be the default DSN for classes that do not have DSN specified -->
  <default_dsn>sqlite://composite.db</default_dsn>
  <!-- <default_dsn>mysql://ezpdo_ex:pdoiseasy@localhost/ezpdo_ex</default_dsn> -->
  <!-- <default_dsn>sqlite://./composite.db</default_dsn> -->

  <!-- Whether to enable auto-compile: true(default)|false -->
  <!-- Class will be auto-compiled for the first time to be persisted -->
  <auto_compile>true</auto_compile>

  <!-- Whether you want to enable auto-flush: true(default)|false -->
  <!-- All 'dirty' objects are commit beore your script exits-->
  <auto_flush>true</auto_flush>

  <!-- The database abstraction library you want to use: default to adodb-->
  <!-- Currently available options: adodb, peardb -->
  <!--
  <db_lib>peardb</db_lib>
  -->
  <db_lib>adodb</db_lib>

  <!-- Whether to write log on console: true(default)|false -->
  <!-- Note that console log only works on command line)    -->
  <log_console>true</log_console>

  <!-- Log file name (string). If unspecified, no log is generated. -->
  <!-- Note that 'relative' path is relative path to this config file   -->
  <log_file>ezpdo.log</log_file>

</options>


text:
game.SpendExp = me.ScreenObject.extend({
	/**
	 *  action to perform on state change
	 */
	onResetEvent: function() {
		me.game.world.addChild(new me.Sprite(0, 0, me.loader.getImage('exp-screen')), -10);
//                these allow us to press on a key and it react on the page
                me.input.bindKey(me.input.KEY.F1, "F1");
                me.input.bindKey(me.input.KEY.F2, "F2");
                me.input.bindKey(me.input.KEY.F3, "F3");
                me.input.bindKey(me.input.KEY.F4, "F4");
                me.input.bindKey(me.input.KEY.F5, "F5");
                var exp1cost = ((Number(game.data.exp1) + 1) * 10);

                me.game.world.addChild(new (me.Renderable.extend({
                    init: function(){
                        this._super(me.Renderable, 'init', [270, 240, 300, 50]);
                        this.font = new me.Font("Helvetica", 46,  "white");
                    },

                    draw: function(renderer){
                        this.font.draw(renderer.getContext(), "", this.pos.x, this.pos.y);
                    },

                    update: function(dt){
                        return true;
                    },

                    newGame: function(){
                        me.input.releasePointerEvent('pointerdown', this);
                        me.save.remove('exp');
                        me.save.remove('exp1');
                        me.save.remove('exp2');
                        me.save.remove('exp3');
                        me.save.remove('exp4');
                        me.state.change(me.state.PLAY);
                    }
                })));

                    me.game.world.addChild(new (me.Renderable.extend({
                    init: function(){
                        this._super(me.Renderable, 'init', [10, 10, 300, 50]);
                        this.font = new me.Font("Helvetica", 26,  "white");
                    },

                    draw: function(renderer){
//                        this adds text to our screen
                        this.font.draw(renderer.getContext(), "PRESS F1-F4 TO BUY, F5 TO SKIP", this.pos.x, this.pos.y);
                        this.font.draw(renderer.getContext(), "CURRENT EXP: " + game.data.exp.toString(), this.pos.x + 100, this.pos.y + 50);
                        this.font.draw(renderer.getContext(), "F1: INCREASE GOLD PRODUCTION CURRENT LEVEL: " + game.data.exp1.toString() + " COST: " + exp1cost, this.pos.x, this.pos.y + 100);
                        this.font.draw(renderer.getContext(), "F2: ADD STARTING GOLD ", this.pos.x, this.pos.y + 150);
                        this.font.draw(renderer.getContext(), "F3: INCREASE ATTACK DAMAGE ", this.pos.x, this.pos.y + 200);
                        this.font.draw(renderer.getContext(), "F4: INCREASE STARTING HEALTH ", this.pos.x, this.pos.y + 250);
                    }
                })));

                this.handler = me.event.subscribe(me.event.KEYDOWN, function (action, keyCode, edge){
                    if(action === "F1"){
                        if(game.data.exp >= exp1cost){
                            game.data.exp1 += 1;
                            game.data.exp -= exp1cost;
                            me.state.change(me.state.PLAY);
                        }else{
                            console.log("not enough experience");
                        }
                    }else if(action === "F2"){

                    }else if(action === "F3"){

                    }else if(action === "F4"){

                    }else if(action === "F5"){
                        me.state.change(me.state.PLAY);
                    }
                });
	},

	/**
	 *  action to perform when leaving this screen (state change)
	 */
	onDestroyEvent: function() {
//            this makes it so once we're away from that screen the keys dont work for the same thing
            me.input.unbindKey(me.input.KEY.F1, "F1");
            me.input.unbindKey(me.input.KEY.F2, "F2");
            me.input.unbindKey(me.input.KEY.F3, "F3");
            me.input.unbindKey(me.input.KEY.F4, "F4");
            me.input.unbindKey(me.input.KEY.F5, "F5");
            me.event.unsubscribe(this.handler);
	}
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>locality</type>
  <type>political</type>
  <formatted_address>4890 Weißenkirchen im Attergau, Austria</formatted_address>
  <address_component>
   <long_name>Weißenkirchen im Attergau</long_name>
   <short_name>Weißenkirchen im Attergau</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Gemeinde Weißenkirchen im Attergau</long_name>
   <short_name>Gemeinde Weißenkirchen im Attergau</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Vöcklabruck District</long_name>
   <short_name>Vöcklabruck District</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Upper Austria</long_name>
   <short_name>Upper Austria</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Austria</long_name>
   <short_name>AT</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>4890</long_name>
   <short_name>4890</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>47.9499124</lat>
    <lng>13.4179157</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>47.9424385</lat>
     <lng>13.4019083</lng>
    </southwest>
    <northeast>
     <lat>47.9573853</lat>
     <lng>13.4339231</lng>
    </northeast>
   </viewport>
  </geometry>
  <place_id>ChIJx1aILZUddEcRRJVeq5YHAwY</place_id>
 </result>
</GeocodeResponse>


text:
class LedDisplay {
  private:
    LedControl* led;
    int currentPosition;
  public:
    LedDisplay(int din, int clk, int cs, int num);
    void setup();
    void update();
};

#endif


text:
// Type definitions for node-apple-receipt-verify 1.7
// Project: https://github.com/ladeiko/node-apple-receipt-verify
// Definitions by: serinuntius <https://github.com/serinuntius>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export enum ERROR_CODES {
    /** The receipt validated successfully. */
    SUCCESS = 0,

    /** The receipt is valid, but purchased nothing. */
    VALID_BUT_EMPTY = 2,

    /** The App Store could not read the JSON object you provided. */
    INVALID_JSON = 21000,

    /** The data in the receipt-data property was malformed or missing. */
    INVALID_RECEIPT_DATA = 21002,

    /** The receipt could not be authenticated. */
    COULD_NOT_AUTHENTICATE = 21003,

    /** The shared secret you provided does not match the shared secret on file for your account. */
    INVALID_SECRET = 21004,

    /** The receipt server is not currently available. */
    UNAVAILABLE = 21005,

    /**
     * This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.
     * Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.
     */
    EXPIRED_SUBSCRIPTION = 21006,

    /** This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead. */
    TEST_RECEIPT = 21007,

    /** This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead. */
    PROD_RECEIPT = 21008,

    /** This receipt could not be authorized. Treat this the same as if a purchase was never made. */
    COULD_NOT_AUTHORIZE = 21010
}

export interface ConfigOptions {
    secret: string;
    verbose?: boolean | undefined;
    environment?: string[] | undefined;
    ignoreExpiredError?: boolean | undefined;
    ignoreExpired?: boolean | undefined;
    extended?: boolean | undefined;
    excludeOldTransactions?: boolean | undefined;
}

export function config(options: ConfigOptions): ConfigOptions;

export interface ValidateOptions {
    receipt: string;
    device?: string | undefined;
}

export interface PurchasedProducts {
    bundleId: string;
    transactionId: string;
    productId: string;
    purchaseDate: number;
    quantity: number;
    expirationDate?: number | undefined;
    isTrialPeriod?: boolean | undefined; // only for subscriptions and if extended = true
    isInIntroOfferPeriod?: boolean | undefined; // only for subscriptions and if extended = true; since v1.5.1
    environment?: string | undefined; // only if extended = true
    originalPurchaseDate?: number | undefined; // only if extended = true
    applicationVersion?: string | undefined; // only if extended = true
    originalApplicationVersion?: string | undefined; // only if extended = true
}

export interface ValidationError extends Error {
    isRetryable: boolean;
    appleStatus: number;
}

export function EmptyError(): void;

export function ServiceUnavailableError(): void;

export function validate(
    options: ValidateOptions,
    callback: (error: ValidationError, purchasedProducts: PurchasedProducts[]) => void,
): void;
export function validate(options: ValidateOptions): Promise<PurchasedProducts[]>;

export function resetConfig(): void;

export function extract(options: {}): Promise<Array<{}>>;


text:
package com.uics.asset.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.dubbo.x.entity.IdEntity;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import java.util.Date;

/**
 * 属性信息
 * <p>
* Created by tom on 2016-12-28 10:59:49.
 */
@Entity
@Table(name = "t_attribute")
@ApiModel("属性信息")
public class Attribute extends IdEntity {

    /**
     * 继承id
     */
    @ApiModelProperty(value = "继承id", required = false)

    @Column(columnDefinition = "继承id")
    private String derivedFromId;
    public String getDerivedFromId() {
        return derivedFromId;
    }
    public void setDerivedFromId(String derivedFromId) {
        this.derivedFromId = derivedFromId;
    }

    /**
     * 显示名称
     */
    @ApiModelProperty(value = "显示名称", required = false)

    @Column(columnDefinition = "显示名称")
    private String displayName;
    public String getDisplayName() {
        return displayName;
    }
    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    /**
     * 别名
     */
    @ApiModelProperty(value = "别名", required = false)

    @Column(columnDefinition = "别名")
    private String alias;
    public String getAlias() {
        return alias;
    }
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * 复合
     */
    @ApiModelProperty(value = "复合", required = false)

    @Column(columnDefinition = "复合")
    private Boolean complexValue;
    public Boolean getComplexValue() {
        return complexValue;
    }
    public void setComplexValue(Boolean complexValue) {
        this.complexValue = complexValue;
    }

    /**
     * 大纲
     */
    @ApiModelProperty(value = "大纲", required = false)

    @Column(columnDefinition = "大纲")
    private Boolean isBlueprint;
    public Boolean getIsBlueprint() {
        return isBlueprint;
    }
    public void setIsBlueprint(Boolean isBlueprint) {
        this.isBlueprint = isBlueprint;
    }

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", required = false)

    @Column(columnDefinition = "描述")
    private String description;
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * 类型名
     */
    @ApiModelProperty(value = "类型名", required = false)

    @Column(columnDefinition = "类型名")
    private String typeName;
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    /**
     * 引用类型
     */
    @ApiModelProperty(value = "引用类型", required = false)

    @Column(columnDefinition = "引用类型")
    private String reftypename;
    public String getReftypename() {
        return reftypename;
    }
    public void setReftypename(String reftypename) {
        this.reftypename = reftypename;
    }

    /**
     * 字符串值
     */
    @ApiModelProperty(value = "字符串值", required = false)

    @Column(columnDefinition = "字符串值")
    private String valueAsString;
    public String getValueAsString() {
        return valueAsString;
    }
    public void setValueAsString(String valueAsString) {
        this.valueAsString = valueAsString;
    }

    /**
     * 长整型值
     */
    @ApiModelProperty(value = "长整型值", required = false)
    @Column(columnDefinition = "长整型值")
    private Long valueAsLong;
    public Long getValueAsLong() {
        return valueAsLong;
    }
    public void setValueAsLong(Long valueAsLong) {
        this.valueAsLong = valueAsLong;
    }

    /**
     * 日期类型值
     */
    @ApiModelProperty(value = "日期类型值", required = false)

    @Column(columnDefinition = "日期类型值")
    private String valueAsDate;
    public String getValueAsDate() {
        return valueAsDate;
    }
    public void setValueAsDate(String valueAsDate) {
        this.valueAsDate = valueAsDate;
    }

//    /**
//     * 所有者id
//     */
//    @ApiModelProperty(value = "所有者id", required = false)
//
//    @Column(columnDefinition = "所有者id")
//    private Integer ownerId;
//    public Integer getOwnerId() {
//        return ownerId;
//    }
//    public void setOwnerId(Integer ownerId) {
//        this.ownerId = ownerId;
//    }

    /**
     * 最长
     */
    @ApiModelProperty(value = "最长", required = false)

    @Column(columnDefinition = "最长")
    private Integer maxOccurs;
    public Integer getMaxOccurs() {
        return maxOccurs;
    }
    public void setMaxOccurs(Integer maxOccurs) {
        this.maxOccurs = maxOccurs;
    }

    /**
     * 最小
     */
    @ApiModelProperty(value = "最小", required = false)

    @Column(columnDefinition = "最小")
    private Integer minOccurs;
    public Integer getMinOccurs() {
        return minOccurs;
    }
    public void setMinOccurs(Integer minOccurs) {
        this.minOccurs = minOccurs;
    }

    /**
     * 最后修改时间
     */
    @ApiModelProperty(value = "最后修改时间", required = false)

    @Column(columnDefinition = "最后修改时间")
    private String lastModified;
    public String getLastModified() {
        return lastModified;
    }
    public void setLastModified(String lastModified) {
        this.lastModified = lastModified;
    }

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)

    @Column(columnDefinition = "创建时间")
    private String createTime;
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}


text:
django.jQuery(function($) {
	'use strict';

	// create class handling the client-side part of ButtonPlugin
	var $glossary_icon_align = $('#id_glossary_icon_align').find('input[name="icon_align"]'),
	    $glossary_icon_font = $('.glossary_icon_font').parent('.glossary-widget'),
	    $glossary_symbol = $('.glossary_symbol').parent('.glossary-widget');

	django.cascade.ButtonMixin = ring.create(eval(django.cascade.ring_plugin_bases.ButtonMixin), {
		constructor: function() {
			var self = this;
			this.$super();
			if (django.cascade.hasOwnProperty('IconPluginMixin')) {
				$glossary_icon_align.change(function(evt) {
					self.toggleAlignIcon(evt.target.value);
				});
			} else {
				$glossary_icon_align.prop('disabled', true);
			}
			this.refreshChangeForm();
		},
		toggleAlignIcon: function(iconAlign) {
			if (iconAlign === '') {
				$glossary_icon_font.hide();
				$glossary_symbol.hide();
			} else {
				$glossary_icon_font.show();
				$glossary_symbol.show();
			}
		},
		refreshChangeForm: function() {
			var value;
			$.each($glossary_icon_align, function(index, field) {
				if (field.checked) {
					value = field.value;
					return;
				}
			});
			this.toggleAlignIcon(value);
			this.$super && this.$super();
		}
	});
});


text:
/**
 * Created by lenovo on 2017/6/12.
 */
$(document).ready(function(){

    $("[data-toggle='tooltip']").tooltip();

})


text:
/**
 * Module dependencies
 */

var _ = require('lodash');
var configure = require('./configure');
var defaults = require('./defaults');
var onRoute = require('./onRoute');
var addLayoutShim = require('./layoutshim');
var addResViewMethod = require('./res.view');
var render = require('./render');
var implicitActions = require('./actions');

module.exports = function (sails) {

  /**
   * `views` hook
   */
  return {

    defaults: defaults,

    configure: _.partial(configure, sails),

    render: render,

    /**
     * Standard responsibilities of `initialize` are to load middleware methods
     * and listen for events to know when to bind any special routes.
     *
     * @api private
     */
    initialize: function (cb) {

      if (!sails.hooks.http) {
        var err = new Error('`views` hook requires the `http` hook, but the `http` hook is disabled.  Please enable both or neither.');
        err.message = '`views` hook requires the `http` hook, but the `http` hook is disabled.  Please enable both or neither.';
        err.type = err.code = 'E_HOOKINIT_DEP';
        err.name = 'failed requires `http` hook';
        err.status = 400;
        return cb(err);
      }

      // Before handing off incoming requests, bind handler that adds the `res.view()` method to `res`.
      // (flagging middleware along the way)
      addResViewMethod._middlewareType = 'VIEWS HOOK: addResViewMethod';
      sails.on('router:before', function () {

        // But wait until after internationalization has happened
        // (if applicable)
        if (sails.hooks.i18n) {
          sails.after('hook:i18n:loaded', function () {
            sails.router.bind('/*', addResViewMethod, 'all', { });
          });
        }
        else {
          sails.router.bind('/*', addResViewMethod, 'all');
        }
      });

      // Register `{view:'/foo'}` route target syntax.
      sails.on('route:typeUnknown', _.partial(onRoute, sails));

      // Declare hook loaded when ejs layouts have been applied,
      // views have been inventoried, and view-serving middleware has been prepared
      addLayoutShim(sails);

      // Detect and prepare implicit actions
      // for each view file so they can be routed to
      // using {view:'...'} syntax in `routes.js`
      implicitActions(sails, this);

      // Expose `sails.renderView()` function to userland.
      sails.renderView = this.render;

      return cb();
    }
  };
};


text:
#import <Foundation/Foundation.h>

// MSVGStyleSheet represents a set of CSS rules.
@interface MSVGStyleSheet : NSObject

// Initializes the receiver with UTF-8-encoded CSS data.
- (instancetype)initWithData:(NSData *)data;

@end


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

namespace ExcelLibrary.BinaryDrawingFormat
{
	public partial class MsofbtColorMRU : EscherRecord
	{
		public MsofbtColorMRU(EscherRecord record) : base(record) { }

		public MsofbtColorMRU()
		{
			this.Type = EscherRecordType.MsofbtColorMRU;
		}

	}
}


text:
package com.microsoft.azure.management.network.v2019_09_01.implementation;

import com.microsoft.azure.management.network.v2019_09_01.RetentionPolicyParameters;
import com.microsoft.azure.management.network.v2019_09_01.FlowLogFormatParameters;
import com.microsoft.azure.management.network.v2019_09_01.TrafficAnalyticsProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;

/**
 * Information on the configuration of flow log and traffic analytics
 * (optional) .
 */
@JsonFlatten
public class FlowLogInformationInner {
    /**
     * The ID of the resource to configure for flow log and traffic analytics
     * (optional) .
     */
    @JsonProperty(value = "targetResourceId", required = true)
    private String targetResourceId;

    /**
     * ID of the storage account which is used to store the flow log.
     */
    @JsonProperty(value = "properties.storageId", required = true)
    private String storageId;

    /**
     * Flag to enable/disable flow logging.
     */
    @JsonProperty(value = "properties.enabled", required = true)
    private boolean enabled;

    /**
     * Parameters that define the retention policy for flow log.
     */
    @JsonProperty(value = "properties.retentionPolicy")
    private RetentionPolicyParameters retentionPolicy;

    /**
     * Parameters that define the flow log format.
     */
    @JsonProperty(value = "properties.format")
    private FlowLogFormatParameters format;

    /**
     * Parameters that define the configuration of traffic analytics.
     */
    @JsonProperty(value = "flowAnalyticsConfiguration")
    private TrafficAnalyticsProperties flowAnalyticsConfiguration;

    /**
     * Get the ID of the resource to configure for flow log and traffic analytics (optional) .
     *
     * @return the targetResourceId value
     */
    public String targetResourceId() {
        return this.targetResourceId;
    }

    /**
     * Set the ID of the resource to configure for flow log and traffic analytics (optional) .
     *
     * @param targetResourceId the targetResourceId value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withTargetResourceId(String targetResourceId) {
        this.targetResourceId = targetResourceId;
        return this;
    }

    /**
     * Get iD of the storage account which is used to store the flow log.
     *
     * @return the storageId value
     */
    public String storageId() {
        return this.storageId;
    }

    /**
     * Set iD of the storage account which is used to store the flow log.
     *
     * @param storageId the storageId value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withStorageId(String storageId) {
        this.storageId = storageId;
        return this;
    }

    /**
     * Get flag to enable/disable flow logging.
     *
     * @return the enabled value
     */
    public boolean enabled() {
        return this.enabled;
    }

    /**
     * Set flag to enable/disable flow logging.
     *
     * @param enabled the enabled value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withEnabled(boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    /**
     * Get parameters that define the retention policy for flow log.
     *
     * @return the retentionPolicy value
     */
    public RetentionPolicyParameters retentionPolicy() {
        return this.retentionPolicy;
    }

    /**
     * Set parameters that define the retention policy for flow log.
     *
     * @param retentionPolicy the retentionPolicy value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withRetentionPolicy(RetentionPolicyParameters retentionPolicy) {
        this.retentionPolicy = retentionPolicy;
        return this;
    }

    /**
     * Get parameters that define the flow log format.
     *
     * @return the format value
     */
    public FlowLogFormatParameters format() {
        return this.format;
    }

    /**
     * Set parameters that define the flow log format.
     *
     * @param format the format value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withFormat(FlowLogFormatParameters format) {
        this.format = format;
        return this;
    }

    /**
     * Get parameters that define the configuration of traffic analytics.
     *
     * @return the flowAnalyticsConfiguration value
     */
    public TrafficAnalyticsProperties flowAnalyticsConfiguration() {
        return this.flowAnalyticsConfiguration;
    }

    /**
     * Set parameters that define the configuration of traffic analytics.
     *
     * @param flowAnalyticsConfiguration the flowAnalyticsConfiguration value to set
     * @return the FlowLogInformationInner object itself.
     */
    public FlowLogInformationInner withFlowAnalyticsConfiguration(TrafficAnalyticsProperties flowAnalyticsConfiguration) {
        this.flowAnalyticsConfiguration = flowAnalyticsConfiguration;
        return this;
    }

}