text:
            Inspeccion
            <input id="inspeccion-plantines" name="inspeccion-plantines" type="text" class="special number"style="width: 65px" maxlength="10"/>

            Tipo de inspeccion
            <input id="tipo-plantines" name="tipo-plantines" type="text" class="special number"style="width: 130px"  maxlength="10"/>

            Observacion
            <textarea id="observacion-plantines" name="observacion-plantines" style="width: 228px; height: 89px;"></textarea>

    <input name="plantines" type="hidden"/>
    <input id="insp" name="insp" type="hidden" value="1"/>
    <input id="mdl" name="mdl" type="hidden" value="certificacion"/>
    <input id="opt" name="opt" type="hidden" value="guardar"/>
    <input id="pag" name="pag" type="hidden" value="inspeccion-plantines"/>

    <button id="enviar-inspeccion-plantines" class="btn btn-success" type="button">

        Registrar
    </button>


text:
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RedditSharp.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace RedditSharp.Things
{
    /// <summary>
    /// A comment.
    /// </summary>
    public class Comment : VotableThing
    {
        private const string CommentUrl = "/api/comment";
        private const string EditUserTextUrl = "/api/editusertext";
        private const string SetAsReadUrl = "/api/read_message";
        private const string SetAsUnReadUrl = "/api/unread_message";

        /// <inheritdoc />
        public Comment(IWebAgent agent, JToken json, Thing sender) : base(agent, json) {
            var data = json["data"];
            Parent = sender;

            // Handle Reddit's API being horrible
            if (data["context"] != null)
            {
                var context = data["context"].Value<string>();
                LinkId = context.Split('/')[4];
            }
            ParseComments(json, sender);
        }

        /// <inheritdoc />
        internal override JToken GetJsonData(JToken json) => json["data"];

        /// <summary>
        /// Prefix for fullname. Includes trailing underscore
        /// </summary>
        public static string KindPrefix { get { return "t1_"; } }

        /// <summary>
        /// Fill the object with comments.
        /// </summary>
        /// <param name="things"></param>
        /// <returns></returns>
        public Comment PopulateComments(IEnumerator<Thing> things)
        {
            Thing first = things.Current;
            Dictionary<string, Tuple<Comment, List<Comment>>> comments = new Dictionary<string, Tuple<Comment, List<Comment>>>
            {
                [this.FullName] = Tuple.Create<Comment, List<Comment>>(this, new List<Comment>())
            };
            while (things.MoveNext() && (first is Comment || first is More))
            {
                first = things.Current;
                if (first is Comment comment)
                {
                    comments[comment.FullName] = Tuple.Create<Comment, List<Comment>>(comment, new List<Comment>());
                    if (comments.ContainsKey(comment.ParentId))
                    {
                        comments[comment.ParentId].Item2.Add(comment);
                    }
                    else if (comment.ParentId == this.ParentId)
                    {
                        //only want sub comments.
                        break;
                    }
                }
                else if (first is More more)
                {
                    if (comments.ContainsKey(more.ParentId))
                    {
                        comments[more.ParentId].Item1.More = more;
                    }
                    else if (more.ParentId == this.ParentId)
                    {
                        // This is more for parent.
                        // Need to process the comments dictionary.
                        break;
                    }
                }
                //things.MoveNext();

            }

            foreach (KeyValuePair<string, Tuple<Comment, List<Comment>>> kvp in comments)
            {
                kvp.Value.Item1.Comments = kvp.Value.Item2.ToArray();
            }

            return this;
        }

        private void ParseComments(JToken data, Thing sender)
        {
            // Parse sub comments
            var replies = data["data"]["replies"];
            var subComments = new List<Comment>();
            if (replies != null && replies.Count() > 0)
            {
                foreach (var comment in replies["data"]["children"])
                    subComments.Add(new Comment(WebAgent, comment, sender));
            }
            Comments = subComments.ToArray();
        }

        /// <summary>
        /// Comment body markdown.
        /// </summary>
        [JsonProperty("body")]
        public string Body { get; private set; }

        /// <summary>
        /// Comment body html.
        /// </summary>
        [JsonProperty("body_html")]
        public string BodyHtml { get; private set; }

        /// <summary>
        /// Id of the parent <see cref="VotableThing"/>.
        /// </summary>
        [JsonProperty("parent_id")]
        public string ParentId { get; private set; }

        /// <summary>
        /// Parent subreddit name.
        /// </summary>
        [JsonProperty("subreddit")]
        public string Subreddit { get; private set; }

        /// <summary>
        /// Link id.
        /// </summary>
        [JsonProperty("link_id")]
        public string LinkId { get; private set; }

        /// <summary>
        /// Parent link title.
        /// </summary>
        [JsonProperty("link_title")]
        public string LinkTitle { get; private set; }

        /// <summary>
        /// True if this is a new item in the indbox.
        /// </summary>
        [JsonProperty("new")]
        public bool Unread { get; private set; }

        /// <summary>
        /// True if the comment is marked as spam.
        /// </summary>
        [JsonProperty("spam")]
        public bool? IsSpam { get; private set; }

        /// <summary>
        /// More comments.
        /// </summary>
        [JsonIgnore]
        public More More { get; private set; }

        /// <summary>
        /// Replies to this comment.
        /// </summary>
        [JsonIgnore]
        public IList<Comment> Comments { get; private set; }

        /// <summary>
        /// Parent <see cref="VotableThing"/>
        /// </summary>
        [JsonIgnore]
        public Thing Parent { get; internal set; }

        /// <summary>
        /// True if comment author is submitter of parent post.
        /// </summary>
        [JsonProperty("is_submitter")]
        public bool IsSubmitter { get; private set; }

        /// <summary>
        /// Subreddit display name.
        /// </summary>
        [JsonProperty("subreddit")]
        public string SubredditName { get; private set; }

        /// <inheritdoc/>
        public override string Shortlink => Permalink.ToString();

        /// <summary>
        /// Reply to this comment.
        /// </summary>
        /// <param name="message">markdown text of the reply.</param>
        /// <returns></returns>
        public async Task<Comment> ReplyAsync(string message)
        {
            // TODO actual error handling. This just hides the error and returns null
            //try
            //{
            var json = await WebAgent.Post(CommentUrl, new
            {
                text = message,
                thing_id = FullName,
                api_type = "json"
                //r = Subreddit
            }).ConfigureAwait(false);
            if (json["errors"].Any())
            {
                if (json["errors"][0].Any(x => x.ToString() == "RATELIMIT" || x.ToString() == "ratelimit"))
                {
                    var timeToReset = TimeSpan.FromMinutes(Convert.ToDouble(Regex.Match(json["errors"][0].ElementAt(1).ToString(), @"\d+").Value));
                    throw new RateLimitException(timeToReset);
                }
                else
                {
                    throw new Exception(json["errors"][0][0].ToString());
                }
            }
            return new Comment(WebAgent, json["data"]["things"][0], this);
            //}
            //catch (HttpRequestException ex)
            //{
            //    var error = new StreamReader(ex..GetResponseStream()).ReadToEnd();
            //    return null;
            //}
        }

        /// <summary>
        /// Replaces the text in this comment with the input text.
        /// </summary>
        /// <param name="newText">The text to replace the comment's contents</param>
        public async Task EditTextAsync(string newText)
        {
            var json = await WebAgent.Post(EditUserTextUrl, new
            {
                api_type = "json",
                text = newText,
                thing_id = FullName
            }).ConfigureAwait(false);
            if (!json["errors"].Any())
                Body = newText;
            else
                throw new Exception($"Errors editing text {json["errors"][0][0].ToString()}");
        }

        /// <inheritdoc />
        protected override async Task<JToken> SimpleActionAsync(string endpoint)
        {
            return await WebAgent.Post(endpoint, new
            {
                id = FullName
            }).ConfigureAwait(false);
        }

        /// <summary>
        /// Mark this comment as read.
        /// </summary>
        public async Task SetAsReadAsync()
        {
            await SetReadStatusAsync(SetAsReadUrl);
        }

        /// <summary>
        /// Mark this comment as unread.
        /// </summary>
        public async Task SetAsUnReadAsync()
        {
            await SetReadStatusAsync(SetAsUnReadUrl);
        }

        private async Task SetReadStatusAsync(string statusUrl)
        {
            await WebAgent.Post(statusUrl, new
            {
                id = FullName,
                api_type = "json"
            }).ConfigureAwait(false);
        }

        #region Static Methods
        /// <summary>
        /// Post a reply to a specific comment
        /// </summary>
        /// <param name="webAgent"></param>
        /// <param name="commentFullName">e.g. "t1_12345"</param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static async Task Reply(IWebAgent webAgent, string commentFullName, string message) {
            // TODO actual error handling. This just hides the error and returns null
            //try
            //{
            var json = await webAgent.Post(CommentUrl, new {
                text = message,
                thing_id = commentFullName,
                api_type = "json"
                //r = Subreddit
            }).ConfigureAwait(false);
            if (json["json"]["ratelimit"] != null) {
                throw new RateLimitException(TimeSpan.FromSeconds(json["json"]["ratelimit"].ValueOrDefault<double>()));
            }

            //}
            //catch (HttpRequestException ex)
            //{
            //    var error = new StreamReader(ex..GetResponseStream()).ReadToEnd();
            //    return null;
            //}
        }
        #endregion

    }
}

redpajama_set_name: RedPajamaGithub


text:
module ActiveRecord
  class TableMetadata # :nodoc:
    delegate :foreign_type, :foreign_key, :join_primary_key, :join_foreign_key, to: :association, prefix: true

    def initialize(klass, arel_table, association = nil, types = klass)
      @klass = klass
      @types = types
      @arel_table = arel_table
      @association = association
    end

    def resolve_column_aliases(hash)
      new_hash = hash.dup
      hash.each_key do |key|
        if key.is_a?(Symbol) && new_key = klass.attribute_aliases[key.to_s]
          new_hash[new_key] = new_hash.delete(key)
        end
      end
      new_hash
    end

    def arel_attribute(column_name)
      if klass
        klass.arel_attribute(column_name, arel_table)
      else
        arel_table[column_name]
      end
    end

    def type(column_name)
      types.type_for_attribute(column_name)
    end

    def has_column?(column_name)
      klass && klass.columns_hash.key?(column_name.to_s)
    end

    def associated_with?(association_name)
      klass && klass._reflect_on_association(association_name)
    end

    def associated_table(table_name)
      association = klass._reflect_on_association(table_name) || klass._reflect_on_association(table_name.to_s.singularize)

      if !association && table_name == arel_table.name
        return self
      elsif association && !association.polymorphic?
        association_klass = association.klass
        arel_table = association_klass.arel_table.alias(table_name)
        TableMetadata.new(association_klass, arel_table, association)
      else
        type_caster = TypeCaster::Connection.new(klass, table_name)
        arel_table = Arel::Table.new(table_name, type_caster: type_caster)
        TableMetadata.new(nil, arel_table, association, type_caster)
      end
    end

    def polymorphic_association?
      association && association.polymorphic?
    end

    def aggregated_with?(aggregation_name)
      klass && reflect_on_aggregation(aggregation_name)
    end

    def reflect_on_aggregation(aggregation_name)
      klass.reflect_on_aggregation(aggregation_name)
    end

    private
      attr_reader :klass, :types, :arel_table, :association
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Peziza fracta Berk. & M.A. Curtis

### Remarks
null


text:
package qapi

import (
	"time"
)

// TODO - Populate this struct
type OrderLeg struct {
}

// Ref: http://www.questrade.com/api/documentSymation/rest-operations/account-calls/accounts-id-orders
type Order struct {
	// Internal order identifier.
	ID int `json:"id"`

	// Symbol that follows Questrade symbology (e.g., "TD.TO").
	Symbol string `json:"symbol"`

	// Internal symbol identifier.
	SymbolID int `json:"symbolId"`

	// Total quantity of the order.
	TotalQuantity int `json:"totalQuantity"`

	// Unfilled portion of the order quantity.
	OpenQuantity int `json:"openQuantity"`

	// Filled portion of the order quantity.
	FilledQuantity int `json:"filledQuantity"`

	// Unfilled portion of the order quantity after cancellation.
	CanceledQuantity int `json:"canceledQuantity"`

	// Client view of the order side (e.g., "Buy-To-Open").
	Side string `json:"side"`

	// Order price type (e.g., "Market").
	OrderType string `json:"orderType"`

	// Limit price.
	LimitPrice float32 `json:"limitPrice"`

	// Stop price.
	StopPrice float32 `json:"stopPrice"`

	// Specifies all-or-none special instruction.
	IsAllOrNone bool `json:"isAllOrNone"`

	// Specifies Anonymous special instruction.
	IsAnonymous bool `json:"isAnonymous"`

	// Specifies Iceberg special instruction.
	IcebergQuantity int `json:"icebergQuantity"`

	// Specifies Minimum special instruction.
	MinQuantity int `json:"minQuantity"`

	// Average price of all executions received for this order.
	AvgExecPrice float32 `json:"avgExecPrice"`

	// Price of the last execution received for the order in question.
	LastExecPrice float32 `json:"lastExecPrice"`

	// See enumerations for all allowed values
	Source string `json:"source"`

	// See Order Time In Force section for all allowed values.
	TimeInForce string `json:"timeInForce"`

	// Good-Till-Date marker and date parameter
	GtdDate *time.Time `json:"gtdDate",string`

	// See Order State section for all allowed values.
	State string `json:"state"`

	// Human readable order rejection reason message.
	ClientReasonStr string `json:"clientReasonStr"`

	// Internal identifier of a chain to which the order belongs.
	ChainID int `json:"chainId"`

	// Order creation time.
	CreationTime *time.Time `json:"creationTime",string`

	// Time of the last update.
	UpdateTime *time.Time `json:"updateTime",string`

	// Notes that may have been manually added by Questrade staff.
	Notes string `json:"notes"`

	// See enumerations for all allowed values
	PrimaryRoute string `json:"primaryRoute"`

	// See enumerations for all allowed values
	SecondaryRoute string `json:"secondaryRoute"`

	// Order route name.
	OrderRoute string `json:"orderRoute"`

	// Venue where non-marketable portion of the order was booked.
	VenueHoldingOrder string `json:"venueHoldingOrder"`

	// Total commission amount charged for this order.
	CommissionCharged float32 `json:"commissionCharged"`

	// Identifier assigned to this order by exchange where it was routed.
	ExchangeOrderID string `json:"exchangeOrderId"`

	// Whether user that placed the order is a significant shareholder.
	IsSignificantShareholder bool `json:"isSignificantShareholder"`

	// Whether user that placed the order is an insider.
	IsInsider bool `json:"isInsider"`

	// Whether limit offset is specified in dollars (vs. percent).
	IsLimitOffsetInDollar bool `json:"isLimitOffsetInDollar"`

	// Internal identifier of user that placed the order.
	UserID int `json:"userId"`

	// Commission for placing the order via the Trade Desk over the phone.
	PlacementCommission float32 `json:"placementCommission"`

	// List of OrderLeg elements.
	Legs []OrderLeg `json:"legs"`

	// Multi-leg strategy to which the order belongs.
	StrategyType string `json:"strategyType"`

	// Stop price at which order was triggered.
	TriggerStopPrice float32 `json:"triggerStopPrice"`

	// Internal identifier of the order group.
	OrderGroupID int `json:"orderGroupId"`

	// Bracket Order class. Primary, Profit or Loss.
	OrderClass string `json:"orderClass"`
}

// Ref: http://www.questrade.com/api/documentation/rest-operations/order-calls/accounts-id-orders
type OrderRequest struct {
	// Account number against which order is being submitted.
	AccountID string `json:"accountNumber"`

	// Optional – order id of the order to be replaced.
	OrderID int `json:"orderId,omitempty"`

	// Internal symbol identifier.
	SymbolID int `json:"symbolId"`

	// Order quantity.
	Quantity int `json:"quantity"`

	// Iceberg instruction quantity.
	IcebergQuantity int `json:"icebergQuantity,omitempty"`

	// Limit price.
	LimitPrice float32 `json:"limitPrice,omitempty"`

	// Stop price.
	StopPrice float32 `json:"stopPrice,omitempty"`

	TimeInForce string `json:"timeInForce"`

	// Identifies whether the all-or-none instruction is enabled.
	IsAllOrNone bool `json:"isAllOrNone"`

	// Identifies whether the anonymous instruction is enabled.
	IsAnonymous bool `json:"isAnonymous"`

	IsLimitOffsetInDollar bool `json:"isLimitOffsetInDollar"`

	// Order type (e.g., "Market").
	OrderType string `json:"orderType"`

	// Order side (e.g., "Buy").
	Action string `json:"action"`

	// Secondary order route (e.g., "NYSE").
	SecondaryRoute string `json:"secondaryRoute"`

	// Primary order route (e.g., "AUTO").
	PrimaryRoute string `json:"primaryRoute"`
}

// Ref: http://www.questrade.com/api/documentation/rest-operations/order-calls/accounts-id-orders-impact
type OrderImpact struct {
	// Estimate of commissions to be charged on the order.
	EstimatedCommissions float32 `json:"estimatedCommissions"`

	// Estimate of change in buying power from the order.
	BuyingPowerEffect float32 `json:"buyingPowerEffect"`

	// Estimate of buying power in which order will result.
	BuyingPowerResult float32 `json:"buyingPowerResult"`

	// Estimate of change in maintenance excess from the order.
	MaintExcessEffect float32 `json:"maintExcessEffect"`

	// Estimate of maintenance excess in which the order will result.
	MaintExcessResult float32 `json:"maintExcessResult"`

	// Client view of the order side (e.g., "Buy-To-Open").
	Side string `json:"side"`

	// Estimate of the order execution value.
	TradeValueCalculation string `json:"tradeValueCalculation"`

	// Estimated average fill price.
	Price float32 `json:"price"`
}


text: - [resources](https://sites.google.com/site/steviesclasses/home/game-maker-resources)


text:
import React, { Component } from 'react';
import propTypes from 'prop-types';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';

// Import Style
import styles from './PostCreateWidget.css';

export class PostCreateWidget extends Component {
  addPost = () => {
    const nameRef = this.refs.name;
    const titleRef = this.refs.title;
    const contentRef = this.refs.content;
    if (nameRef.value && titleRef.value && contentRef.value) {
      this.props.addPost(nameRef.value, titleRef.value, contentRef.value);
      nameRef.value = titleRef.value = contentRef.value = '';
    }
  };

  render() {
    const cls = `${styles.form} ${(this.props.showAddPost ? styles.appear : '')}`;
    return (

<FormattedMessage id="createNewPost" />

          <input placeholder={this.props.intl.messages.authorName} className={styles['form-field']} ref="name" />
          <input placeholder={this.props.intl.messages.postTitle} className={styles['form-field']} ref="title" />
          <textarea placeholder={this.props.intl.messages.postContent} className={styles['form-field']} ref="content" />
          <FormattedMessage id="submit" />

    );
  }
}

PostCreateWidget.propTypes = {
  addPost: propTypes.func.isRequired,
  showAddPost: propTypes.bool.isRequired,
  intl: intlShape.isRequired,
};

export default injectIntl(PostCreateWidget);


text:
<?php
/**
 * Created by PhpStorm.
 * User: jeff
 * Date: 4/21/17
 * Time: 11:36 PM
 */
$excludeConnection = false;
require_once 'C:/xampp/htdocs/apiLibLenovo/lib/Header.php';
$timestampFormat = "'%b %e, %Y %k:%i:%s'";

// check for mapped JSONs in the JSON_MAP table
    $mapQuery = "SELECT d.ID API_ID , d.NAME from API_DEFINITIONS d where d.active_flag = 1 and (select count(*) from API_JSON_MAP m where m.API_ID = d.ID AND m.TARGET_TABLE IS NOT NULL and m.TARGET_COLUMN IS NOT NULL) > 0";
    foreach(getGlobalConnection()->getConnection()->query($mapQuery)->fetchAll(PDO::FETCH_OBJ) as $r) {
    // if any json_maps exist pull all data out of the API_JSON_PERSIST table for that API
    $persistQuery = "SELECT * FROM API_JSON_PERSIST p WHERE p.API_ID = {$r->API_ID} ";
    // write all of those records over to the API_JSON_ARCHIVE and set the partition bit to 0 (ready)
        foreach(getGlobalConnection()->getConnection()->query($persistQuery)->fetchAll(PDO::FETCH_OBJ) as $j) {
            $p = new PersistInput('API_JSON_ARCHIVE'
                , [$j->API_ID,$j->JSON_OUTPUT,$j->TIMESTAMP,0,'now()']
                , ['API_ID', 'JSON_OUTPUT', 'TIMESTAMP', 'PARTITION_BIT', 'DATE']
                , getGlobalConnection());
            if($p->pushRecord()) {
    // clean up the old records in the api_json_persist table
    // TODO this could change to simply add a partition bit in the api_json_persist table and using that...
//                getGlobalConnection()->getConnection()->query("delete from API_JSON_PERSIST WHERE ID = {$j->ID}");
    // Map the json file using the defined jsonMap, if it is not mapped,
                $jsonMap = new JsonMap($j->API_ID);
                if($jsonMap->isMapped()) {
                    $jsonMap->setJson($j->JSON_OUTPUT);
                    // set the partition bit of the record in the API_JSON_ARCHIVE to 1 (complete) or 2 (failed)
                    $up = new PersistInput('API_JSON_ARCHIVE', [$jsonMap->pushRecordFromMap()], ['PARTITION_BIT'], getGlobalConnection());
                    $up->setUpdateMode(true, $p->getLastInsertRecord());
                    $up->pushRecord();
                }
            }
        }
    }


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.ctc.wstx.api (Woodstox 5.0.0 API)</title>
<meta name="date" content="2015-04-01">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package com.ctc.wstx.api

Package that contains subset of Woodstox classes that are considered to be
its public API (in addition to regular Stax 1.0 -- javax.xml.stream.* -- and
Stax2 -- org.codehaus.stax2.*).

See: Description

Interface Summary

Interface
Description

EmptyElementHandler

Optional handler used to determine if a specific empty element (by name) should
 be allowed to use the self-closing syntax instead of having a separate end tag.

InvalidCharHandler

Simple converter interface designed to be used with stream writer property
 WstxOutputProperties.P_OUTPUT_INVALID_CHAR_HANDLER.

Class Summary

Class
Description

EmptyElementHandler.HtmlEmptyElementHandler

HTML specific empty element handler.

EmptyElementHandler.SetEmptyElementHandler

Handler that uses a Set of Strings.

InvalidCharHandler.FailingHandler

This handler implementation just throws an exception for
 all invalid characters encountered.

InvalidCharHandler.ReplacingHandler

Alternative to the default handler, this handler converts all invalid
 characters to the specified output character.

ReaderConfig

Simple configuration container class; passed by reader factory to reader
 instance created.

ValidatorConfig

WriterConfig

Simple configuration container class; passed by writer factory to writer
 instance created.

WstxInputProperties

Class that contains constant for property names used to configure
 cursor and event readers produced by Wstx implementation of
 XMLInputFactory.

WstxInputProperties.ParsingMode

Inner class used for creating type-safe enumerations (prior to JDK 1.5).

WstxOutputProperties

Class that contains constant for property names used to configure
 cursor and event writers produced by Wstx implementation of
 XMLOutputFactory.

Package com.ctc.wstx.api Description

Package that contains subset of Woodstox classes that are considered to be
its public API (in addition to regular Stax 1.0 -- javax.xml.stream.* -- and
Stax2 -- org.codehaus.stax2.*). This means that application code can rely
on these classes, and effort is made to keep them backwards compatible
between releases.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2012–2015 FasterXML. All rights reserved.


text:
#pragma once

#include <folly/IPAddressV4.h>
#include <folly/IPAddressV6.h>
#include <folly/MacAddress.h>
#include "fboss/agent/types.h"
#include "fboss/agent/state/NodeBase.h"
#include "fboss/agent/state/ArpResponseTable.h"
#include "fboss/agent/state/ArpTable.h"
#include "fboss/agent/state/NdpResponseTable.h"
#include "fboss/agent/state/NdpTable.h"

#include <boost/container/flat_map.hpp>
#include <set>
#include <string>
#include <map>

namespace facebook { namespace fboss {

class SwitchState;

namespace cfg {
class Vlan;
}

typedef boost::container::flat_map<folly::MacAddress, folly::IPAddressV4>
    DhcpV4OverrideMap;
typedef boost::container::flat_map<folly::MacAddress, folly::IPAddressV6>
    DhcpV6OverrideMap;

struct VlanFields {
  struct PortInfo {
    explicit PortInfo(bool emitTags) : tagged(emitTags) {}
    bool operator==(const PortInfo& other) const {
      return tagged == other.tagged;
    }
    bool operator!=(const PortInfo& other) const {
      return !(*this == other);
    }
    folly::dynamic toFollyDynamic() const;
    static PortInfo fromFollyDynamic(const folly::dynamic& json);
    bool tagged;
  };
  typedef boost::container::flat_map<PortID, PortInfo> MemberPorts;

  VlanFields(VlanID id, std::string name);
  VlanFields(VlanID id,
             std::string name,
             folly::IPAddressV4 dhcpV4Relay,
             folly::IPAddressV6 dhcpV6Relay,
             MemberPorts&& ports);

  template<typename Fn>
  void forEachChild(Fn fn) {
    fn(arpTable.get());
    fn(arpResponseTable.get());
    fn(ndpTable.get());
    fn(ndpResponseTable.get());
  }

  folly::dynamic toFollyDynamic() const;
  static VlanFields fromFollyDynamic(const folly::dynamic& vlanJson);

  const VlanID id{0};
  std::string name;
  folly::IPAddressV4 dhcpV4Relay;
  folly::IPAddressV6 dhcpV6Relay;
  DhcpV4OverrideMap dhcpRelayOverridesV4;
  DhcpV6OverrideMap dhcpRelayOverridesV6;
  // The list of ports in the VLAN.
  // We only store PortIDs, and not pointers to the actual Port objects.
  // This way VLAN objects don't need to change when a Port object is modified.
  //
  // (Port state is copy-on-write, so when it changes a new copy of the Port
  // object is created.  If we pointed at the Port object here we would also
  // have to modify the Vlan object.  By storing only the PortID the Vlan does
  // not need to be modified.)
  MemberPorts ports;
  std::shared_ptr<ArpTable> arpTable;
  std::shared_ptr<ArpResponseTable> arpResponseTable;
  std::shared_ptr<NdpTable> ndpTable;
  std::shared_ptr<NdpResponseTable> ndpResponseTable;
};

class Vlan : public NodeBaseT<Vlan, VlanFields> {
 public:
  typedef VlanFields::PortInfo PortInfo;
  typedef VlanFields::MemberPorts MemberPorts;

  Vlan(VlanID id, std::string name);
  Vlan(const cfg::Vlan* config, MemberPorts ports);

  static std::shared_ptr<Vlan>
  fromFollyDynamic(const folly::dynamic& json) {
    const auto& fields = VlanFields::fromFollyDynamic(json);
    return std::make_shared<Vlan>(fields);
  }

  static std::shared_ptr<Vlan>
  fromJson(const folly::fbstring& jsonStr) {
    return fromFollyDynamic(folly::parseJson(jsonStr));
  }

  folly::dynamic toFollyDynamic() const override {
    return getFields()->toFollyDynamic();
  }

  VlanID getID() const {
    return getFields()->id;
  }

  const std::string& getName() const {
    return getFields()->name;
  }

  void setName(std::string name) {
    writableFields()->name = name;
  }

  const MemberPorts& getPorts() const {
    return getFields()->ports;
  }
  void setPorts(MemberPorts ports) {
    writableFields()->ports.swap(ports);
  }

  Vlan* modify(std::shared_ptr<SwitchState>* state);

  void addPort(PortID id, bool tagged);

  const std::shared_ptr<ArpTable> getArpTable() const {
    return getFields()->arpTable;
  }
  void setArpTable(std::shared_ptr<ArpTable> table) {
    return writableFields()->arpTable.swap(table);
  }
  void setNeighborTable(std::shared_ptr<ArpTable> table) {
    return writableFields()->arpTable.swap(table);
  }

  const std::shared_ptr<ArpResponseTable> getArpResponseTable() const {
    return getFields()->arpResponseTable;
  }
  void setArpResponseTable(std::shared_ptr<ArpResponseTable> table) {
    writableFields()->arpResponseTable.swap(table);
  }

  const std::shared_ptr<NdpTable> getNdpTable() const {
    return getFields()->ndpTable;
  }
  void setNdpTable(std::shared_ptr<NdpTable> table) {
    return writableFields()->ndpTable.swap(table);
  }
  void setNeighborTable(std::shared_ptr<NdpTable> table) {
    return writableFields()->ndpTable.swap(table);
  }

  const std::shared_ptr<NdpResponseTable> getNdpResponseTable() const {
    return getFields()->ndpResponseTable;
  }
  void setNdpResponseTable(std::shared_ptr<NdpResponseTable> table) {
    writableFields()->ndpResponseTable.swap(table);
  }

  // dhcp relay

  folly::IPAddressV4 getDhcpV4Relay() const {
    return getFields()->dhcpV4Relay;
  }
  void setDhcpV4Relay(folly::IPAddressV4 v4Relay) {
     writableFields()->dhcpV4Relay = v4Relay;
  }

  folly::IPAddressV6 getDhcpV6Relay() const {
    return getFields()->dhcpV6Relay;
  }
  void setDhcpV6Relay(folly::IPAddressV6 v6Relay) {
     writableFields()->dhcpV6Relay = v6Relay;
  }

  // dhcp overrides

  DhcpV4OverrideMap getDhcpV4RelayOverrides() const {
    return getFields()->dhcpRelayOverridesV4;
  }
  void setDhcpV4RelayOverrides(DhcpV4OverrideMap map) {
    writableFields()->dhcpRelayOverridesV4 = map;
  }

  DhcpV6OverrideMap getDhcpV6RelayOverrides() const {
    return getFields()->dhcpRelayOverridesV6;
  }
  void setDhcpV6RelayOverrides(DhcpV6OverrideMap map) {
    writableFields()->dhcpRelayOverridesV6 = map;
  }

 private:
  // Inherit the constructors required for clone()
  using NodeBaseT::NodeBaseT;
  friend class CloneAllocator;
};

}} // facebook::fboss


text:
package com.github.ljtfreitas.restify.http.netflix.client.request.ribbon;

import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.stream.Collectors;

import com.github.ljtfreitas.restify.http.client.message.Header;
import com.github.ljtfreitas.restify.http.client.response.HttpClientResponse;
import com.netflix.client.ClientException;
import com.netflix.client.IResponse;

public class RibbonResponse implements IResponse {

	private final HttpClientResponse response;

	public RibbonResponse(HttpClientResponse response) {
		this.response = response;
	}

	@Override
	public void close() throws IOException {
		response.close();
	}

	@Override
	public Object getPayload() throws ClientException {
		return null;
	}

	@Override
	public boolean hasPayload() {
		return response.available();
	}

	@Override
	public boolean isSuccess() {
		return response.status().isSucessful();
	}

	@Override
	public URI getRequestedURI() {
		return response.request().uri();
	}

	@Override
	public Map<String, ?> getHeaders() {
		return response.headers().all().stream()
				.collect(Collectors.groupingBy(Header::name));
	}

	public HttpClientResponse unwrap() {
		return response;
	}
}


text:
class BreakoutTipsController < ApplicationController
end


text:
using System.Text;
using System.Runtime;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Diagnostics;
using Internal.Reflection.Augments;
using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;

namespace System
{
    // WARNING: Bartok hard-codes offsets to the delegate fields, so it's notion of where fields are may
    // differ from the runtime's notion.  Bartok honors sequential and explicit layout directives, so I've
    // ordered the fields in such a way as to match the runtime's layout and then just tacked on this
    // sequential layout directive so that Bartok matches it.
    [StructLayout(LayoutKind.Sequential)]
    [DebuggerDisplay("Target method(s) = {GetTargetMethodsDescriptionForDebugger()}")]
    public abstract partial class Delegate : ICloneable, ISerializable
    {
        // This ctor exists solely to prevent C# from generating a protected .ctor that violates the surface area. I really want this to be a
        // "protected-and-internal" rather than "internal" but C# has no keyword for the former.
        internal Delegate()
        {
            // ! Do NOT put any code here. Delegate constructers are not guaranteed to be executed.
        }

        // V1 API: Create closed instance delegates. Method name matching is case sensitive.
        protected Delegate(Object target, String method)
        {
            // This constructor cannot be used by application code. To create a delegate by specifying the name of a method, an
            // overload of the public static CreateDelegate method is used. This will eventually end up calling into the internal
            // implementation of CreateDelegate below, and does not invoke this constructor.
            // The constructor is just for API compatibility with the public contract of the Delegate class.
            throw new PlatformNotSupportedException();
        }

        // V1 API: Create open static delegates. Method name matching is case insensitive.
        protected Delegate(Type target, String method)
        {
            // This constructor cannot be used by application code. To create a delegate by specifying the name of a method, an
            // overload of the public static CreateDelegate method is used. This will eventually end up calling into the internal
            // implementation of CreateDelegate below, and does not invoke this constructor.
            // The constructor is just for API compatibility with the public contract of the Delegate class.
            throw new PlatformNotSupportedException();
        }

        // New Delegate Implementation

        protected internal object m_firstParameter;
        protected internal object m_helperObject;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
        protected internal IntPtr m_extraFunctionPointerOrData;
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
        protected internal IntPtr m_functionPointer;

        [ThreadStatic]
        protected static string s_DefaultValueString;

        // WARNING: These constants are also declared in System.Private.TypeLoader\Internal\Runtime\TypeLoader\CallConverterThunk.cs
        // Do not change their values without updating the values in the calling convention converter component
        protected const int MulticastThunk = 0;
        protected const int ClosedStaticThunk = 1;
        protected const int OpenStaticThunk = 2;
        protected const int ClosedInstanceThunkOverGenericMethod = 3; // This may not exist
        protected const int DelegateInvokeThunk = 4;
        protected const int OpenInstanceThunk = 5;        // This may not exist
        protected const int ReversePinvokeThunk = 6;       // This may not exist
        protected const int ObjectArrayThunk = 7;         // This may not exist

        //
        // If the thunk does not exist, the function will return IntPtr.Zero.
        protected virtual IntPtr GetThunk(int whichThunk)
        {
#if DEBUG
            // The GetThunk function should be overriden on all delegate types, except for universal
            // canonical delegates which use calling convention converter thunks to marshal arguments
            // for the delegate call. If we execute this version of GetThunk, we can at least assert
            // that the current delegate type is a generic type.
            Debug.Assert(this.EETypePtr.IsGeneric);
#endif
            return TypeLoaderExports.GetDelegateThunk(this, whichThunk);
        }

        //
        // If there is a default value string, the overridden function should set the
        // s_DefaultValueString field and return true.
        protected virtual bool LoadDefaultValueString() { return false; }

        /// <summary>
        /// Used by various parts of the runtime as a replacement for Delegate.Method
        ///
        /// The Interop layer uses this to distinguish between different methods on a
        /// single type, and to get the function pointer for delegates to static functions
        ///
        /// The reflection apis use this api to figure out what MethodInfo is related
        /// to a delegate.
        ///
        /// </summary>
        /// <param name="typeOfFirstParameterIfInstanceDelegate">
        ///   This value indicates which type an delegate's function pointer is associated with
        ///   This value is ONLY set for delegates where the function pointer points at an instance method
        /// </param>
        /// <param name="isOpenResolver">
        ///   This value indicates if the returned pointer is an open resolver structure.
        /// </param>
        /// <returns></returns>
        unsafe internal IntPtr GetFunctionPointer(out RuntimeTypeHandle typeOfFirstParameterIfInstanceDelegate, out bool isOpenResolver)
        {
            typeOfFirstParameterIfInstanceDelegate = default(RuntimeTypeHandle);
            isOpenResolver = false;

            if (GetThunk(MulticastThunk) == m_functionPointer)
            {
                return IntPtr.Zero;
            }
            else if (m_extraFunctionPointerOrData != IntPtr.Zero)
            {
                if (GetThunk(OpenInstanceThunk) == m_functionPointer)
                {
                    typeOfFirstParameterIfInstanceDelegate = ((OpenMethodResolver*)m_extraFunctionPointerOrData)->DeclaringType;
                    isOpenResolver = true;
                }
                return m_extraFunctionPointerOrData;
            }
            else
            {
                if (m_firstParameter != null)
                    typeOfFirstParameterIfInstanceDelegate = new RuntimeTypeHandle(m_firstParameter.EETypePtr);

                // TODO! Implementation issue for generic invokes here ... we need another IntPtr for uniqueness.

                return m_functionPointer;
            }
        }

        // @todo: Not an api but some NativeThreadPool code still depends on it.
        internal IntPtr GetNativeFunctionPointer()
        {
            if (GetThunk(ReversePinvokeThunk) != m_functionPointer)
            {
                throw new InvalidOperationException("GetNativeFunctionPointer may only be used on a reverse pinvoke delegate");
            }

            return m_extraFunctionPointerOrData;
        }

        // This function is known to the IL Transformer.
        protected void InitializeClosedInstance(object firstParameter, IntPtr functionPointer)
        {
            if (firstParameter == null)
                throw new ArgumentException(SR.Arg_DlgtNullInst);

            m_functionPointer = functionPointer;
            m_firstParameter = firstParameter;
        }

        // This function is known to the IL Transformer.
        protected void InitializeClosedInstanceSlow(object firstParameter, IntPtr functionPointer)
        {
            // This method is like InitializeClosedInstance, but it handles ALL cases. In particular, it handles generic method with fun function pointers.

            if (firstParameter == null)
                throw new ArgumentException(SR.Arg_DlgtNullInst);

            if (!FunctionPointerOps.IsGenericMethodPointer(functionPointer))
            {
                m_functionPointer = functionPointer;
                m_firstParameter = firstParameter;
            }
            else
            {
                m_firstParameter = this;
                m_functionPointer = GetThunk(ClosedInstanceThunkOverGenericMethod);
                m_extraFunctionPointerOrData = functionPointer;
                m_helperObject = firstParameter;
            }
        }

        // This function is known to the compiler.
        protected void InitializeClosedInstanceWithGVMResolution(object firstParameter, RuntimeMethodHandle tokenOfGenericVirtualMethod)
        {
            if (firstParameter == null)
                throw new ArgumentException(SR.Arg_DlgtNullInst);

            IntPtr functionResolution = TypeLoaderExports.GVMLookupForSlot(firstParameter, tokenOfGenericVirtualMethod);

            if (functionResolution == IntPtr.Zero)
            {
                // TODO! What to do when GVM resolution fails. Should never happen
                throw new InvalidOperationException();
            }
            if (!FunctionPointerOps.IsGenericMethodPointer(functionResolution))
            {
                m_functionPointer = functionResolution;
                m_firstParameter = firstParameter;
            }
            else
            {
                m_firstParameter = this;
                m_functionPointer = GetThunk(ClosedInstanceThunkOverGenericMethod);
                m_extraFunctionPointerOrData = functionResolution;
                m_helperObject = firstParameter;
            }

            return;
        }

        private void InitializeClosedInstanceToInterface(object firstParameter, IntPtr dispatchCell)
        {
            if (firstParameter == null)
                throw new ArgumentException(SR.Arg_DlgtNullInst);

            m_functionPointer = RuntimeImports.RhpResolveInterfaceMethod(firstParameter, dispatchCell);
            m_firstParameter = firstParameter;
        }

        // This is used to implement MethodInfo.CreateDelegate() in a desktop-compatible way. Yes, the desktop really
        // let you use that api to invoke an instance method with a null 'this'.
        private void InitializeClosedInstanceWithoutNullCheck(object firstParameter, IntPtr functionPointer)
        {
            if (!FunctionPointerOps.IsGenericMethodPointer(functionPointer))
            {
                m_functionPointer = functionPointer;
                m_firstParameter = firstParameter;
            }
            else
            {
                m_firstParameter = this;
                m_functionPointer = GetThunk(ClosedInstanceThunkOverGenericMethod);
                m_extraFunctionPointerOrData = functionPointer;
                m_helperObject = firstParameter;
            }
        }

        // This function is known to the compiler backend.
        protected void InitializeClosedStaticThunk(object firstParameter, IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            m_extraFunctionPointerOrData = functionPointer;
            m_helperObject = firstParameter;
            m_functionPointer = functionPointerThunk;
            m_firstParameter = this;
        }

        // This function is known to the compiler backend.
        protected void InitializeClosedStaticWithoutThunk(object firstParameter, IntPtr functionPointer)
        {
            m_extraFunctionPointerOrData = functionPointer;
            m_helperObject = firstParameter;
            m_functionPointer = GetThunk(ClosedStaticThunk);
            m_firstParameter = this;
        }

        // This function is known to the compiler backend.
        protected void InitializeOpenStaticThunk(object firstParameter, IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = functionPointerThunk;
            m_extraFunctionPointerOrData = functionPointer;
        }

        // This function is known to the compiler backend.
        protected void InitializeOpenStaticWithoutThunk(object firstParameter, IntPtr functionPointer)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = GetThunk(OpenStaticThunk);
            m_extraFunctionPointerOrData = functionPointer;
        }

        // This function is known to the compiler backend.
        protected void InitializeReversePInvokeThunk(object firstParameter, IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = functionPointerThunk;
            m_extraFunctionPointerOrData = functionPointer;
        }

        // This function is known to the compiler backend.
        protected void InitializeReversePInvokeWithoutThunk(object firstParameter, IntPtr functionPointer)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = GetThunk(ReversePinvokeThunk);
            m_extraFunctionPointerOrData = functionPointer;
        }

        // This function is known to the compiler backend.
        protected void InitializeOpenInstanceThunk(object firstParameter, IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = functionPointerThunk;
            OpenMethodResolver instanceMethodResolver = new OpenMethodResolver(default(RuntimeTypeHandle), functionPointer, default(GCHandle), 0);
            m_extraFunctionPointerOrData = instanceMethodResolver.ToIntPtr();
        }

        // This function is known to the compiler backend.
        protected void InitializeOpenInstanceWithoutThunk(object firstParameter, IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = GetThunk(OpenInstanceThunk);
            OpenMethodResolver instanceMethodResolver = new OpenMethodResolver(default(RuntimeTypeHandle), functionPointer, default(GCHandle), 0);
            m_extraFunctionPointerOrData = instanceMethodResolver.ToIntPtr();
        }

        protected void InitializeOpenInstanceThunkDynamic(IntPtr functionPointer, IntPtr functionPointerThunk)
        {
            // This sort of delegate is invoked by calling the thunk function pointer with the arguments to the delegate + a reference to the delegate object itself.
            m_firstParameter = this;
            m_functionPointer = functionPointerThunk;
            m_extraFunctionPointerOrData = functionPointer;
        }

        internal void SetClosedStaticFirstParameter(object firstParameter)
        {
            // Closed static delegates place a value in m_helperObject that they pass to the target method.
            Debug.Assert(m_functionPointer == GetThunk(ClosedStaticThunk));
            m_helperObject = firstParameter;
        }

        // This function is only ever called by the open instance method thunk, and in that case,
        // m_extraFunctionPointerOrData always points to an OpenMethodResolver
        [MethodImpl(MethodImplOptions.NoInlining)]
        protected IntPtr GetActualTargetFunctionPointer(object thisObject)
        {
            return OpenMethodResolver.ResolveMethod(m_extraFunctionPointerOrData, thisObject);
        }

        public override int GetHashCode()
        {
            return GetType().GetHashCode();
        }

        private bool IsDynamicDelegate()
        {
            if (this.GetThunk(MulticastThunk) == IntPtr.Zero)
            {
                return true;
            }

            return false;
        }

        [DebuggerGuidedStepThroughAttribute]
        protected virtual object DynamicInvokeImpl(object[] args)
        {
            if (IsDynamicDelegate())
            {
                // DynamicDelegate case
                object result = ((Func<object[], object>)m_helperObject)(args);
                DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
                return result;
            }
            else
            {
                IntPtr invokeThunk = this.GetThunk(DelegateInvokeThunk);
                object result = System.InvokeUtils.CallDynamicInvokeMethod(this.m_firstParameter, this.m_functionPointer, this, invokeThunk, IntPtr.Zero, this, args, binderBundle: null);
                DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
                return result;
            }
        }

        [DebuggerGuidedStepThroughAttribute]
        public object DynamicInvoke(params object[] args)
        {
            object result = DynamicInvokeImpl(args);
            DebugAnnotations.PreviousCallContainsDebuggerStepInCode();
            return result;
        }

        public static unsafe Delegate Combine(Delegate a, Delegate b)
        {
            if (a == null)
                return b;
            if (b == null)
                return a;

            return a.CombineImpl(b);
        }

        public static Delegate Remove(Delegate source, Delegate value)
        {
            if (source == null)
                return null;

            if (value == null)
                return source;

            if (!InternalEqualTypes(source, value))
                throw new ArgumentException(SR.Arg_DlgtTypeMis);

            return source.RemoveImpl(value);
        }

        public static Delegate RemoveAll(Delegate source, Delegate value)
        {
            Delegate newDelegate = null;

            do
            {
                newDelegate = source;
                source = Remove(source, value);
            }
            while (newDelegate != source);

            return newDelegate;
        }

        // Used to support the C# compiler in implementing the "+" operator for delegates
        public static Delegate Combine(params Delegate[] delegates)
        {
            if ((delegates == null) || (delegates.Length == 0))
                return null;

            Delegate d = delegates[0];
            for (int i = 1; i < delegates.Length; i++)
            {
                d = Combine(d, delegates[i]);
            }

            return d;
        }

        private MulticastDelegate NewMulticastDelegate(Delegate[] invocationList, int invocationCount, bool thisIsMultiCastAlready)
        {
            // First, allocate a new multicast delegate just like this one, i.e. same type as the this object
            MulticastDelegate result = (MulticastDelegate)RuntimeImports.RhNewObject(this.EETypePtr);

            // Performance optimization - if this already points to a true multicast delegate,
            // copy _methodPtr and _methodPtrAux fields rather than calling into the EE to get them
            if (thisIsMultiCastAlready)
            {
                result.m_functionPointer = this.m_functionPointer;
            }
            else
            {
                result.m_functionPointer = GetThunk(MulticastThunk);
            }
            result.m_firstParameter = result;
            result.m_helperObject = invocationList;
            result.m_extraFunctionPointerOrData = (IntPtr)invocationCount;

            return result;
        }

        internal MulticastDelegate NewMulticastDelegate(Delegate[] invocationList, int invocationCount)
        {
            return NewMulticastDelegate(invocationList, invocationCount, false);
        }

        private bool TrySetSlot(Delegate[] a, int index, Delegate o)
        {
            if (a[index] == null && System.Threading.Interlocked.CompareExchange<Delegate>(ref a[index], o, null) == null)
                return true;

            // The slot may be already set because we have added and removed the same method before.
            // Optimize this case, because it's cheaper than copying the array.
            if (a[index] != null)
            {
                MulticastDelegate d = (MulticastDelegate)o;
                MulticastDelegate dd = (MulticastDelegate)a[index];

                if (Object.ReferenceEquals(dd.m_firstParameter, d.m_firstParameter) &&
                    Object.ReferenceEquals(dd.m_helperObject, d.m_helperObject) &&
                    dd.m_extraFunctionPointerOrData == d.m_extraFunctionPointerOrData &&
                    dd.m_functionPointer == d.m_functionPointer)
                {
                    return true;
                }
            }
            return false;
        }

        // This method will combine this delegate with the passed delegate
        //  to form a new delegate.
        protected virtual Delegate CombineImpl(Delegate follow)
        {
            if ((Object)follow == null) // cast to object for a more efficient test
                return this;

            // Verify that the types are the same...
            if (!InternalEqualTypes(this, follow))
                throw new ArgumentException();

            if (IsDynamicDelegate() && follow.IsDynamicDelegate())
            {
                throw new InvalidOperationException();
            }

            MulticastDelegate dFollow = (MulticastDelegate)follow;
            Delegate[] resultList;
            int followCount = 1;
            Delegate[] followList = dFollow.m_helperObject as Delegate[];
            if (followList != null)
                followCount = (int)dFollow.m_extraFunctionPointerOrData;

            int resultCount;
            Delegate[] invocationList = m_helperObject as Delegate[];
            if (invocationList == null)
            {
                resultCount = 1 + followCount;
                resultList = new Delegate[resultCount];
                resultList[0] = this;
                if (followList == null)
                {
                    resultList[1] = dFollow;
                }
                else
                {
                    for (int i = 0; i < followCount; i++)
                        resultList[1 + i] = followList[i];
                }
                return NewMulticastDelegate(resultList, resultCount);
            }
            else
            {
                int invocationCount = (int)m_extraFunctionPointerOrData;
                resultCount = invocationCount + followCount;
                resultList = null;
                if (resultCount <= invocationList.Length)
                {
                    resultList = invocationList;
                    if (followList == null)
                    {
                        if (!TrySetSlot(resultList, invocationCount, dFollow))
                            resultList = null;
                    }
                    else
                    {
                        for (int i = 0; i < followCount; i++)
                        {
                            if (!TrySetSlot(resultList, invocationCount + i, followList[i]))
                            {
                                resultList = null;
                                break;
                            }
                        }
                    }
                }

                if (resultList == null)
                {
                    int allocCount = invocationList.Length;
                    while (allocCount < resultCount)
                        allocCount *= 2;

                    resultList = new Delegate[allocCount];

                    for (int i = 0; i < invocationCount; i++)
                        resultList[i] = invocationList[i];

                    if (followList == null)
                    {
                        resultList[invocationCount] = dFollow;
                    }
                    else
                    {
                        for (int i = 0; i < followCount; i++)
                            resultList[invocationCount + i] = followList[i];
                    }
                }
                return NewMulticastDelegate(resultList, resultCount, true);
            }
        }

        private Delegate[] DeleteFromInvocationList(Delegate[] invocationList, int invocationCount, int deleteIndex, int deleteCount)
        {
            Delegate[] thisInvocationList = m_helperObject as Delegate[];
            int allocCount = thisInvocationList.Length;
            while (allocCount / 2 >= invocationCount - deleteCount)
                allocCount /= 2;

            Delegate[] newInvocationList = new Delegate[allocCount];

            for (int i = 0; i < deleteIndex; i++)
                newInvocationList[i] = invocationList[i];

            for (int i = deleteIndex + deleteCount; i < invocationCount; i++)
                newInvocationList[i - deleteCount] = invocationList[i];

            return newInvocationList;
        }

        private bool EqualInvocationLists(Delegate[] a, Delegate[] b, int start, int count)
        {
            for (int i = 0; i < count; i++)
            {
                if (!(a[start + i].Equals(b[i])))
                    return false;
            }
            return true;
        }

        // This method currently looks backward on the invocation list
        //  for an element that has Delegate based equality with value.  (Doesn't
        //  look at the invocation list.)  If this is found we remove it from
        //  this list and return a new delegate.  If its not found a copy of the
        //  current list is returned.
        protected virtual Delegate RemoveImpl(Delegate value)
        {
            // There is a special case were we are removing using a delegate as
            //    the value we need to check for this case
            //
            MulticastDelegate v = value as MulticastDelegate;

            if (v == null)
                return this;
            if (v.m_helperObject as Delegate[] == null)
            {
                Delegate[] invocationList = m_helperObject as Delegate[];
                if (invocationList == null)
                {
                    // they are both not real Multicast
                    if (this.Equals(value))
                        return null;
                }
                else
                {
                    int invocationCount = (int)m_extraFunctionPointerOrData;
                    for (int i = invocationCount; --i >= 0;)
                    {
                        if (value.Equals(invocationList[i]))
                        {
                            if (invocationCount == 2)
                            {
                                // Special case - only one value left, either at the beginning or the end
                                return invocationList[1 - i];
                            }
                            else
                            {
                                Delegate[] list = DeleteFromInvocationList(invocationList, invocationCount, i, 1);
                                return NewMulticastDelegate(list, invocationCount - 1, true);
                            }
                        }
                    }
                }
            }
            else
            {
                Delegate[] invocationList = m_helperObject as Delegate[];
                if (invocationList != null)
                {
                    int invocationCount = (int)m_extraFunctionPointerOrData;
                    int vInvocationCount = (int)v.m_extraFunctionPointerOrData;
                    for (int i = invocationCount - vInvocationCount; i >= 0; i--)
                    {
                        if (EqualInvocationLists(invocationList, v.m_helperObject as Delegate[], i, vInvocationCount))
                        {
                            if (invocationCount - vInvocationCount == 0)
                            {
                                // Special case - no values left
                                return null;
                            }
                            else if (invocationCount - vInvocationCount == 1)
                            {
                                // Special case - only one value left, either at the beginning or the end
                                return invocationList[i != 0 ? 0 : invocationCount - 1];
                            }
                            else
                            {
                                Delegate[] list = DeleteFromInvocationList(invocationList, invocationCount, i, vInvocationCount);
                                return NewMulticastDelegate(list, invocationCount - vInvocationCount, true);
                            }
                        }
                    }
                }
            }

            return this;
        }

        public virtual Delegate[] GetInvocationList()
        {
            Delegate[] del;
            Delegate[] invocationList = m_helperObject as Delegate[];
            if (invocationList == null)
            {
                del = new Delegate[1];
                del[0] = this;
            }
            else
            {
                // Create an array of delegate copies and each
                //    element into the array
                int invocationCount = (int)m_extraFunctionPointerOrData;
                del = new Delegate[invocationCount];

                for (int i = 0; i < del.Length; i++)
                    del[i] = invocationList[i];
            }
            return del;
        }

        public MethodInfo Method
        {
            get
            {
                return GetMethodImpl();
            }
        }

        protected virtual MethodInfo GetMethodImpl()
        {
            return RuntimeAugments.Callbacks.GetDelegateMethod(this);
        }

        public override bool Equals(Object obj)
        {
            // It is expected that all real uses of the Equals method will hit the MulticastDelegate.Equals logic instead of this
            // therefore, instead of duplicating the desktop behavior where direct calls to this Equals function do not behave
            // correctly, we'll just throw here.
            throw new PlatformNotSupportedException();
        }

        public static bool operator ==(Delegate d1, Delegate d2)
        {
            if ((Object)d1 == null)
                return (Object)d2 == null;

            return d1.Equals(d2);
        }

        public static bool operator !=(Delegate d1, Delegate d2)
        {
            if ((Object)d1 == null)
                return (Object)d2 != null;

            return !d1.Equals(d2);
        }

        public Object Target
        {
            get
            {
                // Multi-cast delegates return the Target of the last delegate in the list
                if (m_functionPointer == GetThunk(MulticastThunk))
                {
                    Delegate[] invocationList = (Delegate[])m_helperObject;
                    int invocationCount = (int)m_extraFunctionPointerOrData;
                    return invocationList[invocationCount - 1].Target;
                }

                // Closed static delegates place a value in m_helperObject that they pass to the target method.
                if (m_functionPointer == GetThunk(ClosedStaticThunk) ||
                    m_functionPointer == GetThunk(ClosedInstanceThunkOverGenericMethod) ||
                    m_functionPointer == GetThunk(ObjectArrayThunk))
                    return m_helperObject;

                // Other non-closed thunks can be identified as the m_firstParameter field points at this.
                if (Object.ReferenceEquals(m_firstParameter, this))
                {
                    return null;
                }

                // Closed instance delegates place a value in m_firstParameter, and we've ruled out all other types of delegates
                return m_firstParameter;
            }
        }

        // V2 api: Creates open or closed delegates to static or instance methods - relaxed signature checking allowed.
        public static Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method) => CreateDelegate(type, firstArgument, method, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure) => ReflectionAugments.ReflectionCoreCallbacks.CreateDelegate(type, firstArgument, method, throwOnBindFailure);

        // V1 api: Creates open delegates to static or instance methods - relaxed signature checking allowed.
        public static Delegate CreateDelegate(Type type, MethodInfo method) => CreateDelegate(type, method, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure) => ReflectionAugments.ReflectionCoreCallbacks.CreateDelegate(type, method, throwOnBindFailure);

        // V1 api: Creates closed delegates to instance methods only, relaxed signature checking disallowed.
        public static Delegate CreateDelegate(Type type, object target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure) => ReflectionAugments.ReflectionCoreCallbacks.CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure);

        // V1 api: Creates open delegates to static methods only, relaxed signature checking disallowed.
        public static Delegate CreateDelegate(Type type, Type target, string method) => CreateDelegate(type, target, method, ignoreCase: false, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, Type target, string method, bool ignoreCase) => CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure: true);
        public static Delegate CreateDelegate(Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure) => ReflectionAugments.ReflectionCoreCallbacks.CreateDelegate(type, target, method, ignoreCase, throwOnBindFailure);

        public virtual object Clone()
        {
            return MemberwiseClone();
        }

        public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            throw new NotSupportedException();
        }

        internal bool IsOpenStatic
        {
            get
            {
                return GetThunk(OpenStaticThunk) == m_functionPointer;
            }
        }

        internal static bool InternalEqualTypes(object a, object b)
        {
            return a.EETypePtr == b.EETypePtr;
        }

        // Returns a new delegate of the specified type whose implementation is provied by the
        // provided delegate.
        internal static Delegate CreateObjectArrayDelegate(Type t, Func<object[], object> handler)
        {
            EETypePtr delegateEEType;
            if (!t.TryGetEEType(out delegateEEType))
            {
                throw new InvalidOperationException();
            }

            if (!delegateEEType.IsDefType || delegateEEType.IsGenericTypeDefinition)
            {
                throw new InvalidOperationException();
            }

            Delegate del = (Delegate)(RuntimeImports.RhNewObject(delegateEEType));

            IntPtr objArrayThunk = del.GetThunk(Delegate.ObjectArrayThunk);
            if (objArrayThunk == IntPtr.Zero)
            {
                throw new InvalidOperationException();
            }

            del.m_helperObject = handler;
            del.m_functionPointer = objArrayThunk;
            del.m_firstParameter = del;
            return del;
        }

        //
        // Internal (and quite unsafe) helper to create delegates of an arbitrary type. This is used to support Reflection invoke.
        //
        // Note that delegates constructed the normal way do not come through here. The IL transformer generates the equivalent of
        // this code customized for each delegate type.
        //
        internal static Delegate CreateDelegate(EETypePtr delegateEEType, IntPtr ldftnResult, Object thisObject, bool isStatic, bool isOpen)
        {
            Delegate del = (Delegate)(RuntimeImports.RhNewObject(delegateEEType));

            // What? No constructor call? That's right, and it's not an oversight. All "construction" work happens in
            // the Initialize() methods. This helper has a hard dependency on this invariant.

            if (isStatic)
            {
                if (isOpen)
                {
                    IntPtr thunk = del.GetThunk(Delegate.OpenStaticThunk);
                    del.InitializeOpenStaticThunk(null, ldftnResult, thunk);
                }
                else
                {
                    IntPtr thunk = del.GetThunk(Delegate.ClosedStaticThunk);
                    del.InitializeClosedStaticThunk(thisObject, ldftnResult, thunk);
                }
            }
            else
            {
                if (isOpen)
                {
                    IntPtr thunk = del.GetThunk(Delegate.OpenInstanceThunk);
                    del.InitializeOpenInstanceThunkDynamic(ldftnResult, thunk);
                }
                else
                {
                    del.InitializeClosedInstanceWithoutNullCheck(thisObject, ldftnResult);
                }
            }
            return del;
        }

        private string GetTargetMethodsDescriptionForDebugger()
        {
            if (m_functionPointer == GetThunk(MulticastThunk))
            {
                // Multi-cast delegates return the Target of the last delegate in the list
                Delegate[] invocationList = (Delegate[])m_helperObject;
                int invocationCount = (int)m_extraFunctionPointerOrData;
                StringBuilder builder = new StringBuilder();
                for (int c = 0; c < invocationCount; c++)
                {
                    if (c != 0)
                        builder.Append(", ");

                    builder.Append(invocationList[c].GetTargetMethodsDescriptionForDebugger());
                }

                return builder.ToString();
            }
            else
            {
                RuntimeTypeHandle typeOfFirstParameterIfInstanceDelegate;
                bool isOpenThunk;
                IntPtr functionPointer = GetFunctionPointer(out typeOfFirstParameterIfInstanceDelegate, out isOpenThunk);
                if (!FunctionPointerOps.IsGenericMethodPointer(functionPointer))
                {
                    return DebuggerFunctionPointerFormattingHook(functionPointer, typeOfFirstParameterIfInstanceDelegate);
                }
                else
                {
                    unsafe
                    {
                        GenericMethodDescriptor* pointerDef = FunctionPointerOps.ConvertToGenericDescriptor(functionPointer);
                        return DebuggerFunctionPointerFormattingHook(pointerDef->InstantiationArgument, typeOfFirstParameterIfInstanceDelegate);
                    }
                }
            }
        }

        private static string DebuggerFunctionPointerFormattingHook(IntPtr functionPointer, RuntimeTypeHandle typeOfFirstParameterIfInstanceDelegate)
        {
            // This method will be hooked by the debugger and the debugger will cause it to return a description for the function pointer
            throw new NotSupportedException();
        }
    }
}


text:
var events = new require('events');

var contents = new events.EventEmitter();

module.exports = {
  contents: contents
};


text:
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data

'-------------------------------------------------------------------------------------------'
' Inicio de clase "fPagos_Proveedores_Retenciones"
'-------------------------------------------------------------------------------------------'
Partial Class fPagos_Proveedores_Retenciones
    Inherits vis2Formularios.frmReporte

    Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try

            Dim loComandoSeleccionar As New StringBuilder()

            loComandoSeleccionar.AppendLine(" SELECT	Pagos.Documento, ")
            loComandoSeleccionar.AppendLine("           CONVERT(NCHAR(10), Pagos.Fec_Ini, 103)		AS	Fec_Ini, ")
            loComandoSeleccionar.AppendLine("			Pagos.Recibo, ")
            loComandoSeleccionar.AppendLine("			Pagos.Cod_Pro, ")
            loComandoSeleccionar.AppendLine("           Proveedores.Nom_Pro, ")
            loComandoSeleccionar.AppendLine("           Proveedores.Rif, ")
            loComandoSeleccionar.AppendLine("           Proveedores.Dir_Fis, ")
            loComandoSeleccionar.AppendLine("           Proveedores.Telefonos, ")
            loComandoSeleccionar.AppendLine("           Pagos.Comentario, ")
            loComandoSeleccionar.AppendLine("           Pagos.Cod_Ven, ")
            loComandoSeleccionar.AppendLine("           Vendedores.Nom_Ven ")
            loComandoSeleccionar.AppendLine(" INTO      #tmpPagos ")
            loComandoSeleccionar.AppendLine(" FROM      Pagos, ")
            loComandoSeleccionar.AppendLine("           Proveedores, ")
            loComandoSeleccionar.AppendLine("           Vendedores ")
            loComandoSeleccionar.AppendLine(" WHERE     Pagos.Cod_Pro          =   Proveedores.Cod_Pro AND ")
            loComandoSeleccionar.AppendLine("           Pagos.Cod_Ven          =   Vendedores.Cod_Ven  AND ")
            loComandoSeleccionar.AppendLine("           " & cusAplicacion.goFormatos.pcCondicionPrincipal)

            loComandoSeleccionar.AppendLine(" SELECT	#tmpPagos.Documento, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Fec_Ini, ")
            loComandoSeleccionar.AppendLine("			#tmpPagos.Recibo, ")
            loComandoSeleccionar.AppendLine("			#tmpPagos.Cod_Pro, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Nom_Pro, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Rif, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Dir_Fis, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Telefonos, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Comentario, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Cod_Ven, ")
            loComandoSeleccionar.AppendLine("           #tmpPagos.Nom_Ven, ")
            loComandoSeleccionar.AppendLine("           Cuentas_Pagar.Cod_Tip, ")
            loComandoSeleccionar.AppendLine("           Cuentas_Pagar.Documento    AS  Num_Doc, ")
            loComandoSeleccionar.AppendLine("           Cuentas_Pagar.Mon_Net      AS  Mon_Net ")
            loComandoSeleccionar.AppendLine(" INTO      #tmpDocumentos ")
            loComandoSeleccionar.AppendLine(" FROM      #tmpPagos, ")
            loComandoSeleccionar.AppendLine("           Cuentas_Pagar ")
            loComandoSeleccionar.AppendLine(" WHERE     Cuentas_Pagar.Doc_Ori  =   #tmpPagos.Documento    AND ")
            loComandoSeleccionar.AppendLine("           Cuentas_Pagar.Tip_Ori  =   'Pagos'                ")

            loComandoSeleccionar.AppendLine(" SELECT	#tmpDocumentos.Documento, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Fec_Ini, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Recibo, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Cod_Pro, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Nom_Pro, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Rif, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Dir_Fis, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Telefonos, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Comentario, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Cod_Ven, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Nom_Ven, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Cod_Tip, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Num_Doc, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Cod_Tip      AS  Tip_Ori, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Doc_Ori      AS  Doc_Ori, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Cla_Des      AS  Tip_Des, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Clase        AS  Tip_Ret, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Cod_Con      AS  Cod_Con, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Num_Com      AS  Num_Com, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Mon_Bas      AS  Mon_Bas, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Por_Ret      AS  Por_Ret, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Mon_Ret      AS  Mon_Ret, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos.Mon_Sus      AS  Mon_Sus, ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Mon_Net ")
            loComandoSeleccionar.AppendLine(" FROM      #tmpDocumentos, ")
            loComandoSeleccionar.AppendLine("           Retenciones_Documentos ")
            loComandoSeleccionar.AppendLine(" WHERE     #tmpDocumentos.Documento    =   Retenciones_Documentos.Documento    AND ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Cod_Tip      =   Retenciones_Documentos.Cla_Des      AND ")
            loComandoSeleccionar.AppendLine("           #tmpDocumentos.Num_Doc      =   Retenciones_Documentos.Doc_Des      ")
            loComandoSeleccionar.AppendLine(" ORDER BY  #tmpDocumentos.Cod_Tip ")

            Dim loServicios As New cusDatos.goDatos
            Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString(), "curReportes")

            '--------------------------------------------------'
            ' Carga la imagen del logo en cusReportes          '
            '--------------------------------------------------'
            Me.mCargarLogoEmpresa(laDatosReporte.Tables(0), "LogoEmpresa")

            '-------------------------------------------------------------------------------------------------------
            ' Verificando si el select (tabla nº0) trae registros
            '-------------------------------------------------------------------------------------------------------

            If (laDatosReporte.Tables(0).Rows.Count <= 0) Then
                Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
                                          "No se Encontraron Registros para los Parámetros Especificados. ", _
                                          vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
                                          "350px", _
                                          "200px")
            End If

            loObjetoReporte = cusAplicacion.goFormatos.mCargarInforme("fPagos_Proveedores_Retenciones", laDatosReporte)

            Me.mTraducirReporte(loObjetoReporte)
            Me.mFormatearCamposReporte(loObjetoReporte)
            Me.crvfPagos_Proveedores_Retenciones.ReportSource = loObjetoReporte

        Catch loExcepcion As Exception

            Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
                          "No se pudo Completar el Proceso: " & loExcepcion.Message, _
                           vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
                           "auto", _
                           "auto")

        End Try

    End Sub

    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

        Try

            loObjetoReporte.Close()

        Catch loExcepcion As Exception

        End Try

    End Sub

End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo																			'
'-------------------------------------------------------------------------------------------'
' JJD: 28/04/11: Programacion inicial														'
'-------------------------------------------------------------------------------------------'
' JJD: 29/04/11: Continuacion de la programacion											'
'-------------------------------------------------------------------------------------------'


text:
package com.whileyweb;

import java.io.File;
import java.io.IOException;
import java.net.BindException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.apache.http.ConnectionClosedException;
import org.apache.http.ExceptionLogger;
import org.apache.http.config.SocketConfig;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.bootstrap.HttpServer;
import org.apache.http.impl.bootstrap.ServerBootstrap;

import com.whileyweb.pages.*;
import com.whileyweb.util.*;

import com.whileyweb.util.OptArg;
import jwebkit.http.HttpFileHandler;
import wyboogie.core.BoogieFile;
import wyboogie.util.Boogie;
import wyc.lang.WhileyFile;
import wycli.cfg.ConfigFile;
import wycli.lang.SemanticVersion;
import wyfs.lang.Content;
import wyfs.lang.Path;
import wyfs.lang.Path.Entry;
import wyfs.util.DefaultContentRegistry;
import wyfs.util.DirectoryRoot;
import wyfs.util.ZipFile;
import wyil.lang.WyilFile;

/**
 * Responsible for initialising and starting the HTTP server which manages the
 * tool
 *
 * @author David J. Pearce
 *
 */
public class Main {

	public static final int[] HTTP_PORTS = {80,8080,8081};

	public static final ContentType TEXT_JAVASCRIPT = ContentType.create("text/javascript");
	public static final ContentType TEXT_CSS = ContentType.create("text/css");
	public static final ContentType IMAGE_PNG = ContentType.create("image/png");
	public static final ContentType IMAGE_GIF = ContentType.create("image/gif");

	/**
	 * Default implementation of a content registry. This associates whiley and
	 * wyil files with their respective content types.
	 *
	 * @author David J. Pearce
	 *
	 */
	public static final Content.Registry REGISTRY = new DefaultContentRegistry()
			.register(WhileyFile.ContentType, "whiley").register(WyilFile.ContentType, "wyil")
			.register(ConfigFile.ContentType, "toml").register(ZipFile.ContentType, "zip");

	private static final OptArg[] OPTIONS = {
			// Standard options
			new OptArg("timeout", "t", OptArg.INT, "Set timeout constraint per query (in ms)", 10000),
			new OptArg("pkgs", "p", OptArg.STRINGARRAY, "Specify packages to make available for compilation", new String[] {"std"}),
			new OptArg("repository","r", OptArg.STRING, "Specify location of package repository", null),
			new OptArg("analytics","g", OptArg.STRING, "Specify Google analytics Tracking ID", null)
	};

	// =======================================================================
	// Main Entry Point
	// =======================================================================
	public static void main(String[] _args) throws IOException {
		List<String> args = new ArrayList<>(Arrays.asList(_args));
		Map<String, Object> options = OptArg.parseOptions(args, OPTIONS);
		// Determine requested timeout value
		int timeout = (Integer) options.get("timeout");
		// Determine requested packages
		String[] packages = (String[]) options.get("pkgs");
		// Determine location of repository
		String repositoryLocation = (String) options.get("repository");
		//
		if(repositoryLocation == null) {
				// Try environment variable
				repositoryLocation = System.getenv("WHILEY_REPOSITORY");
				if(repositoryLocation == null) {
					// Use default location
					repositoryLocation = System.getProperty("user.home") + File.separator + ".whiley" + File.separator + "repository";
				}
		}
		System.out.println("Working directory is " + System.getProperty("user.dir"));
		System.out.println("Whiley repository is " + repositoryLocation);
		// Extract Google Analytics tracking ID
		String gaTrackingID = (String) options.get("analytics");
		//
		if(gaTrackingID != null) {
			System.out.println("Google analytics enabled (" + gaTrackingID + ")");
		}
		// Create the repository root
		DirectoryRoot repository = new DirectoryRoot(repositoryLocation,REGISTRY);
		// Determine list of installed packages
		String[] pkgs = determineInstalledPackages(repository);
		// Determine default configure deps
		String[] deps = determineDefaultDependencies(pkgs,packages);
		// Attempt to start the web server
		boolean boogie = determineBoogieAvailable();

		try {
			HttpServer server = startWebServer(repositoryLocation, pkgs, deps, timeout, boogie, gaTrackingID);
			server.start();
			server.awaitTermination(-1, TimeUnit.MILLISECONDS);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	public static HttpServer startWebServer(String repository, String[] packages, String[] dependencies, int timeout, boolean boogie, String gaTrackingID) throws IOException {
		// Construct appropriate configuration for socket over which HTTP
		// server will run.
		SocketConfig socketConfig = SocketConfig.custom().setSoTimeout(1500).build();
		// Set port number from which we'll try to run the server. If this port
		// is taken, we'll try the next one and the next one, until we find a
		// match.
		int portIndex = 0;
		//
		while (portIndex < HTTP_PORTS.length) {
			int port = HTTP_PORTS[portIndex++];
			try {
				// Construct HTTP server object, and connect pages to routes
				HttpServer server = ServerBootstrap.bootstrap().setListenerPort(port).setSocketConfig(socketConfig)
						.setExceptionLogger(new Logger())
						.registerHandler("/css/*", new HttpFileHandler(new File("."),TEXT_CSS))
						.registerHandler("/js/*", new HttpFileHandler(new File("."),TEXT_JAVASCRIPT))
						.registerHandler("/bin/js/*", new HttpFileHandler(new File("."),TEXT_JAVASCRIPT))
						.registerHandler("*.png", new HttpFileHandler(new File("."),IMAGE_PNG))
						.registerHandler("*.gif", new HttpFileHandler(new File("."),IMAGE_GIF))
						.registerHandler("/compile", new WhileyWebCompiler(repository, timeout, boogie))
						.registerHandler("/", new FrontPage(gaTrackingID,packages,dependencies))
						.registerHandler("*", new HtmlPage(gaTrackingID))
						.create();
				// Attempt to start server
				server.start();
				System.out.println("WhileyWeb running on port " + port + ".");
				return server;
			} catch (BindException e) {
				System.out.println("Port " + port + " in use by another application.");
			}
		}
		System.out.println("Failed starting HTTP server.");
		System.exit(-1);
		return null;
	}

    private static class Logger implements ExceptionLogger {
		@Override
		public void log(Exception ex) {
            if (ex instanceof SocketTimeoutException) {
                System.err.println(ex.getMessage());
            } else if (ex instanceof ConnectionClosedException) {
                System.err.println(ex.getMessage());
            } else {
                ex.printStackTrace();
            }
		}
    }

	private static String[] determineDefaultDependencies(String[] pkgs, String... deps) {
		ArrayList<String> results = new ArrayList<>();
		for (String dep : deps) {
			String concrete = findLatestVersion(pkgs, dep);
			if (concrete != null) {
				results.add(concrete);
			}

		}
		System.out.println("Found " + results.size() + " matching dependencies: " + results);
		return results.toArray(new String[results.size()]);
	}

	private static String findLatestVersion(String[] pkgs, String dep) {
		String prefix = dep + "-v";
		String best = null;
		SemanticVersion ver = null;
		for (int i = 0; i != pkgs.length; ++i) {
			String pkg = pkgs[i];
			if (pkg.startsWith(prefix)) {
				SemanticVersion v = new SemanticVersion(pkg.substring(prefix.length()));
				if (best == null || v.compareTo(ver) > 0) {
					best = pkg;
					ver = v;
				}
			}
		}
		return best;
	}

    private static String[] determineInstalledPackages(DirectoryRoot repository) throws IOException {
		List<Entry<ZipFile>> pkgs = repository.get(Content.filter("**", ZipFile.ContentType));
		String[] items = new String[pkgs.size()];
		for(int i=0;i!=pkgs.size();++i) {
			items[i] = pkgs.get(i).id().toString();
		}
		System.out.println("Found " + items.length + " installed packages: " + Arrays.toString(items));
		return items;
    }

	/**
	 * Check whether or not Boogie is available on this system.
	 * @return
	 */
	private static boolean determineBoogieAvailable() {
		// Create dummy boogie file
		BoogieFile bf = new BoogieFile();
		boolean response;
		//
		try {
			Boogie.Message[] errors = new Boogie().check(10, "test", bf);
			// Should produce no errors
			if(errors == null) {
				System.out.println("Boogie was detected!");
				return true;
			} else {
				System.out.println("Boogie was not detected (" + errors.length + " errors)");
			}
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println("Boogie was not detected (" + e.getClass().getSimpleName() + ")");
		}
		return false;
	}
}


text:
module.exports = (api) => {
  api.cache.forever()
  return {
    presets: [
      require('@looker/babel-preset-react'),
      require('@looker/babel-preset-typescript'),
    ],
  }
}


text:
from tree import *

class Solution:
    def zigzagLevelOrder(self, root):
        """
        :type root: TreeNode
        :rtype: List[List[int]]
        """
        currLevel = queue.LifoQueue()
        nextLevel = queue.LifoQueue()
        reverse = False
        if root == None:
            return []
        currLevel.put(root)
        ret = []
        while True:
            reverse = (not reverse)
            currList = []
            # print(reverse)
            while not currLevel.empty():
                node = currLevel.get()
                currList.append(node.val)
                # print(node.val)
                if reverse:
                    if node.left != None: nextLevel.put(node.left)
                    if node.right != None: nextLevel.put(node.right)
                else:
                    if node.right != None: nextLevel.put(node.right)
                    if node.left != None: nextLevel.put(node.left)
            ret.append(currList)
            currLevel, nextLevel = nextLevel, currLevel
            if currLevel.empty():
                break
        return ret

sol = Solution()
nodeStringList = [
        '[3,9,20,null,null,15,7]',
        '[]'
]
for nodeString in nodeStringList:
    root = treeBuilder(nodeString)
    traverse(root)
    print(sol.zigzagLevelOrder(root))


text:
package com.intellij.lang.java.parser.partial;

import com.intellij.lang.PsiBuilder;
import com.intellij.lang.java.parser.JavaParser;
import com.intellij.lang.java.parser.JavaParsingTestCase;

public abstract class FileParserTest extends JavaParsingTestCase {
  public FileParserTest() {
    super("parser-partial/files");
  }

  public void testEmptyFile() { doParserTest(""); }

  public void testPackage() { doParserTest("package a.b.c;"); }
  public void testAnnotatedPackage() { doParserTest("@Anno package a.b.c;"); }
  public void testUnclosedPackage0() { doParserTest("package"); }
  public void testUnclosedPackage1() { doParserTest("package a."); }

  public void testImport0() { doParserTest("import java.util.*;"); }
  public void testImport1() { doParserTest("import java.util.Arrays;"); }
  public void testStaticImport0() { doParserTest("import static java.util.Arrays.*;"); }
  public void testStaticImport1() { doParserTest("import static java.util.Arrays.sort;"); }
  public void testUnclosedImport0() { doParserTest("import"); }
  public void testUnclosedImport1() { doParserTest("import java.awt.*"); }
  public void testUnclosedImport2() { doParserTest("import java.awt."); }
  public void testUnclosedImport3() { doParserTest("import static a"); }

  public void testFileWithClass() { doParserTest("package a;\n" +
                                                 "import b;\n" +
                                                 "public class C { }\n" +
                                                 "class D { }"); }

  public void testBindBefore0() { doParserTest("class A{\n  // comment\n  int field;\n}"); }
  public void testBindBefore1() { doParserTest("class A{\n  // comment\n\n  int field;\n}"); }
  public void testBindBefore2() { doParserTest("class A{ // comment\n  int field;\n}"); }
  public void testBindBefore3() { doParserTest("class A{// comment\n  int field;\n}"); }
  public void testBindBefore4() { doParserTest("class A{\n  // comment 1\n  // comment 2\n  // comment 3\n  int field;\n}"); }

  public void testBindDocComment0() { doParserTest("/** class comment */\nclass A { }"); }
  public void testBindDocComment1() { doParserTest("/** file comment */\npackage a;\nclass A { }"); }
  public void testBindDocComment2() { doParserTest("/** file comment */\nimport a;\nclass A { }"); }
  public void testBindDocComment3() { doParserTest("class A {\n /** field comment */\n int f;\n}"); }
  public void testBindDocComment4() { doParserTest("class A {\n /** field comment */\n// field comment\n int f;\n}"); }

  private void doParserTest(final String text) {
    doParserTest(text, new MyTestParser());
  }

  private static class MyTestParser implements TestParser {
    @Override
    public void parse(final PsiBuilder builder) {
      JavaParser.INSTANCE.getFileParser().parse(builder);
    }
  }
}


text:
NS_ASSUME_NONNULL_BEGIN

@interface UIViewController (ControllerAdditions)<SMKViewControllerProtocolDelegate>

@property (nonatomic,strong) __kindof NSObject *smk_viewModel;
@property (nonatomic,strong) __kindof NSObject *smk_viewManger;

@end
NS_ASSUME_NONNULL_END


text:
sample readme

This app did not work really well, in order keep track of possibilities tried out. I am leaving this as it is and making a proper attempt in next project