text:
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 * Copyright (C) 1998 by the FundsXpress, INC.
 *
 * All rights reserved.
 *
 * Export of this software from the United States of America may require
 * a specific license from the United States Government.  It is the
 * responsibility of any person or organization contemplating export to
 * obtain such a license before exporting.
 *
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
 * distribute this software and its documentation for any purpose and
 * without fee is hereby granted, provided that the above copyright
 * notice appear in all copies and that both that copyright notice and
 * this permission notice appear in supporting documentation, and that
 * the name of FundsXpress. not be used in advertising or publicity pertaining
 * to distribution of the software without specific, written prior
 * permission.  FundsXpress makes no representations about the suitability of
 * this software for any purpose.  It is provided "as is" without express
 * or implied warranty.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "crypto_int.h"

/*
 * The following functions were removed from the API in krb5 1.3 but
 * still need to be exported for ABI compatibility.  The other
 * functions defined in this file are still in the API (and thus
 * prototyped in krb5.hin) but are deprecated.
 */
krb5_boolean KRB5_CALLCONV valid_enctype(krb5_enctype ktype);
krb5_boolean KRB5_CALLCONV valid_cksumtype(krb5_cksumtype ctype);
krb5_boolean KRB5_CALLCONV is_coll_proof_cksum(krb5_cksumtype ctype);
krb5_boolean KRB5_CALLCONV is_keyed_cksum(krb5_cksumtype ctype);
krb5_error_code KRB5_CALLCONV krb5_random_confounder(size_t, krb5_pointer);
krb5_error_code krb5_encrypt_data(krb5_context context, krb5_keyblock *key,
                                  krb5_pointer ivec, krb5_data *data,
                                  krb5_enc_data *enc_data);
krb5_error_code krb5_decrypt_data(krb5_context context, krb5_keyblock *key,
                                  krb5_pointer ivec, krb5_enc_data *data,
                                  krb5_data *enc_data);

krb5_error_code KRB5_CALLCONV
krb5_encrypt(krb5_context context, krb5_const_pointer inptr,
             krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock,
             krb5_pointer ivec)
{
    krb5_data inputd, ivecd;
    krb5_enc_data outputd;
    size_t blocksize, outlen;
    krb5_error_code ret;

    if (ivec) {
        ret = krb5_c_block_size(context, eblock->key->enctype, &blocksize);
        if (ret)
            return ret;

        ivecd = make_data(ivec, blocksize);
    }

    /* size is the length of the input cleartext data. */
    inputd = make_data((void *) inptr, size);

    /*
     * The size of the output buffer isn't part of the old api.  Not too
     * safe.  So, we assume here that it's big enough.
     */
    ret = krb5_c_encrypt_length(context, eblock->key->enctype, size, &outlen);
    if (ret)
        return ret;

    outputd.ciphertext = make_data(outptr, outlen);

    return krb5_c_encrypt(context, eblock->key, 0, ivec ? &ivecd : 0,
                          &inputd, &outputd);
}

krb5_error_code KRB5_CALLCONV
krb5_decrypt(krb5_context context, krb5_const_pointer inptr,
             krb5_pointer outptr, size_t size, krb5_encrypt_block *eblock,
             krb5_pointer ivec)
{
    krb5_enc_data inputd;
    krb5_data outputd, ivecd;
    size_t blocksize;
    krb5_error_code ret;

    if (ivec) {
        ret = krb5_c_block_size(context, eblock->key->enctype, &blocksize);
        if (ret)
            return ret;

        ivecd = make_data(ivec, blocksize);
    }

    /* size is the length of the input ciphertext data */
    inputd.enctype = eblock->key->enctype;
    inputd.ciphertext = make_data((void *) inptr, size);

    /* we don't really know how big this is, but the code tends to assume
       that the output buffer size should be the same as the input
       buffer size */
    outputd = make_data(outptr, size);

    return krb5_c_decrypt(context, eblock->key, 0, ivec ? &ivecd : 0,
                          &inputd, &outputd);
}

krb5_error_code KRB5_CALLCONV
krb5_process_key(krb5_context context, krb5_encrypt_block *eblock,
                 const krb5_keyblock *key)
{
    eblock->key = (krb5_keyblock *) key;

    return 0;
}

krb5_error_code KRB5_CALLCONV
krb5_finish_key(krb5_context context, krb5_encrypt_block *eblock)
{
    return 0;
}

krb5_error_code KRB5_CALLCONV
krb5_string_to_key(krb5_context context, const krb5_encrypt_block *eblock,
                   krb5_keyblock *keyblock, const krb5_data *data,
                   const krb5_data *salt)
{
    return krb5_c_string_to_key(context, eblock->crypto_entry, data, salt,
                                keyblock);
}

krb5_error_code KRB5_CALLCONV
krb5_init_random_key(krb5_context context, const krb5_encrypt_block *eblock,
                     const krb5_keyblock *keyblock, krb5_pointer *ptr)
{
    krb5_data data = make_data(keyblock->contents, keyblock->length);

    return krb5_c_random_seed(context, &data);
}

krb5_error_code KRB5_CALLCONV
krb5_finish_random_key(krb5_context context, const krb5_encrypt_block *eblock,
                       krb5_pointer *ptr)
{
    return 0;
}

krb5_error_code KRB5_CALLCONV
krb5_random_key(krb5_context context, const krb5_encrypt_block *eblock,
                krb5_pointer ptr, krb5_keyblock **keyblock)
{
    krb5_keyblock *key;
    krb5_error_code ret;

    *keyblock = NULL;

    key = malloc(sizeof(krb5_keyblock));
    if (key == NULL)
        return ENOMEM;

    ret = krb5_c_make_random_key(context, eblock->crypto_entry, key);
    if (ret) {
        free(key);
        return ret;
    }

    *keyblock = key;
    return(ret);
}

krb5_enctype KRB5_CALLCONV
krb5_eblock_enctype(krb5_context context, const krb5_encrypt_block *eblock)
{
    return eblock->crypto_entry;
}

krb5_error_code KRB5_CALLCONV
krb5_use_enctype(krb5_context context, krb5_encrypt_block *eblock,
                 krb5_enctype enctype)
{
    eblock->crypto_entry = enctype;

    return 0;
}

size_t KRB5_CALLCONV
krb5_encrypt_size(size_t length, krb5_enctype crypto)
{
    size_t ret;

    if (krb5_c_encrypt_length(NULL, crypto, length, &ret))
        return (size_t) -1; /* XXX */

    return ret;
}

size_t KRB5_CALLCONV
krb5_checksum_size(krb5_context context, krb5_cksumtype ctype)
{
    size_t ret;

    if (krb5_c_checksum_length(context, ctype, &ret))
        return (size_t) -1; /* XXX */

    return ret;
}

/* Guess the enctype for an untyped key used with checksum type ctype. */
static krb5_enctype
guess_enctype(krb5_cksumtype ctype)
{
    const struct krb5_cksumtypes *ctp;
    int i;

    if (ctype == CKSUMTYPE_HMAC_MD5_ARCFOUR)
        return ENCTYPE_ARCFOUR_HMAC;
    ctp = find_cksumtype(ctype);
    if (ctp == NULL || ctp->enc == NULL)
        return 0;
    for (i = 0; i < krb5int_enctypes_length; i++) {
        if (krb5int_enctypes_list[i].enc == ctp->enc)
            return i;
    }
    return 0;
}

krb5_error_code KRB5_CALLCONV
krb5_calculate_checksum(krb5_context context, krb5_cksumtype ctype,
                        krb5_const_pointer in, size_t in_length,
                        krb5_const_pointer seed, size_t seed_length,
                        krb5_checksum *outcksum)
{
    krb5_data input = make_data((void *) in, in_length);
    krb5_keyblock keyblock, *kptr = NULL;
    krb5_error_code ret;
    krb5_checksum cksum;

    if (seed != NULL) {
        keyblock.enctype = guess_enctype(ctype);
        keyblock.length = seed_length;
        keyblock.contents = (unsigned char *) seed;
        kptr = &keyblock;
    }

    ret = krb5_c_make_checksum(context, ctype, kptr, 0, &input, &cksum);
    if (ret)
        return ret;

    if (outcksum->length < cksum.length) {
        memset(cksum.contents, 0, cksum.length);
        free(cksum.contents);
        return KRB5_BAD_MSIZE;
    }

    outcksum->magic = cksum.magic;
    outcksum->checksum_type = cksum.checksum_type;
    memcpy(outcksum->contents, cksum.contents, cksum.length);
    outcksum->length = cksum.length;

    free(cksum.contents);

    return(0);
}

krb5_error_code KRB5_CALLCONV
krb5_verify_checksum(krb5_context context, krb5_cksumtype ctype,
                     const krb5_checksum *cksum, krb5_const_pointer in,
                     size_t in_length, krb5_const_pointer seed,
                     size_t seed_length)
{
    krb5_data input = make_data((void *) in, in_length);
    krb5_keyblock keyblock, *kptr = NULL;
    krb5_error_code ret;
    krb5_boolean valid;

    if (seed != NULL) {
        keyblock.enctype = guess_enctype(ctype);
        keyblock.length = seed_length;
        keyblock.contents = (unsigned char *) seed;
        kptr = &keyblock;
    }

    ret = krb5_c_verify_checksum(context, kptr, 0, &input, cksum, &valid);
    if (ret)
        return ret;

    if (!valid)
        return KRB5KRB_AP_ERR_BAD_INTEGRITY;

    return 0;
}

krb5_error_code KRB5_CALLCONV
krb5_random_confounder(size_t size, krb5_pointer ptr)
{
    krb5_data random_data = make_data(ptr, size);

    return krb5_c_random_make_octets(NULL, &random_data);
}

krb5_error_code krb5_encrypt_data(krb5_context context, krb5_keyblock *key,
                                  krb5_pointer ivec, krb5_data *data,
                                  krb5_enc_data *enc_data)
{
    krb5_error_code ret;
    size_t enclen, blocksize;
    krb5_data ivecd;

    ret = krb5_c_encrypt_length(context, key->enctype, data->length, &enclen);
    if (ret)
        return ret;

    if (ivec) {
        ret = krb5_c_block_size(context, key->enctype, &blocksize);
        if (ret)
            return ret;

        ivecd = make_data(ivec, blocksize);
    }

    enc_data->magic = KV5M_ENC_DATA;
    enc_data->kvno = 0;
    enc_data->enctype = key->enctype;
    ret = alloc_data(&enc_data->ciphertext, enclen);
    if (ret)
        return ret;

    ret = krb5_c_encrypt(context, key, 0, ivec ? &ivecd : 0, data, enc_data);
    if (ret)
        free(enc_data->ciphertext.data);

    return ret;
}

krb5_error_code krb5_decrypt_data(krb5_context context, krb5_keyblock *key,
                                  krb5_pointer ivec, krb5_enc_data *enc_data,
                                  krb5_data *data)
{
    krb5_error_code ret;
    krb5_data ivecd;
    size_t blocksize;

    if (ivec) {
        ret = krb5_c_block_size(context, key->enctype, &blocksize);
        if (ret)
            return ret;

        ivecd = make_data(ivec, blocksize);
    }

    ret = alloc_data(data, enc_data->ciphertext.length);
    if (ret)
        return ret;

    ret = krb5_c_decrypt(context, key, 0, ivec ? &ivecd : 0, enc_data, data);
    if (ret)
        free(data->data);

    return 0;
}

krb5_boolean KRB5_CALLCONV
valid_cksumtype(krb5_cksumtype ctype)
{
    return krb5_c_valid_cksumtype(ctype);
}

krb5_boolean KRB5_CALLCONV
is_keyed_cksum(krb5_cksumtype ctype)
{
    return krb5_c_is_keyed_cksum(ctype);
}

krb5_boolean KRB5_CALLCONV
is_coll_proof_cksum(krb5_cksumtype ctype)
{
    return krb5_c_is_coll_proof_cksum(ctype);
}

krb5_boolean KRB5_CALLCONV
valid_enctype(krb5_enctype etype)
{
    return krb5_c_valid_enctype(etype);
}


text:
//Created by: Fabian Verkuijlen
//Created on: 10/05/2016
using UnityEngine;
using System.Collections;

public class MenuMovement : MonoBehaviour {

    private Quaternion buttonRot;
    private RectTransform localRect;
    private Vector2 mousePos;
    [SerializeField]private Camera uiCamera;
    [SerializeField][Range(0.001f, 0.03f)]private float moveSpeedX = 0.01f;
    [SerializeField][Range(0.001f, 0.03f)]private float moveSpeedY = 0.01f;
    [SerializeField]private Vector2 moveRange = new Vector2(50, 50);
	/// <summary>
	/// At Awake it gets the RectTransform and sets the camera, plus sets rotation.
	/// </summary>
    protected void Awake()
    {
        localRect = this.GetComponent<RectTransform>();
        if(uiCamera == null)
        {
            uiCamera = Camera.main;
            Debug.LogWarning("Camera was not set, Setting it to Main camera");
        }
        buttonRot = localRect.localRotation;
    }
	/// <summary>
	/// Updates the Mouseposition and rotation of the elements
	/// </summary>
    protected void Update()
    {
        MouseUpdate();
        RotateElement();
    }
	/// <summary>
	/// Updates mousePosition
	/// </summary>
    private void MouseUpdate()
    {
        mousePos = Input.mousePosition;
        mousePos.x += Screen.width / 3;
        mousePos.y -= Screen.width / 2;
    }
	/// <summary>
	/// updates the rotation of the elements.
	/// </summary>
    private void RotateElement()
    {
        buttonRot = Quaternion.Euler(Mathf.Clamp((mousePos.y) * moveSpeedY, -moveRange.x, moveRange.y), Mathf.Clamp((mousePos.x)* moveSpeedX ,-moveRange.x,moveRange.y), 0);
        localRect.localRotation = buttonRot;
    }

}

redpajama_set_name: RedPajamaGithub


text:
{-# OPTIONS -fno-warn-tabs #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and
-- detab the module (please do the detabbing in a separate patch). See
--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
-- for details

module CmmCallConv (
  ParamLocation(..),
  assignArgumentsPos
) where

#include "HsVersions.h"

import CmmExpr
import SMRep
import Cmm (Convention(..))
import PprCmm ()

import Constants
import qualified Data.List as L
import StaticFlags (opt_Unregisterised)
import Outputable

-- Calculate the 'GlobalReg' or stack locations for function call
-- parameters as used by the Cmm calling convention.

data ParamLocation
  = RegisterParam GlobalReg
  | StackParam ByteOff

instance Outputable ParamLocation where
  ppr (RegisterParam g) = ppr g
  ppr (StackParam p)    = ppr p

-- | JD: For the new stack story, I want arguments passed on the stack to manifest as
-- positive offsets in a CallArea, not negative offsets from the stack pointer.
-- Also, I want byte offsets, not word offsets.
assignArgumentsPos :: Convention -> (a -> CmmType) -> [a] ->
                      [(a, ParamLocation)]
-- Given a list of arguments, and a function that tells their types,
-- return a list showing where each argument is passed
assignArgumentsPos conv arg_ty reps = assignments
    where -- The calling conventions (CgCallConv.hs) are complicated, to say the least
      regs = case (reps, conv) of
               (_,   NativeNodeCall)   -> getRegsWithNode
               (_,   NativeDirectCall) -> getRegsWithoutNode
               ([_], NativeReturn)     -> allRegs
               (_,   NativeReturn)     -> getRegsWithNode
               -- GC calling convention *must* put values in registers
               (_,   GC)               -> allRegs
               (_,   PrimOpCall)       -> allRegs
               ([_], PrimOpReturn)     -> allRegs
               (_,   PrimOpReturn)     -> getRegsWithNode
               (_,   Slow)             -> noRegs
               _ -> pprPanic "Unknown calling convention" (ppr conv)
      -- The calling conventions first assign arguments to registers,
      -- then switch to the stack when we first run out of registers
      -- (even if there are still available registers for args of a different type).
      -- When returning an unboxed tuple, we also separate the stack
      -- arguments by pointerhood.
      (reg_assts, stk_args) = assign_regs [] reps regs
      stk_args' = case conv of NativeReturn -> part
                               PrimOpReturn -> part
                               GC | length stk_args /= 0 -> panic "Failed to allocate registers for GC call"
                               _            -> stk_args
                  where part = uncurry (++)
                                       (L.partition (not . isGcPtrType . arg_ty) stk_args)
      stk_assts = assign_stk 0 [] (reverse stk_args')
      assignments = reg_assts ++ stk_assts

      assign_regs assts []     _    = (assts, [])
      assign_regs assts (r:rs) regs = if isFloatType ty then float else int
        where float = case (w, regs) of
                        (W32, (vs, f:fs, ds, ls)) -> k (RegisterParam f, (vs, fs, ds, ls))
                        (W64, (vs, fs, d:ds, ls)) -> k (RegisterParam d, (vs, fs, ds, ls))
                        (W80, _) -> panic "F80 unsupported register type"
                        _ -> (assts, (r:rs))
              int = case (w, regs) of
                      (W128, _) -> panic "W128 unsupported register type"
                      (_, (v:vs, fs, ds, ls)) | widthInBits w <= widthInBits wordWidth
                          -> k (RegisterParam (v gcp), (vs, fs, ds, ls))
                      (_, (vs, fs, ds, l:ls)) | widthInBits w > widthInBits wordWidth
                          -> k (RegisterParam l, (vs, fs, ds, ls))
                      _   -> (assts, (r:rs))
              k (asst, regs') = assign_regs ((r, asst) : assts) rs regs'
              ty = arg_ty r
              w  = typeWidth ty
              gcp | isGcPtrType ty = VGcPtr
                  | otherwise  	   = VNonGcPtr

      assign_stk _      assts [] = assts
      assign_stk offset assts (r:rs) = assign_stk off' ((r, StackParam off') : assts) rs
        where w    = typeWidth (arg_ty r)
              size = (((widthInBytes w - 1) `div` wORD_SIZE) + 1) * wORD_SIZE
              off' = offset + size

-----------------------------------------------------------------------------
-- Local information about the registers available

type AvailRegs = ( [VGcPtr -> GlobalReg]   -- available vanilla regs.
                 , [GlobalReg]   -- floats
                 , [GlobalReg]   -- doubles
                 , [GlobalReg]   -- longs (int64 and word64)
                 )

-- Vanilla registers can contain pointers, Ints, Chars.
-- Floats and doubles have separate register supplies.
--
-- We take these register supplies from the *real* registers, i.e. those
-- that are guaranteed to map to machine registers.

vanillaRegNos, floatRegNos, doubleRegNos, longRegNos :: [Int]
vanillaRegNos | opt_Unregisterised = []
              | otherwise          = regList mAX_Real_Vanilla_REG
floatRegNos	  | opt_Unregisterised = []
              | otherwise          = regList mAX_Real_Float_REG
doubleRegNos  | opt_Unregisterised = []
              | otherwise          = regList mAX_Real_Double_REG
longRegNos	  | opt_Unregisterised = []
              | otherwise          = regList mAX_Real_Long_REG

--
getRegsWithoutNode, getRegsWithNode :: AvailRegs
getRegsWithoutNode =
  (filter (\r -> r VGcPtr /= node) intRegs,
   map FloatReg  floatRegNos, map DoubleReg doubleRegNos, map LongReg longRegNos)
    where intRegs = map VanillaReg vanillaRegNos
getRegsWithNode =
  (intRegs, map FloatReg  floatRegNos, map DoubleReg doubleRegNos, map LongReg longRegNos)
    where intRegs = map VanillaReg vanillaRegNos

allVanillaRegNos, allFloatRegNos, allDoubleRegNos, allLongRegNos :: [Int]
allVanillaRegNos = regList mAX_Vanilla_REG
allFloatRegNos	 = regList mAX_Float_REG
allDoubleRegNos	 = regList mAX_Double_REG
allLongRegNos	   = regList mAX_Long_REG

regList :: Int -> [Int]
regList n = [1 .. n]

allRegs :: AvailRegs
allRegs = (map VanillaReg allVanillaRegNos, map FloatReg allFloatRegNos,
           map DoubleReg  allDoubleRegNos,  map LongReg  allLongRegNos)

noRegs :: AvailRegs
noRegs    = ([], [], [], [])


text:
using Language.Tests;

using Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;

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

using Xunit;

namespace Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Tests
{
    public class SentimentTests : BaseTests
    {
        [Fact]
        public async Task Sentiment()
        {
            using (MockContext context = MockContext.Start(this.GetType().FullName))
            {
                HttpMockServer.Initialize(this.GetType().FullName, "Sentiment");
                ITextAnalyticsAPI client = GetClient(HttpMockServer.CreateInstance());
                SentimentBatchResult result = await client.SentimentAsync(
                    new MultiLanguageBatchInput(
                        new List<MultiLanguageInput>()
                        {
                            new MultiLanguageInput()
                            {
                                Id ="id",
                                Text ="I love my team mates",
                                Language ="en"
                            }
                        }));

                Assert.True(result.Documents[0].Score > 0);
            }
        }
    }
}


text:
from haystack.views import FacetedSearchView
from django import forms
from haystack.forms import SearchForm
from django.core.exceptions import ValidationError
import logging

logger = logging.getLogger(__name__)

from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.forms import CheckboxInput
from django.utils.safestring import mark_safe
from django.views.generic import TemplateView
from common.models import SiteConfiguration

class ExpandableCheckboxSelectMultiple(forms.CheckboxSelectMultiple):
    def render(self, name, value, attrs=None, choices=(), num_before_fold=5):
        if value is None:
            value = []
        has_id = attrs and 'id' in attrs
        final_attrs = self.build_attrs(attrs, name=name)
        output = [u'
']
        # Normalize to strings
        str_values = set([force_unicode(v) for v in value])

        choices = self.choices + list(choices)

        selected_choices = [choice for choice in choices if choice[0] in str_values]
        choices = [choice for choice in choices if choice[0] not in str_values]

        for i, (option_value, option_label) in enumerate(selected_choices):
            self.render_checkbox(output, has_id, final_attrs,
                attrs, i, str_values, option_value, name, option_label)

        for i, (option_value, option_label) in enumerate(choices[:num_before_fold], start=len(selected_choices)):
            self.render_checkbox(output, has_id, final_attrs,
                attrs, i, str_values, option_value, name, option_label)

        output.append(u'
')

        if choices[num_before_fold:]:
            output.append(u'
')

            for i, (option_value, option_label) in enumerate(choices[num_before_fold:], start=(len(selected_choices) + num_before_fold)):
                self.render_checkbox(output, has_id, final_attrs,
                    attrs, i, str_values, option_value, name, option_label)
            output.append(u'
')

            output.append(u'more...')

        return mark_safe(u'\n'.join(output))

    def render_checkbox(self, output, has_id, final_attrs, attrs, i, str_values, option_value, name, option_label):
        # If an ID attribute was given, add a numeric index as a suffix,
        # so that the checkboxes don't all have the same ID attribute.
        if has_id:
            final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))
            label_for = u' for="%s"' % final_attrs['id']
        else:
            label_for = ''

        cb = CheckboxInput(final_attrs, check_test=lambda value: value in str_values)
        option_value = force_unicode(option_value)
        rendered_cb = cb.render(name, option_value)
        option_label = conditional_escape(force_unicode(option_label))
        output.append(u'
%s %s
' % (label_for, rendered_cb, option_label))

class UnvalidatedMultipleChoiceField(forms.MultipleChoiceField):
    widget = ExpandableCheckboxSelectMultiple

    def validate(self, value):
        """
        Validates that the input is a list or tuple.
        """
        if self.required and not value:
            raise ValidationError(self.error_messages['required'])

class CatalogueSearchForm(SearchForm):
    category = UnvalidatedMultipleChoiceField(required=False)
    global_region = UnvalidatedMultipleChoiceField(required=False)
    country = UnvalidatedMultipleChoiceField(required=False)
    item_name = UnvalidatedMultipleChoiceField(required=False)
    person = forms.CharField(required=False)
    has_images = forms.BooleanField(required=False, label="Only return results with an associated image")

    # def __init__(self, *args, **kwargs):
    #     self.item_names = kwargs.pop("item_names", [])

    #     super(CatalogueSearchForm, self).__init__(*args, **kwargs)

class PersistentSearchView(FacetedSearchView):
    __name__ = "PersistentSearchView"

    def extra_context(self):
        """
        Save results to session
        """
        extra = super(PersistentSearchView, self).extra_context()

        if self.form.is_valid():
            self.request.session['search_query'] = self.form.cleaned_data
            self.request.session['search_facets'] = self.form.selected_facets
        if self.results:
            # Access the first result to prevent ZeroDivisionError
            self.results[0]
        self.request.session['search_results'] = self.results
        self.request.session['search_results_per_page'] = self.results_per_page
        return extra

from django.core.paginator import Paginator, InvalidPage
from haystack.query import EmptySearchQuerySet
from django.conf import settings
from django.shortcuts import render
from django.http import Http404
from haystack.query import SearchQuerySet

RESULTS_PER_PAGE = getattr(settings, 'HAYSTACK_SEARCH_RESULTS_PER_PAGE', 21)

def catalogue_search(request, template='search/search.html', load_all=True,
    form_class=CatalogueSearchForm, searchqueryset=None, extra_context=None,
    results_per_page=None):
    """
    A more traditional view that also demonstrate an alternative
    way to use Haystack.

    Useful as an example of for basing heavily custom views off of.

    Also has the benefit of thread-safety, which the ``SearchView`` class may
    not be.

    Template:: ``search/search.html``
    Context::
        * form
          An instance of the ``form_class``. (default: ``ModelSearchForm``)
        * page
          The current page of search results.
        * paginator
          A paginator instance for the results.
        * query
          The query received by the form.
    """
    query = ''
    results = EmptySearchQuerySet()
    results_per_page = results_per_page or RESULTS_PER_PAGE

    if request.GET.get('q'):
        form = form_class(request.GET, searchqueryset=searchqueryset, load_all=load_all)

        if form.is_valid():
            query = form.cleaned_data['q']
            results = form.search()
    else:
        form = form_class(searchqueryset=searchqueryset, load_all=load_all)

    results = results.facet('categories').facet('country').facet('has_images').facet('global_region').facet('item_name')

    if form.is_valid():
        results = filter_with_facet(form, results, 'item_name', 'item_name')
        results = filter_with_facet(form, results, 'category', 'categories')
        results = filter_with_facet(form, results, 'global_region', 'global_region')
        results = filter_with_facet(form, results, 'country', 'country')

        if form.cleaned_data['person']:
            sqs = SearchQuerySet()
            for p in form.cleaned_data['person'].split():
                term = sqs.query.clean(p)
                results = results.narrow(u'people:"%s"' % term)

        if form.cleaned_data['has_images'] == True:
            results = results.narrow(u'has_images_exact:true')

    facets = results.facet_counts()

    if facets:
        # Prepare the form with all the available facets
        load_facets_into_form(form, facets, 'item_name', 'item_name')
        load_facets_into_form(form, facets, 'category', 'categories')
        load_facets_into_form(form, facets, 'global_region', 'global_region')
        load_facets_into_form(form, facets, 'country', 'country')

        # Append count of images into form
        appended_count = False
        for name, val in facets['fields']['has_images']:
            if name == 'true':
                form.fields['has_images'].label += ' (%s)' % val
                appended_count = True
        if not appended_count:
            form.fields['has_images'].label += ' (0)'

    results = results.order_by('registration_number')

    paginator = Paginator(results, results_per_page)

    try:
        page = paginator.page(int(request.GET.get('page', 1)))
    except InvalidPage:
        raise Http404("No such page of results!")

    context = {
        'form': form,
        'page': page,
        'paginator': paginator,
        'query': query,
        'suggestion': None,
        'facets': facets,
    }

    # Store query for paging through results on item detail page
    if form.is_valid():
        request.session['search_query'] = form.cleaned_data
    # Access the first result to prevent ZeroDivisionError
    if results:
        results[0]
    request.session['search_results'] = results
    request.session['search_results_per_page'] = results_per_page

    if getattr(settings, 'HAYSTACK_INCLUDE_SPELLING', False):
        context['suggestion'] = form.get_suggestion()

    if extra_context:
        context.update(extra_context)

    return render(request, template, context)

def filter_with_facet(form, results, form_field_name, facet_name):
    if form.cleaned_data[form_field_name]:
        ins = None
        for itn in form.cleaned_data[form_field_name]:
            if ins:
                ins += u' AND '
            else:
                ins = u''
            ins += u'"%s"' % results.query.clean(itn)

        results = results.narrow(facet_name + u'_exact:%s' % ins)

    return results

def load_facets_into_form(form, facets, form_field_name, facet_name):
    if 'fields' in facets and facet_name in facets['fields']:
        form.fields[form_field_name].choices = [
            (facet[0], "%s (%s)" % (facet[0], facet[1]))
                for facet in facets['fields'][facet_name]]

class HomepageView(TemplateView):
    template_name = "index.html"

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super(HomepageView, self).get_context_data(**kwargs)

        # Add to the context
        results = SiteConfiguration.objects.all()

        if len(results) > 0:
            site_config = results[0]

            context['site_config'] = site_config
            context['new_acquisition'] = site_config.new_acquisition
            context['new_acquisition_text'] = site_config.new_acquisition_text
            context['new_acquisition_image'] = site_config.new_acquisition_image

        return context


text:
//
//  eventstructor.h
//  v8
//
//  Created by jie on 13-9-10.
//  Copyright (c) 2013年 jie. All rights reserved.
//

#ifndef __v8__eventstructor__
#define __v8__eventstructor__

#include "../core/ClassBase.h"

class DataRange;

class RingBuffer {
public:
    /**
     * @param stride element size in bytes
     * @param count element count
     */
    RingBuffer(int stride, int count);
    virtual ~RingBuffer();
    virtual void read(char* dest, int index);
    virtual void write(char* src, int index);

    virtual DataRange* startRead();
    virtual DataRange* startWrite();
    virtual void endRange(DataRange* range);
    /**
     * reset all bytes, make it maxmum writable
     */
    virtual void clear();
    char* value_ptr(int index);
    int stride();

private:
    int mRead;
    int mWrite;
    int mCount;
    int mStride;
    char* mBuffer;

    DataRange* mReadRange;
    DataRange* mWriteRange;
};

/**
 * hold a tempary read/write range
 */
class DataRange {
public:
    DataRange(RingBuffer* eStruct, char type);
    virtual ~DataRange();

    int mStart;
    int mEnd;
    char mType;
    RingBuffer* mStructor;
    virtual void clear();

    template <typename T>
    T* value_ptr() {
        if(mStart == mEnd) {
            return 0;
        }
        return (T*)(mStructor->value_ptr(mStart));
    }

    virtual bool isEmpty();
    /**
     * init range
     */
    virtual void start(int start, int end);
    /**
     * read a structor unit and return structors remain
     */
    virtual int readOne(char* dest);
    /**
     * write a structor unit and return empty slot remain
     */
    virtual int writeOne(char* dest);
    /**
     * @param dest dest byte pointer
     * @param length max byte avaiable in dest
     * return element readed
     */
    virtual int read(char* dest, int length);
    virtual int write(char* dest, int length);
    /**
     * finish read and tell the underlying EventStructor how much data was readed or written
     */
    virtual void end();
    /**
     * increase the cursor
     * return avaiable slot remain
     */
    virtual int next();
    virtual int remain();
};

#endif /* defined(__v8__eventstructor__) */


text:
package com.learn.mytodo.util;

/**
 * Created by dongjiangpeng on 2017/2/20 0020.
 */

public interface BasePresenter {
}


text:
fulfillment-client
==================

Client for Fulfillment


text:
<?php
/**
 * Date: 2016/4/5
 */

namespace DesignPatterns\Behavioral\Specification;

class Item
{
    protected $price;

    public function __construct($price)
    {
        $this->price = $price;
    }

    public function getPrice()
    {
        return $this->price;
    }
}


text:
layout: page
title: Janet Mccormick's 32nd Birthday
date: 2016-05-24
author: Austin Foster
tags: weekly links, java
status: published
summary: In a elit lobortis nibh ultricies congue.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 01/31/2017
  endDate: 02/05/2017
  ctyhocn: HSVCLHX
  groupCode: JM3B
published: true
---
Maecenas ornare tincidunt dolor. Donec nec ultrices dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean eros felis, aliquam sed libero id, viverra vulputate ex. Cras ut rutrum ante. Sed in purus vel quam mattis scelerisque. Suspendisse potenti. Proin elementum ex nec scelerisque varius. Aliquam erat volutpat.

* Ut nec eros tincidunt leo iaculis eleifend at eget magna
* Proin aliquam diam eu convallis scelerisque.

Donec vel ipsum tincidunt, vehicula nisl eget, egestas arcu. Suspendisse tincidunt fringilla eros eu venenatis. Quisque suscipit, nunc nec aliquet pulvinar, orci est accumsan sapien, quis luctus est diam ac nulla. Integer pretium dignissim dolor et fermentum. Quisque scelerisque sem sit amet fringilla fringilla. Mauris et felis eget metus feugiat aliquam. Vestibulum dui risus, sollicitudin non dolor eget, dictum interdum eros.


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.impl.test;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Callable;

import org.activiti.engine.test.ActivitiRule;
import org.flowable.engine.ManagementService;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.common.api.FlowableException;
import org.flowable.engine.impl.asyncexecutor.AsyncExecutor;

/**
 * @author Joram Barrez
 * @author Tijs Rademakers
 * @author Saeid Mirzaei
 */

// This helper class helps sharing the same code for jobExecutor test helpers, between Junit3 and junit 4 test support classes
public class JobTestHelper {

    public static void waitForJobExecutorToProcessAllJobs(ActivitiRule activitiRule, long maxMillisToWait, long intervalMillis) {
        waitForJobExecutorToProcessAllJobs(activitiRule.getProcessEngine().getProcessEngineConfiguration(),
                activitiRule.getManagementService(), maxMillisToWait, intervalMillis);
    }

    public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfiguration processEngineConfiguration,
            ManagementService managementService, long maxMillisToWait, long intervalMillis) {

        waitForJobExecutorToProcessAllJobs(processEngineConfiguration, managementService, maxMillisToWait, intervalMillis, true);
    }

    public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfiguration processEngineConfiguration,
            ManagementService managementService, long maxMillisToWait, long intervalMillis, boolean shutdownExecutorWhenFinished) {

        AsyncExecutor asyncExecutor = processEngineConfiguration.getAsyncExecutor();
        asyncExecutor.start();

        try {
            Timer timer = new Timer();
            InterruptTask task = new InterruptTask(Thread.currentThread());
            timer.schedule(task, maxMillisToWait);
            boolean areJobsAvailable = true;
            try {
                while (areJobsAvailable && !task.isTimeLimitExceeded()) {
                    Thread.sleep(intervalMillis);
                    try {
                        areJobsAvailable = areJobsAvailable(managementService);
                    } catch (Throwable t) {
                        // Ignore, possible that exception occurs due to locking/updating of table on MSSQL when
                        // isolation level doesn't allow READ of the table
                    }
                }
            } catch (InterruptedException e) {
                // ignore
            } finally {
                timer.cancel();
            }
            if (areJobsAvailable) {
                throw new FlowableException("time limit of " + maxMillisToWait + " was exceeded");
            }

        } finally {
            if (shutdownExecutorWhenFinished) {
                asyncExecutor.shutdown();
            }
        }
    }

    public static void waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(ProcessEngineConfiguration processEngineConfiguration, ManagementService managementService, long maxMillisToWait, long intervalMillis) {
        waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(processEngineConfiguration, managementService, maxMillisToWait, intervalMillis, true);
    }

    public static void waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(ProcessEngineConfiguration processEngineConfiguration, ManagementService managementService, long maxMillisToWait, long intervalMillis,
            boolean shutdownExecutorWhenFinished) {

        AsyncExecutor asyncExecutor = processEngineConfiguration.getAsyncExecutor();
        asyncExecutor.start();
        processEngineConfiguration.setAsyncExecutorActivate(true);

        try {
            Timer timer = new Timer();
            InterruptTask task = new InterruptTask(Thread.currentThread());
            timer.schedule(task, maxMillisToWait);
            boolean areJobsAvailable = true;
            try {
                while (areJobsAvailable && !task.isTimeLimitExceeded()) {
                    Thread.sleep(intervalMillis);
                    try {
                        areJobsAvailable = areJobsOrExecutableTimersAvailable(managementService);
                    } catch (Throwable t) {
                        // Ignore, possible that exception occurs due to locking/updating of table on MSSQL when
                        // isolation level doesn't allow READ of the table
                    }
                }
            } catch (InterruptedException e) {
                // ignore
            } finally {
                timer.cancel();
            }
            if (areJobsAvailable) {
                throw new FlowableException("time limit of " + maxMillisToWait + " was exceeded");
            }

        } finally {
            if (shutdownExecutorWhenFinished) {
                processEngineConfiguration.setAsyncExecutorActivate(false);
                asyncExecutor.shutdown();
            }
        }
    }

    public static void waitForJobExecutorOnCondition(ActivitiRule activitiRule, long maxMillisToWait, long intervalMillis, Callable<Boolean> condition) {
        waitForJobExecutorOnCondition(activitiRule.getProcessEngine().getProcessEngineConfiguration(), maxMillisToWait, intervalMillis, condition);
    }

    public static void waitForJobExecutorOnCondition(ProcessEngineConfiguration processEngineConfiguration,
            long maxMillisToWait, long intervalMillis, Callable<Boolean> condition) {

        AsyncExecutor asyncExecutor = processEngineConfiguration.getAsyncExecutor();
        asyncExecutor.start();

        try {
            Timer timer = new Timer();
            InterruptTask task = new InterruptTask(Thread.currentThread());
            timer.schedule(task, maxMillisToWait);
            boolean conditionIsViolated = true;
            try {
                while (conditionIsViolated) {
                    Thread.sleep(intervalMillis);
                    conditionIsViolated = !condition.call();
                }
            } catch (InterruptedException e) {
                // ignore
            } catch (Exception e) {
                throw new FlowableException("Exception while waiting on condition: " + e.getMessage(), e);
            } finally {
                timer.cancel();
            }

            if (conditionIsViolated) {
                throw new FlowableException("time limit of " + maxMillisToWait + " was exceeded");
            }

        } finally {
            asyncExecutor.shutdown();
        }
    }

    public static void executeJobExecutorForTime(ActivitiRule activitiRule, long maxMillisToWait, long intervalMillis) {
        executeJobExecutorForTime(activitiRule.getProcessEngine().getProcessEngineConfiguration(), maxMillisToWait, intervalMillis);
    }

    public static void executeJobExecutorForTime(ProcessEngineConfiguration processEngineConfiguration, long maxMillisToWait, long intervalMillis) {
        AsyncExecutor asyncExecutor = processEngineConfiguration.getAsyncExecutor();
        asyncExecutor.start();

        try {
            Timer timer = new Timer();
            InterruptTask task = new InterruptTask(Thread.currentThread());
            timer.schedule(task, maxMillisToWait);
            try {
                while (!task.isTimeLimitExceeded()) {
                    Thread.sleep(intervalMillis);
                }
            } catch (InterruptedException e) {
                // ignore
            } finally {
                timer.cancel();
            }

        } finally {
            asyncExecutor.shutdown();
        }
    }

    public static boolean areJobsAvailable(ActivitiRule activitiRule) {
        return areJobsAvailable(activitiRule.getManagementService());
    }

    public static boolean areJobsAvailable(ManagementService managementService) {
        return !managementService.createJobQuery().list().isEmpty();
    }

    public static boolean areJobsAvailable(org.activiti.engine.ManagementService managementService) {
        return !managementService.createJobQuery().list().isEmpty();
    }

    public static boolean areJobsOrExecutableTimersAvailable(ManagementService managementService) {
        boolean emptyJobs = managementService.createJobQuery().list().isEmpty();
        if (emptyJobs) {
            return !managementService.createTimerJobQuery().executable().list().isEmpty();
        } else {
            return true;
        }
    }

    private static class InterruptTask extends TimerTask {

        protected boolean timeLimitExceeded;
        protected Thread thread;

        public InterruptTask(Thread thread) {
            this.thread = thread;
        }

        public boolean isTimeLimitExceeded() {
            return timeLimitExceeded;
        }

        public void run() {
            timeLimitExceeded = true;
            thread.interrupt();
        }
    }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>SpaceFinder - ITWS Group 6</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
  <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8">
  <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css">

  <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
  <link href='http://fonts.googleapis.com/css?family=Muli|Montserrat' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/grids-responsive-min.css">

	<link rel="stylesheet" href="nprogress/nprogress.css" type="text/css" charset="utf-8">

	<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css" charset="utf-8">

SpaceFinder

	        <form id="customlocationform">

					<input type="number" inputmode="numeric" pattern="[0-9]*" placeholder="Zip Code" id="customval" class="pure-u-1"/>

	        		<input type="submit" id="submit" class="pure-u-1">

	        </form>

        Status:

Basic Information

Loading Census data...

Housing Information

Average Listing Prices

Loading Trulia housing information...

Instagram

Loading Instagram...

Yelp

Best Restaurants

Loading Yelp data...

Made by Conrad Mossl, Devin Nguyen, Erin Jordan, Peter Ryder, Samuel Fok


text:
"use strict";
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
Object.defineProperty(exports, "__esModule", { value: true });
const visitor_1 = require("../visitor");
const enum_1 = require("../enum");
class JSONTypeAssembler extends visitor_1.Visitor {
    visit(node) {
        return node == null ? undefined : super.visit(node);
    }
    visitNull({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitInt({ typeId, bitWidth, isSigned }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'bitWidth': bitWidth, 'isSigned': isSigned };
    }
    visitFloat({ typeId, precision }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'precision': enum_1.Precision[precision] };
    }
    visitBinary({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitBool({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitUtf8({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitDecimal({ typeId, scale, precision }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'scale': scale, 'precision': precision };
    }
    visitDate({ typeId, unit }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'unit': enum_1.DateUnit[unit] };
    }
    visitTime({ typeId, unit, bitWidth }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'unit': enum_1.TimeUnit[unit], bitWidth };
    }
    visitTimestamp({ typeId, timezone, unit }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'unit': enum_1.TimeUnit[unit], timezone };
    }
    visitInterval({ typeId, unit }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'unit': enum_1.IntervalUnit[unit] };
    }
    visitList({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitStruct({ typeId }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase() };
    }
    visitUnion({ typeId, mode, typeIds }) {
        return {
            'name': enum_1.ArrowType[typeId].toLowerCase(),
            'mode': enum_1.UnionMode[mode],
            'typeIds': [...typeIds]
        };
    }
    visitDictionary(node) {
        return this.visit(node.dictionary);
    }
    visitFixedSizeBinary({ typeId, byteWidth }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'byteWidth': byteWidth };
    }
    visitFixedSizeList({ typeId, listSize }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'listSize': listSize };
    }
    visitMap({ typeId, keysSorted }) {
        return { 'name': enum_1.ArrowType[typeId].toLowerCase(), 'keysSorted': keysSorted };
    }
}
exports.JSONTypeAssembler = JSONTypeAssembler;

//# sourceMappingURL=jsontypeassembler.js.map


text:
namespace base {
namespace internal {

class BASE_EXPORT ThreadGroupNative : public ThreadGroup {
 public:
  ThreadGroupNative(const ThreadGroupNative&) = delete;
  ThreadGroupNative& operator=(const ThreadGroupNative&) = delete;

  // Destroying a ThreadGroupNative is not allowed in
  // production; it is always leaked. In tests, it can only be destroyed after
  // JoinForTesting() has returned.
  ~ThreadGroupNative() override;

  // Starts the thread group and allows tasks to begin running.
  void Start(WorkerEnvironment worker_environment = WorkerEnvironment::NONE);

  // ThreadGroup:
  void JoinForTesting() override;
  size_t GetMaxConcurrentNonBlockedTasksDeprecated() const override;
  void DidUpdateCanRunPolicy() override;
  void OnShutdownStarted() override;

 protected:
  ThreadGroupNative(TrackedRef<TaskTracker> task_tracker,
                    TrackedRef<Delegate> delegate,
                    ThreadGroup* predecessor_thread_group);

  // Runs a task off the next task source on the |priority_queue_|. Called by
  // callbacks posted to platform native thread pools.
  void RunNextTaskSourceImpl();

  virtual void JoinImpl() = 0;
  virtual void StartImpl() = 0;
  virtual void SubmitWork() = 0;

  // Used to control the worker environment. Supports COM MTA on Windows.
  WorkerEnvironment worker_environment_ = WorkerEnvironment::NONE;

 private:
  class ScopedCommandsExecutor;

  // ThreadGroup:
  void UpdateSortKey(TaskSource::Transaction transaction) override;
  void PushTaskSourceAndWakeUpWorkers(
      TransactionWithRegisteredTaskSource transaction_with_task_source)
      override;
  void EnsureEnoughWorkersLockRequired(BaseScopedCommandsExecutor* executor)
      override EXCLUSIVE_LOCKS_REQUIRED(lock_);

  // Updates the minimum priority allowed to run below which tasks should yield,
  // based on task sources in |priority_queue_|.
  void UpdateMinAllowedPriorityLockRequired() EXCLUSIVE_LOCKS_REQUIRED(lock_);

  // Returns the top TaskSource off the |priority_queue_|. Returns nullptr
  // if the |priority_queue_| is empty.
  RegisteredTaskSource GetWork();

  // Indicates whether the thread group has been started yet.
  bool started_ GUARDED_BY(lock_) = false;

  // Number of threadpool work submitted to the thread group which haven't
  // popped a TaskSource from the PriorityQueue yet.
  size_t num_pending_threadpool_work_ GUARDED_BY(lock_) = 0;

#if DCHECK_IS_ON()
  // Set once JoinForTesting() has returned.
  bool join_for_testing_returned_ = false;
#endif
};

}  // namespace internal
}  // namespace base

#endif  // BASE_TASK_THREAD_POOL_THREAD_GROUP_NATIVE_H_


text:
/**
 * angular-material-spec.js
 *
 * This Jasmine configuration file is used internally for testing the
 * unit test files: "\angular\material\src\**\*.spec.js"
 *
 */
(function() {

  // Patch since PhantomJS does not implement click() on HTMLElement. In some
  // cases we need to execute the native click on an element. However, jQuery's
  // $.fn.click() does not dispatch to the native function on <a> elements, so we
  // can't use it in our implementations: $el[0].click() to correctly dispatch.
  // Borrowed from https://stackoverflow.com/questions/15739263/phantomjs-click-an-element
  if (!HTMLElement.prototype.click) {
    HTMLElement.prototype.click = function() {
      var ev = document.createEvent('MouseEvent');
      ev.initMouseEvent(
          'click',
          /*bubble*/true, /*cancelable*/true,
          window, null,
          0, 0, 0, 0, /*coordinates*/
          false, false, false, false, /*modifier keys*/
          0/*button=left*/, null
      );
      this.dispatchEvent(ev);
    };
  }

  beforeEach(function() {

    /**
     * Before each test, require that the 'ngMaterial-mock' module is ready for injection
     * NOTE: assumes that angular-material-mocks.js has been loaded.
     */
    module('ngMaterial-mock')

    /**
     * Mocks angular.element#focus ONLY for the duration of a particular test.
     *
     * @example
     *
     * it('some focus test', inject(function($document)
     * {
     *   jasmine.mockElementFocus(this); // 'this' is the test instance
     *
     *   doSomething();
     *   expect($document.activeElement).toBe(someElement[0]);
     *
     * }));
     *
     */
    jasmine.mockElementFocus = function(test) {
      var focus = angular.element.prototype.focus;
      inject(function($document) {
        angular.element.prototype.focus = function() {
          $document.activeElement = this[0];
        };
      });
      // Un-mock focus after the test is done
      afterEach(function() {
        angular.element.prototype.focus = focus;
      });
    };

    /**
     * Add special matchers used in the Angular-Material specs
     *
     */
    jasmine.addMatchers({

      toHaveClass: function() {
        return {
          compare: function(actual, expected) {
            var results = { pass : true };
            var classes = expected.trim().split(/\s+/);

            for (var i=0; i<classes.length; ++i) {
              if (!angular.element(actual).hasClass(classes[i])) {
                results.pass = false;
              }
            }

            var negation = !results.pass ? "" : " not ";

            results.message = "";
            results.message += "Expected '";
            results.message += angular.mock.dump(actual);
            results.message += negation + "to have class '" + expected + "'.";

            return results;
          }
        };
      },

      /**
       * A helper to match the type of a given value
       * @example expect(1).toBeOfType('number')
       */
      toBeOfType: function(type) {
        return {
          compare: function(actual, expected) {
            var results = {
                pass : typeof actual == expected
             };

            var negation = !results.pass ? "" : " not ";

            results.message = "";
            results.message += "Expected ";
            results.message += angular.mock.dump(actual) + " of type ";
            results.message += (typeof actual);
            results.message += negation + "to have type '" + type + "'.";

            return results;
          }
        };
      },

      toHaveFields: function() {
        return {
          compare: function(actual, expected) {
            var results = { pass : true  };

            for (var key in expected) {
              if (!(actual || {}).hasOwnProperty(key) || !angular.equals(actual[key], expected[key])) {
                results.pass = false;
              }
            }

            var negation = !results.pass ? "" : " not ";

            results.message = "";
            results.message += "Expected ";
            results.message += angular.mock.dump(actual) + " of type ";
            results.message += (typeof actual);
            results.message += negation + "to have fields matching '" + angular.mock.dump(expected);

            return results;
          }
        };
      }

    });

  });

})();


text:
module NetSuite
  module Records
    class SerializedInventoryItem
      include Support::Fields
      include Support::RecordRefs
      include Support::Records
      include Support::Actions
      include Namespaces::ListAcct

      actions :get, :get_list, :add, :delete, :search, :update, :upsert

      record_refs :soft_descriptor,
        :stock_unit,
        :store_display_image,
        :store_display_thumbnail,
        :store_item_template,
        :supply_lot_sizing_method,
        :supply_replenishment_method,
        :supply_type,
        :tax_schedule,
        :units_type,
        :vendor,
        :alternate_demand_source_item,
        :asset_account,
        :bill_exch_rate_variance_acct,
        :billing_schedule,
        :bill_price_variance_acct,
        :bill_qty_variance_acct,
        :klass,
        :cogs_account,
        :cost_category,
        :custom_form,
        :deferred_revenue_account,
        :demand_source,
        :department,
        :dropship_expense_account,
        :gain_loss_account,
        :income_account,
        :interco_cogs_account,
        :interco_income_account,
        :issue_product,
        :location,
        :parent,
        :preferred_location,
        :pricing_group,
        :purchase_price_variance_acct,
        :purchase_tax_code,
        :purchase_unit,
        :quantity_pricing_schedule,
        :sales_tax_code,
        :sale_unit,
        :ship_package,
        :revenue_allocation_group,
        :revenue_recognition_rule,
        :rev_rec_schedule

      # bin_number_list	InventoryItemBinNumberList
      # custom_field_list	CustomFieldList
      # hazmat_packing_group	HazmatPackingGroup
      # invt_classification	ItemInvtClassification
      # item_carrier	ItemCarrier
      # item_number_options_list	RecordRefList
      # item_options_list	ItemOptionsList
      # item_revenue_category	RecordRef
      # item_ship_method_list	RecordRefList
      # item_vendor_list	ItemVendorList
      # locations_list	SerializedInventoryItemLocationsList
      # matrix_option_list	MatrixOptionList
      # matrix_type	ItemMatrixType
      # numbers_list	SerializedInventoryItemNumbersList
      # out_of_stock_behavior	ItemOutOfStockBehavior
      # overall_quantity_pricing_type	ItemOverallQuantityPricingType
      # periodic_lot_size_type	PeriodicLotSizeType
      # preference_criterion	ItemPreferenceCriterion
      # presentation_item_list	PresentationItemList
      # pricing_matrix	PricingMatrix
      # product_feed_list	ProductFeedList
      # accounting_book_detail_list	ItemAccountingBookDetailList

      fields :auto_lead_time,
        :auto_preferred_stock_level,
        :auto_reorder_point,
        :available_to_partners,
        :average_cost,
        :backward_consumption_days,
        :copy_description,
        :cost,
        :cost_estimate,
        :costing_method_display,
        :cost_units,
        :created_date,
        :currency,
        :default_item_ship_method,
        :default_return_cost,
        :demand_modifier,
        :demand_time_fence,
        :display_name,
        :dont_show_price,
        :enforce_min_qty_internally,
        :exclude_from_sitemap,
        :featured_description,
        :fixed_lot_size,
        :forward_consumption_days,
        :handling_cost,
        :handling_cost_units,
        :hazmat_hazard_class,
        :hazmat_id,
        :hazmat_item_units,
        :hazmat_item_units_qty,
        :hazmat_shipping_name,
        :include_children,
        :invt_count_interval,
        :is_donation_item,
        :is_drop_ship_item,
        :is_gco_compliant,
        :is_hazmat_item,
        :is_inactive,
        :is_online,
        :is_special_order_item,
        :is_taxable,
        :item_id,
        :last_invt_count_date,
        :last_modified_date,
        :last_purchase_price,
        :lead_time,
        :manufacturer,
        :manufacturer_addr1,
        :manufacturer_city,
        :manufacturer_state,
        :manufacturer_tariff,
        :manufacturer_tax_id,
        :manufacturer_zip,
        :match_bill_to_receipt,
        :max_donation_amount,
        :meta_tag_html,
        :minimum_quantity,
        :minimum_quantity_units,
        :mpn,
        :mult_manufacture_addr,
        :nex_tag_category,
        :next_invt_count_date,
        :no_price_message,
        :offer_support,
        :on_hand_value_mli,
        :on_special,
        :out_of_stock_message,
        :page_title,
        :periodic_lot_size_days,
        :preferred_stock_level,
        :preferred_stock_level_days,
        :preferred_stock_level_units,
        :prices_include_tax,
        :producer,
        :purchase_description,
        :purchase_order_amount,
        :purchase_order_quantity,
        :purchase_order_quantity_diff,
        :quantity_available,
        :quantity_back_ordered,
        :quantity_committed,
        :quantity_on_hand,
        :quantity_on_hand_units,
        :quantity_on_order,
        :quantity_reorder_units,
        :rate,
        :receipt_amount,
        :receipt_quantity,
        :receipt_quantity_diff,
        :related_items_description,
        :reorder_multiple,
        :reorder_point,
        :reorder_point_units,
        :reschedule_in_days,
        :reschedule_out_days,
        :round_up_as_component,
        :safety_stock_level,
        :safety_stock_level_days,
        :safety_stock_level_units,
        :sales_description,
        :schedule_b_code,
        :schedule_b_number,
        :schedule_b_quantity,
        :search_keywords,
        :seasonal_demand,
        :serial_numbers,
        :ship_individually,
        :shipping_cost,
        :shipping_cost_units,
        :shopping_dot_com_category,
        :shopzilla_category_id,
        :show_default_donation_amount,
        :specials_description,
        :stock_description,
        :store_description,
        :store_detailed_description,
        :store_display_name,
        :supply_time_fence,
        :total_value,
        :track_landed_cost,
        :transfer_price,
        :upc_code,
        :url_component,
        :use_bins,
        :use_marginal_rates,
        :vendor_name,
        :vsoe_delivered,
        :vsoe_price,
        :weight,
        :weight_units

      # cost_estimate_type	ItemCostEstimateType
      # costing_method	ItemCostingMethod
      # country_of_manufacture	Country
      # create_revenue_plans_on	ItemCreateRevenuePlansOn
      # site_category_list	SiteCategoryList
      # sitemap_priority	SitemapPriority
      # subsidiary_list	RecordRefList
      # translations_list	TranslationList
      # vsoe_deferral	VsoeDeferral
      # vsoe_permit_discount	VsoePermitDiscount
      # vsoe_sop_group	VsoeSopGroup
      # weight_unit	ItemWeightUnit

      field :custom_field_list, CustomFieldList
      field :locations_list, LocationsList
      field :subsidiary_list, RecordRefList

      # TODO from standard copied item record; may need to be deleted
      # field :pricing_matrix, PricingMatrix
      # field :bin_number_list, BinNumberList
      # field :item_vendor_list, ItemVendorList
      # field :matrix_option_list, MatrixOptionList

      attr_reader :internal_id
      attr_accessor :external_id

      def initialize(attributes = {})
        @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
        @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
        initialize_from_attributes_hash(attributes)
      end

      def self.search_class_name
        "Item"
      end
    end
  end
end


text:
<title>Zend Gdata API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/jquery-ui.css" type="text/css"></link><link rel="stylesheet" href="css/docblox/jquery-ui-1.8.16.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link>

API Documentation

Zend/Gdata/Exif/Extension/Tags.php

              Show:
              inherited

                          Classes

\Zend_Gdata_Exif_Extension_Tags

              Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.

Category

Zend

Copyright

Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)

License

New BSD License

Package

Zend_Gdata

Subpackage

Exif

Version

$Id: Tags.php 24593 2012-01-05 20:35:02Z matthew $

\Zend_Gdata_Exif_Extension_Tags
jump to top

Package: Zend\Gdata\Exif
Represents the exif:tags element used by the Gdata Exif extensions.

Parent(s)

\Zend_Gdata_Extension
            <
            \Zend_Gdata_App_Extension
            <
            \Zend_Gdata_App_Base

Category

Zend

Copyright

Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)

License

New BSD License

Properties

\Zend_Gdata_Exif_Extension_Distance
                 $_distance= 'null'

exif:distance value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Distance

\Zend_Gdata_Exif_Extension_Exposure
                 $_exposure= 'null'

exif:exposure value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Exposure

\Zend_Gdata_Exif_Extension_FStop
                 $_fStop= 'null'

exif:fStop value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_FStop

\Zend_Gdata_Exif_Extension_Flash
                 $_flash= 'null'

exif:flash value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Flash

\Zend_Gdata_Exif_Extension_FocalLength
                 $_focalLength= 'null'

exif:focalLength value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_FocalLength

\Zend_Gdata_Exif_Extension_ImageUniqueId
                 $_imageUniqueId= 'null'

exif:imageUniqueID value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_ImageUniqueId

\Zend_Gdata_Exif_Extension_Iso
                 $_iso= 'null'

exif:iso value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Iso

\Zend_Gdata_Exif_Extension_Make
                 $_make= 'null'

exif:make value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Make

\Zend_Gdata_Exif_Extension_Model
                 $_model= 'null'

exif:model value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Model

                 $_rootElement= ''tags''

Default value'tags'Details

Type

                 $_rootNamespace= ''exif''

Default value'exif'Details

Type

\Zend_Gdata_Exif_Extension_Time
                 $_time= 'null'

exif:time value

Default valuenullDetails

Type

\Zend_Gdata_Exif_Extension_Time

Methods

__construct(
          \Zend_Gdata_Exif_Extension_Distance $distance
              =
              null, \Zend_Gdata_Exif_Extension_Exposure $exposure
              =
              null, \Zend_Gdata_Exif_Extension_Flash $flash
              =
              null, \Zend_Gdata_Exif_Extension_FocalLength$focalLength $focalLength
              =
              null, \Zend_Gdata_Exif_Extension_FStop $fStop
              =
              null, \Zend_Gdata_Exif_Extension_ImageUniqueId $imageUniqueId
              =
              null, \Zend_Gdata_Exif_Extension_Iso $iso
              =
              null, \Zend_Gdata_Exif_Extension_Make $make
              =
              null, \Zend_Gdata_Exif_Extension_Model $model
              =
              null, \Zend_Gdata_Exif_Extension_Time $time
              =
              null
          )

        :
          void

Constructs a new Zend_Gdata_Exif_Extension_Tags object.

Parameters

Name
Type
Description

$distance
\Zend_Gdata_Exif_Extension_Distance

(optional) The exif:distance value to be set in the constructed object.

$exposure
\Zend_Gdata_Exif_Extension_Exposure

(optional) The exif:exposure value to be set in the constructed object.

$flash
\Zend_Gdata_Exif_Extension_Flash

(optional) The exif:flash value to be set in the constructed object.

$focalLength
\Zend_Gdata_Exif_Extension_FocalLength$focalLength

(optional) The exif:focallength value to be set in the constructed object.

$fStop
\Zend_Gdata_Exif_Extension_FStop

(optional) The exif:fstop value to be set in the constructed object.

$imageUniqueId
\Zend_Gdata_Exif_Extension_ImageUniqueId

(optional) The exif:imageUniqueID value to be set in the constructed object.

$iso
\Zend_Gdata_Exif_Extension_Iso

(optional) The exif:iso value to be set in the constructed object.

$make
\Zend_Gdata_Exif_Extension_Make

(optional) The exif:make value to be set in the constructed object.

$model
\Zend_Gdata_Exif_Extension_Model

(optional) The exif:model value to be set in the constructed object.

$time
\Zend_Gdata_Exif_Extension_Time

(optional) The exif:time value to be set in the constructed object.

getDOM(
          \DOMDocument $doc
              =
              null,  $majorVersion
              =
              1,  $minorVersion
              =
              null
          )

        :
          \DOMElement

Retrieves a DOMElement which corresponds to this element and all
child properties.  This is used to build an entry back into a DOM
and eventually XML text for application storage/persistence.

Parameters

Name
Type
Description

$doc
\DOMDocument

The DOMDocument used to construct DOMElements

$majorVersion

$minorVersion

Returns

Type
Description

\DOMElement
The DOMElement representing this element and all child properties.

getDistance(

          )

        :
          \Zend_Gdata_Exif_Extension_Distance

Get the value for this element's distance attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Distance
The requested attribute.

Details

See

\setDistance

getExposure(

          )

        :
          \Zend_Gdata_Exif_Extension_Exposure

Get the value for this element's exposure attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Exposure
The requested attribute.

Details

See

\setExposure

getFStop(

          )

        :
          \Zend_Gdata_Exif_Extension_FStop

Get the value for this element's fStop attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_FStop
The requested attribute.

Details

See

\setFStop

getFlash(

          )

        :
          \Zend_Gdata_Exif_Extension_Flash

Get the value for this element's flash attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Flash
The requested attribute.

Details

See

\setFlash

getFocalLength(

          )

        :
          \Zend_Gdata_Exif_Extension_FocalLength

Get the value for this element's name attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_FocalLength
The requested attribute.

Details

See

\setFocalLength

getImageUniqueId(

          )

        :
          \Zend_Gdata_Exif_Extension_ImageUniqueId

Get the value for this element's imageUniqueId attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_ImageUniqueId
The requested attribute.

Details

See

\setImageUniqueId

getIso(

          )

        :
          \Zend_Gdata_Exif_Extension_Iso

Get the value for this element's iso attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Iso
The requested attribute.

Details

See

\setIso

getMake(

          )

        :
          \Zend_Gdata_Exif_Extension_Make

Get the value for this element's make attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Make
The requested attribute.

Details

See

\setMake

getModel(

          )

        :
          \Zend_Gdata_Exif_Extension_Model

Get the value for this element's model attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Model
The requested attribute.

Details

See

\setModel

getTime(

          )

        :
          \Zend_Gdata_Exif_Extension_Time

Get the value for this element's time attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Time
The requested attribute.

Details

See

\setTime

setDistance(
          \Zend_Gdata_Exif_Extension_Distance $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's distance attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Distance

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setExposure(
          \Zend_Gdata_Exif_Extension_Exposure $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's exposure attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Exposure

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setFStop(
          \Zend_Gdata_Exif_Extension_FStop $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's fStop attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_FStop

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setFlash(
          \Zend_Gdata_Exif_Extension_Flash $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's flash attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Flash

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setFocalLength(
          \Zend_Gdata_Exif_Extension_FocalLength $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's focalLength attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_FocalLength

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setImageUniqueId(
          \Zend_Gdata_Exif_Extension_ImageUniqueId $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's imageUniqueId attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_ImageUniqueId

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setIso(
          \Zend_Gdata_Exif_Extension_Iso $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's iso attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Iso

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setMake(
          \Zend_Gdata_Exif_Extension_Make $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's make attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Make

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setModel(
          \Zend_Gdata_Exif_Extension_Model $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's model attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Model

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

setTime(
          \Zend_Gdata_Exif_Extension_Time $value
          )

        :
          \Zend_Gdata_Exif_Extension_Tags

Set the value for this element's time attribute.

Parameters

Name
Type
Description

$value
\Zend_Gdata_Exif_Extension_Time

The desired value for this attribute.

Returns

Type
Description

\Zend_Gdata_Exif_Extension_Tags
Provides a fluent interface

takeChildFromDOM(
          \DOMNode $child
          )

        :
          void

Creates individual Entry objects of the appropriate type and
stores them as members of this entry based upon DOM data.

Parameters

Name
Type
Description

$child
\DOMNode

The DOMNode to process

Documentation was generated by DocBlox 0.15.1.


text:
<?php

namespace Populator\Command;

use Faker\Factory;
use Populator\Database\DatabaseInterface;
use Populator\Event\ProgressBarEvent;
use Populator\Event\SimpleInfoEvent;

class SimplePopulatorCommand extends PopulatorCommand
{
    public function __construct(DatabaseInterface $database, string $language = Factory::DEFAULT_LOCALE)
    {
        parent::__construct();
        $this->addDatabase($database);
        $this->addLanguage($language);
        $this->addEvent(new SimpleInfoEvent());
        $this->addEvent(new ProgressBarEvent());
    }
}


text:
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use app\components\Panel;
use kartik\alert\AlertBlock;
use yii\helpers\ArrayHelper;
use app\modules\user\models\AuthItem;
use app\modules\user\models\AuthRule;
use app\components\Status;
/* @var $this yii\web\View */
/* @var $searchModel app\models\PersonSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Manajemen Karyawan');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php Panel::begin(['title'=>$this->title, 'icon'=>'fa fa-file-text-o']) ?>
<?php
echo AlertBlock::widget([
    'type' => AlertBlock::TYPE_ALERT,
    'useSessionFlash' => true
]);
?>

        <?= Html::a(' '.Yii::t('app', 'Tambah Data Karyawan'), ['create'], ['class' => 'btn btn-success']) ?>

<?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
              'class' => 'yii\grid\SerialColumn',
              'contentOptions' => ['class'=>'text-center'],
              'headerOptions' => ['class'=>'text-center'],
            ],

            [
                'attribute' => 'full_name',
                'value' => 'full_name',
                'headerOptions' => ['class'=>'text-center'],
            ],
            [
              'value' => function($model){
                return Status::getGender($model->gender);
              },
              'attribute' => 'gender',
              'contentOptions' => ['class'=>'text-center'],
              'filter' => Status::getGenderList(),
              'headerOptions' => ['class'=>'text-center'],
            ],
            [
              'value' => 'user.assignment.itemName.name',
              'attribute' => 'jabatan',
              'filter' => ArrayHelper::map(AuthItem::find()->asArray()->all(), 'name', 'name'),
              'headerOptions' => ['class'=>'text-center'],
            ],
            [
              'value' => 'user.assignment.itemName.rule_name',
              'attribute' => 'divisi',
              'filter' => ArrayHelper::map(AuthRule::find()->asArray()->all(), 'name', 'name'),
              'headerOptions' => ['class'=>'text-center'],
            ],
            [
                'value' => 'user.email',
                'attribute' => 'email',
                'headerOptions' => ['class'=>'text-center'],
            ],

            [
              'class' => 'yii\grid\ActionColumn',
              'contentOptions' => ['class'=>'text-center'],
            ],
        ],
    ]); ?>

<?php Panel::end(); ?>


text:
require 'spec_helper'

describe Floor do
  before(:each) do
    args =
      {target: {outdoor_temperature: 20, flow_temperature: 20},
       actual: {outdoor_temperature: 19, flow_temperature: 19, boiler_pump: false},
       pump: false}
      @floor = Floor.new(args)
  end

  describe "#business_logic" do
    context "when turn_off conditions are not met" do

      it "enables pump" do
	@floor.enable(:pump)
	expect(@floor.status(:pump)).to be true
      end

      it "given that mixer runtime has expired" do
	@floor.disable(:mixer)
	expect(@floor.status(:mixer)).to be false
      end

      it "given difference is greater than 2" do
	@floor.disable(:mixer)
	expect(@floor.status(:mixer)).to be false
      end

      it "given difference is less than -2" do
	@floor.enable(:mixer)
	expect(@floor.status(:mixer)).to be true
      end
    end
  end

  describe "#overheating?" do
    temperatures = []
    temperatures.push(40)
    it {expect(temperatures).to eq([40])}

    context "when series has three 40 in a row" do
      series = [40,40,40]
      it {allow(@floor).to receive(:shutdown)}
    end

    context "when series has not three 40 in a row" do
      series = [40,30,40]
      series.clear
      it {expect(series).to be_empty}
      it {allow(@floor).to receive(:monitor).and_return(nil)}
    end

    context "when series has less than three numbers in a row" do
      series = [40,40]
      it {allow(@floor).to receive(:monitor).and_return(nil)}
    end

  end

end


text:
package org.oscm.rest.trigger.data;

import javax.ws.rs.WebApplicationException;

import org.oscm.rest.common.CommonParams;
import org.oscm.rest.common.Representation;
import org.oscm.rest.common.WebException;
import org.oscm.rest.trigger.config.TriggerCommonParams;

/**
 * Representation class of trigger processes.
 *
 * @author miethaner
 */
public class ProcessRepresentation extends Representation {

    private String comment;

    public ProcessRepresentation() {
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public void validateContent() throws WebApplicationException {

        if (comment == null) {
            throw WebException.badRequest()
                    .property(TriggerCommonParams.PROPERTY_COMMENT)
                    .message(CommonParams.ERROR_MANDATORY_PROPERTIES).build();

        } else if (!comment.matches(CommonParams.PATTERN_STRING)) {
            throw WebException.badRequest()
                    .property(TriggerCommonParams.PROPERTY_COMMENT)
                    .message(CommonParams.ERROR_BAD_PROPERTY).build();
        }
    }

    @Override
    public void update() {

        // nothing to update
    }

    @Override
    public void convert() {

        // nothing to convert
    }
}


text:
<?php

namespace Sylius\Bundle\PromotionBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
 * Promotion action choice type.
 *
 * @author Saša Stamenković <umpirsky@gmail.com>
 */
class ActionChoiceType extends AbstractType
{
    protected $actions;

    public function __construct(array $actions)
    {
        $this->actions = $actions;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver
            ->setDefaults(array(
                'choices' => $this->actions
            ))
        ;
    }

    public function getParent()
    {
        return 'choice';
    }

    public function getName()
    {
        return 'sylius_promotion_action_choice';
    }
}


text:
package gov.nih.nci.cabig.caaers.service.migrator;

import gov.nih.nci.cabig.caaers.dao.OrganizationDao;
import gov.nih.nci.cabig.caaers.dao.StudyDao;
import gov.nih.nci.cabig.caaers.dao.StudySiteDao;
import gov.nih.nci.cabig.caaers.dao.query.OrganizationQuery;
import gov.nih.nci.cabig.caaers.domain.Identifier;
import gov.nih.nci.cabig.caaers.domain.Organization;
import gov.nih.nci.cabig.caaers.domain.Participant;
import gov.nih.nci.cabig.caaers.domain.Study;
import gov.nih.nci.cabig.caaers.domain.StudyParticipantAssignment;
import gov.nih.nci.cabig.caaers.domain.StudySite;
import gov.nih.nci.cabig.caaers.domain.repository.OrganizationRepository;
import gov.nih.nci.cabig.caaers.domain.repository.StudyRepository;
import gov.nih.nci.cabig.caaers.domain.workflow.WorkflowConfig;
import gov.nih.nci.cabig.caaers.service.DomainObjectImportOutcome;
import gov.nih.nci.security.util.StringUtilities;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Required;

public class StudyParticipantAssignmentMigrator implements Migrator<Participant> {

	private StudySiteDao studySiteDao;
	private final Log log = LogFactory.getLog(getClass());
	private OrganizationDao organizationDao;
	private OrganizationRepository organizationRepository;
	private StudyDao studyDao;
	private StudyRepository studyRepository;

	public void migrate(Participant src, Participant dest,DomainObjectImportOutcome<Participant> outcome) {

        for (StudyParticipantAssignment studyParticipantAssignment : src.getAssignments()) {

        	StudySite srcSite = studyParticipantAssignment.getStudySite();
        	 log.debug("Size of identifiers : " + srcSite.getStudy().getIdentifiers());

            for (Identifier identifier : studyParticipantAssignment.getStudySite().getStudy().getIdentifiers()) {

                String identifierValue = identifier.getValue();
                String identifierType = identifier.getType();
                String organizationName = srcSite.getOrganization().getName();
                String organizationNciInstituteCode = srcSite.getOrganization().getNciInstituteCode();

                StudySite studySite = null;
                Organization organization = null;
                if (StringUtilities.isBlank(organizationNciInstituteCode)) {
                	//System.out.println("looking by name");
                	organization = organizationDao.getByName(organizationName);
                	studySite = studySiteDao.matchByStudyAndOrg(organizationName, identifierValue, identifierType);
                } else {
                	//System.out.println("looking by id");
                	organization = fetchOrganization(organizationNciInstituteCode);
                	studySite = studySiteDao.matchByStudyAndOrgNciId(organizationNciInstituteCode, identifierValue, identifierType);
                }
                //If study site is not found add the incoming studysite to the study.
                if(studySite == null){
                	Study study = studyDao.getByIdentifier(identifier);
                	studySite = new StudySite();
                	studySite.setOrganization(organization);
                	studySite.setStartDate(new Date());
                	studySite.setEndDate(srcSite.getEndDate());
                    studySite.setStudy(study);
                	if(study == null){
                		outcome.ifNullObject(study, DomainObjectImportOutcome.Severity.ERROR,
                                "The Study with Identifier \" " + identifierValue
                                        + " \" is nonexistant");
                	}else{
                		//
                        List<StudySite> sites = new ArrayList(study.getStudySites());
                        studySiteDao.save(studySite);
                        sites.add(studySite);
                        studyRepository.associateSiteToWorkflowConfig(sites);
                	//	studyDao.updateStudyForServiceUseOnly(study);
                		//Introduced this call
                		//studyRepository.save(study);
                	}
                }
                StudyParticipantAssignment studParticipantAssignment = new StudyParticipantAssignment(dest, studySite);
                studParticipantAssignment.setStudySubjectIdentifier(studyParticipantAssignment.getStudySubjectIdentifier());

                dest.addAssignment(studParticipantAssignment);

            }

        }
        outcome.ifNullOrEmptyList(src.getAssignments(), DomainObjectImportOutcome.Severity.ERROR,
                "Assignments are either Empty or Not Valid");
	}

	///BEAN METHODS
	 @Required
	 public void setStudySiteDao(final StudySiteDao studySiteDao) {
		 this.studySiteDao = studySiteDao;
	 }

    private Organization fetchOrganization(String nciInstituteCode) {
        OrganizationQuery orgQuery = new OrganizationQuery();

        if (StringUtils.isNotEmpty(nciInstituteCode)) {
            orgQuery.filterByNciCodeExactMatch(nciInstituteCode);
        }

        List<Organization> orgList = organizationRepository.searchOrganization(orgQuery);

        if (orgList == null || orgList.isEmpty()) {
            return null;
        }
        if (orgList.size() > 1) {
            //("Multiple organizations exist with same NCI Institute Code :" + nciInstituteCode);
        }

        return orgList.get(0);
    }

	public void setOrganizationDao(OrganizationDao organizationDao) {
		this.organizationDao = organizationDao;
	}

	public void setOrganizationRepository(
			OrganizationRepository organizationRepository) {
		this.organizationRepository = organizationRepository;
	}

	public void setStudyDao(StudyDao studyDao) {
		this.studyDao = studyDao;
	}

	public void setStudyRepository(StudyRepository studyRepository) {
		this.studyRepository = studyRepository;
	}

}


text:
package AsposeCellsExamples.Data;

import com.aspose.cells.*;
import AsposeCellsExamples.Utils;

import java.util.ArrayList;

public class ImportingFromArrayList {

	public static void main(String[] args) throws Exception {

		// The path to the documents directory.
		String dataDir = Utils.getSharedDataDir(ImportingFromArrayList.class) + "Data/";
		//ExStart: 1

		// Instantiating a Workbook object
		Workbook workbook = new Workbook();

		// Obtaining the reference of the worksheet
		Worksheet worksheet = workbook.getWorksheets().get(0);

		// Instantiating an ArrayList object
		ArrayList<String> list = new ArrayList<>();

		// Add few names to the list as string values
		list.add("laurence chen");
		list.add("roman korchagin");
		list.add("kyle huang");
		list.add("tommy wang");

		// Importing the contents of ArrayList to 1st row and first column
		// vertically
		worksheet.getCells().importArrayList(list, 0, 0, true);

		// Saving the Excel file
		workbook.save(dataDir + "IFromArrayList_out.xls");
		// ExEnd: 1

		// Printing the name of the cell found after searching worksheet
		System.out.println("Process completed successfully");
	}
}


text:
#define BBIO_RAWWIRE_HEADER	"RAW1"

void bbio_mode_rawwire(t_hydra_console *con);

typedef struct mode_rawwire_exec_t {
	void (*init)(t_hydra_console *con);
	bool (*pin_init)(t_hydra_console *con);
	void (*tim_init)(t_hydra_console *con);
	void (*tim_update)(t_hydra_console *con);
	uint8_t (*read_u8)(t_hydra_console *con);
	uint8_t (*read_bit_clock)(t_hydra_console *con);
	uint8_t (*read_bit)(t_hydra_console *con);
	uint8_t (*write_u8)(t_hydra_console *con, uint8_t tx_data);
	uint8_t (*write_bit)(t_hydra_console *con, uint8_t bit);
	void (*clock)(t_hydra_console *con);
	void (*clock_high)(t_hydra_console *con);
	void (*clock_low)(t_hydra_console *con);
	void (*data_high)(t_hydra_console *con);
	void (*data_low)(t_hydra_console *con);
	void (*cleanup)(t_hydra_console *con);
} mode_rawwire_exec_t;


text:
static const int ddLogLevel = LOG_LEVEL_VERBOSE;

#if defined( LOG_ASYNC_ENABLED )
    #undef LOG_ASYNC_ENABLED
    #define LOG_ASYNC_ENABLED NO
#endif

#define SRLogError(frmt, ...)   LOG_OBJC_MAYBE(LOG_ASYNC_ERROR,   LOG_LEVEL_DEF, LOG_FLAG_ERROR,   0, frmt, ##__VA_ARGS__)
#define SRLogWarn(frmt, ...)    LOG_OBJC_MAYBE(LOG_ASYNC_WARN,    LOG_LEVEL_DEF, LOG_FLAG_WARN,    0, frmt, ##__VA_ARGS__)
#define SRLogInfo(frmt, ...)    LOG_OBJC_MAYBE(LOG_ASYNC_INFO,    LOG_LEVEL_DEF, LOG_FLAG_INFO,    0, frmt, ##__VA_ARGS__)
#define SRLogDebug(frmt, ...)   LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG,   LOG_LEVEL_DEF, LOG_FLAG_DEBUG,   0, frmt, ##__VA_ARGS__)
#define SRLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__)

#else

#define SRLogError(frmt, ...)      do{ NSLog((frmt), ##__VA_ARGS__); } while(0)
#define SRLogWarn(frmt, ...)       do{ NSLog((frmt), ##__VA_ARGS__); } while(0)
#define SRLogInfo(frmt, ...)       do{ NSLog((frmt), ##__VA_ARGS__); } while(0)
#define SRLogDebug(frmt, ...)      do{ NSLog((frmt), ##__VA_ARGS__); } while(0)
#define SRLogVerbose(frmt, ...)    do{ NSLog((frmt), ##__VA_ARGS__); } while(0)

#endif

#define SRLogPrefixedError(type, frmt, ...) SRLogError(@"%@:\t%@", type, [NSString stringWithFormat:frmt, ##__VA_ARGS__]);
#define SRLogPrefixedWarn(type, frmt, ...) SRLogWarn(@"%@:\t%@", type, [NSString stringWithFormat:frmt, ##__VA_ARGS__]);
#define SRLogPrefixedInfo(type, frmt, ...) SRLogInfo(@"%@:\t%@", type, [NSString stringWithFormat:frmt, ##__VA_ARGS__]);
#define SRLogPrefixedDebug(type, frmt, ...) SRLogDebug(@"%@:\t%@", type, [NSString stringWithFormat:frmt, ##__VA_ARGS__]);
#define SRLogPrefixedVerbose(type, frmt, ...) SRLogVerbose(@"%@:\t%@", type, [NSString stringWithFormat:frmt, ##__VA_ARGS__]);

#define SRLogConnectionError(frmt, ...)   SRLogPrefixedError(@"CONNECTION", frmt, ##__VA_ARGS__);
#define SRLogConnectionWarn(frmt, ...)    SRLogPrefixedWarn(@"CONNECTION", frmt, ##__VA_ARGS__);
#define SRLogConnectionInfo(frmt, ...)    SRLogPrefixedInfo(@"CONNECTION", frmt, ##__VA_ARGS__);
#define SRLogConnectionDebug(frmt, ...)   SRLogPrefixedDebug(@"CONNECTION", frmt, ##__VA_ARGS__);
#define SRLogConnectionVerbose(frmt, ...) SRLogPrefixedVerbose(@"CONNECTION", frmt, ##__VA_ARGS__);

#define SRLogAutoError(frmt, ...)   SRLogPrefixedError(@"AUTO", frmt, ##__VA_ARGS__);
#define SRLogAutoWarn(frmt, ...)    SRLogPrefixedWarn(@"AUTO", frmt, ##__VA_ARGS__);
#define SRLogAutoInfo(frmt, ...)    SRLogPrefixedInfo(@"AUTO", frmt, ##__VA_ARGS__);
#define SRLogAutoDebug(frmt, ...)   SRLogPrefixedDebug(@"AUTO", frmt, ##__VA_ARGS__);
#define SRLogAutoVerbose(frmt, ...) SRLogPrefixedVerbose(@"AUTO", frmt, ##__VA_ARGS__);

#define SRLogTransportError(frmt, ...)   SRLogPrefixedError(@"TRANSPORT", frmt, ##__VA_ARGS__);
#define SRLogTransportWarn(frmt, ...)    SRLogPrefixedWarn(@"TRANSPORT", frmt, ##__VA_ARGS__);
#define SRLogTransportInfo(frmt, ...)    SRLogPrefixedInfo(@"TRANSPORT", frmt, ##__VA_ARGS__);
#define SRLogTransportDebug(frmt, ...)   SRLogPrefixedDebug(@"TRANSPORT", frmt, ##__VA_ARGS__);
#define SRLogTransportVerbose(frmt, ...) SRLogPrefixedVerbose(@"TRANSPORT", frmt, ##__VA_ARGS__);

#define SRLogWSError(frmt, ...)   SRLogPrefixedError(@"WS", frmt, ##__VA_ARGS__);
#define SRLogWSWarn(frmt, ...)    SRLogPrefixedWarn(@"WS", frmt, ##__VA_ARGS__);
#define SRLogWSInfo(frmt, ...)    SRLogPrefixedInfo(@"WS", frmt, ##__VA_ARGS__);
#define SRLogWSDebug(frmt, ...)   SRLogPrefixedDebug(@"WS", frmt, ##__VA_ARGS__);
#define SRLogWSVerbose(frmt, ...) SRLogPrefixedVerbose(@"WS", frmt, ##__VA_ARGS__);

#define SRLogSSEError(frmt, ...)   SRLogPrefixedError(@"SSE", frmt, ##__VA_ARGS__);
#define SRLogSSEWarn(frmt, ...)    SRLogPrefixedWarn(@"SSE", frmt, ##__VA_ARGS__);
#define SRLogSSEInfo(frmt, ...)    SRLogPrefixedInfo(@"SSE", frmt, ##__VA_ARGS__);
#define SRLogSSEDebug(frmt, ...)   SRLogPrefixedDebug(@"SSE", frmt, ##__VA_ARGS__);
#define SRLogSSEVerbose(frmt, ...) SRLogPrefixedVerbose(@"SSE", frmt, ##__VA_ARGS__);

#define SRLogLPError(frmt, ...)   SRLogPrefixedError(@"LP", frmt, ##__VA_ARGS__);
#define SRLogLPWarn(frmt, ...)    SRLogPrefixedWarn(@"LP", frmt, ##__VA_ARGS__);
#define SRLogLPInfo(frmt, ...)    SRLogPrefixedInfo(@"LP", frmt, ##__VA_ARGS__);
#define SRLogLPDebug(frmt, ...)   SRLogPrefixedDebug(@"LP", frmt, ##__VA_ARGS__);
#define SRLogLPVerbose(frmt, ...) SRLogPrefixedVerbose(@"LP", frmt, ##__VA_ARGS__);


text:
//
// GzCompressor compresses a byte stream using gzip compression
// calling the client's ProcessBytes() method with the compressed stream
//

#include "import/cross/gz_compressor.h"

#include <assert.h>
#include "import/cross/memory_buffer.h"
#include "import/cross/memory_stream.h"
#include "zutil.h"

const size_t kChunkSize = 16384;

namespace o3d {

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GzCompressor::GzCompressor(StreamProcessor *callback_client)
    : stream_is_closed_(false),
      callback_client_(callback_client) {
  strm_.zalloc = Z_NULL;
  strm_.zfree = Z_NULL;
  strm_.opaque = Z_NULL;

  // Store this, so we can later check if it's OK to start processing
  int result = deflateInit2(
      &strm_,
      Z_DEFAULT_COMPRESSION,
      Z_DEFLATED,
      MAX_WBITS + 16,  // 16 means write out gzip header/trailer
      DEF_MEM_LEVEL,
      Z_DEFAULT_STRATEGY);

  initialized_ = result == Z_OK;
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void GzCompressor::Close(bool success) {
  if (!stream_is_closed_) {
    // Flush the compression stream
    MemoryReadStream stream(NULL, 0);
    CompressBytes(&stream, 0, true);

    // Deallocate resources
    deflateEnd(&strm_);
    stream_is_closed_ = true;
  }

  callback_client_->Close(success);
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GzCompressor::~GzCompressor() {
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StreamProcessor::Status GzCompressor::ProcessBytes(MemoryReadStream *stream,
                                                   size_t bytes_to_process) {
  // Basic sanity check
  if (stream->GetDirectMemoryPointer() == NULL || bytes_to_process == 0) {
    return FAILURE;
  }

  return CompressBytes(stream, bytes_to_process, false);
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StreamProcessor::Status GzCompressor::CompressBytes(MemoryReadStream *stream,
                                                    size_t bytes_to_process,
                                                    bool flush) {
  // Don't even bother trying if we didn't get initialized properly
  if (!initialized_) return FAILURE;

  uint8 out[kChunkSize];

  // Don't try to read more than our stream has
  size_t remaining = stream->GetRemainingByteCount();
  if (bytes_to_process > remaining) {
    return FAILURE;
  }

  // Use direct memory access on the MemoryStream object
  const uint8 *input_data = stream->GetDirectMemoryPointer();
  stream->Skip(bytes_to_process);

  // Fill out the zlib z_stream struct
  strm_.avail_in = bytes_to_process;
  strm_.next_in = const_cast<uint8*>(input_data);

  // We need to flush the stream when we reach the end
  int flush_code = flush ? Z_FINISH : Z_NO_FLUSH;

  // Run deflate() on input until output buffer not full
  int result;
  do {
    strm_.avail_out = kChunkSize;
    strm_.next_out = out;

    result = deflate(&strm_, flush_code);
    if (result == Z_STREAM_ERROR)
      return FAILURE;

    size_t have = kChunkSize - strm_.avail_out;

    // Callback with the compressed byte stream
    MemoryReadStream decompressed_stream(out, have);
    if (have > 0 && callback_client_) {
      if (callback_client_->ProcessBytes(&decompressed_stream,
                                         have) == FAILURE) {
        return FAILURE;
      }
    }
  } while (strm_.avail_out == 0);

  return result == Z_OK ? IN_PROGRESS : FAILURE;
}

}  // namespace o3d


text:
package com.appmetr.hercules.keys;

public interface ForeignKey {
}