text:
require 'rails_helper'

describe 'ResponsibleDataUse Class' do
  extend RedisHelper
  before(:each) do
    ENV['RESPONSIBLE_DATA_USE_QUALTRICS_SURVEY'] = 'foo'
    ENV['QUALTRICS_URL'] = 'https://secret.qualtrics.site'
    ENV['RESPONSIBLE_DATA_USE_TIMEOUT'] = '1'
    ENV['RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS'] = '5'

    # prevent any actual invocations of the job
    allow(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
    allow(ResponsibleDataUseImportJob).to receive(:perform_later)
    allow(ResponsibleDataUseImportJob).to receive(:reset_last_run)
  end

  # In the interests of testing the behavior and not the implementation, the
  # tests for set_status_of and set_override_on are the only tests that look
  # in Redis. Everything else treats the ResponsibleDataUse class and its
  # persistence layer as a black box.
  context 'set_status_of' do
    it 'stores a date in Redis' do
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_status_of('joebob', time_when)
      redis_val = redis.get('responsible-data-use joebob')
      expect(Time.parse(redis_val)).to eq(time_when)
    end

    it 'overwrites an older date' do
      old_time = Time.parse('2017-01-01 12:00')
      redis.set('responsible-data-use joebob', old_time.to_s)
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_status_of('joebob', time_when)
      redis_val = redis.get('responsible-data-use joebob')
      expect(Time.parse(redis_val)).to eq(time_when)
    end

    it 'does not overwrite a newer date' do
      new_time = Time.parse('2019-01-01 12:00')
      redis.set('responsible-data-use-override joebob', new_time.to_s)
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_status_of('joebob', time_when)
      redis_val = redis.get('responsible-data-use-override joebob')
      expect(Time.parse(redis_val)).to eq(new_time)
    end
  end

  context 'set_override_on' do
    it 'stores a date in Redis' do
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_override_on('joebob', time_when)
      redis_val = redis.get('responsible-data-use-override joebob')
      expect(Time.parse(redis_val)).to eq(time_when)
    end

    it 'overwrites an older date' do
      old_time = Time.parse('2017-01-01 12:00')
      redis.set('responsible-data-use-override joebob', old_time.to_s)
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_override_on('joebob', time_when)
      redis_val = redis.get('responsible-data-use-override joebob')
      expect(Time.parse(redis_val)).to eq(time_when)
    end

    # Unlike set_status_of, set_override_on can change a new date to an old one.
    it 'overwrites a newer date' do
      new_time = Time.parse('2019-01-01 12:00')
      redis.set('responsible-data-use-override joebob', new_time.to_s)
      time_when = Time.parse('2018-01-01 12:00')
      ResponsibleDataUse.set_override_on('joebob', time_when)
      redis_val = redis.get('responsible-data-use-override joebob')
      expect(Time.parse(redis_val)).to eq(time_when)
    end

    it 'deletes the key when nil is passed' do
      new_time = Time.parse('2019-01-01 12:00')
      redis.set('responsible-data-use-override joebob', new_time.to_s)
      ResponsibleDataUse.set_override_on('joebob', nil)
      redis_val = redis.get('responsible-data-use-override joebob')
      expect(redis_val).to be_nil
    end
  end

  context 'survey_id' do
    it 'returns ENV["RESPONSIBLE_DATA_USE_QUALTRICS_SURVEY"]' do
      expect(ResponsibleDataUse.survey_id).to eq('foo')
    end
  end

  context 'survey_url' do
    it 'builds survey URL out of the appropriate ENV vars' do
      expect(ResponsibleDataUse.survey_url).to eq('https://secret.qualtrics.site/jfe/form/foo')
    end
  end

  context 'all_stored_statuses' do
    before(:each) do
      @maryellen_when = 6.years.ago
      @joebob_when = 2.months.ago
      @billyray_when = 1.minute.ago
      ResponsibleDataUse.set_status_of('joebob', @joebob_when)
      ResponsibleDataUse.set_override_on('billyray', @billyray_when)
      ResponsibleDataUse.set_status_of('maryellen', @maryellen_when)
    end

    it 'returns the correct number of results' do
      expect(ResponsibleDataUse.all_stored_statuses.count).to eq(3)
    end

    it 'returns a result for each user' do
      expect(ResponsibleDataUse.all_stored_statuses.keys).to include('joebob')
      expect(ResponsibleDataUse.all_stored_statuses.keys).to include('billyray')
      expect(ResponsibleDataUse.all_stored_statuses.keys).to include('maryellen')
    end

    it 'returns the correct status for each user' do
      expect(ResponsibleDataUse.all_stored_statuses['joebob'][:status]).to eq(true)
      expect(ResponsibleDataUse.all_stored_statuses['billyray'][:status]).to eq(true)
      expect(ResponsibleDataUse.all_stored_statuses['maryellen'][:status]).to eq(false)
    end

    it 'returns the correct completion date for each user' do
      expect(ResponsibleDataUse.all_stored_statuses['joebob'][:completed]).to eq(@joebob_when.to_s)
      expect(ResponsibleDataUse.all_stored_statuses['billyray'][:completed]).to be_nil
      expect(ResponsibleDataUse.all_stored_statuses['maryellen'][:completed]).to eq(@maryellen_when.to_s)
    end

    it 'returns the correct override date for each user' do
      expect(ResponsibleDataUse.all_stored_statuses['joebob'][:override]).to be_nil
      expect(ResponsibleDataUse.all_stored_statuses['billyray'][:override]).to eq(@billyray_when.to_s)
      expect(ResponsibleDataUse.all_stored_statuses['maryellen'][:override]).to be_nil
    end
  end

  context 'status_of' do
    it 'returns true, queues nothing for recent entry, no override' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      expect(ResponsibleDataUseImportJob).to_not receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to_not receive(:perform_later)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'returns true, queues nothing for recent entry, outdated override' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      ResponsibleDataUse.set_override_on('joebob', 6.years.ago)
      expect(ResponsibleDataUseImportJob).to_not receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to_not receive(:perform_later)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'returns true, queues nothing for recent entry, recent override' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      ResponsibleDataUse.set_override_on('joebob', 2.months.ago)
      expect(ResponsibleDataUseImportJob).to_not receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to_not receive(:perform_later)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'returns true, queues nothing for no entry, recent override' do
      ResponsibleDataUse.set_override_on('joebob', 2.months.ago)
      expect(ResponsibleDataUseImportJob).to_not receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to_not receive(:perform_later)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'returns true, queues nothing for outdated entry, recent override' do
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      ResponsibleDataUse.set_override_on('maryellen', 2.months.ago)
      expect(ResponsibleDataUseImportJob).to_not receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to_not receive(:perform_later)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(true)
    end

    it 'returns false, preps/queues job for no entry, no override' do
      expect(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to receive(:perform_later)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
    end

    it 'returns false, preps/queues job for outdated entry, no override' do
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      expect(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to receive(:perform_later)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(false)
    end

    it 'returns false, preps/queues job for no entry, outdated override' do
      ResponsibleDataUse.set_override_on('maryellen', 6.years.ago)
      expect(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to receive(:perform_later)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(false)
    end

    it 'returns false, preps/queues job for outdated entry, outdated override' do
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      ResponsibleDataUse.set_override_on('maryellen', 6.years.ago)
      expect(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
      expect(ResponsibleDataUseImportJob).to receive(:perform_later)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(false)
    end

    it 'uses ENV["RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS"] to decide if entry is too old' do
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      ENV['RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS'] = '100'
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(true)
    end

    it 'uses ENV["RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS"] to decide if override is too old' do
      ResponsibleDataUse.set_override_on('maryellen', 6.years.ago)
      ENV['RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS'] = '100'
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(true)
    end
  end

  context 'invalidate_all_responses' do
    it 'causes status_of to return false for all net_ids' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      ResponsibleDataUse.set_status_of('billyray', 1.minute.ago)
      ResponsibleDataUse.invalidate_all_responses(1.second.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(false)
      expect(ResponsibleDataUse.status_of('billyray')).to eq(false)
    end

    it 'invalidates overrides' do
      ResponsibleDataUse.set_override_on('joebob', 2.months.ago)
      ResponsibleDataUse.invalidate_all_responses(1.second.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
    end

    it 'invalidates old responses even when they get added later' do
      ResponsibleDataUse.invalidate_all_responses(1.second.ago)
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
    end

    it 'does not invalidate new responses' do
      ResponsibleDataUse.invalidate_all_responses(1.second.ago)
      sleep(2)
      ResponsibleDataUse.set_status_of('joebob', 1.second.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'when passed a time, invalidates anything before that time' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      ResponsibleDataUse.invalidate_all_responses(1.minute.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
    end

    it 'when passed a time, does not invalidate anything after that time' do
      ResponsibleDataUse.set_status_of('billyray', 1.minute.ago)
      ResponsibleDataUse.invalidate_all_responses(2.months.ago)
      expect(ResponsibleDataUse.status_of('billyray')).to eq(true)
    end

    it 'when passed nil, clears the invalidation date and falls back to ' \
       'RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS' do
      # we set RESPONSIBLE_DATA_USE_EXPIRE_AFTER_YEARS to 5 in tests
      ResponsibleDataUse.invalidate_all_responses(1.minute.ago)
      ResponsibleDataUse.set_status_of('jay', 6.years.ago)
      ResponsibleDataUse.set_status_of('silentbob', 4.years.ago)
      ResponsibleDataUse.invalidate_all_responses(nil)
      expect(ResponsibleDataUse.status_of('jay')).to eq(false)
      expect(ResponsibleDataUse.status_of('silentbob')).to eq(true)
    end
  end

  context 'clear_and_reload' do
    it 'does not wipe out the effect of invalidate_all_responses' do
      ResponsibleDataUse.invalidate_all_responses(1.second.ago)
      ResponsibleDataUse.clear_and_reload
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
    end

    it 'wipes responses for all net_ids' do
      ResponsibleDataUse.set_status_of('joebob', 2.months.ago)
      ResponsibleDataUse.set_status_of('maryellen', 6.years.ago)
      ResponsibleDataUse.set_status_of('billyray', 1.minute.ago)
      ResponsibleDataUse.clear_and_reload
      expect(ResponsibleDataUse.status_of('joebob')).to eq(false)
      expect(ResponsibleDataUse.status_of('maryellen')).to eq(false)
      expect(ResponsibleDataUse.status_of('billyray')).to eq(false)
    end

    it 'does not wipe out overrides' do
      ResponsibleDataUse.set_override_on('joebob', 2.months.ago)
      ResponsibleDataUse.clear_and_reload
      expect(ResponsibleDataUse.status_of('joebob')).to eq(true)
    end

    it 'calls reset_last_run on ResponsibleDataUseImportJob' do
      expect(ResponsibleDataUseImportJob).to receive(:reset_last_run)
      ResponsibleDataUse.clear_and_reload
    end

    it 'calls prepare_to_run on ResponsibleDataUseImportJob' do
      expect(ResponsibleDataUseImportJob).to receive(:prepare_to_run)
      ResponsibleDataUse.clear_and_reload
    end

    it 'calls perform_later on ResponsibleDataUseImportJob' do
      expect(ResponsibleDataUseImportJob).to receive(:perform_later)
      ResponsibleDataUse.clear_and_reload
    end
  end
end


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Uredo digitariae-violascens Z.C. Chen

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
import { git, IGitExecutionOptions, gitNetworkArguments } from './core'
import { ICloneProgress } from '../../models/progress'
import { CloneOptions } from '../../models/clone-options'
import { CloneProgressParser, executionOptionsWithProgress } from '../progress'
import { getDefaultBranch } from '../helpers/default-branch'
import { envForRemoteOperation } from './environment'

/**
 * Clones a repository from a given url into to the specified path.
 *
 * @param url     - The remote repository URL to clone from
 *
 * @param path    - The destination path for the cloned repository. If the
 *                  path does not exist it will be created. Cloning into an
 *                  existing directory is only allowed if the directory is
 *                  empty.
 *
 * @param options  - Options specific to the clone operation, see the
 *                   documentation for CloneOptions for more details.
 *
 * @param progressCallback - An optional function which will be invoked
 *                           with information about the current progress
 *                           of the clone operation. When provided this enables
 *                           the '--progress' command line flag for
 *                           'git clone'.
 *
 */
export async function clone(
  url: string,
  path: string,
  options: CloneOptions,
  progressCallback?: (progress: ICloneProgress) => void
): Promise<void> {
  const env = await envForRemoteOperation(options.account, url)

  const defaultBranch = options.defaultBranch ?? (await getDefaultBranch())

  const args = [
    ...gitNetworkArguments(),
    '-c',
    `init.defaultBranch=${defaultBranch}`,
    'clone',
    '--recursive',
  ]

  let opts: IGitExecutionOptions = { env }

  if (progressCallback) {
    args.push('--progress')

    const title = `Cloning into ${path}`
    const kind = 'clone'

    opts = await executionOptionsWithProgress(
      { ...opts, trackLFSProgress: true },
      new CloneProgressParser(),
      progress => {
        const description =
          progress.kind === 'progress' ? progress.details.text : progress.text
        const value = progress.percent

        progressCallback({ kind, title, description, value })
      }
    )

    // Initial progress
    progressCallback({ kind, title, value: 0 })
  }

  if (options.branch) {
    args.push('-b', options.branch)
  }

  args.push('--', url, path)

  await git(args, __dirname, 'clone', opts)
}


text:
<ymp_presentation>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_param_istitle>true</ymp_param_istitle>
		<ymp_title>Quantitative Equilibrium Calculations<br>Hemoglobin scenario</ymp_title>

		<ymp_idx>0</ymp_idx>
		<ymp_xAbsolute>25</ymp_xAbsolute>
		<ymp_yAbsolute>0</ymp_yAbsolute>
		<ymp_xOffset>25</ymp_xOffset>
		<ymp_yOffset>40</ymp_yOffset>
		<ymp_tc>00:00</ymp_tc>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>1</ymp_idx>
		<ymp_xAbsolute>55.4</ymp_xAbsolute>
		<ymp_yAbsolute>60</ymp_yAbsolute>
		<ymp_xOffset>157.0</ymp_xOffset>
		<ymp_yOffset>112.7</ymp_yOffset>
		<ymp_tc>00:01</ymp_tc>
		<ymp_txt><!--[1] -->This section uses quantitative calculations to describe the transport of oxygen from the lungs to the muscles.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>2</ymp_idx>
		<ymp_xAbsolute>234.95</ymp_xAbsolute>
		<ymp_yAbsolute>70</ymp_yAbsolute>
		<ymp_xOffset>152.6</ymp_xOffset>
		<ymp_yOffset>19.9</ymp_yOffset>
		<ymp_tc>00:02</ymp_tc>
		<ymp_txt><!--[2] -->Hemoglobin reacts with four oxygen molecules to form a complex molecule in which the oxygens are bound to the Hemoglobin.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>3</ymp_idx>
		<ymp_xAbsolute>224.2</ymp_xAbsolute>
		<ymp_yAbsolute>112.25</ymp_yAbsolute>
		<ymp_xOffset>101.6</ymp_xOffset>
		<ymp_yOffset>40.5</ymp_yOffset>
		<ymp_tc>00:03</ymp_tc>
		<ymp_txt><!--[3] -->We can write Q for this reaction in this form.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>4</ymp_idx>
		<ymp_xAbsolute>235.95</ymp_xAbsolute>
		<ymp_yAbsolute>106.9</ymp_yAbsolute>
		<ymp_xOffset>181.8</ymp_xOffset>
		<ymp_yOffset>38.6</ymp_yOffset>
		<ymp_tc>00:04</ymp_tc>
		<ymp_txt><!--[4] -->As in the previous scenario, we will adopt a convention in which the units for the Hemoglobin concentrations are M (or mol/liter) while the unit for the oxygen concentration is torr (or mm Hg). These are the standard units used in physiological studies of this reaction.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>5</ymp_idx>
		<ymp_xAbsolute>379.85</ymp_xAbsolute>
		<ymp_yAbsolute>86.3</ymp_yAbsolute>
		<ymp_xOffset>100.5</ymp_xOffset>
		<ymp_yOffset>19.2</ymp_yOffset>
		<ymp_tc>00:05</ymp_tc>
		<ymp_txt><!--[5] -->When concentrations are given in these units, the equilibrium constant has this value.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>6</ymp_idx>
		<ymp_xAbsolute>194.7</ymp_xAbsolute>
		<ymp_yAbsolute>172.5</ymp_yAbsolute>
		<ymp_xOffset>318.9</ymp_xOffset>
		<ymp_yOffset>23.9</ymp_yOffset>
		<ymp_tc>00:06</ymp_tc>
		<ymp_txt><!--[6] -->A healthy adult has a total concentration of Hemoglobin of about 240 microMolar.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>7</ymp_idx>
		<ymp_xAbsolute>389.6</ymp_xAbsolute>
		<ymp_yAbsolute>192.45</ymp_yAbsolute>
		<ymp_xOffset>121.5</ymp_xOffset>
		<ymp_yOffset>22.9</ymp_yOffset>
		<ymp_tc>00:07</ymp_tc>
		<ymp_txt><!--[7] -->One MicroMolar corresponds to 10-6 M.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>8</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>87.95</ymp_yAbsolute>
		<ymp_xOffset>118.1</ymp_xOffset>
		<ymp_yOffset>32.2</ymp_yOffset>
		<ymp_tc>00:08</ymp_tc>
		<ymp_txt><!--[8] -->We will calculate the concentrations of species in the blood system at two different points along the circulatory path: (1) when the blood is in the lungs, and (2) when the blood is in the muscles.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>
	<ymp_idx>9</ymp_idx>
	<ymp_xAbsolute>53.2</ymp_xAbsolute>
	<ymp_yAbsolute>218.85</ymp_yAbsolute>
	<ymp_xOffset>175.8</ymp_xOffset>
	<ymp_yOffset>13.9</ymp_yOffset>
	<ymp_tc>00:09</ymp_tc>
	<ymp_txt><!--[9] -->First, what are the concentrations of the chemical species when the blood is in the lungs?</ymp_txt>
</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>10</ymp_idx>
		<ymp_xAbsolute>62.45</ymp_xAbsolute>
		<ymp_yAbsolute>237.65</ymp_yAbsolute>
		<ymp_xOffset>284.0</ymp_xOffset>
		<ymp_yOffset>74.0</ymp_yOffset>
		<ymp_tc>00:10</ymp_tc>
		<ymp_txt><!--[10] -->For initial conditions, we will assume that none of the hemoglobin is bound to oxygen. The entire 240 micromolar of Hemoglobin is then in the form Hb.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>11</ymp_idx>
		<ymp_xAbsolute>191.45</ymp_xAbsolute>
		<ymp_yAbsolute>261.95</ymp_yAbsolute>
		<ymp_xOffset>108.2</ymp_xOffset>
		<ymp_yOffset>50.3</ymp_yOffset>
		<ymp_tc>00:11</ymp_tc>
		<ymp_txt><!--[11] -->The partial pressure of oxygen in fresh air is 100 torr. We will assume that the person is breathing sufficiently rapidly that their lungs remain full of fresh air. So, even though the blood is absorbing oxygen from the air, the oxygen pressure in the lungs remains at 100 torr.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>12</ymp_idx>
		<ymp_xAbsolute>85.95</ymp_xAbsolute>
		<ymp_yAbsolute>280.45</ymp_yAbsolute>
		<ymp_xOffset>246.1</ymp_xOffset>
		<ymp_yOffset>32.5</ymp_yOffset>
		<ymp_tc>00:12</ymp_tc>
		<ymp_txt><!--[12] -->To determine how much the concentrations change as the reaction reaches equilibrium, we will introduce a variable x to capture the progress of reaction. Since 1Hb must react for each HbO24 formed, we can write the equilibrium calculations in terms of x as shown here. </ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>13</ymp_idx>
		<ymp_xAbsolute>419.15</ymp_xAbsolute>
		<ymp_yAbsolute>229.55</ymp_yAbsolute>
		<ymp_xOffset>96.3</ymp_xOffset>
		<ymp_yOffset>39.2</ymp_yOffset>
		<ymp_tc>00:13</ymp_tc>
		<ymp_txt><!--[13] -->Since we know that K=Q at equilibrium, we can use this relationship to determine the value of x. For this reaction, K=Q has this form.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>14</ymp_idx>
		<ymp_xAbsolute>368.1</ymp_xAbsolute>
		<ymp_yAbsolute>281.4</ymp_yAbsolute>
		<ymp_xOffset>191.1</ymp_xOffset>
		<ymp_yOffset>33.0</ymp_yOffset>
		<ymp_tc>00:14</ymp_tc>
		<ymp_txt><!--[14] -->We know the value of K, given above and the concentrations from the equilibrium line of our table.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>15</ymp_idx>
		<ymp_xAbsolute>427.1</ymp_xAbsolute>
		<ymp_yAbsolute>308.7</ymp_yAbsolute>
		<ymp_xOffset>133.8</ymp_xOffset>
		<ymp_yOffset>41.8</ymp_yOffset>
		<ymp_tc>00:15</ymp_tc>
		<ymp_txt><!--[15] -->Solving this for x gives this value.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>16</ymp_idx>
		<ymp_xAbsolute>60.6</ymp_xAbsolute>
		<ymp_yAbsolute>312.35</ymp_yAbsolute>
		<ymp_xOffset>359.2</ymp_xOffset>
		<ymp_yOffset>81.9</ymp_yOffset>
		<ymp_tc>00:16</ymp_tc>
		<ymp_txt><!--[16] -->We can now put this value for x back into our equilibrium concentrations, leading to these concentrations for each species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>
	<ymp_idx>17</ymp_idx>
	<ymp_xAbsolute>59.8</ymp_xAbsolute>
	<ymp_yAbsolute>410.95</ymp_yAbsolute>
	<ymp_xOffset>333.8</ymp_xOffset>
	<ymp_yOffset>11.8</ymp_yOffset>
	<ymp_tc>00:17</ymp_tc>
	<ymp_txt><!--[17] -->The calculations we just completed did not make any assumptions regarding the reaction conditions or the magnitude of the equilibrium constant K. Another approach to solving this type of problem invokes the minority species approximation to simplify the calculation. This involves a two-step procedure.</ymp_txt>
</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>18</ymp_idx>
		<ymp_xAbsolute>71.3</ymp_xAbsolute>
		<ymp_yAbsolute>435.45</ymp_yAbsolute>
		<ymp_xOffset>480.6</ymp_xOffset>
		<ymp_yOffset>18.2</ymp_yOffset>
		<ymp_tc>00:18</ymp_tc>
		<ymp_txt><!--[18] -->Step 1 is to determine the majority species. That is, what species will be present in large amounts when the system reaches equilibrium? Since the supply of oxygen is unlimited (as the person is constantly breathing), oxygen will be one of the majority species. Because there is so much oxygen around, nearly all the Hb will react to form the bound Hb(O2)4 molecule. That is, at equilibrium, the system will progress almost completely to the right, the product side of the progress of reaction, as if the value of K=infinity. Since the concentrations of the majority species at equilibrium will be approximately equal to the concentrations if the forward reaction went to completion, we can use a limiting reagent calculation to determine the concentrations of O2 and Hb(O2)4.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>19</ymp_idx>
		<ymp_xAbsolute>74.3</ymp_xAbsolute>
		<ymp_yAbsolute>460.4</ymp_yAbsolute>
		<ymp_xOffset>428.1</ymp_xOffset>
		<ymp_yOffset>80.9</ymp_yOffset>
		<ymp_tc>00:19</ymp_tc>
		<ymp_txt><!--[19] -->In our approximation, the reaction will progess towards product until one of the  reactants runs out. The limiting reagent calculation tells us which reactant will run out first. As stated above, the person is breathing sufficiently rapidly that the oxygen pressure remains at 100 torr. Hb must then be the limiting reagent, and the reaction proceeds towards product until the Hb runs out.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>20</ymp_idx>
		<ymp_xAbsolute>75</ymp_xAbsolute>
		<ymp_yAbsolute>503.2</ymp_yAbsolute>
		<ymp_xOffset>294.6</ymp_xOffset>
		<ymp_yOffset>19.6</ymp_yOffset>
		<ymp_tc>00:20</ymp_tc>
		<ymp_txt><!--[20] -->Since Hb is the limiting reagent, when the system has progressed all the way to the right, no Hb remains and so the changes are as given here.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>21</ymp_idx>
		<ymp_xAbsolute>56.3</ymp_xAbsolute>
		<ymp_yAbsolute>531.25</ymp_yAbsolute>
		<ymp_xOffset>311.0</ymp_xOffset>
		<ymp_yOffset>16.3</ymp_yOffset>
		<ymp_tc>00:21</ymp_tc>
		<ymp_txt><!--[21] -->This leads to these final concentrations, labeled here as K= infinity, to indicate that we have assumed an infinite K.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>22</ymp_idx>
		<ymp_xAbsolute>229.05</ymp_xAbsolute>
		<ymp_yAbsolute>543.6</ymp_yAbsolute>
		<ymp_xOffset>168.6</ymp_xOffset>
		<ymp_yOffset>63.5</ymp_yOffset>
		<ymp_tc>00:22</ymp_tc>
		<ymp_txt><!--[22] -->Our majority species, Hb(O2)4 and O2, have nonzero concentrations when K = infinity, and we now know their concentrations.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>23</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>547</ymp_yAbsolute>
		<ymp_xOffset>148.4</ymp_xOffset>
		<ymp_yOffset>54.4</ymp_yOffset>
		<ymp_tc>00:23</ymp_tc>
		<ymp_txt><!--[23] -->When K = infinity, the limiting reagent is completely consumed and has zero concentration. However, in equilibrium systems, both the forward and reverse reactions are constantly occuring, so the limiting reagent will never have a value of zero. Thus the concentration of the limiting reagent will be very small, i.e. nearly zero, and this is a minority species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>
	<ymp_idx>24</ymp_idx>
	<ymp_xAbsolute>63.1</ymp_xAbsolute>
	<ymp_yAbsolute>628.45</ymp_yAbsolute>
	<ymp_xOffset>402.4</ymp_xOffset>
	<ymp_yOffset>12.2</ymp_yOffset>
	<ymp_tc>00:24</ymp_tc>
	<ymp_txt><!--[24] -->In step 2, we use the equilibrium expression K=Q to determine the concentration of the minority species.</ymp_txt>
</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>25</ymp_idx>
		<ymp_xAbsolute>84.95</ymp_xAbsolute>
		<ymp_yAbsolute>653.15</ymp_yAbsolute>
		<ymp_xOffset>194.6</ymp_xOffset>
		<ymp_yOffset>39.2</ymp_yOffset>
		<ymp_tc>00:25</ymp_tc>
		<ymp_txt><!--[25] -->For this reaction, K=Q takes this form.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>26</ymp_idx>
		<ymp_xAbsolute>287.1</ymp_xAbsolute>
		<ymp_yAbsolute>655.2</ymp_yAbsolute>
		<ymp_xOffset>92.6</ymp_xOffset>
		<ymp_yOffset>37.9</ymp_yOffset>
		<ymp_tc>00:26</ymp_tc>
		<ymp_txt><!--[26] -->Since the equilibrium concentrations of the majority species are nearly equal to the concentrations when the reaction goes to completion, we can use the values we derived above to put into our equilibrium expression.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>27</ymp_idx>
		<ymp_xAbsolute>398.4</ymp_xAbsolute>
		<ymp_yAbsolute>661.7</ymp_yAbsolute>
		<ymp_xOffset>139.8</ymp_xOffset>
		<ymp_yOffset>19.4</ymp_yOffset>
		<ymp_tc>00:27</ymp_tc>
		<ymp_txt><!--[27] -->We can then solve for the concentration of the minority species, Hb.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>28</ymp_idx>
		<ymp_xAbsolute>109.15</ymp_xAbsolute>
		<ymp_yAbsolute>715.95</ymp_yAbsolute>
		<ymp_xOffset>242.1</ymp_xOffset>
		<ymp_yOffset>64.8</ymp_yOffset>
		<ymp_tc>00:28</ymp_tc>
		<ymp_txt><!--[28] -->We now know the concentrations of both the majority and minority species. Our final step is to check our minority species assumption. That is, our approximation is only valid if the concentration of the minority species is less than 5% that of the majority species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>29</ymp_idx>
		<ymp_xAbsolute>309</ymp_xAbsolute>
		<ymp_yAbsolute>758.85</ymp_yAbsolute>
		<ymp_xOffset>222.7</ymp_xOffset>
		<ymp_yOffset>31.0</ymp_yOffset>
		<ymp_tc>00:29</ymp_tc>
		<ymp_txt><!--[29] -->The ratio between the minority and majority species is much less than 5%, so the minority species approximation holds. Comparison of the results obtained here to those obtained above without making the minority species approximation confirms that the approximation is a good one. The results are identical except for the majority species, Hb(O2)4, having a concentration of 239 vs. 240 micromolar, a 0.4% difference.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>
	<ymp_idx>30</ymp_idx>
	<ymp_xAbsolute>50</ymp_xAbsolute>
	<ymp_yAbsolute>810.5</ymp_yAbsolute>
	<ymp_xOffset>201.5</ymp_xOffset>
	<ymp_yOffset>15.2</ymp_yOffset>
	<ymp_tc>00:30</ymp_tc>
	<ymp_txt><!--[30] -->Next we'll calculate the concentrations of the chemical species when the blood is in the muscles.</ymp_txt>
</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>31</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>846.7</ymp_yAbsolute>
		<ymp_xOffset>284.0</ymp_xOffset>
		<ymp_yOffset>35.1</ymp_yOffset>
		<ymp_tc>00:31</ymp_tc>
		<ymp_txt><!--[31] -->For initial conditions, we will assume that none of the hemoglobin is bound to oxygen and that the entire 240 micromolar of Hemoglobin is in the form Hb.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>32</ymp_idx>
		<ymp_xAbsolute>192.75</ymp_xAbsolute>
		<ymp_yAbsolute>868.5</ymp_yAbsolute>
		<ymp_xOffset>99.5</ymp_xOffset>
		<ymp_yOffset>53.1</ymp_yOffset>
		<ymp_tc>00:32</ymp_tc>
		<ymp_txt><!--[32] -->The muscles are continuously consuming oxygen, and we will assume that the partial pressure of oxygen in the muscles remains constant at 5 torr.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>33</ymp_idx>
		<ymp_xAbsolute>51.8</ymp_xAbsolute>
		<ymp_yAbsolute>889.15</ymp_yAbsolute>
		<ymp_xOffset>266.5</ymp_xOffset>
		<ymp_yOffset>32.5</ymp_yOffset>
		<ymp_tc>00:33</ymp_tc>
		<ymp_txt><!--[33] -->Similar to the above calculation in the lungs, we introduce a variable x to capture the progress of reaction. This allows us to write the equilibrium concentrations in terms of x as shown here.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>34</ymp_idx>
		<ymp_xAbsolute>354.7</ymp_xAbsolute>
		<ymp_yAbsolute>838.55</ymp_yAbsolute>
		<ymp_xOffset>191.1</ymp_xOffset>
		<ymp_yOffset>84.5</ymp_yOffset>
		<ymp_tc>00:34</ymp_tc>
		<ymp_txt><!--[34] -->We next use K=Q at equilibrium to determine the value of x.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>35</ymp_idx>
		<ymp_xAbsolute>413.7</ymp_xAbsolute>
		<ymp_yAbsolute>917.75</ymp_yAbsolute>
		<ymp_xOffset>100.5</ymp_xOffset>
		<ymp_yOffset>44.1</ymp_yOffset>
		<ymp_tc>00:35</ymp_tc>
		<ymp_txt><!--[35] -->Solving this for x gives this value.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>36</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>922.4</ymp_yAbsolute>
		<ymp_xOffset>360.4</ymp_xOffset>
		<ymp_yOffset>81.3</ymp_yOffset>
		<ymp_tc>00:36</ymp_tc>
		<ymp_txt><!--[36] -->We can now put this value for x back into our equilibrium concentrations, leading to these results.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>
	<ymp_idx>37</ymp_idx>
	<ymp_xAbsolute>50</ymp_xAbsolute>
	<ymp_yAbsolute>1026.45</ymp_yAbsolute>
	<ymp_xOffset>333.9</ymp_xOffset>
	<ymp_yOffset>11.8</ymp_yOffset>
	<ymp_tc>00:37</ymp_tc>
	<ymp_txt><!--[37] -->The above calculations did not make any assumptions regarding the concentration of species or the magnitude of the equilibrium constant K. We will next redo this calculation invoking the minority species approximation to simplify the calculation. Again, this involves a two-step procedure.</ymp_txt>
</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>38</ymp_idx>
		<ymp_xAbsolute>59.55</ymp_xAbsolute>
		<ymp_yAbsolute>1055.35</ymp_yAbsolute>
		<ymp_xOffset>480.8</ymp_xOffset>
		<ymp_yOffset>18.2</ymp_yOffset>
		<ymp_tc>00:38</ymp_tc>
		<ymp_txt><!--[38] -->Step 1 is to determine the majority species. In the muscles, the concentration of oxygen is very low, so the reverse reaction will progress until the equilibrium lies far to the reactant side. To determine the majority species, we make the assumption that the reverse reaction progesses completely to the right, which can be done by assuming K is zero.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>39</ymp_idx>
		<ymp_xAbsolute>61.9</ymp_xAbsolute>
		<ymp_yAbsolute>1082</ymp_yAbsolute>
		<ymp_xOffset>444.8</ymp_xOffset>
		<ymp_yOffset>85.7</ymp_yOffset>
		<ymp_tc>00:39</ymp_tc>
		<ymp_txt><!--[39] -->When K = 0, the reaction will progress towards reactants until one of the products runs out. Since there is only one product, Hb(O2)4, it must be the limiting reagent.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>40</ymp_idx>
		<ymp_xAbsolute>62</ymp_xAbsolute>
		<ymp_yAbsolute>1129.8</ymp_yAbsolute>
		<ymp_xOffset>269.2</ymp_xOffset>
		<ymp_yOffset>13.6</ymp_yOffset>
		<ymp_tc>00:40</ymp_tc>
		<ymp_txt><!--[40] -->In our initial concentrations, the product is already at zero concentration, so there is no change in concentrations. Note also that, as above, the muscles keep the oxygen pressure at 5 torr.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>41</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>1150.3</ymp_yAbsolute>
		<ymp_xOffset>286.9</ymp_xOffset>
		<ymp_yOffset>18.0</ymp_yOffset>
		<ymp_tc>00:41</ymp_tc>
		<ymp_txt><!--[41] -->This leads to these final concentrations, labeled here as K= 0, to indicate that we have assumed a zero value for K.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>42</ymp_idx>
		<ymp_xAbsolute>70.15</ymp_xAbsolute>
		<ymp_yAbsolute>1168.7</ymp_yAbsolute>
		<ymp_xOffset>161.8</ymp_xOffset>
		<ymp_yOffset>51.1</ymp_yOffset>
		<ymp_tc>00:42</ymp_tc>
		<ymp_txt><!--[42] -->Those species that have nonzero concentrations when K = 0 are majority species, and we now know their concentrations.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>43</ymp_idx>
		<ymp_xAbsolute>280.85</ymp_xAbsolute>
		<ymp_yAbsolute>1165.7</ymp_yAbsolute>
		<ymp_xOffset>148.6</ymp_xOffset>
		<ymp_yOffset>51.2</ymp_yOffset>
		<ymp_tc>00:43</ymp_tc>
		<ymp_txt><!--[43] -->When K = 0, the limiting reagent is completely consumed and has zero concentration. Since both reactions are constantly occuring, K will be very small but not zero. So the concentration of the minorty species is nearly zero.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>44</ymp_idx>
		<ymp_xAbsolute>50.4</ymp_xAbsolute>
		<ymp_yAbsolute>1249.2</ymp_yAbsolute>
		<ymp_xOffset>402.5</ymp_xOffset>
		<ymp_yOffset>12.2</ymp_yOffset>
		<ymp_tc>00:44</ymp_tc>
		<ymp_txt><!--[44] -->Since we know the minority species is not exactly zero, in step 2, we use the equilibrium expression K=Q to determine the concentration of the minority species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>45</ymp_idx>
		<ymp_xAbsolute>50</ymp_xAbsolute>
		<ymp_yAbsolute>1273.95</ymp_yAbsolute>
		<ymp_xOffset>194.7</ymp_xOffset>
		<ymp_yOffset>39.2</ymp_yOffset>
		<ymp_tc>00:45</ymp_tc>
		<ymp_txt><!--[45] -->For this reaction, K=Q takes this form.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>46</ymp_idx>
		<ymp_xAbsolute>253.05</ymp_xAbsolute>
		<ymp_yAbsolute>1273.9</ymp_yAbsolute>
		<ymp_xOffset>100.0</ymp_xOffset>
		<ymp_yOffset>36.4</ymp_yOffset>
		<ymp_tc>00:46</ymp_tc>
		<ymp_txt><!--[46] -->We know the concentrations of the majority species when the reverse reaction goes to completion are approximately equal to equilibrium concentrations, so we can put those into our equilibrium expression.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>47</ymp_idx>
		<ymp_xAbsolute>366.7</ymp_xAbsolute>
		<ymp_yAbsolute>1292.6</ymp_yAbsolute>
		<ymp_xOffset>169.8</ymp_xOffset>
		<ymp_yOffset>19.6</ymp_yOffset>
		<ymp_tc>00:47</ymp_tc>
		<ymp_txt><!--[47] -->We can then solve for the concentration of the minority species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>48</ymp_idx>
		<ymp_xAbsolute>66.6</ymp_xAbsolute>
		<ymp_yAbsolute>1327.5</ymp_yAbsolute>
		<ymp_xOffset>252.2</ymp_xOffset>
		<ymp_yOffset>64.8</ymp_yOffset>
		<ymp_tc>00:48</ymp_tc>
		<ymp_txt><!--[48] -->We now know the concentrations of both the majority and minority species. Our final step is to check our minority species assumption. To do this, we check to make sure that the concentration of the minority species is less than 5% that of the majority species.</ymp_txt>
	</ymp_slice>

	<ymp_slice>
		<ymp_param_hasaudio>true</ymp_param_hasaudio>

		<ymp_idx>49</ymp_idx>
		<ymp_xAbsolute>286.65</ymp_xAbsolute>
		<ymp_yAbsolute>1366.4</ymp_yAbsolute>
		<ymp_xOffset>222.7</ymp_xOffset>
		<ymp_yOffset>34.3</ymp_yOffset>
		<ymp_tc>00:49</ymp_tc>
		<ymp_txt><!--[49] -->The ratio between the minority and majority species is much less than 5%, so the minority species approximation holds. Comparison of the results obtained here to those obtained above without making the minority species approximation confirms that the approximation is a good one. The results are identical.</ymp_txt>
	</ymp_slice>
</ymp_presentation>


text:
from builtins import object
from django.db import models
from django.utils.translation import gettext_lazy as _

class Redirect(models.Model):
    old_path = models.CharField(
        _('redirect from'), max_length=200, db_index=True, unique=True,
        help_text=_("This should be an absolute path, excluding the "
                    "domain name. Example: '/events/search/'."))
    new_path = models.CharField(
        _('redirect to'), max_length=200, blank=True,
        help_text=_("This can be either an absolute path (as above) "
                    "or a full URL starting with 'http://'."))
    regular_expression = models.BooleanField(
        _('Match using regular expressions'), default=False,
        help_text=_("If checked, the redirect-from and redirect-to fields "
                    "will also be processed using regular expressions when "
                    "matching incoming requests.
Example: "
                    "/projects/.* -> /#!/projects will "
                    "redirect everyone visiting a page starting with "
                    "/projects/
Example: /projects/(.*) -> "
                    "/#!/projects/$1 will turn /projects/myproject "
                    "into /#!/projects/myproject

Invalid regular "
                    "expressions will be ignored."))

    fallback_redirect = models.BooleanField(
        _("Fallback redirect"), default=False,
        help_text=_("This redirect is only matched after all other redirects "
                    "have failed to match.
This allows us to define a "
                    "general 'catch-all' that is only used as a fallback "
                    "after more specific redirects have been attempted."))

    nr_times_visited = models.IntegerField(
        default=0,
        help_text=_("Is incremented each time a visitor hits this redirect"))

    class Meta(object):
        verbose_name = _('redirect')
        verbose_name_plural = _('redirects')
        db_table = 'django_redirect'
        ordering = ('fallback_redirect', 'regular_expression', 'old_path',)

    def __str__(self):
        return "%s ---> %s" % (self.old_path, self.new_path)


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.messages = exports.ruleName = undefined;

exports.default = function (expectation) {
  return function (root, result) {
    var validOptions = (0, _utils.validateOptions)(result, ruleName, {
      actual: expectation,
      possible: ["lower", "upper"]
    });
    if (!validOptions) {
      return;
    }

    root.walkRules(function (rule) {
      var selector = rule.selector;
      var startIndexPseudoElement = selector.indexOf(":");

      if (startIndexPseudoElement === -1) {
        return;
      }

      (0, _postcssSelectorParser2.default)(function (selectorTree) {
        selectorTree.walkPseudos(function (pseudoNode) {
          var pseudoElement = pseudoNode.value;

          if (pseudoElement.indexOf("::") === -1 && !pseudoElements.has(pseudoElement.toLowerCase())) {
            return;
          }

          var expectedPseudoElement = expectation === "lower" ? pseudoElement.toLowerCase() : pseudoElement.toUpperCase();

          if (pseudoElement === expectedPseudoElement) {
            return;
          }

          (0, _utils.report)({
            message: messages.expected(pseudoElement, expectedPseudoElement),
            node: rule,
            index: pseudoNode.sourceIndex,
            ruleName: ruleName,
            result: result
          });
        });
      }).process(selector);
    });
  };
};

var _postcssSelectorParser = require("postcss-selector-parser");

var _postcssSelectorParser2 = _interopRequireDefault(_postcssSelectorParser);

var _utils = require("../../utils");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ruleName = exports.ruleName = "selector-pseudo-element-case";

var messages = (0, _utils.ruleMessages)(ruleName, {
  expected: function expected(actual, _expected) {
    return "Expected \"" + actual + "\" to be \"" + _expected + "\"";
  }
});

// level 1 and 2 pseudo elements
exports.messages = messages;
var pseudoElements = new Set([":before", ":after", ":first-line", ":first-letter"]);


text:
module SwellTrials
	module ApplicationControllerExtensions

		def set_participant
			if request.user_agent.present? && request.user_agent.match( /bot|spider|wget|feed|indexer|lwp-trivial|curl|libwww-perl|slurp|wordpress|zyborg|pinger|crawler/i )
				return false
			else
				cookies[:pid] = Time.now # TODO - random hash or record in db
			end
		end

	end

end


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Audit.Core;

namespace Audit.EntityFramework.ConfigurationApi
{
    public class AuditEntityMapping : IAuditEntityMapping
    {
        private Dictionary<Type, MappingInfo> _mapping = new Dictionary<Type, MappingInfo>();
        private List<KeyValuePair<Func<EventEntry, bool>, MappingInfo>> _explicitMapping = new List<KeyValuePair<Func<EventEntry, bool>, MappingInfo>>();
        private Func<AuditEvent, EventEntry, object, Task<bool>> _commonAction = null;

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>()
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo() { TargetType = typeof(TAuditEntity) };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Action<AuditEvent, EventEntry, TAuditEntity> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, ent, auditEntity) =>
                {
                    entityAction.Invoke(ev, ent, (TAuditEntity)auditEntity);
                    return Task.FromResult(true);
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<AuditEvent, EventEntry, TAuditEntity, Task> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, ent, auditEntity) =>
                {
                    await entityAsyncAction.Invoke(ev, ent, (TAuditEntity)auditEntity);
                    return true;
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<AuditEvent, EventEntry, TAuditEntity, bool> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, ent, auditEntity) => Task.FromResult(entityAction.Invoke(ev, ent, (TAuditEntity)auditEntity))
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<AuditEvent, EventEntry, TAuditEntity, Task<bool>> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, ent, auditEntity) => await entityAsyncAction.Invoke(ev, ent, (TAuditEntity)auditEntity)
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Action<TSourceEntity, TAuditEntity> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, ent, auditEntity) =>
                {
                    entityAction.Invoke((TSourceEntity)ent.Entry.Entity, (TAuditEntity)auditEntity);
                    return Task.FromResult(true);
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<TSourceEntity, TAuditEntity, Task> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, ent, auditEntity) =>
                {
                    await entityAsyncAction.Invoke((TSourceEntity)ent.Entry.Entity, (TAuditEntity)auditEntity);
                    return true;
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<TSourceEntity, TAuditEntity, bool> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, ent, auditEntity) => Task.FromResult(entityAction.Invoke((TSourceEntity)ent.Entry.Entity, (TAuditEntity)auditEntity))
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity, TAuditEntity>(Func<TSourceEntity, TAuditEntity, Task<bool>> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, ent, auditEntity) => await entityAsyncAction.Invoke((TSourceEntity)ent.Entry.Entity, (TAuditEntity)auditEntity)
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity>(Func<EventEntry, Type> mapper, Func<AuditEvent, EventEntry, object, bool> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetTypeMapper = mapper,
                Action = (ev, ent, auditEntity) => Task.FromResult(entityAction.Invoke(ev, ent, auditEntity))
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity>(Func<EventEntry, Type> mapper, Func<AuditEvent, EventEntry, object, Task<bool>> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetTypeMapper = mapper,
                Action = async (ev, ent, auditEntity) => await entityAsyncAction.Invoke(ev, ent, auditEntity)
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity>(Func<EventEntry, Type> mapper, Action<AuditEvent, EventEntry, object> entityAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetTypeMapper = mapper,
                Action = (ev, entry, entity) =>
                {
                    entityAction.Invoke(ev, entry, entity);
                    return Task.FromResult(true);
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity>(Func<EventEntry, Type> mapper, Func<AuditEvent, EventEntry, object, Task> entityAsyncAction)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetTypeMapper = mapper,
                Action = async (ev, entry, entity) =>
                {
                    await entityAsyncAction.Invoke(ev, entry, entity);
                    return true;
                }
            };
            return this;
        }

        public IAuditEntityMapping Map<TSourceEntity>(Func<EventEntry, Type> mapper)
        {
            _mapping[typeof(TSourceEntity)] = new MappingInfo()
            {
                TargetTypeMapper = mapper
            };
            return this;
        }

        public IAuditEntityMapping MapExplicit<TAuditEntity>(Func<EventEntry, bool> predicate, Action<EventEntry, TAuditEntity> entityAction = null)
        {
            _explicitMapping.Add(new KeyValuePair<Func<EventEntry, bool>, MappingInfo>(predicate, new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, entry, entity) =>
                {
                    entityAction?.Invoke(entry, (TAuditEntity)entity);
                    return Task.FromResult(true);
                }
            }));
            return this;
        }

        public IAuditEntityMapping MapExplicit<TAuditEntity>(Func<EventEntry, bool> predicate, Func<EventEntry, TAuditEntity, Task> entityAsyncAction = null)
        {
            _explicitMapping.Add(new KeyValuePair<Func<EventEntry, bool>, MappingInfo>(predicate, new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, entry, entity) =>
                {
                    await entityAsyncAction?.Invoke(entry, (TAuditEntity)entity);
                    return true;
                }
            }));
            return this;
        }

        public IAuditEntityMapping MapTable<TAuditEntity>(string tableName, Action<EventEntry, TAuditEntity> entityAction = null)
        {
            _explicitMapping.Add(new KeyValuePair<Func<EventEntry, bool>, MappingInfo>(ent => ent.Table?.Equals(tableName) == true, new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = (ev, entry, entity) =>
                {
                    entityAction?.Invoke(entry, (TAuditEntity)entity);
                    return Task.FromResult(true);
                }
            }));
            return this;
        }

        public IAuditEntityMapping MapTable<TAuditEntity>(string tableName, Func<EventEntry, TAuditEntity, Task> entityAsyncAction = null)
        {
            _explicitMapping.Add(new KeyValuePair<Func<EventEntry, bool>, MappingInfo>(ent => ent.Table?.Equals(tableName) == true, new MappingInfo()
            {
                TargetType = typeof(TAuditEntity),
                Action = async (ev, entry, entity) =>
                {
                    await entityAsyncAction?.Invoke(entry, (TAuditEntity)entity);
                    return true;
                }
            }));
            return this;
        }

        public void AuditEntityAction(Action<AuditEvent, EventEntry, object> entityAction)
        {
            _commonAction = (ev, ent, auditEntity) =>
            {
                entityAction.Invoke(ev, ent, auditEntity);
                return Task.FromResult(true);
            };
        }

        public void AuditEntityAction(Func<AuditEvent, EventEntry, object, bool> entityAction)
        {
            _commonAction = (ev, ent, auditEntity) => Task.FromResult(entityAction.Invoke(ev, ent, auditEntity));
        }

        public void AuditEntityAction<T>(Action<AuditEvent, EventEntry, T> entityAction)
        {
            _commonAction = (ev, ent, auditEntity) =>
            {
                entityAction.Invoke(ev, ent, (T)auditEntity);
                return Task.FromResult(true);
            };
        }

        public void AuditEntityAction<T>(Func<AuditEvent, EventEntry, T, bool> entityAction)
        {
            _commonAction = (ev, ent, auditEntity) => Task.FromResult(entityAction.Invoke(ev, ent, (T)auditEntity));
        }

        public void AuditEntityAction(Func<AuditEvent, EventEntry, object, Task<bool>> entityAsyncAction)
        {
            _commonAction = async (ev, ent, auditEntity) => await entityAsyncAction.Invoke(ev, ent, auditEntity);
        }

        public void AuditEntityAction<T>(Func<AuditEvent, EventEntry, T, Task<bool>> entityAsyncAction)
        {
            _commonAction = async (ev, ent, auditEntity) => await entityAsyncAction.Invoke(ev, ent, (T)auditEntity);
        }

        public void AuditEntityAction(Func<AuditEvent, EventEntry, object, Task> entityAsyncAction)
        {
            _commonAction = async (ev, ent, auditEntity) =>
            {
                await entityAsyncAction.Invoke(ev, ent, auditEntity);
                return true;
            };
        }

        public void AuditEntityAction<T>(Func<AuditEvent, EventEntry, T, Task> entityAsyncAction)
        {
            _commonAction = async (ev, ent, auditEntity) =>
            {
                await entityAsyncAction.Invoke(ev, ent, (T)auditEntity);
                return true;
            };
        }

        internal Func<Type, EventEntry, Type> GetMapper()
        {
            return (t, e) =>
            {
                _mapping.TryGetValue(t, out MappingInfo map);
                return map?.TargetTypeMapper?.Invoke(e);
            };
        }

        internal Func<EventEntry, Type> GetExplicitMapper()
        {
            return (e) =>
            {
                if (_explicitMapping == null)
                {
                    return null;
                }
                foreach (var em in _explicitMapping)
                {
                    if (em.Key.Invoke(e))
                    {
                        return em.Value.TargetTypeMapper?.Invoke(e);
                    }
                }
                return null;
            };
        }

        // Returns a generic action that executes the specific action for the mapping and the common action
        internal Func<AuditEvent, EventEntry, object, Task<bool>> GetAction()
        {
            return async (ev, ent, auditEntity) =>
            {
                MappingInfo map = null;
                bool include = true;
                bool mappedExplicitly = false;
                if (_explicitMapping != null)
                {
                    foreach (var em in _explicitMapping)
                    {
                        if (em.Key.Invoke(ent))
                        {
                            map = em.Value;
                            include = await map.Action.Invoke(ev, ent, auditEntity);
                            mappedExplicitly = true;
                            break;
                        }
                    }
                }
                if (!mappedExplicitly)
                {
                    var entityType = ent.EntityType;
                    if (entityType != null && _mapping.TryGetValue(entityType, out map))
                    {
                        if (map.Action != null)
                        {
                            include = await map.Action.Invoke(ev, ent, auditEntity);
                        }
                    }
                }

                if (include && _commonAction != null)
                {
                    include = await _commonAction.Invoke(ev, ent, auditEntity);
                }
                return include;
            };
        }
    }
}


text:
namespace csCommon.Types.Geometries.AdvancedGeometry.GeometryTransformers
{
	/// <summary>
	/// Arrow Pattern Transformer
	/// </summary>
	public class ArrowPatternTransformer : PatternTransformer
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ArrowPatternTransformer"/> class.
		/// </summary>
		public ArrowPatternTransformer()
		{
			AtStart = false;
			AtMiddle = false;
			AtEnd = true;
			BySegment = false;

			PatternName = "arrow";
		}
	}

}


text:
package com.amazonaws.services.emrserverless.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListJobRunsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The ID of the application for which to list the job run.
     *

     */
    private String applicationId;
    /**
     *

     * The token for the next set of job run results.
     *

     */
    private String nextToken;
    /**
     *

     * The maximum number of job runs that can be listed.
     *

     */
    private Integer maxResults;
    /**
     *

     * The lower bound of the option to filter by creation date and time.
     *

     */
    private java.util.Date createdAtAfter;
    /**
     *

     * The upper bound of the option to filter by creation date and time.
     *

     */
    private java.util.Date createdAtBefore;
    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     */
    private java.util.List<String> states;

    /**
     *

     * The ID of the application for which to list the job run.
     *

     *
     * @param applicationId
     *        The ID of the application for which to list the job run.
     */

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    /**
     *

     * The ID of the application for which to list the job run.
     *

     *
     * @return The ID of the application for which to list the job run.
     */

    public String getApplicationId() {
        return this.applicationId;
    }

    /**
     *

     * The ID of the application for which to list the job run.
     *

     *
     * @param applicationId
     *        The ID of the application for which to list the job run.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListJobRunsRequest withApplicationId(String applicationId) {
        setApplicationId(applicationId);
        return this;
    }

    /**
     *

     * The token for the next set of job run results.
     *

     *
     * @param nextToken
     *        The token for the next set of job run results.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * The token for the next set of job run results.
     *

     *
     * @return The token for the next set of job run results.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * The token for the next set of job run results.
     *

     *
     * @param nextToken
     *        The token for the next set of job run results.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListJobRunsRequest withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     *

     * The maximum number of job runs that can be listed.
     *

     *
     * @param maxResults
     *        The maximum number of job runs that can be listed.
     */

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    /**
     *

     * The maximum number of job runs that can be listed.
     *

     *
     * @return The maximum number of job runs that can be listed.
     */

    public Integer getMaxResults() {
        return this.maxResults;
    }

    /**
     *

     * The maximum number of job runs that can be listed.
     *

     *
     * @param maxResults
     *        The maximum number of job runs that can be listed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListJobRunsRequest withMaxResults(Integer maxResults) {
        setMaxResults(maxResults);
        return this;
    }

    /**
     *

     * The lower bound of the option to filter by creation date and time.
     *

     *
     * @param createdAtAfter
     *        The lower bound of the option to filter by creation date and time.
     */

    public void setCreatedAtAfter(java.util.Date createdAtAfter) {
        this.createdAtAfter = createdAtAfter;
    }

    /**
     *

     * The lower bound of the option to filter by creation date and time.
     *

     *
     * @return The lower bound of the option to filter by creation date and time.
     */

    public java.util.Date getCreatedAtAfter() {
        return this.createdAtAfter;
    }

    /**
     *

     * The lower bound of the option to filter by creation date and time.
     *

     *
     * @param createdAtAfter
     *        The lower bound of the option to filter by creation date and time.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListJobRunsRequest withCreatedAtAfter(java.util.Date createdAtAfter) {
        setCreatedAtAfter(createdAtAfter);
        return this;
    }

    /**
     *

     * The upper bound of the option to filter by creation date and time.
     *

     *
     * @param createdAtBefore
     *        The upper bound of the option to filter by creation date and time.
     */

    public void setCreatedAtBefore(java.util.Date createdAtBefore) {
        this.createdAtBefore = createdAtBefore;
    }

    /**
     *

     * The upper bound of the option to filter by creation date and time.
     *

     *
     * @return The upper bound of the option to filter by creation date and time.
     */

    public java.util.Date getCreatedAtBefore() {
        return this.createdAtBefore;
    }

    /**
     *

     * The upper bound of the option to filter by creation date and time.
     *

     *
     * @param createdAtBefore
     *        The upper bound of the option to filter by creation date and time.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ListJobRunsRequest withCreatedAtBefore(java.util.Date createdAtBefore) {
        setCreatedAtBefore(createdAtBefore);
        return this;
    }

    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     *
     * @return An optional filter for job run states. Note that if this filter contains multiple states, the resulting
     *         list will be grouped by the state.
     * @see JobRunState
     */

    public java.util.List<String> getStates() {
        return states;
    }

    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     *
     * @param states
     *        An optional filter for job run states. Note that if this filter contains multiple states, the resulting
     *        list will be grouped by the state.
     * @see JobRunState
     */

    public void setStates(java.util.Collection<String> states) {
        if (states == null) {
            this.states = null;
            return;
        }

        this.states = new java.util.ArrayList<String>(states);
    }

    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setStates(java.util.Collection)} or {@link #withStates(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param states
     *        An optional filter for job run states. Note that if this filter contains multiple states, the resulting
     *        list will be grouped by the state.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see JobRunState
     */

    public ListJobRunsRequest withStates(String... states) {
        if (this.states == null) {
            setStates(new java.util.ArrayList<String>(states.length));
        }
        for (String ele : states) {
            this.states.add(ele);
        }
        return this;
    }

    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     *
     * @param states
     *        An optional filter for job run states. Note that if this filter contains multiple states, the resulting
     *        list will be grouped by the state.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see JobRunState
     */

    public ListJobRunsRequest withStates(java.util.Collection<String> states) {
        setStates(states);
        return this;
    }

    /**
     *

     * An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will
     * be grouped by the state.
     *

     *
     * @param states
     *        An optional filter for job run states. Note that if this filter contains multiple states, the resulting
     *        list will be grouped by the state.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see JobRunState
     */

    public ListJobRunsRequest withStates(JobRunState... states) {
        java.util.ArrayList<String> statesCopy = new java.util.ArrayList<String>(states.length);
        for (JobRunState value : states) {
            statesCopy.add(value.toString());
        }
        if (getStates() == null) {
            setStates(statesCopy);
        } else {
            getStates().addAll(statesCopy);
        }
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getApplicationId() != null)
            sb.append("ApplicationId: ").append(getApplicationId()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken()).append(",");
        if (getMaxResults() != null)
            sb.append("MaxResults: ").append(getMaxResults()).append(",");
        if (getCreatedAtAfter() != null)
            sb.append("CreatedAtAfter: ").append(getCreatedAtAfter()).append(",");
        if (getCreatedAtBefore() != null)
            sb.append("CreatedAtBefore: ").append(getCreatedAtBefore()).append(",");
        if (getStates() != null)
            sb.append("States: ").append(getStates());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ListJobRunsRequest == false)
            return false;
        ListJobRunsRequest other = (ListJobRunsRequest) obj;
        if (other.getApplicationId() == null ^ this.getApplicationId() == null)
            return false;
        if (other.getApplicationId() != null && other.getApplicationId().equals(this.getApplicationId()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        if (other.getMaxResults() == null ^ this.getMaxResults() == null)
            return false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
            return false;
        if (other.getCreatedAtAfter() == null ^ this.getCreatedAtAfter() == null)
            return false;
        if (other.getCreatedAtAfter() != null && other.getCreatedAtAfter().equals(this.getCreatedAtAfter()) == false)
            return false;
        if (other.getCreatedAtBefore() == null ^ this.getCreatedAtBefore() == null)
            return false;
        if (other.getCreatedAtBefore() != null && other.getCreatedAtBefore().equals(this.getCreatedAtBefore()) == false)
            return false;
        if (other.getStates() == null ^ this.getStates() == null)
            return false;
        if (other.getStates() != null && other.getStates().equals(this.getStates()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getApplicationId() == null) ? 0 : getApplicationId().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
        hashCode = prime * hashCode + ((getCreatedAtAfter() == null) ? 0 : getCreatedAtAfter().hashCode());
        hashCode = prime * hashCode + ((getCreatedAtBefore() == null) ? 0 : getCreatedAtBefore().hashCode());
        hashCode = prime * hashCode + ((getStates() == null) ? 0 : getStates().hashCode());
        return hashCode;
    }

    @Override
    public ListJobRunsRequest clone() {
        return (ListJobRunsRequest) super.clone();
    }

}


text:
@implementation SDLReadDID

- (instancetype)init {
    if (self = [super initWithName:NAMES_ReadDID]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setEcuName:(NSNumber *)ecuName {
    if (ecuName != nil) {
        [parameters setObject:ecuName forKey:NAMES_ecuName];
    } else {
        [parameters removeObjectForKey:NAMES_ecuName];
    }
}

- (NSNumber *)ecuName {
    return [parameters objectForKey:NAMES_ecuName];
}

- (void)setDidLocation:(NSMutableArray *)didLocation {
    if (didLocation != nil) {
        [parameters setObject:didLocation forKey:NAMES_didLocation];
    } else {
        [parameters removeObjectForKey:NAMES_didLocation];
    }
}

- (NSMutableArray *)didLocation {
    return [parameters objectForKey:NAMES_didLocation];
}

@end


text:
class ModuleDocFragment(object):
    # Parameters for VMware modules
    DOCUMENTATION = '''
options:
    hostname:
        description:
            - The hostname or IP address of the vSphere vCenter.
        required: True
    username:
        description:
            - The username of the vSphere vCenter.
        required: True
        aliases: ['user', 'admin']
    password:
        description:
            - The password of the vSphere vCenter.
        required: True
        aliases: ['pass', 'pwd']
    validate_certs:
        description:
            - Allows connection when SSL certificates are not valid. Set to
              false when certificates are not trusted.
        required: False
        default: 'True'
        choices: ['True', 'False']
'''


text:
<?php

declare(strict_types=1);

namespace Doctrine\Tests\Models\ProxySpecifics;

use Doctrine\ORM\Annotation as ORM;

/** @ORM\Entity */
class FuncGetArgs
{
    /** @ORM\Id @ORM\Column(type="integer") */
    public $id;

    public function funcGetArgsCallingMethod() : array
    {
        return \func_get_args();
    }
}


text:
package com.haulmont.cuba.gui.components.filter.edit;

import com.haulmont.cuba.gui.components.TextField;
import com.haulmont.cuba.gui.components.filter.condition.FtsCondition;

import javax.inject.Inject;
import java.util.Map;

public class FtsConditionFrame extends ConditionFrame<FtsCondition> {
    @Inject
    protected TextField<String> caption;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);
    }

    @Override
    public void setCondition(FtsCondition condition) {
        super.setCondition(condition);
        caption.setValue(condition.getCaption());
    }

    @Override
    public boolean commit() {
        if (!super.commit())
            return false;
        condition.setCaption(caption.getValue());
        return true;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<clinical_study rank="1">
  <!-- This xml conforms to an XML Schema at:
    http://clinicaltrials.gov/ct2/html/images/info/public.xsd
 and an XML DTD at:
    http://clinicaltrials.gov/ct2/html/images/info/public.dtd -->
  <required_header>
    <download_date>ClinicalTrials.gov processed this data on June 07, 2015</download_date>
    <link_text>Link to the current ClinicalTrials.gov record.</link_text>
    <url>http://clinicaltrials.gov/show/NCT01992185</url>
  </required_header>
  <id_info>
    <org_study_id>AB-DRUG-PHOTOCIL-VT-001</org_study_id>
    <nct_id>NCT01992185</nct_id>
  </id_info>
  <brief_title>Photocil (Topical) for the Treatment of Vitiligo</brief_title>
  <official_title>Pilot Study of Novel Topical Drug (Photocil) for the Treatment of Vitiligo</official_title>
  <sponsors>
    <lead_sponsor>
      <agency>Applied Biology, Inc.</agency>
      <agency_class>Industry</agency_class>
    </lead_sponsor>
  </sponsors>
  <source>Applied Biology, Inc.</source>
  <oversight_info>
    <authority>United States: Institutional Review Board</authority>
    <has_dmc>No</has_dmc>
  </oversight_info>
  <brief_summary>
    <textblock>
      Photocil is a topical drug (cream) that selectively delivers Narrow Band - Ultraviolet B
      (NB-UVB) therapy when exposed to sunlight. Photocil is intended to help protect users from
      non-therapeutic Ultraviolet B (UVB) radiation while selectively passing wavelengths of light
      in the NB-UVB range with peak transmission of 308nm. The aim of the study is to assess the
      safety and efficacy of Photocil in the treatment of vitiligo.
    </textblock>
  </brief_summary>
  <detailed_description>
    <textblock>
      NB-UVB phototherapy is a common treatment for patients with psoriasis, and has been reported
      to be safe and effective in numerous clinical trials. Clinical trials have reported
      achievement of Vitiligo Area Severity Index (VASI)-75 in 50-70% of patients after 4-6 weeks
      of NB-UVB treatment.

      Many drawbacks limit patients compliance, access, and acceptance of traditional NB-UVB
      phototherapy. The strict treatment regimen (2-3 sessions per week for an average of 12 weeks
      or more) performed at a specialized phototherapy clinic combined with high cost and low or
      no reimbursement make compliance and access a major drawback.

      In order to address the drawbacks of phototherapy, we developed a novel topical cream -
      Photocil - that selectively delivers NB-UVB therapy when exposed to sunlight. When used with
      natural sunlight, Photocil provides a convenient alternative to traditional clinic based
      phototherapy; thus, has the potential to dramatically increase patient compliance and
      treatment outcome.
    </textblock>
  </detailed_description>
  <overall_status>Recruiting</overall_status>
  <start_date>August 2013</start_date>
  <completion_date type="Anticipated">July 2014</completion_date>
  <primary_completion_date type="Anticipated">July 2014</primary_completion_date>
  <phase>N/A</phase>
  <study_type>Interventional</study_type>
  <study_design>Allocation: Randomized, Intervention Model: Parallel Assignment, Masking: Double Blind (Subject, Caregiver, Investigator, Outcomes Assessor), Primary Purpose: Treatment</study_design>
  <primary_outcome>
    <measure>Vitiligo Area Severity Index (VASI)</measure>
    <time_frame>90 days</time_frame>
    <safety_issue>No</safety_issue>
  </primary_outcome>
  <number_of_arms>2</number_of_arms>
  <enrollment type="Anticipated">50</enrollment>
  <condition>Vitiligo</condition>
  <arm_group>
    <arm_group_label>Photocil for Vitiligo</arm_group_label>
    <arm_group_type>Active Comparator</arm_group_type>
    <description>Active Drug - Photocil for Vitiligo</description>
  </arm_group>
  <arm_group>
    <arm_group_label>Placebo - Sunscreen (SPF 2)</arm_group_label>
    <arm_group_type>Placebo Comparator</arm_group_type>
    <description>Placebo - Sunscreen (SPF 2)</description>
  </arm_group>
  <intervention>
    <intervention_type>Drug</intervention_type>
    <intervention_name>Photocil for Vitiligo</intervention_name>
    <description>Photocil for Vitiligo</description>
    <arm_group_label>Photocil for Vitiligo</arm_group_label>
    <other_name>Photocil for Vitiligo (U.S. FDA NDC: 54841-001-01)</other_name>
  </intervention>
  <intervention>
    <intervention_type>Other</intervention_type>
    <intervention_name>Placebo - Sunscreen (SPF 2)</intervention_name>
    <description>Placebo - Sunscreen (SPF 2)</description>
    <arm_group_label>Placebo - Sunscreen (SPF 2)</arm_group_label>
  </intervention>
  <eligibility>
    <criteria>
      <textblock>
        Inclusion Criteria:

          -  Diagnosed with vitiligo confirmed by a dermatologist

          -  Vitiligo lesions affecting at a minimum 5% of the facial, legs, or arms surface area

          -  Age: 18 to 65

          -  Participants able to give informed consent

        Exclusion Criteria:

          -  Subject did not respond to prior phototherapy treatment

          -  Subject completed phototherapy for same lesion(s) in last 6 months

          -  Subject has previous history of skin cancer

          -  Subject has previous history of photosensitivity

          -  Subject has a history of herpes (HSV I or II) outbreaks

          -  Subject has previous history of autoimmune disease may be excluded at investigator's
             discretion

          -  Subject is currently taking of immunosuppressive or photosensitizing drugs

          -  Subject plans to use antibiotics, anti-fungal, calcineurin inhibitors or other drugs
             that may cause photosensitivity during the study period. These patients may be
             excluded at investigator's discretion

          -  Subject is pregnant or lactating women
      </textblock>
    </criteria>
    <gender>Both</gender>
    <minimum_age>18 Years</minimum_age>
    <maximum_age>65 Years</maximum_age>
    <healthy_volunteers>No</healthy_volunteers>
  </eligibility>
  <overall_official>
    <last_name>John McCoy, PhD</last_name>
    <role>Study Director</role>
    <affiliation>Applied Biology, Inc.</affiliation>
  </overall_official>
  <overall_contact>
    <last_name>Sharon Keene, MD</last_name>
    <phone>(520) 290-5555</phone>
  </overall_contact>
  <location>
    <facility>
      <name>Physicians Institute</name>
      <address>
        <city>Tucson</city>
        <state>Arizona</state>
        <zip>85719</zip>
        <country>United States</country>
      </address>
    </facility>
    <status>Recruiting</status>
    <contact>
      <last_name>Sharon Keene, MD</last_name>
      <phone>520-290-5555</phone>
    </contact>
    <investigator>
      <last_name>Sharon Keene, MD</last_name>
      <role>Principal Investigator</role>
    </investigator>
  </location>
  <location_countries>
    <country>United States</country>
  </location_countries>
  <verification_date>July 2014</verification_date>
  <lastchanged_date>July 22, 2014</lastchanged_date>
  <firstreceived_date>November 19, 2013</firstreceived_date>
  <responsible_party>
    <responsible_party_type>Sponsor</responsible_party_type>
  </responsible_party>
  <is_fda_regulated>No</is_fda_regulated>
  <has_expanded_access>No</has_expanded_access>
  <condition_browse>
    <!-- CAUTION:  The following MeSH terms are assigned with an imperfect algorithm  -->
    <mesh_term>Vitiligo</mesh_term>
  </condition_browse>
  <intervention_browse>
    <!-- CAUTION:  The following MeSH terms are assigned with an imperfect algorithm  -->
    <mesh_term>Sunscreening Agents</mesh_term>
  </intervention_browse>
  <!-- Results have not yet been posted for this study                                -->
</clinical_study>


text:
namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Q-A object.
    /// </summary>
    public partial class QnADTO
    {
        /// <summary>
        /// Initializes a new instance of the QnADTO class.
        /// </summary>
        public QnADTO()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the QnADTO class.
        /// </summary>
        /// <param name="answer">Answer text</param>
        /// <param name="questions">List of questions associated with the
        /// answer.</param>
        /// <param name="id">Unique id for the Q-A.</param>
        /// <param name="source">Source from which Q-A was indexed. eg.
        /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs</param>
        /// <param name="metadata">List of metadata associated with the
        /// answer.</param>
        /// <param name="context">Context of a QnA</param>
        public QnADTO(string answer, IList<string> questions, int? id = default(int?), string source = default(string), IList<MetadataDTO> metadata = default(IList<MetadataDTO>), QnADTOContext context = default(QnADTOContext))
        {
            Id = id;
            Answer = answer;
            Source = source;
            Questions = questions;
            Metadata = metadata;
            Context = context;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets unique id for the Q-A.
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public int? Id { get; set; }

        /// <summary>
        /// Gets or sets answer text
        /// </summary>
        [JsonProperty(PropertyName = "answer")]
        public string Answer { get; set; }

        /// <summary>
        /// Gets or sets source from which Q-A was indexed. eg.
        /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
        /// </summary>
        [JsonProperty(PropertyName = "source")]
        public string Source { get; set; }

        /// <summary>
        /// Gets or sets list of questions associated with the answer.
        /// </summary>
        [JsonProperty(PropertyName = "questions")]
        public IList<string> Questions { get; set; }

        /// <summary>
        /// Gets or sets list of metadata associated with the answer.
        /// </summary>
        [JsonProperty(PropertyName = "metadata")]
        public IList<MetadataDTO> Metadata { get; set; }

        /// <summary>
        /// Gets or sets context of a QnA
        /// </summary>
        [JsonProperty(PropertyName = "context")]
        public QnADTOContext Context { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Answer == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Answer");
            }
            if (Questions == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Questions");
            }
            if (Answer != null)
            {
                if (Answer.Length > 25000)
                {
                    throw new ValidationException(ValidationRules.MaxLength, "Answer", 25000);
                }
                if (Answer.Length < 1)
                {
                    throw new ValidationException(ValidationRules.MinLength, "Answer", 1);
                }
            }
            if (Source != null)
            {
                if (Source.Length > 300)
                {
                    throw new ValidationException(ValidationRules.MaxLength, "Source", 300);
                }
            }
            if (Metadata != null)
            {
                foreach (var element in Metadata)
                {
                    if (element != null)
                    {
                        element.Validate();
                    }
                }
            }
            if (Context != null)
            {
                Context.Validate();
            }
        }
    }
}


text:
#ifndef STARUTIL_H
#define STARUTIL_H

#include <math.h>
#include "an-bool.h"
#include "keywords.h"

#define DIM_STARS 3
#define DIM_XY 2

// upper bound of dimquads value
#define DQMAX 5
// upper bound of dimcodes value
#define DCMAX 6

InlineDeclare int dimquad2dimcode(int dimquad);

typedef unsigned char uchar;

#define ONE_OVER_SIXTY 0.016666666666666666

// pi / 180.
#define RAD_PER_DEG 0.017453292519943295
// pi / (180. * 60.)
#define RAD_PER_ARCMIN 0.00029088820866572158
// pi / (180. * 60. * 60.)
#define RAD_PER_ARCSEC 4.8481368110953598e-06

// 180. / pi
#define DEG_PER_RAD 57.295779513082323
#define DEG_PER_ARCMIN ONE_OVER_SIXTY
// 1./3600.
#define DEG_PER_ARCSEC 0.00027777777777777778

// 60. * 180. / pi
#define ARCMIN_PER_RAD 3437.7467707849396
#define ARCMIN_PER_DEG 60.0
#define ARCMIN_PER_ARCSEC ONE_OVER_SIXTY

// 60. * 60. * 180. / pi
#define ARCSEC_PER_RAD 206264.80624709636
#define ARCSEC_PER_DEG 3600.0
#define ARCSEC_PER_ARCMIN 60.0

InlineDeclare Const double rad2deg(double x);
InlineDeclare Const double rad2arcmin(double x);
InlineDeclare Const double rad2arcsec(double x);

InlineDeclare Const double deg2rad(double x);
InlineDeclare Const double deg2arcmin(double x);
InlineDeclare Const double deg2arcsec(double x);

InlineDeclare Const double arcmin2rad(double x);
InlineDeclare Const double arcmin2deg(double x);
InlineDeclare Const double arcmin2arcsec(double x);

InlineDeclare Const double arcsec2rad(double x);
InlineDeclare Const double arcsec2deg(double x);
InlineDeclare Const double arcsec2arcmin(double x);

#define MJD_JD_OFFSET 2400000.5

InlineDeclare Const double mjdtojd(double mjd);
InlineDeclare Const double jdtomjd(double jd);

// RA,Dec in radians:
#define radec2x(r,d) (cos(d)*cos(r))
#define radec2y(r,d) (cos(d)*sin(r))
#define radec2z(r,d) (sin(d))
InlineDeclare Const double xy2ra(double x, double y);
InlineDeclare Const double z2dec(double z);

double atora(const char* str);
double atodec(const char* str);

double mag2flux(double mag);

/*
 RA,Dec in degrees.  RAs in range [0, 360], Decs in range [-90, 90].
 */
void radecrange2xyzrange(double ralow, double declow, double rahigh, double dechigh,
						 double* xyzlow, double* xyzhigh);

// RA,Dec in radians:
InlineDeclare void radec2xyz(double ra, double dec, double* x, double* y, double* z);
InlineDeclare Flatten void xyz2radec(double x, double y, double z, double *ra, double *dec);
InlineDeclare Flatten void xyzarr2radec(const double* xyz, double *ra, double *dec);
InlineDeclare void xyzarr2radecarr(const double* xyz, double *radec);
InlineDeclare void radec2xyzarr(double ra, double dec, double* xyz);
InlineDeclare void radec2xyzarrmany(double *ra, double *dec, double* xyz, int n);

// RA,Dec in degrees:
InlineDeclare void radecdeg2xyz(double ra, double dec, double* x, double* y, double* z);
InlineDeclare Flatten void xyzarr2radecdeg(const double* xyz, double *ra, double *dec);
InlineDeclare Flatten void xyzarr2radecdegarr(double* xyz, double *radec);
InlineDeclare void radecdeg2xyzarr(double ra, double dec, double* xyz);
InlineDeclare void radecdegarr2xyzarr(double* radec, double* xyz);
InlineDeclare void radecdeg2xyzarrmany(double *ra, double *dec, double* xyz, int n);

// RA,Dec in degrees.
// Puts the xyz unit vector pointing in positive-RA direction in "dra",
// Puts the xyz unit vector pointing in the positive-Dec direction in "ddec".
void radec_derivatives(double ra, double dec, double* dra, double* ddec);

// Returns the distance-squared between two (RA,Dec)s in degrees.
double distsq_between_radecdeg(double ra1, double dec1, double ra2, double dec2);

// Returns the arcseconds between two (RA,Dec)s in degrees.
double arcsec_between_radecdeg(double ra1, double dec1, double ra2, double dec2);

// Returns the degrees between two (RA,Dec)s in degrees.
double deg_between_radecdeg(double ra1, double dec1, double ra2, double dec2);

// RA in degrees to Mercator X coordinate [0, 1).
double ra2mercx(double ra);
// Dec in degrees to Mercator Y coordinate [0, 1).
double dec2mercy(double dec);

// RA in degrees to H:M:S
void ra2hms(double ra, int* h, int* m, double* s);
// Dec in degrees to D:M:S
void dec2dms(double dec, int* sign, int* d, int* m, double* s);

double hms2ra(int h, int m, double s);
double dms2dec(int sgn, int d, int m, double s);

void ra2hmsstring(double ra, char* str);
void dec2dmsstring(double dec, char* str);

void project_hammer_aitoff_x(double x, double y, double z, double* projx, double* projy);

void project_equal_area(double x, double y, double z, double* projx, double* projy);

// Converts a distance-squared between two points on the
// surface of the unit sphere into the angle between the
// rays from the center of the sphere to the points, in
// radians.
InlineDeclare Flatten Const double distsq2arc(double dist2);

// Distance^2 on the unit sphere to radians.
// (alias of distsq2arc)
InlineDeclare Flatten Const double distsq2rad(double dist2);

InlineDeclare Flatten Const double distsq2deg(double dist2);

// Distance on the unit sphere to radians.
InlineDeclare Flatten Const double dist2rad(double dist);

// Distance^2 on the unit sphere to arcseconds.
InlineDeclare Flatten Const double distsq2arcsec(double dist2);

// Distance on the unit sphere to arcseconds
InlineDeclare Flatten Const double dist2arcsec(double dist);

// Radians to distance^2 on the unit sphere.
// (alias of arc2distsq)
InlineDeclare Const double rad2distsq(double arcInRadians);

// Radians to distance on the unit sphere.
InlineDeclare Flatten Const double rad2dist(double arcInRadians);

// Converts an angle (in arcseconds) into the distance-squared
// between two points on the unit sphere separated by that angle.
InlineDeclare Flatten Const double arcsec2distsq(double arcInArcSec);

// Arcseconds to distance on the unit sphere.
InlineDeclare Flatten Const double arcsec2dist(double arcInArcSec);

// Degrees to distance on the unit sphere.
InlineDeclare Flatten Const double deg2dist(double arcInDegrees);

InlineDeclare Flatten Const double deg2distsq(double d);

InlineDeclare Flatten Const double arcmin2dist(double arcmin);

InlineDeclare Flatten Const double arcmin2distsq(double arcmin);

// Distance on the unit sphere to degrees.
InlineDeclare Flatten Const double dist2deg(double dist);

#define HELP_ERR -101
#define OPT_ERR -201

void make_rand_star(double* star, double ramin, double ramax,
					double decmin, double decmax);

/*
 Computes the 2D coordinates (x,y) (in units of a celestial sphere of
 radius 1) that star s would have in a TANGENTIAL PROJECTION defined
 by (centred at) star r.  s and r are both given in xyz coordinates,
 the parameters are pointers to arrays of size3.

 WARNING -- this code assumes s and r are UNIT vectors (ie normalized
 to have length 1), the resulting x direction is increasing DEC, the
 resulting y direction is increasing RA, which might not be the normal
 convention.
*/
WarnUnusedResult InlineDeclare bool star_coords(const double *s, const double *r, double *x, double *y);

InlineDeclare void star_midpoint(double* mid, const double* A, const double* B);

#ifdef INCLUDE_INLINE_SOURCE
#define InlineDefine InlineDefineH
#include "starutil.inc"
#undef InlineDefine
#endif

#endif