text:
<?php
// autogenerated file 30.09.2013 15:20
// $Id: $
// $Log: $
//
//
require_once 'ItemIDArrayType.php';
require_once 'ModifyActionCodeType.php';
require_once 'AbstractRequestType.php';

/**
 * Defines the <b>SetPromotionalSaleListings</b> call request.
 *
 * @link http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/types/SetPromotionalSaleListingsRequestType.html
 *
 */
class SetPromotionalSaleListingsRequestType extends AbstractRequestType
{
	/**
	 * @var long
	 */
	protected $PromotionalSaleID;
	/**
	 * @var ModifyActionCodeType
	 */
	protected $Action;
	/**
	 * @var ItemIDArrayType
	 */
	protected $PromotionalSaleItemIDArray;
	/**
	 * @var long
	 */
	protected $StoreCategoryID;
	/**
	 * @var long
	 */
	protected $CategoryID;
	/**
	 * @var boolean
	 */
	protected $AllFixedPriceItems;
	/**
	 * @var boolean
	 */
	protected $AllStoreInventoryItems;
	/**
	 * @var boolean
	 */
	protected $AllAuctionItems;

	/**
	 * @return long
	 */
	function getPromotionalSaleID()
	{
		return $this->PromotionalSaleID;
	}
	/**
	 * @return void
	 * @param long $value
	 */
	function setPromotionalSaleID($value)
	{
		$this->PromotionalSaleID = $value;
	}
	/**
	 * @return ModifyActionCodeType
	 */
	function getAction()
	{
		return $this->Action;
	}
	/**
	 * @return void
	 * @param ModifyActionCodeType $value
	 */
	function setAction($value)
	{
		$this->Action = $value;
	}
	/**
	 * @return ItemIDArrayType
	 */
	function getPromotionalSaleItemIDArray()
	{
		return $this->PromotionalSaleItemIDArray;
	}
	/**
	 * @return void
	 * @param ItemIDArrayType $value
	 */
	function setPromotionalSaleItemIDArray($value)
	{
		$this->PromotionalSaleItemIDArray = $value;
	}
	/**
	 * @return long
	 */
	function getStoreCategoryID()
	{
		return $this->StoreCategoryID;
	}
	/**
	 * @return void
	 * @param long $value
	 */
	function setStoreCategoryID($value)
	{
		$this->StoreCategoryID = $value;
	}
	/**
	 * @return long
	 */
	function getCategoryID()
	{
		return $this->CategoryID;
	}
	/**
	 * @return void
	 * @param long $value
	 */
	function setCategoryID($value)
	{
		$this->CategoryID = $value;
	}
	/**
	 * @return boolean
	 */
	function getAllFixedPriceItems()
	{
		return $this->AllFixedPriceItems;
	}
	/**
	 * @return void
	 * @param boolean $value
	 */
	function setAllFixedPriceItems($value)
	{
		$this->AllFixedPriceItems = $value;
	}
	/**
	 * @return boolean
	 */
	function getAllStoreInventoryItems()
	{
		return $this->AllStoreInventoryItems;
	}
	/**
	 * @return void
	 * @param boolean $value
	 */
	function setAllStoreInventoryItems($value)
	{
		$this->AllStoreInventoryItems = $value;
	}
	/**
	 * @return boolean
	 */
	function getAllAuctionItems()
	{
		return $this->AllAuctionItems;
	}
	/**
	 * @return void
	 * @param boolean $value
	 */
	function setAllAuctionItems($value)
	{
		$this->AllAuctionItems = $value;
	}
	/**
	 * @return
	 */
	function __construct()
	{
		parent::__construct('SetPromotionalSaleListingsRequestType', 'urn:ebay:apis:eBLBaseComponents');
		if (!isset(self::$_elements[__CLASS__]))
				self::$_elements[__CLASS__] = array_merge(self::$_elements[get_parent_class()],
				array(
					'PromotionalSaleID' =>
					array(
						'required' => false,
						'type' => 'long',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					),
					'Action' =>
					array(
						'required' => false,
						'type' => 'ModifyActionCodeType',
						'nsURI' => 'urn:ebay:apis:eBLBaseComponents',
						'array' => false,
						'cardinality' => '0..1'
					),
					'PromotionalSaleItemIDArray' =>
					array(
						'required' => false,
						'type' => 'ItemIDArrayType',
						'nsURI' => 'urn:ebay:apis:eBLBaseComponents',
						'array' => false,
						'cardinality' => '0..1'
					),
					'StoreCategoryID' =>
					array(
						'required' => false,
						'type' => 'long',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					),
					'CategoryID' =>
					array(
						'required' => false,
						'type' => 'long',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					),
					'AllFixedPriceItems' =>
					array(
						'required' => false,
						'type' => 'boolean',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					),
					'AllStoreInventoryItems' =>
					array(
						'required' => false,
						'type' => 'boolean',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					),
					'AllAuctionItems' =>
					array(
						'required' => false,
						'type' => 'boolean',
						'nsURI' => 'http://www.w3.org/2001/XMLSchema',
						'array' => false,
						'cardinality' => '0..1'
					)
				));
	}
}
?>


text:
layout: page
title: About
---

I am a Front End Developer from Minneapolis, MN

redpajama_set_name: RedPajamaGithub


text:
*** GEDCOMXJS
** A GEDCOM-X reader/writer for Javasript

This module will mirror the Java reference implementation API as closely as possible.


text:
// $Id: Timer_Heap_T.cpp 79134 2007-07-31 18:23:50Z johnnyw $

#ifndef ACE_TIMER_HEAP_T_CPP
#define ACE_TIMER_HEAP_T_CPP

#include "ace/Timer_Heap_T.h"
#include "ace/Log_Msg.h"
#include "ace/Guard_T.h"
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_string.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

/*
** The ACE_Timer_Heap::max_size_ and array loops, checks, etc. are all size_t.
** The timer IDs are long, and since they are indices into the heap, we need
** to be sure that the timer heap size can fit in a long. Hence, when size
** is (re)set, limit it to the maximum long value. We use the C++ standard
** limits if available.
*/
#if !defined(ACE_LACKS_NUMERIC_LIMITS)
// some platforms pollute the namespace by defining max() and min() macros
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
#include <limits>
#endif /* ACE_LACKS_NUMERIC_LIMITS */

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

// Define some simple macros to clarify the code.
#define ACE_HEAP_PARENT(X) (X == 0 ? 0 : (((X) - 1) / 2))
#define ACE_HEAP_LCHILD(X) (((X)+(X))+1)

// Constructor that takes in an <ACE_Timer_Heap_T> to iterate over.

template <class TYPE, class FUNCTOR, class ACE_LOCK>
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &heap)
  : timer_heap_ (heap)
{
  ACE_TRACE ("ACE_Timer_Heap_Iterator_T::ACE_Timer_Heap_Iterator");
  this->first();
}

template <class TYPE, class FUNCTOR, class ACE_LOCK>
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_Iterator_T (void)
{
}

// Positions the iterator at the first node in the heap array

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first (void)
{
  this->position_ = 0;
}

// Positions the iterator at the next node in the heap array

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next (void)
{
  if (this->position_ != this->timer_heap_.cur_size_)
    this->position_++;
}

// Returns true the <position_> is at the end of the heap array

template <class TYPE, class FUNCTOR, class ACE_LOCK> int
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone (void) const
{
  return this->position_ == this->timer_heap_.cur_size_;
}

// Returns the node at the current position in the heap or 0 if at the end

template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item (void)
{
  if (this->position_ != this->timer_heap_.cur_size_)
    return this->timer_heap_.heap_[this->position_];
  return 0;
}

// Constructor
// Note that timer_ids_curr_ and timer_ids_min_free_ both start at 0.
// Since timer IDs are assigned by first incrementing the timer_ids_curr_
// value, the first ID assigned will be 1 (just as in the previous design).
// When it's time to wrap, the next ID given out will be 0.
template <class TYPE, class FUNCTOR, class ACE_LOCK>
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (size_t size,
                                                             bool preallocated,
                                                             FUNCTOR *upcall_functor,
                                                             ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
  : ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK> (upcall_functor, freelist),
    max_size_ (size),
    cur_size_ (0),
    cur_limbo_ (0),
    timer_ids_curr_ (0),
    timer_ids_min_free_ (0),
    preallocated_nodes_ (0),
    preallocated_nodes_freelist_ (0)
{
  ACE_TRACE ("ACE_Timer_Heap_T::ACE_Timer_Heap_T");

  // Possibly reduce size to fit in a long.
#if !defined(ACE_LACKS_NUMERIC_LIMITS)
  if (size > static_cast<size_t> (std::numeric_limits<long>::max ()))
    {
      size = static_cast<size_t> (std::numeric_limits<long>::max ());
      this->max_size_ = size;
    }
#else
  if (size > LONG_MAX)
    {
      size = LONG_MAX;
      this->max_size_ = size;
    }
#endif /* ACE_LACKS_NUMERIC_LIMITS */

  // Create the heap array.
  ACE_NEW (this->heap_,
           ACE_Timer_Node_T<TYPE> *[size]);

  // Create the parallel
  ACE_NEW (this->timer_ids_,
           ssize_t[size]);

  // Initialize the "freelist," which uses negative values to
  // distinguish freelist elements from "pointers" into the <heap_>
  // array.
  for (size_t i = 0; i < size; i++)
    this->timer_ids_[i] = -1;

  if (preallocated)
    {
      ACE_NEW (this->preallocated_nodes_,
               ACE_Timer_Node_T<TYPE>[size]);

      // Add allocated array to set of such arrays for deletion on
      // cleanup.
      this->preallocated_node_set_.insert (this->preallocated_nodes_);

      // Form the freelist by linking the next_ pointers together.
      for (size_t j = 1; j < size; j++)
        this->preallocated_nodes_[j - 1].set_next (&this->preallocated_nodes_[j]);

      // NULL-terminate the freelist.
      this->preallocated_nodes_[size - 1].set_next (0);

      // Assign the freelist pointer to the front of the list.
      this->preallocated_nodes_freelist_ =
        &this->preallocated_nodes_[0];
    }

  ACE_NEW (iterator_,
           HEAP_ITERATOR (*this));
}

// Note that timer_ids_curr_ and timer_ids_min_free_ both start at 0.
// Since timer IDs are assigned by first incrementing the timer_ids_curr_
// value, the first ID assigned will be 1 (just as in the previous design).
// When it's time to wrap, the next ID given out will be 0.
template <class TYPE, class FUNCTOR, class ACE_LOCK>
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Heap_T (FUNCTOR *upcall_functor,
                                                             ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist)
  : ACE_Timer_Queue_T<TYPE,FUNCTOR,ACE_LOCK> (upcall_functor, freelist),
    max_size_ (ACE_DEFAULT_TIMERS),
    cur_size_ (0),
    cur_limbo_ (0),
    timer_ids_curr_ (0),
    timer_ids_min_free_ (0),
    preallocated_nodes_ (0),
    preallocated_nodes_freelist_ (0)
{
  ACE_TRACE ("ACE_Timer_Heap_T::ACE_Timer_Heap_T");

  // Possibly reduce size to fit in a long.
#if !defined(ACE_LACKS_NUMERIC_LIMITS)
  if (this->max_size_ > static_cast<size_t> (std::numeric_limits<long>::max ()))
    this->max_size_ = static_cast<size_t> (std::numeric_limits<long>::max ());
#else
  if (this->max_size_ > LONG_MAX)
    this->max_size_ = LONG_MAX;
#endif /* ACE_LACKS_NUMERIC_LIMITS */

  // Create the heap array.
    ACE_NEW (this->heap_,
             ACE_Timer_Node_T<TYPE> *[this->max_size_]);

  // Create the parallel array.
  ACE_NEW (this->timer_ids_,
           ssize_t[this->max_size_]);

  // Initialize the "freelist," which uses negative values to
  // distinguish freelist elements from "pointers" into the <heap_>
  // array.
  for (size_t i = 0; i < this->max_size_; i++)
    this->timer_ids_[i] = -1;

  ACE_NEW (iterator_,
           HEAP_ITERATOR (*this));
}

template <class TYPE, class FUNCTOR, class ACE_LOCK>
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Heap_T (void)
{
  ACE_TRACE ("ACE_Timer_Heap_T::~ACE_Timer_Heap_T");

  delete iterator_;

  size_t current_size =
    this->cur_size_;

  // Clean up all the nodes still in the queue
  for (size_t i = 0; i < current_size; i++)
    {
      // Grab the event_handler and act, then delete the node before calling
      // back to the handler. Prevents a handler from trying to cancel_timer()
      // inside handle_close(), ripping the current timer node out from
      // under us.
      TYPE eh = this->heap_[i]->get_type ();
      const void *act = this->heap_[i]->get_act ();
      this->free_node (this->heap_[i]);
      this->upcall_functor ().deletion (*this, eh, act);
    }

  delete [] this->heap_;
  delete [] this->timer_ids_;

  // clean up any preallocated timer nodes
  if (preallocated_nodes_ != 0)
    {
      ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<TYPE> *>
        set_iterator (this->preallocated_node_set_);

      for (ACE_Timer_Node_T<TYPE> **entry = 0;
           set_iterator.next (entry) !=0;
           set_iterator.advance ())
        delete [] *entry;
    }
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> long
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::pop_freelist (void)
{
  ACE_TRACE ("ACE_Timer_Heap_T::pop_freelist");

  // Scan for a free timer ID. Note that since this function is called
  // _after_ the check for a full timer heap, we are guaranteed to find
  // a free ID, even if we need to wrap around and start reusing freed IDs.
  // On entry, the curr_ index is at the previous ID given out; start
  // up where we left off last time.
  // NOTE - a timer_ids_ slot with -2 is out of the heap, but not freed.
  // It must be either freed (free_node) or rescheduled (reschedule).
  ++this->timer_ids_curr_;
  while (this->timer_ids_curr_ < this->max_size_ &&
         (this->timer_ids_[this->timer_ids_curr_] >= 0 ||
          this->timer_ids_[this->timer_ids_curr_] == -2  ))
    ++this->timer_ids_curr_;
  if (this->timer_ids_curr_ == this->max_size_)
    {
      ACE_ASSERT (this->timer_ids_min_free_ < this->max_size_);
      this->timer_ids_curr_ = this->timer_ids_min_free_;
      // We restarted the free search at min. Since min won't be
      // free anymore, and curr_ will just keep marching up the list
      // on each successive need for an ID, reset min_free_ to the
      // size of the list until an ID is freed that curr_ has already
      // gone past (see push_freelist).
      this->timer_ids_min_free_ = this->max_size_;
    }

  return static_cast<long> (this->timer_ids_curr_);
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::push_freelist (long old_id)
{
  ACE_TRACE ("ACE_Timer_Heap_T::push_freelist");

  // Since this ID has already been checked by one of the public
  // functions, it's safe to cast it here.
  size_t oldid = size_t (old_id);

  // The freelist values in the <timer_ids_> are negative, so set the
  // freed entry back to 'free'. If this is the new lowest value free
  // timer ID that curr_ won't see on it's normal march through the list,
  // remember it.
  ACE_ASSERT (this->timer_ids_[oldid] >= 0 || this->timer_ids_[oldid] == -2);
  if (this->timer_ids_[oldid] == -2)
    --this->cur_limbo_;
  else
    --this->cur_size_;
  this->timer_ids_[oldid] = -1;
  if (oldid < this->timer_ids_min_free_ && oldid <= this->timer_ids_curr_)
    this->timer_ids_min_free_ = oldid;
  return;
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> long
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::timer_id (void)
{
  ACE_TRACE ("ACE_Timer_Heap_T::timer_id");

  // Return the next item off the freelist and use it as the timer id.
  return this->pop_freelist ();
}

// Checks if queue is empty.

template <class TYPE, class FUNCTOR, class ACE_LOCK> int
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::is_empty (void) const
{
  ACE_TRACE ("ACE_Timer_Heap_T::is_empty");
  return this->cur_size_ == 0;
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::iter (void)
{
  this->iterator_->first ();
  return *this->iterator_;
}

// Returns earliest time in a non-empty queue.

template <class TYPE, class FUNCTOR, class ACE_LOCK> const ACE_Time_Value &
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::earliest_time (void) const
{
  ACE_TRACE ("ACE_Timer_Heap_T::earliest_time");
  return this->heap_[0]->get_timer_value ();
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::dump (void) const
{
#if defined (ACE_HAS_DUMP)
  ACE_TRACE ("ACE_Timer_Heap_T::dump");
  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));

  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmax_size_ = %d"), this->max_size_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_size_ = %d"), this->cur_size_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ncur_limbo_= %d"), this->cur_limbo_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nids_curr_ = %d"),
              this->timer_ids_curr_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nmin_free_ = %d"),
              this->timer_ids_min_free_));

  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nheap_ = \n")));

  for (size_t i = 0; i < this->cur_size_; i++)
    {
      ACE_DEBUG ((LM_DEBUG,
                  ACE_TEXT ("%d\n"),
                  i));
      this->heap_[i]->dump ();
    }

  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_ids_ = \n")));

  for (size_t j = 0; j < this->max_size_; j++)
    ACE_DEBUG ((LM_DEBUG,
                ACE_TEXT ("%d\t%d\n"),
                j,
                this->timer_ids_[j]));

  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::copy (size_t slot,
                                                 ACE_Timer_Node_T<TYPE> *moved_node)
{
  // Insert <moved_node> into its new location in the heap.
  this->heap_[slot] = moved_node;

  ACE_ASSERT (moved_node->get_timer_id () >= 0
              && moved_node->get_timer_id () < (int) this->max_size_);

  // Update the corresponding slot in the parallel <timer_ids_> array.
  this->timer_ids_[moved_node->get_timer_id ()] = static_cast<ssize_t> (slot);
}

// Remove the slot'th timer node from the heap, but do not reclaim its
// timer ID or change the size of this timer heap object. The caller of
// this function must call either free_node (to reclaim the timer ID
// and the timer node memory, as well as decrement the size of the queue)
// or reschedule (to reinsert the node in the heap at a new time).
template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove (size_t slot)
{
  ACE_Timer_Node_T<TYPE> *removed_node =
    this->heap_[slot];

  // NOTE - the cur_size_ is being decremented since the queue has one
  // less active timer in it. However, this ACE_Timer_Node is not being
  // freed, and there is still a place for it in timer_ids_ (the timer ID
  // is not being relinquished). The node can still be rescheduled, or
  // it can be freed via free_node.
  --this->cur_size_;

  // Only try to reheapify if we're not deleting the last entry.

  if (slot < this->cur_size_)
    {
      ACE_Timer_Node_T<TYPE> *moved_node =
        this->heap_[this->cur_size_];

      // Move the end node to the location being removed and update
      // the corresponding slot in the parallel <timer_ids> array.
      this->copy (slot, moved_node);

      // If the <moved_node->time_value_> is great than or equal its
      // parent it needs be moved down the heap.
      size_t parent = ACE_HEAP_PARENT (slot);

      if (moved_node->get_timer_value ()
          >= this->heap_[parent]->get_timer_value ())
        this->reheap_down (moved_node,
                           slot,
                           ACE_HEAP_LCHILD (slot));
      else
        this->reheap_up (moved_node,
                         slot,
                         parent);
    }

  this->timer_ids_[removed_node->get_timer_id ()] = -2;
  ++this->cur_limbo_;
  return removed_node;
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_down (ACE_Timer_Node_T<TYPE> *moved_node,
                                                    size_t slot,
                                                    size_t child)
{
  // Restore the heap property after a deletion.

  while (child < this->cur_size_)
    {
      // Choose the smaller of the two children.
      if (child + 1 < this->cur_size_
          && this->heap_[child + 1]->get_timer_value ()
          < this->heap_[child]->get_timer_value ())
        child++;

      // Perform a <copy> if the child has a larger timeout value than
      // the <moved_node>.
      if (this->heap_[child]->get_timer_value ()
          < moved_node->get_timer_value ())
        {
          this->copy (slot,
                      this->heap_[child]);
          slot = child;
          child = ACE_HEAP_LCHILD (child);
        }
      else
        // We've found our location in the heap.
        break;
    }

  this->copy (slot, moved_node);
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reheap_up (ACE_Timer_Node_T<TYPE> *moved_node,
                                                      size_t slot,
                                                      size_t parent)
{
  // Restore the heap property after an insertion.

  while (slot > 0)
    {
      // If the parent node is greater than the <moved_node> we need
      // to copy it down.
      if (moved_node->get_timer_value ()
          < this->heap_[parent]->get_timer_value ())
        {
          this->copy (slot, this->heap_[parent]);
          slot = parent;
          parent = ACE_HEAP_PARENT (slot);
        }
      else
        break;
    }

  // Insert the new node into its proper resting place in the heap and
  // update the corresponding slot in the parallel <timer_ids> array.
  this->copy (slot,
              moved_node);
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::insert (ACE_Timer_Node_T<TYPE> *new_node)
{
  if (this->cur_size_ + this->cur_limbo_ + 2 >= this->max_size_)
    this->grow_heap ();

  this->reheap_up (new_node,
                   this->cur_size_,
                   ACE_HEAP_PARENT (this->cur_size_));
  this->cur_size_++;
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::grow_heap (void)
{
  // All the containers will double in size from max_size_.
  size_t new_size = this->max_size_ * 2;

#if 0
  // Yikes - there's no way to flag a failure of going out of range of
  // a 'long' - this is a problem that should be addressed at some point.
#if !defined(ACE_LACKS_NUMERIC_LIMITS)
  if (new_size > std::numeric_limits<long>::max ())
    new_size = std::numeric_limits<long>::max ();
#else
  if (new_size > LONG_MAX)
    new_size = LONG_MAX;
#endif /* ACE_LACKS_NUMERIC_LIMITS */

  if (new_size <= this->max_size_)   // We are already at the limit
    {
      errno = ENOMEM;
      return -1;
    }
#endif /* 0 */

   // First grow the heap itself.

  ACE_Timer_Node_T<TYPE> **new_heap = 0;

  ACE_NEW (new_heap,
           ACE_Timer_Node_T<TYPE> *[new_size]);

  ACE_OS::memcpy (new_heap,
                  this->heap_,
                  this->max_size_ * sizeof *new_heap);
  delete [] this->heap_;
  this->heap_ = new_heap;

  // Grow the array of timer ids.

  ssize_t *new_timer_ids = 0;

  ACE_NEW (new_timer_ids,
           ssize_t[new_size]);

  ACE_OS::memcpy (new_timer_ids,
                  this->timer_ids_,
                  this->max_size_ * sizeof (ssize_t));

  delete [] timer_ids_;
  this->timer_ids_ = new_timer_ids;

  // And add the new elements to the end of the "freelist".
  for (size_t i = this->max_size_; i < new_size; i++)
    this->timer_ids_[i] = -(static_cast<ssize_t> (i) + 1);

   // Grow the preallocation array (if using preallocation)
  if (this->preallocated_nodes_ != 0)
    {
      // Create a new array with max_size elements to link in to
      // existing list.
      ACE_NEW (this->preallocated_nodes_,
               ACE_Timer_Node_T<TYPE>[this->max_size_]);

      // Add it to the set for later deletion
      this->preallocated_node_set_.insert (this->preallocated_nodes_);

      // Link new nodes together (as for original list).
      for (size_t k = 1; k < this->max_size_; k++)
        this->preallocated_nodes_[k - 1].set_next (&this->preallocated_nodes_[k]);

      // NULL-terminate the new list.
      this->preallocated_nodes_[this->max_size_ - 1].set_next (0);

      // Link new array to the end of the existling list.
      if (this->preallocated_nodes_freelist_ == 0)
        this->preallocated_nodes_freelist_ =
          &preallocated_nodes_[0];
      else
        {
          ACE_Timer_Node_T<TYPE> *previous =
            this->preallocated_nodes_freelist_;

          for (ACE_Timer_Node_T<TYPE> *current = this->preallocated_nodes_freelist_->get_next ();
               current != 0;
               current = current->get_next ())
            previous = current;

          previous->set_next (&this->preallocated_nodes_[0]);
        }
    }

  this->max_size_ = new_size;
  // Force rescan of list from beginning for a free slot (I think...)
  // This fixed Bugzilla #2447.
  this->timer_ids_min_free_ = this->max_size_;
}

// Reschedule a periodic timer.  This function must be called with the
// mutex lock held.

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reschedule (ACE_Timer_Node_T<TYPE> *expired)
{
  ACE_TRACE ("ACE_Timer_Heap_T::reschedule");

  // If we are rescheduling, then the most recent call was to
  // remove_first (). That called remove () to remove the node from the
  // heap, but did not free the timer ID. The ACE_Timer_Node still has
  // its assigned ID - just needs to be inserted at the new proper
  // place, and the heap restored properly.
  if (this->timer_ids_[expired->get_timer_id ()] == -2)
    --this->cur_limbo_;
  this->insert (expired);
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T<TYPE> *
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::alloc_node (void)
{
  ACE_Timer_Node_T<TYPE> *temp = 0;

  // Only allocate a node if we are *not* using the preallocated heap.
  if (this->preallocated_nodes_ == 0)
    ACE_NEW_RETURN (temp,
                    ACE_Timer_Node_T<TYPE>,
                    0);
  else
    {
      // check to see if the heap needs to grow
      if (this->preallocated_nodes_freelist_ == 0)
        this->grow_heap ();

      temp = this->preallocated_nodes_freelist_;

      // Remove the first element from the freelist.
      this->preallocated_nodes_freelist_ =
        this->preallocated_nodes_freelist_->get_next ();
    }
  return temp;
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> void
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::free_node (ACE_Timer_Node_T<TYPE> *node)
{
  // Return this timer id to the freelist.
  this->push_freelist (node->get_timer_id ());

  // Only free up a node if we are *not* using the preallocated heap.
  if (this->preallocated_nodes_ == 0)
    delete node;
  else
    {
      node->set_next (this->preallocated_nodes_freelist_);
      this->preallocated_nodes_freelist_ = node;
    }
}

// Insert a new timer that expires at time future_time; if interval is
// > 0, the handler will be reinvoked periodically.

template <class TYPE, class FUNCTOR, class ACE_LOCK> long
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::schedule_i (const TYPE &type,
                                                       const void *act,
                                                       const ACE_Time_Value &future_time,
                                                       const ACE_Time_Value &interval)
{
  ACE_TRACE ("ACE_Timer_Heap_T::schedule_i");

  if ((this->cur_size_ + this->cur_limbo_) < this->max_size_)
    {
      // Obtain the next unique sequence number.
      long timer_id = this->timer_id ();

      // Obtain the memory to the new node.
      ACE_Timer_Node_T<TYPE> *temp = 0;

      ACE_ALLOCATOR_RETURN (temp,
                            this->alloc_node (),
                            -1);
      temp->set (type,
                 act,
                 future_time,
                 interval,
                 0,
                 timer_id);

      this->insert (temp);
      return timer_id;
    }
  else
    return -1;
}

// Locate and remove the single timer with a value of <timer_id> from
// the timer queue.

template <class TYPE, class FUNCTOR, class ACE_LOCK> int
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (long timer_id,
                                                   const void **act,
                                                   int dont_call)
{
  ACE_TRACE ("ACE_Timer_Heap_T::cancel");
  ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));

  // Locate the ACE_Timer_Node that corresponds to the timer_id.

  // Check to see if the timer_id is out of range
  if (timer_id < 0
      || (size_t) timer_id > this->max_size_)
    return 0;

  ssize_t timer_node_slot = this->timer_ids_[timer_id];

  // Check to see if timer_id is still valid.
  if (timer_node_slot < 0)
    return 0;

  if (timer_id != this->heap_[timer_node_slot]->get_timer_id ())
    {
      ACE_ASSERT (timer_id == this->heap_[timer_node_slot]->get_timer_id ());
      return 0;
    }
  else
    {
      ACE_Timer_Node_T<TYPE> *temp =
        this->remove (timer_node_slot);

      // Call the close hooks.
      int cookie = 0;

      // cancel_type() called once per <type>.
      this->upcall_functor ().cancel_type (*this,
                                           temp->get_type (),
                                           dont_call,
                                           cookie);

      // cancel_timer() called once per <timer>.
      this->upcall_functor ().cancel_timer (*this,
                                            temp->get_type (),
                                            dont_call,
                                            cookie);

      if (act != 0)
        *act = temp->get_act ();

      this->free_node (temp);
      return 1;
    }
}

// Locate and update the inteval on the timer_id

template <class TYPE, class FUNCTOR, class ACE_LOCK> int
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::reset_interval (long timer_id,
                                                           const ACE_Time_Value &interval)
{
  ACE_TRACE ("ACE_Timer_Heap_T::reset_interval");
  ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));

  // Locate the ACE_Timer_Node that corresponds to the timer_id.

  // Check to see if the timer_id is out of range
  if (timer_id < 0
      || (size_t) timer_id > this->max_size_)
    return -1;

  ssize_t timer_node_slot = this->timer_ids_[timer_id];

  // Check to see if timer_id is still valid.
  if (timer_node_slot < 0)
    return -1;

  if (timer_id != this->heap_[timer_node_slot]->get_timer_id ())
    {
      ACE_ASSERT (timer_id == this->heap_[timer_node_slot]->get_timer_id ());
      return -1;
    }
  else
    {
      // Reset the timer interval
      this->heap_[timer_node_slot]->set_interval (interval);
      return 0;
    }
}

// Locate and remove all values of <type> from the timer queue.

template <class TYPE, class FUNCTOR, class ACE_LOCK> int
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type,
                                                   int dont_call)
{
  ACE_TRACE ("ACE_Timer_Heap_T::cancel");
  ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1));

  int number_of_cancellations = 0;

  // Try to locate the ACE_Timer_Node that matches the timer_id.

  for (size_t i = 0; i < this->cur_size_; )
    {
      if (this->heap_[i]->get_type () == type)
        {
          ACE_Timer_Node_T<TYPE> *temp = this->remove (i);

          number_of_cancellations++;

          this->free_node (temp);

          // We reset to zero so that we don't miss checking any nodes
          // if a reheapify occurs when a node is removed.  There
          // may be a better fix than this, however.
          i = 0;
        }
      else
        i++;
    }

  // Call the close hooks.
  int cookie = 0;

  // cancel_type() called once per <type>.
  this->upcall_functor ().cancel_type (*this,
                                       type,
                                       dont_call,
                                       cookie);

  for (int j = 0;
       j < number_of_cancellations;
       ++j)
    {
      // cancel_timer() called once per <timer>.
      this->upcall_functor ().cancel_timer (*this,
                                            type,
                                            dont_call,
                                            cookie);
    }

  return number_of_cancellations;
}

// Returns the earliest node or returns 0 if the heap is empty.

template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T <TYPE> *
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void)
{
  ACE_TRACE ("ACE_Timer_Heap_T::remove_first");

  if (this->cur_size_ == 0)
    return 0;

  return this->remove (0);
}

template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_Timer_Node_T <TYPE> *
ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::get_first (void)
{
  ACE_TRACE ("ACE_Timer_Heap_T::get_first");

  return this->cur_size_ == 0 ? 0 : this->heap_[0];
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_TIMER_HEAP_T_CPP */


text:
package org.odlabs.wiquery.ui.position;

import org.odlabs.wiquery.core.resources.WiQueryJavaScriptResourceReference;
import org.odlabs.wiquery.core.ui.ICoreUIJavaScriptResourceReference;

/**
 * $Id: PositionJavaScriptResourceReference.java 1150 2011-08-02 10:09:02Z
 * hielke.hoeve@gmail.com $
 * <p>
 * References the JavaScript resource to get the position utilities.
 * </p>
 *
 * @author Julien Roche
 * @since 1.1
 */
public class PositionJavaScriptResourceReference extends WiQueryJavaScriptResourceReference
		implements ICoreUIJavaScriptResourceReference
{
	private static final long serialVersionUID = -4771815414204892357L;

	/**
	 * Singleton instance.
	 */
	private static PositionJavaScriptResourceReference instance =
		new PositionJavaScriptResourceReference();

	/**
	 * Builds a new instance of {@link PositionJavaScriptResourceReference}.
	 */
	private PositionJavaScriptResourceReference()
	{
		super(PositionJavaScriptResourceReference.class, "jquery.ui.position.js");
	}

	/**
	 * Returns the {@link PositionJavaScriptResourceReference} instance.
	 */
	public static PositionJavaScriptResourceReference get()
	{
		return instance;
	}
}


text:
/**
 * \file lower_if_to_cond_assign.cpp
 *
 * This attempts to flatten if-statements to conditional assignments for
 * GPUs with limited or no flow control support.
 *
 * It can't handle other control flow being inside of its block, such
 * as calls or loops.  Hopefully loop unrolling and inlining will take
 * care of those.
 *
 * Drivers for GPUs with no control flow support should simply call
 *
 *    lower_if_to_cond_assign(instructions)
 *
 * to attempt to flatten all if-statements.
 *
 * Some GPUs (such as i965 prior to gen6) do support control flow, but have a
 * maximum nesting depth N.  Drivers for such hardware can call
 *
 *    lower_if_to_cond_assign(instructions, N)
 *
 * to attempt to flatten any if-statements appearing at depth > N.
 */

#include "glsl_types.h"
#include "ir.h"
#include "program/hash_table.h"

namespace {

class ir_if_to_cond_assign_visitor : public ir_hierarchical_visitor {
public:
   ir_if_to_cond_assign_visitor(unsigned max_depth)
   {
      this->progress = false;
      this->max_depth = max_depth;
      this->depth = 0;

      this->condition_variables = hash_table_ctor(0, hash_table_pointer_hash,
						  hash_table_pointer_compare);
   }

   ~ir_if_to_cond_assign_visitor()
   {
      hash_table_dtor(this->condition_variables);
   }

   ir_visitor_status visit_enter(ir_if *);
   ir_visitor_status visit_leave(ir_if *);

   bool progress;
   unsigned max_depth;
   unsigned depth;

   struct hash_table *condition_variables;
};

} /* anonymous namespace */

bool
lower_if_to_cond_assign(exec_list *instructions, unsigned max_depth)
{
   if (max_depth == UINT_MAX)
      return false;

   ir_if_to_cond_assign_visitor v(max_depth);

   visit_list_elements(&v, instructions);

   return v.progress;
}

void
check_control_flow(ir_instruction *ir, void *data)
{
   bool *found_control_flow = (bool *)data;
   switch (ir->ir_type) {
   case ir_type_call:
   case ir_type_discard:
   case ir_type_loop:
   case ir_type_loop_jump:
   case ir_type_return:
      *found_control_flow = true;
      break;
   default:
      break;
   }
}

void
move_block_to_cond_assign(void *mem_ctx,
			  ir_if *if_ir, ir_rvalue *cond_expr,
			  exec_list *instructions,
			  struct hash_table *ht)
{
   foreach_list_safe(node, instructions) {
      ir_instruction *ir = (ir_instruction *) node;

      if (ir->ir_type == ir_type_assignment) {
	 ir_assignment *assign = (ir_assignment *)ir;

	 if (hash_table_find(ht, assign) == NULL) {
	    hash_table_insert(ht, assign, assign);

	    /* If the LHS of the assignment is a condition variable that was
	     * previously added, insert an additional assignment of false to
	     * the variable.
	     */
	    const bool assign_to_cv =
	       hash_table_find(ht, assign->lhs->variable_referenced()) != NULL;

	    if (!assign->condition) {
	       if (assign_to_cv) {
		  assign->rhs =
		     new(mem_ctx) ir_expression(ir_binop_logic_and,
						glsl_type::bool_type,
						cond_expr->clone(mem_ctx, NULL),
						assign->rhs);
	       } else {
		  assign->condition = cond_expr->clone(mem_ctx, NULL);
	       }
	    } else {
	       assign->condition =
		  new(mem_ctx) ir_expression(ir_binop_logic_and,
					     glsl_type::bool_type,
					     cond_expr->clone(mem_ctx, NULL),
					     assign->condition);
	    }
	 }
      }

      /* Now, move from the if block to the block surrounding it. */
      ir->remove();
      if_ir->insert_before(ir);
   }
}

ir_visitor_status
ir_if_to_cond_assign_visitor::visit_enter(ir_if *ir)
{
   (void) ir;
   this->depth++;

   return visit_continue;
}

ir_visitor_status
ir_if_to_cond_assign_visitor::visit_leave(ir_if *ir)
{
   /* Only flatten when beyond the GPU's maximum supported nesting depth. */
   if (this->depth-- <= this->max_depth)
      return visit_continue;

   bool found_control_flow = false;
   ir_assignment *assign;

   /* Check that both blocks don't contain anything we can't support. */
   foreach_list(n, &ir->then_instructions) {
      ir_instruction *then_ir = (ir_instruction *) n;
      visit_tree(then_ir, check_control_flow, &found_control_flow);
   }
   foreach_list(n, &ir->else_instructions) {
      ir_instruction *else_ir = (ir_instruction *) n;
      visit_tree(else_ir, check_control_flow, &found_control_flow);
   }
   if (found_control_flow)
      return visit_continue;

   void *mem_ctx = ralloc_parent(ir);

   /* Store the condition to a variable.  Move all of the instructions from
    * the then-clause of the if-statement.  Use the condition variable as a
    * condition for all assignments.
    */
   ir_variable *const then_var =
      new(mem_ctx) ir_variable(glsl_type::bool_type,
			       "if_to_cond_assign_then",
			       ir_var_temporary, glsl_precision_low);
   ir->insert_before(then_var);

   ir_dereference_variable *then_cond =
      new(mem_ctx) ir_dereference_variable(then_var);

   assign = new(mem_ctx) ir_assignment(then_cond, ir->condition);
   ir->insert_before(assign);

   move_block_to_cond_assign(mem_ctx, ir, then_cond,
			     &ir->then_instructions,
			     this->condition_variables);

   /* Add the new condition variable to the hash table.  This allows us to
    * find this variable when lowering other (enclosing) if-statements.
    */
   hash_table_insert(this->condition_variables, then_var, then_var);

   /* If there are instructions in the else-clause, store the inverse of the
    * condition to a variable.  Move all of the instructions from the
    * else-clause if the if-statement.  Use the (inverse) condition variable
    * as a condition for all assignments.
    */
   if (!ir->else_instructions.is_empty()) {
      ir_variable *const else_var =
	 new(mem_ctx) ir_variable(glsl_type::bool_type,
				  "if_to_cond_assign_else",
				  ir_var_temporary, glsl_precision_low);
      ir->insert_before(else_var);

      ir_dereference_variable *else_cond =
	 new(mem_ctx) ir_dereference_variable(else_var);

      ir_rvalue *inverse =
	 new(mem_ctx) ir_expression(ir_unop_logic_not,
				    then_cond->clone(mem_ctx, NULL));

      assign = new(mem_ctx) ir_assignment(else_cond, inverse);
      ir->insert_before(assign);

      move_block_to_cond_assign(mem_ctx, ir, else_cond,
				&ir->else_instructions,
				this->condition_variables);

      /* Add the new condition variable to the hash table.  This allows us to
       * find this variable when lowering other (enclosing) if-statements.
       */
      hash_table_insert(this->condition_variables, else_var, else_var);
   }

   ir->remove();

   this->progress = true;

   return visit_continue;
}


text:
/**
 * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v25.0.1
 * @link http://www.ag-grid.com/
 * @license MIT
 */
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var context_1 = require("../context/context");
var beanStub_1 = require("../context/beanStub");
var constants_1 = require("../constants/constants");
var generic_1 = require("../utils/generic");
var RowPositionUtils = /** @class */ (function (_super) {
    __extends(RowPositionUtils, _super);
    function RowPositionUtils() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    RowPositionUtils.prototype.getFirstRow = function () {
        var rowIndex = 0;
        var rowPinned;
        if (this.pinnedRowModel.getPinnedTopRowCount()) {
            rowPinned = constants_1.Constants.PINNED_TOP;
        }
        else if (this.rowModel.getRowCount()) {
            rowPinned = null;
            rowIndex = this.paginationProxy.getPageFirstRow();
        }
        else if (this.pinnedRowModel.getPinnedBottomRowCount()) {
            rowPinned = constants_1.Constants.PINNED_BOTTOM;
        }
        return rowPinned === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned };
    };
    RowPositionUtils.prototype.getLastRow = function () {
        var rowIndex;
        var rowPinned;
        var pinnedBottomCount = this.pinnedRowModel.getPinnedBottomRowCount();
        var pinnedTopCount = this.pinnedRowModel.getPinnedTopRowCount();
        if (pinnedBottomCount) {
            rowPinned = constants_1.Constants.PINNED_BOTTOM;
            rowIndex = pinnedBottomCount - 1;
        }
        else if (this.rowModel.getRowCount()) {
            rowPinned = null;
            rowIndex = this.paginationProxy.getPageLastRow();
        }
        else if (pinnedTopCount) {
            rowPinned = constants_1.Constants.PINNED_TOP;
            rowIndex = pinnedTopCount - 1;
        }
        return rowIndex === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned };
    };
    RowPositionUtils.prototype.getRowNode = function (gridRow) {
        switch (gridRow.rowPinned) {
            case constants_1.Constants.PINNED_TOP:
                return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex];
            case constants_1.Constants.PINNED_BOTTOM:
                return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex];
            default:
                return this.rowModel.getRow(gridRow.rowIndex);
        }
    };
    RowPositionUtils.prototype.sameRow = function (rowA, rowB) {
        // if both missing
        if (!rowA && !rowB) {
            return true;
        }
        // if only one missing
        if ((rowA && !rowB) || (!rowA && rowB)) {
            return false;
        }
        // otherwise compare (use == to compare rowPinned because it can be null or undefined)
        return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned;
    };
    // tests if this row selection is before the other row selection
    RowPositionUtils.prototype.before = function (rowA, rowB) {
        switch (rowA.rowPinned) {
            case constants_1.Constants.PINNED_TOP:
                // we we are floating top, and other isn't, then we are always before
                if (rowB.rowPinned !== constants_1.Constants.PINNED_TOP) {
                    return true;
                }
                break;
            case constants_1.Constants.PINNED_BOTTOM:
                // if we are floating bottom, and the other isn't, then we are never before
                if (rowB.rowPinned !== constants_1.Constants.PINNED_BOTTOM) {
                    return false;
                }
                break;
            default:
                // if we are not floating, but the other one is floating...
                if (generic_1.exists(rowB.rowPinned)) {
                    return rowB.rowPinned !== constants_1.Constants.PINNED_TOP;
                }
                break;
        }
        return rowA.rowIndex < rowB.rowIndex;
    };
    __decorate([
        context_1.Autowired('rowModel')
    ], RowPositionUtils.prototype, "rowModel", void 0);
    __decorate([
        context_1.Autowired('pinnedRowModel')
    ], RowPositionUtils.prototype, "pinnedRowModel", void 0);
    __decorate([
        context_1.Autowired('paginationProxy')
    ], RowPositionUtils.prototype, "paginationProxy", void 0);
    RowPositionUtils = __decorate([
        context_1.Bean('rowPositionUtils')
    ], RowPositionUtils);
    return RowPositionUtils;
}(beanStub_1.BeanStub));
exports.RowPositionUtils = RowPositionUtils;

//# sourceMappingURL=rowPosition.js.map


text:
namespace Microsoft.Zelig.CodeGeneration.IR.CompilationSteps.Phases
{
    using System;
    using System.Collections.Generic;

    using Microsoft.Zelig.Runtime.TypeSystem;

    //[PhaseDisabled()]
    [PhaseOrdering( ExecuteAfter=typeof(ApplyClassExtensions) )]
    public sealed class PrepareImplementationOfInternalMethods : PhaseDriver
    {
        //
        // State
        //

        internal ImplementInternalMethods m_state;

        //
        // Constructor Methods
        //

        public PrepareImplementationOfInternalMethods( Controller context ) : base ( context )
        {
            m_state = new ImplementInternalMethods( this.TypeSystem );
        }

        //
        // Helper Methods
        //

        public override PhaseDriver Run()
        {
            this.TypeSystem.BuildCrossReference();

            m_state.Prepare();

            DetectFieldInvariants.Execute( this.TypeSystem );

            return this.NextPhase;
        }
    }
}


text: require Rails.root.join("lib/resque.rb")


text:
using StageMaker.spell_maker.evaluators;
using StageMaker.spell_maker.models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static StageMaker.spell_maker.models.Value;

namespace StageMaker.spell_maker.parser
{
    public class VarsManager
    {
        public ValueEvaluator valueEvaluator { get; private set; }
        public Dictionary<string, Value> vars { get; private set; }

        public VarsManager(ValueEvaluator valueEvaluator)
        {
            vars = new Dictionary<string, Value>();
            this.valueEvaluator = valueEvaluator;
        }

        public void setValue(string name, string value, string type)
        {
            if (type == "FLOAT")
                setValue(name, value, Types.FLOAT);
            else if (type == "VECTOR")
                setValue(name, value, Types.VECTOR);
            else if (type == "STRING")
                setValue(name, value, Types.STRING);
            else
                throw new Exception("Type error.");
        }

        public void setValues(Dictionary<string, Value> values)
        {
            foreach(string key in values.Keys)
            {
                vars[key] = values[key];
            }
        }

        public void setValue(string name, string value, Types type)
        {
            object result = null;

            if (type == Types.FLOAT)
            {
                float f = valueEvaluator.evaluateArithmeticOperation(value);
                if (float.IsNaN(f))
                    result = null;
                else
                    result = f;
            }
            else if (type == Types.VECTOR)
                result = valueEvaluator.evaluateVector(value);
            else if (type == Types.STRING)
                result = valueEvaluator.evaluateString(value);
            else
                throw new Exception("Type error.");

            if (result != null)
                vars[name] = new Value(result, type);
            else
                throw new Exception("Value-Type error.");
        }

        public void updateValue(string name, string value)
        {
            Value var = getValue(name);
            if (var != null)
                setValue(name, value, var.type);
            else
                throw new Exception("Var doesn't exist.");
        }
        public void removeValue(string name)
        {
            vars.Remove(name);
        }

        public Value getValue(string name)
        {
            Value value = null;
            vars.TryGetValue(name, out value);
            return value;
        }
    }
}


text:
package io.freefair.spring.okhttp;

import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * A {@link Qualifier} annotation for {@link okhttp3.Interceptor OkHttp3-Interceptors}.
 *
 * @author Lars Grefer
 * @see ApplicationInterceptor
 */
@SuppressWarnings("WeakerAccess")
@Target({METHOD, FIELD, CONSTRUCTOR})
@Retention(RUNTIME)
@Qualifier
public @interface NetworkInterceptor {
}


text:
    <title>DeviceOrientationAbsolute all-null event test</title>

FAIL


text:
package eu.esco.demo.jobcvmatching.sesame;

import com.tenforce.exception.TenforceException;
import org.openrdf.model.Resource;
import org.openrdf.model.Statement;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.RepositoryResult;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Iterator;

public class StatementIterable implements Iterable<Statement> {
  private final StatementIterator statementIterator;

  public StatementIterable(RepositoryResult<Statement> statements) {
    statementIterator = new StatementIterator(statements);
  }

  @Override
  public Iterator<Statement> iterator() {
    return statementIterator;
  }

  public static StatementIterable list(RepositoryConnection connection) {
    return list(connection, null, null, null);
  }

  public static StatementIterable list(@Nonnull RepositoryConnection connection,
                                       @Nullable Resource subject,
                                       @Nullable URI property,
                                       @Nullable Value value) {
    try {
      return new StatementIterable(connection.getStatements(subject, property, value, false));
    }
    catch (RepositoryException e) {
      throw new TenforceException(e);
    }
  }

  private static class StatementIterator implements Iterator<Statement> {
    private final RepositoryResult<Statement> statements;

    private StatementIterator(RepositoryResult<Statement> statements) {
      this.statements = statements;
    }

    @Override
    public boolean hasNext() {
      try {
        return statements.hasNext();
      }
      catch (RepositoryException e) {
        throw new TenforceException(e);
      }
    }

    @Override
    public Statement next() {
      try {
        return statements.next();
      }
      catch (RepositoryException e) {
        throw new TenforceException(e);
      }
    }

    @Override
    public void remove() {
      throw new UnsupportedOperationException();
    }
  }

}


text:
package com.hkm.vdlsdk.client;

import android.os.AsyncTask;

import com.hkm.vdlsdk.Util;
import com.squareup.okhttp.logging.HttpLoggingInterceptor;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;

/**
 * Created by hesk on 21/1/16.
 */
public class ValidationChecker extends AsyncTask<Void, Void, Void> {
    private OkHttpClient client3;
    protected HttpLoggingInterceptor loglevel;
    protected okhttp3.Interceptor interceptor;
    protected String success;
    protected check_cb cb;
    protected boolean get_redirection_link;
    private final okhttp3.Call call;

    private okhttp3.Request.Builder universal_header(okhttp3.Request.Builder chain) {
        // chain.addHeader("Accept", "application/json");
        return chain;
    }

    private void createLogLevel() {
        loglevel = new HttpLoggingInterceptor();
        loglevel.setLevel(HttpLoggingInterceptor.Level.BODY);
    }

    private void createIntercept() {
        interceptor = new okhttp3.Interceptor() {
            @Override
            public okhttp3.Response intercept(Chain chain) throws IOException {
                okhttp3.Request newRequest = universal_header(chain.request().newBuilder()).build();
                return chain.proceed(newRequest);
            }
        };
    }

    private OkHttpClient createClient() {
        OkHttpClient.Builder b = new OkHttpClient().newBuilder();
        b.connectTimeout(10, TimeUnit.MINUTES);
        b.followRedirects(true);
        client3 = b.build();
        //  client3.interceptors().add(interceptor);
        //    client3.interceptors().add(loglevel);
        return client3;
    }

    private ValidationChecker(String url, check_cb checker) {
        createLogLevel();
        createIntercept();
        createClient();
        get_redirection_link = false;
        cb = checker;
        okhttp3.Request request = new okhttp3.Request.Builder()
                .url(Util.LinkConfirmer(url)).build();
        call = client3.newCall(request);
    }

    public static ValidationChecker general_validation_check(String url, check_cb checkcb) {
        ValidationChecker t = new ValidationChecker(url, checkcb);
        t.execute();
        return t;
    }

    public static ValidationChecker redirection_link_finder(String url, check_cb checkcb) {
        ValidationChecker t = new ValidationChecker(url, checkcb);
        t.setFollowingGetter();
        t.execute();
        return t;
    }

    private void setFollowingGetter() {
        get_redirection_link = true;
    }

    @Override
    protected Void doInBackground(Void[] params) {
        try {
            okhttp3.Response response = call.execute();
            if (response.isSuccessful() && response.code() == 200) {
                success = "valid link";
                if (get_redirection_link) {
                    success = response.headers().get("location");
                }
                return null;
            } else {
                throw new Exception("invalidate link");
            }
        } catch (UnknownHostException e) {
            success = e.getCause().getMessage();
            cancel(true);
        } catch (IOException e) {
            success = e.getCause().getMessage();
            cancel(true);
        } catch (Exception e) {
            success = e.getMessage();
            cancel(true);
        }
        return null;
    }

    @Override
    protected void onPostExecute(Void aVoid) {
        super.onPostExecute(aVoid);
        cb.success(success);
    }

    @Override
    protected void onCancelled(Void aVoid) {
        super.onCancelled(aVoid);
        cb.failture(success);
    }

    public interface check_cb {
        void success(String delivered_product);

        void failture(String failure);
    }

    public void cancel() {
        if (!isCancelled()) {
            call.cancel();
            cancel(true);
        }
    }

}


text:
require 'httparty'
require 'json'

module CricApi
  class Request
    include HTTParty
    base_uri 'https://apecricket.herokuapp.com'
    def initialize(service, page)
      @options = { query: {site: service, page: page} }
    end

    def cricket
      self.class.get("/api/cricket", @options)
    end

    def matches
      self.class.get("/api/matches", @options)
    end

    def matchCalendar
      self.class.get("/api/matchCalendar", @options)
    end

    def getNews
      self.class.get("/api/news", @options)
    end

    def cricketScore(id)
      self.class.post("/api/cricketScore",
      :body => {
        :unique_id => id
      }
      )
    end

    def playerStats(id)
      self.class.post("/api/playerStats",
      :body => {
        :pid => id
      }
      )
    end

    def ballByball(id)
      self.class.post("/api/ballByBall",
      :body => {
        :unique_id => id
      }
      )
    end

    def commentry(id)
      self.class.post("/api/commentry",
      :body => {
        :unique_id => id
      }
      )
    end

    def news(id)
      self.class.post("/api/news",
      :body => {
        :unique_id => id
      }
      )
    end

    def score(id)
      self.class.post("/api/score",
      :body => {
        :unique_id => id
      }
      )
    end

    def getLiveScores

      updates = []
      scores =  cricket
      data = scores['data']['data']
      data.each do |match|
        updates.push(cricketScore(match['unique_id']))
      end

      return updates

    end

    def liveUpdates

      match_update = cricket
      live_updates = matches

      live_updates['data']['matches'].each do |update|
        data = match_update['data']['data']
        for item in data
          if item['unique_id'] == update['unique_id']
            update['title'] = item['title']
            update['description'] = item['description']
          break;
          end
        end

      end
      return live_updates
    end

    def jsonRead(filename)
      file = File.read(filename)
      data_hash = JSON.parse(file)
      # file.close
      return data_hash
    end

    def match_ids
      match_update = cricket
      live_updates = matches
      unique_ids = match_update['data']['data'].collect{ |v| v['unique_id'] }
      all_matches = live_updates['data']['matches'].collect{ |v| v['unique_id']}
      ongng_match_ids = []
      remaining_match_ids = []
      all_matches.each do |id|
        matched = false
        unique_ids.each do |uid|
          if id == uid.to_i
          matched = true
          ongng_match_ids.push(uid.to_i)
          end
        end
        if !matched
        remaining_match_ids.push(id)
        end
      end

      match_ids = {
        "ongng_ids" => ongng_match_ids,
        "remaining_ids" => remaining_match_ids
      }

    end

    def match_response(ids)
      ongng_ids = ids['ongng_ids']
      new_ids = ids['remaining_ids']
      response = []
      new_resp = []

      # ongng_ids.each do |id|
      count = 0
      for id in ongng_ids
        count += 1
        resp = cricketScore(id)
        response.push(resp['data'])

        if count >5
          count = 0
          break
        end
      end

      for id in new_ids
      # new_ids.each do |id|
        count += 1
        if count >5
          break
        end
        resp = cricketScore(id)
        new_resp.push(resp['data'])
      end
      return {:ongng => response, :new_resp => new_resp }
    end

  end

end