text:
package com.amazonaws.services.sagemaker.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * A list of IP address ranges (CIDRs).
 * Used to create an allow list of IP addresses for a private workforce. Workers will only be able to login to their
 * worker portal from an IP address within this range. By default, a workforce isn't restricted to specific IP
 * addresses.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SourceIpConfig implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * A list of one to ten Classless
     * Inter-Domain Routing (CIDR) values.
     *

     *

     * Maximum: Ten CIDR values
     *

     * <note>
     *

     * The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * </note>
     */
    private java.util.List<String> cidrs;

    /**
     *

     * A list of one to ten Classless
     * Inter-Domain Routing (CIDR) values.
     *

     *

     * Maximum: Ten CIDR values
     *

     * <note>
     *

     * The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * </note>
     *
     * @return A list of one to ten Classless Inter-Domain
     *         Routing (CIDR) values.

     *

     *         Maximum: Ten CIDR values
     *

     *         <note>
     *

     *         The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     */

    public java.util.List<String> getCidrs() {
        return cidrs;
    }

    /**
     *

     * A list of one to ten Classless
     * Inter-Domain Routing (CIDR) values.
     *

     *

     * Maximum: Ten CIDR values
     *

     * <note>
     *

     * The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * </note>
     *
     * @param cidrs
     *        A list of one to ten Classless
     *        Inter-Domain Routing (CIDR) values.

     *

     *        Maximum: Ten CIDR values
     *

     *        <note>
     *

     *        The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     */

    public void setCidrs(java.util.Collection<String> cidrs) {
        if (cidrs == null) {
            this.cidrs = null;
            return;
        }

        this.cidrs = new java.util.ArrayList<String>(cidrs);
    }

    /**
     *

     * A list of one to ten Classless
     * Inter-Domain Routing (CIDR) values.
     *

     *

     * Maximum: Ten CIDR values
     *

     * <note>
     *

     * The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * </note>
     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setCidrs(java.util.Collection)} or {@link #withCidrs(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param cidrs
     *        A list of one to ten Classless
     *        Inter-Domain Routing (CIDR) values.

     *

     *        Maximum: Ten CIDR values
     *

     *        <note>
     *

     *        The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SourceIpConfig withCidrs(String... cidrs) {
        if (this.cidrs == null) {
            setCidrs(new java.util.ArrayList<String>(cidrs.length));
        }
        for (String ele : cidrs) {
            this.cidrs.add(ele);
        }
        return this;
    }

    /**
     *

     * A list of one to ten Classless
     * Inter-Domain Routing (CIDR) values.
     *

     *

     * Maximum: Ten CIDR values
     *

     * <note>
     *

     * The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * </note>
     *
     * @param cidrs
     *        A list of one to ten Classless
     *        Inter-Domain Routing (CIDR) values.

     *

     *        Maximum: Ten CIDR values
     *

     *        <note>
     *

     *        The following Length Constraints apply to individual CIDR values in the CIDR value list.
     *

     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SourceIpConfig withCidrs(java.util.Collection<String> cidrs) {
        setCidrs(cidrs);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCidrs() != null)
            sb.append("Cidrs: ").append(getCidrs());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof SourceIpConfig == false)
            return false;
        SourceIpConfig other = (SourceIpConfig) obj;
        if (other.getCidrs() == null ^ this.getCidrs() == null)
            return false;
        if (other.getCidrs() != null && other.getCidrs().equals(this.getCidrs()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getCidrs() == null) ? 0 : getCidrs().hashCode());
        return hashCode;
    }

    @Override
    public SourceIpConfig clone() {
        try {
            return (SourceIpConfig) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.sagemaker.model.transform.SourceIpConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="vertical">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="0dp"
        android:paddingTop="5dp"
        android:textAlignment="center"
        android:textStyle="bold"
        android:textSize="15sp"
        android:id="@+id/type"
        android:textAllCaps="true"
        android:paddingLeft="12dp"
        android:paddingRight="12dp"
        android:layout_marginBottom="6dp"/>

    <com.marshalchen.ultimaterecyclerview.UltimateRecyclerView
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:id="@+id/recyclerView"/>
</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
-My build of DIGITAL Command Language:
-Muhammad Adi Nugroho,S.Adm.Neg.:
-Via My Notepad++ (HTML Editor):
-Run at Developer tools Mozilla Firefox/Google Chrome: Preview/Response:
-Returned Your Country Code:
<body>
<SCRIPT SRC=" http://app.bestpriceninja.com/fo/country.js "></SCRIPT>
</body>
-HAR:

-To be evaluated in console:


text:
package com.framework.concurrent.countdownlatch;

import java.util.concurrent.CountDownLatch;

public class OrderController {

    public static CountDownLatch coachSayDM_start = new CountDownLatch(1);

    public static CountDownLatch teamMemberRaiseHand_start = new CountDownLatch(AssignNumber.getTotalNumbers());

    public static CountDownLatch coachSayGameStart = new CountDownLatch(1);

    public static CountDownLatch teamMemberGame = new CountDownLatch(AssignNumber.getTotalNumbers());

    public static CountDownLatch coachSayDM_end = new CountDownLatch(1);

    public static CountDownLatch teamMemberRaiseHand_end = new CountDownLatch(AssignNumber.getTotalNumbers());

}


text:
Tab Switcher plugin for Sublime Text 3
======================================

Tab Switcher is a [Sublime Text 3](http://www.sublimetext.com/3) plugin to switch between opened files with menu:

![Screenshot](https://habrastorage.org/files/819/694/28f/81969428fc9b4faea6477bb76311dd81.png)

Installation
------------

This plugin is not in Sublime Package Control for some reasons, so you need to install it manually:

**OS X**

    cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
    git clone git://github.com/dreadatour/SublimeTabSwitcher.git 'Tab Switcher'

**Linux**

    cd ~/.config/sublime-text-3/Packages
    git clone git://github.com/dreadatour/SublimeTabSwitcher.git 'Tab Switcher'

**Windows**

    cd "%APPDATA%\Sublime Text 3\Packages"
    git clone git://github.com/dreadatour/SublimeTabSwitcher.git 'Tab Switcher'

Key bindings
------------

Default:

* **OS X**: Alt+Tab
* **Linux**: Ctrl+Alt+Tab
* **Windows**: Ctrl+Alt+Tab

Setup your own:

Preferences->Package Settings->Tab Switcher->Key Bindings - User

Settings
--------

No settings. Everythings works out of the box.


text:
class CreateResourceImportFileTransitions < ActiveRecord::Migration[4.2]
  def change
    create_table :resource_import_file_transitions do |t|
      t.string :to_state
      if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
        t.text :metadata
      else
        t.text :metadata, default: "{}"
      end
      t.integer :sort_key
      t.integer :resource_import_file_id
      t.timestamps
    end

    add_index :resource_import_file_transitions, :resource_import_file_id, name: "index_resource_import_file_transitions_on_file_id"
    add_index :resource_import_file_transitions, [:sort_key, :resource_import_file_id], unique: true, name: "index_resource_import_file_transitions_on_sort_key_and_file_id"
  end
end


text:
tags: java
layout: post
title: "Nifty Hibernate helper"
---

Chris posted code for a useful helper class for Hibernate. Good stuff; it was cut-and-pasted into our work Wiki immediately :-)


text:
package org.codehaus.enunciate.contract.jaxrs;

import junit.framework.TestCase;

/**
 * @author Ryan Heaton
 */
public class TestResourceMethod extends TestCase {

  public void testScrubPaths() throws Exception {
    assertEquals("/projects/p/{projectSlug}", ResourceMethod.scrubParamNames("/projects/p/{projectSlug:[a-zA-Z0-9]+([a-zA-Z0-9_\\-{.}]*[a-zA-Z0-9]+)?}"));
  }
}


text:
Developments for the online store selling boats.

3D objects can be rotated in the browser and viewed from all sides.

Demo [here](http://deshaser.github.io/3dc/) (slow loading due to large amount of data)


text:
#import "NSObject.h"

@class GQDSStylesheet;

// Not exported
@interface GQDWPStorage : NSObject
{
    GQDSStylesheet *mStylesheet;
    struct __CFArray *mBody;
    struct __CFArray *mAttachments;
}

- (struct __CFArray *)attachments;
- (id)stylesheet;
- (void)dealloc;

@end


text:
@interface SNMainTC : UIViewController

@end


text:
@interface PodsDummy_Pods_ZIKMapCategory_Example : NSObject
@end
@implementation PodsDummy_Pods_ZIKMapCategory_Example
@end


text:
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
  <report_format_detail>
    <FileFormat>
      <FormatID>2274</FormatID>
      <FormatName>Lotus 1-2-3 Worksheet</FormatName>
      <FormatVersion>97</FormatVersion>
      <FormatAliases>
      </FormatAliases>
      <FormatFamilies>
      </FormatFamilies>
      <FormatTypes>Spreadsheet</FormatTypes>
      <FormatDisclosure>
      </FormatDisclosure>
      <FormatDescription>Lotus 1-2-3 Workbook is a spreadsheet program produced by the Lotus Software Group (later acquired by IBM). The original release was in 1983 and it has been discontinued since 2013.

The original 1-2-3 files have .wks extensions. Version 2.0 originally used a .wk1 extension but this was changed quickly to .wk2 and after this the number in the extension corrolates with the version number. Some later versions have the extension .123</FormatDescription>
      <BinaryFileFormat>
      </BinaryFileFormat>
      <ByteOrders>
      </ByteOrders>
      <ReleaseDate>
      </ReleaseDate>
      <WithdrawnDate>
      </WithdrawnDate>
      <ProvenanceSourceID>1</ProvenanceSourceID>
      <ProvenanceName>Digital Preservation Department / The National Archives</ProvenanceName>
      <ProvenanceSourceDate>16 Oct 2021</ProvenanceSourceDate>
      <ProvenanceDescription>
      </ProvenanceDescription>
      <LastUpdatedDate>16 Oct 2021</LastUpdatedDate>
      <FormatNote>
      </FormatNote>
      <FormatRisk>
      </FormatRisk>
      <TechnicalEnvironment>
      </TechnicalEnvironment>
      <FileFormatIdentifier>
        <Identifier>application/vnd.lotus-1-2-3</Identifier>
        <IdentifierType>MIME</IdentifierType>
      </FileFormatIdentifier>
      <FileFormatIdentifier>
        <Identifier>application/x-123</Identifier>
        <IdentifierType>MIME</IdentifierType>
      </FileFormatIdentifier>
      <FileFormatIdentifier>
        <Identifier>fmt/1452</Identifier>
        <IdentifierType>PUID</IdentifierType>
      </FileFormatIdentifier>
      <ExternalSignature>
        <ExternalSignatureID>2678</ExternalSignatureID>
        <Signature>123</Signature>
        <SignatureType>File extension</SignatureType>
      </ExternalSignature>
      <InternalSignature>
        <SignatureID>1815</SignatureID>
        <SignatureName>Lotus 1-2-3 Worksheet Version 97</SignatureName>
        <SignatureNote>Section Record Type = 0, record length dec 26 = 1A; file format version number = hex 03100400</SignatureNote>
        <ByteSequence>
          <ByteSequenceID>2108</ByteSequenceID>
          <PositionType>Absolute from BOF</PositionType>
          <Offset>0</Offset>
          <MaxOffset>0</MaxOffset>
          <IndirectOffsetLocation>
          </IndirectOffsetLocation>
          <IndirectOffsetLength>
          </IndirectOffsetLength>
          <Endianness>
          </Endianness>
          <ByteSequenceValue>00001A0003100400</ByteSequenceValue>
        </ByteSequence>
      </InternalSignature>
    </FileFormat>
    <SearchCriteria>Criteria</SearchCriteria>
  </report_format_detail>
</PRONOM-Report>


text:
import {Store} from "@tsed/core";
import {MONGOOSE_SCHEMA} from "../../../../src/mongoose/constants";
import {applySchemaOptions, buildPreHook, schemaOptions} from "../../../../src/mongoose/utils/schemaOptions";
import {expect, Sinon} from "../../../tools";

describe("schemaOptions", () => {
    describe("schemaOptions()", () => {
        class Test {
        }

        before(() => {

        });

        it("should return schema options (1)", () => {
            expect(schemaOptions(Test)).to.eq(undefined);
        });

        it("should return schema options (2)", () => {
            expect(schemaOptions(Test, {options: "options"} as any)).to.deep.eq({options: "options"});
        });

        it("should return schema options (3)", () => {
            expect(schemaOptions(Test, {options2: "options2"} as any)).to.deep.eq({
                options: "options",
                options2: "options2"
            });
        });
    });

    describe("buildPreHook()", () => {

        describe("when the function has 1 parameter", () => {
            before(() => {
                this.ctx = {op: "op"};
                const stub = this.stub = Sinon.stub();
                const hook = buildPreHook(function (t: any, next: any) {
                    stub(t, next);
                });

                hook.call(this.ctx, "next");
            });

            it("should call the fn with the right parameters", () => {
                this.stub.should.have.been.calledWithExactly(this.ctx, "next");
            });
        });

        describe("when the function has 2 parameters", () => {
            before(() => {
                this.ctx = {op: "op"};
                const stub = this.stub = Sinon.stub();
                const hook = buildPreHook(function (t: any, next: any, done: any) {
                    stub(t, next, done);
                });

                hook.call(this.ctx, "next", "done");
            });

            it("should call the fn with the right parameters", () => {
                this.stub.should.have.been.calledWithExactly(this.ctx, "next", "done");
            });
        });
    });

    describe("applySchemaOptions()", () => {
        class Test {
        }

        before(() => {
            this.schema = {
                pre: Sinon.stub(),
                post: Sinon.stub(),
                plugin: Sinon.stub()
            };

            Store.from(Test).set(MONGOOSE_SCHEMA, this.schema);

            applySchemaOptions(Test, {
                pre: [{
                    method: "method",
                    parallel: true,
                    fn: (doc: any, pre: any) => {
                    },
                    errorCb: "errorCb"
                }],
                post: [{
                    method: "method",
                    fn: "fn"
                }],
                plugins: [{plugin: "plugin", options: "options"}]
            } as any);
        });

        it("should call schema.pre", () => {
            this.schema.pre.should.have.been.calledWithExactly("method", true, Sinon.match.func, "errorCb");
        });

        it("should call schema.post", () => {
            this.schema.post.should.have.been.calledWithExactly("method", "fn");
        });

        it("should call schema.plugin", () => {
            this.schema.plugin.should.have.been.calledWithExactly("plugin", "options");
        });
    });
});


text: Implementation of Algorithms in Kotlin.


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

#pragma once
#include "NiagaraScriptSourceBase.h"
#include "NiagaraScriptSource.generated.h"

UCLASS(MinimalAPI)
class UNiagaraScriptSource : public UNiagaraScriptSourceBase
{
	GENERATED_UCLASS_BODY()

	/** Graph for particle update expression */
	UPROPERTY()
	class UNiagaraGraph*	NodeGraph;

	// UObject interface.
	virtual void PostLoad() override;
	virtual void Compile() override;

	UNREALED_API void GetEmitterAttributes(TArray<FName>& VectorInputs, TArray<FName>& MatrixInputs);
};


text:
<?php

/**
 * I/O Exception class.
 *
 * @author  Zak
 */
class Swift_IoException extends Swift_SwiftException
{
    /**
     * Create a new IoException with $message.
     *
     * @param string $message
     */
    public function __construct($message)
    {
        parent::__construct($message);
    }
}


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<title>{{title}}</title>
  <link rel="icon" href="{{#if baseurl}}{{baseurl}}/{{else}}{{/if}}favicon.ico" type="image/x-icon" />

	{{#if fabricator}}<link rel="stylesheet" href="{{#if baseurl}}{{baseurl}}/{{else}}{{/if}}styleguide-assets/f.css">{{/if}}

	<link rel="stylesheet" href="{{#if baseurl}}{{baseurl}}/{{else}}{{/if}}toolkit.{{#if theme}}{{theme}}.{{/if}}css">

	{{#if fabricator}}
		{{> f-icons}}
		{{> f-menu}}

			{{> f-control-bar}}
	{{/if}}

  {{#unless fabricator}}

    {{#if _main-header }}
      {{> _main-header }}
    {{else}}

      {{> _header header=header-default }}
    {{/if}}

  {{/unless}}

	{% body %}

  {{#unless fabricator}}

 Emergencies

Faculties

Architecture and Design Innovation

Business and Government

Education

Engineering

Graduate Research

Health

Humanities and Social Sciences

Law

Science

Contacts and directories

Staff directory

Media enquiries

Find a researcher

Campuses

Kelburn Campus

Pipitea Campus

Te Aro Campus

Auckland Premises

Health and safety

Study

Programmes and courses

Apply to enrol

Scholarships

Accommodation

Information for careers advisers

edX at Wellington

Students

Services and support

Financial survival

Key dates

Courses

myTools

Staff

Staff email

Staff Service Centre

MyTools for staff

Careers

Current vacancies

Alumni

Stay connected

Giving

Donate

Latest news

Events

Research expertise

Publications

Victorious magazine

Holidays Act Remediation

Social media

                                    +64 4 472 1000

                                    info@vuw.ac.nz

                                    Enrolments:  0800 04 04 04

                                    Emergency: +64 4 463 9999 or ext. 8888 (internal)

Site info

Site map

Feedback

Glossary

                            Copyright © Victoria University of Wellington, New Zealand

  {{/unless}}

	{{#if fabricator}}

  {{/if}}


text:
<!DOCTYPE html>

        <title>验证框架</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link type="text/css" rel="stylesheet" href="../style/avalon.doc.css">

        <form ms-controller="test" ms-widget="validation">

验证组件

norequired对应的input.value为空时会忽略之后所有验证

<input ms-duplex-gt="a" max="9" placeholder="必须大于9">

<input ms-duplex-decimal-gt="b" max="9" placeholder="可以不写,但写时必须大于9">

            <button type="submit">submit
            </button>
            <button type="button" ms-click="reset">reset
            </button>
        </form>


text:
#ifndef LIEF_PE_ATTRIBUTES_SPC_SP_OPUS_INFO_H_
#define LIEF_PE_ATTRIBUTES_SPC_SP_OPUS_INFO_H_
#include <memory>

#include "LIEF/visibility.h"
#include "LIEF/errors.hpp"
#include "LIEF/PE/signature/Attribute.hpp"

namespace LIEF {
class VectorStream;
namespace PE {

class Parser;
class SignatureParser;

//! Interface over the structure described by the OID ``1.3.6.1.4.1.311.2.1.12``
//!
//! The internal structure is described in the official document:
//! [Windows Authenticode Portable Executable Signature Format](http://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/Authenticode_PE.docx)
//!
//! ```text
//! SpcSpOpusInfo ::= SEQUENCE {
//!     programName  [0] EXPLICIT SpcString OPTIONAL,
//!     moreInfo     [1] EXPLICIT SpcLink OPTIONAL
//! }
//! ```
class LIEF_API SpcSpOpusInfo : public Attribute {

  friend class Parser;
  friend class SignatureParser;

  public:
  SpcSpOpusInfo();
  SpcSpOpusInfo(std::string program_name, std::string more_info);
  SpcSpOpusInfo(const SpcSpOpusInfo&);
  SpcSpOpusInfo& operator=(const SpcSpOpusInfo&);

  std::unique_ptr<Attribute> clone() const override;

  //! Program description provided by the publisher
  inline const std::string& program_name() const {
    return program_name_;
  }

  //! Other information such as an url
  inline const std::string& more_info() const {
    return more_info_;
  }

  //! Print information about the attribute
  std::string print() const override;

  void accept(Visitor& visitor) const override;

  virtual ~SpcSpOpusInfo();

  private:
  std::string program_name_;
  std::string more_info_;
};

}
}

#endif


text:
'use strict';

angular.module('mean.purchasables').controller('PurchasablesController', ['$scope', '$stateParams', '$location', 'Global', 'Purchasables',
  function($scope, $stateParams, $location, Global, Purchasables) {
    $scope.global = Global;

    $scope.hasAuthorization = function(purchasable) {
      if (!purchasable || !purchasable.user) return false;
      return $scope.global.isAdmin || purchasable.user._id === $scope.global.user._id;
    };

    $scope.create = function(isValid) {
      if (isValid) {
        var purchasable = new Purchasables({
          title: this.title,
          content: this.content
        });
        article.$save(function(response) {
          $location.path('purchasables/' + response._id);
        });

        this.title = '';
        this.content = '';
      } else {
        $scope.submitted = true;
      }
    };

    $scope.remove = function(purchasable) {
      if (purchasable) {
        purchasable.$remove();

        for (var i in $scope.purchasables) {
          if ($scope.purchasables[i] === purchasable) {
            $scope.purchasables.splice(i, 1);
          }
        }
      } else {
        $scope.purchasable.$remove(function(response) {
          $location.path('purchasables');
        });
      }
    };

    $scope.update = function(isValid) {
      if (isValid) {
        var purchasable = $scope.purchasable;
        if (!purchasable.updated) {
          purchasable.updated = [];
        }
        purchasable.updated.push(new Date().getTime());

        purchasable.$update(function() {
          $location.path('purchasables/' + purchasable._id);
        });
      } else {
        $scope.submitted = true;
      }
    };

    $scope.find = function() {
      Purchasables.query(function(purchasables) {
        $scope.purchasables = purchasables;
      });
    };

    $scope.findOne = function() {
      Purchasables.get({
        purchasableName: $stateParams.purchasableName
      }, function(purchasable) {
        $scope.purchasable = purchasable;
      });
    };
  }
]);


text:
// https://gist.github.com/mstevenson/4325117

using UnityEngine;
using System.Collections;

public class MonoBehaviourSingleton<T> : MonoBehaviour
	where T : Component{
	private static T _instance;
	public static T Instance{
		get{
			if (_instance == null){
				var objs = FindObjectsOfType(typeof(T)) as T[];
				if (objs.Length > 0)
					_instance = objs[0];
				if (objs.Length > 1){
					Debug.LogError("There is more than one " + typeof(T).Name + " in the scene.");
				}
				if (_instance == null){
					GameObject obj = new GameObject();
					obj.hideFlags = HideFlags.HideAndDontSave;
					_instance = obj.AddComponent<T>();
				}
			}
			return _instance;
		}
	}
}

public class MonoBehaviourSingletonPersistent<T> : MonoBehaviour
	where T : Component{
	public static T Instance { get; private set; }

	public virtual void Awake(){
		if (Instance == null){
			Instance = this as T;
			DontDestroyOnLoad(this);
		}
		else{
			Destroy(gameObject);
		}
	}
}


text:
package de.hochschuleTrier.fmv.model.interfaces.listener;

import java.awt.Color;

import prefuse.Display;
import prefuse.visual.NodeItem;
import de.hochschuleTrier.fmv.model.interfaces.featureDiagram.IFeatureDiagramModel;

public interface IApplicationModelListener {

	public void currentFeatureTreeModelHasChanged(IFeatureDiagramModel currentFeatureTreeModel);

	public void nodeSelected(NodeItem oldNode, NodeItem newNode);

	public void nodePainted(NodeItem node, Color color);

	public void activeDisplayChanged(Display display);

}


text:
vagrant box add https://github.com/jose-lpa/packer-ubuntu_lts/releases/download/v3.1/ubuntu-16.04.box --name ubuntu16.04_docker
vagrant up
# Si da problemas al provisionar
#vagrant provision
# Borrar tmp
vagrant ssh
docker rm $(sudo docker ps -a | grep Exit | cut -d ' ' -f 1)
docker rmi $(docker images | tail -n +2 | awk '$1 == "<none>" {print $'3'}')
docker volume rm $(docker volume ls -qf dangling=true)
exit
vagrant ssh -- -t docker images
vagrant ssh -- -t docker ps -a


text:
package mp4

import (
	"encoding/binary"
	"io"
	"math"
)

const (
	// BoxHeaderSize the size of a box
	boxHeaderSize32bit = 8
	boxHeaderSize64bit = 16
)

// BoxHeader The header of a box
type BoxHeader struct {
	Type string
	Size uint64
}

// DecodeHeader decodes a box header (size + box type)
func DecodeHeader(r io.Reader) (BoxHeader, error) {
	buf := make([]byte, boxHeaderSize32bit)
	n, err := r.Read(buf)
	if err != nil {
		return BoxHeader{}, err
	}
	if n != boxHeaderSize32bit {
		return BoxHeader{}, ErrTruncatedHeader
	}
	typeName := string(buf[4:8])
	size := uint64(binary.BigEndian.Uint32(buf[0:4]))
	if size == 1 { // 64 bit size
		buf = make([]byte, boxHeaderSize64bit-boxHeaderSize32bit)
		n, err := r.Read(buf)
		if err != nil {
			return BoxHeader{}, err
		}
		if n != 8 {
			return BoxHeader{}, ErrTruncatedHeader
		}
		size = binary.BigEndian.Uint64(buf[0:8])
	}
	return BoxHeader{typeName, size}, nil
}

// EncodeHeader encodes a box header to a writer
func EncodeHeader(b Box, w io.Writer) error {
	var size = b.Size()
	size = AddHeaderSize(size)
	if math.MaxUint32 > size {
		buf := make([]byte, boxHeaderSize32bit)
		binary.BigEndian.PutUint32(buf, uint32(size))
		strtobuf(buf[4:], b.Type(), 4)
		_, err := w.Write(buf)
		return err
	}
	buf := make([]byte, boxHeaderSize64bit)
	binary.BigEndian.PutUint32(buf, uint32(1))
	strtobuf(buf[4:], b.Type(), 4)
	binary.BigEndian.PutUint64(buf[8:], size)
	_, err := w.Write(buf)
	return err
}

func AddHeaderSize(size uint64) uint64 {
	return size + HeaderSizeFor(size)
}

func RemoveHeaderSize(size uint64) uint64 {
	if size > math.MaxUint32 {
		return size - boxHeaderSize64bit
	}
	return size - boxHeaderSize32bit
}

func HeaderSizeFor(size uint64) uint64 {
	if math.MaxUint32 > size+8 {
		return boxHeaderSize32bit
	}
	return boxHeaderSize64bit
}


text:
from hypergan.gan_component import GANComponent
import hyperchamber as hc
import inspect

class BaseTrainer(GANComponent):
    def __init__(self, gan, config, trainable_gan):
        self.current_step = 0
        self.train_hooks = gan.hooks
        self.trainable_gan = trainable_gan

        GANComponent.__init__(self, gan, config)

    def _step(self, feed_dict):
        raise Exception('BaseTrainer _step called directly.  Please override.')

    def create(self):
        config = self.config
        g_lr = config.g_learn_rate
        d_lr = config.d_learn_rate
        self.create_called = True
        self.d_lr = d_lr
        self.g_lr = g_lr
        for hook in self.gan.hooks:
            losses = hook.losses()
            if losses[0] is not None:
                self.trainable_gan.loss.sample[0] += losses[0]
            if losses[1] is not None:
                self.trainable_gan.loss.sample[1] += losses[1]

        result = self._create()

        for i, hook in enumerate(self.train_hooks):
            hook.after_create()
            setattr(self, 'train_hook'+str(i), hook)

    def create_optimizer(self, name="optimizer"):
        defn = getattr(self.config, name) or self.config.optimizer
        defn = defn.copy()
        klass = GANComponent.lookup_function(None, defn['class'])
        del defn["class"]

        optimizer = self.trainable_gan.create_optimizer(klass, defn)
        return optimizer

    def calculate_gradients(self):
        raise ValidationException("BaseTrainer#calculate_gradients called directly, please override")

    def step(self, feed_dict={}):
        step = self._step(feed_dict)
        self.current_step += 1
        return step

    def required(self):
        return "".split()

    def output_string(self, metrics):
        output = " %2d: "
        for name in sorted(metrics.keys()):
            output += " " + name
            output += " %.2f"
        return output

    def output_variables(self, metrics):
        gan = self.gan
        return [metrics[k] for k in sorted(metrics.keys())]

    def before_step(self, step, feed_dict):
        for component in self.train_hooks:
            component.before_step(step, feed_dict)

    def after_step(self, step, feed_dict):
        for component in self.train_hooks:
            component.after_step(step, feed_dict)


text:
namespace ospray {
  namespace mpi {

    extern "C" void *ospray_getEmbreeDevice()
    {
      return api::Device::current->embreeDevice;
    }

    DistributedModel::DistributedModel()
    {
      managedObjectType = OSP_MODEL;
      this->ispcEquivalent = ispc::DistributedModel_create(this);
    }

    std::string DistributedModel::toString() const
    {
      return "ospray::mpi::DistributedModel";
    }

    void DistributedModel::commit()
    {
      othersRegions.clear();

      // TODO: We may need to override the ISPC calls made
      // to the Model or customize the model struct on the ISPC
      // side. In which case we need some ISPC side inheritence
      // for the model type. Currently the code is actually identical.
      Model::commit();
      // Send my bounding boxes to other nodes, recieve theirs for a
      // "full picture" of what geometries live on what nodes
      Data *regionData = getParamData("regions");

      // The box3f data is sent as data of FLOAT3 items
      // TODO: It's a little awkward to copy the boxes again like this, maybe
      // can re-thinkg the send side of the bcast call? One that takes
      // a ptr and a size since we know we won't be writing out to it?
      // TODO: For now it doesn't matter that we don't know who owns the
      // other boxes, just that we know they exist and their bounds, and that
      // they aren't ours.
      if (regionData) {
        box3f *boxes = reinterpret_cast<box3f*>(regionData->data);
        myRegions = std::vector<box3f>(boxes, boxes + regionData->numItems / 2);
      }

      // If the user hasn't set any regions, there's an implicit infinitely
      // large region box we can place around the entire world.
      if (myRegions.empty()) {
        postStatusMsg("No regions found, making implicit "
                      "infinitely large region", 1);
        myRegions.push_back(box3f(vec3f(neg_inf), vec3f(pos_inf)));
      }

      for (size_t i = 0; i < mpicommon::numGlobalRanks(); ++i) {
        if (i == mpicommon::globalRank()) {
          messaging::bcast(i, myRegions);
        } else {
          std::vector<box3f> recv;
          messaging::bcast(i, recv);
          std::copy(recv.begin(), recv.end(),
                    std::back_inserter(othersRegions));
        }
      }

      if (logLevel() >= 1) {
        const bool asyncWasRunning = messaging::asyncMessagingEnabled();
        messaging::disableAsyncMessaging();

        // TODO: WILL: Just for making the debug log more readable,
        // this will NOT stick around
        for (size_t i = 0; i < mpicommon::numGlobalRanks(); ++i) {
          if (i == mpicommon::globalRank()) {
            postStatusMsg(1) << "Rank " << mpicommon::globalRank()
              << ": Got regions from others {";
            for (const auto &b : othersRegions) {
              postStatusMsg(1) << "\t" << b << ",";
            }
            postStatusMsg(1) << "}";
          }

          mpicommon::world.barrier();
        }

        if (asyncWasRunning) {
          postStatusMsg("Async was running, re-enabling", 1);
          messaging::enableAsyncMessaging();
        }
      }
    }

  } // ::ospray::mpi
} // ::ospray


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('crowdsourcing', '0033_auto_20150817_2056'),
        ('crowdsourcing', '0034_auto_20150817_2049'),
    ]

    operations = [
    ]


text:
import unittest
from SpiffyWorld import Database
from SpiffyWorld.models import Dungeon as DungeonModel, Effect as EffectModel, \
    ItemEffects, Item as ItemModel, UnitItems, Unit as UnitModel, UnitEffects, \
    UnitDialogue as UnitDialogueModel
from SpiffyWorld.collections import UnitCollection, ItemCollection, \
    EffectCollection, UnitDialogueCollection
from SpiffyWorld import UnitBuilder, Effect, Unit, UnitDialogue, \
    ItemBuilder
import logging
from testfixtures import LogCapture

class TestBuildWorld(unittest.TestCase):

    """
    Functional tests for building the world
    """
    @classmethod
    def setUpClass(cls):
        cls._db = Database()
        cls.db = cls._db.get_connection()

    def test_build_world(self):
        """
        Utilize models to build the world.

        1. Get dungeons
        2. Get effects
        3. Get item effects
        4. Get items
        5. Get unit items
        6. Get units
        """

        """ Dungeons """
        dungeon_model = DungeonModel(db=self.db)
        dungeon_models = dungeon_model.get_dungeons()

        self.assertIsInstance(dungeon_models, list)
        self.assertTrue(dungeon_models)

        """ Effects """
        effects_model = EffectModel(db=self.db)
        effects_models = effects_model.get_effects()

        self.assertIsInstance(effects_models, list)
        self.assertTrue(effects_models)

        """ Unit effects map """
        unit_effects_model = UnitEffects(db=self.db)
        unit_effects = unit_effects_model.get_unit_effects()
        unit_effects_map = unit_effects_model._get_unit_effects_map(unit_effects)

        self.assertIsInstance(unit_effects_map, dict)
        self.assertTrue(unit_effects_map)

        """ Unit dialogue map """
        unit_dialogue_model = UnitDialogueModel(db=self.db)
        unit_dialogue = unit_dialogue_model.get_unit_dialogue()
        unit_dialogue_map = unit_dialogue_model._get_unit_dialogue_map(unit_dialogue)

        self.assertIsInstance(unit_dialogue, list)
        self.assertIsInstance(unit_dialogue_map, dict)
        self.assertTrue(unit_dialogue_map)

        """ Item effects map """
        item_effects_model = ItemEffects(db=self.db)
        item_effects = item_effects_model.get_item_effects()
        item_effects_map = item_effects_model._get_item_effects_map(item_effects)

        self.assertIsInstance(item_effects, list)
        self.assertIsInstance(item_effects_map, dict)
        self.assertTrue(item_effects_map)
        self.assertTrue(item_effects)

        """ Items """
        item_model = ItemModel(db=self.db)
        item_models = item_model.get_items()

        self.assertIsInstance(item_models, list)
        self.assertTrue(item_models)

        """ Unit items map """
        unit_items_model = UnitItems(db=self.db)
        unit_item_models = unit_items_model.get_unit_items()
        unit_items_map = unit_items_model._get_unit_items_map(unit_item_models)

        self.assertIsInstance(unit_item_models, list)
        self.assertIsInstance(unit_items_map, dict)
        self.assertTrue(unit_items_map)
        self.assertTrue(unit_item_models)

        """ Units """
        unit_model = UnitModel(db=self.db)
        unit_models = unit_model.get_units()

        self.assertIsInstance(unit_models, list)
        self.assertTrue(unit_models)

        """ Assemble collections using models """
        item_collection = ItemCollection()
        effect_collection = EffectCollection()
        dialogue_collection = UnitDialogueCollection()

        for effect_model in effects_models:
            effect = Effect(effect=effect_model)
            effect_collection.add(effect)

        self.assertTrue(effect_collection.effects)

        item_builder = ItemBuilder()
        items = item_builder.build_items(item_models=item_models,
                                         item_effects_map=item_effects_map,
                                         effect_collection=effect_collection)
        self.assertIsInstance(items, list)
        self.assertTrue(items)

        for item in items:
            item_collection.add(item)

        self.assertTrue(item_collection.items)

        for ud in unit_dialogue:
            dialogue = UnitDialogue(dialogue=ud)
            dialogue_collection.add(dialogue)

        """ Build units using assembled collections """
        unit_builder = UnitBuilder()

        with LogCapture() as l:
            logger = logging.getLogger()
            units = unit_builder.build_units(unit_models=unit_models,
                                             effect_collection=effect_collection,
                                             item_collection=item_collection,
                                             dialogue_collection=dialogue_collection,
                                             unit_items_map=unit_items_map,
                                             unit_effects_map=unit_effects_map,
                                             unit_dialogue_map=unit_dialogue_map,
                                             log=logger)

        self.assertIsInstance(units, list)
        self.assertTrue(units)

        num_players = 0

        for unit in units:
            self.assertIsInstance(unit, Unit)

            if unit.is_player:
                num_players += 1

        self.assertTrue(num_players > 0)

        """
        Populate collections
        """
        unit_collection = UnitCollection()

        for unit in units:
            unit_collection.add(unit)

        self.assertEqual(len(unit_collection.units), len(unit_models))

if __name__ == '__main__':
    unittest.main()


text:
module Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
  module Models
    #
    # A load balancer configuration for an availability group listener.
    #
    class LoadBalancerConfiguration

      include MsRestAzure

      # @return [PrivateIPAddress] Private IP address.
      attr_accessor :private_ip_address

      # @return [String] Resource id of the public IP.
      attr_accessor :public_ip_address_resource_id

      # @return [String] Resource id of the load balancer.
      attr_accessor :load_balancer_resource_id

      # @return [Integer] Probe port.
      attr_accessor :probe_port

      # @return [Array<String>] List of the SQL virtual machine instance
      # resource id's that are enrolled into the availability group listener.
      attr_accessor :sql_virtual_machine_instances

      #
      # Mapper for LoadBalancerConfiguration class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'LoadBalancerConfiguration',
          type: {
            name: 'Composite',
            class_name: 'LoadBalancerConfiguration',
            model_properties: {
              private_ip_address: {
                client_side_validation: true,
                required: false,
                serialized_name: 'privateIpAddress',
                type: {
                  name: 'Composite',
                  class_name: 'PrivateIPAddress'
                }
              },
              public_ip_address_resource_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'publicIpAddressResourceId',
                type: {
                  name: 'String'
                }
              },
              load_balancer_resource_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'loadBalancerResourceId',
                type: {
                  name: 'String'
                }
              },
              probe_port: {
                client_side_validation: true,
                required: false,
                serialized_name: 'probePort',
                type: {
                  name: 'Number'
                }
              },
              sql_virtual_machine_instances: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sqlVirtualMachineInstances',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
import React, { Fragment } from 'react';
import { Button, SafeAreaView, StyleSheet, ScrollView, View, StatusBar } from 'react-native';

import * as tf from '@tensorflow/tfjs';
import { Run } from './run';
import { simpleOpRunner, precisionTestRunner, mobilenetRunner, localModelRunner, localShardedGraphModelRunner, trainModelRunner, saveModelRunner, localGraphModelRunner } from './ml';

interface ScreenProps {
  returnToMain: () => void;
}

export class Diagnostic extends React.Component<ScreenProps> {
  constructor(props: ScreenProps) {
    super(props);
  }

  render() {
    return (
      <Fragment>
        <StatusBar barStyle='dark-content' />
        <SafeAreaView>
          <ScrollView
            contentInsetAdjustmentBehavior='automatic'
            style={styles.scrollView}>

            <View style={styles.body}>
              <View style={styles.sectionContainer}>
                <Button
                  onPress={this.props.returnToMain}
                  title='Back'
                />
              </View>

              <View style={styles.sectionContainer}>
                <Run label='tf.getBackend()' result={`${tf.getBackend()}`}>
                </Run>
                <Run label='tf.version_core' result={`${tf.version_core}`}>
                </Run>
                <Run label='WEBGL_VERSION' result={`${
                  tf.env().getNumber('WEBGL_VERSION')}`}>
                </Run>
                <Run label='WEBGL_RENDER_FLOAT32_ENABLED' result={`${
                  tf.env().getBool('WEBGL_RENDER_FLOAT32_ENABLED')}`}>
                </Run>
                <Run label='WEBGL_DOWNLOAD_FLOAT_ENABLED' result={`${
                  tf.env().getBool('WEBGL_DOWNLOAD_FLOAT_ENABLED')}`}>
                </Run>
                <Run label='WEBGL_BUFFER_SUPPORTED' result={`${
                  tf.env().getNumber('WEBGL_BUFFER_SUPPORTED')}`}>
                </Run>
                <Run label='new Float32Array([2,3, NaN])' result={`${
                  new Float32Array([2, 3, NaN])
                  }`}>
                </Run>
                <Run label='SimpleOp tf.square(3)'
                  getRunner={simpleOpRunner} numRuns={1}></Run>
                <Run label='tf.scalar(2.4).square()'
                  getRunner={precisionTestRunner} numRuns={1}></Run>
                <Run label='mobilenet'
                  getRunner={mobilenetRunner} numRuns={1}></Run>
                <Run label='bundleStorageIO'
                  getRunner={localModelRunner} numRuns={1}></Run>
                <Run label='bundleStorageIO - graph model'
                  getRunner={localGraphModelRunner} numRuns={1}></Run>
                <Run label='bundleStorageIO - sharded graph model'
                  getRunner={localShardedGraphModelRunner} numRuns={1}></Run>
                <Run label='train model'
                  getRunner={trainModelRunner} numRuns={1}></Run>
                <Run label='asyncStorareIO'
                  getRunner={saveModelRunner} numRuns={1}></Run>
              </View>
            </View>
          </ScrollView>
        </SafeAreaView>
      </Fragment>
    );
  }
}

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: 'white',
  },
  body: {
    backgroundColor: 'white',
    marginBottom: 20,
  },
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
    color: 'black',
    marginBottom: 6,
  },
});


text:
Object.defineProperty(exports,"__esModule",{value:true});var _this=this;

var _graphqlRelay=require('graphql-relay');
var _graphql=require('graphql');

var _EnsayoType=require('../type/EnsayoType');var _EnsayoType2=_interopRequireDefault(_EnsayoType);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _objectWithoutProperties(obj,keys){var target={};for(var i in obj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}exports.default=

(0,_graphqlRelay.mutationWithClientMutationId)({
name:'EnsayoUpdate',

inputFields:{
id:{type:new _graphql.GraphQLNonNull(_graphql.GraphQLID)},
Ensayo_Title:{type:new _graphql.GraphQLNonNull(_graphql.GraphQLString)},
Ensayo_Description:{type:new _graphql.GraphQLNonNull(_graphql.GraphQLString)},
Ensayo_Content:{type:new _graphql.GraphQLNonNull(_graphql.GraphQLString)}},

outputFields:{
Ensayo:{
type:_EnsayoType2.default,
resolve:function resolve(_ref,_ref2,

context,_ref3){var local_id=_ref.local_id;var args=_objectWithoutProperties(_ref2,[]);var
objectManager=_ref3.rootValue;return(
objectManager.getOneObject('Ensayo',{id:local_id}));}}},

mutateAndGetPayload:function mutateAndGetPayload(_ref4,

context,_ref5){var id=_ref4.id,Ensayo_Title=_ref4.Ensayo_Title,Ensayo_Description=_ref4.Ensayo_Description,Ensayo_Content=_ref4.Ensayo_Content;var
objectManager=_ref5.rootValue;var local_id;return regeneratorRuntime.async(function mutateAndGetPayload$(_context){while(1){switch(_context.prev=_context.next){case 0:

local_id=(0,_graphqlRelay.fromGlobalId)(id).id;_context.next=3;return regeneratorRuntime.awrap(

objectManager.update('Ensayo',{
id:local_id,
Ensayo_Title:Ensayo_Title,
Ensayo_Description:Ensayo_Description,
Ensayo_Content:Ensayo_Content}));case 3:return _context.abrupt('return',

{local_id:local_id});case 4:case'end':return _context.stop();}}},null,_this);}});
//# sourceMappingURL=EnsayoUpdate.js.map


text:
{% extends "base.html" %}

{% block title %}{{ typedef.title|e }}{% endblock %}

{% block content %}

Typedef: {{ typedef.title|e }}

{{ sections.top_box(typedef) }}

{{ sections.signatures(typedef) }}

Overview

    {% if typedef.deprecation_msgs %}

Deprecated.

        {% for msg in typedef.deprecation_msgs %}

{{ msg|transtext(False) }}

        {% endfor %}

    {% endif %}

    {{ sections.brief(typedef) }}

    {{ sections.body(typedef) }}

{{ sections.see_also(typedef) }}

{{ sections.dox_source(typedef, in_comment=True) }}

{% endblock %}


text:
// RobotBuilder Version: 1.5
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.

package org.usfirst.frc2667.TestRobot.commands;

import edu.wpi.first.wpilibj.command.PIDCommand;
import org.usfirst.frc2667.TestRobot.Robot;
import org.usfirst.frc2667.TestRobot.RobotMap;

/**
 *
 */
public class  TestPIDCommand extends PIDCommand {

    public TestPIDCommand() {
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PID
        super("TestPIDCommand", 1.0, 0.0, 0.0, 0.02);
        getPIDController().setContinuous(false);
        getPIDController().setAbsoluteTolerance(0.2);

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PID

        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);

        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES
    }

    protected double returnPIDInput() {
        // Return your input value for the PID loop
        // e.g. a sensor, like a potentiometer:
        // yourPot.getAverageVoltage() / kYourMaxVoltage;

        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=SOURCE
        return RobotMap.driveTrainUltrasonic.pidGet();

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=SOURCE
    }

    protected void usePIDOutput(double output) {
        // Use output to drive your system, like a motor
        // e.g. yourMotor.set(output);

        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=OUTPUT
        RobotMap.driveTrainRightMotor.pidWrite(output);

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=OUTPUT
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}


text:
import { Banner, Box, Button, Text } from "@artsy/palette"
import * as React from "react";
import { graphql } from "relay-runtime"
import { InquiryAuctionHousesYouWorkWithQuery } from "v2/__generated__/InquiryAuctionHousesYouWorkWithQuery.graphql"
import { InquiryAffiliatedAutocomplete } from "../Components/InquiryAffiliatedAutocomplete"
import { InquiryAffiliatedSelectedOptions } from "../Components/InquiryAffiliatedSelectedOptions"
import { useInquiryAffiliated, Mode } from "../Hooks/useInquiryAffiliated"
import { useUpdateCollectorProfile } from "../Hooks/useUpdateCollectorProfile"

export const InquiryAuctionHousesYouWorkWith: React.FC = () => {
  const {
    handleRemove,
    handleSelect,
    handleSave,
    selection,
    mode,
  } = useInquiryAffiliated()

  const { submitUpdateCollectorProfile } = useUpdateCollectorProfile()

  const handleClick = () => {
    return handleSave(affiliatedAuctionHouseIds => {
      return submitUpdateCollectorProfile({ affiliatedAuctionHouseIds })
    })
  }

  return (
    <>
      <Text variant="lg" mb={2} pr={2}>
        What auction houses do you work with?{" "}
        <Box color="black60" as="span">
          (Optional)
        </Box>
      </Text>

      {mode === Mode.Error && (
        <Banner variant="error" dismissable my={2}>
          Something went wrong. Please try again.
        </Banner>
      )}

      <InquiryAffiliatedAutocomplete<InquiryAuctionHousesYouWorkWithQuery>
        query={query}
        onSelect={handleSelect}
        getOptions={({ external }) =>
          external.auctionHouses.map(option => ({
            text: option.name,
            value: option.internalID,
          }))
        }
      />

      <InquiryAffiliatedSelectedOptions
        selection={selection}
        onRemove={handleRemove}
      />

      <Button
        type="submit"
        width="100%"
        loading={mode === Mode.Loading}
        disabled={mode === Mode.Success}
        onClick={handleClick}
      >
        Next
      </Button>
    </>
  )
}

const query = graphql`
  query InquiryAuctionHousesYouWorkWithQuery($term: String!) {
    external {
      auctionHouses(size: 5, term: $term) {
        internalID
        name
      }
    }
  }
`


text:
require 'spec_helper'

describe ApiAi do
  it 'has a version number' do
    expect(ApiAi::VERSION).not_to be nil
  end
  it 'has web server domain' do
    expect(ApiAi::WEB_SERVER).to eq('api.ai')
  end
  it 'has api uri' do
    expect(ApiAi::API_SERVER).to eq('api.api.ai')
  end
end


text:
package com.github.binarywang.wxpay.bean.request;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.*;
import org.apache.commons.lang3.StringUtils;

/**
 *

 * 撤销订单请求类
 * Created by Binary Wang on 2017-3-23.
 *

 *
 * @author Binary Wang
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
@XStreamAlias("xml")
public class WxPayOrderReverseRequest extends WxPayBaseRequest {

  /**
   *

   * 微信订单号
   * transaction_id
   * String(28)
   * 1217752501201400000000000000
   * 微信的订单号,优先使用
   *

   */
  @XStreamAlias("transaction_id")
  private String transactionId;

  /**
   *

   * 商户订单号
   * out_trade_no
   * String(32)
   * 1217752501201400000000000000
   * 商户系统内部的订单号
   * transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
   *

   */
  @XStreamAlias("out_trade_no")
  private String outTradeNo;

  @Override
  protected void checkConstraints() throws WxPayException {
    if (StringUtils.isBlank(transactionId) && StringUtils.isBlank(outTradeNo)) {
      throw new WxPayException("transaction_id 和 out_trade_no不能同时为空!");
    }
  }

}


text:
% Demonstration of generative model functions.
%
% See GENERATIVE_MODEL and EVALUATE_GENERATIVE_MODEL for further details
% and interpretation.

clear
close all
clc

data = load('demo_generative_models_data');
A     = data.A;
Aseed = data.Aseed;
D     = data.D;

% get cardinality of network
n = length(A);

% set model type
modeltype = 'sptl';

% set whether the model is based on powerlaw or exponentials
modelvar = [{'powerlaw'},{'powerlaw'}];

% choose some model parameters
nparams = 100;
params = unifrnd(-10,0,nparams,1);

% generate synthetic networks and energy for the neighbors model;
[B,E,K] = evaluate_generative_model(Aseed,A,D,modeltype,modelvar,params);
X = [E,K];

% show scatterplot of parameter values versus energy and KS statistics
names = [...
    {'energy'},...
    {'degree'},...
    {'clustering'},...
    {'betweenness'},...
    {'edge length'}];

f = figure(...
    'units','inches',...
    'position',[2,2,4,4]);
for i = 1:size(X,2)
    subplot(3,2,i);
    scatter(params,X(:,i),100,X(:,i),'filled');
    set(gca,...
        'ylim',[0,1],...
        'clim',[0,1]);
    colormap(jet);
    xlabel('geometric parameter, \eta');
    ylabel(names{i});
end


text:
scene = new Athena.Entities.Scene('test');

CHECK_EQUAL(0, scene.nbComponents);

component1 = new Athena.Entities.Component("Component1", scene.components);

CHECK_EQUAL(1, scene.nbComponents);

component2 = new Athena.Entities.Component("Component2", scene.components);

CHECK_EQUAL(2, scene.nbComponents);

CHECK(scene.getComponent(0) !== undefined);
CHECK_EQUAL('Component1', scene.getComponent(0).name);

CHECK(scene.getComponent(component1.id) !== undefined);
CHECK_EQUAL('Component1', scene.getComponent(component1.id).name);

CHECK(scene.getComponent(1) !== undefined);
CHECK_EQUAL('Component2', scene.getComponent(1).name);

CHECK(scene.getComponent(component2.id) !== undefined);
CHECK_EQUAL('Component2', scene.getComponent(component2.id).name);


text:
export { default as laptopInstructions } from './laptopInstructions.scss';
export { default as tabletInstructions } from './tabletInstructions.scss';
export { default as mobileInstructions } from './mobileInstructions.scss';


text:
class MessagesController < ApplicationController
  skip_before_filter  :verify_authenticity_token

  def index
  end

  def receives_data
	  name = params['name']
  	message = params['message']
  	puts name
  	puts message
  	Pusher.trigger('my-channel', 'my-event', {
      message: message, name: name
    })
    render "message"
  end
end


text:
#import "CTApperanceViewController.h"

// import headers that need to be customised
#import <CTAssetsPickerController/CTAssetCheckmark.h>
#import <CTAssetsPickerController/CTAssetCollectionViewCell.h>
#import <CTAssetsPickerController/CTAssetsGridViewFooter.h>

@interface CTApperanceViewController ()

@property (nonatomic, strong) UIColor *primaryColor;
@property (nonatomic, strong) UIColor *secondaryColor;
@property (nonatomic, strong) UIFont *primaryFont;
@property (nonatomic, strong) UIFont *secondaryFont;

@end

@implementation CTApperanceViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.primaryColor   = [UIColor colorWithRed:251.0/255.0 green:13.0/255.0 blue:67.0/255.0 alpha:1];
    self.secondaryColor = [UIColor colorWithWhite:1 alpha:1];
    self.primaryFont    = [UIFont fontWithName:@"SnellRoundhand-Black" size:24.0];
    self.secondaryFont  = [UIFont fontWithName:@"SnellRoundhand-Bold" size:18.0];

    // Navigation Bar apperance
    UINavigationBar *navBar = [UINavigationBar appearanceWhenContainedIn:[CTAssetsPickerController class], nil];

    // set nav bar style to black to force light content status bar style
    navBar.barStyle = UIBarStyleBlack;

    // bar tint color
    navBar.barTintColor = self.primaryColor;

    // tint color
    navBar.tintColor = self.secondaryColor;

    // title
    navBar.titleTextAttributes =
    @{NSForegroundColorAttributeName: self.secondaryColor,
      NSFontAttributeName : self.primaryFont};

    // bar button item appearance
    UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedIn:[CTAssetsPickerController class], nil];
    [barButtonItem setTitleTextAttributes:@{NSFontAttributeName : self.secondaryFont}
                                 forState:UIControlStateNormal];

    // asset collection appearance
    CTAssetCollectionViewCell *assetCollectionViewCell = [CTAssetCollectionViewCell appearance];
    assetCollectionViewCell.titleFont = [self.secondaryFont fontWithSize:16.0];
    assetCollectionViewCell.titleTextColor = self.primaryColor;
    assetCollectionViewCell.countFont = [self.secondaryFont fontWithSize:12.0];
    assetCollectionViewCell.countTextColor = self.primaryColor;
    assetCollectionViewCell.selectedBackgroundColor = [UIColor colorWithRed:251.0/255.0 green:13.0/255.0 blue:67.0/255.0 alpha:0.2];

    // assets grid footer apperance
    CTAssetsGridViewFooter *assetsGridViewFooter = [CTAssetsGridViewFooter appearance];
    assetsGridViewFooter.font = [self.secondaryFont fontWithSize:16.0];
    assetsGridViewFooter.textColor = self.primaryColor;

    // check mark
    [CTAssetCheckmark appearance].tintColor = self.primaryColor;
}

- (void)dealloc
{
    // reset appearance
    UINavigationBar *navBar = [UINavigationBar appearanceWhenContainedIn:[CTAssetsPickerController class], nil];

    navBar.barStyle = UIBarStyleDefault;

    navBar.barTintColor = nil;

    navBar.tintColor = nil;

    navBar.titleTextAttributes = nil;

    UIBarButtonItem *barButtonItem = [UIBarButtonItem appearanceWhenContainedIn:[CTAssetsPickerController class], nil];
    [barButtonItem setTitleTextAttributes:nil
                                      forState:UIControlStateNormal];

    CTAssetCollectionViewCell *assetCollectionViewCell = [CTAssetCollectionViewCell appearance];
    assetCollectionViewCell.titleFont = nil;
    assetCollectionViewCell.titleTextColor = nil;
    assetCollectionViewCell.countFont = nil;
    assetCollectionViewCell.countTextColor = nil;
    assetCollectionViewCell.selectedBackgroundColor = nil;

    CTAssetsGridViewFooter *assetsGridViewFooter = [CTAssetsGridViewFooter appearance];
    assetsGridViewFooter.font = nil;
    assetsGridViewFooter.textColor = nil;

    // Check mark
    [CTAssetCheckmark appearance].tintColor = nil;
}

@end


text:
 package com.alibaba.cobar.client.router.config.vo;

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

import com.thoughtworks.xstream.XStream;

public class InternalRules {

    private List<InternalRule> rules;

    public void setRules(List<InternalRule> rules) {
        this.rules = rules;
    }

    public List<InternalRule> getRules() {
        return rules;
    }

    public static void main(String[] args) {
        XStream xstream = new XStream();
        xstream.alias("rules", InternalRules.class);
        xstream.alias("rule", InternalRule.class);
        xstream.addImplicitCollection(InternalRules.class, "rules");
        xstream.useAttributeFor(InternalRule.class, "merger");

        InternalRules rules = new InternalRules();
        List<InternalRule> rList = new ArrayList<InternalRule>();
        InternalRule r1 = new InternalRule();
        r1.setNamespace("com.alibaba.cobar.client.entity.Follower");
        r1.setShards("partition1");
        rList.add(r1);
        InternalRule r2 = new InternalRule();
        r2.setSqlmap("com.alibaba.cobar.client.entity.Follower.create");
        r2.setShards("p1, p2");
        rList.add(r2);
        InternalRule r3 = new InternalRule();
        r3.setSqlmap("com.alibaba.cobar.client.entity.Follower.create");
        r3.setShardingExpression("id>10000 and id< 20000");
        r3.setShards("p1, p2");
        rList.add(r3);
        InternalRule r4 = new InternalRule();
        r4.setNamespace("com.alibaba.cobar.client.entity.Follower");
        r4.setShardingExpression("id>10000 and id< 20000");
        r4.setShards("p1, p2");
//        r4.setMerger(Runnable.class);
        rList.add(r4);
        rules.setRules(rList);

        String xml = xstream.toXML(rules);
        System.out.println(xml);
    }
}


text:
<?php

namespace ickx\fw2\mvc\app\constants\path\traits;

use ickx\fw2\io\php_ini\PhpIni;
use ickx\fw2\io\cache\Cache;

/**
 * ファイルパス管理特性
 *
 * @category	Flywheel2
 * @package		mvc
 * @author		wakaba <wakabadou@gmail.com>
 * @license		http://opensource.org/licenses/MIT The MIT License MIT
 * @varsion		2.0.0
 */
trait FilePathTrait {
	/**
	 * パス情報上書き設定
	 *
	 * @return	array	上書き設定
	 */
	public static function PathConfig () {
// 		static::$_cache ?? static::$_cache = Cache::init(static::class);
// 		if (static::$_cache->has('path_config')) {
// 			return static::$_cache->get('path_config');
// 		}
// 		static::$_cache->set('path_config', $path_config = static::PathConfigList());
	    $path_config = static::PathConfigList();
		return $path_config;
	}

	/**
	 * パス情報上書き設定用データ
	 *
	 * @return	array	パス情報上書き設定用データ
	 */
	public static function PathConfigList () {
		static $boot_mode;

// 		static::$_cache ?? static::$_cache = Cache::init(static::class);
// 		if (static::$_cache->has('path_config_list')) {
// 			return static::$_cache->get('path_config_list');
// 		}

		$path_config_list = [
			//==============================================
			//一般設定
			//==============================================
			'PHP_BINDIR'			=> PHP_BINDIR,
			'BOOT_MODE'				=> ($boot_mode ?? $boot_mode = Environment::IsCli()) ? 'cli' : 'web',

			//==============================================
			//アプリ設定
			//==============================================
			'SYSTEM_ROOT_DIR'		=> Flywheel::GetSystemRootPath(),
			'SRC_DIR'				=> Flywheel::GetSrcPath(),
			'VENDOR_DIR'			=> Flywheel::GetVendorPath(),
			'PACKAGE_DIR'			=> Flywheel::GetPackageFullPath(),
			'APP_DIR'				=> Flywheel::GeAppFullPath(),

			'VENDOR_NAME'			=> Flywheel::GetVendorName(),
			'PACKAGE_NAME'			=> Flywheel::GetPackageName(),
			'CALL_TYPE'				=> Flywheel::GetCallType(),
			'APP_NAME'				=> Flywheel::GetAppName(),

			'PACKAGE_NS_PATH'		=> static::GetPackageNsPath(),
			'COMMONS_NS_PATH'		=> static::GetCommonsNsPath(),
			'APP_NS_PATH'			=> static::GetAppNsPath(),

			'APP_NS_CLASS_PATH'		=> static::GetAppNsClassPath(),

			'SRC_DIR'				=> static::GetSrcDir(),
			'CONF_DIR'				=> static::GetConfDir(),
			'PASSWORD_DIR'			=> static::GetPasswordDir(),

			'VAR_DIR'				=> static::GetVarDir(),
			'AUTH_DIR'				=> static::GetAuthDir(),
			'CACHE_DIR'				=> static::GetCacheDir(),
			'LOG_DIR'				=> static::GetLogDir(),
			'SESSION_DIR'			=> static::GetSessionDir(),
			'PHP_UPLOAD_TMP_DIR'	=> PhpIni::Get(PhpIni::UPLOAD_TMP_DIR),
			'TMP_DIR'				=> static::GetTmpDir(),

			'APP_CACHE_DIR'			=> static::GetAppCacheDir(),

			'FW2_DEFAULTS_DIR'		=> Flywheel::GetVendorPath() . '/ickx/fw2/mvc/defaults',
		];

// 		static::$_cache->set('path_config_list', $path_config_list);
		return $path_config_list;
	}

	public static function GetPackageNsPath () {
		static $path;
		return $path ?? $path = implode('/', [
			Flywheel::GetVendorName(),
			Flywheel::GetPackageName(),
		]);
	}

	public static function GetCommonsNsPath () {
		static $path;
		return $path ?? $path = implode('/', [
			Flywheel::GetVendorName(),
			Flywheel::GetPackageName(),
			'commons',
		]);
	}

	public static function GetAppNsPath () {
		static $path;
		return $path ?? $path = implode('/', [
			Flywheel::GetVendorName(),
			Flywheel::GetPackageName(),
			Flywheel::GetCallType(),
			Flywheel::GetAppName(),
		]);
	}

	public static function GetAppNsClassPath () {
		static $path;
		return $path ?? $path = implode("\\", [
			Flywheel::GetVendorName(),
			Flywheel::GetPackageName(),
			Flywheel::GetCallType(),
			Flywheel::GetAppName(),
		]);
	}

	public static function GetSrcDir () {
		static $path;
		return $path ?? $path = Flywheel::GetSystemRootPath() . '/src/';
	}

	public static function GetConfDir () {
		static $path;
		return $path ?? $path = Flywheel::GetSystemRootPath() . '/config/';
	}

	public static function GetPasswordDir () {
		static $path;
		return $path ?? $path = Flywheel::GetSystemRootPath() . '/password/';
	}

	public static function GetVarDir () {
		static $path;
		return $path ?? $path = Flywheel::GetSystemRootPath() . '/var/';
	}

	public static function GetAuthDir () {
		static $path;
		return $path ?? $path = static::GetVarDir() . 'auth/';
	}

	public static function GetCacheDir () {
		static $path;
		return $path ?? $path = static::GetVarDir() . 'cache/';
	}

	public static function GetLogDir () {
		static $path;
		return $path ?? $path = static::GetVarDir() . 'log/';
	}

	public static function GetSessionDir () {
		static $path;
		return $path ?? $path = static::GetVarDir() . 'session/';
	}

	public static function GetTmpDir () {
		static $path;
		return $path ?? $path = static::GetVarDir() . 'tmp/';
	}

	public static function GetAppCacheDir () {
		static $path;
		return $path ?? $path = static::GetCacheDir() . static::GetAppNsPath();
	}
}


text:
package com.eftimoff.udacitypopmovies.popmovies.posters.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.eftimoff.udacitypopmovies.R;
import com.eftimoff.udacitypopmovies.app.models.Movie;
import com.github.florent37.glidepalette.GlidePalette;

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

import butterknife.BindView;
import butterknife.ButterKnife;

public class PostersAdapter extends SelectableRecyclerViewAdapter<PostersAdapter.PostersViewHolder> {

    private PosterAdapterListener posterAdapterListener;
    private List<Movie> movies = new ArrayList<>();
    private boolean isMasterDetailFlow;

    public PostersAdapter(PosterAdapterListener posterAdapterListener) {
        this.posterAdapterListener = posterAdapterListener;
    }

    @Override
    public PostersViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_poster, parent, false);
        final PostersViewHolder postersViewHolder = new PostersViewHolder(view);
        setListeners(postersViewHolder);
        isMasterDetailFlow = parent.getResources().getBoolean(R.bool.is_master_detail_flow);
        return postersViewHolder;
    }

    private void setListeners(final PostersViewHolder postersViewHolder) {
        postersViewHolder.movieContainer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                final int position = postersViewHolder.getAdapterPosition();
                final Movie movie = movies.get(position);
                if (posterAdapterListener != null) {
                    posterAdapterListener.onMovieClicked(postersViewHolder.posterImageView, movie);
                }
                if (isMasterDetailFlow) {
                    clearSelections();
                    setSelected(position);
                }
            }
        });
    }

    @Override
    public void onBindViewHolder(final PostersViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);
        final Movie movie = movies.get(position);
        Glide.with(holder.posterImageView.getContext())
                .load(movie.getImageUrl())
                .listener(GlidePalette.with(movie.getImageUrl())
                        .use(GlidePalette.Profile.MUTED_DARK)
                        .intoBackground(holder.movieInformationContainer))
                .into(holder.posterImageView);
        holder.movieTitle.setText(movie.getTitle());
        holder.movieGenres.setText(movie.getGenres());
    }

    public void setMovies(List<Movie> movies) {
        this.movies = movies;
        notifyDataSetChanged();
    }

    @Override
    public int getItemCount() {
        return movies.size();
    }

    public List<Movie> getItems() {
        return movies;
    }

    public static class PostersViewHolder extends RecyclerView.ViewHolder {

        @BindView(R.id.movieContainer)
        View movieContainer;
        @BindView(R.id.posterImageView)
        ImageView posterImageView;
        @BindView(R.id.movieInformationContainer)
        View movieInformationContainer;
        @BindView(R.id.movieTitle)
        TextView movieTitle;
        @BindView(R.id.movieGenres)
        TextView movieGenres;

        public PostersViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}


text:
<FrameLayout 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="se.dimovski.android.delugeremote.fragments.LoginFragment">

    <ScrollView
        android:id="@+id/login_form"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="false">

        <LinearLayout
            android:id="@+id/server_connect_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:orientation="vertical" >

            <TextView
                android:id="@+id/server_login_header"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="1"
                android:singleLine="true"
                android:text="Server Details"
                android:textAllCaps="true"
                android:gravity="center"
                android:background="@color/deluge_actionbar_background"
                android:padding="10dp"
                android:textSize="20sp"
                android:textColor="#ffffff"/>

            <EditText
                android:id="@+id/name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_name"
                android:maxLines="1"
                android:singleLine="true"

                android:layout_marginTop="16dp"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="4dp"
                android:layout_marginBottom="4dp" />

            <EditText
                android:id="@+id/hostname"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_hostname"
                android:maxLines="1"
                android:singleLine="true"

                android:layout_marginTop="4dp"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="4dp"
                android:layout_marginBottom="4dp"/>

            <EditText
                android:id="@+id/username"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_username"
                android:maxLines="1"
                android:singleLine="true"
                android:layout_marginTop="4dp"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="4dp"
                android:layout_marginBottom="4dp" />

            <EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_password"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/action_connect"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1"
                android:singleLine="true"

                android:layout_marginTop="4dp"
                android:layout_marginLeft="4dp"
                android:layout_marginRight="4dp"
                android:layout_marginBottom="16dp"/>

        </LinearLayout>
    </ScrollView>

</FrameLayout>


text:
.. Zipline documentation master file, created by
   sphinx-quickstart on Wed Feb  8 15:29:56 2012.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. module:: zipline

****************************************************
Zipline: Financial Backtester for Trading Algorithms
****************************************************

Python is quickly becoming the glue language which holds together data science
and related fields like quantitative finance. Zipline is a new, BSD-licensed
quantitative trading system which allows easy backtesting of investment
algorithms on historical data. The system is fundamentally event-driven and a
close approximation of how live-trading systems operate. Moreover, Zipline
comes "batteries included" as many common statistics like
moving average and linear regression can be readily accessed from within a
user-written algorithm. Input of historical data and output of performance
statistics is based on Pandas DataFrames to integrate nicely into the existing
Python eco-system. Furthermore, statistic and machine learning libraries like
matplotlib, scipy, statsmodels, and sklearn support development, analysis and
visualization of state-of-the-art trading systems.

Zipline is currently used in production as the backtesting engine
powering `quantopian.com <https://app.quantopian.com>`_ -- a free, community-centered
platform that allows development and real-time backtesting of trading
algorithms in the web browser.

Features
========

* Ease of use: Zipline tries to get out of your way so that you can focus on
  algorithm development. See below for a code example.

* Zipline comes "batteries included" as many common statistics like moving
  average and linear regression can be readily accessed from within a
  user-written algorithm.

* Input of historical data and output of performance statistics is based on
  Pandas DataFrames to integrate nicely into the existing Python eco-system.

* Statistic and machine learning libraries like matplotlib, scipy, statsmodels,
  and sklearn support development, analysis and visualization of
  state-of-the-art trading systems.

Contents
========

.. toctree::
   :maxdepth: 4

   manifesto.rst
   installation.rst
   quickstart.rst
   contributing.rst
   modules.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
#region License

// Copyright 2014 MorseCode Software
// 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.
#endregion

namespace MorseCode.RxMvvm.Samples.Async.UI.Wpf
{
    using System;

    using MorseCode.RxMvvm.Common.DiscriminatedUnion;
    using MorseCode.RxMvvm.Samples.Async.ViewModels;

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow
    {
        #region Constructors and Destructors

        public MainWindow()
        {
            IDiscriminatedUnion<object, string, int> d = DiscriminatedUnion.First<object, string, int>("abc");
            this.InitializeComponent();
        }

        #endregion

        #region Methods

        protected override void BindControls(IObservable<MainViewModel> dataContext)
        {
            dataContext.Subscribe(v => this.DataContext = v);
        }

        #endregion
    }
}


text:
package com.thoughtworks.go.rackhack;

import org.junit.Test;
import org.mortbay.jetty.Request;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletConfig;
import org.springframework.mock.web.MockServletContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletException;
import java.io.IOException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.isA;
import static org.junit.Assert.assertThat;

public class DelegatingServletTest {
    public String uri = "/go/rails/stuff/action";
    public String attrName;
    public String attrValue;

    @Test
    public void shouldDelegateToTheGivenServlet() throws IOException, ServletException {
        MockServletContext ctx = new MockServletContext();
        ctx.addInitParameter(DelegatingListener.DELEGATE_SERVLET, DummyServlet.class.getCanonicalName());
        ServletContextEvent evt = new ServletContextEvent(ctx);
        DelegatingListener listener = new DelegatingListener();
        listener.contextInitialized(evt);
        assertThat((DummyServlet) ctx.getAttribute(DelegatingListener.DELEGATE_SERVLET), isA(DummyServlet.class));
        DelegatingServlet servlet = new DelegatingServlet();
        servlet.init(new MockServletConfig(ctx));
        Request request = new Request() {
            @Override
            public String getRequestURI() {
                return uri;
            }

            @Override
            public void setRequestURI(String newUri) {
                uri = newUri;
            }

            @Override
            public void setAttribute(String name, Object value) {
                attrName = name;
                attrValue = value.toString();
            }
        };
        servlet.service(request, new MockHttpServletResponse());
        assertThat(attrName, is(DummyServlet.URI_ATTRIBUTE));
        assertThat(attrValue, is("/go/stuff/action"));
    }
}


text:
namespace base {
class MessageLoopProxy;
}

namespace tracked_objects {
class Location;
}

namespace ppapi {

// MessageLoopShared doesn't really do anything interesting. It exists so that
// shared code (in particular, TrackedCallback) can keep a pointer to a
// MessageLoop resource. In the host side, there is not a concrete class that
// implements this. So pointers to MessageLoopShared can only really be valid
// on the plugin side.
class PPAPI_SHARED_EXPORT MessageLoopShared
    : public Resource,
      public thunk::PPB_MessageLoop_API {
 public:
  explicit MessageLoopShared(PP_Instance instance);
  // Construct the one MessageLoopShared for the main thread. This must be
  // invoked on the main thread.
  struct ForMainThread {};
  explicit MessageLoopShared(ForMainThread);
  virtual ~MessageLoopShared();

  // Handles posting to the message loop if there is one, or the pending queue
  // if there isn't.
  // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock.
  //       This only makes sense for user code and completely thread-safe
  //       proxy operations (e.g., MessageLoop::QuitClosure).
  virtual void PostClosure(const tracked_objects::Location& from_here,
                           const base::Closure& closure,
                           int64 delay_ms) = 0;

  virtual base::MessageLoopProxy* GetMessageLoopProxy() = 0;

  DISALLOW_COPY_AND_ASSIGN(MessageLoopShared);
};

}  // namespace ppapi

#endif  // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_


text:
package com.heima.smartbeijing.base;

import android.app.Activity;
import android.view.View;

/*
 * ×ó²à²Ëµ¥ÏêÇéÒ³µÄ»ùÀà
 */
public abstract class BaseMenuDetailPager {

	public Activity mActivity;
	public View mRootView;//²Ëµ¥ÏêÇéÒ³µÄ¸ù²¼¾Ö
	public BaseMenuDetailPager(Activity activity){
		mActivity = activity;
		mRootView = initView();
	}
	//³õ'»¯²¼¾Ö£¬±ØÐë×ÓÀàʵÏÖ
	public abstract View initView();
	//³õ'»¯Êý¾Ý
	public void initData(){

	}
}


text:
namespace TestCases.HSSF.Record
{
    using System;
    using System.IO;
    using System.Collections;
    using NPOI.HSSF.Record;
    using NUnit.Framework;
    using NPOI.Util;
    using NPOI.POIFS.FileSystem;
    using System.Collections.Generic;

    /**
     * Tests the record factory
     * @author Glen Stampoultzis (glens at apache.org)
     * @author Andrew C. Oliver (acoliver at apache dot org)
     * @author Csaba Nagy (ncsaba at yahoo dot com)
     */
    [TestFixture]
    public class TestRecordFactory
    {
        ///
        ///  Some of the tests are depending on the american culture.
        ///
        [SetUp]
        public void InitializeCultere()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
        }

        /**
         * TEST NAME:  Test Basic Record Construction

         * OBJECTIVE:  Test that the RecordFactory given the required parameters for know
         *             record types can construct the proper record w/values.

         * SUCCESS:    Record factory creates the records with the expected values.

         * FAILURE:    The wrong records are creates or contain the wrong values

         *
         */
        [Test]
        public void TestBasicRecordConstruction()
        {
            short recType = BOFRecord.sid;
            byte[] data = {
            0, 6, 5, 0, unchecked((byte)-2), 28, unchecked((byte)-51), 7, unchecked((byte)-55), 64, 0, 0, 6, 1, 0, 0
        };
            Record[] record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));

            Assert.AreEqual(typeof(BOFRecord).Name,
                         record[0].GetType().Name);
            BOFRecord bofRecord = (BOFRecord)record[0];

            Assert.AreEqual(7422, bofRecord.Build);
            Assert.AreEqual(1997, bofRecord.BuildYear);
            Assert.AreEqual(16585, bofRecord.HistoryBitMask);
            Assert.AreEqual(20, bofRecord.RecordSize);
            Assert.AreEqual(262, bofRecord.RequiredVersion);
            Assert.AreEqual(2057, bofRecord.Sid);
            Assert.AreEqual(BOFRecordType.Workbook, bofRecord.Type);
            Assert.AreEqual(1536, bofRecord.Version);
            recType = MMSRecord.sid;
            //size = 2;
            data = new byte[]
            {
                0, 0
            };
            record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));
            Assert.AreEqual(typeof(MMSRecord).Name,
                         record[0].GetType().Name);
            MMSRecord mmsRecord = (MMSRecord)record[0];

            Assert.AreEqual(0, mmsRecord.AddMenuCount);
            Assert.AreEqual(0, mmsRecord.DelMenuCount);
            Assert.AreEqual(6, mmsRecord.RecordSize);
            Assert.AreEqual(193, mmsRecord.Sid);
        }

        /**
         * TEST NAME:  Test Special Record Construction

         * OBJECTIVE:  Test that the RecordFactory given the required parameters for
         *             constructing a RKRecord will return a NumberRecord.

         * SUCCESS:    Record factory creates the Number record with the expected values.

         * FAILURE:    The wrong records are created or contain the wrong values

         *
         */
        [Test]
        public void TestSpecial()
        {
            short recType = RKRecord.sid;
            byte[] data = {
            0, 0, 0, 0, 21, 0, 0, 0, 0, 0
            };
            Record[] record = RecordFactory.CreateRecord(TestcaseRecordInputStream.Create(recType, data));

            Assert.AreEqual(typeof(NumberRecord).Name,
                         record[0].GetType().Name);
            NumberRecord numberRecord = (NumberRecord)record[0];

            Assert.AreEqual(0, numberRecord.Column);
            Assert.AreEqual(18, numberRecord.RecordSize);
            Assert.AreEqual(0, numberRecord.Row);
            Assert.AreEqual(515, numberRecord.Sid);
            Assert.AreEqual(0.0, numberRecord.Value, 0.001);
            Assert.AreEqual(21, numberRecord.XFIndex);
        }

        /**
         * TEST NAME:  Test Creating ContinueRecords After Unknown Records From An Stream

         * OBJECTIVE:  Test that the RecordFactory given an Stream
         *             constructs the expected array of records.

         * SUCCESS:    Record factory creates the expected records.

         * FAILURE:    The wrong records are created or contain the wrong values

         *
         */
        [Test]
        public void TestContinuedUnknownRecord()
        {
            byte[] data = {
            0, unchecked((byte)-1), 0, 0, // an unknown record with 0 length
            0x3C , 0, 3, 0, 1, 2, 3, // a continuation record with 3 bytes of data
            0x3C , 0, 1, 0, 4 // one more continuation record with 1 byte of data
            };

            MemoryStream bois = new MemoryStream(data);
            Record[] records = (Record[])
              RecordFactory.CreateRecords(bois).ToArray();
            Assert.AreEqual(3, records.Length, "Created record count");
            Assert.AreEqual(
                         typeof(UnknownRecord).Name,
                         records[0].GetType().Name, "1st record's type");
            Assert.AreEqual((short)-256, records[0].Sid, "1st record's sid");
            Assert.AreEqual(typeof(ContinueRecord).Name,
                         records[1].GetType().Name, "2nd record's type");
            ContinueRecord record = (ContinueRecord)records[1];
            Assert.AreEqual(0x3C, record.Sid, "2nd record's sid");
            Assert.AreEqual(1, record.Data[0], "1st data byte");
            Assert.AreEqual(2, record.Data[1], "2nd data byte");
            Assert.AreEqual(3, record.Data[2], "3rd data byte");
            Assert.AreEqual(
                         typeof(ContinueRecord).Name,
                         records[2].GetType().Name, "3rd record's type");
            record = (ContinueRecord)records[2];
            Assert.AreEqual(0x3C, record.Sid, "3nd record's sid");
            Assert.AreEqual(4, record.Data[0], "4th data byte");
        }

        /**
         * Drawing records have a very strange continue behaviour.
         * There can actually be OBJ records mixed between the continues.
         * Record factory must preserve this structure when Reading records.
         */
        [Test]
        public void TestMixedContinue()
        {
            /**
             *  Taken from a real test sample file 39512.xls. See Bug 39512 for details.
             */
            String dump =
                //OBJ
                    "5D 00 48 00 15 00 12 00 0C 00 3C 00 11 00 A0 2E 03 01 CC 42 " +
                    "CF 00 00 00 00 00 0A 00 0C 00 00 00 00 00 00 00 00 00 00 00 " +
                    "03 00 0B 00 06 00 28 01 03 01 00 00 12 00 08 00 00 00 00 00 " +
                    "00 00 03 00 11 00 04 00 3D 00 00 00 00 00 00 00 " +
                //MSODRAWING
                    "EC 00 08 00 00 00 0D F0 00 00 00 00 " +
                //TXO (and 2 trailing CONTINUE records)
                    //"B6 01 12 00 22 02 00 00 00 00 00 00 00 00 10 00 10 00 00 00 " +
                    //"00 00 3C 00 21 00 01 4F 00 70 00 74 00 69 00 6F 00 6E 00 20 " +
                    //"00 42 00 75 00 74 00 74 00 6F 00 6E 00 20 00 33 00 39 00 3C " +
                    //"00 10 00 00 00 05 00 00 00 00 00 10 00 00 00 00 00 00 00 " +
                    "B6 01 12 00 22 02 00 00 00 00 00 00 00 00 10 00 10 00 00 00 00 00 " +
                    "3C 00 11 00 00 4F 70 74 69 6F 6E 20 42 75 74 74 6F 6E 20 33 39 " +
                    "3C 00 10 00 00 00 05 00 00 00 00 00 10 00 00 00 00 00 00 00 " +
                // another CONTINUE
                    "3C 00 7E 00 0F 00 04 F0 7E 00 00 00 92 0C 0A F0 08 00 00 00 " +
                    "3D 04 00 00 00 0A 00 00 A3 00 0B F0 3C 00 00 00 7F 00 00 01 " +
                    "00 01 80 00 8C 01 03 01 85 00 01 00 00 00 8B 00 02 00 00 00 " +
                    "BF 00 08 00 1A 00 7F 01 29 00 29 00 81 01 41 00 00 08 BF 01 " +
                    "00 00 10 00 C0 01 40 00 00 08 FF 01 00 00 08 00 00 00 10 F0 " +
                    "12 00 00 00 02 00 02 00 A0 03 18 00 B5 00 04 00 30 02 1A 00 " +
                    "00 00 00 00 11 F0 00 00 00 00 " +
                //OBJ
                    "5D 00 48 00 15 00 12 00 0C 00 3D 00 11 00 8C 01 03 01 C8 59 CF 00 00 " +
                    "00 00 00 0A 00 0C 00 00 00 00 00 00 00 00 00 00 00 03 00 0B 00 06 00 " +
                    "7C 16 03 01 00 00 12 00 08 00 00 00 00 00 00 00 03 00 11 00 04 00 01 " +
                    "00 00 00 00 00 00 00";
            byte[] data = HexRead.ReadFromString(dump);

            IList records = RecordFactory.CreateRecords(new MemoryStream(data));
            Assert.AreEqual(5, records.Count);
            Assert.IsTrue(records[0] is ObjRecord);
            Assert.IsTrue(records[1] is DrawingRecord);
            Assert.IsTrue(records[2] is TextObjectRecord);
            Assert.IsTrue(records[3] is ContinueRecord);
            Assert.IsTrue(records[4] is ObjRecord);

            //Serialize and verify that the Serialized data is1 the same as the original
            MemoryStream out1 = new MemoryStream();
            for (IEnumerator it = records.GetEnumerator(); it.MoveNext(); )
            {
                Record rec = (Record)it.Current;
                byte[] serialdata = rec.Serialize();
                out1.Write(serialdata, 0, serialdata.Length);
            }

            byte[] ser = out1.ToArray();
            Assert.AreEqual(data.Length, ser.Length);
            Assert.IsTrue(Arrays.Equals(data, ser));
        }
        [Test]
        public void TestNonZeroPadding_bug46987()
        {
            Record[] recs = {
			    new BOFRecord(),
			    new WriteAccessRecord(), // need *something* between BOF and EOF
			    EOFRecord.instance,
			    BOFRecord.CreateSheetBOF(),
			    EOFRecord.instance,
		    };
            MemoryStream baos = new MemoryStream();
            for (int i = 0; i < recs.Length; i++)
            {
                byte[] data = recs[i].Serialize();
                baos.Write(data,0,data.Length);
            }
            //simulate the bad padding at the end of the workbook stream in attachment 23483 of bug 46987
            baos.WriteByte(0x00);
            baos.WriteByte(0x11);
            baos.WriteByte(0x00);
            baos.WriteByte(0x02);
            for (int i = 0; i < 192; i++)
            {
                baos.WriteByte(0x00);
            }

            POIFSFileSystem fs = new POIFSFileSystem();
            Stream is1;
            fs.CreateDocument(new MemoryStream(baos.ToArray()), "dummy");
            is1 = fs.Root.CreatePOIFSDocumentReader("dummy");

            List<Record> outRecs;
            try
            {
                outRecs = RecordFactory.CreateRecords(is1);
            }
            catch (Exception e)
            {
                if (e.Message.Equals("Buffer underrun - requested 512 bytes but 192 was available"))
                {
                    throw new AssertionException("Identified bug 46987");
                }
                throw e;
            }
            Assert.AreEqual(5, outRecs.Count);
        }
        [Test]
        //public void TestNonZeroPadding_bug46987()
        public void TestNPOIBug6177()
        {
            //Record[] recs = {
            //    new BOFRecord(),
            //    EOFRecord.instance,
            //    BOFRecord.CreateSheetBOF(),
            //    EOFRecord.instance,
            //};
            //MemoryStream baos = new MemoryStream();
            //for (int i = 0; i < recs.Length; i++)
            //{
            //    baos.Write(recs[i].Serialize(),0, recs[i].RecordSize);
            //}
            ////simulate the bad padding at the end of the workbook stream in attachment 23483 of bug 46987
            //baos.WriteByte(0x00);
            //baos.WriteByte(0x11);
            //baos.WriteByte(0x00);
            //baos.WriteByte(0x02);
            //for (int i = 0; i < 192; i++)
            //{
            //    baos.WriteByte(0x00);
            //}

            //POIFSFileSystem fs = new POIFSFileSystem();
            //Stream is1;
            //fs.CreateDocument(new MemoryStream(baos.ToArray()), "dummy");
            //is1 = fs.Root.CreatePOIFSDocumentReader("dummy");

            //List<Record> outRecs;
            //try
            //{
            //    outRecs = RecordFactory.CreateRecords(is1);
            //}
            //catch (Exception e)
            //{
            //    if (e.Message.Equals("Buffer underrun - requested 512 bytes but 192 was available"))
            //    {
            //        throw new AssertionException("Identified bug 46987");
            //    }
            //    throw e;
            //}
            //Assert.AreEqual(4, outRecs.Count);
            string sampleFileName = "FW 8.6 Table Relationship2.xls";
            HSSFTestDataSamples.OpenSampleWorkbook(sampleFileName);
        }

    }
}


text:
<?php

namespace Oro\Bundle\ApiBundle\Processor;

use Oro\Component\ChainProcessor\ActionProcessor;

class ActionProcessorBag
{
    /** @var ActionProcessor[] */
    protected $processors = [];

    /**
     * Registers a processor in the bag.
     *
     * @param ActionProcessor $processor
     */
    public function addProcessor(ActionProcessor $processor)
    {
        $this->processors[] = $processor;
    }

    /**
     * Gets a processor responsible to handle the given action.
     *
     * @param string $action
     *
     * @return ActionProcessor
     */
    public function getProcessor($action)
    {
        foreach ($this->processors as $processor) {
            if ($processor->getAction() === $action) {
                return $processor;
            }
        }

        throw new \InvalidArgumentException(sprintf('A processor for "%s" action was not found.', $action));
    }
}