text:
package mods.battlegear2.api.shield;

import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
 * Defines an item that can catch IProjectile
 * Used by ItemShield to block arrows
 * @author GotoLink
 *
 */
public interface IArrowCatcher {
    /**
     *
     * @param shield the {@link ItemStack} corresponding to the shield in use
     * @param player the {@link EntityPlayer} holding the shield
     * @param projectile heading towards the shield
     * @return true if the projectile has been caught
     */
	public boolean catchArrow(ItemStack shield, EntityPlayer player, IProjectile projectile);
}

redpajama_set_name: RedPajamaGithub


text:
/**
* 跨域请求,处理res头部
*/
'use strict';

module.exports = function(req, res, next){
	// 跨域情况才处理匹配请求res
	if(req.headers['origin']){
		res.setHeader('Access-Control-Allow-Origin', req.headers['origin']);
		res.setHeader('Access-Control-Allow-Credentials', true);
		if(req.method.toUpperCase() === 'OPTIONS') {
			res.setHeader('Access-Control-Allow-Headers', req.headers['Access-Control-Request-Headers'.toLowerCase()]);
			res.setHeader('Access-Control-Allow-Methods', req.method);
			res.setHeader('Access-Control-Max-Age', 86400); // 24H
			res.end();
			return;
		}
	}
	next();
};


text: SUSI Client in PHP


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".startup" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="70dp"
        android:text="Welcome"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>


text:
package wasdev.sample.servlet;

import com.google.gson.*;

/**
 * Created by marksalako on 24/02/2017.
 */
public class Main {

    public static void main(String[] args) {
        AnalyzeImage image = new AnalyzeImage();
        String s = image.analyze("/Users/marksalako/Documents/OCR Proj/OCR+Proj/OCR-Proj/src/main/webapp/images/someChinese.jpg");

        //System.out.println("ressult: " +s);

        JsonObject jsonObject = new JsonParser().parse(s).getAsJsonObject();
        JsonArray words_result = jsonObject.getAsJsonArray("words_result");
        for (JsonElement jsonElement : words_result) {
            JsonObject word2 = jsonElement.getAsJsonObject();
            JsonPrimitive words =(JsonPrimitive) word2.get("words");
            String s4 = words.getAsString();
            System.out.println(s4);
        }

    }
}


text:
$(document).ready(function() {
	//change CAPTCHA on each click or on refreshing page
	$("#reload").click(function() {
		$("img#img").remove();
		var id = Math.random();
		$('<img id="img" src="captcha/captcha.php?id='+id+'"/>').appendTo("#imgdiv");
		id ='';
	});

	$('#button').click(function() {
		var frmvalidator  = new Validator("askforademo");
		frmvalidator.addValidation("name","req","Please provide your Name");
		//frmvalidator.addValidation("ph","req","Please provide your Contact No");
		frmvalidator.addValidation("email","req","Please provide your E-Mail ID");
		frmvalidator.addValidation("email","email","Please enter a valid email address");
		//frmvalidator.addValidation("institute","req","Please enter your Institute Name");
		//frmvalidator.addValidation("institute_type","dontselect=000","Please select your Institute Type");
		frmvalidator.addValidation("captcha","req","Enter Image text")

		//validating CAPTCHA with user input text
		var captcha 		= $("#captcha1").val();
		var name 			= $('#name').val();
		var ph 				= $('#ph').val();
		var email 			= $('#email').val();
		var institute 		= $('#institute').val();
		var weburl 			= $('#weburl').val();
		var institute_type	= $('#institute_type').val();

		var dataString = 'captcha='+captcha + '&name='+name + '&ph='+ph + '&email='+email + '&institute='+institute + '&weburl='+weburl + '&institute_type='+institute_type;

		if(captcha != ''){
			$.ajax({
				type: "POST",
				url: "captcha/verify.php",
				data: dataString,
				success: function(html) {
					alert(html);
				}
			});
		}

	});
});


text:
namespace TeleimotBg.Web.Api.Infrastructure.Mappings
{
    using AutoMapper;

    public interface IHaveCustomMappings
    {
        void CreateMappings(IConfiguration configuration);
    }
}


text:
local t = LoadActor("AnyRightFist tap Note") .. {
	InitCommand=cmd(basezoomx,-1);
}

return t;


text:
<?php
namespace App\Repositories;

use App\Models\NL_social_user;
use App\User;

class UserRepository implements UserRepositoryInterface {

  protected $social_user;
  protected $user;

  public function __construct(){
      $this->social_user = new NL_social_user();
      $this->user = new User();
  }

  public function getAllUser(){
    return $this->user->get();
  }

  public function getUserByGoogleID($id){
    $socialUser = $this->social_user
      ->where('social_token_id',$id)
      ->where('provider','google')
      ->get()->first();

    return $this->user->where('id',$socialUser['user_id'])->get()->first();
  }

  public function getUserByFacebookID($id){
    $socialUser = $this->social_user
      ->where('social_token_id',$id)
      ->where('provider','facebook')
      ->get()->first();

    return $this->user->where('id',$socialUser['user_id'])->get()->first();
  }

  public function getUserFromEmail($email){
    return $this->user->where('email',$email)->get()->first();
  }

  public function createSocialUser($userId,$socialUserId,$provider){

    $id = $this->social_user->insertGetId([
      'user_id' => $userId,
      'social_token_id' => $socialUserId,
      'provider' => $provider,
    ]);

    return $id;

  }

}


text:
import csv
from cStringIO import StringIO
import Bio.Phylo as Phylo

def get_tree_string(tree_txt):
    """
    Parses the trees.txt file autogenerated by indelible.
    ASSUMES:
    - File starts with comments
    - Header: FILE	TREE	NTAXA	REP	PART	LENGTH	DEPTH	MAX PAIRWISE DISTANCE	TREE STRING
    - Contents follow:

    small_population.50.0	bigtree	100	1	1	50	1.1657	2.25102	((((((otu1:0.688568,....)ROOT;

    :param str tree_txt: full filepath of trees.txt file
    :return str:  tree string
    """
    with open(tree_txt, 'rU') as fh_in:
        # Skip the comments
        TOTAL_COMMENTS_LINES = 6
        for i in range(0, TOTAL_COMMENTS_LINES):
            fh_in.next()
        reader = csv.DictReader(fh_in, delimiter="\t")
        for row in reader:
            if not row["FILE"]:
                continue
            return row["TREE STRING"]

    return None

def get_tree_stringio(tree_txt):
    """
    Parses the trees.txt file autogenerated by indelible.
    ASSUMES:
    - File starts with comments
    - Header: FILE	TREE	NTAXA	REP	PART	LENGTH	DEPTH	MAX PAIRWISE DISTANCE	TREE STRING
    - Contents follow:

    small_population.50.0	bigtree	100	1	1	50	1.1657	2.25102	((((((otu1:0.688568,....)ROOT;

    :param str tree_txt: full filepath of trees.txt file
    :return StringIO:  tree string as StringIO handle
    """
    with open(tree_txt, 'rU') as fh_in:
        # Skip the comments
        TOTAL_COMMENTS_LINES = 6
        for i in range(0, TOTAL_COMMENTS_LINES):
            fh_in.next()
        reader = csv.DictReader(fh_in, delimiter="\t")
        for row in reader:
            if not row["FILE"]:
                continue
            return StringIO(row["TREE STRING"])

    return None

def write_tree(tree_txt, tree_newick):
    """
    Parses the trees.txt file autogenerated by indelible.  Writes out tree to a newick file.
    ASSUMES:
    - File starts with comments
    - Header: FILE	TREE	NTAXA	REP	PART	LENGTH	DEPTH	MAX PAIRWISE DISTANCE	TREE STRING
    - Contents follow:

    small_population.50.0	bigtree	100	1	1	50	1.1657	2.25102	((((((otu1:0.688568,....)ROOT;

    :param str tree_txt: full filepath of trees.txt file
    :param str tree_newick:  full filepath of newick file to write out.
    """
    with open(tree_txt, 'rU') as fh_in, open(tree_newick, 'w') as fh_out:
        # Skip the comments
        TOTAL_COMMENTS_LINES = 6
        for i in range(0, TOTAL_COMMENTS_LINES):
            fh_in.next()
        reader = csv.DictReader(fh_in, delimiter="\t")
        for row in reader:
            if not row["FILE"]:
                continue
            tree_str = row["TREE STRING"]
            fh_out.write(tree_str)
            break


text:
/**
 *  File Name:    eval-003.js
 *  Description:  (SEE REVISED DESCRIPTION FURTHER BELOW)
 *
 *  The global eval function may not be accessed indirectly and then called.
 *  This feature will continue to work in JavaScript 1.3 but will result in an
 *  error in JavaScript 1.4. This restriction is also in place for the With and
 *  Closure constructors.
 *
 *  http://scopus.mcom.com/bugsplat/show_bug.cgi?id=324451
 *
 *  Author:          christine@netscape.com
 *  Date:               11 August 1998
 *
 *
 *  REVISION:    05  February 2001
 *  Author:          pschwartau@netscape.com
 *
 *  Indirect eval IS NOT ILLEGAL per ECMA3!!!  See
 *
 *  http://bugzilla.mozilla.org/show_bug.cgi?id=38512
 *
 *  ------- Additional Comments From Brendan Eich 2001-01-30 17:12 -------
 * ECMA-262 Edition 3 doesn't require implementations to throw EvalError,
 * see the short, section-less Chapter 16.  It does say an implementation that
 * doesn't throw EvalError must allow assignment to eval and indirect calls
 * of the evalnative method.
 *
 */
    var SECTION = "eval-003.js";
    var VERSION = "JS1_4";
    var TITLE   = "Calling eval indirectly should NOT fail in version 140";
    var BUGNUMBER="38512";

    startTest();
    writeHeaderToLog( SECTION + " "+ TITLE);

    var testcases = new Array();

    var MY_EVAL = eval;
    var RESULT = "";
    var EXPECT= "";
    var h = function f(x,y){var g = function(z){return Math.exp(z);}; return g(x+y);};

    new EvalTest();

    test();

function EvalTest()
{
  with( this )
  {
      MY_EVAL( "RESULT = h(-1, 1)" );
      EXPECT = 1;  //The base e to the power (-1 + 1),  i.e. the power 0,  equals 1 ....

      testcases[tc++] = new TestCase(
          SECTION,
          "Call eval indirectly",
          EXPECT,
          RESULT );
  }
}


text: A Custom Wedding Site for Melanie and I


text:
const envPaths = require('env-paths');
const os = require('os');
const path = require('path');

const dartPaths = envPaths('DART', { suffix: ''});
const homedir = os.homedir();

/**
 * defaultConfig contains config settings for running the electron app
 * and command-line apps as a user. These are the settings you'll want
 * to use in all cases except unit tests.
 *
 * @property {string} homedir - Path to the current user's home directory.
 * @property {string} datadir - Path to directory where the current application stores its data.
 * @property {string} logdir  - Path to directory where the current application stores its logs.
 * @property {string} tempdir - Path to directory where the current application stores temp files.
 *
 * @memberof Config
 * @static
 */
const userConfig = {
    homeDir: homedir,
    dataDir: dartPaths.data,
    logDir: dartPaths.log,
    tempDir: dartPaths.temp
};

/**
 * testConfig contains config settings for running automated tests.
 *
 * @property {string} homedir - Path to the current user's home directory.
 * @property {string} datadir - Path to directory where the current application stores its data.
 * @property {string} logdir  - Path to directory where the current application stores its logs.
 * @property {string} tempdir - Path to directory where the current application stores temp files.
 *
 * @memberof Config
 * @static
 */
const testConfig = {
    homeDir: homedir,
    dataDir: path.join(homedir, '.dart-test', 'data'),
    logDir: path.join(homedir, '.dart-test', 'log'),
    tempDir: path.join(homedir, '.dart-test', 'tmp')
};

/**
 * Config contains config settings for user and test environments.
 * The GlobalContext object determines which configuration to use at
 * runtime. It will always select the 'user' config, except when
 * process.env.NODE_ENV=test.
 *
 */
const Config = {
    'user': userConfig,
    'test': testConfig
};

module.exports.Config = Config;


text:
class RailsInfo::StackTracePresenter < ::RailsInfo::Presenter
  def initialize(subject, options = {})
    super(subject, options)

    options[:stack_trace] ||= {}

    @stack_trace = ::RailsInfo::StackTrace.new(
      options[:stack_trace][:body], rails_root: options[:stack_trace][:rails_root],
      request: options[:stack_trace][:request], exception: options[:stack_trace][:exception],
      show_all: options[:stack_trace][:show_all], lines_of_code_around: options[:stack_trace][:lines_of_code_around]
    )
  end

  def header
    html = ''

    if @stack_trace.exception
      html += content_tag(:h1, h(@stack_trace.title))
      html += content_tag(:pre, @stack_trace.message, class: 'stack_trace_message')
    end

    html += content_tag(:p, content_tag(:code, "Rails.root: #{rails_root}"))

    html
  end

  # Parameters
  #
  # type: full or application
  def accordion(type = 'full')
    content_tag :div, class: 'accordions' do
      html = ''

      hash = if type == 'application'
        if @stack_trace.hash.keys.first.match(' of ')
          @stack_trace.hash.select{|f,c| f.match("of #{rails_root}")}
        else
          @stack_trace.hash.select{|f,c| f.match(rails_root)}
        end
      else
        @stack_trace.hash
      end

      hash.each do |file, code|
        file_without_rails_root = file.dup

        if file_without_rails_root.match(rails_root)
          file_without_rails_root.gsub!(rails_root, '')
        end

        highligted_line_number = code[:highlighted_line_numbers].is_a?(Array) ? code[:highlighted_line_numbers].first : code[:highlighted_line_numbers]
        link_to_line_number = link_to file_without_rails_root, "##{file_without_rails_root.parameterize}"
        html += content_tag :h3, raw("        #{file_without_rails_root}")
        code_presenter = ::RailsInfo::CodePresenter.new(@subject, code.merge(highlighted_number_name: file_without_rails_root))

        height = (((@stack_trace.lines_of_code_around * 2) + 1) * 18).round

        html += content_tag :div, raw(code_presenter.table), style: "max-height:#{height}px; overflow: auto"
      end

      raw html
    end
  end

  def request_tab
    clean_params = request.filtered_parameters.clone
    clean_params.delete("action")
    clean_params.delete("controller")

    request_dump = clean_params.empty? ? 'None' : clean_params.inspect.gsub(',', ",\n")

    html = content_tag(:p) do
      content_tag(:strong, 'Parameters:') + content_tag(:pre, h(request_dump))
    end

    [:session, :env].each do |method|
      html += content_tag(:p) do
        link_to "Show #{method} dump", '#', onclick: "document.getElementById('#{method}_dump').style.display='block'; return false;"
      end

      html += content_tag(:div, id: "#{method}_dump", style: 'display:none') do
        content = method == :env ? request.env.slice(*request.class::ENV_METHODS) : request.send(method)
        content_tag :pre, debug_hash(content)
      end
    end

    html
  end

  def response_tab
    content_tag :p do
      content_tag(:strong, 'Headers:') + content_tag(:pre, h(defined?(@response) ? response.headers.inspect.gsub(',', ",\n") : 'None'))
    end
  end

  private

  def rails_root
    if @stack_trace.rails_root
      @stack_trace.rails_root
    elsif defined?(Rails) && Rails.respond_to?(:root)
      Rails.root.to_s
    else
      'unset'
    end
  end

  def debug_hash(hash)
    hash.sort_by { |k, v| k.to_s }.map { |k, v| "#{k}: #{v.inspect rescue $!.message}" }.join("\n")
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
	<!--
		Copyright (C) 2007-2008 JVending Masa Licensed under the Apache
		License, Version 2.0 (the "License"); you may not use this file except
		in compliance with the License. You may obtain a copy of the License
		at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
		applicable law or agreed to in writing, software distributed under the
		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
		CONDITIONS OF ANY KIND, either express or implied. See the License for
		the specific language governing permissions and limitations under the
		License.
	-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<parent>
		<groupId>org.jvending.masa</groupId>
		<artifactId>masa-parent</artifactId>
		<version>2</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.jvending.masa</groupId>
	<artifactId>android-archetypes</artifactId>
	<version>1.2-SNAPSHOT</version>
	<packaging>pom</packaging>
	<name>JVending Masa: android-archetypes</name>
	<modules>
		<module>android-archetype-quickstart
		</module>
	</modules>
</project>


text:
Add, delete, and download attachments for features from a service.

![](screenshot.png)

## Use case

Attachments provide a flexible way to manage additional information that is related to your features. Attachments allow you to add files to individual features, including: PDFs, text documents, or any other type of file. For example, if you have a feature representing a building, you could use attachments to add multiple photographs of the building taken from several angles, along with PDF files containing the building's deed and tax information.

## How to use the sample

Tap a feature on the map to open a callout displaying the number of attachments. Tap on the info button to view/edit the attachments. Select an entry from the list to download and view the attachment in the gallery. Tap on the floating action button '+' or '-' too add or remove an attachment.

## How it works

1. Create a `ServiceFeatureTable` from a URL.
2. Create a `FeatureLayer` object from the service feature table.
3. Select features from the feature layer with `selectFeatures`.
4. To fetch the feature's attachments, cast to an `ArcGISFeature` and use`ArcGISFeature::attachments()`.
5. To add an attachment to the selected ArcGISFeature, create an attachment and use `ArcGISFeature::attachments()::addAttachment()`.
6. To delete an attachment from the selected ArcGISFeature, use the `ArcGISFeature.deleteAttachment()`.
7. By default, edits are automatically applied to the service and `applyEdits` does not need to be called.

## Additional information

Attachments can only be added to and accessed on service feature tables when their hasAttachments property is true.

## Relevant API

* ApplyEdits
* AttachmentListModel
* DeleteAttachment
* FeatureLayer
* FetchAttachments
* FetchData
* ServiceFeatureTable
* UpdateFeature

## Tags

Edit and Manage Data, image, picture, JPEG, PNG, PDF, TXT


text:
"use strict";

var _core = require("babel-runtime/core-js")["default"];

var _regeneratorRuntime = require("babel-runtime/regenerator")["default"];

var _interopRequire = require("babel-runtime/helpers/interop-require")["default"];

var _interopRequireWildcard = require("babel-runtime/helpers/interop-require-wildcard")["default"];

var giveWord = _regeneratorRuntime.mark(function giveWord() {
  return _regeneratorRuntime.wrap(function giveWord$(context$1$0) {
    while (1) switch (context$1$0.prev = context$1$0.next) {
      case 0:
        context$1$0.next = 2;
        return myWord;

      case 2:
      case "end":
        return context$1$0.stop();
    }
  }, giveWord, this);
});

exports.giveWord = giveWord;
Object.defineProperty(exports, "__esModule", {
  value: true
});

var _someModule = require("someModule");

var foo = _interopRequire(_someModule);

var bar = _interopRequireWildcard(_someModule);

var myWord = _core.Symbol("abc");
exports.myWord = myWord;


text:
import iso8601
import mock
import mox
from oslo.config import cfg

from nova.compute import claims
from nova.compute import task_states
from nova.compute import vm_states
from nova import db
from nova import objects
from nova.openstack.common import jsonutils
from nova.openstack.common import timeutils
from nova.tests.compute import test_compute
from nova.tests.image import fake as fake_image
from nova import utils

CONF = cfg.CONF
CONF.import_opt('shelved_offload_time', 'nova.compute.manager')

def _fake_resources():
    resources = {
        'memory_mb': 2048,
        'memory_mb_used': 0,
        'free_ram_mb': 2048,
        'local_gb': 20,
        'local_gb_used': 0,
        'free_disk_gb': 20,
        'vcpus': 2,
        'vcpus_used': 0
    }
    return resources

class ShelveComputeManagerTestCase(test_compute.BaseTestCase):
    def _shelve_instance(self, shelved_offload_time):
        CONF.set_override('shelved_offload_time', shelved_offload_time)
        db_instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, db_instance, {}, {}, [], None,
                None, True, None, False)
        instance = objects.Instance.get_by_uuid(
            self.context, db_instance['uuid'],
            expected_attrs=['metadata', 'system_metadata'])
        image_id = 'fake_image_id'
        host = 'fake-mini'
        cur_time = timeutils.utcnow()
        timeutils.set_time_override(cur_time)
        instance.task_state = task_states.SHELVING
        instance.save()
        sys_meta = dict(instance.system_metadata)
        sys_meta['shelved_at'] = timeutils.strtime(at=cur_time)
        sys_meta['shelved_image_id'] = image_id
        sys_meta['shelved_host'] = host
        db_instance['system_metadata'] = utils.dict_to_metadata(sys_meta)

        self.mox.StubOutWithMock(self.compute, '_notify_about_instance_usage')
        self.mox.StubOutWithMock(self.compute.driver, 'snapshot')
        self.mox.StubOutWithMock(self.compute.driver, 'power_off')
        self.mox.StubOutWithMock(self.compute, '_get_power_state')
        self.mox.StubOutWithMock(db, 'instance_update_and_get_original')

        self.compute._notify_about_instance_usage(self.context, instance,
                'shelve.start')
        self.compute.driver.power_off(instance)
        self.compute._get_power_state(self.context,
                instance).AndReturn(123)
        self.compute.driver.snapshot(self.context, instance, 'fake_image_id',
                mox.IgnoreArg())

        update_values = {'power_state': 123,
                         'vm_state': vm_states.SHELVED,
                         'task_state': None,
                         'expected_task_state': [task_states.SHELVING,
                                task_states.SHELVING_IMAGE_UPLOADING],
                         'system_metadata': sys_meta}
        if CONF.shelved_offload_time == 0:
            update_values['task_state'] = task_states.SHELVING_OFFLOADING
        db.instance_update_and_get_original(self.context, instance['uuid'],
                 update_values, update_cells=False,
                 columns_to_join=['metadata', 'system_metadata'],
                ).AndReturn((db_instance,
                                                db_instance))
        self.compute._notify_about_instance_usage(self.context,
                                                  instance, 'shelve.end')
        if CONF.shelved_offload_time == 0:
            self.compute._notify_about_instance_usage(self.context, instance,
                'shelve_offload.start')
            self.compute.driver.power_off(instance)
            self.compute._get_power_state(self.context,
                                          instance).AndReturn(123)
            db.instance_update_and_get_original(self.context,
                              instance['uuid'],
                              {'power_state': 123, 'host': None, 'node': None,
                               'vm_state': vm_states.SHELVED_OFFLOADED,
                               'task_state': None,
                               'expected_task_state': [task_states.SHELVING,
                                           task_states.SHELVING_OFFLOADING]},
                              update_cells=False,
                              columns_to_join=['metadata', 'system_metadata'],
                              ).AndReturn((db_instance, db_instance))
            self.compute._notify_about_instance_usage(self.context, instance,
                                                      'shelve_offload.end')
        self.mox.ReplayAll()

        self.compute.shelve_instance(self.context, instance,
                image_id=image_id)

    def test_shelve(self):
        self._shelve_instance(-1)

    def test_shelve_offload(self):
        self._shelve_instance(0)

    def test_shelve_volume_backed(self):
        db_instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, db_instance, {}, {}, [], None,
                None, True, None, False)
        instance = objects.Instance.get_by_uuid(
            self.context, db_instance['uuid'],
            expected_attrs=['metadata', 'system_metadata'])
        instance.task_state = task_states.SHELVING
        instance.save()
        host = 'fake-mini'
        cur_time = timeutils.utcnow()
        timeutils.set_time_override(cur_time)
        sys_meta = dict(instance.system_metadata)
        sys_meta['shelved_at'] = timeutils.strtime(at=cur_time)
        sys_meta['shelved_image_id'] = None
        sys_meta['shelved_host'] = host
        db_instance['system_metadata'] = utils.dict_to_metadata(sys_meta)

        self.mox.StubOutWithMock(self.compute, '_notify_about_instance_usage')
        self.mox.StubOutWithMock(self.compute.driver, 'power_off')
        self.mox.StubOutWithMock(self.compute, '_get_power_state')
        self.mox.StubOutWithMock(db, 'instance_update_and_get_original')

        self.compute._notify_about_instance_usage(self.context, instance,
                'shelve_offload.start')
        self.compute.driver.power_off(instance)
        self.compute._get_power_state(self.context,
                instance).AndReturn(123)
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'power_state': 123, 'host': None, 'node': None,
                 'vm_state': vm_states.SHELVED_OFFLOADED,
                 'task_state': None,
                 'expected_task_state': [task_states.SHELVING,
                    task_states.SHELVING_OFFLOADING]},
                 update_cells=False,
                 columns_to_join=['metadata', 'system_metadata'],
                 ).AndReturn((db_instance, db_instance))
        self.compute._notify_about_instance_usage(self.context, instance,
                'shelve_offload.end')
        self.mox.ReplayAll()

        self.compute.shelve_offload_instance(self.context, instance)

    def test_unshelve(self):
        db_instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, db_instance, {}, {}, [], None,
                None, True, None, False)
        instance = objects.Instance.get_by_uuid(
            self.context, db_instance['uuid'],
            expected_attrs=['metadata', 'system_metadata'])
        instance.task_state = task_states.UNSHELVING
        instance.save()
        image = {'id': 'fake_id'}
        host = 'fake-mini'
        node = test_compute.NODENAME
        limits = {}
        filter_properties = {'limits': limits}
        cur_time = timeutils.utcnow()
        cur_time_tz = cur_time.replace(tzinfo=iso8601.iso8601.Utc())
        timeutils.set_time_override(cur_time)
        sys_meta = dict(instance.system_metadata)
        sys_meta['shelved_at'] = timeutils.strtime(at=cur_time)
        sys_meta['shelved_image_id'] = image['id']
        sys_meta['shelved_host'] = host

        self.mox.StubOutWithMock(self.compute, '_notify_about_instance_usage')
        self.mox.StubOutWithMock(self.compute, '_prep_block_device')
        self.mox.StubOutWithMock(self.compute.driver, 'spawn')
        self.mox.StubOutWithMock(self.compute, '_get_power_state')
        self.mox.StubOutWithMock(self.rt, 'instance_claim')
        self.mox.StubOutWithMock(db, 'instance_update_and_get_original')

        self.deleted_image_id = None

        def fake_delete(self2, ctxt, image_id):
            self.deleted_image_id = image_id

        def fake_claim(context, instance, limits):
            instance.host = self.compute.host
            return claims.Claim(db_instance, self.rt, _fake_resources())

        fake_image.stub_out_image_service(self.stubs)
        self.stubs.Set(fake_image._FakeImageService, 'delete', fake_delete)

        self.compute._notify_about_instance_usage(self.context, instance,
                'unshelve.start')
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'task_state': task_states.SPAWNING},
                update_cells=False,
                columns_to_join=['metadata', 'system_metadata'],
                ).AndReturn((db_instance, db_instance))
        self.compute._prep_block_device(self.context, instance,
                mox.IgnoreArg()).AndReturn('fake_bdm')
        db_instance['key_data'] = None
        db_instance['auto_disk_config'] = None
        self.compute.driver.spawn(self.context, instance, image,
                injected_files=[], admin_password=None,
                network_info=[],
                block_device_info='fake_bdm')
        self.compute._get_power_state(self.context, instance).AndReturn(123)
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'power_state': 123,
                 'vm_state': vm_states.ACTIVE,
                 'task_state': None,
                 'image_ref': instance['image_ref'],
                 'key_data': None,
                 'host': self.compute.host,  # rt.instance_claim set this
                 'auto_disk_config': False,
                 'expected_task_state': task_states.SPAWNING,
                 'launched_at': cur_time_tz},
                 update_cells=False,
                 columns_to_join=['metadata', 'system_metadata']
                 ).AndReturn((db_instance,
                              dict(db_instance,
                                   host=self.compute.host)))
        self.compute._notify_about_instance_usage(self.context, instance,
                'unshelve.end')
        self.mox.ReplayAll()

        with mock.patch.object(self.rt, 'instance_claim',
                               side_effect=fake_claim):
            self.compute.unshelve_instance(self.context, instance, image=image,
                    filter_properties=filter_properties, node=node)
        self.assertEqual(image['id'], self.deleted_image_id)
        self.assertEqual(instance.host, self.compute.host)

    def test_unshelve_volume_backed(self):
        db_instance = jsonutils.to_primitive(self._create_fake_instance())
        host = 'fake-mini'
        node = test_compute.NODENAME
        limits = {}
        filter_properties = {'limits': limits}
        cur_time = timeutils.utcnow()
        cur_time_tz = cur_time.replace(tzinfo=iso8601.iso8601.Utc())
        timeutils.set_time_override(cur_time)
        self.compute.run_instance(self.context, db_instance, {}, {}, [], None,
                None, True, None, False)
        instance = objects.Instance.get_by_uuid(
            self.context, db_instance['uuid'],
            expected_attrs=['metadata', 'system_metadata'])
        instance.task_state = task_states.UNSHELVING
        instance.save()
        sys_meta = dict(instance.system_metadata)
        sys_meta['shelved_at'] = timeutils.strtime(at=cur_time)
        sys_meta['shelved_image_id'] = None
        sys_meta['shelved_host'] = host

        self.mox.StubOutWithMock(self.compute, '_notify_about_instance_usage')
        self.mox.StubOutWithMock(self.compute, '_prep_block_device')
        self.mox.StubOutWithMock(self.compute.driver, 'spawn')
        self.mox.StubOutWithMock(self.compute, '_get_power_state')
        self.mox.StubOutWithMock(self.rt, 'instance_claim')
        self.mox.StubOutWithMock(db, 'instance_update_and_get_original')

        self.compute._notify_about_instance_usage(self.context, instance,
                'unshelve.start')
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'task_state': task_states.SPAWNING},
                update_cells=False,
                columns_to_join=['metadata', 'system_metadata']
                ).AndReturn((db_instance, db_instance))
        self.compute._prep_block_device(self.context, instance,
                mox.IgnoreArg()).AndReturn('fake_bdm')
        db_instance['key_data'] = None
        db_instance['auto_disk_config'] = None
        self.rt.instance_claim(self.context, instance, limits).AndReturn(
                claims.Claim(db_instance, self.rt, _fake_resources()))
        self.compute.driver.spawn(self.context, instance, None,
                injected_files=[], admin_password=None,
                network_info=[],
                block_device_info='fake_bdm')
        self.compute._get_power_state(self.context, instance).AndReturn(123)
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'power_state': 123,
                 'vm_state': vm_states.ACTIVE,
                 'task_state': None,
                 'key_data': None,
                 'auto_disk_config': False,
                 'expected_task_state': task_states.SPAWNING,
                 'launched_at': cur_time_tz},
                 update_cells=False,
                 columns_to_join=['metadata', 'system_metadata']
                 ).AndReturn((db_instance, db_instance))
        self.compute._notify_about_instance_usage(self.context, instance,
                'unshelve.end')
        self.mox.ReplayAll()

        self.compute.unshelve_instance(self.context, instance, image=None,
                filter_properties=filter_properties, node=node)

    def test_shelved_poll_none_exist(self):
        instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, instance, {}, {}, [], None,
                None, True, None, False)
        self.mox.StubOutWithMock(self.compute.driver, 'destroy')
        self.mox.StubOutWithMock(timeutils, 'is_older_than')
        self.mox.ReplayAll()
        self.compute._poll_shelved_instances(self.context)

    def test_shelved_poll_not_timedout(self):
        instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, instance, {}, {}, [], None,
                None, True, None, False)
        sys_meta = utils.metadata_to_dict(instance['system_metadata'])
        shelved_time = timeutils.utcnow()
        timeutils.set_time_override(shelved_time)
        timeutils.advance_time_seconds(CONF.shelved_offload_time - 1)
        sys_meta['shelved_at'] = timeutils.strtime(at=shelved_time)
        db.instance_update_and_get_original(self.context, instance['uuid'],
                {'vm_state': vm_states.SHELVED, 'system_metadata': sys_meta})

        self.mox.StubOutWithMock(self.compute.driver, 'destroy')
        self.mox.ReplayAll()
        self.compute._poll_shelved_instances(self.context)

    def test_shelved_poll_timedout(self):
        active_instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, active_instance, {}, {}, [],
                None, None, True, None, False)

        instance = jsonutils.to_primitive(self._create_fake_instance())
        self.compute.run_instance(self.context, instance, {}, {}, [], None,
                None, True, None, False)
        sys_meta = utils.metadata_to_dict(instance['system_metadata'])
        shelved_time = timeutils.utcnow()
        timeutils.set_time_override(shelved_time)
        timeutils.advance_time_seconds(CONF.shelved_offload_time + 1)
        sys_meta['shelved_at'] = timeutils.strtime(at=shelved_time)
        (old, instance) = db.instance_update_and_get_original(self.context,
                instance['uuid'], {'vm_state': vm_states.SHELVED,
                                   'system_metadata': sys_meta})

        def fake_destroy(inst, nw_info, bdm):
            # NOTE(alaski) There are too many differences between an instance
            # as returned by instance_update_and_get_original and
            # instance_get_all_by_filters so just compare the uuid.
            self.assertEqual(instance['uuid'], inst['uuid'])

        self.stubs.Set(self.compute.driver, 'destroy', fake_destroy)
        self.compute._poll_shelved_instances(self.context)

class ShelveComputeAPITestCase(test_compute.BaseTestCase):
    def test_shelve(self):
        # Ensure instance can be shelved.
        fake_instance = self._create_fake_instance({'display_name': 'vm01'})
        instance = jsonutils.to_primitive(fake_instance)
        instance_uuid = instance['uuid']
        self.compute.run_instance(self.context, instance, {}, {}, [], None,
                None, True, None, False)

        self.assertIsNone(instance['task_state'])

        def fake_init(self2):
            # In original _FakeImageService.__init__(), some fake images are
            # created. To verify the snapshot name of this test only, here
            # sets a fake method.
            self2.images = {}

        def fake_create(self2, ctxt, metadata, data=None):
            self.assertEqual(metadata['name'], 'vm01-shelved')
            metadata['id'] = '8b24ed3f-ee57-43bc-bc2e-fb2e9482bc42'
            return metadata

        fake_image.stub_out_image_service(self.stubs)
        self.stubs.Set(fake_image._FakeImageService, '__init__', fake_init)
        self.stubs.Set(fake_image._FakeImageService, 'create', fake_create)

        inst_obj = objects.Instance.get_by_uuid(self.context, instance_uuid)
        self.compute_api.shelve(self.context, inst_obj)

        inst_obj.refresh()
        self.assertEqual(inst_obj.task_state, task_states.SHELVING)

        db.instance_destroy(self.context, instance['uuid'])

    def test_unshelve(self):
        # Ensure instance can be unshelved.
        instance = jsonutils.to_primitive(self._create_fake_instance())
        instance_uuid = instance['uuid']
        self.compute.run_instance(self.context, instance, {}, {}, [], None,
                None, True, None, False)

        self.assertIsNone(instance['task_state'])

        inst_obj = objects.Instance.get_by_uuid(self.context, instance_uuid)
        self.compute_api.shelve(self.context, inst_obj)

        inst_obj.refresh()
        inst_obj.task_state = None
        inst_obj.vm_state = vm_states.SHELVED
        inst_obj.save()

        self.compute_api.unshelve(self.context, inst_obj)

        inst_obj.refresh()
        self.assertEqual(inst_obj.task_state, task_states.UNSHELVING)

        db.instance_destroy(self.context, instance['uuid'])


text:
Template three

        We've worked super hard to make you happy.

Any questions?

        Too bad!

        Lorem ipsum dolor sit amet, ad hinc nonumy constituam pro, id habemus feugait complectitur sed, solet argumentum
        te mei.
        Sonet deterruisset qui no, eu case conceptam incorrupte his.
        Sit ne magna legendos, mei te virtute senserit, tollit vidisse aliquam has no.
        An duo enim numquam rationibus, eum delenit intellegat at, an ius nonumy appellantur. Euripidis pertinacia in eam.
        Probo lorem nonumes vim ea, vide periculis sed ei.
        An has ipsum mentitum, legimus delectus similique per in. No facer facilisi cum.
        Ut iusto doctus vivendo his, epicuri appareat nam te, cum te aeterno alterum delenit.
        Fabulas deseruisse contentiones ad ius, est case debet elitr ne, ea verear civibus argumentum eos.
        Aperiam propriae abhorreant ea mea, quot autem ancillae ex pro, mea quod omnium ad.
        Mei cu delenit concludaturque, cum ullum nominavi eloquentiam ne, ea diam audiam sit.

        Vim ex dolorum officiis, cum aeque omnesque ne, id nec interesset consectetuer.
        Ex quo ullum volumus voluptaria, ex ius errem vituperata, movet quidam electram et mei.
        Vis rebum salutatus ea. Eripuit fabellas pri ex. Qui sumo erat evertitur in.
        Melius efficiantur his ea, vim et rebum augue alienum, ad utroque oportere expetenda mel.

                Phasellus sed varius ipsum.
                Curabitur in lectus at metus congue eleifend sit amet eget mi.
                Phasellus arcu felis, tincidunt ac justo sit amet, ultricies pharetra nisi.
                Donec porttitor fermentum mi sit amet viverra.
                Quisque rhoncus, justo at ullamcorper iaculis, tellus metus posuere purus, non malesuada leo tellus id libero.
                Nam porttitor fermentum semper.
                Maecenas ornare ullamcorper justo non tincidunt.
                In hac habitasse platea dictumst.
                Donec in ligula eu neque feugiat rhoncus et a massa.
                Phasellus varius felis non augue bibendum efficitur.
                Aliquam et lacus nec dolor gravida tincidunt.
                Nullam hendrerit velit ac ligula semper, at auctor metus feugiat.
                Vestibulum vitae ligula elit. Fusce ornare eu mi et placerat.
                Integer pulvinar convallis eleifend.
                Donec nec condimentum nulla, sed luctus nisi.


text:
package br.com.pjbank.sdk.models.recebimento;

import java.util.List;

/**
 *
 * @author Paulo Vitor Braga Pessoa <foxpv213@gmail.com>
 *
 */
public class Carne {
	/**
	 * Dados para requisição
	 */
	public List<String>pedidoNumero;

	/**
	 * Dados para resposta
	 */
	public String linkBoleto;

	public Carne(List<String> pedidoNumero) {
		super();
		this.pedidoNumero = pedidoNumero;
	}

	public List<String> getPedidoNumero() {
		return pedidoNumero;
	}

	public void setPedidoNumero(List<String> pedidoNumero) {
		this.pedidoNumero = pedidoNumero;
	}

	public String getLinkBoleto() {
		return linkBoleto;
	}

	public void setLinkBoleto(String linkBoleto) {
		this.linkBoleto = linkBoleto;
	}

}


text:
%w(libicu-dev).each do|name|
  package name do
    action :install
  end
end


text:
<?php
include('session.php');

if(!isset($_GET["id"])){
	header("location:organisatie.php");
}

require_once "head.html";
require_once "includes/Database.class.php";
require_once "includes/UserTools.class.php";
require_once "includes/View.class.php";

$userTools = new UserTools();
$view = new View();
$data = array();
$data = $userTools->getQuizInfoById($_GET["id"]);

?>

Template maken voor: <?php echo $data["name"]?>

Maak een nieuwe template

          <input placeholder="Naam template" id="template_name" type="text" class="validate" required>
          Template naam

        Nieuwe template

Wijzig template

      <select class="templateSelect">
        <option value="" disabled selected>Kies een template</option>
        <?php
          foreach ($userTools->getAllTemplates() as $template) {
            ?> <option class="templateOption" value="<?php echo $template["id"];?>" quiztemplate='<?php echo $template["template"];?>'><?php echo $template["name"]; ?> </option>
        <?php  }
         ?>
      </select>
      Bestaande templates

    <form>
    <?php
    $view->getAnswersOverview($_GET["id"]);
    ?>

    </form>
		Aanmaken
    Update
    Delete

<?php

require_once "tail.html";

?>


text:
import Relay from 'react-relay';

export default class UpdatePrivacyMutation extends Relay.Mutation {
    static fragments = {
        user: () => Relay.QL`
            fragment on User {
                id
            }
        `
    }

    getMutation () {
        return Relay.QL`mutation {updatePrivacy}`;
    }

    getVariables () {
        const { sharing } = this.props;

        return {
            privacy: {
                sharing
            }
        };
    }

    getFatQuery () {
        return Relay.QL`
            fragment on UpdatePrivacyPayload {
                user {
                    profile
                }
            }
        `;
    }

    getConfigs () {
        return [{
            type: 'FIELDS_CHANGE',
            fieldIDs: {
                user: this.props.user.id
            }
        }];
    }
}


text:
namespace Browse
{
  partial class frmMain
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
      this.btnOpen = new System.Windows.Forms.Button();
      this.cboBrowsers = new System.Windows.Forms.ComboBox();
      this.lblChoose = new System.Windows.Forms.Label();
      this.lblRoot = new System.Windows.Forms.Label();
      this.txtRoot = new System.Windows.Forms.TextBox();
      this.cbPause = new System.Windows.Forms.CheckBox();
      this.lblPages = new System.Windows.Forms.Label();
      this.txtPages = new System.Windows.Forms.TextBox();
      this.udPause = new System.Windows.Forms.NumericUpDown();
      this.label1 = new System.Windows.Forms.Label();
      this.pnlMsg = new System.Windows.Forms.Panel();
      this.pnlMsgText = new System.Windows.Forms.Panel();
            this.lblMessage = new System.Windows.Forms.Label();
      this.btnAccept = new System.Windows.Forms.Button();
            this.udRepeat = new System.Windows.Forms.NumericUpDown();
            this.cbRepeat = new System.Windows.Forms.CheckBox();
      ((System.ComponentModel.ISupportInitialize)(this.udPause)).BeginInit();
      this.pnlMsg.SuspendLayout();
      this.pnlMsgText.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.udRepeat)).BeginInit();
      this.SuspendLayout();
      //
      // btnOpen
      //
      this.btnOpen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
      this.btnOpen.Location = new System.Drawing.Point(239, 12);
      this.btnOpen.Name = "btnOpen";
      this.btnOpen.Size = new System.Drawing.Size(48, 48);
      this.btnOpen.TabIndex = 1;
      this.btnOpen.Text = "Open";
      this.btnOpen.UseVisualStyleBackColor = true;
      this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
      //
      // cboBrowsers
      //
      this.cboBrowsers.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.cboBrowsers.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cboBrowsers.FormattingEnabled = true;
      this.cboBrowsers.Location = new System.Drawing.Point(12, 29);
      this.cboBrowsers.Name = "cboBrowsers";
      this.cboBrowsers.Size = new System.Drawing.Size(212, 21);
      this.cboBrowsers.TabIndex = 0;
      this.cboBrowsers.SelectedIndexChanged += new System.EventHandler(this.cboBrowsers_SelectedIndexChanged);
      //
      // lblChoose
      //
      this.lblChoose.AutoSize = true;
      this.lblChoose.Location = new System.Drawing.Point(9, 13);
      this.lblChoose.Name = "lblChoose";
      this.lblChoose.Size = new System.Drawing.Size(109, 13);
      this.lblChoose.TabIndex = 2;
      this.lblChoose.Text = "Choose Your Browser";
      //
      // lblRoot
      //
      this.lblRoot.AutoSize = true;
      this.lblRoot.Location = new System.Drawing.Point(10, 72);
      this.lblRoot.Name = "lblRoot";
      this.lblRoot.Size = new System.Drawing.Size(55, 13);
      this.lblRoot.TabIndex = 3;
      this.lblRoot.Text = "Root URL";
      //
      // txtRoot
      //
      this.txtRoot.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.txtRoot.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.RecentlyUsedList;
      this.txtRoot.Location = new System.Drawing.Point(13, 88);
      this.txtRoot.Name = "txtRoot";
      this.txtRoot.Size = new System.Drawing.Size(274, 20);
      this.txtRoot.TabIndex = 4;
      this.txtRoot.Text = "www.canyonco.org";
      //
      // cbPause
      //
      this.cbPause.AutoSize = true;
      this.cbPause.Checked = true;
      this.cbPause.CheckState = System.Windows.Forms.CheckState.Checked;
      this.cbPause.Location = new System.Drawing.Point(13, 115);
      this.cbPause.Name = "cbPause";
      this.cbPause.Size = new System.Drawing.Size(184, 17);
      this.cbPause.TabIndex = 5;
      this.cbPause.Text = "Pause after first page (allow login)";
      this.cbPause.UseVisualStyleBackColor = true;
      //
      // lblPages
      //
      this.lblPages.AutoSize = true;
      this.lblPages.Location = new System.Drawing.Point(10, 163);
      this.lblPages.Name = "lblPages";
      this.lblPages.Size = new System.Drawing.Size(37, 13);
      this.lblPages.TabIndex = 6;
      this.lblPages.Text = "Pages";
      //
      // txtPages
      //
      this.txtPages.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.txtPages.Location = new System.Drawing.Point(13, 179);
      this.txtPages.Multiline = true;
      this.txtPages.Name = "txtPages";
      this.txtPages.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.txtPages.Size = new System.Drawing.Size(274, 111);
      this.txtPages.TabIndex = 8;
      this.txtPages.Text = resources.GetString("txtPages.Text");
      this.txtPages.WordWrap = false;
      //
      // udPause
      //
      this.udPause.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.udPause.Location = new System.Drawing.Point(159, 138);
      this.udPause.Maximum = new decimal(new int[] {
            60000,
            0,
            0,
            0});
      this.udPause.Name = "udPause";
      this.udPause.Size = new System.Drawing.Size(128, 20);
      this.udPause.TabIndex = 7;
      this.udPause.ThousandsSeparator = true;
      this.udPause.Value = new decimal(new int[] {
            1000,
            0,
            0,
            0});
      //
      // label1
      //
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(10, 140);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(143, 13);
      this.label1.TabIndex = 9;
      this.label1.Text = "Delay (in ms) between pages";
      //
      // pnlMsg
      //
      this.pnlMsg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.pnlMsg.BackColor = System.Drawing.SystemColors.Highlight;
      this.pnlMsg.Controls.Add(this.pnlMsgText);
      this.pnlMsg.Location = new System.Drawing.Point(13, 114);
      this.pnlMsg.Name = "pnlMsg";
      this.pnlMsg.Size = new System.Drawing.Size(274, 200);
      this.pnlMsg.TabIndex = 10;
      this.pnlMsg.Visible = false;
      //
      // pnlMsgText
      //
      this.pnlMsgText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.pnlMsgText.BackColor = System.Drawing.SystemColors.Control;
      this.pnlMsgText.Controls.Add(this.lblMessage);
      this.pnlMsgText.Controls.Add(this.btnAccept);
      this.pnlMsgText.Location = new System.Drawing.Point(3, 3);
      this.pnlMsgText.Name = "pnlMsgText";
      this.pnlMsgText.Size = new System.Drawing.Size(268, 194);
      this.pnlMsgText.TabIndex = 0;
      //
      // lblMessage
      //
      this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
      this.lblMessage.Location = new System.Drawing.Point(15, 18);
      this.lblMessage.Name = "lblMessage";
      this.lblMessage.Size = new System.Drawing.Size(241, 123);
      this.lblMessage.TabIndex = 1;
      this.lblMessage.Text = "There was an error, or something";
      this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // btnAccept
            //
            this.btnAccept.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
            this.btnAccept.Location = new System.Drawing.Point(95, 144);
            this.btnAccept.Name = "btnAccept";
            this.btnAccept.Size = new System.Drawing.Size(75, 23);
            this.btnAccept.TabIndex = 0;
            this.btnAccept.Text = "OK";
            this.btnAccept.UseVisualStyleBackColor = true;
            this.btnAccept.Click += new System.EventHandler(this.btnAccept_Click);
            //
            // udRepeat
            //
            this.udRepeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.udRepeat.Location = new System.Drawing.Point(159, 294);
            this.udRepeat.Maximum = new decimal(new int[] {
            60000,
            0,
            0,
            0});
            this.udRepeat.Name = "udRepeat";
            this.udRepeat.Size = new System.Drawing.Size(128, 20);
            this.udRepeat.TabIndex = 11;
            this.udRepeat.ThousandsSeparator = true;
            this.udRepeat.Value = new decimal(new int[] {
            1000,
            0,
            0,
            0});
            //
            // cbRepeat
            //
            this.cbRepeat.AutoSize = true;
            this.cbRepeat.Location = new System.Drawing.Point(51, 295);
            this.cbRepeat.Name = "cbRepeat";
            this.cbRepeat.Size = new System.Drawing.Size(102, 17);
            this.cbRepeat.TabIndex = 12;
            this.cbRepeat.Text = "Repeat (x times)";
            this.cbRepeat.UseVisualStyleBackColor = true;
      // frmMain
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(299, 326);
      this.Controls.Add(this.pnlMsg);
      this.Controls.Add(this.label1);
      this.Controls.Add(this.udPause);
      this.Controls.Add(this.txtPages);
      this.Controls.Add(this.lblPages);
      this.Controls.Add(this.cbPause);
      this.Controls.Add(this.txtRoot);
      this.Controls.Add(this.lblRoot);
      this.Controls.Add(this.lblChoose);
      this.Controls.Add(this.cboBrowsers);
      this.Controls.Add(this.btnOpen);
            this.Controls.Add(this.cbRepeat);
            this.Controls.Add(this.udRepeat);
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
      this.Name = "frmMain";
      this.Opacity = 0.95D;
      this.Text = "Launcher";
      this.TopMost = true;
      this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing);
      this.Load += new System.EventHandler(this.frmMain_Load);
      ((System.ComponentModel.ISupportInitialize)(this.udPause)).EndInit();
      this.pnlMsg.ResumeLayout(false);
      this.pnlMsgText.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.udRepeat)).EndInit();
      this.ResumeLayout(false);
      this.PerformLayout();

    }

    #endregion

    private System.Windows.Forms.Button btnOpen;
    private System.Windows.Forms.ComboBox cboBrowsers;
    private System.Windows.Forms.Label lblChoose;
    private System.Windows.Forms.Label lblRoot;
    private System.Windows.Forms.TextBox txtRoot;
    private System.Windows.Forms.CheckBox cbPause;
    private System.Windows.Forms.Label lblPages;
    private System.Windows.Forms.TextBox txtPages;
    private System.Windows.Forms.NumericUpDown udPause;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Panel pnlMsg;
    private System.Windows.Forms.Panel pnlMsgText;
    private System.Windows.Forms.Label lblMessage;
    private System.Windows.Forms.Button btnAccept;
    private System.Windows.Forms.NumericUpDown udRepeat;
    private System.Windows.Forms.CheckBox cbRepeat;
  }
}


text:
package debrepo.teamcity.service;

import debrepo.teamcity.Loggers;
import jetbrains.buildServer.serverSide.BuildServerAdapter;
import jetbrains.buildServer.serverSide.SBuild;
import jetbrains.buildServer.serverSide.SBuildServer;
import jetbrains.buildServer.serverSide.SRunningBuild;
import jetbrains.buildServer.serverSide.artifacts.BuildArtifactsViewMode;

public class DebRepoServerEventListener extends BuildServerAdapter {

	private final DebRepositoryBuildArtifactsPublisher myPublisher;
	private final SBuildServer myBuildServer;

	public DebRepoServerEventListener(DebRepositoryBuildArtifactsPublisher publisher, SBuildServer sBuildServer) {
		this.myPublisher = publisher;
		this.myBuildServer = sBuildServer;
	}

	public void register(){
		myBuildServer.addListener(this);
		Loggers.SERVER.info("DebRepoServerEventListener :: Registering");
	}

	@Override
	public void serverShutdown() {
		// TODO Auto-generated method stub
	}

	@Override
	public void buildArtifactsChanged(SBuild build) {
		this.myPublisher.removeArtifactsFromRepositories(build, build.getArtifacts(BuildArtifactsViewMode.VIEW_DEFAULT));

	}

	@Override
	public void buildFinished(SRunningBuild build) {
		this.myPublisher.addArtifactsToRepositories(build, build.getArtifacts(BuildArtifactsViewMode.VIEW_DEFAULT));
	}
}


text:
package dcraft.web.ui.tags.form;

import java.lang.ref.WeakReference;
import java.util.List;

import dcraft.web.ui.UIElement;
import dcraft.web.ui.UIWork;
import dcraft.xml.XElement;
import dcraft.xml.XNode;

public class MultiInputField extends CoreField {
	@Override
	public void addControl() {
		UIElement grp = new UIElement("div")
			.withClass("dc-pui-control", "dc-pui-input-multi");

		List<XElement> inputs = this.fieldinfo.selectAll("Input");

		for (XElement el : inputs)
			grp.with(InputControl.fromField(this, (UIElement) el));

		this.with(grp);

		/*
			<div class="dc-pui-control dc-pui-input-multi">
				<input id="first" placeholder="First" class="dc-pui-input-40"  />
				<input id="mid" placeholder="M" class="dc-pui-input-10"  />
				<input id="last" placeholder="Last"  class="dc-pui-input-40" />
			</div>
		*/
	}

	@Override
	public void translate(WeakReference<UIWork> work, List<XNode> pnodes) {
		this.withClass("dc-pui-field-multi");

		super.translate(work, pnodes);
	}
}


text:
<?php

namespace Skaphandrus\AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Validator\Constraints\File;

class SkIdentificationModuleType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('translations', 'a2lix_translations', array(
                'fields' => array(
                    'name' => array(
                        'attr' => array('class' => 'form-control'),
                    )
                )
            ))
            ->add('appstoreId')
            ->add('googleplayId')
            ->add('master')
            ->add('isActive')//se está concluido pelos biologos
            ->add('isEnabled')
            ->add('isFree')
            //->add('image')
//            ->add('file', 'file', array(
//                'label' => 'form.identification_module.label.file',
//                'required' => false
//            ))
//                 ->add('file', 'file', array(
//                    'label' => 'form.identification_module.label.file',
//                    'constraints' => new File(array(
//                        'maxSize' => '10M',
//                        'mimeTypes' => array("image/jpeg")
//                            )),
//                    'required' => false
//                        )
//                )
            ->add('imageFile', 'vich_image', array(
                'label' => 'form.identification_module.label.file',
                'required'      => false,
                'allow_delete'  => false, // not mandatory, default is true
                'download_link' => false, // not mandatory, default is true
                ))
        ;
    }

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

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


text:
<?php

namespace joshmoody\Mock\Models;

use Illuminate\Database\Eloquent\Model;

class LastName extends Model
{
	public $connection = 'mock-data';
	public $timestamps = false;
}


text:
"""Implements Kalman filtering for linear state space models."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.contrib import distributions

from tensorflow.contrib.timeseries.python.timeseries import math_utils

from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import linalg_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import numerics

# TODO(allenl): support for always-factored covariance matrices
class KalmanFilter(object):
  """Inference on linear state models.

  The model for observations in a given state is:
    observation(t) = observation_model * state(t)
        + Gaussian(0, observation_noise_covariance)

  State updates take the following form:
    state(t) = state_transition * state(t-1)
        + state_noise_transform * Gaussian(0, state_transition_noise_covariance)

  This is a real-valued analog to hidden Markov models, with linear transitions
  and a Gaussian noise model. Given initial conditions, noise, and state
  transition, Kalman filtering recursively estimates states and observations,
  along with their associated uncertainty. When fed observations, future state
  and uncertainty estimates are conditioned on those observations (in a Bayesian
  sense).

  Typically some "given"s mentioned above (noises) will be unknown, and so
  optimizing the Kalman filter's probabilistic predictions with respect to these
  parameters is a good approach. The state transition and observation models are
  usually known a priori as a modeling decision.

  """

  def __init__(self, dtype=dtypes.float32,
               simplified_posterior_covariance_computation=False):
    """Initialize the Kalman filter.

    Args:
      dtype: The data type to use for floating point tensors.
      simplified_posterior_covariance_computation: If True, uses an algebraic
        simplification of the Kalman filtering posterior covariance update,
        which is slightly faster at the cost of numerical stability. The
        simplified update is often stable when using double precision on small
        models or with fixed transition matrices.
    """
    self._simplified_posterior_covariance_computation = (
        simplified_posterior_covariance_computation)
    self.dtype = dtype

  def do_filter(
      self, estimated_state, estimated_state_covariance,
      predicted_observation, predicted_observation_covariance,
      observation, observation_model, observation_noise):
    """Convenience function for scoring predictions.

    Scores a prediction against an observation, and computes the updated
    posterior over states.

    Shapes given below for arguments are for single-model Kalman filtering
    (e.g. KalmanFilter). For ensembles, prior_state and prior_state_var are
    same-length tuples of values corresponding to each model.

    Args:
      estimated_state: A prior mean over states [batch size x state dimension]
      estimated_state_covariance: Covariance of state prior [batch size x D x
          D], with D depending on the Kalman filter implementation (typically
          the state dimension).
      predicted_observation: A prediction for the observed value, such as that
          returned by observed_from_state. A [batch size x num features] Tensor.
      predicted_observation_covariance: A covariance matrix corresponding to
          `predicted_observation`, a [batch size x num features x num features]
          Tensor.
      observation: The observed value corresponding to the predictions
          given [batch size x observation dimension]
      observation_model: The [batch size x observation dimension x model state
          dimension] Tensor indicating how a particular state is mapped to
          (pre-noise) observations for each part of the batch.
      observation_noise: A [batch size x observation dimension x observation
          dimension] Tensor or [observation dimension x observation dimension]
          Tensor with covariance matrices to use for each part of the batch (a
          two-dimensional input will be broadcast).
    Returns:
      posterior_state, posterior_state_var: Posterior mean and
          covariance, updated versions of prior_state and
          prior_state_var.
      log_prediction_prob: Log probability of the observations under
          the priors, suitable for optimization (should be maximized).

    """
    symmetrized_observation_covariance = 0.5 * (
        predicted_observation_covariance + array_ops.matrix_transpose(
            predicted_observation_covariance))
    instability_message = (
        "This may occur due to numerically unstable filtering when there is "
        "a large difference in posterior variances, or when inferences are "
        "near-deterministic. Considering tuning the "
        "'filtering_maximum_posterior_variance_ratio' or "
        "'filtering_minimum_posterior_variance' parameters in your "
        "StateSpaceModelConfiguration, or tuning the transition matrix.")
    symmetrized_observation_covariance = numerics.verify_tensor_all_finite(
        symmetrized_observation_covariance,
        "Predicted observation covariance was not finite. {}".format(
            instability_message))
    diag = array_ops.matrix_diag_part(symmetrized_observation_covariance)
    min_diag = math_ops.reduce_min(diag)
    non_negative_assert = control_flow_ops.Assert(
        min_diag >= 0.,
        [("The predicted observation covariance "
          "has a negative diagonal entry. {}").format(instability_message),
         min_diag])
    with ops.control_dependencies([non_negative_assert]):
      observation_covariance_cholesky = linalg_ops.cholesky(
          symmetrized_observation_covariance)
    log_prediction_prob = distributions.MultivariateNormalTriL(
        predicted_observation, observation_covariance_cholesky).log_prob(
            observation)
    (posterior_state,
     posterior_state_var) = self.posterior_from_prior_state(
         prior_state=estimated_state,
         prior_state_var=estimated_state_covariance,
         observation=observation,
         observation_model=observation_model,
         predicted_observations=(predicted_observation,
                                 predicted_observation_covariance),
         observation_noise=observation_noise)
    return (posterior_state, posterior_state_var, log_prediction_prob)

  def predict_state_mean(self, prior_state, transition_matrices):
    """Compute state transitions.

    Args:
      prior_state: Current estimated state mean [batch_size x state_dimension]
      transition_matrices: A [batch size, state dimension, state dimension]
        batch of matrices (dtype matching the `dtype` argument to the
        constructor) with the transition matrix raised to the power of the
        number of steps to be taken (not element-wise; use
        math_utils.matrix_to_powers if there is no efficient special case) if
        more than one step is desired.
    Returns:
      State mean advanced based on `transition_matrices` (dimensions matching
      first argument).
    """
    advanced_state = array_ops.squeeze(
        math_ops.matmul(
            transition_matrices,
            prior_state[..., None]),
        squeeze_dims=[-1])
    return advanced_state

  def predict_state_var(
      self, prior_state_var, transition_matrices, transition_noise_sums):
    r"""Compute variance for state transitions.

    Computes a noise estimate corresponding to the value returned by
    predict_state_mean.

    Args:
      prior_state_var: Covariance matrix specifying uncertainty of current state
          estimate [batch size x state dimension x state dimension]
      transition_matrices: A [batch size, state dimension, state dimension]
        batch of matrices (dtype matching the `dtype` argument to the
        constructor) with the transition matrix raised to the power of the
        number of steps to be taken (not element-wise; use
        math_utils.matrix_to_powers if there is no efficient special case).
      transition_noise_sums: A [batch size, state dimension, state dimension]
        Tensor (dtype matching the `dtype` argument to the constructor) with:

          \sum_{i=0}^{num_steps - 1} (
             state_transition_to_powers_fn(i)
             * state_transition_noise_covariance
             * state_transition_to_powers_fn(i)^T
          )

        for the number of steps to be taken in each part of the batch (this
        should match `transition_matrices`). Use math_utils.power_sums_tensor
        with `tf.gather` if there is no efficient special case.
    Returns:
      State variance advanced based on `transition_matrices` and
      `transition_noise_sums` (dimensions matching first argument).
    """
    prior_variance_transitioned = math_ops.matmul(
        math_ops.matmul(transition_matrices, prior_state_var),
        transition_matrices,
        adjoint_b=True)
    return prior_variance_transitioned + transition_noise_sums

  def posterior_from_prior_state(self, prior_state, prior_state_var,
                                 observation, observation_model,
                                 predicted_observations,
                                 observation_noise):
    """Compute a posterior over states given an observation.

    Args:
      prior_state: Prior state mean [batch size x state dimension]
      prior_state_var: Prior state covariance [batch size x state dimension x
          state dimension]
      observation: The observed value corresponding to the predictions given
          [batch size x observation dimension]
      observation_model: The [batch size x observation dimension x model state
          dimension] Tensor indicating how a particular state is mapped to
          (pre-noise) observations for each part of the batch.
      predicted_observations: An (observation mean, observation variance) tuple
          computed based on the current state, usually the output of
          observed_from_state.
      observation_noise: A [batch size x observation dimension x observation
          dimension] or [observation dimension x observation dimension] Tensor
          with covariance matrices to use for each part of the batch (a
          two-dimensional input will be broadcast).
    Returns:
      Posterior mean and covariance (dimensions matching the first two
      arguments).

    """
    observed_mean, observed_var = predicted_observations
    residual = observation - observed_mean
    # TODO(allenl): Can more of this be done using matrix_solve_ls?
    kalman_solve_rhs = math_ops.matmul(
        observation_model, prior_state_var, adjoint_b=True)
    # This matrix_solve adjoint doesn't make a difference symbolically (since
    # observed_var is a covariance matrix, and should be symmetric), but
    # filtering on multivariate series is unstable without it. See
    # test_multivariate_symmetric_covariance_float64 in kalman_filter_test.py
    # for an example of the instability (fails with adjoint=False).
    kalman_gain_transposed = linalg_ops.matrix_solve(
        matrix=observed_var, rhs=kalman_solve_rhs, adjoint=True)
    posterior_state = prior_state + array_ops.squeeze(
        math_ops.matmul(
            kalman_gain_transposed,
            array_ops.expand_dims(residual, -1),
            adjoint_a=True),
        squeeze_dims=[-1])
    gain_obs = math_ops.matmul(
        kalman_gain_transposed, observation_model, adjoint_a=True)
    identity_extradim = linalg_ops.eye(
        array_ops.shape(gain_obs)[1], dtype=gain_obs.dtype)[None]
    identity_minus_factor = identity_extradim - gain_obs
    if self._simplified_posterior_covariance_computation:
      # posterior covariance =
      #   (I - kalman_gain * observation_model) * prior_state_var
      posterior_state_var = math_ops.matmul(identity_minus_factor,
                                            prior_state_var)
    else:
      observation_noise = ops.convert_to_tensor(observation_noise)
      # A Joseph form update, which provides better numeric stability than the
      # simplified optimal Kalman gain update, at the cost of a few extra
      # operations. Joseph form updates are valid for any gain (not just the
      # optimal Kalman gain), and so are more forgiving of numerical errors in
      # computing the optimal Kalman gain.
      #
      # posterior covariance =
      #   (I - kalman_gain * observation_model) * prior_state_var
      #     * (I - kalman_gain * observation_model)^T
      #   + kalman_gain * observation_noise * kalman_gain^T
      left_multiplied_state_var = math_ops.matmul(identity_minus_factor,
                                                  prior_state_var)
      multiplied_state_var = math_ops.matmul(
          identity_minus_factor, left_multiplied_state_var, adjoint_b=True)
      def _batch_observation_noise_update():
        return (multiplied_state_var + math_ops.matmul(
            math_ops.matmul(
                kalman_gain_transposed, observation_noise, adjoint_a=True),
            kalman_gain_transposed))
      def _matrix_observation_noise_update():
        return (multiplied_state_var + math_ops.matmul(
            math_utils.batch_times_matrix(
                kalman_gain_transposed, observation_noise, adj_x=True),
            kalman_gain_transposed))
      if observation_noise.get_shape().ndims is None:
        posterior_state_var = control_flow_ops.cond(
            math_ops.equal(array_ops.rank(observation_noise), 2),
            _matrix_observation_noise_update, _batch_observation_noise_update)
      else:
        # If static shape information exists, it gets checked in each cond()
        # branch, so we need a special case to avoid graph-build-time
        # exceptions.
        if observation_noise.get_shape().ndims == 2:
          posterior_state_var = _matrix_observation_noise_update()
        else:
          posterior_state_var = _batch_observation_noise_update()
    return posterior_state, posterior_state_var

  def observed_from_state(self, state_mean, state_var, observation_model,
                          observation_noise):
    """Compute an observation distribution given a state distribution.

    Args:
      state_mean: State mean vector [batch size x state dimension]
      state_var: State covariance [batch size x state dimension x state
          dimension]
      observation_model: The [batch size x observation dimension x model state
          dimension] Tensor indicating how a particular state is mapped to
          (pre-noise) observations for each part of the batch.
      observation_noise: A [batch size x observation dimension x observation
          dimension] Tensor with covariance matrices to use for each part of the
          batch. To remove observation noise, pass a Tensor of zeros (or simply
          0, which will broadcast).
    Returns:
      observed_mean: Observation mean vector [batch size x observation
          dimension]
      observed_var: Observation covariance [batch size x observation dimension x
          observation dimension]

    """
    observed_mean = array_ops.squeeze(
        math_ops.matmul(
            array_ops.expand_dims(state_mean, 1),
            observation_model,
            adjoint_b=True),
        squeeze_dims=[1])
    observed_var = math_ops.matmul(
        math_ops.matmul(observation_model, state_var),
        observation_model,
        adjoint_b=True)
    observed_var += observation_noise
    return observed_mean, observed_var


text:
"""Monkey's Audio streams with APEv2 tags.

Monkey's Audio is a very efficient lossless audio compressor developed
by Matt Ashland.

For more information, see http://www.monkeysaudio.com/.
"""

__all__ = ["MonkeysAudio", "Open", "delete"]

import struct

from ._compat import endswith
from mutagen import StreamInfo
from mutagen.apev2 import APEv2File, error, delete
from mutagen._util import cdata

class MonkeysAudioHeaderError(error):
    pass

class MonkeysAudioInfo(StreamInfo):
    """Monkey's Audio stream information.

    Attributes:

    * channels -- number of audio channels
    * length -- file length in seconds, as a float
    * sample_rate -- audio sampling rate in Hz
    * bits_per_sample -- bits per sample
    * version -- Monkey's Audio stream version, as a float (eg: 3.99)
    """

    def __init__(self, fileobj):
        header = fileobj.read(76)
        if len(header) != 76 or not header.startswith(b"MAC "):
            raise MonkeysAudioHeaderError("not a Monkey's Audio file")
        self.version = cdata.ushort_le(header[4:6])
        if self.version >= 3980:
            (blocks_per_frame, final_frame_blocks, total_frames,
             self.bits_per_sample, self.channels,
             self.sample_rate) = struct.unpack("<IIIHHI", header[56:76])
        else:
            compression_level = cdata.ushort_le(header[6:8])
            self.channels, self.sample_rate = struct.unpack(
                "<HI", header[10:16])
            total_frames, final_frame_blocks = struct.unpack(
                "<II", header[24:32])
            if self.version >= 3950:
                blocks_per_frame = 73728 * 4
            elif self.version >= 3900 or (self.version >= 3800 and
                                          compression_level == 4):
                blocks_per_frame = 73728
            else:
                blocks_per_frame = 9216
        self.version /= 1000.0
        self.length = 0.0
        if (self.sample_rate != 0) and (total_frames > 0):
            total_blocks = ((total_frames - 1) * blocks_per_frame +
                            final_frame_blocks)
            self.length = float(total_blocks) / self.sample_rate

    def pprint(self):
        return "Monkey's Audio %.2f, %.2f seconds, %d Hz" % (
            self.version, self.length, self.sample_rate)

class MonkeysAudio(APEv2File):
    _Info = MonkeysAudioInfo
    _mimes = ["audio/ape", "audio/x-ape"]

    @staticmethod
    def score(filename, fileobj, header):
        return header.startswith(b"MAC ") + endswith(filename.lower(), ".ape")

Open = MonkeysAudio


text:
if(EMSCRIPTEN)
  set(EMCC_FLAGS "${EMCC_FLAGS} -s USE_FREETYPE=1 -s USE_HARFBUZZ=1")
else()
  # Build FreeType without HarfBuzz to break the circular dependency
  set(FREETYPE_INCLUDE_DIR_freetype2 ${LOCAL_LIBRARY}/FreeType/include)
  set(FREETYPE_INCLUDE_DIR_ft2build ${THIRD_PARTY}/FreeType)
  add_library(freetype-bootstrap STATIC ${THIRD_PARTY}/FreeType/freetype.c)
  target_compile_definitions(freetype-bootstrap
    PRIVATE
      RAINBOW_BUILD_FREETYPE_WITHOUT_HARFBUZZ
  )
  target_include_directories(freetype-bootstrap
    PUBLIC
      ${FREETYPE_INCLUDE_DIR_ft2build}
      ${FREETYPE_INCLUDE_DIR_freetype2}
    PRIVATE
      ${LOCAL_LIBRARY}/FreeType/builds
      ${LOCAL_LIBRARY}/FreeType/src
  )

  # Build HarfBuzz with FreeType
  set(FREETYPE_LIBRARY freetype-bootstrap)
  set(HB_HAVE_FREETYPE ON CACHE INTERNAL "Enable freetype interop helpers")
  set(HB_BUILD_SUBSET OFF CACHE INTERNAL "Build harfbuzz-subset")
  set(HB_BUILD_TESTS OFF CACHE INTERNAL "Build harfbuzz tests")
  set(SKIP_INSTALL_ALL ON)
  add_subdirectory(${LOCAL_LIBRARY}/harfbuzz EXCLUDE_FROM_ALL)

  # Finally, build FreeType _with_ HarfBuzz
  add_library(freetype STATIC ${THIRD_PARTY}/FreeType/freetype.c)
  target_include_directories(freetype
    PUBLIC
      ${THIRD_PARTY}/FreeType
      ${LOCAL_LIBRARY}/FreeType/include
      ${LOCAL_LIBRARY}/harfbuzz/src
    PRIVATE
      ${LOCAL_LIBRARY}/FreeType/builds
      ${LOCAL_LIBRARY}/FreeType/src
  )

  add_dependencies(harfbuzz freetype-bootstrap)
  target_link_libraries(freetype harfbuzz)
  target_link_libraries(rainbow freetype)

  if(APPLE)
    find_library(COREGRAPHICS_FRAMEWORK CoreGraphics REQUIRED)
    find_library(CORETEXT_FRAMEWORK CoreText REQUIRED)
    target_link_libraries(rainbow ${CORETEXT_FRAMEWORK} ${COREGRAPHICS_FRAMEWORK})
  endif()
endif()


text:
package com.bjlx.QinShihuang.core.formatter.tripplan;

import com.bjlx.QinShihuang.core.formatter.activity.ActivityBasicSerializer;
import com.bjlx.QinShihuang.core.formatter.misc.AddressSerializer;
import com.bjlx.QinShihuang.core.formatter.misc.ContactSerializer;
import com.bjlx.QinShihuang.core.formatter.misc.ImageItemSerializer;
import com.bjlx.QinShihuang.core.formatter.poi.HotelBasicSerializer;
import com.bjlx.QinShihuang.core.formatter.poi.RestaurantBasicSerializer;
import com.bjlx.QinShihuang.core.formatter.poi.ShoppingBasicSerializer;
import com.bjlx.QinShihuang.core.formatter.poi.ViewspotBasicSerializer;
import com.bjlx.QinShihuang.model.activity.Activity;
import com.bjlx.QinShihuang.model.misc.Address;
import com.bjlx.QinShihuang.model.misc.Contact;
import com.bjlx.QinShihuang.model.misc.ImageItem;
import com.bjlx.QinShihuang.model.poi.Hotel;
import com.bjlx.QinShihuang.model.poi.Restaurant;
import com.bjlx.QinShihuang.model.poi.Shopping;
import com.bjlx.QinShihuang.model.poi.Viewspot;
import com.bjlx.QinShihuang.model.tripplan.TripItem;
import com.bjlx.QinShihuang.model.tripplan.TripPlan;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

public class TripPlanFormatter {
	public static ObjectMapper getMapper() {
        ObjectMapper mapper = new ObjectMapper();
        SimpleModule module = new SimpleModule();
        module.addSerializer(TripPlan.class, new TripPlanSerializer());
        module.addSerializer(TripItem.class, new TripItemSerializer());
        module.addSerializer(ImageItem.class, new ImageItemSerializer());
        module.addSerializer(Restaurant.class, new RestaurantBasicSerializer());
        module.addSerializer(Hotel.class, new HotelBasicSerializer());
        module.addSerializer(Viewspot.class, new ViewspotBasicSerializer());
        module.addSerializer(Shopping.class, new ShoppingBasicSerializer());
        module.addSerializer(Activity.class, new ActivityBasicSerializer());
        module.addSerializer(Contact.class, new ContactSerializer());
        module.addSerializer(Address.class, new AddressSerializer());
        mapper.registerModule(module);
        return mapper;
    }
}


text:
namespace StudentSystem.Services.Models.Homeworks
{
    using System;
    using System.ComponentModel.DataAnnotations;

    public class HomeworkRequestModel
    {
        [Required]
        [MaxLength(150)]
        public string Content { get; set; }

        public int CourseId { get; set; }

        public int StudentId { get; set; }
    }
}


text:
Sensor Map

Images

Readings

Graphs


text:
/*
 * ComBachelorprojekt.cpp
 *
 * function: UDP messaging protocol used in the Bachelorprojekt WS 2015/16
 *
 * author: Jannik Beyerstedt
 */

#include "ComBachelorprojekt.h"

//#include "DataFormats.h"
#include "Logger.h"

ComBachelorprojekt::ComBachelorprojekt(UdpSocketServer* socketServer) {
  LOG_SCOPE;

  socket = socketServer;
}

ComBachelorprojekt::~ComBachelorprojekt() {
  LOG_SCOPE;

  delete socket;
}

void ComBachelorprojekt::evaluate() {
  /*
   * evaluate remote input - remote control this software
   */
  std::string message;
  socket->evaluate();

  bool newMessage = socket->get_message(message);

  if (newMessage) {
    // shut down, if requested
    if (message.compare("exit")) {
      throw Error("remote exit command received"); // throw exception to abort/ exit application
    }
  }
}

void ComBachelorprojekt::sendData(Pos3D& position, char errorCode) {
  char positionData[MESSAGE_LEN];

  positionData[0] = 0xDA;
  positionData[1] = char(position.x >> 8);
  positionData[2] = char(position.x);
  positionData[3] = char(position.y >> 8);
  positionData[4] = char(position.y);
  positionData[5] = char(position.z >> 8);
  positionData[6] = char(position.z);
  positionData[7] = errorCode;

  socket->sendMessage(positionData, 8);
}


text:
var express = require('express'),
    openport = require('openport'),
    request = require('request'),
    assert = require('assert'),
    testServer = require('./test-server')

    session = require('../lib/middleware');

var port;
var host;
var server;

before(function(done) {
    testServer({
        secret: 'testSecret'
    }, function(serverPort, serverInstance) {
        port = serverPort;
        host = 'http://localhost:' + port;
        server = serverInstance;
        done();
    });
});

after(function() {
    server.close();
});

describe('lazy-sessions', function() {
    it('does not create sessions on first request', function(done) {
        request(host + '/', {}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);
            assert.equal(resp.headers['set-cookie'], undefined);
            done(err);
        });
    });

    it('creates sessions correctly', function(done) {
        request(host + '/session', {}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);
            assert.equal(1, resp.headers['set-cookie'].length);
            assert.equal(0, resp.headers['set-cookie'][0].indexOf('sessionId=c'));
            done(err);
        });
    });

    it('stores data between requests in a sesions', function(done) {
        var jar = request.jar();
        request.post(host + '/store', {jar: jar}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);

            request(host + '/session', {jar: jar}, function(err, resp, data) {
                assert.equal(resp.statusCode, 200);
                assert.equal(data, '{"cookie":{"maxAge":null},"testing":"123"}');
                done(err);
            });
        });
    });

    it('does not expose others sessions', function(done) {
        request(host + '/session', {jar: false}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);
            assert.equal(data, '{"cookie":{"maxAge":null}}');
            done(err);
        });
    });

    it('rejects tampered session cookies', function(done) {
        var jar = request.jar();
        request.post(host + '/store', {jar: jar}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);

            var cookie = request.cookie(resp.headers['set-cookie'][0]);
            var parts = cookie.value.split('.');
            parts[0] = 'nonsense';
            cookie.value = parts.join('.');

            jar.add(cookie);

            request(host + '/session', {jar: jar}, function(err, resp, data) {
                assert.equal(resp.statusCode, 500);
                assert.equal(1, resp.headers['set-cookie'].length);
                assert.equal('sessionId=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT', resp.headers['set-cookie'][0]);
                done(err);
            });

        });
    });

    it('destroys sessions correctly', function(done) {
        request.post(host + '/destroy', {}, function(err, resp, data) {
            assert.equal(resp.statusCode, 200);
            assert.equal(1, resp.headers['set-cookie'].length);
            assert.equal('sessionId=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT', resp.headers['set-cookie'][0]);
            done(err);
        });
    });

    it('does not create sessions when destroying sessions', function(done) {
        var jar = request.jar();
        request.post(host + '/destroy', {jar: jar}, function (err, resp, data) {
            assert.equal(resp.statusCode, 200);
            assert.equal(1, resp.headers['set-cookie'].length);
            done(err);
        });
    });

    describe('with time based session expiry', function() {
        var port, server, host;
        before(function(done) {
            testServer({
                secret: 'testSecret',
                maxAge: 1000 * 60 * 15 //15 mins
            }, function(serverPort, serverInstance) {
                port = serverPort;
                host = 'http://localhost:' + port;
                server = serverInstance;
                done();
            });
        });

        after(function() {
            server.close();
        });

        it('touches the session cookie on requests', function(done) {
            request(host + '/session', {}, function(err, resp, data) {
                assert.equal(resp.statusCode, 200);
                assert.equal(1, resp.headers['set-cookie'].length);
                assert.equal(0, resp.headers['set-cookie'][0].indexOf('sessionId=c'));

                request(host, {}, function(err, resp, data) {
                    assert.equal(resp.statusCode, 200);
                    assert.equal(1, resp.headers['set-cookie'].length);
                    assert.equal(0, resp.headers['set-cookie'][0].indexOf('sessionId=c'));
                    done(err);
                });
            });
        });
    });
});


text:
package gocb

import (
	"sync"
	"time"

	gocbcore "github.com/couchbase/gocbcore/v8"
	"github.com/pkg/errors"
)

type client interface {
	Hash() string
	connect() error
	buildConfig() error
	getKvProvider() (kvProvider, error)
	getViewProvider() (viewProvider, error)
	getQueryProvider() (queryProvider, error)
	getAnalyticsProvider() (analyticsProvider, error)
	getSearchProvider() (searchProvider, error)
	getHTTPProvider() (httpProvider, error)
	getDiagnosticsProvider() (diagnosticsProvider, error)
	close() error
	setBootstrapError(err error)
	selectBucket(bucketName string) error
	supportsGCCCP() bool
	connected() bool
	getBootstrapError() error
}

type stdClient struct {
	cluster      *Cluster
	state        clientStateBlock
	lock         sync.Mutex
	agent        *gocbcore.Agent
	bootstrapErr error
	isConnected  bool
	config       *gocbcore.AgentConfig
}

func newClient(cluster *Cluster, sb *clientStateBlock) *stdClient {
	client := &stdClient{
		cluster: cluster,
		state:   *sb,
	}
	return client
}

func (c *stdClient) Hash() string {
	return c.state.Hash()
}

func (c *stdClient) buildConfig() error {
	c.lock.Lock()
	defer c.lock.Unlock()

	breakerCfg := c.cluster.sb.CircuitBreakerConfig

	var completionCallback func(err error) bool
	if breakerCfg.CompletionCallback != nil {
		completionCallback = func(err error) bool {
			wrappedErr := maybeEnhanceKVErr(err, c.state.BucketName, "", "", "")
			return breakerCfg.CompletionCallback(wrappedErr)
		}
	}

	config := &gocbcore.AgentConfig{
		UserAgent:              Identifier(),
		ConnectTimeout:         c.cluster.sb.ConnectTimeout,
		UseMutationTokens:      c.cluster.sb.UseMutationTokens,
		KVConnectTimeout:       7000 * time.Millisecond,
		UseDurations:           c.cluster.sb.UseServerDurations,
		UseCollections:         true,
		BucketName:             c.state.BucketName,
		UseZombieLogger:        c.cluster.sb.OrphanLoggerEnabled,
		ZombieLoggerInterval:   c.cluster.sb.OrphanLoggerInterval,
		ZombieLoggerSampleSize: int(c.cluster.sb.OrphanLoggerSampleSize),
		NoRootTraceSpans:       true,
		Tracer:                 &requestTracerWrapper{c.cluster.sb.Tracer},
		CircuitBreakerConfig: gocbcore.CircuitBreakerConfig{
			Enabled:                  !breakerCfg.Disabled,
			VolumeThreshold:          breakerCfg.VolumeThreshold,
			ErrorThresholdPercentage: breakerCfg.ErrorThresholdPercentage,
			SleepWindow:              breakerCfg.SleepWindow,
			RollingWindow:            breakerCfg.RollingWindow,
			CanaryTimeout:            breakerCfg.CanaryTimeout,
			CompletionCallback:       completionCallback,
		},
	}

	err := config.FromConnStr(c.cluster.connSpec().String())
	if err != nil {
		return err
	}

	config.Auth = &coreAuthWrapper{
		auth: c.cluster.authenticator(),
	}

	c.config = config
	return nil
}

func (c *stdClient) connect() error {
	c.lock.Lock()
	defer c.lock.Unlock()
	agent, err := gocbcore.CreateAgent(c.config)
	if err != nil {
		return maybeEnhanceKVErr(err, c.state.BucketName, "", "", "")
	}

	c.agent = agent
	c.isConnected = true
	return nil
}

func (c *stdClient) setBootstrapError(err error) {
	c.bootstrapErr = err
}

func (c *stdClient) getBootstrapError() error {
	return c.bootstrapErr
}

func (c *stdClient) getKvProvider() (kvProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getViewProvider() (viewProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getQueryProvider() (queryProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getAnalyticsProvider() (analyticsProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getSearchProvider() (searchProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getHTTPProvider() (httpProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	if c.agent == nil {
		return nil, errors.New("cluster not yet connected")
	}
	return c.agent, nil
}

func (c *stdClient) getDiagnosticsProvider() (diagnosticsProvider, error) {
	if c.bootstrapErr != nil {
		return nil, c.bootstrapErr
	}

	return c.agent, nil
}

func (c *stdClient) connected() bool {
	return c.isConnected
}

func (c *stdClient) selectBucket(bucketName string) error {
	return c.agent.SelectBucket(bucketName, time.Now().Add(c.cluster.sb.ConnectTimeout))
}

func (c *stdClient) supportsGCCCP() bool {
	return c.agent.UsingGCCCP()
}

func (c *stdClient) close() error {
	c.lock.Lock()
	if c.agent == nil {
		c.lock.Unlock()
		return errors.New("cluster not yet connected")
	}
	c.isConnected = false
	c.lock.Unlock()
	return c.agent.Close()
}


text:
<!DOCTYPE html>
<title>Service Worker: Interfaces</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/interfaces.js"></script>
<script src="resources/test-helpers.js"></script>
<script>

test(function() {
    verifyInterface(
      'ServiceWorkerContainer', navigator.serviceWorker,
      {
        register: 'function',
        getRegistration: 'function'
      });
  }, 'Interfaces and attributes of ServiceWorkerContainer');

async_test(function(t) {
    var EVENT_HANDLER = 'object';
    var scope = 'scope/interfaces-and-attributes';
    var registration;

    service_worker_unregister_and_register(
        t, 'resources/empty-worker.js', scope)
      .then(function(r) {
          registration = r;
          verifyInterface(
            'ServiceWorkerRegistration', registration,
            {
              installing: 'object',
              waiting: 'object',
              active: 'object',
              scope: 'string',
              unregister: 'function',
              onupdatefound: EVENT_HANDLER
            });
          return wait_for_update(t, registration);
        })
      .then(function(worker) {
          verifyInterface(
            'ServiceWorker', worker,
            {
              scriptURL: 'string',
              state: 'string',
              terminate: 'function',
              onstatechange: EVENT_HANDLER
            });
          return registration.unregister();
        })
      .then(function() {
          t.done();
        })
      .catch(unreached_rejection(t));
  }, 'Interfaces and attributes of ServiceWorker');

service_worker_test(
  'resources/interfaces-worker.js',
  'Interfaces and attributes in ServiceWorkerGlobalScope');

</script>