text:
;(function(window, document) {
  'use strict';

  // throw an error if required functions not defined
  if (typeof validateFields === "undefined") {
    throw new Error("validateFields() is required and is not defined");
  }
  if (typeof showNotification === "undefined") {
    throw new Error("showNotification() is required and is not defined");
  }
  if (typeof toggleElemDisabled === "undefined") {
    throw new Error("toggleElemDisabled() is required and is not defined");
  }

  // throw an error if required globals not defined
  if (typeof API_BASE_URL === "undefined") {
    throw new Error("API_BASE_URL is required and is not defined");
  }
  // throw an error if required globals not defined
  if (typeof GUI_BASE_URL === "undefined") {
    throw new Error("GUI_BASE_URL is required and is not defined");
  }

  var gwgroupid;
  var gwgroup_table = $('').DataTable();

  // Add EndpointGroup
  function addCarrierGroup(action) {
    var selector, modal_body, url;

    // The default action is a POST (creating a new EndpointGroup)
    if (typeof action === "undefined") {
      action = "POST";
    }

    if (action === "POST") {
      action = "POST";
      selector = "#add-group";
      modal_body = $(selector + ' .modal-body');
      url = API_BASE_URL + "carriergroups";
    }
    // Grab the Gateway Group ID if updating using a PUT
    else if (action === "PUT") {
      selector = "#edit-group";
      modal_body = $(selector + ' .modal-body');
      gwgroupid = modal_body.find(".gwgroup").val();
      url = API_BASE_URL + "carriergroups/" + gwgroupid;
    }
    else {
      throw new Error("addGatewayGroup(): action must be either POST or PUT");
    }

    var requestPayload = {};
    requestPayload.name = modal_body.find('.name').val();
    if (action === "PUT") {
      requestPayload.name = modal_body.find('.new_name').val();
    }
    var plugin_name = modal_body.find('.plugin_name').val();

    if (plugin_name != "None") {
	    var plugin = {};
	    plugin.name = plugin_name;
	    plugin.account_sid = modal_body.find(".plugin_account_sid").val();
	    plugin.account_token = modal_body.find(".plugin_account_token").val();
    }

    requestPayload.plugin = plugin;

    var auth = {};
    if (action === "POST") {
        auth.type = modal_body.find(".authtype").val();
	if (auth.type == "userpwd") {
        	auth.pass = modal_body.find(".auth_password").val();
     	 }
    }
    else if (action === "PUT") {
        auth.type = modal_body.find(".authtype").val();
	if (auth.type == "userpwd") {
        	auth.pass = modal_body.find(".auth_password").val();
     	 }
    }

    auth.r_username = modal_body.find(".r_username").val();
    auth.auth_username = modal_body.find(".auth_username").val();
    auth.auth_password = auth.pass
    auth.auth_domain = modal_body.find(".auth_domain").val();
    auth.auth_proxy = modal_body.find(".auth_proxy").val();

    requestPayload.auth = auth;

    requestPayload.strip = modal_body.find(".strip").val();
    requestPayload.prefix = modal_body.find(".prefix").val();

    // Put into JSON Message and send over
    $.ajax({
      type: action,
      url: url,
      dataType: "json",
      contentType: "application/json; charset=utf-8",
      data: JSON.stringify(requestPayload),
      success: function(response, textStatus, jqXHR) {
        var btn;
        var gwgroupid_int = response.data[0].gwgroupid;

        // Update the Add Button and the table
        if (action === "POST") {
          btn = $('#add .modal-footer').find('#addButton');
          btn.removeClass("btn-primary");
        }
        else {
          btn = $('#edit .modal-footer').find('#updateButton');
          btn.removeClass("btn-warning");
        }

        btn.addClass("btn-success");
        btn.html(" Saved!");
        btn.attr("disabled", true);

        if (action === "POST") {
          gwgroup_table.row.add({
            "name": requestPayload.name,
            "gwgroupid": gwgroupid_int
          }).draw();
          location.reload(true);
        }
        else {
          /*
          gwgroup_table.row(function(idx, data, node) {
            return data.gwgroupid === gwgroupid_int;
          }).data({
            "name": requestPayload.name,
            "gwgroupid": gwgroupid_int
          }).draw(); */
          location.reload(true);
        }
      }
    })
  }

  function updateCarrierGroup() {
    addCarrierGroup("PUT");
  }

  /* validate fields before submitting api request */
  $('#addButton').click(function(ev) {
    /* prevent form default submit */
    ev.preventDefault();

    if (validateFields('#add-group')) {
      addCarrierGroup();
      // hide the modal after 1.5 sec
      setTimeout(function() {
        var add_modal = $('#add-group');
        if (add_modal.is(':visible')) {
          add_modal.modal('hide');
        }
      }, 1500);
    }
  });

 /* validate fields before submitting api request */
    $('#updateGroupButton').click(function(ev) {
      /* prevent form default submit */
      ev.preventDefault();

      if (validateFields('#edit-group')) {
        updateCarrierGroup();
        // hide the modal after 1.5 sec
        setTimeout(function() {
          var edit_modal = $('#edit-group');
          if (edit_modal.is(':visible')) {
            edit_modal.modal('hide');
          }
        }, 1500);
      }

      /* prevent page reload */
      return false;
    });

  function setCarrierGroupHandlers() {
    var carriergroups_tbody = $('#carrier-groups tbody');

    $('#carrier-nav').click(function(e) {
      var target_link = $(e.target);

      /* fix target if we hit an ancestor elem containing it */
      var target_type = $(e.target).get(0).nodeName.toLowerCase();
      if (target_type !== "a") {
        /* no routing necessary if these are clicked */
        if (['div', 'ul'].indexOf(target_type) > -1) {
          return false;
        }
        target_link = target_link.find('a');
      }

      var other_links = $(e.currentTarget).find('.nav-tabs a').not(target_link);
      var modal_body = $(e.currentTarget.parentNode);

      /* handle dynamic routes (links) */
      if (target_link.data("type") === "link") {
        /* add dynamic routes here for each link */
        if (target_link.attr("name") === "carriers-link") {
          var gwid = modal_body.find('.gwid').val();
          var gwgroup = modal_body.find('.gwgroup').val();

          if (gwgroup !== undefined) {
            target_link.attr('href', target_link.attr('href') + "/group/" + gwgroup);
          }
          else if (gwid !== undefined) {
            target_link.attr('href', target_link.attr('href') + "/" + gwid);
          }
        }

        /* add styling to the links */
        target_link.addClass('current-navlink');
        $.each(other_links, function(i, elem) {
          $(elem).removeClass('current-navlink');
        });

        /* make sure we follow the link after returning */
        return true;
      }

      /* handle dynamic modals (using toggles) */
      e.preventDefault();
      var modal_toggle_divs = modal_body.children('div[name*="toggle"]');
      for (var i = 0; i < modal_toggle_divs.length; i++) {
        if ($(modal_toggle_divs[i]).attr('name') === target_link.attr('name')) {
          $(modal_toggle_divs[i]).removeClass("hidden");
        }
        else {
          $(modal_toggle_divs[i]).addClass("hidden");
        }
      }

      // add styling to the toggles
      target_link.addClass('current-navlink');
      $.each(other_links, function(i, elem) {
        $(elem).removeClass('current-navlink');
      });

      // make sure we don't follow the link
      return false;
    });

    $('.plugin_name').change(function() {

      var modal_body = $('#add-group .modal-body');
      modal_body.find(".authoptions").addClass('hidden');
      // Todo: Use the carriergroup plugin architecture to get meta data about the plugin
      if ($('.plugin_name').val() != 'None')
        modal_body.find('.plugin_creds').removeClass('hidden');
      else
        modal_body.find('.authoptions').addClass('hidden');;

    });

    $('#open-CarrierGroupAdd').click(function() {
      /** Clear out the modal */
      var modal_body = $('#add-group .modal-body');
      modal_body.find(".name").val('');
      modal_body.find(".gwlist").val('');
      modal_body.find(".authtype").val('');
      modal_body.find(".r_username").val('');
      modal_body.find(".auth_username").val('');
      modal_body.find(".auth_password").val('');
      modal_body.find(".auth_domain").val('');
      modal_body.find(".auth_proxy").val('');

      // update gwgroup for all modals
      $('.modal-body').find(".gwgroup").each(function() {
        $(this).val('');
      });

      /* ip auth enabled by default, Set the radio button to true */
      modal_body.find('.authtype[data-toggle="ip_enabled"]').trigger('click');
    });

    carriergroups_tbody.on('click', '#open-Update', function() {
      var row_index = $(this).parent().parent().parent().index() + 1;
      var c = document.getElementById('carrier-groups');
      var gwgroup = $(c).find('tr:eq(' + row_index + ') td:eq(1)').text();
      var name = $(c).find('tr:eq(' + row_index + ') td:eq(2)').text();
      var gwlist = $(c).find('tr:eq(' + row_index + ') td:eq(3)').text();
      var authtype = $(c).find('tr:eq(' + row_index + ') td:eq(4)').text();
      var r_username = $(c).find('tr:eq(' + row_index + ') td:eq(5)').text();
      var auth_password = $(c).find('tr:eq(' + row_index + ') td:eq(6)').text();
      var auth_domain = $(c).find('tr:eq(' + row_index + ') td:eq(7)').text();
      var auth_username = $(c).find('tr:eq(' + row_index + ') td:eq(8)').text();
      var auth_proxy = $(c).find('tr:eq(' + row_index + ') td:eq(9)').text();

      // grab modals to change
      var modal_body = $('#edit-group .modal-body');
      var modal_bodies = $('.modal-body');

      /* clear out the modal */
      modal_body.find(".name").val('');
      modal_body.find(".new_name").val('');
      modal_body.find(".gwlist").val('');
      modal_body.find(".authtype").val('');
      modal_body.find(".r_username").val('');
      modal_body.find(".auth_password").val('');
      modal_body.find(".auth_domain").val('');
      modal_body.find(".auth_username").val('');
      modal_body.find(".auth_proxy").val('');

      // update gwgroup for all modals
      modal_bodies.find(".gwgroup").each(function() {
        $(this).val('');
      });

      /* update modal fields */
      modal_body.find(".name").val(name);
      modal_body.find(".new_name").val(name);
      modal_body.find(".gwlist").val(gwlist);
      modal_body.find(".authtype").val(authtype);
      modal_body.find(".r_username").val(r_username);
      modal_body.find(".auth_password").val(auth_password);
      modal_body.find(".auth_domain").val(auth_domain);
      modal_body.find(".auth_username").val(auth_username);
      modal_body.find(".auth_proxy").val(auth_proxy);

      // update gwgroup for all modals
      modal_bodies.find(".gwgroup").each(function() {
        $(this).val(gwgroup);
      });

      if (authtype !== "") {
        /* userpwd auth enabled, Set the radio button to true */
        modal_body.find('.authtype[data-toggle="userpwd_enabled"]').trigger('click');
      }
      else {
        /* ip auth enabled, Set the radio button to true */
        modal_body.find('.authtype[data-toggle="ip_enabled"]').trigger('click');
      }

      /* only show carriers from current group */
      $('#carriers > tbody > tr').each(function() {
        if (gwlist.split(',').indexOf($(this).data('gwid').toString()) > -1) {
          $(this).removeClass('hidden');
        }
        else {
          $(this).addClass('hidden');
        }
      });

      /* start carrier-nav on first tab */
      $('#carrier-nav > .nav-tabs').find('a').first().trigger('click');
    });

    carriergroups_tbody.on('click','#open-Delete', function() {
      var row_index = $(this).parent().parent().parent().index() + 1;
      var c = document.getElementById('carrier-groups');
      var gwgroup = $(c).find('tr:eq(' + row_index + ') td:eq(1)').text();
      var name = $(c).find('tr:eq(' + row_index + ') td:eq(2)').text();
      var gwlist = $(c).find('tr:eq(' + row_index + ') td:eq(3)').text();

      /* update modal fields */
      var modal_body = $('#delete-group .modal-body');
      modal_body.find(".gwgroup").val(gwgroup);
      modal_body.find(".name").val(name);
      modal_body.find(".gwlist").val(gwlist);
    });
  }

  function setCarrierHandlers() {
    var carriers_tbody = $('#carriers tbody');

    $('#open-CarrierAdd').on('click', function() {
      /** Clear out the modal */
      var modal_body = $('#add .modal-body');
      modal_body.find(".gwid").val('');
      modal_body.find(".name").val('');
      modal_body.find(".ip_addr").val('');
      modal_body.find(".strip").val('');
      modal_body.find(".prefix").val('');

      /* make sure ip_addr not disabled */
      modal_body.find('.ip_addr').prop('disabled', false);
    });

    carriers_tbody.on('click', '#open-Update', function() {
      var row_index = $(this).parent().parent().parent().index() + 1;
      var c = document.getElementById('carriers');
      var gwid = $(c).find('tr:eq(' + row_index + ') td:eq(1)').text();
      var name = $(c).find('tr:eq(' + row_index + ') td:eq(2)').text();
      var ip_addr = $(c).find('tr:eq(' + row_index + ') td:eq(3)').text();
      var strip = $(c).find('tr:eq(' + row_index + ') td:eq(4)').text();
      var prefix = $(c).find('tr:eq(' + row_index + ') td:eq(5)').text();

      /** Clear out the modal */
      var modal_body = $('#edit .modal-body');
      modal_body.find(".gwid").val('');
      modal_body.find(".name").val('');
      modal_body.find(".ip_addr").val('');
      modal_body.find(".strip").val('');
      modal_body.find(".prefix").val('');

      /* update modal fields */
      modal_body.find(".gwid").val(gwid);
      modal_body.find(".name").val(name);
      modal_body.find(".ip_addr").val(ip_addr);
      modal_body.find(".strip").val(strip);
      modal_body.find(".prefix").val(prefix);
    });

    carriers_tbody.on('click', '#open-Delete', function() {
      var row_index = $(this).parent().parent().parent().index() + 1;
      var c = document.getElementById('carriers');
      var gwid = $(c).find('tr:eq(' + row_index + ') td:eq(1)').text();
      var name = $(c).find('tr:eq(' + row_index + ') td:eq(2)').text();
      var related_rules = JSON.parse($(c).find('tr:eq(' + row_index + ') td:eq(6)').text());

      var modal_body = $('#delete .modal-body');

      /* remove previous rules if they were created */
      modal_body.find('div.alert.alert-warning').remove();

      /* check if related dr_rules exist */
      if (Object.keys(related_rules).length > 0) {
        /* create an alert and append it to the DOM */
        var html_string = '
' +
            '
Deleting this rule will cause the following Global Outbound Routes to be deleted
' +
            '
' + '
' +
            '
' +
            '

RULE ID	NAME

';
        for (var key in related_rules) {
          html_string += '
' + key + '	' + related_rules[key] + '
';
        }
        html_string += '

';
        /* let jquery parse the string as html */
        var html_nodes = jQuery.parseHTML(html_string);
        modal_body.find("div.alert.alert-danger").after(html_nodes);
      }

      /* update modal fields */
      modal_body.find(".gwid").val(gwid);
      modal_body.find(".name").val(name);
      modal_body.find(".related_rules").val(JSON.stringify(related_rules));
    });
  }

  function setFormHandler(selector, successCallback) {
    $(selector).submit(function(e) {
      /* prevent form default submit */
      e.preventDefault();
      /* store reference to target for callback */
      var self = this;

      var request_url = $(this).attr("action");
      var request_method = $(this).attr("method");
      var form_data = $(this).serialize();

      $.ajax({
        url: request_url,
        type: request_method,
        data: form_data,
        success: function(data) {
          successCallback(data, self)
        },
        error: function(xhr, msg, err) {
          return true; // follow redirects for error page
        },
        complete: function() {
          $(e.target).closest('div.modal').modal('hide');
        }
      });

      /* make sure we don't reload page */
      return false;
    });
  }

  /* any handlers depending on DOM elements go here */
  $(document).ready(function() {
    /* update the carriers table */
    $.ajax({
      url: GUI_BASE_URL + "carriers",
      method: 'GET',
      headers: {
        'Content-Type': 'text/html,text/css,application/javascript,text/plain,*/*'
      },
      success: function(data) {
        $('#carriers-table').html(data);
      }
    });

    /* DataTable init */
    $('#carrier-groups').DataTable({
      "columnDefs": [
        {"orderable": true, "targets": [1, 2, 3]},
        {"orderable": false, "targets": [0, 4, 5, 6, 7, 8, 9, 10, 11]},
      ],
      "order": [[1, 'asc']]
    });

    /* update view when carriers updated */
    setFormHandler('.gwform', function(data, target) {
      $('#carriers-table').html(data);

      var modal = $(target).closest('div.modal');
      var gwid, gwgroup, td_gwlist, gwlist_arr, gwlist;
      if (modal.attr('id') === 'add') {
        gwid = $(data).find('tr.new_gw').data('gwid');
        gwgroup = modal.find('.gwgroup').val();
        td_gwlist = $('#carrier-groups').find('tr[data-gwgroup="' + gwgroup + '"] > td.gwlist');
        gwlist_arr = td_gwlist.text().split(',');
        gwlist_arr.push(gwid);
        gwlist = gwlist_arr.join(',');
        td_gwlist.text(gwlist);
      }
      else if (modal.attr('id') === 'delete') {
        gwid = modal.find('.gwid').val();
        gwgroup = modal.find('.gwgroup').val();
        td_gwlist = $('#carrier-groups').find('tr[data-gwgroup="' + gwgroup + '"] > td.gwlist');
        gwlist_arr = td_gwlist.text().split(',');
        gwlist_arr.splice(gwlist_arr.indexOf(gwid), 1);
        gwlist = gwlist_arr.join(',');
        td_gwlist.text(gwlist);
      }
    });

    setCarrierGroupHandlers();
  });

  /* any handlers that MAY rely on async calls put here */
  $(document).ajaxStop(function() {
    setCarrierHandlers();
  });

})(window, document);


text:
<?php
/**
 * Created by PhpStorm.
 * User: Frost Wong <frostwong@gmail.com>
 * Date: 18/06/2017
 * Time: 11:45
 */

namespace Hodor\Middleware;

use Hodor\Log;
use Hodor\Support\ContentType;
use Hodor\Support\IP;
use Hodor\Support\Timer;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

/**
 * Record access log on receiving a request, log body only when it is readable and only log part of it
 *
 * @package Hodor\Middleware
 */
class AccessLog extends BaseMiddleware
{
    /**
     * @param ServerRequestInterface $request
     * @param ResponseInterface $response
     * @param callable $next
     * @return mixed
     */
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
    {
        Timer::start('request');
        $newResponse = $next($request, $response);

        $requestContext = $this->request($request);
        $responseContext = $this->response($newResponse);

        if ($newResponse->getStatusCode() < 500) {
            Log::info('Request Response', [
                'request' => $requestContext,
                'response' => $responseContext,
            ]);
        } else {
            Log::info('Request Response', [
                'request' => $requestContext,
                'response' => $responseContext,
            ]);
        }

        return $newResponse;
    }

    private function request(ServerRequestInterface $request)
    {
        $clientIP = IP::getClientIP();

        $requestContext = [
            'method' => $request->getMethod(),
            'target' => $request->getRequestTarget(),
            'ip' => $clientIP,
            'size' => $request->getBody()->getSize(),
            'headers' => $request->getHeaders(),
        ];
        $requestContentType = $request->getHeaderLine('Content-Type');

        if (ContentType::isReadable($requestContentType)) {
            $requestContext['body'] = json_decode($request->getBody(), true);
        }

        return $requestContext;
    }

    private function response(ResponseInterface $response)
    {
        $cost = Timer::stop('request');

        $responseContext = [
            'cost' => $cost,
            'code' => $response->getStatusCode(),
            'size' => $response->getBody()->getSize(),
            'headers' => $response->getHeaders(),
        ];

        $responseContentType = $response->getHeaderLine('Content-Type');
        if (ContentType::isReadable($responseContentType)) {
            $responseContext['body'] = json_decode($response->getBody(), true);
        }

        return $responseContext;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using AESharp.Values;

namespace AESharp.UnaryOperators
{
    public interface ICallable
    {
        bool IsArgumentsValid(List args);

        Error GetArgumentError(List args);

        Expression Call(List args);
    }
}


text:
#pragma once
#ifndef PHUNE_REST_BASE
#define PHUNE_REST_BASE

#include <IwHTTP.h>
#include <s3e.h>
#include <IwDebug.h>
#include <string>
#include <queue>
#include <deque>
#include <ctime>
#include <stdlib.h>
#include "pthread.h"
#include "s3eWebView.h"
#include <IwUriEscape.h>

#include "../model/phune/phune_preference.h"
#include "../model/phune/phune_preference_base64.h"
#include "../model/base64.h"
#include "../model/phune/phune_user.h"
#include "../model/json_object.h"
#include "../model/json_list_object.h"
#include "../model/phune/phune_player.h"
#include "../model/jamp/jamp_score.h"
#include "../model/phune/phune_match.h"
#include "../model/phune/phune_game_triggered_event.h"

//timeout 30 seconds
#define REQUEST_TIMEOUT 30000

//define base url
#define URL_SCHEMA "http"
#define URL_HOST "api.jamp.io"
#define URL_PORT "80"
#define URL_CONTEXT "/phune/r"

#define LOGIN_RESOURCE "/me/login/FACEBOOK"
#define LOGOUT_RESOURCE "/me/logout"
#define LOGIN_REDIRECT "/socialgateway/success"

#define LOGOUT_FACEBOOK_PAGE "http://jamp.io/platform/redirects/facebook-logout.html"
#define LOGOUT_FACEBOOK_REDIRECT "http://api.jamp.io/phune/r/jamp/utils/time"

/*
The request status
*/
enum RequestStatus
{
	READY,
	ONGOING_REQUEST,
	REQUEST_ERROR,
	INVALID_RESPONSE_OBJECT,
    NO_CONTENT
};

/*
Type of response. Used to parse object.
*/
enum ResponseObjectType
{
	PHUNE_TIMESTAMP,
	PHUNE_USER_OBJECT,
	PHUNE_MATCH_OBJECT,
	PHUNE_PREFERENCE_OBJECT,
	PHUNE_PREFERENCE_JSON,
	PHUNE_PREFERENCE_JSON_LIST,
	PHUNE_STRING,
	PHUNE_REDIRECT_LOGIN,
    PHUNE_LOGOUT,
	NONE
};

enum WebViewRequestStatus
{
	LOADING,
	HIDE_VIEW,
	STOP_VIEW,
	FINISHED,
};

/*
Class to represent a request error.
*/
class RequestError
{
public:
	RequestError(RequestStatus type, uint32 httpCode);
	~RequestError();
	RequestStatus type;
	uint32 httpCode;
};

struct pendingRequest {
	std::string resource;
	CIwHTTP::SendType sendType;
	ResponseObjectType responseObjectType;
	std::string body;
	void *userData;
	s3eCallback onResult;
	s3eCallback onError;
};

static pthread_mutex_t mutex;

static std::deque<pendingRequest> _pendingRequests;

/*
Class to represent a request
*/
class RequestData
{
public:
	RequestData(){};
	RequestData(const char *URI, CIwHTTP *http_object, CIwHTTP::SendType sendType, s3eCallback onResult, ResponseObjectType responseObjectType, const char *body, void *userData);
	~RequestData();
	static int32 GotHeaders(void*, void*);
	static int32 GotData(void*, void*);
public:
	CIwHTTP *http_object;
	char* result;
	uint32 len;
	s3eCallback onResult;
	RequestStatus requestStatus;
	ResponseObjectType responseObjectType;
	void* base;
	void *userData;
	static const char* getUri(const char *resource);

};

class PhuneRestBase
{
public:
	PhuneRestBase();
	~PhuneRestBase();

	template<class T>
	int32 StoreGameDataJsonList(const char *gameId, const char *key, JsonListObject<T> jsonListObject, s3eCallback onResult, s3eCallback onError, void *userData){
		char resource[200];
		memset(resource, 0, sizeof(resource));
		sprintf(resource, "/jamp/me/preferences/%s?gameId=%s", key, gameId);

        pendingRequest pr;
        pr.body = jsonListObject.Serialize();
        pr.onError = onError;
        pr.onResult = onResult;
        pr.resource = std::string(resource);
        pr.responseObjectType = NONE;
        pr.sendType = CIwHTTP::PUT;
        pr.userData = userData;

        pthread_mutex_lock(&mutex);
        _pendingRequests.push_back(pr);
        if (_pendingRequests.size() > 1)
        {
            pthread_mutex_unlock(&mutex);
            return 0;
        }
        pthread_mutex_unlock(&mutex);

		_onResult = onResult;
		_onError = onError;

		new RequestData(resource, http_object, CIwHTTP::PUT, GotResult, NONE, jsonListObject.Serialize().c_str(), userData);

		return 0;
	}

	int32 GetGameDataJsonList(const char *gameId, const char *key, s3eCallback onResult, s3eCallback onError, void *userData);

	int64 getCurrentTime();
protected:

	int32 _GetMe(s3eCallback onResult, s3eCallback onError, void *userData);

	int32 StoreGameDataBase64(const char *gameId, const char *key, unsigned char const* bytes, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 StoreGameDataJson(const char *gameId, const char *key, const char* jsonObject, s3eCallback onResult, s3eCallback onError, void *userData, bool append = false);

    int32 StoreGameDataJsonBatch(const char *gameId, const char *key, const char* jsonObject, s3eCallback onResult, s3eCallback onError, void *userData, bool append);

	int32 GetGameDataBase64(const char *gameId, const char *key, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 GetGameDataJson(const char *gameId, const char *key, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 DeleteGameData(const char *gameId, const char *key, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 _Init(s3eCallback onResult, s3eCallback onError, void *userData);

	int32 _Login(s3eWebView* g_WebView, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 _Logout(s3eCallback onResult, s3eCallback onError, void *userData);

	int32 _StartMatch(const char *gameId, s3eCallback onResult, s3eCallback onError, void *userData);

	int32 _EndMatch(int64 matchId, PhunePlayer player, s3eCallback onResult, s3eCallback onError, void *userData);

    int32 _StoreMatchEvents(JsonListObject<GameTriggerdEvent> events, int64 matchId, s3eCallback onResult, s3eCallback onError, void *userData);
public:

	/*
	Callback in case of success.
	*/
	static s3eCallback _onResult;

	/*
	Callback in case of error.
	*/
	static s3eCallback _onError;

	int32 removeOngoingRequest();

protected:
	/*
	The http object to communicato to the server
	*/
	CIwHTTP *http_object;
	/*
	Used to get the result
	*/
	static int32 GotResult(void*, void*);

	static int32 _onHideWebView(s3eWebView *instance, void *systemData, void *userData);

    static int32 _onLogoutWebView(s3eWebView *instance, void *systemData, void *userData);

private:

};

static void* _objectToappend;
inline static void*& objectToAppend(){
	return _objectToappend;
}

static int64 lib_time;
static int64 server_time;

//define the template functions
//#include "phune_rest_base.tpp"

#endif // !PHUNE_REST_BASE


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package SGDE.Math;

/**
 *
 * @author Nekel
 */
public class Quaternion {
    float w,x,y,z;

}


text:
import abc
import typing as t

from globus_sdk import utils
from globus_sdk._types import UUIDLike

from ._common import ensure_datatype

#
# NOTE -- on the organization of arguments in this module --
#
# The arguments to each collection type are defined explicitly for good type annotations
# and documentation.
# However, it's easy for things to get out of sync or different between the various
# locations, so we need to impose some order on things to make comparisons easy.
#
# Complicating this, there are some arguments to specific types which aren't shared
# by the common base.
#
# The rule and rationale used is as follows:
# - DATA_TYPE is special, and always first
# - next, the common optional arguments (shared by all)
# - after that, the specific optional arguments for this type/subtype
# - 'additional_fileds' is special, and always last
#
# within those listings of common and specific arguments, the following ordering is
# maintained:
# - strings, sorted alphabetically
# - string lists, sorted alphabetically
# - bools, sorted alphabetically
# - dicts and other types, sorted alphabetically
#
# This makes it possible to do side-by-side comparison of common arguments, to ensure
# that they are all present and accounted-for in all contexts, and allows us to compare
# definition lists for param docs and arguments against usage sites to ensure that all
# arguments which are passed are actually used
#

class CollectionDocument(utils.PayloadWrapper, abc.ABC):
    """
    This is the base class for :class:`~.MappedCollectionDocument` and
    :class:`~.GuestCollectionDocument`.

    Parameters common to both of those are defined and documented here.

    :param data_type: Explicitly set the ``DATA_TYPE`` value for this collection.
        Normally ``DATA_TYPE`` is deduced from the provided parameters and should not be
        set. To maximize compatibility with different versions of GCS, only set this
        value when necessary.
    :type data_type: str, optional

    :param collection_base_path: The location of the collection on its underlying
        storage. For a mapped collection, this is an absolute path on the storage system
        named by the ``storage_gateway_id``. For a guest collection, this is a path
        relative to the value of the ``root_path`` attribute on the mapped collection
        identified by the ``mapped_collection_id``. This parameter is optional for
        updates but required when creating a new collection.
    :type collection_base_path: str, optional
    :param contact_email: Email address of the support contact for the collection
    :type contact_email: str, optional
    :param contact_info: Other contact information for the collection, e.g. phone number
        or mailing address
    :type contact_info: str, optional
    :param default_directory: Default directory when using the collection
    :type default_directory: str, optional
    :param department: The department which operates the collection
    :type department: str, optional
    :param description: A text description of the collection
    :type description: str, optional
    :param display_name: Friendly name for the collection
    :type display_name: str, optional
    :param identity_id: The Globus Auth identity which acts as the owner of the
        collection
    :type identity_id: str or UUID, optional
    :param info_link: Link for more info about the collection
    :type info_link: str, optional
    :param organization: The organization which maintains the collection
    :type organization: str, optional
    :param user_message: A message to display to users when interacting with this
        collection
    :type user_message: str, optional
    :param user_message_link: A link to additional messaging for users when interacting
        with this collection
    :type user_message_link: str, optional

    :param keywords: A list of keywords used to help searches for the collection
    :type keywords: iterable of str, optional

    :param disable_verify: Disable verification checksums on transfers to and from this
        collection
    :type disable_verify: bool, optional
    :param enable_https: Enable or disable HTTPS support (requires a managed endpoint)
    :type enable_https: bool, optional
    :param force_encryption: When set to True, all transfers to and from the collection
        are always encrypted
    :type force_encryption: bool, optional
    :param force_verify: Force verification checksums on transfers to and from this
        collection
    :type force_verify: bool, optional
    :param public: If True, the collection will be visible to other Globus users
    :type public: bool, optional

    :param additional_fields: Additional data for inclusion in the collection document
    :type additional_fields: dict, optional
    """

    DATATYPE_BASE: str = "collection"
    DATATYPE_VERSION_IMPLICATIONS: t.Dict[str, t.Tuple[int, int, int]] = {
        "disable_anonymous_writes": (1, 5, 0),
        "force_verify": (1, 4, 0),
        "sharing_users_allow": (1, 2, 0),
        "sharing_users_deny": (1, 2, 0),
        "enable_https": (1, 1, 0),
        "user_message": (1, 1, 0),
        "user_message_link": (1, 1, 0),
    }

    def __init__(
        self,
        *,
        # data_type
        data_type: t.Optional[str] = None,
        # strs
        collection_base_path: t.Optional[str] = None,
        contact_email: t.Optional[str] = None,
        contact_info: t.Optional[str] = None,
        default_directory: t.Optional[str] = None,
        department: t.Optional[str] = None,
        description: t.Optional[str] = None,
        display_name: t.Optional[str] = None,
        identity_id: t.Optional[UUIDLike] = None,
        info_link: t.Optional[str] = None,
        organization: t.Optional[str] = None,
        user_message: t.Optional[str] = None,
        user_message_link: t.Optional[str] = None,
        # str lists
        keywords: t.Optional[t.Iterable[str]] = None,
        # bools
        disable_verify: t.Optional[bool] = None,
        enable_https: t.Optional[bool] = None,
        force_encryption: t.Optional[bool] = None,
        force_verify: t.Optional[bool] = None,
        public: t.Optional[bool] = None,
        # additional fields
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__()
        self["collection_type"] = self.collection_type
        self._set_optstrs(
            DATA_TYPE=data_type,
            collection_base_path=collection_base_path,
            contact_email=contact_email,
            contact_info=contact_info,
            default_directory=default_directory,
            department=department,
            description=description,
            display_name=display_name,
            identity_id=identity_id,
            info_link=info_link,
            organization=organization,
            user_message=user_message,
            user_message_link=user_message_link,
        )
        self._set_optstrlists(
            keywords=keywords,
        )
        self._set_optbools(
            disable_verify=disable_verify,
            enable_https=enable_https,
            force_encryption=force_encryption,
            force_verify=force_verify,
            public=public,
        )
        if additional_fields is not None:
            self.update(additional_fields)

    @property
    @abc.abstractmethod
    def collection_type(self) -> str:
        raise NotImplementedError

class MappedCollectionDocument(CollectionDocument):
    """
    An object used to represent a Mapped Collection for creation or update operations.
    The initializer supports all writable fields on Mapped Collections but does not
    include read-only fields like ``id``.

    Because these documents may be used for updates, no fields are strictly required.
    However, GCS will require the following fields for creation:

    - ``storage_gateway_id``
    - ``collection_base_path``

    All parameters for :class:`~.CollectionDocument` are supported in addition to the
    parameters below.

    :param storage_gateway_id: The ID of the storage gateway which hosts this mapped
        collection. This parameter is required when creating a collection.
    :type storage_gateway_id: str or UUID, optional

    :param domain_name: DNS name of the virtual host serving this collection
    :type domain_name: str, optional

    :param sharing_users_allow: Connector-specific usernames allowed to create guest
        collections
    :type sharing_users_allow: iterable of str, optional
    :param sharing_users_deny: Connector-specific usernames forbidden from creating
        guest collections
    :type sharing_users_deny: iterable of str, optional

    :param allow_guest_collections: Enable or disable creation and use of Guest
        Collections on this Mapped Collection
    :type allow_guest_collections: bool, optional
    :param disable_anonymous_writes: Allow anonymous write ACLs on Guest Collections
        attached to this Mapped Collection. This option is only usable on non
        high-assurance collections
    :type disable_anonymous_writes: bool, optional

    :param policies: Connector-specific collection policies
    :type policies: dict, optional
    :param sharing_restrict_paths: A PathRestrictions document
    :type sharing_restrict_paths: dict, optional
    """

    @property
    def collection_type(self) -> str:
        return "mapped"

    def __init__(
        self,
        *,
        # data type
        data_type: t.Optional[str] = None,
        # > common args start <
        # strs
        collection_base_path: t.Optional[str] = None,
        contact_email: t.Optional[str] = None,
        contact_info: t.Optional[str] = None,
        default_directory: t.Optional[str] = None,
        department: t.Optional[str] = None,
        description: t.Optional[str] = None,
        display_name: t.Optional[str] = None,
        identity_id: t.Optional[UUIDLike] = None,
        info_link: t.Optional[str] = None,
        organization: t.Optional[str] = None,
        user_message: t.Optional[str] = None,
        user_message_link: t.Optional[str] = None,
        # str lists
        keywords: t.Optional[t.Iterable[str]] = None,
        # bools
        disable_verify: t.Optional[bool] = None,
        enable_https: t.Optional[bool] = None,
        force_encryption: t.Optional[bool] = None,
        force_verify: t.Optional[bool] = None,
        public: t.Optional[bool] = None,
        # > common args end <
        # > specific args start <
        storage_gateway_id: t.Optional[UUIDLike] = None,
        # strs
        domain_name: t.Optional[str] = None,
        # str lists
        sharing_users_allow: t.Optional[t.Iterable[str]] = None,
        sharing_users_deny: t.Optional[t.Iterable[str]] = None,
        sharing_restrict_paths: t.Optional[t.Dict[str, t.Any]] = None,
        # bools
        allow_guest_collections: t.Optional[bool] = None,
        disable_anonymous_writes: t.Optional[bool] = None,
        # dicts
        policies: t.Union["CollectionPolicies", t.Dict[str, t.Any], None] = None,
        # > specific args end <
        # additional fields
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__(
            # data type
            data_type=data_type,
            # strings
            collection_base_path=collection_base_path,
            contact_email=contact_email,
            contact_info=contact_info,
            default_directory=default_directory,
            department=department,
            description=description,
            display_name=display_name,
            identity_id=identity_id,
            info_link=info_link,
            organization=organization,
            user_message=user_message,
            user_message_link=user_message_link,
            # bools
            disable_verify=disable_verify,
            enable_https=enable_https,
            force_encryption=force_encryption,
            force_verify=force_verify,
            public=public,
            # str lists
            keywords=keywords,
            # additional fields
            additional_fields=additional_fields,
        )
        self._set_optstrs(
            storage_gateway_id=storage_gateway_id,
            domain_name=domain_name,
        )
        self._set_optstrlists(
            sharing_users_allow=sharing_users_allow,
            sharing_users_deny=sharing_users_deny,
        )
        self._set_optbools(
            allow_guest_collections=allow_guest_collections,
            disable_anonymous_writes=disable_anonymous_writes,
        )
        self._set_value("sharing_restrict_paths", sharing_restrict_paths)
        self._set_value("policies", policies, callback=dict)
        ensure_datatype(self)

class GuestCollectionDocument(CollectionDocument):
    """
    An object used to represent a Guest Collection for creation or update operations.
    The initializer supports all writable fields on Guest Collections but does not
    include read-only fields like ``id``.

    Because these documents may be used for updates, no fields are strictly required.
    However, GCS will require the following fields for creation:

    - ``mapped_collection_id``
    - ``user_credential_id``
    - ``collection_base_path``

    All parameters for :class:`~.CollectionDocument` are supported in addition to the
    parameters below.

    :param mapped_collection_id: The ID of the mapped collection which hosts this guest
        collection
    :type mapped_collection_id: str or UUID
    :param user_credential_id: The ID of the User Credential which is used to access
        data on this collection. This credential must be owned by the collection's
        ``identity_id``.
    :type user_credential_id: str or UUID
    """

    @property
    def collection_type(self) -> str:
        return "guest"

    def __init__(
        self,
        *,
        # data type
        data_type: t.Optional[str] = None,
        # > common args start <
        # strs
        collection_base_path: t.Optional[str] = None,
        contact_email: t.Optional[str] = None,
        contact_info: t.Optional[str] = None,
        default_directory: t.Optional[str] = None,
        department: t.Optional[str] = None,
        description: t.Optional[str] = None,
        display_name: t.Optional[str] = None,
        identity_id: t.Optional[UUIDLike] = None,
        info_link: t.Optional[str] = None,
        organization: t.Optional[str] = None,
        user_message: t.Optional[str] = None,
        user_message_link: t.Optional[str] = None,
        # str lists
        keywords: t.Optional[t.Iterable[str]] = None,
        # bools
        disable_verify: t.Optional[bool] = None,
        enable_https: t.Optional[bool] = None,
        force_encryption: t.Optional[bool] = None,
        force_verify: t.Optional[bool] = None,
        public: t.Optional[bool] = None,
        # > common args end <
        # > specific args start <
        mapped_collection_id: t.Optional[UUIDLike] = None,
        user_credential_id: t.Optional[UUIDLike] = None,
        # > specific args end <
        # additional fields
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__(
            # data type
            data_type=data_type,
            # strings
            collection_base_path=collection_base_path,
            contact_email=contact_email,
            contact_info=contact_info,
            default_directory=default_directory,
            department=department,
            description=description,
            display_name=display_name,
            identity_id=identity_id,
            info_link=info_link,
            organization=organization,
            user_message=user_message,
            user_message_link=user_message_link,
            # bools
            disable_verify=disable_verify,
            enable_https=enable_https,
            force_encryption=force_encryption,
            force_verify=force_verify,
            public=public,
            # str lists
            keywords=keywords,
            # additional fields
            additional_fields=additional_fields,
        )
        self._set_optstrs(
            mapped_collection_id=mapped_collection_id,
            user_credential_id=user_credential_id,
        )
        ensure_datatype(self)

class CollectionPolicies(utils.PayloadWrapper, abc.ABC):
    """
    This is the abstract base type for Collection Policies documents to use as the
    ``policies`` parameter when creating a MappedCollectionDocument.
    """

class POSIXCollectionPolicies(CollectionPolicies):
    """
    Convenience class for constructing a Posix Collection Policy
    document to use as the `policies` parameter when creating a
    CollectionDocument

    :param DATA_TYPE: Versioned document type. Defaults to the appropriate type for
        this class.
    :type DATA_TYPE: str, optional
    :param sharing_groups_allow: POSIX groups which are allowed to create guest
        collections.
    :type sharing_groups_allow: iterable of str, optional
    :param sharing_groups_deny: POSIX groups which are not allowed to create guest
        collections.
    :type sharing_groups_deny: iterable of str, optional
    :param additional_fields: Additional data for inclusion in the policy document
    :type additional_fields: dict, optional
    """

    def __init__(
        self,
        DATA_TYPE: str = "posix_collection_policies#1.0.0",
        sharing_groups_allow: t.Union[None, str, t.Iterable[str]] = None,
        sharing_groups_deny: t.Union[None, str, t.Iterable[str]] = None,
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__()
        self._set_optstrs(DATA_TYPE=DATA_TYPE)
        self._set_optstrlists(
            sharing_groups_allow=sharing_groups_allow,
            sharing_groups_deny=sharing_groups_deny,
        )
        if additional_fields is not None:
            self.update(additional_fields)

class POSIXStagingCollectionPolicies(CollectionPolicies):
    """
    Convenience class for constructing a Posix Staging Collection Policy
    document to use as the ``policies`` parameter when creating a
    CollectionDocument

    :param DATA_TYPE: Versioned document type. Defaults to the appropriate type for
        this class.
    :type DATA_TYPE: str, optional
    :param sharing_groups_allow: POSIX groups which are allowed to create guest
        collections.
    :type sharing_groups_allow: iterable of str, optional
    :param sharing_groups_deny: POSIX groups which are not allowed to create guest
        collections.
    :type sharing_groups_deny: iterable of str, optional
    :param additional_fields: Additional data for inclusion in the policy document
    :type additional_fields: dict, optional
    """

    def __init__(
        self,
        DATA_TYPE: str = "posix_staging_collection_policies#1.0.0",
        sharing_groups_allow: t.Union[None, str, t.Iterable[str]] = None,
        sharing_groups_deny: t.Union[None, str, t.Iterable[str]] = None,
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__()
        self._set_optstrs(DATA_TYPE=DATA_TYPE)
        self._set_optstrlists(
            sharing_groups_allow=sharing_groups_allow,
            sharing_groups_deny=sharing_groups_deny,
        )
        if additional_fields is not None:
            self.update(additional_fields)

class GoogleCloudStorageCollectionPolicies(CollectionPolicies):
    """
    Convenience class for constructing a Google Cloud Storage Collection Policy
    document to use as the ``policies`` parameter when creating a CollectionDocument

    :param DATA_TYPE: Versioned document type. Defaults to the appropriate type for
        this class.
    :type DATA_TYPE: str, optional
    :param project: Google Cloud Platform project ID that is used by this collection
    :type project: str, optional
    :param additional_fields: Additional data for inclusion in the policy document
    :type additional_fields: dict, optional
    """

    def __init__(
        self,
        DATA_TYPE: str = "google_cloud_storage_collection_policies#1.0.0",
        project: t.Optional[str] = None,
        additional_fields: t.Optional[t.Dict[str, t.Any]] = None,
    ) -> None:
        super().__init__()
        self._set_optstrs(DATA_TYPE=DATA_TYPE, project=project)
        if additional_fields is not None:
            self.update(additional_fields)


text:
using System;
using System.IO;
using System.Net;
using Endeca.Control.EacToolkit;
using EndecaControl.EacToolkit.Core;
using EndecaControl.EacToolkit.Services;

#endregion

namespace EndecaControl.EacToolkit.Components
{
    public sealed class DgraphComponent : ServerComponent
    {
        private const int WebReqTimeout = 600000; // 10 min
        internal bool IndexApplied;
        internal bool UpdateApplied;
        private string _updateDir;

        internal DgraphComponent(string compId, string appId, HostType host) : base(compId, appId, host)
        {
        }

        /// <summary>
        /// Partial update log files folder
        /// </summary>
        public string UpdateLogDir { get; set; }

        /// <summary>
        /// Partial update folder
        /// </summary>
        public string UpdateDir
        {
            get { return _updateDir; }
            set { _updateDir = value; }
        }

        /// <summary>
        /// Index distribution local temporary folder
        /// </summary>
        public string IndexDistributionDir { set; get; }

        /// <summary>
        /// Stops MDEX engine, copy files to the input folder and starts the engine
        /// </summary>
        /// <returns>true if successful</returns>
        public bool ApplyIndex()
        {
            if (IsActive)
            {
                Logger.Info(String.Format("{0} - Stopping dgraph ...", ComponentId));
                StopComponent(true);
            }

            var inputFolder = InputDirectory.Substring(0, InputDirectory.LastIndexOf(@"\"));

            CopyFilesAndApply(inputFolder);
            IndexApplied = IsActive;
            return IndexApplied;
        }

        /// <summary>
        /// Cleans partial updates folder
        /// </summary>
        public void CleanUpdateDir()
        {
            CleanDir(_updateDir);
        }

        /// <summary>
        /// Applies partial update
        /// </summary>
        public bool ApplyUpdate()
        {
            //TODO: Async????????
            Logger.Debug(String.Format("{0} - Applying updates ...", ComponentId));
            var req = String.Format("http://{0}:{1}/admin?op=update", HostName, Port);
            var updateReq = (HttpWebRequest) WebRequest.Create(req);
            updateReq.Credentials = CredentialCache.DefaultCredentials;
            updateReq.Timeout = WebReqTimeout;
            try
            {
                var response = (HttpWebResponse) updateReq.GetResponse();
                UpdateApplied = response.StatusCode == HttpStatusCode.OK;
            }
            catch (WebException e)
            {
                Logger.Error("Update request", e);
                UpdateApplied = false;
            }
            return UpdateApplied;
        }

        /// <summary>
        /// Lightweight healthcheck for monitoring whether the Dgraph is alive and accepting queries
        /// </summary>
        /// <returns> true if responds</returns>
        public bool IsAlive()
        {
            Logger.Debug(String.Format("Pinging {0} on {1}:{2} ...", ComponentId, hostName, port));
            var req = String.Format("http://{0}:{1}/admin?op=ping", HostName, Port);
            var updateReq = (HttpWebRequest) WebRequest.Create(req);
            updateReq.Credentials = CredentialCache.DefaultCredentials;
            updateReq.Timeout = WebReqTimeout;
            try
            {
                var response = (HttpWebResponse) updateReq.GetResponse();
                return response.StatusCode == HttpStatusCode.OK;
            }
            catch (WebException e)
            {
                Logger.Error(String.Format("Failed to ping {0} at {1}:{2}!", ComponentId, hostName, Port), e);
                return false;
            }
        }

        public override void CleanDirs()
        {
            CleanDir(IndexDistributionDir);
            CleanDir(UpdateDir);
        }

        #region Private Helper Methods

        private void CopyFilesAndApply(string inputFolder)
        {
            var token = CopyFiles(HostId, IndexDistributionDir, inputFolder);

            if (WaitUtilityComplete(token))
            {
                Logger.Info(String.Format("{0} - Archiving logs ...", ComponentId));
                ArchiveLog(true);

                Logger.Debug(String.Format("{0} - Attempting to start Dgraph ...", ComponentId));
                Start(true);
            }
            else
            {
                Logger.Error(FailureMessage);
            }
        }

        #endregion

    }
}


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

<TITLE>
Uses of Class org.nocrala.tools.texttablefmt.CellStyle.NullStyle (Text Table Formatter)
</TITLE>

<META NAME="date" CONTENT="2012-09-25">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../javadoc.css" TITLE="Style">

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.nocrala.tools.texttablefmt.CellStyle.NullStyle

Uses of CellStyle.NullStyle in org.nocrala.tools.texttablefmt

Methods in org.nocrala.tools.texttablefmt that return CellStyle.NullStyle

static CellStyle.NullStyle
CellStyle.NullStyle.valueOf(java.lang.String name)

          Returns the enum constant of this type with the specified name.

static CellStyle.NullStyle[]
CellStyle.NullStyle.values()

          Returns an array containing the constants of this enum type, in
the order they are declared.

Constructors in org.nocrala.tools.texttablefmt with parameters of type CellStyle.NullStyle

CellStyle(CellStyle.HorizontalAlign horAlign,
          CellStyle.AbbreviationStyle abbStyle,
          CellStyle.NullStyle nullStyle)

          Style with a specified horizontal alignment, abbreviation style and null
 style that assumes no terminal formats.

CellStyle(CellStyle.HorizontalAlign horAlign,
          CellStyle.AbbreviationStyle abbStyle,
          CellStyle.NullStyle nullStyle,
          boolean handleTerminalFormats)

          Full constructor, that specifies all characteristics.

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Nocrala tools.


text:
'use strict';

angular.module('dtuWork')
    .config(function ($stateProvider) {
        $stateProvider
            .state('login', {
                parent: 'main',
                url: '/login',
                views: {
                    'content@': {
                        templateUrl: 'main/script/login/login.html',
                        controller: 'loginController'
                    }
                }
            });
    });


text:
import { reflector } from '../reflection/reflection';
import { Type } from '../type';
import { resolveForwardRef } from './forward_ref';
import { Host, Inject, Optional, Self, SkipSelf } from './metadata';
import { InvalidProviderError, MixingMultiProvidersWithRegularProvidersError, NoAnnotationError } from './reflective_errors';
import { ReflectiveKey } from './reflective_key';
/**
 *  `Dependency` is used by the framework to extend DI.
  * This is internal to Angular and should not be used directly.
 */
export var ReflectiveDependency = (function () {
    /**
     * @param {?} key
     * @param {?} optional
     * @param {?} lowerBoundVisibility
     * @param {?} upperBoundVisibility
     * @param {?} properties
     */
    function ReflectiveDependency(key, optional, lowerBoundVisibility, upperBoundVisibility, properties) {
        this.key = key;
        this.optional = optional;
        this.lowerBoundVisibility = lowerBoundVisibility;
        this.upperBoundVisibility = upperBoundVisibility;
        this.properties = properties;
    }
    /**
     * @param {?} key
     * @return {?}
     */
    ReflectiveDependency.fromKey = function (key) {
        return new ReflectiveDependency(key, false, null, null, []);
    };
    return ReflectiveDependency;
}());
function ReflectiveDependency_tsickle_Closure_declarations() {
    /** @type {?} */
    ReflectiveDependency.prototype.key;
    /** @type {?} */
    ReflectiveDependency.prototype.optional;
    /** @type {?} */
    ReflectiveDependency.prototype.lowerBoundVisibility;
    /** @type {?} */
    ReflectiveDependency.prototype.upperBoundVisibility;
    /** @type {?} */
    ReflectiveDependency.prototype.properties;
}
var /** @type {?} */ _EMPTY_LIST = [];
export var ResolvedReflectiveProvider_ = (function () {
    /**
     * @param {?} key
     * @param {?} resolvedFactories
     * @param {?} multiProvider
     */
    function ResolvedReflectiveProvider_(key, resolvedFactories, multiProvider) {
        this.key = key;
        this.resolvedFactories = resolvedFactories;
        this.multiProvider = multiProvider;
    }
    Object.defineProperty(ResolvedReflectiveProvider_.prototype, "resolvedFactory", {
        /**
         * @return {?}
         */
        get: function () { return this.resolvedFactories[0]; },
        enumerable: true,
        configurable: true
    });
    return ResolvedReflectiveProvider_;
}());
function ResolvedReflectiveProvider__tsickle_Closure_declarations() {
    /** @type {?} */
    ResolvedReflectiveProvider_.prototype.key;
    /** @type {?} */
    ResolvedReflectiveProvider_.prototype.resolvedFactories;
    /** @type {?} */
    ResolvedReflectiveProvider_.prototype.multiProvider;
}
/**
 *  An internal resolved representation of a factory function created by resolving {@link
  * Provider}.
 */
export var ResolvedReflectiveFactory = (function () {
    /**
     * @param {?} factory
     * @param {?} dependencies
     */
    function ResolvedReflectiveFactory(factory, dependencies) {
        this.factory = factory;
        this.dependencies = dependencies;
    }
    return ResolvedReflectiveFactory;
}());
function ResolvedReflectiveFactory_tsickle_Closure_declarations() {
    /**
     * Factory function which can return an instance of an object represented by a key.
     * @type {?}
     */
    ResolvedReflectiveFactory.prototype.factory;
    /**
     * Arguments (dependencies) to the `factory` function.
     * @type {?}
     */
    ResolvedReflectiveFactory.prototype.dependencies;
}
/**
 *  Resolve a single provider.
 * @param {?} provider
 * @return {?}
 */
function resolveReflectiveFactory(provider) {
    var /** @type {?} */ factoryFn;
    var /** @type {?} */ resolvedDeps;
    if (provider.useClass) {
        var /** @type {?} */ useClass = resolveForwardRef(provider.useClass);
        factoryFn = reflector.factory(useClass);
        resolvedDeps = _dependenciesFor(useClass);
    }
    else if (provider.useExisting) {
        factoryFn = function (aliasInstance) { return aliasInstance; };
        resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];
    }
    else if (provider.useFactory) {
        factoryFn = provider.useFactory;
        resolvedDeps = constructDependencies(provider.useFactory, provider.deps);
    }
    else {
        factoryFn = function () { return provider.useValue; };
        resolvedDeps = _EMPTY_LIST;
    }
    return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);
}
/**
 *  Converts the {@link Provider} into {@link ResolvedProvider}.
  * *
  * {@link Injector} internally only uses {@link ResolvedProvider}, {@link Provider} contains
  * convenience provider syntax.
 * @param {?} provider
 * @return {?}
 */
function resolveReflectiveProvider(provider) {
    return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi);
}
/**
 *  Resolve a list of Providers.
 * @param {?} providers
 * @return {?}
 */
export function resolveReflectiveProviders(providers) {
    var /** @type {?} */ normalized = _normalizeProviders(providers, []);
    var /** @type {?} */ resolved = normalized.map(resolveReflectiveProvider);
    var /** @type {?} */ resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());
    return Array.from(resolvedProviderMap.values());
}
/**
 *  Merges a list of ResolvedProviders into a list where
  * each key is contained exactly once and multi providers
  * have been merged.
 * @param {?} providers
 * @param {?} normalizedProvidersMap
 * @return {?}
 */
export function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {
    for (var /** @type {?} */ i = 0; i < providers.length; i++) {
        var /** @type {?} */ provider = providers[i];
        var /** @type {?} */ existing = normalizedProvidersMap.get(provider.key.id);
        if (existing) {
            if (provider.multiProvider !== existing.multiProvider) {
                throw new MixingMultiProvidersWithRegularProvidersError(existing, provider);
            }
            if (provider.multiProvider) {
                for (var /** @type {?} */ j = 0; j < provider.resolvedFactories.length; j++) {
                    existing.resolvedFactories.push(provider.resolvedFactories[j]);
                }
            }
            else {
                normalizedProvidersMap.set(provider.key.id, provider);
            }
        }
        else {
            var /** @type {?} */ resolvedProvider = void 0;
            if (provider.multiProvider) {
                resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);
            }
            else {
                resolvedProvider = provider;
            }
            normalizedProvidersMap.set(provider.key.id, resolvedProvider);
        }
    }
    return normalizedProvidersMap;
}
/**
 * @param {?} providers
 * @param {?} res
 * @return {?}
 */
function _normalizeProviders(providers, res) {
    providers.forEach(function (b) {
        if (b instanceof Type) {
            res.push({ provide: b, useClass: b });
        }
        else if (b && typeof b == 'object' && ((b)).provide !== undefined) {
            res.push(/** @type {?} */ (b));
        }
        else if (b instanceof Array) {
            _normalizeProviders(b, res);
        }
        else {
            throw new InvalidProviderError(b);
        }
    });
    return res;
}
/**
 * @param {?} typeOrFunc
 * @param {?} dependencies
 * @return {?}
 */
export function constructDependencies(typeOrFunc, dependencies) {
    if (!dependencies) {
        return _dependenciesFor(typeOrFunc);
    }
    else {
        var /** @type {?} */ params_1 = dependencies.map(function (t) { return [t]; });
        return dependencies.map(function (t) { return _extractToken(typeOrFunc, t, params_1); });
    }
}
/**
 * @param {?} typeOrFunc
 * @return {?}
 */
function _dependenciesFor(typeOrFunc) {
    var /** @type {?} */ params = reflector.parameters(typeOrFunc);
    if (!params)
        return [];
    if (params.some(function (p) { return p == null; })) {
        throw new NoAnnotationError(typeOrFunc, params);
    }
    return params.map(function (p) { return _extractToken(typeOrFunc, p, params); });
}
/**
 * @param {?} typeOrFunc
 * @param {?} metadata
 * @param {?} params
 * @return {?}
 */
function _extractToken(typeOrFunc, metadata, params) {
    var /** @type {?} */ depProps = [];
    var /** @type {?} */ token = null;
    var /** @type {?} */ optional = false;
    if (!Array.isArray(metadata)) {
        if (metadata instanceof Inject) {
            return _createDependency(metadata.token, optional, null, null, depProps);
        }
        else {
            return _createDependency(metadata, optional, null, null, depProps);
        }
    }
    var /** @type {?} */ lowerBoundVisibility = null;
    var /** @type {?} */ upperBoundVisibility = null;
    for (var /** @type {?} */ i = 0; i < metadata.length; ++i) {
        var /** @type {?} */ paramMetadata = metadata[i];
        if (paramMetadata instanceof Type) {
            token = paramMetadata;
        }
        else if (paramMetadata instanceof Inject) {
            token = paramMetadata.token;
        }
        else if (paramMetadata instanceof Optional) {
            optional = true;
        }
        else if (paramMetadata instanceof Self) {
            upperBoundVisibility = paramMetadata;
        }
        else if (paramMetadata instanceof Host) {
            upperBoundVisibility = paramMetadata;
        }
        else if (paramMetadata instanceof SkipSelf) {
            lowerBoundVisibility = paramMetadata;
        }
    }
    token = resolveForwardRef(token);
    if (token != null) {
        return _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps);
    }
    else {
        throw new NoAnnotationError(typeOrFunc, params);
    }
}
/**
 * @param {?} token
 * @param {?} optional
 * @param {?} lowerBoundVisibility
 * @param {?} upperBoundVisibility
 * @param {?} depProps
 * @return {?}
 */
function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps) {
    return new ReflectiveDependency(ReflectiveKey.get(token), optional, lowerBoundVisibility, upperBoundVisibility, depProps);
}
//# sourceMappingURL=reflective_provider.js.map


text:
import { XHRBackend } from '@angular/http';

import { InMemoryBackendService, SEED_DATA } from 'angular2-in-memory-web-api';
import { InMemoryDataService }               from './in-memory-data.service';

// The usual bootstrapping imports
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';

import { AppComponent }   from './app.component';

bootstrap(AppComponent, [
    HTTP_PROVIDERS,
    { provide: XHRBackend, useClass: InMemoryBackendService }, // in-mem server
    { provide: SEED_DATA, useClass: InMemoryDataService }      // in-mem server data
]);


text:
__author__ = 'Sergey'

import os
import shlex
import subprocess
import multiprocessing
import argparse

def ensure_dir(directory):
    if not os.path.exists(directory):
        os.makedirs(directory)

def get_split(name):
    bname = os.path.basename(name)
    pos = bname.rfind('.')
    return bname[:pos], bname[pos + 1:]

def parse_args():
    parser = argparse.ArgumentParser(description='This script tests prediction quality of IgCAT annotation. ' +
                                     'It receives preannotated data as input, and uses one part of it for ' +
                                     'training and another one for testing. Partition is executed rundomly, ' +
                                     'so there is a posibility to gather statistics from different runs. ' +
                                     'And if you need to run test many times, you can just an according option. ' +
                                     '')
    parser.add_argument('fasta', help='input fasta file')
    parser.add_argument('marking', help='input marking file')
    parser.add_argument('-n', '--max-threads', default=1, type=int, help='maximum count of threads')
    parser.add_argument('-o', '--out-dir', default='out_random_runs', help='output directory')
    parser.add_argument('-m', '--tests-count', default=1, help='count of tests', type=int)
    parser.add_argument('-c', '--train-seq-count', default=100, help='maximum count of train sequences')
    parser.add_argument('-t', '--test-seq-count', default=200, help='maximum count of test sequences')
    parser.add_argument('-p', '--mode', default='affine-semiglobal', help='alignment mode')
    parser.add_argument('-d', '--script-dir', default='..',help='scripts location')
    return parser.parse_args()

def executestar(args):
    return execute(*args)

def execute(args, i):
    out_directory = args.out_dir + "/test-" + str(i)
    ensure_dir(out_directory)
    fasta_pref, fasta_suff = get_split(os.path.basename(args.fasta))
    marking_pref, marking_suff = get_split(os.path.basename(args.marking))
    annotator_out_file_name = out_directory + '/' + marking_pref + '-prediction.' + args.mode + '.' + marking_suff
    annotator_ref_file_name = out_directory + '/' + marking_pref + '-test.' + marking_suff

    out_file = open(annotator_out_file_name, 'w')
    p = subprocess.Popen('python test_data_generator.py ' + args.fasta + ' ' + args.marking +
                         ' --max-count ' + str(args.train_seq_count + args.test_seq_count) +
                         ' --out-dir ' + out_directory + ' --split-ratio ' +
                         str(float(args.train_seq_count)/(args.train_seq_count + args.test_seq_count))
                         , shell=True)
    p = p.wait()
    p = subprocess.Popen(shlex.split('java -Dlogback.configurationFile=../../logback.xml '
                         + '-jar ../../ig-regions/target/ig-regions-1.0-SNAPSHOT.jar'
                         + ' -s ' + out_directory + '/' + fasta_pref + '-test.' + fasta_suff
                         + ' -r ' + out_directory + '/' + fasta_pref + '-train.' + fasta_suff
                         + ' -m ' + out_directory + '/' + marking_pref + '-train.' + marking_suff
                         + ' --amino ' + '--' + args.mode + ' --igblast-like'),
                         universal_newlines=True, stdout=out_file)
    p.wait()
    out_file.close()

    out_file = open(out_directory + '/' + 'result', 'w')
    p = subprocess.Popen(shlex.split('python ' + args.script_dir + '/compare_marking.py '
                         + annotator_ref_file_name + ' ' + annotator_out_file_name),
                         universal_newlines=True, stdout=out_file)
    p.wait()
    out_file.close()

    out_file = open(out_directory + '/' + 'diff', 'w')
    p = subprocess.Popen(shlex.split('python ' + args.script_dir + '/diff_info.py '
                         + annotator_ref_file_name + ' ' + annotator_out_file_name),
                         universal_newlines=True, stdout=out_file)
    p.wait()
    out_file.close()

def main():
    args = parse_args()
    args.init_dir = os.getcwd()
    p = multiprocessing.Pool(args.max_threads)
    tasks = [(args, i) for i in range(args.tests_count)]
    p.map(executestar, tasks)

if __name__ == '__main__':
    main()


text:
#pragma once
//------------------------------------------------------------------------------
/**
    @class AY8910Window
    @brief visualize AY-3-8910 sound chip state
*/
#include "yakc_ui/WindowBase.h"

namespace YAKC {

class AY38910Window : public WindowBase {
    OryolClassDecl(AY38910Window);
public:
    /// setup the window
    virtual void Setup(yakc& emu) override;
    /// draw method
    virtual bool Draw(yakc& emu) override;
};

} // namespace YAKC


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- PYCSW_VERSION -->
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
  <csw:SearchStatus timestamp="PYCSW_TIMESTAMP"/>
  <csw:SearchResults nextRecord="0" numberOfRecordsMatched="1" numberOfRecordsReturned="1" recordSchema="http://www.isotc211.org/2005/gmd" elementSet="full">
    <gmd:MD_Metadata xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd">
      <gmd:fileIdentifier>
        <gco:CharacterString>PYCSW_IDENTIFIER</gco:CharacterString>
      </gmd:fileIdentifier>
      <gmd:language>
        <gco:CharacterString/>
      </gmd:language>
      <gmd:hierarchyLevel>
        <gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="service" codeSpace="ISOTC211/19115">service</gmd:MD_ScopeCode>
      </gmd:hierarchyLevel>
      <gmd:contact>
        <gmd:CI_ResponsibleParty>
          <gmd:individualName>
            <gco:CharacterString>Matt Austin</gco:CharacterString>
          </gmd:individualName>
          <gmd:organisationName>
            <gco:CharacterString>National Oceanic and Atmospheric Administration</gco:CharacterString>
          </gmd:organisationName>
          <gmd:positionName>
            <gco:CharacterString/>
          </gmd:positionName>
          <gmd:contactInfo>
            <gmd:CI_Contact>
              <gmd:phone>
                <gmd:CI_Telephone>
                  <gmd:voice>
                    <gco:CharacterString/>
                  </gmd:voice>
                  <gmd:facsimile>
                    <gco:CharacterString/>
                  </gmd:facsimile>
                </gmd:CI_Telephone>
              </gmd:phone>
              <gmd:address>
                <gmd:CI_Address>
                  <gmd:deliveryPoint>
                    <gco:CharacterString/>
                  </gmd:deliveryPoint>
                  <gmd:city>
                    <gco:CharacterString>Silver Spring</gco:CharacterString>
                  </gmd:city>
                  <gmd:administrativeArea>
                    <gco:CharacterString>Maryland</gco:CharacterString>
                  </gmd:administrativeArea>
                  <gmd:postalCode>
                    <gco:CharacterString>20910</gco:CharacterString>
                  </gmd:postalCode>
                  <gmd:country>
                    <gco:CharacterString>USA</gco:CharacterString>
                  </gmd:country>
                  <gmd:electronicMailAddress>
                    <gco:CharacterString/>
                  </gmd:electronicMailAddress>
                </gmd:CI_Address>
              </gmd:address>
            </gmd:CI_Contact>
          </gmd:contactInfo>
          <gmd:role>
            <gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
          </gmd:role>
        </gmd:CI_ResponsibleParty>
      </gmd:contact>
      <gmd:dateStamp>
        <gco:Date/>
      </gmd:dateStamp>
      <gmd:metadataStandardName>
        <gco:CharacterString>ISO19119</gco:CharacterString>
      </gmd:metadataStandardName>
      <gmd:metadataStandardVersion>
        <gco:CharacterString>2005/PDAM 1</gco:CharacterString>
      </gmd:metadataStandardVersion>
      <gmd:identificationInfo>
        <srv:SV_ServiceIdentification id="PYCSW_IDENTIFIER">
          <gmd:citation>
            <gmd:CI_Citation>
              <gmd:title>
                <gco:CharacterString>GeoServer Web Feature Service</gco:CharacterString>
              </gmd:title>
            </gmd:CI_Citation>
          </gmd:citation>
          <gmd:abstract>
            <gco:CharacterString>This is the reference implementation of WFS 1.0.0 and WFS 1.1.0, supports all WFS operations including Transaction.</gco:CharacterString>
          </gmd:abstract>
          <gmd:descriptiveKeywords>
            <gmd:MD_Keywords>
              <gmd:keyword>
                <gco:CharacterString>WFS</gco:CharacterString>
              </gmd:keyword>
              <gmd:keyword>
                <gco:CharacterString>WMS</gco:CharacterString>
              </gmd:keyword>
              <gmd:keyword>
                <gco:CharacterString>GEOSERVER</gco:CharacterString>
              </gmd:keyword>
            </gmd:MD_Keywords>
          </gmd:descriptiveKeywords>
          <gmd:language>
            <gco:CharacterString/>
          </gmd:language>
          <srv:serviceType>
            <gco:LocalName>OGC:WFS</gco:LocalName>
          </srv:serviceType>
          <srv:serviceTypeVersion>
            <gco:CharacterString>1.1.0</gco:CharacterString>
          </srv:serviceTypeVersion>
          <srv:keywords>
            <gmd:MD_Keywords>
              <gmd:keyword>
                <gco:CharacterString>WFS</gco:CharacterString>
              </gmd:keyword>
              <gmd:keyword>
                <gco:CharacterString>WMS</gco:CharacterString>
              </gmd:keyword>
              <gmd:keyword>
                <gco:CharacterString>GEOSERVER</gco:CharacterString>
              </gmd:keyword>
            </gmd:MD_Keywords>
          </srv:keywords>
          <srv:extent>
            <gmd:EX_Extent>
              <gmd:geographicElement>
                <gmd:EX_GeographicBoundingBox>
                  <gmd:westBoundLongitude>
                    <gco:Decimal>-179.87</gco:Decimal>
                  </gmd:westBoundLongitude>
                  <gmd:eastBoundLongitude>
                    <gco:Decimal>179.99</gco:Decimal>
                  </gmd:eastBoundLongitude>
                  <gmd:southBoundLatitude>
                    <gco:Decimal>-54.61</gco:Decimal>
                  </gmd:southBoundLatitude>
                  <gmd:northBoundLatitude>
                    <gco:Decimal>83.46</gco:Decimal>
                  </gmd:northBoundLatitude>
                </gmd:EX_GeographicBoundingBox>
              </gmd:geographicElement>
            </gmd:EX_Extent>
          </srv:extent>
          <srv:couplingType>
            <srv:SV_CouplingType codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#SV_CouplingType" codeListValue="tight">tight</srv:SV_CouplingType>
          </srv:couplingType>
          <srv:coupledResource>
            <srv:SV_CoupledResource>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:identifier>
                <gco:CharacterString>geoss_water_sba:Reservoir</gco:CharacterString>
              </srv:identifier>
            </srv:SV_CoupledResource>
          </srv:coupledResource>
          <srv:coupledResource>
            <srv:SV_CoupledResource>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:identifier>
                <gco:CharacterString>geoss_water_sba:glwd_1</gco:CharacterString>
              </srv:identifier>
            </srv:SV_CoupledResource>
          </srv:coupledResource>
          <srv:coupledResource>
            <srv:SV_CoupledResource>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:identifier>
                <gco:CharacterString>geoss_water_sba:Dams</gco:CharacterString>
              </srv:identifier>
            </srv:SV_CoupledResource>
          </srv:coupledResource>
          <srv:coupledResource>
            <srv:SV_CoupledResource>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:identifier>
                <gco:CharacterString>geoss_water_sba:glwd_2</gco:CharacterString>
              </srv:identifier>
            </srv:SV_CoupledResource>
          </srv:coupledResource>
          <srv:coupledResource>
            <srv:SV_CoupledResource>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:identifier>
                <gco:CharacterString>geoss_water_sba:Lakes</gco:CharacterString>
              </srv:identifier>
            </srv:SV_CoupledResource>
          </srv:coupledResource>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>GetCapabilities</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>DescribeFeatureType</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>GetFeature</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>GetGmlObject</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>LockFeature</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>GetFeatureWithLock</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:containsOperations>
            <srv:SV_OperationMetadata>
              <srv:operationName>
                <gco:CharacterString>Transaction</gco:CharacterString>
              </srv:operationName>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPGet">HTTPGet</srv:DCPList>
              </srv:DCP>
              <srv:DCP>
                <srv:DCPList codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#DCPList" codeListValue="HTTPPost">HTTPPost</srv:DCPList>
              </srv:DCP>
              <srv:connectPoint>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                </gmd:CI_OnlineResource>
              </srv:connectPoint>
            </srv:SV_OperationMetadata>
          </srv:containsOperations>
          <srv:operatesOn uuidref="geoss_water_sba:Reservoir" xlink:href="http://localhost/pycsw/csw.py?config=tests/suites/harvesting/default.cfg&service=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=PYCSW_IDENTIFIER-geoss_water_sba:Reservoir"/>
          <srv:operatesOn uuidref="geoss_water_sba:glwd_1" xlink:href="http://localhost/pycsw/csw.py?config=tests/suites/harvesting/default.cfg&service=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=PYCSW_IDENTIFIER-geoss_water_sba:glwd_1"/>
          <srv:operatesOn uuidref="geoss_water_sba:Dams" xlink:href="http://localhost/pycsw/csw.py?config=tests/suites/harvesting/default.cfg&service=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=PYCSW_IDENTIFIER-geoss_water_sba:Dams"/>
          <srv:operatesOn uuidref="geoss_water_sba:glwd_2" xlink:href="http://localhost/pycsw/csw.py?config=tests/suites/harvesting/default.cfg&service=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=PYCSW_IDENTIFIER-geoss_water_sba:glwd_2"/>
          <srv:operatesOn uuidref="geoss_water_sba:Lakes" xlink:href="http://localhost/pycsw/csw.py?config=tests/suites/harvesting/default.cfg&service=CSW&version=2.0.2&request=GetRecordById&outputschema=http://www.isotc211.org/2005/gmd&id=PYCSW_IDENTIFIER-geoss_water_sba:Lakes"/>
        </srv:SV_ServiceIdentification>
      </gmd:identificationInfo>
      <gmd:distributionInfo>
        <gmd:MD_Distribution>
          <gmd:transferOptions>
            <gmd:MD_DigitalTransferOptions>
              <gmd:onLine>
                <gmd:CI_OnlineResource>
                  <gmd:linkage>
                    <gmd:URL>http://services.ogc.noaa.gov/geoserver/geoss_water_sba/wfs</gmd:URL>
                  </gmd:linkage>
                  <gmd:protocol>
                    <gco:CharacterString>OGC:WFS</gco:CharacterString>
                  </gmd:protocol>
                  <gmd:name>
                    <gco:CharacterString>PYCSW_IDENTIFIER</gco:CharacterString>
                  </gmd:name>
                  <gmd:description>
                    <gco:CharacterString>OGC-WFS Web Feature Service</gco:CharacterString>
                  </gmd:description>
                </gmd:CI_OnlineResource>
              </gmd:onLine>
            </gmd:MD_DigitalTransferOptions>
          </gmd:transferOptions>
        </gmd:MD_Distribution>
      </gmd:distributionInfo>
    </gmd:MD_Metadata>
  </csw:SearchResults>
</csw:GetRecordsResponse>


text:
package com.monsanto.stats.tables.clustering

import com.monsanto.stats.tables._
import com.monsanto.stats.tables.utils.ProfileUtils
import ProfileUtils._

object ProfileAlgo {

  def main(args: Array[String]): Unit = {
    val allTopicVectors =
      args.headOption match {
        case Some("big") => DataGen.cannedBigData
        case _ => MnMGen.cannedData
      }
    val params =
      args.headOption match {
        case Some("big") => ModelParams(10000, 0.01, 0.01)
        case _ => ModelParams(5, 0.01, 0.01)
      }
    val crp = new CRP(params, allTopicVectors)
    val (result, millis) = time {
      crp.findClusters(100, SameRandomNumGen, crp.selectCluster, false)
    }
    result.clusters.map(_.topicCountsSums) foreach println
    println(s"Algo required: $millis milliseconds")
  }
}


text:
A simple unicorn launcher for use with upstart, in the same manner as https://github.com/alphagov/unicornherder

## Credits

upstart-unicorn-launcher was written by [Tom Ward](http://tomafro.net) when he worked at [Go Free Range Ltd](http://gofreerange.com).

## License

upstart-unicorn-launcher is released under the [MIT License](https://github.com/freerange/upstart-unicorn-launcher/blob/master/LICENSE).


text:
package com.zuolg.zsite.logic;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zuolg.zsite.gen.service.OptionService;

/**
 * <pre>
 * 配置信息表,用来保存网站的所有配置信息。
 * </pre>
 *
 */
@Component
public class OptionFactory {

	private static final Log log = LogFactory.getLog(UserFactory.class);

	@Autowired
	private OptionService service;

	/**
	 * 获取列表
	 * @Title:list
	 * void
	 */
	public void list(){}

	/**
	 * 编辑初始化
	 * @Title:edit
	 * void
	 */
	public void edit(){}

	/**
	 * 编辑保存
	 * @Title:editsave
	 * void
	 */
	public void editsave(){}

	/**
	 * 保存
	 * @Title:save
	 * void
	 */
	public void save(){}

	/**
	 * 删除
	 * @Title:delete
	 * void
	 */
	public void delete(){}

}


text:
var languages = require('languages4translatewiki')
    , fs = require('fs')
    , path = require('path')
    , _ = require('underscore')
    , npm = require('npm')
    , plugins = require('ep_etherpad-lite/static/js/pluginfw/plugins.js').plugins
    , semver = require('semver')
    , existsSync = semver.gt(process.version, '0.7.0') ? fs.existsSync : path.existsSync
    , settings = require('../utils/Settings')

    ;

// returns all existing messages merged together and grouped by langcode
// {es: {"foo": "string"}, en:...}
function getAllLocales() {
    var locales2paths = {};

    // Puts the paths of all locale files contained in a given directory
    // into `locales2paths` (files from various dirs are grouped by lang code)
    // (only json files with valid language code as name)
    function extractLangs(dir) {
        if (!existsSync(dir))
            return;
        var stat = fs.lstatSync(dir);
        if (!stat.isDirectory() || stat.isSymbolicLink())
            return;

        fs.readdirSync(dir).forEach(function (file) {
            file = path.resolve(dir, file);
            stat = fs.lstatSync(file);
            if (stat.isDirectory() || stat.isSymbolicLink())
                return;

            var ext = path.extname(file)
                , locale = path.basename(file, ext).toLowerCase();

            if ((ext == '.json') && languages.isValid(locale)) {
                if (!locales2paths[locale])
                    locales2paths[locale] = [];
                locales2paths[locale].push(file);
            }
        });
    }

    //add core supported languages first
    extractLangs(npm.root + "/ep_etherpad-lite/locales");

    //add plugins languages (if any)
    for (var pluginName in plugins)
        extractLangs(path.join(npm.root, pluginName, 'locales'));

    // Build a locale index (merge all locale data)
    var locales = {}
    _.each(locales2paths, function (files, langcode) {
        locales[langcode] = {};

        files.forEach(function (file) {
            var fileContents = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'}));
            _.extend(locales[langcode], fileContents);
        });
    });

    return locales;
}

// returns a hash of all available languages availables with nativeName and direction
// e.g. { es: {nativeName: "español", direction: "ltr"}, ... }
function getAvailableLangs(locales) {
    var result = {};
    _.each(_.keys(locales), function (langcode) {
        result[langcode] = languages.getLanguageInfo(langcode);
    });
    return result;
}

// returns locale index that will be served in /locales.json
var generateLocaleIndex = function (locales) {
    // keep English strings
    var result = {};
    var defaultLang = settings.padOptions.lang;
    _.each(locales, function (val, key) {
        var embed = key === 'en' ||
            key === 'en-gb' ||
            key === defaultLang;
        var propVal = embed ? locales[key] : 'locales/' + key + '.json';
        result[key] = result[key] || propVal;
    });
    return JSON.stringify(result);
}

exports.expressCreateServer = function (n, args) {

    //regenerate locales on server restart
    var locales = getAllLocales();
    var localeIndex = generateLocaleIndex(locales);
    exports.availableLangs = getAvailableLangs(locales);

    args.app.get('/locales/:locale', function (req, res) {
        //works with /locale/en and /locale/en.json requests
        var locale = req.params.locale.split('.')[0];
        if (exports.availableLangs.hasOwnProperty(locale)) {
            res.setHeader('Content-Type', 'application/json; charset=utf-8');
            res.send('{"' + locale + '":' + JSON.stringify(locales[locale]) + '}');
        } else {
            res.status(404).send('Language not available');
        }
    })

    args.app.get('/locales.json', function (req, res) {
        res.setHeader('Content-Type', 'application/json; charset=utf-8');
        res.send(localeIndex);
    })

}


text:
title: Built-in Combos
order: 2
---

New feature of V3.5. There are 2 kinds of built-in combos in G6, which can be extended by [configurations](/en/docs/manual/middle/elements/combos/defaultCombo#common-property) and [custom combo mechanism](/en/docs/manual/middle/elements/combos/custom-combo). The following two examples allow users to drag the combo or node to change the hierarchy, and double click to collapse/expand a combo.

## Usage

2 built-in combos and their extensions allow users to select appropriate ones for their scenario.

Please refer to [Built-in Combos](/en/docs/manual/middle/elements/combos/built-in/circle) for more information.


text:
package vrpsim.core.model.events.strategies;

import vrpsim.core.model.events.IEventStrategy;
import vrpsim.core.model.events.impl.CloseEvent;
import vrpsim.core.model.events.impl.OpenEvent;
import vrpsim.core.model.structure.IVRPSimulationModelStructureElementWithStorage;

public interface IOpeningHoursStrategy extends IEventStrategy  {

	/**
	 * Return the {@link OpenEvent}.
	 *
	 * @param movable
	 * @return
	 */
	public OpenEvent getOpen(IVRPSimulationModelStructureElementWithStorage withStorage);

	/**
	 * Returns the {@link CloseEvent}.
	 *
	 * @param breakdownEvent
	 * @param movable
	 * @return
	 */
	public CloseEvent getClose(IVRPSimulationModelStructureElementWithStorage withStorage);

	public void reset();

}