text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

/** @file iothub_client.h
*	@brief Extends the IoTHubCLient_LL module with additional features.
*
*	@details IoTHubClient is a module that extends the IoTHubCLient_LL
*			 module with 2 features:
*				- scheduling the work for the IoTHubCLient from a
*				  thread, so that the user does not need to create their
*				  own thread
*				- thread-safe APIs
*/

#ifndef IOTHUB_CLIENT_H
#define IOTHUB_CLIENT_H

typedef struct IOTHUB_CLIENT_INSTANCE_TAG* IOTHUB_CLIENT_HANDLE;

#include "iothub_client_ll.h"
#include "iothubtransport.h"

#ifdef __cplusplus
extern "C"
{
#endif

#define IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES \
    FILE_UPLOAD_OK ,\
    FILE_UPLOAD_ERROR

    DEFINE_ENUM(IOTHUB_CLIENT_FILE_UPLOAD_RESULT, IOTHUB_CLIENT_FILE_UPLOAD_RESULT_VALUES)
        typedef void(*IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, void* userContextCallback);

	/**
	* @brief	Creates a IoT Hub client for communication with an existing
	* 			IoT Hub using the specified connection string parameter.
	*
	* @param	connectionString	Pointer to a character string
	* @param	protocol			Function pointer for protocol implementation
	*
	*			Sample connection string:
	*

	*
HostName=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net];DeviceId=[Device ID goes here];SharedAccessKey=[Device key goes here];

	*
HostName=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net];DeviceId=[Device ID goes here];SharedAccessSignature=SharedAccessSignature sr=[IoT Hub name goes here].[IoT Hub suffix goes here, e.g., private.azure-devices-int.net]/devices/[Device ID goes here]&sig=[SAS Token goes here]&se=[Expiry Time goes here];

	*

	*
	* @return	A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
	* 			invoking other functions for IoT Hub client and @c NULL on failure.
	*/
	extern IOTHUB_CLIENT_HANDLE IoTHubClient_CreateFromConnectionString(const char* connectionString, IOTHUB_CLIENT_TRANSPORT_PROVIDER protocol);

	/**
	* @brief	Creates a IoT Hub client for communication with an existing IoT
	* 			Hub using the specified parameters.
	*
	* @param	config	Pointer to an @c IOTHUB_CLIENT_CONFIG structure
	*
	*			The API does not allow sharing of a connection across multiple
	*			devices. This is a blocking call.
	*
	* @return	A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
	* 			invoking other functions for IoT Hub client and @c NULL on failure.
	*/
	extern IOTHUB_CLIENT_HANDLE IoTHubClient_Create(const IOTHUB_CLIENT_CONFIG* config);

	/**
	* @brief	Creates a IoT Hub client for communication with an existing IoT
	* 			Hub using the specified parameters.
	*
	* @param	transportHandle	TRANSPORT_HANDLE which represents a connection.
	* @param	config	Pointer to an @c IOTHUB_CLIENT_CONFIG structure
	*
	*			The API allows sharing of a connection across multiple
	*			devices. This is a blocking call.
	*
	* @return	A non-NULL @c IOTHUB_CLIENT_HANDLE value that is used when
	* 			invoking other functions for IoT Hub client and @c NULL on failure.
	*/
	extern IOTHUB_CLIENT_HANDLE IoTHubClient_CreateWithTransport(TRANSPORT_HANDLE transportHandle, const IOTHUB_CLIENT_CONFIG* config);

	/**
	* @brief	Disposes of resources allocated by the IoT Hub client. This is a
	* 			blocking call.
	*
	* @param	iotHubClientHandle	The handle created by a call to the create function.
	*/
	extern void IoTHubClient_Destroy(IOTHUB_CLIENT_HANDLE iotHubClientHandle);

	/**
	* @brief	Asynchronous call to send the message specified by @p eventMessageHandle.
	*
	* @param	iotHubClientHandle		   	The handle created by a call to the create function.
	* @param	eventMessageHandle		   	The handle to an IoT Hub message.
	* @param	eventConfirmationCallback  	The callback specified by the device for receiving
	* 										confirmation of the delivery of the IoT Hub message.
	* 										This callback can be expected to invoke the
	* 										::IoTHubClient_SendEventAsync function for the
	* 										same message in an attempt to retry sending a failing
	* 										message. The user can specify a @c NULL value here to
	* 										indicate that no callback is required.
	* @param	userContextCallback			User specified context that will be provided to the
	* 										callback. This can be @c NULL.
	*
	*			@b NOTE: The application behavior is undefined if the user calls
	*			the ::IoTHubClient_Destroy function from within any callback.
	*
	* @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
	*/
	extern IOTHUB_CLIENT_RESULT IoTHubClient_SendEventAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_MESSAGE_HANDLE eventMessageHandle, IOTHUB_CLIENT_EVENT_CONFIRMATION_CALLBACK eventConfirmationCallback, void* userContextCallback);

	/**
	* @brief	This function returns the current sending status for IoTHubClient.
	*
	* @param	iotHubClientHandle		The handle created by a call to the create function.
	* @param	iotHubClientStatus		The sending state is populated at the address pointed
	* 									at by this parameter. The value will be set to
	* 									@c IOTHUBCLIENT_SENDSTATUS_IDLE if there is currently
	* 								    no item to be sent and @c IOTHUBCLIENT_SENDSTATUS_BUSY
	* 								    if there are.
	*
	* @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
	*/
	extern IOTHUB_CLIENT_RESULT IoTHubClient_GetSendStatus(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_STATUS *iotHubClientStatus);

	/**
	* @brief	Sets up the message callback to be invoked when IoT Hub issues a
	* 			message to the device. This is a blocking call.
	*
	* @param	iotHubClientHandle		   	The handle created by a call to the create function.
	* @param	messageCallback     	   	The callback specified by the device for receiving
	* 										messages from IoT Hub.
	* @param	userContextCallback			User specified context that will be provided to the
	* 										callback. This can be @c NULL.
	*
	*			@b NOTE: The application behavior is undefined if the user calls
	*			the ::IoTHubClient_Destroy function from within any callback.
	*
	* @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
	*/
	extern IOTHUB_CLIENT_RESULT IoTHubClient_SetMessageCallback(IOTHUB_CLIENT_HANDLE iotHubClientHandle, IOTHUB_CLIENT_MESSAGE_CALLBACK_ASYNC messageCallback, void* userContextCallback);

	/**
	* @brief	This function returns in the out parameter @p lastMessageReceiveTime
	* 			what was the value of the @c time function when the last message was
	* 			received at the client.
	*
	* @param	iotHubClientHandle				The handle created by a call to the create function.
	* @param	lastMessageReceiveTime  		Out parameter containing the value of @c time function
	* 											when the last message was received.
	*
	* @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
	*/
	extern IOTHUB_CLIENT_RESULT IoTHubClient_GetLastMessageReceiveTime(IOTHUB_CLIENT_HANDLE iotHubClientHandle, time_t* lastMessageReceiveTime);

	/**
	* @brief	This API sets a runtime option identified by parameter @p optionName
	* 			to a value pointed to by @p value. @p optionName and the data type
	* 			@p value is pointing to are specific for every option.
	*
	* @param	iotHubClientHandle	The handle created by a call to the create function.
	* @param	optionName		  	Name of the option.
	* @param	value			  	The value.
	*
	*			The options that can be set via this API are:
	*				- @b timeout - the maximum time in milliseconds a communication is
	*				  allowed to use. @p value is a pointer to an @c unsigned @c int with
	*				  the timeout value in milliseconds. This is only supported for the HTTP
	*				  protocol as of now. When the HTTP protocol uses CURL, the meaning of
	*				  the parameter is total request time. When the HTTP protocol uses
	*				  winhttp, the meaning is the same as the @c dwSendTimeout and
	*				  @c dwReceiveTimeout parameters of the
	*
	*				  WinHttpSetTimeouts API.
	*				- @b CURLOPT_LOW_SPEED_LIMIT - only available for HTTP protocol and only
	*				  when CURL is used. It has the same meaning as CURL's option with the same
	*				  name. @p value is pointer to a long.
	*				- @b CURLOPT_LOW_SPEED_TIME - only available for HTTP protocol and only
	*				  when CURL is used. It has the same meaning as CURL's option with the same
	*				  name. @p value is pointer to a long.
	*				- @b CURLOPT_FORBID_REUSE - only available for HTTP protocol and only
	*				  when CURL is used. It has the same meaning as CURL's option with the same
	*				  name. @p value is pointer to a long.
	*				- @b CURLOPT_FRESH_CONNECT - only available for HTTP protocol and only
	*				  when CURL is used. It has the same meaning as CURL's option with the same
	*				  name. @p value is pointer to a long.
	*				- @b CURLOPT_VERBOSE - only available for HTTP protocol and only
	*				  when CURL is used. It has the same meaning as CURL's option with the same
	*				  name. @p value is pointer to a long.
	*				- @b messageTimeout - the maximum time in milliseconds until a message
	*                 is timeouted. The time starts at IoTHubClient_SendEventAsync. By default,
	*                 messages do not expire. @p is a pointer to a uint64_t
	* @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
	*/
	extern IOTHUB_CLIENT_RESULT IoTHubClient_SetOption(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* optionName, const void* value);

#ifndef DONT_USE_UPLOADTOBLOB
    /**
    * @brief	IoTHubClient_UploadToBlobAsync uploads data from memory to a file in Azure Blob Storage.
    *
    * @param	iotHubClientHandle	                The handle created by a call to the IoTHubClient_Create function.
    * @param	destinationFileName	                The name of the file to be created in Azure Blob Storage.
    * @param	source                              The source of data.
    * @param	size                                The size of data.
    * @param    iotHubClientFileUploadCallback      A callback to be invoked when the file upload operation has finished.
    * @param    context                             A user-provided context to be passed to the file upload callback.
    *
    * @return	IOTHUB_CLIENT_OK upon success or an error code upon failure.
    */
    extern IOTHUB_CLIENT_RESULT IoTHubClient_UploadToBlobAsync(IOTHUB_CLIENT_HANDLE iotHubClientHandle, const char* destinationFileName, const unsigned char* source, size_t size, IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK iotHubClientFileUploadCallback, void* context);
#endif
#ifdef __cplusplus
}
#endif

#endif /* IOTHUB_CLIENT_H */


text:
const childProcess = require('child_process');
const Duplex = require('stream').Duplex;
const fs = require('fs');
const getTemporaryFilePath = require('gettemporaryfilepath');
const which = require('which');
const memoizeAsync = require('memoizeasync');

// a bit of boilerplate to set up our stream class
class OptiPng extends Duplex {
  constructor(binArgs) {
    super();
    this.binArgs = binArgs || []; // args to pass to cli command
  }

  _read(n) {
    // don't push anything here, this is no-op unless we need to resume
    // underlying read. We'll push into queue later.
    if (this.readStream) {
      this.readStream.resume();
    }
  }

  _write(chunk, enc, done) {
    if (this.hasEnded) {
      return;
    }
    if (!this.writeStream) {
      // write a tempfile to give to binary
      this.tempFile = getTemporaryFilePath({ suffix: '.png' });
      this.writeStream = fs.createWriteStream(this.tempFile);
      this.writeStream.on(
        'error',
        function onWsErr(err) {
          this._error(err);
        }.bind(this)
      );
    }
    this.writeStream.write(chunk, enc);
    done();
  }

  end(chunk) {
    if (this.hasEnded) {
      return;
    }
    if (chunk) {
      this.write(chunk); // any final bits
    }

    if (!this.writeStream) {
      this._error(new Error('Closing stream before writing data.'));
      return;
    }

    this.writeStream.end();
    this.writeStream.once('close', function onWsClose() {
      // runBinary is a callback
      OptiPng.getBinaryPath(runBinary);
    });

    // prebind for easy drop-in
    const bailOut = this._error.bind(this);

    const runBinary = function runBinary(err, binary) {
      if (err) {
        bailOut(err);
      }

      this.binArgs.push(this.tempFile); // final arg is  the file
      this.optiPngProcess = childProcess.spawn(binary, this.binArgs, {
        windowsHide: true,
      });

      // format a copy of the cli string for test suite
      this.commandLine =
        binary + (this.binArgs ? ` ${this.binArgs.join(' ')}` : '');

      this.optiPngProcess.once('error', bailOut);
      this.optiPngProcess.once('exit', onBinComplete);
    }.bind(this);

    const onBinComplete = function onBinComplete(exitCode) {
      this.optiPngProcess = null;
      if (this.hasEnded) {
        return;
      }
      if (exitCode > 0) {
        return bailOut(
          new Error(
            `The optipng process exited with a non-zero exit code: ${exitCode}`
          )
        );
      }
      // read back out the new file
      this.readStream = fs.createReadStream(this.tempFile);
      this.readStream.once('error', bailOut);
      this.readStream.on(
        'data',
        function onReadStreamData(chunk) {
          // pipe it into the outgoing queue
          const flowing = this.push(chunk);
          // false here means output not being read, pause and wait
          if (flowing === false) {
            this.readStream.pause();
          }
        }.bind(this)
      );
      this.readStream.once(
        'end',
        function onReadStreamEnd() {
          this.push(null); // null closes the stream
          if (this.tempFile) {
            fs.unlink(this.tempFile, function onUnlink(err) {
              // not emitting this error since stream is done
              if (err) {
                console.error(err.stack);
              }
            });
            this.tempFile = null;
          }
        }.bind(this)
      );
    }.bind(this);
  }

  destroy() {
    this.hasEnded = true;
    if (this.readStream) {
      this.readStream.destroy();
      this.readStream = null;
    }
    if (this.writeStream) {
      this.writeStream.destroy();
      this.writeStream = null;
    }
    if (this.optiPngProcess) {
      this.optiPngProcess.kill();
      this.optiPngProcess = null;
    }
    if (this.tempFile) {
      fs.unlink(this.tempFile, function onUnlink(err) {
        // not emitting this error since stream is done
        if (err) {
          console.error(err.stack);
        }
      });
      this.tempFile = null;
    }
  }

  _error(err) {
    if (!this.hasEnded) {
      this.destroy();
      this.emit('error', err);
    }
  }
}

OptiPng.getBinaryPath = memoizeAsync((cb) => {
  // trying environment path first
  which('optipng', function onWhichDone(err, binary) {
    if (err) {
      // not in environment path, try in node_modules
      binary = require('optipng-bin');
    }
    if (binary) {
      // found somewhere
      cb(null, binary);
    } else {
      cb(
        new Error(
          'No optipng binary in PATH and optipng-bin does not provide a pre-built binary for your architecture'
        )
      );
    }
  });
});

module.exports = OptiPng;

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

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

#### Published in
null

#### Original name
Arundinaria spongiosa C.D.Chu & C.S.Chao

### Remarks
null


text:
from zoo.tfpark.text.estimator import *

def make_bert_ner_model_fn(optimizer):
    import tensorflow as tf
    from zoo.tfpark import ZooOptimizer

    def _bert_ner_model_fn(features, labels, mode, params):
        output_layer = bert_model(features, labels, mode, params).get_sequence_output()
        if mode == tf.estimator.ModeKeys.TRAIN:
            output_layer = tf.nn.dropout(output_layer, keep_prob=0.9)
        logits = tf.layers.dense(output_layer, params["num_entities"])
        if mode == tf.estimator.ModeKeys.TRAIN:
            logits = tf.reshape(logits, [-1, params["num_entities"]])
            labels = tf.reshape(labels, [-1])
            mask = tf.cast(features["input_mask"], dtype=tf.float32)
            one_hot_labels = tf.one_hot(labels, depth=params["num_entities"], dtype=tf.float32)
            loss = tf.losses.softmax_cross_entropy(logits=logits, onehot_labels=one_hot_labels)
            loss *= tf.reshape(mask, [-1])
            loss = tf.reduce_sum(loss)
            total_size = tf.reduce_sum(mask)
            total_size += 1e-12  # to avoid division by 0 for all-0 weights
            loss /= total_size
            train_op = ZooOptimizer(optimizer).minimize(loss)
            return tf.estimator.EstimatorSpec(mode=mode,
                                              train_op=train_op, loss=loss)
        elif mode == tf.estimator.ModeKeys.PREDICT:
            probabilities = tf.nn.softmax(logits, axis=-1)
            predict = tf.argmax(probabilities, axis=-1)
            return tf.estimator.EstimatorSpec(mode=mode, predictions=predict)
        else:
            raise ValueError("Currently only TRAIN and PREDICT modes are supported for NER")
    return _bert_ner_model_fn

class BERTNER(BERTBaseEstimator):
    """
    A pre-built TFEstimator that takes the hidden state of the final encoder layer of BERT
    for named entity recognition based on SoftMax classification.
    Note that cased BERT models are recommended for NER.

    :param num_entities: Positive int. The number of entity labels to be classified.
    :param bert_config_file: The path to the json file for BERT configurations.
    :param init_checkpoint: The path to the initial checkpoint of the pre-trained BERT model if any.
                            Default is None.
    :param use_one_hot_embeddings: Boolean. Whether to use one-hot for word embeddings.
                                   Default is False.
    :param optimizer: The optimizer used to train the estimator. It should be an instance of
                      tf.train.Optimizer.
                      Default is None if no training is involved.
    :param model_dir: The output directory for model checkpoints to be written if any.
                      Default is None.
    """
    def __init__(self, num_entities, bert_config_file, init_checkpoint=None,
                 use_one_hot_embeddings=False, optimizer=None, model_dir=None):
        super(BERTNER, self).__init__(
            model_fn=make_bert_ner_model_fn(optimizer),
            bert_config_file=bert_config_file,
            init_checkpoint=init_checkpoint,
            use_one_hot_embeddings=use_one_hot_embeddings,
            model_dir=model_dir,
            num_entities=num_entities)


text:
#include <libmemcached/common.h>
#include <libmemcached/assert.hpp>

memcached_return_t memcached_set_namespace(memcached_st *self, const char *key, size_t key_length)
{
  assert_msg(self, "A NULL memcached_st was used");

  if (key and key_length == 0)
  {
    WATCHPOINT_ASSERT(key_length);
    return memcached_set_error(*self, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, memcached_literal_param("Invalid namespace, namespace string had value but length was 0"));
  }
  else if (key_length and key == NULL)
  {
    WATCHPOINT_ASSERT(key);
    return memcached_set_error(*self, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT, memcached_literal_param("Invalid namespace, namespace string length was > 1 but namespace string was null "));
  }
  else if (key and key_length)
  {
    bool orig= self->flags.verify_key;
    self->flags.verify_key= true;
    if (memcached_failed(memcached_key_test(*self, (const char **)&key, &key_length, 1)))
    {
      self->flags.verify_key= orig;
      return memcached_last_error(self);
    }
    self->flags.verify_key= orig;

    if ((key_length > MEMCACHED_PREFIX_KEY_MAX_SIZE -1))
    {
      return memcached_set_error(*self, MEMCACHED_KEY_TOO_BIG, MEMCACHED_AT);
    }

    memcached_array_free(self->_namespace);
    self->_namespace= memcached_strcpy(self, key, key_length);

    if (not self->_namespace)
    {
      return memcached_set_error(*self, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
    }
  }
  else
  {
    memcached_array_free(self->_namespace);
    self->_namespace= NULL;
  }

  return MEMCACHED_SUCCESS;
}

const char * memcached_get_namespace(memcached_st *self)
{
  if (self->_namespace == NULL)
  {
    return NULL;
  }

  return memcached_array_string(self->_namespace);
}


text:
using ComplexTestSupport;
using Xunit;

namespace System.Numerics.Tests
{
    public class trigonometricOperations_ACosTest
    {
        private static void VerifyACos(double x, double y)
        {
            // formula used in the feature: arccos(z) = -iln(z + iSqrt(value*value-1))
            // Verification is done with z = ACos(Cos(z));

            Complex complex = new Complex(x, y);
            Complex cosComplex = Complex.Cos(complex);
            Complex acosComplex = Complex.Acos(cosComplex);

            if (false == x.Equals((Double)acosComplex.Real) || false == y.Equals((Double)acosComplex.Imaginary))
            {
                double realDiff = Math.Abs(Math.Abs(x) - Math.Abs(acosComplex.Real));
                double imaginaryDiff = Math.Abs(Math.Abs(y) - Math.Abs(acosComplex.Imaginary));
                Assert.False((realDiff > 0.1) || (imaginaryDiff > 0.1), string.Format("({0}) != ACos(Cos():{1}):{2}", complex, cosComplex, acosComplex));
            }
        }

        private static void VerifyACos(double x, double y, double expectedReal, double expectedImaginary)
        {
            // for boundary values, ACos returns invalid Values

            Complex complex = new Complex(x, y);
            Complex acosComplex = Complex.Acos(complex);

            Support.VerifyRealImaginaryProperties(acosComplex, expectedReal, expectedImaginary,
                string.Format("AcOs({0}):{1}", complex, acosComplex));
        }

        [Fact]
        public static void RunTests_ZeroOneImaginaryOne()
        {
            // verify sqrt with Zero
            VerifyACos(0.0, 0.0);

            // Verify test results with One
            VerifyACos(1.0, 0.0);

            // Verify test results with MinusOne
            VerifyACos(-1.0, 0.0);

            // Verify test results with ImaginaryOne
            VerifyACos(0.0, 1.0);

            // Verify test results with MinusImaginaryOne
            VerifyACos(0.0, -1.0);
        }

        [Fact]
        public static void RunTests_RandomValidValues()
        {
            // Verify test results with ComplexInFirstQuad
            double real = Support.GetSmallRandomDoubleValue(false);
            double imaginary = Support.GetSmallRandomDoubleValue(false);
            VerifyACos(real, imaginary);

            // Verify test results with ComplexInSecondQuad
            real = Support.GetSmallRandomDoubleValue(true);
            imaginary = Support.GetSmallRandomDoubleValue(false);
            VerifyACos(real, imaginary);

            // Verify test results with ComplexInThirdQuad
            real = Support.GetSmallRandomDoubleValue(true);
            imaginary = Support.GetSmallRandomDoubleValue(true);
            VerifyACos(real, imaginary);

            // Verify test results with ComplexInFourthQuad
            real = Support.GetSmallRandomDoubleValue(false);
            imaginary = Support.GetSmallRandomDoubleValue(true);
            VerifyACos(real, imaginary);
        }

        [Fact]
        public static void RunTests_BoundaryValues()
        {
            // Verify test results with Max
            VerifyACos(double.MaxValue, double.MaxValue);

            // Verify test results with MaxReal
            VerifyACos(double.MaxValue, 0.0, double.NaN, double.NaN);

            // Verify test results with MaxImg
            VerifyACos(0.0, double.MaxValue);

            // Verify test results with Min
            VerifyACos(double.MinValue, double.MinValue);

            // Verify test results with MinReal
            VerifyACos(double.MinValue, 0.0, double.NaN, double.NaN);

            // Verify test results with MinImaginary
            VerifyACos(0.0, double.MinValue);
        }

        [Fact]
        public static void RunTests_InvalidValues()
        {
            // Verify test results with invalid Imaginary
            VerifyACos(1.0, double.PositiveInfinity, double.NaN, double.NaN);
            VerifyACos(1.0, double.NegativeInfinity, double.NaN, double.NaN);
            VerifyACos(1.0, double.NaN, double.NaN, double.NaN);

            // Verify test results with invalid Real
            VerifyACos(double.PositiveInfinity, 1.0, double.NaN, double.NaN);
            VerifyACos(double.NegativeInfinity, 1.0, double.NaN, double.NaN);
            VerifyACos(double.NaN, 1.0, double.NaN, double.NaN);

            // Verify test results with invalid Real and Imaginary
            foreach (double invalidReal in Support.doubleInvalidValues)
            {
                foreach (double invalidImaginary in Support.doubleInvalidValues)
                {
                    VerifyACos(invalidReal, invalidImaginary, double.NaN, double.NaN);
                }
            }
        }

        [Fact]
        public static void RunTests_EdgeCases()
        {
            // Verify edge cases where imaginary part is zero and real part is positive.
            VerifyACos(1234000000, 0, 0, 21.62667394298955);

            // Verify edge cases where imaginary part is negative.
            VerifyACos(0, -1234000000, 1.5707963267948966, 21.62667394298955);
        }
    }
}


text:
'use strict';

global.app = angular.module('BlurAdmin', [
    'ngAnimate',
    'ui.bootstrap',
    'ui.sortable',
    'ui.router',
    'ngTouch',
    'toastr',
    'smart-table',
    "xeditable",
    'ui.slimscroll',
    'ngJsTree',
    'angular-progress-button-styles',
    'ui.bootstrap.datetimepicker',
    'cgBusy',
    'textAngular',
    // 'angular-sanitize',
    // 'textAngular',
    //'lodash',

    // 'BlurAdmin.login',
    'BlurAdmin.theme',
    // 'BlurAdmin.pages',
    'BlurAdmin.cms',

    // directives
    'BlurAdmin.shared',
])
    .config(['$provide', function($provide){
        // this demonstrates how to register a new tool and add it to the default toolbar
        $provide.decorator('taOptions', ['taRegisterTool', '$delegate',
            function(taRegisterTool, taOptions){
                // $delegate is the taOptions we are decorating
                // here we override the default toolbars and classes specified in taOptions.
                taOptions.forceTextAngularSanitize = true; // set false to allow the textAngular-sanitize provider to be replaced
                taOptions.keyMappings = []; // allow customizable keyMappings for specialized key boards or languages
                taOptions.toolbar = [
                    ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'quote'],
                    ['bold', 'italics', 'underline', 'ul', 'ol', 'redo', 'undo', 'clear'],
                    ['justifyLeft','justifyCenter','justifyRight', 'justifyFull'],
                    ['html', 'insertImage', 'insertLink']
                ];
                taOptions.classes = {
                    focussed: 'focussed',
                    toolbar: 'btn-toolbar',
                    toolbarGroup: 'btn-group',
                    toolbarButton: 'btn btn-default',
                    toolbarButtonActive: 'active',
                    disabled: 'disabled',
                    textEditor: 'form-control',
                    htmlEditor: 'form-control'
                };

                // Create our own insertImage button
                // taRegisterTool('customInsertImage', {
                //     iconclass: "fa fa-picture-o",
                //     action: function() {
                //         var textAngular = this;
                //         var savedSelection = rangy.saveSelection();
                //         var modalInstance = $modal.open({
                //             // Put a link to your template here or whatever
                //             template: '<label>Enter the url to your image:</label><input type="text" ng-model="img.url"><button ng-click="submit()">OK</button>',
                //             size: 'sm',
                //             controller: ['$uibmodalInstance', '$scope',
                //                 function($modalInstance, $scope) {
                //                     $scope.img = {
                //                         url: ''
                //                     };
                //                     $scope.submit = function() {
                //                         $modalInstance.close($scope.img.url);
                //                     };
                //                 }
                //             ]
                //         });
                //
                //         modalInstance.result.then(function(imgUrl) {
                //             rangy.restoreSelection(savedSelection);
                //             textAngular.$editor().wrapSelection('insertImage', imgUrl);
                //         });
                //         return false;
                //     },
                // });
                //
                // // Now add the button to the default toolbar definition
                // // Note: It'll be the last button
                // taOptions.toolbar[3].push('customInsertImage');

                return taOptions; // whatever you return will be the taOptions
            }]);

    }])
    .value('cgBusyDefaults',{
        message:'正在处理...',
        //backdrop: false,
        templateUrl: './loading.html',
        delay: 300,
        minDuration: 1000,
        wrapperClass: 'loading'
    });

//app.directive('deleteConfirm', )
// app.control('mainCtrl', ['$scope', '$window', 'lodash', function($scope, $window, _){
//     toastr.info(JSON.stringify($window.sessionStorage.user));
// }]);


text:
package org.elasticsearch.xpack.core.ml.action;

import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.core.ml.action.DeleteDataFrameAnalyticsAction.Request;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;

public class DeleteDataFrameAnalyticsActionRequestTests extends AbstractWireSerializingTestCase<Request> {

    @Override
    protected Request createTestInstance() {
        Request request = new Request(randomAlphaOfLength(10));
        request.setForce(randomBoolean());
        if (randomBoolean()) {
            request.timeout(TimeValue.parseTimeValue(randomTimeValue(), "test"));
        }
        return request;
    }

    @Override
    protected Writeable.Reader<Request> instanceReader() {
        return Request::new;
    }

    public void testDefaultTimeout() {
        assertThat(createTestInstance().timeout(), is(notNullValue()));
    }
}


text:
C Example Project
=================

[![Build Status](https://img.shields.io/travis/kontron/c-example-project/master.svg)](https://travis-ci.org/kontron/c-example-project)

Features
--------

* Automatically dependency check for .h files
* Support for subdirectories
* Versioning from GIT tags
* Unittest support with glib
* Memory validation check with validgrind


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Dermatocarpon trachyticum f. rubescens Timkó

### Remarks
null


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="JavaScript image viewer.">
  <meta name="keywords" content="HTML, CSS, JS, JavaScript, image viewing, viewer, viewerjs, viewer.js, front-end, web development">
  <meta name="author" content="Fengyuan Chen">
  <title>Viewer.js</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/css/tether.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
  <link rel="stylesheet" href="css/viewer.css">
  <link rel="stylesheet" href="css/main.css">

      Viewer.js
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-controls="navbar-collapse" aria-expanded="false" aria-label="Toggle navigation">

      </button>

          Docs
          GitHub
          More
          About

Viewer.js v0.6.1

JavaScript image viewer.

Overview

Options

              <input type="radio" name="inline" data-value="false" autocomplete="off" checked> Modal mode

              <input type="radio" name="inline" data-value="true" autocomplete="off"> Inline mode

          <button class="btn btn-primary btn-block hidden-md-up" id="toggle-options" data-target="#options" data-toggle="collapse" aria-expanded="true">Toggle options</button>

                  <input class="form-check-input" type="checkbox" name="button" checked> button

                  <input class="form-check-input" type="checkbox" name="navbar" checked> navbar

                  <input class="form-check-input" type="checkbox" name="title" checked> title

                  <input class="form-check-input" type="checkbox" name="toolbar" checked> toolbar

                  <input class="form-check-input" type="checkbox" name="tooltip" checked> tooltip

                  <input class="form-check-input" type="checkbox" name="movable" checked> movable

                  <input class="form-check-input" type="checkbox" name="zoomable" checked> zoomable

                  <input class="form-check-input" type="checkbox" name="rotatable" checked> rotatable

                  <input class="form-check-input" type="checkbox" name="scalable" checked> scalable

                  <input class="form-check-input" type="checkbox" name="transition" checked> transition

                  <input class="form-check-input" type="checkbox" name="fullscreen" checked> fullscreen

                  <input class="form-check-input" type="checkbox" name="keyboard" checked> keyboard

Demo

Methods

            <input type="text" class="form-control" id="viewIndex" name="index" value="4" placeholder="index">

              <button type="button" class="btn btn-primary" data-enable="inline" data-method="view" data-target="#viewIndex" title="View one of the images with image's index">View</button>

            <input type="text" class="form-control" id="zoomRatio" name="ratio" value="0.5" placeholder="ratio">

              <button type="button" class="btn btn-primary" data-enable="inline" data-method="zoom" data-target="#zoomRatio" title="Zoom the image">Zoom</button>

            <input type="text" class="form-control" id="zoomToRatio" name="ratio" value="1" placeholder="ratio">

              <button type="button" class="btn btn-primary" data-enable="inline" data-method="zoomTo" data-target="#zoomToRatio" title="Zoom the image to a special ratio">Zoom To</button>

            <input type="text" class="form-control" id="rotateDegrees" name="degrees" value="90" placeholder="degrees">

              <button type="button" class="btn btn-primary" data-enable="inline" data-method="rotate" data-target="#rotateDegrees" title="Rotate the image">Rotate</button>

            <input type="text" class="form-control" id="rotateToDegrees" name="degrees" value="360" placeholder="degrees">

              <button type="button" class="btn btn-primary" data-enable="inline" data-method="rotateTo" data-target="#rotateToDegrees" title="Rotate the image to a special angle">Rotate To</button>

            <button type="button" class="btn btn-primary" data-arguments="[0.5]" data-enable="inline" data-method="zoom" title="Zoom in">Zoom In</button>
            <button type="button" class="btn btn-primary" data-arguments="[-0.5]" data-enable="inline" data-method="zoom" title="Zoom out">Zoom out</button>

            <button type="button" class="btn btn-primary" data-arguments="[-90]" data-enable="inline" data-method="rotate" title="Rotate left">Rotate Left</button>
            <button type="button" class="btn btn-primary" data-arguments="[90]" data-enable="inline" data-method="rotate" title="Rotate right">Rotate Right</button>

            <button type="button" class="btn btn-primary" data-arguments="[-1]" data-enable="inline" data-method="scaleX" title="Flip horizontal">Flip horizontal</button>
            <button type="button" class="btn btn-primary" data-arguments="[-1]" data-enable="inline" data-method="scaleY" title="Flip vertical">Flip vertical</button>

            <button type="button" class="btn btn-primary" data-arguments="[-10,0]" data-enable="inline" data-method="move" title="Move left">Left</button>
            <button type="button" class="btn btn-primary" data-arguments="[10,0]" data-enable="inline" data-method="move" title="Move right">Right</button>
            <button type="button" class="btn btn-primary" data-arguments="[0,-10]" data-enable="inline" data-method="move" title="Move up">Up</button>
            <button type="button" class="btn btn-primary" data-arguments="[0,10]" data-enable="inline" data-method="move" title="Move down">Down</button>

            <button type="button" class="btn btn-primary" data-enable="inline" data-method="prev" title="View previous image">Prev</button>
            <button type="button" class="btn btn-primary" data-enable="inline" data-method="next" title="View next image">Next</button>
            <button type="button" class="btn btn-primary" data-enable="inline" data-method="play" title="Play the images">Play</button>
            <button type="button" class="btn btn-primary" data-enable="inline" data-method="stop" title="Stop the playing">Stop</button>

            <button type="button" class="btn btn-primary" data-enable="modal" data-method="show" title="Show the viewer">Show</button>
            <button type="button" class="btn btn-primary" data-method="hide" title="Hide the viewer" disabled>Hide</button>
            <button type="button" class="btn btn-primary" data-enable="inline" data-method="full" title="Enter modal mode">Full</button>
            <button type="button" class="btn btn-primary" data-method="exit" title="Exit modal mode" disabled>Exit</button>

            <button type="button" class="btn btn-primary" data-enable="inline" data-method="reset">Reset</button>
            <button type="button" class="btn btn-primary" data-enable="inline" data-method="tooltip">Tooltip</button>

          <button type="button" class="btn btn-block btn-danger" data-enable="modal inline" data-method="destroy">Destroy</button>

        GitHub
        Releases
        License
        About


text:
require "spec_helper"

describe Mongoid::Collection do

  let(:master) do
    stub.quacks_like(Mongoid::Collections::Master.allocate)
  end

  let(:collection) do
    Mongoid::Collection.new(Person, "people")
  end

  before do
    collection.instance_variable_set(:@master, master)
  end

  context "Mongo::Collection write operations" do

    Mongoid::Collections::Operations::WRITE.each do |name|

      it "defines #{name}" do
        collection.should respond_to(name)
      end
    end

  end

  context "Mongo::Collection read operations" do

    Mongoid::Collections::Operations::READ.each do |name|

      it "defines #{name}" do
        collection.should respond_to(name)
      end
    end
  end

  context "when secondary databases exist" do

    context "when the database is named" do
      let(:secondary) { mock("secondary") }
      let(:collection) do
        Mongoid::Collection.new(Business, "businesses")
      end

      before do
        collection.instance_variable_set(:@master, nil)
      end

      before do
        Mongoid.expects(:databases).returns({
          "secondary" => secondary
        })
      end

      it "should use the named database master" do
        Mongoid::Collections::Master.expects(:new).with(secondary, "businesses")
        collection.master
      end

    end
  end

  describe "#find" do

    before do
      @cursor = stub.quacks_like(Mongoid::Cursor.allocate)
      Mongoid::Cursor.expects(:new).with(Person, collection, @mongo_cursor).returns(@cursor)
    end

    context "when no block supplied" do

      before do
        master.expects(:find).with({ :test => "value" }, {}).returns(@mongo_cursor)
      end

      it "finds return a cursor" do
        collection.find({ :test => "value"}).should == @cursor
      end

    end

    context "when a block is supplied" do

      before do
        master.expects(:find).with({ :test => "value" }, {}).returns(@mongo_cursor)
      end

      it "yields to the cursor and closes it" do
        @cursor.expects(:close).returns(true)
        collection.find({ :test => "value" }) do |cur|
          cur.should == @cursor
        end
      end
    end

    context "when an enslave option does not exist" do

      before do
        master.expects(:find).with({ :test => "value" }, {}).returns(@mongo_cursor)
      end

      it "sends the query to the master" do
        collection.find({ :test => "value"}).should == @cursor
      end
    end
  end

  describe "#find_one" do

    before do
      @person = stub
    end

    context "when an enslave option does not exist" do

      before do
        master.expects(:find_one).with({ :test => "value" }, {}).returns(@person)
      end

      it "sends the query to the master" do
        collection.find_one({ :test => "value"}).should == @person
      end
    end
  end

  describe "#insert" do

    let(:document) do
      { "$set" => { "field" => "value" } }
    end

    context "when no inserter exists on the current thread" do

      it "delegates straight to the master collection" do
        master.expects(:insert).with(document, {})
        collection.insert(document)
      end
    end
  end

  describe "#update" do

    let(:selector) do
      { "_id" => BSON::ObjectId.new }
    end

    let(:document) do
      { "$set" => { "field" => "value" } }
    end

    context "when no updater exists on the current thread" do

      it "delegates straight to the master collection" do
        master.expects(:update).with(selector, document, {})
        collection.update(selector, document)
      end
    end
  end
end


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis
{
    internal partial class SolutionState
    {
        private abstract partial class CompilationTranslationAction
        {
            internal class TouchDocumentAction : CompilationTranslationAction
            {
                private readonly DocumentState _oldState;
                private readonly DocumentState _newState;

                public TouchDocumentAction(DocumentState oldState, DocumentState newState)
                {
                    _oldState = oldState;
                    _newState = newState;
                }

                public override Task<Compilation> InvokeAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return UpdateDocumentInCompilationAsync(oldCompilation, _oldState, _newState, cancellationToken);
                }

                public DocumentId DocumentId => _newState.Attributes.Id;
            }

            private class RemoveAllDocumentsAction : CompilationTranslationAction
            {
                public override Task<Compilation> InvokeAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return Task.FromResult(oldCompilation.RemoveAllReferences());
                }
            }

            private class RemoveDocumentAction : SimpleCompilationTranslationAction<DocumentState>
            {
                private static readonly Func<Compilation, DocumentState, CancellationToken, Task<Compilation>> s_action =
                    async (o, d, c) => o.RemoveSyntaxTrees(await d.GetSyntaxTreeAsync(c).ConfigureAwait(false));

                public RemoveDocumentAction(DocumentState document)
                    : base(document, s_action)
                {
                }
            }

            private class AddDocumentsAction : CompilationTranslationAction
            {
                private readonly ImmutableArray<DocumentState> _documents;

                public AddDocumentsAction(ImmutableArray<DocumentState> documents)
                {
                    _documents = documents;
                }

                public override async Task<Compilation> InvokeAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    var syntaxTrees = new List<SyntaxTree>();
                    foreach (var document in _documents)
                    {
                        syntaxTrees.Add(await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false));
                    }

                    return oldCompilation.AddSyntaxTrees(syntaxTrees);
                }
            }

            private class ProjectParseOptionsAction : SimpleCompilationTranslationAction<ProjectState>
            {
                private static readonly Func<Compilation, ProjectState, CancellationToken, Task<Compilation>> s_action =
                    (o, d, c) => Task.Run(() => ReplaceSyntaxTreesWithTreesFromNewProjectStateAsync(o, d, c), c);

                public ProjectParseOptionsAction(ProjectState state)
                    : base(state, s_action)
                {
                }
            }

            private class ProjectCompilationOptionsAction : SimpleCompilationTranslationAction<CompilationOptions>
            {
                private static readonly Func<Compilation, CompilationOptions, CancellationToken, Task<Compilation>> s_action =
                    (o, d, c) => Task.FromResult(o.WithOptions(d));

                public ProjectCompilationOptionsAction(CompilationOptions option)
                    : base(option, s_action)
                {
                }
            }

            private class ProjectAssemblyNameAction : SimpleCompilationTranslationAction<string>
            {
                private static readonly Func<Compilation, string, CancellationToken, Task<Compilation>> s_action =
                    (o, d, c) => Task.FromResult(o.WithAssemblyName(d));

                public ProjectAssemblyNameAction(string assemblyName)
                    : base(assemblyName, s_action)
                {
                }
            }

            private class SimpleCompilationTranslationAction<T> : CompilationTranslationAction
            {
                private readonly T _data;
                private readonly Func<Compilation, T, CancellationToken, Task<Compilation>> _action;

                public SimpleCompilationTranslationAction(T data, Func<Compilation, T, CancellationToken, Task<Compilation>> action)
                {
                    _data = data;
                    _action = action;
                }

                public override Task<Compilation> InvokeAsync(Compilation oldCompilation, CancellationToken cancellationToken)
                {
                    return _action(oldCompilation, _data, cancellationToken);
                }
            }
        }
    }
}


text:
_fast and powerful string micro templating_

## Installation

The module available via [npm](https://www.npmjs.com/package/f2)

```bash
npm i f2 --save
```

## API

### Common

#### `F2 new F2()`

_class_

```js
var F2 = require('f2/f2');
var f2 = new F2();
```

The module provides a complete instance with built-in substitution formatters.

```js
var f2 = require('f2');
```

A class reference needed only for advanced usage.

#### `String f2.format([String f][, * arg[, * arg...]])`

_method_

Formats pattern with passed arguments

```js
var f2 = require('f2');
f2.format('Lorem %s!', 'ipsum'); // -> 'Lorem ipsum!'
```

Common method. See the full templates features below.
The method is bound to instance, it can be used as static function

```js
var f = require('f2').format;
f('Lorem %s!', 'ipsum'); // -> 'Lorem ipsum!'
```

Also the method is represented as separate module

```js
var f = require('f2/format');
f('Lorem %s!', 'ipsum'); // -> 'Lorem ipsum!'
```

### Advanced & sugar

#### `String f2.applyArgs(Array args[, Number offsetL[, Number offsetR]])`

_method_

Do something like `f2.format.apply(f2, ['Lorem %s!', 'ipsum'])`, but supports args array offsets from left and from right.

```js
var f2 = require('f2');
f2.applyArgs(['Lorem %s!', 'ipsum']); // -> 'Lorem ipsum!'
f2.applyArgs(['foobar', 'Lorem %s!', 'ipsum'], 1); // -> 'Lorem ipsum!'
f2.applyArgs(['foobar', 'Lorem %s!', 'ipsum'], 1, 1); // -> 'Lorem undefined!' // oops!
```

#### `String f2.applyArgsTo(String f, Array args[, Number offsetL[, Number offsetR]])`

_method_

Like `f2.applyArgs`, but first argument is template

```js
var f2 = require('f2');
f2.applyArgsTo('Lorem %s!', ['ipsum']); // -> 'Lorem ipsum!'
f2.applyArgsTo('Lorem %s!', ['foobar', 'ipsum'], 1); // -> 'Lorem ipsum!'
```

#### `F2 f2.type(String type, Function formatter)`

_method_

Adds new substitution type

```js
var F2 = require('f2/f2');
var f2 = new F2();
f2.type('b', function (v) {
    return '[' + v + ']';
});
f2.format('Lorem %b!', 'ipsum'); // -> 'Lorem [ipsum]!'
```

There are available `s`, `d` and `j` formatters in bundled instance

## Features

### Explicit indexes for positional arguments

```js
f2.format('%2$s %1$s', 'foo', 'bar'); // -> 'bar foo'
```

### Keyword arguments

```js
f2.format('Login to %(user.name)s at %(time)s', {user: {name: 'golyshevd'}, time: 'Tomorrow'});
// -> Login to golyshevd at Tomorrow
```

### Inspecting extra arguments

```js
f2.format('Lorem %s', 'ipsum', 'dolor'); // -> 'Lorem ipsum \'dolor\''
```

### Functional arguments

```js
f2.format('Lorem %s!', function () {
    return 'ipsum';
}); // -> 'Lorem ipsum!'
```

### Substitution options

Any substitution type can support options that can be passed in template between `%` and `<type>`

```js
f2.format('Lorem %-?:5.3s!', 'ipsum'); // 'Lorem ips??!'
```

There are `fill`, `sign`, `width` and `precision`. Every formatter can interpret parameters handling in their own way. All parameters are available in substitution formatter function body.

```js
f2.type('b', function (value, fill, sign, width, precision) {
    return value; // Ignore any parameters, why not?
});
```

---------
LICENSE [MIT](LICENCE)


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SetCustomDimensionsForAcquireToken">
    <DisplayName>AM-SetCustomDimensionsForAcquireToken</DisplayName>
    <FaultRules/>
    <Properties/>
    <AssignVariable>
        <Name>customerPPId</Name>
        <Ref>oauthv2authcode.OAInfo-RetrieveOIDCAuthCode.customerPPId</Ref>
    </AssignVariable>
    <AssignVariable>
        <Name>tokenOp</Name>
        <Value>acquire</Value>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo transport="http" createNew="false"/>
</AssignMessage>


text:
char * read_binary_file(char * filename);

class QueryEngine {
    unsigned char * binary_mmaped; //The binari phrase table file
    std::map<unsigned int, std::string> vocabids;
    std::map<uint64_t, std::string> source_vocabids;

    Table table;
    char *mem; //Memory for the table, necessary so that we can correctly destroy the object

    HuffmanDecoder decoder;

    size_t binary_filesize;
    size_t table_filesize;
    public:
        QueryEngine (const char *);
        ~QueryEngine();
        std::pair<bool, std::vector<target_text> > query(StringPiece source_phrase);
        std::pair<bool, std::vector<target_text> > query(std::vector<uint64_t> source_phrase);
        void printTargetInfo(std::vector<target_text> target_phrases);
        const std::map<unsigned int, std::string> getVocab() const
        { return decoder.get_target_lookup_map(); }

        const std::map<uint64_t, std::string> getSourceVocab() const {
            return source_vocabids;
        }

};


text:
<?php

/**
 * XmlConnect Images resource model
 *
 * @category    Mage
 * @package     Mage_XmlConnect
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_XmlConnect_Model_Resource_Images extends Mage_Core_Model_Resource_Db_Abstract
{
    /**
     * Initialize connection and define resource
     *
     */
    protected function _construct()
    {
        $this->_init('xmlconnect/images', 'image_id');
    }

    /**
     * Repair image order for application by type
     *
     * @param Mage_Core_Model_Abstract $image
     * @return Mage_XmlConnect_Model_Resource_Images
     */
    public function repairOrder(Mage_Core_Model_Abstract $image)
    {
        $bind = array(':application_id' => (int)$image->getApplicationId(), ':image_type' => $image->getImageType());

        $select = $this->_getWriteAdapter()->select()->from($this->getMainTable(), array('image_id'))
            ->where('application_id=:application_id AND image_type=:image_type')
            ->order('order', Varien_Data_Collection::SORT_ORDER_ASC);

        $result = $this->_getWriteAdapter()->fetchCol($select, $bind);
        $imageModel = Mage::getModel('xmlconnect/images');
        $i = 0;
        foreach ($result as $image_id) {
            $imageModel->load($image_id)->setOrder(++$i)->save();
        }
        return $this;
    }

    /**
     * Save image data
     *
     * @param int $applicationId
     * @param string $imageFile
     * @param string $imageType
     * @param string $order
     * @return Mage_XmlConnect_Model_Resource_Images
     */
    public function saveImage($applicationId, $imageFile, $imageType, $order)
    {
        $newData = array(
            'application_id' => $applicationId,
            'image_file'    => $imageFile,
            'image_type'    => $imageType,
            'order'     => $order
        );

        $this->_getWriteAdapter()->insert($this->getMainTable(), $newData);
        return $this;
    }
}


text:
ACCEPTED

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

#### Published in
null

#### Original name
Pastinaca dasycarpa Regel & Schmalh. ex Regel

### Remarks
null


text:
"use strict";

var request = require("request");

module.exports = {
  accessTokenTest: function (accessToken, callback) {
    if (!accessToken) { callback("no access token provided", null); }
    else {
      request({
        method: "GET",
        uri: "https://bookable.herokuapp.com/api/v1/me",
        headers: {
          "Authorization": accessToken
        }
      },
      function (err, response, body) {
        if (err) {
          callback("access token failed", null);
        }
        else {
          let jsonBody = JSON.parse(body),
              user = {
                accessToken: accessToken,
                firstName: jsonBody.forename
              };

          callback(null, user);
        };
      });
    };
  },
  addBookmark: function (accessToken, url, tags, callback) {
    let data = {
      url: url,
      tags: tags
    }

    request({
        method: "POST",
        uri: "https://bookable.herokuapp.com/api/v1/bookmarks",
        headers: {
          "Authorization": accessToken,
          "Content-Type": "application/json"
        },
        json: data
      },
      function (err, response, body) {
        if (!err && response.statusCode == 201) {
          callback(null, "success");
        }
        else {
          callback(response.body, null);
        };
      });
  }
};


text:
layout: example
title: Instream Video and Banner Ad Mixed Page
description: An example of displaying both instream video and banner ads using Prebid.js

sidebarType: 1

jsfiddle_link: jsfiddle.net/Prebid_Examples/nowfejh7/embedded/html,result/

code_height: 3050

---


text:
layout: post
date: '2016-02-23'
title: "Long Alfred Sung by Dessy Bridesmaid Dress D627"
category: Long
tags: [Long]
---
### Long Alfred Sung by Dessy Bridesmaid Dress D627
Just **$222.99**
###

Buy it: [https://www.eudances.com/en/long/1916-alfred-sung-by-dessy-bridesmaid-dress-d627.html](https://www.eudances.com/en/long/1916-alfred-sung-by-dessy-bridesmaid-dress-d627.html)


text:
import unittest

from transformers import MobileBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from .test_configuration_common import ConfigTester
from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor

if is_tf_available():
    import tensorflow as tf

    from transformers import (
        TFMobileBertForMaskedLM,
        TFMobileBertForMultipleChoice,
        TFMobileBertForNextSentencePrediction,
        TFMobileBertForPreTraining,
        TFMobileBertForQuestionAnswering,
        TFMobileBertForSequenceClassification,
        TFMobileBertForTokenClassification,
        TFMobileBertModel,
    )

@require_tf
class TFMobileBertModelTest(TFModelTesterMixin, unittest.TestCase):

    all_model_classes = (
        (
            TFMobileBertModel,
            TFMobileBertForMaskedLM,
            TFMobileBertForNextSentencePrediction,
            TFMobileBertForPreTraining,
            TFMobileBertForQuestionAnswering,
            TFMobileBertForSequenceClassification,
            TFMobileBertForTokenClassification,
            TFMobileBertForMultipleChoice,
        )
        if is_tf_available()
        else ()
    )
    test_head_masking = False
    test_onnx = False

    class TFMobileBertModelTester(object):
        def __init__(
            self,
            parent,
            batch_size=13,
            seq_length=7,
            is_training=True,
            use_input_mask=True,
            use_token_type_ids=True,
            use_labels=True,
            vocab_size=99,
            hidden_size=32,
            embedding_size=32,
            num_hidden_layers=5,
            num_attention_heads=4,
            intermediate_size=37,
            hidden_act="gelu",
            hidden_dropout_prob=0.1,
            attention_probs_dropout_prob=0.1,
            max_position_embeddings=512,
            type_vocab_size=16,
            type_sequence_label_size=2,
            initializer_range=0.02,
            num_labels=3,
            num_choices=4,
            scope=None,
        ):
            self.parent = parent
            self.batch_size = batch_size
            self.seq_length = seq_length
            self.is_training = is_training
            self.use_input_mask = use_input_mask
            self.use_token_type_ids = use_token_type_ids
            self.use_labels = use_labels
            self.vocab_size = vocab_size
            self.hidden_size = hidden_size
            self.num_hidden_layers = num_hidden_layers
            self.num_attention_heads = num_attention_heads
            self.intermediate_size = intermediate_size
            self.hidden_act = hidden_act
            self.hidden_dropout_prob = hidden_dropout_prob
            self.attention_probs_dropout_prob = attention_probs_dropout_prob
            self.max_position_embeddings = max_position_embeddings
            self.type_vocab_size = type_vocab_size
            self.type_sequence_label_size = type_sequence_label_size
            self.initializer_range = initializer_range
            self.num_labels = num_labels
            self.num_choices = num_choices
            self.scope = scope
            self.embedding_size = embedding_size

        def prepare_config_and_inputs(self):
            input_ids = ids_tensor([self.batch_size, self.seq_length], self.vocab_size)

            input_mask = None
            if self.use_input_mask:
                input_mask = ids_tensor([self.batch_size, self.seq_length], vocab_size=2)

            token_type_ids = None
            if self.use_token_type_ids:
                token_type_ids = ids_tensor([self.batch_size, self.seq_length], self.type_vocab_size)

            sequence_labels = None
            token_labels = None
            choice_labels = None
            if self.use_labels:
                sequence_labels = ids_tensor([self.batch_size], self.type_sequence_label_size)
                token_labels = ids_tensor([self.batch_size, self.seq_length], self.num_labels)
                choice_labels = ids_tensor([self.batch_size], self.num_choices)

            config = MobileBertConfig(
                vocab_size=self.vocab_size,
                hidden_size=self.hidden_size,
                num_hidden_layers=self.num_hidden_layers,
                num_attention_heads=self.num_attention_heads,
                intermediate_size=self.intermediate_size,
                hidden_act=self.hidden_act,
                hidden_dropout_prob=self.hidden_dropout_prob,
                attention_probs_dropout_prob=self.attention_probs_dropout_prob,
                max_position_embeddings=self.max_position_embeddings,
                type_vocab_size=self.type_vocab_size,
                initializer_range=self.initializer_range,
                embedding_size=self.embedding_size,
            )

            return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels

        def create_and_check_mobilebert_model(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            model = TFMobileBertModel(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)

            inputs = [input_ids, input_mask]
            result = model(inputs)

            result = model(input_ids)

            self.parent.assertEqual(
                result.last_hidden_state.shape, (self.batch_size, self.seq_length, self.hidden_size)
            )
            self.parent.assertEqual(result.pooler_output.shape, (self.batch_size, self.hidden_size))

        def create_and_check_mobilebert_for_masked_lm(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            model = TFMobileBertForMaskedLM(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(result.logits.shape, (self.batch_size, self.seq_length, self.vocab_size))

        def create_and_check_mobilebert_for_next_sequence_prediction(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            model = TFMobileBertForNextSentencePrediction(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(result.logits.shape, (self.batch_size, 2))

        def create_and_check_mobilebert_for_pretraining(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            model = TFMobileBertForPreTraining(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(
                result.prediction_logits.shape, (self.batch_size, self.seq_length, self.vocab_size)
            )
            self.parent.assertEqual(result.seq_relationship_logits.shape, (self.batch_size, 2))

        def create_and_check_mobilebert_for_sequence_classification(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            config.num_labels = self.num_labels
            model = TFMobileBertForSequenceClassification(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(result.logits.shape, (self.batch_size, self.num_labels))

        def create_and_check_mobilebert_for_multiple_choice(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            config.num_choices = self.num_choices
            model = TFMobileBertForMultipleChoice(config=config)
            multiple_choice_inputs_ids = tf.tile(tf.expand_dims(input_ids, 1), (1, self.num_choices, 1))
            multiple_choice_input_mask = tf.tile(tf.expand_dims(input_mask, 1), (1, self.num_choices, 1))
            multiple_choice_token_type_ids = tf.tile(tf.expand_dims(token_type_ids, 1), (1, self.num_choices, 1))
            inputs = {
                "input_ids": multiple_choice_inputs_ids,
                "attention_mask": multiple_choice_input_mask,
                "token_type_ids": multiple_choice_token_type_ids,
            }
            result = model(inputs)
            self.parent.assertEqual(result.logits.shape, (self.batch_size, self.num_choices))

        def create_and_check_mobilebert_for_token_classification(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            config.num_labels = self.num_labels
            model = TFMobileBertForTokenClassification(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(result.logits.shape, (self.batch_size, self.seq_length, self.num_labels))

        def create_and_check_mobilebert_for_question_answering(
            self, config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
        ):
            model = TFMobileBertForQuestionAnswering(config=config)
            inputs = {"input_ids": input_ids, "attention_mask": input_mask, "token_type_ids": token_type_ids}
            result = model(inputs)
            self.parent.assertEqual(result.start_logits.shape, (self.batch_size, self.seq_length))
            self.parent.assertEqual(result.end_logits.shape, (self.batch_size, self.seq_length))

        def prepare_config_and_inputs_for_common(self):
            config_and_inputs = self.prepare_config_and_inputs()
            (
                config,
                input_ids,
                token_type_ids,
                input_mask,
                sequence_labels,
                token_labels,
                choice_labels,
            ) = config_and_inputs
            inputs_dict = {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
            return config, inputs_dict

    def setUp(self):
        self.model_tester = TFMobileBertModelTest.TFMobileBertModelTester(self)
        self.config_tester = ConfigTester(self, config_class=MobileBertConfig, hidden_size=37)

    def test_config(self):
        self.config_tester.run_common_tests()

    def test_mobilebert_model(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_model(*config_and_inputs)

    def test_for_masked_lm(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_masked_lm(*config_and_inputs)

    def test_for_multiple_choice(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_multiple_choice(*config_and_inputs)

    def test_for_next_sequence_prediction(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_next_sequence_prediction(*config_and_inputs)

    def test_for_pretraining(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_pretraining(*config_and_inputs)

    def test_for_question_answering(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_question_answering(*config_and_inputs)

    def test_for_sequence_classification(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_sequence_classification(*config_and_inputs)

    def test_for_token_classification(self):
        config_and_inputs = self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_mobilebert_for_token_classification(*config_and_inputs)

    def test_model_common_attributes(self):
        config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
        list_lm_models = [TFMobileBertForMaskedLM, TFMobileBertForPreTraining]

        for model_class in self.all_model_classes:
            model = model_class(config)
            assert isinstance(model.get_input_embeddings(), tf.keras.layers.Layer)

            if model_class in list_lm_models:
                x = model.get_output_embeddings()
                assert isinstance(x, tf.keras.layers.Layer)
                name = model.get_bias()
                assert isinstance(name, dict)
                for k, v in name.items():
                    assert isinstance(v, tf.Variable)
            else:
                x = model.get_output_embeddings()
                assert x is None
                name = model.get_bias()
                assert name is None

    def test_saved_model_creation(self):
        # This test is too long (>30sec) and makes fail the CI
        pass

    @slow
    def test_model_from_pretrained(self):
        # for model_name in TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
        for model_name in ["google/mobilebert-uncased"]:
            model = TFMobileBertModel.from_pretrained(model_name)
            self.assertIsNotNone(model)

@require_tf
class TFMobileBertModelIntegrationTest(unittest.TestCase):
    @slow
    def test_inference_masked_lm(self):
        model = TFMobileBertForPreTraining.from_pretrained("google/mobilebert-uncased")
        input_ids = tf.constant([[0, 1, 2, 3, 4, 5]])
        output = model(input_ids)[0]

        expected_shape = [1, 6, 30522]
        self.assertEqual(output.shape, expected_shape)

        expected_slice = tf.constant(
            [
                [
                    [-4.5919547, -9.248295, -9.645256],
                    [-6.7306175, -6.440284, -6.6052837],
                    [-7.2743506, -6.7847915, -6.024673],
                ]
            ]
        )
        tf.debugging.assert_near(output[:, :3, :3], expected_slice, atol=1e-4)


text:
using java.lang;
using java.lang.reflect;

public class FieldAnnotation {
	[Deprecated]
	public int field*;

	public static bool test() {
		Class<?> c = typeof(FieldAnnotation);
		Field f = c.getField("field");
		return f.getAnnotation(typeof(Deprecated)) != null;
	}
}


text:
<?php

namespace AppBundle\Controller;

use PDFfiller\OAuth2\Client\Provider\Document;
use PDFfiller\OAuth2\Client\Provider\FillableTemplate;
use PDFfiller\OAuth2\Client\Provider\Uploader;
use PDFfiller\OAuth2\Client\Provider\Enums\GrantType;
use PDFfiller\OAuth2\Client\Provider\PDFfiller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\File;
use Symfony\Component\Validator\Constraints\Url;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

class DocumentController extends Controller
{
    protected $clientId = '72f2f43812e0f9e2';

    protected $clientSecret = '39lYL1rasqjJmanPELmouqm3scj1Iv3I';

    protected $urlAccessToken = 'https://api.pdffiller.com/v1/oauth/access_token';

    protected $urlApiDomain = 'https://api.pdffiller.com/v1/';

    protected $userEmail = '';

    protected $userPassword = '';

    protected $provider;

    protected function getProvider()
    {
        $provider = new PDFfiller([
            'clientId'       => $this->clientId,
            'clientSecret'   => $this->clientSecret,
            'urlAccessToken' => $this->urlAccessToken,
            'urlApiDomain'   => $this->urlApiDomain
        ]);
        $sessionToken = $this->get('session')->get('pdffiller');

        if (null === $sessionToken) {

            $token = $provider->getAccessToken('password', [
                'username' => $this->userEmail,
                'password' => $this->userPassword
            ]);

            $provider->setAccessToken($token);
            $this->get('session')->set('pdffiller', $token);

        } else if ($sessionToken->getExpires() <= \time()) {
            $provider->setAccessToken($sessionToken);
            $token = $provider->issueAccessToken(new GrantType(GrantType::REFRESH_TOKEN_GRANT), [
                'refresh_token' => $provider->getAccessToken()->getRefreshToken()
            ]);

            $provider->setAccessToken($token);
            $this->get('session')->set('pdffiller', $token);
        } else if ($sessionToken) {
            $provider->setAccessToken($sessionToken);
        }

        $this->provider = $provider;
    }

    /**
     * @Route("/document/", name="document_list")
     */
    public function documentsListAction()
    {
        $this->getProvider();
        $documents = Document::all($this->provider, ['perpage' => '10', 'order' => 'desc']);
        $pagination = [
            'total' => $documents['total'],
            'current_page' => $documents['current_page'],
            'per_page' => $documents['per_page'],
            'prev_page_url' => $documents['prev_page_url'],
            'next_page_url' => $documents['next_page_url']
        ];
//        Document::all($this->provider, ['page' => $page]);

        return $this->render('document/list-all.html.twig', [
            'documents' => $documents->toArray(),
            'pagination' => $pagination
        ]);

    }

    /**
     * @Route("/documents/{id}", name="document_by_id")
     * @param $id
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function documentByIdAction($id)
    {
        $this->getProvider();
        $document = Document::one($this->provider, $id)->toArray();
        $document['filledDocuments'] = FillableTemplate::filledDocuments($this->provider, $document['id'])->toArray();
        $document['fillableFields'] = FillableTemplate::dictionary($this->provider, $document['id'])->toArray();
        return $this->render('document/item.html.twig', [
            'document' => $document,
        ]);
    }

    /**
     * @Route("/documents/upload/file", name="document_upload_by_file")
     * @Method ({"GET", "POST"})
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function uploadDocumentByFileAction(Request $request)
    {
        $defaultData = ['message' => 'Download File To PDFfiller'];
        $form = $this->createFormBuilder($defaultData)
            ->add('file', FileType::class, [
                'constraints' => [
                    new NotBlank(),
                    new File([
                        'maxSize' => '25M',
                        'mimeTypes' => [
                            'application/pdf',
                            'application/msword',
                            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
                            'application/vnd.ms-powerpoint',
                            'application/vnd.openxmlformats-officedocument.presentationml.presentation'
                        ],
                    ])
                ],
                'required' => true,
            ])
            ->getForm();

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $data = $form->getData();
            $brochuresDir = $this->getParameter('kernel.root_dir').'/../web/uploads/user/1/';
            $data['file']->move($brochuresDir, $data['file']->getClientOriginalName());
            $this->getProvider();
            $uploader = new Uploader($this->provider, Document::class);
            $uploader->type = Uploader::TYPE_MULTIPART;
            $uploader->file = $brochuresDir . $data['file']->getClientOriginalName();
            $document = $uploader->upload();
            $document->toArray();
            return $this->redirectToRoute('document_by_id', array('id' => $document->id));
        }

        return $this->render('document/form-download-doc-by-file.html.twig', [
            'form' => $form->createView()
        ]);
    }

    /**
     * @Route("/documents/upload/url", name="document_upload_by_url")
     * @Method ({"GET", "POST"})
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function uploadDocumentByUrlAction(Request $request)
    {
        $defaultData = ['message' => 'Download File To PDFfiller'];
        $form = $this->createFormBuilder($defaultData)
            ->add('url', TextType::class, [
                'constraints' => [
                    new NotBlank(),
                    new Url()
                ],
                'required' => true,
            ])
            ->getForm();

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $data = $form->getData();
            $this->getProvider();
            $uploader = new Uploader($this->provider, Document::class);
            $uploader->type = Uploader::TYPE_URL;
            $uploader->file = $data['url'];
            $document = $uploader->upload();
            $document->toArray();
            return $this->redirectToRoute('document_by_id', array('id' => $document->id));
        }

        return $this->render('document/form-download-doc-by-url.html.twig', [
            'form' => $form->createView()
        ]);
    }

    /**
     * @Route("/documents/delete/{id}", name="document_delete")
     * @Method ({"GET"})
     * @param $id
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function deleteDocumentAction($id)
    {
        $this->getProvider();
        $document = Document::one($this->provider, $id);
        $e = $document->remove();
        return new Response($e['message']);
    }

    /**
     * @Route("/documents/download/{id}", name="download_document_from_pdffiller")
     * @Method ({"GET"})
     * @param Request $request
     * @param $id
     * @return Response
     */
    public function downloadDocumentAction(Request $request, $id)
    {
        $this->getProvider();
        $document = Document::one($this->provider, $id)->toArray();
        $contents = Document::download($this->provider, $id);

        $response = new Response();
        $response->headers->set('Content-type' , 'application/pdf');
        if ("true" !== $request->query->get('in_browser')) {
            $response->headers->set('Content-Disposition', 'attachment;filename="' . $document['name'] . '"');
//            $response->headers->set('Content-length', strlen(utf8_decode($contents)));
        }
        return $response->setContent($contents);
    }

    /**
     * @Route("/documents/download_signatures/{id}", name="download_signatures_from_pdffiller")
     * @Method ({"GET"})
     * @param $id
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function downloadSignaturesAction($id)
    {
        $this->getProvider();
        $signatures = Document::downloadSignatures($this->provider, $id);
        $response = new Response($signatures);
        $response->headers->set('Content-Type', 'application/zip');
        $response->headers->set('Content-Disposition', 'attachment;filename="signatures_doc_' . $id . '"');
        $response->headers->set('Content-length', strlen(utf8_decode($signatures)));

        return $response;
    }
}


text:
namespace Reactive.ActorModel.Messages
{
    public class StartScheduler
    {
    }
}


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

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Graphics;

using BeyondYonder.src.GameComponents;
using BeyondYonder.src.Controls;

namespace BeyondYonder.src
{
    public class ControlManager : List<Control>
    {
        #region Fields and Properties
        int selectedControl = 0;
        static SpriteFont spriteFont;

        public static SpriteFont SpriteFont
        {
            get { return spriteFont; }
        }
        #endregion

        #region Constructors
        public ControlManager(SpriteFont spriteFont)
            : base()
        {
            ControlManager.spriteFont = spriteFont;
        }

        public ControlManager(SpriteFont spriteFont, int capacity)
            : base(capacity)
        {
            ControlManager.spriteFont = spriteFont;
        }

        public ControlManager(SpriteFont spriteFont, IEnumerable<Control> collection) :
            base(collection)
        {
            ControlManager.spriteFont = spriteFont;
        }
        #endregion

        #region Methods
        public void Update(GameTime gameTime, PlayerIndex playerIndex)
        {
            if (Count == 0)
                return;
            foreach (Control c in this)
            {
                if (c.Enabled)
                    c.Update(gameTime);

                if (c.HasFocus)
                    c.HandleInput(playerIndex);
                else if (
                    InputHandler.CurrentMouseState.Y > c.Position.Y &&
                    InputHandler.CurrentMouseState.Y < c.Position.Y + c.SpriteFont.MeasureString(c.Text).Y &&
                    InputHandler.CurrentMouseState.X > c.Position.X &&
                    InputHandler.CurrentMouseState.X < c.Position.X + c.SpriteFont.MeasureString(c.Text).X
                    ||
                    InputHandler.CurrentGesture.Position.X > c.Position.X &&
                     InputHandler.CurrentGesture.Position.X < c.Position.X + SpriteFont.MeasureString(c.Text).X &&
                     InputHandler.CurrentGesture.Position.Y > c.Position.Y &&
                     InputHandler.CurrentGesture.Position.Y < c.Position.Y + SpriteFont.MeasureString(c.Text).Y
                    ){
                        SelectControl(c);
                }
            }
            if (InputHandler.ButtonPressed(Buttons.LeftThumbstickUp, playerIndex) ||
                InputHandler.ButtonPressed(Buttons.DPadUp, playerIndex) ||
                InputHandler.KeyPressed(Keys.Up) ||
                InputHandler.TouchPressed() && InputHandler.CurrentGesture.GestureType == GestureType.Flick && InputHandler.CurrentGesture.Position.Y < InputHandler.LastGesture.Position.Y)
            {
                PreviousControl();
            }
            if (InputHandler.ButtonPressed(Buttons.LeftThumbstickDown, playerIndex) ||
                InputHandler.ButtonPressed(Buttons.DPadDown, playerIndex) ||
                InputHandler.TouchPressed() && InputHandler.CurrentGesture.GestureType == GestureType.Flick && InputHandler.CurrentGesture.Position.Y > InputHandler.LastGesture.Position.Y ||
                InputHandler.KeyPressed(Keys.Down))
            {
                NextControl();
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            foreach (Control c in this)
            {
                if (c.Visible)
                    c.Draw(spriteBatch);
            }
        }

        public void SelectControl(Control control)
        {
            if (Count == 0)
                return;
            int currentControl = selectedControl;
            this[selectedControl].HasFocus = false;
            do
            {
                selectedControl++;
                if (selectedControl == Count)
                    selectedControl = 0;
                if (this[selectedControl].TabStop && this[selectedControl].Enabled)
                    break;
            } while (currentControl != selectedControl);
            this[selectedControl].HasFocus = true;
        }

        public void NextControl()
        {
            if (Count == 0)
                return;
            int currentControl = selectedControl;
            this[selectedControl].HasFocus = false;
            do
            {
                selectedControl++;
                if (selectedControl == Count)
                    selectedControl = 0;
                if (this[selectedControl].TabStop && this[selectedControl].Enabled)
                    break;
            } while (currentControl != selectedControl);
            this[selectedControl].HasFocus = true;
        }

        public void PreviousControl()
        {
            if (Count == 0)
                return;
            int currentControl = selectedControl;
            this[selectedControl].HasFocus = false;
            do
            {
                selectedControl--;
                if (selectedControl < 0)
                    selectedControl = Count - 1;
                if (this[selectedControl].TabStop && this[selectedControl].Enabled)
                    break;
            } while (currentControl != selectedControl);
            this[selectedControl].HasFocus = true;
        }
        #endregion
    }
}


text:
import { Figure } from '../figure';
import document from './document';
import element from './element';
import attribute from './attribute';
import directive from './directive';
import expression from './expression';
import text from './text';
import comment from './comment';
import import_ from './import';
import if_ from './if';
import for_ from './for';
import unsafe from './unsafe';

const compilers = Object.assign({},
  document,
  element,
  attribute,
  directive,
  expression,
  text,
  comment,
  import_,
  if_,
  for_,
  unsafe
);

function next(parent, node, figure, options) {
  let path = {
    parent,
    node,
    figure,
    options,
    compile: (child, subfigure = figure) => next(node, child, subfigure, options)
  };

  if (node.type in compilers) {
    return compilers[node.type](path);
  } else {
    throw new Error(`Unknown node type "${node.type}".`);
  }
}

export function compile(name, ast, options, globals) {
  let figure = new Figure(name);
  figure.scope = globals;
  return next(null, ast, figure, options);
}


text:
<?php defined('BASEPATH') or exit('No direct script access allowed');

// labels
$lang['congrats']			= 'Čestitamo';
$lang['intro_text']			= 'PyroCMS je sedaj nameščen in pripravljen za delo. Prosimo prijavite se v administracijo s naslednjimi podatki.';
$lang['email']				= 'E-mail';
$lang['password']			= 'Geslo';
$lang['show_password']		= 'Pokaži geslo?';
$lang['outro_text']			= 'Za konec, izbrišite mapo installer, če jo pustite na strežniku lahko pride do vdora na vašo spletno stran.';

$lang['go_website']			= 'Pojdi na spletno stran';
$lang['go_control_panel']	= 'Pojdi v administracijo strani';


text:
{% ckan_extends %}

{%- block styles %}
    {# ciwater.css is generated by compiling the main.less file of this extension #}
    {% resource 'customization_resources/base/css/ciwater.css' %}
{% endblock %}


text:
package de.galan.verjson.serializer;

import java.io.IOException;
import java.time.ZonedDateTime;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

/**
 * Deserializes java.time.ZonedDateTime from String "yyyy-MM-dd'T'HH:mm:ss[.SSS]'Z'" back to ZonedDateTime.
 *
 * @author daniel
 */
public class ZonedDateTimeDeserializer extends JsonDeserializer<ZonedDateTime> {

	@Override
	public ZonedDateTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
		return ZonedDateTime.parse(jp.getText());
	}

}


text:
Install dev dependencies first:

`npm i -d`

To be able to run the tests you have to set up a Qlik Sense server first.

(TBD)

### Configuring your tests
(TBD)

### Run the tests

`npm test`

This will run the [Mocha](https://mochajs.org/) based tests.


text:
namespace base {
class TickClock;
}

namespace blink {
namespace scheduler {

// Now() is somewhat expensive so it makes sense not to call Now() unless we
// really need to.
class BLINK_PLATFORM_EXPORT LazyNow {
 public:
  explicit LazyNow(base::TimeTicks now) : tick_clock_(nullptr), now_(now) {
    DCHECK(!now.is_null());
  }

  explicit LazyNow(base::TickClock* tick_clock) : tick_clock_(tick_clock) {}

  base::TimeTicks Now();

 private:
  base::TickClock* tick_clock_;  // NOT OWNED
  base::TimeTicks now_;
};

}  // namespace scheduler
}  // namespace blink

#endif  // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_LAZY_NOW_H_


text:
title: Upload a Directory to GitHub.com
module: topic-02
permalink: /topic-02/git-add-directory/
categories: development
tags: directory, github, guide, upload
---

Load Time This page contains embedded interactive content. In may take 3-10 seconds to completely load.

Instead of file-by-file uploading to GitHub.com, we can do _all_ of our work locally, and upload the completed assignment directory when finished!

View Larger


text:
<TITLE>Review for Glimmer Man, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Glimmer Man, The (1996)

reviewed by
Jamie Peck

THE GLIMMER MAN

RATING: no stars (out of ****)

Warner Bros. / 1:32 / 1996 / R (violence, gore, language, Steven Seagal,
corpse nudity)
Cast: Steven Seagal; Keenan Ivory Wayans; Brian Cox; Bob Gunton; Michelle
Johnson; John Jackson; Stephen Tobolowsky
Director: John Gray
Screenplay: Kevin Brodbin

Steven Seagal's last few movies have actually bore the distinction of being
not too bad, with the exception of his 1994 botched directorial debut, "On
Deadly Ground." Both "Under Siege" movies were, I suppose, mildly amusing,
and his brief turn in last spring's "Executive Decision" was actually --
gasp! -- something of a welcome. (That could be because he was killed off so
quickly.) But whoever he's recently pleased will be unhappy now, because
"The Glimmer Man," Seagal's latest action flick, is an ugly return to form
for the star, a horrid invoking of nearly every cop movie cliche that
results in one of the dumbest films of the year.

Seagal plays Jack Cole, a governmental special operative-turned-Buddhist
homicide detective. Cole dons prayer beads and silk jackets, chants, speaks
Chinese and refuses to engage in combat unless he's goaded -- and because
people go to a Steven Seagal movie to see the him mop the floor with
assorted baddies, it's a safe bet that he will be provoked plenty of times
before "The Glimmer Man" is over.

Cole is on a case to catch the mysterious killer known as "The Family Man"
(Stephen Tobolowsky), called thus due to his penchant for murdering Catholic
households through crucifixion. He is reluctantly teamed up in his
investigation with a partner by the name of Jim Campbell (Keenan Ivory
Wayans). It's the first time Seagal is allowed a sidekick, and maybe the
last. The faux-comedic banter between the two covers cheap, juvenile
territory -- Campbell tries to mask his sad tears as he views
"Casablanca" with his new pal. He watches in amazement as Cole dispatches a
couple villains with a credit card (don't ask). And as if all this weren't
enough, Cole introduces Campbell to a Chinese allergy cure ... which turns
out to be powdered deer penis! Oh, please stop, guys! My sides are hurting,
I'm laughing so hard!

Still, however lame the buddy-buddy gags are in "The Glimmer Man," the plot
is always one step worse. What starts out in shades of "Seven" ends up
veering off in a strange direction after Cole becomes the  investigation's
prime suspect when his ex-wife falls victim to "The Family Man." All of a
sudden, the movie's about powerful political figures -- one of whom is
Cole's old boss (Brian Cox) -- who are trying to pull off a smuggled
chemical weapons deal involving the Russian mob. This, of course, after a
ludicrous scene where Seagal claims a nude female corpse on an autopsy table
is from said country -- and then cuts open her breast and pulls out the
implant to prove so.

By the way, this movie is called "The Glimmer Man" because Seagal's
character is allegedly so skilled at sudden death that you only catch a
"glimmer" of him before he kills you. Of course, I'm praying the title takes
on a double meaning, as "The Glimmer Man" should hopefully run through
theaters faster than diahrea.

© 1996 Jamie Peck
E-mail: jpeck1@gl.umbc.edu
Visit the Reel Deal Online: http://www.gl.umbc.edu/~jpeck1/

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews