text:
var Profile = {
	avatar: function (user, height) {
	    return '';
	},

	customAvatar: function (user, height) {
	    return '
';
	},

	name: function (user) {
	    return '' + user.name + '';
	},

	unregisteredName: function (user) {
	    return '' + user.name + ' (Unregistered)
';
	},

	rank: function (user) {
		return Utilities.rank(user);
	},

	tier: function (user) {
		io.stdinNumber('db/tourWins.csv', user, 'tourWins');
		if (user.tourWins  < 8) {
			return ' | Rating tier: Bronze
';
		} else if (user.tourWins >= 8 && user.tourWins < 20) {
			return ' | Rating tier: Silver
';
		} else if (user.tourWins >= 20 && user.tourWins < 40) {
			return ' | Rating tier: Gold
';
		} else if (user.tourWins >= 40 && user.tourWins < 60) {
			return ' | Rating tier: Platinum
';
		} else if (user.tourWins >= 60 && user.tourWins <= 99) {
			return ' | Rating tier: Diamond
';
		} else {
			return ' | Rating tier: Legend
';
		}
	},

	views: function (user) {
	    io.stdinNumber('db/views.csv', user, 'views');
	    var space = '      ';
	    return space + '- Views: ' + user.views;
	},

	money: function (user) {
	    io.stdinNumber('db/money.csv', user, 'money');
	    return 'Money: ' + '' + user.money;
	},

	tourWins: function (user) {
		io.stdinNumber('db/tourWins.csv', user, 'tourWins');
		return  ' | Tournament Wins: ' + user.tourWins + '
';
	},

	status: function (user) {
	    io.stdinString('db/status.csv', user, 'status');
	    if (user.status === '') {
	        user.status = 'This user hasn\'t set their status yet.';
	    }
	    return 'Status: "' + user.status + '"';
	},

	statusTime: function (user) {
	    io.stdinString('db/statusTime.csv', user, 'statusTime');
	    return ' ' + user.statusTime + '';
	}
};

var cmds = {
	profile: function (target, room, user, connection) {
	    if (!this.canBroadcast()) return;

	    var targetUser = this.targetUserOrSelf(target);

	    if (!targetUser) return this.sendReply('User ' + this.targetUsername + ' not found.');

	    var height = 75;

	    io.stdoutNumber('db/views.csv', targetUser, 'views', 1);

	    var display = Profile.avatar(targetUser, height) + Profile.name(targetUser) + Profile.views(targetUser) + '
' + Profile.rank(targetUser) + Profile.tier(targetUser) + Profile.money(targetUser) + Profile.tourWins(targetUser) + Profile.status(targetUser) + Profile.statusTime(targetUser);

	    if (!targetUser.authenticated) {
	        display = Profile.avatar(targetUser, height) + Profile.unregisteredName(targetUser) + Profile.views(targetUser) + '
' + Profile.rank(targetUser) + Profile.tier(targetUser) + Profile.money(targetUser) + Profile.tourWins(targetUser) + Profile.status(targetUser) + Profile.statusTime(targetUser);
	        return this.sendReplyBox(display);
	    } else if (typeof (targetUser.avatar) === typeof ('')) {
	        display = Profile.customAvatar(targetUser, height) + Profile.name(targetUser) + Profile.views(targetUser) + '
' + Profile.rank(targetUser) + Profile.tier(targetUser) + Profile.money(targetUser) + Profile.tourWins(targetUser) + Profile.status(targetUser) + Profile.statusTime(targetUser);
	        return this.sendReplyBox(display);
	    } else {
	        return this.sendReplyBox(display);
	    }
	},

	setstatus: 'status',
	status: function(target, room, user){
		if (!target) return this.sendReply('|raw|Set your status for profile. Usage: /status status information');
		if (target.length > 30) return this.sendReply('Status is too long.');
		if (target.indexOf(',') >= 1) return this.sendReply('Unforunately, your status cannot contain a comma.');
		var escapeHTML = Utilities.escapeHTML(target);
		io.stdoutString('db/status.csv', user, 'status', escapeHTML);

		var currentdate = new Date();
		var datetime = "Last Updated: " + (currentdate.getMonth()+1) + "/"+currentdate.getDate() + "/" + currentdate.getFullYear() + " @ "  + Utilities.formatAMPM(currentdate);
		io.stdoutString('db/statusTime.csv', user, 'statusTime', datetime);

		this.sendReply('Your status is now: "' + target + '"');
		if('+%@&~'.indexOf(user.group) >= 0) {
			room.add('|raw| * ' + user.name + ' set their status to: "' + escapeHTML + '"');
		}
	},
};

Object.merge(CommandParser.commands, cmds);
exports.cmds = cmds;


text:
package co.cask.cdap.internal.pipeline;

import co.cask.cdap.pipeline.Pipeline;
import co.cask.cdap.pipeline.Stage;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Concrete implementation of synchronous {@link Pipeline}.
 *

 * Input from each {@link Stage} is passed to next {@link Stage}.
 * Before processing to next {@link Stage}, we wait for results
 * to be available.
 *

 *
 * @param <T> Type of object produced by this pipeline.
 */
public final class SynchronousPipeline<T> extends AbstractPipeline<T> {

  private static final Logger LOG = LoggerFactory.getLogger(SynchronousPipeline.class);

  /**
   * Executes a pipeline in synchronous mode.
   *

   * Waits for the results of previous to be available to move to next
   * stage of processing.
   *

   *
   * @param o argument to run the pipeline.
   */
  @SuppressWarnings("unchecked")
  @Override
  public ListenableFuture<T> execute(Object o) {
    StageContext ctx = new StageContext(o);
    try {
      for (Stage stage : getStages()) {
        stage.process(ctx);
        // Output of previous stage is input to next stage
        ctx = StageContext.next(ctx);
      }
      return Futures.immediateFuture((T) ctx.getUpStream());
    } catch (Throwable th) {
      return Futures.immediateFailedFuture(th);
    } finally {
      Stage finalStage = getFinalStage();
      if (finalStage != null) {
        try {
          finalStage.process(ctx);
        } catch (Throwable t) {
          LOG.warn("Exception thrown when executing final stage {}", finalStage, t);
        }
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef HEADER_CURL_MULTIHANDLE_H
#define HEADER_CURL_MULTIHANDLE_H

#include "conncache.h"

struct Curl_message {
  /* the 'CURLMsg' is the part that is visible to the external user */
  struct CURLMsg extmsg;
};

/* NOTE: if you add a state here, add the name to the statename[] array as
   well!
*/
typedef enum {
  CURLM_STATE_INIT,         /* 0 - start in this state */
  CURLM_STATE_CONNECT_PEND, /* 1 - no connections, waiting for one */
  CURLM_STATE_CONNECT,      /* 2 - resolve/connect has been sent off */
  CURLM_STATE_WAITRESOLVE,  /* 3 - awaiting the resolve to finalize */
  CURLM_STATE_WAITCONNECT,  /* 4 - awaiting the TCP connect to finalize */
  CURLM_STATE_WAITPROXYCONNECT, /* 5 - awaiting proxy CONNECT to finalize */
  CURLM_STATE_SENDPROTOCONNECT, /* 6 - initiate protocol connect procedure */
  CURLM_STATE_PROTOCONNECT, /* 7 - completing the protocol-specific connect
                                   phase */
  CURLM_STATE_WAITDO,       /* 8 - wait for our turn to send the request */
  CURLM_STATE_DO,           /* 9 - start send off the request (part 1) */
  CURLM_STATE_DOING,        /* 10 - sending off the request (part 1) */
  CURLM_STATE_DO_MORE,      /* 11 - send off the request (part 2) */
  CURLM_STATE_DO_DONE,      /* 12 - done sending off request */
  CURLM_STATE_WAITPERFORM,  /* 13 - wait for our turn to read the response */
  CURLM_STATE_PERFORM,      /* 14 - transfer data */
  CURLM_STATE_TOOFAST,      /* 15 - wait because limit-rate exceeded */
  CURLM_STATE_DONE,         /* 16 - post data transfer operation */
  CURLM_STATE_COMPLETED,    /* 17 - operation complete */
  CURLM_STATE_MSGSENT,      /* 18 - the operation complete message is sent */
  CURLM_STATE_LAST          /* 19 - not a true state, never use this */
} CURLMstate;

/* we support N sockets per easy handle. Set the corresponding bit to what
   action we should wait for */
#define MAX_SOCKSPEREASYHANDLE 5
#define GETSOCK_READABLE (0x00ff)
#define GETSOCK_WRITABLE (0xff00)

#define CURLPIPE_ANY (CURLPIPE_HTTP1 | CURLPIPE_MULTIPLEX)

/* This is the struct known as CURLM on the outside */
struct Curl_multi {
  /* First a simple identifier to easier detect if a user mix up
     this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */
  long type;

  /* We have a doubly-linked circular list with easy handles */
  struct SessionHandle *easyp;
  struct SessionHandle *easylp; /* last node */

  int num_easy; /* amount of entries in the linked list above. */
  int num_alive; /* amount of easy handles that are added but have not yet
                    reached COMPLETE state */

  struct curl_llist *msglist; /* a list of messages from completed transfers */

  struct curl_llist *pending; /* SessionHandles that are in the
                                 CURLM_STATE_CONNECT_PEND state */

  /* callback function and user data pointer for the *socket() API */
  curl_socket_callback socket_cb;
  void *socket_userp;

  /* Hostname cache */
  struct curl_hash hostcache;

  /* timetree points to the splay-tree of time nodes to figure out expire
     times of all currently set timers */
  struct Curl_tree *timetree;

  /* 'sockhash' is the lookup hash for socket descriptor => easy handles (note
     the pluralis form, there can be more than one easy handle waiting on the
     same actual socket) */
  struct curl_hash sockhash;

  /* pipelining wanted bits (CURLPIPE*) */
  long pipelining;

  bool recheckstate; /* see Curl_multi_connchanged */

  /* Shared connection cache (bundles)*/
  struct conncache conn_cache;

  /* This handle will be used for closing the cached connections in
     curl_multi_cleanup() */
  struct SessionHandle *closure_handle;

  long maxconnects; /* if >0, a fixed limit of the maximum number of entries
                       we're allowed to grow the connection cache to */

  long max_host_connections; /* if >0, a fixed limit of the maximum number
                                of connections per host */

  long max_total_connections; /* if >0, a fixed limit of the maximum number
                                 of connections in total */

  long max_pipeline_length; /* if >0, maximum number of requests in a
                               pipeline */

  long content_length_penalty_size; /* a connection with a
                                       content-length bigger than
                                       this is not considered
                                       for pipelining */

  long chunk_length_penalty_size; /* a connection with a chunk length
                                     bigger than this is not
                                     considered for pipelining */

  struct curl_llist *pipelining_site_bl; /* List of sites that are blacklisted
                                            from pipelining */

  struct curl_llist *pipelining_server_bl; /* List of server types that are
                                              blacklisted from pipelining */

  /* timer callback and user data pointer for the *socket() API */
  curl_multi_timer_callback timer_cb;
  void *timer_userp;
  struct timeval timer_lastcall; /* the fixed time for the timeout for the
                                    previous callback */
};

#endif /* HEADER_CURL_MULTIHANDLE_H */


text:
'use strict'

const Policy = require('trails/policy')
const _ = require('lodash')

/**
 * @module CheckPermissionsPolicy
 * @description Check permission on the route or model
 */
module.exports = class CheckPermissionsPolicy extends Policy {
  checkModel(req, res, next) {
    const modelName = req.params.model || req.params.parentModel
    const user = req.user
    const defaultRole = this.app.config.permissions.defaultRole

    let action = 'access'
    if (req.method === 'POST') {
      action = 'create'
    }
    else if (req.method === 'PUT' || req.method === 'PATCH') {
      action = 'update'
    }
    else if (req.method === 'DELETE') {
      action = 'destroy'
    }

    if (user) {
      this.app.services.PermissionService.isUserAllowed(user, modelName, action).then(permission => {
        if (!permission || permission.length === 0) {
          res.forbidden(`You doesn't have permissions to ${action} ${modelName}`)
        }
        else {
          if (action !== 'create' && permission[0].relation === 'owner') {
            if (action === 'access' || !req.params.id) {
              if (action === 'update' || action === 'destroy') {
                return next({
                  message: 'Update and Destroy are not yet supported with permissions, please do your request manually',
                  statusCode: 400,
                  code: 'E_UNSUPPORTED'
                })
              }
              //Override populate criteria to filter items
              if (modelName === 'user') {
                if (req.params.id === user.id) {
                  return next()
                }
                else {
                  res.forbidden(`You doesn't have permissions to ${action} ${modelName}`)
                }
              }
              else {
                req.query.populate = [{
                  model: this.app.orm.User,
                  as: 'owners',
                  required: true,
                  where: {id: req.user.id}
                }]
                return next()
              }
            }
            else {
              if (modelName === 'user') {
                if (req.params.id === user.id) {
                  return next()
                }
                else {
                  res.forbidden(`You doesn't have permissions to ${action} ${modelName}`)
                }
              }
              else {
                this.app.services.FootprintService.find(modelName, req.params.id, {populate: 'owners'}).then(item => {
                  for (let i = 0; i < item.owners.length; i++) {
                    if (item.owners[i].id === user.id) {
                      return next()
                    }
                  }
                  res.forbidden(`You doesn't have permissions to ${action} ${modelName}:${req.params.id}`)
                }).catch(err => {
                  this.app.log.error(err)
                  res.serverError(err)
                })
              }
            }
          }
          else {
            return next()
          }
        }
      }).catch(next)
    }
    else if (defaultRole) {
      this.app.services.PermissionService.isAllowed(defaultRole, modelName, action).then(permission => {
        if (!permission || permission.length === 0) {
          res.forbidden(`You doesn't have permissions to ${action} ${modelName}`)
        }
        else {
          return next()
        }
      }).catch(next)
    }
    else {
      res.forbidden(`You doesn't have permissions to ${action} ${modelName}`)
    }
  }

  checkRoute(req, res, next) {
    const user = req.user
    const defaultRole = this.app.config.permissions.defaultRole

    const permissionsConfig = _.get(req.route, 'config.app.permissions')

    if (!permissionsConfig) return next()

    if (user) {
      this.app.services.PermissionService.isUserAllowed(user, permissionsConfig.resourceName, 'access').then(permission => {
        if (!permission || permission.length === 0) {
          res.forbidden(`You doesn't have permissions to access ${req.originalUrl}`)
        }
        else {
          return next()
        }
      }).catch(next)
    }
    else if (defaultRole) {
      this.app.services.PermissionService.isAllowed(defaultRole, permissionsConfig.resourceName, 'access').then(permission => {
        if (!permission || permission.length === 0) {
          res.forbidden(`You doesn't have permissions to access ${req.originalUrl}`)
        }
        else {
          return next()
        }
      }).catch(next)
    }
    else {
      res.forbidden(`You doesn't have permissions to access ${req.originalUrl}`)
    }
  }
}


text:
using System;
using System.Collections;
using System.Threading;
using Alachisoft.NCache.Common.DataStructures;
using Alachisoft.NCache.Common;
using Alachisoft.NCache.Web.RemoteClient.Config;
using System.Collections.Generic;
using System.Text;
using Alachisoft.NCache.Common.Net;

namespace Alachisoft.NCache.Web.Communication
{
    /// <summary>
    /// Hold connection objects and hashmap from partition and partition of replica.
    /// Makes decision on bases of key and hashmap.
    /// </summary>
    internal sealed class ConnectionPool
    {
        private Hashtable _connections;
        //private ArrayList _reconnecting;
        private Hashtable _hashMap;
        private int _bucketSize = 0;
        private long _lastViewId = -1;

        public ConnectionPool() : this(null) { }

        public ConnectionPool(Hashtable hashMap)
        {
            this._connections = Hashtable.Synchronized(new Hashtable(5));
            if (hashMap != null)
            {
                this._hashMap = (!hashMap.IsSynchronized) ? Hashtable.Synchronized(hashMap) : hashMap;
            }
            else
            {
                this._hashMap = Hashtable.Synchronized(new Hashtable());
            }
        }

        /// <summary>
        /// Get or set connection in connection pool
        /// </summary>
        /// <param name="ip">ip of system to which connection is made</param>
        /// <returns>connection object</returns>
        public Connection this[Alachisoft.NCache.Common.Net.Address ip]
        {
            get { lock (this._connections.SyncRoot) return this._connections[ip] as Connection; }
            set { lock (this._connections.SyncRoot) this._connections[ip] = value; }
        }

        /// <summary>
        /// Get or set bucket size
        /// </summary>
        public int BucketSize
        {
            get { return this._bucketSize; }
            set { this._bucketSize = value; }
        }

        /// <summary>
        /// Get count of connection in pool
        /// </summary>
        public int Count
        {
            get { lock (this._connections.SyncRoot) return this._connections.Count; }
        }

        public Hashtable Connections
        {
            get { return _connections; }
        }

        /// <summary>
        /// Get last view id that published this hashmap
        /// </summary>
        public long LastViewId
        {
            get { return this._lastViewId; }
            set { this._lastViewId = value; }
        }

        /// <summary>
        /// Get connection to server on which the item is residing.
        /// If no connection exists, null will be returned.
        /// </summary>
        /// <param name="key">key of item</param>
        /// <returns>connection to server on which item is residing</returns>
        public Connection GetConnection(string key)
        {
            object ip = GetIpInternal(key);
            Connection connection = null;

            if (ip != null) lock (this._connections.SyncRoot) connection = this._connections[ip] as Connection;
            return connection;
        }

        public ICollection Servers
        {
            get
            {
                lock (_connections.SyncRoot)
                {
                    return _connections.Keys;
                }
            }
        }

        public Connection GetAnyConnection()
        {
            Connection connection = null;
            Connection firstConnection = null;
            foreach (Connection conn in _connections.Values)
            {
                if (firstConnection == null) firstConnection = conn;
                if (conn.IsConnected)
                {
                    connection = conn;
                    break;
                }
            }

            if (connection == null)
                connection = firstConnection;

            return connection;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        private object GetIpInternal(string key)
        {
            if (key == null || key == string.Empty) return null;
            if (this._hashMap == null || this._bucketSize == 0) return null;
            int hashCode = AppUtil.GetHashCode(key);
            int index = hashCode / this._bucketSize;
            if (index < 0) index = index * -1;

            lock (this._hashMap.SyncRoot) return this._hashMap[index];
        }

        /// <summary>
        /// Get ip address of server on which key resides
        /// </summary>
        /// <param name="key">key</param>
        /// <returns>ip address of server</returns>

        public Address GetIp(string key)
        {
            return GetIpInternal(key) as Address;
        }

        /// <summary>
        /// Set new hashmap to this new hashmap
        /// </summary>
        /// <param name="hashMap">new hashmap</param>
        public void SetHashmap(NewHashmap hashMap)
        {
            this._lastViewId = hashMap.LastViewId;
            lock (this._hashMap.SyncRoot) this._hashMap = (!hashMap.Map.IsSynchronized) ? Hashtable.Synchronized(hashMap.Map) : hashMap.Map;
        }

        /// <summary>
        /// Add connection to pool. If connection already exists, it will be replaced with new
        /// connection instance
        /// </summary>
        /// <param name="ip">ip address of machine to which connection is made</param>
        /// <param name="connection">connection object</param>
        public void Add(Address ip, Connection connection)
        {
            lock (this._connections.SyncRoot) this._connections[ip] = connection;
        }

        /// <summary>
        /// Remove connection from pool
        /// </summary>
        /// <param name="ip">ip address of machine to which connection is made</param>
        public void Remove(Alachisoft.NCache.Common.Net.Address ip)
        {
            lock (this._connections.SyncRoot) this._connections.Remove(ip);
        }

        /// <summary>
        /// Check whether connection pool contains specified connection
        /// </summary>
        /// <param name="ip">ip address of machine to which connection is made</param>
        /// <returns>true if the connection exists, false otherwise</returns>
        public bool Contains(Address ip)
        {
            lock (this._connections.SyncRoot) return this._connections.Contains(ip);
        }

        /// <summary>
        /// Clone connection table.
        /// </summary>
        /// <returns>cloned connection table</returns>
        public Hashtable CloneConnectionTable()
        {
            lock (this._connections.SyncRoot) return this._connections.Clone() as Hashtable;
        }

        public bool FullyConnnected
        {
            get
            {
                lock (this._connections.SyncRoot)
                {
                    foreach (Connection conn in _connections.Values)
                    {
                        if (!conn.IsConnected)
                        {
                            return false;
                        }
                    }
                    return true;
                }
            }
        }

        public bool FullyDisConnnected
        {
            get
            {
                lock (this._connections.SyncRoot)
                {
                    foreach (Connection conn in _connections.Values)
                    {
                        if (conn.IsConnected)
                        {
                            return false;
                        }
                    }
                    return true;
                }
            }
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append("{ ("); builder.Append(this._lastViewId); builder.Append(") ");
            builder.Append("[");
            foreach (Address ip in _connections.Keys)
            {
                builder.Append(ip.IpAddress.ToString());
                builder.Append(",");
            }
            builder.Remove(builder.Length - 1, 1);
            builder.Append("] }");
            return builder.ToString();
        }
    }
}


text:
.class public abstract Lo/jS;
.super Lo/kz;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lo/jS$ˊ;,
        Lo/jS$if;
    }
.end annotation

.annotation runtime Lo/jE;
.end annotation

# instance fields
.field private final ˊ:Lcom/google/android/gms/internal/fh;

.field private final ˋ:Lo/jR$if;

# direct methods
.method public constructor <init>(Lcom/google/android/gms/internal/fh;Lo/jR$if;)V
    .locals 0

    invoke-direct {p0}, Lo/kz;-><init>()V

    iput-object p1, p0, Lo/jS;->ˊ:Lcom/google/android/gms/internal/fh;

    iput-object p2, p0, Lo/jS;->ˋ:Lo/jR$if;

    return-void
.end method

.method private static ˊ(Lo/jW;Lcom/google/android/gms/internal/fh;)Lcom/google/android/gms/internal/fj;
    .locals 2

    :try_start_0
    invoke-interface {p0, p1}, Lo/jW;->ˊ(Lcom/google/android/gms/internal/fh;)Lcom/google/android/gms/internal/fj;
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_3

    move-result-object v0

    return-object v0

    :catch_0
    move-exception v1

    const-string v0, "Could not fetch ad response from ad request service."

    invoke-static {v0, v1}, Lo/kU;->ˏ(Ljava/lang/String;Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    return-object v0

    :catch_1
    move-exception v1

    const-string v0, "Could not fetch ad response from ad request service due to an Exception."

    invoke-static {v0, v1}, Lo/kU;->ˏ(Ljava/lang/String;Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    return-object v0

    :catch_2
    move-exception v1

    const-string v0, "Could not fetch ad response from ad request service due to an Exception."

    invoke-static {v0, v1}, Lo/kU;->ˏ(Ljava/lang/String;Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    return-object v0

    :catch_3
    move-exception v1

    invoke-static {v1}, Lo/ku;->ˊ(Ljava/lang/Throwable;)V

    const/4 v0, 0x0

    return-object v0
.end method

# virtual methods
.method public final ˊ()V
    .locals 4

    :try_start_0
    invoke-virtual {p0}, Lo/jS;->ˏ()Lo/jW;

    move-result-object v2

    if-nez v2, :cond_0

    new-instance v1, Lcom/google/android/gms/internal/fj;

    const/4 v0, 0x0

    invoke-direct {v1, v0}, Lcom/google/android/gms/internal/fj;-><init>(I)V

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lo/jS;->ˊ:Lcom/google/android/gms/internal/fh;

    invoke-static {v2, v0}, Lo/jS;->ˊ(Lo/jW;Lcom/google/android/gms/internal/fh;)Lcom/google/android/gms/internal/fj;

    move-result-object v1

    if-nez v1, :cond_1

    new-instance v1, Lcom/google/android/gms/internal/fj;

    const/4 v0, 0x0

    invoke-direct {v1, v0}, Lcom/google/android/gms/internal/fj;-><init>(I)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_1
    :goto_0
    invoke-virtual {p0}, Lo/jS;->ˎ()V

    goto :goto_1

    :catchall_0
    move-exception v3

    invoke-virtual {p0}, Lo/jS;->ˎ()V

    throw v3

    :goto_1
    iget-object v0, p0, Lo/jS;->ˋ:Lo/jR$if;

    invoke-interface {v0, v1}, Lo/jR$if;->ˊ(Lcom/google/android/gms/internal/fj;)V

    return-void
.end method

.method public final ˋ()V
    .locals 0

    invoke-virtual {p0}, Lo/jS;->ˎ()V

    return-void
.end method

.method public abstract ˎ()V
.end method

.method public abstract ˏ()Lo/jW;
.end method


text:
module.exports = function($scope, $projects, $upload) {
  $scope.projects = $projects;

  $scope.upload = function() {
    $upload($scope.myFile, '/api/release?project=' + encodeURIComponent($scope.project) + '&version=' + encodeURIComponent($scope.version), function(error, data) {
      alert(error);
    });
  };
};


text:
#pragma once

#include <ft2build.h>
#include FT_GLYPH_H
#include FT_TRUETYPE_TABLES_H

class FreetypeHelper
{
    FT_Library library;

public:
    FreetypeHelper();
    ~FreetypeHelper();

    FT_Library getLib() const;
};


text:
namespace Test
{
    internal abstract class AbstractClass
    {
        internal abstract int this[string one{caret}] { get; set; }
    }
}


text:
import createPersistedState from 'vuex-persistedstate'

export default ({store}) => {
  store.dispatch('initializing');

  createPersistedState({
    paths: ["app"]
  })(store);

  store.dispatch('initialized');
}


text:
package com.d2dx;

public class TestMain
{

    private int foo;

    public TestMain()
    {
        this.foo = 42;
    }

    public static void main(String[] args)
    {
        System.out.println(new TestMain().foo);
    }
}


text:
<?php

class Presenter_Home_Historical extends Presenter
{
    public function view()
    {
        $historical_bookings_table = '';

        $bookings_section_data = [
            'heading' => 'Historical Bookings',
            'unique_id' => Str::random('uuid'),
            'groups' => [
                $historical_bookings_table
            ]
        ];

        $bookings_section = View::forge('form/section', $bookings_section_data);

        $this->historical_form = View::forge('form/container', [
            'sections' => [
                $bookings_section,
            ],
            'name' => 'bookings',
            'type' => 'form-horizontal'
        ]);
    }
}


text:
program galgorithm
  use genetics
  use cities
  use myio
  use cmparser
  use slf_random
  implicit none
  real*8  :: x
  real*8, allocatable  ::  places(:,:), distances(:,:)
  type(group), allocatable  :: population(:), bestpopulation(:), temppop(:)
  integer :: time  = 1000,&
             popNo = 1000
  real*8  :: xmen = 0.0001d0
  real*8  :: meanCase
  integer  :: i,t,p,p1,p2, genNo
  integer  :: dt
  real*8   :: data(1:200)
  character(len=200) :: cPlace="", loadFile=""
  logical :: file_exists

  ! Turn on a random number generator
  call random_init_urandom()

  !!! Command line
  call getArgInt('-pop',popNo)
  call getArgInt('--population',popNo)
  if (popNo < 1000) stop "Spawn more overlords (population should be greater than 1000)!"
  call getArgInt('-t',time)
  call getArgInt('--time',time)
  if (time < 100) stop "Need more time! Use multplicity of 100 generations!"
  call getargReal('-x',xmen)
  call getargReal('-prob',xmen)
  call getargReal('--probability',xmen)
  if (xmen > 1.d-3) stop "Hey, Hulk! Need less radiation (less than 0.001 chance of mutation)!"
  call getArgChar('-c',cPlace)
  call getArgChar('--load',loadFile)

  !!! Load favourite places
  ! TODO
  ! Load SOUTH AMERICA
  ! include 'data/eu.f'
  include 'data/sa.f'
  genNo = size(places,2)
  allocate(distances(genNo,genNo))
  call calcDistances(places,distances)

  !!! Set population & heuristics
  ! TODO
  allocate(bestpopulation(2*popNo))
  allocate(population(popNo))
  call growPopulation(population,genNo)
  allocate(temppop(popNo)) ! auxilary population
  do i=1,popNo
    call group_create(temppop(i),genNo)
  enddo!i

  INQUIRE(FILE=trim(loadFile),EXIST=file_exists)
  if (file_exists) call loadSnapshot('EU',popNo,xmen,time,population,bestpopulation(1:popNo))

  do i=1,popNo
    call cycleLength(population(i),distances)
  enddo!i
  meanCase = mean(population(:)%fitness)
  ! DATA
  dt = time/size(data)

!!!!! MAIN LOOP OF THE PROGRAM
  !!! Fitness Base Selection
  ! TODO
  do t=1,time
    if (mod(t,time/10)==0) print *, "Generation #",t,"out of",time
    do p=1,popNo
      call fitness(population(p),distances,meanCase)
    enddo!p
    call QSort(population,popNo)
    do p=1,popNo/2
      ! Pick parents
      call rouletteWheelSelection(population(:)%fitness,p1)
      call rouletteWheelSelection(population(:)%fitness,p2)
      ! Breed chromosomes using Crossover
      call CrossoverOX1(population(p1)%chromosome,population(p2)%chromosome,temppop(p)%chromosome,temppop(p+popNo/2)%chromosome)
      ! Apply mutation with some probability 'XMEN'
      call random_number(x)
      if (x<xmen) call ScrambleMutation(temppop(p)%chromosome)
      call random_number(x)
      if (x<xmen) call ScrambleMutation(temppop(p+popNo/2)%chromosome)
      call random_number(x)
      if (x<xmen) call InversionMutation(temppop(p)%chromosome)
      call random_number(x)
      if (x<xmen) call InversionMutation(temppop(p+popNo/2)%chromosome)
    enddo!p

    ! Copy temp population
    do i=1,popNo
      population(i)%chromosome = temppop(i)%chromosome
    enddo
    if(mod(t,4)==0) then
      bestpopulation((popNo+1):2*popNo) = population(:)
      call QSort(bestpopulation,2*popNo)
    endif
    if(mod(t,dt)==0) then
      open(1,file='time.dat',action='write',access='append')
        write(1,*) t, meanCase - mean(population(:)%fitness), variance(population(:)%fitness)
      close(1)
    endif
  enddo!t
  !!! Save data
  ! TODO
  do i=1,popNo
    print "(52(I3))", population(i)%chromosome
  enddo

end program galgorithm


text:
import { Injectable } from '@angular/core';

import { ViewActionItem } from './view-action-item';
import { View } from './view';

@Injectable()
export class ViewActionRegistry {

  private state = new WeakMap<View, Array<ViewActionItem>>();

  setActionsByView(view: View, ads: Array<ViewActionItem>) {
    this.state.set(view, ads);
  }

  getActionsByView(view: View): Array<ViewActionItem> {
    return this.state.has(view) ? this.state.get(view) : [];
  }
}


text:
Primitive::Primitive( void )
{}

Primitive::~Primitive( void )
{}


text:
import unittest

from swift.common.swob import Request

from swift3.test.unit import Swift3TestCase
from swift3.etree import fromstring

class TestSwift3Versioning(Swift3TestCase):

    def setUp(self):
        super(TestSwift3Versioning, self).setUp()

    def test_object_versioning_GET(self):
        req = Request.blank('/bucket/object?versioning',
                            environ={'REQUEST_METHOD': 'GET'},
                            headers={'Authorization': 'AWS test:tester:hmac'})
        status, headers, body = self.call_swift3(req)
        self.assertEquals(status.split()[0], '200')
        fromstring(body, 'VersioningConfiguration')

    def test_object_versioning_PUT(self):
        req = Request.blank('/bucket/object?versioning',
                            environ={'REQUEST_METHOD': 'PUT'},
                            headers={'Authorization': 'AWS test:tester:hmac'})
        status, headers, body = self.call_swift3(req)
        self.assertEquals(self._get_error_code(body), 'NotImplemented')

    def test_bucket_versioning_GET(self):
        req = Request.blank('/bucket?versioning',
                            environ={'REQUEST_METHOD': 'GET'},
                            headers={'Authorization': 'AWS test:tester:hmac'})
        status, headers, body = self.call_swift3(req)
        fromstring(body, 'VersioningConfiguration')

if __name__ == '__main__':
    unittest.main()


text:
title: Using Swift for Glance with RDO Havana
authors: gfidente
wiki_title: Using Swift for Glance with RDO Havana
wiki_revision_count: 5
wiki_last_updated: 2014-01-08
---

# Using Swift for Glance with RDO Havana

The default backend driver configured for Glance is the local filesystem but it supports a set of alternative backends, including Swift. If you want to store the Glance images on Swift, a few post-install configuration steps are needed:

       # openstack-config --set /etc/glance/glance-api.conf DEFAULT default_store swift
` # openstack-config --set /etc/glance/glance-api.conf DEFAULT swift_store_auth_address `[`http://$KEYSTONE_HOST:5000/v2.0/`](http://$KEYSTONE_HOST:5000/v2.0/)
       # openstack-config --set /etc/glance/glance-api.conf DEFAULT swift_store_user services:glance
       # openstack-config --set /etc/glance/glance-api.conf DEFAULT swift_store_key $SERVICE_PASSWORD
       # openstack-config --set /etc/glance/glance-api.conf DEFAULT swift_store_create_container_on_put True

**NOTE**: you should replace $KEYSTONE_HOST with the IP address of the node running Keystone and $SERVICE_PASSWORD with the password assigned to the "glance" user. If you installed using packstack, that is in your answer file, search for `CONFIG_GLANCE_KS_PW`

You will also need to assign the "ResellerAdmin" role to the "glance" user or it won't be able to create containers.

       # keystone user-role-add --tenant_id=$UUID_SERVICES_TENANT --user=$UUID_GLANCE_USER --role=$UUID_ResellerAdmin_ROLE

Feel free to create the "ResellerAdmin" role first if it's not found and lastly restart the needed services:

       # service openstack-glance-api restart


text:
import ts from 'typescript';

import {Cycle} from '../../../cycles';
import {makeRelatedInformation} from '../../../diagnostics';
import {Reference} from '../../../imports';

/**
 * Generate a diagnostic related information object that describes a potential cyclic import path.
 */
export function makeCyclicImportInfo(
    ref: Reference, type: string, cycle: Cycle): ts.DiagnosticRelatedInformation {
  const name = ref.debugName || '(unknown)';
  const path = cycle.getPath().map(sf => sf.fileName).join(' -> ');
  const message =
      `The ${type} '${name}' is used in the template but importing it would create a cycle: `;
  return makeRelatedInformation(ref.node, message + path);
}

/**
 * Checks whether a selector is a valid custom element tag name.
 * Based loosely on https://github.com/sindresorhus/validate-element-name.
 */
export function checkCustomElementSelectorForErrors(selector: string): string|null {
  // Avoid flagging components with an attribute or class selector. This isn't bulletproof since it
  // won't catch cases like `foo[]bar`, but we don't need it to be. This is mainly to avoid flagging
  // something like `foo-bar[baz]` incorrectly.
  if (selector.includes('.') || (selector.includes('[') && selector.includes(']'))) {
    return null;
  }

  if (!(/^[a-z]/.test(selector))) {
    return 'Selector of a ShadowDom-encapsulated component must start with a lower case letter.';
  }

  if (/[A-Z]/.test(selector)) {
    return 'Selector of a ShadowDom-encapsulated component must all be in lower case.';
  }

  if (!selector.includes('-')) {
    return 'Selector of a component that uses ViewEncapsulation.ShadowDom must contain a hyphen.';
  }

  return null;
}


text:
#ifndef FFMPEG_SOURCE_H_

#define FFMPEG_SOURCE_H_

#include <stdio.h>

#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaErrors.h>
#include <utils/threads.h>
#include <drm/DrmManagerClient.h>

namespace android {

class FFmpegSource : public DataSource {
public:
    FFmpegSource(const char *filename);
    FFmpegSource(int fd, int64_t offset, int64_t length);

    virtual status_t initCheck() const;

    virtual ssize_t readAt(off64_t offset, void *data, size_t size);

    virtual status_t getSize(off64_t *size);

    virtual sp<DecryptHandle> DrmInitialization(const char *mime);

    virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client);

protected:
    virtual ~FFmpegSource();

private:
    int mFd;
    int64_t mOffset;
    int64_t mLength;
    Mutex mLock;

    /*for DRM*/
    sp<DecryptHandle> mDecryptHandle;
    DrmManagerClient *mDrmManagerClient;
    int64_t mDrmBufOffset;
    int64_t mDrmBufSize;
    unsigned char *mDrmBuf;

    ssize_t readAtDRM(off64_t offset, void *data, size_t size);

    FFmpegSource(const FFmpegSource &);
    FFmpegSource &operator=(const FFmpegSource &);
};

}  // namespace android

#endif  // FFMPEG_SOURCE_H_


text:
import Coordinate from '../geom/Coordinate';
import extend from '../../../../extend';
import LineSegment from '../geom/LineSegment';
import Envelope from '../geom/Envelope';
export default function GeometricShapeBuilder() {
	this.extent = new Envelope(0, 1, 0, 1);
	this.numPts = 0;
	this.geomFactory = null;
	let geomFactory = arguments[0];
	this.geomFactory = geomFactory;
}
extend(GeometricShapeBuilder.prototype, {
	setNumPoints: function (numPts) {
		this.numPts = numPts;
	},
	getRadius: function () {
		return this.getDiameter() / 2;
	},
	getDiameter: function () {
		return Math.min(this.extent.getHeight(), this.extent.getWidth());
	},
	getSquareBaseLine: function () {
		var radius = this.getRadius();
		var centre = this.getCentre();
		var p0 = new Coordinate(centre.x - radius, centre.y - radius);
		var p1 = new Coordinate(centre.x + radius, centre.y - radius);
		return new LineSegment(p0, p1);
	},
	setExtent: function (extent) {
		this.extent = extent;
	},
	getCentre: function () {
		return this.extent.centre();
	},
	getExtent: function () {
		return this.extent;
	},
	getSquareExtent: function () {
		var radius = this.getRadius();
		var centre = this.getCentre();
		return new Envelope(centre.x - radius, centre.x + radius, centre.y - radius, centre.y + radius);
	},
	createCoord: function (x, y) {
		var pt = new Coordinate(x, y);
		this.geomFactory.getPrecisionModel().makePrecise(pt);
		return pt;
	},
	interfaces_: function () {
		return [];
	},
	getClass: function () {
		return GeometricShapeBuilder;
	}
});


text:
package com.blockwithme.util.proto.stringnum;

/**
 * IntegerStringnum is a Stringnum that only accepts integers > 0, in the
 * natural order.
 *
 * Note that if onNewString() fails, the object will be inconsistent and
 * cannot be safely used anymore.
 *
 * TODO Test
 *
 * @author monster
 */
public class IntegerStringnum extends Stringnum {

    /** Constructor. */
    public IntegerStringnum() {
        // NOP
    }

    /** Constructor that allows pre-creating the IDs. */
    public IntegerStringnum(final int generateUpToInclusive) {
        for (int i = 1; i <= generateUpToInclusive; i++) {
            add(String.valueOf(i));
        }
    }

    /**
     * Generates the next ID.
     *
     * Note that this method is NOT thread-safe.
     */
    public String next() {
        return intern(String.valueOf(size()));
    }

    /** Called when a new String is indexed. */
    @Override
    protected void onNewString(final String original, final String hacked) {
        // Fails if not integer
        final int value = Integer.parseInt(hacked);
        if (value != hacked.hashCode()) {
            throw new IllegalStateException("Added " + hacked + " at position "
                    + hacked.hashCode());
        }
    }
}


text:
namespace ui {

class Event;
class CursorDelegateEvdev;
class KeyboardEvdev;
class EventModifiersEvdev;

class EVENTS_OZONE_EVDEV_EXPORT InputInjectorEvdev
    : public SystemInputInjector {
 public:
  InputInjectorEvdev(EventModifiersEvdev* modifiers,
                     CursorDelegateEvdev* cursor,
                     KeyboardEvdev* keyboard,
                     const EventDispatchCallback& callback);

  ~InputInjectorEvdev() override;

  // SystemInputInjector implementation.
  void InjectMouseButton(EventFlags button, bool down) override;
  void InjectMouseWheel(int delta_x, int delta_y) override;
  void MoveCursorTo(const gfx::PointF& location) override;
  void InjectKeyPress(DomCode physical_key, bool down) override;

 private:
  // Modifier key state (shift, ctrl, etc).
  EventModifiersEvdev* modifiers_;

  // Shared cursor state.
  CursorDelegateEvdev* cursor_;

  // Shared keyboard state.
  KeyboardEvdev* keyboard_;

  // Callback for dispatching events.
  EventDispatchCallback callback_;

  DISALLOW_COPY_AND_ASSIGN(InputInjectorEvdev);
};

}  // namespace ui

#endif  // UI_EVENTS_OZONE_EVDEV_INPUT_INJECTOR_EVDEV_H_


text:
package org.jhaws.common.lang;

import java.util.function.Consumer;

import org.jhaws.common.lang.functions.ERunnable;
import org.jhaws.common.lang.functions.ESupplier;

public class EnhancedThread extends Thread {
    public static Runnable convert(ESupplier<Long> runnable, Consumer<Exception> exceptionHandler) {
        return () -> {
            try {
                long delay;
                do {
                    delay = runnable.get();
                    if (delay > 0) {
                        try {
                            Thread.sleep(delay);
                        } catch (InterruptedException ex1) {
                            //
                        }
                    }
                } while (delay >= 0);
            } catch (Exception ex2) {
                if (exceptionHandler != null) {
                    exceptionHandler.accept(ex2);
                }
            }
        };
    }

    public static ESupplier<Long> convert(ERunnable runnable, Long delay) {
        return () -> {
            runnable.run();
            return delay;
        };
    }

    public EnhancedThread(boolean deamon, ESupplier<Long> runnable, Consumer<Exception> exceptionHandler) {
        super(convert(runnable, exceptionHandler));
        setDaemon(deamon);
    }

    public EnhancedThread(boolean deamon, ESupplier<Long> runnable, Consumer<Exception> exceptionHandler, String id) {
        super(convert(runnable, exceptionHandler), id);
        setDaemon(deamon);
    }

    public EnhancedThread(boolean deamon, ERunnable runnable, Long delay, Consumer<Exception> exceptionHandler) {
        super(convert(convert(runnable, delay), exceptionHandler));
        setDaemon(deamon);
    }

    public EnhancedThread(boolean deamon, ERunnable runnable, Long delay, Consumer<Exception> exceptionHandler, String id) {
        super(convert(convert(runnable, delay), exceptionHandler), id);
        setDaemon(deamon);
    }
}


text:
$(function() {

  $.fn.extend({

    draggableInput: function(_options) {
      // Default options
      var defaults = {
        type: 'integer',
        min: 0,
        max: -1,
        scrollPrecision: 1,
        precision: 2
      };
      // Merge defaults with input options
      var options = $.extend(defaults, _options);

      // Get started
      return this.each(function() {
        if(this.nodeName.toLowerCase() != 'input')
          throw new Error('jquery-draggable-input: The given node is not an <input> tag.');

        var $el = $(this);

        var parse;
        if(options.type === 'integer') parse = parseInt;
        if(options.type === 'float') parse = parseFloat;

        // Parse options correctly
        var value = parse($el.val());
        var scrollPrecision = parse(options.scrollPrecision);
        var precision = parseInt(options.precision);
        var max = parse(options.max);
        var min = parse(options.min);

        var checkBoundaries = function(newValue){
          return parse( Math.min( max, Math.max( min, newValue ) ) );
        };

        var checkPrecision = function(newValue){
          if(options.type === 'float')
            newValue = newValue.toFixed(options.precision);
          return newValue;
        };

        $(this).mousedown(function(e) {

          var initialPos = { x: e.pageX, y: e.pageY };

          var onMouseMove = function(e) {
            var diffPos = { x: e.pageX - initialPos.x, y: e.pageY - initialPos.y };
            var newValue = value - diffPos.y * scrollPrecision;

            // Boundaries
            newValue = checkBoundaries(newValue);

            // Decimal precision
            newValue = checkPrecision(newValue);

            $el.val(newValue).trigger('change');
          };

          $(document).mousemove(onMouseMove);
          $(document).one('mouseup', function(e) {
            $(document).off('mousemove', onMouseMove);
            value = parse($el.val());
          });

        });

        $(this).blur(function(e){
          var currentValue = $(this).val();
          var newValue = checkBoundaries(currentValue);

          newValue = checkPrecision(newValue);

          if(currentValue != newValue){
            $(this).val(newValue).trigger('change');
          }
        });

      });
    }

  });

});


text:
import unittest

import sys
sys.path.append('LeetCode/_001_050')

from _007_ReverseInteger import Solution

class Test_007_ReverseInteger(unittest.TestCase):
    def test_reverse_1(self):
        solution = Solution()
        result = solution.reverse(123)

        self.assertEqual(321, result)

    def test_reverse_2(self):
        solution = Solution()
        result = solution.reverse(-123)

        self.assertEqual(-321, result)

    def test_reverse_3(self):
        solution = Solution()
        result = solution.reverse(120)

        self.assertEqual(21, result)

    def test_reverse_overflow(self):
        solution = Solution()
        result = solution.reverse(1534236469)

        self.assertEqual(0, result)

    def test_reverse_overflow_2(self):
        solution = Solution()
        result = solution.reverse(-1534236469)

        self.assertEqual(0, result)

if __name__ == '__main__':
    unittest.main()


text:
function getID(e) {
    return document.getElementById(e) || false;
}

function toggle_fullscreen(e) {
    var background = getID("background");
    if (!background) {
        background = document.createElement("div");
        background.id = "background";
        document.body.appendChild(background);
    }

    if (e.className == "fullscreen") {
        e.className = "";
        background.style.display = "none";
    } else {
        e.className = "fullscreen";
        background.style.display = "block";
    }
}

function set_display(value) {
    var show_hide;
    var d = new Date();
    d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));
    var expires = "expires=" + d.toUTCString();

    if (value == "Simple") {
        show_hide = "none";
        getID("toggle_display").value = "Full";
    } else {
        show_hide = "block";
        getID("toggle_display").value = "Simple";
    }
    getID("main-buttons").style.display = show_hide;
    getID("secondary-buttons").style.display = show_hide;
    getID("accordion").style.display = show_hide;
    document.cookie = "display_mode=" + value + "; " + expires;
}

function set_stream_mode(value) {
    var d = new Date();
    d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));
    var expires = "expires=" + d.toUTCString();

    if (value == "DefaultStream") {
        getID("toggle_stream").value = "MJPEG-Stream";
    } else {
        getID("toggle_stream").value = "Default-Stream";
    }
    document.cookie = "stream_mode=" + value + "; " + expires;
    document.location.reload(true);
}

function schedule_rows() {
    var sun, day, fixed, mode;
    mode = parseInt(getID("DayMode").value);
    switch (mode) {
        case 0:
            sun = 'table-row';
            day = 'none';
            fixed = 'none';
            break;
        case 1:
            sun = 'none';
            day = 'table-row';
            fixed = 'none';
            break;
        case 2:
            sun = 'none';
            day = 'none';
            fixed = 'table-row';
            break;
        default:
            sun = 'table-row';
            day = 'table-row';
            fixed = 'table-row';
            break;
    }
    var rows;
    rows = document.getElementsByClassName('sun');
    for (i = 0; i < rows.length; i++)
        rows[i].style.display = sun;
    rows = document.getElementsByClassName('day');
    for (i = 0; i < rows.length; i++)
        rows[i].style.display = day;
    rows = document.getElementsByClassName('fixed');
    for (i = 0; i < rows.length; i++)
        rows[i].style.display = fixed;
}

function set_preset(value) {
    var values = value.split(" ");
    getID("video_width").value = values[0];
    getID("video_height").value = values[1];
    getID("video_fps").value = values[2];
    getID("MP4Box_fps").value = values[3];
    getID("image_width").value = values[4];
    getID("image_height").value = values[5];
    set_res();
}

function set_res() {
    send_cmd("px " + getID("video_width").value + " " + getID("video_height").value + " " + getID("video_fps").value + " " + getID("MP4Box_fps").value + " " + getID("image_width").value + " " + getID("image_height").value);
    update_preview_delay();
    updatePreview(true);
}

function set_ce() {
    send_cmd("ce " + getID("ce_en").value + " " + getID("ce_u").value + " " + getID("ce_v").value);
}

function set_preview() {
    send_cmd("pv " + getID("quality").value + " " + getID("width").value + " " + getID("divider").value);
    update_preview_delay();
}

function set_roi() {
    send_cmd("ri " + getID("roi_x").value + " " + getID("roi_y").value + " " + getID("roi_w").value + " " + getID("roi_h").value);
}

function set_at() {
    send_cmd("at " + getID("at_en").value + " " + getID("at_y").value + " " + getID("at_u").value + " " + getID("at_v").value);
}

function set_ac() {
    send_cmd("ac " + getID("ac_en").value + " " + getID("ac_y").value + " " + getID("ac_u").value + " " + getID("ac_v").value);
}

function set_ag() {
    send_cmd("ag " + getID("ag_r").value + " " + getID("ag_b").value);
}

//
// Shutdown
//
function sys_shutdown() {
    ajax_status.open("GET", "cmd_func.php?cmd=shutdown", true);
    ajax_status.send();
}

function sys_reboot() {
    ajax_status.open("GET", "cmd_func.php?cmd=reboot", true);
    ajax_status.send();
}

//
// MJPEG
//
var mjpeg_img;
var halted = 0;
var previous_halted = 99;
var mjpeg_mode = 0;
var preview_delay = 0;

function reload_img() {
    if (!halted) mjpeg_img.src = "cam_pic.php?time=" + new Date().getTime() + "&pDelay=" + preview_delay;
    else setTimeout("reload_img()", 500);
}

function error_img() {
    setTimeout("mjpeg_img.src = 'cam_pic.php?time=' + new Date().getTime();", 100);
}

function updatePreview(cycle) {
    if (mjpegmode) {
        if (cycle !== undefined && cycle == true) {
            mjpeg_img.src = "/updating.jpg";
            setTimeout("mjpeg_img.src = \"cam_pic_new.php?time=\" + new Date().getTime()  + \"&pDelay=\" + preview_delay;", 1000);
            return;
        }

        if (previous_halted != halted) {
            if (!halted) {
                mjpeg_img.src = "cam_pic_new.php?time=" + new Date().getTime() + "&pDelay=" + preview_delay;
            } else {
                mjpeg_img.src = "/unavailable.jpg";
            }
        }
        previous_halted = halted;
    }
}

//
// Ajax Status
//
var ajax_status;

if (window.XMLHttpRequest) {
    ajax_status = new XMLHttpRequest();
} else {
    ajax_status = new ActiveXObject("Microsoft.XMLHTTP");
}

ajax_status.onreadystatechange = function() {
    if (ajax_status.readyState == 4 && ajax_status.status == 200) {
        switch (ajax_status.responseText) {
            case "ready":
                getID("video_button").disabled = false;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {
                    send_cmd("ca 1");
                };
                getID("image_button").disabled = false;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 1");
                };
                getID("md_button").disabled = false;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {
                    send_cmd("md 1");
                };
                getID("halt_button").disabled = false;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {
                    send_cmd("ru 0");
                };
                getID("preview_select").disabled = false;
                halted = 0;
                updatePreview();
                break;
            case "md_ready":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = false;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 1");
                };
                getID("md_button").disabled = false;
                getID("md_button").value = "motion detection stop";
                getID("md_button").onclick = function() {
                    send_cmd("md 0");
                };
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                halted = 0;
                updatePreview();
                break;
            case "timelapse":
                getID("video_button").disabled = false;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {
                    send_cmd("ca 1");
                };
                getID("image_button").disabled = true;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {};
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse stop";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 0");
                };
                getID("md_button").disabled = true;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                break;
            case "tl_md_ready":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = false;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse stop";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 0");
                };
                getID("md_button").disabled = false;
                getID("md_button").value = "motion detection stop";
                getID("md_button").onclick = function() {
                    send_cmd("md 0");
                };
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                halted = 0;
                updatePreview();
                break;
            case "video":
                getID("video_button").disabled = false;
                getID("video_button").value = "record video stop";
                getID("video_button").onclick = function() {
                    send_cmd("ca 0");
                };
                getID("image_button").disabled = false;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 1");
                };
                getID("md_button").disabled = true;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = true;
                break;
            case "md_video":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video stop";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = false;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 1");
                };
                getID("md_button").disabled = true;
                getID("md_button").value = "recording video...";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = true;
                break;
            case "tl_video":
                getID("video_button").disabled = false;
                getID("video_button").value = "record video stop";
                getID("video_button").onclick = function() {
                    send_cmd("ca 0");
                };
                getID("image_button").disabled = true;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {
                    send_cmd("im");
                };
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse stop";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 0");
                };
                getID("md_button").disabled = true;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                break;
            case "tl_md_video":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video stop";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = true;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {};
                getID("timelapse_button").disabled = false;
                getID("timelapse_button").value = "timelapse stop";
                getID("timelapse_button").onclick = function() {
                    send_cmd("tl 0");
                };
                getID("md_button").disabled = true;
                getID("md_button").value = "recording video...";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                break;
            case "image":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = true;
                getID("image_button").value = "recording image";
                getID("image_button").onclick = function() {};
                getID("timelapse_button").disabled = true;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {};
                getID("md_button").disabled = true;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = true;
                getID("halt_button").value = "stop camera";
                getID("halt_button").onclick = function() {};
                getID("preview_select").disabled = false;
                break;
            case "halted":
                getID("video_button").disabled = true;
                getID("video_button").value = "record video start";
                getID("video_button").onclick = function() {};
                getID("image_button").disabled = true;
                getID("image_button").value = "record image";
                getID("image_button").onclick = function() {};
                getID("timelapse_button").disabled = true;
                getID("timelapse_button").value = "timelapse start";
                getID("timelapse_button").onclick = function() {};
                getID("md_button").disabled = true;
                getID("md_button").value = "motion detection start";
                getID("md_button").onclick = function() {};
                getID("halt_button").disabled = false;
                getID("halt_button").value = "start camera";
                getID("halt_button").onclick = function() {
                    send_cmd("ru 1");
                };
                getID("preview_select").disabled = false;
                halted = 1;
                updatePreview();
        }
        if (ajax_status.responseText.substr(0, 5) == "Error") {
            alert("Error in RaspiMJPEG: " + ajax_status.responseText.substr(7) + "\nRestart RaspiMJPEG (./RPi_Cam_Web_Interface_Installer.sh start) or the whole RPi.");
        }
        if (getID("motion_button")) {
            getID("motion_button").disabled = false;
            getID("motion_button").value = motion_status;
            getID("motion_button").onclick = function() {
                toggle_motion_status("toggle");
            };
        }
        reload_ajax(ajax_status.responseText);
    }
}

var motion_status = "motion start";

function toggle_motion_status(cmd) {
    if (!getID("motion_button")) {
        return;
    }
    var run = "",
        stop = "motion stop",
        start = "motion start",
        ajax_motion = window.XMLHttpRequest ? new XMLHttpRequest() : ActiveXObject("Microsoft.XMLHTTP");
    ajax_motion.onreadystatechange = function() {
        if (ajax_motion.readyState == 4 && ajax_motion.status == 200) {
            console.log("motion status: " + ajax_motion.responseText);
            if (ajax_motion.responseText == "ON") {
                motion_status = stop;
                run = "tr 0";
            } else {
                motion_status = start;
                run = "tr 1";
            }
            if (cmd == "toggle") {
                motion_status = (motion_status == start ? stop : start);
                send_cmd(run);
            }
            getID("motion_button").value = motion_status;
        }
    }
    ajax_motion.open("GET", "cmd_pipe.php?tracking_status=true");
    ajax_motion.send();
}

function reload_ajax(last) {
    ajax_status.open("GET", "status_mjpeg.php?last=" + last, true);
    ajax_status.send();
}

function get_zip_progress(zipname) {
    var ajax_zip;
    if (window.XMLHttpRequest) {
        ajax_zip = new XMLHttpRequest();
    } else {
        ajax_zip = new ActiveXObject("Microsoft.XMLHTTP");
    }
    ajax_zip.onreadystatechange = function() {
        if (ajax_zip.readyState == 4 && ajax_zip.status == 200) {
            if (process_zip_progress(ajax_zip.responseText)) {
                setTimeout(function() {
                    get_zip_progress(zipname);
                }, 1000);
            } else {
                getID("zipdownload").value = zipname;
                getID("zipform").submit();
                getID("progress").style.display = "none";
            }
        }
    }
    ajax_zip.open("GET", "preview.php?zipprogress=" + zipname);
    ajax_zip.send();
}

function process_zip_progress(str) {
    var arr = str.split("/");
    if (str.indexOf("Done") != -1) {
        return false;
    }
    if (arr.length == 2) {
        var count = parseInt(arr[0]);
        var total = parseInt(arr[1]);
        var progress = getID("progress");
        var caption = " ";
        if (count > 0) caption = str;
        progress.innerHTML = caption + "<div style=\"width:" + (count / total) * 100 + "%;background-color:#0f0;\"> </div>";
    }
    return true;
}
//
// Ajax Commands
//
var ajax_cmd;

if (window.XMLHttpRequest) {
    ajax_cmd = new XMLHttpRequest();
} else {
    ajax_cmd = new ActiveXObject("Microsoft.XMLHTTP");
}

function send_cmd(cmd) {
    ajax_cmd.open("GET", "cmd_pipe.php?cmd=" + cmd, true);
    ajax_cmd.send();
}

function update_preview_delay() {
    var video_fps = parseInt(getID("video_fps").value);
    var divider = parseInt(getID("divider").value);
    preview_delay = Math.floor(divider / Math.max(video_fps, 1) * 1000000);
}

//
// Init
//
function init(mjpeg, video_fps, divider) {
    mjpeg_img = getID("mjpeg_dest");
    preview_delay = Math.floor(divider / Math.max(video_fps, 1) * 1000000);
    if (mjpeg) {
        mjpegmode = 1;
    } else {
        mjpegmode = 0;
        mjpeg_img.onload = reload_img;
        mjpeg_img.onerror = error_img;
        reload_img();
    }
    toggle_motion_status("");
    reload_ajax("");
}


text:
require('./public/client.js');
const client = new Client();
client.exit = process.exit;
client.print = function(msg){
    process.stdout.write(msg);
}
let stdin;
client.do_conn(false, function(){
    process.stdout.write("[me]: ");
    stdin = process.openStdin();
    stdin.addListener("data", function(msg) {
        client.execute(String(msg));
        process.stdout.write("[me]: ");
    });
});


text:
package com.fjoglar.etsitnoticias.domain.usecase;

import com.fjoglar.etsitnoticias.domain.UseCase;
import com.fjoglar.etsitnoticias.data.entities.NewsItem;
import com.fjoglar.etsitnoticias.data.repository.NewsDataSource;

import java.util.List;

public class GetSearch extends UseCase<GetSearch.RequestValues, GetSearch.ResponseValue> {

    private final NewsDataSource mNewsDataSource;

    public GetSearch(NewsDataSource mNewsDataSource) {
        this.mNewsDataSource = mNewsDataSource;
    }

    @Override
    protected void executeUseCase(RequestValues requestValues) {
        mNewsDataSource.getSearchNews(
                requestValues.getSearchQuery(),
                new NewsDataSource.LoadNewsCallback() {
                    @Override
                    public void onNewsLoaded(List<NewsItem> newsItemList) {
                        ResponseValue responseValue = new ResponseValue(newsItemList);
                        getUseCaseCallback().onSuccess(responseValue);
                    }

                    @Override
                    public void onDataNotAvailable() {
                        getUseCaseCallback().onError();
                        }
                    }
            );

    }

    public static final class RequestValues implements UseCase.RequestValues {
        private String mSearchQuery;

        public RequestValues(String searchQuery) {
            this.mSearchQuery = searchQuery;
        }

        public String getSearchQuery() {
            return mSearchQuery;
        }

    }

    public static final class ResponseValue implements UseCase.ResponseValue {
        private List<NewsItem> mNewsItemSearchList;

        public ResponseValue(List<NewsItem> newsItemSearchList) {
            mNewsItemSearchList = newsItemSearchList;
        }

        public List<NewsItem> getNewsItemSearchList() {
            return mNewsItemSearchList;
        }
    }

}


text:
package org.orekit.forces.gravity;

import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

import org.hipparchus.Field;
import org.hipparchus.CalculusFieldElement;
import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.util.FastMath;
import org.orekit.forces.AbstractForceModel;
import org.orekit.propagation.FieldSpacecraftState;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.events.EventDetector;
import org.orekit.propagation.events.FieldEventDetector;
import org.orekit.propagation.numerical.FieldTimeDerivativesEquations;
import org.orekit.propagation.numerical.TimeDerivativesEquations;
import org.orekit.utils.ParameterDriver;

/** Force model for Newtonian central body attraction.
 * @author Luc Maisonobe
 */
public class NewtonianAttraction extends AbstractForceModel {

    /** Name of the single parameter of this model: the central attraction coefficient. */
    public static final String CENTRAL_ATTRACTION_COEFFICIENT = "central attraction coefficient";

    /** Central attraction scaling factor.
     * <p>
     * We use a power of 2 to avoid numeric noise introduction
     * in the multiplications/divisions sequences.
     * </p>
     */
    private static final double MU_SCALE = FastMath.scalb(1.0, 32);

    /** Driver for gravitational parameter. */
    private final ParameterDriver gmParameterDriver;

   /** Simple constructor.
     * @param mu central attraction coefficient (m^3/s^2)
     */
    public NewtonianAttraction(final double mu) {
        gmParameterDriver = new ParameterDriver(NewtonianAttraction.CENTRAL_ATTRACTION_COEFFICIENT,
                                                mu, MU_SCALE,
                                                0.0, Double.POSITIVE_INFINITY);
    }

    /** {@inheritDoc} */
    @Override
    public boolean dependsOnPositionOnly() {
        return true;
    }

    /** Get the central attraction coefficient μ.
     * @return mu central attraction coefficient (m³/s²)
     */
    public double getMu() {
        return gmParameterDriver.getValue();
    }

    /** Get the central attraction coefficient μ.
     * @param <T> the type of the field element
     * @param field field to which the state belongs
     * @return mu central attraction coefficient (m³/s²)
     */
    public <T extends CalculusFieldElement<T>> T getMu(final Field<T> field) {
        final T zero = field.getZero();
        return zero.add(gmParameterDriver.getValue());
    }

    /** {@inheritDoc} */
    @Override
    public void addContribution(final SpacecraftState s, final TimeDerivativesEquations adder) {
        adder.addKeplerContribution(getMu());
    }

    /** {@inheritDoc} */
    @Override
    public <T extends CalculusFieldElement<T>> void addContribution(final FieldSpacecraftState<T> s,
                                                                final FieldTimeDerivativesEquations<T> adder) {
        final Field<T> field = s.getDate().getField();
        adder.addKeplerContribution(getMu(field));
    }

    /** {@inheritDoc} */
    @Override
    public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {
        final double mu = parameters[0];
        final double r2 = s.getPVCoordinates().getPosition().getNormSq();
        return new Vector3D(-mu / (FastMath.sqrt(r2) * r2), s.getPVCoordinates().getPosition());
    }

    /** {@inheritDoc} */
    @Override
    public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s,
                                                                         final T[] parameters) {
        final T mu = parameters[0];
        final T r2 = s.getPVCoordinates().getPosition().getNormSq();
        return new FieldVector3D<>(r2.sqrt().multiply(r2).reciprocal().multiply(mu).negate(), s.getPVCoordinates().getPosition());
    }

    /** {@inheritDoc} */
    @Override
    public Stream<EventDetector> getEventsDetectors() {
        return Stream.empty();
    }

    /** {@inheritDoc} */
    @Override
    public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventsDetectors(final Field<T> field) {
        return Stream.empty();
    }

    /** {@inheritDoc} */
    @Override
    public List<ParameterDriver> getParametersDrivers() {
        return Collections.singletonList(gmParameterDriver);
    }

}


text:
import {inject} from 'aurelia-framework';
import {Router} from 'aurelia-router';

@inject(Router)
export class ChildRouter{
  heading = 'Child Router';

  constructor(router){
    this.router = router;
    router.configure(config => {
      config.map([
        { route: ['','welcome'],  moduleId: './welcome',      nav: true, title:'Welcome' },
        { route: 'flickr',        moduleId: './flickr',       nav: true },
        { route: 'child-router',  moduleId: './child-router', nav: true, title:'Child Router' }
      ]);
    });
  }
}


text:
.blink {
  animation: blink-animation 0.5s steps(8, start) infinite alternate; }

@keyframes blink-animation {
  from {
    opacity: 1; }
  to {
    opacity: 0; } }

.flashlight {
  animation: flashlight-animation 0.5s ease-in-out 5 alternate; }

@keyframes flashlight-animation {
  from {
    background-color: rgba(255, 192, 203, 0.8); }
  to {
    background-color: transparent; } }

* {
  box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0; }

footer {
  color: #999;
  font-size: 12px;
  line-height: 14px;
  padding: 16px 8px;
  text-align: right;
  opacity: 1;
  transition: opacity 0.25s ease-in-out; }
  footer .license-link {
    color: #999; }
    footer .license-link:hover {
      color: #ff4081; }

a {
  color: #ff4081;
  cursor: pointer; }
  a:hover {
    color: #d9004a; }
  a:visited {
    color: #ec5387; }

p {
  font-weight: 400;
  letter-spacing: 0.010em;
  line-height: 1.6em;
  margin: 0.8em 0 1.6em; }

instr {
  font-family: monospace;
  font-weight: 800;
  font-size: 115%; }

.internal-link {
  color: #ff4081;
  cursor: pointer; }

.intro {
  background-image: url("images/background.png");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: auto 100%;
  text-align: center; }
  .intro-download-sub {
    font-size: 11px; }
  .intro-header {
    padding: 64px 32px 128px 32px; }
    .intro-header-blurb {
      color: #222;
      margin: 32px auto;
      max-width: 480px;
      text-align: justify; }
    .intro-header-subtitle {
      font-size: 24px;
      margin-top: 64px; }
    .intro-header-title {
      font-size: 64px;
      font-weight: 500;
      text-transform: uppercase; }

.main-content {
  padding: 24px;
  margin: 0;
  max-width: 800px;
  width: 100%;
  transition: opacity 0.25s ease-in-out;
  opacity: 1; }
  .main-content.ng-enter {
    display: flex !important;
    opacity: 0;
    position: absolute; }
    .main-content.ng-enter-active {
      opacity: 0; }
      .main-content.ng-enter-active + footer {
        opacity: 0; }
  .main-content.ng-leave {
    display: flex !important;
    opacity: 1; }
    .main-content.ng-leave-active {
      opacity: 0; }

.navlink-container.page-home #navlink-home {
  background-color: rgba(255, 255, 255, 0.2); }

.navlink-container.page-playing #navlink-playing {
  background-color: rgba(255, 255, 255, 0.2); }

.navlink-container.page-editing #navlink-editing {
  background-color: rgba(255, 255, 255, 0.2); }

.navlink-container.page-media #navlink-media {
  background-color: rgba(255, 255, 255, 0.2); }

.navlink-container.page-cues #navlink-cues {
  background-color: rgba(255, 255, 255, 0.2); }

.navlink-container.page-help #navlink-help {
  background-color: rgba(255, 255, 255, 0.2); }

.editcue-subgroup-table {
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
  width: 100%; }
  .editcue-subgroup-table td {
    padding: 4px; }
  .editcue-subgroup-table th:not(:first-child), .editcue-subgroup-table td:not(:first-child) {
    padding-left: 2em; }
  .editcue-subgroup-table td:last-child {
    font-style: italic;
    color: #555; }
  .editcue-subgroup-table tr:nth-child(even) {
    background-color: #f2f2f2; }

.sidenav.md-synthea-theme {
  background-color: #424242;
  color: #eee; }
  .sidenav.md-synthea-theme .nav-button {
    border-radius: 0;
    border-top: solid 1px rgba(224, 224, 224, 0.2);
    color: #e0e0e0;
    display: block;
    margin: 0;
    padding: 4px 16px;
    text-align: left; }
    .sidenav.md-synthea-theme .nav-button-sub {
      border-top: none;
      padding-left: 40px;
      text-transform: none; }
  .sidenav.md-synthea-theme .nav-header {
    background: -webkit-linear-gradient(top, #212121 0%, #424242 100%); }
  .sidenav.md-synthea-theme .nav-content {
    background-color: transparent; }
  .sidenav.md-synthea-theme .sidenav-logo {
    background-image: url("images/logo.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 80%;
    width: 100%;
    padding-top: 90%; }

.section {
  margin-bottom: 24px; }

.section-header {
  font-size: 24px;
  font-weight: 500; }

.section-body {
  margin-top: -8px;
  text-align: justify; }

.section-screenshot {
  text-align: center; }
  .section-screenshot-image {
    margin: 0 auto 16px auto;
    width: 100%; }

.section-title {
  border-bottom: solid 1px rgba(100, 100, 100, 0.2);
  font-size: 40px;
  font-weight: 700;
  margin: 8px 0 16px 0;
  padding-bottom: 8px; }

.section-sub-body {
  margin-bottom: 1.6em; }

.section-sub-title {
  font-weight: bold; }

.section-toc {
  border-bottom: solid 1px rgba(100, 100, 100, 0.2);
  padding-bottom: 24px;
  margin-bottom: 16px; }


text:
'use strict';
let AuthZPEClient = require('./src/AuthZPEClient');
AuthZPEClient.AccessCheckStatus = require('./src/AccessCheckStatus');
module.exports = AuthZPEClient;


text:
from supriya.tools.ugentools.Index import Index

class IndexInBetween(Index):
    r'''

    ::

        >>> source = ugentools.In.ar(bus=0)
        >>> index_in_between = ugentools.IndexInBetween.ar(
        ...     buffer_id=buffer_id,
        ...     source=source,
        ...     )
        >>> index_in_between
        IndexInBetween.ar()

    '''

    ### CLASS VARIABLES ###

    __documentation_section__ = None

    __slots__ = ()

    _ordered_input_names = (
        'buffer_id',
        'source',
        )

    _valid_calculation_rates = None

    ### INITIALIZER ###

    def __init__(
        self,
        calculation_rate=None,
        buffer_id=None,
        source=None,
        ):
        Index.__init__(
            self,
            calculation_rate=calculation_rate,
            buffer_id=buffer_id,
            source=source,
            )

    ### PUBLIC METHODS ###

    @classmethod
    def ar(
        cls,
        buffer_id=None,
        source=None,
        ):
        r'''Constructs an audio-rate IndexInBetween.

        ::

            >>> source = ugentools.In.ar(bus=0)
            >>> index_in_between = ugentools.IndexInBetween.ar(
            ...     buffer_id=buffer_id,
            ...     source=source,
            ...     )
            >>> index_in_between
            IndexInBetween.ar()

        Returns ugen graph.
        '''
        from supriya.tools import synthdeftools
        calculation_rate = synthdeftools.CalculationRate.AUDIO
        ugen = cls._new_expanded(
            calculation_rate=calculation_rate,
            buffer_id=buffer_id,
            source=source,
            )
        return ugen

    @classmethod
    def kr(
        cls,
        buffer_id=None,
        source=None,
        ):
        r'''Constructs a control-rate IndexInBetween.

        ::

            >>> source = ugentools.In.ar(bus=0)
            >>> index_in_between = ugentools.IndexInBetween.kr(
            ...     buffer_id=buffer_id,
            ...     source=source,
            ...     )
            >>> index_in_between
            IndexInBetween.kr()

        Returns ugen graph.
        '''
        from supriya.tools import synthdeftools
        calculation_rate = synthdeftools.CalculationRate.CONTROL
        ugen = cls._new_expanded(
            calculation_rate=calculation_rate,
            buffer_id=buffer_id,
            source=source,
            )
        return ugen

    ### PUBLIC PROPERTIES ###

    @property
    def buffer_id(self):
        r'''Gets `buffer_id` input of IndexInBetween.

        ::

            >>> source = ugentools.In.ar(bus=0)
            >>> index_in_between = ugentools.IndexInBetween.ar(
            ...     buffer_id=buffer_id,
            ...     source=source,
            ...     )
            >>> index_in_between.buffer_id

        Returns ugen input.
        '''
        index = self._ordered_input_names.index('buffer_id')
        return self._inputs[index]

    @property
    def source(self):
        r'''Gets `source` input of IndexInBetween.

        ::

            >>> source = ugentools.In.ar(bus=0)
            >>> index_in_between = ugentools.IndexInBetween.ar(
            ...     buffer_id=buffer_id,
            ...     source=source,
            ...     )
            >>> index_in_between.source
            OutputProxy(
                source=In(
                    bus=0.0,
                    calculation_rate=CalculationRate.AUDIO,
                    channel_count=1
                    ),
                output_index=0
                )

        Returns ugen input.
        '''
        index = self._ordered_input_names.index('source')
        return self._inputs[index]


text:
<!DOCTYPE html>
<html>
<head>
    <script src="/js-test-resources/js-test.js"></script>
    <script src="../resources/referrer-test.js"></script>
</head>
<body>
    <script>
        description("Test that 'origin' works correctly from HTTP to HTTPS.");
        expectOriginReferrer(ReferrerTest.ORIGIN, ReferrerTest.HTTP, ReferrerTest.HTTPS);
    </script>
</body>
</html>


text:
<?php declare(strict_types=1);

namespace DaveRandom\LibDNS\Records;

interface ResourceData
{
    function __toString(): string;
}


text:
module Spontaneous
  module DataMapper
    class ContentTable
      REVISION_PADDING = 5

      def self.revision_table?(base_name, table_name)
        /\A__r\d+_#{base_name}\z/ === table_name.to_s
      end

      def self.pad_revision_number(revision_number)
        revision_number.to_s.rjust(REVISION_PADDING, "0")
      end

      def self.revision_table(base_name, revision_number)
        return base_name if revision_number.nil?
        "__r#{pad_revision_number(revision_number)}_#{base_name}".to_sym
      end

      # Extracts the revision number from a table name
      #
      #   revision_number :content, :__r00034_content
      #   => 34
      #
      def self.revision_from_table(base_name, table_name)
        return nil if base_name == table_name
        return nil unless revision_table?(base_name, table_name)
        if (match = /\A__r(\d+)_#{base_name}\z/.match(table_name.to_s))
          rev = match[1]
          return rev.to_i(10)
        end
        nil
      end

      attr_reader :name, :database

      def initialize(name, database)
        @name, @database = name, database
      end

      def columns
        dataset.columns
      end

      def primary_key
        :id
      end

      def dataset(revision = nil, visible_only = false)
        ds = @database[revision_table(revision)]
        ds.filter!(hidden: false) if visible_only
        ds
      end

      def logger
        @database.logger
      end

      def logger=(logger)
        @database.logger = logger
      end

      alias_method :db, :database

      def qualify(revision, col)
        Sequel::SQL::QualifiedIdentifier.new(revision_table(revision), col)
      end

      def quote_identifier(identifier)
        dataset.quote_identifier(identifier)
      end

      def revision_table(revision_number)
        self.class.revision_table(@name, revision_number)
      end

      def revision_from_table(table)
        self.class.revision_from_table(@name, table)
      end

      def revision_table?(table_name)
        self.class.revision_table?(@name, table_name)
      end

      def pad_revision_number(revision_number)
        self.class.pad_revision_number(revision_number)
      end

      def revision_history_table
        :"spontaneous_#{@name}_history"
      end

      def revision_archive_table
        :"spontaneous_#{@name}_archive"
      end

      def revision_history_dataset
        @database[revision_history_table]
      end

      def revision_archive_dataset
        @database[revision_archive_table]
      end
    end
  end
end