text:
require 'sequel'
require 'json'

require_relative './exceptions.rb'

module Moose
  module Inventory
    ##
    # Module for DB-related functionality
    module DB
      # rubocop:disable Style/ModuleFunction
      extend self
      # rubocop:enable Style/ModuleFunction

      @db         = nil
      @models     = nil
      @exceptions = nil

      attr_reader :db
      attr_reader :models
      attr_reader :exceptions

      #----------------------
      def self.init
        # If we allow init more than once, then the db connection is remade,
        # which changes Sequel:DATABASES[0], thereby invalidating the sequel
        # models.  This causes unexpected behavour. That is to say, because
        # of the way Sequel initializes models, this method is not idempotent.
        # In our single-shot application, this shouldn't be a problem. However,
        # our unit tests like to call init multiple times, which borks things.
        # So, we allow init only once, gated by whether @db is nil. In effect,
        # this means we pool the DB connection for the life of the application.
        # Again, not a problem for our one-shot app, but it may be an issue in
        # long-running code. Personally, I don't like this pooling regime -
        # perhaps I'm not understanding how it's supposed to be used?
        #
        # QUESTION: can the models be refreshed, to make then again valid? What if
        #       we "load" instead of "require" the models?
        # ANSWER: Nope, still borks even if we use a load.
        #
        # @db = nil            # <- fails for unit tests
        return unless @db.nil? # <- works for unit tests

        Sequel::Model.plugin :json_serializer
        connect
        create_tables

        # Make our models work
        Sequel::DATABASES[0] = @db
        require_relative 'models'
        # load( load_dir = File.join(File.dirname(__FILE__), "models.rb") )

        # For convenience
        @models = {}
        @models[:host]     = Moose::Inventory::DB::Host
        @models[:hostvar]  = Moose::Inventory::DB::Hostvar
        @models[:group]    = Moose::Inventory::DB::Group
        @models[:groupvar] = Moose::Inventory::DB::Groupvar

        @exceptions = {}
        @exceptions[:moose] = Moose::Inventory::DB::MooseDBException
      end

      #--------------------
      def self.transaction
        fail('Database connection has not been established') if @db.nil?

        tries = 0

        begin
          @db.transaction(savepoint: true) do
            yield
          end

        rescue Sequel::DatabaseError => e
          # We want to rescue Sqlite3::BusyException.  But, sequel catches that
          # and re-raises it as Sequel::DatabaseError, with a message referencing
          # the original exception class

          # We look into e, to see whether it is a BusyException.  If not,
          # we re-raise immediately.
          raise unless e.message.include?('BusyException')

          # Looks like a BusyException, so we retry, after a random delay.
          tries += 1
          case tries
          when 1..10
            if Moose::Inventory::Config._confopts[:trace] == true
              STDERR.puts e.message
            end
            sleep rand
            retry
          else
            warn('The database appears to be locked by another process, and '\
                 " did not become free after #{tries} tries. Giving up. ")

            # TODO: Some useful advice to the user, as to what to do about this error.
            raise
          end

        rescue @exceptions[:moose] => e
          warn 'An error occurred during a transaction, any changes have been rolled back.'

          if Moose::Inventory::Config._confopts[:trace] == true
            STDERR.puts $ERROR_INFO.backtrace
            abort("ERROR: #{e}")
          else
            abort("ERROR: #{e.message}")
          end

        rescue Exception => e
          warn 'An error occurred during a transaction, any changes have been rolled back.'
          raise e
        end
      end

      #--------------------
      def self.reset
        fail('Database connection has not been established') if @db.nil?
        # @debug << 'reset'
        purge
        create_tables
      end

      #===============================

      private

      #--------------------
      def self.purge # rubocop:disable Metrics/AbcSize
        adapter = Moose::Inventory::Config._settings[:config][:db][:adapter]
        adapter.downcase!

        if adapter == 'sqlite3'
          # HACK: SQLite3 supposedly supports CASCADE, see
          # https://www.sqlite.org/foreignkeys.html#fk_actions
          # However, when we do a drop_table with :cascade=>true
          # on an sqlite3 database, it throws errors regarding
          # foreign keys constraints. Instead, the following is
          # less efficient, but does work.

          Group.all.each do |g|
            g.remove_all_hosts
            g.remove_all_groupvars
            g.remove_all_children
            g.destroy
          end

          Host.all.each do |h|
            h.remove_all_groups
            h.remove_all_hostvars
            h.destroy
          end

          Groupvar.all.each(&:destroy)
          Hostvar.all.each(&:destroy)

        else
          @db.drop_table(:hosts, :hostvars,
                         :groups, :groupvars, :group_hosts,
                         if_exists: true, cascade: true)
        end
      end

      #--------------------
      def self.create_tables # rubocop:disable Metrics/AbcSize
        unless @db.table_exists? :hosts
          @db.create_table(:hosts) do
            primary_key :id
            column :name, :text, unique: true
          end
        end

        unless @db.table_exists? :hostvars
          @db.create_table(:hostvars) do
            primary_key :id
            foreign_key :host_id
            column :name, :text
            column :value, :text
          end
        end

        unless @db.table_exists? :groups
          @db.create_table(:groups) do
            primary_key :id
            column :name, :text, unique: true
          end
        end

        unless @db.table_exists? :groups_groups
          @db.create_table(:groups_groups) do
            primary_key :id
            foreign_key :parent_id, :groups
            foreign_key :child_id,  :groups
          end
        end

        unless @db.table_exists? :groupvars
          @db.create_table(:groupvars) do
            primary_key :id
            foreign_key :group_id
            column :name, :text
            column :value, :text
          end
        end

        unless @db.table_exists? :groups_hosts
          @db.create_table(:groups_hosts) do
            primary_key :id
            foreign_key :host_id,  :hosts
            foreign_key :group_id, :groups
          end
        end
      end

      #--------------------
      def self.connect
        return unless @db.nil?

        adapter = Moose::Inventory::Config._settings[:config][:db][:adapter]
        adapter.downcase!

        case adapter
        when 'sqlite3'
          init_sqlite3

        when 'msqsql'
          init_mysql

        when 'postgresql'
          init_postgresql

        else
          fail @exceptions[:moose],
               "database adapter #{adapter} is not yet supported."
        end
      end

      #--------------------
      def self.init_sqlite3 # rubocop:disable Metrics/AbcSize
        require 'sqlite3'

        # Quick check that expected keys are at least present & sensible
        config = Moose::Inventory::Config._settings[:config][:db]
        [:file].each do |key|
          if config[key].nil?
            fail @exceptions[:moose],
                 "Expected key #{key} missing in sqlite3 configuration"
          end
        end
        config[:file].empty? && fail("SQLite3 DB 'file' cannot be empty")

        # Make sure the directory exists
        dbfile = File.expand_path(config[:file])
        dbdir = File.dirname(dbfile)
        Dir.mkdir(dbdir) unless Dir.exist?(dbdir)

        # Create and/or open the database file
        @db = Sequel.sqlite(dbfile)
      end

      #--------------------
      def self.init_mysql
        require 'mysql'

        # TODO: native MySQL driver vs the pure ruby one?
        #       Sequel requires the native on.
        # gem('mysql')

        # Quick check that expected keys are at least present
        config = Moose::Inventory::Config._settings[:config][:db]
        [:host, :database, :user, :password].each do |key|
          if config[key].nil?
            fail @exceptions[:moose],
                 "Expected key #{key} missing in mysql configuration"
          end
        end

        @db = Sequel.mysql(user: config[:user],
                           password: config[:password],
                           host: config[:host],
                           database: config[:database])
      end
    end
  end
end


text:
Prolog Prototype of SHACL axiomatic semantics

http://labra.github.io/Haws/shacl/index.html

Author: Jose Emilio Labra Gayo

redpajama_set_name: RedPajamaGithub


text:
import * as Module from '../../ts/index';
import * as nock from 'nock';
import {Fixtures} from '../fixtures/Fixtures';
import {expect} from 'chai';

/* tslint:disable:no-backbone-get-set-outside-model */
describe('Transfers Class', () => {
    const putioClient: Module.Client = new Module.Client('testToken');

    describe('GET /transfers/<id>', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const transferId: number = 36738408;
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.id.get.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .get(`/transfers/${transferId}`)
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.getTransferId(transferId).then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });

        it('Should return an error if bad request', (done: Function) => {

            const transferId: number = 36738408;
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.id.get.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .get(`/transfers/${transferId}`)
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.getTransferId(transferId).then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });
        });

    });

    describe('GET /transfers/list', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.list.get.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .get('/transfers/list')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.getTransfersList().then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });
        });

        it('Should return an error if bad request', (done: Function) => {

            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.list.get.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .get('/transfers/list')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.getTransfersList().then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });
        });
    });

    describe('POST /transfers/add-multi', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const urlToDownload: string[] = [];
            urlToDownload.push('{"url":"magnet:?xt=ahbytwohq0,"email_when_complete":false,"save_parent_id":0}');
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.add.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/add-multi')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.addTransfer(urlToDownload).then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });
        it('Should return an error if bad request', (done: Function) => {

            const urlToDownload: string[] = [];
            urlToDownload.push('{"url":"magnet:?xt=ahbytwohq0","email_when_complete":false,"save_parent_id":0}');
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.add.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/add-multi')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.addTransfer(urlToDownload).then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });

        });
    });
    describe('POST /transfers/info', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const urlToDownload: string = 'magnet:?xt=ahbytwohq0';
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.info.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/info')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.getTransferInfo(urlToDownload).then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });
        it('Should return an error if bad request', (done: Function) => {

            const urlToDownload: string = 'magnet:?xt=ahbytwohq0';
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.info.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/info')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.getTransferInfo(urlToDownload).then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });
        });

    });
    describe('POST /transfers/cancel', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const transferId: number[] = [36738408];
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.cancel.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/cancel')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.cancelTransfers(transferId).then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });
        it('Should return an error if bad request', (done: Function) => {

            const transferId: number[] = [36738408];
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.cancel.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/cancel')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.cancelTransfers(transferId).then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });

        });
    });
    describe('POST /transfers/clean', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.clean.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/clean')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.cleanTransfers().then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });

        it('Should return an error if bad request', (done: Function) => {

            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.clean.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/clean')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.cleanTransfers().then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });

        });
    });
    describe('POST /transfers/retry', () => {
        it('Should return valid response if parameters are valid', (done: Function) => {

            const transferId: number = 36738408;
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.retry.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/retry')
            .query(true)
            .reply(200, info.fixtureData);

            putioClient.transfers.retryTransfer(transferId).then((result: string) => {
                expect(result).to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done(err);
            });

        });
        it('Should return an error if bad request', (done: Function) => {

            const transferId: number = 36738408;
            const info: Fixtures = new Fixtures('../fixtures/transfers/transfers.retry.post.response.json');
            nock('https://api.put.io/v2')
            .defaultReplyHeaders({'Content-Type': 'application/json'})
            .post('/transfers/retry')
            .query(true)
            .reply(400, 'Bad Request');

            putioClient.transfers.retryTransfer(transferId).then((result: string) => {
                expect(result).not.to.equal(JSON.stringify(info.fixtureData));
                done();
            }).catch(err => {
                expect(err).to.contain('Error:');
                done();
            });

        });
    });
});


text: The Space Race game repository


text:
require 'spec_helper.rb'

describe 'User' do
  it "can create" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                       .users.create(identity: "identity")
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {'Identity' => "identity",}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'post',
        url: 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users',
        data: values,
    ))).to eq(true)
  end

  it "receives create responses" do
    @holodeck.mock(Twilio::Response.new(
        201,
      %q[
      {
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "date_created": "2017-02-17T07:17:02Z",
          "date_updated": "2017-02-17T07:17:02Z",
          "identity": "identity",
          "links": {
              "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings",
              "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships"
          },
          "segments": [
              "segment1"
          ],
          "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity"
      }
      ]
    ))

    actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .users.create(identity: "identity")

    expect(actual).to_not eq(nil)
  end

  it "can delete" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                       .users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'delete',
        url: 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    ))).to eq(true)
  end

  it "receives delete responses" do
    @holodeck.mock(Twilio::Response.new(
        204,
      nil,
    ))

    actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()

    expect(actual).to eq(true)
  end

  it "can fetch" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                       .users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    ))).to eq(true)
  end

  it "receives fetch responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "date_created": "2017-02-17T07:17:02Z",
          "date_updated": "2017-02-17T07:17:02Z",
          "identity": "identity",
          "links": {
              "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings",
              "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships"
          },
          "segments": [
              "segment1"
          ],
          "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity"
      }
      ]
    ))

    actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()

    expect(actual).to_not eq(nil)
  end

  it "can read" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                       .users.list()
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users',
    ))).to eq(true)
  end

  it "receives read_empty responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "users": [],
          "meta": {
              "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0",
              "key": "users",
              "next_page_url": null,
              "page": 0,
              "page_size": 50,
              "previous_page_url": null,
              "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0"
          }
      }
      ]
    ))

    actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .users.list()

    expect(actual).to_not eq(nil)
  end

  it "receives read_full responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "users": [
              {
                  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                  "date_created": "2017-02-17T07:17:02Z",
                  "date_updated": "2017-02-17T07:17:02Z",
                  "identity": "identity",
                  "links": {
                      "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings",
                      "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships"
                  },
                  "segments": [
                      "segment1"
                  ],
                  "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                  "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                  "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity"
              }
          ],
          "meta": {
              "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0",
              "key": "users",
              "next_page_url": null,
              "page": 0,
              "page_size": 50,
              "previous_page_url": null,
              "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0"
          }
      }
      ]
    ))

    actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
                              .users.list()

    expect(actual).to_not eq(nil)
  end
end


text:
<?php
// GENERATED CODE -- DO NOT EDIT!

// Original file comments:
// Copyright 2022 Google LLC
//
// 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.
//
namespace Google\Ads\GoogleAds\V10\Services;

/**
 * Proto file describing the AccountBudgetProposal service.
 *
 * A service for managing account-level budgets via proposals.
 *
 * A proposal is a request to create a new budget or make changes to an
 * existing one.
 *
 * Mutates:
 * The CREATE operation creates a new proposal.
 * UPDATE operations aren't supported.
 * The REMOVE operation cancels a pending proposal.
 */
class AccountBudgetProposalServiceGrpcClient extends \Grpc\BaseStub {

    /**
     * @param string $hostname hostname
     * @param array $opts channel options
     * @param \Grpc\Channel $channel (optional) re-use channel object
     */
    public function __construct($hostname, $opts, $channel = null) {
        parent::__construct($hostname, $opts, $channel);
    }

    /**
     * Creates, updates, or removes account budget proposals.  Operation statuses
     * are returned.
     *
     * List of thrown errors:
     *   [AccountBudgetProposalError]()
     *   [AuthenticationError]()
     *   [AuthorizationError]()
     *   [DatabaseError]()
     *   [DateError]()
     *   [FieldError]()
     *   [FieldMaskError]()
     *   [HeaderError]()
     *   [InternalError]()
     *   [MutateError]()
     *   [QuotaError]()
     *   [RequestError]()
     *   [StringLengthError]()
     * @param \Google\Ads\GoogleAds\V10\Services\MutateAccountBudgetProposalRequest $argument input argument
     * @param array $metadata metadata
     * @param array $options call options
     * @return \Grpc\UnaryCall
     */
    public function MutateAccountBudgetProposal(\Google\Ads\GoogleAds\V10\Services\MutateAccountBudgetProposalRequest $argument,
      $metadata = [], $options = []) {
        return $this->_simpleRequest('/google.ads.googleads.v10.services.AccountBudgetProposalService/MutateAccountBudgetProposal',
        $argument,
        ['\Google\Ads\GoogleAds\V10\Services\MutateAccountBudgetProposalResponse', 'decode'],
        $metadata, $options);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/Clear-EviPreserve.iml" filepath="$PROJECT_DIR$/.idea/Clear-EviPreserve.iml" />
    </modules>
  </component>
</project>


text:
package tab;

import java.sql.Connection;
import java.sql.PreparedStatement;

import system.DateAndClock;

public class AdvancedExpense extends DateAndClock {

	public void addSectorToList(String sectorName) {
		String sqltoactive = "UPDATE Sector_List SET sectorActive = ?, sectorArchived = ?, ASL_Queue = ?, ASL_Active = ? WHERE sectorList = ?";

		try (Connection conn = connector(); PreparedStatement pstmt = conn.prepareStatement(sqltoactive)) {
			pstmt.setString(1, "active");
			pstmt.setString(2, "");
			pstmt.setString(3, "");
			pstmt.setString(4, "aslActive");
			pstmt.setString(5, sectorName);
			pstmt.executeUpdate();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void removeSectorFromList(String sectorName) {
		String sqltoqueue = "UPDATE Sector_List SET sectorActive = ?, sectorArchived = ?, ASL_Queue = ?, ASL_Active = ? WHERE sectorList = ?";

		try (Connection conn = connector(); PreparedStatement pstmt = conn.prepareStatement(sqltoqueue)) {
			pstmt.setString(1, "active");
			pstmt.setString(2, "");
			pstmt.setString(3, "aslQueue");
			pstmt.setString(4, "");
			pstmt.setString(5, sectorName);
			pstmt.executeUpdate();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


text:
package org.ovirt.engine.core.common.action;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.ovirt.engine.core.common.businessentities.DiskImageBase;
import org.ovirt.engine.core.common.businessentities.VM;
import org.ovirt.engine.core.common.businessentities.VmNetworkInterface;
import org.ovirt.engine.core.common.businessentities.VmStatic;
import org.ovirt.engine.core.compat.Guid;

@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "AddVmFromScratchParameters")
public class AddVmFromScratchParameters extends VmManagementParametersBase implements java.io.Serializable {
    private static final long serialVersionUID = 8641610721114989096L;

    public AddVmFromScratchParameters() {
    }

    public AddVmFromScratchParameters(VmStatic vmStatic, java.util.ArrayList<DiskImageBase> diskInfoList,
            Guid storageDomainId) {
        super(vmStatic);
        setDiskInfoList((diskInfoList != null) ? diskInfoList : new java.util.ArrayList<DiskImageBase>());
        setStorageDomainId(storageDomainId);
        _interfaces = new java.util.ArrayList<VmNetworkInterface>();
    }

    public AddVmFromScratchParameters(VM vm, ArrayList<DiskImageBase> diskInfoList, Guid storageDomainId) {
        this(vm.getStaticData(), diskInfoList, storageDomainId);
    }

    @XmlElement(name = "DiskInfoList")
    private java.util.ArrayList<DiskImageBase> privateDiskInfoList;

    public java.util.ArrayList<DiskImageBase> getDiskInfoList() {
        return privateDiskInfoList == null ? new ArrayList<DiskImageBase>() : privateDiskInfoList;
    }

    public void setDiskInfoList(java.util.ArrayList<DiskImageBase> value) {
        privateDiskInfoList = value;
    }

    @XmlElement
    private java.util.ArrayList<VmNetworkInterface> _interfaces;

    public java.util.ArrayList<VmNetworkInterface> getInterfaces() {
        return _interfaces == null ? new ArrayList<VmNetworkInterface>() : _interfaces;
    }

    public void setInterfaces(java.util.ArrayList<VmNetworkInterface> value) {
        _interfaces = value;
    }

}


text:
/**
 *  comment.js 评论模型
 *  @author: JY
 *  @since: 2013-03-05
 */
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var models = require('../models');
var User = models.User
  , Topic = models.Topic
  , ObjectId = Schema.Types.ObjectId;

var CommentSchema = new Schema({
    topic_id: {type: ObjectId, ref: 'Topic'},
    user_id: {type: ObjectId, ref: 'User'},
    reply_id: {type: ObjectId, ref: 'Comment'},
    content: String,
    create_date: {type: Date, Default: Date.now}
});

mongoose.model('Comment', CommentSchema);


text:
package ch.jalu.configme.properties;

import ch.jalu.configme.properties.convertresult.PropertyValue;
import ch.jalu.configme.properties.types.PrimitivePropertyType;
import ch.jalu.configme.resource.PropertyReader;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import java.util.Arrays;
import java.util.List;

import static ch.jalu.configme.TestUtils.isErrorValueOf;
import static ch.jalu.configme.TestUtils.isValidValueOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.BDDMockito.given;

/**
 * Test for {@link ListProperty}.
 */
@ExtendWith(MockitoExtension.class)
class ListPropertyTest {

    @Mock
    private PropertyReader reader;

    @Test
    void shouldReturnValueFromResource() {
        // given
        Property<List<Integer>> property = new ListProperty<>("list", PrimitivePropertyType.INTEGER);
        given(reader.getList("list")).willReturn((List) Arrays.asList(3, 5, 7.0));

        // when
        PropertyValue<List<Integer>> result = property.determineValue(reader);

        // then
        assertThat(result, isValidValueOf(Arrays.asList(3, 5, 7)));
    }

    @Test
    void shouldReturnDefaultValue() {
        // given
        Property<List<Integer>> property = new ListProperty<>("list", PrimitivePropertyType.INTEGER, 8, 9, 10);
        given(reader.getList("list")).willReturn(null);

        // when
        PropertyValue<List<Integer>> result = property.determineValue(reader);

        // then
        assertThat(result, isErrorValueOf(Arrays.asList(8, 9, 10)));
    }

    @Test
    void shouldReturnValueAsExportValue() {
        // given
        Property<List<Integer>> property = new ListProperty<>("list", PrimitivePropertyType.INTEGER, Arrays.asList(-2, 16));

        // when
        Object result = property.toExportValue(Arrays.asList(128, -256, 512));

        // then
        assertThat(result, equalTo(Arrays.asList(128, -256, 512)));
    }
}


text:
package response

import (
	// Interfaces
	"MindAssistantBackend/interfaces/response"
)

// Set формирует ответ
func Set(result bool, message string, data interface{}) iResponse.Model {
	return iResponse.Model{
		Result:  result,
		Message: message,
		Data:    data,
	}
}


text:
namespace SCRAM
{
    partial class AdminCalendarPage
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdminCalendarPage));
            this.btnr1c1 = new System.Windows.Forms.Button();
            this.btnr1c2 = new System.Windows.Forms.Button();
            this.btnr1c3 = new System.Windows.Forms.Button();
            this.btnr1c4 = new System.Windows.Forms.Button();
            this.btnr1c5 = new System.Windows.Forms.Button();
            this.btnr1c6 = new System.Windows.Forms.Button();
            this.btnr1c7 = new System.Windows.Forms.Button();
            this.btnr2c1 = new System.Windows.Forms.Button();
            this.btnr2c2 = new System.Windows.Forms.Button();
            this.btnr2c3 = new System.Windows.Forms.Button();
            this.btnr2c4 = new System.Windows.Forms.Button();
            this.btnr2c5 = new System.Windows.Forms.Button();
            this.btnr2c6 = new System.Windows.Forms.Button();
            this.btnr2c7 = new System.Windows.Forms.Button();
            this.btnr3c1 = new System.Windows.Forms.Button();
            this.btnr3c2 = new System.Windows.Forms.Button();
            this.btnr3c3 = new System.Windows.Forms.Button();
            this.btnr3c4 = new System.Windows.Forms.Button();
            this.btnr3c5 = new System.Windows.Forms.Button();
            this.btnr3c6 = new System.Windows.Forms.Button();
            this.btnr3c7 = new System.Windows.Forms.Button();
            this.btnr4c1 = new System.Windows.Forms.Button();
            this.btnr4c2 = new System.Windows.Forms.Button();
            this.btnr4c3 = new System.Windows.Forms.Button();
            this.btnr4c4 = new System.Windows.Forms.Button();
            this.btnr4c5 = new System.Windows.Forms.Button();
            this.btnr4c6 = new System.Windows.Forms.Button();
            this.btnr4c7 = new System.Windows.Forms.Button();
            this.btnr5c1 = new System.Windows.Forms.Button();
            this.btnr5c2 = new System.Windows.Forms.Button();
            this.btnr5c3 = new System.Windows.Forms.Button();
            this.btnr5c4 = new System.Windows.Forms.Button();
            this.btnr5c5 = new System.Windows.Forms.Button();
            this.btnr5c6 = new System.Windows.Forms.Button();
            this.btnr5c7 = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.label11 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.dataSourceBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            ((System.ComponentModel.ISupportInitialize)(this.dataSourceBindingSource)).BeginInit();
            this.SuspendLayout();
            //
            // btnr1c1
            //
            this.btnr1c1.BackColor = System.Drawing.Color.Lime;
            this.btnr1c1.Location = new System.Drawing.Point(322, 81);
            this.btnr1c1.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c1.Name = "btnr1c1";
            this.btnr1c1.Size = new System.Drawing.Size(58, 55);
            this.btnr1c1.TabIndex = 1;
            this.btnr1c1.Text = "button1";
            this.btnr1c1.UseVisualStyleBackColor = false;
            this.btnr1c1.Click += new System.EventHandler(this.btnr1c1_Click);
            //
            // btnr1c2
            //
            this.btnr1c2.BackColor = System.Drawing.Color.Lime;
            this.btnr1c2.Location = new System.Drawing.Point(385, 81);
            this.btnr1c2.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c2.Name = "btnr1c2";
            this.btnr1c2.Size = new System.Drawing.Size(58, 55);
            this.btnr1c2.TabIndex = 2;
            this.btnr1c2.Text = "button2";
            this.btnr1c2.UseVisualStyleBackColor = false;
            this.btnr1c2.Click += new System.EventHandler(this.btnr1c2_Click);
            //
            // btnr1c3
            //
            this.btnr1c3.BackColor = System.Drawing.Color.Lime;
            this.btnr1c3.Location = new System.Drawing.Point(448, 81);
            this.btnr1c3.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c3.Name = "btnr1c3";
            this.btnr1c3.Size = new System.Drawing.Size(58, 55);
            this.btnr1c3.TabIndex = 3;
            this.btnr1c3.Text = "button3";
            this.btnr1c3.UseVisualStyleBackColor = false;
            this.btnr1c3.Click += new System.EventHandler(this.btnr1c3_Click);
            //
            // btnr1c4
            //
            this.btnr1c4.BackColor = System.Drawing.Color.Lime;
            this.btnr1c4.Location = new System.Drawing.Point(511, 81);
            this.btnr1c4.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c4.Name = "btnr1c4";
            this.btnr1c4.Size = new System.Drawing.Size(58, 55);
            this.btnr1c4.TabIndex = 4;
            this.btnr1c4.Text = "button4";
            this.btnr1c4.UseVisualStyleBackColor = false;
            this.btnr1c4.Click += new System.EventHandler(this.btnr1c4_Click);
            //
            // btnr1c5
            //
            this.btnr1c5.BackColor = System.Drawing.Color.Lime;
            this.btnr1c5.Location = new System.Drawing.Point(572, 81);
            this.btnr1c5.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c5.Name = "btnr1c5";
            this.btnr1c5.Size = new System.Drawing.Size(58, 55);
            this.btnr1c5.TabIndex = 5;
            this.btnr1c5.Text = "button5";
            this.btnr1c5.UseVisualStyleBackColor = false;
            this.btnr1c5.Click += new System.EventHandler(this.btnr1c5_Click);
            //
            // btnr1c6
            //
            this.btnr1c6.BackColor = System.Drawing.Color.Lime;
            this.btnr1c6.Location = new System.Drawing.Point(634, 81);
            this.btnr1c6.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c6.Name = "btnr1c6";
            this.btnr1c6.Size = new System.Drawing.Size(58, 55);
            this.btnr1c6.TabIndex = 6;
            this.btnr1c6.Text = "button6";
            this.btnr1c6.UseVisualStyleBackColor = false;
            this.btnr1c6.Click += new System.EventHandler(this.btnr1c6_Click);
            //
            // btnr1c7
            //
            this.btnr1c7.BackColor = System.Drawing.Color.Lime;
            this.btnr1c7.Location = new System.Drawing.Point(697, 81);
            this.btnr1c7.Margin = new System.Windows.Forms.Padding(2);
            this.btnr1c7.Name = "btnr1c7";
            this.btnr1c7.Size = new System.Drawing.Size(58, 55);
            this.btnr1c7.TabIndex = 7;
            this.btnr1c7.Text = "button7";
            this.btnr1c7.UseVisualStyleBackColor = false;
            this.btnr1c7.Click += new System.EventHandler(this.btnr1c7_Click);
            //
            // btnr2c1
            //
            this.btnr2c1.BackColor = System.Drawing.Color.Lime;
            this.btnr2c1.Location = new System.Drawing.Point(322, 141);
            this.btnr2c1.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c1.Name = "btnr2c1";
            this.btnr2c1.Size = new System.Drawing.Size(58, 55);
            this.btnr2c1.TabIndex = 14;
            this.btnr2c1.Text = "button8";
            this.btnr2c1.UseVisualStyleBackColor = false;
            this.btnr2c1.Click += new System.EventHandler(this.btnr2c1_Click);
            //
            // btnr2c2
            //
            this.btnr2c2.BackColor = System.Drawing.Color.Lime;
            this.btnr2c2.Location = new System.Drawing.Point(385, 141);
            this.btnr2c2.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c2.Name = "btnr2c2";
            this.btnr2c2.Size = new System.Drawing.Size(58, 55);
            this.btnr2c2.TabIndex = 13;
            this.btnr2c2.Text = "button9";
            this.btnr2c2.UseVisualStyleBackColor = false;
            this.btnr2c2.Click += new System.EventHandler(this.btnr2c2_Click);
            //
            // btnr2c3
            //
            this.btnr2c3.BackColor = System.Drawing.Color.Lime;
            this.btnr2c3.Location = new System.Drawing.Point(448, 141);
            this.btnr2c3.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c3.Name = "btnr2c3";
            this.btnr2c3.Size = new System.Drawing.Size(58, 55);
            this.btnr2c3.TabIndex = 12;
            this.btnr2c3.Text = "button10";
            this.btnr2c3.UseVisualStyleBackColor = false;
            this.btnr2c3.Click += new System.EventHandler(this.btnr2c3_Click);
            //
            // btnr2c4
            //
            this.btnr2c4.BackColor = System.Drawing.Color.Lime;
            this.btnr2c4.Location = new System.Drawing.Point(511, 141);
            this.btnr2c4.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c4.Name = "btnr2c4";
            this.btnr2c4.Size = new System.Drawing.Size(58, 55);
            this.btnr2c4.TabIndex = 11;
            this.btnr2c4.Text = "button11";
            this.btnr2c4.UseVisualStyleBackColor = false;
            this.btnr2c4.Click += new System.EventHandler(this.btnr2c4_Click);
            //
            // btnr2c5
            //
            this.btnr2c5.BackColor = System.Drawing.Color.Lime;
            this.btnr2c5.Location = new System.Drawing.Point(572, 141);
            this.btnr2c5.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c5.Name = "btnr2c5";
            this.btnr2c5.Size = new System.Drawing.Size(58, 55);
            this.btnr2c5.TabIndex = 10;
            this.btnr2c5.Text = "button12";
            this.btnr2c5.UseVisualStyleBackColor = false;
            this.btnr2c5.Click += new System.EventHandler(this.btnr2c5_Click);
            //
            // btnr2c6
            //
            this.btnr2c6.BackColor = System.Drawing.Color.Lime;
            this.btnr2c6.Location = new System.Drawing.Point(634, 141);
            this.btnr2c6.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c6.Name = "btnr2c6";
            this.btnr2c6.Size = new System.Drawing.Size(58, 55);
            this.btnr2c6.TabIndex = 9;
            this.btnr2c6.Text = "button13";
            this.btnr2c6.UseVisualStyleBackColor = false;
            this.btnr2c6.Click += new System.EventHandler(this.btnr2c6_Click);
            //
            // btnr2c7
            //
            this.btnr2c7.BackColor = System.Drawing.Color.Lime;
            this.btnr2c7.Location = new System.Drawing.Point(696, 141);
            this.btnr2c7.Margin = new System.Windows.Forms.Padding(2);
            this.btnr2c7.Name = "btnr2c7";
            this.btnr2c7.Size = new System.Drawing.Size(58, 55);
            this.btnr2c7.TabIndex = 8;
            this.btnr2c7.Text = "button14";
            this.btnr2c7.UseVisualStyleBackColor = false;
            this.btnr2c7.Click += new System.EventHandler(this.btnr2c7_Click);
            //
            // btnr3c1
            //
            this.btnr3c1.BackColor = System.Drawing.Color.Lime;
            this.btnr3c1.Location = new System.Drawing.Point(322, 201);
            this.btnr3c1.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c1.Name = "btnr3c1";
            this.btnr3c1.Size = new System.Drawing.Size(58, 55);
            this.btnr3c1.TabIndex = 21;
            this.btnr3c1.Text = "button15";
            this.btnr3c1.UseVisualStyleBackColor = false;
            this.btnr3c1.Click += new System.EventHandler(this.btnr3c1_Click);
            //
            // btnr3c2
            //
            this.btnr3c2.BackColor = System.Drawing.Color.Lime;
            this.btnr3c2.Location = new System.Drawing.Point(385, 201);
            this.btnr3c2.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c2.Name = "btnr3c2";
            this.btnr3c2.Size = new System.Drawing.Size(58, 55);
            this.btnr3c2.TabIndex = 20;
            this.btnr3c2.Text = "button16";
            this.btnr3c2.UseVisualStyleBackColor = false;
            this.btnr3c2.Click += new System.EventHandler(this.btnr3c2_Click);
            //
            // btnr3c3
            //
            this.btnr3c3.BackColor = System.Drawing.Color.Lime;
            this.btnr3c3.Location = new System.Drawing.Point(448, 201);
            this.btnr3c3.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c3.Name = "btnr3c3";
            this.btnr3c3.Size = new System.Drawing.Size(58, 55);
            this.btnr3c3.TabIndex = 19;
            this.btnr3c3.Text = "button17";
            this.btnr3c3.UseVisualStyleBackColor = false;
            this.btnr3c3.Click += new System.EventHandler(this.btnr3c3_Click_1);
            //
            // btnr3c4
            //
            this.btnr3c4.BackColor = System.Drawing.Color.Lime;
            this.btnr3c4.Location = new System.Drawing.Point(510, 201);
            this.btnr3c4.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c4.Name = "btnr3c4";
            this.btnr3c4.Size = new System.Drawing.Size(58, 55);
            this.btnr3c4.TabIndex = 18;
            this.btnr3c4.Text = "button18";
            this.btnr3c4.UseVisualStyleBackColor = false;
            this.btnr3c4.Click += new System.EventHandler(this.btnr3c4_Click);
            //
            // btnr3c5
            //
            this.btnr3c5.BackColor = System.Drawing.Color.Lime;
            this.btnr3c5.Location = new System.Drawing.Point(572, 201);
            this.btnr3c5.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c5.Name = "btnr3c5";
            this.btnr3c5.Size = new System.Drawing.Size(58, 55);
            this.btnr3c5.TabIndex = 17;
            this.btnr3c5.Text = "button19";
            this.btnr3c5.UseVisualStyleBackColor = false;
            this.btnr3c5.Click += new System.EventHandler(this.btnr3c5_Click);
            //
            // btnr3c6
            //
            this.btnr3c6.BackColor = System.Drawing.Color.Lime;
            this.btnr3c6.Location = new System.Drawing.Point(634, 201);
            this.btnr3c6.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c6.Name = "btnr3c6";
            this.btnr3c6.Size = new System.Drawing.Size(58, 55);
            this.btnr3c6.TabIndex = 16;
            this.btnr3c6.Text = "button20";
            this.btnr3c6.UseVisualStyleBackColor = false;
            this.btnr3c6.Click += new System.EventHandler(this.btnr3c6_Click);
            //
            // btnr3c7
            //
            this.btnr3c7.BackColor = System.Drawing.Color.Lime;
            this.btnr3c7.Location = new System.Drawing.Point(696, 201);
            this.btnr3c7.Margin = new System.Windows.Forms.Padding(2);
            this.btnr3c7.Name = "btnr3c7";
            this.btnr3c7.Size = new System.Drawing.Size(58, 55);
            this.btnr3c7.TabIndex = 15;
            this.btnr3c7.Text = "button21";
            this.btnr3c7.UseVisualStyleBackColor = false;
            this.btnr3c7.Click += new System.EventHandler(this.btnr3c7_Click);
            //
            // btnr4c1
            //
            this.btnr4c1.BackColor = System.Drawing.Color.Lime;
            this.btnr4c1.Location = new System.Drawing.Point(324, 259);
            this.btnr4c1.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c1.Name = "btnr4c1";
            this.btnr4c1.Size = new System.Drawing.Size(58, 55);
            this.btnr4c1.TabIndex = 28;
            this.btnr4c1.Text = "button22";
            this.btnr4c1.UseVisualStyleBackColor = false;
            this.btnr4c1.Click += new System.EventHandler(this.btnr4c1_Click);
            //
            // btnr4c2
            //
            this.btnr4c2.BackColor = System.Drawing.Color.Lime;
            this.btnr4c2.Location = new System.Drawing.Point(386, 259);
            this.btnr4c2.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c2.Name = "btnr4c2";
            this.btnr4c2.Size = new System.Drawing.Size(58, 55);
            this.btnr4c2.TabIndex = 27;
            this.btnr4c2.Text = "button23";
            this.btnr4c2.UseVisualStyleBackColor = false;
            this.btnr4c2.Click += new System.EventHandler(this.btnr4c2_Click);
            //
            // btnr4c3
            //
            this.btnr4c3.BackColor = System.Drawing.Color.Lime;
            this.btnr4c3.Location = new System.Drawing.Point(448, 259);
            this.btnr4c3.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c3.Name = "btnr4c3";
            this.btnr4c3.Size = new System.Drawing.Size(58, 55);
            this.btnr4c3.TabIndex = 26;
            this.btnr4c3.Text = "button24";
            this.btnr4c3.UseVisualStyleBackColor = false;
            this.btnr4c3.Click += new System.EventHandler(this.btnr4c3_Click);
            //
            // btnr4c4
            //
            this.btnr4c4.BackColor = System.Drawing.Color.Lime;
            this.btnr4c4.Location = new System.Drawing.Point(511, 259);
            this.btnr4c4.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c4.Name = "btnr4c4";
            this.btnr4c4.Size = new System.Drawing.Size(58, 55);
            this.btnr4c4.TabIndex = 25;
            this.btnr4c4.Text = "button25";
            this.btnr4c4.UseVisualStyleBackColor = false;
            this.btnr4c4.Click += new System.EventHandler(this.btnr4c4_Click);
            //
            // btnr4c5
            //
            this.btnr4c5.BackColor = System.Drawing.Color.Lime;
            this.btnr4c5.Location = new System.Drawing.Point(572, 259);
            this.btnr4c5.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c5.Name = "btnr4c5";
            this.btnr4c5.Size = new System.Drawing.Size(58, 55);
            this.btnr4c5.TabIndex = 24;
            this.btnr4c5.Text = "button26";
            this.btnr4c5.UseVisualStyleBackColor = false;
            this.btnr4c5.Click += new System.EventHandler(this.btnr4c5_Click);
            //
            // btnr4c6
            //
            this.btnr4c6.BackColor = System.Drawing.Color.Lime;
            this.btnr4c6.Location = new System.Drawing.Point(634, 259);
            this.btnr4c6.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c6.Name = "btnr4c6";
            this.btnr4c6.Size = new System.Drawing.Size(58, 55);
            this.btnr4c6.TabIndex = 23;
            this.btnr4c6.Text = "button27";
            this.btnr4c6.UseVisualStyleBackColor = false;
            this.btnr4c6.Click += new System.EventHandler(this.btnr4c6_Click);
            //
            // btnr4c7
            //
            this.btnr4c7.BackColor = System.Drawing.Color.Lime;
            this.btnr4c7.Location = new System.Drawing.Point(696, 259);
            this.btnr4c7.Margin = new System.Windows.Forms.Padding(2);
            this.btnr4c7.Name = "btnr4c7";
            this.btnr4c7.Size = new System.Drawing.Size(58, 55);
            this.btnr4c7.TabIndex = 22;
            this.btnr4c7.Text = "button28";
            this.btnr4c7.UseVisualStyleBackColor = false;
            this.btnr4c7.Click += new System.EventHandler(this.btnr4c7_Click);
            //
            // btnr5c1
            //
            this.btnr5c1.BackColor = System.Drawing.Color.Lime;
            this.btnr5c1.Location = new System.Drawing.Point(322, 318);
            this.btnr5c1.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c1.Name = "btnr5c1";
            this.btnr5c1.Size = new System.Drawing.Size(58, 55);
            this.btnr5c1.TabIndex = 35;
            this.btnr5c1.Text = "button29";
            this.btnr5c1.UseVisualStyleBackColor = false;
            this.btnr5c1.Click += new System.EventHandler(this.btnr5c1_Click);
            //
            // btnr5c2
            //
            this.btnr5c2.BackColor = System.Drawing.Color.Lime;
            this.btnr5c2.Location = new System.Drawing.Point(386, 318);
            this.btnr5c2.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c2.Name = "btnr5c2";
            this.btnr5c2.Size = new System.Drawing.Size(58, 55);
            this.btnr5c2.TabIndex = 34;
            this.btnr5c2.Text = "button30";
            this.btnr5c2.UseVisualStyleBackColor = false;
            this.btnr5c2.Click += new System.EventHandler(this.btnr5c2_Click);
            //
            // btnr5c3
            //
            this.btnr5c3.BackColor = System.Drawing.Color.Lime;
            this.btnr5c3.Location = new System.Drawing.Point(448, 318);
            this.btnr5c3.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c3.Name = "btnr5c3";
            this.btnr5c3.Size = new System.Drawing.Size(58, 55);
            this.btnr5c3.TabIndex = 33;
            this.btnr5c3.Text = "button31";
            this.btnr5c3.UseVisualStyleBackColor = false;
            this.btnr5c3.Click += new System.EventHandler(this.btnr5c3_Click);
            //
            // btnr5c4
            //
            this.btnr5c4.BackColor = System.Drawing.Color.Lime;
            this.btnr5c4.Location = new System.Drawing.Point(511, 318);
            this.btnr5c4.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c4.Name = "btnr5c4";
            this.btnr5c4.Size = new System.Drawing.Size(58, 55);
            this.btnr5c4.TabIndex = 32;
            this.btnr5c4.Text = "button32";
            this.btnr5c4.UseVisualStyleBackColor = false;
            this.btnr5c4.Click += new System.EventHandler(this.btnr5c4_Click);
            //
            // btnr5c5
            //
            this.btnr5c5.BackColor = System.Drawing.Color.Lime;
            this.btnr5c5.Location = new System.Drawing.Point(572, 318);
            this.btnr5c5.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c5.Name = "btnr5c5";
            this.btnr5c5.Size = new System.Drawing.Size(58, 55);
            this.btnr5c5.TabIndex = 31;
            this.btnr5c5.Text = "button33";
            this.btnr5c5.UseVisualStyleBackColor = false;
            this.btnr5c5.Click += new System.EventHandler(this.btnr5c5_Click);
            //
            // btnr5c6
            //
            this.btnr5c6.BackColor = System.Drawing.Color.Lime;
            this.btnr5c6.Location = new System.Drawing.Point(634, 318);
            this.btnr5c6.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c6.Name = "btnr5c6";
            this.btnr5c6.Size = new System.Drawing.Size(58, 55);
            this.btnr5c6.TabIndex = 30;
            this.btnr5c6.Text = "button34";
            this.btnr5c6.UseVisualStyleBackColor = false;
            this.btnr5c6.Click += new System.EventHandler(this.btnr5c6_Click);
            //
            // btnr5c7
            //
            this.btnr5c7.BackColor = System.Drawing.Color.Lime;
            this.btnr5c7.Location = new System.Drawing.Point(696, 318);
            this.btnr5c7.Margin = new System.Windows.Forms.Padding(2);
            this.btnr5c7.Name = "btnr5c7";
            this.btnr5c7.Size = new System.Drawing.Size(58, 55);
            this.btnr5c7.TabIndex = 29;
            this.btnr5c7.Text = "button35";
            this.btnr5c7.UseVisualStyleBackColor = false;
            this.btnr5c7.Click += new System.EventHandler(this.btnr5c7_Click);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(496, 19);
            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(91, 13);
            this.label1.TabIndex = 36;
            this.label1.Text = "Weekly Schedule";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(328, 41);
            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(43, 13);
            this.label2.TabIndex = 37;
            this.label2.Text = "Sunday";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(391, 41);
            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(45, 13);
            this.label3.TabIndex = 38;
            this.label3.Text = "Monday";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(454, 41);
            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(48, 13);
            this.label4.TabIndex = 39;
            this.label4.Text = "Tuesday";
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(508, 41);
            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(64, 13);
            this.label5.TabIndex = 40;
            this.label5.Text = "Wednesday";
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(574, 41);
            this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(51, 13);
            this.label6.TabIndex = 41;
            this.label6.Text = "Thursday";
            this.label6.Click += new System.EventHandler(this.label6_Click);
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(646, 41);
            this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(35, 13);
            this.label7.TabIndex = 42;
            this.label7.Text = "Friday";
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(694, 41);
            this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(49, 13);
            this.label8.TabIndex = 43;
            this.label8.Text = "Saturday";
            //
            // label9
            //
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(250, 102);
            this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(58, 13);
            this.label9.TabIndex = 44;
            this.label9.Text = "8:30-12:30";
            //
            // label10
            //
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(250, 162);
            this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(58, 13);
            this.label10.TabIndex = 45;
            this.label10.Text = "12:30-1:30";
            //
            // label11
            //
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(250, 223);
            this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(52, 13);
            this.label11.TabIndex = 46;
            this.label11.Text = "1:30-5:30";
            //
            // label12
            //
            this.label12.AutoSize = true;
            this.label12.Location = new System.Drawing.Point(250, 284);
            this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(52, 13);
            this.label12.TabIndex = 47;
            this.label12.Text = "5:30-6:30";
            //
            // label13
            //
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(250, 343);
            this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(58, 13);
            this.label13.TabIndex = 48;
            this.label13.Text = "6:30-10:30";
            //
            // dataSourceBindingSource
            //
            this.dataSourceBindingSource.CurrentChanged += new System.EventHandler(this.dataSourceBindingSource_CurrentChanged);
            //
            // monthCalendar1
            //
            this.monthCalendar1.Location = new System.Drawing.Point(18, 81);
            this.monthCalendar1.Name = "monthCalendar1";
            this.monthCalendar1.TabIndex = 51;
            this.monthCalendar1.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar1_DateChanged_1);
            //
            // comboBox1
            //
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new System.Drawing.Point(32, 284);
            this.comboBox1.Margin = new System.Windows.Forms.Padding(2);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(198, 21);
            this.comboBox1.TabIndex = 52;
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged_1);
            this.comboBox1.SelectionChangeCommitted += new System.EventHandler(this.comboBox1_SelectionChangeCommitted);
            this.comboBox1.DropDownClosed += new System.EventHandler(this.comboBox1_DropDownClosed);
            //
            // AdminCalendarPage
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(792, 405);
            this.Controls.Add(this.comboBox1);
            this.Controls.Add(this.monthCalendar1);
            this.Controls.Add(this.label13);
            this.Controls.Add(this.label12);
            this.Controls.Add(this.label11);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.label9);
            this.Controls.Add(this.label8);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.btnr5c1);
            this.Controls.Add(this.btnr5c2);
            this.Controls.Add(this.btnr5c3);
            this.Controls.Add(this.btnr5c4);
            this.Controls.Add(this.btnr5c5);
            this.Controls.Add(this.btnr5c6);
            this.Controls.Add(this.btnr5c7);
            this.Controls.Add(this.btnr4c1);
            this.Controls.Add(this.btnr4c2);
            this.Controls.Add(this.btnr4c3);
            this.Controls.Add(this.btnr4c4);
            this.Controls.Add(this.btnr4c5);
            this.Controls.Add(this.btnr4c6);
            this.Controls.Add(this.btnr4c7);
            this.Controls.Add(this.btnr3c1);
            this.Controls.Add(this.btnr3c2);
            this.Controls.Add(this.btnr3c3);
            this.Controls.Add(this.btnr3c4);
            this.Controls.Add(this.btnr3c5);
            this.Controls.Add(this.btnr3c6);
            this.Controls.Add(this.btnr3c7);
            this.Controls.Add(this.btnr2c1);
            this.Controls.Add(this.btnr2c2);
            this.Controls.Add(this.btnr2c3);
            this.Controls.Add(this.btnr2c4);
            this.Controls.Add(this.btnr2c5);
            this.Controls.Add(this.btnr2c6);
            this.Controls.Add(this.btnr2c7);
            this.Controls.Add(this.btnr1c7);
            this.Controls.Add(this.btnr1c6);
            this.Controls.Add(this.btnr1c5);
            this.Controls.Add(this.btnr1c4);
            this.Controls.Add(this.btnr1c3);
            this.Controls.Add(this.btnr1c2);
            this.Controls.Add(this.btnr1c1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Margin = new System.Windows.Forms.Padding(2);
            this.Name = "AdminCalendarPage";
            this.Text = "Admin Calendar";
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.CalendarPage_FormClosed);
            this.Shown += new System.EventHandler(this.AdminCalendarPage_Shown);
            ((System.ComponentModel.ISupportInitialize)(this.dataSourceBindingSource)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnr1c1;
        private System.Windows.Forms.Button btnr1c2;
        private System.Windows.Forms.Button btnr1c3;
        private System.Windows.Forms.Button btnr1c4;
        private System.Windows.Forms.Button btnr1c5;
        private System.Windows.Forms.Button btnr1c6;
        private System.Windows.Forms.Button btnr1c7;
        private System.Windows.Forms.Button btnr2c1;
        private System.Windows.Forms.Button btnr2c2;
        private System.Windows.Forms.Button btnr2c3;
        private System.Windows.Forms.Button btnr2c4;
        private System.Windows.Forms.Button btnr2c5;
        private System.Windows.Forms.Button btnr2c6;
        private System.Windows.Forms.Button btnr2c7;
        private System.Windows.Forms.Button btnr3c1;
        private System.Windows.Forms.Button btnr3c2;
        private System.Windows.Forms.Button btnr3c3;
        private System.Windows.Forms.Button btnr3c4;
        private System.Windows.Forms.Button btnr3c5;
        private System.Windows.Forms.Button btnr3c6;
        private System.Windows.Forms.Button btnr3c7;
        private System.Windows.Forms.Button btnr4c1;
        private System.Windows.Forms.Button btnr4c2;
        private System.Windows.Forms.Button btnr4c3;
        private System.Windows.Forms.Button btnr4c4;
        private System.Windows.Forms.Button btnr4c5;
        private System.Windows.Forms.Button btnr4c6;
        private System.Windows.Forms.Button btnr4c7;
        private System.Windows.Forms.Button btnr5c1;
        private System.Windows.Forms.Button btnr5c2;
        private System.Windows.Forms.Button btnr5c3;
        private System.Windows.Forms.Button btnr5c4;
        private System.Windows.Forms.Button btnr5c5;
        private System.Windows.Forms.Button btnr5c6;
        private System.Windows.Forms.Button btnr5c7;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.BindingSource dataSourceBindingSource;
        private System.Windows.Forms.MonthCalendar monthCalendar1;
        private System.Windows.Forms.ComboBox comboBox1;
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Swart, Crous, Kang, Mchau, Pascoe & Palm, Mycologia 93(2): 370 (2001)

#### Original name
Elsinoë leucospermi L. Swart & Crous, 2001

### Remarks
null


text:
using System;
using Microsoft.SqlServer.Types;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using GeoJSON.Net.Geometry;
using GeoJSON.Net.Contrib.MsSqlSpatial;
using System.Data.SqlTypes;

namespace GeoJSON.Net.MsSqlSpatial.Tests
{
	[TestClass]
	public class ToGeoJSONGeometryTests
	{
		[TestMethod]
		public void ValidPointTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(simplePoint);
			Point geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<Point>(simplePoint);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.Point);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.Point);
			Assert.IsNotNull(geoJSONobj.BoundingBoxes);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, simplePoint.BoundingBox());

		}

		[TestMethod]
		public void ValidMultiPointTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(multiPoint);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<MultiPoint>(multiPoint);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiPoint);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiPoint);
			Assert.IsNotNull(geoJSONobj.BoundingBoxes);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiPoint.BoundingBox());
			Assert.AreEqual(multiPoint.STNumGeometries().Value, geoJSONobj.Coordinates.Count);
		}

		[TestMethod]
		public void ValidLineStringTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(lineString);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<LineString>(lineString);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.LineString);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.LineString);
			Assert.IsNotNull(geoJSONobj.BoundingBoxes);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, lineString.BoundingBox());
		}

		[TestMethod]
		public void ValidMultiLineStringTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(multiLineString);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<MultiLineString>(multiLineString);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiLineString);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiLineString);
			Assert.IsNotNull(geoJSONobj.BoundingBoxes);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiLineString.BoundingBox());
		}

		[TestMethod]
		public void ValidPolygonTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(simplePoly);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<Polygon>(simplePoly);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.Polygon);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.Polygon);
			Assert.IsNotNull(geoJSONobj.BoundingBoxes);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, simplePoly.BoundingBox());

			geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(polyWithHole);
			geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<Polygon>(polyWithHole);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.Polygon);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.Polygon);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, polyWithHole.BoundingBox());
			Assert.AreEqual(geoJSONobj.Coordinates.Count, 2);
		}

		[TestMethod]
		public void ValidMultiPolygonTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(multiPolygon);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<MultiPolygon>(multiPolygon);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiPolygon);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiPolygon);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiPolygon.BoundingBox());
			Assert.AreEqual(geoJSONobj.Coordinates.Count, 3);
			Assert.AreEqual(geoJSONobj.Coordinates[0].Coordinates.Count, 1);
			Assert.AreEqual(geoJSONobj.Coordinates[1].Coordinates.Count, 2);
			Assert.AreEqual(geoJSONobj.Coordinates[2].Coordinates.Count, 2);

			Assert.AreEqual(geoJSONobj.Coordinates[0].Coordinates[0].Coordinates.Count, 4);
			Assert.AreEqual(geoJSONobj.Coordinates[1].Coordinates[0].Coordinates.Count, 6);
			Assert.AreEqual(geoJSONobj.Coordinates[1].Coordinates[1].Coordinates.Count, 4);
			Assert.AreEqual(geoJSONobj.Coordinates[2].Coordinates[0].Coordinates.Count, 5);
			Assert.AreEqual(geoJSONobj.Coordinates[2].Coordinates[1].Coordinates.Count, 5);
		}

		[TestMethod]
		public void ValidGeometryCollectionTest()
		{
			IGeometryObject geoJSON = MsSqlSpatialConvert.ToGeoJSONGeometry(geomCol);
			var geoJSONobj = MsSqlSpatialConvert.ToGeoJSONObject<GeometryCollection>(geomCol);

			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.GeometryCollection);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.GeometryCollection);
			Assert.IsTrue(geoJSONobj.BoundingBoxes.Length == 4);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, geomCol.BoundingBox());
			Assert.AreEqual(geoJSONobj.Geometries.Count, 6);
			Assert.AreEqual(geoJSONobj.Geometries[0].Type, GeoJSONObjectType.Polygon);
			Assert.AreEqual(geoJSONobj.Geometries[1].Type, GeoJSONObjectType.MultiPolygon);
			Assert.AreEqual(geoJSONobj.Geometries[2].Type, GeoJSONObjectType.LineString);
			Assert.AreEqual(geoJSONobj.Geometries[3].Type, GeoJSONObjectType.Point);
			Assert.AreEqual(geoJSONobj.Geometries[4].Type, GeoJSONObjectType.MultiLineString);
			Assert.AreEqual(geoJSONobj.Geometries[5].Type, GeoJSONObjectType.MultiLineString);

			Assert.AreEqual(((Polygon)geoJSONobj.Geometries[0]).Coordinates[0].Coordinates.Count, 5);
			Assert.AreEqual(((Polygon)geoJSONobj.Geometries[0]).Coordinates[1].Coordinates.Count, 5);
			Assert.AreEqual(((MultiPolygon)geoJSONobj.Geometries[1]).Coordinates[0].Coordinates[0].Coordinates.Count, 4);
			Assert.AreEqual(((MultiPolygon)geoJSONobj.Geometries[1]).Coordinates[1].Coordinates[0].Coordinates.Count, 6);
			Assert.AreEqual(((MultiPolygon)geoJSONobj.Geometries[1]).Coordinates[1].Coordinates[1].Coordinates.Count, 4);
			Assert.AreEqual(((MultiPolygon)geoJSONobj.Geometries[1]).Coordinates[2].Coordinates[0].Coordinates.Count, 5);
			Assert.AreEqual(((MultiPolygon)geoJSONobj.Geometries[1]).Coordinates[2].Coordinates[1].Coordinates.Count, 5);
			Assert.AreEqual(((LineString)geoJSONobj.Geometries[2]).Coordinates.Count, 5);
			Assert.AreEqual(((MultiLineString)geoJSONobj.Geometries[4]).Coordinates.Count, 0);
			Assert.AreEqual(((MultiLineString)geoJSONobj.Geometries[5]).Coordinates.Count, 2);
			Assert.AreEqual(((MultiLineString)geoJSONobj.Geometries[5]).Coordinates[0].Coordinates.Count, 5);
			Assert.AreEqual(((MultiLineString)geoJSONobj.Geometries[5]).Coordinates[1].Coordinates.Count, 5);
		}

		[TestMethod]
		public void TestEmptyMultiPoint()
		{
			SqlGeometryBuilder builder = new SqlGeometryBuilder();
			builder.SetSrid(4326);
			builder.BeginGeometry(OpenGisGeometryType.MultiPoint);
			builder.EndGeometry();
			var multiPoint = builder.ConstructedGeometry;
			var geoJSON = multiPoint.ToGeoJSONGeometry();
			var geoJSONobj = multiPoint.ToGeoJSONObject<MultiPoint>();
			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiPoint);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiPoint);
			Assert.IsTrue(geoJSONobj.BoundingBoxes.Length == 4);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiPoint.BoundingBox());
			var geom = geoJSONobj.ToSqlGeometry();
			Assert.IsTrue(geom.STGeometryType().Value == "MultiPoint");
			Assert.IsTrue(geom.STIsEmpty().IsTrue);
		}

		[TestMethod]
		public void TestEmptyMultiPolygon()
		{
			SqlGeometryBuilder builder = new SqlGeometryBuilder();
			builder.SetSrid(4326);
			builder.BeginGeometry(OpenGisGeometryType.MultiPolygon);
			builder.EndGeometry();
			var multiPoly = builder.ConstructedGeometry;
			var geoJSON = multiPoly.ToGeoJSONGeometry();
			var geoJSONobj = multiPoly.ToGeoJSONObject<MultiPolygon>();
			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiPolygon);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiPolygon);
			Assert.IsTrue(geoJSONobj.BoundingBoxes.Length == 4);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiPoly.BoundingBox());
			var geom = geoJSONobj.ToSqlGeometry();
			Assert.IsTrue(geom.STGeometryType().Value == "MultiPolygon");
			Assert.IsTrue(geom.STIsEmpty().IsTrue);
		}

		[TestMethod]
		public void TestEmptyMultiLineString()
		{
			SqlGeometryBuilder builder = new SqlGeometryBuilder();
			builder.SetSrid(4326);
			builder.BeginGeometry(OpenGisGeometryType.MultiLineString);
			builder.EndGeometry();
			var multiLineString = builder.ConstructedGeometry;
			var geoJSON = multiLineString.ToGeoJSONGeometry();
			var geoJSONobj = multiLineString.ToGeoJSONObject<MultiLineString>();
			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.MultiLineString);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.MultiLineString);
			Assert.IsTrue(geoJSONobj.BoundingBoxes.Length == 4);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, multiLineString.BoundingBox());
			var geom = geoJSONobj.ToSqlGeometry();
			Assert.IsTrue(geom.STGeometryType().Value == "MultiLineString");
			Assert.IsTrue(geom.STIsEmpty().IsTrue);
		}

		[TestMethod]
		public void TestEmptGeometryCollection()
		{
			SqlGeometryBuilder builder = new SqlGeometryBuilder();
			builder.SetSrid(4326);
			builder.BeginGeometry(OpenGisGeometryType.GeometryCollection);
			builder.EndGeometry();
			var geomCollection = builder.ConstructedGeometry;
			var geoJSON = geomCollection.ToGeoJSONGeometry();
			var geoJSONobj = geomCollection.ToGeoJSONObject<GeometryCollection>();
			Assert.IsNotNull(geoJSON);
			Assert.IsNotNull(geoJSONobj);
			Assert.AreEqual(geoJSON.Type, GeoJSONObjectType.GeometryCollection);
			Assert.AreEqual(geoJSONobj.Type, GeoJSONObjectType.GeometryCollection);
			Assert.IsTrue(geoJSONobj.BoundingBoxes.Length == 4);
			CollectionAssert.AreEqual(geoJSONobj.BoundingBoxes, geomCollection.BoundingBox());
			var geom = geoJSONobj.ToSqlGeometry();
			Assert.IsTrue(geom.STGeometryType().Value == "GeometryCollection");
			Assert.IsTrue(geom.STIsEmpty().IsTrue);

		}

		#region Test geometries

		SqlGeometry simplePoint = SqlGeometry.Point(1, 47, 4326);
		SqlGeometry multiPoint = SqlGeometry.Parse(new SqlString("MULTIPOINT((1 47),(1 46),(0 46),(0 47),(1 47))"));
		SqlGeometry lineString = SqlGeometry.Parse(new SqlString("LINESTRING(1 47,1 46,0 46,0 47,1 47)"));
		SqlGeometry multiLineString = SqlGeometry.Parse(new SqlString("MULTILINESTRING((0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),(0.764923095703125 47.86549372980948,0.951690673828125 47.82309640371982,1.220855712890625 47.79911736820551,1.089019775390625 47.69015026565801,1.256561279296875 47.656860648589))"));

		SqlGeometry simplePoly = SqlGeometry.Parse(new SqlString("POLYGON((1 47,1 46,0 46,0 47,1 47))"));
		SqlGeometry polyWithHole = SqlGeometry.Parse(new SqlString(@"
					POLYGON(
					(0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),
					(0.630340576171875 47.54944962456812,0.630340576171875 47.49380564962583,0.729217529296875 47.482669772098674,0.731964111328125 47.53276262898896,0.630340576171875 47.54944962456812)
					)"));
		SqlGeometry multiPolygon = SqlGeometry.Parse(new SqlString(@"
					MULTIPOLYGON (
						((40 40, 20 45, 45 30, 40 40)),
						((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)),
						((0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),(0.630340576171875 47.54944962456812,0.630340576171875 47.49380564962583,0.729217529296875 47.482669772098674,0.731964111328125 47.53276262898896,0.630340576171875 47.54944962456812))
					)"));

		SqlGeometry geomCol = SqlGeometry.Parse(new SqlString(@"
					GEOMETRYCOLLECTION (
						POLYGON((0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),(0.630340576171875 47.54944962456812,0.630340576171875 47.49380564962583,0.729217529296875 47.482669772098674,0.731964111328125 47.53276262898896,0.630340576171875 47.54944962456812)),
						MULTIPOLYGON (
						((40 40, 20 45, 45 30, 40 40)),
						((20 35, 45 20, 30 5, 10 10, 10 30, 20 35), (30 20, 20 25, 20 15, 30 20)),
						((0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),(0.630340576171875 47.54944962456812,0.630340576171875 47.49380564962583,0.729217529296875 47.482669772098674,0.731964111328125 47.53276262898896,0.630340576171875 47.54944962456812))
						),
						LINESTRING(0.764923095703125 47.86549372980948,0.951690673828125 47.82309640371982,1.220855712890625 47.79911736820551,1.089019775390625 47.69015026565801,1.256561279296875 47.656860648589),
						POINT(0.767669677734375 47.817563762851776),
						MULTILINESTRING EMPTY,
						MULTILINESTRING((0.516357421875 47.6415668949958,0.516357421875 47.34463879017405,0.977783203125 47.22539733216678,1.175537109375 47.463611506072866,0.516357421875 47.6415668949958),(0.764923095703125 47.86549372980948,0.951690673828125 47.82309640371982,1.220855712890625 47.79911736820551,1.089019775390625 47.69015026565801,1.256561279296875 47.656860648589))
					)"));

		#endregion

	}
}


text:
using System;
using System.Xml;
using System.Text;

using Mono.Unix;

using Hyena;

namespace Hyena.Query
{
    public class NullQueryValue : QueryValue
    {
        public static readonly Operator IsNullOrEmpty  = new Operator ("empty", Catalog.GetString ("empty"), "IN (NULL, '', 0)", true, "!");

        public static readonly NullQueryValue Instance = new NullQueryValue ();

        public override string XmlElementName {
            get { return "empty"; }
        }

        public override object Value {
            get { return null; }
        }

        protected static AliasedObjectSet<Operator> operators = new AliasedObjectSet<Operator> (IsNullOrEmpty);
        public override AliasedObjectSet<Operator> OperatorSet {
            get { return operators; }
        }

        private NullQueryValue ()
        {
            IsEmpty = false;
        }

        public override void ParseUserQuery (string input)
        {
        }

        public override void LoadString (string input)
        {
        }

        public override void ParseXml (XmlElement node)
        {
        }

        public override void AppendXml (XmlElement node)
        {
            node.InnerText = String.Empty;
        }

        public void SetValue (string str)
        {
        }

        public override string ToSql (Operator op)
        {
            return null;
        }
    }
}


text:
//
//  TWTJSONSchemaASTNode.h
//  TWTValidation
//
//  Created by Jill Cohen on 12/12/14.
//  Copyright (c) 2015 Ticketmaster Entertainment, Inc. All rights reserved.
//
//  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.
//

@import Foundation;

#import <TWTValidation/TWTJSONSchemaASTProcessor.h>
#import <TWTValidation/TWTJSONSchemaKeywordConstants.h>

/*!
 TWTJSONSchemaASTNodes model a valid JSON schema, as defined by http://json-schema.org/draft-04/schema#, or a building block of
 one (e.g., TWTJSONSchemaKeyValuePairASTNode). Nodes modeling valid schemas can represent either the entire schema (see
 TWTJSONSchemaTopLevelASTNode) or nested schemas, e.g., self.andNodes represent the schemas that are the value of "allOf". This
 is an abstract class that defines common properties and the interface for accepting a TWTJSONSchemaASTProcessor.
 */
@interface TWTJSONSchemaASTNode : NSObject

/*!
 @abstract The title of the instance described by this schema.
 @discussion This is not used for validation.
 */
@property (nonatomic, copy) NSString *schemaTitle;

/*!
 @abstract A description explaining the purpose of the instance described by this schema.
 @discussion This is not used for validation.
 */
@property (nonatomic, copy) NSString *schemaDescription;

/*!
 @abstract A flag indicating whether the "type" keyword is present in the schema.
 @discussion A YES requires that an instance be of the type specified. A NO indicates that types not matching type-specific
     keywords will be ignored for those keywords.
 */
@property (nonatomic, assign, getter = isTypeSpecified) BOOL typeSpecified;

/*!
 @abstract A set of type keywords indicating the valid types for an instance described by the schema.
 @discussion Subclasses must override this implementation with either a returned set or allowing readwrite access. May be nil,
     indicating type is not meaningful (e.g., dependencyNode).
 */
@property (nonatomic, copy, readonly) NSSet *validTypes;

/*!
 @abstract A set of valid values given by "enum."
 @discussion An instance passes if it is equal to one of these objects. Nil indicates "enum" is not present in the schema.
 */
@property (nonatomic, copy) NSSet *validValues;

/*!
 @abstract An array of TWTJSONSchemaASTNodes that model the schemas given by "allOf."
 @discussion If this property is non-nil, it must have at least one element. Nil indicates "allOf" is not present in the schema.
 */
@property (nonatomic, copy) NSArray *andSchemas;

/*!
 @abstract An array of TWTJSONSchemaASTNodes that model the schemas given by "anyOf."
 @discussion If this property is non-nil, it must have at least one element. Nil indicates "anyOf" is not present in the schema.
 */
@property (nonatomic, copy) NSArray *orSchemas;

/*!
 @abstract An array of TWTJSONSchemaASTNodes that model the schemas given by "oneOf."
 @discussion If this property is non-nil, it must have at least one element. Nil indicates "oneOf" is not present in the schema.
 */
@property (nonatomic, copy) NSArray *exactlyOneOfSchemas;

/*!
 @abstract A TWTJSONSchemaASTNode that models the schema given by "not."
 @discussion Nil indicates "not" is not present in the schema.
 */
@property (nonatomic, strong) TWTJSONSchemaASTNode *notSchema;

/*!
 @abstract A location where schemas referenced elsewhere can be defined.
 @discussion Each key provides a reference path, and its value must be a TWTJSONSchemaASTNode.
 */
@property (nonatomic, copy) NSDictionary *definitions;

/*!
 @abstract The interface for accepting a TWTJSONSchemaASTProcessor.
 @discussion Subclasses must override this, and the implementations must invoke the appropriate method from the
     TWTJSONSchemaASTProcessor protocol on the processor (for example, [processor processArrayNode:self]). If called on an
     instance of this class, this will throw a subclass responsibility exception.
 @param processor The processor on which a method from the TWTJSONSchemaASTProcessor protocol should be invoked.
 */
- (void)acceptProcessor:(id<TWTJSONSchemaASTProcessor>)processor;

# pragma mark - Only subclasses should invoke

/*!
 @abstract The children that are of class TWTJSONSchemaReferenceASTNode, which models a schema with the "$ref" keyword.
 @discussion Subclasses should override this if they have type-specific children nodes. The implementations must invoke super then
     add the reference nodes from its type-specific properties to the returned array, except TWTJSONSchemaReferenceASTNode, which
     should add itself to the array. If no children are reference nodes, this should return an empty array. See
     TWTJSONSchemaTopLevelASTNode for the external interface.
 @result An array containing all children that are reference nodes. An empty array is returned if none exist.
 */
- (NSArray *)childrenReferenceNodes;

/*!
 @abstract The children of nodes in an array that are of class TWTJSONSchemaReferenceASTNode.
 @discussion This is a convenience method to retrieve reference nodes from all the nodes in an array property.
 @param array The array from which children reference nodes are to be collected. This can be nil, in which case an empty array will be returned.
 @result An array containing all children that are reference nodes. An empty array is returned if none exist.
 */
- (NSArray *)childrenReferenceNodesFromNodeArray:(NSArray *)array;

/*!
 @abstract The node for a reference path.
 @discussion Subclasses should override this if they have type-specific children nodes. The implementations must:
      1) invoke super, which handles common keywords and the case where self is the referent
      2) check if a node is returned from super and if so return it
      3) otherwise, check the first path component against its type-specific keywords. For a match, it should pass the remaining
      components to that property to serve up the referent node.

      This implementation should only be used internal to the AST node tree. See TWTJSONSchemaTopLevelASTNode for the external interface.
 @param path An array of path components. The path is with respect to the recipient of the m

 The root of the path  location of the recipient is considered the root of the path.
 @result The node that matches a given reference path, or nil if no match is found.
 */
- (TWTJSONSchemaASTNode *)nodeForPathComponents:(NSArray *)path;

/*!
 @abstract The node that matches a given reference path within a node array, or nil if none exists.
 @discussion This is a convenience method to retrieve a node from an array property. The first component is expected to be a
     string representation of the element's index.
 @param path An array of nodes.
 @result An array containing all children that are reference nodes. An empty array is returned if none exist.
 */
- (TWTJSONSchemaASTNode *)nodeForPathComponents:(NSArray *)path fromNodeArray:(NSArray *)array;

/*!
 @abstract A convenience method to get the remaining path after removing the first component.
 @param path An array of path components.
 @result The new path after removing the first component.
 */
- (NSArray *)remainingPathFromPath:(NSArray *)path;

@end


text:
class CreateFeedsStreams < ActiveRecord::Migration
  def self.up
    create_table :feeds_streams, :id => false do |t|
      t.integer :feed_id
      t.integer :stream_id
    end
  end

  def self.down
    drop_table :feeds_streams
  end
end