text:
<?php
<<<<<<< HEAD

defined('BASEPATH') OR exit('No direct script access allowed');

class CobVeg extends CI_Controller {

=======
defined('BASEPATH') OR exit('No direct script access allowed');
class CobVeg extends CI_Controller{
>>>>>>> d0a6859f1ef8b7109fa3ed399f31b760f3406e20
    public function __construct() {
        parent::__construct();
        $this->load->model('CobVeg_model', 'cobveg');
    }
<<<<<<< HEAD

    public function index() {
        //$data_sim['necesidad']=$this->load->view('cobveg/simulacion/necesidad.php','',TRUE);
        $data['unidad'] = $this->view_unidades();
        //$data['simulacion']=$this->load->view('cobveg/simulacion.php',$data_sim,TRUE);
        $this->load->view('sitio/cobveg.php', $data);
    }

    //cargar unidades hidricas
    public function view_unidades() {
        $data['unidades'] = $this->cobveg->get_unidades();
        $vista = $this->load->view('cobveg/unidades.php', $data, TRUE);
        return $vista;
    }

    //cargar sectores por unidad hidrica
    public function view_sectores($unidad) {
        //$uni_id= $this->input->post('id');
        $data['encabezado'] = $this->cobveg->get_unidad($unidad);
        $data['sectores'] = $this->cobveg->get_sectores($unidad);
        $this->load->view('cobveg/sectores.php', $data);
    }

    //cargar el componente activa en base a la seccion y ecosistema
    public function view_activa($ecosistema, $sec_id) {
        $data = array();
        $data = array_merge($data, $this->plantacion($sec_id, $ecosistema));
        $data = array_merge($data, $this->seguimiento($sec_id, 'activa',$ecosistema));
        $data = array_merge($data, $this->get_txt_act($ecosistema));
        $this->load->view('cobveg/componentes/activa.php', $data);
    }
    //cargar el componente pasiva en base a la seccion y ecosistema
    public function view_pasiva($ecosistema, $sec_id) {
        $data = array();
        $data = array_merge($data, $this->cercado($sec_id, $ecosistema));
        $data = array_merge($data, $this->seguimiento($sec_id, 'pasiva',$ecosistema));
        $data = array_merge($data, $this->get_txt_pas($ecosistema));
        $this->load->view('cobveg/componentes/pasiva.php', $data);
    }

    //datos de plantacion y mantenimiento
    public function plantacion($sec_id, $ecosistema) {
        $data['plantacion'] = $this->cobveg->get_plantacion($sec_id, $ecosistema);
        $data['pla_man'] = $this->cobveg->get_pla_man($sec_id, $ecosistema);
        $data['tbl_plantacion'] = $this->load->view('cobveg/componentes/tbl_plantacion', '', TRUE);
        $data['tbl_pla_man'] = $this->load->view('cobveg/componentes/tbl_pla_man', '', TRUE);
        return $data;
    }

    //datos de cercado y mantenimiento
    public function cercado($sec_id, $ecosistema) {
        $data['cercado'] = $this->cobveg->get_cercado($sec_id, $ecosistema);
        $data['cer_man'] = $this->cobveg->get_cer_man($sec_id, $ecosistema);
        $data['tbl_cercado'] = $this->load->view('cobveg/componentes/tbl_cercado', '', TRUE);
        $data['tbl_cer_man'] = $this->load->view('cobveg/componentes/tbl_cer_man', '', TRUE);
        return $data;
    }

    //datos para el componente seguimiento
    public function seguimiento($sec_id, $fase,$ecosistema) {
        $seguimiento['fase'] = $fase;
        $seguimiento['sector'] = $sec_id;
        $seguimiento['ecosistema']=$ecosistema;
        $seguimiento['datos'] = $this->cobveg->get_coberturas_sector($sec_id, $fase,$ecosistema);
        $data['seguimiento'] = $this->load->view('cobveg/componentes/seguimiento', $seguimiento, TRUE);
        return $data;
    }
    //cargar la seccion paramo
    public function view_paramo($sec_id) {
        $data['sector'] = $this->cobveg->get_sector($sec_id);
        $this->load->view('cobveg/paramo.php', $data);
    }
    //cargar la seccion bosque
    public function view_bosque($sec_id) {
        //$sec_id=$this->input->post('sec_id');
        $data['sector'] = $this->cobveg->get_sector($sec_id);
        //$data['activa'] = $this->load->view('cobveg/bosque/activa.php', '', TRUE);
        //$data['pasiva'] = $this->load->view('cobveg/bosque/pasiva.php', '', TRUE);
        $this->load->view('cobveg/bosque.php', $data);
    }

    //cargar la seccion ripario
    public function view_ripario($sec_id) {
        //$sec_id=$this->input->post('sec_id');
        $data['sector'] = $this->cobveg->get_sector($sec_id);
        //$data['activa'] = $this->load->view('cobveg/ripario/activa.php', '', TRUE);
        //$data['pasiva'] = $this->load->view('cobveg/ripario/pasiva.php', '', TRUE);
        $this->load->view('cobveg/ripario.php', $data);
    }

    //cargar la seccion areas prioritarias
    public function view_areas($unidad) {
        $data_necesidad['unidad'] = $unidad;
        $data['necesidad'] = $this->load->view('cobveg/simulacion/necesidad.php', $data_necesidad, TRUE);
        $this->load->view('cobveg/areas', $data);
    }

    //vista de prueba
    public function view_informacion() {
        $this->load->view('cobveg/view_informacion');
    }

    //componente seguimiento para las secciones paramo, bosque y ripario
    public function view_seguimiento($sector, $fase,$ecosistema) {
        $data['sector'] = $sector;
        $data['fase'] = $fase;
        $data['datos'] = $this->cobveg->get_coberturas_sector($sector, $fase,$ecosistema);
        $this->load->view('cobveg/componentes/seguimiento', $data);
    }

    //componente simulacion con las capas por unidad hidrica
    public function view_coberturas_unidad($unidad, $demanda) {
        $data['datos'] = $this->cobveg->get_coberturas_unidad($unidad, $demanda);
        $data['unidad'] = $unidad;
        $data['demanda'] = $demanda;
        $this->load->view('cobveg/simulacion/simulacion', $data);
    }

    //componente escenario
    public function view_escenario($demanda, $precipitacion) {
        $data['guayllabamba'] = $this->cobveg->get_modelo('Guayllabamba', $demanda, $precipitacion);
        $data['napo'] = $this->cobveg->get_modelo('Napo', $demanda, $precipitacion);
        $data['demanda'] = $demanda;
        $data['precipitacion'] = $precipitacion;
        $data['introduccion'] = $this->get_txt_esc($precipitacion);
        $this->load->view('cobveg/componentes/escenario', $data);
    }

    //devolver lista de capas en formato json
    public function get_coberturas_unidad($unidad, $demanda) {
        $data = $this->cobveg->get_coberturas_unidad($unidad, $demanda);
        echo json_encode($data);
    }

    //devolver lista de capas de recuperacion en formato json
    public function get_coberturas_sector($sector, $fase,$ecosistema) {
        $data = $this->cobveg->get_coberturas_sector($sector, $fase,$ecosistema);
        echo json_encode($data);
    }

    //devolver lista de capas del modelo por demanda, precipitacion y cuenca en formato json
    public function get_coberturas_precipitacion($demanda, $precipitacion, $cuenca) {
        $data = $this->cobveg->get_coberturas_precipitacion($demanda, $precipitacion, $cuenca);
        echo json_encode($data);
    }
    //devolver lista de capas de recupracion por unidad en formato json
    public function get_recuperacion_unidad() {
        $data = $this->cobveg->get_recuperacion_unidad();
        echo json_encode($data);
    }

    //textos escenarios de la secion simulacion
    public function get_txt_esc($precipitacion) {
        switch ($precipitacion) {
            case 'actual':
                $texto = "Los resultados de la salida de información para este escenario están dados por la variable de estrés hídrico, considerando así que, para el escenario actual el estrés hídrico no tiene incremento de precipitación ni de demanda (P0D0).";
                break;
            case 'incremento':
                $texto = "Los resultados de la salida de información para una proyección donde el estrés hídrico resulta del incremento del 10% en precipitación y una mayor demanda (P+10D+).";
                break;
            case 'decremento':
                $texto = "Los resultados de la salida de información para una proyección donde el estrés hídrico resulta del decremento del 10% en precipitación y mayor demanda (P-10D+).";
                break;
            default:
                $texto = "No definido";
                break;
        }
        return $texto;
    }

    public function get_txt_act($ecosistema) {
        switch ($ecosistema) {
            case 'paramo':
                $texto['txt_sin'] = "Debido a que el incremento de las actividades humanas productivas en los Páramos está alternado significativamente su funcionalidad natural especialmente la hidrológica, el FONAG implementa actividades como la introducción de plántulas de especies forestales, arbustivas y herbáceas nativas alto andinas adaptadas al medio que aceleren la recuperación del ecosistema páramo, cuando la restauración pasiva no funciona o es demasiado lenta.";
                $texto['txt_pla'] = "Este tipo de recuperación se ejecuta cuando el ecosistema páramo es fuertemente degradado, se lo realiza con la utilización de especies nativas principalmente Polylepis sp. (Yagual) Chuquiragua sp. Gynoxys sp (Piquil), Loricaria thuyoides (Jata), Hypericum sp (Romerillo de páramo) entre otras, aplicando metodologías como tres bolillo, tipo célula y en marco real, que dependen del grado de degradación, pendiente, viento y tipo de suelo del sector.";
                $texto['txt_man'] = "Una vez realizada la restauración activa se espera un período de al menos dos años de adaptación de las plántulas a las condiciones climáticas y de tipo de suelo, para realizar una limpieza o un coronamiento en un radio de 50cm alrededor de las plantas, reducir la competencia y fomentar su crecimiento. Durante el transcurso del tiempo, dependiendo del sitio y estado de la plantación se programa podas y raleos para disminuir la densidad de los árboles y propiciar el ingreso natural de nuevas especies.";
                break;
            case 'bosque':
                $texto['txt_sin'] = "Los bosques andinos se desarrollan entre los 2800 y 3200 msnm y se distinguen por su amplia diversidad biológica. Debido al incremento de las actividades humanas productivas este ecosistema ha disminuido drásticamente. El FONAG busca su recuperación a través de la introducción de plántulas de especies forestales nativas y generar corredores forestales que ayuden a la conectividad de ecosistemas.";
                $texto['txt_pla'] = "Este tipo de recuperación se ejecuta cuando el ecosistema Bosque Andino está fuertemente degradado. Se utiliza especies nativas como: Oreopanax sp, Tecoma stans, Acacia melanoxilum, Alunus nepalensis, entre otras, aplicando metodologías como parches que vayan de acuerdo a las necesidades del terreno o en marco real, según el grado de degradación, pendiente, viento y tipo de suelo del sector.";
                $texto['txt_man'] = "Una vez realizada la restauración activa se espera un periodo de al menos un año de adaptación de las plántulas a las condiciones climáticas y de tipo de suelo, para realizar una limpieza o un coronamiento en un radio de 50cm alrededor de las plantas, para reducir la competencia y fomentar su crecimiento. Durante el transcurso del tiempo, dependiendo del sitio y estado de la plantación se pueden programar podas y raleos para disminuir la densidad de los árboles y propiciar el ingreso natural de nuevas especies.";
                break;
            case 'ripario':
                $texto['txt_sin'] = "Los hábitats vegetales de los márgenes y orillas de un río son de vital importancia debido al rol que desempeñan estabilizando y rehabilitando el suelo, motivo por el cual el FONAG busca su recuperación a través de la introducción de plántulas de especies forestales nativas al medio que aceleren la regeneración del ecosistema";
                $texto['txt_pla'] = "Este tipo de recuperación se ejecuta cuando el ecosistema ha sido fuertemente degradado y una regeneración natural ya no es posible, y se lo realiza con la utilización de especies hidrofílicas que dependerán del tipo de suelo, la topología y caudal del río, aplicando metodologías como: En parches entre 20 y 25 individuos que vayan de acuerdo a las necesidades del terreno, y la Marco real que se utiliza en caso no exista ningún tipo de vegetación y de esta manera evitar la sedimentación excesiva.";
                $texto['txt_man'] = "Una vez realizada la restauración activa se espera un periodo de al menos un año de adaptación de las plántulas a las condiciones climáticas y de tipo de suelo, para realizar una limpieza o un coronamiento en un radio de 50cm alrededor de las plantas, para reducir la competencia y fomentar su crecimiento. Durante el transcurso del tiempo, dependiendo del sitio y estado de la plantación se pueden programar podas y raleos para disminuir la densidad de los árboles y propiciar el ingreso natural de nuevas especies.";
                break;
            default:
                $texto['sintesis'] = "";
                $texto['plantacion'] = "No definido";
                $texto['mantenimiento'] = "";
                break;
        }
        return $texto;
    }

    public function get_txt_pas($ecosistema) {
        switch ($ecosistema) {
            case 'paramo':
                $texto['txt_sin'] = "Debido a que existen páramos que se encuentran en proceso de degradación, por actividades antropogénicas como la ganadería, el FONAG busca propiciar la restauración pasiva del ecosistema páramo a través de la regeneración natural, reducción de perturbaciones y la reducción de competencia con la implementación de cercados que limitan el ingreso de ganado.";
                $texto['txt_cer'] = "Actualmente el FONAG utiliza dos tipos de cercado; el primero un cercado eléctrico, que utiliza paneles solares, dos líneas alambre de acero y postes de plástico reciclado cada 30 m o menos dependiendo de la topología del sitio; y, el cercado tradicional con 4 líneas de alambre de púas y postes de pambil.";
                $texto['txt_man'] = "Debido a la constante presión del ganado en las cercas tradicional es necesario realizar un mantenimiento anual pues es común que se rompan las líneas de alambre por lo que se cambian los sectores afectados; para cercas eléctricas se realiza un cambio de batería en el panel y recolocación de postes de ser necesario.";
                break;
            case 'bosque':
                $texto['txt_sin'] = "Debido a que existen Bosques Andinos que se encuentran en proceso de degradación acelerado, por actividades antropogénicas como la ganadería, el FONAG busca propiciar la restauración pasiva del ecosistema a través de la regeneración natural, reducción de perturbaciones y la reducción de competencia con la implementación de cercados que limitan el ingreso principalmente de ganado.";
                $texto['txt_cer'] = "Se utilizan dos tipos de cercado, el primero un cercado eléctrico en el que se utilizan paneles solares, dos líneas alambre de acero y postes de plástico reciclado cada 30 m o menos, dependiendo de la topología del sitio, y el cercado tradicional con 6 líneas de alambre de púas y postes de pambil.";
                $texto['txt_man'] = "Debido a la constante presión del ganado en las cercas tradicionales es necesario realizar un mantenimiento anual de cercas, para el caso de cercas eléctricas se realiza un cambio de batería en el panel y recolocación de postes de ser necesario, para el caso es común que se rompan las líneas de alambre por lo que se hace un cambio de las mismas en los sectores afectados.";
                break;
            case 'ripario':
                $texto['txt_sin'] = "Debido a que existen Zonas Riparias que se encuentran en proceso de degradación acelerado por actividades antropogénicas como la ganadería pero que aún es posible una regeneración natural, el FONAG busca propiciar la restauración pasiva del ecosistema a través de la reducción de perturbaciones y la reducción de competencia con la implementación de cercados que limitan el ingreso principalmente de ganado.";
                $texto['txt_cer'] = "Actualmente el FONAG utiliza dos tipos de cercado, el primero se refiere a un cercado eléctrico en el que se utilizan paneles solares, dos líneas alambre de acero y postes de plástico reciclado cada 30 m o menos dependiendo de la topología del sitio, y el cercado tradicional con 4 líneas de alambre de púas y postes de pambil.";
                $texto['txt_man'] = "Debido a la constante presión del ganado en las cercas tradicionales es necesario realizar un mantenimiento anual de cercas, para el caso de cercas eléctricas se realiza un cambio de batería en el panel y recolocación de postes de ser necesario, para el caso es común que se rompan las líneas de alambre por lo que se hace un cambio de las mismas en los sectores afectados.";
                break;
            default:
                $texto['txt_sin'] = "";
                $texto['txt_cer'] = "No definido";
                $texto['txt_man'] = "";
                break;
        }
        return $texto;
    }

}
=======

    public function view_sectores() {
        $uni_id= $this->input->post('id');
        $data['encabezado']=$this->cobveg->get_unidad($uni_id);
        $data['sectores']= $this->cobveg->get_sectores($uni_id);
        $this->load->view('cobveg/sectores.php',$data);
    }
    public function view_paramo() {
        $sec_id=$this->input->post('sec_id');
        $data['sector']=$this->cobveg->get_sector($sec_id);
        $data['plantacion']= $this->cobveg->get_plantacion($sec_id);
        $this->load->view('cobveg/paramo.php',$data);
    }
}
>>>>>>> d0a6859f1ef8b7109fa3ed399f31b760f3406e20

redpajama_set_name: RedPajamaGithub


text:
Breaking changes:
* The `cookieJar` instance member is no longer available on sub resources. It can still be accessed on the top-level api object.

Additions:
* You can now optionally supply `modifyRequest(RequestObject) : RequestObject` as a third argument to `SilkApi`. This function, if present, will be called before every request and lets you modify the request object.

## 1.0.0

* Initial release, using API version `1.13.4`.


text:
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:

      module Pxpay
        class Notification < ActiveMerchant::Billing::Integrations::Notification
          include PostsData
          include RequiresParameters

          def initialize(query_string, options={})
            # PxPay appends ?result=...&userid=... to whatever return_url was specified, even if that URL ended with a ?query.
            # So switch the first ? if present to a &
            query_string[/\?/] = '&' if query_string[/\?/]
            super

            @encrypted_params = @params
            @params = {}

            requires! @encrypted_params, "result"
            requires! @options, :credential1, :credential2

            decrypt_transaction_result(@encrypted_params["result"])
          end

          # was the notification a validly formed request?
          def acknowledge
            @valid == '1'
          end

          def status
            return 'Failed' unless success?
            return 'Completed' if complete?
            'Error'
          end

          def complete?
            @params['TxnType'] == 'Purchase' && success?
          end

          def cancelled?
            !success?
          end

          # for field definitions see
          # http://www.paymentexpress.com/Technical_Resources/Ecommerce_Hosted/PxPay

          def success?
            @params['Success'] == '1'
          end

          def gross
            @params['AmountSettlement']
          end

          def currency
            @params['CurrencySettlement']
          end

          def account
            @params['userid']
          end

          def item_id
            @params['TxnId']
          end

          def currency_input
            @params['CurrencyInput']
          end

          def auth_code
            @params['AuthCode']
          end

          def card_type
            @params['CardName']
          end

          def card_holder_name
            @params['CardHolderName']
          end

          def card_number
            @params['CardNumber']
          end

          def expiry_date
            @params['DateExpiry']
          end

          def client_ip
            @params['ClientInfo']
          end

          def order_id
            item_id
          end

          def payer_email
            @params['EmailAddress']
          end

          def transaction_id
            @params['DpsTxnRef']
          end

          def settlement_date
            @params['DateSettlement']
          end

          # Indication of the uniqueness of a card number
          def txn_mac
            @params['TxnMac']
          end

          def message
            @params['ResponseText']
          end

          def optional_data
            [@params['TxnData1'],@fields['TxnData2'],@fields['TxnData3']]
          end

          # When was this payment was received by the client.
          def received_at
            settlement_date
          end

          # Was this a test transaction?
          def test?
            nil
          end

          private

          def decrypt_transaction_result(encrypted_result)
            request_xml = REXML::Document.new
            root = request_xml.add_element('ProcessResponse')

            root.add_element('PxPayUserId').text = @options[:credential1]
            root.add_element('PxPayKey').text = @options[:credential2]
            root.add_element('Response').text = encrypted_result

            @raw = ssl_post(Pxpay.token_url, request_xml.to_s)

            response_xml = REXML::Document.new(@raw)
            root = REXML::XPath.first(response_xml)
            @valid = root.attributes["valid"]
            @params = {}
            root.elements.each { |e| @params[e.name] = e.text }
          end

        end
      end
    end
  end
end


text:
#!/usr/bin/env node

'use strict';

/**
 * Module dependencies
 */

// Node.js core.
const fs = require('fs');
const path = require('path');

// Logger.
const logger = require('strapi-utils').logger;

/**
 * `$ strapi config`
 *
 * Read or create the RC file a $HOME to
 * use custom generators.
 */

module.exports = function () {
  const HOME = process.env[process.platform === 'win32' ? 'USERPROFILE' : 'HOME'];

  fs.access(path.resolve(HOME, '.strapirc'), fs.F_OK | fs.R_OK | fs.W_OK, err => {
    if (err) {
      if (err.code === 'ENOENT') {
        fs.writeFile(path.resolve(HOME, '.strapirc'), JSON.stringify({
          generators: {}
        }, null, '\t'), err => {
          if (err) {
            logger.error('Impossible to write the `.strapirc` file at `' + HOME + '`');
            logger.error('Please check read/write permissions before execute `$ strapi config`');
            logger.error('You can manually create the file at `' + HOME + '`');
          } else {
            logger.info('Global configuration file successfully created at `' + HOME + '`');
            logger.info('Please read http://strapi.io/documentation/customization to learn more');
          }
          process.exit(1);
        });
      } else if (err.code === 'EACCES') {
        logger.error('Impossible to access the `.strapirc` file at `' + HOME + '`');
        logger.error('Please check read/write permissions before execute `$ strapi config`');
        logger.error('You can manually create the file at `' + HOME + '`');
        process.exit(1);
      }
    } else {
      logger.warn('Looks like the configuration file already exists at `' + HOME + '`');
      process.exit(0);
    }
  });
};


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
 * This package contains the implementation classes for AzureStackManagementClient.
 * Azure Stack.
 */
package com.microsoft.azure.management.azurestack.v2017_06_01.implementation;


text:
/// <reference path="../../../Metronic/metronic/assets/global/scripts/metronic.js" />
(function ($) {
    jQuery.fn.extend({
        formWizard: function () {
            if (!jQuery().bootstrapWizard) {
                return;
            }

            var form_wizard = $(this);

            var handleTitle = function (tab, navigation, index) {
                var total = navigation.find('li').length;
                var current = index + 1;
                // set wizard title
                $('.step-title', form_wizard).text(app.localization.Global.Wizard_StepTitle.format(index + 1, total));
                // set done steps
                jQuery('li', form_wizard).removeClass("done");

                var li_list = navigation.find('li');
                for (var i = 0; i < index; i++) {
                    jQuery(li_list[i]).addClass("done");
                }

                if (current == 1) {
                    form_wizard.find('.button-previous').hide();
                } else {
                    form_wizard.find('.button-previous').show();
                }

                if (current >= total) {
                    form_wizard.find('.button-next').hide();
                    form_wizard.find('.button-submit').show();
                } else {
                    form_wizard.find('.button-next').show();
                    form_wizard.find('.button-submit').hide();
                }
                Metronic.scrollTo(form_wizard.closest('.portlet'), -20);
            }

            return form_wizard.bootstrapWizard({
                'nextSelector': '.button-next',
                'previousSelector': '.button-previous',
                onNext: function (tab, navigation, index) {
                    form_wizard.trigger({ type: 'next', tab: tab, navigation: navigation, index: index });

                    form_wizard.find('input').addClass('ignore');
                    $('.tab-content .active input', form_wizard).removeClass('ignore');

                    form_wizard.find('input').removeClass('ignore');

                    handleTitle(tab, navigation, index);
                },
                onPrevious: function (tab, navigation, index) {
                    form_wizard.trigger({ type: 'previous', tab: tab, navigation: navigation, index: index });

                    handleTitle(tab, navigation, index);
                },
                onLast: function (tab, navigation, index) {
                    form_wizard.trigger({ type: 'last', tab: tab, navigation: navigation, index: index });
                },
                onFirst: function () {
                    form_wizard.trigger({ type: 'first', tab: tab, navigation: navigation, index: index });
                },
                onTabChange: function (tab, navigation, index, clickedIndex) {
                    form_wizard.trigger({ type: 'tabChange', tab: tab, navigation: navigation, index: index, clickedIndex: clickedIndex });
                },
                onTabClick: function (tab, navigation, index, clickedIndex) {
                    form_wizard.trigger({ type: 'tabClick', tab: tab, navigation: navigation, index: index, clickedIndex: clickedIndex });

                    handleTitle(tab, navigation, clickedIndex);
                },
                onTabShow: function (tab, navigation, index) {
                    form_wizard.trigger({ type: 'tabShow', tab: tab, navigation: navigation, index: index });

                    var total = navigation.find('li').length;
                    var current = index + 1;
                    var $percent = (current / total) * 100;
                    form_wizard.find('.progress-bar').css({
                        width: $percent + '%'
                    });
                }
            });
        }
    });
})(jQuery);


text:
const mongoose = require('mongoose');

let Trans = require('../models/transaction');
let Request = require('../models/request');
let User = require('../models/user');
let login = require('../helpers/login');
let contact = require('../helpers/contact');
// pas dia approve
let PropertySell = require('../models/propertySell');
let PropertyRent = require('../models/propertyRent');

const checkAuth = (req,res, next) => {
  let method = req.method;
  // let hasParam = req.path !== '/';

  if (req.headers.hasOwnProperty('token')){
    let decoded = login.getUserDetail(req.headers.token);
    if (decoded) next();
    else res.send({err:'You must login'})
  } else res.send({err:'You must login'})
}

const getRequests = (req,res) => {
  let decoded = login.getUserDetail(req.headers.token);
  if (decoded) {
    Request.find({}, (err,requests) => {
      res.send(err ? err : requests);
    })
  } else res.send({err: 'You dont have access'})

}

const getRequestsByBuyer = (req,res) => {
  let decoded = login.getUserDetail(req.headers.token);

  Request.find({_userId: decoded._id})
  .populate('_userId _sellerId')
  .populate('connections._propertyId')
  .exec( (err,requests) => {
    let filtered = requests.filter(rq => {if(rq._userId !== null && rq._sellerId !== null && rq.connections._propertyId !== null) {return rq} })
    res.send(err? {err:err} : filtered );
  })

}
const getRequestsBySeller = (req,res) => {
  let decoded = login.getUserDetail(req.headers.token);

  Request.find({_sellerId: decoded._id})
  // .populate('_userId _sellerId')
  .populate({path:'_userId', select:'phone username email name _id'})
  .populate({path:'_sellerId', select:'phone username email name _id'})
  .populate('connections._propertyId')
  .exec( (err,requests) => {
    let filtered = requests.filter(rq => {if(rq._userId !== null && rq._sellerId !== null && rq.connections._propertyId !== null) {return rq} })
    res.send(err? {err:err} : filtered );
  })
}

const getRequest = (req,res) => {
  let decoded = login.getUserDetail(req.headers.token);
  let id = req.params.id;
  Request.findById(id)
  .populate('_sellerId _userId')
  .populate('connections._propertyId')
  .exec( (err,request) => {
    if (err) res.send(err)
    else if (request._sellerId._id == decoded._id || request._userId._id == decoded._id || decoded.role === 'admin') res.send(request)
    else res.send({err:'You dont have access'})
  })
}

const addRequest = (req,res) => {
  let requestDt = req.body;
  let decoded = login.getUserDetail(req.headers.token);
  requestDt._userId = decoded._id;
  let Prop = requestDt.kind == 'PropertyRent' ? PropertyRent: PropertySell;
  if (requestDt._sellerId === requestDt._userId) res.send({err:'You cant rent/sell your own product'})
  else {

    let body =  (typeof requestDt.note !== 'undefined' && requestDt.note !== '' ? requestDt.note: 'You got a request!')
    let msg = {
      subject: 'There is a request for you',
      body: body
    }

    Prop.findById(requestDt._propertyId)
    .populate({path:'_ownerId', select:'phone username email name'})
    .exec((err,prop)=>{
      if (err){ res.send({err: 'Invalid Property'}); }
      // else if(requestDt.kind === 'PropertyRent'){
        // let start = new Date(requestDt['connections.start']);
        // let end = new Date(requestDt['connections.end']);
        //cek ketersediaan
        // let idx = prop.renter.findIndex(r => ( (start >= r.start && start <= r.end) || (end >= r.start && end <= r.end)  ))
        // if (idx > -1) res.send({err:'Booking Date are not available'})
      // }

      let newrequest = new Request({
        note: requestDt.note,
        connections: {
          kind: requestDt.kind,
          _propertyId: requestDt._propertyId
        },
        _sellerId : requestDt._sellerId,
        _userId: requestDt._userId
      });
      // console.log(prop._ownerId);
      newrequest.save((err,request) => {
        if (err) res.send({err:err})
        else {
          // console.log(prop._ownerId);
          if (typeof prop._ownerId !== 'undefined') {
            contact.contact(prop._ownerId,msg);

          }
          res.send(request);

        }
      })
    })

  }
}

const deleteRequest = (req,res) => {
  let requestDt = req.body;
  let decoded = login.getUserDetail(req.headers.token);
  let id = req.params.id;

  // Request.collection.drop();

  Request.findById(id, (err,request) => {
    if (err) res.send({err: 'Invalid Request'})
    else if (request._sellerId != decoded._id && decoded.role !== 'admin') res.send({err:'Invalid access'});
    else {
      let subject = 'Your request is ' +requestDt.response;
      let msg = { subject: subject  }
      User.findById(request._userId, (err,user)=> {
        // console.log('masuk find by id')
        if (err) res.send({err:err})
        else if (requestDt.response === 'approved') {
          msg.body = `Your request has been approved. For further information please contact ${decoded.name} - ${decoded.phone} / ${decoded.email}`

          let transDt = req.body;
          transDt._userId = request._userId;
          transDt._sellerId = decoded._id;
          let trans = new Trans(transDt);

          let Prop = request.connections.kind === 'PropertyRent'? PropertyRent : PropertySell;

          Prop.findById( request.connections._propertyId, (err,prop) => {
            if (err) res.send({err : 'Invalid Property'});
            else {
            // else if (request.connections.kind === 'PropertyRent') {
              // let idx = prop.renter.findIndex(r => ( (start >= r.start && start <= r.end) || (end >= r.start && end <= r.end)  ))
              // if (idx > -1) res.send({err:'Booking Date are not available'})
              // else {
                // trans.connections.detail = {
                //     start: request.connections.detail.start,
                //     end: request.connections.detail.end
                //   }
                trans.save((err,newtrans) => {
                  if (err) {
                    let err_msg = [];
                    for (let error in err.errors) err_msg.push(err.errors[error].message);
                    res.send({err : err_msg.join(',')});
                  }
                  // else {
                    // prop.renter.push({
                    //   start: request.connections.detail.start,
                    //   end: request.connections.detail.end,
                    //   _renterId: request._userId
                    // });
                    // prop.rentercount = prop.rentercount + 1;
                    // prop.save((err,nprop) => {
                    //   res.send(err? {err:err} : newtrans);
                    //   contact.contact(user,msg);
                    // })
                  // }
                })
              // }
            }
            //else valid
          })
          //end propertyFindById
        }
        else {
          msg.body = `Your request has been rejected `;
          msg.body += (typeof requestDt.note === 'undefined' || requestDt.note === '') ? '': `because ${requestDt.note}`;

        }
        // console.log(user);

        request.remove((err,deleted) => {
          if (err) {res.send({err : err});}
          else {
            contact.contact(user,msg);
            res.send(deleted)
          }
        })

      })
      //end UserfindById
    }
  })
}

module.exports = {
  getRequests,
  getRequest,
  addRequest,
  deleteRequest,
  getRequestsByBuyer,
  getRequestsBySeller,
  checkAuth
}


text:
/*
 * Created on 07-Mar-2005
 */
package sim.collections;

import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.SortedMap;
import java.util.TreeMap;

import sim.main.Global;
import sim.net.overlay.dht.NodeAddressPair;

/**
 * @author Andrew Brampton
 */
public class NumberSet<T extends Number> implements Iterable<T>, Collection<T> {

	// TODO Why is this a SortedMap, not a SortedSet?
	protected SortedMap<T, T> set;

	public NumberSet() {
		set = new TreeMap<T, T>();
	}

	public NumberSet(final Comparator<T> compare) {
		set = new TreeMap<T, T>(compare);
	}

	/**
	 * Finds the T that represents the number ID
	 * If found T is returned, otherwise null
	 * @param ID
	 * @return
	 */
	public T find(final long ID) {
		return set.get(new NodeAddressPair(ID));
	}

	/**
	 * Finds the numerically closest peer
	 * @param ID
	 * @return
	 */
	public T findNumClosest(final long ID) {
		long diff = Long.MAX_VALUE;
		long bestDiff = Long.MAX_VALUE;

		T pair = null;
		T bestPair = null;

		Iterator<T> i = iterator();

		while (i.hasNext()) {
			pair = i.next();

			diff = Math.abs(pair.longValue() - ID);

			if (diff < bestDiff) {
				bestDiff = diff;
				bestPair = pair;
			}

		}

		return bestPair;
	}

	/**
	 * @param o
	 * @return
	 */
	public boolean add(final T o) {

		if (Global.debug_extra_sanity) {
			if (o == null)
				throw new RuntimeException("Nulls not allowed");
		}

		if (set.put(o, o) == o)
			return false;

		return true;
	}

	/**
	 * @param o
	 * @return
	 */
	public boolean addAll(final Collection<? extends T> c) {

		boolean ret = false;
		Iterator<? extends T> i = c.iterator();
		while (i.hasNext()) {
			ret |= add(i.next());
		}

		return ret;
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#removeAll(java.util.Collection)
	 */
	public boolean removeAll(final Collection<?> c) {
		boolean ret = false;
		Iterator<?> i = c.iterator();
		while (i.hasNext()) {
			ret |= remove(i.next());
		}

		return ret;
	}

	/**
	 *
	 */
	public void clear() {
		set.clear();
	}

	/**
	 * @param o
	 * @return
	 */
	public boolean contains(final T o) {
		return set.containsKey(o);
	}

	/**
	 * @return
	 */
	public T first() {
		return set.firstKey();
	}

	/**
	 * @return
	 */
	public T last() {
		return set.lastKey();
	}

	/**
	 * @return
	 */
	public boolean isEmpty() {
		return set.isEmpty();
	}

	/**
	 * @return
	 */
	public Iterator<T> iterator() {
		return set.keySet().iterator();
	}

	/**
	 * @param o
	 * @return
	 */
	public boolean remove(final T o) {
		return remove((Object)o);
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#remove(java.lang.Object)
	 */
	public boolean remove(final Object o) {
		return set.remove(o) != null;
	}

	/**
	 * @return
	 */
	public int size() {
		return set.size();
	}

	/**
	 * @return
	 */
	public T random() {

		if (isEmpty())
			return null;

		int idx = Global.rand.nextInt(set.size());

		Iterator<T> i = iterator();
		while (idx > 0) {
			i.next();
			idx--;
		}

		return i.next();
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#contains(java.lang.Object)
	 */
	public boolean contains(final Object o) {
		return set.containsKey(o);
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#toArray()
	 */
	public Object[] toArray() {
		throw new RuntimeException("Not implemented");
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#toArray(T[])
	 */
	@SuppressWarnings("hiding")
	public <T> T[] toArray(final T[] a) {
		throw new RuntimeException("Not implemented");
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#containsAll(java.util.Collection)
	 */
	public boolean containsAll(final Collection<?> c) {
		throw new RuntimeException("Not implemented");
	}

	/* (non-Javadoc)
	 * @see java.util.Collection#retainAll(java.util.Collection)
	 */
	public boolean retainAll(final Collection<?> c) {
		throw new RuntimeException("Not implemented");
	}

	@Override
	public String toString() {
		return set.toString();
	}

}


text: from pyface.action.action_event import *


text:
package model;

public class Variable extends Value {

    private String name;
    private Value<?> value;

    public Variable(String name) {
        super(-1);
        this.name = name;
    }

    public String getName(){
        return name;
    }

    public void setValue(Value<?> v){
        this.value = v;
    }

    public Value<?> value(){
        return value;
    }
}


text:
    <meta itemprop="name" content="TensorFlow Datasets" />

  <meta itemprop="name" content="wit" />
  <meta itemprop="description" content="Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual
dataset. WIT is composed of a curated set of 37.6 million entity rich image-text
examples with 11.5 million unique images across 108 Wikipedia languages. Its
size enables WIT to be used as a pretraining dataset for multimodal machine
learning models.

To use this dataset:

```python
import tensorflow_datasets as tfds

ds = tfds.load('wit', split='train')
for ex in ds.take(4):
  print(ex)
```

See [the guide](https://www.tensorflow.org/datasets/overview) for more
informations on [tensorflow_datasets](https://www.tensorflow.org/datasets).

" />
  <meta itemprop="url" content="https://www.tensorflow.org/datasets/catalog/wit" />
  <meta itemprop="sameAs" content="https://github.com/google-research-datasets/wit/" />
  <meta itemprop="citation" content="@article{srinivasan2021wit,
  title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},
  author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},
  journal={arXiv preprint arXiv:2103.01913},
  year={2021}
}" />

# `wit`

*   **Description**:

Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual
dataset. WIT is composed of a curated set of 37.6 million entity rich image-text
examples with 11.5 million unique images across 108 Wikipedia languages. Its
size enables WIT to be used as a pretraining dataset for multimodal machine
learning models.

*   **Additional Documentation**:

    Explore on Papers With Code
     north_east

*   **Homepage**:
    [https://github.com/google-research-datasets/wit/](https://github.com/google-research-datasets/wit/)

*   **Source code**:
    [`tfds.vision_language.wit.Wit`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/vision_language/wit/wit.py)

*   **Versions**:

    *   `1.0.0`: Initial release. It loads the WIT dataset from
        https://storage.googleapis.com/gresearch/wit/
    *   **`1.1.0`** (default): Added `val` and `test` splits.

*   **Download size**: `25.20 GiB`

*   **Dataset size**: `81.17 GiB`

*   **Auto-cached**
    ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):
    No

*   **Splits**:

Split     | Examples
:-------- | ---------:
`'test'`  | 210,166
`'train'` | 37,046,386
`'val'`   | 261,024

*   **Feature structure**:

```python
FeaturesDict({
    'attribution_passes_lang_id': bool,
    'caption_alt_text_description': Text(shape=(), dtype=object),
    'caption_attribution_description': Text(shape=(), dtype=object),
    'caption_reference_description': Text(shape=(), dtype=object),
    'context_page_description': Text(shape=(), dtype=object),
    'context_section_description': Text(shape=(), dtype=object),
    'hierarchical_section_title': Text(shape=(), dtype=object),
    'image_url': Text(shape=(), dtype=object),
    'is_main_image': bool,
    'language': Text(shape=(), dtype=object),
    'mime_type': Text(shape=(), dtype=object),
    'original_height': int32,
    'original_width': int32,
    'page_changed_recently': bool,
    'page_title': Text(shape=(), dtype=object),
    'page_url': Text(shape=(), dtype=object),
    'section_title': Text(shape=(), dtype=object),
})
```

*   **Feature documentation**:

Feature                         | Class        | Shape | Dtype  | Description
:------------------------------ | :----------- | :---- | :----- | :----------
                                | FeaturesDict |       |        |
attribution_passes_lang_id      | Tensor       |       | bool   |
caption_alt_text_description    | Text         |       | object |
caption_attribution_description | Text         |       | object |
caption_reference_description   | Text         |       | object |
context_page_description        | Text         |       | object |
context_section_description     | Text         |       | object |
hierarchical_section_title      | Text         |       | object |
image_url                       | Text         |       | object |
is_main_image                   | Tensor       |       | bool   |
language                        | Text         |       | object |
mime_type                       | Text         |       | object |
original_height                 | Tensor       |       | int32  |
original_width                  | Tensor       |       | int32  |
page_changed_recently           | Tensor       |       | bool   |
page_title                      | Text         |       | object |
page_url                        | Text         |       | object |
section_title                   | Text         |       | object |

*   **Supervised keys** (See
    [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):
    `None`

*   **Figure**
    ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):
    Not supported.

*   **Examples**
    ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

{% framebox %}

<button id="displaydataframe">Display examples...</button>

{% endframebox %}

*   **Citation**:

```
@article{srinivasan2021wit,
  title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},
  author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},
  journal={arXiv preprint arXiv:2103.01913},
  year={2021}
}
```


text:
SYNONYM

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

#### Published in
Bull. Herb. Boissier 4: 91 (1896)

#### Original name
Parmelia myriotrema Müll. Arg.

### Remarks
null


text:
<?php

namespace common\models;

/**
 * This is the ActiveQuery class for [[WishlistDetails]].
 *
 * @see WishlistDetails
 */
class WishlistDetailsQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        return $this->andWhere('[[status]]=1');
    }*/

    /**
     * @inheritdoc
     * @return WishlistDetails[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return WishlistDetails|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


text:
/**
 * @requires OpenLayers/Control.js
 * @requires OpenLayers/Control/Button.js
 */

/**
 * Class: OpenLayers.Control.NavigationHistory
 * A navigation history control.  This is a meta-control, that creates two
 *     dependent controls: <previous> and <next>.  Call the trigger method
 *     on the <previous> and <next> controls to restore previous and next
 *     history states.  The previous and next controls will become active
 *     when there are available states to restore and will become deactive
 *     when there are no states to restore.
 *
 * Inherits from:
 *  - <OpenLayers.Control>
 */
OpenLayers.Control.NavigationHistory = OpenLayers.Class(OpenLayers.Control, {

    /**
     * Property: type
     * {String} Note that this control is not intended to be added directly
     *     to a control panel.  Instead, add the sub-controls previous and
     *     next.  These sub-controls are button type controls that activate
     *     and deactivate themselves.  If this parent control is added to
     *     a panel, it will act as a toggle.
     */
    type: OpenLayers.Control.TYPE_TOGGLE,

    /**
     * APIProperty: previous
     * {<OpenLayers.Control>} A button type control whose trigger method restores
     *     the previous state managed by this control.
     */
    previous: null,

    /**
     * APIProperty: previousOptions
     * {Object} Set this property on the options argument of the constructor
     *     to set optional properties on the <previous> control.
     */
    previousOptions: null,

    /**
     * APIProperty: next
     * {<OpenLayers.Control>} A button type control whose trigger method restores
     *     the next state managed by this control.
     */
    next: null,

    /**
     * APIProperty: nextOptions
     * {Object} Set this property on the options argument of the constructor
     *     to set optional properties on the <next> control.
     */
    nextOptions: null,

    /**
     * APIProperty: limit
     * {Integer} Optional limit on the number of history items to retain.  If
     *     null, there is no limit.  Default is 50.
     */
    limit: 50,

    /**
     * APIProperty: autoActivate
     * {Boolean} Activate the control when it is added to a map.  Default is
     *     true.
     */
    autoActivate: true,

    /**
     * Property: clearOnDeactivate
     * {Boolean} Clear the history when the control is deactivated.  Default
     *     is false.
     */
    clearOnDeactivate: false,

    /**
     * Property: registry
     * {Object} An object with keys corresponding to event types.  Values
     *     are functions that return an object representing the current state.
     */
    registry: null,

    /**
     * Property: nextStack
     * {Array} Array of items in the history.
     */
    nextStack: null,

    /**
     * Property: previousStack
     * {Array} List of items in the history.  First item represents the current
     *     state.
     */
    previousStack: null,

    /**
     * Property: listeners
     * {Object} An object containing properties corresponding to event types.
     *     This object is used to configure the control and is modified on
     *     construction.
     */
    listeners: null,

    /**
     * Property: restoring
     * {Boolean} Currently restoring a history state.  This is set to true
     *     before calling restore and set to false after restore returns.
     */
    restoring: false,

    /**
     * Constructor: OpenLayers.Control.NavigationHistory
     *
     * Parameters:
     * options - {Object} An optional object whose properties will be used
     *     to extend the control.
     */
    initialize: function(options) {
        OpenLayers.Control.prototype.initialize.apply(this, [options]);

        this.registry = OpenLayers.Util.extend({
            "moveend": this.getState
        }, this.registry);

        var previousOptions = {
            trigger: OpenLayers.Function.bind(this.previousTrigger, this),
            displayClass: this.displayClass + " " + this.displayClass + "Previous"
        };
        OpenLayers.Util.extend(previousOptions, this.previousOptions);
        this.previous = new OpenLayers.Control.Button(previousOptions);

        var nextOptions = {
            trigger: OpenLayers.Function.bind(this.nextTrigger, this),
            displayClass: this.displayClass + " " + this.displayClass + "Next"
        };
        OpenLayers.Util.extend(nextOptions, this.nextOptions);
        this.next = new OpenLayers.Control.Button(nextOptions);

        this.clear();
    },

    /**
     * Method: onPreviousChange
     * Called when the previous history stack changes.
     *
     * Parameters:
     * state - {Object} An object representing the state to be restored
     *     if previous is triggered again or null if no previous states remain.
     * length - {Integer} The number of remaining previous states that can
     *     be restored.
     */
    onPreviousChange: function(state, length) {
        if(state && !this.previous.active) {
            this.previous.activate();
        } else if(!state && this.previous.active) {
            this.previous.deactivate();
        }
    },

    /**
     * Method: onNextChange
     * Called when the next history stack changes.
     *
     * Parameters:
     * state - {Object} An object representing the state to be restored
     *     if next is triggered again or null if no next states remain.
     * length - {Integer} The number of remaining next states that can
     *     be restored.
     */
    onNextChange: function(state, length) {
        if(state && !this.next.active) {
            this.next.activate();
        } else if(!state && this.next.active) {
            this.next.deactivate();
        }
    },

    /**
     * APIMethod: destroy
     * Destroy the control.
     */
    destroy: function() {
        OpenLayers.Control.prototype.destroy.apply(this);
        this.previous.destroy();
        this.next.destroy();
        this.deactivate();
        for(var prop in this) {
            this[prop] = null;
        }
    },

    /**
     * Method: setMap
     * Set the map property for the control and <previous> and <next> child
     *     controls.
     *
     * Parameters:
     * map - {<OpenLayers.Map>}
     */
    setMap: function(map) {
        this.map = map;
        this.next.setMap(map);
        this.previous.setMap(map);
    },

    /**
     * Method: draw
     * Called when the control is added to the map.
     */
    draw: function() {
        OpenLayers.Control.prototype.draw.apply(this, arguments);
        this.next.draw();
        this.previous.draw();
    },

    /**
     * Method: previousTrigger
     * Restore the previous state.  If no items are in the previous history
     *     stack, this has no effect.
     *
     * Returns:
     * {Object} Item representing state that was restored.  Undefined if no
     *     items are in the previous history stack.
     */
    previousTrigger: function() {
        var current = this.previousStack.shift();
        var state = this.previousStack.shift();
        if(state != undefined) {
            this.nextStack.unshift(current);
            this.previousStack.unshift(state);
            this.restoring = true;
            this.restore(state);
            this.restoring = false;
            this.onNextChange(this.nextStack[0], this.nextStack.length);
            this.onPreviousChange(
                this.previousStack[1], this.previousStack.length - 1
            );
        } else {
            this.previousStack.unshift(current);
        }
        return state;
    },

    /**
     * APIMethod: nextTrigger
     * Restore the next state.  If no items are in the next history
     *     stack, this has no effect.  The next history stack is populated
     *     as states are restored from the previous history stack.
     *
     * Returns:
     * {Object} Item representing state that was restored.  Undefined if no
     *     items are in the next history stack.
     */
    nextTrigger: function() {
        var state = this.nextStack.shift();
        if(state != undefined) {
            this.previousStack.unshift(state);
            this.restoring = true;
            this.restore(state);
            this.restoring = false;
            this.onNextChange(this.nextStack[0], this.nextStack.length);
            this.onPreviousChange(
                this.previousStack[1], this.previousStack.length - 1
            );
        }
        return state;
    },

    /**
     * APIMethod: clear
     * Clear history.
     */
    clear: function() {
        this.previousStack = [];
        this.previous.deactivate();
        this.nextStack = [];
        this.next.deactivate();
    },

    /**
     * Method: getState
     * Get the current state and return it.
     *
     * Returns:
     * {Object} An object representing the current state.
     */
    getState: function() {
        return {
            center: this.map.getCenter(),
            resolution: this.map.getResolution(),
            projection: this.map.getProjectionObject(),
            units: this.map.getProjectionObject().getUnits() ||
                this.map.units || this.map.baseLayer.units
        };
    },

    /**
     * Method: restore
     * Update the state with the given object.
     *
     * Parameters:
     * state - {Object} An object representing the state to restore.
     */
    restore: function(state) {
        var center, zoom;
        if (this.map.getProjectionObject() == state.projection) {
            zoom = this.map.getZoomForResolution(state.resolution);
            center = state.center;
        } else {
            center = state.center.clone();
            center.transform(state.projection, this.map.getProjectionObject());
            var sourceUnits = state.units;
            var targetUnits = this.map.getProjectionObject().getUnits() ||
                this.map.units || this.map.baseLayer.units;
            var resolutionFactor = sourceUnits && targetUnits ?
                OpenLayers.INCHES_PER_UNIT[sourceUnits] / OpenLayers.INCHES_PER_UNIT[targetUnits] : 1;
            zoom = this.map.getZoomForResolution(resolutionFactor*state.resolution);
        }
        this.map.setCenter(center, zoom);
    },

    /**
     * Method: setListeners
     * Sets functions to be registered in the listeners object.
     */
    setListeners: function() {
        this.listeners = {};
        for(var type in this.registry) {
            this.listeners[type] = OpenLayers.Function.bind(function() {
                if(!this.restoring) {
                    var state = this.registry[type].apply(this, arguments);
                    this.previousStack.unshift(state);
                    if(this.previousStack.length > 1) {
                        this.onPreviousChange(
                            this.previousStack[1], this.previousStack.length - 1
                        );
                    }
                    if(this.previousStack.length > (this.limit + 1)) {
                        this.previousStack.pop();
                    }
                    if(this.nextStack.length > 0) {
                        this.nextStack = [];
                        this.onNextChange(null, 0);
                    }
                }
                return true;
            }, this);
        }
    },

    /**
     * APIMethod: activate
     * Activate the control.  This registers any listeners.
     *
     * Returns:
     * {Boolean} Control successfully activated.
     */
    activate: function() {
        var activated = false;
        if(this.map) {
            if(OpenLayers.Control.prototype.activate.apply(this)) {
                if(this.listeners == null) {
                    this.setListeners();
                }
                for(var type in this.listeners) {
                    this.map.events.register(type, this, this.listeners[type]);
                }
                activated = true;
                if(this.previousStack.length == 0) {
                    this.initStack();
                }
            }
        }
        return activated;
    },

    /**
     * Method: initStack
     * Called after the control is activated if the previous history stack is
     *     empty.
     */
    initStack: function() {
        if(this.map.getCenter()) {
            this.listeners.moveend();
        }
    },

    /**
     * APIMethod: deactivate
     * Deactivate the control.  This unregisters any listeners.
     *
     * Returns:
     * {Boolean} Control successfully deactivated.
     */
    deactivate: function() {
        var deactivated = false;
        if(this.map) {
            if(OpenLayers.Control.prototype.deactivate.apply(this)) {
                for(var type in this.listeners) {
                    this.map.events.unregister(
                        type, this, this.listeners[type]
                    );
                }
                if(this.clearOnDeactivate) {
                    this.clear();
                }
                deactivated = true;
            }
        }
        return deactivated;
    },

    CLASS_NAME: "OpenLayers.Control.NavigationHistory"
});


text:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
  <task-flow-definition id="HomeAnnouncementsFlow">
    <default-activity id="__5">HomePageViewCheck</default-activity>
    <managed-bean id="__4">
      <managed-bean-name id="__3">HomeAnnouncementsBean</managed-bean-name>
      <managed-bean-class id="__2">oracle.apps.uikit.bean.HomeAnnouncementsBean</managed-bean-class>
      <managed-bean-scope id="__1">pageFlow</managed-bean-scope>
    </managed-bean>
    <router id="HomePageViewCheck">
      <case>
        <expression>#{SessionState.homePageView == 'GRID'}</expression>
        <outcome id="__6">GRID</outcome>
      </case>
      <case>
        <expression>#{SessionState.homePageView == 'BANNER'}</expression>
        <outcome id="__7">BANNER</outcome>
      </case>
      <default-outcome>BANNER</default-outcome>
    </router>
    <view id="HomeBanner">
      <page>/oracle/apps/uikit/page/HomeBanner.jsff</page>
    </view>
    <view id="HomeSidePanel">
      <page>/oracle/apps/uikit/page/HomeSidePanel.jsff</page>
    </view>
    <control-flow-rule id="__8">
      <from-activity-id id="__9">HomePageViewCheck</from-activity-id>
      <control-flow-case id="__10">
        <from-outcome id="__11">BANNER</from-outcome>
        <to-activity-id id="__12">HomeBanner</to-activity-id>
      </control-flow-case>
      <control-flow-case id="__14">
        <from-outcome id="__15">GRID</from-outcome>
        <to-activity-id id="__13">HomeSidePanel</to-activity-id>
      </control-flow-case>
    </control-flow-rule>
    <use-page-fragments/>
  </task-flow-definition>
</adfc-config>