text:
<?php
/**
 * Button widget
 *
 * @package Talon
 */

class Athemes_Image extends WP_Widget {

	public function __construct() {
		$widget_ops = array('classname' => 'athemes_image_widget', 'description' => __( 'Add an image', 'talon') );
        parent::__construct(false, $name = __('Talon: Image', 'talon'), $widget_ops);
		$this->alt_option_name = 'athemes_image_widget';
    }

	function form($instance) {
		$title     	= isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
		$image_uri 	= isset( $instance['image_uri'] ) ? esc_url( $instance['image_uri'] ) : '';
		$link 		= isset( $instance['link'] ) ? esc_url( $instance['link'] ) : '';

		?>

		<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'talon'); ?>
		<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />

<label for="<?php echo $this->get_field_id('image_uri'); ?>"><?php _e('Upload your image', 'talon'); ?>

<input class="widefat custom_media_url" id="<?php echo $this->get_field_id( 'image_uri' ); ?>" name="<?php echo $this->get_field_name( 'image_uri' ); ?>" type="text" value="<?php echo $image_uri; ?>" size="3" />

<input type="button" class="button button-primary custom_media_button" id="custom_media_button" value="<?php echo esc_attr__('Upload Image', 'talon'); ?>" />

<label for="<?php echo $this->get_field_id('link'); ?>"><?php _e('Enter an URL here if you want to link your image somewhere', 'talon'); ?>
		<input class="widefat" id="<?php echo $this->get_field_id( 'link' ); ?>" name="<?php echo $this->get_field_name( 'link' ); ?>" type="text" value="<?php echo $link; ?>" size="3" />

		<?php
	}

	function update($new_instance, $old_instance) {
		$instance = $old_instance;
		$instance['title'] 	  	= sanitize_text_field($new_instance['title']);
	    $instance['image_uri'] 	= esc_url_raw( $new_instance['image_uri'] );
	    $instance['link'] 		= esc_url_raw( $new_instance['link'] );
		return $instance;
	}

	function widget($args, $instance) {
		if ( ! isset( $args['widget_id'] ) ) {
			$args['widget_id'] = $this->id;
		}

		$title 	  	= ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
		$image_uri 	= isset( $instance['image_uri'] ) ? esc_url($instance['image_uri']) : '';
		$link 		= isset( $instance['link'] ) ? esc_url($instance['link']) : '';

		echo $args['before_widget'];

		if ( $title ) echo $args['before_title'] . $title . $args['after_title'];
		?>

			<?php if ( $link == '' ) : ?>
				<img src="<?php echo $image_uri; ?>"/>
			<?php else : ?>
				<a href="<?php echo $link; ?>"><img src="<?php echo $image_uri; ?>"/>
			<?php endif; ?>

		<?php

		echo $args['after_widget'];

	}

}


text:
set +o pipefail
OPP_OPRT_REPO=${OPP_OPRT_REPO-""}
OPP_OPRT_SHA=${OPP_OPRT_SHA-""}
OPP_OPRT_SRC_REPO=${OPP_OPRT_SRC_REPO-"operator-framework/community-operators"}
OPP_OPRT_SRC_BRANCH=${OPP_OPRT_SRC_BRANCH-"master"}
#OPP_SCRIPT_ENV_URL=${OPP_SCRIPT_ENV_URL-"https://raw.githubusercontent.com/operator-framework/community-operators/master/scripts/ci/actions-env"}
OPP_SCRIPT_ENV_URL=${OPP_SCRIPT_ENV_URL-"https://raw.githubusercontent.com/operator-framework/community-operators/support/ci_01/ci/scripts/opp-env.sh"}
export OPRT=1
echo "OPP_SCRIPT_ENV_URL=$OPP_SCRIPT_ENV_URL"

[ -n "$OPP_OPRT_REPO" ] || { echo "Error: '\$OPP_OPRT_REPO' is empty !!!"; exit 1; }
[ -n "$OPP_OPRT_SHA" ] || { echo "Error: '\$OPP_OPRT_SHA' is empty !!!"; exit 1; }

git clone https://github.com/$OPP_OPRT_REPO operators #> /dev/null 2>&1
echo "cloned https://github.com/$OPP_OPRT_REPO"
cd operators
BRANCH_NAME=$(git branch -a --contains $OPP_OPRT_SHA | grep remotes/ | grep -v HEAD | cut -d '/' -f 2-)
echo "BRANCH_NAME=$BRANCH_NAME"
git checkout $BRANCH_NAME #> /dev/null 2>&1
git log --oneline | head

git config --global user.email "test@example.com"
git config --global user.name "Test User"

git remote add upstream https://github.com/$OPP_OPRT_SRC_REPO -f #> /dev/null 2>&1
echo "added remote https://github.com/$OPP_OPRT_SRC_REPO"
git rev-parse HEAD
git pull --rebase -Xours upstream $OPP_OPRT_SRC_BRANCH
echo "Repo rebased over branch OPP_OPRT_SRC_BRANCH - $OPP_OPRT_SRC_BRANCH"

export OPP_ADDED_FILES=$(git diff --diff-filter=A upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_MODIFIED_FILES=$(git diff --diff-filter=M upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_REMOVED_FILES=$(git diff --diff-filter=D upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_RENAMED_FILES=$(git diff --diff-filter=R upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_ADDED_MODIFIED_FILES=$(git diff --diff-filter=AM upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_ADDED_MODIFIED_RENAMED_FILES=$(git diff --diff-filter=RAM upstream/$OPP_OPRT_SRC_BRANCH --name-only | tr '\r\n' ' ')
export OPP_CURRENT_PROJECT_REPO="$OPP_OPRT_SRC_REPO"
export OPP_CURRENT_PROJECT_BRANCH="$OPP_OPRT_SRC_BRANCH"
echo "OPP_ADDED_MODIFIED_RENAMED_FILES=$OPP_ADDED_MODIFIED_RENAMED_FILES"

BRANCH_NAME=$(echo $BRANCH_NAME | cut -d '/' -f 2-)
echo "BRANCH_NAME=$BRANCH_NAME"
# echo "::set-output name=op_test_repo_branch::$OPP_OPRT_REPO/${BRANCH_NAME}"

bash <(curl -sL $OPP_SCRIPT_ENV_URL)

redpajama_set_name: RedPajamaGithub


text: Rails.application.config.session_store :cookie_store, key: '_trackomatic_session'


text:
package com.zeroq6.blog.operate.manager;

import com.zeroq6.blog.common.base.BaseDao;
import com.zeroq6.blog.common.base.BaseManager;
import com.zeroq6.blog.common.dao.PostDao;
import com.zeroq6.blog.common.domain.CommentDomain;
import com.zeroq6.blog.common.domain.PostDomain;
import com.zeroq6.blog.common.domain.RelationDomain;
import com.zeroq6.blog.common.domain.enums.field.EmRelationType;
import com.zeroq6.blog.common.base.BaseResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 自定义开始 自定义结束
 * 自定义结束
 */

/**
 * @author icgeass@hotmail.com
 * @date 2017-07-08
 */
@Service
public class PostManager extends BaseManager<PostDomain, Long> {

    @Autowired
    private PostDao postDao;

    @Autowired
    private CommentManager commentManager;

    @Autowired
    private RelationManager relationManager;

    @Override
    public BaseDao<PostDomain, Long> getDao() {
        return postDao;
    }

    @Transactional
    public BaseResponse<String> deleteById(Long id) {
        if (null == id || id <= 0) {
            throw new RuntimeException("文章id非法, " + id);
        }
        this.disableByKey(id);
        relationManager.disableByCondition(new RelationDomain().setType(EmRelationType.WEN_ZHANG_BIAOQIAN.value()).setParentId(id + ""));
        relationManager.disableByCondition(new RelationDomain().setType(EmRelationType.WEN_ZHANG_FENLEI.value()).setParentId(id + ""));
        commentManager.disableByCondition(new CommentDomain().setPostId(id));
        return new BaseResponse<String>(true, "成功", "成功");
    }

    @Transactional
    public BaseResponse<String> addPost(PostDomain postDomain, RelationDomain category, List<RelationDomain> tagsList) {
        // 文章
        insertFillingId(postDomain);
        if (null != category) {
            // 分类
            category.setParentId(postDomain.getId() + "");
            relationManager.insert(category);
        }
        if (null != tagsList && !tagsList.isEmpty()) {
            // 标签
            for (RelationDomain tag : tagsList) {
                tag.setParentId(postDomain.getId() + "");
            }
            relationManager.insertBatch(tagsList);
        }
        return new BaseResponse<String>(true, "成功", "成功");
    }

    @Transactional
    public BaseResponse<String> editPost(PostDomain postDomain, String categoryId, List<RelationDomain> addList, List<RelationDomain> deleteList) {
        updateByKey(postDomain);
        if (StringUtils.isNotBlank(categoryId)) {
            relationManager.updateByCondition(new RelationDomain().setChildId(categoryId), new RelationDomain().setType(EmRelationType.WEN_ZHANG_FENLEI.value()).setParentId(postDomain.getId() + ""), 1);
        }
        // 新增标签
        if (null != addList && !addList.isEmpty()) {
            relationManager.insertBatch(addList);
        }
        // 删除标签
        if (null != deleteList && !deleteList.isEmpty()) {
            for (RelationDomain delete : deleteList) {
                relationManager.disableByKey(delete.getId());
            }
        }
        return new BaseResponse<String>(true, "成功", "成功");
    }

}


text:
import nnabla.functions as F

def stack_backward(grad_inputs, inputs, input_shapes, outputs, output_shapes, axis=0):
    """
    Args:
      grad_inputs (list of :obj:`nnabla.Variable`): Propagated grads to this backward function.
      inputs (list of :obj:`nnabla.Variable` and None): Input Variables of the forward function
          if this backward function depends on it. Otherwise, None is set instead.
      input_shapes (list of tuple of :obj:`int`): Input shapes of the forward function.
          The shapes of the inputs in which None is set can be passed.
      outputs (list of :obj:`nnabla.Variable` and None): Output Variables of the forward function
          if this backward function depends on it. Otherwise, None is set instead.
      output_shapes (list of tuple of :obj:`int`): Output shapes of the forward function.
          The shapes of the outputs in which None is set can be passed.
      kwargs (dict of arguments): Dictionary of the corresponding function arguments.

    Return:
      list of Variable: Return the gradients wrt inputs of the corresponding function.
    """
    dy = grad_inputs[0]
    yshape = dy.shape
    if yshape[axis] == 1:
        reshape = yshape[:axis] + yshape[axis + 1:]
        return F.reshape(dy, reshape, inplace=False)
    dx_list = F.split(dy, axis=axis)
    return dx_list


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpatialAnalysis.CellularEnvironment;
using SpatialAnalysis.Data;
using SpatialAnalysis.IsovistUtility;
using SpatialAnalysis.Geometry;
using SpatialAnalysis.Agents;
using System.Threading.Tasks;
using System.Windows.Threading;
using System.Threading;
using SpatialAnalysis.Interoperability;

namespace SpatialAnalysis.Events
{
    /// <summary>
    /// Class VisibilityEvaluationEvent.
    /// </summary>
    public class VisibilityTarget //VisibilityTarget
    {

        /// <summary>
        /// Gets or sets all visible cells.
        /// </summary>
        /// <value>All visible cells.</value>
        public HashSet<int> AllVisibleCells { get; set; }
        /// <summary>
        /// Gets or sets the referenced vantage cells.
        /// </summary>
        /// <value>The referenced vantage cells.</value>
        public Dictionary<int, List<int>> ReferencedVantageCells{ get; set; }
        /// <summary>
        /// Gets or sets the vantage cells.
        /// </summary>
        /// <value>The vantage cells.</value>
        public ICollection<int> VantageCells { get; set; }
        //public Isovist[] VisibilityTargetIsovists { get; set; }
        /// <summary>
        /// Gets or sets the visual targets.
        /// </summary>
        /// <value>The visual targets.</value>
        public SpatialAnalysis.Geometry.BarrierPolygon[] VisualTargets { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="VisibilityEvaluationEvent"/> class.
        /// </summary>
        /// <param name="allVisibleCells">All visible cells.</param>
        /// <param name="visibilityTargetIsovists">The visibility target isovists.</param>
        /// <param name="visualTargets">The visual targets.</param>
        public VisibilityTarget(HashSet<int> allVisibleCells, ICollection<Isovist> visibilityTargetIsovists, ICollection<SpatialAnalysis.Geometry.BarrierPolygon> visualTargets)
        {
            this.AllVisibleCells = allVisibleCells;
            //this.VisibilityTargetIsovists = visibilityTargetIsovists;
            this.VisualTargets = visualTargets.ToArray();
            this.ReferencedVantageCells = new Dictionary<int, List<int>>();
            var vantageCells = new List<int>(visibilityTargetIsovists.Count);
            foreach (var item in this.AllVisibleCells)
            {
                this.ReferencedVantageCells.Add(item, new List<int>());
            }
            foreach (var isovist in visibilityTargetIsovists)
            {
                vantageCells.Add(isovist.VantageCell.ID);
                foreach (var cellID in isovist.VisibleCells)
                {
                    this.ReferencedVantageCells[cellID].Add(isovist.VantageCell.ID);
                }
            }
            this.VantageCells = vantageCells;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="VisibilityEvaluationEvent"/> class.
        /// </summary>
        /// <param name="visualTargets">The visual targets.</param>
        /// <param name="cellularFloor">The cellular floor.</param>
        /// <param name="tolerance">The tolerance by default set to the main document's absolute tolerance value.</param>
        /// <exception cref="System.ArgumentException">Cannot generate 'Occupancy Visual Event' with no visibility target cells!</exception>
        public VisibilityTarget(ICollection<SpatialAnalysis.Geometry.BarrierPolygon> visualTargets, CellularFloor cellularFloor, double tolerance = OSMDocument.AbsoluteTolerance)
        {
            this.VisualTargets = visualTargets.ToArray();
            HashSet<Index> allIndices = new HashSet<Index>();
            foreach (SpatialAnalysis.Geometry.BarrierPolygon item in this.VisualTargets)
            {
                allIndices.UnionWith(cellularFloor.GetIndicesInsideBarrier(item, tolerance));
            }
            var visibleCells = new HashSet<int>();
            foreach (Index item in allIndices)
            {
                if (cellularFloor.ContainsCell(item) &&
                    cellularFloor.Cells[item.I, item.J].VisualOverlapState == OverlapState.Outside)
                {
                    visibleCells.Add(cellularFloor.Cells[item.I, item.J].ID);
                }
            }
            allIndices.Clear();
            allIndices = null;
            if (visibleCells.Count == 0)
            {
                throw new ArgumentException("Cannot generate 'Occupancy Visual Event' with no visibility target cells!");
            }
            var cellsOnEdge = CellUtility.GetEdgeOfField(cellularFloor, visibleCells);
            List<Isovist> isovists = new List<Isovist>(cellsOnEdge.Count);
            double depth = cellularFloor.Origin.DistanceTo(cellularFloor.TopRight) + 1;
            foreach (int item in cellsOnEdge)
            {
                isovists.Add(new Isovist(cellularFloor.FindCell(item)));
            }
            Parallel.ForEach(isovists, (a) =>
            {
                a.Compute(depth, BarrierType.Visual, cellularFloor, 0.0000001);
            });
            HashSet<int> visibleArea = new HashSet<int>();
            foreach (Isovist item in isovists)
            {
                visibleArea.UnionWith(item.VisibleCells);
            }
            this.AllVisibleCells = visibleArea;
            this.ReferencedVantageCells = new Dictionary<int, List<int>>();
            var vantageCells = new List<int>(isovists.Count);
            foreach (var item in this.AllVisibleCells)
            {
                this.ReferencedVantageCells.Add(item, new List<int>());
            }
            foreach (var isovist in isovists)
            {
                vantageCells.Add(isovist.VantageCell.ID);
                foreach (var cellID in isovist.VisibleCells)
                {
                    this.ReferencedVantageCells[cellID].Add(isovist.VantageCell.ID);
                }
            }
            this.VantageCells = vantageCells;
        }
        /// <summary>
        /// Saves the instance of the visual event as string.
        /// </summary>
        /// <returns>System.String.</returns>
        public string SaveAsString()
        {
            StringBuilder sb = new StringBuilder();
            foreach (SpatialAnalysis.Geometry.BarrierPolygon item in VisualTargets)
            {
                sb.AppendLine(item.ToString());
            }
            string text = sb.ToString();
            sb.Clear();
            sb = null;
            return text;
        }
        /// <summary>
        /// Creates an instance of the event from its string representation .
        /// </summary>
        /// <param name="lines">The lines.</param>
        /// <param name="start">The start.</param>
        /// <param name="cellularFloor">The cellular floor.</param>
        /// <param name="tolerance">The tolerance.</param>
        /// <returns>VisibilityEvaluationEvent.</returns>
        public static VisibilityTarget FromString(List<String> lines, int start, Length_Unit_Types unitType, CellularFloor cellularFloor, double tolerance = 0.0000001d)
        {
            List<SpatialAnalysis.Geometry.BarrierPolygon> barriers = new List<Geometry.BarrierPolygon>();
            for (int i = start; i < lines.Count; i++)
            {
                var barrier = SpatialAnalysis.Geometry.BarrierPolygon.FromStringRepresentation(lines[i]);
                UnitConversion.Transform(barrier.BoundaryPoints, unitType, cellularFloor.UnitType);
                barriers.Add(barrier);
            }
            return new VisibilityTarget(barriers, cellularFloor, tolerance);
        }

        /// <summary>
        /// Targets the visibility test.
        /// </summary>
        /// <param name="currentState">The current state of the agent.</param>
        /// <param name="visibilityCosineFactor">The visibility cosine factor.</param>
        /// <param name="cellularFloor">The cellular floor.</param>
        /// <returns>UV.</returns>
        public UV TargetVisibilityTest(StateBase currentState, double visibilityCosineFactor, CellularFloorBaseGeometry cellularFloor)
        {
            var vantageCell = cellularFloor.FindCell(currentState.Location);
            if (!this.AllVisibleCells.Contains(vantageCell.ID))
            {
                return null;
            }
            UV target = null;
            foreach (var cellID in this.ReferencedVantageCells[vantageCell.ID])
            {
                UV targetCell = cellularFloor.FindCell(cellID);
                UV direction = targetCell - currentState.Location;
                direction.Unitize();
                if (direction.DotProduct(currentState.Direction) >= visibilityCosineFactor)
                {
                    target = targetCell;
                    break;
                }
            }
            return target;
        }
        /// <summary>
        /// Determines whether a visual the event is raised.
        /// </summary>
        /// <param name="currentState">The current state of the agent.</param>
        /// <param name="visibilityCosineFactor">The visibility cosine factor.</param>
        /// <param name="cellularFloor">The cellular floor.</param>
        /// <returns><c>true</c> if visual the event is raised, <c>false</c> otherwise.</returns>
        public bool VisualEventRaised(StateBase currentState, double visibilityCosineFactor, CellularFloorBaseGeometry cellularFloor)
        {
            var vantageCell = cellularFloor.FindCell(currentState.Location);
            if (!this.AllVisibleCells.Contains(vantageCell.ID))
            {
                return false;
            }
            bool raised = false;
            foreach (var cellID in this.ReferencedVantageCells[vantageCell.ID])
            {
                UV targetCell = cellularFloor.FindCell(cellID);
                UV direction = targetCell - currentState.Location;
                direction.Unitize();
                if (direction.DotProduct(currentState.Direction) >= visibilityCosineFactor)
                {
                    raised = true;
                    break;
                }
            }
            return raised;
        }
        public static bool operator ==(VisibilityTarget a, VisibilityTarget b)
        {
            if ((object)a == null && (object)b == null)
            {
                return true;
            }
            if ((object)a == null || (object)b == null)
            {
                return false;
            }
            if (a.AllVisibleCells.Count == b.AllVisibleCells.Count)
            {
                foreach (var item in a.AllVisibleCells)
                {
                    if (!b.AllVisibleCells.Contains(item))
                    {
                        return false;
                    }
                }
                return true;
            }
            else
            {
                return false;
            }
        }
        public static bool operator !=(VisibilityTarget a, VisibilityTarget b)
        {
            return !(a == b);
        }
    }

}


text:
/**
 * @ignore
 * format html prettily
 * @author yiminghe@gmail.com
 */
KISSY.add(function (S, require) {
    var BasicWriter = require('./basic');
    var dtd = require('../dtd');
    var Utils = require('../utils');

    function BeautifyWriter() {
        var self = this;
        BeautifyWriter.superclass.constructor.apply(self, arguments);
        // tag in pre should not indent
        // space (\t\r\n ) in pre should not collapse
        self.inPre = 0;
        self.indentChar = '\t';
        self.indentLevel = 0;
        // whether to indent on current line
        // if already indent and then not line break ,next tag should not indent
        self.allowIndent = 0;
        self.rules = {};

        var beauty = S.merge(
            dtd.$nonBodyContent,
            dtd.$block,
            dtd.$listItem,
            dtd.$tableContent, {
                // may add unnecessary whitespaces
                'select': 1,
                // add unnecessary whitespaces is ok for script and style
                'script': 1,
                'style': 1
            });
        for (var e in beauty) {
            // whether its tag/text children should indent
            self.setRules(e, {
                allowIndent: 1,
                breakBeforeOpen: 1,
                breakAfterOpen: 1,
                breakBeforeClose: 1,
                breakAfterClose: 1
            });
        }

        S.each(['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], function (e) {
            // text paragraph does not allow
            self.setRules(e, {
                allowIndent: 0,
                breakAfterOpen: 0,
                breakBeforeClose: 0
            });
        });

        self.setRules('option', {
            breakBeforeOpen: 1
        });

        self.setRules('optiongroup', {
            breakBeforeOpen: 1
        });

        self.setRules('br', {
            breakAfterOpen: 1
        });

        self.setRules('title', {
            allowIndent: 0,
            breakBeforeClose: 0,
            breakAfterOpen: 0
        });

        // Disable indentation on
.
        self.setRules('pre', {
            breakAfterOpen: 1,
            allowIndent: 0
        });
    }

    S.extend(BeautifyWriter, BasicWriter, {
        indentation: function () {
            if (!this.inPre) {
                this.append(new Array(this.indentLevel + 1).join(this.indentChar));
            }
            // already indent ,unless line break  it will not indent again
            this.allowIndent = 0;
        },

        lineBreak: function () {
            var o = this.output;
            if (!this.inPre && o.length) {
                // prevent adding more \n between tags :
                // before :
\n
\n
\n
 =>
\n\t' '\n

                // now :
\n
\n
\n
 =>
\n
 => indentation =>
\n\t

                for (var j = o.length - 1; j >= 0; j--) {
                    if (!(/[\r\n\t ]/.test(o[j]))) {
                        break;
                    }
                }
                o.length = j + 1;
                this.append('\n');
            }
            // allow indentation if encounter next tag
            this.allowIndent = 1;
        },

        setRules: function (tagName, rule) {
            if (!this.rules[tagName]) {
                this.rules[tagName] = {};
            }
            S.mix(this.rules[tagName], rule);
        },

        openTag: function (el) {

            var tagName = el.tagName,
                rules = this.rules[tagName] || {};
            if (this.allowIndent) {
                this.indentation();
            } else if (rules.breakBeforeOpen) {
                this.lineBreak();
                this.indentation();
            }
            BeautifyWriter.superclass.openTag.apply(this, arguments);
        },

        openTagClose: function (el) {

            var tagName = el.tagName;
            var rules = this.rules[tagName] || {};
            if (el.isSelfClosed) {
                this.append(' />');
            } else {
                this.append('>');
                if (rules.allowIndent) {
                    this.indentLevel++;
                }
            }
            if (rules.breakAfterOpen) {
                this.lineBreak();
            }
            if (tagName === 'pre') {
                this.inPre = 1;
            }
        },

        closeTag: function (el) {
            var self = this,
                tagName = el.tagName,
                rules = self.rules[tagName] || {};

            if (rules.allowIndent) {
                self.indentLevel--;
            }

            if (self.allowIndent) {
                self.indentation();
            } else if (rules.breakBeforeClose) {
                self.lineBreak();
                self.indentation();
            }

            BeautifyWriter.superclass.closeTag.apply(self, arguments);

            if (tagName === 'pre') {
                self.inPre = 0;
            }

            if (rules.breakAfterClose) {
                self.lineBreak();
            }

        },

        text: function (text) {
            if (this.allowIndent) {
                this.indentation();
            }
            if (!this.inPre) {
                // shrink consequential spaces into one space
                // 换行也没了,否则由于 closeTag 时 lineBreak 会导致换行越来越多
                text = Utils.collapseWhitespace(text);
            }
            this.append(text);
        },

        comment: function (comment) {
            if (this.allowIndent) {
                this.indentation();
            }
            this.append('');
        },

        cdata: function (text) {
            if (this.allowIndent) {
                this.indentation();
            }
            this.append(S.trim(text));
        }

    });

    return BeautifyWriter;

});


text:
![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png) 6

To use the chuckFacts skill, try saying...

* *Alexa, ask ChuckFacts to tell me something about Chuck Norris*

* *Alexa, ask ChuckFacts to tell me a Chuck Norris fact*

* *Alexa, ask ChuckFacts to give me a Chuck Norris fact*

Chuck Norris facts are satirical factoids about martial artist and actor Chuck Norris that have become an Internet phenomenon and as a result have become widespread in popular culture. The 'facts' are normally absurd hyperbolic claims about Norris' toughness, attitude, virility, sophistication, and masculinity.

***

### Skill Details

* **Invocation Name:** chuck facts
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.7cf24ea7-221e-4cb4-b364-b2e733695b5e
* **ASIN:** B01GM2XC04
* **Author:** Jer Warren
* **Release Date:** June 7, 2016 @ 04:38:29
* **In-App Purchasing:** No


text:
package fi.antientropy.pagerdutyreports.domain.logentries;

import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang3.builder.ToStringBuilder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "id",
    "type",
    "summary",
    "self",
    "html_url"
})
public class EscalationPolicy {

    @JsonProperty("id")
    private String id;
    @JsonProperty("type")
    private String type;
    @JsonProperty("summary")
    private String summary;
    @JsonProperty("self")
    private String self;
    @JsonProperty("html_url")
    private String htmlUrl;
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    @JsonProperty("id")
    public String getId() {
        return id;
    }

    @JsonProperty("id")
    public void setId(String id) {
        this.id = id;
    }

    @JsonProperty("type")
    public String getType() {
        return type;
    }

    @JsonProperty("type")
    public void setType(String type) {
        this.type = type;
    }

    @JsonProperty("summary")
    public String getSummary() {
        return summary;
    }

    @JsonProperty("summary")
    public void setSummary(String summary) {
        this.summary = summary;
    }

    @JsonProperty("self")
    public String getSelf() {
        return self;
    }

    @JsonProperty("self")
    public void setSelf(String self) {
        this.self = self;
    }

    @JsonProperty("html_url")
    public String getHtmlUrl() {
        return htmlUrl;
    }

    @JsonProperty("html_url")
    public void setHtmlUrl(String htmlUrl) {
        this.htmlUrl = htmlUrl;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

}


text:
Events API
==========

Labadee - Events API takes its name from a port/beach located on the northern coast of [Haiti](https://en.wikipedia.org/wiki/Haiti).

I started this small project while I was visiting this beautiful beach in Haiti, I got inspired by the warm blue waters, the hundreds of *events* and tours near the beach and of course by the friendly people from the flea markets.

## API Resources

**Current version:** v1

### Users

  - [GET /users](#get-users) **Not available yet**
  - [GET /users/:id](#get-usersid) **Not available yet**
  - [POST /users](#post-users)
  - [POST /sign_in](#post-sign_in)

### Events

  - [GET /events](#get-events)
  - [GET /events/:id](#get-eventsid)
  - [POST /events](#post-events)
  - [PUT /events/:id](#put-eventsid)
  - [DELETE /events/:id](#delete-eventsid)

### Attendees

  - [GET /events/:event_id/attendees](#get-eventsevent_id-attendees)
  - [GET /events/:event_id/attendees/:id](#get-eventsevent_id-attendeesid)
  - [POST /events/:event_id/attendees](#post-eventsevent_id-attendees)

## Installation

### Notes

Make sure you have MongoDB installed and running on your computer (or server).

1. Clone the repo.

       git clone https://github.com/mcka1n/labadee-api.git

2. `bundle install`.
2. run `rake db:seed` in order to 'install' the default values for users and clients.
4. `rake db:mongoid:create_indexes`
5. `rails s`

## Getting started with the API

### Authentication

I'm using a simple way to authenticate Clients (other apps or scripts) and Users.

#### Client Authentication (key)

For testing and debugging purposes you can run the seeds to create a default client, this will give you a client key which is required in every call to the API.

As a developer you have to send this client `key` as a get param on every request you make, no exceptions.

#### User Authentication (token)

Each and every user will have a `token` field, this token contains a value used for authentication. Every time you sign in with email & password, the token will be refreshed and a new one will be returned.

As a developer you have to send as query params both client `key` and user's `token` on each request, except:

- Sign in
- Sign up

### Authentication Examples

     POST http://localhost:3000/v1/users/sign_in?key=Bnb@fUCodG_j-ywdnty

**Params:**

```
  {
    "user": {
      "email": "andre+test0@gmail.com",
      "password": "1234%678P"
    }
  }
```
**Response:**

```
Status: 200 OK

{
  "success": true,
  "auth_token": "W00tszBmuqdw4tsPY_rY",
  "email": "andre+test0@gmail.com"
}
```


text:
$(document).ready(function(e) {

	var f = new Date();
	anio = f.getFullYear();
	mes = (f.getMonth() +1).toString();
	mes = (mes.length>1)?mes:'0'+mes;
	dia = f.getDate().toString();
	dia = (dia.length>1)?dia:'0'+dia;
	fecha=$("#fecha_fin").val();

	$(".date1").datetimepicker({pickTime:false}).on("changeDate",function(e){
		sel=$("#fecha_inicio").val();
		hoy =anio+'-'+mes+'-'+dia;
	});

	$(".date2").datetimepicker({pickTime:false}).on("changeDate",function(e){
		sel=$("#fecha_fin").val();
		hoy =anio+'-'+mes+'-'+dia;
	});

	var cargando='
 Cargando
';

	$("button#actualizar").click(function(){
		$("div.proyecto-inicio").html(cargando);
		var fecha_inicio = $('input#fecha_inicio').val();
		var fecha_fin = $('input#fecha_fin').val();
		var historico='';
		datos = 'fecha_inicio='+fecha_inicio+'&fecha_fin='+fecha_fin;
		$.getJSON(base_url+'doc/dashboard_hist/proyectos',datos,function(json){
			$.each(json,function(x,y){
				historico = historico + '
 '+y.nombre_proyecto+'

';
			});
			$('div.proyecto-inicio').html(historico);
		});

	});

	$('div.proyecto-inicio').on('click','i.abrir-proyecto',function(){
		idproyecto = $(this).attr('idproyecto');
		var fecha_inicio = $('input#fecha_inicio').val();
		var fecha_fin = $('input#fecha_fin').val();
		datos = 'idproyecto='+idproyecto+'&fecha_inicio='+fecha_inicio+'&fecha_fin='+fecha_fin;
		contratos = '';
		if($('li.proyectos i#'+idproyecto).hasClass('fa-plus-square-o')){
			$('.proyecto'+idproyecto).html(cargando).toggle();
			$.getJSON(base_url+'doc/dashboard_hist/contratos',datos,function(json){
				$.each(json,function(x,y){
					contratos = contratos + '
 CONTRATO: '+y.numero_contrato+'

';
				});
			$('.proyecto'+idproyecto).html(contratos);
			});
			$('li.proyectos i#'+idproyecto).removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
		}else{
			$('.proyecto'+idproyecto).toggle();
			$('li.proyectos i#'+idproyecto).removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
		}
	});

	$('div.proyecto-inicio').on('click','div.contratos i.abrir-contratos',function(){
		var idcontrato = $(this).attr('idcontrato');
		var fecha_inicio = $('input#fecha_inicio').val();
		var fecha_fin = $('input#fecha_fin').val();
		datos = 'idcontrato='+idcontrato+'&fecha_inicio='+fecha_inicio+'&fecha_fin='+fecha_fin;
		categorias='';
		if($(this).hasClass('fa-plus-square-o')){
			$('.contrato'+idcontrato).html(cargando).toggle();
			$.getJSON(base_url+'doc/dashboard_hist/categorias',datos,function(json){
				$.each(json,function(x,y){
					categorias = categorias + '
 '+y.cat_categoria+'

';
				});
			$('.contrato'+idcontrato).html(categorias);
			});
			$(this).removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
		}else{
			$('.contrato'+idcontrato).toggle();
			$(this).removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
		}
	});

	$('div.proyecto-inicio').on('click','div.contratos i.abrir-categorias',function(){
		var idcategoria = $(this).attr('idcategoria');
		var idcontrato = $(this).attr('idcontrato');
		var fecha_inicio = $('input#fecha_inicio').val();
		var fecha_fin = $('input#fecha_fin').val();
		datos = 'idcategoria='+idcategoria+'&idcontrato='+idcontrato+'&fecha_inicio='+fecha_inicio+'&fecha_fin='+fecha_fin;
		subcategorias='';
		if($(this).hasClass('fa-plus-square-o')){
			$('.categoria'+idcontrato+idcategoria).html(cargando).toggle();
			$.getJSON(base_url+'doc/dashboard_hist/subcategorias',datos,function(json){
				$.each(json,function(x,y){
					subcategorias = subcategorias + '
 '+y.cat_subcategoria+'

';
				});
			$('.categoria'+idcontrato+idcategoria).html(subcategorias);
			});
			$(this).removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
		}else{
			$('.categoria'+idcontrato+idcategoria).toggle();
			$(this).removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
		}
	});

	$('div.proyecto-inicio').on('click','div.contratos i.abrir-subcategorias',function(){
		var idsubcategoria = $(this).attr('idsubcategoria');
		var idcategoria = $(this).attr('idcategoria');
		var idcontrato = $(this).attr('idcontrato');
		var fecha_inicio = $('input#fecha_inicio').val();
		var fecha_fin = $('input#fecha_fin').val();
		datos = 'idcategoria='+idcategoria+'&idcontrato='+idcontrato+'&idsubcategoria='+idsubcategoria+'&fecha_inicio='+fecha_inicio+'&fecha_fin='+fecha_fin;
		actividades='';
		leyenda='';
		if($(this).hasClass('fa-plus-square-o')){
			$('.subcategoria'+idcontrato+idcategoria+idsubcategoria).html(cargando).toggle();

			$.getJSON(base_url+'doc/dashboard_hist/actividades',datos,function(json){
				actividades = actividades + '

Id	Actividad	Descripción	Fecha Límite	Estado	Acción	Evidencias	Notificar	Anotaciones
';
				$.each(json,function(x,y){
					actividades = actividades + '
P-'+y.idprogramacion+'	'+y.nombre_actividad+'	'+y.descripcion_actividad+'	'+y.fecha.substring(8,10)+'-'+y.fecha.substring(5,7)+'-'+y.fecha.substring(0,4)+'	'+y.estado_actividad+'	'+y.botones+'	'+y.e_doc+'   '+y.doc+'	'+y.mensaje+'	'+y.a+'
';
				});
				actividades=actividades + '
';
			$('.subcategoria'+idcontrato+idcategoria+idsubcategoria).html(actividades);
			});
			$(this).removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
		}else{
			$('.subcategoria'+idcontrato+idcategoria+idsubcategoria).toggle();
			$(this).removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
		}
	});

/*
	$('div.proyecto-inicio').on('click','div.contratos .historico',function(){
		id=$(this).attr('id');
		var idcontrato=$(this).attr('idcontrato');
		var idcategoria=$(this).attr('idcategoria');
		var idsubcategoria=$(this).attr('idsubcategoria');
		var historico='';
		datos = 'idcategoria='+idcategoria+'&idcontrato='+idcontrato+'&idsubcategoria='+idsubcategoria;

		if($('span#'+id).attr('valor')==0){
			$('span#'+id).html('CERRAR HIST\u00d3RICO');
			$('span#'+id).attr('valor',1);
			$('div.historico-doc'+id).html(cargando);
			$.getJSON(base_url+'doc/dashboard/historicos',datos,function(json){
				historico = historico + '

Id	Actividad	Descripción	Fecha Límite	Estado	Acción	Evidencias	Notificar	Anotaciones
';
				$.each(json,function(x,y){
					historico = historico + '
P-'+y.idprogramacion+'	'+y.nombre_actividad+'	'+y.descripcion_actividad+'	'+y.fecha.substring(8,10)+'-'+y.fecha.substring(5,7)+'-'+y.fecha.substring(0,4)+'	'+y.estado_actividad+'	'+y.botones+'	'+y.e_doc+'   '+y.doc+'	'+y.mensaje+'	'+y.a+'
';
				});
				historico=historico + '
';
				$('div.historico-doc'+id).html(historico);
			});
		}
		else{
			$('span#'+id).html('VER HIST\u00d3RICO');
			$('span#'+id).attr('valor',0);
			$('div.historico-doc'+id).html('');
		}

	});

*/

	$('div.proyecto-inicio').on('click','div.contratos .abrir-programacion',function(){
		idprogramacion=$(this).attr('idprogramacion');
		datos='idprogramacion='+idprogramacion;
		$.getJSON(base_url+'doc/dashboard_hist/areas',datos,function(json0){
			areas='';
			tabla_seg='';
			$.each(json0,function(u,v){
				areas = areas + ''+v.nombre_area_involucrada+'
';
			});
			$('#areas').html(areas);
		}).done(function(){
			$.getJSON(base_url+'doc/dashboard_hist/programacion',datos,function(json){
				$('#proyecto').text(json[0].nombre_proyecto);
				$('#contrato').text(json[0].numero_contrato);
				$('#categoria').text(json[0].cat_categoria);
				$('#subcategoria').text(json[0].cat_subcategoria);
				$('#descripcion_contrato').text(json[0].descripcion_contrato);
				$('#inicio_contrato').text(json[0].fecha_inicio);
				$('#fin_contrato').text(json[0].fecha_fin);
				$('#idactividad_p').text('P-'+json[0].idprogramacion);
				$('#actividad').text(json[0].nombre_actividad);
				$('#descripcion').text(json[0].descripcion_actividad);
				$('#documento').text(json[0].documento_contractual);
				$('#empresa').text(json[0].empresa_responsable);
				$('#persona').text(json[0].persona_responsable);
				$('#referencia').text(json[0].referencia_documental);
				$('#detalle').text(json[0].detalle_referencia);
				$('#observacion').text(json[0].observacion);
				$('#fin_actividad').text(json[0].fecha);
			}).done(function(){
				$.getJSON(base_url+'doc/dashboard_hist/desplegar_evidencias',datos,function(json){
					$('div#detalle_acciones').html('');
					table='

#	Evidencia documental	Estado
';
					i=0;
					$.each(json,function(x,y){
						i++;
						table = table+'
'+i+'	'+y.documento+'	'+y.doc_estado_actividad+'
';
					});
					table = table + '
';
					if(i>0){
						$('div#consultar-evidencias').html(table);
					}else{
						$('div#consultar-evidencias').html('No existen evidencias documentales');
					}
				}).done(function(){

					$.getJSON(base_url+'doc/dashboard_hist/desplegar_seguimiento',datos,function(json){
						tabla_seg = '
DESCRIPCI\u00d3N	FECHA	HORA	USUARIO	';
						$.each(json,function(u,v){
							tabla_seg = tabla_seg +'
'+v.estado_actividad+'	'+v.fecha+'	'+v.hora+'	'+v.usuario_registra+'
';
						});
						$('div#seguimiento').html(tabla_seg);
					});

					$('#modal-detalle').modal();
				});
				//
			});
		});
	});

/*

	$('div#detalle_acciones').on('click','i.accion',function(){
		ruta = $(this).attr('ruta');
		idprogramacion = $(this).attr('id');
		estado = $(this).attr('idestado');
		datos = 'idprogramacion='+idprogramacion+'&estado='+estado+'&ruta='+ruta;
		$.getJSON(base_url+'doc/dashboard/cambiar_estado',datos,function(json){
			if(json.msg>0){
				alert('La actividad ha sido '+json.text);
				$('#modal-detalle').modal('hide');
				if(estado!=1){
					loadEvidencias(idprogramacion,estado);
					$('form#form-evidencia-documental input#idprogramacion').val(idprogramacion);
					$('form#form-evidencia-documental input#idestado').val(estado);
					loadEvidencias(idprogramacion);
				}
				$.getJSON(base_url+'doc/dashboard/programacion_actividad','idprogramacion='+idprogramacion,function(json){
					$('tr#programacion'+idprogramacion+' td#botones').html(json[0].botones);
					$('tr#programacion'+idprogramacion+' td#estado').html(json[0].estado_actividad);
				});

			}else{
				alert('Ha ocurrido un error, intente nuevamente');
			}
		})
	});
*/
/*
	$('div#detalle_acciones').on('click','i.doc',function(){
		idprogramacion = $(this).attr('id');
		idestado = $(this).attr('idestado');
		idprgramacion = $('input#idprogramacion').val(idprogramacion);
		idestado = $('input#idestado').val(idestado);
		loadEvidencias(idprogramacion);
	});
*/

/*

	$('div#detalle_acciones').on('click','i.not',function(){
		idprogramacion = $(this).attr('id');
		idestado = $(this).attr('idestado');
		datos='idprogramacion='+idprogramacion;
		$("#not-idprogramacion").val(idprogramacion);
		$.getJSON(base_url+'doc/dashboard/areas',datos,function(json0){
			areas='';
			$.each(json0,function(u,v){
				areas = areas + ''+v.nombre_area_involucrada+'
';
				$.getJSON(base_url+'doc/dashboard/areas_usuarios','idarea='+v.idarea_involucrada,function(json1){
					usuarios='';
					$.each(json1,function(x,y){
						usuarios = usuarios + '
<input type="checkbox" value="'+y.correo_usuario+'" name="correos[]">'+y.usuario+'   NIVEL:'+y.idnivel+'
';

					});
					$(usuarios).insertAfter('span#area'+v.idarea_involucrada);
				});
			});
			$('#enviar-areas').html(areas);
		}).done(function(){
			$.getJSON(base_url+'doc/dashboard/programacion',datos,function(json){
				$('#enviar-idactividad_p').text('P-'+json[0].idprogramacion);
				$('#enviar-actividad').text(json[0].nombre_actividad);
				$('#enviar-descripcion').text(json[0].descripcion_actividad);
				$('#enviar-documento').text(json[0].documento_contractual);
				$('#enviar-empresa').text(json[0].empresa_responsable);
				$('#enviar-persona').text(json[0].persona_responsable);
				$('#enviar-referencia').text(json[0].referencia_documental);
				$('#enviar-detalle').text(json[0].detalle_referencia);
				$('#enviar-observacion').text(json[0].observacion);
			});
		});
		$('#modal-notificacion').modal();
	});
*/
/*
	$('div.proyecto-inicio').on('click','div.contratos i.cancelar_programacion_actividad',function(){
		idprogramacion=$(this).attr('idprogramacion');
		if(confirm("\u00BF Est\u00e1 seguro que desea cancelar la actividad P-"+idprogramacion+"?")){
			datos = 'idprogramacion='+idprogramacion+'&estado=1&ruta=cancelar';
			$.getJSON(base_url+'doc/dashboard/cambiar_estado',datos,function(json){
				if(json.msg>0){
					alert('La actividad ha sido cancelada');
					$('#modal-detalle').modal('hide');
					$.getJSON(base_url+'doc/dashboard/programacion_actividad','idprogramacion='+idprogramacion,function(json){
						$('tr#programacion'+idprogramacion).remove();
					});
				}else{
					alert('Ha ocurrido un error, intente nuevamente');
				}
			});
			return true;
		}
		else
			return false;
	});
*/
/*
	$('#modal-detalle').on('click','i.cancelar_programacion_actividad',function(){
		idprogramacion=$(this).attr('idprogramacion');
		if(confirm("\u00BF Est\u00e1 seguro que desea cancelar la actividad P-"+idprogramacion+"?")){
			datos = 'idprogramacion='+idprogramacion+'&estado=1&ruta=cancelar';
			$.getJSON(base_url+'doc/dashboard/cambiar_estado',datos,function(json){
				if(json.msg>0){
					alert('La actividad ha sido cancelada');
					$('#modal-detalle').modal('hide');
					$.getJSON(base_url+'doc/dashboard/programacion_actividad','idprogramacion='+idprogramacion,function(json){
						$('tr#programacion'+idprogramacion).remove();
					});
				}else{
					alert('Ha ocurrido un error, intente nuevamente');
				}
			});
			return true;
		}
		else
			return false;
	});

*/
	$('div.proyecto-inicio').on('click','div.contratos i.doc',function(){
		idprogramacion = $(this).attr('id');
		idestado = $(this).attr('idestado');
		idprgramacion = $('input#idprogramacion').val(idprogramacion);
		idestado = $('input#idestado').val(idestado);
		loadEvidencias(idprogramacion);
	});

	$('div.proyecto-inicio').on('click','div.contratos i.not',function(){
		idprogramacion = $(this).attr('id');
		idestado = $(this).attr('idestado');
		datos='idprogramacion='+idprogramacion;
		$("#not-idprogramacion").val(idprogramacion);
		$.getJSON(base_url+'doc/dashboard_hist/areas',datos,function(json0){
			areas='';
			$.each(json0,function(u,v){
				areas = areas + ''+v.nombre_area_involucrada+'
';
				$.getJSON(base_url+'doc/dashboard_hist/areas_usuarios','idarea='+v.idarea_involucrada,function(json1){
					usuarios='';
					$.each(json1,function(x,y){
						usuarios = usuarios + '
<input type="checkbox" value="'+y.correo_usuario+'" name="correos[]">'+y.usuario+'   NIVEL:'+y.idnivel+'
';
					});
					$(usuarios).insertAfter('span#area'+v.idarea_involucrada);
				});
			});
			$('#enviar-areas').html(areas);
		}).done(function(){
			$.getJSON(base_url+'doc/dashboard_hist/programacion',datos,function(json){
				$('#enviar-actividad').text(json[0].nombre_actividad);
				$('#enviar-descripcion').text(json[0].descripcion_actividad);
				$('#enviar-documento').text(json[0].documento_contractual);
				$('#enviar-empresa').text(json[0].empresa_responsable);
				$('#enviar-persona').text(json[0].persona_responsable);
				$('#enviar-referencia').text(json[0].referencia_documental);
				$('#enviar-detalle').text(json[0].detalle_referencia);
				$('#enviar-observacion').text(json[0].observacion);
			});
		});
		$('#modal-notificacion').modal();
	});

	$('#btn-enviar-notificacion').click(function(){
		datos = $('form#form-enviar-notificaciones-usuarios').serialize();
		$.getJSON(base_url+'doc/dashboard_hist/notificacion',datos,function(json){
			if(json.msg>0){
				alert('Las notificaciones han sido enviadas');
				$('#modal-notificacion').modal('hide');
			}else{
				alert('Las notificaciones no han podido ser enviadas, intente nuevamente');
			}
		});
	});

	$('div.proyecto-inicio').on('click','div.contratos i.accion',function(){
		ruta = $(this).attr('ruta');
		idprogramacion = $(this).attr('id');
		estado = $(this).attr('idestado');
		datos = 'idprogramacion='+idprogramacion+'&estado='+estado+'&ruta='+ruta;
		idcontrato=$(this).attr('co');
		idcategoria=$(this).attr('ca');
		idsubcategoria=$(this).attr('su');
		datos = 'idprogramacion='+idprogramacion+'&estado='+estado+'&ruta='+ruta;
		$.getJSON(base_url+'doc/dashboard_hist/cambiar_estado',datos,function(json){
			if(json.msg>0){
				alert('La actividad ha sido '+json.text);
				if(estado!=1){
					loadEvidencias(idprogramacion,estado);
					$('form#form-evidencia-documental input#idprogramacion').val(idprogramacion);
					$('form#form-evidencia-documental input#idestado').val(estado);
					loadEvidencias(idprogramacion);
				}
				$.getJSON(base_url+'doc/dashboard_hist/programacion_actividad','idprogramacion='+idprogramacion,function(json){
					$('tr#programacion'+idprogramacion+' td#botones').html(json[0].botones);
					$('tr#programacion'+idprogramacion+' td#estado').html(json[0].estado_actividad);
				});

			}else{
				alert('Ha ocurrido un error, intente nuevamente');
			}
		})
	});

	$('input#guardar_evidencia').click(function(){
		contenedor='<input type="submit" value="Procesando..." class="btn btn-success" disabled id="btn-copia" >';
		$(contenedor).insertAfter('#guardar_evidencia');
		$('#guardar_evidencia').hide();
	});

	var options = {
    	beforeSend: function(){
        	$("#progress").hide();
        	//clear everything
        	$("#bar").width('0%');
        	$("#message").html("");
        	$("#percent").html("0%");
    	},
    	uploadProgress: function(event, position, total, percentComplete){
        	$("#bar").width(percentComplete+'%');
        	$("#percent").html(percentComplete+'%');
 		},
    	success: function(){
        	$("#bar").width('100%');
        	$("#percent").html('100%');
    	},
		complete: function(response){
			//$("#message").html(""+response.responseText+"");
			$('#btn-copia').val('Guardar').hide();
			$('#guardar_evidencia').val('Guardar').show();
			alert(response.responseText);
			idprgramacion = $('input#idprogramacion').val();
			idestado = $('input#idestado').val();
			loadEvidencias(idprogramacion);
			$fileupload=$("#form-evidencia-documental #exampleInputFile");
			$fileupload.replaceWith($fileupload.clone(true));
		},
		error: function(){
			//$("#message").html(" ERROR: Intente nuevamente");
			alert('Ocurrio un error, intente nuevamente');
		}
	};

	$("#form-evidencia-documental").ajaxForm(options);

	$('div#detalle-evidencia-documental').on('click','a.eliminar-documento',function(){
		iddocumento = $(this).attr('id');
		idprogramacion = $('input#idprogramacion').val();
		datos = 'iddocumento='+iddocumento;
		$.getJSON(base_url+'doc/dashboard_hist/eliminar_evidencia',datos,function(json){
			if(json.msg>0){
				alert('La evidencia ha sido eliminada');
				loadEvidencias(idprogramacion);
			}else{
				alert('Ha ocurrido un error, intente nuevamente');
			}
		});
	});

});

//anotaciones
	$('div').on('click','i.notas',function(){
		id=$(this).attr('id');
		muestra_anotaciones(id);
		$('#idprogramacion_v').val(id);
		$('#modal-anotacion').modal();
	});

	//guardar anotacion
	$('#modal-anotacion').on('click','button#guarda_anotacion',function(){
		errores = 0;
		if($('textarea#nota_v').val()==''){
			errores = errores + 1;
			$('textarea#nota_v').css('border','solid 1px red');
		}else{
			$('textarea#nota_v').css('border','solid 1px #ccc');
		}

		if(errores>0){
			alert('Llene los campos correctamente');
		}else{
			$(this).html('Procesando...').attr('disabled',true);
			fecha=$('input#fecha_anotacion').val();
			nota=$('textarea#nota_v').val();
			valoracion=$('select#val').val();
			usuario=$('input#usuario_v').val();
			idprogramacion=$('input#idprogramacion_v').val();
			datos='fecha='+fecha+'&nota='+nota+'&valoracion='+valoracion+'&usuario='+usuario+'&idprogramacion='+idprogramacion;
			$.getJSON(base_url+'doc/dashboard_hist/guarda_anotacion',datos,function(data){
				$('button#guarda_anotacion').html('Guardar').attr('disabled',false);
				if(data.msg>0){
					alert('La anotacion se guardo correctamente.');
					muestra_anotaciones(idprogramacion);
					actualiza_anotacions(idprogramacion);
				}else{
					alert('Ocurrio un error, intente nuevamente.');
				}
			});
		}
	});

	//bloquea anotacion
	$('#modal-anotacion').on('click','i.bloquear_v',function(){
		id=$(this).attr('id');
		idprogramacion=$(this).attr('idprogramacion');
		datos='id='+id;
		if(confirm("Esta seguro de bloquear la anotacion")){
			$.getJSON(base_url+'doc/dashboard_hist/bloquea_anotacion',datos,function(data){
				if(data.msg>0){
					alert('La anotacion ha sido bloqueada.');
					muestra_anotaciones(idprogramacion);
				}else{
					alert('Ocurrio un error, intente nuevamente.');
				}
			});
		return true;
		}else{
			return false;
		}
	});

	//elimina anotacion
	$('#modal-anotacion').on('click','i.borrar_v',function(){
		id=$(this).attr('id');
		idprogramacion=$(this).attr('idprogramacion');
		datos='id='+id;
		if(confirm("Esta seguro de eliminar la anotacion")){
			$.getJSON(base_url+'doc/dashboard_hist/eliminar_anotacion',datos,function(data){
				if(data.msg>0){
					alert('La anotacion ha sido eliminada.');
					muestra_anotaciones(idprogramacion);
					actualiza_anotacion(idprogramacion);
				}else{
					alert('Ocurrio un error, intente nuevamente.');
				}
			});
		return true;
		}else{
			return false;
		}
	});

function muestra_anotaciones(idprogramacion)
{
	$('#fecha_anotacion').val(anio+'-'+mes+'-'+dia);
	$('#nota_v').val('');
	$("select#val").val("1");

	datos = 'idprogramacion='+idprogramacion;
	$.getJSON(base_url+'doc/dashboard_hist/desplegar_anotaciones',datos,function(json){
		contenido='

#	Fecha	Anotacion	Valoracion	Uusuario	Estado	Accion
';
		i=0;
		$.each(json,function(x,y){
			i++;
			contenido=contenido+'
'+i+'	'+y.fecha_anotacion+' '+y.hora_anotacion+'	'+y.anotacion+'	'+y.valoracion+'	'+y.usuario_registra+'	'+y.cat_estado_anotacion+'	'+y.accion+'
';
		});
		contenido=contenido+'
';
		if(i>0){
			$('#detalle-anotaciones').html(contenido);
		}else{
			$('#detalle-anotaciones').html('No existen anotaciones');
		}

	});

}

function loadEvidencias(idprogramacion)
{
	datos = 'idprogramacion='+idprogramacion;
	$.getJSON(base_url+'doc/dashboard_hist/desplegar_evidencias',datos,function(json){
		table='

#	Evidencia documental	Estado	Acción
';
			i=0;
			$.each(json,function(x,y){
				i++;
				table = table+'
'+i+'	'+y.documento+'	'+y.doc_estado_actividad+'	'+y.eliminar+'
';
			});
		table = table + '
';
		if(i>0){
			$('div#detalle-evidencia-documental').html(table);
		}else{
			$('div#detalle-evidencia-documental').html('No existen evidencias documentales');
		}
	}).done(function(){
		$('div#modal-evidencia-documental').modal();
		$fileupload=$("#form-evidencia-documental #exampleInputFile");
		$fileupload.replaceWith($fileupload.clone(true));
	}).done(function(){
		$.getJSON(base_url+'doc/dashboard_hist/numero_evidencia',datos,function(json1){
			$('tr#programacion'+idprogramacion+' td#evidencias').html(json1[0].e_doc+'   '+json1[0].doc);
		});
	});
}

function actualiza_anotacions(idprogramacion)
{
	datos = 'idprogramacion='+idprogramacion;
	$.getJSON(base_url+'doc/dashboard_hist/numero_anotacion',datos,function(json){
		$('tr#programacion'+idprogramacion+' td#anotacion').html(json[0].numero+'   '+json[0].anotacion);
	});
}


text:
package redis

import (
	pb "beam.apache.org/playground/backend/internal/api/v1"
	"beam.apache.org/playground/backend/internal/cache"
	"context"
	"encoding/json"
	"fmt"
	"github.com/go-redis/redis/v8"
	"github.com/go-redis/redismock/v8"
	"github.com/google/uuid"
	"reflect"
	"testing"
	"time"
)

func TestRedisCache_GetValue(t *testing.T) {
	pipelineId := uuid.New()
	subKey := cache.RunOutput
	value := "MOCK_OUTPUT"
	client, mock := redismock.NewClientMock()
	marshSubKey, _ := json.Marshal(subKey)
	marshValue, _ := json.Marshal(value)

	type fields struct {
		redisClient *redis.Client
	}
	type args struct {
		ctx        context.Context
		pipelineId uuid.UUID
		subKey     cache.SubKey
	}
	tests := []struct {
		name    string
		mocks   func()
		fields  fields
		args    args
		want    interface{}
		wantErr bool
	}{
		{
			name: "error during HGet operation",
			mocks: func() {
				mock.ExpectHGet(pipelineId.String(), string(marshSubKey)).SetErr(fmt.Errorf("MOCK_ERROR"))
			},
			fields: fields{client},
			args: args{
				ctx:        context.TODO(),
				pipelineId: pipelineId,
				subKey:     subKey,
			},
			want:    nil,
			wantErr: true,
		},
		{
			name: "all success",
			mocks: func() {
				mock.ExpectHGet(pipelineId.String(), string(marshSubKey)).SetVal(string(marshValue))
			},
			fields: fields{client},
			args: args{
				ctx:        context.TODO(),
				pipelineId: pipelineId,
				subKey:     subKey,
			},
			want:    value,
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			tt.mocks()
			rc := &Cache{
				tt.fields.redisClient,
			}
			got, err := rc.GetValue(tt.args.ctx, tt.args.pipelineId, tt.args.subKey)
			if (err != nil) != tt.wantErr {
				t.Errorf("GetValue() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("GetValue() got = %v, want %v", got, tt.want)
			}
			mock.ClearExpect()
		})
	}
}

func TestRedisCache_SetExpTime(t *testing.T) {
	pipelineId := uuid.New()
	expTime := time.Second
	client, mock := redismock.NewClientMock()

	type fields struct {
		redisClient *redis.Client
	}
	type args struct {
		ctx        context.Context
		pipelineId uuid.UUID
		expTime    time.Duration
	}
	tests := []struct {
		name    string
		mocks   func()
		fields  fields
		args    args
		wantErr bool
	}{
		{
			name: "error during Exists operation",
			mocks: func() {
				mock.ExpectExists(pipelineId.String()).SetErr(fmt.Errorf("MOCK_ERROR"))
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				expTime:    expTime,
			},
			wantErr: true,
		},
		{
			name: "Exists operation returns 0",
			mocks: func() {
				mock.ExpectExists(pipelineId.String()).SetVal(0)
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				expTime:    expTime,
			},
			wantErr: true,
		},
		{
			name: "error during Expire operation",
			mocks: func() {
				mock.ExpectExists(pipelineId.String()).SetVal(1)
				mock.ExpectExpire(pipelineId.String(), expTime).SetErr(fmt.Errorf("MOCK_ERROR"))
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				expTime:    expTime,
			},
			wantErr: true,
		},
		{
			name: "all success",
			mocks: func() {
				mock.ExpectExists(pipelineId.String()).SetVal(1)
				mock.ExpectExpire(pipelineId.String(), expTime).SetVal(true)
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				expTime:    expTime,
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			tt.mocks()
			rc := &Cache{
				tt.fields.redisClient,
			}
			if err := rc.SetExpTime(tt.args.ctx, tt.args.pipelineId, tt.args.expTime); (err != nil) != tt.wantErr {
				t.Errorf("SetExpTime() error = %v, wantErr %v", err, tt.wantErr)
			}
			mock.ClearExpect()
		})
	}
}

func TestRedisCache_SetValue(t *testing.T) {
	pipelineId := uuid.New()
	subKey := cache.Status
	value := pb.Status_STATUS_FINISHED
	client, mock := redismock.NewClientMock()
	marshSubKey, _ := json.Marshal(subKey)
	marshValue, _ := json.Marshal(value)

	type fields struct {
		redisClient *redis.Client
	}
	type args struct {
		ctx        context.Context
		pipelineId uuid.UUID
		subKey     cache.SubKey
		value      interface{}
	}
	tests := []struct {
		name    string
		mocks   func()
		fields  fields
		args    args
		wantErr bool
	}{
		{
			name: "error during HSet operation",
			mocks: func() {
				mock.ExpectHSet(pipelineId.String(), marshSubKey, marshValue).SetErr(fmt.Errorf("MOCK_ERROR"))
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				subKey:     subKey,
				value:      value,
			},
			wantErr: true,
		},
		{
			name: "all success",
			mocks: func() {
				mock.ExpectHSet(pipelineId.String(), marshSubKey, marshValue).SetVal(1)
				mock.ExpectExpire(pipelineId.String(), time.Minute*15).SetVal(true)
			},
			fields: fields{client},
			args: args{
				ctx:        context.Background(),
				pipelineId: pipelineId,
				subKey:     subKey,
				value:      value,
			},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			tt.mocks()
			rc := &Cache{
				tt.fields.redisClient,
			}
			if err := rc.SetValue(tt.args.ctx, tt.args.pipelineId, tt.args.subKey, tt.args.value); (err != nil) != tt.wantErr {
				t.Errorf("SetValue() error = %v, wantErr %v", err, tt.wantErr)
			}
			mock.ClearExpect()
		})
	}
}

func Test_newRedisCache(t *testing.T) {
	address := "host:port"
	type args struct {
		ctx  context.Context
		addr string
	}
	tests := []struct {
		name    string
		args    args
		wantErr bool
	}{
		{
			name: "error during Ping operation",
			args: args{
				ctx:  context.Background(),
				addr: address,
			},
			wantErr: true,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if _, err := New(tt.args.ctx, tt.args.addr); (err != nil) != tt.wantErr {
				t.Errorf("newRedisCache() error = %v, wantErr %v", err, tt.wantErr)
			}
		})
	}
}

func Test_unmarshalBySubKey(t *testing.T) {
	status := pb.Status_STATUS_FINISHED
	statusValue, _ := json.Marshal(status)
	output := "MOCK_OUTPUT"
	outputValue, _ := json.Marshal(output)
	type args struct {
		ctx    context.Context
		subKey cache.SubKey
		value  string
	}
	tests := []struct {
		name    string
		args    args
		want    interface{}
		wantErr bool
	}{
		{
			name: "status subKey",
			args: args{
				ctx:    context.Background(),
				subKey: cache.Status,
				value:  string(statusValue),
			},
			want:    status,
			wantErr: false,
		},
		{
			name: "runOutput subKey",
			args: args{
				subKey: cache.RunOutput,
				value:  string(outputValue),
			},
			want:    output,
			wantErr: false,
		},
		{
			name: "compileOutput subKey",
			args: args{
				subKey: cache.CompileOutput,
				value:  string(outputValue),
			},
			want:    output,
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got, err := unmarshalBySubKey(tt.args.subKey, tt.args.value)
			if (err != nil) != tt.wantErr {
				t.Errorf("unmarshalBySubKey() error = %v, wantErr %v", err, tt.wantErr)
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("unmarshalBySubKey() got = %v, want %v", got, tt.want)
			}
		})
	}
}


text:
OpenDesk UI is a collaboration web app that grant users easy access to Alfresco repository and a range of other services combined with chat and simple workflow tools.

## Setting up and running OpenDesk-UI

You'll want to clone the git repo and get it running. We assume you have an Apache server and Alfresco installation already set up, but you'll need to add a little extra magic.

First, clone the Git repo. In a terminal, go to your home dir and enter the following commands:
```
$ git clone https://github.com/magenta-aps/OpenDESK-UI.git
$ cd ~/www/OpenDESK-UI
$ npm install -g gulp
$ ./update-all.sh
```
*Note:* The above _update-all_ command might take a while. Enter "3" if it asks you about selecting versions for translation package)

When you change .scss (SASS) files in the project, you'll want to run a watcher that grabs your code and compiles new CSS on the fly. You can make that happen by running the gulp watch command in your project directory:
```
$ gulp watch
```
Happy coding :)

If you want to run OpenDesk-UI against an Alfresco server running on localhost and ejabberd running on demo.opendesk.dk, then run:
```
$ gulp local
```

If you want to run it against the demo.opendesk.dk Alfresco/ejabberd server, then run:
```
$ gulp demo
```


text:
<?php

require_once dirname(dirname(__FILE__)) . '/init.php';

// Enter parameters required by the code example.
$adGroupId = 'INSERT_AD_GROUP_ID_HERE';

/**
 * Runs the example.
 * @param AdWordsUser $user the user to run the example with
 * @param string $adGroupId the ID of the ad group to add the ads to
 */
function AddThirdPartyRedirectAdsExample(AdWordsUser $user, $adGroupId) {
  // Get the service, which loads the required classes.
  $adGroupAdService = $user->GetService('AdGroupAdService', ADWORDS_VERSION);

  $numAds = 5;

  $thirdPartyRedirectAd = new ThirdPartyRedirectAd();
  $thirdPartyRedirectAd->name = 'Example third party ad #' . uniqid();
  $thirdPartyRedirectAd->url = 'http://www.example.com';

  $thirdPartyRedirectAd->dimensions = new Dimensions(300, 250);
  // This field normally contains the javascript ad tag.
  $thirdPartyRedirectAd->snippet = '<img src="http://goo.gl/HJM3L"/>';

  // DoubleClick Rich Media Expandable format ID.
  $thirdPartyRedirectAd->certifiedVendorFormatId = 232;
  $thirdPartyRedirectAd->isCookieTargeted = false;
  $thirdPartyRedirectAd->isUserInterestTargeted = false;
  $thirdPartyRedirectAd->isTagged = false;

  // Expandable Ad properties.
  $thirdPartyRedirectAd->expandingDirections =
      array('EXPANDING_UP', 'EXPANDING_DOWN');
  $thirdPartyRedirectAd->adAttributes = array('ROLL_OVER_TO_EXPAND');

  // Create ad group ad.
  $thirdPartyAdGroup = new AdGroupAd();
  $thirdPartyAdGroup->adGroupId = $adGroupId;
  $thirdPartyAdGroup->ad = $thirdPartyRedirectAd;

  // Set additional settings (optional).
  $thirdPartyAdGroup->status = 'PAUSED';

  // Create operation.
  $thirdPartyOperation = new AdGroupAdOperation();
  $thirdPartyOperation->operand = $thirdPartyAdGroup;
  $thirdPartyOperation->operator = 'ADD';

  // Create in stream third party redirect ad.
  $inStreamRedirectAd = new ThirdPartyRedirectAd();
  $inStreamRedirectAd->name = 'Example third party ad #' . uniqid();
  $inStreamRedirectAd->url = 'http://www.example.com';

  // Duration = 15 seconds
  $inStreamRedirectAd->adDuration = 15000;
  $inStreamRedirectAd->sourceUrl = 'http://ad.doubleclick.net/pfadx/' .
      'N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;' .
      'ord=%5btimestamp%5d;dcmt=text/xml';

  // VAST (video) Unit.
  $inStreamRedirectAd->certifiedVendorFormatId = 303;

  $inStreamRedirectAd->richMediaAdType = 'IN_STREAM_VIDEO';

  // Create ad group ad.
  $inStreamAdGroup = new AdGroupAd();
  $inStreamAdGroup->adGroupId = $adGroupId;
  $inStreamAdGroup->ad = $inStreamRedirectAd;

  // Set additional settings (optional).
  $inStreamAdGroup->status = 'PAUSED';

  // Create operation.
  $inStreamOperation = new AdGroupAdOperation();
  $inStreamOperation->operand = $inStreamAdGroup;
  $inStreamOperation->operator = 'ADD';

  $operations = array(
    $thirdPartyOperation,
    $inStreamOperation,
  );

  // Make the mutate request.
  $result = $adGroupAdService->mutate($operations);

  // Display results.
  foreach ($result->value as $adGroupAd) {
    printf("Third party redirect ad with name '%s' and ID '%s' was added.\n",
        $adGroupAd->ad->name, $adGroupAd->ad->id);
  }
}

// Don't run the example if the file is being included.
if (__FILE__ != realpath($_SERVER['PHP_SELF'])) {
  return;
}

try {
  // Get AdWordsUser from credentials in "../auth.ini"
  // relative to the AdWordsUser.php file's directory.
  $user = new AdWordsUser();

  // Log every SOAP XML request and response.
  $user->LogAll();

  // Run the example.
  AddThirdPartyRedirectAdsExample($user, $adGroupId);
} catch (Exception $e) {
  printf("An error has occurred: %s\n", $e->getMessage());
}


text:
using namespace std;

class energyCom
{
	protected:
		struct energyError{
			unsigned int code = 0;
			string info = "";
		}_error;

		bool _success = true;

		bool _enable_logging = false;
		string _conf_file = ENERGY_CONFIG_FILE_PATH;
		string _log_file;
		unsigned int _debug_level = 0;

	protected:
		bool isNull(int i) { return i == ENERGY_NULL_VALUE; };
		bool isNull(const string & s) { return s.empty(); };

		virtual string version() { return ""; }
		void logging(const char * func, unsigned int line, const string & text, unsigned int level = 0);

	public:
		virtual string getVersion();
		string getLastError();
		bool error(int code, const string &info, const string & log_info = "");
		bool error(const char * func, unsigned int line, unsigned int code, const string &info, const string & log_info = "");
		void clearError();
		bool getLastExecSuccess() { return this->_success; }
		bool success();

	public:
		energyCom() {};
		energyCom(string conf_file) { this->_conf_file = conf_file; }
		virtual ~energyCom() {};
};

//=====================================================================================================
class energySerial: public energyCom
{
	private:
		struct serialCon {
			string			device			= ENERGY_SERIAL_DEVICE;
			unsigned int	baud_rate		= ENERGY_SERIAL_BAUD_RATE;
		}_serialCon;

		int _fd = -1;

		bool _initialized = false;
		bool _connected = false;
		bool _exit_flag = false;
		bool (* _on_data_callback)(const char * data) = NULL;

	public:
		virtual string getVersion();
		bool loadConfig(string fileName);

		bool initInst();
		bool clearInst();
		bool runInstLoop();
		bool instWrite(const char * data = NULL);
		bool instWrite(vector <char> data);

		void setDataCallback(bool (* callback)(const char * data)) { this->_on_data_callback = callback; }
		void onMessage(const char * data);
		char calculateCumulativeSum(const char * data);
	public:
		energySerial();
		energySerial(const string & conf_file);
		energySerial(const string & dev, unsigned int baud_rate);
		virtual ~energySerial();
};

//=====================================================================================================
class energyMqtt: public energyCom
{
	private:
		struct mqttMessage {
			struct mosquitto * m	= NULL;
			energyMqtt * instObj	= NULL;
		}_mqttMsg;

		struct mqttTls {
			bool useSsl			= false;
			string version		= "tlsv1";
			string ca_file		= "";
			string ca_path		= "";
			string cert_file	= "";
			string key_file		= "";
			bool insecure		= false;
		}_mqttTls;

		struct mqttCon {
			string			host			= ENERGY_MQTT_BROKER_HOSTNAME;
			unsigned int	port			= ENERGY_MQTT_BROKER_PORT;
			string			username		= "";
			string			password		= "";
			unsigned int	keepalive_time	= ENERGY_MQTT_KEEPALIVE_TIME;
			unsigned int	timeout			= ENERGY_MQTT_CONN_TIMEOUT;
			unsigned int	max_packets		= ENERGY_MQTT_CONN_MAX_PACKETS;

			string			message_profile	= ENERGY_MQTT_MSG_PROFILE_NAME;
			string			control_profile	= ENERGY_MQTT_CTRL_PROFILE_NAME;
		}_mqttCon;

		bool _initialized	= false;
		bool _connected		= false;
		bool _subscribed	= false;

		bool (* _on_ctrl_data_callback)(const char *) = NULL;

	public:
		bool setTls();
		bool setUserPass();

	public:
		virtual string getVersion();
		bool loadConfig(string fileName);

		string hostMqtt() { return this->_mqttCon.host; }
		int portMqtt() { return this->_mqttCon.port; }
		int keepAliveSeconds() { return this->_mqttCon.keepalive_time; }

		void hostMqtt(string host) { this->_mqttCon.host = host; }
		void portMqtt(unsigned int port) { this->_mqttCon.port = port; }
		void keepAliveSeconds(unsigned int seconds) { this->_mqttCon.keepalive_time = seconds; }

		bool isInitialized() { return _initialized; }
		bool isConnected() { return _connected; }
	public:
		bool initInst();
		bool instConnect();
		bool instDisconnect();
		bool runInstLoop();
		bool instSubscribe(struct mosquitto *m, int *mid, const char *sub, int qos = 0);
		bool instPublish(const char * data, int qos = 0);

		static void onConnect(struct mosquitto *m, void *udata, int result);
		static void onDisconnect(struct mosquitto *m, void *udata, int result);
		static void onPublish(struct mosquitto *m, void *udata, int m_id);
		static void onSubscribe(struct mosquitto *m, void *udata, int mid, int qos_count, const int *granted_qos);
		static void onMessage(struct mosquitto *m, void *udata, const struct mosquitto_message *msg);

		void processCtrlData(const char * data);
		void setCtrlDataCallback(bool (* callback)(const char *)) { this->_on_ctrl_data_callback = callback; }
	public:
		energyMqtt();
		virtual ~energyMqtt();
};


text:
import { ICellEditorComp, ICellEditorParams } from "../../interfaces/iCellEditor";
import { PopupComponent } from "../../widgets/popupComponent";
export interface ILargeTextEditorParams extends ICellEditorParams {
    maxLength: number;
    rows: number;
    cols: number;
}
export declare class LargeTextCellEditor extends PopupComponent implements ICellEditorComp {
    private static TEMPLATE;
    private params;
    private eTextArea;
    private focusAfterAttached;
    constructor();
    init(params: ILargeTextEditorParams): void;
    private onKeyDown;
    afterGuiAttached(): void;
    getValue(): any;
}


text:
typedef void (^CoderwallAPIProfileSuccessBlock)(CoderwallUserProfile *profile);
typedef void (^CoderwallAPIBasicFailureBlock)(NSError *error);

@interface CoderwallAPIClient : AFHTTPClient

+ (id)sharedClient;
- (void)profileForUsername:(NSString *)username
                completion:(CoderwallAPIProfileSuccessBlock)completion
                   failure:(CoderwallAPIBasicFailureBlock)failure;

@end


text:
module Cubits
  class Quote < Resource
    path '/api/v1/quotes'

    expose_methods :create
  end # class Quote
end


text:
#define Clean(a)

typedef struct clean_string *CleanString;

/*	a string in Clean is:
	struct clean_string {
		int clean_string_length;
		char clean_string_characters[clean_string_length];
	};
	The string does not end with a '\0' !
*/

/* CleanStringLength(clean_string) returns the length of the clean_string in characters */
#define CleanStringLength(clean_string) (*(unsigned long *)(clean_string))

/* CleanStringCharacters(clean_string) returns a pointer to the characters of the clean_string */
#define CleanStringCharacters(clean_string) ((char*)(1+(unsigned long *)(clean_string)))

/* CleanStringSizeInts(string_length) return size of *CleanString in integers */
#define CleanStringSizeInts(string_length) (1+(((unsigned int)(string_length)+3)>>2))

/* CleanStringVariable(clean_string,string_length) defines variable clean_string with length string_length,
   before using the clean_string variable, cast to CleanString, except for the macros above  */
#define CleanStringVariable(clean_string,string_length) unsigned int clean_string[CleanStringSizeInts(string_length)]

/* CleanStringSizeBytes(string_length) return size of *CleanString in bytes */
#define CleanStringSizeBytes(string_length) (4+(((unsigned int)(string_length)+3) & -4))

typedef int *CleanIntArray;

/* CleanIntArraySize(clean_array) returns the size (number of elements) of the clean_int_array */
#define CleanIntArraySize(clean_int_array) (((unsigned int *)(clean_int_array))[-2])

typedef double *CleanRealArray;

/* CleanRealArraySize(clean_real_array) returns the size (number of elements) of the clean_real_array */
#define CleanRealArraySize(clean_real_array) (((unsigned int *)(clean_real_array))[-2])

typedef unsigned char *CleanCharArray;

/* CleanCharArraySize(clean_char_array) returns the size (number of elements) of the clean_char_array */
#define CleanCharArraySize(clean_char_array) (((unsigned int *)(clean_char_array))[-1])


text:
using System;
using System.Collections.Generic;
using System.Linq;

using FluentMigrator.Runner.Extensions;
using FluentMigrator.Runner.Processors;

namespace FluentMigrator.Runner.Generators
{
    [Obsolete]
    public class MigrationGeneratorFactory
    {
        private static readonly IDictionary<string, IMigrationGenerator> _migrationGenerators;

        static MigrationGeneratorFactory()
        {
            var assemblies = MigrationProcessorFactoryProvider.RegisteredFactories.Select(x => x.GetType().Assembly);

            var types = assemblies
                .SelectMany(a => a.GetExportedTypes())
                .Where(type => type.IsConcrete() && type.Is<IMigrationGenerator>())
                .ToList();

            var available = new SortedDictionary<string, IMigrationGenerator>();
            foreach (Type type in types)
            {
                try
                {
                    var factory = (IMigrationGenerator) Activator.CreateInstance(type);
                    available.Add(type.Name.Replace("Generator", ""), factory);
                }
                catch (Exception)
                {
                    //can't add generators that require construtor parameters
                }
            }

            _migrationGenerators = available;
        }

        [Obsolete("Ony the statically provided generators are accessed")]
        public MigrationGeneratorFactory()
        {
        }

        public static IEnumerable<IMigrationGenerator> RegisteredGenerators
            => _migrationGenerators.Values;

        [Obsolete("Ony the statically provided generators are accessed")]
        public virtual IMigrationGenerator GetGenerator(string name)
        {
            return _migrationGenerators
                   .Where(pair => pair.Key.Equals(name, StringComparison.OrdinalIgnoreCase))
                   .Select(pair => pair.Value)
                   .FirstOrDefault();
        }

        [Obsolete("Ony the statically provided generators are accessed")]
        public string ListAvailableGeneratorTypes()
        {
            return string.Join(", ", _migrationGenerators.Keys.ToArray());
        }
    }
}


text:
using System.Collections.Generic;

namespace OrdersCollector.EventSourcing.Tests.AggregateTests
{
    public class TestAggregate : AggregateRoot
    {
        private List<IEvent> appliedEvents = new List<IEvent>();

        public TestAggregate()
        {
            RegisterEventHandler<TestEvent1>(When);
            RegisterEventHandler<TestEvent2>(When);
        }

        private void When(TestEvent1 @event)
        {
            appliedEvents.Add(@event);
        }

        private void When(TestEvent2 @event)
        {
            appliedEvents.Add(@event);
        }

        public void InvokeRaiseEvent(IEvent @event)
        {
            RaiseEvent(@event);
        }

        public IEnumerable<IEvent> AppliedEvents => appliedEvents;
    }

    public class TestEvent1 : Event
    {
    }

    public class TestEvent2 : Event
    {
    }

    public class TestUnsupportedEvent : Event
    {
    }
}


text:
newproperty(:insertionpaused) do
  include EasyType
  include EasyType::Mungers::Integer

  desc <<-EOD

  EOD
  newvalues(1, 0)

  to_translate_to_resource do | raw_resource|
    raw_resource['insertionpaused']
  end

end


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _helperPluginUtils = require("@babel/helper-plugin-utils");

var _pluginSyntaxExportNamespaceFrom = _interopRequireDefault(require("@babel/plugin-syntax-export-namespace-from"));

var _core = require("@babel/core");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = (0, _helperPluginUtils.declare)(api => {
  api.assertVersion(7);
  return {
    name: "proposal-export-namespace-from",
    inherits: _pluginSyntaxExportNamespaceFrom.default,
    visitor: {
      ExportNamedDeclaration(path) {
        var _exported$name;

        const {
          node,
          scope
        } = path;
        const {
          specifiers
        } = node;
        const index = _core.types.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;
        if (!_core.types.isExportNamespaceSpecifier(specifiers[index])) return;
        const nodes = [];

        if (index === 1) {
          nodes.push(_core.types.exportNamedDeclaration(null, [specifiers.shift()], node.source));
        }

        const specifier = specifiers.shift();
        const {
          exported
        } = specifier;
        const uid = scope.generateUidIdentifier((_exported$name = exported.name) != null ? _exported$name : exported.value);
        nodes.push(_core.types.importDeclaration([_core.types.importNamespaceSpecifier(uid)], _core.types.cloneNode(node.source)), _core.types.exportNamedDeclaration(null, [_core.types.exportSpecifier(_core.types.cloneNode(uid), exported)]));

        if (node.specifiers.length >= 1) {
          nodes.push(node);
        }

        const [importDeclaration] = path.replaceWithMultiple(nodes);
        path.scope.registerDeclaration(importDeclaration);
      }

    }
  };
});

exports.default = _default;


text:
require 'spec_helper'

module FakeRedis
  describe "SetsMethods" do
    before(:each) do
      @client = Redis.new
    end

    it "should add a member to a set" do
      expect(@client.sadd("key", "value")).to eq(true)
      expect(@client.sadd("key", "value")).to eq(false)

      expect(@client.smembers("key")).to eq(["value"])
    end

    it "should raise error if command arguments count is not enough" do
      expect { @client.sadd("key", []) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'sadd' command")
      expect { @client.sinter(*[]) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'sinter' command")
      expect { @client.sinter([]) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'sinter' command")
      expect { @client.sunion(*[]) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'sunion' command")
      expect { @client.sunion([]) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'sunion' command")
      expect { @client.srem("key", []) }.to raise_error(Redis::CommandError, "ERR wrong number of arguments for 'srem' command")

      expect(@client.smembers("key")).to be_empty
    end

    it "should add multiple members to a set" do
      expect(@client.sadd("key", %w(value other something more))).to eq(4)
      expect(@client.sadd("key", %w(and additional values))).to eq(3)
      expect(@client.smembers("key")).to match_array(["value", "other", "something", "more", "and", "additional", "values"])
    end

    it "should get the number of members in a set" do
      @client.sadd("key", "val1")
      @client.sadd("key", "val2")

      expect(@client.scard("key")).to eq(2)
    end

    it "should subtract multiple sets" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")

      expect(@client.sdiff("key1", "key2", "key3")).to match_array(["b", "d"])
      expect(@client.sdiff("key1", ["key2", "key3"])).to match_array(["b", "d"])
    end

    it "should subtract from a nonexistent set" do
      @client.sadd("key2", "a")
      @client.sadd("key2", "b")

      expect(@client.sdiff("key1", "key2")).to eq([])
      expect(@client.sdiff(["key1", "key2"])).to eq([])
    end

    it "should subtract multiple sets and store the resulting set in a key" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")
      @client.sdiffstore("key", "key1", "key2", "key3")
      @client.sdiffstore("new_key", "key1", ["key2", "key3"])

      expect(@client.smembers("key")).to match_array(["b", "d"])
      expect(@client.smembers("new_key")).to match_array(["b", "d"])
    end

    it "should intersect multiple sets" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")

      expect(@client.sinter("key1", "key2", "key3")).to eq(["c"])
      expect(@client.sinter(["key1", "key2", "key3"])).to eq(["c"])
    end

    it "should intersect multiple sets and store the resulting set in a key" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")
      @client.sinterstore("key", "key1", "key2", "key3")
      @client.sinterstore("new_key", ["key1", "key2", "key3"])

      expect(@client.smembers("key")).to eq(["c"])
      expect(@client.smembers("new_key")).to eq(["c"])
    end

    it "should determine if a given value is a member of a set" do
      @client.sadd("key1", "a")

      expect(@client.sismember("key1", "a")).to eq(true)
      expect(@client.sismember("key1", "b")).to eq(false)
      expect(@client.sismember("key2", "a")).to eq(false)
    end

    it "should get all the members in a set" do
      @client.sadd("key", "a")
      @client.sadd("key", "b")
      @client.sadd("key", "c")
      @client.sadd("key", "d")

      expect(@client.smembers("key")).to match_array(["a", "b", "c", "d"])
    end

    it "should move a member from one set to another" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key2", "c")
      expect(@client.smove("key1", "key2", "a")).to eq(true)
      expect(@client.smove("key1", "key2", "a")).to eq(false)

      expect(@client.smembers("key1")).to eq(["b"])
      expect(@client.smembers("key2")).to match_array(["c", "a"])
    end

    it "should remove and return a random member from a set" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")

      expect(["a", "b"].include?(@client.spop("key1"))).to be true
      expect(["a", "b"].include?(@client.spop("key1"))).to be true
      expect(@client.spop("key1")).to be_nil
    end

    it "should get a random member from a set" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")

      expect(["a", "b"].include?(@client.spop("key1"))).to be true
    end

    it "should pop multiple members from a set" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")

      vals = @client.spop("key1", 2)
      expect(vals.count).to eq(2)
      vals.each { |v| expect(["a", "b", "c"].include?(v)).to be true }

      new_vals = @client.spop("key1", 2)
      expect(new_vals.count).to eq(1)
      expect(["a", "b", "c"].include?(new_vals.first)).to be true

      expect(["a", "b", "c"]).to eq((vals + new_vals).sort)
    end

    it "should remove a member from a set" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      expect(@client.srem("key1", "a")).to eq(true)
      expect(@client.srem("key1", "a")).to eq(false)

      expect(@client.smembers("key1")).to eq(["b"])
    end

    it "should remove multiple members from a set" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")

      expect(@client.srem("key1", [ "a", "b"])).to eq(2)
      expect(@client.smembers("key1")).to be_empty
    end

    it "should remove the set's key once it's empty" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.srem("key1", "b")
      @client.srem("key1", "a")

      expect(@client.exists("key1")).to eq(false)
    end

    it "should add multiple sets" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")

      expect(@client.sunion("key1", "key2", "key3")).to match_array(["a", "b", "c", "d", "e"])
    end

    it "should add multiple sets and store the resulting set in a key" do
      @client.sadd("key1", "a")
      @client.sadd("key1", "b")
      @client.sadd("key1", "c")
      @client.sadd("key1", "d")
      @client.sadd("key2", "c")
      @client.sadd("key3", "a")
      @client.sadd("key3", "c")
      @client.sadd("key3", "e")
      @client.sunionstore("key", "key1", "key2", "key3")

      expect(@client.smembers("key")).to match_array(["a", "b", "c", "d", "e"])
    end
  end

  describe 'srandmember' do
    before(:each) do
      @client = Redis.new
    end

    context 'with a set that has three elements' do
      before do
        @client.sadd("key1", "a")
        @client.sadd("key1", "b")
        @client.sadd("key1", "c")
      end

      context 'when called without the optional number parameter' do
        it 'is a random element from the set' do
          random_element = @client.srandmember("key1")

          expect(['a', 'b', 'c'].include?(random_element)).to be true
        end
      end

      context 'when called with the optional number parameter of 1' do
        it 'is an array of one random element from the set' do
          random_elements = @client.srandmember("key1", 1)

          expect([['a'], ['b'], ['c']].include?(random_elements)).to be true
        end
      end

      context 'when called with the optional number parameter of 2' do
        it 'is an array of two unique, random elements from the set' do
          random_elements = @client.srandmember("key1", 2)

          expect(random_elements.count).to eq(2)
          expect(random_elements.uniq.count).to eq(2)
          random_elements.all? do |element|
            expect(['a', 'b', 'c'].include?(element)).to be true
          end
        end
      end

      context 'when called with an optional parameter of -100' do
        it 'is an array of 100 random elements from the set, some of which are repeated' do
          random_elements = @client.srandmember("key1", -100)

          expect(random_elements.count).to eq(100)
          expect(random_elements.uniq.count).to be <= 3
          random_elements.all? do |element|
            expect(['a', 'b', 'c'].include?(element)).to be true
          end
        end
      end

      context 'when called with an optional parameter of 100' do
        it 'is an array of all of the elements from the set, none of which are repeated' do
          random_elements = @client.srandmember("key1", 100)

          expect(random_elements.count).to eq(3)
          expect(random_elements.uniq.count).to eq(3)
          expect(random_elements).to match_array(['a', 'b', 'c'])
        end
      end
    end

    context 'with an empty set' do
      before { @client.del("key1") }

      it 'is nil without the extra parameter' do
        expect(@client.srandmember("key1")).to be_nil
      end

      it 'is an empty array with an extra parameter' do
        expect(@client.srandmember("key1", 1)).to eq([])
      end
    end

    describe "#sscan" do
      it 'with no arguments and few items, returns all items' do
        @client.sadd('set', ['name', 'Jack', 'age', '33'])
        result = @client.sscan('set', 0)

        expect(result[0]).to eq('0')
        expect(result[1]).to eq(['name', 'Jack', 'age', '33'])
      end

      it 'with a count should return that number of members or more' do
        @client.sadd('set', ['a', '1', 'b', '2', 'c', '3', 'd', '4', 'e', '5', 'f', '6', 'g', '7'])
        result = @client.sscan('set', 0, count: 3)
        expect(result[0]).to eq('3')
        expect(result[1]).to eq([ 'a', '1', 'b'])
      end

      it 'returns items starting at the provided cursor' do
        @client.sadd('set', ['a', '1', 'b', '2', 'c', '3', 'd', '4', 'e', '5', 'f', '6', 'g', '7'])
        result = @client.sscan('set', 2, count: 3)
        expect(result[0]).to eq('5')
        expect(result[1]).to eq(['b', '2', 'c'])
      end

      it 'with match, returns items matching the given pattern' do
        @client.sadd('set', ['aa', '1', 'b', '2', 'cc', '3', 'd', '4', 'ee', '5', 'f', '6', 'gg', '7'])
        result = @client.sscan('set', 2, count: 7, match: '??')
        expect(result[0]).to eq('9')
        expect(result[1]).to eq(['cc','ee'])
      end

      it 'returns an empty result if the key is not found' do
        result = @client.sscan('set', 0)

        expect(result[0]).to eq('0')
        expect(result[1]).to eq([])
      end
    end
  end
end


text:
<?php

namespace Admin\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Admin\Form\FormBase;
use Admin\Form\FormProveedorCuenta;
use Application\Model\Entity\ProveedorCuenta;
use Application\Model\Clases\FuncionesBase;
use Zend\Session\Container;

class ProveedorCuentaController extends AbstractActionController {

    private $ProveedorCuenta;
    private $form;
    private $user_session;

    public function __construct() {
        $this->user_session = new Container('user');
    }

    public function indexAction() {
        $this->validarSession();
        // se asigna el layout admin
        $this->layout('layout/admin');
        // se obtiene el adapter
        $this->dbAdapter = $this->getServiceLocator()->get('Zend\Db\Adapter');
        // Parametro pasado por get, con el cual se sabe si se seleccionó objeto para modificar
        $id = $this->params()->fromQuery('id', null);

        $this->ProveedorCuenta = new ProveedorCuenta($this->dbAdapter);
        $this->form = new FormProveedorCuenta($this->getServiceLocator(), $this->getRequest()->getBaseUrl());
        /*         * *********************************************************************************** */
        // Se agregan el boton de buscar  proveedor oficina al formualrio saldo inventario
        /*         * *********************************************************************************** */
        $formBase = new FormBase($this->getServiceLocator(), $this->getRequest()->getBaseUrl());
        $this->form->add($formBase->get("btnBuscarProveedorOficina"));
        /*         * *********************************************************************************** */
        $this->configurarBotonesFormulario(false);
        // Si se ha enviado parámetros por post, se evalua si se va a modificar o a guardar
        if (count($this->request->getPost()) > 0) {
            try {
                $datos = $this->request->getPost();
                // Si se envia el id de la proveedorcuenta se modifica este.
                if ($datos["idProveedorCuenta"] != null) {
                    $returnCrud = $this->consultarMessage("errorUpdate");
                    if ($this->ProveedorCuenta->modificarProveedorCuenta($datos['idProveedorCuenta'], $datos['idProveedorOficina'], $datos['numeroCuentaBancaria'], $datos['idTipoCuenta'], $datos['idViaPago']))
                        $returnCrud = $this->consultarMessage("okUpdate");
                }
                else {
                    $returnCrud = $this->consultarMessage("errorSave");
                    // se guarda la nueva proveedorcuenta
                    if ($this->ProveedorCuenta->guardarProveedorCuenta($datos['idProveedorOficina'], $datos['numeroCuentaBancaria'], $datos['idTipoCuenta'], $datos['idViaPago']))
                        $returnCrud = $this->consultarMessage("okSave");
                }
            } catch (\Exception $e) {
                $returnCrud = $this->consultarMessage($e->getMessage(), true);
            }
            return new ViewModel(array('form' => $this->form, 'msg' => $returnCrud, 'registros' => $this->ProveedorCuenta->consultarTodoProveedorCuenta()));
        }
        // si existe el parametro $id  se consulta la proveedorcuenta y se carga el formulario.
        else if (isset($id)) {
            $this->ProveedorCuenta->consultarProveedorCuentaPorIdProveedorCuenta($this->params()->fromQuery('id'));
            $this->form->get("idProveedorCuenta")->setValue($this->ProveedorCuenta->getIdProveedorCuenta());
            $this->form->get("idProveedorOficina")->setValue($this->ProveedorCuenta->getIdProveedorOficina());
            $this->form->get("numeroCuentaBancaria")->setValue($this->ProveedorCuenta->getNumeroCuentaBancaria());
            $this->form->get("idTipoCuenta")->setValue($this->ProveedorCuenta->getIdTipoCuenta());
            $this->form->get("idViaPago")->setValue($this->ProveedorCuenta->getIdViaPago());
            $this->configurarBotonesFormulario(true);
        }
        return new ViewModel(array('form' => $this->form, 'registros' => $this->ProveedorCuenta->consultarTodoProveedorCuenta()));
    }

    public function eliminarAction() {
        //$this->validarSession();
        $this->dbAdapter = $this->getServiceLocator()->get('Zend\Db\Adapter');
        $this->ProveedorCuenta = new ProveedorCuenta($this->dbAdapter);
        $id = $this->params()->fromQuery('id', null);
        if ($id != null) {
            $this->ProveedorCuenta->eliminarProveedorCuenta($id);
            return $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/admin/proveedorcuenta');
        }
    }

    private function consultarMessage($nameMensaje, $propio = false) {

        return FuncionesBase::consultarMessage($this->getServiceLocator()->get('Config'), $nameMensaje, $propio);
    }

    private function configurarBotonesFormulario($modificarBool) {

        FuncionesBase::configurarBotonesFormulario($this->form, $modificarBool);
    }

    private function validarSession() {
        $dif = date("H:i:s", strtotime("00:00:00") + strtotime(date('H:i:s')) - strtotime($this->user_session->timeLastActivity));
        $dif = explode(':', $dif)[0] * 3600 + explode(':', $dif)[1] * 60 + explode(':', $dif)[2];
        // Si el no existe la variable de sesión o  tiempo de inactividad sobrepasa al parametrizado  se cierra la sesión
        if (!$this->user_session->offsetExists('idUsuario') ||
                $dif > $this->user_session->getManager()->getConfig()->getRememberMeSeconds()) {
            $manager = $this->user_session->getManager();
            $manager->getStorage()->clear(); //delete all session values unless it is immutable
            unset($_SESSION['user']);
            return $this->redirect()->toRoute("login_admin");
        }
        $this->user_session->timeLastActivity = date('H:i:s');
    }

}


text:
import { LobbyLogonErrorData } from "./LobbyLogonErrorData";

import { AbstractData } from "../../core/data/AbstractData";

export class SrvLogonErrorData extends AbstractData {
	public errorVO:LobbyLogonErrorData;

	constructor(parent?:AbstractData) {
		super(parent);
	}
}