text:
layout: post
date: 2017-08-02
title: "Lillian West 6354 Sleeveless Chapel Train Ballgown"
category: Lillian West
tags: [Lillian West,Lillian West ,Ballgown,Sweetheart,Chapel Train,Sleeveless]
---
### Lillian West 6354
Just **$309.99**
###   Sleeveless Chapel Train Ballgown

BRANDS	Lillian West

Silhouette	Ballgown

Neckline	Sweetheart

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/lillian-west/43712-lillian-west-6354.html](https://www.readybrides.com/en/lillian-west/43712-lillian-west-6354.html)


text:
package org.apache.hadoop.fs.s3a;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.fs.EtagSource;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.Path;

/**
 * File status for an S3A "file".
 * Modification time is trouble, see {@link #getModificationTime()}.
 *
 * The subclass is private as it should not be created directly.
 */
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class S3AFileStatus extends FileStatus implements EtagSource {

  private static final long serialVersionUID = -5955674081978903922L;

  private Tristate isEmptyDirectory;
  private String eTag;
  private String versionId;

  /**
   * Create a directory status.
   * @param isemptydir is this an empty directory?
   * @param path the path
   * @param owner the owner
   */
  public S3AFileStatus(boolean isemptydir,
      Path path,
      String owner) {
    this(Tristate.fromBool(isemptydir), path, owner);
  }

  /**
   * Create a directory status.
   * @param isemptydir is this an empty directory?
   * @param path the path
   * @param owner the owner
   */
  public S3AFileStatus(Tristate isemptydir,
      Path path,
      String owner) {
    this(path,
        true,
        isemptydir,
        0,
        0,
        0,
        owner,
        null,
        null
    );
  }

  /**
   * A simple file.
   * @param length file length
   * @param modification_time mod time
   * @param path path
   * @param blockSize block size
   * @param owner owner
   * @param eTag eTag of the S3 object if available, else null
   * @param versionId versionId of the S3 object if available, else null
   */
  public S3AFileStatus(long length, long modification_time, Path path,
      long blockSize, String owner, String eTag, String versionId) {
    this(path,
        false,
        Tristate.FALSE,
        length,
        modification_time,
        blockSize,
        owner,
        eTag,
        versionId
    );
  }

  /**
   * Either a file or directory.
   * @param path path
   * @param isDir is this a directory?
   * @param isemptydir is this an empty directory?
   * @param length file length
   * @param modificationTime mod time
   * @param blockSize block size
   * @param owner owner
   * @param eTag eTag of the S3 object if available, else null
   * @param versionId versionId of the S3 object if available, else null
   */
  S3AFileStatus(Path path,
      boolean isDir,
      Tristate isemptydir,
      long length,
      long modificationTime,
      long blockSize,
      String owner,
      String eTag,
      String versionId) {
    super(length, isDir, 1, blockSize, modificationTime,
        0, null, owner, owner, null,
        path, false, true, false);
    this.isEmptyDirectory = isemptydir;
    this.eTag = eTag;
    this.versionId = versionId;
  }

  /**
   * Convenience constructor for creating from a vanilla FileStatus plus
   * an isEmptyDirectory flag.
   * @param source FileStatus to convert to S3AFileStatus
   * @param isEmptyDirectory TRUE/FALSE if known to be / not be an empty
   *     directory, UNKNOWN if that information was not computed.
   * @param eTag eTag of the S3 object if available, else null
   * @param versionId versionId of the S3 object if available, else null
   * @return a new S3AFileStatus
   */
  public static S3AFileStatus fromFileStatus(FileStatus source,
      Tristate isEmptyDirectory, String eTag, String versionId) {
    if (source.isDirectory()) {
      return new S3AFileStatus(isEmptyDirectory, source.getPath(),
          source.getOwner());
    } else {
      return new S3AFileStatus(source.getLen(), source.getModificationTime(),
          source.getPath(), source.getBlockSize(), source.getOwner(),
          eTag, versionId);
    }
  }

  /**
   * @return FALSE if status is not a directory, or its a dir, but known to
   * not be empty.  TRUE if it is an empty directory.  UNKNOWN if it is a
   * directory, but we have not computed whether or not it is empty.
   */
  public Tristate isEmptyDirectory() {
    return isEmptyDirectory;
  }

  /**
   * Update isEmptyDirectory attribute.
   * @param isEmptyDirectory new isEmptyDirectory value
   */
  public void setIsEmptyDirectory(Tristate isEmptyDirectory) {
    this.isEmptyDirectory = isEmptyDirectory;
  }

  /**
   * @return the S3 object eTag when available, else null.
   * @deprecated use {@link EtagSource#getEtag()} for
   * public access.
   */
  @Deprecated
  public String getETag() {
    return getEtag();
  }

  @Override
  public String getEtag() {
    return eTag;
  }

  /**
   * @return the S3 object versionId when available, else null.
   */
  public String getVersionId() {
    return versionId;
  }

  /**
   * set the S3 object versionId, else null.
   * @param versionId version ID or null.
   */
  public void setVersionId(final String versionId) {
    this.versionId = versionId;
  }

  /** Compare if this object is equal to another object.
   * @param   o the object to be compared.
   * @return  true if two file status has the same path name; false if not.
   */
  @Override
  public boolean equals(Object o) {
    return super.equals(o);
  }

  /**
   * Returns a hash code value for the object, which is defined as
   * the hash code of the path name.
   *
   * @return  a hash code value for the path name.
   */
  @Override
  public int hashCode() {
    return super.hashCode();
  }

  /** Get the modification time of the file/directory.
   *
   * s3a uses objects as "fake" directories, which are not updated to
   * reflect the accurate modification time. We choose to report the
   * current time because some parts of the ecosystem (e.g. the
   * HistoryServer) use modification time to ignore "old" directories.
   *
   * @return for files the modification time in milliseconds since January 1,
   *         1970 UTC or for directories the current time.
   */
  @Override
  public long getModificationTime(){
    if(isDirectory()){
      return System.currentTimeMillis();
    } else {
      return super.getModificationTime();
    }
  }

  @Override
  public String toString() {
    return super.toString()
        + String.format(" isEmptyDirectory=%s", isEmptyDirectory().name()
        + String.format(" eTag=%s", eTag)
        + String.format(" versionId=%s", versionId));
  }

}

redpajama_set_name: RedPajamaGithub


text:
class EnableSslVerificationForWebHooks < ActiveRecord::Migration
  def up
    execute("UPDATE web_hooks SET enable_ssl_verification = true")
  end

  def down
  end
end


text:
require "logger"
require "faraday"
require "humi/version"

module Humi
  module Config
    VALID_CONFIG_KEYS = [
      :access_token,
      :auth_code,
      :username,
      :password,
      :auth_code,
      :refresh_token,
      :client_id,
      :client_secret,
      :auth_callback,
      :auth_retries,
      :adapter,
      :connection_options,
      :scope,
      :redirect_uri,
      :endpoint,
      :format,
      :user_agent,
      :logger
    ].freeze

    DEFAULT_ACCESS_TOKEN       = nil
    DEFAULT_AUTH_CODE          = nil
    DEFAULT_USERNAME           = nil
    DEFAULT_PASSWORD           = nil
    DEFAULT_REFRESH_TOKEN      = nil
    DEFAULT_CLIENT_ID          = nil
    DEFAULT_CLIENT_SECRET      = nil
    DEFAULT_AUTH_CALLBACK      = ->(response) {}
    DEFAULT_AUTH_RETRIES       = 3
    DEFAULT_ADAPTER            = Faraday.default_adapter
    DEFAULT_CONNECTION_OPTIONS = {}
    DEFAULT_SCOPE              = nil
    DEFAULT_REDIRECT_URI       = nil
    DEFAULT_ENDPOINT           = "https://www.humi.ca".freeze
    DEFAULT_FORMAT             = :json
    DEFAULT_USER_AGENT         = "Humi Ruby Client/#{Humi::VERSION}".freeze
    DEFAULT_LOGGER             = ::Logger.new(STDOUT)

    attr_accessor *VALID_CONFIG_KEYS

    def self.extended(base)
      base.reset
    end

    def configure
      yield self
    end

    def options
      VALID_CONFIG_KEYS.inject({}) do |option, key|
        option.merge!(key => send(key))
      end
    end

    def reset
      self.access_token       = DEFAULT_ACCESS_TOKEN
      self.auth_code          = DEFAULT_AUTH_CODE
      self.username           = DEFAULT_USERNAME
      self.password           = DEFAULT_PASSWORD
      self.refresh_token      = DEFAULT_REFRESH_TOKEN
      self.client_id          = DEFAULT_CLIENT_ID
      self.client_secret      = DEFAULT_CLIENT_SECRET
      self.auth_callback      = DEFAULT_AUTH_CALLBACK
      self.auth_retries       = DEFAULT_AUTH_RETRIES
      self.adapter            = DEFAULT_ADAPTER
      self.connection_options = DEFAULT_CONNECTION_OPTIONS
      self.scope              = DEFAULT_SCOPE
      self.redirect_uri       = DEFAULT_REDIRECT_URI
      self.endpoint           = DEFAULT_ENDPOINT
      self.format             = DEFAULT_FORMAT
      self.user_agent         = DEFAULT_USER_AGENT
      self.logger             = DEFAULT_LOGGER
    end
  end
end


text:
namespace XenAPI
{
    partial class VGPU
    {
        public bool IsPassthrough()
        {
            var vGPUType = Connection.Resolve(type);
            return vGPUType == null || vGPUType.IsPassthrough();
        }
    }
}


text:
package com.graywolf336.trailingperspective.interfaces;

import java.util.List;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;

public interface ICommand extends CommandExecutor, TabCompleter {
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args);

    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args);
}


text:
Yet another post

[meta:author]: <> (Jonas Colmsjo)
[meta:title]: <> (Home.md)
[meta:date]: <> (2012-01-01)
[meta:nested:key]: <> (Metadata value)

##!!truncate

_Work In Progress_ is a Blog written by Jonas Colmsjö. It is actually my public playground with misc. notes and things I'm working on. Feel free to poke around...

2012-11-28: [[Blacksmith CMS]] - generate HTML files from markdown

2012-11-26: [[Heroku for PHP]]

2012-11-26: [[CSS stuff]]

2012-11-23: [[SEO introduction]]

2012-11-22: [[Responsive WP themes]]

2012-11-21: [[Testing Mobile apps]]

2012-11-19: [[CMS on NodeJS]]

2012-11-18: [[More on web frontend development]]

2012-11-13: [[Hosted Helpdesk]]

2012-10-24: [[Send mail with AWS SES]]

2012-10-22: [[Logging services]] - save and analyze logs, centralized instead of spread out on different servers

2012-10-22: [[John Resig articles]] - creator of jQuery, always worth to read

2012-10-22: [[More JS MVC]]

2012-10-21: [[JS grids]]

2012-10-22: [[NoSQL DBs]]

2012-10-21: [[Browser side templates]]

2012-10-18: [[Batch scheduling in NodeJS]]

2012-10-18: [[NodeJS on Heroku]]

2012-10-16: [[Git internals]]

2012-10-14: [[Phing]] - build tool based on ant for PHP

2012-10-10: [[Debugging NodeJS]]

2012-10-08: [[Web and mobile icons]]

2012-10-07: [[Setup node.js on OSX]]

2012-10-05: [[Agile PM Tools]]

2012-09-30: [[Github pages]]

2012-09-30: [[CMS update]]

2012-09-19: [[Git and SSH]]

2012-09-09: [[HTML UI]] - modern HTML basen UI:s for desktops, tablets and mobiles

2012-09-09: Play around with the [[Github API]]

2012-08-30: [[cfengine]] - configuration management

2012-08-29: [[CSS Sprites]]

2012-08-22: [[Performance analysis in PHP]]

2012-08-15: [[Setup apex urls like gizur.com]]

2012-08-15: [[Create mirror using wget]]

2012-08-12: [[Docco]] - simple tool for generating documentation

2012-08-10: [[JavaScript Apps]] - HTML and JavaScript has matured and can be used for large scale business critical applications

2012-08-10: [[Shrinking CodeIgniter]]

2012-08-10: [[Setup AWS Elastic Beanstalk]] - Getting AWS Beanstalk setup with Git and deploy a PHP application

2012-08-10: [[Customized Elastic Beanstalk]]

2012-08-10: [[AWS ELB]]

2012-08-10: [[Hosted Issue Tracking]] - Short survey of hosted issue tracking solutions

2012-08-10: [[Amazon-web-services-development]] - Use git to deploy to EBT

2012-08-10: [[Git related stuff]] - Getting started with git and GitHub


text:
static unsigned long alloc_count, free_count, scoped_count;
static unsigned long alloc_current_bytes, alloc_max_bytes;
static unsigned long alloc_actual_current_bytes, alloc_actual_max_bytes;
static unsigned long long alloc_bytes, alloc_actual_bytes;

static size_t realsize(size_t s)
{
  size_t n = (s < sizeof(mchunk) - CHUNK_OVERHEAD - 1) ?
    16 : (s + CHUNK_OVERHEAD + 7) & ~7;

  if (n >= mparams.mmap_threshold)
    n = granularity_align(n + SIX_SIZE_T_SIZES + 7);

  n += n >> 3; /* Ref counts */

  return n;
}

static void stats_allocating(size_t n)
{
  alloc_count++;

  alloc_bytes += n;
  alloc_current_bytes += n;
  if (alloc_current_bytes > alloc_max_bytes)
    alloc_max_bytes = alloc_current_bytes;

  alloc_actual_bytes += realsize(n);
  alloc_actual_current_bytes += realsize(n);
  if (alloc_actual_current_bytes > alloc_actual_max_bytes)
    alloc_actual_max_bytes = alloc_actual_current_bytes;
}

static void stats_freeing(size_t n)
{
  free_count++;
  alloc_current_bytes -= n;
  alloc_actual_current_bytes -= realsize(n);
}

static void stats_scope(size_t scope_n)
{
  scoped_count += scope_n;
  scope_n *= 8;
  if (alloc_actual_current_bytes + scope_n > alloc_actual_max_bytes)
    alloc_actual_max_bytes = alloc_actual_current_bytes + scope_n;
}

static void stats_report(int shortlog)
{
  if (shortlog)
    {
      mprintf(", %10lu, %10lu, %10lu", alloc_count, free_count, scoped_count);
      mprintf(", %16llu, %16llu", alloc_bytes, alloc_actual_bytes);
      mprintf(", %10lu, %10lu\n", alloc_max_bytes, alloc_actual_max_bytes);
    }
  else
    {
      mprintf("%lu allocations, %lu frees (%lu scoped)\n",
	      alloc_count, free_count, scoped_count);
      mprintf("%llu requested bytes, %llu actual bytes\n",
	      alloc_bytes, alloc_actual_bytes);
      mprintf("max memory use: %lu\n", alloc_max_bytes);
      mprintf("max actual memory use: %lu\n", alloc_actual_max_bytes);
    }
}


text:
import { Injectable } from '@angular/core';
import { Http, Headers, Response, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch'
import 'rxjs/add/operator/toPromise';
import { Prescription } from '../models/prescription.model';
import * as config from '../config/appSettings.json';

@Injectable()
export class SearchService {
    public webApiBaseUrl: any = config['apiBaseUrl'];
    public authHeader: any = 'Bearer ' + sessionStorage['authToken'];

    constructor(private http: Http) {
    }

    SearchPatientsByName(name: string)
    {
        console.log('SearchPatientsByName service invoked...');
        let headers = new Headers();
        headers.append('Content-Type', 'application/json ; charset=utf-8');
        headers.append('Authorization', `${this.authHeader}`);
        let options = new RequestOptions({ headers: headers });

        return this.http.get(`${this.webApiBaseUrl}/Patients/Search/${name}`, options)
           //return this.http.get('assets/data.json')
            .map(res => res)
            .catch(error => {
                console.log(error);
                return Observable.throw(error);
            });
    }

    private handleError(error: any): Promise<any> {
        console.error('An error occurred', error); // for demo purposes only
        return Promise.reject(error.message || error);
    }

    private handleServerError(error: Response) {
        console.error("An error occurred : " + error);
        return Observable.throw(error || 'Server error');
    }

}


text:
'use strict';

module.exports = function quoted_printable_decode(str) {
  // eslint-disable-line camelcase
  //       discuss at: http://locutus.io/php/quoted_printable_decode/
  //      original by: Ole Vrijenhoek
  //      bugfixed by: Brett Zamir (http://brett-zamir.me)
  //      bugfixed by: Theriault (https://github.com/Theriault)
  // reimplemented by: Theriault (https://github.com/Theriault)
  //      improved by: Brett Zamir (http://brett-zamir.me)
  //        example 1: quoted_printable_decode('a=3Db=3Dc')
  //        returns 1: 'a=b=c'
  //        example 2: quoted_printable_decode('abc  =20\r\n123  =20\r\n')
  //        returns 2: 'abc   \r\n123   \r\n'
  //        example 3: quoted_printable_decode('012345678901234567890123456789012345678901234567890123456789012345678901234=\r\n56789')
  //        returns 3: '01234567890123456789012345678901234567890123456789012345678901234567890123456789'
  //        example 4: quoted_printable_decode("Lorem ipsum dolor sit amet=23, consectetur adipisicing elit")
  //        returns 4: 'Lorem ipsum dolor sit amet#, consectetur adipisicing elit'

  // Decodes all equal signs followed by two hex digits
  var RFC2045Decode1 = /=\r\n/gm;

  // the RFC states against decoding lower case encodings, but following apparent PHP behavior
  var RFC2045Decode2IN = /=([0-9A-F]{2})/gim;
  // RFC2045Decode2IN = /=([0-9A-F]{2})/gm,

  var RFC2045Decode2OUT = function RFC2045Decode2OUT(sMatch, sHex) {
    return String.fromCharCode(parseInt(sHex, 16));
  };

  return str.replace(RFC2045Decode1, '').replace(RFC2045Decode2IN, RFC2045Decode2OUT);
};
//# sourceMappingURL=quoted_printable_decode.js.map


text:
import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    return this.store.findAll('question');
  },
  actions: {
    saveQuestion(params) {
      var newQuestion = this.store.createRecord('question', params);
      newQuestion.save();
      this.transitionTo('question', newQuestion.id);
    }
  }
});


text:
<title>
News and reports
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

News and reports

April 6, 2007 | Pages 14 and 15

ARTICLES BELOW:

Immigrant rights in San Diego

Defending the undocumented

Houston protest against executions

Toledo anti-death penalty forum

Immigrant rights in San Diego

By Marcos Perez and Norma Villegas

SAN DIEGO--Approximately 80 activists from half a dozen immigrant rights and relief organizations rallied here October 28 in front of the Immigration and Customs Enforcement (ICE) headquarters to demand an end to the military-style checkpoints set up outside neighborhoods affected by last week's wildfires.

According to the San Diego American Civil Liberties Union, the sheriff's department plans to ask for identification of evacuees returning home and to detain and hand over people suspected of being undocumented to the U.S. Border Patrol.

These checkpoints, expected to last up to three days, are further victimizing undocumented people, including Native Americans, most of whom may lack proper identification. At some evacuation sites, like Qualcomm Stadium, law enforcement officials also have been asking evacuees for identification.

Speakers denounced the racial profiling, detentions and deportations of immigrant evacuees and the discrimination in the distribution of services and aid. Fernando Suarez del Solar, who lost his son in the Iraq war, spoke out against the catastrophe in Iraq and the need to assess the commonalities of the wildfires and the war.

Estela de los Rios, from the Center for Social Advocacy, called on the sheriff and other local anti-immigrant politicians to "[e]nd the inhumane acts of discrimination in this state of emergency."

Back to the top

Defending the undocumented

By Zach Mason and David Thurston

WASHINGTON--In the suburbs of the nation's capital, struggles are unfolding over the rights of undocumented immigrants. In Northern Virginia, the trend is towards restrictions on the rights of the undocumented, while Takoma Park, Md., recently voted to maintain its status as a sanctuary city.

In Virginia, the Prince William County board of supervisors voted unanimously October 17 to provide funding for the implementation of a resolution targeting undocumented immigrants.

The vote came after a 12-hour session of public testimony by nearly 400 people. Some speakers supported the resolution, but the vast majority of speakers opposed it. Outside, a crowd of 1,200 gathered, the largest crowd ever seen at a board of supervisors meeting.

The new ordinance, which still faces a challenge to its constitutionality in federal court, would turn local police officers into enforcers of federal immigration law and deny many public services to undocumented immigrants.

Though the law was passed despite lawsuits and a series of protests (including a boycott of businesses, a mass march and rally and a one-day strike), the county has been forced to concede some ground, such as pulling back from denying access to such services as schools and emergency medical care, which would have violated federal law.

Police enforcement of immigration law was also at issue in Takoma Park, Md. For weeks, a debate has been brewing over the city's sanctuary city law, passed in the 1980s to protect refugees from civil wars and right-wing dictatorships in Central America.

The law mandated that local police have no contact with federal immigration authorities. Yet in recent weeks, the city's police chief proposed amending the law to allow city police to arrest "previously deported felons" and to access the National Crime Information Database in order to do so.

Activists in Takoma Park were outraged at the plan. A city council meeting to decide on the proposed changes was flooded by supporters of the sanctuary law, including many immigrant families.

At the end of the day, the city council voted overwhelmingly to leave Takoma's sanctuary policy unchanged. Activists are now strategizing about how to use this victory to push other communities to provide sanctuaries for the undocumented.

Back to the top

Houston protest against executions

By Dan Sharber and Laura Taylor

HOUSTON, Texas--"Break the needle, smash the chair! The death penalty is not fair!" These words were shouted by the 300 protesters who came out to the Eighth Annual Texas Statewide March to Stop Executions on October 27.

This year, the march was held in Houston for the first time--because, organizers say, Houston prosecutors put more people on death row than any other city in Texas, and most other states in the U.S. The march was organized by a coalition that includes the Texas Death Penalty Abolition Movement, Texas Coalition to Abolish the Death Penalty, National Black United Front and International Socialist Organization.

The theme of this year's march was "Celebrating Our Victories, Remembering Our Losses, and Continuing the Fight for Abolition." Lee Greewood, the mother of Joseph Nichols, who was executed earlier this year, spoke about her son's case. There were messages of solidarity from many groups and individuals on death row, including Mumia Abu-Jamal and members of the DRIVE Movement.

Bryan McCann, a representative from the Campaign to End the Death Penalty noted how important such marches are. "Make no mistake--Kenneth Foster is alive today because of the people's movement," McCann said.

The march ended with a call to action to work together to fight for abolition of the death penalty.

Back to the top

Toledo anti-death penalty forum

By Ted Reinhart

TOLEDO, Ohio--One hundred people turned out October 21 at the University of Toledo (UT) for a stop on the Campaign to End the Death Penalty's (CEDP) "A Broken System...Crying Out for Justice" fall tour.

Featured speakers included Yusef Salaam, who served seven years in prison in connection with the Central Park jogger case; Saadiqah Amatullah Hasan, the wife of Ohio death row inmate and political prisoner Siddique Abdullah Hasan; and Harold Wilson, the 122nd person to be exonerated from death row in the U.S. since capital punishment was reinstated.

Local organizations sponsoring the event included the CEDP, the International Socialist Organization, UT Black Student Union, CURE-Ohio, Muhammad's Mosque #91, St. Rose Peace and Justice, UT NAACP and the Millions More Movement.

The speakers told of their personal experiences with the criminal injustice system. In each case, convictions were based on questionable or manipulated evidence.

Audience members were encouraged to contribute whatever they could to the movement, be it time, money or other resources--and to get involved with one of the sponsoring organizations.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
using UnityEngine;
using System.Collections;

public class MusicPlayer : MonoBehaviour {

	public static bool musicOn = false;

	void Awake() {

		if(musicOn){
			Object.Destroy(gameObject);
		}
		else{
			musicOn = true;
			GameObject.DontDestroyOnLoad(gameObject);
		}
	}
}


text:
package org.sputnikdev.bluetooth.manager;

/**
 *
 * A value change listener. Mainly is used within a characteristic governor.
 *
 * @author Vlad Kolotov
 */
public interface ValueListener {

    /**
     * Reports value changed event.
     * @param value a new state
     */
    void changed(byte[] value);

}


text:
package org.apache.flink.orc.writer;

import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.core.fs.Path;
import org.apache.flink.orc.data.Record;
import org.apache.flink.orc.util.OrcBulkWriterTestUtil;
import org.apache.flink.orc.vector.RecordVectorizer;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSink;
import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.UniqueBucketAssigner;
import org.apache.flink.streaming.util.FiniteTestSource;
import org.apache.flink.util.TestLogger;

import org.apache.hadoop.conf.Configuration;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;

/** Integration test for writing data in ORC bulk format using StreamingFileSink. */
public class OrcBulkWriterITCase extends TestLogger {

    @ClassRule public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder();

    private final String schema = "struct<_col0:string,_col1:int>";
    private final List<Record> testData =
            Arrays.asList(new Record("Sourav", 41), new Record("Saul", 35), new Record("Kim", 31));

    @Test
    public void testOrcBulkWriter() throws Exception {
        final File outDir = TEMPORARY_FOLDER.newFolder();
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        final Properties writerProps = new Properties();
        writerProps.setProperty("orc.compress", "LZ4");

        final OrcBulkWriterFactory<Record> factory =
                new OrcBulkWriterFactory<>(
                        new RecordVectorizer(schema), writerProps, new Configuration());

        env.setParallelism(1);
        env.enableCheckpointing(100);

        DataStream<Record> stream =
                env.addSource(new FiniteTestSource<>(testData), TypeInformation.of(Record.class));
        stream.map(str -> str)
                .addSink(
                        StreamingFileSink.forBulkFormat(new Path(outDir.toURI()), factory)
                                .withBucketAssigner(new UniqueBucketAssigner<>("test"))
                                .build());

        env.execute();

        OrcBulkWriterTestUtil.validate(outDir, testData);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
{
    internal sealed partial class VisualStudioProjectTracker
    {
        internal sealed class WorkspaceHostState : ForegroundThreadAffinitizedObject
        {
            private readonly IVisualStudioWorkspaceHost _workspaceHost;
            private readonly VisualStudioProjectTracker _tracker;
            private readonly HashSet<AbstractProject> _pushedProjects;

            /// <summary>
            /// Set to true if we've already called <see cref="IVisualStudioWorkspaceHost.OnSolutionAdded(Microsoft.CodeAnalysis.SolutionInfo)"/>
            /// for this host. Set to false after the solution has closed.
            /// </summary>
            private bool _solutionAdded;

            public WorkspaceHostState(VisualStudioProjectTracker tracker, IVisualStudioWorkspaceHost workspaceHost)
                : base(assertIsForeground: true)
            {
                _tracker = tracker;
                _workspaceHost = workspaceHost;
                _pushedProjects = new HashSet<AbstractProject>();

                this.HostReadyForEvents = false;
                _solutionAdded = false;
            }

            public IVisualStudioWorkspaceHost Host
            {
                get
                {
                    AssertIsForeground();
                    return _workspaceHost;
                }
            }

            /// <summary>
            /// Whether or not the project tracker has been notified that it should start to push state
            /// to the <see cref="IVisualStudioWorkspaceHost"/> or not.
            /// </summary>
            public bool HostReadyForEvents { get; set; }

            private void AddToPushListIfNeeded(AbstractProject project, List<AbstractProject> inOrderToPush, HashSet<AbstractProject> visited)
            {
                AssertIsForeground();

                if (_pushedProjects.Contains(project))
                {
                    return;
                }

                if (!visited.Add(project))
                {
                    return;
                }

                foreach (var projectReference in project.GetCurrentProjectReferences())
                {
                    AddToPushListIfNeeded(_tracker.GetProject(projectReference.ProjectId), inOrderToPush, visited);
                }

                inOrderToPush.Add(project);
            }

            internal void SolutionClosed()
            {
                AssertIsForeground();

                _solutionAdded = false;
                _pushedProjects.Clear();
            }

            internal void StartPushingToWorkspaceAndNotifyOfOpenDocuments(IEnumerable<AbstractProject> projects)
            {
                AssertIsForeground();

                // If the workspace host isn't actually ready yet, we shouldn't do anything.
                // Also, if the solution is closing we shouldn't do anything either, because all of our state is
                // in the process of going away. This can happen if we receive notification that a document has
                // opened in the middle of the solution close operation.
                if (!this.HostReadyForEvents || _tracker._solutionIsClosing)
                {
                    return;
                }

                // We need to push these projects and any project dependencies we already know about. Therefore, compute the
                // transitive closure of the projects that haven't already been pushed, keeping them in appropriate order.
                var visited = new HashSet<AbstractProject>();
                var inOrderToPush = new List<AbstractProject>();

                foreach (var project in projects)
                {
                    AddToPushListIfNeeded(project, inOrderToPush, visited);
                }

                var projectInfos = inOrderToPush.Select(p => p.CreateProjectInfoForCurrentState()).ToImmutableArray();

                // We need to enable projects to start pushing changes to workspace hosts even before we add the solution/project to the host.
                // This is required because between the point we capture the project info for current state and the point where we start pushing to workspace hosts,
                // project system may send new events on the AbstractProject on a background thread, and these won't get pushed over to the workspace hosts as we didn't set the _pushingChangesToWorkspaceHost flag on the AbstractProject.
                // By invoking StartPushingToWorkspaceHosts upfront, any project state changes on the background thread will enqueue notifications to workspace hosts on foreground scheduled tasks.
                foreach (var project in inOrderToPush)
                {
                    project.StartPushingToWorkspaceHosts();
                }

                if (!_solutionAdded)
                {
                    string solutionFilePath = null;
                    VersionStamp? version = default(VersionStamp?);

                    // Figure out the solution version
                    string solutionDirectory;
                    string solutionFileName;
                    string userOptsFile;
                    if (ErrorHandler.Succeeded(_tracker._vsSolution.GetSolutionInfo(out solutionDirectory, out solutionFileName, out userOptsFile)) && solutionFileName != null)
                    {
                        solutionFilePath = Path.Combine(solutionDirectory, solutionFileName);
                        if (File.Exists(solutionFilePath))
                        {
                            version = VersionStamp.Create(File.GetLastWriteTimeUtc(solutionFilePath));
                        }
                    }

                    if (version == null)
                    {
                        version = VersionStamp.Create();
                    }

                    var id = SolutionId.CreateNewId(string.IsNullOrWhiteSpace(solutionFileName) ? null : solutionFileName);
                    _tracker.RegisterSolutionProperties(id);

                    var solutionInfo = SolutionInfo.Create(id, version.Value, solutionFilePath, projects: projectInfos);

                    this.Host.OnSolutionAdded(solutionInfo);

                    _solutionAdded = true;
                }
                else
                {
                    // The solution is already added, so we'll just do project added notifications from here
                    foreach (var projectInfo in projectInfos)
                    {
                        this.Host.OnProjectAdded(projectInfo);
                    }
                }

                foreach (var project in inOrderToPush)
                {
                    _pushedProjects.Add(project);

                    foreach (var document in project.GetCurrentDocuments())
                    {
                        if (document.IsOpen)
                        {
                            this.Host.OnDocumentOpened(
                                document.Id,
                                document.GetOpenTextBuffer(),
                                isCurrentContext: LinkedFileUtilities.IsCurrentContextHierarchy(document, _tracker._runningDocumentTable));
                        }
                    }
                }
            }

            internal void RemoveProject(AbstractProject project)
            {
                // If we've already told this host about it, then we need to remove it. Otherwise, this host has no
                // further work to do.
                if (_pushedProjects.Remove(project))
                {
                    this.Host.OnProjectRemoved(project.Id);
                }
            }
        }
    }
}


text:
<?php

namespace Zend\Http;

use Zend\Http\Client;

/**
 * Http static client
 *
 * @category   Zend
 * @package    Zend\Http
 */
class ClientStatic
{

    protected static $client;

    /**
     * Get the static HTTP client
     *
     * @return Zend\Http\Client
     */
    protected static function getStaticClient()
    {
        if (!isset(self::$client)) {
            self::$client = new Client();
        }
        return self::$client;
    }

    /**
     * HTTP GET METHOD (static)
     *
     * @param  string $url
     * @param  array $query
     * @param  array $headers
     * @return Response|boolean
     */
    public static function get($url, $query=array(), $headers=array(), $body=null)
    {
        if (empty($url)) {
            return false;
        }

        $request= new Request();
        $request->setUri($url);
        $request->setMethod(Request::METHOD_GET);

        if (!empty($query) && is_array($query)) {
            $request->getQuery()->fromArray($query);
        }

        if (!empty($headers) && is_array($headers)) {
            $request->getHeaders()->addHeaders($headers);
        }

        if (!empty($body)) {
            $request->setBody($body);
        }

        return self::getStaticClient()->send($request);
    }
    /**
     * HTTP POST METHOD (static)
     *
     * @param  string $url
     * @param  array $params
     * @param  array $headers
     * @return Response|boolean
     */
    public static function post($url, $params, $headers=array(), $body=null)
    {
        if (empty($url)) {
            return false;
        }

        $request= new Request();
        $request->setUri($url);
        $request->setMethod(Request::METHOD_POST);

        if (!empty($params) && is_array($params)) {
            $request->getPost()->fromArray($params);
        } else {
            throw new Exception\InvalidArgumentException('The array of post parameters is empty');
        }

        if (!isset($headers['Content-Type'])) {
            $headers['Content-Type']= Client::ENC_URLENCODED;
        }

        if (!empty($headers) && is_array($headers)) {
            $request->getHeaders()->addHeaders($headers);
        }

        if (!empty($body)) {
            $request->setContent($body);
        }

        return self::getStaticClient()->send($request);
    }
}


text:
function renderHistogram(data, hash, theForm) {
  var margin = {top: 5, right: 60, bottom: 35, left: 55};
  var svgWidth = 865;
  var svgHeight = 380;
  var chartWidth = svgWidth - margin.left - margin.right;
  var chartLeftBound = margin.left;
  var chartRightBound = svgWidth - margin.right;
  var chartHeight = svgHeight - margin.top - margin.bottom;
  var chartTopBound = margin.top;
  var chartBottomBound = svgHeight - margin.bottom
  var barPadding = 1;

  var dataset = [];
  $.each(data.hist, function(index, item) {dataset.push([parseInt(index), item])});
  var mean = data.meanSuc;
  var stdDev = data.stdDevSuc;
  var xMin = d3.min(dataset, function(d) {return d[0];});
  var xMax = d3.max(dataset, function(d) {return d[0];});
  var yMin = d3.min(dataset, function(d) {return d[1];});
  var yMax = d3.max(dataset, function(d) {return d[1];});

  $.each(dataset, function(index, item) {
    var sucGreaterOrEqual = 0;
    $.each(dataset, function(indexInterior, itemInterior) {if (item[0] <= itemInterior[0]) {sucGreaterOrEqual += itemInterior[1];}});
    item[2] = sucGreaterOrEqual;
  });

  d3.selectAll("svg > *").remove();

  var svg = d3.select("svg")
    .attr("width", svgWidth)
    .attr("height", svgHeight);

  var numBars = xMax - xMin + 2 ;
  var barWidth = (chartWidth) / numBars - barPadding;
  if(barWidth < 1) {barWidth = 1}

  var xScale = d3.scaleLinear()
    .domain([xMin-1, xMax+1])
    .range([chartLeftBound, chartRightBound]);

  var yScale = d3.scaleLinear()
    .domain([0, yMax])
    .range([chartBottomBound, chartTopBound]);

  var xAxis = d3.axisBottom()
    .scale(xScale);

  var yAxis = d3.axisLeft()
    .scale(yScale);

  var stdDevBoxes = [[chartLeftBound, xScale(mean - stdDev) - chartLeftBound, "#737373"],
                    [xScale(mean - stdDev), xScale(mean) - xScale(mean - stdDev), "#999999"],
                    [xScale(mean), xScale(mean + stdDev) - xScale(mean), "#CCCCCC"],
                    [xScale(mean + stdDev), chartRightBound - xScale(mean + stdDev), "#f2f2f2"]];

  var stdDevLine = [xScale(mean - stdDev), xScale(mean), xScale(mean + stdDev)];

  var stdDevText = [[xScale(mean - stdDev), "-\u03C3"], [xScale(mean), "\u03BC"], [xScale(mean + stdDev),"+\u03C3"]];

  // Render Background standard deviation shading
  svg.selectAll("noHighlight")
    .data(stdDevBoxes)
    .enter()
    .append("rect")
    .attr("id", "stdDevShading")
    .attr("class", "noHighlight")
    .attr("x", function(d) {return d[0]})
    .attr("y", chartTopBound)
    .attr("width", function(d) {return d[1]})
    .attr("height", chartHeight)
    .attr("fill", function(d) {return d[2]});

  // Render mean, +/- stdDev lines
  svg.selectAll("line")
    .data(stdDevLine)
    .enter()
    .append("line")
    .attr("id", "stdDevLines")
    .attr("x1", function(d) {return d})
    .attr("x2", function(d) {return d})
    .attr("y1", chartTopBound)
    .attr("y2", chartBottomBound)
    .attr("stroke-width", 2)
    .attr("stroke", "black");

  // Render Histogram
  svg.selectAll("histogramBars")
    .data(dataset)
    .enter()
    .append("rect")
    .attr("class", "histogramBars")
    .attr("x", function(d) {return xScale(d[0]) - barWidth/2;})
    .attr("y", function(d) {return  yScale(d[1]);})
    .attr("width", barWidth)
    .attr("height", function(d) {return chartBottomBound - yScale(d[1]);})
    .attr("fill", function(d) {return (d[0] < hash["targetThreshold"]) ? "crimson" : "gold";})
    .on("mouseover", function(d) {
      var tooltipText = ["n = " + d[0] + " successes",
                        d[1] + " trials with s = n successes",
                        (100*d[2]/theForm.elements.namedItem("numAttempts").value).toFixed(2) + "% trials s >= n",
                        (100*d[1]/theForm.elements.namedItem("numAttempts").value).toFixed(2) + "% trials s = n"];
      var xPosition = xScale(d[0]);
      var yPosition = 3*(chartBottomBound - yScale(yMax))/4;
      var tooltipWidth = 2+5*Math.max(tooltipText[0].length,tooltipText[1].length,tooltipText[2].length, tooltipText[3].length);
      var tooltipHeight = 48;
      svg.append("rect")
        .attr("id", "tooltipRect")
        .attr("class", "noHighlight")
        .attr("x", xPosition - tooltipWidth/2)
        .attr("y", yPosition - 11)
        .attr("width", tooltipWidth)
        .attr("height", tooltipHeight)
        .attr("fill", "white");
      //render tooltip text
      var tblock = svg.append("text")
        .attr("id", "tooltipText")
        .attr("text-anchor", "middle")
        .attr("font-family", "sans-serif")
        .attr("font-size", "11px");
      tblock.append("tspan")
        .attr("x", (xPosition))
        .attr("y", yPosition)
        .text(tooltipText[0]);
      tblock.append("tspan")
        .attr("x", (xPosition))
        .attr("y", yPosition + 11)
        .text(tooltipText[1]);
      tblock.append("tspan")
        .attr("x", (xPosition))
        .attr("y", yPosition + 22)
        .text(tooltipText[2]);
      tblock.append("tspan")
        .attr("x", (xPosition))
        .attr("y", yPosition + 33)
        .text(tooltipText[3]);
     })
     .on("mouseout", function() {
      //Hide the tooltip
      d3.select("#tooltipText").remove();
      d3.select("#tooltipRect").remove();
     });

  // Render line annotations
  svg.selectAll("text")
    .data(stdDevText)
    .enter()
    .append("text")
    .attr("x", function(d) {return d[0] + 3})
    .attr("y", yScale(7*yMax/8))
    .attr("dy", "1em")
    .attr("font-family", "sans-serif")
    .attr("font-size", "14px")
    .attr("fill", "black")
    .text(function(d) {return d[1]});

  // Render bar color annotations
  svg.append("text")
    .attr("x", xScale(xMin))
    .attr("y", yScale(7*yMax/8))
    .attr("font-family", "sans-serif")
    .attr("font-size", "14px")
    .attr("font-weight", "bold")
    .attr("fill", "red")
    .style("text-anchor", "start")
    .text("Red Bars: Failed Attempts");
  svg.append("text")
    .attr("x", xScale(xMin))
    .attr("y", yScale(7*yMax/8))
    .attr("dy", "-1em")
    .attr("font-family", "sans-serif")
    .attr("font-size", "14px")
    .attr("font-weight", "bold")
    .attr("fill", "Gold")
    .style("text-anchor", "start")
    .text("Gold Bars: Successful Attempts");

  // Render X Axis
  svg.append("g")
    .attr("class", "axis")
    .attr("transform", "translate(0," + chartBottomBound + ")")
    .call(xAxis);

  // Render X Axis Label
  svg.append("text")
    .attr("transform", "translate(" + (svgWidth / 2) + " ," + svgHeight + ")")
    .attr("dy", "-0.3em")
    .attr("font-family", "sans-serif")
    .attr("font-size", "14px")
    .attr("fill", "black")
    .style("text-anchor", "middle")
    .text("Total Threshold Successes per Crafting Attempt");

  // Render Y Axis
  svg.append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + chartLeftBound + ", 0)")
    .call(yAxis);

  // Render Y Axis Label
  svg.append("text")
    .attr("transform", "rotate(-90)")
    .attr("y", 0 )
    .attr("x", 0-(svgHeight)/2 )
    .attr("dy", "1em")
    .attr("font-family", "sans-serif")
    .attr("font-size", "14px")
    .attr("fill", "black")
    .style("text-anchor", "middle")
    .text("Number of Crafting Attempts");
}


text:
var fs = require("fs");
var vash = require("vash");
var grunt = require("grunt");
function createByCssOutput(cssFiles, outputFolder) {
    createOutputFolder(outputFolder);
    var templateUrl = getTemplateUrl("templates/byCssFile.vash");
    var output = render(templateUrl, cssFiles);
    grunt.file.write(outputFolder + "byCss.html", output);
}
exports.createByCssOutput = createByCssOutput;
function createByHtmlOutput(htmlFiles, outputFolder) {
    createOutputFolder(outputFolder);
    var templateUrl = getTemplateUrl("templates/byHtmlFile.vash");
    var output = render(templateUrl, htmlFiles);
    grunt.file.write(outputFolder + "byHtml.html", output);
}
exports.createByHtmlOutput = createByHtmlOutput;
function render(templatePath, model) {
    var byCssFileTemplate = grunt.file.read(templatePath);
    var templateFunction = vash.compile(byCssFileTemplate);
    return templateFunction(model);
}
function createOutputFolder(folderPath) {
    if (!fs.existsSync(folderPath)) {
        fs.mkdirSync(folderPath);
    }
}
function getTemplateUrl(relativeUrl) {
    if (grunt.file.exists(relativeUrl)) {
        return relativeUrl;
    }
    else {
        return "node_modules/thunderstone/" + relativeUrl;
    }
}


text:
class Abc
{
    protected static string DefGhi(float jkl)
    {
//


text:
=============================
Request and Response Messages
=============================

Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP
responses. Both requests and responses are referred to as messages.

Headers
=======

Both request and response messages contain HTTP headers.

Complex Headers
---------------

Some headers contain additional key value pair information. For example, Link
headers contain a link and several key value pairs:

::

    <http://foo.com>; rel="thing"; type="image/jpeg"

Guzzle provides a convenience feature that can be used to parse these types of
headers:

.. code-block:: php

    use GuzzleHttp\Message\Request;

    $request = new Request('GET', '/', [
        'Link' => '<http:/.../front.jpeg>; rel="front"; type="image/jpeg"'
    ]);

    $parsed = Request::parseHeader($request, 'Link');
    var_export($parsed);

Will output:

.. code-block:: php

    array (
      0 =>
      array (
        0 => '<http:/.../front.jpeg>',
        'rel' => 'front',
        'type' => 'image/jpeg',
      ),
    )

The result contains a hash of key value pairs. Header values that have no key
(i.e., the link) are indexed numerically while headers parts that form a key
value pair are added as a key value pair.

See :ref:`headers` for information on how the headers of a request and response
can be accessed and modified.

Body
====

Both request and response messages can contain a body.

You can check to see if a request or response has a body using the
``getBody()`` method:

.. code-block:: php

    $response = GuzzleHttp\get('http://httpbin.org/get');
    if ($response->getBody()) {
        echo $response->getBody();
        // JSON string: { ... }
    }

The body used in request and response objects is a
``GuzzleHttp\Stream\StreamInterface``. This stream is used for both uploading
data and downloading data. Guzzle will, by default, store the body of a message
in a stream that uses PHP temp streams. When the size of the body exceeds
2 MB, the stream will automatically switch to storing data on disk rather than
in memory (protecting your application from memory exhaustion).

You can change the body used in a request or response using the ``setBody()``
method:

.. code-block:: php

    use GuzzleHttp\Stream\Stream;
    $request = $client->createRequest('PUT', 'http://httpbin.org/put');
    $request->setBody(Stream::factory('foo'));

The easiest way to create a body for a request is using the static
``GuzzleHttp\Stream\Stream::factory()`` method. This method accepts various
inputs like strings, resources returned from ``fopen()``, and other
``GuzzleHttp\Stream\StreamInterface`` objects.

The body of a request or response can be cast to a string or you can read and
write bytes off of the stream as needed.

.. code-block:: php

    use GuzzleHttp\Stream\Stream;
    $request = $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'testing...']);

    echo $request->getBody()->read(4);
    // test
    echo $request->getBody()->read(4);
    // ing.
    echo $request->getBody()->read(1024);
    // ..
    var_export($request->eof());
    // true

You can find out more about Guzzle stream objects in :doc:`streams`.

Requests
========

Requests are sent from a client to a server. Requests include the method to
be applied to a resource, the identifier of the resource, and the protocol
version to use.

Clients are used to create request messages. More precisely, clients use
a ``GuzzleHttp\Message\MessageFactoryInterface`` to create request messages.
You create requests with a client using the ``createRequest()`` method.

.. code-block:: php

    // Create a request but don't send it immediately
    $request = $client->createRequest('GET', 'http://httpbin.org/get');

Request Methods
---------------

When creating a request, you are expected to provide the HTTP method you wish
to perform. You can specify any method you'd like, including a custom method
that might not be part of RFC 7231 (like "MOVE").

.. code-block:: php

    // Create a request using a completely custom HTTP method
    $request = $client->createRequest('MOVE', 'http://httpbin.org/move', ['exceptions' => false]);

    echo $request->getMethod();
    // MOVE

    $response = $client->send($request);
    echo $response->getStatusCode();
    // 405

You can create and send a request using methods on a client that map to the
HTTP method you wish to use.

:GET: ``$client->get('http://httpbin.org/get', [/** options **/])``
:POST: ``$client->post('http://httpbin.org/post', [/** options **/])``
:HEAD: ``$client->head('http://httpbin.org/get', [/** options **/])``
:PUT: ``$client->put('http://httpbin.org/put', [/** options **/])``
:DELETE: ``$client->delete('http://httpbin.org/delete', [/** options **/])``
:OPTIONS: ``$client->options('http://httpbin.org/get', [/** options **/])``
:PATCH: ``$client->patch('http://httpbin.org/put', [/** options **/])``

.. code-block:: php

    $response = $client->patch('http://httpbin.org/patch', ['body' => 'content']);

Request URI
-----------

The resource you are requesting with an HTTP request is identified by the
path of the request, the query string, and the "Host" header of the request.

When creating a request, you can provide the entire resource URI as a URL.

.. code-block:: php

    $response = $client->get('http://httbin.org/get?q=foo');

Using the above code, you will send a request that uses ``httpbin.org`` as
the Host header, sends the request over port 80, uses ``/get`` as the path,
and sends ``?q=foo`` as the query string. All of this is parsed automatically
from the provided URI.

Sometimes you don't know what the entire request will be when it is created.
In these cases, you can modify the request as needed before sending it using
the ``createRequest()`` method of the client and methods on the request that
allow you to change it.

.. code-block:: php

    $request = $client->createRequest('GET', 'http://httbin.org');

You can change the path of the request using ``setPath()``:

.. code-block:: php

    $request->setPath('/get');
    echo $request->getPath();
    // /get
    echo $request->getUrl();
    // http://httpbin.com/get

Scheme
~~~~~~

The `scheme <http://tools.ietf.org/html/rfc3986#section-3.1>`_ of a request
specifies the protocol to use when sending the request. When using Guzzle, the
scheme can be set to "http" or "https".

You can change the scheme of the request using the ``setScheme()`` method:

.. code-block:: php

    $request = $client->createRequest('GET', 'http://httbin.org');
    $request->setScheme('https');
    echo $request->getScheme();
    // https
    echo $request->getUrl();
    // https://httpbin.com/get

Port
~~~~

No port is necessary when using the "http" or "https" schemes, but you can
override the port using ``setPort()``. If you need to modify the port used with
the specified scheme from the default setting, then you must use the
``setPort()`` method.

.. code-block:: php

    $request = $client->createRequest('GET', 'http://httbin.org');
    $request->setPort(8080);
    echo $request->getPort();
    // 8080
    echo $request->getUrl();
    // https://httpbin.com:8080/get

    // Set the port back to the default value for the scheme
    $request->setPort(443);
    echo $request->getUrl();
    // https://httpbin.com/get

Query string
~~~~~~~~~~~~

You can get the query string of the request using the ``getQuery()`` method.
This method returns a ``GuzzleHttp\Query`` object. A Query object can be
accessed like a PHP array, iterated in a foreach statement like a PHP array,
and cast to a string.

.. code-block:: php

    $request = $client->createRequest('GET', 'http://httbin.org');
    $query = $request->getQuery();
    $query['foo'] = 'bar';
    $query['baz'] = 'bam';
    $query['bam'] = ['test' => 'abc'];

    echo $request->getQuery();
    // foo=bar&baz=bam&bam%5Btest%5D=abc

    echo $request->getQuery()['foo'];
    // bar
    echo $request->getQuery()->get('foo');
    // bar
    echo $request->getQuery()->get('foo');
    // bar

    var_export($request->getQuery()['bam']);
    // array('test' => 'abc')

    foreach ($query as $key => $value) {
        var_export($value);
    }

    echo $request->getUrl();
    // https://httpbin.com/get?foo=bar&baz=bam&bam%5Btest%5D=abc

Query Aggregators
^^^^^^^^^^^^^^^^^

Query objects can store scalar values or arrays of values. When an array of
values is added to a query object, the query object uses a query aggregator to
convert the complex structure into a string. Query objects will use
`PHP style query strings <http://www.php.net/http_build_query>`_ when complex
query string parameters are converted to a string. You can customize how
complex query string parameters are aggregated using the ``setAggregator()``
method of a query string object.

.. code-block:: php

    $query->setAggregator($query::duplicateAggregator());

In the above example, we've changed the query object to use the
"duplicateAggregator". This aggregator will allow duplicate entries to appear
in a query string rather than appending "[n]" to each value. So if you had a
query string with ``['a' => ['b', 'c']]``, the duplicate aggregator would
convert this to "a=b&a=c" while the default aggregator would convert this to
"a[0]=b&a[1]=c" (with urlencoded brackets).

The ``setAggregator()`` method accepts a ``callable`` which is used to convert
a deeply nested array of query string variables into a flattened array of key
value pairs. The callable accepts an array of query data and returns a
flattened array of key value pairs where each value is an array of strings.
You can use the ``GuzzleHttp\Query::walkQuery()`` static function to easily
create custom query aggregators.

Host
~~~~

You can change the host header of the request in a predictable way using the
``setHost()`` method of a request:

.. code-block:: php

    $request->setHost('www.google.com');
    echo $request->getHost();
    // www.google.com
    echo $request->getUrl();
    // https://www.google.com/get?foo=bar&baz=bam

.. note::

    The Host header can also be changed by modifying the Host header of a
    request directly, but modifying the Host header directly could result in
    sending a request to a different Host than what is specified in the Host
    header (sometimes this is actually the desired behavior).

Resource
~~~~~~~~

You can use the ``getResource()`` method of a request to return the path and
query string of a request in a single string.

.. code-block:: php

    $request = $client->createRequest('GET', 'http://httpbin.org/get?baz=bar');
    echo $request->getResource();
    // /get?baz=bar

Request Config
--------------

Request messages contain a configuration collection that can be used by
event listeners and HTTP handlers to modify how a request behaves or is
transferred over the wire. For example, many of the request options that are
specified when creating a request are actually set as config options that are
only acted upon by handlers and listeners when the request is sent.

You can get access to the request's config object using the ``getConfig()``
method of a request.

.. code-block:: php

    $request = $client->createRequest('GET', '/');
    $config = $request->getConfig();

The config object is a ``GuzzleHttp\Collection`` object that acts like
an associative array. You can grab values from the collection using array like
access. You can also modify and remove values using array like access.

.. code-block:: php

    $config['foo'] = 'bar';
    echo $config['foo'];
    // bar

    var_export(isset($config['foo']));
    // true

    unset($config['foo']);
    var_export(isset($config['foo']));
    // false

    var_export($config['foo']);
    // NULL

HTTP handlers and event listeners can expose additional customization options
through request config settings. For example, in order to specify custom cURL
options to the cURL handler, you need to specify an associative array in the
``curl`` ``config`` request option.

.. code-block:: php

    $client->get('/', [
        'config' => [
            'curl' => [
                CURLOPT_HTTPAUTH => CURLAUTH_NTLM,
                CURLOPT_USERPWD  => 'username:password'
            ]
        ]
    ]);

Consult the HTTP handlers and event listeners you are using to see if they
allow customization through request configuration options.

Event Emitter
-------------

Request objects implement ``GuzzleHttp\Event\HasEmitterInterface``, so they
have a method called ``getEmitter()`` that can be used to get an event emitter
used by the request. Any listener or subscriber attached to a request will only
be triggered for the lifecycle events of a specific request. Conversely, adding
an event listener or subscriber to a client will listen to all lifecycle events
of all requests created by the client.

See :doc:`events` for more information.

Responses
=========

Responses are the HTTP messages a client receives from a server after sending
an HTTP request message.

Start-Line
----------

The start-line of a response contains the protocol and protocol version,
status code, and reason phrase.

.. code-block:: php

    $response = GuzzleHttp\get('http://httpbin.org/get');
    echo $response->getStatusCode();
    // 200
    echo $response->getReasonPhrase();
    // OK
    echo $response->getProtocolVersion();
    // 1.1

Body
----

As described earlier, you can get the body of a response using the
``getBody()`` method.

.. code-block:: php

    if ($body = $response->getBody()) {
        echo $body;
        // Cast to a string: { ... }
        $body->seek(0);
        // Rewind the body
        $body->read(1024);
        // Read bytes of the body
    }

When working with JSON responses, you can use the ``json()`` method of a
response:

.. code-block:: php

    $json = $response->json();

.. note::

    Guzzle uses the ``json_decode()`` method of PHP and uses arrays rather than
    ``stdClass`` objects for objects.

You can use the ``xml()`` method when working with XML data.

.. code-block:: php

    $xml = $response->xml();

.. note::

    Guzzle uses the ``SimpleXMLElement`` objects when converting response
    bodies to XML.

Effective URL
-------------

The URL that was ultimately accessed that returned a response can be accessed
using the ``getEffectiveUrl()`` method of a response. This method will return
the URL of a request or the URL of the last redirected URL if any redirects
occurred while transferring a request.

.. code-block:: php

    $response = GuzzleHttp\get('http://httpbin.org/get');
    echo $response->getEffectiveUrl();
    // http://httpbin.org/get

    $response = GuzzleHttp\get('http://httpbin.org/redirect-to?url=http://www.google.com');
    echo $response->getEffectiveUrl();
    // http://www.google.com


text:
"""
    email_reply_parser is a python library port of GitHub's Email Reply Parser.

    For more information, visit https://github.com/zapier/email-reply-parser
"""

import re

class EmailReplyParser(object):
    """ Represents a email message that is parsed.
    """

    @staticmethod
    def read(text):
        """ Factory method that splits email into list of fragments

            text - A string email body

            Returns an EmailMessage instance
        """
        return EmailMessage(text).read()

    @staticmethod
    def parse_reply(text):
        """ Provides the reply portion of email.

            text - A string email body

            Returns reply body message
        """
        return EmailReplyParser.read(text).reply

class EmailMessage(object):
    """ An email message represents a parsed email body.
    """

    SIG_REGEX = re.compile(r'(--|__|-\w)|(^Sent from my (\w+\s*){1,3})')
    QUOTE_HDR_REGEX = re.compile('On.*wrote:$')
    QUOTED_REGEX = re.compile(r'(>+)')
    HEADER_REGEX = re.compile(r'^\*?(From|Sent|To|Subject):\*? .+')
    _MULTI_QUOTE_HDR_REGEX = r'(?!On.*On\s.+?wrote:)(On\s(.+?)wrote:)'
    MULTI_QUOTE_HDR_REGEX = re.compile(_MULTI_QUOTE_HDR_REGEX, re.DOTALL | re.MULTILINE)
    MULTI_QUOTE_HDR_REGEX_MULTILINE = re.compile(_MULTI_QUOTE_HDR_REGEX, re.DOTALL)

    def __init__(self, text):
        self.fragments = []
        self.fragment = None
        self.text = text.replace('\r\n', '\n')
        self.found_visible = False

    def read(self):
        """ Creates new fragment for each line
            and labels as a signature, quote, or hidden.

            Returns EmailMessage instance
        """

        self.found_visible = False

        is_multi_quote_header = self.MULTI_QUOTE_HDR_REGEX_MULTILINE.search(self.text)
        if is_multi_quote_header:
            self.text = self.MULTI_QUOTE_HDR_REGEX.sub(is_multi_quote_header.groups()[0].replace('\n', ''), self.text)

        # Fix any outlook style replies, with the reply immediately above the signature boundary line
        #   See email_2_2.txt for an example
        self.text = re.sub('([^\n])(?=\n ?[_-]{7,})', '\\1\n', self.text, re.MULTILINE)

        self.lines = self.text.split('\n')
        self.lines.reverse()

        for line in self.lines:
            self._scan_line(line)

        self._finish_fragment()

        self.fragments.reverse()

        return self

    @property
    def reply(self):
        """ Captures reply message within email
        """
        reply = []
        for f in self.fragments:
            if not (f.hidden or f.quoted):
                reply.append(f.content)
        return '\n'.join(reply)

    def _scan_line(self, line):
        """ Reviews each line in email message and determines fragment type

            line - a row of text from an email message
        """
        is_quote_header = self.QUOTE_HDR_REGEX.match(line) is not None
        is_quoted = self.QUOTED_REGEX.match(line) is not None
        is_header = is_quote_header or self.HEADER_REGEX.match(line) is not None

        if self.fragment and len(line.strip()) == 0:
            if self.SIG_REGEX.match(self.fragment.lines[-1].strip()):
                self.fragment.signature = True
                self._finish_fragment()

        if self.fragment \
                and ((self.fragment.headers == is_header and self.fragment.quoted == is_quoted) or
                         (self.fragment.quoted and (is_quote_header or len(line.strip()) == 0))):

            self.fragment.lines.append(line)
        else:
            self._finish_fragment()
            self.fragment = Fragment(is_quoted, line, headers=is_header)

    def quote_header(self, line):
        """ Determines whether line is part of a quoted area

            line - a row of the email message

            Returns True or False
        """
        return self.QUOTE_HDR_REGEX.match(line[::-1]) is not None

    def _finish_fragment(self):
        """ Creates fragment
        """

        if self.fragment:
            self.fragment.finish()
            if self.fragment.headers:
                # Regardless of what's been seen to this point, if we encounter a headers fragment,
                # all the previous fragments should be marked hidden and found_visible set to False.
                self.found_visible = False
                for f in self.fragments:
                    f.hidden = True
            if not self.found_visible:
                if self.fragment.quoted \
                        or self.fragment.headers \
                        or self.fragment.signature \
                        or (len(self.fragment.content.strip()) == 0):

                    self.fragment.hidden = True
                else:
                    self.found_visible = True
            self.fragments.append(self.fragment)
        self.fragment = None

class Fragment(object):
    """ A Fragment is a part of
        an Email Message, labeling each part.
    """

    def __init__(self, quoted, first_line, headers=False):
        self.signature = False
        self.headers = headers
        self.hidden = False
        self.quoted = quoted
        self._content = None
        self.lines = [first_line]

    def finish(self):
        """ Creates block of content with lines
            belonging to fragment.
        """
        self.lines.reverse()
        self._content = '\n'.join(self.lines)
        self.lines = None

    @property
    def content(self):
        return self._content.strip()


text:
using System;
using System.Linq;
using System.Collections.Generic;
using System.ServiceModel.Syndication;
using Firehose.Web.Infrastructure;

namespace Firehose.Web.Authors
{
    public class DanielKrzyczkowski : IAmAMicrosoftMVP, IFilterMyBlogPosts
    {
        public IEnumerable<Uri> FeedUris
        {
            get { yield return new Uri("http://mobileprogrammerblog.wordpress.com/feed/rss"); }
        }

        public string FirstName => "Daniel";
        public string LastName => "Krzyczkowski";
        public string StateOrRegion => "Warsaw, Poland";
        public string EmailAddress => "daniel.krzyczkowski@hotmail.com";
        public string ShortBioOrTagLine => "is passionate about Universal Windows Platform and Xamarin.";
        public Uri WebSite => new Uri("http://mobileprogrammer.pl");
        public string TwitterHandle => "DKrzyczkowski";
        public string GitHubHandle => "Daniel-Krzyczkowski";
        public string GravatarHash => "65e521a756dff3ac3c233e58afc9ee2b";
        public GeoPosition Position => new GeoPosition(52.230878, 21.010842);

          public bool Filter(SyndicationItem item)
          {
            return item.Title.Text.ToLowerInvariant().Contains("xamarin") && item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("xamarin"));
          }
    }
}


text:
using namespace std;
typedef actionlib::SimpleActionClient<control_msgs::JointTrajectoryAction> TrajClient;

class ArmControllerTester {
private:
    ros::NodeHandle nh;
    ros::NodeHandle pnh;

    auto_ptr<message_filters::Subscriber<humanoid_catching::MovementGoal> > movementGoalSub;
    ros::Publisher movementGoalMetricsPub;
    ros::Publisher movementPlanMetricsPub;

    string endEffector;
    string arm;
    string commandTopic;

    robot_model::JointModelGroup* jointModelGroup;
    robot_state::RobotStatePtr kinematicState;
    auto_ptr<TrajClient> trajectoryClient;
    auto_ptr<moveit::planning_interface::MoveGroup> moveGroup;
public:
    ArmControllerTester() :
            pnh("~")
        {

        if (!pnh.getParam("end_effector", endEffector))
        {
            ROS_ERROR("End effector name must be specified");
        }
        else {
            ROS_INFO("Configuring for end effector: [%s]", endEffector.c_str());
        }

        if (!pnh.getParam("arm", arm))
        {
            ROS_ERROR("Arm name must be specified");
        }
        else {
            ROS_INFO("Configuring for arm: [%s]", arm.c_str());
        }

        if (!pnh.getParam("command_topic", commandTopic))
        {
            ROS_ERROR("Command topic must be specified");
        }
        else {
            ROS_INFO("Subscribing to topic: [%s]", commandTopic.c_str());
        }

        // Setup the subscriber
        movementGoalSub.reset(new message_filters::Subscriber<humanoid_catching::MovementGoal>(nh,commandTopic, 1000));
        movementGoalSub->registerCallback(boost::bind(&ArmControllerTester::goalCallback, this, _1));

        // Setup the publisher
        movementGoalMetricsPub = nh.advertise<humanoid_catching::DurationStamped>("movement_execute_metric", 100000, true);
        movementPlanMetricsPub = nh.advertise<humanoid_catching::DurationStamped>("movement_plan_metric", 100000, true);

        robot_model_loader::RobotModelLoader robotModelLoader("robot_description");
        robot_model::RobotModelPtr kinematicModel = robotModelLoader.getModel();

        kinematicState.reset(new robot_state::RobotState(kinematicModel));
        kinematicState->setToDefaultValues();
        jointModelGroup = kinematicModel->getJointModelGroup(arm);

        trajectoryClient.reset(new TrajClient(arm == "left" ? "l_arm_controller/joint_trajectory_action" : "r_arm_controller/joint_trajectory_action", true));

        ROS_INFO("Waiting for the joint_trajectory_action server");
        if(!trajectoryClient->waitForServer(ros::Duration(30))){
            ROS_ERROR("joint trajectory server could not be found");
        }
        ROS_INFO("joint_trajectory_action server is up");

        moveGroup.reset(new moveit::planning_interface::MoveGroup(arm));
    }

private:

    static double distance(const geometry_msgs::Pose& pose1, const geometry_msgs::Pose& pose2) {
        return sqrt(pow(pose2.position.x - pose1.position.x, 2) + pow(pose2.position.y - pose1.position.y, 2) + pow(pose2.position.z - pose1.position.z, 2));
    }

    void goalCallback(const humanoid_catching::MovementGoalConstPtr movementGoal) {

        ROS_INFO("Receive a goal callback");

        setArmToStart(movementGoal->jointAngles);

        moveGroup->setGoalPositionTolerance(0.01);
        moveGroup->setGoalOrientationTolerance(0.01);
        moveGroup->setPoseTarget(movementGoal->pose);
        moveGroup->setPlanningTime(1.0);
        moveGroup->allowLooking(false);
        moveGroup->allowReplanning(false);

        ros::WallTime startMove = ros::WallTime::now();
        ros::Time startMoveRos = ros::Time::now();
        if (moveGroup->asyncMove() == -1) {
            ROS_WARN("Failed to start movement");
            return;
        }

        ROS_INFO("Polling for result");
        bool succeeded = false;
        while (ros::Duration(0.001).sleep() && ros::Time::now() - startMoveRos < ros::Duration(5)) {
            const geometry_msgs::PoseStamped& pose = moveGroup->getCurrentPose();
            ROS_INFO("Current position [%f %f %f]", pose.pose.position.x, pose.pose.position.y, pose.pose.position.z);
            ROS_INFO("Desired position [%f %f %f]", movementGoal->pose.position.x, movementGoal->pose.position.y, movementGoal->pose.position.z);
            double current = distance(pose.pose, movementGoal->pose);
            ROS_INFO("Current distance: [%f]", current);
            // TODO: Add orientation
            if (current <= 0.01) {
                ROS_INFO("Reached goal");
                succeeded = true;
                break;
            }
        }
        ROS_INFO("Finished polling for result");

        if (!succeeded) {
            ROS_WARN("Failed to reach goal");
            return;
        }
        ROS_INFO("Succeeded!");
        {
            humanoid_catching::DurationStamped msg;
            msg.arm = arm;
            msg.header = movementGoal->header;
            msg.duration = ros::Duration((ros::WallTime::now() - startMove).toSec());
            ROS_INFO("Duration of move was [%f]", msg.duration.toSec());
            movementGoalMetricsPub.publish(msg);
        }

        ROS_INFO("Exiting goal callback");
    }

    void setArmToStart(const vector<double>& positions) {

        control_msgs::JointTrajectoryGoal goal;
        goal.trajectory.header.stamp = ros::Time::now();

        if (arm == "left") {
            goal.trajectory.joint_names.push_back("l_shoulder_pan_joint");
            goal.trajectory.joint_names.push_back("l_shoulder_lift_joint");
            goal.trajectory.joint_names.push_back("l_upper_arm_roll_joint");
            goal.trajectory.joint_names.push_back("l_elbow_flex_joint");
            goal.trajectory.joint_names.push_back("l_forearm_roll_joint");
            goal.trajectory.joint_names.push_back("l_wrist_flex_joint");
            goal.trajectory.joint_names.push_back("l_wrist_roll_joint");
        }
        else {
            goal.trajectory.joint_names.push_back("r_shoulder_pan_joint");
            goal.trajectory.joint_names.push_back("r_shoulder_lift_joint");
            goal.trajectory.joint_names.push_back("r_upper_arm_roll_joint");
            goal.trajectory.joint_names.push_back("r_elbow_flex_joint");
            goal.trajectory.joint_names.push_back("r_forearm_roll_joint");
            goal.trajectory.joint_names.push_back("r_wrist_flex_joint");
            goal.trajectory.joint_names.push_back("r_wrist_roll_joint");
        }
        goal.trajectory.points.resize(1);
        goal.trajectory.points[0].positions = positions;

        goal.trajectory.points[0].velocities.resize(7);
        goal.trajectory.points[0].velocities[0] = 0.0;
        goal.trajectory.points[0].time_from_start = ros::Duration(0.5);

        trajectoryClient->sendGoal(goal);
        ROS_INFO("Sent goal to reset arm positions");

        // Wait for the action to return
        if (trajectoryClient->waitForResult(ros::Duration(30.0))) {
            actionlib::SimpleClientGoalState state = trajectoryClient->getState();
            ROS_INFO("Action finished: %s", state.toString().c_str());
        }
        else {
            ROS_WARN("Failed to move to base position");
        }
    }
};

int main(int argc, char **argv) {
    ros::init(argc, argv, "arm_controller_tester");
    ArmControllerTester act;
    ros::spin();
    return 0;
}


text:
package badger

import (
	"testing"
	"time"

	assert "github.com/stretchr/testify/require"

	"github.com/jaegertracing/jaeger/pkg/config"
)

func TestDefaultOptionsParsing(t *testing.T) {
	opts := NewOptions("badger")
	v, command := config.Viperize(opts.AddFlags)
	command.ParseFlags([]string{})
	opts.InitFromViper(v)

	assert.True(t, opts.GetPrimary().Ephemeral)
	assert.False(t, opts.GetPrimary().SyncWrites)
	assert.Equal(t, time.Duration(72*time.Hour), opts.GetPrimary().SpanStoreTTL)
}

func TestParseOptions(t *testing.T) {
	opts := NewOptions("badger")
	v, command := config.Viperize(opts.AddFlags)
	command.ParseFlags([]string{
		"--badger.ephemeral=false",
		"--badger.consistency=true",
		"--badger.directory-key=/var/lib/badger",
		"--badger.directory-value=/mnt/slow/badger",
		"--badger.span-store-ttl=168h",
	})
	opts.InitFromViper(v)

	assert.False(t, opts.GetPrimary().Ephemeral)
	assert.True(t, opts.GetPrimary().SyncWrites)
	assert.Equal(t, time.Duration(168*time.Hour), opts.GetPrimary().SpanStoreTTL)
	assert.Equal(t, "/var/lib/badger", opts.GetPrimary().KeyDirectory)
	assert.Equal(t, "/mnt/slow/badger", opts.GetPrimary().ValueDirectory)
	assert.False(t, opts.GetPrimary().ReadOnly)
	assert.False(t, opts.GetPrimary().Truncate)
}

func TestTruncateAndReadOnlyOptions(t *testing.T) {
	opts := NewOptions("badger")
	v, command := config.Viperize(opts.AddFlags)
	command.ParseFlags([]string{
		"--badger.truncate=true",
		"--badger.read-only=true",
	})
	opts.InitFromViper(v)

	assert.True(t, opts.GetPrimary().ReadOnly)
	assert.True(t, opts.GetPrimary().Truncate)
}


text:
package co.guiduck.scope;
import java.util.Map;

import co.guiduck.data.Data;

public class Scope {
	private Map<String, Data> variables;
	private int returnAddress;

	public Scope(Map<String, Data> variables, int returnAddress) {
		this.variables = variables;
		this.returnAddress = returnAddress;
	}

	public Object getData(String var) {
		return variables.get(var);
	}

	public boolean containsVar(String var) {
		return variables.containsKey(var);
	}

}


text:
from __future__ import unicode_literals

# Django
from django.db import migrations, models

# AWX
from awx.main.migrations import ActivityStreamDisabledMigration
from awx.main.migrations import _inventory_source as invsrc
from awx.main.migrations import _migration_utils as migration_utils
from awx.main.migrations import _reencrypt as reencrypt
from awx.main.migrations import _scan_jobs as scan_jobs
from awx.main.migrations import _credentialtypes as credentialtypes
from awx.main.migrations import _azure_credentials as azurecreds
import awx.main.fields

class Migration(ActivityStreamDisabledMigration):

    dependencies = [
        ('main', '0006_v320_release'),
    ]

    operations = [
        # Inventory Refresh
        migrations.RunPython(migration_utils.set_current_apps_for_migrations),
        migrations.RunPython(invsrc.remove_rax_inventory_sources),
        migrations.RunPython(azurecreds.remove_azure_credentials),
        migrations.RunPython(invsrc.remove_azure_inventory_sources),
        migrations.RunPython(invsrc.remove_inventory_source_with_no_inventory_link),
        migrations.RunPython(invsrc.rename_inventory_sources),
        migrations.RunPython(reencrypt.replace_aesecb_fernet),
        migrations.RunPython(scan_jobs.migrate_scan_job_templates),

        migrations.RunPython(credentialtypes.migrate_to_v2_credentials),
        migrations.RunPython(credentialtypes.migrate_job_credentials),
    ]


text:
"use strict";

const Chan = require("../../models/chan");
const Msg = require("../../models/msg");
const LinkPrefetch = require("./link");

module.exports = function(irc, network) {
	var client = this;

	irc.on("notice", function(data) {
		// Some servers send notices without any nickname
		if (!data.nick) {
			data.from_server = true;
			data.nick = network.host;
		}

		data.type = Msg.Type.NOTICE;
		handleMessage(data);
	});

	irc.on("action", function(data) {
		data.type = Msg.Type.ACTION;
		handleMessage(data);
	});

	irc.on("privmsg", function(data) {
		data.type = Msg.Type.MESSAGE;
		handleMessage(data);
	});

	irc.on("wallops", function(data) {
		data.from_server = true;
		data.type = Msg.Type.NOTICE;
		handleMessage(data);
	});

	function handleMessage(data) {
		let chan;
		let highlight = false;
		const self = data.nick === irc.user.nick;

		// Server messages go to server window, no questions asked
		if (data.from_server) {
			chan = network.channels[0];
		} else {
			var target = data.target;

			// If the message is targeted at us, use sender as target instead
			if (target.toLowerCase() === irc.user.nick.toLowerCase()) {
				target = data.nick;
			}

			chan = network.getChannel(target);
			if (typeof chan === "undefined") {
				// Send notices that are not targeted at us into the server window
				if (data.type === Msg.Type.NOTICE) {
					chan = network.channels[0];
				} else {
					chan = new Chan({
						type: Chan.Type.QUERY,
						name: target
					});
					network.channels.push(chan);
					client.emit("join", {
						network: network.id,
						chan: chan
					});
				}
			}

			// Query messages (unless self) always highlight
			if (chan.type === Chan.Type.QUERY) {
				highlight = !self;
			}
		}

		// Self messages in channels are never highlighted
		// Non-self messages are highlighted as soon as the nick is detected
		if (!highlight && !self) {
			highlight = network.highlightRegex.test(data.message);
		}

		var msg = new Msg({
			type: data.type,
			time: data.time,
			mode: chan.getMode(data.nick),
			from: data.nick,
			text: data.message,
			self: self,
			highlight: highlight
		});
		chan.pushMessage(client, msg, !self);

		// No prefetch URLs unless are simple MESSAGE or ACTION types
		if ([Msg.Type.MESSAGE, Msg.Type.ACTION].indexOf(data.type) !== -1) {
			LinkPrefetch(client, chan, msg);
		}
	}
};


text:
Introduction to the Geospatial Goodies in Elasticsearch
===============================================================


text:
title: Graffiti
location: "Bristol, England"
layout: gallery

gallery:
- src: bristol-1.jpg
  alt: Graffiti of a large mechanical dragon.
  comment: Robo-dragon
- src: bristol-2.jpg
  alt: Graffiti of a man wearing a gas mask.
  comment: This was in the large roundabout in the city center.
- src: bristol-3.jpg
  alt: Graffiti of a sad girl.
  bgpos: 0 16%
- src: bristol-4.jpg
  alt: Tattoo art of the word Bristol
  bgpos: 0 30%
- src: bristol-5.jpg
  alt: Graffiti of indeterminate creatures.
  comment: blarg

summary: I went to Frontend United in Bristol. They had some sweet graffiti.
---


text:
class BooksController < ApplicationController
  before_action :authenticate_user!

  def new
    @book = Book.new
    @hosts = Host.all
    @users= User.all
  end

  def index
    if current_user
      @books = Book.where(user_id: current_user.id)
    else
      @books = Book.where(host_id: current_host.id).delete_expired_books
    end
  end

  def create
    @book = Book.new book_params
    if @book.save
      redirect_to books_path, notice: "Booking successfully created"
    else
      render 'new'
    end
  end

  def show
    if current_user
      @books = Book.where(user_id: current_user.id)
    else
      @books = Book.where(host_id: current_host.id)
    end
  end

  private

  def book_params
    params.require(:book).permit(:name, :location, :description, :user_id, :host_id, :start_at, :end_at )
  end

end


text:
import multiprocessing
import os
import time
import unittest
import uuid
from unittest import mock

import pytest
from mock import patch

from airflow import settings
from airflow.exceptions import AirflowException
from airflow.executors.sequential_executor import SequentialExecutor
from airflow.jobs.local_task_job import LocalTaskJob
from airflow.models.dag import DAG
from airflow.models.dagbag import DagBag
from airflow.models.taskinstance import TaskInstance
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python import PythonOperator
from airflow.utils import timezone
from airflow.utils.net import get_hostname
from airflow.utils.session import create_session
from airflow.utils.state import State
from airflow.utils.timeout import timeout
from tests.test_utils.asserts import assert_queries_count
from tests.test_utils.db import clear_db_runs
from tests.test_utils.mock_executor import MockExecutor

DEFAULT_DATE = timezone.datetime(2016, 1, 1)
TEST_DAG_FOLDER = os.environ['AIRFLOW__CORE__DAGS_FOLDER']

class TestLocalTaskJob(unittest.TestCase):
    def setUp(self):
        clear_db_runs()
        patcher = patch('airflow.jobs.base_job.sleep')
        self.addCleanup(patcher.stop)
        self.mock_base_job_sleep = patcher.start()

    def test_localtaskjob_essential_attr(self):
        """
        Check whether essential attributes
        of LocalTaskJob can be assigned with
        proper values without intervention
        """
        dag = DAG(
            'test_localtaskjob_essential_attr',
            start_date=DEFAULT_DATE,
            default_args={'owner': 'owner1'})

        with dag:
            op1 = DummyOperator(task_id='op1')

        dag.clear()
        dr = dag.create_dagrun(run_id="test",
                               state=State.SUCCESS,
                               execution_date=DEFAULT_DATE,
                               start_date=DEFAULT_DATE)
        ti = dr.get_task_instance(task_id=op1.task_id)

        job1 = LocalTaskJob(task_instance=ti,
                            ignore_ti_state=True,
                            executor=SequentialExecutor())

        essential_attr = ["dag_id", "job_type", "start_date", "hostname"]

        check_result_1 = [hasattr(job1, attr) for attr in essential_attr]
        self.assertTrue(all(check_result_1))

        check_result_2 = [getattr(job1, attr) is not None for attr in essential_attr]
        self.assertTrue(all(check_result_2))

    @patch('os.getpid')
    def test_localtaskjob_heartbeat(self, mock_pid):
        session = settings.Session()
        dag = DAG(
            'test_localtaskjob_heartbeat',
            start_date=DEFAULT_DATE,
            default_args={'owner': 'owner1'})

        with dag:
            op1 = DummyOperator(task_id='op1')

        dag.clear()
        dr = dag.create_dagrun(run_id="test",
                               state=State.SUCCESS,
                               execution_date=DEFAULT_DATE,
                               start_date=DEFAULT_DATE,
                               session=session)
        ti = dr.get_task_instance(task_id=op1.task_id, session=session)
        ti.state = State.RUNNING
        ti.hostname = "blablabla"
        session.commit()

        job1 = LocalTaskJob(task_instance=ti,
                            ignore_ti_state=True,
                            executor=SequentialExecutor())
        self.assertRaises(AirflowException, job1.heartbeat_callback)

        mock_pid.return_value = 1
        ti.state = State.RUNNING
        ti.hostname = get_hostname()
        ti.pid = 1
        session.merge(ti)
        session.commit()

        job1.heartbeat_callback(session=None)

        mock_pid.return_value = 2
        self.assertRaises(AirflowException, job1.heartbeat_callback)

    @patch('os.getpid')
    def test_heartbeat_failed_fast(self, mock_getpid):
        """
        Test that task heartbeat will sleep when it fails fast
        """
        mock_getpid.return_value = 1
        self.mock_base_job_sleep.side_effect = time.sleep

        with create_session() as session:
            dagbag = DagBag(
                dag_folder=TEST_DAG_FOLDER,
                include_examples=False,
            )
            dag_id = 'test_heartbeat_failed_fast'
            task_id = 'test_heartbeat_failed_fast_op'
            dag = dagbag.get_dag(dag_id)
            task = dag.get_task(task_id)

            dag.create_dagrun(run_id="test_heartbeat_failed_fast_run",
                              state=State.RUNNING,
                              execution_date=DEFAULT_DATE,
                              start_date=DEFAULT_DATE,
                              session=session)
            ti = TaskInstance(task=task, execution_date=DEFAULT_DATE)
            ti.refresh_from_db()
            ti.state = State.RUNNING
            ti.hostname = get_hostname()
            ti.pid = 1
            session.commit()

            job = LocalTaskJob(task_instance=ti, executor=MockExecutor(do_update=False))
            job.heartrate = 2
            heartbeat_records = []
            job.heartbeat_callback = lambda session: heartbeat_records.append(job.latest_heartbeat)
            job._execute()
            self.assertGreater(len(heartbeat_records), 2)
            for i in range(1, len(heartbeat_records)):
                time1 = heartbeat_records[i - 1]
                time2 = heartbeat_records[i]
                # Assert that difference small enough
                delta = (time2 - time1).total_seconds()
                self.assertAlmostEqual(delta, job.heartrate, delta=0.05)

    @pytest.mark.xfail(condition=True, reason="This test might be flaky in postgres/mysql")
    def test_mark_success_no_kill(self):
        """
        Test that ensures that mark_success in the UI doesn't cause
        the task to fail, and that the task exits
        """
        dagbag = DagBag(
            dag_folder=TEST_DAG_FOLDER,
            include_examples=False,
        )
        dag = dagbag.dags.get('test_mark_success')
        task = dag.get_task('task1')

        session = settings.Session()

        dag.clear()
        dag.create_dagrun(run_id="test",
                          state=State.RUNNING,
                          execution_date=DEFAULT_DATE,
                          start_date=DEFAULT_DATE,
                          session=session)
        ti = TaskInstance(task=task, execution_date=DEFAULT_DATE)
        ti.refresh_from_db()
        job1 = LocalTaskJob(task_instance=ti, ignore_ti_state=True)
        process = multiprocessing.Process(target=job1.run)
        process.start()
        ti.refresh_from_db()
        for _ in range(0, 50):
            if ti.state == State.RUNNING:
                break
            time.sleep(0.1)
            ti.refresh_from_db()
        self.assertEqual(State.RUNNING, ti.state)
        ti.state = State.SUCCESS
        session.merge(ti)
        session.commit()

        process.join(timeout=10)
        self.assertFalse(process.is_alive())
        ti.refresh_from_db()
        self.assertEqual(State.SUCCESS, ti.state)

    def test_localtaskjob_double_trigger(self):
        dagbag = DagBag(
            dag_folder=TEST_DAG_FOLDER,
            include_examples=False,
        )
        dag = dagbag.dags.get('test_localtaskjob_double_trigger')
        task = dag.get_task('test_localtaskjob_double_trigger_task')

        session = settings.Session()

        dag.clear()
        dr = dag.create_dagrun(run_id="test",
                               state=State.SUCCESS,
                               execution_date=DEFAULT_DATE,
                               start_date=DEFAULT_DATE,
                               session=session)
        ti = dr.get_task_instance(task_id=task.task_id, session=session)
        ti.state = State.RUNNING
        ti.hostname = get_hostname()
        ti.pid = 1
        session.merge(ti)
        session.commit()

        ti_run = TaskInstance(task=task, execution_date=DEFAULT_DATE)
        ti_run.refresh_from_db()
        job1 = LocalTaskJob(task_instance=ti_run,
                            executor=SequentialExecutor())
        from airflow.task.task_runner.standard_task_runner import StandardTaskRunner
        with patch.object(StandardTaskRunner, 'start', return_value=None) as mock_method:
            job1.run()
            mock_method.assert_not_called()

        ti = dr.get_task_instance(task_id=task.task_id, session=session)
        self.assertEqual(ti.pid, 1)
        self.assertEqual(ti.state, State.RUNNING)

        session.close()

    @pytest.mark.quarantined
    def test_localtaskjob_maintain_heart_rate(self):
        dagbag = DagBag(
            dag_folder=TEST_DAG_FOLDER,
            include_examples=False,
        )
        dag = dagbag.dags.get('test_localtaskjob_double_trigger')
        task = dag.get_task('test_localtaskjob_double_trigger_task')

        session = settings.Session()

        dag.clear()
        dag.create_dagrun(run_id="test",
                          state=State.SUCCESS,
                          execution_date=DEFAULT_DATE,
                          start_date=DEFAULT_DATE,
                          session=session)

        ti_run = TaskInstance(task=task, execution_date=DEFAULT_DATE)
        ti_run.refresh_from_db()
        job1 = LocalTaskJob(task_instance=ti_run,
                            executor=SequentialExecutor())

        # this should make sure we only heartbeat once and exit at the second
        # loop in _execute()
        return_codes = [None, 0]

        def multi_return_code():
            return return_codes.pop(0)

        time_start = time.time()
        from airflow.task.task_runner.standard_task_runner import StandardTaskRunner
        with patch.object(StandardTaskRunner, 'start', return_value=None) as mock_start:
            with patch.object(StandardTaskRunner, 'return_code') as mock_ret_code:
                mock_ret_code.side_effect = multi_return_code
                job1.run()
                self.assertEqual(mock_start.call_count, 1)
                self.assertEqual(mock_ret_code.call_count, 2)
        time_end = time.time()

        self.assertEqual(self.mock_base_job_sleep.call_count, 1)
        self.assertEqual(job1.state, State.SUCCESS)

        # Consider we have patched sleep call, it should not be sleeping to
        # keep up with the heart rate in other unpatched places
        #
        # We already make sure patched sleep call is only called once
        self.assertLess(time_end - time_start, job1.heartrate)
        session.close()

    def test_mark_failure_on_failure_callback(self):
        """
        Test that ensures that mark_failure in the UI fails
        the task, and executes on_failure_callback
        """
        data = {'called': False}

        def check_failure(context):
            self.assertEqual(context['dag_run'].dag_id, 'test_mark_failure')
            data['called'] = True

        def task_function(ti):
            print("python_callable run in pid %s", os.getpid())
            with create_session() as session:
                self.assertEqual(State.RUNNING, ti.state)
                ti.log.info("Marking TI as failed 'externally'")
                ti.state = State.FAILED
                session.merge(ti)
                session.commit()

            time.sleep(60)
            # This should not happen -- the state change should be noticed and the task should get killed
            data['reached_end_of_sleep'] = True

        with DAG(dag_id='test_mark_failure', start_date=DEFAULT_DATE) as dag:
            task = PythonOperator(
                task_id='test_state_succeeded1',
                python_callable=task_function,
                on_failure_callback=check_failure)

        session = settings.Session()

        dag.clear()
        dag.create_dagrun(run_id="test",
                          state=State.RUNNING,
                          execution_date=DEFAULT_DATE,
                          start_date=DEFAULT_DATE,
                          session=session)
        ti = TaskInstance(task=task, execution_date=DEFAULT_DATE)
        ti.refresh_from_db()

        job1 = LocalTaskJob(task_instance=ti,
                            ignore_ti_state=True,
                            executor=SequentialExecutor())
        with timeout(30):
            # This should be _much_ shorter to run.
            # If you change this limit, make the timeout in the callbable above bigger
            job1.run()

        ti.refresh_from_db()
        self.assertEqual(ti.state, State.FAILED)
        self.assertTrue(data['called'])
        self.assertNotIn('reached_end_of_sleep', data,
                         'Task should not have been allowed to run to completion')

    @pytest.mark.quarantined
    def test_mark_success_on_success_callback(self):
        """
        Test that ensures that where a task is marked suceess in the UI
        on_success_callback gets executed
        """
        data = {'called': False}

        def success_callback(context):
            self.assertEqual(context['dag_run'].dag_id,
                             'test_mark_success')
            data['called'] = True

        dag = DAG(dag_id='test_mark_success',
                  start_date=DEFAULT_DATE,
                  default_args={'owner': 'owner1'})

        task = DummyOperator(
            task_id='test_state_succeeded1',
            dag=dag,
            on_success_callback=success_callback)

        session = settings.Session()

        dag.clear()
        dag.create_dagrun(run_id="test",
                          state=State.RUNNING,
                          execution_date=DEFAULT_DATE,
                          start_date=DEFAULT_DATE,
                          session=session)
        ti = TaskInstance(task=task, execution_date=DEFAULT_DATE)
        ti.refresh_from_db()
        job1 = LocalTaskJob(task_instance=ti,
                            ignore_ti_state=True,
                            executor=SequentialExecutor())
        from airflow.task.task_runner.standard_task_runner import StandardTaskRunner
        job1.task_runner = StandardTaskRunner(job1)
        process = multiprocessing.Process(target=job1.run)
        process.start()
        ti.refresh_from_db()
        for _ in range(0, 50):
            if ti.state == State.RUNNING:
                break
            time.sleep(0.1)
            ti.refresh_from_db()
        self.assertEqual(State.RUNNING, ti.state)
        ti.state = State.SUCCESS
        session.merge(ti)
        session.commit()

        job1.heartbeat_callback(session=None)
        self.assertTrue(data['called'])
        process.join(timeout=10)
        self.assertFalse(process.is_alive())

@pytest.fixture()
def clean_db_helper():
    yield
    clear_db_runs()

@pytest.mark.usefixtures("clean_db_helper")
class TestLocalTaskJobPerformance:
    @pytest.mark.parametrize("return_codes", [[0], 9 * [None] + [0]])  # type: ignore
    @mock.patch("airflow.jobs.local_task_job.get_task_runner")
    def test_number_of_queries_single_loop(self, mock_get_task_runner, return_codes):
        unique_prefix = str(uuid.uuid4())
        dag = DAG(dag_id=f'{unique_prefix}_test_number_of_queries', start_date=DEFAULT_DATE)
        task = DummyOperator(task_id='test_state_succeeded1', dag=dag)

        dag.clear()
        dag.create_dagrun(run_id=unique_prefix, state=State.NONE)

        ti = TaskInstance(task=task, execution_date=DEFAULT_DATE)

        mock_get_task_runner.return_value.return_code.side_effects = return_codes

        job = LocalTaskJob(task_instance=ti, executor=MockExecutor())
        with assert_queries_count(12):
            job.run()