text:
package org.jivesoftware.smack.filter;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza;

import org.jxmpp.jid.DomainBareJid;
import org.jxmpp.jid.EntityFullJid;
import org.jxmpp.jid.Jid;

/**
 * Filters for packets which are a valid reply to an IQ request.
 *

 * Such a stanza must have the same stanza id and must be an IQ stanza of type
 * RESULT or ERROR. Moreover, it is necessary to check
 * the from address to ignore forged replies.
 *

 * We accept a from address if one of the following is true:
 *

 *
It matches the to address of the request.
 *
The to address of the request was empty and the
 * from address matches either the bare jid of the server or the
 * (bare or full jid) of the client.
 *
To to was our bare address and the from is empty.
 *

 *

 * For a discussion of the issues, see the thread "Spoofing of iq ids and
 * misbehaving servers" from 2014-01 on the jdev@jabber.org mailing list
 * and following discussion in February and March.
 *
 * @author Lars Noschinski
 *
 */
public class IQReplyFilter implements StanzaFilter {
    private static final Logger LOGGER = Logger.getLogger(IQReplyFilter.class.getName());

    private final StanzaFilter iqAndIdFilter;
    private final OrFilter fromFilter;
    private final Jid to;
    private final EntityFullJid local;
    private final DomainBareJid server;
    private final String packetId;

    /**
     * Filters for packets which are a valid reply to an IQ request.
     *

     * Such a stanza must have the same stanza id and must be an IQ stanza of type
     * RESULT or ERROR. Moreover, it is necessary to check
     * the from address to ignore forged replies.
     *

     * We accept a from address if one of the following is true:
     *

     *
It matches the to address of the request.
     *
The to address of the request was empty and the
     * from address matches either the bare jid of the server or the
     * (bare or full jid) of the client.
     *
To to was our bare address and the from is empty.
     *

     *

     * For a discussion of the issues, see the thread "Spoofing of iq ids and
     * misbehaving servers" from 2014-01 on the jdev@jabber.org mailing list
     * and following discussion in February and March.
     *
     * @param iqPacket An IQ request. Filter for replies to this packet.
     * @param conn connection.
     */
    public IQReplyFilter(IQ iqPacket, XMPPConnection conn) {
        if (!iqPacket.isRequestIQ()) {
            throw new IllegalArgumentException("IQ must be a request IQ, i.e. of type 'get' or 'set'.");
        }
        to = iqPacket.getTo();
        local = conn.getUser();
        if (local == null) {
            throw new IllegalArgumentException("Must have a local (user) JID set. Either you didn't configure one or you where not connected at least once");
        }

        server = conn.getXMPPServiceDomain();
        packetId = iqPacket.getStanzaId();

        StanzaFilter iqFilter = new OrFilter(IQTypeFilter.ERROR, IQTypeFilter.RESULT);
        StanzaFilter idFilter = new StanzaIdFilter(iqPacket);
        iqAndIdFilter = new AndFilter(iqFilter, idFilter);
        fromFilter = new OrFilter();
        fromFilter.addFilter(FromMatchesFilter.createFull(to));
        if (to == null) {
            fromFilter.addFilter(FromMatchesFilter.createBare(local));
            fromFilter.addFilter(FromMatchesFilter.createFull(server));
        }
        else if (to.equals(local.asBareJid())) {
            fromFilter.addFilter(FromMatchesFilter.createFull(null));
        }
    }

    @Override
    public boolean accept(Stanza packet) {
        // First filter out everything that is not an IQ stanza and does not have the correct ID set.
        if (!iqAndIdFilter.accept(packet))
            return false;

        // Second, check if the from attributes are correct and log potential IQ spoofing attempts
        if (fromFilter.accept(packet)) {
            return true;
        } else {
            String msg = String.format("Rejected potentially spoofed reply to IQ-packet. Filter settings: "
                            + "packetId=%s, to=%s, local=%s, server=%s. Received packet with from=%s",
                            packetId, to, local, server, packet.getFrom());
            LOGGER.log(Level.WARNING, msg , packet);
            return false;
        }
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(": iqAndIdFilter (").append(iqAndIdFilter.toString()).append("), ");
        sb.append(": fromFilter (").append(fromFilter.toString()).append(')');
        return sb.toString();
    }
}


text:
/* @flow */
import { dialogTitleTheme as theme } from '../../../../../library/Dialog/themes';
import description from './description';
import propDocs from './propDocs';
import examples from './examples';

import type { ComponentDocType } from '../../../pages/ComponentDoc/types';

const componentDoc: ComponentDocType = {
  title: 'DialogTitle',
  slug: 'dialog-title',
  description,
  examples,
  propDocs,
  theme
};

export default componentDoc;

redpajama_set_name: RedPajamaGithub


text:
require 'rails_helper'

RSpec.describe 'oauth/tokens password grant flow', type: :request do
  context 'with valid username/password' do
    with :user
    with :application
    let(:params) do
      {
        client_id: application.uid,
        client_secret: application.secret,
        username: user.email,
        password: user.password,
        grant_type: 'password'
      }
    end
    let(:headers) { {} }
    let(:expected_response) do
      {
        access_token: @new_token.token,
        token_type: 'Bearer',
        expires_in: 'ignored',
        created_at: 'ignored'
      }.to_json
    end
    before do
      post '/oauth/token', params: params, headers: headers
      @new_token = Doorkeeper::AccessToken.last
    end
    it { expect(response.status).to eq 200 }
    it { expect(response.body).to be_json_eql(expected_response).excluding('expires_in', 'created_at') }
  end
  context 'with invalid password' do
    with :user
    with :application
    let(:params) do
      {
        client_id: application.uid,
        client_secret: application.secret,
        username: user.email,
        password: 'invalid password',
        grant_type: 'password'
      }
    end
    let(:headers) { {} }
    before do
      post '/oauth/token', params: params, headers: headers
    end
    it { expect(response.status).to eq 400 }
  end
  context 'with invalid username' do
    with :user
    with :application
    let(:params) do
      {
        client_id: application.uid,
        client_secret: application.secret,
        username: 'invalid username',
        password: 'invalid password',
        grant_type: 'password'
      }
    end
    let(:headers) { {} }
    before do
      post '/oauth/token', params: params, headers: headers
    end
    it { expect(response.status).to eq 400 }
  end
end


text:
package kanzi

// An integer function is an operation that takes an array of integers as input and
// and turns it into another array of integers. The size of the returned array
// is not known in advance (by the caller).
// Return index in src, index in dst and error
type IntTransform interface {
	Forward(src, dst []int) (uint, uint, error)

	Inverse(src, dst []int) (uint, uint, error)
}

// A byte function is an operation that takes an array of bytes as input and
// turns it into another array of bytes. The size of the returned array is not
// known in advance (by the caller).
// Return index in src, index in dst and error
type ByteTransform interface {
	Forward(src, dst []byte) (uint, uint, error)

	Inverse(src, dst []byte) (uint, uint, error)
}

// An integer function is an operation that transforms the input int array and writes
// the result in the output int array. The result may have a different size.
// The function may fail if input and output array are the same array.
// The index of input and output arrays are updated appropriately.
// Return index in src, index in dst and error
type IntFunction interface {
	Forward(src, dst []int) (uint, uint, error)

	Inverse(src, dst []int) (uint, uint, error)

	// Return the max size required for the encoding output buffer
	// If the max size of the output buffer is not known, return -1
	MaxEncodedLen(srcLen int) int
}

// A byte function is an operation that transforms the input byte array and writes
// the result in the output byte array. The result may have a different size.
// The function may fail if input and output array are the same array.
// Return index in src, index in dst and error
type ByteFunction interface {
	Forward(src, dst []byte) (uint, uint, error)

	Inverse(src, dst []byte) (uint, uint, error)

	// Return the max size required for the encoding output buffer
	// If the max size of the output buffer is not known, return -1
	MaxEncodedLen(srcLen int) int
}

// InputStream = io.Reader + io.Closer
// Hence an InputStream is a Reader
// Any Reader with the appropriate Close() function can be used
type InputStream interface {
	Read(b []byte) (n int, err error)

	Close() error
}

type InputBitStream interface {
	ReadBit() int // panic if error

	ReadBits(length uint) uint64 // panic if error

	Close() (bool, error)

	Read() uint64 // number of bits read so far

	HasMoreToRead() (bool, error)
}

// OuputStream = io.Writer + io.Closer
// Hence an OuputStream is a Writer
// Any Writer with the appropriate Close() function can be used
type OutputStream interface {
	Write(b []byte) (n int, err error)

	Close() error
}

type OutputBitStream interface {
	WriteBit(bit int) // panic if error

	WriteBits(bits uint64, length uint) uint // panic if error

	Close() (bool, error)

	Written() uint64 // number of bits written so far
}

type EntropyEncoder interface {
	// Encode the array provided into the bitstream. Return the number of byte
	// written to the bitstream
	Encode(block []byte) (int, error)

	// Return the underlying bitstream
	BitStream() OutputBitStream

	// Must be called before getting rid of the entropy encoder
	Dispose()
}

type EntropyDecoder interface {
	// Decode the next chunk of data from the bitstream and return in the
	// provided buffer.
	Decode(block []byte) (int, error)

	// Return the underlying bitstream
	BitStream() InputBitStream

	// Must be called before getting rid of the entropy decoder
	// Trying to encode after a call to dispose gives undefined behavior
	Dispose()
}

type Sizeable interface {
	Size() uint

	SetSize(sz uint) bool
}

func SameIntSlices(slice1, slice2 []int, checkLengths bool) bool {
	if slice2 == nil {
		return slice1 == nil
	}

	if slice1 == nil {
		return false
	}

	if &slice1 == &slice2 {
		return true
	}

	if len(slice2) == 0 {
		return len(slice1) == 0
	}

	if len(slice1) == 0 {
		return false
	}

	if checkLengths == true && len(slice1) != len(slice2) {
		return false
	}

	saved := slice1[0]
	slice2[0] = ^slice2[0]

	if slice1[0] == saved {
		slice2[0] = ^slice2[0]
		return false
	}

	slice2[0] = ^slice2[0]
	return true
}

func SameByteSlices(slice1, slice2 []byte, checkLengths bool) bool {
	if slice2 == nil {
		return slice1 == nil
	}

	if slice1 == nil {
		return false
	}

	if &slice1 == &slice2 {
		return true
	}

	if len(slice2) == 0 {
		return len(slice1) == 0
	}

	if len(slice1) == 0 {
		return false
	}

	if checkLengths == true && len(slice1) != len(slice2) {
		return false
	}

	saved := slice1[0]
	slice2[0] = ^slice2[0]

	if slice1[0] == saved {
		slice2[0] = ^slice2[0]
		return false
	}

	slice2[0] = ^slice2[0]
	return true
}


text:
package microsoft.exchange.webservices.data.property.complex;

import microsoft.exchange.webservices.data.core.EwsServiceXmlReader;
import microsoft.exchange.webservices.data.core.EwsServiceXmlWriter;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.core.XmlElementNames;

/**
 * Represents an operation to update an existing rule.
 */
public class SetRuleOperation extends RuleOperation {
  /**
   * Inbox rule to be updated.
   */
  private Rule rule;

  /**
   * Initializes a new instance of the SetRuleOperation class.
   */
  public SetRuleOperation() {
    super();
  }

  /**
   * Initializes a new instance of the SetRuleOperation class.
   *
   * @param rule The rule
   *             The inbox rule to update.
   */
  public SetRuleOperation(Rule rule) {
    super();
    this.rule = rule;
  }

  /**
   * Gets the rule to be updated.
   */
  public Rule getRule() {
    return this.rule;
  }

  /**
   * Sets the rule to be updated.
   */
  public void setRule(Rule value) {
    if (this.canSetFieldValue(this.rule, value)) {
      this.rule = value;
      this.changed();
    }
  }

  /**
   * Tries to read element from XML.
   *
   * @param reader The reader
   * @return True if element was read.
   */
  @Override
  public boolean tryReadElementFromXml(EwsServiceXmlReader reader)
      throws Exception {
    if (reader.getLocalName().equals(XmlElementNames.Rule)) {
      this.rule = new Rule();
      this.rule.loadFromXml(reader, reader.getLocalName());
      return true;
    } else {
      return false;
    }
  }

  /**
   * Writes elements to XML.
   *
   * @param writer The writer.
   */
  @Override
  public void writeElementsToXml(EwsServiceXmlWriter writer)
      throws Exception {
    this.rule.writeToXml(writer, XmlElementNames.Rule);
  }

  /**
   * Validates this instance.
   *
   * @throws Exception
   */
  @Override
  protected void internalValidate() throws Exception {
    EwsUtilities.validateParam(this.rule, "Rule");
  }

  /**
   * Gets the Xml element name of the SetRuleOperation object.
   */
  @Override public String getXmlElementName() {
    return XmlElementNames.SetRuleOperation;
  }
}


text:
module Extensions::DeferredWorkflowStatePersistence::ActiveRecord::Base
  module ClassMethods
    def workflow_adapter
      Extensions::DeferredWorkflowStatePersistence::Workflow::Adapter::DeferredActiveRecord
    end
  end
end


text:
// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2017 Oslo and Akershus University College of Applied Sciences
// and Alfred Bratterud
//
// 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.

#pragma once
#ifndef UPLINK_WS_UPLINK_HPP
#define UPLINK_WS_UPLINK_HPP

#include "transport.hpp"
#include "config.hpp"

#include <net/inet4>
#include <net/http/basic_client.hpp>
#include <net/ws/websocket.hpp>
#include <liveupdate.hpp>
#include <util/timer.hpp>
#include <util/logger.hpp>
#include <rtc>

namespace uplink {

class WS_uplink {
public:
  static constexpr auto heartbeat_interval = 10s;
  static constexpr auto heartbeat_retries  = 3;

  WS_uplink(Config config);

  void start(net::Inet<net::IP4>&);

  void auth();

  void dock();

  void handle_transport(Transport_ptr);

  void send_ident();

  void send_log(const char*, size_t);

  void flush_log();

  void send_uplink();

  void update(std::vector<char> buffer);

  void send_error(const std::string& err);

  void send_stats();

  void send_message(Transport_code, const char* data, size_t len);

  bool is_online() const
  { return ws_ != nullptr and ws_->is_alive(); }

private:
  Config config_;

  net::Inet<net::IP4>&          inet_;
  std::unique_ptr<http::Basic_client> client_;
  net::WebSocket_ptr            ws_;
  std::string                   id_;
  std::string                   token_;
  /** Hash for the current running binary
   * (restored during update, none if never updated) */
  std::string                   binary_hash_;
  /** Hash for current received update */
  std::string                   update_hash_;

  Transport_parser parser_;

  Timer retry_timer;
  uint8_t retry_backoff = 0;
  uint8_t heart_retries_left = heartbeat_retries;

  std::vector<char> logbuf_;

  Timer heartbeat_timer;
  RTC::timestamp_t last_ping;

  RTC::timestamp_t update_time_taken = 0;

  void inject_token(http::Request& req, http::Basic_client::Options&, const http::Basic_client::Host)
  {
    if (not token_.empty())
      req.header().add_field("Authorization", "Bearer " + token_);
  }

  std::string auth_data() const;

  void handle_auth_response(http::Error err, http::Response_ptr res, http::Connection&);

  void retry_auth();

  void establish_ws(net::WebSocket_ptr ws);

  void handle_ws_close(uint16_t code);

  bool handle_ping(const char*, size_t);
  void handle_pong_timeout(net::WebSocket&);

  bool missing_heartbeat()
  { return last_ping < RTC::now() - heartbeat_interval.count(); }
  void on_heartbeat_timer();

  void parse_transport(net::WebSocket::Message_ptr msg);

  void store(liu::Storage& store, const liu::buffer_t*);

  void restore(liu::Restore& store);

  void store_conntrack(liu::Storage& store, const liu::buffer_t*);

  void restore_conntrack(liu::Restore& store);

}; // < class WS_uplink

} // < namespace uplink

#endif


text:
var app = angular.module('koreatechCommunity',['ui.router','Community.chatboard','Community.chatroom']);

app.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {

	$stateProvider.state('home', {
		url : '/home',
		templateUrl : '/home.html',
		controller : 'MainCtrl'

	}).state('chats',{
		url : '/chats',
		templateUrl : '/chats.html',
		controller : 'chatCtrl',
		resolve : {
			chatPromise : ['chats',
			function(chats) {
				return chats.getAll();
			}]
		}
	}).state('chatRoom', {
		url : '/chats/:id',
		templateUrl : '/chatrooms.html',
		controller : 'ChatroomCtrl',
		resolve : {
			chat : ['$stateParams', 'chats',
			function($stateParams, chats) {
				return chats.get($stateParams.id);
			}]

		}
	});

	$urlRouterProvider.otherwise('home');
}]);

app.controller('MainCtrl',function($scope){});


text:
JSIL.ImplementExternals("System.IO.FileInfo", function ($) {

    $.Method({ Static: false, Public: true }, ".ctor",
      (new JSIL.MethodSignature(null, [$.String], [])),
      function _ctor(fileName) {
          var storageRoot = JSIL.Host.getStorageRoot();

          if (storageRoot)
              this.$fromNodeAndPath(storageRoot.resolvePath(fileName, false), storageRoot.normalizePath(fileName));
          else
              this.$fromNodeAndPath(null, fileName);
      }
    );

    $.Method({ Static: false, Public: true }, "AppendText",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.StreamWriter"), [], [])),
      function AppendText() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "CopyTo",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileInfo"), [$.String], [])),
      function CopyTo(destFileName) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "CopyTo",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileInfo"), [$.String, $.Boolean], [])),
      function CopyTo(destFileName, overwrite) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "Create",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [], [])),
      function Create() {
          return System.IO.File.Create(this._path);
      }
    );

    $.Method({ Static: false, Public: true }, "CreateText",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.StreamWriter"), [], [])),
      function CreateText() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "Decrypt",
      (JSIL.MethodSignature.Void),
      function Decrypt() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "Delete",
      (JSIL.MethodSignature.Void),
      function Delete() {
          System.IO.File.Delete(this._path);
      }
    );

    $.Method({ Static: false, Public: true }, "Encrypt",
      (JSIL.MethodSignature.Void),
      function Encrypt() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "get_Directory",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.DirectoryInfo"), [], [])),
      function get_Directory() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "get_DirectoryName",
      (new JSIL.MethodSignature($.String, [], [])),
      function get_DirectoryName() {
          throw new Error('Not implemented');
      }
    );

    $.InheritBaseMethod("get_Exists", JSIL.MethodSignature.Return($.Boolean));

    $.Method({ Static: false, Public: true }, "get_IsReadOnly",
      (new JSIL.MethodSignature($.Boolean, [], [])),
      function get_IsReadOnly() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "get_Length",
      (new JSIL.MethodSignature($.Int64, [], [])),
      function get_Length() {
          throw new Error('Not implemented');
      }
    );

    $.InheritBaseMethod("get_Name", JSIL.MethodSignature.Return($.String));

    $.Method({ Static: false, Public: true }, "GetAccessControl",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.Security.AccessControl.FileSecurity"), [], [])),
      function GetAccessControl() {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "GetAccessControl",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.Security.AccessControl.FileSecurity"), [$jsilcore.TypeRef("System.Security.AccessControl.AccessControlSections")], [])),
      function GetAccessControl(includeSections) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: false }, "GetDisplayPath",
      (new JSIL.MethodSignature($.String, [$.String], [])),
      function GetDisplayPath(originalPath) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "MoveTo",
      (new JSIL.MethodSignature(null, [$.String], [])),
      function MoveTo(destFileName) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "Open",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [$jsilcore.TypeRef("System.IO.FileMode")], [])),
      function Open(mode) {
          return System.IO.File.Open(this._path, mode);
      }
    );

    $.Method({ Static: false, Public: true }, "Open",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [$jsilcore.TypeRef("System.IO.FileMode"), $jsilcore.TypeRef("System.IO.FileAccess")], [])),
      function Open(mode, access) {
          // FIXME: access
          return System.IO.File.Open(this._path, mode);
      }
    );

    $.Method({ Static: false, Public: true }, "Open",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [
            $jsilcore.TypeRef("System.IO.FileMode"), $jsilcore.TypeRef("System.IO.FileAccess"),
            $jsilcore.TypeRef("System.IO.FileShare")
      ], [])),
      function Open(mode, access, share) {
          // FIXME: access, share
          return System.IO.File.Open(this._path, mode);
      }
    );

    $.Method({ Static: false, Public: true }, "OpenRead",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [], [])),
      function OpenRead() {
          return System.IO.File.OpenRead(this._path);
      }
    );

    $.Method({ Static: false, Public: true }, "OpenText",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.StreamReader"), [], [])),
      function OpenText() {
          return System.IO.File.OpenText(this._path);
      }
    );

    $.Method({ Static: false, Public: true }, "OpenWrite",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileStream"), [], [])),
      function OpenWrite() {
          return System.IO.File.OpenWrite(this._path);
      }
    );

    $.Method({ Static: false, Public: true }, "Replace",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileInfo"), [$.String, $.String], [])),
      function Replace(destinationFileName, destinationBackupFileName) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "Replace",
      (new JSIL.MethodSignature($jsilcore.TypeRef("System.IO.FileInfo"), [
            $.String, $.String,
            $.Boolean
      ], [])),
      function Replace(destinationFileName, destinationBackupFileName, ignoreMetadataErrors) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "set_IsReadOnly",
      (new JSIL.MethodSignature(null, [$.Boolean], [])),
      function set_IsReadOnly(value) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "SetAccessControl",
      (new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Security.AccessControl.FileSecurity")], [])),
      function SetAccessControl(fileSecurity) {
          throw new Error('Not implemented');
      }
    );

    $.Method({ Static: false, Public: true }, "toString",
      (new JSIL.MethodSignature($.String, [], [])),
      function toString() {
          return "<FileInfo " + this._path + ">";
      }
    );

});


text:
struct sdl_deleter {
    void operator()(SDL_Window *p) const { SDL_DestroyWindow(p); }
    void operator()(SDL_Renderer *p) const { SDL_DestroyRenderer(p); }
    void operator()(SDL_Texture *p) const { SDL_DestroyTexture(p); }
};


text:
'''Abstract Syntax Tree nodes for parsed XPath.

This module contains basic nodes for representing parsed XPath expressions.
The parser provided by this module creates its parsed XPath representation
from the classes defined in this module. Library callers will mostly not use
this module directly, unless they need to produce XPath ASTs from scratch or
perhaps introspect ASTs returned by the parser.
'''

from __future__ import unicode_literals
import sys

# python2/3 string type logic borrowed from six
# NOTE: not importing six here because setup.py needs to generate
# the parser at install time, when six installation is not yet available
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3

if PY3:
    string_types = str
else:
    string_types = basestring

__all__ = [
    'serialize',
    'UnaryExpression',
    'BinaryExpression',
    'PredicatedExpression',
    'AbsolutePath',
    'Step',
    'NameTest',
    'NodeType',
    'AbbreviatedStep',
    'VariableReference',
    'FunctionCall',
    ]

def serialize(xp_ast):
    '''Serialize an XPath AST as a valid XPath expression.'''
    return ''.join(_serialize(xp_ast))

def _serialize(xp_ast):
    '''Generate token strings which, when joined together, form a valid
    XPath serialization of the AST.'''

    if hasattr(xp_ast, '_serialize'):
        for tok in xp_ast._serialize():
            yield tok
    elif isinstance(xp_ast, string_types):
        # strings in serialized xpath needed to be quoted
        # (e.g. for use in paths, comparisons, etc)
        # using repr to quote them; for unicode, the leading
        # u (u'') needs to be removed.
        yield repr(xp_ast).lstrip('u')
    else:
        yield str(xp_ast)

class UnaryExpression(object):

    '''A unary XPath expression. Practially, this means -foo.'''

    def __init__(self, op, right):
        self.op = op
        '''the operator used in the expression'''
        self.right = right
        '''the expression the operator is applied to'''

    def __repr__(self):
        return '<%s %s %s>' % (self.__class__.__name__,
                self.op, serialize(self.right))

    def _serialize(self):
        yield self.op
        for tok in _serialize(self.right):
            yield tok

KEYWORDS = set(['or', 'and', 'div', 'mod'])
class BinaryExpression(object):

    '''Any binary XPath expression. a/b; a and b; a | b.'''

    def __init__(self, left, op, right):
        self.left = left
        '''the left side of the binary expression'''
        self.op = op
        '''the operator of the binary expression'''
        self.right = right
        '''the right side of the binary expression'''

    def __repr__(self):
        return '<%s %s %s %s>' % (self.__class__.__name__,
                serialize(self.left), self.op, serialize(self.right))

    def _serialize(self):
        for tok in _serialize(self.left):
            yield tok

        if self.op in KEYWORDS:
            yield ' '
            yield self.op
            yield ' '
        else:
            yield self.op

        for tok in _serialize(self.right):
            yield tok

class PredicatedExpression(object):

    '''A filtered XPath expression. $var[1]; (a or b)[foo][@bar].'''

    def __init__(self, base, predicates=None):
        self.base = base
        '''the base expression to be filtered'''
        self.predicates = predicates or []
        '''a list of filter predicates'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def append_predicate(self, pred):
        self.predicates.append(pred)

    def _serialize(self):
        yield '('
        for tok in _serialize(self.base):
            yield tok
        yield ')'
        for pred in self.predicates:
            yield '['
            for tok in _serialize(pred):
                yield tok
            yield ']'

class AbsolutePath(object):

    '''An absolute XPath path. /a/b/c; //a/ancestor:b/@c.'''

    def __init__(self, op='/', relative=None):
        self.op = op
        '''the operator used to root the expression'''
        self.relative = relative
        '''the relative path after the absolute root operator'''

    def __repr__(self):
        if self.relative:
            return '<%s %s %s>' % (self.__class__.__name__,
                    self.op, serialize(self.relative))
        else:
            return '<%s %s>' % (self.__class__.__name__, self.op)

    def _serialize(self):
        yield self.op
        for tok in _serialize(self.relative):
            yield tok

class Step(object):

    '''A single step in a relative path. a; @b; text(); parent::foo:bar[5].'''

    def __init__(self, axis, node_test, predicates):
        self.axis = axis
        '''the step's axis, or @ or None if abbreviated or undefined'''
        self.node_test = node_test
        '''a NameTest or NodeType object describing the test represented'''
        self.predicates = predicates
        '''a list of predicates filtering the step'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        if self.axis == '@':
            yield '@'
        elif self.axis:
            yield self.axis
            yield '::'

        for tok in self.node_test._serialize():
            yield tok

        for predicate in self.predicates:
            yield '['
            for tok in _serialize(predicate):
                yield tok
            yield ']'

class NameTest(object):

    '''An element name node test for a Step.'''

    def __init__(self, prefix, name):
        self.prefix = prefix
        '''the namespace prefix used for the test, or None if unset'''
        self.name = name
        '''the node name used for the test, or *'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        if self.prefix:
            yield self.prefix
            yield ':'
        yield self.name

    def __str__(self):
        return ''.join(self._serialize())

class NodeType(object):

    '''A node type node test for a Step.'''

    def __init__(self, name, literal=None):
        self.name = name
        '''the node type name, such as node or text'''
        self.literal = literal
        '''the argument to the node specifier. XPath allows these only for
        processing-instruction() node tests.'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        yield self.name
        yield '('
        if self.literal is not None:
            for tok in _serialize(self.literal):
                yield self.literal
        yield ')'

    def __str__(self):
        return ''.join(self._serialize())

class AbbreviatedStep(object):

    '''An abbreviated XPath step. . or ..'''

    def __init__(self, abbr):
        self.abbr = abbr
        '''the abbreviated step'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        yield self.abbr

class VariableReference(object):

    '''An XPath variable reference. $foo; $myns:foo.'''

    def __init__(self, name):
        self.name = name
        '''a tuple (prefix, localname) containing the variable name'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        yield '$'
        prefix, localname = self.name
        if prefix:
            yield prefix
            yield ':'
        yield localname

class FunctionCall(object):

    '''An XPath function call. foo(); my:foo(1); foo(1, 'a', $var).'''

    def __init__(self, prefix, name, args):
        self.prefix = prefix
        '''the namespace prefix, or None if unspecified'''
        self.name = name
        '''the local function name'''
        self.args = args
        '''a list of argument expressions'''

    def __repr__(self):
        return '<%s %s>' % (self.__class__.__name__,
                serialize(self))

    def _serialize(self):
        if self.prefix:
            yield self.prefix
            yield ':'
        yield self.name
        yield '('
        if self.args:
            for tok in _serialize(self.args[0]):
                yield tok

            for arg in self.args[1:]:
                yield ','
                for tok in _serialize(arg):
                    yield tok
        yield ')'


text:
//go:build !providerless
// +build !providerless

package routeclient

import (
	"context"

	"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network"
	"k8s.io/legacy-cloud-providers/azure/retry"
)

const (
	// APIVersion is the API version for network.
	APIVersion = "2019-06-01"
)

// Interface is the client interface for Route.
// Don't forget to run the following command to generate the mock client:
// mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routeclient/interface.go -package=mockrouteclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/routeclient/mockrouteclient/interface.go
type Interface interface {
	// CreateOrUpdate creates or updates a Route.
	CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters network.Route, etag string) *retry.Error

	// Delete deletes a Route by name.
	Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) *retry.Error
}


text:
<?php

namespace TigranMaestro\OpenExchangeRatesPHPClient\Exceptions;

/**
 * Class ClientException
 * @package TigranMaestro\OpenExchangeRatesPHPClient\Exceptions
 */
class ClientException extends \Exception
{

}


text:
package com.mmnaseri.personal.worthtrend.cmd.impl;

import com.mmnaseri.personal.worthtrend.cmd.Command;
import com.mmnaseri.personal.worthtrend.data.model.*;
import com.mmnaseri.personal.worthtrend.data.repository.TransactionRepository;
import com.mmnaseri.personal.worthtrend.io.Console;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @author Milad Naseri (milad.naseri@cdk.com)
 * @since 1.0 (2015/11/05, 10:07)
 */
public class ScheduleTransactionCommand implements Command {

    private final TransactionRepository repository;
    private final DateFormat dateFormat = new SimpleDateFormat("y/M/d");

    @Autowired
    public ScheduleTransactionCommand(TransactionRepository repository) {
        this.repository = repository;
    }

    @Override
    public String getMnemonic() {
        return "schedule";
    }

    @Override
    public void execute(Console console) {
        final Transaction transaction = new Transaction();
        console.print("Note: ");
        transaction.setNote(console.read("(\\s*\\S+)+\\s*"));
        if (transaction.getNote().equals("-")) {
            return;
        }
        console.print("Amount: ");
        transaction.setAmount(console.read(Double.class));
        if (transaction.getAmount().equals(0d)) {
            return;
        }
        console.print("Start Date: ");
        try {
            transaction.setStartDate(dateFormat.parse(console.read("\\d+/\\d+/\\d+")));
        } catch (ParseException e) {
            console.println("Invalid date format");
            return;
        }
        console.print("Recurrent: [N/Y] ");
        if (console.read("[yYnN]").equalsIgnoreCase("y")) {
            final Recurrence recurrence = readRecurrence(console);
            if (recurrence == null) return;
            transaction.setRecurrence(recurrence);
        }
        final Transaction saved = repository.save(transaction);
        final String id = saved.getId();
        saved.setCode(id.substring(id.length() - 6));
        repository.save(saved);
        console.println("Saved transaction " + saved.getCode());
    }

    private Recurrence readRecurrence(Console console) {
        console.println("How often does this transaction occur?");
        console.println("D) Daily");
        console.println("W) Weekly");
        console.println("M) Monthly");
        console.println("Y) Yearly");
        final String type = console.read("[dwmyDWMY]");
        final RecurrenceType recurrenceType;
        if (type.equalsIgnoreCase("d")) {
            recurrenceType = RecurrenceType.DAY;
        } else if (type.equalsIgnoreCase("w")) {
            recurrenceType = RecurrenceType.WEEK;
        } else if (type.equalsIgnoreCase("m")) {
            recurrenceType = RecurrenceType.MONTH;
        } else if (type.equalsIgnoreCase("y")) {
            recurrenceType = RecurrenceType.YEAR;
        } else {
            console.println("Invalid recurrence type");
            return null;
        }
        final Recurrence recurrence = new Recurrence();
        recurrence.setType(recurrenceType);
        console.print("How many " + recurrenceType.name().toLowerCase() + "s should pass between two occurrences? ");
        recurrence.setFrequency(Math.max(1, console.read(Integer.class)));
        console.print("Does the recurrence end? [Y/N] ");
        if (console.read("[yYnN]").equalsIgnoreCase("y")) {
            final Termination termination = readTermination(console);
            recurrence.setTermination(termination);
        }
        return recurrence;
    }

    private Termination readTermination(Console console) {
        console.print("Do you want this to finish after a particular (n)umber of times or on a (d)ate? ");
        final Termination termination;
        if (console.read("[nNdD]").equalsIgnoreCase("n")) {
            termination = new IterativeTermination();
            console.print("How many times should this transaction run? ");
            ((IterativeTermination) termination).setIterations(console.read(Integer.class));
        } else {
            termination =  new TimedTermination();
            console.print("When should this transaction end? ");
            try {
                ((TimedTermination) termination).setEndDate(dateFormat.parse(console.read("\\d+/\\d+/\\d+")));
            } catch (ParseException e) {
                console.println("Invalid date format");
                return null;
            }
        }
        return termination;
    }

}


text:
Caboose.Store.Modules.Cart = (function() {
  var self = {
    templates: {
      line_items: JST['caboose/cart/line_items'],
      add_to_cart: JST['caboose/cart/add_to_cart']
    }
  };

  //
  // Initialize
  //

  self.initialize = function() {
    self.render_add_to_cart();
    self.render_item_count();
    self.$cart = $('#cart');
    if (!self.$cart.length) return false;
    self.$cart.on('click', '#remove-from-cart', self.remove_handler);
    self.$cart.on('keyup', 'input', self.update_handler);
    self.render();
  };

  //
  // Set Variant
  //

  self.set_variant = function(variant) {
    if (self.$add_to_cart) {
      self.$add_to_cart.find('input[name=variant_id]').val(variant ? variant.id : "");
      self.$add_to_cart.trigger('change');
    }
  };

  //
  // Render
  //

  self.render = function() {
    $.get('/cart/items', function(response) {
      self.$cart.empty().html(self.templates.line_items({ invoice: response.invoice }));
      self.$cart.removeClass('loading');
    });
  };

  self.render_add_to_cart = function() {
    self.$add_to_cart = $('#add-to-cart');
    if (!self.$add_to_cart.length) return false;
    self.$add_to_cart.empty().html(self.templates.add_to_cart());
    //$('input[name=quantity]', self.$add_to_cart).on('keyup', self.qty_keyup_handler);
    //$('input[name=quantity,type=hidden,value=1]', self.$add_to_cart);
    $('form', self.$add_to_cart).on('submit', self.add_handler);
  };

  self.render_item_count = function(item_count) {
    var $link = $('#cart-link, .cart-link');
    //if (!$link.length) return false;

    function set_count(count) {
      if ($('#cart_item_count').length > 0)
        $('#cart_item_count').html(count);
      else if ($link.length > 0)
      {
        if ($link.children('i') && count < 1) { $link.children('i').remove(); }
        else if ($link.children('i').length)  { $link.children('i').empty().text(count); }
        else                                  { $link.append($('<i/>').text(count)); }
      }
    };

    if (item_count) {
      set_count(item_count);
    } else {
      $.get('/cart/item-count', function(response) {
        set_count(response.item_count);
      });
    }
  };

  //
  // Event Handlers
  //

  self.qty_keyup_handler = function(event) {
    var $quantity = $(event.target);
    $quantity.val($quantity.val().match(/\d*\.?\d+/));
  };

  self.add_handler = function(event) {
    event.preventDefault();
    var $form = $(event.target);

    if ($form.find('input[name=variant_id]').val().trim() == "") {
      alert('Must select all options');
    } else {
      $.ajax({
        type: $form.attr('method'),
        url: $form.attr('action'),
        data: $form.serialize(),
        success: function(response) {
          if (response.success) {
            self.render_item_count(response.item_count);
            if (self.$add_to_cart.length) self.$add_to_cart.trigger('added');

            if (!self.$add_to_cart.find('.message').length) {
              self.$add_to_cart
                .append($('<div/>').hide().addClass('message')
                  .append($('<p/>').text(response.quantity_message ? response.quantity_message : 'Successfully added to cart'))
                  .append($('<p/>')
                    .append($('<a/>').attr('href', '/cart').html('View cart')).append(' | ')
                    .append($('<a/>').attr('href', '/checkout').html('Continue to checkout'))
                  )
                );
              self.$add_to_cart.find('.message').fadeIn();
              Caboose.Store.Modules.Product.$product.trigger('added-to-cart');

              //setTimeout(function() {
              //  self.$add_to_cart.find('.message').fadeOut(function() { $(this).remove() });
              //}, 5000);
            }
          } else {
            if (!self.$add_to_cart.find('.message').length) {
              self.$add_to_cart
                .append($('<div/>').hide().addClass('message')
                  .append($('<p/>').addClass('note error').html(response.error ? response.error : (response.errors ? response.errors[0] : "Error adding to cart")))
             //     .append($('<p/>').append($('<a/>').attr('href', '/cart').html('View cart')))
                );
              self.$add_to_cart.find('.message').fadeIn();
            }
            //alert(response.errors[0]);
          }
        }
      });
    }
  };

  self.update_handler = function(event) {
    var $quantity = $(event.target)
    var $line_item = $quantity.parents('li').first();

    $quantity.val($quantity.val().match(/\d*\.?\d+/));
    if ($quantity.val() == "") return false;

    delay(function() {
      $.ajax({
        type: 'put',
        url: '/cart/items/' + $line_item.data('id'),
        data: { quantity: $quantity.val() },
        success: function(response) {
          if (response.success) {
            $line_item.find('.price').empty().text('$' + response.line_item.price);
            if (self.$cart.find('.subtotal').length) self.$cart.find('.subtotal').empty().text('$' + response.invoice_subtotal);
          } else {
            alert(response.errors[0]);
          }
        }
      });
    }, 1000);
  };

  self.remove_handler = function(event) {
    var $line_item = $(event.target).parents('li').first();

    $.ajax({
      type: 'delete',
      url: '/cart/items/' + $line_item.data('id'),
      success: function(response) {
        if (response.success) {
          self.render();
          self.render_item_count(response.item_count);
        }
      }
    });
  };

  self.redirect_handler = function(event) {
    event.preventDefault();
    window.location = $(event.target).attr('href');
  };

  return self;
}).call(Caboose.Store);


text:
package Vue;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.Observable;
import java.util.Observer;
import javax.swing.JPanel;
import Controleur.Jeu;
import Modele.Niveau;

public class MonPanel extends JPanel implements Observer
{
	private BufferedImage dt;
	private BufferedImage rock;
	private BufferedImage diam;
	private BufferedImage swall;
	private BufferedImage bold;
	private BufferedImage brick;
	private final Jeu j;

	public MonPanel(Jeu jeu)
	{
		super();
		this.setVisible(true);
		this.j = jeu;
		j.getNiveau().addObserver(this);

	}
	/**
	 * Méthode paint qui permet d'afficher tous les éléments construits dans la matrice
	 * On construit les sprites correspondantes et on les dessine
	**/
	@Override
	public void paint/* Component */(Graphics g)
	{
		for ( int x = 0; x < j.getMatrice().getX(); x++ )
		{
			for ( int y = 0; y < j.getMatrice().getY(); y++ )
			{
				if ( j.getMatrice().getCase(x, y).getType() == "dirt" )
				{
					dt = j.getMatrice().getCase(x, y).construireEA();
					g.drawImage(dt, x * 16, y * 16, 16, 16, null);
				}
				else if ( j.getMatrice().getCase(x, y).getType() == "rockford" )
				{
					rock = j.getMatrice().getCase(x, y).construireEA();
					j.updateRockford(System.currentTimeMillis());
					j.construireSpritesRockford();
					g.drawImage(j.getSpriteR(), x * 16, y * 16, 16, 16, null);
				}
				else if ( j.getMatrice().getCase(x, y).getType() == "diamond" )
				{
					diam = j.getMatrice().getCase(x, y).construireEA();
					j.updateDiamonds(System.currentTimeMillis());
					j.construireSpritesDiamond();
					g.drawImage(j.getSpriteD(), x * 16, y * 16, 16, 16, null);
				}
				else if ( j.getMatrice().getCase(x, y).getType() == "steelwall" )
				{
					swall = j.getMatrice().getCase(x, y).construireEA();
					g.drawImage(swall, x * 16, y * 16, 16, 16, null);
				}
				else if ( j.getMatrice().getCase(x, y).getType() == "vide" )
				{
					g.setColor(new Color(0, 0, 0));
					g.fillRect(x * 16, y * 16, 16, 16);
				}
				else if ( j.getMatrice().getCase(x, y).getType() == "brickwall" )
				{
					brick = j.getMatrice().getCase(x, y).construireEA();
					g.drawImage(brick, x * 16, y * 16, 16, 16, null);
				}
				else if (j.getMatrice().getCase(x, y).getType() == "exit" )
				{
				}
				for ( int i = 0; i < j.getMatrice().getBoulders().size(); i++ )
				{
					if ( j.getMatrice().getCase(x, y) == j.getMatrice().getBoulders().get(i) )
					{
						g.drawImage(j.getMatrice().getBoulders().get(i).construireEA(), x * 16, y * 16, 16, 16, null);
					}
				}
			}
		}
	}

	/**
	 * Méthode qui permet de mettre à jour la vue en fonction des changements réalisés dans l'observable
	 * On notifie la vue des changements effectués pour les positions de Rockford
	**/
	@Override
	public void update(Observable o, Object arg)
	{
		if ( o instanceof Niveau )
		{
			Niveau niv = (Niveau) o;
			j.getMatrice().placerRockford(niv.getMatrice().getRockford().getx(), niv.getMatrice().getRockford().gety());
			repaint();
		}
	}

}


text:
namespace Summator
{
    using System;
    using System.Windows.Forms;

    public static class Summator
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new SummatorForm());
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of nsubj:outer in UD_Turkish-IMST</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Turkish-IMST: Relations: nsubj:outer

This relation is a language-specific subtype of <tt>nsubj</tt>.

9 nodes (0%) are attached to their parents as nsubj:outer.

9 instances of nsubj:outer (100%) are right-to-left (child precedes parent).
Average distance between parent and child is 10.8888888888889.

The following 6 pairs of parts of speech are connected with nsubj:outer: <tt>VERB</tt>-<tt>NOUN</tt> (3; 33% instances), <tt>VERB</tt>-<tt>PROPN</tt> (2; 22% instances), <tt>ADJ</tt>-<tt>NOUN</tt> (1; 11% instances), <tt>VERB</tt>-<tt>ADJ</tt> (1; 11% instances), <tt>VERB</tt>-<tt>NUM</tt> (1; 11% instances), <tt>VERB</tt>-<tt>PRON</tt> (1; 11% instances).

# visual-style 2	bgColor:blue
# visual-style 2	fgColor:white
# visual-style 8	bgColor:blue
# visual-style 8	fgColor:white
# visual-style 8 2 nsubj:outer	color:blue
1	Eski	eski	ADJ	Adj	_	2	amod	_	_
2	çamlar	çam	NOUN	Noun	Case=Nom|Number=Plur|Person=3	8	nsubj:outer	_	_
3	bardak	bardak	NOUN	Noun	Case=Nom|Number=Sing|Person=3	2	conj	_	SpaceAfter=No
4	,	,	PUNCT	Punc	_	3	punct	_	_
5	eski	eski	ADJ	Adj	_	6	amod	_	_
6	komünistler	komünist	NOUN	Noun	Case=Nom|Number=Plur|Person=3	8	nsubj	_	_
7	yeşil	yeşil	ADJ	Adj	_	8	obj	_	_
8	oldu	ol	VERB	Verb	Aspect=Perf|Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Tense=Past	0	root	_	SpaceAfter=No
9	.	.	PUNCT	Punc	_	8	punct	_	_

# visual-style 1	bgColor:blue
# visual-style 1	fgColor:white
# visual-style 7	bgColor:blue
# visual-style 7	fgColor:white
# visual-style 7 1 nsubj:outer	color:blue
1	Cevat	Cevat	PROPN	Prop	Case=Nom|Number=Sing|Person=3	7	nsubj:outer	_	SpaceAfter=No
2	,	,	PUNCT	Punc	_	7	punct	_	_
3	Nasıl	nasıl	ADV	Adverb	_	7	advmod	_	_
4	yani	yani	CCONJ	Conj	_	3	compound	_	SpaceAfter=No
5	?	?	PUNCT	Punc	_	4	punct	_	_
6	diye	diye	ADP	PCNom	_	3	case	_	_
7	sordu	sor	VERB	Verb	Aspect=Perf|Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Tense=Past	0	root	_	SpaceAfter=No
8	,	,	PUNCT	Punc	_	7	punct	_	_
9	Selahattin	Selahattin	PROPN	Prop	Case=Nom|Number=Sing|Person=3	7	nsubj	_	_
10	de	de	CCONJ	Conj	_	9	advmod:emph	_	SpaceAfter=No
11	,	,	PUNCT	Punc	_	10	punct	_	_
12	Rahip	rahip	NOUN	Noun	Case=Nom|Number=Sing|Person=3	13	obj	_	_
13	bulup	bul	VERB	Verb	Aspect=Perf|Mood=Ind|Polarity=Pos|Tense=Pres|VerbForm=Conv	14	advcl	_	_
14	günah	günah	NOUN	Noun	Case=Nom|Number=Sing|Person=3	9	conj	_	_
15	mı	mi	AUX	Ques	Aspect=Perf|Mood=Ind|Number=Sing|Person=3|Tense=Pres	14	aux:q	_	_
16	çıkaralım	çıkar	VERB	Verb	Aspect=Perf|Mood=Opt|Number=Plur|Person=1|Polarity=Pos|Tense=Pres	14	compound	_	SpaceAfter=No
17	?	?	PUNCT	Punc	_	16	punct	_	_
18	diye	diye	ADP	PCNom	_	14	case	_	SpaceAfter=No
19	.	.	PUNCT	Punc	_	7	punct	_	_

# visual-style 29	bgColor:blue
# visual-style 29	fgColor:white
# visual-style 45	bgColor:blue
# visual-style 45	fgColor:white
# visual-style 45 29 nsubj:outer	color:blue
1	Elektrozayıf	elektrozayıf	NOUN	Noun	Case=Nom|Number=Sing|Person=3	2	nmod:poss	_	_
2	kuramın	kuram	NOUN	Noun	Case=Gen|Number=Sing|Person=3	3	nmod:poss	_	_
3	oluşturulmasıyla	oluş	VERB	Verb	Aspect=Perf|Case=Ins|Mood=Ind|Number[psor]=Sing|Person[psor]=3|Polarity=Pos|Tense=Pres|VerbForm=Vnoun|Voice=CauPass	6	nmod	_	_
4	Nobel	Nobel	PROPN	Prop	Case=Nom|Number=Sing|Person=3	5	nmod:poss	_	_
5	ödülü	ödül	NOUN	Noun	Case=Nom|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=3	6	obj	_	_
6	alan	al	VERB	Verb	Aspect=Perf|Mood=Ind|Polarity=Pos|Tense=Pres|VerbForm=Part	7	acl	_	_
7	bilim	bilim	NOUN	Noun	Case=Nom|Number=Sing|Person=3	9	nmod:poss	_	_
8	insanlarından	insan	NOUN	Noun	Case=Abl|Number=Plur|Number[psor]=Sing|Person=3|Person[psor]=3	7	compound	_	_
9	birisi	biri	PRON	Quant	Case=Nom|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=3|PronType=Ind	10	obj	_	_
10	olan	ol	VERB	Verb	Aspect=Perf|Mood=Ind|Polarity=Pos|Tense=Pres|VerbForm=Part	11	acl	_	_
11	Sheldon	Sheldon	PROPN	Prop	Case=Nom|Number=Sing|Person=3	21	nsubj	_	_
12	Glashow	Glashow	PROPN	Prop	Case=Nom|Number=Sing|Person=3	11	flat	_	SpaceAfter=No
13	,	,	PUNCT	Punc	_	21	punct	_	_
14	projenin	proje	NOUN	Noun	Case=Gen|Number=Sing|Person=3	16	nmod:poss	_	_
15	onanma	ona	VERB	Verb	Aspect=Perf|Case=Nom|Mood=Ind|Polarity=Pos|Tense=Pres|VerbForm=Vnoun|Voice=Pass	16	nmod:poss	_	_
16	şansının	şans	NOUN	Noun	Case=Gen|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=3	18	nsubj	_	_
17	düşük	düşük	ADJ	NAdj	Case=Nom|Number=Sing|Person=3	18	obj	_	_
18	olduğunu	ol	VERB	Verb	Aspect=Perf|Case=Acc|Mood=Ind|Number[psor]=Sing|Person[psor]=3|Polarity=Pos|Tense=Past|VerbForm=Part	21	obj	_	_
19	şu	şu	DET	Det	_	20	det	_	_
20	şakayla	şaka	NOUN	Noun	Case=Ins|Number=Sing|Person=3	21	nmod	_	_
21	anlatıyor	anlat	VERB	Verb	Aspect=Prog|Mood=Ind|Number=Sing|Person=3|Polarity=Pos|Polite=Infm|Tense=Pres	0	root	_	SpaceAfter=No
22	:	:	PUNCT	Punc	_	45	punct	_	_
23	bizi	biz	PRON	Pers	Case=Acc|Number=Plur|Person=1|PronType=Prs	26	obj	_	_
24	erke	erke	NOUN	Noun	Case=Nom|Number=Sing|Person=3	25	nmod:poss	_	_
25	düzeylerine	düzey	NOUN	Noun	Case=Dat|Number=Plur|Number[psor]=Sing|Person=3|Person[psor]=3	26	iobj	_	_
26	çıkaracak	çıkar	VERB	Verb	Aspect=Perf|Mood=Ind|Polarity=Pos|Tense=Fut|VerbForm=Part	27	acl	_	_
27	olan	ol	VERB	Verb	Aspect=Perf|Mood=Ind|Polarity=Pos|Tense=Pres|VerbForm=Part	28	acl	_	_
28	hızlandırıcının	hızlandırıcı	NOUN	Noun	Case=Gen|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=2	29	nmod:poss	_	_
29	boyu	boy	NOUN	Noun	Case=Nom|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=3	45	nsubj:outer	_	_
30	birkaç	birkaç	DET	Det	_	31	det	_	_
31	ışık	ışık	NOUN	Noun	Case=Nom|Number=Sing|Person=3	33	nmod	_	_
32	yılı	yıl	NOUN	Noun	Case=Nom|Number=Sing|Number[psor]=Sing|Person=3|Person[psor]=3	31	compound	_	_
33	uzunluklarda	uzunluk	NOUN	Noun	Case=Loc|Number=Plur|Person=3	37	obl	_	_
34	ve	ve	CCONJ	Conj	_	36	cc	_	_
35	bir	bir	NUM	ANum	NumType=Card	36	nummod	_	_
36	saniyede	saniye	NOUN	Noun	Case=Loc|Number=Sing|Person=3	33	conj	_	_
37	tüketeceği	tüket	VERB	Verb	Aspect=Perf|Mood=Ind|Number[psor]=Sing|Person[psor]=3|Polarity=Pos|Tense=Fut|VerbForm=Part	38	acl	_	_
38	erke	erke	NOUN	Noun	Case=Nom|Number=Sing|Person=3	45	nsubj	_	_
39	de	de	CCONJ	Conj	_	38	advmod:emph	_	_
40	Güneş'in	Güneş	PROPN	Prop	Case=Gen|Number=Sing|Person=3	43	nmod:poss	_	_
41	bir	bir	NUM	ANum	NumType=Card	42	nummod	_	_
42	saniyede	saniye	NOUN	Noun	Case=Loc|Number=Sing|Person=3	43	obl	_	_
43	ürettiği	üre	VERB	Verb	Aspect=Perf|Mood=Ind|Number[psor]=Sing|Person[psor]=3|Polarity=Pos|Tense=Past|VerbForm=Part|Voice=Cau	44	acl	_	_
44	erkeye	erke	NOUN	Noun	Case=Dat|Number=Sing|Person=3	45	obl	_	_
45	denk	denk	ADJ	NAdj	Case=Nom|Number=Sing|Person=3	21	conj	_	_
46	olacaktır	ol	VERB	Verb	Aspect=Perf|Mood=Gen|Number=Sing|Person=3|Polarity=Pos|Tense=Fut	45	compound:lvc	_	SpaceAfter=No
47	.	.	PUNCT	Punc	_	45	punct	_	_

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
function modal () {
  $("#modal-1").on("change", function() {
    if ($(this).is(":checked")) {
      $("body").addClass("modal-open");
    } else {
      $("body").removeClass("modal-open");
    }
  });

  $(".modal-close").on("click", function() {
    $(".modal-state:checked").prop("checked", false).change();
  });

  $(".modal-inner").on("click", function(e) {
    e.stopPropagation();
  });
}


text:
using OpenTK;
using System;
using System.Diagnostics;

//
// David Young 2016
// Code taken from the GameWindow.cs, INativeWindow.cs, NativeWindow.cs
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//

namespace TextureDemo
{
    class GameWindow : IDisposable
    {
        const double MaxFrequency = 500.0; // Frequency cap for Update/RenderFrame events

        readonly Stopwatch watch = new Stopwatch();

        double target_update_period, target_render_period;

        private INativeWindow implementation;

        bool isExiting = false;
        bool events;

        /// <summary>
        /// System.Threading.Thread.CurrentThread.ManagedThreadId of the thread that created this <see cref="OpenTK.NativeWindow"/>.
        /// </summary>
        private int thread_id;

        //private bool events;

        double update_period;
        double render_period;
        double update_timestamp; // timestamp of last UpdateFrame event
        double render_timestamp; // timestamp of last RenderFrame event
        double update_epsilon; // quantization error for UpdateFrame events

        double render_time; // length of last RenderFrame event
        double update_time; // length of last UpdateFrame event

        bool is_running_slowly; // true, when UpdatePeriod cannot reach TargetUpdatePeriod

        public GameWindow(INativeWindow window)
        {
            implementation = window;

            this.thread_id = System.Threading.Thread.CurrentThread.ManagedThreadId;
        }

        #region EnsureUndisposed

        /// <summary>
        /// Ensures that this NativeWindow has not been disposed.
        /// </summary>
        /// <exception cref="System.ObjectDisposedException">
        /// If this NativeWindow has been disposed.
        /// </exception>
        protected void EnsureUndisposed()
        {
            if (mIsDisposed) throw new ObjectDisposedException(GetType().Name);
        }

        #endregion

        #region Visible

        /// <summary>
        /// Gets or sets a System.Boolean that indicates whether this NativeWindow is visible.
        /// </summary>
        public bool Visible
        {
            get
            {
                EnsureUndisposed();
                return implementation.Visible;
            }
            set
            {
                EnsureUndisposed();
                implementation.Visible = value;
            }
        }

        #endregion

        #region TargetUpdatePeriod

        /// <summary>
        /// Gets or sets a double representing the target update period, in seconds.
        /// </summary>
        /// <remarks>
        /// <para>A value of 0.0 indicates that UpdateFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para>
        /// <para>Values lower than 0.002 seconds (500Hz) are clamped to 0.0. Values higher than 1.0 seconds (1Hz) are clamped to 1.0.</para>
        /// </remarks>
        public double TargetUpdatePeriod
        {
            get
            {
                EnsureUndisposed();
                return target_update_period;
            }
            set
            {
                EnsureUndisposed();
                if (value <= 1 / MaxFrequency)
                {
                    target_update_period = 0.0;
                }
                else if (value <= 1.0)
                {
                    target_update_period = value;
                }
                else Debug.Print("Target update period clamped to 1.0 seconds.");
            }
        }

        #endregion

        #region TargetUpdateFrequency

        /// <summary>
        /// Gets or sets a double representing the target update frequency, in hertz.
        /// </summary>
        /// <remarks>
        /// <para>A value of 0.0 indicates that UpdateFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para>
        /// <para>Values lower than 1.0Hz are clamped to 0.0. Values higher than 500.0Hz are clamped to 500.0Hz.</para>
        /// </remarks>
        public double TargetUpdateFrequency
        {
            get
            {
                EnsureUndisposed();
                if (TargetUpdatePeriod == 0.0)
                    return 0.0;
                return 1.0 / TargetUpdatePeriod;
            }
            set
            {
                EnsureUndisposed();
                if (value < 1.0)
                {
                    TargetUpdatePeriod = 0.0;
                }
                else if (value <= MaxFrequency)
                {
                    TargetUpdatePeriod = 1.0 / value;
                }
                else Debug.Print("Target render frequency clamped to {0}Hz.", MaxFrequency);
            }
        }

        #endregion

        /// <summary>
        /// Enters the game loop of the GameWindow updating and rendering at the specified frequency.
        /// </summary>
        /// <remarks>
        /// When overriding the default game loop you should call ProcessEvents()
        /// to ensure that your GameWindow responds to operating system events.
        /// <para>
        /// Once ProcessEvents() returns, it is time to call update and render the next frame.
        /// </para>
        /// </remarks>
        /// <param name="updates_per_second">The frequency of UpdateFrame events.</param>
        /// <param name="frames_per_second">The frequency of RenderFrame events.</param>
        public void Run(double updates_per_second, double frames_per_second)
        {
            EnsureUndisposed();

            try
            {
                if (updates_per_second < 0.0 || updates_per_second > 200.0)
                    throw new ArgumentOutOfRangeException("updates_per_second", updates_per_second,
                                                          "Parameter should be inside the range [0.0, 200.0]");
                if (frames_per_second < 0.0 || frames_per_second > 200.0)
                    throw new ArgumentOutOfRangeException("frames_per_second", frames_per_second,
                                                          "Parameter should be inside the range [0.0, 200.0]");

                if (updates_per_second != 0)
                {
                    TargetUpdateFrequency = updates_per_second;
                }
                if (frames_per_second != 0)
                {
                    TargetRenderFrequency = frames_per_second;
                }

                Visible = true;   // Make sure the GameWindow is visible.
                //OnLoadInternal(EventArgs.Empty);
                //OnResize(EventArgs.Empty);

                // On some platforms, ProcessEvents() does not return while the user is resizing or moving
                // the window. We can avoid this issue by raising UpdateFrame and RenderFrame events
                // whenever we encounter a size or move event.
                // Note: hack disabled. Threaded rendering provides a better solution to this issue.
                //Move += DispatchUpdateAndRenderFrame;
                //Resize += DispatchUpdateAndRenderFrame;

                Debug.Print("Entering main loop.");
                watch.Start();
                while (true)
                {
                    ProcessEvents(false);
                    if (Exists && !IsExiting)
                        DispatchUpdateAndRenderFrame(this, EventArgs.Empty);
                    else
                        return;
                }
            }
            finally
            {
                Move -= DispatchUpdateAndRenderFrame;
                Resize -= DispatchUpdateAndRenderFrame;

                if (Exists)
                {
                    // TODO: Should similar behaviour be retained, possibly on native window level?
                    //while (this.Exists)
                    //    ProcessEvents(false);
                }
            }
        }

        /// <summary>This member is not supported.</summary>
        /// <value>To be added.</value>
        /// <remarks>
        ///   <para>
        ///     Throws a <see cref="T:System.NotSupportedException" />.
        ///   </para>
        /// </remarks>
        public event EventHandler<EventArgs> Move = delegate { };

        /// <summary>
        ///   Occurs when the view's
        ///   <see cref="P:OpenTK.Platform.Android.AndroidGameView.Size" />
        ///   changes.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public event EventHandler<EventArgs> Resize = delegate { };

        void DispatchUpdateAndRenderFrame(object sender, EventArgs e)
        {
            int is_running_slowly_retries = 4;
            double timestamp = watch.Elapsed.TotalSeconds;
            double elapsed = 0;

            elapsed = ClampElapsed(timestamp - update_timestamp);
            while (elapsed > 0 && elapsed + update_epsilon >= TargetUpdatePeriod)
            {
                RaiseUpdateFrame(elapsed, ref timestamp);

                // Calculate difference (positive or negative) between
                // actual elapsed time and target elapsed time. We must
                // compensate for this difference.
                update_epsilon += elapsed - TargetUpdatePeriod;

                // Prepare for next loop
                elapsed = ClampElapsed(timestamp - update_timestamp);

                if (TargetUpdatePeriod <= Double.Epsilon)
                {
                    // According to the TargetUpdatePeriod documentation,
                    // a TargetUpdatePeriod of zero means we will raise
                    // UpdateFrame events as fast as possible (one event
                    // per ProcessEvents() call)
                    break;
                }

                is_running_slowly = update_epsilon >= TargetUpdatePeriod;
                if (is_running_slowly && --is_running_slowly_retries == 0)
                {
                    // If UpdateFrame consistently takes longer than TargetUpdateFrame
                    // stop raising events to avoid hanging inside the UpdateFrame loop.
                    break;
                }
            }

            elapsed = ClampElapsed(timestamp - render_timestamp);
            if (elapsed > 0 && elapsed >= TargetRenderPeriod)
            {
                RaiseRenderFrame(elapsed, ref timestamp);
            }
        }

        void RaiseUpdateFrame(double elapsed, ref double timestamp)
        {
            // Raise UpdateFrame event
            OnUpdateFrameInternal(new FrameEventArgs(elapsed));

            // Update UpdatePeriod/UpdateFrequency properties
            update_period = elapsed;

            // Update UpdateTime property
            update_timestamp = timestamp;
            timestamp = watch.Elapsed.TotalSeconds;
            update_time = timestamp - update_timestamp;
        }

        /// <summary>
        /// Occurs when it is time to update a frame.
        /// </summary>
        public event EventHandler<FrameEventArgs> UpdateFrame = delegate { };

        #region OnUpdateFrame

        /// <summary>
        /// Called when the frame is updated.
        /// </summary>
        /// <param name="e">Contains information necessary for frame updating.</param>
        /// <remarks>
        /// Subscribe to the <see cref="UpdateFrame"/> event instead of overriding this method.
        /// </remarks>
        protected virtual void OnUpdateFrame(FrameEventArgs e)
        {
            UpdateFrame(this, e);
        }

        #endregion

        #region OnUpdateFrameInternal

        private void OnUpdateFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnUpdateFrame(e); }

        #endregion

        public event EventHandler<FrameEventArgs> RenderFrame = delegate { };

        #region OnRenderFrame

        /// <summary>
        /// Called when the frame is rendered.
        /// </summary>
        /// <param name="e">Contains information necessary for frame rendering.</param>
        /// <remarks>
        /// Subscribe to the <see cref="RenderFrame"/> event instead of overriding this method.
        /// </remarks>
        protected virtual void OnRenderFrame(FrameEventArgs e)
        {
            RenderFrame(this, e);
        }

        #endregion

        #region OnRenderFrameInternal

        private void OnRenderFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnRenderFrame(e); }

        #endregion

        void RaiseRenderFrame(double elapsed, ref double timestamp)
        {
            // Raise RenderFrame event
            OnRenderFrameInternal(new FrameEventArgs(elapsed));

            // Update RenderPeriod/UpdateFrequency properties
            render_period = elapsed;

            // Update RenderTime property
            render_timestamp = timestamp;
            timestamp = watch.Elapsed.TotalSeconds;
            render_time = timestamp - render_timestamp;
        }

        double ClampElapsed(double elapsed)
        {
            return MathHelper.Clamp(elapsed, 0.0, 1.0);
        }

        #region IsExiting

        /// <summary>
        /// Gets a value indicating whether the shutdown sequence has been initiated
        /// for this window, by calling GameWindow.Exit() or hitting the 'close' button.
        /// If this property is true, it is no longer safe to use any OpenTK.Input or
        /// OpenTK.Graphics.OpenGL functions or properties.
        /// </summary>
        public bool IsExiting
        {
            get
            {
                EnsureUndisposed();
                return isExiting;
            }
        }

        #endregion

        #region Exists

        /// <summary>
        /// Gets a value indicating whether a render window exists.
        /// </summary>
        public bool Exists
        {
            get
            {
                return mIsDisposed ? false : implementation.Exists; // TODO: Should disposed be ignored instead?
            }
        }

        #endregion

        #region ProcessEvents

        /// <summary>
        /// Processes operating system events until the NativeWindow becomes idle.
        /// </summary>
        /// <param name="retainEvents">If true, the state of underlying system event propagation will be preserved, otherwise event propagation will be enabled if it has not been already.</param>
        protected void ProcessEvents(bool retainEvents)
        {
            EnsureUndisposed();
            if (this.thread_id != System.Threading.Thread.CurrentThread.ManagedThreadId)
            {
                throw new InvalidOperationException("ProcessEvents must be called on the same thread that created the window.");
            }
            if (!retainEvents && !events) Events = true;
            implementation.ProcessEvents();
        }

        #endregion

        #region OnMove

        /// <summary>
        /// Called when the NativeWindow is moved.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected virtual void OnMove(EventArgs e)
        {
            Move(this, e);
        }

        #endregion

        #region OnMoveInternal

        private void OnMoveInternal(object sender, EventArgs e) { OnMove(e); }

        #endregion

        #region OnResize

        /// <summary>
        /// Called when the NativeWindow is resized.
        /// </summary>
        /// <param name="e">Not used.</param>
        protected virtual void OnResize(EventArgs e)
        {
            Resize(this, e);
        }

        #endregion

        #region OnResizeInternal

        private void OnResizeInternal(object sender, EventArgs e) { OnResize(e); }

        #endregion

        #region Events

        private bool Events
        {
            set
            {
                if (value)
                {
                    if (events)
                    {
                        throw new InvalidOperationException("Event propagation is already enabled.");
                    }
                    implementation.Move += OnMoveInternal;
                    implementation.Resize += OnResizeInternal;
                    events = true;
                }
                else if (events)
                {
                    implementation.Move -= OnMoveInternal;
                    implementation.Resize -= OnResizeInternal;
                    events = false;
                }
                else
                {
                    throw new InvalidOperationException("Event propagation is already disabled.");
                }
            }
        }

        #endregion

        #region TargetRenderFrequency

        /// <summary>
        /// Gets or sets a double representing the target render frequency, in hertz.
        /// </summary>
        /// <remarks>
        /// <para>A value of 0.0 indicates that RenderFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para>
        /// <para>Values lower than 1.0Hz are clamped to 0.0. Values higher than 500.0Hz are clamped to 200.0Hz.</para>
        /// </remarks>
        public double TargetRenderFrequency
        {
            get
            {
                EnsureUndisposed();
                if (TargetRenderPeriod == 0.0)
                    return 0.0;
                return 1.0 / TargetRenderPeriod;
            }
            set
            {
                EnsureUndisposed();
                if (value < 1.0)
                {
                    TargetRenderPeriod = 0.0;
                }
                else if (value <= MaxFrequency)
                {
                    TargetRenderPeriod = 1.0 / value;
                }
                else Debug.Print("Target render frequency clamped to {0}Hz.", MaxFrequency);
            }
        }

        #endregion

        #region TargetRenderPeriod

        /// <summary>
        /// Gets or sets a double representing the target render period, in seconds.
        /// </summary>
        /// <remarks>
        /// <para>A value of 0.0 indicates that RenderFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para>
        /// <para>Values lower than 0.002 seconds (500Hz) are clamped to 0.0. Values higher than 1.0 seconds (1Hz) are clamped to 1.0.</para>
        /// </remarks>
        public double TargetRenderPeriod
        {
            get
            {
                EnsureUndisposed();
                return target_render_period;
            }
            set
            {
                EnsureUndisposed();
                if (value <= 1 / MaxFrequency)
                {
                    target_render_period = 0.0;
                }
                else if (value <= 1.0)
                {
                    target_render_period = value;
                }
                else Debug.Print("Target render period clamped to 1.0 seconds.");
            }
        }

        #endregion

        #region IDisposable Support
        private bool mIsDisposed = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (mIsDisposed)
            {
                return;
            }

            if (disposing)
            {
                // TODO: dispose managed state (managed objects).
            }

            // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
            // TODO: set large fields to null.

            mIsDisposed = true;

        }

        // This code added to correctly implement the disposable pattern.
        public void Dispose()
        {
            // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
            Dispose(true);
            // TODO: uncomment the following line if the finalizer is overridden above.
            // GC.SuppressFinalize(this);
        }
        #endregion
    }
}


text:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;

namespace Buldo.AspNetCore.SpaServices.Extensions.Utils
{
    internal static class LoggerFinder
    {
        public static ILogger GetOrCreateLogger(
            IApplicationBuilder appBuilder,
            string logCategoryName)
        {
            // If the DI system gives us a logger, use it. Otherwise, set up a default one.
            var loggerFactory = appBuilder.ApplicationServices.GetService<ILoggerFactory>();
            var logger = loggerFactory != null
                ? loggerFactory.CreateLogger(logCategoryName)
                : new ConsoleLogger(logCategoryName, null, false);
            return logger;
        }
    }
}


text:
require 'spec_helper'

describe VoodooSMS do
  let(:client) { VoodooSMS.new('username', 'password') }
end


text:
package com.google.storagetransfer.v1.proto;

import com.google.api.core.BetaApi;
import com.google.longrunning.Operation;
import com.google.protobuf.AbstractMessage;
import com.google.protobuf.Empty;
import com.google.storagetransfer.v1.proto.StorageTransferServiceGrpc.StorageTransferServiceImplBase;
import io.grpc.stub.StreamObserver;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import javax.annotation.Generated;

@BetaApi
@Generated("by gapic-generator-java")
public class MockStorageTransferServiceImpl extends StorageTransferServiceImplBase {
  private List<AbstractMessage> requests;
  private Queue<Object> responses;

  public MockStorageTransferServiceImpl() {
    requests = new ArrayList<>();
    responses = new LinkedList<>();
  }

  public List<AbstractMessage> getRequests() {
    return requests;
  }

  public void addResponse(AbstractMessage response) {
    responses.add(response);
  }

  public void setResponses(List<AbstractMessage> responses) {
    this.responses = new LinkedList<Object>(responses);
  }

  public void addException(Exception exception) {
    responses.add(exception);
  }

  public void reset() {
    requests = new ArrayList<>();
    responses = new LinkedList<>();
  }

  @Override
  public void getGoogleServiceAccount(
      TransferProto.GetGoogleServiceAccountRequest request,
      StreamObserver<TransferTypes.GoogleServiceAccount> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.GoogleServiceAccount) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.GoogleServiceAccount) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method GetGoogleServiceAccount, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.GoogleServiceAccount.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void createTransferJob(
      TransferProto.CreateTransferJobRequest request,
      StreamObserver<TransferTypes.TransferJob> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.TransferJob) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.TransferJob) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method CreateTransferJob, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.TransferJob.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void updateTransferJob(
      TransferProto.UpdateTransferJobRequest request,
      StreamObserver<TransferTypes.TransferJob> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.TransferJob) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.TransferJob) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method UpdateTransferJob, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.TransferJob.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void getTransferJob(
      TransferProto.GetTransferJobRequest request,
      StreamObserver<TransferTypes.TransferJob> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.TransferJob) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.TransferJob) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method GetTransferJob, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.TransferJob.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void listTransferJobs(
      TransferProto.ListTransferJobsRequest request,
      StreamObserver<TransferProto.ListTransferJobsResponse> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferProto.ListTransferJobsResponse) {
      requests.add(request);
      responseObserver.onNext(((TransferProto.ListTransferJobsResponse) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method ListTransferJobs, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferProto.ListTransferJobsResponse.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void pauseTransferOperation(
      TransferProto.PauseTransferOperationRequest request, StreamObserver<Empty> responseObserver) {
    Object response = responses.poll();
    if (response instanceof Empty) {
      requests.add(request);
      responseObserver.onNext(((Empty) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method PauseTransferOperation, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  Empty.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void resumeTransferOperation(
      TransferProto.ResumeTransferOperationRequest request,
      StreamObserver<Empty> responseObserver) {
    Object response = responses.poll();
    if (response instanceof Empty) {
      requests.add(request);
      responseObserver.onNext(((Empty) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method ResumeTransferOperation, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  Empty.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void runTransferJob(
      TransferProto.RunTransferJobRequest request, StreamObserver<Operation> responseObserver) {
    Object response = responses.poll();
    if (response instanceof Operation) {
      requests.add(request);
      responseObserver.onNext(((Operation) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method RunTransferJob, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  Operation.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void deleteTransferJob(
      TransferProto.DeleteTransferJobRequest request, StreamObserver<Empty> responseObserver) {
    Object response = responses.poll();
    if (response instanceof Empty) {
      requests.add(request);
      responseObserver.onNext(((Empty) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method DeleteTransferJob, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  Empty.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void createAgentPool(
      TransferProto.CreateAgentPoolRequest request,
      StreamObserver<TransferTypes.AgentPool> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.AgentPool) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.AgentPool) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method CreateAgentPool, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.AgentPool.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void updateAgentPool(
      TransferProto.UpdateAgentPoolRequest request,
      StreamObserver<TransferTypes.AgentPool> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.AgentPool) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.AgentPool) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method UpdateAgentPool, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.AgentPool.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void getAgentPool(
      TransferProto.GetAgentPoolRequest request,
      StreamObserver<TransferTypes.AgentPool> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferTypes.AgentPool) {
      requests.add(request);
      responseObserver.onNext(((TransferTypes.AgentPool) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method GetAgentPool, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferTypes.AgentPool.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void listAgentPools(
      TransferProto.ListAgentPoolsRequest request,
      StreamObserver<TransferProto.ListAgentPoolsResponse> responseObserver) {
    Object response = responses.poll();
    if (response instanceof TransferProto.ListAgentPoolsResponse) {
      requests.add(request);
      responseObserver.onNext(((TransferProto.ListAgentPoolsResponse) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method ListAgentPools, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  TransferProto.ListAgentPoolsResponse.class.getName(),
                  Exception.class.getName())));
    }
  }

  @Override
  public void deleteAgentPool(
      TransferProto.DeleteAgentPoolRequest request, StreamObserver<Empty> responseObserver) {
    Object response = responses.poll();
    if (response instanceof Empty) {
      requests.add(request);
      responseObserver.onNext(((Empty) response));
      responseObserver.onCompleted();
    } else if (response instanceof Exception) {
      responseObserver.onError(((Exception) response));
    } else {
      responseObserver.onError(
          new IllegalArgumentException(
              String.format(
                  "Unrecognized response type %s for method DeleteAgentPool, expected %s or %s",
                  response == null ? "null" : response.getClass().getName(),
                  Empty.class.getName(),
                  Exception.class.getName())));
    }
  }
}


text:
<?php
/*********************************************************************************
 * Developed by Maxx Ng'ang'a
 * (C) 2017 Crysoft Dynamics Ltd
 * Karbon V 2.1
 * User: Maxx
 * Date: 5/9/2017
 * Time: 4:57 PM
 ********************************************************************************/

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="AppBundle\Repository\GrowerAgentRepository")
 * @ORM\Table(name="grower_agent")
 */
class GrowerAgent
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="UUID")
     * @ORM\Column(type="string")
     */
    private $id;
    /**
     * @ORM\ManyToOne(targetEntity="Company",inversedBy="agentGrowers")
     * @ORM\JoinColumn(nullable=false)
     */
    private $agent;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Company",inversedBy="growerAgents")
     * @ORM\JoinColumn(nullable=false)
     */
    private $grower;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Company")
     */
    private $listOwner;
    /**
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
     */
    private $agentListOwner;

    /**
     * @ORM\Column(type="string")
     */
    private $status;
    /**
     * @ORM\Column(type="datetime",nullable=true)
     */
    private $dateSince;
    /**
     * @ORM\Column(type="datetime")
     */
    private $updatedAt;

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return mixed
     */
    public function getAgent()
    {
        return $this->agent;
    }

    /**
     * @param mixed $agent
     */
    public function setAgent($agent)
    {
        $this->agent = $agent;
    }

    /**
     * @return mixed
     */
    public function getGrower()
    {
        return $this->grower;
    }

    /**
     * @param mixed $grower
     */
    public function setGrower($grower)
    {
        $this->grower = $grower;
    }

    /**
     * @return mixed
     */
    public function getListOwner()
    {
        return $this->listOwner;
    }

    /**
     * @param mixed $listOwner
     */
    public function setListOwner($listOwner)
    {
        $this->listOwner = $listOwner;
    }

    /**
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param mixed $status
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }

    /**
     * @return mixed
     */
    public function getDateSince()
    {
        return $this->dateSince;
    }

    /**
     * @param mixed $dateSince
     */
    public function setDateSince($dateSince)
    {
        $this->dateSince = $dateSince;
    }

    /**
     * @return mixed
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * @param mixed $updatedAt
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;
    }

    /**
     * @return mixed
     */
    public function getAgentListOwner()
    {
        return $this->agentListOwner;
    }

    /**
     * @param mixed $agentListOwner
     */
    public function setAgentListOwner($agentListOwner)
    {
        $this->agentListOwner = $agentListOwner;
    }

}