text:
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;

namespace chrome {

namespace {

class BookmarkDragHelper;

// Generates a bookmark drag and drop chip image.
class BookmarkDragImageSource : public gfx::CanvasImageSource {
 public:
  // These DIP measurements come from the Bookmarks Drag Drop spec.
  static constexpr int kContainerWidth = 172;
  static constexpr int kContainerHeight = 40;
  static constexpr int kContainerRadius = kContainerHeight / 2;

  static constexpr int kIconContainerRadius = 12;
  static constexpr int kIconSize = 16;
  static constexpr int kTitlePadding = 12;

  static constexpr int kCountPadding = 5;
  static constexpr int kCountContainerRadius = 12;

  static constexpr gfx::Size kBookmarkDragImageSize =
      gfx::Size(kContainerWidth, kContainerHeight + kCountContainerRadius);

  static constexpr int kDragImageOffsetX = kContainerWidth / 2;
  static constexpr int kDragImageOffsetY = 0.9 * kContainerHeight;

  BookmarkDragImageSource(const ui::ColorProvider& color_provider,
                          const std::u16string& title,
                          const gfx::ImageSkia& icon,
                          size_t count)
      : gfx::CanvasImageSource(kBookmarkDragImageSize),
        color_provider_(color_provider),
        title_(title),
        icon_(icon),
        count_(count) {}

 private:
  // gfx::CanvasImageSource overrides:
  void Draw(gfx::Canvas* canvas) override {
    cc::PaintFlags paint_flags;
    paint_flags.setAntiAlias(true);

    // Draw background.
    gfx::RectF container_rect(0, kCountContainerRadius, kContainerWidth,
                              kContainerHeight);
    paint_flags.setColor(
        color_provider_->GetColor(kColorBookmarkDragImageBackground));
    canvas->DrawRoundRect(container_rect, kContainerRadius, paint_flags);

    // Draw icon container.
    paint_flags.setColor(
        color_provider_->GetColor(kColorBookmarkDragImageIconBackground));
    canvas->DrawCircle(
        gfx::PointF(kContainerRadius, kContainerRadius + kCountContainerRadius),
        kIconContainerRadius, paint_flags);

    // Draw icon image.
    canvas->DrawImageInt(
        icon_, kContainerRadius - kIconSize / 2,
        kContainerRadius + kIconContainerRadius - kIconSize / 2);

    // Draw bookmark title.
    gfx::FontList font_list = views::style::GetFont(
        views::style::CONTEXT_LABEL, views::style::STYLE_PRIMARY);
    gfx::Rect text_rect(kBookmarkDragImageSize);
    text_rect.Inset(gfx::Insets::TLBR(
        kCountContainerRadius,
        kContainerRadius + kIconContainerRadius + kTitlePadding, 0,
        kContainerRadius - kIconContainerRadius));
    canvas->DrawStringRectWithFlags(
        title_, font_list,
        color_provider_->GetColor(kColorBookmarkDragImageForeground), text_rect,
        gfx::Canvas::TEXT_ALIGN_LEFT);

    if (count_ <= 1)
      return;

    // Draw bookmark count if more than 1 bookmark is dragged.
    std::u16string count = base::NumberToString16(count_);
    std::unique_ptr<gfx::RenderText> render_text =
        gfx::RenderText::CreateRenderText();
    render_text->SetFontList(font_list);
    render_text->SetCursorEnabled(false);
    render_text->SetColor(
        color_provider_->GetColor(kColorBookmarkDragImageCountForeground));
    render_text->SetText(count);
    render_text->SetHorizontalAlignment(gfx::ALIGN_CENTER);

    // We measure the count text size to determine container width, as the
    // container is a rounded rect behind the text.
    int count_width = render_text->GetStringSize().width();
    int count_container_width =
        std::max(kCountContainerRadius * 2, count_width + 2 * kCountPadding);

    // Draw the count container.
    gfx::Rect count_container_rect(
        container_rect.right() - count_container_width, 0,
        count_container_width, kCountContainerRadius * 2);
    paint_flags.setColor(
        color_provider_->GetColor(kColorBookmarkDragImageCountBackground));
    canvas->DrawRoundRect(gfx::RectF(count_container_rect),
                          kCountContainerRadius, paint_flags);

    // Draw the count text.
    render_text->SetDisplayRect(count_container_rect);
    render_text->Draw(canvas);
  }

  const raw_ref<const ui::ColorProvider> color_provider_;
  const std::u16string title_;
  const gfx::ImageSkia icon_;
  const int count_;
};

constexpr gfx::Size BookmarkDragImageSource::kBookmarkDragImageSize;

// Helper class that takes a drag request, loads the icon from the bookmark
// model and then launches a system drag with a generated drag image.
// Owns itself.
class BookmarkDragHelper : public bookmarks::BaseBookmarkModelObserver {
 public:
  BookmarkDragHelper(const BookmarkDragHelper&) = delete;
  BookmarkDragHelper& operator=(const BookmarkDragHelper&) = delete;

  static base::WeakPtr<BookmarkDragHelper> Create(
      Profile* profile,
      const BookmarkDragParams& params,
      DoBookmarkDragCallback do_drag_callback) {
    base::WeakPtr<BookmarkDragHelper> ptr =
        (new BookmarkDragHelper(profile, params, std::move(do_drag_callback)))
            ->GetWeakPtr();

    ptr->Start(params.nodes.at(params.drag_node_index));
    return ptr;
  }

 private:
  BookmarkDragHelper(Profile* profile,
                     const BookmarkDragParams& params,
                     DoBookmarkDragCallback do_drag_callback)
      : model_(BookmarkModelFactory::GetForBrowserContext(profile)),
        count_(params.nodes.size()),
        web_contents_(params.web_contents->GetWeakPtr()),
        source_(params.source),
        start_point_(params.start_point),
        do_drag_callback_(std::move(do_drag_callback)),
        drag_data_(std::make_unique<ui::OSExchangeData>()) {
    observation_.Observe(model_.get());

    // Set up our OLE machinery.
    bookmarks::BookmarkNodeData bookmark_drag_data(params.nodes);
    bookmark_drag_data.Write(profile->GetPath(), drag_data_.get());

    operation_ = ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK;
    if (bookmarks::CanAllBeEditedByUser(model_->client(), params.nodes))
      operation_ |= ui::DragDropTypes::DRAG_MOVE;
  }

  void Start(const BookmarkNode* drag_node) {
    drag_node_id_ = drag_node->id();

    ui::ImageModel icon;
    if (drag_node->is_url()) {
      const gfx::Image& image = model_->GetFavicon(drag_node);
      // If favicon is not loaded, the above call will initiate loading, and
      // drag will proceed in BookmarkNodeFaviconChanged(). In rare cases,
      // BookmarkNodeFaviconChanged() will never be called (e.g unfortunate
      // bookmark deletion timing) and we intentionally leak at most one request
      // in these cases which will clean up next drag.
      if (!drag_node->is_favicon_loaded())
        return;

      icon = ui::ImageModel::FromImage(image);
    } else {
      icon = GetBookmarkFolderIcon(chrome::BookmarkFolderIconType::kNormal,
                                   ui::kColorMenuIcon);
    }

    OnBookmarkIconLoaded(drag_node, icon);
  }

  void OnBookmarkIconLoaded(const BookmarkNode* drag_node,
                            const ui::ImageModel& icon) {
    auto weak_this = GetWeakPtr();
    if (web_contents_) {
      const auto& color_provider = web_contents_->GetColorProvider();
      gfx::ImageSkia drag_image(
          std::make_unique<BookmarkDragImageSource>(
              color_provider, drag_node->GetTitle(),
              icon.IsEmpty() ? favicon::GetDefaultFavicon().AsImageSkia()
                             : icon.Rasterize(&color_provider),
              count_),
          BookmarkDragImageSource::kBookmarkDragImageSize);

      drag_data_->provider().SetDragImage(
          drag_image,
          gfx::Vector2d(BookmarkDragImageSource::kDragImageOffsetX,
                        BookmarkDragImageSource::kDragImageOffsetY));

      std::move(do_drag_callback_)
          .Run(std::move(drag_data_), web_contents_->GetNativeView(), source_,
               start_point_, operation_);
    }

    // The Run() call above could have spun a nested message loop resulting in
    // our deletion.  Be sure to avoid double-free.
    if (weak_this)
      delete this;
  }

  base::WeakPtr<BookmarkDragHelper> GetWeakPtr() {
    return weak_factory_.GetWeakPtr();
  }

  // bookmarks::BaseBookmarkModelObserver overrides:
  void BookmarkModelChanged() override {}

  void BookmarkModelBeingDeleted(BookmarkModel* model) override { delete this; }

  void BookmarkNodeFaviconChanged(BookmarkModel* model,
                                  const BookmarkNode* node) override {
    if (node->id() != drag_node_id_)
      return;

    const ui::ImageModel& image =
        ui::ImageModel::FromImage(model_->GetFavicon(node));
    DCHECK(node->is_favicon_loaded());

    OnBookmarkIconLoaded(node, image);
  }

  raw_ptr<BookmarkModel> model_;

  int64_t drag_node_id_ = -1;
  int count_;
  base::WeakPtr<content::WebContents> web_contents_;
  ui::mojom::DragEventSource source_;
  const gfx::Point start_point_;
  int operation_;

  DoBookmarkDragCallback do_drag_callback_;

  std::unique_ptr<ui::OSExchangeData> drag_data_;

  base::ScopedObservation<bookmarks::BookmarkModel,
                          bookmarks::BookmarkModelObserver>
      observation_{this};

  base::WeakPtrFactory<BookmarkDragHelper> weak_factory_{this};
};

void DoDragImpl(std::unique_ptr<ui::OSExchangeData> drag_data,
                gfx::NativeView native_view,
                ui::mojom::DragEventSource source,
                gfx::Point point,
                int operation) {
  // Allow nested run loop so we get DnD events as we drag this around.
  base::CurrentThread::ScopedAllowApplicationTasksInNativeNestedLoop allow;

  views::Widget* widget = views::Widget::GetWidgetForNativeView(native_view);
  if (widget) {
    widget->RunShellDrag(nullptr, std::move(drag_data), gfx::Point(), operation,
                         source);
  } else {
    views::RunShellDrag(native_view, std::move(drag_data), point, operation,
                        source);
  }
}

void DragBookmarksImpl(Profile* profile,
                       const BookmarkDragParams& params,
                       DoBookmarkDragCallback do_drag_callback) {
  DCHECK(!params.nodes.empty());
  static base::NoDestructor<base::WeakPtr<BookmarkDragHelper>> g_drag_helper;
  if (*g_drag_helper)
    delete g_drag_helper->get();

  DCHECK(!*g_drag_helper);

  // Cleaned up in
  // BookmarkDragHelper::BookmarkIconLoaded()/BookmarkModelBeingDeleted(), or
  // above when a new drag is initiated before the favicon loads.
  *g_drag_helper =
      BookmarkDragHelper::Create(profile, params, std::move(do_drag_callback));
}

}  // namespace

void DragBookmarks(Profile* profile, const BookmarkDragParams& params) {
  DragBookmarksImpl(profile, params, base::BindOnce(&DoDragImpl));
}

void DragBookmarksForTest(Profile* profile,
                          const BookmarkDragParams& params,
                          DoBookmarkDragCallback do_drag_callback) {
  DragBookmarksImpl(profile, params, std::move(do_drag_callback));
}

}  // namespace chrome


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Tasks;

/**
 * TasksSearch represents the model behind the search form about `app\models\Tasks`.
 */
class TasksSearch extends Tasks
{

    public $ownerUser;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'user_id', 'order_opencart_id', 'serial_number'], 'integer'],
            [['text', 'comment', 'date_added', 'date_start', 'date_end', 'date_closed','ownerUser'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Tasks::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $dataProvider->setSort([
            'attributes' => [
                'order_opencart_id',
                'serial_number',
                'text',
                'date_start',
                'date_end',
                'date_closed',
                'comment',
                'ownerUser' => [
                    'asc' => [
                        'userData.username' => SORT_ASC,
                    ],
                    'desc' => [
                        'userData.username' => SORT_DESC,
                    ],
                ],
            ],
            'enableMultiSort'=>true
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'user_id' => $this->user_id,
            'order_opencart_id' => $this->order_opencart_id,
            'serial_number' => $this->serial_number,
            'date_added' => $this->date_added,
            'date_start' => $this->date_start,
            'date_end' => $this->date_end,
            'date_closed' => $this->date_closed,
        ]);

        $query->andFilterWhere(['like', 'text', $this->text])
            ->andFilterWhere(['like', 'comment', $this->comment]);

//        $query->with('userData');

        $query->joinWith(['userData' => function ($q) {
                $q->where('userData.username LIKE "%' . $this->ownerUser . '%"');
            }]);

        return $dataProvider;
    }

    public function searchForManager($params) {
        $query = Tasks::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $dataProvider->setSort([
            'attributes' => [
                'order_opencart_id',
                'serial_number',
                'text',
                'date_start',
                'date_end',
                'date_closed',
                'comment',
                'ownerUser' => [
                    'asc' => [
                        'userData.username' => SORT_ASC,
                    ],
                    'desc' => [
                        'userData.username' => SORT_DESC,
                    ],
                ],
            ],
            'enableMultiSort'=>true
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
            'user_id' => Yii::$app->user->identity->id,
            'order_opencart_id' => $this->order_opencart_id,
            'serial_number' => $this->serial_number,
            'date_added' => $this->date_added,
            'date_start' => $this->date_start,
            'date_end' => $this->date_end,
            'date_closed' => $this->date_closed,
        ]);

        $query->andFilterWhere(['like', 'text', $this->text])
            ->andFilterWhere(['like', 'comment', $this->comment]);

        $query->with('orderData');

        $query->joinWith(['userData' => function ($q) {
                $q->where('userData.username LIKE "%' . $this->ownerUser . '%"');
            }]);

        return $dataProvider;
    }

}

redpajama_set_name: RedPajamaGithub


text:
#ifndef TALK_APP_WEBRTC_TEST_PEERCONNECTIONTESTWRAPPER_H_
#define TALK_APP_WEBRTC_TEST_PEERCONNECTIONTESTWRAPPER_H_

#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/app/webrtc/test/fakeaudiocapturemodule.h"
#include "talk/app/webrtc/test/fakeconstraints.h"
#include "talk/app/webrtc/test/fakevideotrackrenderer.h"
#include "webrtc/base/sigslot.h"
#include "webrtc/base/thread.h"

namespace webrtc {
class PortAllocatorFactoryInterface;
}

class PeerConnectionTestWrapper
    : public webrtc::PeerConnectionObserver,
      public webrtc::CreateSessionDescriptionObserver,
      public sigslot::has_slots<> {
 public:
  static void Connect(PeerConnectionTestWrapper* caller,
                      PeerConnectionTestWrapper* callee);

  explicit PeerConnectionTestWrapper(const std::string& name);
  virtual ~PeerConnectionTestWrapper();

  bool CreatePc(const webrtc::MediaConstraintsInterface* constraints);

  rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
      const std::string& label,
      const webrtc::DataChannelInit& init);

  // Implements PeerConnectionObserver.
  virtual void OnError() {}
  virtual void OnSignalingChange(
     webrtc::PeerConnectionInterface::SignalingState new_state) {}
  virtual void OnStateChange(
      webrtc::PeerConnectionObserver::StateType state_changed) {}
  virtual void OnAddStream(webrtc::MediaStreamInterface* stream);
  virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) {}
  virtual void OnDataChannel(webrtc::DataChannelInterface* data_channel);
  virtual void OnRenegotiationNeeded() {}
  virtual void OnIceConnectionChange(
      webrtc::PeerConnectionInterface::IceConnectionState new_state) {}
  virtual void OnIceGatheringChange(
      webrtc::PeerConnectionInterface::IceGatheringState new_state) {}
  virtual void OnIceCandidate(const webrtc::IceCandidateInterface* candidate);
  virtual void OnIceComplete() {}

  // Implements CreateSessionDescriptionObserver.
  virtual void OnSuccess(webrtc::SessionDescriptionInterface* desc);
  virtual void OnFailure(const std::string& error) {}

  void CreateOffer(const webrtc::MediaConstraintsInterface* constraints);
  void CreateAnswer(const webrtc::MediaConstraintsInterface* constraints);
  void ReceiveOfferSdp(const std::string& sdp);
  void ReceiveAnswerSdp(const std::string& sdp);
  void AddIceCandidate(const std::string& sdp_mid, int sdp_mline_index,
                       const std::string& candidate);
  void WaitForCallEstablished();
  void WaitForConnection();
  void WaitForAudio();
  void WaitForVideo();
  void GetAndAddUserMedia(
    bool audio, const webrtc::FakeConstraints& audio_constraints,
    bool video, const webrtc::FakeConstraints& video_constraints);

  // sigslots
  sigslot::signal1<std::string*> SignalOnIceCandidateCreated;
  sigslot::signal3<const std::string&,
                   int,
                   const std::string&> SignalOnIceCandidateReady;
  sigslot::signal1<std::string*> SignalOnSdpCreated;
  sigslot::signal1<const std::string&> SignalOnSdpReady;
  sigslot::signal1<webrtc::DataChannelInterface*> SignalOnDataChannel;

 private:
  void SetLocalDescription(const std::string& type, const std::string& sdp);
  void SetRemoteDescription(const std::string& type, const std::string& sdp);
  bool CheckForConnection();
  bool CheckForAudio();
  bool CheckForVideo();
  rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
      bool audio, const webrtc::FakeConstraints& audio_constraints,
      bool video, const webrtc::FakeConstraints& video_constraints);

  std::string name_;
  rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
      allocator_factory_;
  rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
  rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
      peer_connection_factory_;
  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
  rtc::scoped_ptr<webrtc::FakeVideoTrackRenderer> renderer_;
};

#endif  // TALK_APP_WEBRTC_TEST_PEERCONNECTIONTESTWRAPPER_H_


text:
<?php
	require_once('Conexion.php');

	class Facturas extends Conexion
	{
		public function getVenta($idVenta)
		{
			$sql = "SELECT V.idVenta,V.fecha,V.idCliente,C.nombreCliente,C.nit,C.direccion,M.nombreMunicipio,
					       D.nombreDepartamento,DV.idProducto,P.nombreProducto,P.codigoProducto,P.descripcion,
					       MP.nombreMarca,DV.cantidad,DV.precio,DV.costoTotal
					FROM ventas V
					INNER JOIN ventasdetalle DV ON V.idVenta = DV.idVenta
					INNER JOIN clientes C ON V.idCliente = C.idCliente
					INNER JOIN productos P ON DV.idProducto = P.idProducto
					INNER JOIN marcaproductos MP ON P.idMarca = MP.idMarca
					INNER JOIN municipio M ON C.idMunicipio = M.idMunicipio
					INNER JOIN departamento D ON M.idDepartamento = D.idDepartamento
					WHERE V.idVenta = $idVenta";

			$stmt = Conexion::Conectar()->prepare($sql);
			$stmt->execute();

			return $stmt->fetchAll();
			$stmt->close();
		}

		public function getNotaCredito($documentoCausoNotaCredito)
		{
			$sql = "SELECT N.idNotaCredito,N.fechaNotaCredito,V.idVenta,V.fecha,V.idCliente,C.nit,C.direccion,
						   M.nombreMunicipio,D.nombreDepartamento,VD.idProducto,P.nombreProducto,P.codigoProducto,
						   P.descripcion,MP.nombreMarca,
						   VD.cantidad,VD.precio,VD.costoTotal,C.nombreCliente
					FROM notasdecredito N
					INNER JOIN ventas V ON N.idVenta = V.idVenta
					INNER JOIN ventasdetalle VD ON V.idVenta = VD.idVenta
					INNER JOIN clientes C ON V.idCliente = C.idCliente
					INNER JOIN productos P ON VD.idProducto = P.idProducto
					INNER JOIN marcaproductos MP ON P.idMarca = MP.idMarca
					INNER JOIN municipio M ON C.idMunicipio = M.idMunicipio
					INNER JOIN departamento D ON M.idDepartamento = D.idDepartamento
					WHERE N.idVentaGeneroEsta = $documentoCausoNotaCredito";

			$stmt = Conexion::Conectar()->prepare($sql);
			$stmt->execute();

			return $stmt->fetchAll();
			$stmt->close();
		}

	}

	/*$r = new Facturas();
	echo json_encode($r->getNotaCredito(31));*/

 ?>


text:
<form [formGroup]="userform" (ngSubmit)="onSubmit(userform.value)">

          First Name *:

          <input pInputText type="text" formControlName="firstname" placeholder="Required" />

             Firstname is required

          Last Name *:

          <input pInputText type="text" formControlName="lastname" placeholder="Required" />

             Lastname is required

          Password *:

          <input pInputText type="password" formControlName="password" placeholder="Required - Min(6)" />

            Password is required
            Must be longer than 6 characters

          Description:

          <textarea pInputTextarea type="text" formControlName="description"></textarea>

          Gender *:

             Gender is required

          <button pButton type="submit" label="Submit" [disabled]="!userform.valid"></button>

        Form Submitted

 {{diagnostic}}

</form>


text:
package net.venaglia.nondairy.soylang.lexer.cupparser.structure.expr;

/**
 * Created by IntelliJ IDEA.
 * User: ed
 * Date: Jul 23, 2010
 * Time: 10:43:32 PM
 */
public class IntegerLiteralExpression extends LiteralExpression<Integer> {

    public IntegerLiteralExpression(int value) {
        super(value);
    }
}


text:
if (!us) var us = {};
if (!us.engy) us.engy = {};
if (!us.engy.rehostImage) us.engy.rehostImage = {};

us.engy.rehostImage.imageshackUploader = function(sourceFile, destinationFilename, mimeType, userName, password){
	this.sourceFile = sourceFile;
	this.destinationFilename = destinationFilename;
	this.mimeType = mimeType;
	this.userName = userName;
	this.password = password;
}

us.engy.rehostImage.imageshackUploader.prototype = {
	postUploader: null,
	uploadedImageUrl: null,
	apiKey: "PNHM3ZTRcfcb623a7775b5d6971b8eabd381a32e",

	executeTransfer: function () {
		var self = this;

		var options = {
			"api_key": this.apiKey,
			"user": this.userName,
			"password": this.password
		};

		var authRequest = new XMLHttpRequest();
		authRequest.open("POST", "https://api.imageshack.com/v2/user/login");
		authRequest.setRequestHeader("Content-Type", "application/json");
		authRequest.overrideMimeType("text/plain");
		authRequest.onload = function () {
			self.authCallback(this.responseText);
		};
		authRequest.onerror = function () {
			var riBundle = document.getElementById("us.engy.rehostImage.bundle");
			us.engy.rehostImage.main.reportCompletion(false, riBundle.getString("error.disconnected"));
		};
		authRequest.send(JSON.stringify(options));
	},

	authCallback: function(responseJson) {
		var responseObject = JSON.parse(responseJson);

		if (responseObject.error) {
			this.exitWithError(responseObject.error.error_message);
		} else {
			var options = {
				"api_key": this.apiKey,
				"auth_token": responseObject.result.auth_token
			};

			this.postUploader = new us.engy.rehostImage.postUploader(
				"https://api.imageshack.com/v2/images",
				this.sourceFile,
				this.destinationFilename,
				this.mimeType,
				"file",
				options,
				this.uploadCallback.bind(this));
			this.postUploader.executeTransfer();
		}
	},

	uploadCallback: function(request) {
		var responseJson = request.responseText;
		var responseObject = JSON.parse(responseJson);

		if (responseObject.error) {
			this.exitWithError(responseObject.error.error_message);
		} else {
			var imageObject = responseObject.result.images[0];
			this.uploadedImageUrl = imageObject.direct_link;
			if (this.uploadedImageUrl.indexOf("http://") !== 0 && this.uploadedImageUrl.indexOf("https://") !== 0) {
				this.uploadedImageUrl = "http://" + this.uploadedImageUrl;
			}

			us.engy.rehostImage.main.reportUploadSuccess();
		}
	},

	exitWithError: function(message) {
		us.engy.rehostImage.main.reportCompletion(false, message);
	}
}


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

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Gms.Maps;
using Android.Support.V4.App;
using Android.Gms.Maps.Model;

namespace MapsSample
{
    [Activity (Label = "Retain Map Demo")]
    public class RetainMapDemoActivity : FragmentActivity, IOnMapReadyCallback
    {
        protected override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            SetContentView (Resource.Layout.basic_demo);

            var mapFragment =
                (SupportMapFragment) SupportFragmentManager.FindFragmentById (Resource.Id.map);

            if (savedInstanceState == null) {
                // First incarnation of this activity.
                mapFragment.RetainInstance = true;
            }

            mapFragment.GetMapAsync (this);
        }

        public void OnMapReady(GoogleMap map)
        {
            map.AddMarker(new MarkerOptions().SetPosition (new LatLng(0, 0)).SetTitle ("Marker"));
        }
    }
}


text:
GOOGLE_DIFFS=vendor/intel/google_diffs/l_pdk/patches

PATCH="0003-OTA-cleanup-OSIP-specifics.patch"
FOLDER="build"
BACK_FOLDER=".." # must contain as many "../" than FOLDER has depth
if [ -f ${GOOGLE_DIFFS}/${FOLDER}/${PATCH} ]
then
  echo "Applying patch ${PATCH} from ${GOOGLE_DIFFS}/${FOLDER}"
  cd $FOLDER && git am ${BACK_FOLDER}/${GOOGLE_DIFFS}/${FOLDER}/${PATCH} && cd -
else
  echo "Could not find patch ${PATCH} from ${GOOGLE_DIFFS}/${FOLDER} : skipping"
fi


text:
namespace TotaMoviesRental.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class ChangeBirthdateToNull : DbMigration
    {
        public override void Up()
        {
            AlterColumn("dbo.Customers", "Birthdate", c => c.DateTime());
        }

        public override void Down()
        {
            AlterColumn("dbo.Customers", "Birthdate", c => c.DateTime(nullable: false));
        }
    }
}


text:
package jquants;

import static jquants.BinarySystem.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import org.junit.Test;

public class BinarySystemTest {
  @Test
  public void test() {
    assertThat(Yotta, is(Zetta * 1024d));
    assertThat(Zetta, is(Exa * 1024d));
    assertThat(Exa, is(Peta * 1024d));
    assertThat(Peta, is(Tera * 1024d));
    assertThat(Tera, is(Giga * 1024d));
    assertThat(Giga, is(Mega * 1024d));
    assertThat(Mega, is(Kilo * 1024d));
    assertThat(Kilo, is(1024d));
  }
}


text:
<!DOCTYPE HTML>

<title>EGLClientPixmapHI (LWJGL 3.1.0 - EGL)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2016-10-30">
<link rel="stylesheet" type="text/css" href="../../../javadoc.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Deprecated

Index

Prev Class

Next Class

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package org.lwjgl.egl

Class EGLClientPixmapHI

java.lang.Object

org.lwjgl.system.Pointer.Default

org.lwjgl.system.Struct

org.lwjgl.egl.EGLClientPixmapHI

All Implemented Interfaces:

java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class EGLClientPixmapHI
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource

Specifies the width, height, stride, format and memory pointer of the pixmap to be used by the function CreatePixmapSurfaceHI to
 create the PixmapSurface.

Member documentation

pData –
 pointer to a memory buffer allocated by the application that will contain the result of the drawing operations. It is up to the application to ensure
 that the buffer size corresponds to iHeight * iStride * sizeof(pixel).

iWidth – width of the buffer in pixels

iHeight –
 height of the buffer in pixels. The height of the buffer can be negative; in that case the result of the drawing operations will be vertically swapped.
 When positive, pData will point at the bottom-left corner of the image; when negative, to the top-left corner.

iStride – stride of the buffer, in pixels. It is important to note that each row of the buffer must start on 32-bit boundaries.

Layout

struct EGLClientPixmapHI {
    void * pData;
    EGLint iWidth;
    EGLint iHeight;
    EGLint iStride;
}

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
EGLClientPixmapHI.Buffer

An array of EGLClientPixmapHI structs.

Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

org.lwjgl.system.Pointer.Default

Field Summary

Fields

Modifier and Type
Field and Description

static int
SIZEOF

The struct size in bytes.

Fields inherited from interface org.lwjgl.system.Pointer

POINTER_SHIFT, POINTER_SIZE

Constructor Summary

Constructors

Constructor and Description

EGLClientPixmapHI(java.nio.ByteBuffer container)

Creates a EGLClientPixmapHI instance at the current position of the specified ByteBuffer container.

Method Summary

All Methods Static Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

static EGLClientPixmapHI
calloc()

Returns a new EGLClientPixmapHI instance allocated with memCalloc.

static EGLClientPixmapHI.Buffer
calloc(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with memCalloc.

static EGLClientPixmapHI
callocStack()

Returns a new EGLClientPixmapHI instance allocated on the thread-local MemoryStack and initializes all its bits to zero.

static EGLClientPixmapHI.Buffer
callocStack(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.

static EGLClientPixmapHI.Buffer
callocStack(int capacity,
           org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

static EGLClientPixmapHI
callocStack(org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI instance allocated on the specified MemoryStack and initializes all its bits to zero.

static EGLClientPixmapHI
create()

Returns a new EGLClientPixmapHI instance allocated with BufferUtils.

static EGLClientPixmapHI.Buffer
create(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with BufferUtils.

static EGLClientPixmapHI
create(long address)

Returns a new EGLClientPixmapHI instance for the specified memory address or null if the address is NULL.

static EGLClientPixmapHI.Buffer
create(long address,
      int capacity)

Create a EGLClientPixmapHI.Buffer instance at the specified memory.

int
iHeight()

Returns the value of the iHeight field.

EGLClientPixmapHI
iHeight(int value)

Sets the specified value to the iHeight field.

int
iStride()

Returns the value of the iStride field.

EGLClientPixmapHI
iStride(int value)

Sets the specified value to the iStride field.

int
iWidth()

Returns the value of the iWidth field.

EGLClientPixmapHI
iWidth(int value)

Sets the specified value to the iWidth field.

static EGLClientPixmapHI
malloc()

Returns a new EGLClientPixmapHI instance allocated with memAlloc.

static EGLClientPixmapHI.Buffer
malloc(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with memAlloc.

static EGLClientPixmapHI
mallocStack()

Returns a new EGLClientPixmapHI instance allocated on the thread-local MemoryStack.

static EGLClientPixmapHI.Buffer
mallocStack(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the thread-local MemoryStack.

static EGLClientPixmapHI.Buffer
mallocStack(int capacity,
           org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the specified MemoryStack.

static EGLClientPixmapHI
mallocStack(org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI instance allocated on the specified MemoryStack.

EGLClientPixmapHI
nset(long struct)

Unsafe version of set.

EGLClientPixmapHI
pData(java.nio.ByteBuffer value)

Sets the address of the specified ByteBuffer to the pData field.

java.nio.ByteBuffer
pData(int capacity)

Returns a ByteBuffer view of the data pointed to by the pData field.

EGLClientPixmapHI
set(java.nio.ByteBuffer pData,
   int iWidth,
   int iHeight,
   int iStride)

Initializes this struct with the specified values.

EGLClientPixmapHI
set(EGLClientPixmapHI src)

Copies the specified struct data to this struct.

int
sizeof()

Returns the sizeof(struct).

static void
validate(long struct)

Validates pointer members that should not be NULL.

static void
validate(long array,
        int count)

Calls EGLClientPixmapHI.validate(long) for each struct contained in the specified struct array.

Methods inherited from class org.lwjgl.system.Struct

clear, free

Methods inherited from class org.lwjgl.system.Pointer.Default

address, equals, hashCode, toString

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface org.lwjgl.system.NativeResource

close, free

Field Detail

SIZEOF

public static final int SIZEOF

The struct size in bytes.

Constructor Detail

EGLClientPixmapHI

public EGLClientPixmapHI(java.nio.ByteBuffer container)

Creates a EGLClientPixmapHI instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be
 visible to the struct instance and vice versa.

The created instance holds a strong reference to the container object.

Method Detail

sizeof

public int sizeof()

Description copied from class: org.lwjgl.system.Struct

Returns the sizeof(struct).

Specified by:

sizeof in class org.lwjgl.system.Struct

pData

public java.nio.ByteBuffer pData(int capacity)

Returns a ByteBuffer view of the data pointed to by the pData field.

Parameters:

capacity - the number of elements in the returned buffer

iWidth

public int iWidth()

Returns the value of the iWidth field.

iHeight

public int iHeight()

Returns the value of the iHeight field.

iStride

public int iStride()

Returns the value of the iStride field.

pData

public EGLClientPixmapHI pData(java.nio.ByteBuffer value)

Sets the address of the specified ByteBuffer to the pData field.

iWidth

public EGLClientPixmapHI iWidth(int value)

Sets the specified value to the iWidth field.

iHeight

public EGLClientPixmapHI iHeight(int value)

Sets the specified value to the iHeight field.

iStride

public EGLClientPixmapHI iStride(int value)

Sets the specified value to the iStride field.

set

public EGLClientPixmapHI set(java.nio.ByteBuffer pData,
                             int iWidth,
                             int iHeight,
                             int iStride)

Initializes this struct with the specified values.

nset

public EGLClientPixmapHI nset(long struct)

Unsafe version of set.

set

public EGLClientPixmapHI set(EGLClientPixmapHI src)

Copies the specified struct data to this struct.

Parameters:

src - the source struct

Returns:

this struct

malloc

public static EGLClientPixmapHI malloc()

Returns a new EGLClientPixmapHI instance allocated with memAlloc. The instance must be explicitly freed.

calloc

public static EGLClientPixmapHI calloc()

Returns a new EGLClientPixmapHI instance allocated with memCalloc. The instance must be explicitly freed.

create

public static EGLClientPixmapHI create()

Returns a new EGLClientPixmapHI instance allocated with BufferUtils.

create

public static EGLClientPixmapHI create(long address)

Returns a new EGLClientPixmapHI instance for the specified memory address or null if the address is NULL.

malloc

public static EGLClientPixmapHI.Buffer malloc(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters:

capacity - the buffer capacity

calloc

public static EGLClientPixmapHI.Buffer calloc(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters:

capacity - the buffer capacity

create

public static EGLClientPixmapHI.Buffer create(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated with BufferUtils.

Parameters:

capacity - the buffer capacity

create

public static EGLClientPixmapHI.Buffer create(long address,
                                              int capacity)

Create a EGLClientPixmapHI.Buffer instance at the specified memory.

Parameters:

address - the memory address

capacity - the buffer capacity

mallocStack

public static EGLClientPixmapHI mallocStack()

Returns a new EGLClientPixmapHI instance allocated on the thread-local MemoryStack.

callocStack

public static EGLClientPixmapHI callocStack()

Returns a new EGLClientPixmapHI instance allocated on the thread-local MemoryStack and initializes all its bits to zero.

mallocStack

public static EGLClientPixmapHI mallocStack(org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI instance allocated on the specified MemoryStack.

Parameters:

stack - the stack from which to allocate

callocStack

public static EGLClientPixmapHI callocStack(org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters:

stack - the stack from which to allocate

mallocStack

public static EGLClientPixmapHI.Buffer mallocStack(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the thread-local MemoryStack.

Parameters:

capacity - the buffer capacity

callocStack

public static EGLClientPixmapHI.Buffer callocStack(int capacity)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.

Parameters:

capacity - the buffer capacity

mallocStack

public static EGLClientPixmapHI.Buffer mallocStack(int capacity,
                                                   org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the specified MemoryStack.

Parameters:

stack - the stack from which to allocate

capacity - the buffer capacity

callocStack

public static EGLClientPixmapHI.Buffer callocStack(int capacity,
                                                   org.lwjgl.system.MemoryStack stack)

Returns a new EGLClientPixmapHI.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters:

stack - the stack from which to allocate

capacity - the buffer capacity

validate

public static void validate(long struct)

Validates pointer members that should not be NULL.

Parameters:

struct - the struct to validate

validate

public static void validate(long array,
                            int count)

Calls EGLClientPixmapHI.validate(long) for each struct contained in the specified struct array.

Parameters:

array - the struct array to validate

count - the number of structs in array

Skip navigation links

Package

Class

Deprecated

Index

Prev Class

Next Class

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright LWJGL. All Rights Reserved. License terms.


text:
package com.kyleruss.jsockchat.server.message;

import com.kyleruss.jsockchat.commons.message.AcceptFriendMsgBean;
import com.kyleruss.jsockchat.commons.message.RequestMessage;
import com.kyleruss.jsockchat.commons.message.ResponseMessage;
import com.kyleruss.jsockchat.server.core.UserManager;
import com.kyleruss.jsockchat.server.db.DBFriends;
import com.kyleruss.jsockchat.server.gui.AppResources;
import com.kyleruss.jsockchat.server.gui.LogMessage;
import com.kyleruss.jsockchat.server.gui.LoggingList;
import java.io.IOException;

public class AcceptFriendMessageHandler implements ServerMessageHandler
{
    @Override
    public void serverAction(RequestMessage request)
    {
        AcceptFriendMsgBean bean    =   (AcceptFriendMsgBean) request.getMessageBean();
        String source               =   request.getUserSource();
        boolean result              =   DBFriends.getInstance().respondToFriendRequest(bean);

        ResponseMessage response    =   new ResponseMessage(request);
        String responseMsg          =   result? "Successfully responded to pending request" : "Failed to respond to pending request";
        response.setStatus(result);
        response.setDescription(responseMsg);

        try
        {
            UserManager.getInstance().sendMessageToUser(source, response);

            if(result)
            {
                ResponseMessage senderResponse  =   new ResponseMessage(request);
                senderResponse.setStatus(true);
                senderResponse.setDescription(source + " has accepted your friend request");
                UserManager.getInstance().sendMessageToUser(bean.getFromUser(), senderResponse);
            }
        }
        catch(IOException e)
        {
            System.out.println("[AcceptFriendMessageHandler@serverAction]: " + e.getMessage());
        }

        if(result)
        {
            LoggingList.sendLogMessage(new LogMessage("[Friend response] User '" + source + "' has " + (bean.isAcceptRequest()? "accepted" : "declined") + " the friend request "
            + "from user '" + bean.getFromUser() + "'",
            AppResources.getInstance().getAddFriendImage()));
        }
    }
}


text:
<?php

namespace Phpml\NeuralNetwork;

use Phpml\Exception\InvalidArgumentException;
use Phpml\NeuralNetwork\Node\Neuron;
class Layer
{
    /**
     * @var Node[]
     */
    private $nodes = [];
    /**
     * @param int                     $nodesNumber
     * @param string                  $nodeClass
     * @param ActivationFunction|null $activationFunction
     *
     * @throws InvalidArgumentException
     */
    public function __construct($nodesNumber = 0, $nodeClass = Neuron::class, ActivationFunction $activationFunction = null)
    {
        if (!in_array(Node::class, class_implements($nodeClass))) {
            throw InvalidArgumentException::invalidLayerNodeClass();
        }
        for ($i = 0; $i < $nodesNumber; ++$i) {
            $this->nodes[] = $this->createNode($nodeClass, $activationFunction);
        }
    }
    /**
     * @param string                  $nodeClass
     * @param ActivationFunction|null $activationFunction
     *
     * @return Neuron
     */
    private function createNode($nodeClass, ActivationFunction $activationFunction = null)
    {
        if (Neuron::class == $nodeClass) {
            return new Neuron($activationFunction);
        }
        return new $nodeClass();
    }
    /**
     * @param Node $node
     */
    public function addNode(Node $node)
    {
        $this->nodes[] = $node;
    }
    /**
     * @return Node[]
     */
    public function getNodes()
    {
        return $this->nodes;
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';

import GameRound from './GameRound';

// Ignore the next line because react-router requires containers to be actual React Components
// eslint-disable-next-line react/prefer-stateless-function
export default class GameRoundContainer extends React.Component {
    render() {
        const { navigation } = this.props;
        const { numberOfPlayers, startingLifeTotal, stayAwake } = navigation.state.params;

        return (<GameRound
            navigation={navigation}
            numberOfPlayers={numberOfPlayers}
            startingLifeTotal={startingLifeTotal}
            stayAwake={stayAwake}
        />);
    }
}

GameRoundContainer.navigationOptions = {
    header: null,
};

GameRoundContainer.propTypes = {
    navigation: PropTypes.object.isRequired,
};


text:
@class DVTStackView_AppKitAutolayout, IDEDebuggerSpecifier, IDEWorkspaceTabController, NSArray, NSButton, NSButtonCell, NSImageView, NSMatrix, NSTextField, NSView, NSWindow;

@interface IDEAttachToProcessSheet : DVTViewController
{
    IDEWorkspaceTabController *_workspaceTabController;
    id <IDEAttachToProcessSheetDelegate> _delegate;
    NSArray *_debuggerSpecifiers;
    IDEDebuggerSpecifier *_selectedDebuggerSpecifier;
    unsigned int _debugProcessAsUID;
    NSButton *_attachButton;
    NSButton *_cancelButton;
    NSWindow *_sheetWindow;
    NSTextField *_pidTextField;
    NSImageView *_invalidPIDImage;
    NSImageView *_applicationImage;
    NSView *_debuggerSlice;
    NSView *_debugProcessAsSlice;
    DVTStackView_AppKitAutolayout *_slicesStackView;
    NSMatrix *_debugProcessAsMatrix;
    NSButtonCell *_debugProcessAsMeButtonCell;
    NSTextField *_debugProcessAsRootText;
}

+ (void)showAttachToProcessSheetForWorkspaceTabController:(id)arg1 delegate:(id)arg2;
@property unsigned int debugProcessAsUID; // @synthesize debugProcessAsUID=_debugProcessAsUID;
@property(readonly) IDEDebuggerSpecifier *selectedDebuggerSpecifier; // @synthesize selectedDebuggerSpecifier=_selectedDebuggerSpecifier;
@property(readonly) NSArray *debuggerSpecifiers; // @synthesize debuggerSpecifiers=_debuggerSpecifiers;
- (void).cxx_destruct;
- (void)_rememberEnteredProcessNameIfNecessary;
- (void)_rememberDebugProcessAsSelection;
- (void)_sheetDidEnd;
- (void)_attachToProcessUsingProcessInformations:(id)arg1;
- (void)attachToProcess:(id)arg1;
- (void)cancel:(id)arg1;
- (void)_showAttachToProcessSheet;
- (void)_updateUIBasedOnPIDTextFieldAfterDelay;
- (void)_updateUIBasedOnPIDTextFieldUsingProcessInformations:(id)arg1;
- (void)_updateUIBasedOnPIDTextField;
- (id)_processInformationForProcessName:(id)arg1 processInformations:(id)arg2;
- (id)_processInformationForUserEnteredText:(id)arg1;
- (id)_processInformationForPID:(int)arg1 processInformations:(id)arg2;
- (void)setSelectedDebuggerSpecifier:(id)arg1;
- (void)primitiveInvalidate;
- (void)loadView;
- (void)_setupDebugProcessAsSlice;
- (BOOL)_supportsDebugAs;
- (id)_initWithWorkspaceTabControler:(id)arg1 delegate:(id)arg2;

@end


text:
class TString;
class TF1;
class TH1F;
class TH2F;
class TH3F;
class AliRhoParameter;

#include "AliAnalysisTaskEmcalJet.h"

class AliAnalysisTaskRhoBase : public AliAnalysisTaskEmcalJet {
 public:
  AliAnalysisTaskRhoBase();
  AliAnalysisTaskRhoBase(const char *name, Bool_t histo=kFALSE);
  virtual ~AliAnalysisTaskRhoBase() {}

  void                   UserCreateOutputObjects();

  void                   SetOutRhoName(const char *name)                       { fOutRhoName           = name    ;
                                                                                fOutRhoScaledName     = Form("%s_Scaled",name);     }
  void                   SetCompareRhoName(const char *name)                   { fCompareRhoName       = name    ;                   }
  void                   SetCompareRhoScaledName(const char *name)             { fCompareRhoScaledName = name    ;                   }
  void                   SetScaleFunction(TF1* sf)                             { fScaleFunction        = sf      ;                   }
  void                   SetRhoFunction(TF1* rf)                               { fRhoFunction          = rf      ;                   }
  TF1*                   LoadRhoFunction(const char* path, const char* name);
  void                   SetInEventSigmaRho(Double_t s)                        { fInEventSigmaRho      = s       ;                   }
  void                   SetAttachToEvent(Bool_t a)                            { fAttachToEvent        = a       ;                   }
  void                   SetSmallSystem(Bool_t setter = kTRUE)                 { fIsPbPb               = !setter ;                   }

  const char*            GetOutRhoName() const                                 { return fOutRhoName.Data()       ;                   }
  const char*            GetOutRhoScaledName() const                           { return fOutRhoScaledName.Data() ;                   }

 protected:
  void                   ExecOnce();
  Bool_t                 Run();
  Bool_t                 FillHistograms();

  virtual Double_t       GetRhoFactor(Double_t cent);
  virtual Double_t       GetScaleFactor(Double_t cent);

  TString                fOutRhoName;                    // name of output rho object
  TString                fOutRhoScaledName;              // name of output scaled rho object
  TString                fCompareRhoName;                // name of rho object to compare
  TString                fCompareRhoScaledName;          // name of scaled rho object to compare
  TF1                   *fRhoFunction;                   // pre-computed rho as a function of centrality
  TF1                   *fScaleFunction;                 // pre-computed scale factor as a function of centrality
  Double_t               fInEventSigmaRho;               // in-event sigma rho
  Bool_t                 fAttachToEvent;                 // whether or not attach rho to the event objects list
  Bool_t                 fIsPbPb;                        // different histogram ranges for pp/pPb and PbPb

  AliRhoParameter       *fOutRho;                        //!output rho object
  AliRhoParameter       *fOutRhoScaled;                  //!output scaled rho object
  AliRhoParameter       *fCompareRho;                    //!rho object to compare
  AliRhoParameter       *fCompareRhoScaled;              //!scaled rho object to compare

  TH2F                  *fHistJetPtvsCent;               //!jet pt vs. centrality
  TH2F                  *fHistJetAreavsCent;             //!jet area vs. centrality
  TH2F                  *fHistJetRhovsCent;              //!jet pt/area vs. centrality
  TH2F                  *fHistNjetvsCent;                //!no. of jets vs. centrality
  TH2F                  *fHistJetPtvsNtrack;             //!jet pt vs. no. of tracks
  TH2F                  *fHistJetAreavsNtrack;           //!jet area vs. no. of tracks
  TH2F                  *fHistNjetvsNtrack;              //!no. of jets vs. no. of tracks
  TH2F                  *fHistNjUEoverNjVsNj[12];        //!ratio no. of jets below rho*A+sigma_rho over. no. of jets vs. no. of jets
  TH2F                  *fHistJetNconstVsPt[4];          //!jet no. of constituents vs. pt
  TH2F                  *fHistJetRhovsEta[4];               //!rho vs. eta
  TH2F                  *fHistRhovsCent;                 //!rho vs. centrality
  TH2F                  *fHistRhoScaledvsCent;           //!rhoscaled vs. centrality
  TH2F                  *fHistDeltaRhovsCent;            //!delta rho vs. centrality
  TH2F                  *fHistDeltaRhoScalevsCent;       //!delta rhoscaled vs. centrality

  TH3F                  *fHistRhovsNtrackvsV0Mult;       //!rho vs. no. of tracks vs V0mult
  TH3F                  *fHistRhoScaledvsNtrackvsV0Mult; //!rhoscaled vs. no. of tracks vs V0mult
  TH2F                  *fHistDeltaRhovsNtrack;          //!delta rho vs. no. of tracks
  TH2F                  *fHistDeltaRhoScalevsNtrack;     //!delta rho scaled vs. no. of tracks

  TH2F                  *fHistRhovsNcluster;             //!rho vs. no. of clusters
  TH2F                  *fHistRhoScaledvsNcluster;       //!rhoscaled vs. no. of clusters

  AliAnalysisTaskRhoBase(const AliAnalysisTaskRhoBase&);             // not implemented
  AliAnalysisTaskRhoBase& operator=(const AliAnalysisTaskRhoBase&);  // not implemented

  ClassDef(AliAnalysisTaskRhoBase, 11); // Rho base task
};
#endif


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jdbi.v3.sqlobject.config.internal;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.stream.Stream;

import org.jdbi.v3.core.config.ConfigRegistry;
import org.jdbi.v3.sqlobject.config.Configurer;
import org.jdbi.v3.sqlobject.config.RegisterRowMappers;

public class RegisterRowMappersImpl implements Configurer {
    @Override
    public void configureForMethod(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType, Method method) {
        configureForType(registry, annotation, sqlObjectType);
    }

    @Override
    public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
        Configurer delegate = new RegisterRowMapperImpl();

        RegisterRowMappers registerRowMappers = (RegisterRowMappers) annotation;
        Stream.of(registerRowMappers.value()).forEach(anno -> delegate.configureForType(registry, anno, sqlObjectType));
    }
}


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

<title>T-Index</title>
<meta name="date" content="2021-01-31">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

T

TableRow - Interface in asj.data

tangentCircleCenterNext1 - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleCenterNext1 - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleCenterNext2 - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleCenterNext2 - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleCenterPrevious1 - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleCenterPrevious1 - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleCenterPrevious2 - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleCenterPrevious2 - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleRadiusNext - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleRadiusNext - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleRadiusNextCos - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleRadiusNextCos - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleRadiusPrevious - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleRadiusPrevious - Variable in class IK.floatIK.AbstractLimitCone

tangentCircleRadiusPreviousCos - Variable in class IK.doubleIK.AbstractLimitCone

tangentCircleRadiusPreviousCos - Variable in class IK.floatIK.AbstractLimitCone

target - Variable in class math.doubleV.QCP

target - Variable in class math.floatV.QCP

TAU - Static variable in class IK.doubleIK.AbstractKusudama

TAU - Static variable in class IK.floatIK.AbstractKusudama

THREEHALF_PI - Static variable in class math.doubleV.MathUtils

toDegrees(float) - Static method in class math.floatV.MathUtils

toggle() - Method in class IK.doubleIK.AbstractIKPin

toggle() - Method in class IK.floatIK.AbstractIKPin

toggleAxialLimits() - Method in class IK.doubleIK.AbstractKusudama

toggleAxialLimits() - Method in class IK.floatIK.AbstractKusudama

toggleOrientationalLimits() - Method in class IK.doubleIK.AbstractKusudama

toggleOrientationalLimits() - Method in class IK.floatIK.AbstractKusudama

togglePin() - Method in class IK.doubleIK.AbstractBone

Creates / enables a pin if there no pin is active, disables the pin if it is active.

togglePin() - Method in class IK.floatIK.AbstractBone

Creates / enables a pin if there no pin is active, disables the pin if it is active.

toJSON() - Method in class asj.data.DoubleDict

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.DoubleList

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.FloatDict

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.FloatList

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.IntDict

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.IntList

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.LongDict

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.LongList

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.StringDict

Return this dictionary as a String in JSON format.

toJSON() - Method in class asj.data.StringList

Return this dictionary as a String in JSON format.

toJsonArray() - Method in class math.doubleV.Rot

toJSONArray() - Method in class math.doubleV.SGVec_3d

toJsonArray() - Method in class math.floatV.Rot

toJSONArray() - Method in class math.floatV.SGVec_3f

toJSONObject() - Method in interface asj.CanLoad

toJSONObject() - Method in class math.doubleV.sgRayd

toJSONObject() - Method in class math.doubleV.SGVec_3d

toJSONObject() - Method in class math.floatV.sgRayf

toJSONObject() - Method in class math.floatV.SGVec_3f

toMatrix4Val() - Method in class math.doubleV.MRotation

Get an array representing the 4X4 matrix corresponding to this rotation instance.

toMatrix4Val(double[], boolean) - Method in class math.doubleV.MRotation

Get an array representing the 4X4 matrix corresponding to this rotation instance.

toMatrix4Val() - Method in class math.floatV.MRotation

Get an array representing the 4X4 matrix corresponding to this rotation instance.

toMatrix4Val(float[], boolean) - Method in class math.floatV.MRotation

Get an array representing the 4X4 matrix corresponding to this rotation instance.

TOO_LARGE_CUTOFF_SINGULAR_VALUE - Static variable in class numerical.Precision.LocalizedFormats

TOO_LARGE_TOURNAMENT_ARITY - Static variable in class numerical.Precision.LocalizedFormats

TOO_MANY_ELEMENTS_TO_DISCARD_FROM_ARRAY - Static variable in class numerical.Precision.LocalizedFormats

TOO_MANY_REGRESSORS - Static variable in class numerical.Precision.LocalizedFormats

TOO_SMALL_COST_RELATIVE_TOLERANCE - Static variable in class numerical.Precision.LocalizedFormats

TOO_SMALL_INTEGRATION_INTERVAL - Static variable in class numerical.Precision.LocalizedFormats

TOO_SMALL_ORTHOGONALITY_TOLERANCE - Static variable in class numerical.Precision.LocalizedFormats

TOO_SMALL_PARAMETERS_RELATIVE_TOLERANCE - Static variable in class numerical.Precision.LocalizedFormats

TOP - Static variable in interface asj.data.Constants

toRadians(float) - Static method in class math.floatV.MathUtils

toString() - Method in class asj.data.DoubleDict

toString() - Method in class asj.data.DoubleList

toString() - Method in class asj.data.FloatDict

toString() - Method in class asj.data.FloatList

toString() - Method in class asj.data.IntDict

toString() - Method in class asj.data.IntList

toString() - Method in class asj.data.JSONArray

Return the JSON data formatted with two spaces for indents.

toString() - Method in class asj.data.JSONObject

Return the JSON data formatted with two spaces for indents.

toString() - Method in class asj.data.LongDict

toString() - Method in class asj.data.LongList

toString() - Method in class asj.data.StringDict

toString() - Method in class asj.data.StringList

toString() - Method in class IK.doubleIK.AbstractBone

toString() - Method in class IK.floatIK.AbstractBone

toString() - Method in class math.doubleV.AbstractAxes

toString() - Method in class math.doubleV.AbstractBasis

toString() - Method in class math.doubleV.MRotation

toString() - Method in class math.doubleV.Rot

toString() - Method in class math.doubleV.RotationOrder

Get a string representation of the instance.

toString() - Method in class math.doubleV.sgRayd

toString() - Method in class math.doubleV.Vec3d

Converts this Vector3 to a string in the format (x,y,z).

toString() - Method in class math.floatV.AbstractAxes

toString() - Method in class math.floatV.AbstractBasis

toString() - Method in class math.floatV.MRotation

toString() - Method in class math.floatV.Rot

toString() - Method in class math.floatV.RotationOrder

Get a string representation of the instance.

toString() - Method in class math.floatV.sgRayf

toString() - Method in class math.floatV.Vec3f

Converts this Vector3 to a string in the format (x,y,z).

toTau(double) - Method in class IK.doubleIK.AbstractKusudama

toTau(float) - Method in class IK.floatIK.AbstractKusudama

toVec3f() - Method in class math.doubleV.SGVec_3d

toVec3f() - Method in interface math.doubleV.Vecd

toVec3f() - Method in class math.floatV.SGVec_3f

toVec3f() - Method in interface math.floatV.Vecf

transferToParent(AbstractAxes) - Method in class math.doubleV.AbstractAxes

unregisters this AbstractAxes from its current parent and
 registers it to a new parent without changing its global position or orientation
 when doing so.

transferToParent(AbstractAxes) - Method in class math.floatV.AbstractAxes

unregisters this AbstractAxes from its current parent and
 registers it to a new parent without changing its global position or orientation
 when doing so.

translate - Variable in class math.doubleV.AbstractBasis

a vector respresnting the translation of this basis relative to its parent.

translate(V, V[]) - Static method in class math.doubleV.QCP

translate - Variable in class math.floatV.AbstractBasis

a vector respresnting the translation of this basis relative to its parent.

translate(V, V[]) - Static method in class math.floatV.QCP

translateBy(V) - Method in class math.doubleV.AbstractBasis

translateBy(V) - Method in class math.doubleV.sgRayd

translateBy(V) - Method in class math.floatV.AbstractBasis

translateBy(V) - Method in class math.floatV.sgRayf

translateBy_(Vec3d<?>) - Method in class IK.doubleIK.AbstractIKPin

translates the pin to the location specified in local coordinates
 (relative to any other Axes objects the pin may be parented to)

translateBy_(Vec3f<?>) - Method in class IK.floatIK.AbstractIKPin

translates the pin to the location specified in local coordinates
 (relative to any other Axes objects the pin may be parented to)

translateByGlobal(Vec3d<?>) - Method in class math.doubleV.AbstractAxes

translateByGlobal(Vec3f<?>) - Method in class math.floatV.AbstractAxes

translateByLocal(V) - Method in class math.doubleV.AbstractAxes

translateByLocal(V) - Method in class math.floatV.AbstractAxes

translateTipTo(SGVec_3d) - Method in class math.doubleV.sgRayd

translateTipTo(SGVec_3f) - Method in class math.floatV.sgRayf

translateTo(Vec3d<?>, boolean) - Method in class math.doubleV.AbstractAxes

translateTo(Vec3d<?>) - Method in class math.doubleV.AbstractAxes

translateTo(V) - Method in class math.doubleV.AbstractBasis

translateTo(SGVec_3d) - Method in class math.doubleV.sgRayd

translateTo(Vec3f<?>, boolean) - Method in class math.floatV.AbstractAxes

translateTo(Vec3f<?>) - Method in class math.floatV.AbstractAxes

translateTo(V) - Method in class math.floatV.AbstractBasis

translateTo(SGVec_3f) - Method in class math.floatV.sgRayf

translateTo_(Vec3d<?>) - Method in class IK.doubleIK.AbstractIKPin

translates the pin to the location specified in global coordinates

translateTo_(Vec3f<?>) - Method in class IK.floatIK.AbstractIKPin

translates the pin to the location specified in global coordinates

translateToArmatureLocal_(Vec3d<?>) - Method in class IK.doubleIK.AbstractIKPin

translates the pin to the location specified in Armature coordinates
 (in other words, relative to whatever coordinate frame the armature itself is specified in)

translateToArmatureLocal_(Vec3f<?>) - Method in class IK.floatIK.AbstractIKPin

translates the pin to the location specified in Armature coordinates
 (in other words, relative to whatever coordinate frame the armature itself is specified in)

translator(float, PGA3D) - Static method in class math.pga.PGA3D

a rotation around the given line by the given angle (equivalent to dual exponentiation)

TRIANGLE - Static variable in interface asj.data.Constants

TRIANGLE_FAN - Static variable in interface asj.data.Constants

TRIANGLE_STRIP - Static variable in interface asj.data.Constants

TRIANGLES - Static variable in interface asj.data.Constants

triArea2D(double, double, double, double, double, double) - Static method in class math.doubleV.sgRayd

triArea2D(float, float, float, float, float, float) - Static method in class math.floatV.sgRayf

trim(String) - Static method in class asj.data.StringFuncs

( begin auto-generated from trim.xml )

 Removes whitespace characters from the beginning and end of a String.

trim(String[]) - Static method in class asj.data.StringFuncs

TRUST_REGION_STEP_FAILED - Static variable in class numerical.Precision.LocalizedFormats

TWO_OR_MORE_CATEGORIES_REQUIRED - Static variable in class numerical.Precision.LocalizedFormats

TWO_OR_MORE_VALUES_IN_CATEGORY_REQUIRED - Static variable in class numerical.Precision.LocalizedFormats

TypeIdentifier - Class in asj

TypeIdentifier(Object, Object) - Constructor for class asj.TypeIdentifier

A hack to get around Java type erasure.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
package andy.zhu.android.eleganceinterpolator.demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import andy.zhu.android.eleganceinterpolator.AccDecInterpolator;

public class MainActivity extends AppCompatActivity {

    private InterpolatorView mInterpolatorView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mInterpolatorView = (InterpolatorView) findViewById(R.id.interpolator_view);
        mInterpolatorView.setInterpolator(new AccDecInterpolator());
    }
}


text:
namespace dp
{
class HWTextureAllocator;

class HWTexture
{
public:
  HWTexture();
  virtual ~HWTexture();

  struct Params
  {
    Params()
      : m_filter(gl_const::GLLinear)
      , m_wrapSMode(gl_const::GLClampToEdge)
      , m_wrapTMode(gl_const::GLClampToEdge)
      , m_format(UNSPECIFIED)
      , m_usePixelBuffer(false)
    {}

    uint32_t m_width;
    uint32_t m_height;
    glConst m_filter;
    glConst m_wrapSMode;
    glConst m_wrapTMode;
    TextureFormat m_format;
    bool m_usePixelBuffer;

    ref_ptr<HWTextureAllocator> m_allocator;
  };

  void Create(Params const & params);
  virtual void Create(Params const & params, ref_ptr<void> data) = 0;
  virtual void UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height,
                          ref_ptr<void> data) = 0;

  void Bind() const;

  // Texture must be bound before calling this method.
  void SetFilter(glConst filter);

  TextureFormat GetFormat() const;
  uint32_t GetWidth() const;
  uint32_t GetHeight() const;
  float GetS(uint32_t x) const;
  float GetT(uint32_t y) const;

  uint32_t GetID() const;

protected:
  void UnpackFormat(TextureFormat format, glConst & layout, glConst & pixelType);

  uint32_t m_width;
  uint32_t m_height;
  TextureFormat m_format;
  uint32_t m_textureID;
  glConst m_filter;
  uint32_t m_pixelBufferID;
  uint32_t m_pixelBufferSize;
  uint32_t m_pixelBufferElementSize;
};

class HWTextureAllocator
{
public:
  virtual ~HWTextureAllocator() {}

  virtual drape_ptr<HWTexture> CreateTexture() = 0;
  virtual void Flush() = 0;
};

class OpenGLHWTexture : public HWTexture
{
  using TBase = HWTexture;

public:
  ~OpenGLHWTexture();
  void Create(Params const & params, ref_ptr<void> data) override;
  void UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height,
                  ref_ptr<void> data) override;
};

class OpenGLHWTextureAllocator : public HWTextureAllocator
{
public:
  drape_ptr<HWTexture> CreateTexture() override;
  void Flush() override {}
};

ref_ptr<HWTextureAllocator> GetDefaultAllocator();
drape_ptr<HWTextureAllocator> CreateAllocator();
}  // namespace dp


text:
<?php
$config = array (
	'Elfinder' => array (
		'title' => __('Elfinder File Manager'),
		'width' => 900,
		'height' => 500,
		'resizable' => 'yes',

/**
 *
 * for urls
 * before cake 2.4 use FULL_BASE_URL
 * starting cake 2.4 Router::fullbaseUrl()
 *
 * window_url - the url by which the elfinder window is called
 * if we set 'window_url' => Router::fullbaseUrl().'/posts/elfinderWindow',
 *  		 'connector_url' => Router::fullbaseUrl().'/posts/elfinderConnector',
 * than we should create actions elfinderWindow and elfinderConnector in posts controller like this
 * public function elfinderWindow() {
 * 		$this->TinymceElfinder->elfinder();
 * }
 * public function elfinderConnector() {
 * 		$this->TinymceElfinder->connector();
 * }
 *
 */
		'window_url' => Router::fullbaseUrl().'/ConfigurationsController/elfinder',		// call elfinder window
		'connector_url' => Router::fullbaseUrl().'/ConfigurationsController/connector',	// connect to retrive files
		'locale' => 'en',

/**
 * for full list of options as well as documentation
 * visit https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
 *
 */
		'options' => array(
			//'debug' => true,
			'roots' => array(
				array(
					'driver'        => 'LocalFileSystem',   					// driver for accessing file system (REQUIRED)
					'URL'   		=> Router::fullbaseUrl().'/img/Uploads',	// upload main folder
					'path'          => IMAGES.'Uploads',        				// path to files (REQUIRED)
					'accessControl' => 'access',            					// disable and hide dot starting files (OPTIONAL)
					'attributes' => array(
						array(
							'pattern' => '!\.html$!',
							'hidden' => true
						)
					),
					'tmbPath' => 'tumbnails',
					'uploadOverwrite' => false,
				)
			)

		)
	)
);


text:
""" A drag drawn polygon. """

from __future__ import with_statement

from enable.primitives.api import Polygon
from enable.api import Pointer
from pyface.action.api import MenuManager
from traits.api import Delegate, Instance

from drawing_tool import DrawingTool

class DragPolygon(DrawingTool):
    """ A drag drawn polygon. """

    poly = Instance(Polygon, args=())

    draw_mode = "overlay"

    #### Visible style. ####

    # Override the vertex color so as to not draw it.
    vertex_color = Delegate('poly', modify=True)

    # Override the vertex size so as to not draw it.
    vertex_size = Delegate('poly', modify=True)

    background_color = Delegate('poly', modify=True)

    #### Pointers. ####

    # Pointer for the complete state.
    complete_pointer = Pointer('cross')

    # Pointer for the drawing state.
    drawing_pointer = Pointer('cross')

    # Pointer for the normal state.
    normal_pointer = Pointer('cross')

    #### Miscellaneous. ####

    # The context menu for the polygon.
    menu = Instance(MenuManager)

    def reset(self):
        self.vertex_color = (0,0,0,0)
        self.vertex_size = 0
        self.poly.model.points = []
        self.event_state = "normal"
        return

    ###########################################################################
    # 'Component' interface.
    ###########################################################################

    #### 'complete' state #####################################################

    def complete_draw ( self, gc ):
        """ Draw the completed polygon. """
        with gc:
            self.poly.border_dash = None
            self.poly._draw_closed(gc)
        return

    def complete_left_down ( self, event ):
        """ Draw a new polygon. """
        self.reset()
        self.normal_left_down( event )
        return

    def complete_right_down ( self, event ):
        """ Do the context menu if available. """
        if self.menu is not None:
            if self._is_in((event.x + self.x, event.y - self.y)):
                menu = self.menu.create_menu(event.window.control)
                ### FIXME : The call to _flip_y is necessary but inappropriate.
                menu.show(event.x, event.window._flip_y(event.y))
        return

    #### 'drawing' state ######################################################

    def drawing_draw ( self, gc ):
        """ Draw the polygon while in 'drawing' state. """

        with gc:
            self.poly.border_dash = (4.0, 2.0)
            self.poly._draw_open(gc)
        return

    def drawing_left_up ( self, event ):
        """ Handle the left mouse button coming up in 'drawing' state. """

        self.event_state = 'complete'
        self.pointer = self.complete_pointer

        self.request_redraw()

        self.complete = True

        return

    def drawing_mouse_move ( self, event ):
        """ Handle the mouse moving in 'drawing' state. """

        last_point = self.poly.model.points[-1]

        # If we have moved, we need to add a point.
        if last_point != (event.x + self.x, event.y - self.y):
            self.poly.model.points.append((event.x + self.x, event.y - self.y))
            self.request_redraw()

        return

    #### 'normal' state #######################################################

    def normal_left_down ( self, event ):
        """ Handle the left button down in the 'normal' state. """

        self.poly.model.points.append((event.x + self.x, event.y - self.y))

        self.event_state = 'drawing'
        self.pointer = self.drawing_pointer

        self.request_redraw()

        return

    def normal_mouse_move ( self, event ):
        """ Handle the mouse moving in the 'normal' state. """

        self.pointer = self.normal_pointer

        return

#### EOF ######################################################################