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

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Represents the input of a delete custom action operation. The custom action
 * will be marked as deleted.
 *

 */
public class DeleteCustomActionTypeRequest extends AmazonWebServiceRequest
        implements Serializable, Cloneable {

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     */
    private String category;
    /**
     *

     * The provider of the service used in the custom action, such as AWS
     * CodeDeploy.
     *

     */
    private String provider;
    /**
     *

     * The version of the custom action to delete.
     *

     */
    private String version;

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     *
     * @param category
     *        The category of the custom action that you want to delete, such as
     *        source or deploy.
     * @see ActionCategory
     */

    public void setCategory(String category) {
        this.category = category;
    }

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     *
     * @return The category of the custom action that you want to delete, such
     *         as source or deploy.
     * @see ActionCategory
     */

    public String getCategory() {
        return this.category;
    }

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     *
     * @param category
     *        The category of the custom action that you want to delete, such as
     *        source or deploy.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     * @see ActionCategory
     */

    public DeleteCustomActionTypeRequest withCategory(String category) {
        setCategory(category);
        return this;
    }

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     *
     * @param category
     *        The category of the custom action that you want to delete, such as
     *        source or deploy.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     * @see ActionCategory
     */

    public void setCategory(ActionCategory category) {
        this.category = category.toString();
    }

    /**
     *

     * The category of the custom action that you want to delete, such as source
     * or deploy.
     *

     *
     * @param category
     *        The category of the custom action that you want to delete, such as
     *        source or deploy.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     * @see ActionCategory
     */

    public DeleteCustomActionTypeRequest withCategory(ActionCategory category) {
        setCategory(category);
        return this;
    }

    /**
     *

     * The provider of the service used in the custom action, such as AWS
     * CodeDeploy.
     *

     *
     * @param provider
     *        The provider of the service used in the custom action, such as AWS
     *        CodeDeploy.
     */

    public void setProvider(String provider) {
        this.provider = provider;
    }

    /**
     *

     * The provider of the service used in the custom action, such as AWS
     * CodeDeploy.
     *

     *
     * @return The provider of the service used in the custom action, such as
     *         AWS CodeDeploy.
     */

    public String getProvider() {
        return this.provider;
    }

    /**
     *

     * The provider of the service used in the custom action, such as AWS
     * CodeDeploy.
     *

     *
     * @param provider
     *        The provider of the service used in the custom action, such as AWS
     *        CodeDeploy.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public DeleteCustomActionTypeRequest withProvider(String provider) {
        setProvider(provider);
        return this;
    }

    /**
     *

     * The version of the custom action to delete.
     *

     *
     * @param version
     *        The version of the custom action to delete.
     */

    public void setVersion(String version) {
        this.version = version;
    }

    /**
     *

     * The version of the custom action to delete.
     *

     *
     * @return The version of the custom action to delete.
     */

    public String getVersion() {
        return this.version;
    }

    /**
     *

     * The version of the custom action to delete.
     *

     *
     * @param version
     *        The version of the custom action to delete.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */

    public DeleteCustomActionTypeRequest withVersion(String version) {
        setVersion(version);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCategory() != null)
            sb.append("Category: " + getCategory() + ",");
        if (getProvider() != null)
            sb.append("Provider: " + getProvider() + ",");
        if (getVersion() != null)
            sb.append("Version: " + getVersion());
        sb.append("}");
        return sb.toString();
    }

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

        if (obj instanceof DeleteCustomActionTypeRequest == false)
            return false;
        DeleteCustomActionTypeRequest other = (DeleteCustomActionTypeRequest) obj;
        if (other.getCategory() == null ^ this.getCategory() == null)
            return false;
        if (other.getCategory() != null
                && other.getCategory().equals(this.getCategory()) == false)
            return false;
        if (other.getProvider() == null ^ this.getProvider() == null)
            return false;
        if (other.getProvider() != null
                && other.getProvider().equals(this.getProvider()) == false)
            return false;
        if (other.getVersion() == null ^ this.getVersion() == null)
            return false;
        if (other.getVersion() != null
                && other.getVersion().equals(this.getVersion()) == false)
            return false;
        return true;
    }

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

        hashCode = prime * hashCode
                + ((getCategory() == null) ? 0 : getCategory().hashCode());
        hashCode = prime * hashCode
                + ((getProvider() == null) ? 0 : getProvider().hashCode());
        hashCode = prime * hashCode
                + ((getVersion() == null) ? 0 : getVersion().hashCode());
        return hashCode;
    }

    @Override
    public DeleteCustomActionTypeRequest clone() {
        return (DeleteCustomActionTypeRequest) super.clone();
    }
}


text:
var server = null;
if(window.location.protocol === 'http:')
	server = "http://" + window.location.hostname + ":8088/janus";
else
	server = "https://" + window.location.hostname + ":8089/janus";

var janus = null;
var echotest = null;
var started = false;
var bitrateTimer = null;
var spinner = null;

var audioenabled = false;
var videoenabled = false;

$(document).ready(function() {
	// Initialize the library (all console debuggers enabled)
	Janus.init({debug: "all", callback: function() {
		// Use a button to start the demo
		$('#start').click(function() {
			if(started)
				return;
			started = true;
			$(this).attr('disabled', true).unbind('click');
			// Make sure the browser supports WebRTC
			if(!Janus.isWebrtcSupported()) {
				bootbox.alert("No WebRTC support... ");
				return;
			}
			// Create session
			janus = new Janus(
				{
					server: server,
					// No "iceServers" is provided, meaning janus.js will use a default STUN server
					// Here are some examples of how an iceServers field may look like to support TURN
					// 		iceServers: [{url: "turn:yourturnserver.com:3478", username: "janususer", credential: "januspwd"}],
					// 		iceServers: [{url: "turn:yourturnserver.com:443?transport=tcp", username: "janususer", credential: "januspwd"}],
					// 		iceServers: [{url: "turns:yourturnserver.com:443?transport=tcp", username: "janususer", credential: "januspwd"}],
					// Should the Janus API require authentication, you can specify either the API secret or user token here too
					//		token: "mytoken",
					//	or
					//		apisecret: "serversecret",
					success: function() {
						// Attach to echo test plugin
						janus.attach(
							{
								plugin: "janus.plugin.echotest",
								success: function(pluginHandle) {
									$('#details').remove();
									echotest = pluginHandle;
									Janus.log("Plugin attached! (" + echotest.getPlugin() + ", id=" + echotest.getId() + ")");
									// Negotiate WebRTC
									var body = { "audio": true, "video": true };
									Janus.debug("Sending message (" + JSON.stringify(body) + ")");
									echotest.send({"message": body});
									Janus.debug("Trying a createOffer too (audio/video sendrecv)");
									echotest.createOffer(
										{
											// No media provided: by default, it's sendrecv for audio and video
											media: { data: true },	// Let's negotiate data channels as well
											success: function(jsep) {
												Janus.debug("Got SDP!");
												Janus.debug(jsep);
												echotest.send({"message": body, "jsep": jsep});
											},
											error: function(error) {
												Janus.error("WebRTC error:", error);
												bootbox.alert("WebRTC error... " + JSON.stringify(error));
											}
										});
									$('#start').removeAttr('disabled').html("Stop")
										.click(function() {
											$(this).attr('disabled', true);
											clearInterval(bitrateTimer);
											janus.destroy();
										});
								},
								error: function(error) {
									console.error("  -- Error attaching plugin...", error);
									bootbox.alert("Error attaching plugin... " + error);
								},
								consentDialog: function(on) {
									Janus.debug("Consent dialog should be " + (on ? "on" : "off") + " now");
									if(on) {
										// Darken screen and show hint
										$.blockUI({
											message: '

',
											css: {
												border: 'none',
												padding: '15px',
												backgroundColor: 'transparent',
												color: '#aaa',
												top: '10px',
												left: (navigator.mozGetUserMedia ? '-100px' : '300px')
											} });
									} else {
										// Restore screen
										$.unblockUI();
									}
								},
								onmessage: function(msg, jsep) {
									Janus.debug(" ::: Got a message :::");
									Janus.debug(JSON.stringify(msg));
									if(jsep !== undefined && jsep !== null) {
										Janus.debug("Handling SDP as well...");
										Janus.debug(jsep);
										echotest.handleRemoteJsep({jsep: jsep});
									}
									var result = msg["result"];
									if(result !== null && result !== undefined) {
										if(result === "done") {
											// The plugin closed the echo test
											bootbox.alert("The Echo Test is over");
											if(spinner !== null && spinner !== undefined)
												spinner.stop();
											spinner = null;
											$('#myvideo').remove();
											$('#waitingvideo').remove();
											$('#peervideo').remove();
											$('#toggleaudio').attr('disabled', true);
											$('#togglevideo').attr('disabled', true);
											$('#bitrate').attr('disabled', true);
											$('#curbitrate').hide();
											$('#curres').hide();
										}
									}
								},
								onlocalstream: function(stream) {
									Janus.debug(" ::: Got a local stream :::");
									Janus.debug(JSON.stringify(stream));
									if($('#myvideo').length === 0) {
										$('#videos').removeClass('hide').show();
										$('#videoleft').append('<video class="rounded centered" id="myvideo" width=320 height=240 autoplay muted="muted"/>');
									}
									attachMediaStream($('#myvideo').get(0), stream);
									$("#myvideo").get(0).muted = "muted";
									// No remote video yet
									$('#videoright').append('<video class="rounded centered" id="waitingvideo" width=320 height=240 />');
									if(spinner == null) {
										var target = document.getElementById('videoright');
										spinner = new Spinner({top:100}).spin(target);
									} else {
										spinner.spin();
									}
									var videoTracks = stream.getVideoTracks();
									if(videoTracks === null || videoTracks === undefined || videoTracks.length === 0) {
										// No webcam
										$('#myvideo').hide();
										$('#videoleft').append(
											'
' +
												'' +
												'No webcam available' +
											'
');
									}
								},
								onremotestream: function(stream) {
									Janus.debug(" ::: Got a remote stream :::");
									Janus.debug(JSON.stringify(stream));
									if($('#peervideo').length === 0) {
										$('#videos').removeClass('hide').show();
										$('#videoright').append('<video class="rounded centered hide" id="peervideo" width=320 height=240 autoplay/>');
										// Show the video, hide the spinner and show the resolution when we get a playing event
										$("#peervideo").bind("playing", function () {
											$('#waitingvideo').remove();
											$('#peervideo').removeClass('hide');
											if(spinner !== null && spinner !== undefined)
												spinner.stop();
											spinner = null;
											var width = this.videoWidth;
											var height = this.videoHeight;
											$('#curres').removeClass('hide').text(width+'x'+height).show();
											if(webrtcDetectedBrowser == "firefox") {
												// Firefox Stable has a bug: width and height are not immediately available after a playing
												setTimeout(function() {
													var width = $("#peervideo").get(0).videoWidth;
													var height = $("#peervideo").get(0).videoHeight;
													$('#curres').removeClass('hide').text(width+'x'+height).show();
												}, 2000);
											}
										});
									}
									attachMediaStream($('#peervideo').get(0), stream);
									var videoTracks = stream.getVideoTracks();
									if(videoTracks === null || videoTracks === undefined || videoTracks.length === 0 || videoTracks[0].muted) {
										// No remote video
										$('#peervideo').hide();
										$('#videoright').append(
											'
' +
												'' +
												'No remote video available' +
											'
');
									}
									// Enable audio/video buttons and bitrate limiter
									audioenabled = true;
									videoenabled = true;
									$('#toggleaudio').click(
										function() {
											audioenabled = !audioenabled;
											if(audioenabled)
												$('#toggleaudio').html("Disable audio").removeClass("btn-success").addClass("btn-danger");
											else
												$('#toggleaudio').html("Enable audio").removeClass("btn-danger").addClass("btn-success");
											echotest.send({"message": { "audio": audioenabled }});
										});
									$('#togglevideo').click(
										function() {
											videoenabled = !videoenabled;
											if(videoenabled)
												$('#togglevideo').html("Disable video").removeClass("btn-success").addClass("btn-danger");
											else
												$('#togglevideo').html("Enable video").removeClass("btn-danger").addClass("btn-success");
											echotest.send({"message": { "video": videoenabled }});
										});
									$('#toggleaudio').parent().removeClass('hide').show();
									$('#bitrate a').click(function() {
										var id = $(this).attr("id");
										var bitrate = parseInt(id)*1000;
										if(bitrate === 0) {
											Janus.log("Not limiting bandwidth via REMB");
										} else {
											Janus.log("Capping bandwidth to " + bitrate + " via REMB");
										}
										$('#bitrateset').html($(this).html()).parent().removeClass('open');
										echotest.send({"message": { "bitrate": bitrate }});
										return false;
									});
									if(webrtcDetectedBrowser == "chrome" || webrtcDetectedBrowser == "firefox") {
										$('#curbitrate').removeClass('hide').show();
										bitrateTimer = setInterval(function() {
											// Display updated bitrate, if supported
											var bitrate = echotest.getBitrate();
											//~ Janus.debug("Current bitrate is " + echotest.getBitrate());
											$('#curbitrate').text(bitrate);
										}, 1000);
									}
								},
								ondataopen: function(data) {
									Janus.log("The DataChannel is available!");
									$('#videos').removeClass('hide').show();
									$('#datasend').removeAttr('disabled');
								},
								ondata: function(data) {
									Janus.debug("We got data from the DataChannel! " + data);
									$('#datarecv').val(data);
								},
								oncleanup: function() {
									Janus.log(" ::: Got a cleanup notification :::");
									if(spinner !== null && spinner !== undefined)
										spinner.stop();
									spinner = null;
									$('#myvideo').remove();
									$('#waitingvideo').remove();
									$('#peervideo').remove();
									$('#toggleaudio').attr('disabled', true);
									$('#togglevideo').attr('disabled', true);
									$('#bitrate').attr('disabled', true);
									$('#curbitrate').hide();
									$('#curres').hide();
									$('#datasend').attr('disabled', true);
								}
							});
					},
					error: function(error) {
						Janus.error(error);
						bootbox.alert(error, function() {
							window.location.reload();
						});
					},
					destroyed: function() {
						window.location.reload();
					}
				});
		});
	}});
});

function checkEnter(event) {
	var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if(theCode == 13) {
		sendData();
		return false;
	} else {
		return true;
	}
}

function sendData() {
	var data = $('#datasend').val();
	if(data === "") {
		bootbox.alert('Insert a message to send on the DataChannel');
		return;
	}
	echotest.data({
		text: data,
		error: function(reason) { bootbox.alert(reason); },
		success: function() { $('#datasend').val(''); },
	});
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Google\Service\Slides;

class UpdateSlidesPositionRequest extends \Google\Collection
{
  protected $collection_key = 'slideObjectIds';
  /**
   * @var int
   */
  public $insertionIndex;
  /**
   * @var string[]
   */
  public $slideObjectIds;

  /**
   * @param int
   */
  public function setInsertionIndex($insertionIndex)
  {
    $this->insertionIndex = $insertionIndex;
  }
  /**
   * @return int
   */
  public function getInsertionIndex()
  {
    return $this->insertionIndex;
  }
  /**
   * @param string[]
   */
  public function setSlideObjectIds($slideObjectIds)
  {
    $this->slideObjectIds = $slideObjectIds;
  }
  /**
   * @return string[]
   */
  public function getSlideObjectIds()
  {
    return $this->slideObjectIds;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(UpdateSlidesPositionRequest::class, 'Google_Service_Slides_UpdateSlidesPositionRequest');


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

    <TimePicker android:id="@+id/timePickerMin"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
            >
    </TimePicker>

    <TimePicker android:id="@+id/timePickerMax"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
            >
    </TimePicker>

</LinearLayout>


text:
 package org.eclipse.jdt.internal.ui;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;

import org.eclipse.ui.progress.UIJob;

import org.eclipse.jdt.core.JavaCore;

import org.eclipse.jdt.ui.JavaUI;

public class InitializeAfterLoadJob extends UIJob {

	private final class RealJob extends Job {
		public RealJob(String name) {
			super(name);
		}
		@Override
		protected IStatus run(IProgressMonitor monitor) {
			monitor.beginTask("", 10); //$NON-NLS-1$
			try {
				JavaCore.initializeAfterLoad(new SubProgressMonitor(monitor, 6));
				JavaPlugin.initializeAfterLoad(new SubProgressMonitor(monitor, 4));
			} catch (CoreException e) {
				JavaPlugin.log(e);
				return e.getStatus();
			}
			return Status.OK_STATUS;
		}
		@Override
		public boolean belongsTo(Object family) {
			return JavaUI.ID_PLUGIN.equals(family);
		}
	}

	public InitializeAfterLoadJob() {
		super(JavaUIMessages.InitializeAfterLoadJob_starter_job_name);
		setSystem(true);
	}
	@Override
	public IStatus runInUIThread(IProgressMonitor monitor) {
		Job job = new RealJob(JavaUIMessages.JavaPlugin_initializing_ui);
		job.setPriority(Job.SHORT);
		job.schedule();
		return Status.OK_STATUS;
	}
}


text:
import {Subject, AnonymousSubject} from '../../Subject';
import {Subscriber} from '../../Subscriber';
import {Observable} from '../../Observable';
import {Subscription} from '../../Subscription';
import {root} from '../../util/root';
import {ReplaySubject} from '../../ReplaySubject';
import {Observer, NextObserver} from '../../Observer';
import {tryCatch} from '../../util/tryCatch';
import {errorObject} from '../../util/errorObject';
import {assign} from '../../util/assign';

export interface WebSocketSubjectConfig {
  url: string;
  protocol?: string | Array<string>;
  resultSelector?: <T>(e: MessageEvent) => T;
  openObserver?: NextObserver<Event>;
  closeObserver?: NextObserver<CloseEvent>;
  closingObserver?: NextObserver<void>;
  WebSocketCtor?: { new(url: string, protocol?: string|Array<string>): WebSocket };
}

/**
 * We need this JSDoc comment for affecting ESDoc.
 * @extends {Ignored}
 * @hide true
 */
export class WebSocketSubject<T> extends AnonymousSubject<T> {
  url: string;
  protocol: string|Array<string>;
  socket: WebSocket;
  openObserver: NextObserver<Event>;
  closeObserver: NextObserver<CloseEvent>;
  closingObserver: NextObserver<void>;
  WebSocketCtor: { new(url: string, protocol?: string|Array<string>): WebSocket };
  private _output: Subject<T> = new Subject<T>();

  resultSelector(e: MessageEvent) {
    return JSON.parse(e.data);
  }

  /**
   * @param urlConfigOrSource
   * @return {WebSocketSubject}
   * @static true
   * @name webSocket
   * @owner Observable
   */
  static create<T>(urlConfigOrSource: string | WebSocketSubjectConfig): WebSocketSubject<T> {
    return new WebSocketSubject<T>(urlConfigOrSource);
  }

  constructor(urlConfigOrSource: string | WebSocketSubjectConfig | Observable<T>, destination?: Observer<T>) {
    super();
    this.WebSocketCtor = root.WebSocket;

    if (typeof urlConfigOrSource === 'string') {
      this.url = urlConfigOrSource;
    } else {
      // WARNING: config object could override important members here.
      assign(this, urlConfigOrSource);
    }

    if (!this.WebSocketCtor) {
      throw new Error('no WebSocket constructor can be found');
    }

    this.destination = new ReplaySubject();
  }

  // TODO: factor this out to be a proper Operator/Subscriber implementation and eliminate closures
  multiplex(subMsg: () => any, unsubMsg: () => any, messageFilter: (value: T) => boolean) {
    const self = this;
    return new Observable((observer: Observer<any>) => {
      const result = tryCatch(subMsg)();
      if (result === errorObject) {
        observer.error(errorObject.e);
      } else {
        self.next(result);
      }

      let subscription = self.subscribe(x => {
        const result = tryCatch(messageFilter)(x);
        if (result === errorObject) {
          observer.error(errorObject.e);
        } else if (result) {
          observer.next(x);
        }
      },
        err => observer.error(err),
        () => observer.complete());

      return () => {
        const result = tryCatch(unsubMsg)();
        if (result === errorObject) {
          observer.error(errorObject.e);
        } else {
          self.next(result);
        }
        subscription.unsubscribe();
      };
    });
  }

  private _connectSocket() {
    const socket = this.protocol ? new WebSocket(this.url, this.protocol) : new WebSocket(this.url);
    this.socket = socket;
    const subscription = new Subscription(() => {
      this.socket = null;
      if (socket && socket.readyState === 1) {
        socket.close();
      }
    });

    const observer = this._output;

    socket.onopen = (e: Event) => {
      const openObserver = this.openObserver;
      if (openObserver) {
        openObserver.next(e);
      }

      const queue = this.destination;

      this.destination = Subscriber.create(
        (x) => socket.readyState === 1 && socket.send(x),
        (e) => {
          const closingObserver = this.closingObserver;
          if (closingObserver) {
            closingObserver.next(undefined);
          }
          if (e && e.code) {
            socket.close(e.code, e.reason);
          } else {
            observer.error(new TypeError('WebSocketSubject.error must be called with an object with an error code, ' +
              'and an optional reason: { code: number, reason: string }'));
          }
          this.destination = new ReplaySubject();
          this.socket = null;
        },
        ( ) => {
          const closingObserver = this.closingObserver;
          if (closingObserver) {
            closingObserver.next(undefined);
          }
          socket.close();
          this.destination = new ReplaySubject();
          this.socket = null;
        }
      );

      if (queue && queue instanceof ReplaySubject) {
        subscription.add((<ReplaySubject<T>>queue).subscribe(this.destination));
      }
    };

    socket.onerror = (e: Event) => observer.error(e);

    socket.onclose = (e: CloseEvent) => {
      const closeObserver = this.closeObserver;
      if (closeObserver) {
        closeObserver.next(e);
      }
      if (e.wasClean) {
        observer.complete();
      } else {
        observer.error(e);
      }
    };

    socket.onmessage = (e: MessageEvent) => {
      const result = tryCatch(this.resultSelector)(e);
      if (result === errorObject) {
        observer.error(errorObject.e);
      } else {
        observer.next(result);
      }
    };
  }

  protected _subscribe(subscriber: Subscriber<T>): Subscription {
    if (!this.socket) {
      this._connectSocket();
    }
    let subscription = new Subscription();
    subscription.add(this._output.subscribe(subscriber));
    subscription.add(() => {
      const { socket } = this;
      if (socket && socket.readyState === 1) {
        socket.close();
        this.socket = null;
      }
    });
    return subscription;
  }

  unsubscribe() {
    const { socket } = this;
    if (socket && socket.readyState === 1) {
      socket.close();
      this.socket = null;
    }
    super.unsubscribe();
    this.destination = new ReplaySubject();
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using XenAdmin.Network;
using XenAPI;

namespace XenAdmin.Mappings
{
    public class LiveMigrateOptionsVmMapping
    {
        private readonly VmMapping vmMapping;
        private readonly VM vm;

        public LiveMigrateOptionsVmMapping(VmMapping vmMapping, IXenObject vm)
        {
            this.vmMapping = vmMapping;
            this.vm = vm as VM;

            if(vm==null)
                throw new NullReferenceException("VM passed to ctor was null");
        }

        /// <summary>
        /// VDI ref to SR ref Map
        /// </summary>
        public Dictionary<XenRef<VDI>, XenRef<SR>> VdiMap
        {
            get
            {
                return vmMapping.Storage.ToDictionary(pair => new XenRef<VDI>(pair.Key),
                                                      pair => new XenRef<SR>(pair.Value));
            }
        }

        /// <summary>
        /// VIF to remote network
        /// </summary>
        public Dictionary<XenRef<VIF>, XenRef<XenAPI.Network>> VifMap
        {
            get
            {
                //VM mapping is network to network
                Dictionary<XenRef<VIF>, XenRef<XenAPI.Network>> map = new Dictionary<XenRef<VIF>, XenRef<XenAPI.Network>>();

                foreach (var pair in vmMapping.Networks)
                {
                    XenAPI.Network net = vm.Connection.Resolve(new XenRef<XenAPI.Network>(pair.Key));

                    List<XenRef<VIF>> selectedVIFs =  (from vifRef in net.VIFs
                                                       where vm.VIFs.Contains(vifRef)
                                                       select vifRef).ToList();

                    KeyValuePair<string, XenAPI.Network> closurePair = pair;
                    selectedVIFs.ForEach(v => map.Add(new XenRef<VIF>(v.opaque_ref),
                                         new XenRef<XenAPI.Network>(closurePair.Value.opaque_ref)));

                }

                return map;
            }
        }

        public bool Live
        {
            get { return true; }
        }

        public Dictionary<string, string> Options
        {
            get { return new Dictionary<string, string>(); }
        }
    }
}


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

using AutoRest.Core.Logging;
using AutoRest.Core.Properties;
using AutoRest.Core.Validation;
using AutoRest.Swagger.Model;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace AutoRest.Swagger.Validation
{
    public class BodyTopLevelProperties : TypedRule<Dictionary<string, Operation>>
    {

        private readonly Regex resourceRefRegEx = new Regex(@".+/Resource$", RegexOptions.IgnoreCase);
        private readonly string[] allowedTopLevelProperties = { "name", "type", "id", "location", "properties", "tags", "plan", "sku", "etag",
                                                                "managedBy", "identity"};

        /// <summary>
        /// Id of the Rule.
        /// </summary>
        public override string Id => "M3006";

        /// <summary>
        /// Violation category of the Rule.
        /// </summary>
        public override ValidationCategory ValidationCategory => ValidationCategory.RPCViolation;

        /// <summary>
        /// This rule passes if the body parameter contains top level properties only from the allowed set: name, type,
        /// id, location, properties, tags, plan, sku, etag, managedBy, identity
        /// </summary>
        /// <param name="paths"></param>
        /// <returns></returns>
        public override bool IsValid( Dictionary<string, Operation> path, RuleContext context, out object[] formatParameters)
        {
            List<string> notAllowedProperties = new List<string>();
            foreach (string operation in path.Keys)
            {
                if ((operation.ToLower().Equals("get") ||
                    operation.ToLower().Equals("put") ||
                    operation.ToLower().Equals("patch")) && path[operation]?.Parameters != null)
                {
                    foreach (SwaggerParameter param in path[operation].Parameters)
                    {
                        if (param.In == ParameterLocation.Body)
                        {
                            if (param?.Schema?.Reference != null)
                            {
                                string defName = Extensions.StripDefinitionPath(param.Schema.Reference);
                                var definition = ((ServiceDefinition)context.Root).Definitions[defName];
                                if (definition?.AllOf != null && definition.Properties != null &&
                                    definition.AllOf.Select(s => s.Reference).Where(reference => resourceRefRegEx.IsMatch(reference)) != null)
                                {
                                    //Model is allOf Resource
                                    foreach (KeyValuePair<string, Schema> prop in definition.Properties)
                                    {
                                        if (!allowedTopLevelProperties.Contains(prop.Key.ToLower()))
                                        {
                                            notAllowedProperties.Add(defName + "/" + prop.Key);
                                        }
                                    }
                                }
                            }
                            if (param?.Schema?.AllOf != null && param.Schema.Properties != null &&
                                param.Schema.AllOf.Select(s => s.Reference).Where(reference => resourceRefRegEx.IsMatch(reference)) != null)
                            {
                                //Model is allOf Resource
                                foreach (KeyValuePair<string, Schema> prop in param.Schema.Properties)
                                {
                                    if (!allowedTopLevelProperties.Contains(prop.Key.ToLower()))
                                    {
                                        notAllowedProperties.Add(path[operation].OperationId + ":" + prop.Key);
                                    }
                                }
                            }
                          }
                        }
                    }
                }
            formatParameters = new[] { string.Join(", ", notAllowedProperties.ToArray()) };
            return (notAllowedProperties.Count() == 0);
        }

        /// <summary>
        /// The template message for this Rule.
        /// </summary>
        /// <remarks>
        /// This may contain placeholders '{0}' for parameterized messages.
        /// </remarks>
        public override string MessageTemplate => Resources.AllowedTopLevelProperties;

        /// <summary>
        /// The severity of this message (ie, debug/info/warning/error/fatal, etc)
        /// </summary>
        public override Category Severity => Category.Error;

    }
}


text:
<?php

namespace IPS\core\modules\admin\membersettings;

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * ranks
 */
class _ranks extends \IPS\Dispatcher\Controller
{
	/**
	 * Execute
	 *
	 * @return	void
	 */
	public function execute()
	{
		\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );
		parent::execute();
	}

	/**
	 * Manage
	 *
	 * @return	void
	 */
	protected function manage()
	{
		/* Create the table */
		$table = new \IPS\Helpers\Table\Db( 'core_member_ranks', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );

		/* Columns */
		$table->joins = array(
			array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_member_rank_', core_member_ranks.id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
		);

		$table->include    = array( 'word_custom', 'posts', 'pips' );
		$table->langPrefix = 'member_ranks_';
		$table->mainColumn = 'title';
		$table->noSort	   = array( 'pips' );

		$table->parsers = array(
			'pips' => function( $val, $row )
			{
				if ( $row['use_icon'] and $row['icon'] )
				{
					return "url . "' alt=''>";
				}
				else
				{
					return str_repeat("", intval($val) );
				}
			}
		);

		$table->sortBy = $table->sortBy ?: 'posts';
		$table->sortDirection = $table->sortDirection ?: 'asc';

		/* Root Buttons */
		if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
		{
			$table->rootButtons = array(
					'add'	=> array(
						'icon'		=> 'plus',
						'title'		=> 'member_ranks_add',
						'data'		=> array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_add') ),
						'link'		=> \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form' ),
					)
			);
		}

		/* Row buttons */
		$table->rowButtons = function( $row )
		{
			$return = array();

			if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
			{
				$return['edit'] = array(
					'icon'		=> 'pencil',
					'title'		=> 'edit',
					'data'		=> array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('edit') ),
					'link'		=> \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form&id=' ) . $row['id'],
				);
			}

			if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
			{
				$return['delete'] = array(
					'icon'		=> 'times-circle',
					'title'		=> 'delete',
					'link'		=> \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=delete&id=' ) . $row['id'],
					'data'		=> array( 'delete' => '' ),
				);
			}

			return $return;
		};

		/* The incredibly complex search code */
		$table->quickSearch = 'word_custom';

		/* Show a message about the setting to allow members to set their own */
		switch ( \IPS\Settings::i()->post_titlechange )
		{
			case -1:
				$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_none');
				break;

			case 0:
				$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_always');
				break;

			default:
				$message = \IPS\Member::loggedIn()->language()->addToStack( 'rankown_limit', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->post_titlechange ) ) );
				break;
		}
		$message .= ' language()->addToStack('change') . '">' . \IPS\Member::loggedIn()->language()->addToStack('change') . '';
		\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( $message, 'information', NULL, FALSE );

		/* Display */

		\IPS\Output::i()->title		= \IPS\Member::loggedIn()->language()->addToStack('ranks');
		\IPS\Output::i()->output	.= \IPS\Theme::i()->getTemplate( 'global' )->block( 'ranks', (string) $table );
	}

	/**
	 * Add/Edit Rank
	 */
	public function form()
	{
		$current = NULL;

		if ( \IPS\Request::i()->id )
		{
			$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();
		}

		/* Build form */
		$form = new \IPS\Helpers\Form();

		$form->add( new \IPS\Helpers\Form\Translatable( 'member_ranks_word_custom', NULL, TRUE, array( 'app' => 'core', 'key' => ( $current ? "core_member_rank_{$current['id']}" : NULL ) ) ) );
		$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_posts', $current ? $current['posts'] : 0, TRUE, array( 'min' => 0 ) ) );

		$form->add( new \IPS\Helpers\Form\Radio( 'member_use_icon', $current['use_icon'], FALSE, array(
			'parse'		=> 'raw',
			'options'	=> array( 0 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_number', FALSE, array( 'htmlsprintf' => array( "" ) ) ), 1 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_icon') ),
			'toggles'	=> array( 0 => array('member_ranks_pips'), 1 => array('member_ranks_icon') )
		) ) );

		/* Pip Icon */
		$pip = NULL;
		if ( $current['icon'] )
		{
			$pip = \IPS\File::get( 'core_Theme', $current['icon'] );
		}
		$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_num_pips' , $current ? $current['pips']  : 0, FALSE, array( 'min' => 0, 'max' => 100 ), NULL, NULL, NULL, 'member_ranks_pips' ) );
		$form->add( new \IPS\Helpers\Form\Upload( 'member_ranks_icon', $pip, FALSE, array( 'image' => array( 'maxWidth' => 140, 'maxHeight' => 140 ), 'storageExtension' => 'core_Theme' ), NULL, NULL, NULL, 'member_ranks_icon' ) );

		if ( $values = $form->values() )
		{
			$save = array(
				'posts'    => intval( $values['member_ranks_posts'] ),
				'pips'	   => intval( $values['member_ranks_num_pips'] ),
				'use_icon' => intval( $values['member_use_icon'] ),
				'icon'		=> '',
			);

			if ( $values['member_ranks_icon'] instanceof \IPS\File )
			{
				$save['icon'] = (string) $values['member_ranks_icon'];
			}

			if ( $current )
			{
				\IPS\Db::i()->update( 'core_member_ranks', $save, array( 'id=?', $current['id'] ) );
				$id = $current['id'];
				\IPS\Session::i()->log( 'acplogs__rank_edited', array( $save['posts'] => FALSE ) );
			}
			else
			{
				$id = \IPS\Db::i()->insert( 'core_member_ranks', $save );
				\IPS\Session::i()->log( 'acplogs__rank_created', array( $save['posts'] => FALSE ) );
			}

			\IPS\Lang::saveCustom( 'core', "core_member_rank_{$id}", $values['member_ranks_word_custom'] );
			unset( \IPS\Data\Store::i()->ranks );

			/* Clear guest page caches */
			\IPS\Data\Cache::i()->clearAll();

			\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
		}

		/* Display */
		\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( $current ? "core_member_rank_{$current['id']}" : 'add', $form, FALSE );
	}

	/**
	 * Delete
	 *
	 * @return	void
	 */
	public function delete()
	{
		\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );

		/* Make sure the user confirmed the deletion */
		\IPS\Request::i()->confirmedDelete();

		try
		{
			$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();

			\IPS\Session::i()->log( 'acplogs__rank_deleted', array( $current['posts'] => FALSE ) );
			\IPS\Db::i()->delete( 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) );
			\IPS\Lang::deleteCustom( 'core', 'core_member_rank_' . \IPS\Request::i()->id );
		}
		catch ( \UnderflowException $e ) { }

		unset( \IPS\Data\Store::i()->ranks );

		/* Clear guest page caches */
		\IPS\Data\Cache::i()->clearAll();

		\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );
	}

	/**
	 * Settings
	 *
	 * @return	void
	 */
	public function settings()
	{
		$form = new \IPS\Helpers\Form;
		$form->add( new \IPS\Helpers\Form\Number( 'post_titlechange', \IPS\Settings::i()->post_titlechange, FALSE, array( 'unlimited' => -1, 'unlimitedLang' => 'never_allow' ) ) );
		if ( $form->values() )
		{
			$form->saveAsSettings();
			\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
		}
		\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'ranks', $form, FALSE );
	}
}


text:
function roadRadar([speed, drivingArea]) {
    let speedOverflow;

    switch (drivingArea.toLowerCase()) {
        case "motorway":
            speedOverflow = speed - 130;
            break;
        case "interstate":
            speedOverflow = speed - 90;
            break;
        case "city":
            speedOverflow = speed - 50;
            break;
        case "residential":
            speedOverflow = speed - 20;
            break;
    }
    if (speedOverflow <= 0) {
        return '';
    } else if (speedOverflow <= 20) {
        return "speeding";
    } else if (speedOverflow <= 40) {
        return "excessive speeding";
    } else {
        return "reckless driving";
    }
}


text:
package logbook.bean;

import java.io.Serializable;

import javax.json.JsonObject;

import logbook.internal.JsonHelper;
import lombok.Data;

/**
 * api_mst_maparea
 *
 */
@Data
public class Maparea implements Serializable {

    private static final long serialVersionUID = 3065470938786532030L;

    /** api_id */
    private Integer id;

    /** api_name */
    private String name;

    /** api_type */
    private Integer type;

    /**
     * JsonObjectから{@link Maparea}を構築します
     *
     * @param json JsonObject
     * @return {@link Maparea}
     */
    public static Maparea toMaparea(JsonObject json) {
        Maparea bean = new Maparea();
        JsonHelper.bind(json)
                .setInteger("api_id", bean::setId)
                .setString("api_name", bean::setName)
                .setInteger("api_type", bean::setType);
        return bean;
    }
}


text:
<refentry xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="5.0" xml:id="man.output.base.dir">
<refmeta>
<refentrytitle>man.output.base.dir</refentrytitle>
<refmiscinfo class="other" otherclass="datatype">uri</refmiscinfo>
</refmeta>
<refnamediv>
<refname>man.output.base.dir</refname>
<refpurpose>Specifies separate output directory</refpurpose>
</refnamediv>

<refsynopsisdiv>
<src:fragment xml:id="man.output.base.dir.frag"><xsl:param name="man.output.base.dir">man/</xsl:param></src:fragment>
</refsynopsisdiv>

<refsection><info><title>Description</title></info>

<para>The <parameter>man.output.base.dir</parameter> parameter
specifies the base directory into which man-page files are output. The
<parameter>man.output.subdirs.enabled</parameter> parameter controls
whether the files are output in subdirectories within the base
directory.</para>

<note>
  <para>The values of the <parameter>man.output.base.dir</parameter>
  and <parameter>man.output.subdirs.enabled</parameter> parameters are
  used only if the value of
  <parameter>man.output.in.separate.dir</parameter> parameter is
  non-zero. If the value of the
  <parameter>man.output.in.separate.dir</parameter> is zero, man-page
  files are not output in a separate directory.</para>
</note>

</refsection>
</refentry>


text:
module Puppet::Parser::Functions
  newfunction(:deprecation, :doc => <<-EOS
  Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.).
EOS
  ) do |arguments|

    raise(Puppet::ParseError, "deprecation: Wrong number of arguments given (#{arguments.size} for 2)") unless arguments.size == 2

    key = arguments[0]
    message = arguments[1]

    if ENV['STDLIB_LOG_DEPRECATIONS'] == "true"
      warning("deprecation. #{key}. #{message}")
    end
  end
end


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycologia 71(1): 193 (1979)

#### Original name
Acaulospora gerdemannii N.C. Schenck & T.H. Nicolson, 1979

### Remarks
null


text:
'use strict';

var Promise = require('bluebird');

function renderPostFilter() {
  var self = this;

  function renderPosts(model) {
    var posts = model.toArray().filter(function(post) {
      return post.content == null;
    });

    return Promise.map(posts, function(post) {
      post.content = post._content;

      return self.post.render(post.full_source, post).then(function() {
        return post.save();
      });
    });
  }

  return Promise.all([
    renderPosts(this.model('Post')),
    renderPosts(this.model('Page'))
  ]);
}

module.exports = renderPostFilter;


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = filterEvents;

var _contains = _interopRequireDefault(require("../query/contains"));

var _querySelectorAll = _interopRequireDefault(require("../query/querySelectorAll"));

function filterEvents(selector, handler) {
  return function filterHandler(e) {
    var top = e.currentTarget,
        target = e.target,
        matches = (0, _querySelectorAll.default)(top, selector);
    if (matches.some(function (match) {
      return (0, _contains.default)(match, target);
    })) handler.call(this, e);
  };
}

module.exports = exports["default"];


text:
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Models.Membership;

namespace Umbraco.Cms.Core.Notifications
{
    public sealed class UserDeletedNotification : DeletedNotification<IUser>
    {
        public UserDeletedNotification(IUser target, EventMessages messages) : base(target, messages)
        {
        }
    }
}


text:
var express = require('express'),       // the main ssjs framework
    routes = require('./routes'),       // by default, brings in routes/index.js
    path = require('path'),             // for pathn manipulation
    db = require('./config/db'),        // database connection
    passport = require('passport'),     // for user authentication
    auth = require('./config/middlewares/authorization'), // helper methods for authentication
    constants = require('./config/constants'),
    app = express();//,                    // create an express app
    // RedisStore = require('connect-redis')(express); // for persistent sessions
var session = require('cookie-session');

// var redis;
// var redisURI = process.env.MONGOLAB_URI || 'redis://redistogo:57028c3a314873902459d1407db1657e@greeneye.redistogo.com:11571/';
// if (redisURI) {
//     console.log("using reditogo");
//     rtg   = require('url').parse(redisURI);
//     redis = require('redis').createClient(rtg.port, rtg.hostname);
//     redis.auth(rtg.auth.split(':')[1]); // auth 1st part is username and 2nd is password separated by ":"
// } else {
//     console.log("using local redis");
//     redis = require("redis").createClient();
// }

app.configure(function(){
    app.set('port', process.env.PORT || 8888);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(function(req, res, next) {
        if (req.url != '/favicon.ico') {
            return next();
        } else {
            res.status(200);
            res.header('Content-Type', 'image/x-icon');
            res.header('Cache-Control', 'max-age=4294880896');
            res.end();
        }
    });
    app.use(express.static(path.join(__dirname, 'public')));
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.cookieParser('keyboard cat'));
    app.use(session({
      keys: ['key1', 'key2']
    }));
    app.use(passport.initialize());
    app.use(passport.session());
    app.use(app.router);
});

app.get('/', routes.index);
app.get('/app', routes.app);

app.get('/auth/facebook', passport.authenticate("facebook", {scope: ['email', 'user_likes', 'create_event']}));
app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/auth/error' }), routes.authSuccess);
app.get('/auth/error', routes.authError);

// returns the 3 movies in the queue
app.get('/get_movies', auth.requiresLogin, routes.getMovies);
// POST and send the movie object. Reorders the queue based on this like
app.post('/liked', auth.requiresLogin, routes.movieLiked);
// GET all friends who have liked this movie too
app.get('/friends_like_too', auth.requiresLogin, routes.getFriendsWhoLike);

// make the event for this movie
app.post('/make_event', auth.requiresLogin, routes.makeEvent);

// recommend a movie to another user
app.post('/recommend', auth.requiresLogin, routes.recommend);

// find users matching a search criteria on name
app.get('/search', auth.requiresLogin, routes.search);

// all movies i liked
app.get('/all_likes', auth.requiresLogin, routes.allLikes);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
        res.status(err.status || 500);
        res.render('error', {
            message: err.message,
            error: err
        });
    });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        error: {}
    });
});

require('./config/pass.js')(passport);

var server = require('http').createServer(app);
server.listen(app.get('port'));
console.log('Express server listening on port ' + app.get('port'));


text:
using picojson::value;
using picojson::object;
using picojson::array;

namespace gltf {
namespace io {

    class gltf_exception : public std::runtime_error {
    public:
        gltf_exception(char const * what) : std::runtime_error(what) {}
    };

    namespace {
        using std::experimental::optional;

        template<class T> struct ReadAs  { using Type = T; };
        template<> struct ReadAs<size_t> { using Type = int64_t; };
        template<> struct ReadAs<uint>   { using Type = int64_t; };

        template<class T>
        T get_or_throw(picojson::value const& from, char const* error) {
            using TR = typename ReadAs<T>::Type;

            if (!from.is<TR>()) throw gltf_exception(error);
            return T(from.get<TR>());
        }

        template<class T>
        struct Reader {
            T operator()(picojson::value const& from)
            {
                return get_or_throw<T>(from, ("Expected a " + std::string(typeid(T).name())).c_str());
            }
        };

        template<class T>
        struct Reader<std::vector<T>> {
            std::vector<T> operator()(picojson::value const& from)
            {
                auto arr = get_or_throw<picojson::array>(from, "Expected an array.");

                std::vector<T> result;
                for (auto&& e : arr) {
                    result.push_back(Reader<T>()(e));
                }
                return result;
            }
        };

        template<class T>
        optional<T> read_optional(picojson::object const& obj, std::string const& index)
        {
            auto it = obj.find(index);
            if (it == end(obj)) return {};

            return Reader<T>()(it->second);
        }

        template<class T>
        std::vector<T> read_vec(picojson::object const& obj, std::string const& index)
        {
            return read_optional<std::vector<T>>(obj, index).value_or(std::vector<T>());
        }

        template<class T>
        T read_mandatory(picojson::object const& obj, std::string const& index)
        {
            auto opt = read_optional<T>(obj, index);
            if (!opt) throw gltf_exception((("missing required attribute " + index).c_str()));
            return opt.value();
        }

        template<>
        struct Reader<Buffer> {
            Buffer operator()(picojson::value const& val) {
                Buffer buffer;
                auto&& obj = get_or_throw<object>(val, "Expected buffer to be an object.");

                buffer.byteLength = read_optional<size_t>(obj, "byteLength").value_or(0);
                buffer.uri        = read_optional<std::string>(obj, "uri");

                return buffer;
            }
        };

        template<>
        struct Reader<BufferView> {
            BufferView operator()(picojson::value const& val) {
                BufferView view;
                auto&& obj = get_or_throw<object>(val, "Expected bufferView to be an object.");

                view.buffer = read_mandatory<size_t>(obj, "buffer");
                view.byteLength = read_optional<size_t>(obj, "byteLength").value_or(0);
                view.byteLength = read_optional<size_t>(obj, "byteOffset").value_or(0);
                view.byteStride = read_optional<size_t>(obj, "byteStride").value_or(0);
                view.target = read_mandatory<uint>(obj, "target");

                return view;
            }
        };

        template<>
        struct Reader<Accessor> {
            Accessor operator()(picojson::value const& val) {
                Accessor acc;
                auto&& obj = get_or_throw<object>(val, "Expected accessor to be an object.");

                acc.bufferView = read_mandatory<size_t>(obj, "bufferView");
                acc.byteOffset = read_optional<size_t>(obj, "byteOffset").value_or(0);
                acc.componentType = Accessor::ComponentType(read_mandatory<size_t>(obj, "byteOffset"));
                acc.count = read_mandatory<size_t>(obj, "count");
                acc.min = read_vec<double>(obj, "min");
                acc.max = read_vec<double>(obj, "max");
                acc.type = read_optional<std::string>(obj, "type").value_or("");

                return acc;
            }
        };

        template<>
        struct Reader<Node> {
            Node operator()(picojson::value const& val){
                Node node;
                auto&& obj = get_or_throw<object>(val, "Expected node to be an object.");

                node.children = read_optional<std::vector<size_t>>(obj, "children").value_or(std::vector<size_t>{});
                {
                    auto matrixit = obj.find("matrix");
                    if (matrixit != obj.end())
                    {
                        auto&& matrix = get_or_throw<array>(matrixit->second, "Expected matrix to be an array.");
                        if (matrix.size() != 16) throw gltf_exception("The matrix should have 16 elements.");

                        for (size_t i = 0; i < 16; i++) {
                            glm::value_ptr(node.matrix)[i] = get_or_throw<double>(matrix[i], "Expected matrix entry to be a number.");
                        }
                    }
                }
                return node;
            }
        };

        template<>
        struct Reader<Scene> {
            Scene operator()(picojson::value const& val) {
                Scene scene;
                return scene;
            }
        };

        template<>
        struct Reader<Camera::Orthographic> {
            Camera::Orthographic operator()(picojson::value const& val) {
                Camera::Orthographic ortho;
                auto&& obj = get_or_throw<picojson::object>(val, "Expected orthographic to be an object.");

                ortho.xmag = read_mandatory<double>(obj, "xmag");
                ortho.ymag = read_mandatory<double>(obj, "ymag");
                ortho.zfar = read_mandatory<double>(obj, "zfar");
                ortho.znear = read_mandatory<double>(obj, "znear");

                return ortho;
            }
        };

        template<>
        struct Reader<Camera::Perspective> {
            Camera::Perspective operator()(picojson::value const& val) {
                Camera::Perspective pers;
                auto&& obj = get_or_throw<picojson::object>(val, "Expected perspective to be an object.");

                pers.aspectRatio = read_optional<double>(obj, "aspectRatio").value_or(1.0);
                pers.yfov = read_mandatory<double>(obj, "yfov");
                pers.zfar = read_optional<double>(obj, "zfar");
                pers.znear = read_mandatory<double>(obj, "znear");

                return pers;
            }
        };

        template<>
        struct Reader<Camera> {
            Camera operator()(picojson::value const& val) {
                Camera cam;
                auto&& obj = get_or_throw<picojson::object>(val, "Expected camera to be an object.");

                cam.name = read_optional<std::string>(obj, "name").value_or("");
                cam.orthographic = read_optional<Camera::Orthographic>(obj, "orthographic");
                cam.perspective = read_optional<Camera::Perspective>(obj, "perspective");
                cam.type = read_optional<std::string>(obj, "type").value_or("");

                return cam;
            }
        };
    }

    Root readFromFile(std::string const& filename) {
        Root root;

        auto file = std::ifstream(filename);
        if (!file) throw gltf_exception("could not open file");

        picojson::value jval;
        picojson::parse(jval, file);

        auto&& rootobj = get_or_throw<picojson::object>(jval, "Expected the gltf root to be an object.");

        root.cameras = read_vec<Camera>(rootobj, "cameras");
        root.nodes = read_vec<Node>(rootobj, "nodes");
        root.scenes = read_vec<Scene>(rootobj, "scenes");
        root.buffers = read_vec<Buffer>(rootobj, "buffers");
        root.bufferViews = read_vec<BufferView>(rootobj, "bufferViews");
        root.accessors = read_vec<Accessor>(rootobj, "accessors");

        return root;
    }
}
}


text:
include_recipe "mediawiki"

passwords = data_bag_item("foundation", "passwords")

mediawiki_site "mwg.osmfoundation.org" do
  sitename "OSMF Membership Working Group Wiki"
  metanamespace "OSMFMWG"
  directory "/srv/mwg.osmfoundation.org"
  fpm_prometheus_port 11003
  database_name "mwg_wiki"
  database_user "mwg_wikiuser"
  database_password passwords["mwg"]["database"]
  admin_password passwords["mwg"]["admin"]
  logo "/Wiki.png"
  email_contact "webmaster@openstreetmap.org"
  email_sender "webmaster@openstreetmap.org"
  email_sender_name "OSMF Board Wiki"
  private_site true
  version "1.38"
end

cookbook_file "/srv/mwg.osmfoundation.org/Wiki.png" do
  owner node[:mediawiki][:user]
  group node[:mediawiki][:group]
  mode "644"
end


text:
<?php

namespace Phprest\Response;

use InvalidArgumentException;
use Phprest\HttpFoundation\Response;

class Created extends Response
{
    /**
     * @param string $location The value of the Location header
     * @param mixed $content The response content, see setContent()
     * @param array $headers An array of response headers
     *
     * @throws InvalidArgumentException When the HTTP status code is not valid
     *
     * @api
     */
    public function __construct($location, $content = '', $headers = [])
    {
        parent::__construct($content, Response::HTTP_CREATED, $headers);

        $this->headers->set('Location', $location);
    }
}


text:
{% extends "layout.html" %} {% include 'pageMacros.html' %} {% include 'components/_index.html' %} {% include 'svg/_index.html' %} {% block bodyClass %}{{ super() }} home-page{% endblock %} {# breadcrumbs are excluded from the homepage #} {% block breadcrumbs %} {% endblock %} {% block main %}

Coldbot . Coffee

              Fresh global coffee varieties delivered

 right to your doorstep.

Taste a new coffee each month

Fresh Roasted Coffee,
From Around the World.

          Unique varieties from all over the world, roasted and shipped same day.
 Each coffee is sourced for quality and roasted with the Cold brewing process in mind.

Convenient, tasty and accessible.

Start truly experiencing your coffee.
Starting at $17.10/month.
Shipping included.

          Subscribe Now

        <svg class="hidden-xs hidden-sm" style="z-index: -1;position: absolute;  right: 109px;width: 125px;opacity: .3;top: 200px;" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="228.013px" height="251.242px" viewBox="0 0 228.013 251.242" enable-background="new 0 0 228.013 251.242" xml:space="preserve">
          <path fill="none" stroke="#000000" stroke-width="6" stroke-miterlimit="10" d="M4,110v97.656v0.172c3,21,38.606,38.414,82,38.414
  s78-17.371,80-38.371v-0.215V110H4z" />
          <path fill="none" stroke="#000000" stroke-width="6" stroke-miterlimit="10" d="M185.589,205.615
  c45.501-26.762,54.11-95.884,0-95.884" />
          <rect x="22" y="77" rx="6" ry="6" fill="#000000" width="18" class="smoke-1" height="18" />
          <rect x="75" y="77" rx="6" ry="6" fill="#000000" width="18" class="smoke-2" height="18" />
          <rect x="130" y="77" rx="6" ry="6" fill="#000000" width="18" class="smoke-3" height="18" />
        </svg>

Expand your knowledge and your taste buds

Recipes

 Our creative and tasty coffee recipes

will have you coming back for more.

 Try a new take on coffee.

Product Reviews

New coffee products are put to the test,

see which ones are worthy.

Brewing Guides

Don't spend countless hours searching the web. We'll show you how to get the most

 out of your beans.

Exlpore Coffee

{% endblock %}


text:
#include "bgp/extended-community/types.h"
#include "bgp/origin-vn/origin_vn.h"

#include <stdio.h>

#include <algorithm>

using std::copy;
using std::string;

OriginVn OriginVn::null_originvn;

OriginVn::OriginVn() {
    data_.fill(0);
}

OriginVn::OriginVn(as2_t asn, uint32_t vn_index) {
    data_[0] = BgpExtendedCommunityType::Experimental;
    data_[1] = BgpExtendedCommunityExperimentalSubType::OriginVn;
    put_value(&data_[2], 2, asn);
    put_value(&data_[4], 4, vn_index);
}

OriginVn::OriginVn(const bytes_type &data) {
    copy(data.begin(), data.end(), data_.begin());
}

OriginVn OriginVn::FromString(const string &str,
    boost::system::error_code *errorp) {
    OriginVn origin_vn;
    uint8_t data[OriginVn::kSize];
    size_t pos = str.find(':');
    if (pos == string::npos) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    string first(str.substr(0, pos));
    if (first != "originvn") {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    string rest(str.substr(pos+1));

    pos = rest.find(':');
    if (pos == string::npos) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    string second(rest.substr(0, pos));
    char *endptr;
    int64_t asn = strtol(second.c_str(), &endptr, 10);
    if (asn == 0 || asn >= 65535 || *endptr != '\0') {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    string third(rest.substr(pos+1));
    uint64_t value = strtol(third.c_str(), &endptr, 10);
    if (*endptr != '\0') {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    // Check assigned number.
    if (value > 0xFFFFFFFF) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn::null_originvn;
    }

    data[0] = BgpExtendedCommunityType::Experimental;
    data[1] = BgpExtendedCommunityExperimentalSubType::OriginVn;
    put_value(&data[2], 2, asn);
    put_value(&data[4], 4, value);
    copy(&data[0], &data[OriginVn::kSize], origin_vn.data_.begin());
    return origin_vn;
}

as2_t OriginVn::as_number() const {
    if (data_[0] == BgpExtendedCommunityType::Experimental &&
            data_[1] == BgpExtendedCommunityExperimentalSubType::OriginVn) {
        as2_t as_number = get_value(data_.data() + 2, 2);
        return as_number;
    }
    return 0;
}

int OriginVn::vn_index() const {
    if (data_[0] == BgpExtendedCommunityType::Experimental &&
            data_[1] == BgpExtendedCommunityExperimentalSubType::OriginVn) {
        int vn_index = get_value(data_.data() + 4, 4);
        return vn_index;
    }
    return 0;
}

bool OriginVn::IsGlobal() const {
    return (vn_index() >= kMinGlobalId);
}

string OriginVn::ToString() {
    char temp[50];
    snprintf(temp, sizeof(temp), "originvn:%u:%u", as_number(), vn_index());
    return string(temp);
}

OriginVn4ByteAs OriginVn4ByteAs::null_originvn;

OriginVn4ByteAs::OriginVn4ByteAs() {
    data_.fill(0);
}

OriginVn4ByteAs::OriginVn4ByteAs(as_t asn, uint32_t vn_index) {
    data_[0] = BgpExtendedCommunityType::Experimental4ByteAs;
    data_[1] = BgpExtendedCommunityExperimentalSubType::OriginVn;
    put_value(&data_[2], 4, asn);
    put_value(&data_[4], 2, vn_index);
}

OriginVn4ByteAs::OriginVn4ByteAs(const bytes_type &data) {
    copy(data.begin(), data.end(), data_.begin());
}

OriginVn4ByteAs OriginVn4ByteAs::FromString(const string &str,
    boost::system::error_code *errorp) {
    OriginVn4ByteAs origin_vn;
    uint8_t data[OriginVn4ByteAs::kSize];
    size_t pos = str.find(':');
    if (pos == string::npos) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    string first(str.substr(0, pos));
    if (first != "originvn") {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    string rest(str.substr(pos+1));

    pos = rest.find(':');
    if (pos == string::npos) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    string second(rest.substr(0, pos));
    char *endptr;
    int64_t asn = strtol(second.c_str(), &endptr, 10);
    if (asn == 0 || asn >= 65535 || *endptr != '\0') {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    string third(rest.substr(pos+1));
    uint64_t value = strtol(third.c_str(), &endptr, 10);
    if (*endptr != '\0') {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    // Check assigned number.
    if (value > 0xFFFFFFFF) {
        if (errorp != NULL) {
            *errorp = make_error_code(boost::system::errc::invalid_argument);
        }
        return OriginVn4ByteAs::null_originvn;
    }

    data[0] = BgpExtendedCommunityType::Experimental4ByteAs;
    data[1] = BgpExtendedCommunityExperimentalSubType::OriginVn;
    put_value(&data[2], 4, asn);
    put_value(&data[4], 2, value);
    copy(&data[0], &data[OriginVn4ByteAs::kSize], origin_vn.data_.begin());
    return origin_vn;
}

as_t OriginVn4ByteAs::as_number() const {
    if (data_[0] == BgpExtendedCommunityType::Experimental4ByteAs &&
            data_[1] == BgpExtendedCommunityExperimentalSubType::OriginVn) {
        as_t as_number = get_value(data_.data() + 2, 4);
        return as_number;
    }
    return 0;
}

int OriginVn4ByteAs::vn_index() const {
    if (data_[0] == BgpExtendedCommunityType::Experimental &&
            data_[1] == BgpExtendedCommunityExperimentalSubType::OriginVn) {
        int vn_index = get_value(data_.data() + 6, 2);
        return vn_index;
    }
    return 0;
}

bool OriginVn4ByteAs::IsGlobal() const {
    return (vn_index() >= kMinGlobalId);
}

string OriginVn4ByteAs::ToString() {
    char temp[50];
    snprintf(temp, sizeof(temp), "originvn:%u:%u", as_number(), vn_index());
    return string(temp);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/objects/media/member-and-leader-services-mls" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/objects/media/member-and-leader-services-mls</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Member and Leader Services (MLS)</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/objects/media/member-and-leader-services-mls</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/objects/media/member-and-leader-services-mls</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object>
  </sem:triple>
</sem:triples>


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Applesauce Quick Bread</title>
      <categories>
        <cat>Bread</cat></categories>
      <yield>10</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>2 1/2</qty>
          <unit>cups</unit></amt>
        <item>Unbleached all-purpose flour</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit>teaspoons</unit></amt>
        <item>Baking powder</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>teaspoons</unit></amt>
        <item>Salt</item></ing>
      <ing>
        <amt>
          <qty>1/2</qty>
          <unit>cups</unit></amt>
        <item>Brown sugar; firmly packed</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>tablespoon</unit></amt>
        <item>Ground cinnamon</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>cup</unit></amt>
        <item>Applesauce</item></ing>
      <ing>
        <amt>
          <qty>2</qty>
          <unit/></amt>
        <item>Egg whites (I used 1/4 cup liquid egg substitute)</item></ing>
      <ing>
        <amt>
          <qty>1</qty>
          <unit>cup</unit></amt>
        <item>Skim milk</item></ing></ingredients>
    <directions>
      <step>  Date: Fri, 7 Jun 1996 08:11:30 -0700

  From: bwatson@cisco.com (Bethann Watson)
  I tried this recipe from Sarah Schlesinger's cookbook "500 Fat-Free
  Recipes," and it is very good. I've had a slice of this bread and a cup of
  nonfat yogurt for breakfast the last few days. The bread is also a good
  evening snack. Thought others in the group would like it.  BTW, I love
  Sarah Schlesinger's cookbook--heard about it on this list, too! Every
  recipe I have tried has come out very well. I heartily recommend it.

  Combine the flour, baking powder, salt, sugar, and cinnamon. Stir in the
  applesauce, egg whites, and milk. Pour into a nonstick loaf pan, or a pan
  lined witha baking pan liner or lightly sprayed with vegetable cooking
  spray. Let stand for 1 hour.

  Preheat oven to 325F. Bake bread for 50 minutes or until a wooden pick
  inserted in the center of the bread comes out dry. Cool in pan for 10
  minutes, then transfer to a wire rack to cool. Makes 10 servings.

  You could probably add chopped, dried fruit to this recipe without any
  problems. Also, soy or rice milk (or even spice tea) could probably be
  substituted for the skim milk. To make it more of a spice bread, next time
  I will reduce the cinnamon to 2 1/2 teaspoons and add 1/4 teaspoon nutmeg,
  1/8 teaspoon cloves, and 1/8 teaspoon cardamom.

  FATFREE DIGEST V96 #158

  From the Fatfree Vegetarian recipe list.  Downloaded from Glen's MM Recipe
  Archive, http://www.erols.com/hosey.

</step></directions></recipe></recipeml>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Biblthca Mycol. 150: 206 (1993)

#### Original name
Lachnum pseudoclandestinum Raitv.

### Remarks
null


text:
local actor = tengine.actor
local emitter = tengine.Emitter
local timer = tengine.timer

local INFO_MSG = tengine.INFO_MSG
local ERROR_MSG = tengine.ERROR_MSG
local p = tengine.p

local _M = {}

local global_objects = {}

local function _on_register_service(type, s)
    --INFO_MSG("after 5s, start game ...")
    timer.callback(0, function(...)
        if type == 'gate' then
            local _gate = actor.sync(s)
            local ok, ret = _gate.start_game()
            if not ok or ret ~= 0 then
                ERROR_MSG("start game logic failed !!!")
            else
                INFO_MSG("start game ok ...")

                -- TODO 通知登录服
            end
        end
    end, type, s)
end

function _M.init(self, conf)
    if not self.__init then
        self.__init = true
        self.event = emitter:new()

        -- 当第一个gate注册上来就通知他启动游戏逻辑
        self.event:once("register_service", _on_register_service)
    end
end

function _M.trigger(self, name, ...)
    local event = self.event
    if event then
        event:emit(name, ...)
    end
end

function _M.get_global_object(type)
    return global_objects[type]
end

function _M.add_global_object(type, s)
    global_objects[type] = s
end

function _M.del_global_object(type)
    global_objects[type] = nil
end

return _M


text:
require 'test_helper'
require 'garen'

class Garen::ChampionMasteryTest < Minitest::Test
  def setup
    @garen = Garen::Client.new(api_key: 'RGAPI-ed14c2ae-a063-4195-a3d6-bc5ad541e191')
  end

  def test_by_summoner_id
    VCR.use_cassette 'champion_mastery/by_summoner_id' do
      champion_mastery = @garen.champion_mastery.by_summoner_id(22_332_661)
      assert_equal true, champion_mastery.is_a?(Array)
      cm = champion_mastery.first
      assert_equal 22_332_661, cm.player_id
      assert_equal 64, cm.champion_id
      assert_equal 7, cm.champion_level
      assert_equal 74_041, cm.champion_points
      assert_equal 1_498_972_686_000, cm.last_play_time
      assert_equal 52_441, cm.champion_points_since_last_level
      assert_equal 0, cm.champion_points_until_next_level
      assert_equal true, cm.chest_granted
      assert_equal 0, cm.tokens_earned
    end
  end

  def test_by_summoner_id_with_headers
    VCR.use_cassette 'champion_mastery/by_summoner_id_with_headers' do
      @garen = Garen::Client.new(api_key: 'RGAPI-cd7020de-1039-474b-93d5-4dfe0d201c1c')
      champion_mastery = @garen.champion_mastery.by_summoner_id(22_332_661, return_rate_limits: true)
      assert_equal '1:120,1:1', champion_mastery.rate_limit.app_count
      assert_equal '1:10,1:600', champion_mastery.rate_limit.method_count
    end
  end

  def test_by_summoner_and_champ_id
    VCR.use_cassette 'champion_mastery/by_summoner_and_champ_id' do
      cm = @garen.champion_mastery.by_summoner_and_champion_id(22_332_661, 64)
      assert_equal 22_332_661, cm.player_id
      assert_equal 64, cm.champion_id
      assert_equal 7, cm.champion_level
      assert_equal 74_041, cm.champion_points
      assert_equal 1_498_972_686_000, cm.last_play_time
      assert_equal 52_441, cm.champion_points_since_last_level
      assert_equal 0, cm.champion_points_until_next_level
      assert_equal true, cm.chest_granted
      assert_equal 0, cm.tokens_earned
    end
  end

  def test_score_by_summoner_id
    VCR.use_cassette 'champion_mastery/score_by_summoner_id' do
      cm = @garen.champion_mastery.score_by_summoner_id(22_332_661)
      assert_equal 313, cm
    end
  end

  def test_by_summoner_id_not_found
    VCR.use_cassette 'champion_mastery/by_summoner_id_not_found' do
      cm = @garen.champion_mastery.by_summoner_id(999_999_999_999)
      assert_equal [], cm
    end
  end

  def test_by_summoner_and_champ_not_found_summoner_id
    VCR.use_cassette 'champion_mastery/by_summoner_and_champ_not_found_summoner_id' do
      assert_raises(Faraday::Error::ClientError) { @garen.champion_mastery.by_summoner_and_champion_id(999_999_999_999, 64) }
    end
  end

  def test_by_summoner_and_champ_not_found_champ_id
    VCR.use_cassette 'champion_mastery/by_summoner_and_champ_not_found_champ_id' do
      assert_raises(Faraday::Error::ClientError) { @garen.champion_mastery.by_summoner_and_champion_id(22_332_661, 999_999_999) }
    end
  end

  def test_score_by_summoner_id_not_found
    VCR.use_cassette 'champion_mastery/score_by_summoner_id_not_found' do
      assert_equal 0, @garen.champion_mastery.score_by_summoner_id(999_999_999)
    end
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<artifactId>demo</artifactId>
	<name>AndroidFindView Demo</name>
	<packaging>apk</packaging>

	<parent>
		<groupId>pl.com.hme.androidfindview</groupId>
		<artifactId>parent</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<dependencies>
		<dependency>
			<groupId>pl.com.hme.androidfindview</groupId>
			<artifactId>library</artifactId>
            <version>${project.version}</version>
            <type>apklib</type>
		</dependency>
		<dependency>
				<groupId>android</groupId>
				<artifactId>android</artifactId>
				<version>4.4.2_r2</version>
				<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.android.support</groupId>
			<artifactId>support-v4</artifactId>
		</dependency>
    </dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>android-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>


text:
<?php
namespace Wizard\Step;

use Wizard\Step\StepPluginManager;
use Zend\Form\FormElementManager;

class StepFactory
{
    /**
     * @var StepPluginManager
     */
    protected $stepPluginManager;

    /**
     * @var FormElementManager
     */
    protected $formPluginManager;

    /**
     * @param StepPluginManager $stepPluginManager
     * @param FormElementManager $formPluginManager
     */
    public function __construct(
        StepPluginManager $stepPluginManager,
        FormElementManager $formPluginManager
    ) {
        $this->stepPluginManager = $stepPluginManager;
        $this->formPluginManager = $formPluginManager;
    }

    /**
     * @param  string $name
     * @param  array $options
     * @return \Wizard\Step\StepInterface
     */
    public function create($name, array $options = [])
    {
        $step = $this->stepPluginManager->get($name);

        if (isset($options['form'])) {
            $form = $this->formPluginManager->get($options['form']);
            $step->setForm($form);
            unset($options['form']);
        }

        $step->setName($name);
        $step->getOptions()->setFromArray($options);

        return $step;
    }
}


text:
package com.netflix.msl.io;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;

/**
 *
This class implements a stream filter for writing compressed data in the
 * LZW format.

 *
 * @author Wesley Miaw <wmiaw@netflix.com>
 */
public class LZWOutputStream extends OutputStream {
    /** Maximum number of codes to buffer before flushing. */
    private static final int MAX_BUFFER_SIZE = 100;

    /** A byte array for use as map keys. */
    private static class Key {
        /**
         * Create a new key with the following byte array value. This does not
         * make a copy of the byte array.
         *
         * @param bytes the byte array to serve as the key value.
         */
        public Key(final byte[] bytes) {
            this.bytes = bytes;
            this.hashCode = Arrays.hashCode(bytes);
        }

        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */
        @Override
        public boolean equals(final Object o) {
            if (o == this) return true;
            if (!(o instanceof Key)) return false;
            return Arrays.equals(bytes, ((Key)o).bytes);
        }

        /* (non-Javadoc)
         * @see java.lang.Object#hashCode()
         */
        @Override
        public int hashCode() {
            return hashCode;
        }

        /* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
            return Arrays.toString(bytes);
        }

        /** The byte array value. */
        private final byte[] bytes;
        /** The hash code value. */
        private final int hashCode;
    }

    /** A code is a numeric value represented by a specific number of bits. */
    private static class Code {
        /**
         * Create a new code with the specified value and bit length.
         *
         * @param value the value.
         * @param bits the number of bits used to encode the value.
         */
        public Code(int value, int bits) {
            this.value = value;
            this.bits = bits;
        }

        /* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
        @Override
        public String toString() {
            return Integer.toHexString(value) + " (" + bits + "b)";
        }

        /** Numeric value. */
        public final int value;
        /** Bit length. */
        public final int bits;
    }

    /** Maximum number of values represented by a byte. */
    private static final int BYTE_RANGE = 256;
    /** The initial dictionary. */
    private static final Map<Key,Integer> INITIAL_DICTIONARY = new HashMap<Key,Integer>(BYTE_RANGE);
    static {
        for (int i = 0; i < BYTE_RANGE; ++i) {
            final byte[] keybytes = { (byte)i };
            final Key key = new Key(keybytes);
            INITIAL_DICTIONARY.put(key, i);
        }
    }

    /**
     * Creates a new output stream.
     *
     * @param out the output stream.
     */
    public LZWOutputStream(final OutputStream out) {
        this.out = out;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#finalize()
     */
    @Override
    protected void finalize() throws Throwable {
        close();
        super.finalize();
    }

    /* (non-Javadoc)
     * @see java.io.OutputStream#close()
     */
    @Override
    public void close() throws IOException {
        if (!closed) {
            finish();
            out.close();
            closed = true;
        }
    }

    /**
     * Finishes writing compressed data to the output stream without closing
     * the underlying stream. Use this method when applying multiple filters in
     * succession to the same output stream.
     *
     * @throws IOException if an I/O error has occurred.
     */
    public void finish() throws IOException {
        if (!finish) {
            finish = true;

            // If there are any symbols left we have to emit those codes now.
            if (symbols.size() > 0) {
                final byte[] keybytes = symbols.toByteArray();
                final Key key = new Key(keybytes);
                final Integer value = dictionary.get(key);
                buffer.add(new Code(value, bits));
                flush();
            }
        }
    }

    /* (non-Javadoc)
     * @see java.io.OutputStream#write(int)
     */
    @Override
    public void write(int b) throws IOException {
        final byte[] buf = new byte[1];
        buf[0] = (byte)(b & 0xff);
        write(buf, 0, 1);
    }

    /* (non-Javadoc)
     * @see java.io.OutputStream#write(byte[], int, int)
     */
    @Override
    public void write(byte[] b, int off, int len) throws IOException {
        if (closed)
            throw new IOException("Output stream is closed.");

        if (off < 0)
            throw new IndexOutOfBoundsException("Offset cannot be negative.");
        if (len < 0)
            throw new IndexOutOfBoundsException("Length cannot be negative.");
        if (off + len > b.length)
            throw new IndexOutOfBoundsException("Offset plus length cannot be greater than the array length.");

        for (int i = off; i < off + len; ++i) {
            // Add a byte to the input.
            final byte c = b[i];
            symbols.write(c);

            // Check if the input is in the dictionary.
            final byte[] keybytes = symbols.toByteArray();
            final Key key = new Key(keybytes);
            final Integer value = dictionary.get(key);

            // If the input is not in the dictionary, then...
            if (value == null) {
                // emit the previous input's code...
                final byte[] prevkeybytes = Arrays.copyOf(keybytes, keybytes.length - 1);
                final Key prevkey = new Key(prevkeybytes);
                final Integer prevvalue = dictionary.get(prevkey);
                buffer.add(new Code(prevvalue, bits));

                // and add the new input to the dictionary.
                //
                // The bit width increases from p to p + 1 when the new code is
                // the first code requiring p + 1 bits.
                final int newvalue = dictionary.size();
                if (newvalue >> bits != 0)
                    ++bits;
                dictionary.put(key, newvalue);

                // Remove the emitted symbol from the current input.
                symbols.reset();
                symbols.write(c);

                // If the buffer is too big, flush to avoid blowing the heap.
                if (buffer.size() > MAX_BUFFER_SIZE)
                    flush();
            }
        }
    }

    /* (non-Javadoc)
     * @see java.io.OutputStream#flush()
     */
    public void flush() throws IOException {
        // Do nothing if the code buffer is empty.
        if (buffer.isEmpty()) return;

        // Use MSB-First packing order.
        //
        // Collect codes until aligned on a byte boundary.
        int codebits = 0;
        final LinkedList codes = new LinkedList();
        while (buffer.size() > 0) {
            final Code c = buffer.remove();
            codes.add(c);
            codebits += c.bits;

            // If aligned on a byte boundary output the collected codes and
            // remove them from the codes buffer.
            if (codebits % 8 == 0) {
                out.write(codesToBytes(codes));
                codes.clear();
                codebits = 0;
            }
        }

        // If the stream is closed then output the remaining codes.
        if (finish)
            out.write(codesToBytes(codes));

        // Otherwise stick them back onto the code buffer for next time.
        else
            buffer.addAll(codes);
    }

    /**
     * Convert an ordered list of codes (which may or may not be byte-aligned)
     * into their MSB-first byte representation.
     *
     * @param codes an ordered list of codes.
     * @return the MSB-first byte representation of the codes.
     */
    private static byte[] codesToBytes(final LinkedList codes) {
        final ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        byte b = 0;
        int available = Byte.SIZE;
        while (codes.size() > 0) {
            // Write the current code bits MSB-first.
            final Code code = codes.remove();
            int bits = code.bits;
            while (bits > 0) {
                // If the code has more bits than available, shift right to get
                // the most significant bits. This finishes off the current
                // byte.
                if (bits > available) {
                    int msbits = code.value;
                    msbits >>>= bits - available;
                    b |= (msbits & 0xff);

                    // The current byte is finished so write it out.
                    bytes.write(b);

                    // We've written 'available' bits of the current code. The
                    // next byte is completely available so reset the values.
                    bits -= available;
                    available = Byte.SIZE;
                    b = 0;
                }

                // If the code has less then or equal bits available, shift
                // left to pack against the previous bits.
                else if (bits <= available) {
                    // First shift left to erase the most significant bits then
                    // shift right to start at the correct offset.
                    int msbits = code.value;
                    msbits <<= available - bits;
                    msbits &= 0xff;
                    msbits >>>= Byte.SIZE - available;
                    b |= (msbits & 0xff);

                    // We've written 'bits' bits into the current byte. There
                    // are no more bits to write for the current code.
                    available -= bits;
                    bits = 0;

                    // If this finished the current byte then write it and
                    // reset the values.
                    if (available == 0) {
                        bytes.write(b);
                        available = Byte.SIZE;
                        b = 0;
                    }
                }
            }
        }

        // If the number of bits available in the current byte is less than the
        // size of a byte then the current byte still needs to be written.
        if (available < Byte.SIZE)
            bytes.write(b);
        return bytes.toByteArray();
    }

    /** Output stream. */
    private final OutputStream out;
    /** The dictionary of codes keyed off bytes. */
    private final Map<Key,Integer> dictionary = new HashMap<Key,Integer>(INITIAL_DICTIONARY);

    /** Working symbols. */
    private final ByteArrayOutputStream symbols = new ByteArrayOutputStream();
    /** Current bit length. */
    private int bits = Byte.SIZE;
    /** Buffered codes pending write. */
    private final LinkedList buffer = new LinkedList();

    /** Finish called. */
    private boolean finish = false;
    /** Stream closed. */
    private boolean closed = false;
}