text:
require 'rails_helper'

RSpec.describe StaffNomisChecker do
  subject { described_class.new(visit) }

  # Enabled for slot availability
  let(:prison)   { build_stubbed(:prison, name: 'Pentonville') }
  let(:pvb_prisoner) { build_stubbed(:prisoner) }
  let(:visit)    { build_stubbed(:visit, prisoner: pvb_prisoner, prison: prison) }
  let(:nomis_prisoner) { Nomis::Prisoner.new(id: 'some_noms_id', noms_id: pvb_prisoner.number) }

  describe 'When the API is disabled' do
    before do
      switch_off_api
    end

    describe '#prisoner_availability_unknown?' do
      it { is_expected.to be_prisoner_availability_unknown }
    end

    describe '#slot_availability_unknown?' do
      it { is_expected.not_to be_slot_availability_unknown }
    end

    describe '#errors_for' do
      it { expect(subject.errors_for(visit.slots.first)).to be_empty }
    end

    describe '#prisoner' do
      it { expect(subject.prisoner).to be_instance_of(Nomis::NullPrisoner) }
    end
  end

  describe '#prisoner_availability_unknown?' do
    let(:prisoner_availability_validation) do
      instance_double(PrisonerAvailabilityValidation,
                      valid?: false, unknown_result?: unknown_result)
    end

    before do
      mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
      mock_service_with(PrisonerAvailabilityValidation, prisoner_availability_validation)
    end

    context 'when the validator returns unknown' do
      let(:unknown_result) { true }

      it { is_expected.to be_prisoner_availability_unknown }
    end

    context 'when the validator returns not unknown' do
      let(:unknown_result) { false }

      it { is_expected.not_to be_prisoner_availability_unknown }
    end
  end

  describe '#errors_for' do
    let(:slot) { visit.slots.first }

    context 'when the api is disabled' do
      before do
        switch_off_api
      end

      it { expect(subject.errors_for(slot)).to be_empty }
    end

    context 'when the api is enabled' do
      let(:slot_date) { Time.zone.today + 10.days }
      let(:api) { 'https://api-dev.prison.service.justice.gov.uk/api/v1' }

      before do
        stub_auth_token
        stub_request(:get, "#{api}/prison/#{prison.nomis_id}/slots?end_date=#{slot_date}&start_date=#{slot_date}").
          to_return(body: { slots: ["time": "#{slot_date}T14:00/16:10"] }.to_json)
      end

      context 'with a valid prisoner' do
        let(:prisoner_availability_validator) do
          instance_double(PrisonerAvailabilityValidation, valid?: false, slot_errors: messages)
        end

        before do
          mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
          mock_service_with(PrisonerAvailabilityValidation, prisoner_availability_validator)
        end

        context 'with an error' do
          let(:messages) { [Nomis::PrisonerDateAvailability::EXTERNAL_MOVEMENT] }

          it { expect(subject.errors_for(slot)).to eq(messages) }
        end

        context 'with no errors' do
          let(:messages) { [] }

          it { expect(subject.errors_for(slot)).to eq([]) }
        end
      end

      context 'with a null prisoner' do
        let(:nomis_prisoner) { Nomis::NullPrisoner.new }

        before do
          mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
        end

        it { expect(subject.errors_for(slot)).to be_empty }
      end
    end

    context 'with slot availability' do
      context 'with NOMIS_STAFF_SLOT_AVAILABILITY_ENABLED switched OFF' do
        let(:prisoner_availability_validator) do
          instance_double(PrisonerAvailabilityValidation, valid?: false, slot_errors: [])
        end

        before do
          mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
          mock_service_with(PrisonerAvailabilityValidation, prisoner_availability_validator)
          switch_off :nomis_staff_slot_availability_enabled
        end

        it { expect(subject.errors_for(slot)).to be_empty }

        describe "and STAFF_PRISONS_WITH_SLOT_AVAILABILITY switched OFF for the visit's prison" do
          before do
            switch_feature_flag_with(:staff_prisons_with_slot_availability, [])
          end

          it { expect(subject.errors_for(slot)).to be_empty }
        end
      end

      context 'with NOMIS_STAFF_SLOT_AVAILABILITY_ENABLED switched ON' do
        before do
          switch_on :nomis_staff_slot_availability_enabled
          mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
        end

        describe "and STAFF_PRISONS_WITH_SLOT_AVAILABILITY switched ON for the visit's prison" do
          let(:message)  { nil }
          let(:slot_availability_validation) do
            instance_double(SlotAvailabilityValidation, valid?: false, slot_error: message)
          end

          let(:prisoner_availability_validator) do
            instance_double(PrisonerAvailabilityValidation, valid?: false, slot_errors: [])
          end

          before do
            switch_feature_flag_with(:staff_prisons_with_slot_availability, %w[Pentonville Cardiff])
            mock_service_with(SlotAvailabilityValidation, slot_availability_validation)
            mock_service_with(PrisonerAvailabilityValidation, prisoner_availability_validator)
          end

          context 'with no errors' do
            let(:message) { nil }

            it { expect(subject.errors_for(slot)).to be_empty }
          end

          context 'with an error' do
            let(:message) { SlotAvailabilityValidation::SLOT_NOT_AVAILABLE }

            it { expect(subject.errors_for(slot)).to eq([message]) }
          end
        end
      end
    end
  end

  describe '#slots_unavailable?' do
    describe 'when the slots have expired' do
      before do
        now = Date.current
        allow(visit).
          to receive(:slots).
               and_return([
                            ConcreteSlot.new(2015, 10, 5, 11, 30, 12, 30),
                            ConcreteSlot.new(now.year, now.month, now.day, 14, 30, 15, 30)
                          ])
      end

      it { is_expected.to be_slots_unavailable }
    end

    describe 'when the slots are unavailable' do
      before do
        allow(subject).
          to receive(:errors_for).
               with(anything).
               and_return([SlotAvailabilityValidation::SLOT_NOT_AVAILABLE])
      end

      it { is_expected.to be_slots_unavailable }
    end

    describe 'when a future slot is available' do
      let(:slot1) do
        date = Date.current + 3.days
        ConcreteSlot.new(date.year, date.month, date.day, 12, 0, 13, 0)
      end

      let(:slot2) do
        date = Date.current + 2.days
        ConcreteSlot.new(date.year, date.month, date.day, 12, 0, 13, 0)
      end

      let(:slot3) do
        date = Date.current - 2.days
        ConcreteSlot.new(date.year, date.month, date.day, 12, 0, 13, 0)
      end

      before do
        allow(visit).to receive(:slots).and_return([slot1, slot2, slot3])

        allow(subject).to receive(:errors_for).with(slot1).and_return([])

        allow(subject).
          to receive(:errors_for).
               with(slot2).
               and_return([SlotAvailabilityValidation::SLOT_NOT_AVAILABLE])
      end

      it { is_expected.not_to be_slots_unavailable }
    end
  end

  describe '#no_allowance?' do
    let(:slot) { ConcreteSlot.new(2015, 11, 6, 18, 0, 19, 0) }

    before do
      expect(subject).to receive(:errors_for).with(slot).and_return(errors)
    end

    context 'when there is no vo error' do
      let(:errors) { [Nomis::PrisonerDateAvailability::OUT_OF_VO] }

      it { is_expected.to be_no_allowance(slot) }
    end

    context "when there isn't a no vo error" do
      let(:errors) { [] }

      it { is_expected.not_to be_no_allowance(slot) }
    end
  end

  describe '#prisoner_out_of_prison?' do
    let(:slot) { ConcreteSlot.new(2015, 11, 6, 18, 0, 19, 0) }

    before do
      expect(subject).to receive(:errors_for).with(slot).and_return(errors)
    end

    context 'when there is a prisoner out of prison error' do
      let(:errors) { [Nomis::PrisonerDateAvailability::EXTERNAL_MOVEMENT] }

      it { is_expected.to be_prisoner_out_of_prison(slot) }
    end

    context "when there isn't prisoner out of prison error" do
      let(:errors) { [] }

      it { is_expected.not_to be_prisoner_out_of_prison(slot) }
    end
  end

  describe '#contact_list_unknown?' do
    let(:contact_list) do
      instance_double(PrisonerContactList)
    end

    context 'when the contact list returns an API error' do
      let(:contact_list_api_error) { true }

      before do
        mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
        expect(contact_list).to receive(:unknown_result?).and_return(contact_list_api_error)
        mock_service_with(PrisonerContactList, contact_list)
      end

      it { is_expected.to be_contact_list_unknown }
    end
  end

  describe '#approved_contacts' do
    let(:approved_contacts) { double }
    let(:contact_list) do
      instance_double(PrisonerContactList, approved: approved_contacts)
    end

    before do
      mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
      mock_service_with(PrisonerContactList, contact_list)
    end

    it 'returns the prisoner approved contacts' do
      expect(subject.approved_contacts).to eq(approved_contacts)
    end
  end

  describe '#prisoner' do
    before do
      mock_nomis_with(:lookup_active_prisoner, nomis_prisoner)
    end

    it { expect(subject.prisoner).to eq(nomis_prisoner) }
  end
end


text:
package dsmoq.maintenance.data.group

/**
 * メンバー更新のパラメータを表すクラス
 */
case class UpdateMemberParameter(
  groupId: Option[String],
  userId: Option[String],
  role: MemberRole
) {
  override def toString: String = {
    s"groupId=${groupId},userId=${userId},role=${role.toString}"
  }
}

/**
 * メンバー更新のパラメータを表すクラスのコンパニオンオブジェクト
 */
object UpdateMemberParameter {

  /**
   * マップ値からパラメータを作成する。
   *
   * @param map マップ値
   * @return パラメータ
   */
  def fromMap(map: Map[String, String]): UpdateMemberParameter = {
    UpdateMemberParameter(
      groupId = map.get("groupId"),
      userId = map.get("userId"),
      role = MemberRole(map.get("role"))
    )
  }
}

redpajama_set_name: RedPajamaGithub


text:
<bravo>
    <components>
        <!-- The following are equivalent.  The first
             add-on is in the same XMLNS as bravo, but should
             be transparently handled in its real namespace-->
        <component type="assembly"
                   name="Carbonfrost.Commons.SharedRuntime" />

        <component xmlns="http://ns.carbonfrost.com/commons/sharedruntime"
                   type="assembly"
                   name="Carbonfrost.Commons.SharedRuntime" />
    </components>
</bravo>


text:
---
uid: SolidEdgeFrameworkSupport.ChamferGeometry2d.ModifyBySetBacks(System.Double,System.Double)
summary:
remarks:
syntax:
    parameters:
    - id: SetBackA
      description: Specifies the setback from the intersection of the two objects the chamfer has been placed between along the first object to which it connects.
    - id: SetBackB
      description: Specifies the setback from the intersection of the two objects the chamfer has been placed between along the second object to which it connects.
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgeFrameworkSupport.ChamferGeometry2d.ModifyBySetBacks.vb]
[!code-csharp[Main](..\snippets\SolidEdgeFrameworkSupport.ChamferGeometry2d.ModifyBySetBacks.cs]


text:
Imports System.IO
Imports Aspose.Email.Mail
Imports Aspose.Email.Outlook
Imports Aspose.Email.Pop3
Imports Aspose.Email
Imports Aspose.Email.Mime
Imports Aspose.Email.Imap
Imports System.Configuration
Imports System.Data
Imports Aspose.Email.Mail.Bounce
Imports Aspose.Email.Exchange
Imports Aspose.Email.Outlook.Pst

Namespace Aspose.Email.Examples.VisualBasic.Email.SMTP

    Public Class LoadSmtpConfigFile
        Public Shared Sub Run()
            ' The path to the documents directory.
            Dim dataDir As String = RunExamples.GetDataDir_SMTP()
            Dim dstEmail As String = dataDir & Convert.ToString("EmbeddedImage.msg")

            'Declare msg as MailMessage instance
            Dim msg As New MailMessage()

            'use MailMessage properties like specify sender, recipient and message
            msg.[To] = "asposetest123@gmail.com"
            msg.From = "aspose2@gmail.com"
            msg.Subject = "Test Email"
            msg.Body = "Hello World!"

            'Create an instance of SmtpClient class and load SMTP Authentication settings from Config file
            Dim client As New SmtpClient(ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None))
            client.SecurityOptions = SecurityOptions.Auto

            Try
                'Client.Send will send this message
                client.Send(msg)
                'Message sent successfully
                System.Console.WriteLine("Message sent")

            Catch ex As System.Exception
                System.Diagnostics.Trace.WriteLine(ex.ToString())
            End Try

            Console.WriteLine(Environment.NewLine + "Message sent after loading configuration from config file.")
        End Sub
    End Class
End Namespace


text:
from django.conf.urls import url

from openstack_dashboard.dashboards.project.stacks.resource_types import views

urlpatterns = [
    url(r'^$', views.ResourceTypesView.as_view(), name='index'),
    url(r'^(?P<resource_type>[^/]+)/$',
        views.DetailView.as_view(), name='details'),
]


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../../">
  <title data-ice="title">src/index.js | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

  Home

  Reference
  Source

  Repository

    <input class="search-input">

components
CEndpoint

CRestTestServer

models
CEndpointConfig

CServerConfig

utils
FisFunction

FisPlainObject

FisString

VfindBy

VgetBy

VgetId

src/index.js

module.exports = require('./components/server').TestRestServer;

  Generated by ESDoc(0.4.3)


text:
namespace blink {

class FontLoader;

class RemoteFontFaceSource final : public CSSFontFaceSource, public FontResourceClient {
public:
    explicit RemoteFontFaceSource(FontResource*, PassRefPtrWillBeRawPtr<FontLoader>);
    virtual ~RemoteFontFaceSource();

    virtual FontResource* resource() override { return m_font.get(); }
    virtual bool isLoading() const override;
    virtual bool isLoaded() const override;
    virtual bool isValid() const override;

    void beginLoadIfNeeded() override;
    virtual bool ensureFontData();

    virtual void didStartFontLoad(FontResource*) override;
    virtual void fontLoaded(FontResource*) override;
    virtual void fontLoadWaitLimitExceeded(FontResource*) override;

    // For UMA reporting
    virtual bool hadBlankText() override { return m_histograms.hadBlankText(); }
    void paintRequested() { m_histograms.fallbackFontPainted(); }

    virtual void trace(Visitor*) override;

protected:
    virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override;
    PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescription&);
    void pruneTable();

private:
    class FontLoadHistograms {
    public:
        FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { }
        void loadStarted();
        void fallbackFontPainted();
        void recordRemoteFont(const FontResource*);
        void recordFallbackTime(const FontResource*);
        bool hadBlankText() { return m_fallbackPaintTime; }
    private:
        const char* histogramName(const FontResource*);
        double m_loadStartTime;
        double m_fallbackPaintTime;
    };

    ResourcePtr<FontResource> m_font;
    RefPtrWillBeMember<FontLoader> m_fontLoader;
    FontLoadHistograms m_histograms;
};

} // namespace blink

#endif


text:
/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/

(function($) {

    module("String functions");

	test("equals ignore case", function() {
		equal(true, "String".equalsIgnoreCase("string"), "strings equalsregardless of case");
        equal(false, "String".equalsIgnoreCase("not string"), "different character strings are not equal");
		equal(false, "String".equalsIgnoreCase(null), "strings are not equal to null");
	});

} (jQuery));


text:
class Wine < ApplicationRecord
  has_many :glasses
  belongs_to :winemaker

end


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

 $(document).ready(function() {

      $.noConflict();

      //Calendario que toma la fecha de hoy
      $.datepicker.setDefaults($.datepicker.regional["es"]);
   $('input[id$="_fechaPublicacion"]').datepicker({ dateFormat: 'yy-mm-dd',
                           changeMonth: true,
                           changeYear: true,
                           minDate:'todate',
                           maxDate: 'todate',
                           clearStatus: 'Borra fecha actual',
                           //defaultDate: '01-01-2012',
                           yearRange: '2013:y',
                           dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
                           monthNamesShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun",
                                             "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"]
                          });

    $('#boton').button();
    $('#boton1').button();
    $('#boton2').button();
    //Opciones del validador
    var optionsRed = {
        classNamePrefix: 'bvalidator_red_',
        lang: 'es'
    };

    //Validar el formulario

    $('form').bValidator(optionsRed);

     $(function() {
    $( document ).tooltip({
      position: {
        my: "center bottom-20",
        at: "center top",
        using: function( position, feedback ) {
          $( this ).css( position );
          $( "<div>" )
            .addClass( "arrow" )
            .addClass( feedback.vertical )
            .addClass( feedback.horizontal )
            .appendTo( this );
        }
      }
    });

           });

       $('#boton').on ('click', function() {

       $file=$('#siblh_mantenimientobundle_blhinformacionpublica_file').val();
       $fechaPublicacion=$('#siblh_mantenimientobundle_blhinformacionpublica_fechaPublicacion').val();
       $nombreDocumento=$('#siblh_mantenimientobundle_blhinformacionpublica_nombreDocumento').val();

        if($nombreDocumento == "" ) {
            alert("Pendiente titulo del documento !");
            return false;}
        else{
             if($fechaPublicacion == "" ) {
            alert("Ingrese una fecha valida !");
            return false;}
        else{
             if($file == "" ) {
            alert("Debe adjuntar un archivo !");
            return false;}

            }}
       });
 });


text:
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  font-weight: inherit;
  font-style: inherit;
  font-family: inherit;
  font-size: 100%;
  vertical-align: baseline;
}
body {
  line-height: 1;
  color: #000;
  background: #fff;
}
ol,
ul {
  list-style: none;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  vertical-align: middle;
}
caption,
th,
td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}
a img {
  border: none;
}
tr.readonly {
  background-color: #11b3f3;
}
.timetable {
  border: 1px solid #f00;
}
.sheet {
  overflow: hidden;
  margin-bottom: 2em;
}
.sheet-data-table,
.sheet-overview {
  float: left;
  border: 1px solid #d5cbc1;
}
.sheet-data-table tr.weekend,
.sheet-overview tr.weekend {
  background-color: #1ca8d2;
}
.sheet-data-table tr.vacation,
.sheet-overview tr.vacation {
  background-color: #fdeaa7;
}
.sheet-data-table th,
.sheet-overview th {
  background-color: #898984;
  color: #fff;
}
.sheet-data-table td,
.sheet-overview td,
.sheet-data-table th,
.sheet-overview th {
  padding-left: 1em;
  padding-right: 1em;
  border-bottom: 1px solid #d5cbc1;
  border-right: 1px solid #d5cbc1;
}
.sheet-data-table td:last-of-type,
.sheet-overview td:last-of-type,
.sheet-data-table th:last-of-type,
.sheet-overview th:last-of-type {
  border-right: none;
}
.sheet-data-table .sheet-data-table-row:last-of-type td,
.sheet-overview .sheet-data-table-row:last-of-type td,
.sheet-data-table .sheet-data-table-row:last-of-type th,
.sheet-overview .sheet-data-table-row:last-of-type th {
  border-bottom: none;
}


text:
<?php

namespace Weixin\Biz;

use Weixin\Biz\Encrypt\Prp;
use Weixin\Biz\Hash\Hash;
use Weixin\Biz\Message\Message;
use Weixin\Biz\Exception\IllegalAesKeyException;
use Weixin\Biz\Exception\SignatureValidateErrorException;

class Biz
{

    protected $token;

    protected $aesKey;

    protected $corpId;

    protected $prp;

    public function __construct($token, $aesKey, $corpId)
    {
        $this->token = $token;
        $this->aesKey = $aesKey;
        $this->corpId = $corpId;

        if (strlen($this->aesKey) != 43) {
            throw new IllegalAesKeyException();
        }

        $this->prp = new Prp($this->aesKey);
    }

    public function verifyUrl($signature, $timestamp, $nonce, $echoStr)
    {

        $shaSignature = Hash::sha1($this->token, $timestamp, $nonce, $echoStr);

        if ($signature !== $shaSignature) {
            throw new SignatureValidateErrorException();
        }

        return $this->prp->decode($echoStr, $this->corpId);
    }

    public function packMessage($replyMessage, $timestamp, $nonce)
    {
        $encrypt = $this->prp->encode($replyMessage, $this->corpId);
        if (is_null($timestamp)) {
            $timestamp = time();
        }
        $shaSignature = Hash::sha1($this->token, $timestamp, $nonce, $encrypt);
        return Message::encode($encrypt, $shaSignature, $timestamp, $nonce);
    }

    public function unpackMessage($signature, $timestamp, $nonce, $postData)
    {
        list($encrypt, $toUsername) = Message::decode($postData);

        if (is_null($timestamp)) {
            $timestamp = time();
        }

        $shaSignature = Hash::sha1($this->token, $timestamp, $nonce, $encrypt);

        if ($shaSignature != $signature) {
            throw new SignatureValidateErrorException();
        }

        return $this->prp->decode($encrypt, $this->corpId);

    }

}


text:
class CTerrainPanel;
class CTilePanel;
class CMainPanel : public CDialogEx
{
public:
	CMainPanel(CWnd* pParent = NULL);   // Ç¥ÁØ »ý¼ºÀÚÀÔ´Ï´Ù.
	virtual ~CMainPanel();

// ´ëÈ »óÀÚ µ¥ÀÌÅÍÀÔ´Ï´Ù.
	enum { IDD = IDD_DIALOG_MAINPANEL };

	CTerrainPanel *m_pTerrainPanel;
	CTilePanel *m_pTilePanel;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV Áö¿øÀÔ´Ï´Ù.

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedCancel();
	CTabCtrl m_Tab;
	virtual BOOL OnInitDialog();
	afx_msg void OnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult);
};


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

    <parent>
        <groupId>it.redhat.demo</groupId>
        <artifactId>eap6-play</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <artifactId>eap6-ldap</artifactId>
    <packaging>war</packaging>

    <dependencies>
        <!-- core -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- JEE -->
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- for custom valve -->
        <dependency>
            <groupId>org.jboss.web</groupId>
            <artifactId>jbossweb</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>


text:
package aerostore

import (
	"bytes"
	"encoding/base32"
	"encoding/gob"
	"errors"
	"net/http"
	"strings"

	as "github.com/aerospike/aerospike-client-go"
	"github.com/gorilla/securecookie"
	"github.com/gorilla/sessions"
)

var notConnError = errors.New("SessionStore: Aerospike client isn't connected to the cluster")

// AeroStore stores sessions in a Aerospike backend.
type AeroStore struct {
	Codecs  []securecookie.Codec
	Options *sessions.Options // default configuration
	client  *as.Client
	ns, set string
}

// NewAeroStore returns a new AeroStore.
// ns: Aerospike namespace (similar to database)
// set: Aerospike set (similar to table)
func NewAeroStore(ns, set string, host string, port int, keyPairs ...[]byte) (*AeroStore, error) {
	client, err := as.NewClient(host, port)
	if err != nil {
		return nil, err
	}
	return NewAeroStoreWithClient(ns, set, client, keyPairs...)
}

// NewAeroStoreWithClient instantiates a AeroStore with a *as.Client passed in.
func NewAeroStoreWithClient(ns, set string, client *as.Client, keyPairs ...[]byte) (*AeroStore, error) {
	var err error
	if !client.IsConnected() {
		err = notConnError
	}
	return &AeroStore{
		Codecs: securecookie.CodecsFromPairs(keyPairs...),
		Options: &sessions.Options{
			Path:   "/",
			MaxAge: 86400 * 30,
		},
		client: client,
		ns:     ns,
		set:    set,
	}, err
}

// Close closes the underlying the Aerospike client
func (s *AeroStore) Close() {
	s.client.Close()
}

// Get returns a session for the given name after adding it to the registry.
//
// See CookieStore.Get().
func (s *AeroStore) Get(r *http.Request, name string) (*sessions.Session, error) {
	return sessions.GetRegistry(r).Get(s, name)
}

// New returns a session for the given name without adding it to the registry.
//
// See CookieStore.New().
func (s *AeroStore) New(r *http.Request, name string) (*sessions.Session, error) {
	var err error
	session := sessions.NewSession(s, name)
	options := *s.Options
	session.Options = &options
	session.IsNew = true
	if c, errCookie := r.Cookie(name); errCookie == nil {
		err = securecookie.DecodeMulti(name, c.Value, &session.ID, s.Codecs...)
		if err == nil {
			ok, err := s.load(session)
			session.IsNew = !(err == nil && ok) // not new if no error and data available
		}
	}
	return session, err
}

// Save adds a single session to the response.
func (s *AeroStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error {
	var err error
	// Build an alphanumeric key for the Aerospike store.
	if session.ID == "" {
		session.ID = strings.TrimRight(base32.StdEncoding.EncodeToString(securecookie.GenerateRandomKey(32)), "=")
	}
	if err = s.save(session); err != nil {
		return err
	}
	encoded, err := securecookie.EncodeMulti(session.Name(), session.ID, s.Codecs...)
	if err != nil {
		return err
	}
	http.SetCookie(w, sessions.NewCookie(session.Name(), encoded, session.Options))

	return nil
}

// save stores the session in Aerospike.
func (s *AeroStore) save(session *sessions.Session) error {
	if !s.client.IsConnected() {
		return notConnError
	}

	buf := new(bytes.Buffer)
	enc := gob.NewEncoder(buf)
	err := enc.Encode(session.Values)
	if err != nil {
		return err
	}
	b := buf.Bytes()

	key, err := as.NewKey(s.ns, s.set, "session_"+session.ID)
	if err != nil {
		return err
	}

	bin := as.NewBin("data", b)
	err = s.client.PutBins(nil, key, bin)
	if err != nil {
		return err
	}
	return nil
}

// load stores the session in Aerospike.
func (s *AeroStore) load(session *sessions.Session) (bool, error) {
	if !s.client.IsConnected() {
		return false, notConnError
	}

	key, err := as.NewKey(s.ns, s.set, "session_"+session.ID)
	if err != nil {
		return false, err
	}

	rec, err := s.client.Get(nil, key)
	if err != nil {
		return false, err
	}

	if rec != nil {
		dec := gob.NewDecoder(bytes.NewBuffer(rec.Bins["data"].([]byte)))
		return true, dec.Decode(&session.Values)
	}
	return false, nil
}


text:
'''
Contains informations necessaries to build, release and install a distribution.

For more information:
    https://pythonhosted.org/setuptools/setuptools.html
    https://packaging.python.org/en/latest/distributing.html
    http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#packaging-your-project
    http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#uploading-your-project-to-pypi
'''
from setuptools import setup
from pip.req import parse_requirements as parse

# Parse a requirements file to string list
requirements = lambda f: [str(i.req) for i in parse(f, session=False)]

setup(
    name='project_name',
    version='0.0.1',
    author='author_name',
    url='https://github.com/github_username/project_name',
    license='MIT License',
    description='The awesome project_name project.',
    platforms='any',
    py_modules=['module_name'],
    install_requires=requirements('requirements.txt'),
    classifiers=[
        'Development Status :: 1 - Planning',
        'Operating System :: OS Independent',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 3',
    ],  # see more at https://pypi.python.org/pypi?%3Aaction=list_classifiers
    zip_safe=False
)


text:
<!DOCTYPE html><html><head><meta charset="utf-8" />
<meta http-equiv="refresh" content="0;url=/place/antigua-and-barbuda/weather/" />
</head></html>


text:
package test.user;

/**
 * @md.hide
 */
public interface UserProfileService {
    User getUser();
}


text:
module Aleph

  # -- CONFIGURATION VALUES --

  # Class which hold an Aleph borrower
  mattr_accessor :aleph_bor_class
  @@aleph_bor_class  = "Aleph::Borrower"

  # Class which hold an Aleph Bibliographic record
  mattr_accessor :aleph_bib_class
  @@aleph_bib_class  = "Aleph::Bibliographic"

  # Class which hold an Aleph Item
  mattr_accessor :aleph_item_class
  @@aleph_item_class = "Aleph::Item"

  # Class which hold an Aleph Hold Request
  mattr_accessor :aleph_hold_class
  @@aleph_hold_class = "Aleph::Hold"

  # Class which hold an Aleph Cash Transaction
  mattr_accessor :aleph_cash_class
  @@aleph_cash_class = "Aleph::Cash"

  # Class which hold an Aleph Loan Transaction
  mattr_accessor :aleph_loan_class
  @@aleph_loan_class = "Aleph::Loan"

  # Class which hold an Aleph Photocopy Transaction
  mattr_accessor :aleph_photo_class
  @@aleph_photo_class = "Aleph::Photocopy"

  # Class which hold an Aleph Short Doc
  mattr_accessor :aleph_short_doc_class
  @@aleph_short_doc_class = "Aleph::Shortdoc"

  # Url for Aleph X server
  mattr_accessor :aleph_x_url
  @@aleph_x_url = nil

  # Url for Aleph restful server
  mattr_accessor :aleph_rest_url
  @@aleph_rest_url = nil

  # Default bibliographic library
  mattr_accessor :bib_library
  @@bib_library = "DTV01"

  # Default administrative library
  mattr_accessor :adm_library
  @@adm_library = "DTV50"

  # Borrower prefix used to create unique identifiers.
  mattr_accessor :bor_prefix
  @@bor_prefix = "RUBY"

  # Borrower type id create (Z308-TYPE-ID)
  mattr_accessor :bor_type_id
  @@bor_type_id = "02"

  mattr_accessor :z303_defaults
  @@z303_defaults = {
    'z303-alpha' => 'L',
    'z303-con-lng' => 'ENG',
    'z303-ill-library' => '820060',
    'z303-ill-total-limit' => '9999',
    'z303-ill-active-limit' => '9999',
    'z303-proxy-id-type' => '00',
    'z303-send-all-letters' => 'Y',
    'z303-title-req-limit' => '0000',
    'z303-profile-id' => 'DTV_ENG',
    'z303-plain-html' => 'P',
    'z303-home-library' => 'DTV',
    'z303-plif-modification' => '',
    'z303-want-sms' => 'N',
  }

  mattr_accessor :z304_defaults
  @@z304_defaults = {
    'z304-date-to' => '20991231',
  }

  mattr_accessor :z305_defaults
  @@z305_defaults = {}

  mattr_accessor :z308_defaults
  @@z308_defaults = {
    'z308-status' => 'AC',
    'z308-encryption' => 'N',
    'z308-verification-type' => '00',
  }

  # Default will be unavailable if no mapping present.
  mattr_accessor :item_mapping
  @@item_mapping = {
    '01' => 'available',
    '02' => 'available',
    '03' => 'available',
    '04' => 'restricted',
    '05' => 'restricted',
    '08' => 'restricted',
    '09' => 'restricted',
    '20' => 'available',
    '61' => 'limited',
    '62' => 'limited',
    '63' => 'limited',
    '64' => 'limited',
    '65' => 'request',
    '66' => 'request',
  }

  mattr_accessor :availability_sub_libraries
  @@availability_sub_libraries = [ 'DTV', 'BAL' ]

  mattr_accessor :textbook_collections
  @@textbook_collections = [ 'LB' ]

  mattr_accessor :priorities
  @@priorities = {
    'available' => 10,
    'request' => 20,
    'on-loan' => 30,
    'restricted' => 40,
    'limited' => 50,
    'unavailable' => 60,
    'unknown' => 100,
  }

  # Should we create users that doesn't exists.
  mattr_accessor :create_aleph_borrowers
  @@create_aleph_borrowers = false

  def self.setup
    yield self
  end

  def self.config
    self
  end
end

require 'ruby_aleph_integration/aleph'

# Add our translations to the list of files loaded
#config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]


text:
require 'chef/application'
require 'chef/client'
require 'chef/config'
require 'chef/daemon'
require 'chef/log'
require 'chef/rest'
require 'chef/handler/error_report'

class Chef::Application::Client < Chef::Application

  # Mimic self_pipe sleep from Unicorn to capture signals safely
  SELF_PIPE = []

  option :config_file,
    :short => "-c CONFIG",
    :long  => "--config CONFIG",
    :default => Chef::Config.platform_specific_path("/etc/chef/client.rb"),
    :description => "The configuration file to use"

  option :formatter,
    :short        => "-F FORMATTER",
    :long         => "--format FORMATTER",
    :description  => "output format to use"

  option :color,
    :long         => '--[no-]color',
    :boolean      => true,
    :default      => false,
    :description  => "Use colored output, defaults to enabled"

  option :log_level,
    :short        => "-l LEVEL",
    :long         => "--log_level LEVEL",
    :description  => "Set the log level (debug, info, warn, error, fatal)",
    :proc         => lambda { |l| l.to_sym }

  option :log_location,
    :short        => "-L LOGLOCATION",
    :long         => "--logfile LOGLOCATION",
    :description  => "Set the log file location, defaults to STDOUT - recommended for daemonizing",
    :proc         => nil

  option :help,
    :short        => "-h",
    :long         => "--help",
    :description  => "Show this message",
    :on           => :tail,
    :boolean      => true,
    :show_options => true,
    :exit         => 0

  option :user,
    :short => "-u USER",
    :long => "--user USER",
    :description => "User to set privilege to",
    :proc => nil

  option :group,
    :short => "-g GROUP",
    :long => "--group GROUP",
    :description => "Group to set privilege to",
    :proc => nil

  option :daemonize,
    :short => "-d",
    :long => "--daemonize",
    :description => "Daemonize the process",
    :proc => lambda { |p| true }

  option :pid_file,
    :short        => "-P PID_FILE",
    :long         => "--pid PIDFILE",
    :description  => "Set the PID file location, defaults to /tmp/chef-client.pid",
    :proc         => nil

  option :interval,
    :short => "-i SECONDS",
    :long => "--interval SECONDS",
    :description => "Run chef-client periodically, in seconds",
    :proc => lambda { |s| s.to_i }

  option :once,
    :long => "--once",
    :description => "Cancel any interval or splay options, run chef once and exit",
    :boolean => true

  option :json_attribs,
    :short => "-j JSON_ATTRIBS",
    :long => "--json-attributes JSON_ATTRIBS",
    :description => "Load attributes from a JSON file or URL",
    :proc => nil

  option :node_name,
    :short => "-N NODE_NAME",
    :long => "--node-name NODE_NAME",
    :description => "The node name for this client",
    :proc => nil

  option :splay,
    :short => "-s SECONDS",
    :long => "--splay SECONDS",
    :description => "The splay time for running at intervals, in seconds",
    :proc => lambda { |s| s.to_i }

  option :chef_server_url,
    :short => "-S CHEFSERVERURL",
    :long => "--server CHEFSERVERURL",
    :description => "The chef server URL",
    :proc => nil

  option :validation_key,
    :short        => "-K KEY_FILE",
    :long         => "--validation_key KEY_FILE",
    :description  => "Set the validation key file location, used for registering new clients",
    :proc         => nil

  option :client_key,
    :short        => "-k KEY_FILE",
    :long         => "--client_key KEY_FILE",
    :description  => "Set the client key file location",
    :proc         => nil

  option :environment,
    :short        => '-E ENVIRONMENT',
    :long         => '--environment ENVIRONMENT',
    :description  => 'Set the Chef Environment on the node'

  option :version,
    :short        => "-v",
    :long         => "--version",
    :description  => "Show chef version",
    :boolean      => true,
    :proc         => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
    :exit         => 0

  option :override_runlist,
    :short        => "-o RunlistItem,RunlistItem...",
    :long         => "--override-runlist RunlistItem,RunlistItem...",
    :description  => "Replace current run list with specified items",
    :proc         => lambda{|items|
      items = items.split(',')
      items.compact.map{|item|
        Chef::RunList::RunListItem.new(item)
      }
    }

  option :why_run,
    :short        => '-W',
    :long         => '--why-run',
    :description  => 'Enable whyrun mode',
    :boolean      => true

  option :client_fork,
    :short        => "-f",
    :long         => "--fork",
    :description  => "Fork client",
    :boolean      => true

  option :enable_reporting,
    :short        => "-R",
    :long         => "--enable-reporting",
    :description  => "Enable reporting data collection for chef runs",
    :boolean      => true

  attr_reader :chef_client_json

  def initialize
    super
  end

  # Reconfigure the chef client
  # Re-open the JSON attributes and load them into the node
  def reconfigure
    super

    Chef::Config[:chef_server_url] = config[:chef_server_url] if config.has_key? :chef_server_url
    unless Chef::Config[:exception_handlers].any? {|h| Chef::Handler::ErrorReport === h}
      Chef::Config[:exception_handlers] << Chef::Handler::ErrorReport.new
    end

    if Chef::Config[:daemonize]
      Chef::Config[:interval] ||= 1800
    end

    if Chef::Config[:once]
      Chef::Config[:interval] = nil
      Chef::Config[:splay] = nil
    end

    if Chef::Config[:json_attribs]
      begin
        json_io = case Chef::Config[:json_attribs]
                  when /^(http|https):\/\//
                    @rest = Chef::REST.new(Chef::Config[:json_attribs], nil, nil)
                    @rest.get_rest(Chef::Config[:json_attribs], true).open
                  else
                    open(Chef::Config[:json_attribs])
                  end
      rescue SocketError => error
        Chef::Application.fatal!("I cannot connect to #{Chef::Config[:json_attribs]}", 2)
      rescue Errno::ENOENT => error
        Chef::Application.fatal!("I cannot find #{Chef::Config[:json_attribs]}", 2)
      rescue Errno::EACCES => error
        Chef::Application.fatal!("Permissions are incorrect on #{Chef::Config[:json_attribs]}. Please chmod a+r #{Chef::Config[:json_attribs]}", 2)
      rescue Exception => error
        Chef::Application.fatal!("Got an unexpected error reading #{Chef::Config[:json_attribs]}: #{error.message}", 2)
      end

      begin
        @chef_client_json = Chef::JSONCompat.from_json(json_io.read)
        json_io.close unless json_io.closed?
      rescue JSON::ParserError => error
        Chef::Application.fatal!("Could not parse the provided JSON file (#{Chef::Config[:json_attribs]})!: " + error.message, 2)
      end
    end
  end

  def configure_logging
    super
    Mixlib::Authentication::Log.use_log_devices( Chef::Log )
    Ohai::Log.use_log_devices( Chef::Log )
  end

  def setup_application
    Chef::Daemon.change_privilege
  end

  # Run the chef client, optionally daemonizing or looping at intervals.
  def run_application
    unless Chef::Platform.windows?
      SELF_PIPE.replace IO.pipe

      trap("USR1") do
        Chef::Log.info("SIGUSR1 received, waking up")
        SELF_PIPE[1].putc('.') # wakeup master process from select
      end
    end

    if Chef::Config[:version]
      puts "Chef version: #{::Chef::VERSION}"
    end

    if Chef::Config[:daemonize]
      Chef::Daemon.daemonize("chef-client")
    end

    loop do
      begin
        if Chef::Config[:splay]
          splay = rand Chef::Config[:splay]
          Chef::Log.debug("Splay sleep #{splay} seconds")
          sleep splay
        end
        run_chef_client
        if Chef::Config[:interval]
          Chef::Log.debug("Sleeping for #{Chef::Config[:interval]} seconds")
          unless SELF_PIPE.empty?
            client_sleep Chef::Config[:interval]
          else
            # Windows
            sleep Chef::Config[:interval]
          end
        else
          Chef::Application.exit! "Exiting", 0
        end
      rescue Chef::Application::Wakeup => e
        Chef::Log.debug("Received Wakeup signal.  Starting run.")
        next
      rescue SystemExit => e
        raise
      rescue Exception => e
        if Chef::Config[:interval]
          Chef::Log.error("#{e.class}: #{e}")
          Chef::Application.debug_stacktrace(e)
          Chef::Log.error("Sleeping for #{Chef::Config[:interval]} seconds before trying again")
          unless SELF_PIPE.empty?
            client_sleep Chef::Config[:interval]
          else
            # Windows
            sleep Chef::Config[:interval]
          end
          retry
        else
          Chef::Application.debug_stacktrace(e)
          Chef::Application.fatal!("#{e.class}: #{e.message}", 1)
        end
      end
    end
  end

  private

  def client_sleep(sec)
    IO.select([ SELF_PIPE[0] ], nil, nil, sec) or return
    SELF_PIPE[0].getc
  end
end


text:
package httprequest

import (
	"log"
	"net/http"
)

// BodyCloseWithErrorLog ...
func BodyCloseWithErrorLog(r *http.Request) {
	err := r.Body.Close()
	if err != nil {
		log.Printf(" [!] Exception: request.BodyCloseWithErrorLog: %+v", err)
	}
}


text:
//
// This file is auto-generated. Please don't modify it!
//
package sdk.java.src.org.opencv.ml;

// C++: class CvGBTreesParams

/**
 *
GBT training parameters.

 *

 *
The structure contains parameters for each single decision tree in the
 * ensemble, as well as the whole model characteristics. The structure is
 * derived from "CvDTreeParams" but not all of the decision tree parameters are
 * supported: cross-validation, pruning, and class priorities are not used.

 *
 * @see org.opencv.ml.CvGBTreesParams : public CvDTreeParams
 */
public class CvGBTreesParams extends CvDTreeParams {

    protected CvGBTreesParams(long addr) {
        super(addr);
    }

    //
    // C++:   CvGBTreesParams::CvGBTreesParams()
    //

    /**
     *
By default the following constructor is used: CvGBTreesParams(CvGBTrees.SQUARED_LOSS,
     * 200, 0.8f, 0.01f, 3, false)

     *

     *
// C++ code:

     *

     *
: CvDTreeParams(3, 10, 0, false, 10, 0, false, false, 0)

     *
     * @see org.opencv.ml.CvGBTreesParams.CvGBTreesParams
     */
    public CvGBTreesParams() {

        super(CvGBTreesParams_0());

        return;
    }

    //
    // C++: int CvGBTreesParams::weak_count
    //

    public int get_weak_count() {

        int retVal = get_weak_count_0(nativeObj);

        return retVal;
    }

    //
    // C++: void CvGBTreesParams::weak_count
    //

    public void set_weak_count(int weak_count) {

        set_weak_count_0(nativeObj, weak_count);

        return;
    }

    //
    // C++: int CvGBTreesParams::loss_function_type
    //

    public int get_loss_function_type() {

        int retVal = get_loss_function_type_0(nativeObj);

        return retVal;
    }

    //
    // C++: void CvGBTreesParams::loss_function_type
    //

    public void set_loss_function_type(int loss_function_type) {

        set_loss_function_type_0(nativeObj, loss_function_type);

        return;
    }

    //
    // C++: float CvGBTreesParams::subsample_portion
    //

    public float get_subsample_portion() {

        float retVal = get_subsample_portion_0(nativeObj);

        return retVal;
    }

    //
    // C++: void CvGBTreesParams::subsample_portion
    //

    public void set_subsample_portion(float subsample_portion) {

        set_subsample_portion_0(nativeObj, subsample_portion);

        return;
    }

    //
    // C++: float CvGBTreesParams::shrinkage
    //

    public float get_shrinkage() {

        float retVal = get_shrinkage_0(nativeObj);

        return retVal;
    }

    //
    // C++: void CvGBTreesParams::shrinkage
    //

    public void set_shrinkage(float shrinkage) {

        set_shrinkage_0(nativeObj, shrinkage);

        return;
    }

    @Override
    protected void finalize() throws Throwable {
        delete(nativeObj);
    }

    // C++:   CvGBTreesParams::CvGBTreesParams()
    private static native long CvGBTreesParams_0();

    // C++: int CvGBTreesParams::weak_count
    private static native int get_weak_count_0(long nativeObj);

    // C++: void CvGBTreesParams::weak_count
    private static native void set_weak_count_0(long nativeObj, int weak_count);

    // C++: int CvGBTreesParams::loss_function_type
    private static native int get_loss_function_type_0(long nativeObj);

    // C++: void CvGBTreesParams::loss_function_type
    private static native void set_loss_function_type_0(long nativeObj, int loss_function_type);

    // C++: float CvGBTreesParams::subsample_portion
    private static native float get_subsample_portion_0(long nativeObj);

    // C++: void CvGBTreesParams::subsample_portion
    private static native void set_subsample_portion_0(long nativeObj, float subsample_portion);

    // C++: float CvGBTreesParams::shrinkage
    private static native float get_shrinkage_0(long nativeObj);

    // C++: void CvGBTreesParams::shrinkage
    private static native void set_shrinkage_0(long nativeObj, float shrinkage);

    // native support for java finalize()
    private static native void delete(long nativeObj);

}


text:
using System;

namespace owncloudsharp.Types
{
    /// <summary>
    /// Provides information of a group ownCloud share.
    /// </summary>
	public class GroupShare : Share
	{
		/// <summary>
		/// Name of the user the target is being shared with
		/// </summary>
		public string SharedWith { get; set; }
	}
}


text:
#import <Foundation/Foundation.h>

@interface NSFileManager (ApplicationSupportDirectory)
- (NSString*)currentApplicationSupportDirectoryCreateIfNecessary:(BOOL)create;
@end


text:
*[PEP 3156]: Asynchronous IO. See https://www.python.org/dev/peps/pep-3156/.

*[asyncio]: Reference implementation of PEP 3156.

*[hiredis]: Python extension that wraps protocol parsing code in `hiredis`.

*[error replies]: Redis server replies that start with `-` (minus) char (`-ERR`).

*[pytest]: A mature full-featured Python testing tool. See http://pytest.org/latest/.

*[uvloop]: An ultra fast implementation of asyncio event loop on top of libuv.

*[redis-py]: The official Python interface to the Redis key-value store.

*[UNIX]: unix://var/run/redis.sock

*[TCP]: redis://redis-host-or-ip:6379/1


text:
namespace HoloToolkit.Sharing
{
    /// <summary>
    /// Allows users of the pairing API to register to receive pairing event callbacks without
    /// having their classes inherit directly from PairingListener
    /// </summary>
    public class PairingAdapter : PairingListener
    {
        public event System.Action SuccessEvent;
        public event System.Action<PairingResult> FailureEvent;

        public PairingAdapter() { }

        public override void PairingConnectionSucceeded()
        {
            if (this.SuccessEvent != null)
            {
                this.SuccessEvent();
            }
        }

        public override void PairingConnectionFailed(PairingResult result)
        {
            if (this.FailureEvent != null)
            {
                this.FailureEvent(result);
            }
        }
    }
}


text:
\hypertarget{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend}{\section{D\-M\-A\textbackslash{}Friends\textbackslash{}Components\textbackslash{}Badge\-Recommend Class Reference}
\label{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend}\index{D\-M\-A\textbackslash{}\-Friends\textbackslash{}\-Components\textbackslash{}\-Badge\-Recommend@{D\-M\-A\textbackslash{}\-Friends\textbackslash{}\-Components\textbackslash{}\-Badge\-Recommend}}
}
Inheritance diagram for D\-M\-A\textbackslash{}Friends\textbackslash{}Components\textbackslash{}Badge\-Recommend\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{d2/dbd/classDMA_1_1Friends_1_1Components_1_1BadgeRecommend}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hypertarget{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_a851a204784cf3f70c0f3471a37b88a4d}{{\bfseries component\-Details} ()}\label{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_a851a204784cf3f70c0f3471a37b88a4d}

\item
\hypertarget{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_a7678b0bc4e68fd30e61c052562d8df2f}{{\bfseries define\-Properties} ()}\label{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_a7678b0bc4e68fd30e61c052562d8df2f}

\item
\hypertarget{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_acca807fdbef2adc92f6c0a7765ce0dde}{{\bfseries on\-Run} ()}\label{classDMA_1_1Friends_1_1Components_1_1BadgeRecommend_acca807fdbef2adc92f6c0a7765ce0dde}

\end{DoxyCompactItemize}

The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item
components/Badge\-Recommend.\-php\end{DoxyCompactItemize}


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

namespace AppWeb.TelegramBotClient.Services
{
    public interface IHttpService
    {
        void GetWebApi(string apiUrl);
        void PostWebApi(object data, string apiUrl);
        T GetWebApi<T>(string apiUrl);
        T PostWebApi<T>(object data, string apiUrl);
    }
}


text:
Resumen de la factura nº<?php echo $factura->id; ?> seleccionada:

	Proveedor:
	<?php echo Model_Proveedor::find($factura->idprov)->get('nombre'); ?>

    Fecha de emisión:
    <?php echo date_conv($factura->fecha); ?>

    IVA aplicado:
    <?php echo $factura->iva; ?> %

    Retención aplicada:
    <?php echo $factura->retencion; ?> %

    Cuota interprofesional aplicada:
    <?php echo $factura->cuota; ?> €

	Importe total:
	<?php echo $factura->total; ?> €

    Comentario:
    <?php echo $factura->comentario; ?>

<?php echo Html::anchor('factura/print/'.$factura->id, 'Ver líneas',array('class'=>'btn btn-info')); ?>
<?php echo Html::anchor('factura/edit/'.$factura->id, 'Editar',array('class'=>'btn btn-success')); ?>
<?php echo Html::anchor('factura/list', 'Volver al listado',array('class'=>'btn btn-danger')); ?>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>ie.trinitynews</groupId>
	<artifactId>tncms</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>Trinity News CMS</name>
	<properties>
		<jdk.version>1.8</jdk.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<junit.version>4.12</junit.version>
		<spring.version>4.3.10.RELEASE</spring.version>
		<spring-security.version>4.2.3.RELEASE</spring-security.version>
        <hibernate.version>5.2.10.Final</hibernate.version>
		<jstl.version>1.2</jstl.version>
		<servlet-api.version>3.1.0</servlet-api.version>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
		</dependency>
		<!-- Spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
			<version>${spring-security.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
			<version>1.5.7.RELEASE</version>
		</dependency>
		<!-- Hibernate -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>${jstl.version}</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>${servlet-api.version}</version>
		</dependency>
		<!-- MySQL -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>6.0.6</version>
		</dependency>
		<!-- ini4j -->
		<dependency>
			<groupId>org.ini4j</groupId>
			<artifactId>ini4j</artifactId>
			<version>0.5.4</version>
		</dependency>
		<!-- jsoup -->
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
			<version>1.7.2</version>
		</dependency>
		<!-- File Upload -->
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.3</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.bsc.maven</groupId>
				<artifactId>maven-processor-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>process</id>
						<goals>
							<goal>process</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<processors>
								<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
							</processors>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.hibernate</groupId>
						<artifactId>hibernate-jpamodelgen</artifactId>
						<version>${hibernate.version}</version>
					</dependency>
				</dependencies>
			</plugin>
			<!--plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.6.2</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<compilerArgument>-proc:none</compilerArgument>
				</configuration>
			</plugin-->
		</plugins>
	</build>
</project>


text:
<?php

namespace Dotdigitalgroup\Email\Controller\Adminhtml;

class Contact extends \Magento\Backend\App\Action
{
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    private $resultPageFactory;

    /**
     * Contact constructor.
     *
     * @param \Magento\Backend\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
    }

    /**
     * Index action.
     *
     * @return \Magento\Backend\Model\View\Result\Page
     */
    public function execute()
    {
        /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
        $resultPage = $this->resultPageFactory->create();
        $resultPage->setActiveMenu('Dotdigitalgroup_Email::contact');
        $resultPage->addBreadcrumb(__('Contacts'), __('Contacts'));
        $resultPage->addBreadcrumb(__('Reports'), __('Reports'));
        $resultPage->getConfig()->getTitle()->prepend(__('Contacts'));

        return $resultPage;
    }

    /**
     * @return bool
     */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Dotdigitalgroup_Email::contact');
    }
}


text:
@interface JRTFormModalBaseViewController ()

@end

@implementation JRTFormModalBaseViewController

- (instancetype)init {
    self = [super init];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        [self commonInit];
    }
    return self;
}

- (void)commonInit {
    self.modalPresentationStyle = UIModalPresentationOverFullScreen;
    self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
}

- (void)show {
    UIViewController *viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
    [viewController presentViewController:self animated:YES completion:nil];
}

@end


text:
//
// (C) Jan de Vaan 2007-2011, all rights reserved. See the accompanying "License.txt" for licensed use.
//

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CharLS.Test
{
    [TestClass]
    public class JpegLSCodecTest
    {
        [TestMethod]
        public void JpegLsReadHeader()
        {
            var source = new byte[100];

            JpegLSCodec.GetPixelDataInfo(source);
        }
    }
}


text:
package org.apache.kafka.common.message;

import org.apache.kafka.common.protocol.ByteBufferAccessor;
import org.junit.jupiter.api.Test;

import java.nio.ByteBuffer;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class SimpleArraysMessageTest {
    @Test
    public void testArrayBoundsChecking() {
        // SimpleArraysMessageData takes 2 arrays
        final ByteBuffer buf = ByteBuffer.wrap(new byte[] {
            (byte) 0x7f, // Set size of first array to 126 which is larger than the size of this buffer
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
        });
        final SimpleArraysMessageData out = new SimpleArraysMessageData();
        ByteBufferAccessor accessor = new ByteBufferAccessor(buf);
        assertEquals("Tried to allocate a collection of size 126, but there are only 7 bytes remaining.",
                assertThrows(RuntimeException.class, () -> out.read(accessor, (short) 2)).getMessage());
    }

    @Test
    public void testArrayBoundsCheckingOtherArray() {
        // SimpleArraysMessageData takes 2 arrays
        final ByteBuffer buf = ByteBuffer.wrap(new byte[] {
            (byte) 0x01, // Set size of first array to 0
            (byte) 0x7e, // Set size of second array to 125 which is larger than the size of this buffer
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
        });
        final SimpleArraysMessageData out = new SimpleArraysMessageData();
        ByteBufferAccessor accessor = new ByteBufferAccessor(buf);
        assertEquals("Tried to allocate a collection of size 125, but there are only 6 bytes remaining.",
                assertThrows(RuntimeException.class, () -> out.read(accessor, (short) 2)).getMessage());
    }
}


text:
source ~/openrc

if [ ! -z "`facter | grep kvm`" ] ;then
  arch=i386
else
  arch=amd64
fi

if [ -z "`glance image-list | grep trusty`" ] ;then
	if [ ! -f ./trusty-server-cloudimg-${arch}-disk1.img ] ; then
	  wget https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-${arch}-disk1.img
    fi
glance image-create --name=trusty --disk-format=qcow2 --container-format=bare --is-public=true \
--file=./trusty-server-cloudimg-${arch}-disk1.img
fi

# Create user data if it doesn't exist
if [ ! -d ~/user.data ]; then
cat > ~/user.data <<EOF
#!/bin/bash

apt-get install vlan -y
echo 8021q >> /etc/modules
modprobe 8021q
vconfig add eth0 143
ip_host=`ip addr show eth0 | awk '/ inet / {print $2}' | cut -d/ -f1 | cut -d. -f4`
ifconfig eth0.143 	192.168.143.\$ip_host netmask 255.255.255.0 mtu 8950 up
EOF
fi

if [ -z "`nova keypair-list | grep root`" ] ;then
	ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''
	nova keypair-add --pub-key ~/.ssh/id_rsa.pub root
fi

# Create a vlan provider network against physnet1 on vlain 144
neutron net-create --tenant-id `keystone tenant-list | awk '/ openstack /  {print $2}'` \
  vlannet1 --shared --provider:network_type vlan --provider:physical_network physnet1 --provider:segmentation_id 144
neutron subnet-create --ip-version 4 --tenant-id `keystone tenant-list | awk '/ openstack / {print $2}'` \
 vlannet1 192.168.144.0/24 --allocation-pool start=192.168.144.100,end=192.168.144.200 --dns_nameservers \
 list=true 8.8.8.8

# Create a flat provider network against physnet2
neutron net-create --tenant-id `keystone tenant-list | awk '/ openstack /  {print $2}'` \
  sharednet1 --shared --provider:network_type flat --provider:physical_network physnet2
neutron subnet-create --ip-version 4 --tenant-id `keystone tenant-list | awk '/ openstack / {print $2}'` \
 sharednet1 192.168.149.0/24 --allocation-pool start=192.168.149.100,end=192.168.149.200 --dns_nameservers \
 list=true 8.8.8.8

# Create a tenant network which will default to vxlan
neutron net-create --tenant-id `keystone tenant-list | awk '/ openstack /  {print $2}'` tenantnet1
neutron subnet-create --ip-version 4 --tenant-id `keystone tenant-list | awk '/ openstack / {print $2}'` \
 tenantnet1 192.168.0.0/24 --allocation-pool start=192.168.0.100,end=192.168.0.200 --dns_nameservers \
 list=true 8.8.4.4

nova boot --flavor 2 --image trusty --nic net-id=`neutron net-list | awk '/ sharednet1 /  {print $2}'` \
  --nic net-id=`neutron net-list | awk '/ tenantnet1 / {print $2}'` --key-name root \
  --user-data ~/user.data vxa

nova boot --flavor 2 --image trusty --nic net-id=`neutron net-list | awk '/ sharednet1 / {print $2}'` \
  --nic net-id=`neutron net-list | awk '/ vlannet1 / {print $2}'` --key-name root \
  --user-data ~/user.data vxb

nova boot --flavor 2 --image trusty --nic net-id=`neutron net-list | awk '/ vlannet1 / {print $2}'` \
  --nic net-id=`neutron net-list | awk '/ tenantnet1 / {print $2}'` --key-name root \
  --user-data ~/user.data vxc


text:
var gulp = require('gulp');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var doxx = require('gulp-doxx');
var mocha = require('gulp-mocha');

gulp.task('jshint', function () {
    gulp.src('*.js')
        .pipe(jshint({
            node: true,
            devel: true,
            '-W030': true,//Expected an assignment or function call and instead saw an expression.
            '-W097': true,//Use the function form of "use strict".
            'newcap': false//Missing 'new' prefix when invoking a constructor.
        }))
        .pipe(jshint.reporter('jshint-stylish'));
});

gulp.task('docs', function () {
    gulp.src(['*.js', 'README.md'])
        .pipe(doxx({
            title: 'node-toybox',
            ignore: ['node_modules', 'build']
        }))
        .pipe(gulp.dest('build/doxx'));
});

gulp.task('test', function () {
    gulp.src('tests/**/*_test.js', {read: false})
        .pipe(mocha({reporter: 'nyan'}));
});

gulp.task('default', ['jshint']);


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZETEST_MATHTEST_CREATOR_DYNAMICLOWER_H_
#define _BLAZETEST_MATHTEST_CREATOR_DYNAMICLOWER_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <blaze/math/DynamicMatrix.h>
#include <blaze/math/LowerMatrix.h>
#include <blazetest/mathtest/creator/Default.h>
#include <blazetest/system/Types.h>

namespace blazetest {

//=================================================================================================
//
//  CLASS DEFINITION
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Specialization of the Creator class template for lower dynamic matrices.
//
// This specialization of the Creator class template is able to create random lower dynamic
// matrices.
*/
template< typename T  // Element type of the dynamic matrix
        , bool SO >   // Storage order of the dynamic matrix
class Creator< blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > >
{
 public:
   //**Type definitions****************************************************************************
   //! Type to be created by the Creator.
   typedef blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> >  Type;
   //**********************************************************************************************

   //**Constructors********************************************************************************
   /*!\name Constructors */
   //@{
   explicit inline Creator( const Creator<T>& elementCreator = Creator<T>() );
   explicit inline Creator( size_t n, const Creator<T>& elementCreator = Creator<T>() );
   // No explicitly declared copy constructor.
   //@}
   //**********************************************************************************************

   //**Destructor**********************************************************************************
   // No explicitly declared destructor.
   //**********************************************************************************************

   //**Operators***********************************************************************************
   /*!\name Operators */
   //@{
   // No explicitly declared copy assignment operator.
   const blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > operator()() const;
   //@}
   //**********************************************************************************************

 private:
   //**Member variables****************************************************************************
   /*!\name Member variables */
   //@{
   size_t n_;       //!< The number of rows and columns of the lower dynamic matrix.
   Creator<T> ec_;  //!< Creator for the elements of the lower dynamic matrix.
   //@}
   //**********************************************************************************************
};
//*************************************************************************************************

//=================================================================================================
//
//  CONSTRUCTORS
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Constructor for the creator specialization for LowerMatrix<DynamicMatrix>.
//
// \param elementCreator The creator for the elements of the lower dynamic matrix.
*/
template< typename T  // Element type of the dynamic matrix
        , bool SO >   // Storage order of the dynamic matrix
inline Creator< blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > >::Creator( const Creator<T>& elementCreator )
   : n_( 3UL )              // The number of rows and columns of the lower dynamic matrix
   , ec_( elementCreator )  // Creator for the elements of the lower dynamic matrix
{}
//*************************************************************************************************

//*************************************************************************************************
/*!\brief Constructor for the creator specialization for LowerMatrix<DynamicMatrix>.
//
// \param n The number of rows and columns of the lower dynamic matrix.
// \param elementCreator The creator for the elements of the lower dynamic matrix.
*/
template< typename T  // Element type of the dynamic matrix
        , bool SO >   // Storage order of the dynamic matrix
inline Creator< blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > >::Creator( size_t n, const Creator<T>& elementCreator )
   : n_( n )                // The number of rows and columns of the lower dynamic matrix
   , ec_( elementCreator )  // Creator for the elements of the lower dynamic matrix
{}
//*************************************************************************************************

//=================================================================================================
//
//  OPERATORS
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Returns a randomly created lower dynamic matrix.
//
// \return The randomly generated lower dynamic matrix.
*/
template< typename T  // Element type of the dynamic matrix
        , bool SO >   // Storage order of the dynamic matrix
inline const blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> >
   Creator< blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > >::operator()() const
{
   blaze::LowerMatrix< blaze::DynamicMatrix<T,SO> > matrix( n_ );

   // Initialization of a column-major matrix
   if( SO ) {
      for( size_t j=0UL; j<n_; ++j )
         for( size_t i=j; i<n_; ++i )
            matrix(i,j) = ec_();
   }

   // Initialization of a row-major matrix
   else {
      for( size_t i=0UL; i<n_; ++i )
         for( size_t j=0UL; j<=i; ++j )
            matrix(i,j) = ec_();
   }

   return matrix;
}
//*************************************************************************************************

} // namespace blazetest

#endif


text:
package docker // import "docker.io/go-docker"

import (
	"docker.io/go-docker/api/types/swarm"
	"golang.org/x/net/context"
)

// SwarmUnlock unlocks locked swarm.
func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
	serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil)
	ensureReaderClosed(serverResp)
	return err
}


text:
<!DOCTYPE HTML>

    <meta charset="utf-8">
    <title>White space processing</title>
    <meta name="flags" content="ahem">
    <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#spacing-props" title="16.4 Letter and word spacing: the 'letter-spacing' and 'word-spacing' properties">
    <link rel="author" title="Robert Hogan">

 White space between inline blocks should be affected by the word-spacing property.
     https://bugs.webkit.org/show_bug.cgi?id=69072

The following strings must be the same:

x x x

    x
    x
    x

x x x

x  x  x

x x x

    x
    x x

    x
    x
        x

The following strings must be the same:

x x x

    x
    x
    x

x x x

x x x

x x x

    x
    x x

    x
    x
        x

The following strings must be the same:

xxx

xxx

xxx


text:
using Microsoft.Xrm.Sdk;
using System;
using System.Runtime.CompilerServices;

namespace Augustus.CRM.AttributeExtensions
{
    public static class EntityReferenceAttributeExtension
    {
        public static Guid? GetAttributeEntityReference(this BaseEntity entity, [CallerMemberName] string caller = "")
        {
            string attributeLogicalName = AttributeHelper.GetLogicalName(entity, caller);

            var entRef = entity.GetAttributeValue<EntityReference>(attributeLogicalName);

            if (entRef == null)
            {
                return null;
            }
            else
            {
                return entRef.Id;
            }
        }

        public static void SetAttributeEntityReference(this BaseEntity entity, Guid? id, [CallerMemberName] string caller = "")
        {
            if (id.HasValue)
            {
                string attributeLogicalName = AttributeHelper.GetLogicalName(entity, caller);
                string entityReferenceLogicalName = AttributeHelper.GetEntityReferenceLogicalName(entity, caller);

                var newEntRef = new EntityReference(entityReferenceLogicalName, id.Value);
                var oldEntRef = entity.GetAttributeValue<EntityReference>(attributeLogicalName);

                if (oldEntRef == null || newEntRef.Id != oldEntRef.Id)
                {
                    entity.SetBaseAttributeValue(attributeLogicalName, newEntRef);
                }
            }
        }
    }
}


text:
using System;

namespace Chloe.Server.Exceptions
{
    public class AuthorNotFoundException: NotFoundException
    {
        public AuthorNotFoundException()
            :base("Author Not Found")
        {
        }

        public AuthorNotFoundException(string message)
            :base(message)
        {

        }

        public AuthorNotFoundException(string message, Exception inner)
        {

        }
    }
}


text:
package net.javacrumbs.jsonliteral.jackson2;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import net.javacrumbs.jsonliteral.core.AbstractJsonLiteralBuilder;
import net.javacrumbs.jsonliteral.core.NameTranslator;

/**
 * Builds JSON literal using Jackson 2. You can use this class for customization.
 */
public final class JsonLiteralBuilder extends AbstractJsonLiteralBuilder<ObjectNode> {
    private final ObjectMapper objectMapper;

    public JsonLiteralBuilder(NameTranslator nameTranslator, ObjectMapper objectMapper) {
        super(nameTranslator);
        this.objectMapper = objectMapper;
    }

    @Override
    protected final void put(ObjectNode node, String name, Object value) {
        node.put(name, convertValueToNode(value));
    }

    @Override
    protected final ObjectNode createNode() {
        return new ObjectNode(objectMapper.getNodeFactory());
    }

    public final ArrayNode array(Object... values) {
        return toArray(this::convertValueToNode, () -> new ArrayNode(objectMapper.getNodeFactory()), ArrayNode::add, ArrayNode::addAll, values);
    }

    private JsonNode convertValueToNode(Object value) {
        return objectMapper.convertValue(value, JsonNode.class);
    }
}


text:
<?php namespace Ngungut\Nccms\Model;

use Illuminate\Database\Eloquent\Model as Eloquent;

class Settings extends Eloquent {

	/**
	 * The database table settings by the model.
	 *
	 * @var string
	 */
	protected $table = 'bi_settings';

    /**
     * Fillable of settings data
     *
     * @var array
     */
    protected $fillable = [
        'name', 'value'
    ];

    public static function getMedia(){
        $media = static::where('name', 'LIKE', 'media%')->get();
        $return = [];
        foreach($media as $resp){
            $return[$resp['name']] = $resp['value'];
        }
        return $return;
    }

    public static function getThumbW(){
        $media = static::where('name', '=', 'mediaThumbWidth')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getThumbH(){
        $media = static::where('name', '=', 'mediaThumbHeight')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getMediumW(){
        $media = static::where('name', '=', 'mediaMediumWidth')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getMediumH(){
        $media = static::where('name', '=', 'mediaMediumHeight')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getLargeW(){
        $media = static::where('name', '=', 'mediaLargeWidth')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getLargeH(){
        $media = static::where('name', '=', 'mediaLargeHeight')->first();
        if(isset($media->id)) {
            $return = $media['value'];
        }else{
            $return = 1;
        }
        return $return;
    }

    public static function getSite(){
        $media = static::where('name', 'LIKE', 'site%')->get();
        $return = [];
        foreach($media as $resp){
            $return[$resp['name']] = $resp['value'];
        }
        return $return;
    }

    public static function getTitle(){
        $site = static::where('name', '=', 'siteTitle')->first();
        if(isset($site->id)) {
            $return = $site['value'];
        }else{
            $return = 'NRD - CMS';
        }
        return $return;
    }

    public static function getTagline(){
        $site = static::where('name', '=', 'siteTagline')->first();
        if(isset($site->id)) {
            $return = $site['value'];
        }else{
            $return = 'CMS Made By Narrada Communication';
        }
        return $return;
    }

    public static function getWebDateFormat(){
        $date = static::where('name', '=', 'siteDate')->first();
        $time = static::where('name', '=', 'siteTime')->first();
        if(isset($date->id) && isset($time->id)) {
            $return = $date . ' @ ' . $time;
        }else{
            $return = 'F j, Y @ H:i:s';
        }
        return $return;
    }

}


text:
var gTestcases = new Array();
var gTc = gTestcases.length;
function TestCase(n, d, e, a) {
  gTestcases[gTc++] = this;
}
new TestCase("SECTION", "with MyObject, eval should return square of ");
test();
function test() {
  for (gTc = 0; gTc < gTestcases.length; gTc++) {
    var MYOBJECT = (function isPrototypeOf(message) {
        delete input;
      })();
    with({}) {
      gTestcases[gTc].actual = eval("");
    }
  }
}


text:
package com.j2js.dom;

import com.j2js.visitors.AbstractVisitor;

public class ContinueStatement extends LabeledJump {

	public ContinueStatement(Block block) {
        super(block);
    }

    public void visit(AbstractVisitor visitor) {
	    visitor.visit(this);
    }

}


text:
class CreateVariants < ActiveRecord::Migration
  def self.up
    create_table :variants do |t|
      t.integer :product_id
      t.string :sku, :default => "", :null => false
      t.decimal :price, :precision => 8, :scale => 2, :null => false
    end
  end

  def self.down
    drop_table :variants
  end
end