text:
<?php
namespace Tests\Http\Controllers\Admin\User;

use Illuminate\Support\Facades\Hash;
use Tests\TestCase;
use Xetaravel\Models\User;

class UserControllerTest extends TestCase
{
    /**
     * Triggered before each test.
     *
     * @return void
     */
    public function setUp(): void
    {
        parent::setUp();

        $user = User::find(1);
        $this->be($user);
    }

    /**
     * testIndexSuccess method
     *
     * @return void
     */
    public function testIndexSuccess()
    {
        $response = $this->get('/admin/user');
        $response->assertSuccessful();
    }

    /**
     * testSearchSuccess method
     *
     * @return void
     */
    public function testSearchSuccess()
    {
        $response = $this->get('/admin/user/search?search=admin&type=username');
        $response->assertSuccessful();
        $response->assertSee('admin@xetaravel.io');

        $response = $this->get('/admin/user/search?search=admin&type=email');
        $response->assertSuccessful();
        $response->assertSee('admin@xetaravel.io');

        $response = $this->get('/admin/user/search?search=127&type=register_ip');
        $response->assertSuccessful();
        $response->assertSee('admin@xetaravel.io');

        $response = $this->get('/admin/user/search?search=127&type=last_login_ip');
        $response->assertSuccessful();
        $response->assertSee('admin@xetaravel.io');

        $response = $this->get('/admin/user/search?search=admin&type=unknown');
        $response->assertSuccessful();
        $response->assertSee('admin@xetaravel.io');
    }

    /**
     * testShowUpdateFormSuccess method
     *
     * @return void
     */
    public function testShowUpdateFormSuccess()
    {
        $response = $this->get('/admin/user/update/admin.1');
        $response->assertSuccessful();
    }

    /**
     * testUpdateSuccess method
     *
     * @return void
     */
    public function testUpdateSuccess()
    {
        $data = [
            'username' => 'Test',
            'email' => 'test@xetaravel.io',
            'account' => [
                'first_name' => 'test first',
                'last_name' => 'test last',
                'facebook' => 'TestFB',
                'twitter' => 'TestTW',
                'biography' => '
My test biography
',
                'signature' => '
My test signature
'
            ],
            'roles' => [
                1,
                2
            ]
        ];
        $response = $this->put('/admin/user/update/1', $data);
        $response->assertSessionHas('success');
        $response->assertStatus(302);

        $user = User::findOrFail(1);
        $this->assertSame($data['username'], $user->username);
        $this->assertSame('test', (string)$user->slug);
        $this->assertSame($data['email'], $user->email);
        $this->assertSame($data['account']['first_name'], $user->first_name);
        $this->assertSame($data['account']['last_name'], $user->last_name);
        $this->assertSame($data['account']['facebook'], $user->facebook);
        $this->assertSame($data['account']['twitter'], $user->twitter);
        $this->assertSame($data['account']['biography'], $user->biography);
        $this->assertSame($data['account']['signature'], $user->signature);
        $this->assertSame($data['roles'], $user->roles->pluck('id')->toArray());
    }

    /**
     * testDeleteSuccess method
     *
     * @return void
     */
    public function testDeleteSuccess()
    {
        $this->assertNotNull(User::find(2));

        $response = $this->delete('/admin/user/delete/2', ['password' => 'admin']);
        $response->assertSessionHas('success');
        $response->assertStatus(302);

        $this->assertNull(User::find(2), 'The user must be deleted');
    }

    /**
     * testDeleteWrongPasswordFailed method
     *
     * @return void
     */
    public function testDeleteWrongPasswordFailed()
    {
        $response = $this->delete('/admin/user/delete/2', ['password' => 'WRONG PASSWORD']);
        $response->assertSessionHas('danger');
        $response->assertStatus(302);
    }

    /**
     * testDeleteAvatarSuccess method
     *
     * @return void
     */
    public function testDeleteAvatarSuccess()
    {
        $old = User::find(1)->avatar_small;

        $response = $this->delete('/admin/user/deleteAvatar/1');
        $response->assertSessionHas('success');
        $response->assertStatus(302);

        $this->assertNotSame($old, User::find(1)->avatar_small, 'The path should not be the same.');
    }
}


text:
<?php

namespace Harp\Harp\Test;

use Harp\Harp\Repo\Container;
use PHPUnit_Framework_TestCase;

/**
 * @package Jam
 * @author Ivan Kerin
 */
abstract class AbstractTestCase extends PHPUnit_Framework_TestCase
{
    public function getDb()
    {
        return $this->db;
    }

    public function setUp()
    {
        $this->db = new Session();
        $this->db->setAliases([
            'Address'  => __NAMESPACE__.'\TestModel\Address',
            'BlogPost' => __NAMESPACE__.'\TestModel\BlogPost',
            'City'     => __NAMESPACE__.'\TestModel\City',
            'Country'  => __NAMESPACE__.'\TestModel\Country',
            'Post'     => __NAMESPACE__.'\TestModel\Post',
            'PostTag'  => __NAMESPACE__.'\TestModel\PostTag',
            'Profile'  => __NAMESPACE__.'\TestModel\Profile',
            'Tag'      => __NAMESPACE__.'\TestModel\Tag',
            'User'     => __NAMESPACE__.'\TestModel\User',
        ]);

        parent::setUp();

        Container::clear();
    }
}

redpajama_set_name: RedPajamaGithub


text:
require "spec_helper"

describe Mongoid::Extensions::Date do

  describe ".mongoize" do

    context "when provided a date" do

      let(:date) do
        Date.new(2010, 1, 1)
      end

      let(:mongoized) do
        Date.mongoize(date)
      end

      let(:expected) do
        Time.utc(2010, 1, 1, 0, 0, 0)
      end

      it "returns the time" do
        expect(mongoized).to eq(expected)
      end
    end

    context "when provided a string" do
      # This also configures a non-UTC time zone for AS which we want
      include_context 'using AS time zone'

      context "when the string is a valid date" do

        let(:mongoized) do
          Date.mongoize('2010-01-01')
        end

        let(:expected) do
          # Date is always serialized as UTC time with zero time component
          # on the specified date, regardless of time zone.
          # This allows the application to change its time zone and
          # retrieve the date back unchanged.
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns the beginning of date in UTC" do
          expect(mongoized).to eq(expected)
        end
      end

      context "when the string is a valid date and time" do

        let(:mongoized) do
          Date.mongoize("2010-01-01 02:00:00")
        end

        let(:expected) do
          # Time component is ignored, date is specified in UTC
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns beginning of date in UTC" do
          expect(mongoized).to eq(expected)
        end
      end

      context "when the string is a valid date and time in later time zone" do

        let(:mongoized) do
          # Tokyo is +9
          Date.mongoize("2010-01-01 00:00:00 +1000")
        end

        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns the date specified in the string without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end

      context "when the string is a valid date and time in earlier time zone" do

        let(:mongoized) do
          # Tokyo is +9
          Date.mongoize("2010-01-01 20:00:00 +0400")
        end

        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns the date specified in the string without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end

      context "when the string is empty" do

        let(:evolved) do
          Date.mongoize("")
        end

        it "returns nil" do
          expect(evolved).to be_nil
        end
      end

      context "when the string is an invalid time" do

        it "returns nil" do
          expect(Date.mongoize("time")).to eq(nil)
        end
      end
    end

    context "when provided a float" do
      include_context 'using AS time zone'

      let(:float) do
        time.to_f
      end

      let(:mongoized) do
        Date.mongoize(float)
      end

      context 'float in the same local day' do
        let(:time) do
          Time.utc(2010, 1, 1, 2, 3, 4, 123456)
        end

        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns start of the day as date" do
          expect(mongoized).to eq(expected)
        end
      end

      context 'float in a different local day' do
        let(:time) do
          Time.utc(2010, 1, 1, 22, 3, 4, 123456)
        end

        let(:expected) do
          Time.utc(2010, 1, 2, 0, 0, 0, 0)
        end

        it "returns start of the day as date" do
          expect(mongoized).to eq(expected)
        end
      end
    end

    context "when provided an integer" do
      include_context 'using AS time zone'

      let(:integer) do
        time.to_i
      end

      let(:mongoized) do
        Date.mongoize(integer)
      end

      context 'integer in the same local day' do
        let(:time) do
          Time.utc(2010, 1, 1, 2, 3, 4)
        end

        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0, 0)
        end

        it "returns start of the day as date" do
          expect(mongoized).to eq(expected)
        end
      end

      context 'integer in a different local day' do
        let(:time) do
          Time.utc(2010, 1, 1, 22, 3, 4)
        end

        let(:expected) do
          Time.utc(2010, 1, 2, 0, 0, 0, 0)
        end

        it "returns start of the day as date" do
          expect(mongoized).to eq(expected)
        end
      end
    end

    context "when provided a time" do
      include_context 'using AS time zone'

      let(:mongoized) do
        Date.mongoize(time)
      end

      context 'in the same local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:time) do
          Time.utc(2010, 1, 1, 22, 3, 4)
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end

      context 'in another local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:time) do
          Time.utc(2010, 1, 1, 2, 3, 4)
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end
    end

    context "when provided an AS::TimeWithZone" do
      include_context 'using AS time zone'

      let(:mongoized) do
        Date.mongoize(time)
      end

      context 'in the same local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:time) do
          # Tokyo is +9
          ActiveSupport::TimeZone['PST8PDT'].local(2010, 1, 1, 1, 3, 4)
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end

      context 'in another local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:time) do
          ActiveSupport::TimeZone['Moscow'].local(2010, 1, 1, 1, 3, 4)
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end
    end

    context "when provided a DateTime" do
      include_context 'using AS time zone'

      let(:mongoized) do
        Date.mongoize(date_time)
      end

      context 'in the same local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:date_time) do
          # Tokyo is +9
          DateTime.parse('2010-01-01 01:03:04 -0800')
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end

      context 'in another local day' do
        let(:expected) do
          Time.utc(2010, 1, 1, 0, 0, 0)
        end

        let(:date_time) do
          DateTime.parse('2010-01-01 01:03:04 +0100')
        end

        it "returns the date specified in the time without regard for local day" do
          expect(mongoized).to eq(expected)
        end
      end
    end

    context "when provided an array" do
      include_context 'using AS time zone'

      let(:expected) do
        Time.utc(2010, 1, 1, 0, 0, 0)
      end

      let(:array) do
        [ 2010, 1, 1, 2, 3, 4, 0 ]
      end

      let(:mongoized) do
        Date.mongoize(array)
      end

      it "returns the array as a time" do
        expect(mongoized).to eq(expected)
      end
    end

    context "when provided nil" do

      it "returns nil" do
        expect(Date.mongoize(nil)).to be_nil
      end
    end
  end
end


text:
<!DOCTYPE html>

     <meta charset="utf-8">
    <title></title>

İSTANBUL'DAKİ NÖBETÇİ ECZANELER

      <form name="searchDistrict" ng-submit="self.search(self.district)">
        <input class="search-text" type="search" required placeholder="SEMT" name="name" ng-model="self.district">
        <input class="search-button" type="submit" value="ARA">
      </form>

      <ui-gmap-google-map center='self.map.center' zoom='self.map.zoom'>
          <ui-gmap-marker ng-repeat="marker in self.map.markers" coords="marker.coords" options="marker.options" idkey='marker.id' class="marker">
         </ui-gmap-marker>
      </ui-gmap-google-map>


text:
main()
{
eval `grep -E "^enable=|^update_cycle=|^update_url=" $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init`

cat <<EOF

<form id="base_setting">
	<legend>Base Setting<legend>

	Enable

	<input type="checkbox" name="enable" value="1" `[ $enable -eq 1 ] && echo checked`>

	Update cycle

  Hidden label
  <input type="text" class="form-control" id="update_cycle" name="update_cycle" value="$update_cycle">
  Day

	Update URL

	<input type="text" class="form-control" name="update_url" placeholder="URL input" value="$update_url">

	Option

	<input type="hidden" name="action" value="base_setting">
	<button class="btn btn-primary" id="_submit" type="submit">保存</button>

</form>

Update domain list.

EOF
}
base_setting()
{
sed -i "s/^enable=.*/enable=\"$FORM_enable\"/g" $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init
sed -i "s/^update_cycle=.*/update_cycle=\"$FORM_update_cycle\"/g" $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init
sed -i "s#^update_url=.*#update_url=\"$FORM_update_url\"#g" $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init

cat <<EOF > $DOCUMENT_ROOT/apps/dns-fix/root.cron
0 0 $FORM_update_cycle * * eval \`$DOCUMENT_ROOT/../bin/main.sbin shellgui_env\` && $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init update && $DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init analyse && $DOCUMENT_ROOT/apps/dnsmasq/S390dnsmasq.init
EOF
$DOCUMENT_ROOT/apps/scheduled/S300scheduled.init >/dev/null 2>&1
$DOCUMENT_ROOT/apps/dns-fix/S501dns-fix.init >/dev/null 2>&1
if
[ $? -eq 0 ]
then
(echo "$_LANG_Save_success" | main.sbin output_json 0) || exit 0
else
(echo "Fail" | main.sbin output_json 1) || exit 1
fi
}

lang=`main.sbin get_client_lang`
eval `cat $DOCUMENT_ROOT/apps/$FORM_app/i18n/$lang/i18n.conf`

if
[ $is_main_page = 1 ]
then
main
elif [ -n "$FORM_action" ]
then
$FORM_action
fi


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
POIFSConstants (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.poi.poifs.common

Interface POIFSConstants

public interface POIFSConstants

A repository for constants shared by POI classes.

Field Summary

static int
BIG_BLOCK_MINIMUM_DOCUMENT_SIZE

          The minimum size of a document before it's stored using
  Big Blocks (normal streams).

static int
DIFAT_SECTOR_BLOCK

          Indicates the sector holds a DIFAT block (0xFFFFFFFC)

static int
END_OF_CHAIN

          Indicates the sector is the end of a chain (0xFFFFFFFE)

static int
FAT_SECTOR_BLOCK

          Indicates the sector holds a FAT block (0xFFFFFFFD)

static int
LARGER_BIG_BLOCK_SIZE

          Some use 4096 bytes

static POIFSBigBlockSize
LARGER_BIG_BLOCK_SIZE_DETAILS

static int
LARGEST_REGULAR_SECTOR_NUMBER

          The highest sector number you're allowed, 0xFFFFFFFA

static byte[]
OOXML_FILE_HEADER

          The first 4 bytes of an OOXML file, used in detection

static int
PROPERTY_SIZE

          How big a single property is

static byte[]
RAW_XML_FILE_HEADER

          The first 5 bytes of a raw XML file, used in detection

static int
SMALL_BLOCK_SIZE

          How big a block in the small block stream is.

static int
SMALLER_BIG_BLOCK_SIZE

          Most files use 512 bytes as their big block size

static POIFSBigBlockSize
SMALLER_BIG_BLOCK_SIZE_DETAILS

static int
UNUSED_BLOCK

          Indicates the sector is not used (0xFFFFFFFF)

Field Detail

SMALLER_BIG_BLOCK_SIZE

static final int SMALLER_BIG_BLOCK_SIZE

Most files use 512 bytes as their big block size

See Also:
Constant Field Values

SMALLER_BIG_BLOCK_SIZE_DETAILS

static final POIFSBigBlockSize SMALLER_BIG_BLOCK_SIZE_DETAILS

LARGER_BIG_BLOCK_SIZE

static final int LARGER_BIG_BLOCK_SIZE

Some use 4096 bytes

See Also:
Constant Field Values

LARGER_BIG_BLOCK_SIZE_DETAILS

static final POIFSBigBlockSize LARGER_BIG_BLOCK_SIZE_DETAILS

SMALL_BLOCK_SIZE

static final int SMALL_BLOCK_SIZE

How big a block in the small block stream is. Fixed size

See Also:
Constant Field Values

PROPERTY_SIZE

static final int PROPERTY_SIZE

How big a single property is

See Also:
Constant Field Values

BIG_BLOCK_MINIMUM_DOCUMENT_SIZE

static final int BIG_BLOCK_MINIMUM_DOCUMENT_SIZE

The minimum size of a document before it's stored using
  Big Blocks (normal streams). Smaller documents go in the
  Mini Stream (SBAT / Small Blocks)

See Also:
Constant Field Values

LARGEST_REGULAR_SECTOR_NUMBER

static final int LARGEST_REGULAR_SECTOR_NUMBER

The highest sector number you're allowed, 0xFFFFFFFA

See Also:
Constant Field Values

DIFAT_SECTOR_BLOCK

static final int DIFAT_SECTOR_BLOCK

Indicates the sector holds a DIFAT block (0xFFFFFFFC)

See Also:
Constant Field Values

FAT_SECTOR_BLOCK

static final int FAT_SECTOR_BLOCK

Indicates the sector holds a FAT block (0xFFFFFFFD)

See Also:
Constant Field Values

END_OF_CHAIN

static final int END_OF_CHAIN

Indicates the sector is the end of a chain (0xFFFFFFFE)

See Also:
Constant Field Values

UNUSED_BLOCK

static final int UNUSED_BLOCK

Indicates the sector is not used (0xFFFFFFFF)

See Also:
Constant Field Values

OOXML_FILE_HEADER

static final byte[] OOXML_FILE_HEADER

The first 4 bytes of an OOXML file, used in detection

RAW_XML_FILE_HEADER

static final byte[] RAW_XML_FILE_HEADER

The first 5 bytes of a raw XML file, used in detection

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

                Copyright 2017 The Apache Software Foundation or
        its licensors, as applicable.


text:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

  <title>The Dark Tower VII</title>
  <link href="../styles/page-template.xpgt" rel="stylesheet" type="application/vnd.adobe-page-template+xml" />
  <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
  <link href="../Styles/page_styles.css" rel="stylesheet" type="text/css" />

APPENDIX

ROBERT BROWNING

"CHILDE ROLAND

  TO THE DARK TOWER CAME"

I

My first thought was, he lied in every word,

  That hoary cripple, with malicious eye

  Askance to watch the workings of his lie

  On mine, and mouth scarce able to afford

  Suppression of the glee, that pursed and scored

  Its edge, at one more victim gained thereby.

II

What else should he be set for, with his staff?

  What, save to waylay with his lies, ensnare

  All travellers who might find him posted there,

  And ask the road? I guessed what skull-like laugh

  Would break, what crutch 'gin write my epitaph

  For pastime in the dusty thoroughfare.

III

If at his counsel I should turn aside

  Into that ominous tract which, all agree,

  Hides the Dark Tower. Yet acquiescingly

  I did turn as he pointed, neither pride

  Nor hope rekindling at the end descried,

  So much as gladness that some end might be.

IV

For, what with my whole world-wide wandering,

  What with my search drawn out through years,

  my hope

  Dwindled into a ghost not fit to cope

  With that obstreperous joy success would bring,

  I hardly tried now to rebuke the spring

  My heart made, finding failure in its scope.

V

As when a sick man very near to death

  Seems dead indeed, and feels begin and end

  The tears and takes the farewell of each friend,

  And hears one bid the other go, draw breath

  Freelier outside, ('since all is o'er,' he saith

  'And the blow fallen no grieving can amend;')

VI

When some discuss if near the other graves

  Be room enough for this, and when a day

  Suits best for carrying the corpse away,

  With care about the banners, scarves and staves

  And still the man hears all, and only craves

  He may not shame such tender love and stay.

VII

Thus, I had so long suffered in this quest,

  Heard failure prophesied so oft, been writ

  So many times among 'The Band' to wit,

  The knights who to the Dark Tower's

  search addressed

  Their steps—that just to fail as they, seemed best,

  And all the doubt was now—should I be fit?

VIII

So, quiet as despair I turned from him,

  That hateful cripple, out of his highway

  Into the path he pointed. All the day

  Had been a dreary one at best, and dim

  Was settling to its close, yet shot one grim

  Red leer to see the plain catch its estray.

IX

For mark! No sooner was I fairly found

  Pledged to the plain, after a pace or two,

  Than, pausing to throw backwards a last view

  O'er the safe road, 'twas gone; grey plain all round:

  Nothing but plain to the horizon's bound.

  I might go on, naught else remained to do.

X

So on I went. I think I never saw

  Such starved ignoble nature; nothing throve:

  For flowers—as well expect a cedar grove!

  But cockle, spurge, according to their law

  Might propagate their kind with none to awe,

  You'd think; a burr had been a treasure trove.

XI

No! penury, inertness and grimace,

  In some strange sort, were the land's portion. 'See

  Or shut your eyes,' said Nature peevishly,

  'It nothing skills: I cannot help my case:

  'Tis the Last Judgement's fire must cure this place

  Calcine its clods and set my prisoners free.'

XII

If there pushed any ragged thistle-stalk

  Above its mates, the head was chopped, the bents

  Were jealous else. What made those holes and rents

  In the dock's harsh swarth leaves, bruised as to baulk

  All hope of greenness? 'tis a brute must walk

  Pashing their life out, with a brute's intents.

XIII

As for the grass, it grew as scant as hair

  In leprosy; thin dry blades pricked the mud

  Which underneath looked kneaded up with blood.

  One stiff blind horse, his every bone a-stare,

  Stood stupefied, however he came there:

  Thrust out past service from the devil's stud!

XIV

Alive? he might be dead for aught I know,

  With that red gaunt and colloped neck a-strain.

  And shut eyes underneath the rusty mane;

  Seldom went such grotesqueness with such woe;

  I never saw a brute I hated so;

  He must be wicked to deserve such pain.

XV

I shut my eyes and turned them on my heart,

  As a man calls for wine before he fights,

  I asked one draught of earlier, happier sights,

  Ere fitly I could hope to play my part.

  Think first, fight afterwards, the soldier's art:

  One taste of the old time sets all to rights.

XVI

Not it! I fancied Cuthbert's reddening face

  Beneath its garniture of curly gold,

  Dear fellow, till I almost felt him fold

  An arm to mine to fix me to the place,

  The way he used. Alas, one night's disgrace!

  Out went my heart's new fire and left it cold.

XVII

Giles then, the soul of honour—there he stands

  Frank as ten years ago when knighted first,

  What honest man should dare (he said) he durst.

  Good—but the scene shifts—faugh!

  what hangman hands

  Pin to his breast a parchment? His own bands

  Read it. Poor traitor, spit upon and curst!

XVIII

Better this present than a past like that:

  Back therefore to my darkening path again!

  No sound, no sight as far as eye could strain.

  Will the night send a howlet or a bat?

  I asked: when something on the dismal flat

  Came to arrest my thoughts and change their train.

XIX

A sudden little river crossed my path

  As unexpected as a serpent comes.

  No sluggish tide congenial to the glooms;

  This, as it frothed by, might have been a bath

  For the fiend's glowing hoof—to see the wrath

  Of its black eddy bespate with flakes and spumes.

XX

So petty yet so spiteful! All along,

  Low scrubby alders kneeled down over it;

  Drenched willows flung them headlong in a fit

  Of mute despair, a suicidal throng:

  The river which had done them all the wrong,

  Whate'er that was, rolled by, deterred no whit.

XXI

Which, while I forded—good saints,

  how I feared

  To set my foot upon a dead man's cheek,

  Each step, or feel the spear I thrust to seek

  For hollows, tangled in his hair or beard!

  —It may have been a water-rat I speared,

  But, ugh! it sounded like a baby's shriek.

XXII

Glad was I when I reached the other bank.

  Now for a better country. Vain presage!

  Who were the strugglers, what war did they wage,

  Whose savage trample thus could pad the dank

  Soil to a plash? Toads in a poisoned tank

  Or wild cats in a red-hot iron cage—

XXIII

The fight must so have seemed in that fell cirque,

  What penned them there, with all the plain to choose?

  No footprint leading to that horrid mews,

  None out of it. Mad brewage set to work

  Their brains, no doubt, like galley-slaves the Turk

  Pits for his pastime, Christians against Jews.

XXIV

And more than that—a furlong on—why, there!

  What bad use was that engine for, that wheel,

  Or brake, not wheel—that harrow fit to reel

  Men's bodies out like silk? With all the air

  Of Tophet's tool, on earth left unaware

  Or brought to sharpen its rusty teeth of steel.

XXV

Then came a bit of stubbed ground, once a wood,

  Next a marsh it would seem, and now mere earth

  Desperate and done with; (so a fool finds mirth,

  Makes a thing and then mars it, till his mood

  Changes and off he goes!) within a rood—

  Bog, clay and rubble, sand, and stark black dearth.

XXVI

Now blotches rankling, coloured gay and grim,

  Now patches where some leanness of the soil's

  Broke into moss, or substances like boils;

  Then came some palsied oak, a cleft in him

  Like a distorted mouth that splits its rim

  Gaping at death, and dies while it recoils.

XXVII

And just as far as ever from the end!

  Naught in the distance but the evening, naught

  To point my footstep further! At the thought,

  A great black bird, Apollyon's bosom friend,

  Sailed past, not best his wide wing dragon-penned

  That brushed my cap—perchance the guide I sought.

XXVIII

For, looking up, aware I somehow grew,

  'Spite of the dusk, the plain had given place

  All round to mountains—with such name to grace

  Mere ugly heights and heaps now stolen in view.

  How thus they had surprised me—solve it, you!

  How to get from them was no clearer case.

XXIX

Yet half I seemed to recognise some trick

  Of mischief happened to me, God knows when—

  In a bad dream perhaps. Here ended, then

  Progress this way. When, in the very nick

  Of giving up, one time more, came a click

  As when a trap shuts—you're inside the den.

XXX

Burningly it came on me all at once,

  This was the place! those two hills on the right,

  Crouched like two bulls locked horn in horn in fight;

  While to the left a tall scalped mountain . . . Dunce,

  Dotard, a-dozing at the very nonce,

  After a life spent training for the sight!

XXXI

What in the midst lay but the Tower itself?

  The round squat turret, blind as the fool's heart,

  Built of brown stone, without a counterpart

  In the whole world. The tempest's mocking elf

  Points to the shipman thus the unseen shelf

  He strikes on, only when the timbers start.

XXXII

Not see? because of night perhaps?—why day

  Came back again for that! before it left

  The dying sunset kindled through a cleft:

  The hills, like giants at a hunting, lay,

  Chin upon hand, to see the game at bay,—

  'Now stab and end the creature—to the heft!'

XXXIII

Not hear? When noise was everywhere! it tolled

  Increasing like a bell. Names in my ears

  Of all the lost adventurers, my peers—

  How such a one was strong, and such was bold,

  And such was fortunate, yet each of old

  Lost, lost! one moment knelled the woe of years.

XXXIV

There they stood, ranged along the hillsides, met

  To view the last of me, a living frame

  For one more picture! In a sheet of flame

  I saw them and I knew them all. And yet

  Dauntless the slug-horn to my lips I set,

  And blew. 'Childe Roland to the Dark Tower came.'


text:
package thosakwe.fray.interpreter.errors;

import org.antlr.v4.runtime.tree.ParseTree;
import thosakwe.fray.interpreter.FrayInterpreter;
import thosakwe.fray.interpreter.FrayStackElement;

import java.util.List;

public class FrayException extends Exception {
    private final FrayInterpreter interpreter;
    private final String message;
    private final ParseTree source;

    public FrayException(String message, ParseTree source, FrayInterpreter interpreter) {
        this.interpreter = interpreter;
        this.message = message;
        this.source = source;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public ParseTree getSource() {
        return source;
    }

    @Override
    public void printStackTrace() {
        final List<FrayStackElement> elements = interpreter.getStack().getElements();

        for (int i = elements.size() - 1; i >= 0; i--) {
            final FrayStackElement element = elements.get(i);
            System.err.printf(
                    "    at %s(%s:%d:%d)%n",
                    element.getName(),
                    element.getSourceFile(),
                    element.getSourceTree().start.getLine(),
                    element.getSourceTree().start.getCharPositionInLine());
        }
    }

    public static FrayException expectedAtLeast(int min) {
        return new FrayException(String.format("Expected at least %d argument(s).", min), null, null);
    }

    @Override
    public String toString() {
        return String.format("Unhandled exception: %s", message);
    }
}


text:
var nodes = require('../nodes');

/**
 * Returns the @media string for the current block
 *
 * @return {String}
 * @api public
 */

module.exports = function currentMedia(){
  return new nodes.String(lookForMedia(this.closestBlock.node) || '');

  function lookForMedia(node){
    if ('media' == node.nodeName) {
      return node.toString();
    } else if (node.block.parent.node) {
      return lookForMedia(node.block.parent.node);
    }
  }
};


text: Shared Services Senior Support Officer


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class org.apache.cassandra.db.lifecycle.SSTableIntervalTree (apache-cassandra API)</title>
<meta name="date" content="2016-04-28">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.cassandra.db.lifecycle.SSTableIntervalTree

Packages that use SSTableIntervalTree

Package
Description

org.apache.cassandra.db.lifecycle

Uses of SSTableIntervalTree in org.apache.cassandra.db.lifecycle

Fields in org.apache.cassandra.db.lifecycle declared as SSTableIntervalTree

Modifier and Type
Field and Description

SSTableIntervalTree
View.intervalTree

Methods in org.apache.cassandra.db.lifecycle that return SSTableIntervalTree

Modifier and Type
Method and Description

static SSTableIntervalTree
SSTableIntervalTree.build(java.lang.Iterable<SSTableReader> sstables)

static SSTableIntervalTree
SSTableIntervalTree.empty()

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 The Apache Software Foundation


text:
class LocationBarView;
class OmniboxPopupView;

namespace views {
class MenuRunner;
class NativeViewHost;
class View;
}

// Provides the implementation of an edit control with a drop-down
// autocomplete box. The box itself is implemented in autocomplete_popup.cc
// This file implements the edit box and management for the popup.
class OmniboxViewWin
    : public CWindowImpl<OmniboxViewWin,
                         CRichEditCtrl,
                         CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL |
                                    ES_NOHIDESEL> >,
      public CRichEditCommands<OmniboxViewWin>,
      public ui::SimpleMenuModel::Delegate,
      public ui::TsfEventRouterObserver,
      public OmniboxView {
 public:
  struct State {
    State(const CHARRANGE& selection,
          const CHARRANGE& saved_selection_for_focus_change)
        : selection(selection),
          saved_selection_for_focus_change(saved_selection_for_focus_change) {
    }

    const CHARRANGE selection;
    const CHARRANGE saved_selection_for_focus_change;
  };

  DECLARE_WND_SUPERCLASS(L"Chrome_OmniboxView", MSFTEDIT_CLASS);

  OmniboxViewWin(OmniboxEditController* controller,
                 ToolbarModel* toolbar_model,
                 LocationBarView* parent_view,
                 CommandUpdater* command_updater,
                 bool popup_window_mode,
                 views::View* location_bar);
  ~OmniboxViewWin();

  // Gets the relative window for the specified native view.
  static gfx::NativeView GetRelativeWindowForNativeView(
      gfx::NativeView edit_native_view);

  views::View* parent_view() const;

  // OmniboxView:
  virtual void SaveStateToTab(content::WebContents* tab) OVERRIDE;
  virtual void Update(
      const content::WebContents* tab_for_state_restoring) OVERRIDE;
  virtual void OpenMatch(const AutocompleteMatch& match,
                         WindowOpenDisposition disposition,
                         const GURL& alternate_nav_url,
                         size_t index) OVERRIDE;
  virtual string16 GetText() const OVERRIDE;
  virtual void SetUserText(const string16& text,
                           const string16& display_text,
                           bool update_popup) OVERRIDE;
  virtual void SetWindowTextAndCaretPos(const string16& text,
                                        size_t caret_pos,
                                        bool update_popup,
                                        bool notify_text_changed) OVERRIDE;
  virtual void SetForcedQuery() OVERRIDE;
  virtual bool IsSelectAll() const OVERRIDE;
  virtual bool DeleteAtEndPressed() OVERRIDE;
  virtual void GetSelectionBounds(string16::size_type* start,
                                  string16::size_type* end) const OVERRIDE;
  virtual void SelectAll(bool reversed) OVERRIDE;
  virtual void RevertAll() OVERRIDE;
  virtual void UpdatePopup() OVERRIDE;
  virtual void SetFocus() OVERRIDE;
  virtual void OnTemporaryTextMaybeChanged(
      const string16& display_text,
      bool save_original_selection) OVERRIDE;
  virtual bool OnInlineAutocompleteTextMaybeChanged(
      const string16& display_text, size_t user_text_length) OVERRIDE;
  virtual void OnRevertTemporaryText() OVERRIDE;
  virtual void OnBeforePossibleChange() OVERRIDE;
  virtual bool OnAfterPossibleChange() OVERRIDE;
  virtual gfx::NativeView GetNativeView() const OVERRIDE;
  virtual gfx::NativeView GetRelativeWindowForPopup() const OVERRIDE;
  virtual void SetInstantSuggestion(const string16& suggestion) OVERRIDE;
  virtual int TextWidth() const OVERRIDE;
  virtual string16 GetInstantSuggestion() const OVERRIDE;
  virtual bool IsImeComposing() const OVERRIDE;
  virtual int GetMaxEditWidth(int entry_width) const OVERRIDE;
  virtual views::View* AddToView(views::View* parent) OVERRIDE;
  virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
  virtual gfx::Font GetFont() OVERRIDE;
  virtual int WidthOfTextAfterCursor() OVERRIDE;

  int GetPopupMaxYCoordinate();

  void SetDropHighlightPosition(int position);
  int drop_highlight_position() const { return drop_highlight_position_; }

  // Returns true if a drag a drop session was initiated by this edit.
  bool in_drag() const { return in_drag_; }

  // Moves the selected text to the specified position.
  void MoveSelectedText(int new_position);

  // Inserts the text at the specified position.
  void InsertText(int position, const string16& text);

  void set_force_hidden(bool force_hidden) { force_hidden_ = force_hidden; }

  // Called before an accelerator is processed to give us a chance to override
  // it.
  bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event);

  // Handler for external events passed in to us.  The View that owns us may
  // send us events that we should treat as if they were events on us.
  void HandleExternalMsg(UINT msg, UINT flags, const CPoint& screen_point);

  // CWindowImpl
  BEGIN_MSG_MAP(OmniboxViewWin)
    MSG_WM_CHAR(OnChar)
    MSG_WM_CONTEXTMENU(OnContextMenu)
    MSG_WM_COPY(OnCopy)
    MSG_WM_CREATE(OnCreate)
    MSG_WM_CUT(OnCut)
    MESSAGE_HANDLER_EX(WM_GETOBJECT, OnGetObject)
    MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeComposition)
    MESSAGE_HANDLER_EX(WM_IME_ENDCOMPOSITION, OnImeEndComposition)
    MESSAGE_HANDLER_EX(WM_IME_NOTIFY, OnImeNotify)
    MESSAGE_HANDLER_EX(WM_TOUCH, OnTouchEvent)
    MSG_WM_KEYDOWN(OnKeyDown)
    MSG_WM_KEYUP(OnKeyUp)
    MSG_WM_KILLFOCUS(OnKillFocus)
    MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk)
    MSG_WM_LBUTTONDOWN(OnLButtonDown)
    MSG_WM_LBUTTONUP(OnLButtonUp)
    MSG_WM_MBUTTONDBLCLK(OnMButtonDblClk)
    MSG_WM_MBUTTONDOWN(OnMButtonDown)
    MSG_WM_MBUTTONUP(OnMButtonUp)
    MSG_WM_MOUSEACTIVATE(OnMouseActivate)
    MSG_WM_MOUSEMOVE(OnMouseMove)
    MSG_WM_MOUSEWHEEL(OnMouseWheel)
    MSG_WM_PAINT(OnPaint)
    MSG_WM_PASTE(OnPaste)
    MSG_WM_RBUTTONDBLCLK(OnRButtonDblClk)
    MSG_WM_RBUTTONDOWN(OnRButtonDown)
    MSG_WM_RBUTTONUP(OnRButtonUp)
    MSG_WM_SETFOCUS(OnSetFocus)
    MSG_WM_SETTEXT(OnSetText)
    MSG_WM_SYSCHAR(OnSysChar)  // WM_SYSxxx == WM_xxx with ALT down
    MSG_WM_SYSKEYDOWN(OnKeyDown)
    MSG_WM_SYSKEYUP(OnKeyUp)
    MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging)
    DEFAULT_REFLECTION_HANDLER()  // avoids black margin area
  END_MSG_MAP()

  // ui::SimpleMenuModel::Delegate
  virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
  virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
  virtual bool GetAcceleratorForCommandId(
      int command_id,
      ui::Accelerator* accelerator) OVERRIDE;
  virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE;
  virtual string16 GetLabelForCommandId(int command_id) const OVERRIDE;
  virtual void ExecuteCommand(int command_id) OVERRIDE;

 private:
  enum MouseButton {
    kLeft  = 0,
    kRight = 1,
  };

  // This object freezes repainting of the edit until the object is destroyed.
  // Some methods of the CRichEditCtrl draw synchronously to the screen.  If we
  // don't freeze, the user will see a rapid series of calls to these as
  // flickers.
  //
  // Freezing the control while it is already frozen is permitted; the control
  // will unfreeze once both freezes are released (the freezes stack).
  class ScopedFreeze {
   public:
    ScopedFreeze(OmniboxViewWin* edit, ITextDocument* text_object_model);
    ~ScopedFreeze();

   private:
    OmniboxViewWin* const edit_;
    ITextDocument* const text_object_model_;

    DISALLOW_COPY_AND_ASSIGN(ScopedFreeze);
  };

  class EditDropTarget;
  friend class EditDropTarget;

  // This object suspends placing any operations on the edit's undo stack until
  // the object is destroyed.  If we don't do this, some of the operations we
  // perform behind the user's back will be undoable by the user, which feels
  // bizarre and confusing.
  class ScopedSuspendUndo {
   public:
    explicit ScopedSuspendUndo(ITextDocument* text_object_model);
    ~ScopedSuspendUndo();

   private:
    ITextDocument* const text_object_model_;

    DISALLOW_COPY_AND_ASSIGN(ScopedSuspendUndo);
  };

  // Replacement word-breaking proc for the rich edit control.
  static int CALLBACK WordBreakProc(LPTSTR edit_text,
                                    int current_pos,
                                    int length,
                                    int action);

  // Returns true if |edit_text| starting at |current_pos| is "://".
  static bool SchemeEnd(LPTSTR edit_text, int current_pos, int length);

  // Message handlers
  void OnChar(TCHAR ch, UINT repeat_count, UINT flags);
  void OnContextMenu(HWND window, const CPoint& point);
  void OnCopy();
  LRESULT OnCreate(const CREATESTRUCTW* create_struct);
  void OnCut();
  LRESULT OnGetObject(UINT message, WPARAM wparam, LPARAM lparam);
  LRESULT OnImeComposition(UINT message, WPARAM wparam, LPARAM lparam);
  LRESULT OnImeEndComposition(UINT message, WPARAM wparam, LPARAM lparam);
  LRESULT OnImeNotify(UINT message, WPARAM wparam, LPARAM lparam);
  LRESULT OnTouchEvent(UINT message, WPARAM wparam, LPARAM lparam);
  void OnKeyDown(TCHAR key, UINT repeat_count, UINT flags);
  void OnKeyUp(TCHAR key, UINT repeat_count, UINT flags);
  void OnKillFocus(HWND focus_wnd);
  void OnLButtonDblClk(UINT keys, const CPoint& point);
  void OnLButtonDown(UINT keys, const CPoint& point);
  void OnLButtonUp(UINT keys, const CPoint& point);
  void OnMButtonDblClk(UINT keys, const CPoint& point);
  void OnMButtonDown(UINT keys, const CPoint& point);
  void OnMButtonUp(UINT keys, const CPoint& point);
  LRESULT OnMouseActivate(HWND window, UINT hit_test, UINT mouse_message);
  void OnMouseMove(UINT keys, const CPoint& point);
  BOOL OnMouseWheel(UINT flags, short delta, CPoint point);
  void OnPaint(HDC bogus_hdc);
  void OnPaste();
  void OnRButtonDblClk(UINT keys, const CPoint& point);
  void OnRButtonDown(UINT keys, const CPoint& point);
  void OnRButtonUp(UINT keys, const CPoint& point);
  void OnSetFocus(HWND focus_wnd);
  LRESULT OnSetText(const wchar_t* text);
  void OnSysChar(TCHAR ch, UINT repeat_count, UINT flags);
  void OnWindowPosChanging(WINDOWPOS* window_pos);

  // Helper function for OnChar() and OnKeyDown() that handles keystrokes that
  // could change the text in the edit.
  void HandleKeystroke(UINT message, TCHAR key, UINT repeat_count, UINT flags);

  // Helper functions for OnKeyDown() that handle accelerators applicable when
  // we're not read-only and all the time, respectively.  These return true if
  // they handled the key.
  bool OnKeyDownOnlyWritable(TCHAR key, UINT repeat_count, UINT flags);
  bool OnKeyDownAllModes(TCHAR key, UINT repeat_count, UINT flags);

  // Like GetSel(), but returns a range where |cpMin| will be larger than
  // |cpMax| if the cursor is at the start rather than the end of the selection
  // (in other words, tracks selection direction as well as offsets).
  // Note the non-Google-style "non-const-ref" argument, which matches GetSel().
  void GetSelection(CHARRANGE& sel) const;

  // Returns the currently selected text of the edit control.
  string16 GetSelectedText() const;

  // Like SetSel(), but respects the selection direction implied by |start| and
  // |end|: if |end| < |start|, the effective cursor will be placed at the
  // beginning of the selection.
  void SetSelection(LONG start, LONG end);

  // Like SetSelection(), but takes a CHARRANGE.
  void SetSelectionRange(const CHARRANGE& sel) {
    SetSelection(sel.cpMin, sel.cpMax);
  }

  // Places the caret at the given position.  This clears any selection.
  void PlaceCaretAt(size_t pos);

  // Returns true if |sel| represents a forward or backward selection of all the
  // text.
  bool IsSelectAllForRange(const CHARRANGE& sel) const;

  // Given an X coordinate in client coordinates, returns that coordinate
  // clipped to be within the horizontal bounds of the visible text.
  //
  // This is used in our mouse handlers to work around quirky behaviors of the
  // underlying CRichEditCtrl like not supporting triple-click when the user
  // doesn't click on the text itself.
  //
  // |is_triple_click| should be true iff this is the third click of a triple
  // click.  Sadly, we need to clip slightly differently in this case.
  LONG ClipXCoordToVisibleText(LONG x, bool is_triple_click) const;

  virtual int GetOmniboxTextLength() const OVERRIDE;

  // Parses the contents of the control for the scheme and the host name.
  // Highlights the scheme in green or red depending on it security level.
  // If a host name is found, it makes it visually stronger.
  virtual void EmphasizeURLComponents() OVERRIDE;

  // TsfEventRouter::Observer:
  virtual void OnCandidateWindowCountChanged(size_t window_count) OVERRIDE;
  virtual void OnTextUpdated(const ui::Range& composition_range) OVERRIDE;

  // Erases the portion of the selection in the font's y-adjustment area.  For
  // some reason the edit draws the selection rect here even though it's not
  // part of the font.
  void EraseTopOfSelection(CDC* dc,
                           const CRect& client_rect,
                           const CRect& paint_clip_rect);

  // Draws a slash across the scheme if desired.
  void DrawSlashForInsecureScheme(HDC hdc,
                                  const CRect& client_rect,
                                  const CRect& paint_clip_rect);

  // Renders the drop highlight.
  void DrawDropHighlight(HDC hdc,
                         const CRect& client_rect,
                         const CRect& paint_clip_rect);

  // Internally invoked whenever the text changes in some way.
  void TextChanged() OVERRIDE;

  // Getter for the text_object_model_.  Note that the pointer returned here is
  // only valid as long as the AutocompleteEdit is still alive.  Also, if the
  // underlying call fails, this may return NULL.
  ITextDocument* GetTextObjectModel() const;

  // Invoked during a mouse move. As necessary starts a drag and drop session.
  void StartDragIfNecessary(const CPoint& point);

  // Invoked during a mouse down. If the mouse location is over the selection
  // this sets possible_drag_ to true to indicate a drag should start if the
  // user moves the mouse far enough to start a drag.
  void OnPossibleDrag(const CPoint& point);

  // Redraws the necessary region for a drop highlight at the specified
  // position. This does nothing if position is beyond the bounds of the
  // text.
  void RepaintDropHighlight(int position);

  // Generates the context menu for the edit field.
  void BuildContextMenu();

  void SelectAllIfNecessary(MouseButton button, const CPoint& point);
  void TrackMousePosition(MouseButton button, const CPoint& point);

  // Returns the sum of the left and right margins.
  int GetHorizontalMargin() const;

  // Returns the width in pixels needed to display |text|.
  int WidthNeededToDisplay(const string16& text) const;

  // Real implementation of OnAfterPossibleChange() method.
  // If |force_text_changed| is true, then the text_changed code will always be
  // triggerred no matter if the text is actually changed or not.
  bool OnAfterPossibleChangeInternal(bool force_text_changed);

  // Common implementation for performing a drop on the edit view.
  int OnPerformDropImpl(const ui::DropTargetEvent& event, bool in_drag);

  // Whether to show the menu item for copying the URL.
  bool ShouldEnableCopyURL() const;
  void CopyURL();

  // Handle of RichEdit dll.
  static HMODULE loaded_library_module_;

  scoped_ptr<OmniboxPopupView> popup_view_;

  // The parent view for the edit, used to align the popup and for
  // accessibility.
  LocationBarView* parent_view_;

  // When true, the location bar view is read only and also is has a slightly
  // different presentation (font size / color). This is used for popups.
  bool popup_window_mode_;

  // True if we should prevent attempts to make the window visible when we
  // handle WM_WINDOWPOSCHANGING.  While toggling fullscreen mode, the main
  // window is hidden, and if the edit is shown it will draw over the main
  // window when that window reappears.
  bool force_hidden_;

  // Non-null when the edit is gaining focus from a left click.  This is only
  // needed between when WM_MOUSEACTIVATE and WM_LBUTTONDOWN get processed.  It
  // serves two purposes: first, by communicating to OnLButtonDown() that we're
  // gaining focus from a left click, it allows us to work even with the
  // inconsistent order in which various Windows messages get sent (see comments
  // in OnMouseActivate()).  Second, by holding the edit frozen, it ensures that
  // when we process WM_SETFOCUS the edit won't first redraw itself with the
  // caret at the beginning, and then have it blink to where the mouse cursor
  // really is shortly afterward.
  scoped_ptr<ScopedFreeze> gaining_focus_;

  // When the user clicks to give us focus, we watch to see if they're clicking
  // or dragging.  When they're clicking, we select nothing until mouseup, then
  // select all the text in the edit.  During this process, tracking_click_[X]
  // is true and click_point_[X] holds the original click location.
  // At other times, tracking_click_[X] is false, and the contents of
  // click_point_[X] should be ignored. The arrays hold the state for the
  // left and right mouse buttons, and are indexed using the MouseButton enum.
  bool tracking_click_[2];
  CPoint click_point_[2];

  // We need to know if the user triple-clicks, so track double click points
  // and times so we can see if subsequent clicks are actually triple clicks.
  bool tracking_double_click_;
  CPoint double_click_point_;
  DWORD double_click_time_;

  // Used to discard unnecessary WM_MOUSEMOVE events after the first such
  // unnecessary event.  See detailed comments in OnMouseMove().
  bool can_discard_mousemove_;

  // Used to prevent IME message handling in the midst of updating the edit
  // text.  See comments where this is used.
  bool ignore_ime_messages_;

  // Variables for tracking state before and after a possible change.
  string16 text_before_change_;
  CHARRANGE sel_before_change_;

  // Set at the same time the model's original_* members are set, and valid in
  // the same cases.
  CHARRANGE original_selection_;

  // Holds the user's selection across focus changes.  cpMin holds -1 when
  // there is no saved selection.
  CHARRANGE saved_selection_for_focus_change_;

  // Was the delete key pressed with an empty selection at the end of the edit?
  bool delete_at_end_pressed_;

  // The context menu for the edit.
  scoped_ptr<ui::SimpleMenuModel> context_menu_contents_;
  scoped_ptr<views::MenuRunner> context_menu_runner_;

  // Font we're using.  We keep a reference to make sure the font supplied to
  // the constructor doesn't go away before we do.
  gfx::Font font_;

  // Metrics about the font, which we keep so we don't need to recalculate them
  // every time we paint.  |font_y_adjustment_| is the number of pixels we need
  // to shift the font vertically in order to make its baseline be at our
  // desired baseline in the edit.
  int font_x_height_;
  int font_y_adjustment_;

  // If true, indicates the mouse is down and if the mouse is moved enough we
  // should start a drag.
  bool possible_drag_;

  // If true, we're in a call to DoDragDrop.
  bool in_drag_;

  // If true indicates we've run a drag and drop session. This is used to
  // avoid starting two drag and drop sessions if the drag is canceled while
  // the mouse is still down.
  bool initiated_drag_;

  // Position of the drop highlight.  If this is -1, there is no drop highlight.
  int drop_highlight_position_;

  // True if the IME candidate window is open.  When this is true, we want to
  // avoid showing the popup.
  bool ime_candidate_window_open_;

  // Security UI-related data.
  COLORREF background_color_;
  ToolbarModel::SecurityLevel security_level_;

  // This interface is useful for accessing the CRichEditCtrl at a low level.
  mutable ITextDocument* text_object_model_;

  // This contains the scheme char start and stop indexes that should be
  // stricken-out when displaying an insecure scheme.
  url_parse::Component insecure_scheme_component_;

  // Instance of accessibility information and handling.
  mutable base::win::ScopedComPtr<IAccessible> autocomplete_accessibility_;

  // The native view host.
  views::NativeViewHost* native_view_host_;

  // TSF related event router.
  scoped_ptr<ui::TsfEventRouter> tsf_event_router_;

  DISALLOW_COPY_AND_ASSIGN(OmniboxViewWin);
};

#endif  // CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_VIEW_WIN_H_


text:
using System.Collections.Generic;

namespace eShopOnContainers.Core.Models.Marketing
{
    public class CampaignRoot
    {
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public int Count { get; set; }
        public List<CampaignItem> Data { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>[%title%] - FHIR Server [%id%]</title>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
  <meta content="http://hl7.org/fhir" name="author"/>
  <meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=edge" />

  <link rel="stylesheet" href="/fhir.css"/>

  <link rel="stylesheet" href="/dist/css/bootstrap.css"/>
  <link rel="stylesheet" href="/assets/css/bootstrap-fhir.css"/>

  <link rel="stylesheet" href="/assets/css/project.css"/>
  <link rel="stylesheet" href="/assets/css/pygments-manni.css"/>
	<link rel="stylesheet" href="/assets/css/jquery-ui.css"/>

  <link sizes="144x144" rel="apple-touch-icon-precomposed" href="/assets/ico/apple-touch-icon-144-precomposed.png"/>
  <link sizes="114x114" rel="apple-touch-icon-precomposed" href="/assets/ico/apple-touch-icon-114-precomposed.png"/>
  <link sizes="72x72" rel="apple-touch-icon-precomposed" href="/assets/ico/apple-touch-icon-72-precomposed.png"/>
  <link rel="apple-touch-icon-precomposed" href="/assets/ico/apple-touch-icon-57-precomposed.png"/>
  <link rel="shortcut icon" href="/assets/ico/favicon.png"/>

<link rel="stylesheet" href="/css/jquery.ui.all.css">

   FHIR

  © HL7.org
   |
  Server Home    |
  [%id%] FHIR Server
   |
   [%logout%]

[%content%]

        Server Home. | FHIR © HL7.org 2011+.  |  Server Provided by Health Intersections Pty Ltd


text:
using System;
using System.Globalization;
using System.Runtime.Serialization;

namespace System.Text
{
    public sealed class DecoderExceptionFallback : DecoderFallback
    {
        // Construction
        public DecoderExceptionFallback()
        {
        }

        public override DecoderFallbackBuffer CreateFallbackBuffer()
        {
            return new DecoderExceptionFallbackBuffer();
        }

        // Maximum number of characters that this instance of this fallback could return
        public override int MaxCharCount
        {
            get
            {
                return 0;
            }
        }

        public override bool Equals(object value)
        {
            if (value is DecoderExceptionFallback that)
            {
                return (true);
            }
            return (false);
        }

        public override int GetHashCode()
        {
            return 879;
        }
    }

    public sealed class DecoderExceptionFallbackBuffer : DecoderFallbackBuffer
    {
        public override bool Fallback(byte[] bytesUnknown, int index)
        {
            Throw(bytesUnknown, index);
            return true;
        }

        public override char GetNextChar()
        {
            return (char)0;
        }

        public override bool MovePrevious()
        {
            // Exception fallback doesn't have anywhere to back up to.
            return false;
        }

        // Exceptions are always empty
        public override int Remaining
        {
            get
            {
                return 0;
            }
        }

        private void Throw(byte[] bytesUnknown, int index)
        {
            // Create a string representation of our bytes.
            StringBuilder strBytes = new StringBuilder(bytesUnknown.Length * 3);

            int i;
            for (i = 0; i < bytesUnknown.Length && i < 20; i++)
            {
                strBytes.Append('[');
                strBytes.Append(bytesUnknown[i].ToString("X2", CultureInfo.InvariantCulture));
                strBytes.Append(']');
            }

            // In case the string's really long
            if (i == 20)
                strBytes.Append(" ...");

            // Known index
            throw new DecoderFallbackException(
                SR.Format(SR.Argument_InvalidCodePageBytesIndex,
                   strBytes, index), bytesUnknown, index);
        }
    }

    // Exception for decoding unknown byte sequences.
    [Serializable]
    [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
    public sealed class DecoderFallbackException : ArgumentException
    {
        private byte[] _bytesUnknown = null;
        private int _index = 0;

        public DecoderFallbackException()
            : base(SR.Arg_ArgumentException)
        {
            HResult = HResults.COR_E_ARGUMENT;
        }

        public DecoderFallbackException(string message)
            : base(message)
        {
            HResult = HResults.COR_E_ARGUMENT;
        }

        public DecoderFallbackException(string message, Exception innerException)
            : base(message, innerException)
        {
            HResult = HResults.COR_E_ARGUMENT;
        }

        public DecoderFallbackException(string message, byte[] bytesUnknown, int index)
            : base(message)
        {
            _bytesUnknown = bytesUnknown;
            _index = index;
        }

        private DecoderFallbackException(SerializationInfo serializationInfo, StreamingContext streamingContext)
            : base(serializationInfo, streamingContext)
        {
        }

        public byte[] BytesUnknown
        {
            get
            {
                return (_bytesUnknown);
            }
        }

        public int Index
        {
            get
            {
                return _index;
            }
        }
    }
}


text:
SYNONYM

#### According to
Integrated Taxonomic Information System

#### Published in
E. E. Silva Tarouca, Freiland-Nadelgehölz. 281, fig. 293. 1913

#### Original name
null

### Remarks
null


text:
MACRO(VTK_LOAD_SINGLE_CMAKE_EXTENSION name dir)
  IF(COMMAND ${name})
  ELSE(COMMAND ${name})
    LOAD_COMMAND(${name} ${dir} ${dir}/Debug)
  ENDIF(COMMAND ${name})
  IF(COMMAND ${name})
  ELSE(COMMAND ${name})
    MESSAGE(FATAL_ERROR "Loading VTK command ${name} - failed")
  ENDIF(COMMAND ${name})
ENDMACRO(VTK_LOAD_SINGLE_CMAKE_EXTENSION)

MACRO(VTK_LOAD_CMAKE_EXTENSIONS ext_dir)
  # do we need the extensions
  SET (VTK_NEED_LOADED_COMMANDS 0)
  IF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
    SET (VTK_NEED_LOADED_COMMANDS 1)
  ENDIF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
  IF (VTK_WRAP_JAVA)
    SET (VTK_NEED_LOADED_COMMANDS 1)
  ENDIF (VTK_WRAP_JAVA)

  IF (VTK_NEED_LOADED_COMMANDS)
    MESSAGE(STATUS "Loading VTK CMake commands")
    VTK_LOAD_SINGLE_CMAKE_EXTENSION(VTK_WRAP_TCL2 ${ext_dir})
    VTK_LOAD_SINGLE_CMAKE_EXTENSION(VTK_WRAP_PYTHON2 ${ext_dir})
    VTK_LOAD_SINGLE_CMAKE_EXTENSION(VTK_WRAP_JAVA2 ${ext_dir})
    VTK_LOAD_SINGLE_CMAKE_EXTENSION(VTK_GENERATE_JAVA_DEPENDENCIES ${ext_dir})
    MESSAGE(STATUS "Loading VTK CMake commands - done")
  ENDIF (VTK_NEED_LOADED_COMMANDS)
ENDMACRO(VTK_LOAD_CMAKE_EXTENSIONS)


text:
/*
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive
 * for more details.
 */

#undef DEBUG

#include <linux/dma-mapping.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/export.h>

#include <asm/pgalloc.h>

#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)

void *dma_alloc_coherent(struct device *dev, size_t size,
			 dma_addr_t *handle, gfp_t flag)
{
	struct page *page, **map;
	pgprot_t pgprot;
	void *addr;
	int i, order;

	pr_debug("dma_alloc_coherent: %d,%x\n", size, flag);

	size = PAGE_ALIGN(size);
	order = get_order(size);

	page = alloc_pages(flag, order);
	if (!page)
		return NULL;

	*handle = page_to_phys(page);
	map = kmalloc(sizeof(struct page *) << order, flag & ~__GFP_DMA);
	if (!map) {
		__free_pages(page, order);
		return NULL;
	}
	split_page(page, order);

	order = 1 << order;
	size >>= PAGE_SHIFT;
	map[0] = page;
	for (i = 1; i < size; i++)
		map[i] = page + i;
	for (; i < order; i++)
		__free_page(page + i);
	pgprot = __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
	if (CPU_IS_040_OR_060)
		pgprot_val(pgprot) |= _PAGE_GLOBAL040 | _PAGE_NOCACHE_S;
	else
		pgprot_val(pgprot) |= _PAGE_NOCACHE030;
	addr = vmap(map, size, VM_MAP, pgprot);
	kfree(map);

	return addr;
}

void dma_free_coherent(struct device *dev, size_t size,
		       void *addr, dma_addr_t handle)
{
	pr_debug("dma_free_coherent: %p, %x\n", addr, handle);
	vfree(addr);
}

#else

#include <asm/cacheflush.h>

void *dma_alloc_coherent(struct device *dev, size_t size,
			   dma_addr_t *dma_handle, gfp_t gfp)
{
	void *ret;
	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
		gfp |= GFP_DMA;
	ret = (void *)__get_free_pages(gfp, get_order(size));

	if (ret != NULL) {
		memset(ret, 0, size);
		*dma_handle = virt_to_phys(ret);
	}
	return ret;
}

void dma_free_coherent(struct device *dev, size_t size,
			 void *vaddr, dma_addr_t dma_handle)
{
	free_pages((unsigned long)vaddr, get_order(size));
}

#endif /* CONFIG_MMU && !CONFIG_COLDFIRE */

EXPORT_SYMBOL(dma_alloc_coherent);
EXPORT_SYMBOL(dma_free_coherent);

void dma_sync_single_for_device(struct device *dev, dma_addr_t handle,
				size_t size, enum dma_data_direction dir)
{
	switch (dir) {
	case DMA_BIDIRECTIONAL:
	case DMA_TO_DEVICE:
		cache_push(handle, size);
		break;
	case DMA_FROM_DEVICE:
		cache_clear(handle, size);
		break;
	default:
		if (printk_ratelimit())
			printk("dma_sync_single_for_device: unsupported dir %u\n", dir);
		break;
	}
}
EXPORT_SYMBOL(dma_sync_single_for_device);

void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sglist,
			    int nents, enum dma_data_direction dir)
{
	int i;
	struct scatterlist *sg;

	for_each_sg(sglist, sg, nents, i) {
		dma_sync_single_for_device(dev, sg->dma_address, sg->length,
					   dir);
	}
}
EXPORT_SYMBOL(dma_sync_sg_for_device);

dma_addr_t dma_map_single(struct device *dev, void *addr, size_t size,
			  enum dma_data_direction dir)
{
	dma_addr_t handle = virt_to_bus(addr);

	dma_sync_single_for_device(dev, handle, size, dir);
	return handle;
}
EXPORT_SYMBOL(dma_map_single);

dma_addr_t dma_map_page(struct device *dev, struct page *page,
			unsigned long offset, size_t size,
			enum dma_data_direction dir)
{
	dma_addr_t handle = page_to_phys(page) + offset;

	dma_sync_single_for_device(dev, handle, size, dir);
	return handle;
}
EXPORT_SYMBOL(dma_map_page);

int dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
	       enum dma_data_direction dir)
{
	int i;
	struct scatterlist *sg;

	for_each_sg(sglist, sg, nents, i) {
		sg->dma_address = sg_phys(sg);
		dma_sync_single_for_device(dev, sg->dma_address, sg->length,
					   dir);
	}
	return nents;
}
EXPORT_SYMBOL(dma_map_sg);


text:
using MVC5EFCodeFirst.DAL;
using System.Data.Entity;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace MVC5EFCodeFirst
{
    public class MvcApplication : HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            //Database.SetInitializer(new SchoolInitializer());
        }
    }
}


text:
package cadastrodeclientesaula25052017;

import java.io.*;
import javax.swing.JOptionPane;

class Pilha implements Serializable {
    private static int base = 0, limite = 3; // esse cadastro recebera 100 clientes
    private int topo;
    private Cliente[] vetor;

    Pilha() {
        topo = base - 1; // valor inicial do topo sempre inicializara abaixo da base onde ser� colocado o primeiro valor da pilha
        vetor = new Cliente[limite + 1];   //limite  acima do final do vettor
    }

    void inserir(Cliente cli) throws PilhaCheiaException {
       if(topo < limite ){
            topo = topo + 1;
            vetor[topo] = cli;
       }else
           throw new PilhaCheiaException();
    }

    Cliente remover()throws PilhaVaziaException{
        Cliente cli;
        if(topo >=base)
        {
            cli = vetor[topo];
            vetor[topo] = null;
            topo = topo - 1;
            return cli;
        }else
            throw  new PilhaVaziaException();
    }
//
// public void Exibir() {
//            JOptionPane.showMessageDialog(null,"Pilha: \n");
//            for (int i=0; i<topo; i++)
//                JOptionPane.showMessageDialog(null,"Nome: "+vetor[i].getNome()
//                        +"\nTelefone: "+vetor[i].getTelefone());
//            }

    boolean vazia() {
        if(topo < base)
            return true;
        else
            return false;
    }
}


text:
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/list"
    android:scrollbars="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?drawer_background" />


text:
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Text.RegularExpressions;
using HelperSharp;

namespace BackupSharp
{
    /// <summary>
    /// Path helpers.
    /// </summary>
    public static class PathHelper
    {
        #region Fields
        private static Regex s_fixDirectorySeparatorRegex = new Regex(@"(/|\\)+", RegexOptions.Compiled);
        private static Regex s_removeDriveRegex = new Regex(@"[a-z]+:(/|\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes static members of the <see cref="PathHelper"/> class.
        /// </summary>
        [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline", Justification = "Is a property, not a field.")]
        static PathHelper()
        {
            DirectorySeparator = Path.DirectorySeparatorChar.ToString();
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets or sets the directory separator.
        /// </summary>
        public static string DirectorySeparator { get; set; }
        #endregion

        #region Methods
        /// <summary>
        /// Combines the paths.
        /// </summary>
        /// <param name="firstPath">The first path.</param>
        /// <param name="secondPath">The second path.</param>
        /// <returns>The path.</returns>
        public static string Combine(string firstPath, string secondPath)
        {
            var secondPathSanitized = s_removeDriveRegex.Replace(secondPath, string.Empty);
            var result = "{0}/{1}".With(firstPath, secondPathSanitized);
            result = s_fixDirectorySeparatorRegex.Replace(result, DirectorySeparator);

            return result;
        }

        /// <summary>
        /// Gets the full path.
        /// </summary>
        /// <param name="path">The partial path.</param>
        /// <returns>The full path.</returns>
        public static string GetFullPath(string path)
        {
            if (Path.IsPathRooted(path))
            {
                return path;
            }

            return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
        }

        /// <summary>
        /// Ensures the folder exists.
        /// </summary>
        /// <param name="path">The path.</param>
        public static void EnsureFolderExists(string path)
        {
            var folder = GetFolder(path);

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }
        }

        /// <summary>
        /// Ensures the clear folder.
        /// </summary>
        /// <param name="path">The folder path.</param>
        public static void EnsureClearFolder(string path)
        {
            var folder = GetFolder(path);

            if (Directory.Exists(folder))
            {
                Directory.Delete(folder, true);
            }

            Directory.CreateDirectory(folder);
        }

        private static string GetFolder(string path)
        {
            if (Path.HasExtension(path))
            {
                return Path.GetDirectoryName(path);
            }

            return path;
        }
        #endregion
    }
}


text:
angular.module('tableTennisTime',[])
.controller('Controller', function ($scope, $http, $timeout){
  $scope.game = {numPlayers: 1, matchType: 'singles'};
  $scope.status = 0;

  $scope.submit = function(game){
    Notification.requestPermission(function() {});
    $http.post('/match_requests', game).success(function(response){
      $scope.request_guid = response['guid'];
      $scope.status = 1;
      $scope.update($scope.request_guid);
    });
  };

  $scope.update = function(request_guid){
    $http.get('/match_requests/'+ request_guid).success(function(response){
      $scope.scheduled_guid = response['scheduledMatchGuid'];
      $scope.getMatchInfo($scope.scheduled_guid);
    }).error(function(){
      $timeout(function(){$scope.update(request_guid)}, 1000);
    });
  };

  var failMatch = function(){
    $scope.match = null;
    $scope.status = -1;
  };

  $scope.getMatchInfo = function(scheduledGuid){
    $http.get('/matches/' + scheduledGuid).success(function(response){
      if($scope.status < 2){
        new Notification('Match Found!', {
          body: response.teams[0].names + " vs. " + response.teams[1].names,
          icon: "/public/images/icon.png"
        });
      }
      $scope.status = 2;
      $scope.match = response;
      if(response.timeRemaining > 0 && response.scheduled === 0){
        $timeout(function(){$scope.getMatchInfo(scheduledGuid)}, 1000);
      } else if(response.timeRemaining < 1 && response.scheduled === 0) {
        failMatch();
      }
    }).error(function(){
      if($scope.match && !$scope.match.scheduled){
        failMatch();
      }
    });
  };

  $scope.acceptOrRejectMatch = function(scheduledGuid, requestGuid, wasAccepted){
    $scope.accepted = wasAccepted ? 1 : -1;
    $scope.acceptedOrRejected = 3;
    $http.put('/matches/' + scheduledGuid, {
      matchRequestGuid: requestGuid,
      accepted: wasAccepted
    });
  };
});


text:
> see https://aka.ms/autorest

This is the AutoRest configuration file for PowerBIDedicated.

---
## Getting Started
To build the SDK for PowerBIDedicated, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run:

> `autorest`

To see additional help and options, run:

> `autorest --help`
---

## Configuration

### Basic Information
These are the global settings for the PowerBIDedicated API.

``` yaml
openapi-type: arm
tag: package-2017-10-01
```

### Tag: package-2017-10-01

These settings apply only when `--tag=package-2017-10-01` is specified on the command line.

``` yaml $(tag) == 'package-2017-10-01'
input-file:
- Microsoft.PowerBIdedicated/stable/2017-10-01/powerbidedicated.json
```

---
# Code Generation

## C#

These settings apply only when `--csharp` is specified on the command line.
Please also specify `--csharp-sdks-folder=<path to "SDKs" directory of your azure-sdk-for-net clone>`.

``` yaml $(csharp)
csharp:
  azure-arm: true
  license-header: MICROSOFT_MIT_NO_VERSION
  namespace: Microsoft.Azure.Management.PowerBIDedicated
  output-folder: $(csharp-sdks-folder)/PowerBIDedicated/Management.PowerBIDedicated/Generated
  clear-output-folder: true
```

## Go

These settings apply only when `--go` is specified on the command line.

``` yaml $(go)
go:
  license-header: MICROSOFT_APACHE_NO_VERSION
  clear-output-folder: true
  namespace: powerbidedicated
```

### Tag: package-2017-10-01 and go

These settings apply only when `--tag=package-2017-10-01 --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

``` yaml $(tag)=='package-2017-10-01' && $(go)
output-folder: $(go-sdk-folder)/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated
```


text:
<?php

namespace IdeasBucket\QueueBundle\Connector;

use IdeasBucket\Common\Utils\ArrayHelper;
use IdeasBucket\QueueBundle\Exception\BadConnectionException;
use IdeasBucket\QueueBundle\Type\RedisQueue;
use Predis\Client;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Class RedisConnector
 *
 * @package IdeasBucket\QueueBundle\Connectors
 */
class RedisConnector implements ConnectorInterface
{
    /**
     * The Redis database instance.
     *
     * @var Client
     */
    protected $redis;

    /**
     * Create a new Redis queue connector instance.
     *
     * @param  Client  $redis
     */
    public function __construct(Client $redis = null)
    {
        $this->redis = $redis;
    }

    /**
     * Establish a queue connection.
     *
     * @param ContainerInterface $container
     * @param array              $config
     *
     * @throws BadConnectionException
     *
     * @return RedisQueue
     */
    public function connect(ContainerInterface $container, array $config)
    {
        if ($this->redis === null) {

            throw new BadConnectionException('Redis client not configured');
        }

        return (new RedisQueue(
            $this->redis,
            ArrayHelper::get($config, 'queue'),
            ArrayHelper::get($config, 'retry_after', 60)
        ))->setContainer($container);
    }

    /**
     * @inheritDoc
     */
    public function getName()
    {
        return 'redis';
    }

}


text:
<?php declare(strict_types=1);
namespace Imbo\Image\Transformation;

use Imagick;
use ImagickException;
use Imbo\Exception\TransformationException;
use Imbo\Http\Response\Response;

/**
 * Vignette transformation
 */
class Vignette extends Transformation
{
    /**
     * {@inheritdoc}
     */
    public function transform(array $params)
    {
        $inner  = $this->formatColor(isset($params['inner']) ? $params['inner'] : 'none');
        $outer  = $this->formatColor(isset($params['outer']) ? $params['outer'] : '000');
        $scale  = (float) max(isset($params['scale']) ? $params['scale'] : 1.5, 1);

        $image  = $this->image;
        $width  = $image->getWidth();
        $height = $image->getHeight();

        $scaleX = floor($width  * $scale);
        $scaleY = floor($height * $scale);

        $vignette = new Imagick();
        $vignette->newPseudoImage((int) $scaleX, (int) $scaleY, 'radial-gradient:' . $inner . '-' . $outer);
        $vignette->cropImage(
            $width,
            $height,
            (int) floor(($scaleX - $width)  / 2),
            (int) floor(($scaleY - $height) / 2),
        );

        try {
            $this->imagick->compositeImage($vignette, Imagick::COMPOSITE_MULTIPLY, 0, 0);
        } catch (ImagickException $e) {
            throw new TransformationException($e->getMessage(), Response::HTTP_BAD_REQUEST, $e);
        }

        $image->setHasBeenTransformed(true);
    }
}