text:
/*
 * Phone.com API
 * This is a Phone.com api Swagger definition
 *
 * OpenAPI spec version: 1.0.0
 * Contact: apisupport@phone.com
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package io.swagger.client.model;

import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.client.model.ExtensionSummary;
import io.swagger.client.model.MediaSummary;
import io.swagger.client.model.MenuSummary;
import io.swagger.client.model.QueueSummary;
import io.swagger.client.model.RuleSetForwardItem;
import io.swagger.client.model.TrunkSummary;
import java.util.ArrayList;
import java.util.List;

/**
 * Filter Object. Optional. See below for details.
 */
@ApiModel(description = "Filter Object. Optional. See below for details.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2017-03-21T10:43:19.319+01:00")
public class RuleSetAction {
  @SerializedName("action")
  private String action = null;

  @SerializedName("extension")
  private ExtensionSummary extension = null;

  @SerializedName("items")
  private List<RuleSetForwardItem> items = new ArrayList<RuleSetForwardItem>();

  @SerializedName("timeout")
  private Integer timeout = null;

  @SerializedName("hold_music")
  private MediaSummary holdMusic = null;

  @SerializedName("greeting")
  private MediaSummary greeting = null;

  @SerializedName("duration")
  private Integer duration = null;

  @SerializedName("menu")
  private MenuSummary menu = null;

  @SerializedName("queue")
  private QueueSummary queue = null;

  @SerializedName("trunk")
  private TrunkSummary trunk = null;

  public RuleSetAction action(String action) {
    this.action = action;
    return this;
  }

   /**
   * Required.
   * @return action
  **/
  @ApiModelProperty(example = "null", value = "Required.")
  public String getAction() {
    return action;
  }

  public void setAction(String action) {
    this.action = action;
  }

  public RuleSetAction extension(ExtensionSummary extension) {
    this.extension = extension;
    return this;
  }

   /**
   * Extension that this action refers to. Output is an Extension Summary Object. Input must be an Extension Lookup Object. Required.
   * @return extension
  **/
  @ApiModelProperty(example = "null", value = "Extension that this action refers to. Output is an Extension Summary Object. Input must be an Extension Lookup Object. Required.")
  public ExtensionSummary getExtension() {
    return extension;
  }

  public void setExtension(ExtensionSummary extension) {
    this.extension = extension;
  }

  public RuleSetAction items(List<RuleSetForwardItem> items) {
    this.items = items;
    return this;
  }

  public RuleSetAction addItemsItem(RuleSetForwardItem itemsItem) {
    this.items.add(itemsItem);
    return this;
  }

   /**
   * This action is for forwarding calls to any number of extensions or phone numbers. The forwarding is handled in parallel, meaning that all phone numbers and/or extensions will ring simultaneously. When the call is answered by any single phone number or extension, ringing will stop for all of them. Subsequent actions in this rule set will be performed if the call is not answered before the timeout period is reached, or if it is forwarded to an extension that has its own route and that route does not result in any actions that disconnect the call or take over call handling.
   * @return items
  **/
  @ApiModelProperty(example = "null", value = "This action is for forwarding calls to any number of extensions or phone numbers. The forwarding is handled in parallel, meaning that all phone numbers and/or extensions will ring simultaneously. When the call is answered by any single phone number or extension, ringing will stop for all of them. Subsequent actions in this rule set will be performed if the call is not answered before the timeout period is reached, or if it is forwarded to an extension that has its own route and that route does not result in any actions that disconnect the call or take over call handling.")
  public List<RuleSetForwardItem> getItems() {
    return items;
  }

  public void setItems(List<RuleSetForwardItem> items) {
    this.items = items;
  }

  public RuleSetAction timeout(Integer timeout) {
    this.timeout = timeout;
    return this;
  }

   /**
   * Seconds that our routing engine should wait until moving on. Optional. Must be an integer between 5 and 90. Default is 5 seconds.
   * @return timeout
  **/
  @ApiModelProperty(example = "null", value = "Seconds that our routing engine should wait until moving on. Optional. Must be an integer between 5 and 90. Default is 5 seconds.")
  public Integer getTimeout() {
    return timeout;
  }

  public void setTimeout(Integer timeout) {
    this.timeout = timeout;
  }

  public RuleSetAction holdMusic(MediaSummary holdMusic) {
    this.holdMusic = holdMusic;
    return this;
  }

   /**
   * Hold Music to be played while callers are waiting. Output is a Media Summary Object. Input must be a Media Lookup Object. Optional. Must refer to a media recording that has is_hold_music set to TRUE. Default is to play a standard ring tone.
   * @return holdMusic
  **/
  @ApiModelProperty(example = "null", value = "Hold Music to be played while callers are waiting. Output is a Media Summary Object. Input must be a Media Lookup Object. Optional. Must refer to a media recording that has is_hold_music set to TRUE. Default is to play a standard ring tone.")
  public MediaSummary getHoldMusic() {
    return holdMusic;
  }

  public void setHoldMusic(MediaSummary holdMusic) {
    this.holdMusic = holdMusic;
  }

  public RuleSetAction greeting(MediaSummary greeting) {
    this.greeting = greeting;
    return this;
  }

   /**
   * Greeting that this action refers to. Output is a Media Summary Object. Input must be a Media Lookup Object. Required. Must refer to a media recording that has is_hold_music set to FALSE.
   * @return greeting
  **/
  @ApiModelProperty(example = "null", value = "Greeting that this action refers to. Output is a Media Summary Object. Input must be a Media Lookup Object. Required. Must refer to a media recording that has is_hold_music set to FALSE.")
  public MediaSummary getGreeting() {
    return greeting;
  }

  public void setGreeting(MediaSummary greeting) {
    this.greeting = greeting;
  }

  public RuleSetAction duration(Integer duration) {
    this.duration = duration;
    return this;
  }

   /**
   * Required. Seconds that the caller should be placed on hold before being moved onto the next action. Must be an integer between 1 and 60 seconds.
   * @return duration
  **/
  @ApiModelProperty(example = "null", value = "Required. Seconds that the caller should be placed on hold before being moved onto the next action. Must be an integer between 1 and 60 seconds.")
  public Integer getDuration() {
    return duration;
  }

  public void setDuration(Integer duration) {
    this.duration = duration;
  }

  public RuleSetAction menu(MenuSummary menu) {
    this.menu = menu;
    return this;
  }

   /**
   * Menu that this action refers to. Required. Output is a Menu Summary Object. Input must be a Menu Lookup Object.
   * @return menu
  **/
  @ApiModelProperty(example = "null", value = "Menu that this action refers to. Required. Output is a Menu Summary Object. Input must be a Menu Lookup Object.")
  public MenuSummary getMenu() {
    return menu;
  }

  public void setMenu(MenuSummary menu) {
    this.menu = menu;
  }

  public RuleSetAction queue(QueueSummary queue) {
    this.queue = queue;
    return this;
  }

   /**
   * Queue that this action refers to. Required. Output is a Queue Summary Object. Input must be a Queue Lookup Object.
   * @return queue
  **/
  @ApiModelProperty(example = "null", value = "Queue that this action refers to. Required. Output is a Queue Summary Object. Input must be a Queue Lookup Object.")
  public QueueSummary getQueue() {
    return queue;
  }

  public void setQueue(QueueSummary queue) {
    this.queue = queue;
  }

  public RuleSetAction trunk(TrunkSummary trunk) {
    this.trunk = trunk;
    return this;
  }

   /**
   * Trunk that this action refers to. Required. Output is a Trunk Summary Object. Input must be a Trunk Lookup Object.
   * @return trunk
  **/
  @ApiModelProperty(example = "null", value = "Trunk that this action refers to. Required. Output is a Trunk Summary Object. Input must be a Trunk Lookup Object.")
  public TrunkSummary getTrunk() {
    return trunk;
  }

  public void setTrunk(TrunkSummary trunk) {
    this.trunk = trunk;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RuleSetAction ruleSetAction = (RuleSetAction) o;
    return Objects.equals(this.action, ruleSetAction.action) &&
        Objects.equals(this.extension, ruleSetAction.extension) &&
        Objects.equals(this.items, ruleSetAction.items) &&
        Objects.equals(this.timeout, ruleSetAction.timeout) &&
        Objects.equals(this.holdMusic, ruleSetAction.holdMusic) &&
        Objects.equals(this.greeting, ruleSetAction.greeting) &&
        Objects.equals(this.duration, ruleSetAction.duration) &&
        Objects.equals(this.menu, ruleSetAction.menu) &&
        Objects.equals(this.queue, ruleSetAction.queue) &&
        Objects.equals(this.trunk, ruleSetAction.trunk);
  }

  @Override
  public int hashCode() {
    return Objects.hash(action, extension, items, timeout, holdMusic, greeting, duration, menu, queue, trunk);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RuleSetAction {\n");

    sb.append("    action: ").append(toIndentedString(action)).append("\n");
    sb.append("    extension: ").append(toIndentedString(extension)).append("\n");
    sb.append("    items: ").append(toIndentedString(items)).append("\n");
    sb.append("    timeout: ").append(toIndentedString(timeout)).append("\n");
    sb.append("    holdMusic: ").append(toIndentedString(holdMusic)).append("\n");
    sb.append("    greeting: ").append(toIndentedString(greeting)).append("\n");
    sb.append("    duration: ").append(toIndentedString(duration)).append("\n");
    sb.append("    menu: ").append(toIndentedString(menu)).append("\n");
    sb.append("    queue: ").append(toIndentedString(queue)).append("\n");
    sb.append("    trunk: ").append(toIndentedString(trunk)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>fr.pilato.elasticsearch.crawler</groupId>
        <artifactId>fscrawler-it</artifactId>
        <version>2.7-SNAPSHOT</version>
    </parent>

    <artifactId>fscrawler-it-common</artifactId>
    <name>FSCrawler Integration Common Tests</name>

    <dependencies>
        <dependency>
            <groupId>fr.pilato.elasticsearch.crawler</groupId>
            <artifactId>fscrawler-core</artifactId>
        </dependency>
        <dependency>
            <groupId>fr.pilato.elasticsearch.crawler</groupId>
            <artifactId>fscrawler-rest</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>fr.pilato.elasticsearch.crawler</groupId>
            <artifactId>fscrawler-test-framework</artifactId>
        </dependency>
        <dependency>
            <groupId>fr.pilato.elasticsearch.crawler</groupId>
            <artifactId>fscrawler-test-documents</artifactId>
        </dependency>

        <!--
        For legal reasons (incompatible license), these dependencies are to marked as optional so users who might want
        to use them have to provided them manually in the lib dir.
        -->
        <dependency>
            <groupId>com.levigo.jbig2</groupId>
            <artifactId>levigo-jbig2-imageio</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-jpeg2000</artifactId>
        </dependency>

    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/main/resources-binary</directory>
                <filtering>false</filtering>
            </testResource>
            <testResource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
    </build>

    <profiles>
        <!-- We are building a profile that can be activated from the IDE -->
        <profile>
            <id>es-7x</id>
            <properties>
                <integ.elasticsearch.version>${elasticsearch7.version}</integ.elasticsearch.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>fr.pilato.elasticsearch.crawler</groupId>
                    <artifactId>fscrawler-elasticsearch-client-v7</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <!-- We are building a profile that can be activated from the IDE -->
        <profile>
            <id>es-6x</id>
            <properties>
                <integ.elasticsearch.version>${elasticsearch6.version}</integ.elasticsearch.version>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>fr.pilato.elasticsearch.crawler</groupId>
                    <artifactId>fscrawler-elasticsearch-client-v6</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>

redpajama_set_name: RedPajamaGithub


text:
require('angular-material-icons');
require('./dist/md-data-table-templates.js');
require('./dist/md-data-table.js');

module.exports = 'mdDataTable';


text:
package org.multibit.viewsystem.swing.action;

/**
 *
Exception to provide the following to {@link org.multibit.viewsystem.swing.action.CheckPrivateKeysSubmitAction}:

 *

 *
Error handling for private key checking

 *

 *
This base exception acts as a general failure mode not attributable to a specific cause (other than
 * that reported in the exception message). Since this is in English, it may not be worth reporting directly
 * to the user other than as part of a "general failure to parse" response.

 *
 * @since 0.3.0
 */
public class PrivateKeysException extends RuntimeException {

    private static final long serialVersionUID = 2372470348971293437L;

    public PrivateKeysException(String s) {
        super(s);
    }

    public PrivateKeysException(String s, Throwable throwable) {
        super(s, throwable);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Web.Mvc;
using Infodinamica.Framework.MvcComponents.Resources;

namespace Infodinamica.Framework.MvcComponents.Extensions
{
    /// <summary>
    /// Permite crear nuevos tipos de elementos en HTML
    /// </summary>
    public static class Controls
    {
        /// <summary>
        /// Crea un nuevo multiple drop down list
        /// </summary>
        /// <typeparam name="TModel">Modelo a utilizar</typeparam>
        /// <typeparam name="TProperty">Propiedad a utilizar</typeparam>
        /// <param name="htmlHelper">HtmlHelper de MVC</param>
        /// <param name="expression">Expresión que contiene la propiedad a utilizar</param>
        /// <param name="selectList">Listado de elementos a colocar en la lista</param>
        /// <returns>DropDownList del cual se pueden escoger varios elementos de forma simultánea</returns>
        public static MvcHtmlString MultipleDropDownList<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper,
            Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItem> selectList)
        {
            var selectBuilder = new TagBuilder("select");
            var options = string.Empty;

            if (expression == null)
                throw new ArgumentNullException("expression");

            if (expression.Body == null)
                throw new ArgumentException(ErrorMessages.NoBodyInExpression);

            //Se obtiene el member de la expresion
            var member = (expression.Body as MemberExpression);

            if (member == null || member.Member == null)
                throw new NullReferenceException();

            //Se establece el id
            selectBuilder.GenerateId(member.Member.Name);

            //Se establece el name
            selectBuilder.Attributes.Add(new KeyValuePair<string, string>("name", member.Member.Name));

            //Se establece el css
            selectBuilder.AddCssClass("form-control");
            selectBuilder.AddCssClass("select2");

            //Por cada elemento en el listado, se agrega a los options
            foreach (var item in selectList)
            {
                //Se establece el constructor para cada option
                var optionBuilder = new TagBuilder("option");

                //Se establece el ID y el valor del listado
                optionBuilder.SetInnerText(item.Text);
                optionBuilder.Attributes.Add(new KeyValuePair<string, string>("value", item.Value));

                //Se agrega el option
                options += optionBuilder.ToString();
            }

            //Se asigna el contenido de los elementos hijos
            selectBuilder.InnerHtml = options;

            //Se establece la propiedad multiple
            selectBuilder.Attributes.Add(new KeyValuePair<string, string>("multiple", "multiple"));

            //Se establece el ancho
            selectBuilder.Attributes.Add(new KeyValuePair<string, string>("style", "width: 100%;"));

            //Se establece el mensaje seleccione elementos
            selectBuilder.Attributes.Add(new KeyValuePair<string, string>("data-placeholder", @Presentation.SelectSomeElementFromListMessage));

            //Se retorna el elemento
            return MvcHtmlString.Create(selectBuilder.ToString());
        }

        /// <summary>
        /// Crea un mensaje que puede ser cliqueado y eliminado de la interfaz
        /// </summary>
        /// <param name="helper">Html helper de MVC</param>
        /// <returns>Mensaje de validación que puede ser cliqueado y eliminado de la interfaz</returns>
        public static MvcHtmlString ValidationMessageDismissable(this HtmlHelper helper)
        {
            if (helper.ViewData.ModelState[""] == null || helper.ViewData.ModelState[""].Errors == null)
            {
                return MvcHtmlString.Empty;
            }

            //Se crea el div principal
            TagBuilder tagMainDiv = new TagBuilder("div");
            tagMainDiv.AddCssClass("box-body");

            //Se crea el div hijo
            TagBuilder tagChildDiv = new TagBuilder("div");
            tagChildDiv.AddCssClass("alert");
            tagChildDiv.AddCssClass("alert-danger");
            tagChildDiv.AddCssClass("alert-dismissable");

            //Se crea el botón que permite cerrar la alerta
            TagBuilder tagCloseButton = new TagBuilder("button");
            tagCloseButton.AddCssClass("close");
            tagCloseButton.Attributes.Add(new KeyValuePair<string, string>("data-dismiss", "alert"));
            tagCloseButton.Attributes.Add(new KeyValuePair<string, string>("aria-hidden", "true"));
            tagCloseButton.SetInnerText("x");

            //Se crea el titulo de la ventana de alerta
            TagBuilder tagTitle = new TagBuilder("h4");

            //Se crea el icono de warning
            TagBuilder tagIcon = new TagBuilder("i");
            tagIcon.AddCssClass("icon");
            tagIcon.AddCssClass("fa");
            tagIcon.AddCssClass("fa-warning");

            //Se añade el icono al h4 y el titulo
            tagTitle.InnerHtml += tagIcon.ToString(TagRenderMode.EndTag);
            tagTitle.SetInnerText(Presentation.LabelErrorTitle);

            //Se añade el boton, el h4 y el mensaje al div hijo
            tagChildDiv.InnerHtml += tagCloseButton.ToString(TagRenderMode.Normal);
            tagChildDiv.InnerHtml += tagTitle.ToString(TagRenderMode.Normal);
            tagChildDiv.InnerHtml += helper.ViewData.ModelState[""].Errors[0].ErrorMessage;

            //Se añade el div hijo al div padre
            tagMainDiv.InnerHtml += tagChildDiv.ToString(TagRenderMode.Normal);

            //Se retorna el mensaje
            return MvcHtmlString.Create(tagMainDiv.ToString(TagRenderMode.Normal));
        }
    }
}


text:
using namespace Gaffer;

namespace GafferBindings
{

void bindChildSet()
{

	boost::python::scope s = IECorePython::RunTimeTypedClass<ChildSet>()
		.def( boost::python::init<GraphComponentPtr>() )
	;

}

} // namespace GafferBindings


text:
(function() {
  var Auction, Collection, StateMachine, auction, events, states;
  var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
    for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor;
    child.__super__ = parent.prototype;
    return child;
  }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __slice = Array.prototype.slice;
  StateMachine = require('./sm').StateMachine;
  Collection = require('./collection').Collection;
  states = {
    start: {
      full_name: 'Waiting for Bidders'
    },
    active: {
      full_name: 'Auction happening now!'
    },
    complete: {
      full_name: 'Auction Finished'
    },
    payment_pending: {
      full_name: 'Waiting for Payment'
    },
    payment_collected: {
      full_name: 'Payment Completed'
    },
    finished: {
      full_name: 'End State'
    }
  };
  events = {
    bidder_joined: {
      transitions: {
        start: 'start',
        active: 'active',
        complete: 'complete',
        payment_pending: 'payment_pending',
        payment_collected: 'payment_collected'
      },
      callback: function(bidder) {
        var p;
        this.bidders.push(bidder);
        this.bidderemit(bidder, 'startup');
        this.bidderemit("newbid", this.current_bid);
        this.broadcast("new bidder! " + bidder.name);
        this.broademit("bidder_joined", {
          bidders: (function() {
            var _i, _len, _ref, _results;
            _ref = this.bidders;
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              p = _ref[_i];
              _results.push(p.id);
            }
            return _results;
          }).call(this)
        });
        return true;
      }
    },
    bidder_left: {
      transitions: {
        start: 'start',
        active: 'active',
        complete: 'complete',
        payment_pending: 'payment_pending',
        payment_collected: 'payment_collected'
      },
      callback: function(bidder) {
        var p;
        this.bidders = (function() {
          var _i, _len, _ref, _results;
          _ref = this.bidders;
          _results = [];
          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            p = _ref[_i];
            if (p !== bidder) {
              _results.push(p);
            }
          }
          return _results;
        }).call(this);
        this.broadcast("bidder left! " + bidder.name);
        this.broademit("bidder_left", {
          bidders: (function() {
            var _i, _len, _ref, _results;
            _ref = this.bidders;
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
              p = _ref[_i];
              _results.push(p.id);
            }
            return _results;
          }).call(this)
        });
        return true;
      }
    },
    start_auction: {
      transitions: {
        start: 'active'
      },
      callback: function() {
        this.broadcast("auction started ");
        return this.broademit("started");
      }
    },
    stop_auction: {
      transitions: {
        active: 'complete'
      },
      callback: function(admin) {
        this.broadcast("auction stopped");
        return this.broademit("stopped");
      }
    },
    auction_over: {
      transitions: {
        active: 'complete'
      },
      callback: function() {
        this.broadcast("auction over. Sold!");
        this.broademit("over", {
          name: this.current_bid.name,
          value: this.current_bid.value
        });
        if (this.current_bidder != null) {
          this.biddercast(this.current_bidder, "You've won and it's now time to pay");
          return this.bidderemit(this.current_bidder, "winner", {
            value: this.current_bid.value,
            auction_name: this.name
          });
        }
      }
    },
    restart_auction: {
      transitions: {
        start: 'active',
        active: 'active',
        complete: 'active',
        payment_pending: 'active',
        payment_collected: 'active',
        active: 'active'
      },
      callback: function(admin) {
        this.broadcast("auction restarted");
        this.broademit("restarted");
        this.bids = [];
        this.current_bidder = null;
        this.current_bid = {
          value: 0,
          name: admin.name,
          image: admin.image
        };
        return this.broademit("newbid", this.current_bid);
      }
    },
    going_auction: {
      transitions: {
        active: 'active'
      },
      callback: function(admin) {
        return this.going1();
      }
    },
    bid: {
      transitions: {
        active: 'active'
      },
      callback: function(bid, bidder) {
        if (this.going != null) {
          clearTimeout(this.going);
          this.going = null;
        }
        bid.name = bidder.name;
        bid.image = bidder.image;
        console.log("auction " + this.item + " got bid " + bid.value + " from " + bidder.name);
        if (!(this.current_bid != null)) {
          console.log("first bid accepted " + bid.value + " from " + bidder.name);
          this.bids.push(bid);
          this.current_bid = bid;
          this.current_bidder = bidder;
          this.broadcast("first bid from " + bidder.name);
          this.biddercast(bidder, "bid accepted");
          this.broademit("newbid", bid);
          this.bidderemit(bidder, "bidstatus", {
            accepted: true
          });
        }
        if (bid.value > this.current_bid.value) {
          console.log("bid accepted");
          this.bids.push(bid);
          this.current_bid = bid;
          this.current_bidder = bidder;
          this.broadcast("new bid from " + bidder.name);
          this.biddercast(bidder, "bid accepted");
          this.broademit("newbid", bid);
          return this.bidderemit(bidder, "bidstatus", {
            accepted: true
          });
        } else {
          console.log("bid rejected");
          this.biddercast(bidder, "sorry, you've been out bid already");
          this.bidderemit(bidder, "bidstatus", {
            accepted: false
          });
          return this.bidderemit(bidder, "newbid", this.current_bid);
        }
      }
    }
  };
  Auction = (function() {
    __extends(Auction, StateMachine);
    function Auction(_arg) {
      this.item = _arg.item, this.description = _arg.description;
      Auction.__super__.constructor.call(this, 'start', states, events);
      this.bidders = [];
      this.current_bid = null;
      this.current_bidder = null;
      this.bids = [];
      this.name = "" + (Math.floor(Math.random() * 1000000000000));
      this.on('moved_state', __bind(function(state_name) {
        return this.broadcast("auction moved to " + state_name);
      }, this));
      this.getState('finished').on('enter', __bind(function() {
        var p, _i, _len, _ref;
        _ref = this.bidders;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          p = _ref[_i];
          p.sm.trigger('auction_over');
        }
        Auction.collection.remove(this.id);
        return Auction.finished_collection.remove(this.id);
      }, this));
    }
    Auction.prototype.bidderemit = function() {
      var args, b, event;
      b = arguments[0], event = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
      console.log.apply(console, ["auction " + this.item + " bidderemit: " + b.name + " " + event].concat(__slice.call(args)));
      return b.emit.apply(b, [event].concat(__slice.call(args)));
    };
    Auction.prototype.biddercast = function(b, message) {
      console.log("auction " + this.item + " biddercast: " + b.name + " " + message);
      b.emit("broadcast", {
        message: message
      });
      return b.send(message);
    };
    Auction.prototype.broademit = function() {
      var args, b, event, _i, _len, _ref, _results;
      event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      console.log.apply(console, ["auction " + this.item + " broademit: " + event].concat(__slice.call(args)));
      _ref = this.bidders;
      _results = [];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        b = _ref[_i];
        _results.push(b.emit.apply(b, [event].concat(__slice.call(args))));
      }
      return _results;
    };
    Auction.prototype.broadcast = function(message) {
      var b, _i, _j, _len, _len2, _ref, _ref2, _results;
      console.log("auction " + this.item + " broadcast: " + message);
      _ref = this.bidders;
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        b = _ref[_i];
        b.emit("broadcast", {
          message: message
        });
      }
      _ref2 = this.bidders;
      _results = [];
      for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
        b = _ref2[_j];
        _results.push(b.send(message));
      }
      return _results;
    };
    Auction.prototype.going1 = function() {
      var a;
      this.broadcast('going once');
      this.broademit('going', {
        left: 3,
        message: 'Going once!'
      });
      a = this;
      return this.going = setTimeout(function() {
        a.broadcast('going twice');
        a.broademit('going', {
          left: 2,
          message: 'Going twice!'
        });
        return a.going = setTimeout(function() {
          a.broadcast('going three times');
          a.broademit('going', {
            left: 1,
            message: 'Going three times...!'
          });
          return a.going = setTimeout(function() {
            a.trigger('auction_over');
            a.broadcast('Sold');
            return a.broademit('going', {
              left: 0,
              message: 'Sold!'
            });
          }, 3500);
        }, 3000);
      }, 2500);
    };
    return Auction;
  })();
  auction = new Auction({
    item: 'Mars Bar',
    description: 'chocolate bar'
  });
  global.live_auction = auction;
  auction.trigger('start_auction');
  (typeof exports !== "undefined" && exports !== null ? exports : window).Auction = Auction;
}).call(this);


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * @author  Peter Boros
 * @date    2004/10/01
 * @version $Id$
 * @file    conceptnet.h
 * @brief   Concept network class definition.
 *
 */

#pragma once

#include <cassert>
#include <stdlib.h>
#include "file.h" // for FileAccessMethod
#include "fsa.h"

namespace fsa {

// {{{ class ConceptNet

/**
 * @class ConceptNet
 * @brief Class for compact representation of a concept network.
 */
class ConceptNet {

public:

  class Handle; // defined in conceptnethandle.h

private:
  static const uint32_t MAGIC = 238579428;    /**< Magic number identifying concept net files. */

  static const FileAccessMethod _default_file_access_method = FILE_ACCESS_MMAP;   /**< Default file access method (read/mmap). */

  /**
   * @struct Header
   * @brief Concept net data file header.
   */
  struct Header {
    uint32_t _magic;             /**< Magic number.                        */
    uint32_t _version;           /**< Version number. (currently not used) */
    uint32_t _checksum;          /**< Checksum. (currently not used)       */
    uint32_t _index_size;        /**< Size of index structure.             */
    uint32_t _info_size;         /**< Size of info structure.              */
    uint32_t _catindex_size;     /**< Size of category index.              */
    uint32_t _strings_size;      /**< Size of string storage.              */
    uint32_t _max_freq;          /**< Reseved for normalization purposes.  */
    uint32_t _max_cfreq;         /**< Reseved for normalization purposes.  */
    uint32_t _max_qfreq;         /**< Reseved for normalization purposes.  */
    uint32_t _max_sfreq;         /**< Reseved for normalization purposes.  */
    uint32_t _max_efreq;         /**< Reseved for normalization purposes.  */
    uint32_t _max_afreq;         /**< Reseved for normalization purposes.  */
    uint32_t _dummy[51];         /**< Reserved.                            */
  };

  /**
   * @struct UnitData
   * @brief Unit data structure.
   */
  struct UnitData {
    uint32_t     _term;          /**< Offset of unit string in string storage.     */
    uint32_t     _frq;           /**< Unit frequency.                              */
    uint32_t     _cfrq;          /**< Frequency of the unit as complete query.     */
    uint32_t     _qfrq;          /**< Frequency of the unit as part of a query.    */
    uint32_t     _sfrq;          /**< Number of queries containing all unit terms. */
    uint32_t     _exts;          /**< If non-zero: offset of extension info in info structure.   */
    uint32_t     _assocs;        /**< If non-zero: offset of association info in info structure. */
    uint32_t     _cats;          /**< If non-zero: offset of category info in info structure.    */
  };

  void         *_mmap_addr;      /**< mmap address, NULL is file has not been mmapped.   */
  size_t        _mmap_length;    /**< mmap length.                                       */

  FSA           _unit_fsa;       /**< %FSA containing the units (with hash).    */
  uint32_t      _index_size;     /**< Size of the index structure.              */
  UnitData     *_index;          /**< Pointer to the index structure in memory. */
  uint32_t      _info_size;      /**< Size of the info structure.               */
  uint32_t     *_info;           /**< Pointer to the info structure in memory.  */
  uint32_t      _catindex_size;  /**< Size of the catergory index.              */
  uint32_t     *_catindex;       /**< Pointer to the category index in memory.  */
  uint32_t      _strings_size;   /**< Size of the string storage.               */
  char         *_strings;        /**< Pointer to the string storage in memory.  */

  bool _ok;                      /**< Flag indicating successful initialization. */

  /**
   * @brief Reset the object.
   *
   * Resets the object to an empty %ConceptNet, and releases allocated memory.
   */
  void reset();

  /**
   * @brief Read the concept net data file from disk.
   *
   * @param datafile Name of the concept net data file.
   * @param fam File access mode (read or mmap). If not set, the
   *            global default access mode will be used.
   * @return True on success.
   */
  bool read(const char *datafile, fsa::FileAccessMethod fam = FILE_ACCESS_UNDEF);

  /**
   * @brief Unimplemented private default constructor.
   */
  ConceptNet();
  /**
   * @brief Unimplemented private copy constructor.
   */
  ConceptNet(const ConceptNet&);
  /**
   * @brief Unimplemented private assignement operator.
   */
  const ConceptNet& operator=(const ConceptNet&);

public:

  /**
   * @brief Constructor.
   *
   * @param fsafile %FSA file containing the units, with a perfect has
   *                (used for indexing the data file).
   * @param datafile Concept net data file.
   * @param fam File access mode (read or mmap). If not set, the
   *            global default access mode will be used.
   */
  ConceptNet(const char *fsafile, const char *datafile=NULL, FileAccessMethod fam = FILE_ACCESS_UNDEF);
  ConceptNet(const std::string &fsafile, const std::string &datafile, FileAccessMethod fam = FILE_ACCESS_UNDEF);

  /**
   * @brief Destructor.
   */
  virtual ~ConceptNet();

  /**
   * @brief Check if initialization was successful.
   *
   * @return True if the initialization of the object succeeded.
   */
  bool isOk() const
  {
    return _ok;
  }

  /**
   * @brief Get the concept net %FSA.
   *
   * Get the concept net %FSA. The object continues to be owned by the
   * concept net.
   *
   * @return The concept net %FSA.
   */
  const FSA& getFSA() const
  {
    assert(_ok);
    return _unit_fsa;
  }

  /**
   * @brief Look up a unit.
   *
   * Look up a unit in the concept net, and get its index.
   *
   * @param unit Unit string.
   * @return Index of the unit, or -1 if not found.
   */
  int lookup(const char *unit) const;

  /**
   * @brief Look up a unit index.
   *
   * Look up a unit index in the concept net, and get the unit string.
   *
   * @param idx Unit index.
   * @return Pointer to the unit string, or NULL if index is out of range.
   */
  const char * lookup(int idx) const;

  /**
   * @brief Get the unit frequency of the unit.
   *
   * @param idx Unit index.
   * @return Unit frequency, or -1 if the index is out of range.
   */
  int frq(int idx) const;

  /**
   * @brief Get the unit frequency of the unit.
   *
   * @param unit Unit string.
   * @return Unit frequency, or -1 if the unit is not found.
   */
  int frq(const char *unit) const;

  /**
   * @brief Get the frequency of the unit as a complete query.
   *
   * @param idx Unit index.
   * @return Unit-C frequency, or -1 if the index is out of range.
   */
  int cFrq(int idx) const;

  /**
   * @brief Get the frequency of the unit as a complete query.
   *
   * @param unit Unit string.
   * @return Unit-C frequency, or -1 if the unit is not found.
   */
  int cFrq(const char *unit) const;

  /**
   * @brief Get the frequency of the unit as part of a query.
   *
   * @param idx Unit index.
   * @return Unit-Q frequency, or -1 if the index is out of range.
   */
  int qFrq(int idx) const;

  /**
   * @brief Get the frequency of the unit as part of a query.
   *
   * @param unit Unit string.
   * @return Unit-Q frequency, or -1 if the unit is not found.
   */
  int qFrq(const char *unit) const;

  /**
   * @brief Get the frequency of queries containing all terms of the unit.
   *
   * @param idx Unit index.
   * @return Unit-S frequency, or -1 if the index is out of range.
   */
  int sFrq(int idx) const;

  /**
   * @brief Get the frequency of queries containing all terms of the unit.
   *
   * @param unit Unit string.
   * @return Unit-Q frequency, or -1 if the unit is not found.
   */
  int sFrq(const char *unit) const;

  /**
   * @brief Get the unit score (100.0*cFrq/qFrq).
   *
   * @param idx Unit index.
   * @return Unit score, or -1.0 if the index is out of range.
   */
  double score(int idx) const;

  /**
   * @brief Get the unit score (100.0*cFrq/qFrq).
   *
   * @param unit Unit string.
   * @return Unit score, or -1. if the unit is not found.
   */
  double score(const char *unit) const;

  /**
   * @brief Get the unit strength (100.0*qFrq/sFrq).
   *
   * @param idx Unit index.
   * @return Unit strength, or -1.0 if the index is out of range.
   */
  double strength(int idx) const;

  /**
   * @brief Get the unit strength (100.0*qFrq/sFrq).
   *
   * @param unit Unit string.
   * @return Unit strength, or -1. if the unit is not found.
   */
  double strength(const char *unit) const;

  /**
   * @brief Get the number of extensions for the unit.
   *
   * @param idx Unit index.
   * @return Number of extensions for the unit, -1 if the index is out
   *         of range.
   */
  int numExt(int idx) const;

  /**
   * @brief Get the number of associations for the unit.
   *
   * @param idx Unit index.
   * @return Number of associations for the unit, -1 if the index is out
   *         of range.
   */
  int numAssoc(int idx) const;

  /**
   * @brief Get the number of categories for the unit.
   *
   * @param idx Unit index.
   * @return Number of categories for the unit, -1 if the index is out
   *         of range.
   */
  int numCat(int idx) const;

  /**
   * @brief Get the index of an extension.
   *
   * @param idx Unit index.
   * @param j Number of the extension (extensions of each unit are
   *          sorted by decreasing weight).
   * @return Extension (unit) index, -1 if idx or j is out
   *         of range.
   */
  int ext(int idx, int j) const;

  /**
   * @brief Get the frequency of an extension.
   *
   * @param idx Unit index.
   * @param j Number of the extension (extensions of each unit are
   *          sorted by decreasing weight).
   * @return Extension frequency, -1 if idx or j is out
   *         of range.
   */
  int extFrq(int idx, int j) const;

  /**
   * @brief Get the index of an association.
   *
   * @param idx Unit index.
   * @param j Number of the association (associations of each unit are
   *          sorted by decreasing weight).
   * @return Association (unit) index, -1 if idx or j is out
   *         of range.
   */
  int assoc(int idx, int j) const;

  /**
   * @brief Get the frequency of an association.
   *
   * @param idx Unit index.
   * @param j Number of the association (associations of each unit are
   *          sorted by decreasing weight).
   * @return Association frequency, -1 if idx or j is out
   *         of range.
   */
  int assocFrq(int idx, int j) const;

  /**
   * @brief Get the index of a category.
   *
   * @param idx Unit index.
   * @param j Number of the category.
   * @return Catergory index, -1 if idx or j is out of range.
   */
  int cat(int idx, int j) const;

  /**
   * @brief Get the name of a category.
   *
   * @param catIdx Category index.
   * @return Catergory name, or NULL if catIdx is out of range.
   */
  const char *catName(int catIdx) const;

};

// }}}

} // namespace fsa


text:
public partial class TestEntity {

    public My.Namespace.EntityIndexComponent myNamespaceEntityIndex { get { return (My.Namespace.EntityIndexComponent)GetComponent(TestComponentsLookup.MyNamespaceEntityIndex); } }
    public bool hasMyNamespaceEntityIndex { get { return HasComponent(TestComponentsLookup.MyNamespaceEntityIndex); } }

    public void AddMyNamespaceEntityIndex(string newValue) {
        var index = TestComponentsLookup.MyNamespaceEntityIndex;
        var component = (My.Namespace.EntityIndexComponent)CreateComponent(index, typeof(My.Namespace.EntityIndexComponent));
        component.value = newValue;
        AddComponent(index, component);
    }

    public void ReplaceMyNamespaceEntityIndex(string newValue) {
        var index = TestComponentsLookup.MyNamespaceEntityIndex;
        var component = (My.Namespace.EntityIndexComponent)CreateComponent(index, typeof(My.Namespace.EntityIndexComponent));
        component.value = newValue;
        ReplaceComponent(index, component);
    }

    public void RemoveMyNamespaceEntityIndex() {
        RemoveComponent(TestComponentsLookup.MyNamespaceEntityIndex);
    }
}

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityApiInterfaceGenerator.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class TestEntity : IMyNamespaceEntityIndexEntity { }

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherApiGenerator.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public sealed partial class TestMatcher {

    static Entitas.IMatcher<TestEntity> _matcherMyNamespaceEntityIndex;

    public static Entitas.IMatcher<TestEntity> MyNamespaceEntityIndex {
        get {
            if (_matcherMyNamespaceEntityIndex == null) {
                var matcher = (Entitas.Matcher<TestEntity>)Entitas.Matcher<TestEntity>.AllOf(TestComponentsLookup.MyNamespaceEntityIndex);
                matcher.componentNames = TestComponentsLookup.componentNames;
                _matcherMyNamespaceEntityIndex = matcher;
            }

            return _matcherMyNamespaceEntityIndex;
        }
    }
}


text:
// Copyright 2016 Circonus, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

'use strict';

/*
This plugin requires node v4.4+ (if the version of node installed is v0.10, use the io.js plugin).

To use this module the user NAD runs as needs privileges to run DTrace.

By default NAD runs as the unprivileged user 'nobody'. The 'nobody' user, by default,
cannot run dtrace.

Adding a line such as the following to /etc/user_attr will add the two privileges
required (dtrace_kernel and file_dac_read) in a default OmniOS install. Different
OSes and/or local security modfications may require different privileges:

nobody::::type=normal;defaultpriv=basic,dtrace_kernel,file_dac_read

Note: if there is already a line for nobody, modify it by adding the additional privileges.

### Configuration ###

To track the syscalls for a specific process. Create a configuration file
/opt/circonus/etc/syscall2.json, for example:
{
  "execname": "node"
}

Will collect syscall metrics only for process(es) where the execname is 'node'.

### enabling the plugin ###

1. Disable NAD:

svcadm disable nad

2. Enable the plugin:

cd /opt/circonus/etc/node-agent.d
ln -s illumous/syscall2.js syscall.js

3. Add additional privileges for nobody if not already done. (see above)

4. Enable NAD:

svcadm enable nad

### disabling the plugin ###

1. Disable NAD:

svcadm disable nad

2. Remove the symlink for the plugin:

cd /opt/circonus/etc/node-agent.d
rm syscall.js

3. Remove the additional privileges for nobody that were added to /etc/user_attr.
   If a line was added, remove it. If an existing line was modified, remove the modifications.

4. Enable NAD:

svcadm enable nad

*/

const path = require('path');
const Dtrace = require('dtrace_aggr2');

const DEFAULT_SAMPLES = 60;
const MILLISECOND = 1000;

let singleton = null;

module.exports = class Syscall {

    /**
     * creates new instance
     */
    constructor() {
        if (singleton !== null) {
            return singleton;
        }

        const cfgName = `${path.basename(__filename, '.js')}.json`; // e.g. syscall2.json
        const cfgFile = path.resolve(path.join(__dirname, '..', '..', cfgName));

        let execName = null;

        try {
            const cfg = require(cfgFile); // eslint-disable-line global-require

            if ({}.hasOwnProperty.call(cfg, 'execname')) {
                execName = cfg.execname;
            }
        } catch (err) {
            console.error(err);
        }

        let script = '';

        if (execName === null) {
            script = 'syscall:::entry{self->start=timestamp;}syscall:::return/self->start/{@l[strjoin(probefunc,"`latency_us")] = llquantize((timestamp-self->start)/1000, 10, 0, 6, 100); self->start = 0;}'; // eslint-disable-line max-len
        } else {
            script = `syscall:::entry/execname=="${execName}"/{self->start=timestamp;}syscall:::return/self->start/{@l[strjoin(strjoin(execname,"\`"),strjoin(probefunc,"\`latency_us"))] = llquantize((timestamp-self->start)/1000, 10, 0, 6, 100); self->start = 0;}`; // eslint-disable-line max-len
        }

        script += 'tick-1sec{printf(">START\\n");printa("=%s%@d\\n", @l);printf(">END\\n");trunc(@l);}';

        this.dtrace = new Dtrace(script);
        this.dtrace.start();

        singleton = this; // eslint-disable-line consistent-this

        return singleton;
    }

    /**
     * called by nad to run the plugin
     * @arg {Object} plugin definition
     * @arg {Function} cb callback
     * @arg {Object} req http request object
     * @arg {Object} args instance arguments
     * @arg {String} instance id
     * @returns {Undefined} nothing
     */
    run(plugin, cb, req, args, instance) { // eslint-disable-line max-params, no-unused-vars
        let samples = DEFAULT_SAMPLES;

        if (req && {}.hasOwnProperty.call(req, 'headers') && {}.hasOwnProperty.call(req.headers, 'x-reconnoiter-period')) {
            samples = Math.floor(req.headers['x-reconnoiter-period'] / MILLISECOND);
        }

        const metrics = this.dtrace.flush(samples);

        plugin.running = false; // eslint-disable-line no-param-reassign
        cb(plugin, metrics, instance);
    }

};


text:
package com.sun.corba.se.spi.orbutil.fsm ;

import com.sun.corba.se.impl.orbutil.fsm.NameBase ;

public abstract class GuardBase extends NameBase implements Guard {
    public GuardBase( String name ) { super( name ) ; }
}


text:
/* Generated By:JJTree: Do not edit this line. ASTThrowStatement.java */

public class ASTThrowStatement extends SimpleNode {
  public ASTThrowStatement(int id) {
    super(id);
  }

  public ASTThrowStatement(JavaParser p, int id) {
    super(p, id);
  }

}


text:
import { FromSchema } from 'json-schema-to-ts';

export const updateTagTypeSchema = {
    $id: '#/components/schemas/updateTagTypeSchema',
    type: 'object',
    properties: {
        description: {
            type: 'string',
        },
        icon: {
            type: 'string',
        },
    },
    components: {},
} as const;

export type UpdateTagTypeSchema = FromSchema<typeof updateTagTypeSchema>;


text:
package org.apache.dubbo.common.extension.support;

import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.common.extension.SPI;

import java.util.Comparator;

/**
 * OrderComparator
 */
public class ActivateComparator implements Comparator<Object> {

    public static final Comparator<Object> COMPARATOR = new ActivateComparator();

    @Override
    public int compare(Object o1, Object o2) {
        if (o1 == null && o2 == null) {
            return 0;
        }
        if (o1 == null) {
            return -1;
        }
        if (o2 == null) {
            return 1;
        }
        if (o1.equals(o2)) {
            return 0;
        }

        // to support com.alibab.dubbo.common.extension.Activate
        String[] a1Before, a2Before, a1After, a2After;
        int a1Order, a2Order;
        Class<?> inf = null;
        if (o1.getClass().getInterfaces().length > 0) {
            inf = o1.getClass().getInterfaces()[0];

            if (inf.getInterfaces().length > 0) {
                inf = inf.getInterfaces()[0];
            }
        }

        Activate a1 = o1.getClass().getAnnotation(Activate.class);
        if (a1 != null) {
            a1Before = a1.before();
            a1After = a1.after();
            a1Order = a1.order();
        } else {
            com.alibaba.dubbo.common.extension.Activate oa1 = o1.getClass().getAnnotation(com.alibaba.dubbo.common.extension.Activate.class);
            a1Before = oa1.before();
            a1After = oa1.after();
            a1Order = oa1.order();
        }
        Activate a2 = o2.getClass().getAnnotation(Activate.class);
        if (a2 != null) {
            a2Before = a2.before();
            a2After = a2.after();
            a2Order = a2.order();
        } else {
            com.alibaba.dubbo.common.extension.Activate oa2 = o2.getClass().getAnnotation(com.alibaba.dubbo.common.extension.Activate.class);
            a2Before = oa2.before();
            a2After = oa2.after();
            a2Order = oa2.order();
        }
        if ((a1Before.length > 0 || a1After.length > 0
                || a2Before.length > 0 || a2After.length > 0)
                && inf != null && inf.isAnnotationPresent(SPI.class)) {
            ExtensionLoader<?> extensionLoader = ExtensionLoader.getExtensionLoader(inf);
            if (a1Before.length > 0 || a1After.length > 0) {
                String n2 = extensionLoader.getExtensionName(o2.getClass());
                for (String before : a1Before) {
                    if (before.equals(n2)) {
                        return -1;
                    }
                }
                for (String after : a1After) {
                    if (after.equals(n2)) {
                        return 1;
                    }
                }
            }
            if (a2Before.length > 0 || a2After.length > 0) {
                String n1 = extensionLoader.getExtensionName(o1.getClass());
                for (String before : a2Before) {
                    if (before.equals(n1)) {
                        return 1;
                    }
                }
                for (String after : a2After) {
                    if (after.equals(n1)) {
                        return -1;
                    }
                }
            }
        }
        int n1 = a1 == null ? 0 : a1Order;
        int n2 = a2 == null ? 0 : a2Order;
        // never return 0 even if n1 equals n2, otherwise, o1 and o2 will override each other in collection like HashSet
        return n1 > n2 ? 1 : -1;
    }

}


text:
<?php

declare(strict_types=1);

namespace Talesweaver\Application\Http\Entity;

use Psr\Http\Message\ServerRequestInterface;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Talesweaver\Application\Bus\QueryBus;
use Talesweaver\Application\Http\ResponseFactoryInterface;
use Talesweaver\Application\Query\Security\AuthorById;
use Talesweaver\Domain\Author;

final class AuthorResolver
{
    /**
     * @var ResponseFactoryInterface
     */
    private $responseFactory;

    /**
     * @var QueryBus
     */
    private $queryBus;

    public function __construct(ResponseFactoryInterface $responseFactory, QueryBus $queryBus)
    {
        $this->responseFactory = $responseFactory;
        $this->queryBus = $queryBus;
    }

    public function fromRequest(ServerRequestInterface $request, string $idAttribute = 'id'): Author
    {
        $id = $this->getId($request, $idAttribute);
        if (null === $id) {
            throw $this->responseFactory->notFound('No author id!');
        }

        $author = $this->queryForAuthor($id);
        if (false === $author instanceof Author) {
            throw $this->responseFactory->notFound("No author for id \"{$id->toString()}\"!");
        }

        return $author;
    }

    private function queryForAuthor(UuidInterface $id): ?Author
    {
        return $this->queryBus->query(new AuthorById($id));
    }

    private function getId(ServerRequestInterface $request, string $idAttribute): ?UuidInterface
    {
        $id = $request->getAttribute($idAttribute);
        if (null === $id) {
            return null;
        }

        return Uuid::fromString($id);
    }
}


text:
package org.light4j.concurrency.chapter2;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public class Counter {
	private AtomicInteger atomicI = new AtomicInteger();

	private int i = 0;

	public static void main(String[] args) {
		final Counter cas = new Counter();
		List<Thread> ts = new ArrayList<>(600);
		long start = System.currentTimeMillis();
		for (int i = 0; i < 100; i++) {
			Thread t = new Thread(new Runnable() {

				@Override
				public void run() {
					cas.safeCount();
					cas.count();
				}
			});
			ts.add(t);
		}

		for (Thread t : ts) {
			t.start();
		}
		// 等待所有线程执行完成
		for (Thread t : ts) {
			try {
				t.join();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		long time = System.currentTimeMillis() - start;
		System.out.println("time:" + time + "s");
	}

	/**
	 * 使用CAS实现线程安全计数器
	 */
	private void safeCount() {
		for (;;) {
			int i = atomicI.get();
			boolean suc = atomicI.compareAndSet(i, i++);
			if (suc) {
				break;
			}
		}
	}

	/**
	 * 非线程安全计数器
	 */
	private void count() {
		i++;
	}
}


text:
<?php

/**
 * @file
 * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUploadInstanceTest.
 */

namespace Drupal\migrate_drupal\Tests\d6;

use Drupal\field\Entity\FieldConfig;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;

/**
 * Upload field instance migration.
 *
 * @group migrate_drupal
 */
class MigrateUploadInstanceTest extends MigrateDrupal6TestBase {

  /**
   * The modules to be enabled during the test.
   *
   * @var array
   */
  static $modules = array('file', 'node');

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    // Add some node mappings to get past checkRequirements().
    $id_mappings = array(
      'd6_upload_field' => array(
        array(array(1), array('node', 'upload')),
      ),
      'd6_node_type' => array(
        array(array('page'), array('page')),
        array(array('story'), array('story')),
      ),
    );
    $this->prepareMigrations($id_mappings);

    foreach (array('page', 'story') as $type) {
      entity_create('node_type', array('type' => $type))->save();
    }
    entity_create('field_storage_config', array(
      'entity_type' => 'node',
      'field_name' => 'upload',
      'type' => 'file',
      'translatable' => '0',
    ))->save();

    $migration = entity_load('migration', 'd6_upload_field_instance');
    $dumps = array(
      $this->getDumpDirectory() . '/NodeType.php',
      $this->getDumpDirectory() . '/Variable.php',
    );
    $this->prepare($migration, $dumps);
    $executable = new MigrateExecutable($migration, $this);
    $executable->import();
  }

  /**
   * Tests the Drupal 6 upload settings to Drupal 8 field instance migration.
   */
  public function testUploadFieldInstance() {
    $field = FieldConfig::load('node.page.upload');
    $settings = $field->getSettings();
    $this->assertIdentical('node.page.upload', $field->id());
    $this->assertIdentical('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp', $settings['file_extensions']);
    $this->assertIdentical('1MB', $settings['max_filesize']);
    $this->assertIdentical(TRUE, $settings['description_field']);

    $field = FieldConfig::load('node.story.upload');
    $this->assertIdentical('node.story.upload', $field->id());

    // Shouldn't exist.
    $field = FieldConfig::load('node.article.upload');
    $this->assertTrue(is_null($field));

    $this->assertIdentical(array('node', 'page', 'upload'), entity_load('migration', 'd6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page')));
  }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta property="og:url"                content="https://ballerinalang.org" />
  <meta property="og:type"               content="article" />
  <meta property="og:title"              content="Flexible. Powerful. Beautiful." />
  <meta property="og:description"        content="Ballerina by Example is a hands-on introduction to Ballerina using annotated example programs. Check out the first example or browse the full list below. " />
  <meta property="og:image"              content="http://ballerinalang.org/img/ballerina-fb.jpg" />
    <link rel="shortcut icon" href="https://ballerinalang.org/img/favicon.ico" type="image/x-icon">
  <link rel="icon" href="https://ballerinalang.org/img/favicon.ico" type="image/x-icon">
    <title>Ballerina by Example: HTTPS Server/Client Connectors</title>

     <link href="https://b.content.wso2.com/sites/all/bootstrap/css/bootstrap.css?230617" rel="stylesheet">

    <link rel=stylesheet href="site.css">
    <link href="https://fonts.googleapis.com/css?family=Cairo:200,300,400,600,700,900" rel="stylesheet">
    <link rel=stylesheet href="https://b.content.wso2.com/sites/all/ballerina/ballerina-example.css">

import ballerina.net.http;@http:configuration {
    basePath:"/hello",
    httpsPort:9095,
    keyStoreFile:"${ballerina.home}/bre/security/ballerinaKeystore.p12",
    keyStorePassword:"ballerina",
    certPassword:"ballerina"
}service<http> helloWorld {
    @http:resourceConfig {
        methods:["GET"],
        path:"/"
    }    resource sayHello (http:Request req, http:Response res) {
        res.setStringPayload("Successful");
        _ = res.send();
    }
}
function main (string[] args) {
    endpoint<http:HttpClient> httpEndpoint {
        create http:HttpClient("https://localhost:9095", getConnectorConfigs());
    }
    http:Request req = {};
    http:Response resp = {};
    resp, _ = httpEndpoint.get("/hello/", req);
    println("Response code: " + resp.getStatusCode());
    println("Response: " + resp.getStringPayload());
}function getConnectorConfigs() (http:Options) {
    http:Options option = {
          ssl: {
                 trustStoreFile:"${ballerina.home}/bre/security/ballerinaTruststore.p12",
                 trustStorePassword:"ballerina"
               },
          followRedirects: {}
    };
    return option;
}

Ballerina by Example: HTTPS Server/Client Connectors

This example demonstrates how ballerina https client connector can be configured to connect to a https server through 1-way ssl connection (server is verified by the client). This example uses ballerina https server connector to host a service and https client connector will be sending requests for that server.

import ballerina.net.http;

@http:configuration {
    basePath:"/hello",
    httpsPort:9095,
    keyStoreFile:"${ballerina.home}/bre/security/ballerinaKeystore.p12",
    keyStorePassword:"ballerina",
    certPassword:"ballerina"
}

service<http> helloWorld {
    @http:resourceConfig {
        methods:["GET"],
        path:"/"
    }

    resource sayHello (http:Request req, http:Response res) {
        res.setStringPayload("Successful");
        _ = res.send();
    }
}

Ballerina client connector can be used to connect to the created https server. You have to run the service before running this main function. As this is a 1-way ssl connection, client needs to provide trustStoreFile and trustStorePassword.

function main (string[] args) {
    endpoint<http:HttpClient> httpEndpoint {
        create http:HttpClient("https://localhost:9095", getConnectorConfigs());
    }

Creates a request.

    http:Request req = {};
    http:Response resp = {};
    resp, _ = httpEndpoint.get("/hello/", req);
    println("Response code: " + resp.getStatusCode());
    println("Response: " + resp.getStringPayload());
}

function getConnectorConfigs() (http:Options) {
    http:Options option = {
          ssl: {
                 trustStoreFile:"${ballerina.home}/bre/security/ballerinaTruststore.p12",
                 trustStorePassword:"ballerina"
               },
          followRedirects: {}
    };
    return option;
}

Run the service

$ ballerina run https-server-client-connectors.bal -s
ballerina: deploying service(s) in 'https-server-client-connectors.bal'
ballerina: started HTTPS/WSS server connector http-9095

Run the main function containing ballerina client

$ ballerina run https-server-client-connectors.bal
Response code: 200
Response: Successful

                          Next example: HTTP to WebSocket Upgrade.

                          by @ballerinalang | feedback | source

                          This site was generated using a tool developed by @mmcgrana, licensed under CC BY / modified from original


text:
Chats

                CHAT

                                    {{message.username}} {{message.date}}

                                    {{message.content}}

                    <input type="text" placeholder="Enter Message" class="form-control" data-ng-model="message">

                                        <button type="button" class="btn btn-info" ng-click="sendMessage(message)">SEND</button>


text:
package org.gradle.launcher.daemon.protocol;

import java.io.Serializable;

/**
 * A message sent between daemon client and daemon server.
 */
public class Message implements Serializable {
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>Corona Docs: Plugins > together > togetherusergame</title>
  <meta name="revised" content="14-Nov-2013" />
  <meta name="description" content="Whether you're new to Corona or want to take your app to the next level, we've got a wealth of resources for you including extensive documentation, API reference, sample code, and videos.  Plugins > together > togetherusergame" />
  <link rel="stylesheet" href="../../css/style.css" type="text/css" />

SDK APIs

Enterprise APIs

Plugins

Guides

Tutorials

Corona Resources ▹

  <form action="http://www.google.com/cse" id="cse-search-box">
  <input type="hidden" name="cx" value="009283852522218786394:g40gqt2m6rq" />
  <input type="hidden" name="ie" value="UTF-8" />
  <input type="text" name="q" id="q" autocomplete="off" size="40" style="width:150px;float:left" />
  <input type="submit" name="sa" value="Search" style="float:right; font-size: 13px;" />
  </form>

together.TogetherUserGame

Overview

Members

number GameID

string Name

string Description

Ξ  ▸  Plugins  ▸  together  ▸  togetherusergame

together.TogetherUserGame

Type
[class][api.type.class]

Library
together.*

Revision
Current Public Version

Keywords
TogetherUserGame

Sample code
github samples

Overview

The UserGame class represents a game played by a User.

Members

number GameID

The ID of the Game the User has played.

string Name

The Name of the Game the User has played.

string Description

A textual description for the Game the User has played.

© 2013 Corona Labs Inc. All Rights Reserved. (Last updated: 14-Nov-2013)

Help us help you! Give us feedback on this page:

Love it

Like it, but...

Hate it


text:
<!DOCTYPE html>

	<title>Header/Footer with menu/toolbar/ribbon/status</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../../codebase/dhtmlx.css"/>

Hi! I'm header!

Hi! I'm copyright ©!

			<input type="button" value="attach header" onclick="attachHeader();">
			<input type="button" value="detach header" onclick="detachHeader();">

			<input type="button" value="attach footer" onclick="attachFooter();">
			<input type="button" value="detach footer" onclick="detachFooter();">

				<input type="button" value="attach menu" onclick="attachMenu();">
				<input type="button" value="detach menu" onclick="detachMenu();">

				<input type="button" value="attach toolbar" onclick="attachToolbar();">
				<input type="button" value="detach toolbar" onclick="detachToolbar();">

				<input type="button" value="attach ribbon" onclick="attachRibbon();">
				<input type="button" value="detach ribbon" onclick="detachRibbon();">

				<input type="button" value="attach status bar" onclick="attachStatusBar();">
				<input type="button" value="detach status bar" onclick="detachStatusBar();">


text:
lychee.define('game.webserver.mod.Redirect').requires([
	'game.webserver.Template'
]).exports(function(lychee, game, global, attachments) {

	var Class = function(webserver) {

	};

	Class.prototype = {

		/*
		 * PUBLIC API
		 */

		execute: function(host, url, callback) {

			var target = url;

			// Assume it's a local redirect
			if (url.charAt(0) === '/') {
				target = url.substr(host.root.length);
			}

			callback({
				status: 301,
				header: {
					'Location': target
				},
				body: ''
			});

		}

	};

	return Class;

});


text:
<?php

namespace App\Http\Middleware;

use Closure;
use App\LoginModule\Platform\PlatformContext;
use Illuminate\Support\Facades\Auth;

class AutoAuthorization
{

    private $context;

    public function __construct(PlatformContext $context) {
        $this->context = $context;
    }
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if($client = $this->context->client()) {
            $pms_active = (bool) Auth::guard($guard)->user()->authConnections()->where('provider', 'pms')->where('active', '1')->first();
            $generated_account = Auth::guard($guard)->user()->creator_client_id == $client->id;
            if(($client->autoapprove_authorization && $pms_active) || $generated_account) {
                $url = str_replace('/oauth/authorize?', '/oauth/auto_authorize?', $request->fullUrl());
                return redirect($url);
            }
        }
        return $next($request);
    }

}


text:
/**
 * Helpers to publish packages using the npm CLI.
 *
 * @module utils/npm-publish
 */

/** (Placeholder comment, see TypeStrong/typedoc#603) */

import { Furi } from "furi";
import { execFile } from "./node-async";

export interface NpmPublishOptions {
  /**
   * Directory to the package to publish.
   *
   * It must contain a `package.json` file.
   */
  directory: Furi;

  /**
   * Tag to use for this publication.
   *
   * Default: `"latest"`.
   */
  tag?: string;

  /**
   * Path to the npm or Yarn command-line program.
   *
   * Default: `"npm"` (assumes that `npm` is in the `$PATH`)
   */
  command?: string;
}

export interface ResolvedNpmPublishOptions extends NpmPublishOptions {
  /**
   * Directory to publish.
   */
  directory: Furi;

  /**
   * Tag to use for this publication.
   */
  tag: string;

  /**
   * Path to the npm command-line program.
   */
  command: string;
}

/**
 * Fully resolves the provided options for [[npmPublish]].
 *
 * It applies default values to ensure that the options are complete.
 *
 * @param options Base options to resolve.
 * @return Resolved options.
 */
function resolveNpmPublishOptions(options: NpmPublishOptions): ResolvedNpmPublishOptions {
  const tag: string = options.tag !== undefined ? options.tag : "latest";
  const command: string = options.command !== undefined ? options.command : "npm";
  return {directory: options.directory, tag, command};
}

/**
 * Publishes a package to the npm registry.
 *
 * @param options Publication options.
 * @return Promise resolved once the package is published.
 */
export async function npmPublish(options: NpmPublishOptions): Promise<void> {
  const resolved: ResolvedNpmPublishOptions = resolveNpmPublishOptions(options);
  const args: string[] = ["--tag", resolved.tag];
  await execFile(resolved.command, ["publish", ...args], {cwd: resolved.directory.toSysPath()});
}


text:
    <title>用户-学员每次学习详细</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta http-equiv="imagetoolbar" content="no"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <link rel="apple-touch-icon" href="data/apple-touch-icon.png" />
    <link rel="apple-touch-startup-image" href="data/startup-iphone.png" media="screen and (max-device-width: 320px)"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet">
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet">
    <link href="用户-学员每次学习详细_files/axurerp_pagespecificstyles.css" type="text/css" rel="stylesheet">

学习情况详细页面

学习时间

课程

是否答对

2013-07-09  22:20:19

2

23

卡片集

HELLO

返回

用户管理

单词卡片

交互说明:

1.  此页面展示的是每次学习单词的答对与否的详细情况,

2013-07-09  22:20:19

2

23

hey

2013-07-09  22:20:19

2

23

we


text:
In x64_tracers.cc:

Enable tracing:
```
#define ITRACE 1  <--- for only ppc instructions
#define DTRACE 1  <--- add HIR data
```

If tracing data, run with the following flags:
```
--store_all_context_values
```

By default, tracing will start at the beginning and only for the specified
thread.

Change traced thread by thread creation ID:
```
#define TARGET_THREAD 4
```

To only trace at a certain point, change default trace flag to false:
```
bool trace_enabled = true;
```
Add a breakpoint:
```
--break_on_instruction=0x821009A4
```
On break, add the following to the Watch window and set it to true:
```
xe::cpu::backend::x64::trace_enabled
```
Continue, and watch stuff appear in the log.


text:
/*!

  A quick guide to the basics of the RTP decoder implementation

  This module contains the RTP packetization, de-packetization, and the
  handling of Parameter Sets, see VCEG-N52 and accompanying documents.
  Note: Compound packets are not yet implemented!

  The interface between every NAL (including the RTP NAL) and the VCL is
  based on Slices.  The slice data structure on which the VCL is working
  is defined in the type Slice (in defines.h).  This type contains the
  various fields of the slice header and a partition array, which itself
  contains the data partitions the slice consists of.  When data
  partitioning is not used, then the whole slice bit string is stored
  in partition #0.  When individual partitions are missing, this is
  indicated by the size of the bit strings in the partition array.
  A complete missing slice (e.g. if a Full Slice packet was lost) is
  indicated in a similar way.

  part of the slice structure is the error indication (ei-flag).  The
  Ei-flag is set in such cases in which at least one partition of a slice
  is damaged or missing.When data partitioning is used, it can happen that
  one partition does not contain any symbols but the ei_flag is cleared,
  which indicates the intentional missing of symbols of that partition.
  A typical example for this behaviour is the Intra Slice, which does not
  have symnbols in its type C partition.

  The VCL requests new data to work on through the call of readSliceRTP().
  This function calls the main state machine of this module in ReadRTPpaacket().

  ReadRTPpacket assumes, when called, that in an error free environment
  a complete slice, consisting of one Full Slice RTP packet, or three Partition
  packets of types A, B, C with consecutive sequence numbers, can be read.
  It first interprets any trailing SUPP and Parameter Update (Header) packets.
  Then it reads one video data packet.  Two cases have to be distinguished:

  1. Type A, or Full Slice packet
  In this case, the PictureID and the macroblock mumbers are used to
  identify the potential loss of a slice.  A slice is lost, when the
  StartMB of the newly read slice header is not equal to the current
  state of the decoder
    1.1 Loss detected
      In this case the last packet is unread (fseek back), and a dummy slice
      containing the missing macroblocks is conveyed to the VCL.  At the next
      call of the NAL, the same packet is read again, but this time no packet
      loss is detected by the above algorithm,
    1.2. No loss
      In this case it is checked whether a Full Slice packet or a type A data
      partition was read
        1.2.1 Full Slice
          The Full Slice packet is conveyed to the NAL
        1.2.2 Type A Partition
          The function RTPReadDataPartitionedSlice() is called, which collects
          the remaining type B, C partitions and handles them appropriately.

  Paraneter Update Packets (aka Header packets) are in an SDP-like syntax
  and are interpreted by a simple parser in the function
  RTPInterpretParameterSetPacket()

  Each Slice header contaions the information on which parameter set to be used.
  The function RTPSetImgInp() copies the information of the relevant parameter
  set in the VCL's global variables img-> and inp->  IMPORTANT: any changes
  in the semantics of the img-> and inp-> structure members must be represented
  in this function as well!

  A note to the stream-buffer data structure: The stream buffer always contains
  only the contents of the partition in question, and not the slice/partition
  header.  Decoding has to start at bitoffset 0 (UVLC) or bytreoffset 0 (CABAC).

  The remaining functions should be self-explanatory.

*/

#include "contributors.h"

#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

#include "global.h"
#include "errorconcealment.h"
#include "rtp.h"
#include "fmo.h"
#include "sei.h"
#include "memalloc.h"

#ifdef WIN32
#include <Winsock2.h>
#else
#include <netinet/in.h>
#endif

FILE *bits;

int RTPReadPacket (RTPpacket_t *p, FILE *bits);

/*!
 ************************************************************************
 * \brief
 *    Opens the bit stream file named fn
 * \return
 *    none
 ************************************************************************
 */
void OpenRTPFile (char *fn)
{
  if (NULL == (bits=fopen(fn, "rb")))
  {
    snprintf (errortext, ET_SIZE, "Cannot open RTP file '%s'", input->infile);
    error(errortext,500);
  }
}

/*!
 ************************************************************************
 * \brief
 *    Closes the bit stream file
 ************************************************************************
 */
void CloseRTPFile()
{
  fclose (bits);
}

/*!
 ************************************************************************
 * \brief
 *    Fills nalu->buf and nalu->len with the payload of an RTP packet.
 *    Other fields in nalu-> remain uninitialized (will be taken care of
 *    by NALUtoRBSP.
 *
 * \return
 *     4 in case of ok (for compatibility with GetAnnexbNALU)
 *     0 if there is nothing any more to read (EOF)
 *    -1 in case of any error
 *
 ************************************************************************
 */

int GetRTPNALU (NALU_t *nalu)
{
  RTPpacket_t *p;
  int ret;

  if ((p=malloc (sizeof (RTPpacket_t)))== NULL)
    no_mem_exit ("GetRTPNALU-1");
  if ((p->packet=malloc (MAXRTPPACKETSIZE))== NULL)
    no_mem_exit ("GetRTPNALU-2");
  if ((p->payload=malloc (MAXRTPPACKETSIZE))== NULL)
    no_mem_exit ("GetRTPNALU-3");

  ret = RTPReadPacket (p, bits);
  nalu->forbidden_bit = 1;
  nalu->len = 0;

  if (ret < 0)
    return -1;
  if (ret == 0)
    return 0;

  assert (p->paylen < nalu->max_size);

  nalu->len = p->paylen;
  memcpy (nalu->buf, p->payload, p->paylen);
  nalu->forbidden_bit = (nalu->buf[0]>>7) & 1;
  nalu->nal_reference_idc = (nalu->buf[0]>>5) & 3;
  nalu->nal_unit_type = (nalu->buf[0]) & 0x1f;

  free (p->payload);
  free (p->packet);
  free (p);
//  printf ("Got an RTP NALU, len %d, first byte %x\n", nalu->len, nalu->buf[0]);
  return nalu->len;
}

/*!
 *****************************************************************************
 *
 * \brief
 *    DecomposeRTPpacket interprets the RTP packet and writes the various
 *    structure members of the RTPpacket_t structure
 *
 * \return
 *    0 in case of success
 *    negative error code in case of failure
 *
 * \param p
 *    Caller is responsible to allocate enough memory for the generated payload
 *    in parameter->payload. Typically a malloc of paclen-12 bytes is sufficient
 *
 * \par Side effects
 *    none
 *
 * \date
 *    30 Spetember 2001
 *
 * \author
 *    Stephan Wenger   stewe@cs.tu-berlin.de
 *****************************************************************************/

int DecomposeRTPpacket (RTPpacket_t *p)

{
  // consistency check
  assert (p->packlen < 65536 - 28);  // IP, UDP headers
  assert (p->packlen >= 12);         // at least a complete RTP header
  assert (p->payload != NULL);
  assert (p->packet != NULL);

  // Extract header information

  p->v  = (p->packet[0] >> 6) & 0x03;
  p->p  = (p->packet[0] >> 5) & 0x01;
  p->x  = (p->packet[0] >> 4) & 0x01;
  p->cc = (p->packet[0] >> 0) & 0x0F;

  p->m  = (p->packet[1] >> 7) & 0x01;
  p->pt = (p->packet[1] >> 0) & 0x7F;

  memcpy (&p->seq, &p->packet[2], 2);
  p->seq = ntohs((unsigned short)p->seq);

  memcpy (&p->timestamp, &p->packet[4], 4);// change to shifts for unified byte sex
  p->timestamp = ntohl(p->timestamp);
  memcpy (&p->ssrc, &p->packet[8], 4);// change to shifts for unified byte sex
  p->ssrc = ntohl(p->ssrc);

  // header consistency checks
  if (     (p->v != 2)
        || (p->p != 0)
        || (p->x != 0)
        || (p->cc != 0) )
  {
    printf ("DecomposeRTPpacket, RTP header consistency problem, header follows\n");
    DumpRTPHeader (p);
    return -1;
  }
  p->paylen = p->packlen-12;
  memcpy (p->payload, &p->packet[12], p->paylen);
  return 0;
}

/*!
 *****************************************************************************
 *
 * \brief
 *    DumpRTPHeader is a debug tool that dumps a human-readable interpretation
 *    of the RTP header
 *
 * \return
 *    n.a.
 * \param p
 *    the RTP packet to be dumped, after DecompositeRTPpacket()
 *
 * \par Side effects
 *    Debug output to stdout
 *
 * \date
 *    30 Spetember 2001
 *
 * \author
 *    Stephan Wenger   stewe@cs.tu-berlin.de
 *****************************************************************************/

void DumpRTPHeader (RTPpacket_t *p)

{
  int i;
  for (i=0; i< 30; i++)
    printf ("%02x ", p->packet[i]);
  printf ("Version (V): %d\n", p->v);
  printf ("Padding (P): %d\n", p->p);
  printf ("Extension (X): %d\n", p->x);
  printf ("CSRC count (CC): %d\n", p->cc);
  printf ("Marker bit (M): %d\n", p->m);
  printf ("Payload Type (PT): %d\n", p->pt);
  printf ("Sequence Number: %d\n", p->seq);
  printf ("Timestamp: %d\n", p->timestamp);
  printf ("SSRC: %d\n", p->ssrc);
}

/*!
 *****************************************************************************
 *
 * \brief
 *    RTPReadPacket reads one packet from file
 *
 * \return
 *    0: EOF
 *    negative: error
 *    positive: size of RTP packet in bytes
 *
 * \param p
 *    packet data structure, with memory for p->packet allocated
 *
 * \param bits
 *    target file
 *
 * \par Side effects:
 *   - File pointer in bits moved
 *   - p->xxx filled by reading and Decomposepacket()
 *
 * \date
 *    04 November, 2001
 *
 * \author
 *    Stephan Wenger, stewe@cs.tu-berlin.de
 *****************************************************************************/

int RTPReadPacket (RTPpacket_t *p, FILE *bits)
{
  int Filepos, intime;

  assert (p != NULL);
  assert (p->packet != NULL);
  assert (p->payload != NULL);

  Filepos = ftell (bits);
  if (4 != fread (&p->packlen,1, 4, bits))
    {
      return 0;
    }

  if (4 != fread (&intime, 1, 4, bits))
    {
      fseek (bits, Filepos, SEEK_SET);
      printf ("RTPReadPacket: File corruption, could not read Timestamp, exit\n");
      exit (-1);
    }

  assert (p->packlen < MAXRTPPACKETSIZE);

  if (p->packlen != fread (p->packet, 1, p->packlen, bits))
    {
      printf ("RTPReadPacket: File corruption, could not read %d bytes\n", p->packlen);
      exit (-1);    // EOF inidication
    }

  if (DecomposeRTPpacket (p) < 0)
    {
      // this should never happen, hence exit() is ok.  We probably do not want to attempt
      // to decode a packet that obviously wasn't generated by RTP
      printf ("Errors reported by DecomposePacket(), exit\n");
      exit (-700);
    }
    assert (p->pt == H264PAYLOADTYPE);
    assert (p->ssrc == H264SSRC);
  return p->packlen;
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('UserManagement', '0009_auto_20170303_1756'),
    ]

    operations = [
        migrations.AlterField(
            model_name='profile',
            name='blog',
            field=models.URLField(blank=True, null=True, verbose_name='Website'),
        ),
        migrations.AlterField(
            model_name='profile',
            name='facebook',
            field=models.URLField(blank=True, null=True, verbose_name='Facebook Account'),
        ),
        migrations.AlterField(
            model_name='profile',
            name='linkedin',
            field=models.URLField(blank=True, null=True, verbose_name='LinkedIn Account'),
        ),
        migrations.AlterField(
            model_name='profile',
            name='twitter',
            field=models.URLField(blank=True, null=True, verbose_name='Twitter Account'),
        ),
    ]


text:
<!DOCTYPE HTML>
<html>
<head>
<style>
body::first-letter { color:white; }
</style>
</head>
<!-- Check that a pre-line newline stops first-letter processing -->
<body style="white-space:pre-line; color:black;">
Hello
</body>
</html>


text:
php-fanout
============

Author: Konstantin Bokarius <kon@fanout.io>

A PHP convenience library for publishing messages to Fanout.io using the EPCP protocol.

License
-------

php-fanout is offered under the MIT license. See the LICENSE file.

Requirements
------------

* openssl
* curl
* pthreads (required for asynchronous publishing)
* firebase/php-jwt >=1.0.0 (retreived automatically via Composer)
* fanout/php-pubcontrol >=1.0.6 (retreived automatically via Composer)

Installation
------------

Using Composer: 'composer require fanout/fanout'

Manual: ensure that php-jwt and php-pubcontrol have been included and require the following files in php-fanout:

```PHP
require 'php-fanout/src/jsonobjectformat.php';
require 'php-fanout/src/fanout.php';
```

Asynchronous Publishing
-----------------------

In order to make asynchronous publish calls pthreads must be installed. If pthreads is not installed then only synchronous publish calls can be made. To install pthreads recompile PHP with the following flag: '--enable-maintainer-zts'

Also note that since a callback passed to the publish_async methods is going to be executed in a separate thread, that callback and the class it belongs to are subject to the rules and limitations imposed by the pthreads extension.

See more information about pthreads here: http://php.net/manual/en/book.pthreads.php

Usage
------------

```PHP
<?php

$fanout = new Fanout\Fanout('<realm>', '<realmkey>');
$fanout->publish('<channel>', 'Test publish!');

// Use publish_async for async publishing only if pthreads are installed:
// $fanout->publish_async('<channel>', 'Test async publish!', null, null,
//         'callback');
?>
```


text:
import { DOM, window, define, bootstrap, render, BaseComponent } from '@chialab/dna/compat';
import { getComponentName } from '../../test/helpers.js';

describe('Compat', () => {
    let wrapper, TestComponent1, TestComponent2, name1, name2;

    describe('Library', () => {
        before(() => {
            DOM.lifeCycle(true);
            name1 = getComponentName();
            name2 = getComponentName();
            wrapper = DOM.createElement('div');
            wrapper.ownerDocument.body.appendChild(wrapper);

            TestComponent1 = class TestComponent1 extends BaseComponent {
                static get observedAttributes() {
                    return ['age'];
                }

                constructor(node) {
                    super(node);
                    this.name = 'Alan';
                    this.lastName = 'Turing';
                    this.connectedTimes = 0;
                    this.disconnectedTimes = 0;
                    this.attributeChanges = 0;
                }

                connectedCallback() {
                    super.connectedCallback();
                    this.connectedTimes++;
                }

                disconnectedCallback() {
                    super.disconnectedCallback();
                    this.disconnectedTimes++;
                }

                attributeChangedCallback(...args) {
                    super.attributeChangedCallback(...args);
                    this.attributeChanges++;
                }
            };
            TestComponent2 = class TestComponent2 extends BaseComponent {
                static get observedAttributes() {
                    return ['age'];
                }

                constructor(node) {
                    super(node);
                    this.name = 'Alan';
                    this.lastName = 'Turing';
                    this.connectedTimes = 0;
                    this.disconnectedTimes = 0;
                    this.attributeChanges = 0;
                }

                connectedCallback() {
                    super.connectedCallback();
                    this.connectedTimes++;
                }

                disconnectedCallback() {
                    super.disconnectedCallback();
                    this.disconnectedTimes++;
                }

                attributeChangedCallback(...args) {
                    super.attributeChangedCallback(...args);
                    this.attributeChanges++;
                }
            };

            define(name1, TestComponent1);
            define(name2, TestComponent2, { extends: 'button' });
        });

        describe('define', () => {
            describe('a simple element', () => {
                it('should define a custom element', () => {
                    const elem = new TestComponent1();
                    assert.equal(elem.node.tagName.toLowerCase(), name1);
                    assert.equal(elem.name, 'Alan');
                    assert.equal(elem.lastName, 'Turing');
                });
            });

            describe('an element with extends field', () => {
                it('a custom element with extends field', () => {
                    const elem = render(wrapper, TestComponent2);
                    assert.equal(elem.node.localName, 'button');
                    assert.equal(elem.name, 'Alan');
                    assert.equal(elem.lastName, 'Turing');
                });
            });
        });

        describe('DOM helpers', () => {
            let elem1, elem2;
            before(() => {
                elem1 = new TestComponent1();
                elem2 = render(wrapper, TestComponent2);
            });

            it('should do nothing', () => {
                const tmp = document.createElement('div');
                assert(!DOM.connect(tmp));
                assert(!DOM.disconnect(tmp));
            });

            it('should create a component instance', () => {
                assert.equal(elem1.node.tagName.toLowerCase(), name1);
                assert.equal(elem1.name, 'Alan');
                assert.equal(elem1.lastName, 'Turing');
            });

            it('should append a component', () => {
                DOM.appendChild(wrapper, elem1);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem1.disconnectedTimes, 0);
                assert.equal(elem1.connectedTimes, 1);
                assert.equal(elem2.disconnectedTimes, 0);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should append a component before another', () => {
                DOM.insertBefore(wrapper, elem1, elem2);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem2.node.parentNode, wrapper);
                assert.equal(elem1.node.nextSibling, elem2.node);
                assert.equal(elem1.disconnectedTimes, 1);
                assert.equal(elem1.connectedTimes, 2);
                assert.equal(elem2.disconnectedTimes, 0);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should do nothing if already before another', () => {
                DOM.insertBefore(wrapper, elem1, elem2);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem2.node.parentNode, wrapper);
                assert.equal(elem1.node.nextSibling, elem2.node);
                assert.equal(elem1.disconnectedTimes, 2);
                assert.equal(elem1.connectedTimes, 3);
                assert.equal(elem2.disconnectedTimes, 0);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should append again a component', () => {
                DOM.appendChild(wrapper, elem1);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem1.disconnectedTimes, 3);
                assert.equal(elem1.connectedTimes, 4);
                assert.equal(elem2.disconnectedTimes, 0);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should do nothing if already last child of parent', () => {
                DOM.appendChild(wrapper, elem1);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem1.disconnectedTimes, 4);
                assert.equal(elem1.connectedTimes, 5);
                assert.equal(elem2.disconnectedTimes, 0);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should replace a child', () => {
                DOM.replaceChild(wrapper, elem1, elem2);
                assert.equal(elem1.node.parentNode, wrapper);
                assert.equal(elem1.disconnectedTimes, 5);
                assert.equal(elem1.connectedTimes, 6);
                assert.equal(elem2.disconnectedTimes, 1);
                assert.equal(elem2.connectedTimes, 1);
            });

            it('should set attributes', () => {
                DOM.setAttribute(elem1, 'age', 20);
                DOM.setAttribute(elem1, 'married', '');
                assert.equal(elem1.attributeChanges, 1);
                assert.equal(elem1.node.getAttribute('age'), '20');
                assert.equal(elem1.node.getAttribute('married'), '');
            });

            it('should remove attributes', () => {
                DOM.removeAttribute(elem1, 'age');
                DOM.removeAttribute(elem1, 'married');
                assert.equal(elem1.attributeChanges, 2);
                assert.equal(elem1.node.getAttribute('age'), null);
                assert.equal(elem1.node.getAttribute('married'), null);
            });
        });

        describe('bootstrap', () => {
            let wrapper, wrapper2;
            before(() => {
                wrapper = DOM.createElement('div');
                wrapper.innerHTML = `<p>Hello <${name1} age="21"></${name1}></p>`;
                wrapper2 = DOM.createElement('div');
                wrapper2.innerHTML = `<p>Hello again <${name1} age="21"></${name1}><${name1} age="22"></${name1}></p>`;
                DOM.appendChild(window.document.body, wrapper);
                DOM.appendChild(window.document.body, wrapper2);
            });

            it('should instantiate all components', () => {
                bootstrap(wrapper);
                const elem = DOM.getNodeComponent(
                    wrapper.querySelector(`.${name1}`)
                );
                assert.equal(elem.node.localName, name1);
                assert.equal(elem.node.getAttribute('age'), '21');
                assert.equal(elem.node.getAttribute('class'), name1);
                assert.equal(elem.name, 'Alan');
                assert.equal(elem.lastName, 'Turing');
            });

            it('should call callback for every component', () => {
                let count = 0;
                bootstrap(wrapper2, () => {
                    count++;
                });
                assert.equal(count, 2);
            });

            after(() => {
                DOM.removeChild(window.document.body, wrapper);
                DOM.removeChild(window.document.body, wrapper2);
            });
        });
    });
});