text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18e06fec4">
<name type="corporate">
 <namePart>United States Government Publishing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">publisher</roleTerm>
  <roleTerm type="code" authority="marcrelator">pbl</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States Bankruptcy Court Western District of Missouri</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2015-11-30</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2014-09-17</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 14.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275</identifier>
<identifier type="local">P0b002ee18e06fec4</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2015-11-30</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2015-11-30</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-mowb-4_12-ap-04275</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mowb-4_12-ap-04275</accessId>
 <courtType>Bankruptcy</courtType>
 <courtCode>mowb</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtState>Missouri</courtState>
 <courtSortOrder>3284</courtSortOrder>
 <caseNumber>4:12-ap-04275</caseNumber>
 <caseOffice>Kansas City</caseOffice>
 <party fullName="Kraus Anderson Capital, Inc." lastName="Kraus Anderson Capital, Inc." role="Plaintiff"></party>
 <party firstName="John" fullName="John Bosco Donohue" lastName="Donohue" middleName="Bosco" role="Defendant"></party>
 <party firstName="Sheila" fullName="Sheila Ann Donohue" lastName="Donohue" middleName="Ann" role="Defendant"></party>
</extension>
<titleInfo>
 <title>Kraus Anderson Capital, Inc. v. Donohue et al</title>
 <partNumber>4:12-ap-04275</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275/content-detail.html</url>
</location>
<classification authority="sudocs">JU 14.15</classification>
<identifier type="preferred citation">4:12-ap-04275;12-4275</identifier>
<name type="corporate">
 <namePart>United States Bankruptcy Court Western District of Missouri</namePart>
 <namePart>8th Circuit</namePart>
 <namePart>Kansas City</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>Kraus Anderson Capital, Inc.</displayForm>
 <namePart type="family">Kraus Anderson Capital, Inc.</namePart>
 <namePart type="given"></namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>John Bosco Donohue</displayForm>
 <namePart type="family">Donohue</namePart>
 <namePart type="given">John</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>Sheila Ann Donohue</displayForm>
 <namePart type="family">Donohue</namePart>
 <namePart type="given">Sheila</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-mowb-4_12-ap-04275</accessId>
 <courtType>Bankruptcy</courtType>
 <courtCode>mowb</courtCode>
 <courtCircuit>8th</courtCircuit>
 <courtState>Missouri</courtState>
 <courtSortOrder>3284</courtSortOrder>
 <caseNumber>4:12-ap-04275</caseNumber>
 <caseOffice>Kansas City</caseOffice>
 <party fullName="Kraus Anderson Capital, Inc." lastName="Kraus Anderson Capital, Inc." role="Plaintiff"></party>
 <party firstName="John" fullName="John Bosco Donohue" lastName="Donohue" middleName="Bosco" role="Defendant"></party>
 <party firstName="Sheila" fullName="Sheila Ann Donohue" lastName="Donohue" middleName="Ann" role="Defendant"></party>
 <state>Missouri</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-mowb-4_12-ap-04275-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-0/mods.xml">
 <titleInfo>
  <title>Kraus Anderson Capital, Inc. v. Donohue et al</title>
  <subTitle>Memorandum Opinion and Order(related document(s)30) THE MOVING PARTY IS TO SERVE THIS ORDER ON PARTIES NOT RECEIVING ELECTRONIC NOTICE.File the Certificate of Service and relate it to the ORDER category. (McAdams, Jamie)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-01-03</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275/pdf/USCOURTS-mowb-4_12-ap-04275-0.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e07c08f</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-0</identifier>
 <identifier type="former granule identifier">mowb-4_12-ap-04275_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275/pdf/USCOURTS-mowb-4_12-ap-04275-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 4:12-ap-04275; Kraus Anderson Capital, Inc. v. Donohue et al; </searchTitle>
  <courtName>United States Bankruptcy Court Western District of Missouri</courtName>
  <state>Missouri</state>
  <accessId>USCOURTS-mowb-4_12-ap-04275-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2014-01-03</dateIssued>
  <docketText>Memorandum Opinion and Order(related document(s)30) THE MOVING PARTY IS TO SERVE THIS ORDER ON PARTIES NOT RECEIVING ELECTRONIC NOTICE.File the Certificate of Service and relate it to the ORDER category. (McAdams, Jamie)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-mowb-4_12-ap-04275-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-1/mods.xml">
 <titleInfo>
  <title>Kraus Anderson Capital, Inc. v. Donohue et al</title>
  <subTitle>Clerk's Judgment- entering Judgment in Favor of Defendant John Bosco Donohue and Against Plaintiff, Kraus-Anderson Capital, Inc.(related document(s)50) THE MOVING PARTY IS TO SERVE THIS ORDER ON PARTIES NOT RECEIVING ELECTRONIC NOTICE.File the Certificate of Service and relate it to the ORDER category. (McAdams, Jamie)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-09-17</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275/pdf/USCOURTS-mowb-4_12-ap-04275-1.pdf">
  <identifier type="FDsys Unique ID">D09002ee18e07c090</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-1</identifier>
 <identifier type="former granule identifier">mowb-4_12-ap-04275_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-mowb-4_12-ap-04275/USCOURTS-mowb-4_12-ap-04275-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-mowb-4_12-ap-04275/pdf/USCOURTS-mowb-4_12-ap-04275-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 4:12-ap-04275; Kraus Anderson Capital, Inc. v. Donohue et al; </searchTitle>
  <courtName>United States Bankruptcy Court Western District of Missouri</courtName>
  <state>Missouri</state>
  <accessId>USCOURTS-mowb-4_12-ap-04275-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2014-09-17</dateIssued>
  <docketText>Clerk's Judgment- entering Judgment in Favor of Defendant John Bosco Donohue and Against Plaintiff, Kraus-Anderson Capital, Inc.(related document(s)50) THE MOVING PARTY IS TO SERVE THIS ORDER ON PARTIES NOT RECEIVING ELECTRONIC NOTICE.File the Certificate of Service and relate it to the ORDER category. (McAdams, Jamie)</docketText>
</extension>
</relatedItem>
</mods>


text:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>PeekD</title>

PeekD()

语法

Value.d = PeekD(*MemoryBuffer)

概要

Reads a double (8 bytes) number from  the specified memory address.

参数

*MemoryBuffer

The address to read from.

返回值

Returns the value of the double.

参阅

PokeD()

已支持操作系统
所有

<- PeekC() - Memory Index - PeekF() ->

redpajama_set_name: RedPajamaGithub


text:
<?php
App::uses('AbstractPdfCrypto', 'CakePdf.Pdf/Crypto');

class PdftkCrypto extends AbstractPdfCrypto {

/**
 * Path to the pdftk executable binary
 *
 * @access protected
 * @var string
 */
	protected $binary = '/usr/local/bin/pdftk';

/**
 * Mapping of the CakePdf permissions to the Pdftk arguments
 *
 * @access protected
 * @var string
 */
	protected $_permissionsMap = array(
		'print' => 'Printing',
		'degraded_print' => 'DegradedPrinting',
		'modify' => 'ModifyContents',
		'assembly' => 'Assembly',
		'copy_contents' => 'CopyContents',
		'screen_readers' => 'ScreenReaders',
		'annotate' => 'ModifyAnnotations',
		'fill_in' => 'FillIn'
	);

/**
 * Encrypt a pdf file
 *
 * @param string $data raw pdf data
 * @return string raw pdf data
 */
	public function encrypt($data) {
		if (!is_executable($this->binary)) {
			throw new CakeException(sprintf('pdftk binary is not found or not executable: %s', $this->binary));
		}

		$arguments = array();

		$ownerPassword = $this->_Pdf->ownerPassword();
		if ($ownerPassword !== null) {
			$arguments['owner_pw'] = escapeshellarg($ownerPassword);
		}

		$userPassword = $this->_Pdf->userPassword();
		if ($userPassword !== null) {
			$arguments['user_pw'] = escapeshellarg($userPassword);
		}

		$allowed = $this->_buildPermissionsArgument();
		if($allowed) {
			$arguments['allow'] = $allowed;
		}

		if (!$ownerPassword && !$userPassword) {
			throw new CakeException('Crypto: Required to configure atleast an ownerPassword or userPassword');
		}

		if ($ownerPassword == $userPassword) {
			throw new CakeException('Crypto: ownerPassword and userPassword cannot be the same');
		}

		$command = sprintf('%s - output - %s', $this->binary, $this->__buildArguments($arguments));

		$descriptorspec = array(
			0 => array('pipe', 'r'), // feed stdin of process from this file descriptor
			1 => array('pipe', 'w'), // Note you can also grab stdout from a pipe, no need for temp file
			2 => array('pipe', 'w'), // stderr
		);

		$prochandle = proc_open($command, $descriptorspec, $pipes);

		fwrite($pipes[0], $data);
		fclose($pipes[0]);

		$stdout = stream_get_contents($pipes[1]);
		fclose($pipes[1]);
		$stderr = stream_get_contents($pipes[2]);
		fclose($pipes[2]);

		$exitcode = proc_close($prochandle);

		if ($exitcode !== 0) {
			throw new CakeException(sprintf('Crypto: Unknown error (exit code %d)', $exitcode));
		}

		return $stdout;
	}

/**
 * Checks if a CakePdf permission is implemented
 *
 * @param string $permission permission name
 * @return boolean
 */
	public function permissionImplemented($permission) {
		return array_key_exists($permission, $this->_permissionsMap);
	}

/**
 * Builds a shell safe argument list
 *
 * @param array $arguments
 * @return string list of arguments
 */
	private function __buildArguments($arguments) {
		$output = array();

		foreach ($arguments as $argument => $value) {
			$output[] = $argument . ' ' . $value;
		}

		return implode(' ', $output);
	}

/**
 * Generate the permissions argument
 *
 * @param array $arguments
 * @return string list of arguments
 */
	protected function _buildPermissionsArgument() {
		$permissions = $this->_Pdf->permissions();

		if ($permissions === false) {
			return false;
		}

		$allowed = array();

		if ($permissions === true) {
			$allowed[] = 'AllFeatures';
		}

		if (is_array($permissions)) {
			foreach ($permissions as $permission) {
				$allowed[] = $this->_permissionsMap[$permission];
			}
		}

		return implode(' ', $allowed);
	}

}


text:
package org.olat.ims.qti.fileresource;

import java.io.File;

import org.olat.fileresource.types.FileResource;

/**
 * Initial Date: Apr 6, 2004
 *
 * @author Mike Stock
 */
public class SurveyFileResource extends FileResource {

	/**
	 * IMS QTI Survey file resource identifier.
	 */
	public static final String TYPE_NAME = "FileResource.SURVEY";
	private static QTIFileResourceValidator validator;

	/**
	 * Standard constructor.
	 */
	public SurveyFileResource() {
		super.setTypeName(TYPE_NAME);
	}

	/**
	 * [SPRING]
	 *
	 * @param validator
	 */
	public void setValidator(final QTIFileResourceValidator validator) {
		SurveyFileResource.validator = validator;
	}

	/**
	 * @param unzippedDir
	 * @return True if is of type.
	 */
	public static boolean validate(final File unzippedDir) {
		return SurveyFileResource.validator.validate(unzippedDir);
	}
}


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

namespace MP3Lib
{
    /// <summary>
    /// interface for audio stored in file or buffer
    /// </summary>
    public interface IAudio
    {
        #region Properties

        /// <summary>
        /// the audio header in AudioStream
        /// </summary>
        AudioFrameHeader Header { get; }

        /// <summary>
        /// the encoding standard of audio data in AudioStream
        /// </summary>
        string DebugString { get; }

        /// <summary>
        /// is it a VBR file? i.e. is it better encoding quality than cbr at the same bitrate?
        /// audio frame without xing or vbri header just checks header bitrate is 'free'
        /// </summary>
        bool IsVbr { get; }

        /// <summary>
        /// the number of bytes of data in the Audio payload
        /// always the real size of the file
        /// </summary>
        uint NumPayloadBytes { get; }

        /// <summary>
        /// Number of bytes playable audio
        /// VBR header priority, best for calculating bitrates
        /// </summary>
        uint NumAudioBytes { get; }

        /// <summary>
        /// Number of Frames in file (including the header frame)
        /// VBR header priority, best for calculating bitrates
        /// or if not present, calculated from the number of bytes in the audio block, as reported by the caller
        /// </summary>
        uint NumPayloadFrames { get; }

        /// <summary>
        /// Number of Frames of playable audio
        /// VBR header priority, best for calculating bitrates
        /// </summary>
        uint NumAudioFrames { get; }

        /// <summary>
        /// Number of seconds from the xing/vbri headers,
        /// or from the id3 TLEN tag,
        /// or null.
        /// </summary>
        double Duration { get; }

        /// <summary>
        /// bit-rate calculated from the id3 length tag, and the length of the audio
        /// </summary>
        double? BitRateCalc { get; }

        /// <summary>
        /// bit-rate published in the standard mp3 header
        /// </summary>
        uint? BitRateMp3 { get; }

        /// <summary>
        /// the VBR bit-rate, if any
        /// </summary>
        double? BitRateVbr { get; }

        /// <summary>
        /// overall best guess of bit-rate; there's always a way of guessing it
        /// </summary>
        double BitRate { get; }

        /// <summary>
        /// did it parse without any errors?
        /// </summary>
        bool HasInconsistencies { get; }

        /// <summary>
        /// get the error from the parse operation, if any
        /// </summary>
        Exception ParsingError { get; }

        #endregion

        #region Functions

        /// <summary>
        /// the stream containing the audio data, wound to the start
        /// </summary>
        Stream OpenAudioStream();

        /// <summary>
        /// calculate CRC of the audio data
        /// </summary>
        byte[] CalculateAudioSHA1();

        /// <summary>
        /// Count frames and bytes of file to see who's telling porkies
        /// </summary>
        void ScanWholeFile();

        #endregion
    }
}


text:
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')

describe "volumes:remove command" do
  def wait_for_gone(id)
      gone = false
      (0..15).each do |i|
        if HP::Cloud::Volumes.new.get(id.to_s).is_valid? == false
          gone = true
          break
        end
        sleep(1)
      end
      gone.should be_true
  end

  context "when deleting volume with name" do
    it "should succeed" do
      @volume = VolumeTestHelper.create(resource_name("del1"))

      rsp = cptr("volumes:remove #{@volume.name}")

      rsp.stderr.should eq("")
      rsp.stdout.should eq("Removed volume '#{@volume.name}'.\n")
      rsp.exit_status.should be_exit(:success)
      wait_for_gone(@volume.id)
    end
  end

  context "volumes:remove with valid avl" do
    it "should be successful" do
      @volume = VolumeTestHelper.create(resource_name("del2"))

      rsp = cptr("volumes:remove #{@volume.name} -z #{REGION}")

      rsp.stderr.should eq("")
      rsp.stdout.should eq("Removed volume '#{@volume.name}'.\n")
      rsp.exit_status.should be_exit(:success)
      wait_for_gone(@volume.id)
    end
  end

  context "volumes:remove with invalid avl" do
    it "should report error" do
      rsp = cptr("volumes:remove volume_name -z blah")

      rsp.stderr.should include("Please check your HP Cloud Services account to make sure the 'BlockStorage' service is activated for the appropriate availability zone.\n")
      rsp.stdout.should eq("")
      rsp.exit_status.should be_exit(:general_error)
    end

    after(:all) do
      HP::Cloud::Connection.instance.clear_options()
      begin
        @volume.destroy
      rescue Exception => e
      end
    end
  end

  context "volumes:remove with invalid volume" do
    it "should report error" do
      rsp = cptr("volumes:remove bogus")

      rsp.stderr.should eq("Cannot find a volume matching 'bogus'.\n")
      rsp.stdout.should eq("")
      rsp.exit_status.should be_exit(:not_found)
    end
  end

  context "verify the -a option is activated" do
    it "should report error" do
      AccountsHelper.use_tmp()

      rsp = cptr("volumes:remove bogus -a bogus")

      tmpdir = AccountsHelper.tmp_dir()
      rsp.stderr.should eq("Could not find account file: #{tmpdir}/.hpcloud/accounts/bogus\n")
      rsp.stdout.should eq("")
      rsp.exit_status.should be_exit(:general_error)
    end
    after(:all) {reset_all()}
  end
end


text:
package de.fhg.iais.commons.fs;

import java.io.File;

/**
 * Interface fuer zwei Callback-Methoden fuer den
 *
 * @see brsh.file.FileSystemScanner.
 * @Author: ks
 * @Created: Freitag, 4. Mai 2001 11:06:50
 */
public interface FileEventListener {
    /**
     * The expect method is called with the number of files that this listener should expect. This can be used
     * to show values on a progress bar. If the expect method is not called then the expect counter is set to
     * -1 by default which means 'undefined'. The number 0 as expected files is valid and may occurr is cases
     * where we expect that acceptFile is never called. [mc, 12.7.2011]
     *
     * @param count - the number of times to call acceptFile that is expected
     */
    public void expect(int count);

    //    /**
    //     * return the number of expected files as initialized with expect()
    //     * @return
    //     */
    //    public int expected();

    /**
     * Der Scanner findet grundsaetzlich jede Datei und fuehrt nextFile(File) fuer jedes File aus. Diese
     * Methode erlaubt einer Klasse, das Verhalten des Scanners zu steuern. Dazu kann die implementierende
     * Klasse acceptFile als Filter auslegen. Immer dann und nur dann, wenn die Methode true zurueck gibt,
     * wird acceptFile ausgefuehrt. Neu: wenn mit setPattern(string) eine Dateimaske angegeben ist, wird
     * intern nach diese Maske vorgefiltert.
     */
    public boolean acceptFile(File file);

    /**
     * Die Methode nextFile wird vom FileSystemScanner immer dann aufgerufen wird, wenn der Scanner bei
     * Durchgehen der Verzeichnisse auf eine neue Datei (kein Verzeichnis) trifft. Ein Klasse, die dieser
     * Methode implementiert, kann die Methode als Event ansehen, dass (nach dem Start des Scanners) immer
     * dann aufgerufen wird, wenn der Scanner auf eine Datei trifft.<br>
     * Die implementierende Klasse erhaelt die Nachricht nur, wenn die zuvor ausgefuehrte Methode true
     * zurueckgegeben hat. Der Parameter
     *
     * @param file zeigt auf das gerade gefundene Verzeichnis. Der return Wert true bricht weiteres scannen
     *        ab.
     */
    public boolean nextFile(File file);
}


text:
using ImageSequencer.Common;
using Lumia.Imaging;
using Lumia.Imaging.Transforms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Storage;
using Windows.UI.Core;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Navigation;

namespace ImageSequencer
{

    public sealed partial class SequencePreviewPage : Page
    {

        private IReadOnlyList<IImageProvider> _unalignedImageProviders;
        private IReadOnlyList<IImageProvider> _alignedImageProviders;
        private IReadOnlyList<IImageProvider> _onScreenImageProviders;

        private int _unalignedImageWidth;
        private int _unalignedImageHeight;
        private int _alignedImageWidth;
        private int _alignedImageHeight;

        private WriteableBitmap _foregroundBitmap;
        private WriteableBitmap _backgroundBitmap;

        private RectangleGeometry _animatedArea;
        private bool _frameEnabled;
        private Point _dragStart;

        private int _animationIndex = 0;
        private DispatcherTimer _animationTimer;
        private volatile Task _renderTask;

        private NavigationHelper _navigationHelper;

        public SequencePreviewPage()
        {
            this.InitializeComponent();

            _animationTimer = new DispatcherTimer();
            _animationTimer.Tick += AnimationTimer_Tick;
            _animationTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);

            _navigationHelper = new NavigationHelper(this);

            // Hide page header on landscape orientation
            Window.Current.SizeChanged += ((s, e) => { Header.Visibility = (e.Size.Width > e.Size.Height) ? Visibility.Collapsed : Visibility.Visible; });
            Header.Visibility = Window.Current.Bounds.Width > Window.Current.Bounds.Height ? Visibility.Collapsed : Visibility.Visible;
        }

        private void AdjustPreviewImageSizeAccordingToLayout()
        {
            int imageWidth = _onScreenImageProviders == _unalignedImageProviders ? _unalignedImageWidth : _alignedImageWidth;
            int imageHeight = _onScreenImageProviders == _unalignedImageProviders ? _unalignedImageHeight : _alignedImageHeight;

            double aspectRatio = ((double)imageWidth) / imageHeight;

            double w = RootGrid.ActualWidth;
            double h = w / aspectRatio;

            if (h > RootGrid.ActualHeight)
            {
                w /= h / RootGrid.ActualHeight;
                h = RootGrid.ActualHeight;
            }

            double scale = w / ImageElementBackground.Width;

            ImageElement.Width = w;
            ImageElement.Height = h;
            ImageElementBackground.Width = w;
            ImageElementBackground.Height = h;

            if (_animatedArea == null && imageWidth != 0 && imageHeight != 0)
            {
                _animatedArea = new RectangleGeometry();
                AnimatedAreaIndicator.Width = w;
                AnimatedAreaIndicator.Height = h;
                Canvas.SetLeft(AnimatedAreaIndicator, 0);
                Canvas.SetTop(AnimatedAreaIndicator, 0);
                _animatedArea.Rect = new Rect(0, 0, w, h);
            }
            else if (_animatedArea != null)
            {
                if (scale > 0)
                {
                    Rect newAnimatedArea = new Rect(
                        _animatedArea.Rect.Left * scale,
                        _animatedArea.Rect.Top * scale,
                        _animatedArea.Rect.Width * scale,
                        _animatedArea.Rect.Height * scale);
                    if (newAnimatedArea.Height + newAnimatedArea.Top >= h)
                    {
                        newAnimatedArea.Height = h - newAnimatedArea.Top;
                    }

                    AnimatedAreaIndicator.Width = newAnimatedArea.Width;
                    AnimatedAreaIndicator.Height = newAnimatedArea.Height;
                    Canvas.SetLeft(AnimatedAreaIndicator, newAnimatedArea.Left);
                    Canvas.SetTop(AnimatedAreaIndicator, newAnimatedArea.Top);
                    _animatedArea.Rect = newAnimatedArea;
                }
            }
        }

        private void AdjustPreviewImageSizeAccordingToOrientation(object sender, SizeChangedEventArgs e)
        {
            AdjustPreviewImageSizeAccordingToLayout();
        }

        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            ProgressBarHelper.ShowProgressBar("Processing sequence");

            // The image sources are provided as parameter
            List<IImageProvider> imageProviders = new List<IImageProvider>();

            if (e.Parameter is List<StorageFile>) // Using list of files as source for sequence
            {
                var files = e.Parameter as List<StorageFile>;
                foreach (StorageFile storageFile in files)
                {
                    imageProviders.Add(new StorageFileImageSource(storageFile));
                }
            }
            else if (e.Parameter is int) // Using bundled resources as source for sequence, list of files is created here
            {
                int sequenceId = (int)e.Parameter;
                int imageIndex = 0;
                List<StorageFile> files = new List<StorageFile>();
                try
                {
                    while (true)
                    {
                        var imageUri = new Uri("ms-appx:///Assets/sequence." + sequenceId + "." + imageIndex + ".jpg");
                        StorageFile file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(imageUri);
                        var stream = await file.OpenReadAsync(); // only for checking if file exists
                        stream.Dispose();
                        imageProviders.Add(new StorageFileImageSource(file));
                        imageIndex++;
                    }
                }
                catch (Exception)
                {
                    // Expected FileNotFoundException
                }
            }

            await PrepareImageSequence(imageProviders);

            Canvas.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY;
            Canvas.ManipulationStarted += ImageElement_ManipulationStarted;
            Canvas.ManipulationDelta += ImageElement_ManipulationDelta;

            SetControlsEnabled(true);

            AdjustPreviewImageSizeAccordingToLayout();
            RootGrid.SizeChanged += AdjustPreviewImageSizeAccordingToOrientation;

            _animationTimer.Start();

            ProgressBarHelper.HideProgressBar();
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            _animationTimer.Stop();
        }

        public async Task PrepareImageSequence(List<IImageProvider> imageProviders)
        {
            _unalignedImageProviders = imageProviders;
            _onScreenImageProviders = _unalignedImageProviders;

            IAsyncImageResource asyncImageResource = (IAsyncImageResource)_unalignedImageProviders[0];
            var info = await asyncImageResource.LoadAsync();
            _unalignedImageWidth = (int)info.ImageSize.Width;
            _unalignedImageHeight = (int)info.ImageSize.Height;

            using (ImageAligner imageAligner = new ImageAligner())
            {
                imageAligner.Sources = _unalignedImageProviders;
                imageAligner.ReferenceSource = _unalignedImageProviders[0];

                try
                {
                    _alignedImageProviders = await imageAligner.AlignAsync();

                    asyncImageResource = (IAsyncImageResource)_unalignedImageProviders[0];
                    info = await asyncImageResource.LoadAsync();
                    _alignedImageWidth = (int)info.ImageSize.Width;
                    _alignedImageHeight = (int)info.ImageSize.Height;
                    await EnableAlign();
                }
                catch (Exception)
                {
                    // If align fails, fail silently but don't enable the align button on UI
                }
            }
        }

        private void AnimationTimer_Tick(object sender, object e)
        {
            Render(_onScreenImageProviders, _animationIndex);

            if (_animationIndex == (_onScreenImageProviders.Count() - 1))
            {
                _animationIndex = 0;
            }
            else
            {
                _animationIndex++;
            }
        }

        private void Render(IReadOnlyList<IImageProvider> imageProviders, int animationIndex, bool renderBackground = false)
        {
            if (_renderTask == null || _renderTask.IsCompleted)
            {
                _renderTask = DoRender(imageProviders, animationIndex, renderBackground);
            }
        }

        private async Task DoRender(IReadOnlyList<IImageProvider> imageProviders, int animationIndex, bool renderBackground = false)
        {
            if (_onScreenImageProviders[animationIndex] != null)
            {
                int imageWidth = imageProviders == _unalignedImageProviders ? _unalignedImageWidth : _alignedImageWidth;
                int imageHeight = imageProviders == _unalignedImageProviders ? _unalignedImageHeight : _alignedImageHeight;

                if (_foregroundBitmap == null || _foregroundBitmap.PixelWidth != imageWidth || _foregroundBitmap.PixelHeight != imageHeight)
                    _foregroundBitmap = new WriteableBitmap(imageWidth, imageHeight);

                using (WriteableBitmapRenderer writeableBitmapRenderer = new WriteableBitmapRenderer(imageProviders[animationIndex], _foregroundBitmap))
                {
                    _foregroundBitmap = await writeableBitmapRenderer.RenderAsync();
                }

                if (renderBackground)
                {
                    if (_backgroundBitmap == null || _backgroundBitmap.PixelWidth != imageWidth || _backgroundBitmap.PixelHeight != imageHeight)
                        _backgroundBitmap = new WriteableBitmap(imageWidth, imageHeight);

                    using (WriteableBitmapRenderer writeableBitmapRenderer = new WriteableBitmapRenderer(imageProviders[0], _backgroundBitmap))
                    {
                        _backgroundBitmap = await writeableBitmapRenderer.RenderAsync();
                    }
                }

                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                    () =>
                    {
                        _foregroundBitmap.Invalidate();
                        ImageElement.Source = _foregroundBitmap;
                        if (renderBackground)
                        {
                            _backgroundBitmap.Invalidate();
                            ImageElementBackground.Source = _backgroundBitmap;
                        }
                    });
            }
        }

        private async Task EnableAlign()
        {
            await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                () =>
                {
                    alignButton.IsEnabled = true;
                });
        }

        private void ImageElement_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if (_frameEnabled)
            {

                double x0 = Math.Min(e.Position.X, _dragStart.X);
                double x1 = Math.Max(e.Position.X, _dragStart.X);
                double y0 = Math.Min(e.Position.Y, _dragStart.Y);
                double y1 = Math.Max(e.Position.Y, _dragStart.Y);

                x0 = Math.Max(x0, 0);
                x1 = Math.Min(x1, ImageElementBackground.ActualWidth);
                y0 = Math.Max(y0, 0);
                y1 = Math.Min(y1, ImageElementBackground.ActualHeight);

                double width = x1 - x0;
                double height = y1 - y0;

                Rect rect = new Rect(x0, y0, width, height);
                Canvas.SetLeft(AnimatedAreaIndicator, rect.X);
                Canvas.SetTop(AnimatedAreaIndicator, rect.Y);
                AnimatedAreaIndicator.Width = rect.Width;
                AnimatedAreaIndicator.Height = rect.Height;

                _animatedArea.Rect = rect;

            }
        }

        private void ImageElement_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
        {
            _dragStart = new Point(e.Position.X, e.Position.Y);
        }

        public void Play_Click(object sender, RoutedEventArgs e)
        {
            if (_animationTimer.IsEnabled)
            {
                Stop();
            }
            else
            {
                Play();
            }
        }

        private void Stop()
        {
            _animationTimer.Stop();
            playButton.Icon = new SymbolIcon(Symbol.Play);
        }

        private void Play()
        {
            _animationTimer.Start();
            playButton.Icon = new SymbolIcon(Symbol.Pause);
        }

        private void AlignButton_Click(object sender, RoutedEventArgs e)
        {
            bool isAligned = _onScreenImageProviders == _alignedImageProviders;

            if (!isAligned)
            {
                _onScreenImageProviders = _alignedImageProviders;
                BitmapIcon icon = new BitmapIcon();
                icon.UriSource = new Uri("ms-appx:/Assets/appbar.align.enabled.png");
                alignButton.Icon = icon;
            }
            else
            {
                _onScreenImageProviders = _unalignedImageProviders;
                BitmapIcon icon = new BitmapIcon();
                icon.UriSource = new Uri("ms-appx:/Assets/appbar.align.disabled.png");
                alignButton.Icon = icon;
            }

            Render(_onScreenImageProviders, _animationIndex, true);
            AdjustPreviewImageSizeAccordingToLayout();

            saveButton.IsEnabled = true;
        }

        private void FrameButton_Click(object sender, RoutedEventArgs e)
        {
            _frameEnabled = !_frameEnabled;
            AnimatedAreaIndicator.Visibility = _frameEnabled ? Visibility.Visible : Visibility.Collapsed;

            if (!_frameEnabled)
            {
                ImageElement.Clip = null;
                BitmapIcon icon = new BitmapIcon();
                icon.UriSource = new Uri("ms-appx:/Assets/appbar.frame.disabled.png");
                frameButton.Icon = icon;
            }
            else
            {
                ImageElement.Clip = _animatedArea;
                BitmapIcon icon = new BitmapIcon();
                icon.UriSource = new Uri("ms-appx:/Assets/appbar.frame.enabled.png");
                frameButton.Icon = icon;
            }

            Render(_onScreenImageProviders, _animationIndex, true);

            saveButton.IsEnabled = true;
        }

        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            Stop();
            await _renderTask;

            SetControlsEnabled(false);

            ProgressBarHelper.ShowProgressBar("Saving");

            await Save();

            ProgressBarHelper.HideProgressBar();

            if (Frame.BackStackDepth == 2)
            {
                Frame.BackStack.RemoveAt(1);
            }

            _navigationHelper.GoBack();
        }

        private async Task Save()
        {
            if (_frameEnabled)
            {
                double _imageWidth = (_onScreenImageProviders == _unalignedImageProviders) ? _unalignedImageWidth : _alignedImageWidth;
                double _imageHeight = (_onScreenImageProviders == _unalignedImageProviders) ? _unalignedImageHeight : _alignedImageHeight;

                // Scale animated area coordinates from display coordinates to the match the original bitmap size
                double xScale = _imageWidth / ImageElementBackground.ActualWidth;
                double yScale = _imageHeight / ImageElementBackground.ActualHeight;
                Rect frame = new Rect(
                    _animatedArea.Rect.Left * xScale,
                    _animatedArea.Rect.Top * yScale,
                    _animatedArea.Rect.Width * xScale,
                    _animatedArea.Rect.Height * yScale);
                await GifExporter.Export(_onScreenImageProviders, frame);
            }
            else
            {
                await GifExporter.Export(_onScreenImageProviders, null);
            }
        }

        private void SetControlsEnabled(bool value)
        {
            playButton.IsEnabled = value;
            saveButton.IsEnabled = value;
            alignButton.IsEnabled = value && (_alignedImageProviders != null);
            frameButton.IsEnabled = value;
        }

        public void About_Click(object sender, RoutedEventArgs e)
        {
            Frame.Navigate(typeof(AboutPage));
        }

    }
}


text:
namespace Google.Cloud.ContactCenterInsights.V1.Snippets
{
    // [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_sync_flattened]
    using Google.Cloud.ContactCenterInsights.V1;
    using Google.Protobuf.WellKnownTypes;

    public sealed partial class GeneratedContactCenterInsightsClientSnippets
    {
        /// <summary>Snippet for UpdateIssueModel</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void UpdateIssueModel()
        {
            // Create client
            ContactCenterInsightsClient contactCenterInsightsClient = ContactCenterInsightsClient.Create();
            // Initialize request argument(s)
            IssueModel issueModel = new IssueModel();
            FieldMask updateMask = new FieldMask();
            // Make the request
            IssueModel response = contactCenterInsightsClient.UpdateIssueModel(issueModel, updateMask);
        }
    }
    // [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_sync_flattened]
}


text:
.class Lcom/android/server/LocationManagerService$LocationWorkerHandler;
.super Landroid/os/Handler;
.source "LocationManagerService.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/LocationManagerService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "LocationWorkerHandler"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/LocationManagerService;

# direct methods
.method private constructor <init>(Lcom/android/server/LocationManagerService;)V
    .locals 0
    .parameter

    .prologue
    .line 1717
    iput-object p1, p0, Lcom/android/server/LocationManagerService$LocationWorkerHandler;->this$0:Lcom/android/server/LocationManagerService;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/android/server/LocationManagerService;Lcom/android/server/LocationManagerService$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 1717
    invoke-direct {p0, p1}, Lcom/android/server/LocationManagerService$LocationWorkerHandler;-><init>(Lcom/android/server/LocationManagerService;)V

    return-void
.end method

# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 4
    .parameter "msg"

    .prologue
    const/4 v1, 0x1

    .line 1720
    iget v0, p1, Landroid/os/Message;->what:I

    packed-switch v0, :pswitch_data_0

    .line 1725
    :goto_0
    return-void

    .line 1722
    :pswitch_0
    iget-object v2, p0, Lcom/android/server/LocationManagerService$LocationWorkerHandler;->this$0:Lcom/android/server/LocationManagerService;

    iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v0, Landroid/location/Location;

    iget v3, p1, Landroid/os/Message;->arg1:I

    if-ne v3, v1, :cond_0

    :goto_1
    #calls: Lcom/android/server/LocationManagerService;->handleLocationChanged(Landroid/location/Location;Z)V
    invoke-static {v2, v0, v1}, Lcom/android/server/LocationManagerService;->access$1300(Lcom/android/server/LocationManagerService;Landroid/location/Location;Z)V

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    goto :goto_1

    .line 1720
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method


text:
wordstress is an opensource whitebox security scanner for wordpress powered
websites.

## Description

[wordstress](https://rubygems.org/gems/wordstress) is a whitebox
security scanner for wordpress powered websites.

Site owners don't want to spend time in reading complex blackbox security scan
reports trying to remove false positives. A useful security tool must give them
only vulnerabilities really affecting installed plugins or themes.

Let's assume, plugin `foobar_plugin` version 3.4.3 has a sever SQL Injection
vulnerability. In one of several wordpress powered website, you installed
version 3.2.1 version that **is not vulnerable**.

A blackbox security scanner will try to enumerate installed plugins but it
can't tell the exact installed version. So, using a blackbox approach you'll
have a alleged SQL Injection vulnerability you must validate and mitigate.
Unfortunately, you will lose precious time to spot a false positive since your
plugin is safe.

With wordstress plugin, you'll give [the security
tool](https://rubygems.org/gems/wordstress) the exact `foobar_plugin` version
installed on the system, 3.2.1. The tool will scan the knowledge base and
report 0 vulnerabilities. You save time and you can be focused only on stuff
really need your attention.

Of course you may argue that giving on the Internet a place where all your
website third parties plugins and themes name with version is not a wise
decision. This is correct, that's why wordstress plugin creates a secure access
key the scanner must use in order to access /wordstress virtual page.

People without the correct key can't access your website information. The key
is unique per server and created with hashing functions so to be resilient to
guessing account. Bruteforcing the key will lead to an unsuccessful attempt,
and you'll be busted. For sure.

You must pass the correct key value to wordstress ruby gem in order to perform
the whitebox scan. If you provide the wrong key or you won't provide a key at
all, the wordstress plugin will give no information as output and then no
whitebox scan will be possible.

You don't like the key? Just reload the page a couple of times since you're
comfortable about the generated entropy and then save the settings.

## Installation

wordstress scanner, this ruby gem is very easy to install.  You need a working
ruby environment, please ask your preferred search engine if you need
instructions on how to setup ruby on your operating system.  Just issue the
`gem install wordstress` command and you're almost ready to start.

To install the [wordstress plugin for
wordpress](https://wordpress.org/plugins/wordstress/) you may must:

* download wordstress.zip and unpack the content to your `/wp-content/plugins/` directory
* activate the plugin through the 'Plugins' menu in WordPress
* navigate the Settings->Wordstress admin page
* every time you enter wordstress setting page, a new key is automagically
  generated, to increase entropy you may want to reload the page a couple of
  times. When you're comfortable with the generated key, press the "Save Changes"
  button.
  The virtual page is now available at the url http://youblogurl/wordstress?wordstress-key=the_key
* from the command line, use wordstress security scanner this way: `wordstress -u http://yourblogurl/wordstress -k the_key`
* enjoy results

## Why another tool?

[wpscan](https://github.com/wpscanteam/wpscan) is a great tool and wordstress
do use [wpvulndb API](https://wpvulndb.com/api) as knowledge base, that is the
same KB enpowering wpscan.

For some very personal issues I need some features that wpscan doesn't have out
of the box, of couse I can fork it and contributing, but since they are mostly
on presentation and scanning steps, it would be a major rewrite rather than a
pull request.

True to be told, I added basic authentication support in [December
2012](https://github.com/wpscanteam/wpscan/pull/45). I don't want to impose my
own scanning vision and my very particular scanning needs, then I started a
smaller project.

Another thing I don't like about wpscan is that isn't distributed as ruby gem.
I want a security tool that follows 'the ruby way'.

Furthermore, wordstress is designed to be more accurate in whitebox testing.
During those years I was very upset as pentester with false positives about
themes and plugins and their version. Since an authenticated check is necessary
to match scan results with installed plugin (or theme) version, I tought it was
a better idea to start authenticated from the beginning.

## Usage

Using wordstress from command line is pretty easy. There are 2 mandatory
arguments, the key to use to query the wordpress plugin and the target url.

`$ wordstress -k d4a34e43b5d74c822830b5c4690eccbb621aa372 http://mywordpressblog.com`

By default, wordstress doesn't look for inactive themes or inactive plugins
vulnerabilities. This means that if `foobar_plugin` installed version is
vulnerable to privilege escalation, wordstress scanner by default won't raise
an alarm if the `foobar_plugin` **is not active**.

If you want to include vulnerabilities for all themes and vulnerabilities you
can use -T and -P flags.

`$ wordstress -k d4a34e43b5d74c822830b5c4690eccbb621aa372 -T -P http://mywordpressblog.com`

Examples:
$ wordstress -k d4a34e43b5d74c822830b5c4690eccbb621aa372 -B basic_user:basic_password http://mywordpressblog.com

-k, --key                            uses the key to access wordstress plugin content on target website
-B, --basic-auth user:pwd            uses 'user' and 'pwd' as basic auth credentials to target website

Plugins and themes specific flags

-T, --fetch-all-themes-vulns         retrieves vulnerabilities also for inactive themes
-P, --fetch-all-plugins-vulns        retrieves vulnerabilities also for inactive plugins

Service flags

-D, --debug                          enters dawn debug mode
-v, --version                        shows version information
-h, --help                           shows this help

## Online resource

[Wordstress homepage](http://wordstress.org)
[Wordstress plugin](http://wordpress.org/plugins/wordstress/)
[Attacking Wordpress](http://hackertarget.com/attacking-wordpress/)

## Killing features

* A great knowledge base powered by [wpvulndb API](https://wpvulndb.com)
* Standard rubygem distribution
* Whitebox testing using existing wordpress user for template and themes vulnerabilities.
* Information gathering from robots.txt file _(planned)_
* SQL and CSV output. Suitable for script integration _(planned)_
* Massive websites scan from text file _(planned)_
* SSL server rating using [Qualys SSL Labs rating guide](https://www.ssllabs.com/projects/rating-guide/) _(planned)_

## Contributing

1. Fork it ( https://github.com/[my-github-username]/wordstress/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
  3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
  5. Create a new Pull Request


text:
package org.spongycastle.util.io;

import java.io.IOException;
import java.io.OutputStream;

/**
 * An output stream which copies anything written into it to another stream.
 */
public class TeeOutputStream
    extends OutputStream
{
    private OutputStream output1;
    private OutputStream output2;

    /**
     * Base constructor.
     *
     * @param output1 the output stream that is wrapped.
     * @param output2 a secondary stream that anything written to output1 is also written to.
     */
    public TeeOutputStream(OutputStream output1, OutputStream output2)
    {
        this.output1 = output1;
        this.output2 = output2;
    }

    public void write(byte[] buf)
        throws IOException
    {
        this.output1.write(buf);
        this.output2.write(buf);
    }

    public void write(byte[] buf, int off, int len)
        throws IOException
    {
        this.output1.write(buf, off, len);
        this.output2.write(buf, off, len);
    }

    public void write(int b)
        throws IOException
    {
        this.output1.write(b);
        this.output2.write(b);
    }

    public void flush()
        throws IOException
    {
        this.output1.flush();
        this.output2.flush();
    }

    public void close()
        throws IOException
    {
        this.output1.close();
        this.output2.close();
    }
}


text:
/* ncClose.h
 */

#ifndef NC_CLOSE_H
#define NC_CLOSE_H

/* This is a NETCDF API call */

#include "rods.h"
#include "rcMisc.h"
#include "procApiRequest.h"
#include "apiNumber.h"
#include "initServer.h"
#include "dataObjInpOut.h"
#include "ncOpen.h"

typedef struct {
    int type;			/* not used */
    int ncid;
    keyValPair_t condInput;
} ncCloseInp_t;

#define NcCloseInp_PI "int type; int ncid; struct KeyValPair_PI;"

#if defined(RODS_SERVER) && defined(NETCDF_API)
#define RS_NC_CLOSE rsNcClose
/* prototype for the server handler */
int
rsNcClose (rsComm_t *rsComm, ncCloseInp_t *ncCloseInp);
#else
#define RS_NC_CLOSE NULL
#endif

#ifdef  __cplusplus
extern "C" {
#endif

/* rcNcClose - netcdf close an iRODS data object (equivalent to nc_close.
 * Input -
 *   rcComm_t *conn - The client connection handle.
 *   int the ncid of the opened object - an integer descriptor.
 * OutPut -
 */
/* prototype for the client call */
int
rcNcClose (rcComm_t *conn, ncCloseInp_t *ncCloseInp);

#ifdef  __cplusplus
}
#endif

#endif	/* NC_CLOSE_H */


text:
/*
 * A partial implementation of the Ruby list functions from Compass:
 * https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/lists.rb
 */
/*
 * A partial implementation of the Ruby constants functions from Compass:
 * https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/constants.rb
 */
/*
 * A partial implementation of the Ruby display functions from Compass:
 * https://github.com/Compass/compass/blob/stable/core/lib/compass/core/sass_extensions/functions/display.rb
 */
*[data-tooltip] {
  position: relative; }

.tooltip-content {
  position: relative;
  position: relative;
  -webkit-transition: opacity 0.25s;
  -webkit-transition-delay: ease-in-out;
  -webkit-transition: opacity 0.25s ease-in-out;
          transition: opacity 0.25s ease-in-out;
  box-shadow: 2px 1px 3px rgba(0, 0, 0, 0.15);
  position: absolute;
  display: none;
  top: auto;
  z-index: 1;
  min-width: 210px;
  max-width: 450px;
  opacity: 0;
  bottom: auto;
  padding: 16px;
  background-color: #FFF;
  border: 1px solid #dcdcdc;
  margin-top: 13px;
  cursor: default; }
  .tooltip-content:before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-bottom-color: #CCC;
    z-index: 1; }
  .tooltip-content:after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -9px;
    width: 0;
    height: 0;
    border: 9px solid transparent;
    border-bottom-color: #FFF;
    z-index: 2; }
  .tooltip-content.fade {
    opacity: 1; }
  .tooltip-content.show {
    display: block; }
  .tooltip-content.top {
    box-shadow: -2px -1px 3px rgba(0, 0, 0, 0.15);
    position: relative;
    position: relative;
    position: absolute;
    bottom: 1.8em; }
    .tooltip-content.top:before {
      content: "";
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -10px;
      width: 0;
      height: 0;
      border: 10px solid transparent;
      border-top-color: #CCC;
      z-index: 1; }
    .tooltip-content.top:after {
      content: "";
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -9px;
      width: 0;
      height: 0;
      border: 9px solid transparent;
      border-top-color: #FFF;
      z-index: 2; }
    .tooltip-content.top:before, .tooltip-content.top:after {
      left: 40px; }
  .tooltip-content:before, .tooltip-content:after {
    left: 40px; }


text:
<!--
- Copyright (c) 2019-2021, The Khronos Group
-
- SPDX-License-Identifier: Apache-2.0
-
- Licensed under the Apache License, Version 2.0 the "License";
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-->
### HPP Dynamic Uniform Buffers<br/>
A transcoded version of the API sample [Dynamic Uniform buffers](https://github.com/KhronosGroup/Vulkan-Samples/tree/master/samples/api/dynamic_uniform_buffers) that illustrates the usage of the C++ bindings of vulkan provided by vulkan.hpp.


text:
<!DOCTYPE html>

        <title>Page Secretaires</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

Secretaires

Gestion des Secretaires :

                        ID
                        Nom
                        Prenom
                        Date de Naissance
                        Adresse
                        CP
                        Ville
                        Tel

                        {{secretaire.id}}
                        {{secretaire.nom}}
                        {{secretaire.prenom}}
                        {{secretaire.dateNaissance}}
                        {{secretaire.adresse}}
                        {{secretaire.cp}}
                        {{secretaire.ville}}
                        {{secretaire.tel}}
                        <button ng-class="'bouton-supprimer'" ng-click="deleteSecretaire(secretaire.id)">Supprimer</button>

Formulaire pour ajouter une secretaire :

            <form role="form" ng-submit="createSecretaire()">

                    Nom :
                    <input type="text" class="form-control" id="name" required ng-model="nom"/>

                    Prenom :
                    <input type="text" class="form-control" id="name" required ng-model="prenom"/>

                    Date de naissance : {{dateNaissance}}
                    <datepicker ng-model="dateNaissance" show-weeks="true" class="well well-sm" required></datepicker>

                    Adresse :
                    <input type="text" class="form-control" id="name" required ng-model="adresse"/>

                    CP :
                    <input type="text" class="form-control" id="name" required ng-model="cp"/>

                    Ville :
                    <input type="text" class="form-control" id="name" required ng-model="ville"/>

                    Tel :
                    <input type="text" class="form-control" id="name" required ng-model="tel"/>

                <button type="submit" ng-class="'bouton-ajouter'">Ajouter</button>
            </form>

Formulaire pour modifier une secretaire :

            <form role="form" ng-submit="updateSecretaire(secretaire_choisie)">

                    Secretaire :
                    <select ng-model="secretaire_choisie" ng-options="s as s.id for s in listeSecretaires" >
                    </select>

                    Nom :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.nom"/>

                    Prenom :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.prenom"/>

                    Date de naissance : {{dateNaissance}}
                    <datepicker ng-model="secretaire_choisi.dateNaissance" show-weeks="true" class="well well-sm" required></datepicker>

                    Adresse :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.adresse"/>

                    CP :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.cp"/>

                    Ville :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.ville"/>

                    Tel :
                    <input type="text" class="form-control" id="name" required ng-model="secretaire_choisie.tel"/>

                <button type="submit" ng-class="'bouton-modifier'">Modifier</button>
            </form>


text:
package math.algebra.linear;

/**
 *
 * @author Joris Schelfaut
 */
public class LinearSystem {

    // page 44-45 Bultheel
    public Vector backwardSubstitution(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    // page 45-46 Bultheel (Gauss method)
    private Matrix eliminitionPhase(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    // page 45-46 Bultheel (Gauss method)
    public Vector gauss(Matrix matrix) {
        throw new UnsupportedOperationException();
        //eliminitionPhase()
        //backwardSubstitution()
    }

    public Vector gaussPivoting(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    // page 74-80 Bultheel (Crout method)
    public Vector crout(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    // page 81-82 Bultheel (orthogonal transformation)
    public Vector orthogonalTransformation(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    /**
     * @param matrix
     * @return
     */
    public Vector cramer(Matrix matrix) {
        throw new UnsupportedOperationException();
    }

    // additional methods involving condition/stability
    // and solving multiple linear systems
}


text:
#import <UIKit/UIKit.h>

@interface SectionHeaderView : UICollectionReusableView

@property(nonatomic, strong, readonly) UILabel *titleLabel;

@end


text:
import endsWith from 'ends-with';
import {walk, unit} from 'postcss-value-parser';
import shouldReturnResult from '../util/shouldReturnResult';
import {invalidMessage} from '../util/validationMessages';
import getArguments from './getArguments';
import isAngle from './isAngle';
import isAt from './isAt';
import isColor from './isColor';
import isComma from './isComma';
import isCustomIdent from './isCustomIdent';
import isFunction from './isFunction';
import isKeyword from './isKeyword';
import isLength from './isLength';
import isLengthPercentage from './isLengthPercentage';
import isPercentage from './isPercentage';
import {isPositionNoRepeat} from './isPosition';
import isResolution from './isResolution';
import isString from './isString';
import isUrl from './isUrl';

function isMultiplier ({type, value}) {
    if (type !== 'word') {
        return false;
    }
    let int = unit(value);
    return int &&
        !endsWith(int.number, '.') &&
        !~int.unit.indexOf('.') &&
        int.unit === 'x';
};

function isImageFunction (node) {
    if (!isFunction(node, 'image')) {
        return false;
    }
    let valid = true;
    walk(node.nodes, (child, index) => {
        if (index === 0 && !isImage(child) && !isString(child) && !isColor(child)) {
            valid = false;
        }
        if (index === 1 && !isComma(child)) {
            valid = false;
        }
        if (index === 2 && (isColor(node.nodes[0]) || !isColor(child))) {
            valid = false;
        }
        return false;
    });
    return valid && node.nodes.length <= 3;
}

function validateImageSet (group) {
    if (
        (!isImage(group[0]) && !isString(group[0])) ||
        isFunction(group[0], 'image-set') ||
        !group[2] ||
        (!isResolution(group[2]) && !isMultiplier(group[2]))
    ) {
        return false;
    }
    return group.length === 3;
}

function isImageSet (node) {
    if (!isFunction(node, 'image-set')) {
        return false;
    }
    return getArguments(node).every(validateImageSet);
}

function isIdSelector ({type, value}) {
    if (type !== 'word') {
        return false;
    }
    if (value[0] !== '#') {
        return invalidMessage(
            `Expected "${value}" to start with a "#".`
        );
    }
    if (value[0] === '#' && !isCustomIdent({type: 'word', value: value.slice(1)})) {
        return invalidMessage(
            `Expected "${value}" to be a valid custom identifier.`
        );
    }
    return true;
}

function isElement (node) {
    if (!isFunction(node, 'element')) {
        return false;
    }
    if (node.nodes.length !== 1) {
        return false;
    }
    return isIdSelector(node.nodes[0]);
}

function isCrossFade (node) {
    if (!isFunction(node, 'cross-fade')) {
        return false;
    }
    let valid = true;
    walk(node.nodes, (child, index) => {
        if (index === 0 && !isPercentage(child) && !isImage(child)) {
            valid = false;
        }
        if (index === 2 && !isPercentage(child) && !isImage(child)) {
            valid = false;
        }
        if (index === 4 && !isImage(child) && !isColor(child)) {
            valid = false;
        }
        return false;
    });
    return valid;
}

function isColourStop (group) {
    const {length} = group;
    if (length === 1) {
        return isColor(group[0]);
    }
    if (length === 3) {
        return isColor(group[0]) && isLengthPercentage(group[2]);
    }
    return false;
}

const top = 'top';
const right = 'right';
const bottom = 'bottom';
const left = 'left';

const verticals = [top, bottom];
const horizontals = [right, left];
const directions = [...horizontals, ...verticals];

function isLinearGradient (node) {
    if (!isFunction(node, ['linear-gradient', 'repeating-linear-gradient'])) {
        return false;
    }
    let colours = 0;
    const valid = getArguments(node).every((group, index) => {
        if (index === 0) {
            const {length} = group;
            if (length === 1 && isAngle(group[0])) {
                return true;
            }
            if (length > 1 && group[0].value === 'to' && length <= 5) {
                return (
                    (!group[4] && isKeyword(group[2], directions)) ||
                    (isKeyword(group[2], horizontals) && isKeyword(group[4], verticals)) ||
                    (isKeyword(group[2], verticals) && isKeyword(group[4], horizontals))
                );
            }
        }
        const colour = isColourStop(group);
        if (colour) {
            colours ++;
        }
        return colour;
    });
    return valid && colours > 1;
}

const circle = 'circle';
const ellipse = 'ellipse';
const endingShapes = [circle, ellipse];

export const extentKeywords = [
    'closest-corner',
    'closest-side',
    'farthest-corner',
    'farthest-side',
];

function isRadialGradient (node) {
    if (!isFunction(node, ['radial-gradient', 'repeating-radial-gradient'])) {
        return false;
    }
    let colours = 0;
    const valid = getArguments(node).every((group, index) => {
        if (index === 0) {
            const {length} = group;
            const firstIsEndingShape = isKeyword(group[0], endingShapes);
            const firstIsLength = isLength(group[0]);
            const firstIsExtent = isKeyword(group[0], extentKeywords);
            if (length === 1 && (
                firstIsEndingShape ||
                firstIsLength ||
                firstIsExtent
            )) {
                return true;
            }
            const position2 = isPositionNoRepeat({nodes: group.slice(2)});
            if (isAt(group[0]) && position2) {
                return true;
            }
            const firstIsCircle = group[0].value === circle;
            const secondIsExtent = group[2] && isKeyword(group[2], extentKeywords);
            const secondIsEndingShape = group[2] && isKeyword(group[2], endingShapes);
            if (length === 3 && (
                (firstIsCircle && isLength(group[2])) ||
                (firstIsLength && group[2].value === circle) ||
                (firstIsExtent && secondIsEndingShape) ||
                (firstIsEndingShape && secondIsExtent)
            )) {
                return true;
            }
            const firstIsEllipse = group[0].value === ellipse;
            const firstIsLP = isLengthPercentage(group[0]);
            const secondIsLP = group[2] && isLengthPercentage(group[2]);
            const thirdIsLP = group[4] && isLengthPercentage(group[4]);
            const position4 = isPositionNoRepeat({nodes: group.slice(4)});
            const position6 = isPositionNoRepeat({nodes: group.slice(6)});
            const position8 = isPositionNoRepeat({nodes: group.slice(8)});
            if (length === 5 && (
                (firstIsEllipse && secondIsLP && thirdIsLP) ||
                (firstIsLP && secondIsLP && group[4].value === ellipse)
            )) {
                return true;
            }
            if (length > 3 && (
                (firstIsEndingShape && isAt(group[2]) && position4) ||
                (firstIsExtent && isAt(group[2]) && position4) ||
                (firstIsLength && isAt(group[2]) && position4) ||
                (firstIsLP && secondIsLP && isAt(group[4]) && position6) ||
                (firstIsCircle && isLength(group[2]) && isAt(group[4]) && position6) ||
                (firstIsEndingShape && secondIsExtent && isAt(group[4]) && position6) ||
                (firstIsExtent && secondIsEndingShape && isAt(group[4]) && position6) ||
                (firstIsEllipse && secondIsLP && thirdIsLP && isAt(group[6]) && position8) ||
                (firstIsLP && secondIsLP && group[4].value === ellipse && isAt(group[6]) && position8)
            )) {
                return true;
            }
        }
        const colour = isColourStop(group);
        if (colour) {
            colours ++;
        }
        return colour;
    });
    return valid && colours > 1;
}

function isGradient (node) {
    return isLinearGradient(node) || isRadialGradient(node);
}

export default function isImage (node) {
    const element = isElement(node);
    if (shouldReturnResult(element)) {
        return element;
    }
    return isUrl(node) ||
           isImageFunction(node) ||
           isImageSet(node) ||
           isCrossFade(node) ||
           isGradient(node);
}


text:
namespace Zu.ChromeDevTools.WebAudio
{
    using Newtonsoft.Json;

    /// <summary>
    /// Notifies that a new AudioNode has been created.
    /// </summary>
    public sealed class AudioNodeCreatedEvent : IEvent
    {
        /// <summary>
        /// Gets or sets the node
        /// </summary>
        [JsonProperty("node")]
        public AudioNode Node
        {
            get;
            set;
        }
    }
}


text:
package org.comicwiki.model.schema.bib;

import org.comicwiki.Add;
import org.comicwiki.IRI;
import org.comicwiki.model.schema.CreativeWork;
import org.comicwiki.rdf.annotations.ObjectBoolean;
import org.comicwiki.rdf.annotations.ObjectIRI;
import org.comicwiki.rdf.annotations.ObjectNonNegativeInteger;
import org.comicwiki.rdf.annotations.ObjectString;
import org.comicwiki.rdf.annotations.Predicate;
import org.comicwiki.rdf.annotations.SchemaBib;
import org.comicwiki.rdf.annotations.SchemaComicWiki;
import org.comicwiki.rdf.annotations.Subject;

@Subject(value = "http://schema.org/ComicStory", key= "name")
@SchemaBib
public class ComicStory extends CreativeWork {

	@Predicate("artist")
	@ObjectIRI
	public IRI[] artists;

	@Predicate("colorist")
	@ObjectIRI
	public IRI[] colorists;

	@Predicate("creatorAlias")
	@ObjectIRI
	public IRI[] creatorAlias;

	@Predicate("inker")
	@ObjectIRI
	public IRI[] inkers;

	@Predicate("jobCode")
	@ObjectString
	@SchemaComicWiki
	public String jobCode;

	@Predicate("letterer")
	@ObjectIRI
	public IRI[] letterers;

	@Predicate("organization")
	@ObjectIRI
	@SchemaComicWiki
	public IRI[] organizations;

	@Predicate("pageCount")
	@ObjectNonNegativeInteger
	@SchemaComicWiki
	public int pageCount;

	@Predicate("pageCountUncertain")
	@ObjectBoolean
	@SchemaComicWiki
	public Boolean pageCountUncertain;

	@Predicate("pageEnd")
	@ObjectNonNegativeInteger
	@SchemaComicWiki
	public int pageEnd;

	@Predicate("pageStart")
	@ObjectNonNegativeInteger
	@SchemaComicWiki
	public int pageStart;

	@Predicate("penciler")
	@ObjectIRI
	public IRI[] pencilers;

	@Predicate("storyNote")
	@ObjectIRI
	@SchemaComicWiki
	public IRI[] storyNote;

	@Predicate("storyType")
	@ObjectString
	@SchemaComicWiki
	public String storyType;

	public void addArtist(IRI artist) {
		artists = Add.one(artists, artist);
	}

	public void addColorist(IRI colorist) {
		colorists = Add.one(colorists, colorist);
	}

	public void addCreatorAlias(IRI alias) {
		creatorAlias = Add.one(creatorAlias, alias);
	}

	public void addInker(IRI inker) {
		inkers = Add.one(inkers, inker);
	}

	public void addLetter(IRI letterer) {
		letterers = Add.one(letterers, letterer);
	}

	public void addOrganization(IRI org) {
		organizations = Add.one(organizations, org);
	}

	public void addPenciler(IRI penciler) {
		pencilers = Add.one(pencilers, penciler);
	}

	public void addStoryNote(IRI note) {
		storyNote = Add.one(storyNote, note);
	}

}


text:
/// <reference path="../../../typings/browser.d.ts" />

namespace DDDTools.Promises {

    export var PromiseHandler: ng.IQService;
    export import IPromise = ng.IPromise;
    export import Deferred = ng.IDeferred;

    /**
     * This code forces DDDTools to use $q promises if angular is defined at the moment ddd-tools is loaded
     */
    if (typeof angular !== "undefined") {
        var $injector = angular.injector(['ng']);
        var $q = $injector.get("$q");

        PromiseHandler = $q;
    } else {
        if (Q) {
            // TODO This cast is effectively a risk! How to manage it correctly ?
            PromiseHandler = <ng.IQService>(<any>Q);
        }
    }

    // We didn't find a suitable PromiseHandler
    if (PromiseHandler == undefined) throw new Error("A Promise Handler must be defined, supported are angular's $q or kris kowal's Q. This means that Q or angular MUST be loaded before ddd-tools.js");

}


text:
import { Box, Margins } from '@rocket.chat/fuselage';
import React from 'react';

export function LegendSymbol({ color = 'currentColor' }) {
	return <Margins inlineEnd='x8'>
		<Box
			is='span'
			aria-hidden='true'
			style={{
				display: 'inline-block',
				width: 12,
				height: 12,
				borderRadius: 2,
				backgroundColor: color,
				verticalAlign: 'baseline',
			}}
		/>
	</Margins>;
}


text:
Convert img to base64, or convert base64 to img
```js
var base64Img = require('base64-img');
```
## install
```
npm install base64-img --save
```
## test
```
mocha
```
## API
### .base64(filename, callback)
Convert image file to image base64 data
* {string} ``filename`` required
The image path
* {function} ``callback(err, data)`` required
Callback with image base64 data
```js
base64Img.base64('path/demo.png', function(err, data) {})
```

### .base64Sync(filename)
The api same as base64, but it's synchronous
```js
var data = base64Img.base64Sync('path/demo.png');
```

### .requestBase64(url, callback)
* {string} ``url`` required
* {function} ``callback(err, res, body)`` required
Callback with http request
```js
var url = 'http://../demo.png';
base64Img.requestBase64(url, function(err, res, body) {

});
```

### .img(data, destpath, name, callback)
Convert image base64 data to image
* {string} ``data`` required
Image base64 data
* {string} ``destpath`` required
Dest path, if the destpath is root, pass empty string
* {string} ``name`` required
The image's filename
* {function} ``callback(err, filepath)`` required
```js
base64Img.img('data:image/png;base64,...', 'dest', '1', function(err, filepath) {});
```

### .imgSync(data, destpath, name)
The api same as img, but it's synchronous
```js
var filepath = base64Img.imgSync('data:image/png;base64,...', '', '2');
```


text:
Donate

This page is currently under construction until the official PTSA Paypal account is created... Check back here for updates

  <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
        <input type="hidden" name="cmd" value="_s-xclick">
        <input type="hidden" name="encrypted" value="">
        <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

  </form>


text:
using System.Threading.Tasks;
using Telegram.Bot.Tests.Integ.Framework;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using Telegram.Bot.Types.InlineQueryResults;
using Xunit;

namespace Telegram.Bot.Tests.Integ.Update_Messages
{
    [Collection(Constants.TestCollections.DeleteMessage)]
    [Trait(Constants.CategoryTraitName, Constants.InteractiveCategoryValue)]
    [TestCaseOrderer(Constants.TestCaseOrderer, Constants.AssemblyName)]
    public class DeleteMessageTests
    {
        private ITelegramBotClient BotClient => _fixture.BotClient;

        private readonly TestsFixture _fixture;

        public DeleteMessageTests(TestsFixture fixture)
        {
            _fixture = fixture;
        }

        [OrderedFact(DisplayName = FactTitles.ShouldDeleteMessageFromInlineQuery)]
        [Trait(Constants.MethodTraitName, Constants.TelegramBotApiMethods.AnswerInlineQuery)]
        public async Task Should_Delete_Message_From_InlineQuery()
        {
            await _fixture.SendTestInstructionsAsync(
                "Starting the inline query with this message...",
                startInlineQuery: true
            );

            Update queryUpdate = await _fixture.UpdateReceiver.GetInlineQueryUpdateAsync();

            await BotClient.AnswerInlineQueryAsync(
                inlineQueryId: queryUpdate.InlineQuery.Id,
                results: new[]
                {
                    new InlineQueryResultArticle(
                        id: "article-to-delete",
                        title: "Telegram Bot API",
                        inputMessageContent: new InputTextMessageContent("https://www.telegram.org/")
                    )
                },
                cacheTime: 0
            );

            (Update messageUpdate, Update chosenResultUpdate) =
                await _fixture.UpdateReceiver.GetInlineQueryResultUpdates(MessageType.Text);

            await Task.Delay(1_000);

            await BotClient.DeleteMessageAsync(
                chatId: messageUpdate.Message.Chat.Id,
                messageId: messageUpdate.Message.MessageId
            );
        }

        private static class FactTitles
        {
            public const string ShouldDeleteMessageFromInlineQuery =
                "Should delete message generated from an inline query result";
        }
    }
}


text:
import { useState, useEffect } from "react";

//HOOK======================================================================
function useIsPhone() {
    const [isPhone, setIsPhone] = useState(false);

    function handleResize() {
        if(window.innerWidth <= 600){
            setIsPhone(true);
        }
        else{
            setIsPhone(false);
        }
    }

    useEffect(() => {
        handleResize();
        window.addEventListener("resize", handleResize);
        return () => {
            window.removeEventListener("resize", handleResize);
        };
    }, [])

    return isPhone;
}

//EXPORT HOOK===============================================================
export default useIsPhone;


text:
using System;
using System.Collections.Generic;
using NotHotdog.Services;
using NotHotdog.ViewModels;
using Xamarin.Forms;

namespace NotHotdog.Views
{
    public partial class InfoPage : ContentPage
    {
        public InfoPage()
        {
            InitializeComponent();

            InfoViewModel vm = new InfoViewModel(new HotDogRecognitionService(), Navigation);
            BindingContext = vm;
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Palaeontographica, Abt. B 133(1-3): 48 + pl. 14, fig. 74; pl. 16, fig. 74 (1971)

#### Original name
Fusiformisporites lineolatus Sheffy & Dilcher

### Remarks
null


text:
local setmetatable = setmetatable
local xpcall = xpcall
local pcall = pcall
local assert = assert
local rawget = rawget
local error = error
local print = print
local traceback = tolua.traceback
local ilist = ilist

local _xpcall = {}

_xpcall.__call = function(self, ...)
	if jit then
		if nil == self.obj then
			return xpcall(self.func, traceback, ...)
		else
			return xpcall(self.func, traceback, self.obj, ...)
		end
	else
		local args = {...}

		if nil == self.obj then
			local func = function() self.func(unpack(args)) end
			return xpcall(func, traceback)
		else
			local func = function() self.func(self.obj, unpack(args)) end
			return xpcall(func, traceback)
		end
	end
end

_xpcall.__eq = function(lhs, rhs)
	return lhs.func == rhs.func and lhs.obj == rhs.obj
end

local function xfunctor(func, obj)
	return setmetatable({func = func, obj = obj}, _xpcall)
end

local _pcall = {}

_pcall.__call = function(self, ...)
	if nil == self.obj then
		return pcall(self.func, ...)
	else
		return pcall(self.func, self.obj, ...)
	end
end

_pcall.__eq = function(lhs, rhs)
	return lhs.func == rhs.func and lhs.obj == rhs.obj
end

local function functor(func, obj)
	return setmetatable({func = func, obj = obj}, _pcall)
end

local _event = {}
_event.__index = _event

--废弃
function _event:Add(func, obj)
	assert(func)

	if self.keepSafe then
		func = xfunctor(func, obj)
	else
		func = functor(func, obj)
	end

	if self.lock then
		local node = {value = func, _prev = 0, _next = 0}
		table.insert(self.opList, node)
		node.op = list.pushnode
		return node
	else
		return self.list:push(func)
	end
end

--废弃
function _event:Remove(func, obj)
	for i, v in ilist(self.list) do
		if v.func == func and v.obj == obj then
			if self.lock then
				table.insert(self.opList, i)
				node.op = list.remove
			else
				self.list:remove(i)
			end
			break
		end
	end
end

function _event:CreateListener(func, obj)
	if self.keepSafe then
		func = xfunctor(func, obj)
	else
		func = functor(func, obj)
	end

	return {value = func, _prev = 0, _next = 0, removed = true}
end

function _event:AddListener(handle)
	if self.lock then
		table.insert(self.opList, handle)
		handle.op = list.pushnode
	else
		self.list:pushnode(handle)
	end
end

function _event:RemoveListener(handle)
	if self.lock then
		table.insert(self.opList, handle)
		handle.op = list.remove
	else
		self.list:remove(handle)
	end
end

function _event:Count()
	return self.list.length
end

function _event:Clear()
	self.list:clear()
	self.opList = {}
	self.lock = false
	self.keepSafe = false
	self.current = nil
end

function _event:Dump()
	local count = 0

	for _, v in ilist(self.list) do
		if v.obj then
			print("update function:", v.func, "object name:", v.obj.name)
		else
			print("update function: ", v.func)
		end

		count = count + 1
	end

	print("all function is:", count)
end

_event.__call = function(self, ...)
	local _list = self.list
	self.lock = true
	local ilist = ilist

	for i, f in ilist(_list) do
		self.current = i
		local flag, msg = f(...)

		if not flag then
			if self.keepSafe then
				_list:remove(i)
			end
			self.lock = false
			error(msg)
		end
	end

	for _, i in ipairs(self.opList) do
		i.op(_list, i)
	end

	self.lock = false
	self.opList = {}
end

function event(name, safe)
	safe = safe or false
	return setmetatable({name = name, keepSafe = safe, lock = false, opList = {}, list = list:new()}, _event)
end

UpdateBeat 		= event("Update", true)
LateUpdateBeat	= event("LateUpdate", true)
FixedUpdateBeat	= event("FixedUpdate", true)
CoUpdateBeat	= event("CoUpdate")				--只在协同使用

local Time = Time
local UpdateBeat = UpdateBeat
local LateUpdateBeat = LateUpdateBeat
local FixedUpdateBeat = FixedUpdateBeat
local CoUpdateBeat = CoUpdateBeat

--逻辑update
function Update(deltaTime, unscaledDeltaTime)
	Time:SetDeltaTime(deltaTime, unscaledDeltaTime)
	UpdateBeat()
end

function LateUpdate()
	LateUpdateBeat()
	CoUpdateBeat()
	Time:SetFrameCount()
end

--物理update
function FixedUpdate(fixedDeltaTime)
	Time:SetFixedDelta(fixedDeltaTime)
	FixedUpdateBeat()
end

function PrintEvents()
	UpdateBeat:Dump()
	FixedUpdateBeat:Dump()
end


text:
'use strict';

var chai = require('chai')
  , sinon = require('sinon')
  , Sequelize = require('../../index')
  , Promise = Sequelize.Promise
  , expect = chai.expect
  , Support = require(__dirname + '/../support')
  , DataTypes = require(__dirname + '/../../lib/data-types')
  , dialect = Support.getTestDialect()
  , datetime = require('chai-datetime')
  , _ = require('lodash')
  , assert = require('assert')
  , current = Support.sequelize;

chai.use(datetime);
chai.config.includeStack = true;

describe(Support.getTestDialectTeaser('Model'), function() {
  beforeEach(function() {
    this.clock = sinon.useFakeTimers();

    this.User = this.sequelize.define('user', {
      username: DataTypes.STRING,
      foo: {
        unique: 'foobar',
        type: DataTypes.STRING
      },
      bar: {
        unique: 'foobar',
        type: DataTypes.INTEGER
      }
    });

    return this.sequelize.sync({ force: true });
  });

  afterEach(function() {
    this.clock.restore();
  });

  if (current.dialect.supports.upserts) {
    describe('upsert', function() {
      it('works with upsert on id', function() {
        return this.User.upsert({ id: 42, username: 'john' }).bind(this).then(function(created) {
          if (dialect === 'sqlite') {
            expect(created).not.to.be.defined;
          } else {
            expect(created).to.be.ok;
          }

          this.clock.tick(2000); // Make sure to pass some time so updatedAt != createdAt
          return this.User.upsert({ id: 42, username: 'doe' });
        }).then(function(created) {
          if (dialect === 'sqlite') {
            expect(created).not.to.be.defined;
          } else {
            expect(created).not.to.be.ok;
          }

          return this.User.find(42);
        }).then(function(user) {
          expect(user.createdAt).to.be.defined;
          expect(user.username).to.equal('doe');
          expect(user.updatedAt).to.be.afterTime(user.createdAt);
        });
      });

      it('works with upsert on a composite key', function() {
        return this.User.upsert({ foo: 'baz', bar: 19, username: 'john' }).bind(this).then(function(created) {
          if (dialect === 'sqlite') {
            expect(created).not.to.be.defined;
          } else {
            expect(created).to.be.ok;
          }

          this.clock.tick(2000); // Make sure to pass some time so updatedAt != createdAt
          return this.User.upsert({ foo: 'baz', bar: 19, username: 'doe' });
        }).then(function(created) {
          if (dialect === 'sqlite') {
            expect(created).not.to.be.defined;
          } else {
            expect(created).not.to.be.ok;
          }

          return this.User.find({ where: { foo: 'baz', bar: 19 }});
        }).then(function(user) {
          expect(user.createdAt).to.be.defined;
          expect(user.username).to.equal('doe');
          expect(user.updatedAt).to.be.afterTime(user.createdAt);
        });
      });
    });
  }

});


text:
#ifndef CPP_UTIL_GLOBAL_TIMER_HPP_
#define CPP_UTIL_GLOBAL_TIMER_HPP_

#include <util/timer.hpp>

/**
 * @file timer_global.hpp
 * This file includes all the definitions for the global routines
 * and should only be included into your program a single
 * time to avoid linking errors with duplicate functions
 */

namespace util {
namespace timer {
	namespace global {

		#ifndef CPP_UTIL_TIMER_GLOBAL_AUTODUMP
		#define CPP_UTIL_TIMER_GLOBAL_AUTODUMP true
		#endif /* CPP_UTIL_TIMER_GLOBAL_AUTODUMP */

		multi_timer t(CPP_UTIL_TIMER_GLOBAL_AUTODUMP);

		void push(const char *name) { t.push(name); }
		void push(const std::string &name) { t.push(name); }
		void pop() { t.pop(); }
		void dump() { t.dump(); }
		void auto_dump(bool flag) { t.auto_dump(flag); }

		timer_pointer add_to_stage(const char *name)
		{ return t.add(name); }

		timer_pointer add_to_stage(const std::string &name)
		{ return t.add(name); }

		timer_pointer get(const char *name)
		{ return t.get(name); }

		timer_pointer get(const std::string &name)
		{ return t.get(name); }

	} // namespace global

} // namespace timer
} // namespace util

#endif /*CPP_UTIL_GLOBAL_TIMER_HPP_*/


text:
namespace System.DirectoryServices.ActiveDirectory
{
    public enum TrustType
    {
        TreeRoot = 0,
        ParentChild = 1,
        CrossLink = 2,
        External = 3,
        Forest = 4,
        Kerberos = 5,
        Unknown = 6
    }

    public enum TrustDirection
    {
        Inbound = 1,
        Outbound = 2,
        Bidirectional = Outbound | Inbound
    }

    public class TrustRelationshipInformation
    {
        internal string source = null;
        internal string target = null;
        internal TrustType type;
        internal TrustDirection direction;
        internal DirectoryContext context = null;

        internal TrustRelationshipInformation() { }

        internal TrustRelationshipInformation(DirectoryContext context, string source, TrustObject obj)
        {
            // security context
            this.context = context;
            // source
            this.source = source;
            // target
            this.target = (obj.DnsDomainName == null ? obj.NetbiosDomainName : obj.DnsDomainName);
            // direction
            if ((obj.Flags & (int)DS_DOMAINTRUST_FLAG.DS_DOMAIN_DIRECT_OUTBOUND) != 0 &&
                (obj.Flags & (int)DS_DOMAINTRUST_FLAG.DS_DOMAIN_DIRECT_INBOUND) != 0)
                direction = TrustDirection.Bidirectional;
            else if ((obj.Flags & (int)DS_DOMAINTRUST_FLAG.DS_DOMAIN_DIRECT_OUTBOUND) != 0)
                direction = TrustDirection.Outbound;
            else if ((obj.Flags & (int)DS_DOMAINTRUST_FLAG.DS_DOMAIN_DIRECT_INBOUND) != 0)
                direction = TrustDirection.Inbound;
            // type
            this.type = obj.TrustType;
        }

        public string SourceName => source;

        public string TargetName => target;

        public TrustType TrustType => type;

        public TrustDirection TrustDirection => direction;
    }
}