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

    var wrapper         = $(".input_fields_wrap"); //Fields wrapper
    var wrapperContacts         = $(".input_fields_wrap_contacts"); //Fields wrapper

    var sandboxApplication = {

        init: function init(){
            $(".cDivTabSectionSandbox").hide();
            $(".cDivSpecificClientDetailsSandbox").hide();
            $("#iDivSandBoxSaveSectionWrapper").show();

            $('input:radio[name="registeringModeSandBox"]').change(
                function(){
                    if($(this).val() == "semimanual"){
                        $(".cDivTabCreateClientSandbox").show();
                        $(".cDivSpecificClientDetailsSandbox").hide();
                    }else if($(this).val() == "manual"){

                        $(".cDivSpecificClientDetailsSandbox").show();
                        $(".cDivTabCreateClientSandbox").hide();

                    }

                });
        },
        addNewCallBackURLelementSandbox :function addNewCallBackURLelementSandbox(){
            $(".cDivPlusIconSandBox").click(function(e){ //on add input button click

                $(".input_fields_wrap_sandbox").append('
<input type="text" class="input-large icallbackURLsSandBox" name="callbackURLsSandBox[]"/>
Remove

');

            });
        },
        addNewContactElementSandbox :function addNewContactElementSandbox(){
            $(".cDivPlusIconSandBoxContact").click(function(e){ //on add input button click
                e.preventDefault();
                $(".input_fields_wrap_sandbox_contacts").append('
<input type="text" class="input-large iContactsSandBox" name="iSandboxAuthAppContact[]"/>
Remove

');

            });
        },
        addNewScopeSandBox :function addNewScopeSandBox(){
            $(".cDivPlusIconScopeSandBox").click(function(e){ //on add input button click

                //alert($(".input_fields_wrap_scope").html());

                $(".input_fields_wrap_scope_sandbox").append('
<input type="text" class="input-large iScopeSandBox" name="iProductionAppScopeSandBox[]"/>
Remove

');

            });
        },
        deleteCallbackURLElementSandbox :function deleteCallbackURLElementSandbox(){
            $(".input_fields_wrap_sandbox").on("click",".remove_field_sandbox", function(e){ //user click on remove text
                e.preventDefault();
                $(this).parent('div').remove(); ;
            })
        },
        deleteContactsElementSandBox :function deleteContactsElementSandBox(){
            $(".input_fields_wrap_sandbox_contacts").on("click",".remove_field_sandbox_contact", function(e){
                e.preventDefault();
                $(this).parent('div').remove(); ;
            })
        },
        deleteScopeElementSandBox :function deleteScopeElementSandBox(){

            $(".input_fields_wrap_scope_sandbox").on("click",".remove_field_scope_sandbox", function(e){

                e.preventDefault();
                $(this).parent('div').remove();
            })
        },
        registerClientSandBox: function registerClientSandBox(){

            /* register client in OIDC server  */
            $(".btnRegisterClientSandbox").click(function(){
                //alert("dsd");
                var keyTypeSandBox = "SANDBOX";
                var applicationSandbox = $("#iHiddenApplicationNameSandBox").val();
                var clientNameSanBox = $("#iSandboxAuthAppName").val();
                var requestModeSandBox = $("#iHiddenRequestModeSandBox").val();
                var consumerKeySandBox = $(".sandBoxConsumerKey").val();

                //alert(keyType);

                var callbackUrlsArraySandBox = new Array();
                $('.icallbackURLsSandBox').each(function(){
                    if($(this).val().length >0){
                        callbackUrlsArraySandBox.push($(this).val());
                    }
                });

                //console.log(callbackUrlsArraySandBox);

                var contactArraySandBox = new Array();
                $('.iContactsSandBox').each(function(){
                    if($(this).val().length >0){
                        contactArraySandBox.push($(this).val());
                    }
                });
                //console.log(contactArraySandBox);

                var scopeArraySandBox = new Array();
                $('.iScopeSandBox').each(function(){
                    if($(this).val().length >0){
                        scopeArraySandBox.push($(this).val());
                    }
                });

                var grantArraySandBox = new Array();
                $('.iGrantsSandBox').each(function(){
                    if($(this).is(':checked')){
                        grantArraySandBox.push($(this).val());
                    }
                });

                var responseArraySandBox = new Array();
                $('.iResponseTypeSandBox').each(function(){
                    if($(this).is(':checked')){
                        responseArraySandBox.push($(this).val());
                    }
                });

                var authMethod = null;

                $(".iAuthMethodSandBox").each(function(){
                    if (this.checked)
                    {
                        authMethod = this.value;
                    }
                });

                if(callbackUrlsArraySandBox.length != 0) {
                    var oJsonParams =
                        {
                            //"application":applicationSandbox,
                            "client_name": clientNameSanBox,
                            //"key_type" : keyTypeSandBox,
                            "callback_url": callbackUrlsArraySandBox,
                            "client_id": consumerKeySandBox,
                            "contact": contactArraySandBox,
                            "scope": scopeArraySandBox,
                            "grant_types": grantArraySandBox,
                            "response_types": responseArraySandBox,
                            "token_endpoint_auth_method": authMethod
                        }
                        ;
                    //console.log(oJsonParams);
                    jagg.post("/site/blocks/subscription/subscription-add/ajax/subscription-add.jag", {
                        action: requestModeSandBox,
                        application: applicationSandbox,
                        key_type: keyTypeSandBox,
                        jsonParams: JSON.stringify(oJsonParams)

                    }, function (result) {
                        if (!result.error) {
                            location.reload();
                        } else {
                            jagg.message({content: result.message, type: "error"});
                        }

                    }, "json");
                }else{
                    alert("Callback URLs can not be empty");
                }

            });

        },
        updateActionClickSandBox : function updateActionClickSandBox(){
            $("#iDivUpdateActionSandbox").click(function(){
                $(".cDivTabSectionSandbox").show();
                $(".cDivAuthAppListSandBox").hide();
            });
        },
        deleteActionClickSandBox : function deleteActionClickSandBox(){
            $("#iDivDeleteActionSandbox").click(function(){

                var r = confirm("Do you want to delete this sandbox auth app from OIDC");
                if (r == true) {
                    sandboxApplication.deleteAuthApplicationSandBox();
                }

            });
        },
        deleteAuthApplicationSandBox : function deleteAuthApplicationSandBox(){
            var consumerKey = $(".sandBoxConsumerKey").val();

            jagg.post("/site/blocks/subscription/subscription-add/ajax/subscription-add.jag", {
                action:"deleteAuthApplication",
                consumerKey:consumerKey

            }, function (result) {
                if (!result.error) {
                    location.reload();
                }else {
                    jagg.message({content:result.message,type:"error"});
                }

            }, "json");

        },
        cancleBtnClickSandBox : function cancleBtnClickSandBox(){
            $(".btnCancleUpdateSandBox").click(function(){
                $(".cDivTabSectionSandbox").hide();
                $(".cDivAuthAppListSandBox").show();

            });
        },
        addDefaultScope : function addDefaultScope(){

            if(!$(".sandBoxConsumerKey").val()){
                var scopeArraySandBox = ["phone", "openid", "offline_access", "address", "email", "profile"];
                var arrayLength = scopeArraySandBox.length;
                for (var i = 0; i < arrayLength; i++) {
                    $(".input_fields_wrap_scope_sandbox").append('
<input type="text" class="input-large iScopeSandBox" value="'+scopeArraySandBox[i]+'" name="iProductionAppScopeSandBox[]"/>
Remove

');
                }

            }
        },
        toogleSandBoxSave : function toogleSandBoxSave(){
            $( "#iSandBoxToogleBtn" ).click(function() {
                $("#iDivSandBoxSaveSectionWrapper").show();
                $( "#iSandBoxToogle").hide();
            });
            ;
        },
        cancelCreateSandboxApp: function cancelCreateSandboxApp(){
            $(".btnCancleCreateSandBox").click(function(){
                //$( "#iDivSandBoxSaveSectionWrapper").hide();
                //$( "#iSandBoxToogle").show();
            });
        },
        iBtnCancleUpdateSandbox: function iBtnCancleUpdateSandbox(){
            $(".iBtnCancleUpdateSandbox").click(function(){

                $( ".cDivTabSectionSandbox").hide();
                $( ".cDivAuthAppListSandBox").show();
            });
        },
        iBtnCancelCreateApp:function iBtnCancelCreateApp(){
            $(".iBtnCancelCreateApp").click(function(){
                $(".cDivTabSection").hide();
                $(".cDivAuthAppList").show();
            });
        }

    };

    sandboxApplication.init();
    sandboxApplication.addNewCallBackURLelementSandbox();
    sandboxApplication.deleteCallbackURLElementSandbox();
    sandboxApplication.addNewContactElementSandbox();
    sandboxApplication.deleteContactsElementSandBox();
    sandboxApplication.registerClientSandBox();
    sandboxApplication.addNewScopeSandBox();
    sandboxApplication.deleteScopeElementSandBox();
    sandboxApplication.addDefaultScope();
    sandboxApplication.updateActionClickSandBox();
    sandboxApplication.cancleBtnClickSandBox();
    sandboxApplication.deleteActionClickSandBox();
    sandboxApplication.toogleSandBoxSave();
    sandboxApplication.cancelCreateSandboxApp();
    sandboxApplication.iBtnCancleUpdateSandbox();

    var productionApplication = {

        init: function init(){
            $(".cDivTabSection").hide();
            $(".cDivSpecificClientDetails").hide();
            $("#iDivProductionSaveSectionWrapper").show();

            $('input:radio[name="registeringMode"]').change(
                function(){

                    if($(this).val() == "semimanual"){
                        $(".cDivTabCreateClient").show();
                        $(".cDivSpecificClientDetails").hide();
                    }else if($(this).val() == "manual"){
                        $(".cDivSpecificClientDetails").show();
                        $(".cDivTabCreateClient").hide();

                    }

                });
        },
        toogleProductionSave : function toogleProductionSave(){
            $( "#iDivProductionToogle" ).click(function() {
                $("#iDivProductionSaveSectionWrapper").show();
                $( "#iDivProductionToogle").hide();
            });
            ;
        },
        cancelCreateApp: function cancelCreateApp(){
            $(".btnCancleCreateProduction").click(function(){

                //$( "#iDivProductionSaveSectionWrapper").hide();
                //$( "#iDivProductionToogle").show();
            });
        },

        addNewCallBackURLelementProduction :function addNewCallBackURLelementProduction(){
            $(".cDivPlusIcon").click(function(e){ //on add input button click

                $(wrapper).append('
<input type="text" class="input-large iCallBackUrls" name="callbackURLs[]"/>
Remove

');

            });
        },
        addNewContactElement :function addNewContactElement(){
            $(".cDivPlusIconContact").click(function(e){ //on add input button click
                e.preventDefault();
                $(wrapperContacts).append('
<input type="text" class="input-large iContacts" name="iProductionAuthAppContact[]"/>
Remove

');

            });
        },
        addNewScope :function addNewScope(){
            $(".cDivPlusIconScope").click(function(e){ //on add input button click

                //alert($(".input_fields_wrap_scope").html());

                $(".input_fields_wrap_scope").append('
<input type="text" class="input-large iScope" name="iProductionAppScope[]"/>
Remove

');

            });
        },
        deleteCallbackURLElement :function deleteCallbackURLElement(){
            $(wrapper).on("click",".remove_field", function(e){ //user click on remove text
                e.preventDefault();
                $(this).parent('div').remove(); ;
            })
        },
        deleteContactsElement :function deleteContactsElement(){
            $(wrapperContacts).on("click",".remove_field_contact", function(e){
                e.preventDefault();
                $(this).parent('div').remove(); ;
            })
        },
        deleteScopeElement :function deleteScopeElement(){

            $(".input_fields_wrap_scope").on("click",".remove_field_scope", function(e){

                e.preventDefault();
                $(this).parent('div').remove();
            })
        },
        registerClientProduction: function registerClientProduction(){

            $(".btnRegisterClientProduction").click(function(){
                var keyType = "PRODUCTION";
                var allowDomains = $('#allowedDomainsPro').val();
                var application = $("#iHiddenApplicationName").val();
                var clientName = $("#iProductionAuthAppName").val();
                var requestMode = $("#iHiddenRequestMode").val();
                var consumerKey = $(".prodConsumerKey").val();

                //alert(allowDomains);

                var callbackUrlsArray = new Array();
                $('.iCallBackUrls').each(function(){
                    if($(this).val().length >0){
                        callbackUrlsArray.push($(this).val());
                    }
                });

                var contactArray = new Array();
                $('.iContacts').each(function(){
                    if($(this).val().length >0){
                        contactArray.push($(this).val());
                    }
                });

                var scopeArray = new Array();
                $('.iScope').each(function(){
                    if($(this).val().length >0){
                        scopeArray.push($(this).val());
                    }
                });
                var grantArray = new Array();
                $('.iGrants').each(function(){
                    if($(this).is(':checked')){
                        grantArray.push($(this).val());
                    }
                });
                var responseArray = new Array();
                $('.iResponseType').each(function(){
                    if($(this).is(':checked')){
                        responseArray.push($(this).val());
                    }
                });

                var authMethod = null;

                $(".iAuthMethod").each(function(){
                    if (this.checked)
                    {
                        authMethod = this.value;
                    }
                });

                if(callbackUrlsArray.length != 0) {
                    var oJsonParams =
                        {
                            //"application":application,
                            "client_name": clientName,
                            "allowDomains": allowDomains,
                            "callback_url": callbackUrlsArray,
                            "client_id": consumerKey,
                            "contact": contactArray,
                            "scope": scopeArray,
                            "grant_types": grantArray,
                            "response_types": responseArray,
                            "token_endpoint_auth_method": authMethod
                        }
                        ;
                    //console.log(oJsonParams);
                    jagg.post("/site/blocks/subscription/subscription-add/ajax/subscription-add.jag", {
                        action: requestMode,
                        application: application,
                        key_type: keyType,
                        jsonParams: JSON.stringify(oJsonParams)

                    }, function (result) {
                        if (!result.error) {
                            location.reload();
                        } else {
                            jagg.message({content: result.message, type: "error"});
                        }

                    }, "json");
                }else{
                    alert("Callback URLs can not be empty");
                }

            });

        },
        updateActionClick : function updateActionClick(){
            $("#iDivUpdateAction").click(function(){

                $(".cDivTabSection").show();
                $(".cDivAuthAppList").hide();

            });
        },
        deleteActionClick : function deleteActionClick(){
            $("#iDivDeleteAction").click(function(){

                var r = confirm("Do you want to delete this auth app from OIDC");
                if (r == true) {
                    productionApplication.deleteAuthApplication();
                }

            });
        },
        deleteAuthApplication : function deleteAuthApp(){
            var consumerKey = $(".prodConsumerKey").val();

                jagg.post("/site/blocks/subscription/subscription-add/ajax/subscription-add.jag", {
                    action:"deleteAuthApplication",
                    consumerKey:consumerKey

                }, function (result) {
                    if (!result.error) {
                        location.reload();
                    }else {
                        jagg.message({content:result.message,type:"error"});
                    }

                }, "json");

        },
        cancleBtnClick : function cancleBtnClick(){
            $(".btnCancleUpdate").click(function(){

                $(".cDivTabSection").hide();
                $(".cDivAuthAppList").show();

            });
        },
        addDefaultScope : function addDefaultScope(){

            if(!$(".prodConsumerKey").val()){
                var scopeArray = ["phone", "openid", "offline_access", "address", "email", "profile"];
                var arrayLength = scopeArray.length;
                for (var i = 0; i < arrayLength; i++) {
                    $(".input_fields_wrap_scope").append('
<input type="text" class="input-large iScope" value="'+scopeArray[i]+'" name="iProductionAppScope[]"/>
Remove

');
                }

            }
        },
        iBtnCancelCreateApp:function iBtnCancelCreateApp(){
            $(".iBtnCancelCreateApp").click(function(){
                $(".cDivTabSection").hide();
                $(".cDivAuthAppList").show();
            });
        }
    };
    productionApplication.init();
    productionApplication.addNewCallBackURLelementProduction();
    productionApplication.addNewContactElement();
    productionApplication.deleteCallbackURLElement();
    productionApplication.deleteContactsElement();
    productionApplication.registerClientProduction();
    productionApplication.updateActionClick();
    productionApplication.deleteActionClick();
    //productionApplication.deleteAuthApp();
    productionApplication.cancleBtnClick();
    productionApplication.addNewScope();
    productionApplication.deleteScopeElement();
    productionApplication.addDefaultScope();
    productionApplication.toogleProductionSave();
    productionApplication.cancelCreateApp();
    productionApplication.iBtnCancelCreateApp();

});


text:
#ifndef _ARSTREAM_TB_CONFIG_H_
#define _ARSTREAM_TB_CONFIG_H_

#define ARSTREAM_TB_FRAG_SIZE (65000)
#define ARSTREAM_TB_MAX_NB_FRAG (4)

#endif /* _ARSTREAM_TB_CONFIG_H_ */

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace artkost\imagestyle;

use yii\base\Component;
use yii\base\InvalidCallException;
use yii\helpers\FileHelper;

/**
 * Class ImageStyle
 *
 * @property string $filePath
 */
class ImageStyle extends Component
{
    /**
     * @var string
     */
    public $dirUrl;

    /**
     * @var string
     */
    public $dirPath;

    /**
     * @var \Closure
     */
    public $handler;

    /**
     * @var string
     */
    public $name;

    /**
     * @var ImageStyleBehavior
     */
    public $behavior;

    /**
     * @return string
     */
    public function getFilePath()
    {
        return $this->behavior->getFilePath();
    }

    /**
     * @return string
     */
    public function getUrl()
    {
        return $this->dirUrl . '/' . $this->name . '/' . $this->filePath;
    }

    /**
     * @return string
     */
    public function getPath()
    {
        return $this->dirPath . DIRECTORY_SEPARATOR . $this->name . DIRECTORY_SEPARATOR . $this->filePath;
    }

    /**
     * @return string
     */
    public function getDirPath()
    {
        return dirname($this->getPath());
    }

    /**
     * @return bool
     */
    public function isExists()
    {
        return is_file($this->getPath());
    }

    /**
     * @return bool status
     */
    public function save()
    {
        if (! FileHelper::createDirectory($this->getDirPath())) {
            throw new InvalidCallException("Directory '{$this->getDirPath()}' doesn't exist or cannot be created.");
        }

        if (is_callable($this->handler)) {
            return call_user_func_array($this->handler, [$this]);
        } else {
            throw new InvalidCallException("Style function for {$this->name} not callable");
        }
    }

    public function delete()
    {
        if ($this->isExists()) {
            unlink($this->getPath());
        }
    }
}


text:
Firefox search tool for Woordenlijst.org, the Dutch Word List

_Firefoxzoekgereedschap voor Woordenlijst.org, de Nederlandse Woordenlijst_

http://woordenlijst.org


text:
package ch.qos.logback.core.status;

import java.util.ArrayList;
import java.util.List;

import ch.qos.logback.core.spi.LifeCycle;
import ch.qos.logback.core.status.Status;
import ch.qos.logback.core.status.StatusListener;

public class TrivialStatusListener implements StatusListener, LifeCycle {

  public List<Status> list = new ArrayList<Status>();
  boolean start = false;

  public void addStatusEvent(Status status) {
    if(!isStarted())
      return;
    list.add(status);
  }

  public void start() {
    start = true;
  }

  public void stop() {
    start = false;
  }

  public boolean isStarted() {
    return start;
  }
}


text:
Forms
=====

``Flask-Velox`` comes with SQLAlchemy form integration to hopefully make
those Create / Update tasks as simple as possible.

.. note::
    The following packages must be installed:

    * ``Flask-SQLAlchemy``
    * ``Flask-WTF``

.. _create-view:

Create View
-----------

The ``CreateModelView`` allows you to render a form and on successful
validation of the form creates a new object and saves to the database. You will
ofcourse need to make the form yourself, you could use `WTForms-Alchemy`_ to
automate this for you, example below:

This view is almost identical to the :ref:`Form View <form-view>` we have seen
before except that the view mixis in the ability to create an object populated
with data from the form and save that object. You can see how the success
callback function works here:

* :py:meth:`flask_velox.mixins.sqla.forms.BaseCreateUpdateMixin.success_callback`

.. code-block:: python

    from flask.ext.wtf import Form
    from flask.ext.velox.views.sqla import forms
    from wtforms import TextField
    from yourapp import db

    class MyModel(db.Model):
        field1 = db.Column(db.String(20))
        field2 = db.Column(db.String(128))

    class MyForm(Form):
        field1 = TextField()
        field2 = TextField()

    class MyCreateView(forms.CreateModelView):
        model = MyModel
        session = db.session
        form = MyForm
        template = 'create.html'

You will ofcourse need a template for rendering the form, see an
:ref:`Example Template <form-view-example-template>` in the
:ref:`Form View <form-view>` guide.

As with the :ref:`Form View <form-view>` you can override the success callback
function, redirect url etc.

.. _update-view:

Update View
-----------

The Update View follows the same principle as the :ref:`Create View
<create-view>` except that the form is instantiated with an existing object
which you can see documented here:

* :py:meth:`flask_velox.mixins.sqla.forms.UpdateModelFormMixin.instantiate_form`

.. code-block:: python

    class MyUpdateView(forms.UpdateModelView):
        model = MyModel
        session = db.session
        form = MyForm
        template = 'update.html'

Multi Form Update View
----------------------

There can sometimes be the requirement for multiple forms to update a single
object which offer different functionality, an example situation is updating
a user object where a password change form needs to be seperate from the
general user attributes form. This view allows us to do this.

Again it follows the same principles as the :ref:`create-view` and
:ref:`update-view`.

.. seealso::

    * :ref:`multi-form-view`

.. code-block:: python

    from flask.ext.velox.views.sqla import forms
    from yourapp import db
    from yourapp.forms import UserPasswordForm, UserUpdateForm
    from yourapp.models import User

    class MyMultiFormView(forms.UpdateModelMultiFormView):
        model = User
        session = db.sesion
        forms = [
            ('Change Password', UserPasswordForm)
            ('Update User', UserUpdateForm)
        ]
        template = 'mutli.html'

You can see an example template :ref:`here <multi-form-view-example-template>`.

.. _`WTForms-Alchemy`: http://wtforms-alchemy.readthedocs.org/en/latest/


text:
<!DOCTYPE HTML>

<meta charset="UTF-8">
<title>Elmore delay sizing for a straight wire (GP)</title>
<link rel="canonical" href="http://cvxr.com/cvx/examples/circuit_design/html/elmore_straight_wire.html">
<link rel="stylesheet" href="../../examples.css" type="text/css">

Elmore delay sizing for a straight wire (GP)

Jump to:
Source code
Text output

Plots
    Library index

% Boyd, "Problems in VLSI design" (Lecture)
% Written for CVX by Almir Mutapcic 02/08/06
%
% We consider the problem of finding optimal width profile
% for a straight wire segmented into N parts. We want to
% minimize the Elmore delay, subject to limits on wire width
% and the total area. We use a pi-model for each wire segment.
% Problem can be formulated as GP:
%
%   minimize   D
%       s.t.   w_min <= w <= w_max
%              area  <= Amax
%
% where variables are widths w (and arrival times T that are used
% to formulate the overall delay D expression).
%
% Important: We label root node as 1, and all the other nodes as
%            node_label_in_the_paper + 1 (due to Matlab's convention).
%            Also label nodes with increasing numbers downstream.

%********************************************************************
% user supplied data (problem constants and tree topology)
%********************************************************************
N = 10+1; % number of segments (including the root node which is labeled as 1)

% parent node array for the straight wire
% specifies which node is a unique parent for node i (always have a tree)
parent = [0:N-1];

% problem constants
Rsource = 0.1;
l = 1*ones(N-1,1);
alpha = 1*ones(N-1,1);
beta  = 1*ones(N-1,1);
gamma = 1*ones(N-1,1);

% load capacitance at each node
Cload = [0; ones(N-1,1)];

% minimum and maximum width and area specification
Wmin = 1;
Wmax = 10;
Amax = 50;

%********************************************************************
% derived data (computed from user's data)
%********************************************************************
% compute children cell array (evaluate who are children for each node)
children = cell(N,1);
leafs = [];
for node = [1:N]
  children{node} = find(parent == node);
  if isempty(children{node})
    leafs(end+1) = node; % leafs have no children
  end
end

%********************************************************************
% optimization
%********************************************************************

disp('Generating the tradeoff curve...')
Darray = []; widths = [];
for Amax = [10.05 10.5 11 12:2:20 22.5 25:5:60]
    fprintf( 'Amax = %5.2f: ', Amax );
    cvx_begin gp quiet
        % optimization variables
        variable w(N-1)     % wire width
        variable T(N)       % arrival time (Elmore delay to node i)

        % objective is the critical Elmore delay
        minimize( max( T(leafs) ) )
        subject to

          % wire segment resistance is inversely proportional to widths
          R = alpha.*l./w;
          R = [Rsource; R];

          % wire segment capacitance is an affine function of widths
          C_bar = beta.*l.*w + gamma.*l;
          C_bar = [0; C_bar];

          % compute common capacitances for each node (C_tilde in GP tutorial)
          C_tilde = cvx( zeros(N,1) );
          for node = [1:N]
            C_tilde(node,1) = Cload(node);
            for k = parent(node)
              if k > 0; C_tilde(node,1) = C_tilde(node,1) + C_bar(k); end;
            end
            for k = children{node}
              C_tilde(node,1) = C_tilde(node,1) + C_bar(k);
            end
          end

          % now compute total downstream capacitances
          C_total = C_tilde;
          for node = N:-1:1
            for k = children{node}
              C_total(node,1) = C_total(node,1) + C_total(k,1);
            end
          end

        % generate Elmore delay constraints
        R(1)*C_total(1) <= T(1,1);
        for node = 2:N
          R(node)*C_total(node) + T(parent(node),1) <= T(node,1);
        end

        % collect all the constraints
        sum(w.*l) <= Amax;
        Wmin <= w <= Wmax;
    cvx_end
    % display and store computed values
    fprintf('delay = %3.2f\n',cvx_optval);
    Darray = [Darray cvx_optval];
    widths = [widths w];
end

% indices of four taper designs on the tradeoff curve
Amax = [10.05 10.5 11 12:2:20 22.5 25:5:60];
A11ind = find(Amax == 11);
A20ind = find(Amax == 20);
A35ind = find(Amax == 35);
A50ind = find(Amax == 50);

% plot the tradeoff curve
figure, clf
plot(Darray,Amax, ...
     Darray(A11ind),Amax(A11ind),'ro',...
     Darray(A20ind),Amax(A20ind),'ro',...
     Darray(A35ind),Amax(A35ind),'ro',...
     Darray(A50ind),Amax(A50ind),'ro');
xlabel('Elmore delay D'); ylabel('Amax');
disp('Optimal tradeoff curve plotted.')

% plot four taper designs
figure, clf
w1 = widths(:,A50ind);
w2 = widths(:,A35ind);
w3 = widths(:,A20ind);
w4 = widths(:,A11ind);
plot_four_tapers(w1,w2,w3,w4);

Generating the tradeoff curve...
Amax = 10.05: delay = 255.72
Amax = 10.50: delay = 241.04
Amax = 11.00: delay = 228.67
Amax = 12.00: delay = 209.98
Amax = 14.00: delay = 184.90
Amax = 16.00: delay = 168.19
Amax = 18.00: delay = 156.01
Amax = 20.00: delay = 146.74
Amax = 22.50: delay = 137.78
Amax = 25.00: delay = 130.82
Amax = 30.00: delay = 120.77
Amax = 35.00: delay = 113.95
Amax = 40.00: delay = 109.06
Amax = 45.00: delay = 105.43
Amax = 50.00: delay = 102.96
Amax = 55.00: delay = 101.76
Amax = 60.00: delay = 101.60
Optimal tradeoff curve plotted.


text:
__END__

=head1 NAME

SOAP::Transport::HTTP - Server/Client side HTTP support for SOAP::Lite

=head1 SYNOPSIS

=over 4

=item Client

  use SOAP::Lite
    uri => 'http://my.own.site.com/My/Examples',
    proxy => 'http://localhost/',
  # proxy => 'http://localhost/cgi-bin/soap.cgi', # local CGI server
  # proxy => 'http://localhost/',                 # local daemon server
  # proxy => 'http://localhost/soap',             # local mod_perl server
  # proxy => 'https://localhost/soap',            # local mod_perl SECURE server
  # proxy => 'http://login:password@localhost/cgi-bin/soap.cgi', # local CGI server with authentication
  ;

  print getStateName(1);

=item CGI server

  use SOAP::Transport::HTTP;

  SOAP::Transport::HTTP::CGI
    # specify path to My/Examples.pm here
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method')
    -> handle
  ;

=item Daemon server

  use SOAP::Transport::HTTP;

  # change LocalPort to 81 if you want to test it with soapmark.pl

  my $daemon = SOAP::Transport::HTTP::Daemon
    -> new (LocalAddr => 'localhost', LocalPort => 80)
    # specify list of objects-by-reference here
    -> objects_by_reference(qw(My::PersistentIterator My::SessionIterator My::Chat))
    # specify path to My/Examples.pm here
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method')
  ;
  print "Contact to SOAP server at ", $daemon->url, "\n";
  $daemon->handle;

=item Apache mod_perl server

See F<examples/server/Apache.pm> and L</"EXAMPLES"> section for more information.

=item mod_soap server (.htaccess, directory-based access)

  SetHandler perl-script
  PerlHandler Apache::SOAP
  PerlSetVar dispatch_to "/Your/Path/To/Deployed/Modules, Module::Name, Module::method"
  PerlSetVar options "compress_threshold => 10000"

See L<Apache::SOAP> for more information.

=back

=head1 DESCRIPTION

This class encapsulates all HTTP related logic for a SOAP server,
independent of what web server it's attached to.
If you want to use this class you should follow simple guideline
mentioned above.

Following methods are available:

=over 4

=item on_action()

on_action method lets you specify SOAPAction understanding. It accepts
reference to subroutine that takes three parameters:

  SOAPAction, method_uri and method_name.

C<SOAPAction> is taken from HTTP header and method_uri and method_name are
extracted from request's body. Default behavior is match C<SOAPAction> if
present and ignore it otherwise. You can specify you own, for example
die if C<SOAPAction> doesn't match with following code:

  $server->on_action(sub {
    (my $action = shift) =~ s/^("?)(.+)\1$/$2/;
    die "SOAPAction shall match 'uri#method'\n" if $action ne join '#', @_;
  });

=item dispatch_to()

dispatch_to lets you specify where you want to dispatch your services
to. More precisely, you can specify C<PATH>, C<MODULE>, C<method> or
combination C<MODULE::method>. Example:

  dispatch_to(
    'PATH/',          # dynamic: load anything from there, any module, any method
    'MODULE',         # static: any method from this module
    'MODULE::method', # static: specified method from this module
    'method',         # static: specified method from main::
  );

If you specify C<PATH/> name of module/classes will be taken from uri as
path component and converted to Perl module name with substitution
'::' for '/'. Example:

  urn:My/Examples              => My::Examples
  urn://localhost/My/Examples  => My::Examples
  http://localhost/My/Examples => My::Examples

For consistency first '/' in the path will be ignored.

According to this scheme to deploy new class you should put this
class in one of the specified directories and enjoy its services.
Easy, eh?

=item handle()

handle method will handle your request. You should provide parameters
with request() method, call handle() and get it back with response() .

=item request()

request method gives you access to HTTP::Request object which you
can provide for Server component to handle request.

=item response()

response method gives you access to HTTP::Response object which
you can access to get results from Server component after request was
handled.

=back

=head2 PROXY SETTINGS

You can use any proxy setting you use with LWP::UserAgent modules:

 SOAP::Lite->proxy('http://endpoint.server/',
                   proxy => ['http' => 'http://my.proxy.server']);

or

 $soap->transport->proxy('http' => 'http://my.proxy.server');

should specify proxy server for you. And if you use C<HTTP_proxy_user>
and C<HTTP_proxy_pass> for proxy authorization SOAP::Lite should know
how to handle it properly.

=head2 COOKIE-BASED AUTHENTICATION

  use HTTP::Cookies;

  my $cookies = HTTP::Cookies->new(ignore_discard => 1);
    # you may also add 'file' if you want to keep them between sessions

  my $soap = SOAP::Lite->proxy('http://localhost/');
  $soap->transport->cookie_jar($cookies);

Cookies will be taken from response and provided for request. You may
always add another cookie (or extract what you need after response)
with HTTP::Cookies interface.

You may also do it in one line:

  $soap->proxy('http://localhost/',
               cookie_jar => HTTP::Cookies->new(ignore_discard => 1));

=head2 SSL CERTIFICATE AUTHENTICATION

To get certificate authentication working you need to specify three
environment variables: C<HTTPS_CERT_FILE>, C<HTTPS_KEY_FILE>, and
(optionally) C<HTTPS_CERT_PASS>:

  $ENV{HTTPS_CERT_FILE} = 'client-cert.pem';
  $ENV{HTTPS_KEY_FILE}  = 'client-key.pem';

Crypt::SSLeay (which is used for https support) will take care about
everything else. Other options (like CA peer verification) can be specified
in a similar way. See Crypt::SSLeay documentation for more details.

Those who would like to use encrypted keys may check
http://groups.yahoo.com/group/soaplite/message/729 for details.

=head2 COMPRESSION

SOAP::Lite provides you with the option for enabling compression on the
wire (for HTTP transport only). Both server and client should support
this capability, but this should be absolutely transparent to your
application. The Server will respond with an encoded message only if
the client can accept it (indicated by client sending an Accept-Encoding
header with 'deflate' or '*' values) and client has fallback logic,
so if server doesn't understand specified encoding
(Content-Encoding: deflate) and returns proper error code
(415 NOT ACCEPTABLE) client will repeat the same request without encoding
and will store this server in a per-session cache, so all other requests
will go there without encoding.

Having options on client and server side that let you specify threshold
for compression you can safely enable this feature on both client and
server side.

=over 4

=item Client

  print SOAP::Lite
    -> uri('http://localhost/My/Parameters')
    -> proxy('http://localhost/', options => {compress_threshold => 10000})
    -> echo(1 x 10000)
    -> result
  ;

=item Server

  my $server = SOAP::Transport::HTTP::CGI
    -> dispatch_to('My::Parameters')
    -> options({compress_threshold => 10000})
    -> handle;

=back

Compression will be enabled on the client side
B<if> the threshold is specified
B<and> the size of current message is bigger than the threshold
B<and> the module Compress::Zlib is available.

The Client will send the header 'Accept-Encoding' with value 'deflate'
B<if> the threshold is specified
B<and> the module Compress::Zlib is available.

Server will accept the compressed message if the module Compress::Zlib
is available, and will respond with the compressed message
B<only if> the threshold is specified
B<and> the size of the current message is bigger than the threshold
B<and> the module Compress::Zlib is available
B<and> the header 'Accept-Encoding' is presented in the request.

=head1 EXAMPLES

Consider following examples of SOAP servers:

=over 4

=item CGI:

  use SOAP::Transport::HTTP;

  SOAP::Transport::HTTP::CGI
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method')
    -> handle
  ;

=item daemon:

  use SOAP::Transport::HTTP;

  my $daemon = SOAP::Transport::HTTP::Daemon
    -> new (LocalAddr => 'localhost', LocalPort => 80)
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method')
  ;
  print "Contact to SOAP server at ", $daemon->url, "\n";
  $daemon->handle;

=item mod_perl:

httpd.conf:

  <Location /soap>
    SetHandler perl-script
    PerlHandler SOAP::Apache
  </Location>

Apache.pm:

  package SOAP::Apache;

  use SOAP::Transport::HTTP;

  my $server = SOAP::Transport::HTTP::Apache
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method');

  sub handler { $server->handler(@_) }

  1;

=item Apache::Registry:

httpd.conf:

  Alias /mod_perl/ "/Apache/mod_perl/"
  <Location /mod_perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    PerlSendHeader On
    Options +ExecCGI
  </Location>

soap.mod_cgi (put it in /Apache/mod_perl/ directory mentioned above)

  use SOAP::Transport::HTTP;

  SOAP::Transport::HTTP::CGI
    -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method')
    -> handle
  ;

=back

WARNING: dynamic deployment with Apache::Registry will fail, because
module will be loaded dynamically only for the first time. After that
it is already in the memory, that will bypass dynamic deployment and
produces error about denied access. Specify both PATH/ and MODULE name
in dispatch_to() and module will be loaded dynamically and then will work
as under static deployment. See examples/server/soap.mod_cgi for example.

=head1 TROUBLESHOOTING

=over 4

=item Dynamic libraries are not found

If you see in webserver's log file something like this:

Can't load '/usr/local/lib/perl5/site_perl/.../XML/Parser/Expat/Expat.so'
for module XML::Parser::Expat: dynamic linker: /usr/local/bin/perl:
 libexpat.so.0 is NEEDED, but object does not exist at
/usr/local/lib/perl5/.../DynaLoader.pm line 200.

and you are using Apache web server, try to put into your httpd.conf

 <IfModule mod_env.c>
     PassEnv LD_LIBRARY_PATH
 </IfModule>

=item Apache is crashing with segfaults (it may looks like "500 unexpected EOF before status line seen" on client side)

If using SOAP::Lite (or XML::Parser::Expat) in combination with mod_perl
causes random segmentation faults in httpd processes try to configure
Apache with:

 RULE_EXPAT=no

-- OR (for Apache 1.3.20 and later) --

 ./configure --disable-rule=EXPAT

See http://archive.covalent.net/modperl/2000/04/0185.xml for more
details and lot of thanks to Robert Barta <rho@bigpond.net.au> for
explaining this weird behavior.

If it doesn't help, you may also try -Uusemymalloc
(or something like that) to get perl to use the system's own malloc.
Thanks to Tim Bunce <Tim.Bunce@pobox.com>.

=item CGI scripts are not running under Microsoft Internet Information Server (IIS)

CGI scripts may not work under IIS unless scripts are .pl, not .cgi.

=back

=head1 DEPENDENCIES

 Crypt::SSLeay             for HTTPS/SSL
 SOAP::Lite, URI           for SOAP::Transport::HTTP::Server
 LWP::UserAgent, URI       for SOAP::Transport::HTTP::Client
 HTTP::Daemon              for SOAP::Transport::HTTP::Daemon
 Apache, Apache::Constants for SOAP::Transport::HTTP::Apache

=head1 SEE ALSO

 See ::CGI, ::Daemon and ::Apache for implementation details.
 See examples/server/soap.cgi as SOAP::Transport::HTTP::CGI example.
 See examples/server/soap.daemon as SOAP::Transport::HTTP::Daemon example.
 See examples/My/Apache.pm as SOAP::Transport::HTTP::Apache example.

=head1 COPYRIGHT

Copyright (C) 2000-2001 Paul Kulchenko. All rights reserved.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 AUTHOR

Paul Kulchenko (paulclinger@yahoo.com)

=cut


text:
source $HOME/.dotfiles/bootstrap/lib/helpers.sh

running "Installing tmux plugins"
~/.tmux/plugins/tpm/bin/install_plugins


text:
require 'openstudio'
require 'openstudio/ruleset/ShowRunnerOutput'
require 'minitest/autorun'
require_relative '../measure.rb'
require 'fileutils'

class CreateAWaterHeaterMixedAndAssignItsSourceAndUseSidesTest < MiniTest::Unit::TestCase

  # def setup
  # end

  # def teardown
  # end

  def test_number_of_arguments_and_argument_names
    # create an instance of the measure
    measure = CreateAWaterHeaterMixedAndAssignItsSourceAndUseSides.new

    # make an empty model
    model = OpenStudio::Model::Model.new

    # get arguments and test that they are what we are expecting
    arguments = measure.arguments(model)
    assert_equal(3, arguments.size)
    assert_equal("tank_name", arguments[0].name)
    assert_equal("source_loop", arguments[1].name)
    assert_equal("use_loop", arguments[2].name)
  end

  def test_bad_argument_values_same_loop
    # create an instance of the measure
    measure = CreateAWaterHeaterMixedAndAssignItsSourceAndUseSides.new

    # create an instance of a runner
    runner = OpenStudio::Ruleset::OSRunner.new

    # make an empty model
    model = OpenStudio::Model::Model.new

    # Create a boiler loop
    source_loop = OpenStudio::Model::PlantLoop.new(model)
    source_loop.setName("Boiler Plant Loop")

    # Create a DHW loop
    use_loop = OpenStudio::Model::PlantLoop.new(model)
    use_loop.setName("DHW Plant Loop")

    # get arguments
    arguments = measure.arguments(model)
    argument_map = OpenStudio::Ruleset.convertOSArgumentVectorToMap(arguments)

    # create hash of argument values
    args_hash = {}
    args_hash["tank_name"] = "Storage tank"
    args_hash["source_loop"] = source_loop.handle.to_s
    args_hash["use_loop"] = source_loop.handle.to_s

    # populate argument with specified hash value if specified
    arguments.each do |arg|
      temp_arg_var = arg.clone
      # Check if exists
      if args_hash.has_key?(arg.name)
        assert(temp_arg_var.setValue(args_hash[arg.name]))
      end
      argument_map[arg.name] = temp_arg_var
    end

    # run the measure
    measure.run(model, runner, argument_map)
    result = runner.result

    # show the output
    show_output(result)

    # assert that it ran correctly
    assert_equal("Fail", result.value.valueName)
  end

  def test_good_argument_values
    # create an instance of the measure
    measure = CreateAWaterHeaterMixedAndAssignItsSourceAndUseSides.new

    # create an instance of a runner
    runner = OpenStudio::Ruleset::OSRunner.new

    # make an empty model
    model = OpenStudio::Model::Model.new

    # Create a boiler loop
    source_loop = OpenStudio::Model::PlantLoop.new(model)
    source_loop.setName("Boiler Plant Loop")

    # Create a DHW loop
    use_loop = OpenStudio::Model::PlantLoop.new(model)
    use_loop.setName("DHW Plant Loop")

    # get arguments
    arguments = measure.arguments(model)
    argument_map = OpenStudio::Ruleset.convertOSArgumentVectorToMap(arguments)

    # create hash of argument values
    args_hash = {}
    args_hash["tank_name"] = "Storage tank"
    args_hash["source_loop"] = source_loop.handle.to_s
    args_hash["use_loop"] = use_loop.handle.to_s

    # populate argument with specified hash value if specified
    arguments.each do |arg|
      temp_arg_var = arg.clone
      # Check if exists
      if args_hash.has_key?(arg.name)
        assert(temp_arg_var.setValue(args_hash[arg.name]))
      end
      argument_map[arg.name] = temp_arg_var
    end

    # run the measure
    measure.run(model, runner, argument_map)
    result = runner.result

    # show the output
    show_output(result)

    # assert that it ran correctly
    assert_equal("Success", result.value.valueName)
    assert(result.info.size == 0)
    assert(result.warnings.size == 0)

    # check that the tank has a plantLoop and a secondaryPlantLoop
    tank = model.getWaterHeaterMixedByName("Storage tank").get
    assert_equal(false, tank.plantLoop.empty?)

    assert_equal(false, tank.secondaryPlantLoop.empty?)

    # save the model to test output directory
    output_file_path = OpenStudio::Path.new(File.dirname(__FILE__) + "/output/test_output.osm")
    model.save(output_file_path,true)
  end

end


text:
/**
 * Created by avi on 8/8/2014.
 */
var app = angular.module('WhereIsIt', ['ngRoute', 'ngAnimate', 'ngSanitize', 'angularMoment', 'ui.bootstrap', 'services', 'controllers'])
                    .run(['$rootScope', '$window', '$location','sessionService', 'geoLocationService', 'amMoment', function ($rootScope, $window, $location, sessionService, geoLocationService, amMoment) {

  // these rootScope variables serves all inner controllers and views
  $rootScope.session = sessionService;
  $rootScope.position = null;
  $rootScope.loading = false;
  $rootScope.title = "";

        /*
  // register listener to watch route changes
  $rootScope.$on( "$routeChangeStart", function(event, next, current) {
    if ( $rootScope.isLoggedIn == null || $rootScope.isLoggedIn == false) {
        console.log("not logged in");

        // no logged user, we should be going to #index
        if ( next.templateUrl == "/views/index.html" ) {
            // already going to #index, no redirect needed
        } else {
            // not going to #index, we should redirect now
            $location.path( "/" );
        }
    }
  });
  */

  // authenticate and handle session and logged in user on app startup
  $window.app = {
    authState: function(state, user) {
      $rootScope.$apply(function() {
        switch (state) {
          case 'success':
            sessionService.authSuccess(user);
            break;
          case 'failure':
            sessionService.authFailed();
            break;
          }
      });
    }
  };

  if ($window.user !== null) {
    sessionService.authSuccess($window.user);
  }

  $rootScope.getPosition = function() {
    geoLocationService.getPosition();
  }

  $rootScope.hasPosition = function() {
    return ($rootScope.position != null);
  }

  $rootScope.redirectToIndex = function() {
    $rootScope.title = "";
    $location.hash("");
    $location.path("/");
  }

  $rootScope.getPosition();

  // angular moment is used to translate Date objetcs to meaningful strings.
  // it supports localization, and in particular, it has hebrew translations.
  // see business.html under partials, in the business reviews section.
  amMoment.changeLocale('he');

}]);

app.config(['$routeProvider', '$locationProvider',
  function($routeProvider, $locationProvider) {
    $routeProvider.
      when('/business/create/new', {
        templateUrl: '/views/partials/businessCreate.html',
        controller: 'businessController',
        resolve: {
            factory: CheckIfLoggedIn
        }
      })
      .when('/business/:businessId', {
        templateUrl: '/views/partials/business.html',
        controller: 'businessController'
      })
      .when('/business/:businessId/update', {
        templateUrl: '/views/partials/businessUpdate.html',
        controller: 'businessController',
        resolve: {
            factory: CheckIfLoggedIn
        }
      })
      .when('/search/keyword/:keyword', {
        templateUrl: '/views/partials/search.html',
        controller: 'searchController'
      })
      .when('/search/nearest', {
        templateUrl: '/views/partials/search.html',
        controller: 'searchController'
      })
      .when('/users/:id', {
        templateUrl: '/views/partials/user.html',
        controller: 'userController',
        resolve: {
            factory: CheckIfLoggedIn
        }
      })
      .when('/error', {
        templateUrl: '/views/partials/error.html'
      })
      .otherwise({
        redirectTo: '/'
      });

      // use the HTML5 History API
      $locationProvider.html5Mode(true);
  }]);

var CheckIfLoggedIn= function ($rootScope, $location) {
    if ($rootScope.isLoggedIn) {
        return true;
    } else {
        $location.path("/error");
    }
};

app.directive('googleautocomplete', function() {
  return {
    require: 'ngModel',
    link: function(scope, element, attrs, model) {
      var options = {
        types: [],
        componentRestrictions: {}
      };
      scope.googlePlace = new google.maps.places.Autocomplete(element[0], options);

      google.maps.event.addListener(scope.googlePlace, 'place_changed', function() {
        scope.$apply(function() {
          model.$setViewValue(element.val());
        });
      });
    }
  };
});

app.directive('scrolltoanchor', ['$timeout', '$location', '$anchorScroll', function($timeout, $location, $anchorScroll) {
  return {
    link: function(scope, element, attrs, model) {
      $timeout(function() {
        var currentHash = $location.hash();
        var anchored = $("#"+currentHash);
        if (currentHash && anchored) {
          if (anchored.offset()) {
            $('html, body').animate({scrollTop: anchored.offset().top}, 1000);
          }
        }
      }, 0);
    }
  };
}]);


text:
/*
* 3. Write a program that reads a text file and inserts line numbers in front of
* each of its lines.The result should be written to another text file.
*/

using System;
using System.IO;
using System.Linq;

class InsertTheNumberOfLine
{
    static void Main()
    {
        string pathText = "../../text.txt";
        string pathResult = "../../result.txt";

        InsertLinesToResultFile(pathText, pathResult);
        PrintResultContent(pathResult);
    }

    static void InsertLinesToResultFile(string pathText, string pathResult)
    {
        int lineCount = 1;

        using (StreamWriter result = new StreamWriter(pathResult))
        {
            using (StreamReader reader = new StreamReader(pathText))
            {
                while (!reader.EndOfStream) result.WriteLine("Line {0}: {1}", lineCount++, reader.ReadLine());
            }
        }
    }

    static void PrintResultContent(string path)
    {
        Console.WriteLine("> Result:\n");

        using (StreamReader reader = new StreamReader(path))
        {
            while (!reader.EndOfStream) Console.WriteLine(reader.ReadLine());
        }

        Console.WriteLine("\n> End of file...\n");
    }
}


text:
#ifndef RANDOMC_H
#define RANDOMC_H

// Define integer types with known size: int32_t, uint32_t, int64_t, uint64_t.
// If this doesn't work then insert compiler-specific definitions here:

// Compilers supporting C99 or C++0x have inttypes.h defining these integer types
#include <ctime>
#include <inttypes.h>
#define INT64_SUPPORTED // Remove this if the compiler doesn't support 64-bit integers

using namespace std;
/***********************************************************************
 System-specific user interface functions
 ***********************************************************************/

void EndOfProgram(void); // System-specific exit code (userintf.cpp)

void FatalError(const char *ErrorText);// System-specific error reporting (userintf.cpp)

/***********************************************************************
 Define random number generator classes
 ***********************************************************************/

class CRandomMersenne { // Encapsulate random number generator
// Choose which version of Mersenne Twister you want:
#if 0
	// Define constants for type MT11213A:
#define MERS_N   351
#define MERS_M   175
#define MERS_R   19
#define MERS_U   11
#define MERS_S   7
#define MERS_T   15
#define MERS_L   17
#define MERS_A   0xE4BD75F5
#define MERS_B   0x655E5280
#define MERS_C   0xFFD58000
#else
	// or constants for type MT19937:
#define MERS_N   624
#define MERS_M   397
#define MERS_R   31
#define MERS_U   11
#define MERS_S   7
#define MERS_T   15
#define MERS_L   18
#define MERS_A   0x9908B0DF
#define MERS_B   0x9D2C5680
#define MERS_C   0xEFC60000
#endif

public:
	CRandomMersenne() { // Constructor
		int seed=time(NULL);
		RandomInit(seed);
		LastInterval = 0;
	}
	CRandomMersenne(int seed) { // Constructor
		RandomInit(seed);
		LastInterval = 0;
	}
	void RandomInit(int seed); // Re-seed
	void RandomInitByArray(int const seeds[], int NumSeeds); // Seed by more than 32 bits
	int IRandom(int min, int max); // Output random integer
	int IRandomX(int min, int max); // Output random integer, exact
	double Random(); // Output random float
	uint32_t BRandom(); // Output random bits
private:
	void Init0(int seed); // Basic initialization procedure
	uint32_t mt[MERS_N]; // State vector
	int mti; // Index into mt
	uint32_t LastInterval; // Last interval length for IRandomX
	uint32_t RLimit; // Rejection limit used by IRandomX
};

class CRandomMother { // Encapsulate random number generator
public:
	void RandomInit(int seed); // Initialization
	int IRandom(int min, int max); // Get integer random number in desired interval
	double Random(); // Get floating point random number
	uint32_t BRandom(); // Output random bits
	CRandomMother(int seed) { // Constructor
		RandomInit(seed);
	}
protected:
	uint32_t x[5]; // History buffer
};

#endif // RANDOMC_H


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\GroupPcu */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'group_id')->textInput() ?>

    <?= $form->field($model, 'hospcode')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'create_date')->textInput() ?>

        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
/*jshint jasmine: true, node: true */
'use strict';

const path = require('path');
const runtimeUtils = require('../utils/runtime-test-utils');

describe('config webpack test', () => {
  let skyPagesConfig;

  beforeEach(() => {
    skyPagesConfig = {
      skyux: {
        mode: 'advanced'
      },
      runtime: runtimeUtils.getDefaultRuntime()
    };
  });

  function getLib() {
    return require('../config/webpack/test.webpack.config');
  }

  function getConfig(argv) {
    return getLib().getWebpackConfig(skyPagesConfig, argv);
  }

  function getInstrumentLoader(argv) {
    const config = getConfig(argv);

    return config.module.rules.filter(rule => {
      return (rule.use && rule.use[0].loader === 'istanbul-instrumenter-loader');
    })[0];
  }

  it('should expose a getWebpackConfig method', () => {
    const lib = getLib();
    expect(typeof lib.getWebpackConfig).toEqual('function');
  });

  it('should return a config object', () => {
    const config = getConfig();
    expect(config).toEqual(jasmine.any(Object));
  });

  it('should run coverage by default', () => {
    const instrumentLoader = getInstrumentLoader();

    expect(instrumentLoader).toBeDefined();
  });

  it('should not run coverage if argv.coverage is false', () => {
    const instrumentLoader = getInstrumentLoader({
      coverage: false
    });

    expect(instrumentLoader).not.toBeDefined();
  });

  it('should match on whole folder names when excluding folders from code coverage', () => {
    function createTestPaths(items) {
      return [
        ...items,
        // Add backslash variants of all provided paths.
        ...items.map(item => item.replace(/\//g, '\\'))
      ];
    }

    const instrumentLoader = getInstrumentLoader();

    const allowedPaths = createTestPaths([
      '/home/not_node_modules/some-folder/test.ts',
      '/home/skyux-spa-testing/src/test.ts',
      '/src/app/do-not-exclude-this-fixtures-folder/test.ts',
      '/src/app/do-not-exclude-this-testing-folder/test.ts',
      '/src/app/libs/test.ts',
      '/src/app/some-other-index.ts'
    ]);

    const disallowedPaths = createTestPaths([
      '/home/node_modules/some-folder/test.ts',
      '/home/testing/src/test.ts',
      '/src/app/fixtures/test.ts',
      '/src/app/testing/test.ts',
      '/src/app/lib/test.ts',
      '/src/app/index.ts'
    ]);

    for (const allowedPath of allowedPaths) {
      let foundMatch;

      for (const exclude of instrumentLoader.exclude) {
        foundMatch = foundMatch || exclude.test(allowedPath);
      }

      expect(foundMatch).toBe(false);
    }

    for (const disallowedPath of disallowedPaths) {
      let foundMatch;

      for (const exclude of instrumentLoader.exclude) {
        foundMatch = foundMatch || exclude.test(disallowedPath);
      }

      expect(foundMatch).toBe(true);
    }
  });

  it('should run coverage differently for libraries', () => {
    let instrumentLoader = getInstrumentLoader();
    let index = instrumentLoader.include.indexOf(path.resolve('src', 'app'));

    expect(index > -1).toEqual(true);

    instrumentLoader = getInstrumentLoader({
      coverage: 'library'
    });

    index = instrumentLoader.include.indexOf(path.resolve('src', 'app', 'public'));
    expect(index > -1).toEqual(true);
  });
});


text:
@interface PodsDummy_Pods_CCWeChatSDK_Example : NSObject
@end
@implementation PodsDummy_Pods_CCWeChatSDK_Example
@end


text:
CREATE TABLE `image_master_table` (
  `image_id` int(11) NOT NULL auto_increment,
  `path` varchar(255) NOT NULL,
  `latitude` double NOT NULL,
  `longitude` double NOT NULL,
  `height` double NOT NULL,
  `row` double NOT NULL,
  `pitch` double NOT NULL,
  `yaw` double NOT NULL,
  `image_size_height` int(11) NOT NULL,
  `image_size_width` int(11) NOT NULL,
  `created_date` timestamp NULL DEFAULT NULL,
  `converted` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`image_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `image_processed_tables` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `x` int(11) DEFAULT NULL,
  `y` int(11) DEFAULT NULL,
  `z` int(11) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `taken_date` datetime DEFAULT NULL,
  `theta` int(11) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `width` int(11) DEFAULT NULL,
  `source_image_ids` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `position_index` (`x`,`y`,`z`,`theta`,`height`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


text:
require 'spec_helper'

describe Flea::Interpreter do
  describe '.new' do
    it 'returns an Interpreter' do
      expect(Flea::Interpreter.new).to be_a Flea::Interpreter
    end

    it 'allows setting the base environment' do
      environment = double(:environment)
      interpreter = Flea::Interpreter.new(
        environment: environment,
        standard_library: false
      )
      expect(interpreter.base_environment).to eq(environment)
    end
  end

  describe '#run' do
    it 'runs a program and return the last output from the program' do
      interpreter = Flea::Interpreter.new
      result = interpreter.run('(define test 1)')

      expect(result).to eq(1)
      expect(interpreter.base_environment).to have_variable(:test)
    end
  end

  describe '#evaluate' do
    let(:environment) { double(:environment) }
    let(:interpreter) { Flea::Interpreter.new(environment: environment, standard_library: false) }

    it 'returns the value of a variable' do
      allow(environment).to receive(:find).with(:test).and_return(1)
      expect(interpreter.evaluate(:test)).to eq(1)
    end

    it 'defines a variable in the current environment' do
      allow(environment).to receive(:define).with(:test, 1).and_return(1)
      expect(interpreter.evaluate([:define, :test, 1])).to eq(1)
    end

    it 'creates a native function' do
      result = interpreter.evaluate([:native_function, "
        Proc.new() do |arguments, interpreter|
          1
        end
      "])

      expect(result).to be_a Proc
      expect(result.call).to eq(1)
    end

    it 'calls a native function' do
      allow(environment).to receive(:find).with(:foo).and_return(proc { |_a, _b| 'bar' })
      result = interpreter.evaluate([:foo, 1, 2, 3])

      expect(result).to eq('bar')
    end

    [1, 1.0, 'string'].each do |literal|
      it "returns literal '#{literal}'" do
        result = interpreter.evaluate(literal)
        expect(result).to be literal
      end
    end
  end
end


text:
#include "e.h"

/******** private function definitions **********/
static void _e_confirm_dialog_free(E_Confirm_Dialog *cd);
static void _e_confirm_dialog_delete(E_Dialog *dia, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
static void _e_confirm_dialog_yes(void *data, E_Dialog *dia);
static void _e_confirm_dialog_no(void *data, E_Dialog *dia);

static void
_dia_del(void *data)
{
   E_Dialog *dia = data;

   e_object_del(dia->data);
}

/********** externally accesible functions ****************/
E_API E_Confirm_Dialog *
e_confirm_dialog_show(const char *title, const char *icon, const char *text,
                      const char *button_text, const char *button2_text,
                      void (*func)(void *data), void (*func2)(void *data),
                      void *data, void *data2,
                      void (*del_func)(void *data), void *del_data)
{
   E_Confirm_Dialog *cd;
   E_Dialog *dia;

   cd = E_OBJECT_ALLOC(E_Confirm_Dialog, E_CONFIRM_DIALOG_TYPE, _e_confirm_dialog_free);
   cd->yes.func = func;
   cd->yes.data = data;
   cd->no.func = func2;
   cd->no.data = data2;
   cd->del.func = del_func;
   cd->del.data = del_data;

   dia = e_dialog_new(NULL, "E", "_confirm_dialog");
   if (!dia)
     {
        e_object_del(E_OBJECT(cd));
        return NULL;
     }
   dia->data = cd;
   cd->dia = dia;

   evas_object_event_callback_add(dia->win, EVAS_CALLBACK_DEL, (Evas_Object_Event_Cb)_e_confirm_dialog_delete, dia);
   e_object_del_attach_func_set(E_OBJECT(dia), _dia_del);

   if (title) e_dialog_title_set(dia, title);
   if (icon) e_dialog_icon_set(dia, icon, 64);
   if (text) e_dialog_text_set(dia, text);

   e_dialog_button_add(dia, !button_text ? _("Yes") : button_text, NULL, _e_confirm_dialog_yes, cd);
   e_dialog_button_add(dia, !button2_text ? _("No") : button2_text, NULL, _e_confirm_dialog_no, cd);

   e_dialog_button_focus_num(dia, 0);
   elm_win_center(dia->win, 1, 1);
   e_dialog_show(dia);

   return cd;
}

/********* private function bodies ************/
static void
_e_confirm_dialog_free(E_Confirm_Dialog *cd)
{
   if (!cd->no_run)
     {
        e_object_ref(E_OBJECT(cd));
        cd->no_run = EINA_TRUE;
        if (cd->no.func) cd->no.func(cd->no.data);
        e_object_unref(E_OBJECT(cd));
        return;
     }
   if (cd->del.func) cd->del.func(cd->del.data);
   e_object_del(E_OBJECT(cd->dia));
   free(cd);
}

static void
_e_confirm_dialog_yes(void *data, E_Dialog *dia EINA_UNUSED)
{
   E_Confirm_Dialog *cd;

   cd = data;
   e_object_ref(data);
   cd->no_run = EINA_TRUE;
   if (cd->yes.func) cd->yes.func(cd->yes.data);
   e_object_del(data);
   e_object_unref(data);
}

static void
_e_confirm_dialog_no(void *data, E_Dialog *dia EINA_UNUSED)
{
   E_Confirm_Dialog *cd;

   cd = data;
   e_object_ref(data);
   cd->no_run = EINA_TRUE;
   if (cd->no.func) cd->no.func(cd->no.data);
   e_object_del(data);
   e_object_unref(data);
}

static void
_e_confirm_dialog_delete(E_Dialog *dia, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
   e_object_del(dia->data);
}


text:
using System.Xml.Serialization;
using KayakoRestApi.Core.Constants;
using KayakoRestApi.Data;

namespace KayakoRestApi.Core.Troubleshooter
{
	/// <summary>
	/// Represents a troubleshooter comment
	/// <remarks>
	/// see: http://wiki.kayako.com/display/DEV/REST+-+TroubleshooterComment#REST-TroubleshooterComment-Response
	/// </remarks>
	/// </summary>
	[XmlType("troubleshooterstepcomment")]
	public class TroubleshooterComment
	{
		[XmlElement("id")]
		public int Id { get; set; }

		[XmlElement("troubleshooterstepid")]
		public int TroubleshooterStepId { get; set; }

		[XmlElement("creatortype")]
		public TroubleshooterCommentCreatorType CreatorType { get; set; }

		[XmlElement("creatorid")]
		public int CreatorId { get; set; }

		[XmlElement("fullname")]
		public string FullName { get; set; }

		[XmlElement("email")]
		public string Email { get; set; }

		[XmlElement("ipaddress")]
		public string IpAddress { get; set; }

		[XmlElement("dateline")]
		public UnixDateTime DateLine { get; set; }

		[XmlElement("parentcommentid")]
		public int ParentCommentId { get; set; }

		[XmlElement("commentstatus")]
		public TroubleshooterCommentStatus CommentStatus { get; set; }

		[XmlElement("useragent")]
		public string UserAgent { get; set; }

		[XmlElement("referrer")]
		public string Referrer { get; set; }

		[XmlElement("parenturl")]
		public string ParentUrl { get; set; }

		[XmlElement("contents")]
		public string Contents { get; set; }
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Petrak & Sydow, Feddes Repert. Spec. Nov. Regni Veg. , Beih. 42: 95 (1926)

#### Original name
Aplosporella tiliacea var. dubia Petr.

### Remarks
null


text:
"""
The ObjectManager manages creating, updating, and drawing objects.
"""

import pygame
import gameobjects

class ObjectManager:
    def __init__(self, scene):
        self.scene = scene
        self.objects = {}

        # Controls the order objects are updated
        self.early_update = []    # Early objects might include platforms entities can ride on
        self.normal_update = []   # Most entities will go here
        self.late_update = []     # Objects that need to be updated after everything, like the camera

        # Sprite groups for collision and drawing
        self.visible = pygame.sprite.Group()
        self.solid = pygame.sprite.Group()
        self.player_touchable = pygame.sprite.Group()
        self.enemy_touchable = pygame.sprite.Group()

        self.auto_name_id = 0

    def _auto_name(self):
        """Name for unnamed objects"""
        self.auto_name_id += 1
        return "_obj_" + str(self.auto_name_id)

    def get(self, name):
        """Get an object by name"""
        return self.objects.get(name)

    def add(self, name, obj):
        """Add an object to the object manager"""
        if name is None:
            name = self._auto_name()
            obj.name = name
        self.objects[name] = obj
        obj.init()

    def remove(self, name):
        """Remove an object from the object manager"""
        self.objects[name].destroy()
        del self.objects[name]

    def detach(self, name):
        """The object manager will no longer keep track of this object, but it will not be destroyed. Currently this isn't used."""
        obj = self.objects.get(name)
        if obj is not None:
            del self.objects[name]
        return obj

    def create(self, class_name, name, x, y, **kwargs):
        """Create an object by class name"""
        if name is None or name=="":
            name = self._auto_name()

        obj = getattr(gameobjects, class_name)(self.scene, name, x, y, **kwargs)
        self.objects[name] = obj
        obj.init()
        return obj

    def bulkCreate(self, toCreate):
        """toCreate is a list of tuples of the form (class_name, name, x, y, kwargs)"""
        newObjects = []

        for class_name, name, x, y, kwargs in toCreate:
            if name is None or name=="":
                name = self._auto_name()
            obj = getattr(gameobjects, class_name)(self.scene, name, x, y, **kwargs)
            self.objects[name] = obj
            newObjects.append(obj)

        # Done in two steps because objects need to be available for other objects to subscribe to them
        for obj in newObjects:
            obj.init()

    def createFromTMX(self, tmx):
        """Imports object information from tmx file and creates them."""
        toCreate = []
        for layer in tmx.layers:
            if layer.type == "objects":
                for obj in layer.all_objects():
                    props = obj.properties
                    props.update({"width":obj.width*tmx.tile_size[0], "height":obj.height*tmx.tile_size[1]})
                    toCreate.append((obj.type, obj.name, obj.pixel_pos[0], obj.pixel_pos[1]-obj.height*tmx.tile_size[1], props))
        self.bulkCreate(toCreate)

    def clear(self):
        """Destroy all objects in the object manager"""
        for obj in self.objects.values():
            obj.destroy()
        self.objects = {}

    def update(self, td):
        """Update objects"""
        for obj in self.early_update:
            obj.update(td)

        for obj in self.normal_update:
            obj.update(td)

        for obj in self.late_update:
            obj.update(td)

    def draw(self, surface, camera_x, camera_y):
        # Updates sprites rects relative to camera
        self.visible.update(camera_x, camera_y)
        self.visible.draw(surface)

    def debug_draw(self, surface, camera_x, camera_y):
        for obj in self.objects.values():
            obj.debug_draw(surface, camera_x, camera_y)


text:
class Gdk::Pixbuf
  def initialize(*args)
    if Gtk.takeob
      @ob = Gtk.takeob
      Gtk.takeob = nil
    else
      @ob = Kernel.const_get("RealGdk").const_get("Pixbuf").method(:new).overload(System::String).call(System::String.new(args[0]))
      #method.call("")
    end
  end
end


text:
namespace dai
{
namespace utility
{

std::string getEnv(const std::string& var);

} // namespace utility
} // namespace dai


text:
QUnit.test( 'jquery success', function( assert ) {
  let $ = window.jQuery;
  let done = assert.async( 6 );

  $('#jquery-success').imagesLoaded( function( instance ) {
      assert.ok( true, 'callback triggered' );
      assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' );
      done();
    } )
    .done( function( instance ) {
      assert.ok( true, 'done triggered' );
      assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' );
      done();
    } )
    .always( function( instance ) {
      assert.ok( true, 'always triggered' );
      assert.ok( instance instanceof imagesLoaded, 'instance instanceof imagesLoaded' );
      done();
    } )
    .progress( function( instance, image ) {
      assert.ok( image.isLoaded, 'progress trigged, image is loaded' );
      done();
    } );

} );


text:
namespace Bridge.Contract
{
    public enum FileNameCaseConvert
    {
        /// <summary>
        /// (Default), Group contents on first file processed by compiler: this means data for 'File.js' and 'file.js' will go all
        /// to either 'File.js' or 'file.js', whichever comes first in the compiling or file creation process.
        /// </summary>
        None = 1,

        /// <summary>
        /// Like 'None', but all 'word' names begin lowercase. A 'word' begins either in the begining of
        /// the file name or after a dot (that is not the file extension separator).
        /// </summary>
        CamelCase = 2,

        /// <summary>
        /// Convert any file names to lowercase. This is the most fail-safe solution that might work on all file systems
        /// regardles of their inherent file name case sensitiveness properties. But might break fancy file naming.
        /// </summary>
        Lowercase = 3
    }
 }


text:
//====================================================================================
//
// Purpose: Provide basic teleportation of VR CameraRig
//
// This script must be attached to the CameraRig
//
// A GameObject must have the VRTK_WorldPointer attached to it to listen for the
// updated world position to teleport to.
//
//====================================================================================

namespace VRTK
{
    using UnityEngine;

    public delegate void TeleportEventHandler(object sender, DestinationMarkerEventArgs e);

    public class VRTK_BasicTeleport : MonoBehaviour
    {
        public float blinkTransitionSpeed = 0.6f;
        [Range(0f, 32f)]
        public float distanceBlinkDelay = 0f;
        public bool headsetPositionCompensation = true;
        public string ignoreTargetWithTagOrClass;
        [Tooltip("The max distance the nav mesh edge can be from the teleport destination to be considered valid.\n[0 = ignore nav mesh limits]")]
        public float navMeshLimitDistance = 0f;

        public event TeleportEventHandler Teleporting;
        public event TeleportEventHandler Teleported;

        protected Transform eyeCamera;
        protected bool adjustYForTerrain = false;
        protected bool enableTeleport = true;

        private float blinkPause = 0f;
        private float fadeInTime = 0f;
        private float maxBlinkTransitionSpeed = 1.5f;
        private float maxBlinkDistance = 33f;

        public void InitDestinationSetListener(GameObject markerMaker, bool register)
        {
            if (markerMaker)
            {
                foreach (var worldMarker in markerMaker.GetComponents<VRTK_DestinationMarker>())
                {
                    if (register)
                    {
                        worldMarker.DestinationMarkerSet += new DestinationMarkerEventHandler(DoTeleport);
                        worldMarker.SetInvalidTarget(ignoreTargetWithTagOrClass);
                        worldMarker.SetNavMeshCheckDistance(navMeshLimitDistance);
                        worldMarker.SetHeadsetPositionCompensation(headsetPositionCompensation);
                    }
                    else
                    {
                        worldMarker.DestinationMarkerSet -= new DestinationMarkerEventHandler(DoTeleport);
                    }
                }
            }
        }

        protected virtual void Awake()
        {
            Utilities.SetPlayerObject(gameObject, VRTK_PlayerObject.ObjectTypes.CameraRig);
            eyeCamera = Utilities.AddCameraFade();
        }

        protected virtual void OnEnable()
        {
            adjustYForTerrain = false;
            enableTeleport = true;
            InitDestinationMarkerListeners(true);
            InitHeadsetCollisionListener(true);
        }

        protected virtual void OnDisable()
        {
            InitDestinationMarkerListeners(false);
            InitHeadsetCollisionListener(false);
        }

        protected void OnTeleporting(object sender, DestinationMarkerEventArgs e)
        {
            if (Teleporting != null)
            {
                Teleporting(this, e);
            }
        }

        protected void OnTeleported(object sender, DestinationMarkerEventArgs e)
        {
            if (Teleported != null)
            {
                Teleported(this, e);
            }
        }

        protected virtual void Blink(float transitionSpeed)
        {
            fadeInTime = transitionSpeed;
            VRTK_SDK_Bridge.HeadsetFade(Color.black, 0);
            Invoke("ReleaseBlink", blinkPause);
        }

        protected virtual bool ValidLocation(Transform target, Vector3 destinationPosition)
        {
            //If the target is one of the player objects or a UI Canvas then it's never a valid location
            if (target.GetComponent<VRTK_PlayerObject>() || target.GetComponent<VRTK_UIGraphicRaycaster>())
            {
                return false;
            }

            bool validNavMeshLocation = false;
            if (target)
            {
                NavMeshHit hit;
                validNavMeshLocation = NavMesh.SamplePosition(destinationPosition, out hit, 0.1f, NavMesh.AllAreas);
            }
            if (navMeshLimitDistance == 0f)
            {
                validNavMeshLocation = true;
            }

            return (validNavMeshLocation && target && target.tag != ignoreTargetWithTagOrClass && target.GetComponent(ignoreTargetWithTagOrClass) == null);
        }

        protected virtual void DoTeleport(object sender, DestinationMarkerEventArgs e)
        {
            if (enableTeleport && ValidLocation(e.target, e.destinationPosition) && e.enableTeleport)
            {
                OnTeleporting(sender, e);
                Vector3 newPosition = GetNewPosition(e.destinationPosition, e.target);
                CalculateBlinkDelay(blinkTransitionSpeed, newPosition);
                Blink(blinkTransitionSpeed);
                SetNewPosition(newPosition, e.target);
                OnTeleported(sender, e);
            }
        }

        protected virtual void SetNewPosition(Vector3 position, Transform target)
        {
            transform.position = CheckTerrainCollision(position, target);
        }

        protected virtual Vector3 GetNewPosition(Vector3 tipPosition, Transform target)
        {
            float newX = (headsetPositionCompensation ? (tipPosition.x - (eyeCamera.position.x - transform.position.x)) : tipPosition.x);
            float newY = transform.position.y;
            float newZ = (headsetPositionCompensation ? (tipPosition.z - (eyeCamera.position.z - transform.position.z)) : tipPosition.z);

            return new Vector3(newX, newY, newZ);
        }

        protected Vector3 CheckTerrainCollision(Vector3 position, Transform target)
        {
            if (adjustYForTerrain && target.GetComponent<Terrain>())
            {
                var terrainHeight = Terrain.activeTerrain.SampleHeight(position);
                position.y = (terrainHeight > position.y ? position.y : terrainHeight);
            }
            return position;
        }

        private void CalculateBlinkDelay(float blinkSpeed, Vector3 newPosition)
        {
            blinkPause = 0f;
            if (distanceBlinkDelay > 0f)
            {
                float distance = Vector3.Distance(transform.position, newPosition);
                blinkPause = Mathf.Clamp((distance * blinkTransitionSpeed) / (maxBlinkDistance - distanceBlinkDelay), 0, maxBlinkTransitionSpeed);
                blinkPause = (blinkSpeed <= 0.25 ? 0f : blinkPause);
            }
        }

        private void ReleaseBlink()
        {
            VRTK_SDK_Bridge.HeadsetFade(Color.clear, fadeInTime);
            fadeInTime = 0f;
        }

        private void InitDestinationMarkerListeners(bool state)
        {
            var leftHand = VRTK_SDK_Bridge.GetControllerLeftHand();
            var rightHand = VRTK_SDK_Bridge.GetControllerRightHand();
            InitDestinationSetListener(leftHand, state);
            InitDestinationSetListener(rightHand, state);

            foreach (var destinationMarker in FindObjectsOfType<VRTK_DestinationMarker>())
            {
                if (destinationMarker.gameObject != leftHand && destinationMarker.gameObject != rightHand)
                {
                    InitDestinationSetListener(destinationMarker.gameObject, state);
                }
            }
        }

        private void InitHeadsetCollisionListener(bool state)
        {
            var headset = FindObjectOfType<VRTK_HeadsetCollision>();
            if (headset)
            {
                if (state)
                {
                    headset.HeadsetCollisionDetect += new HeadsetCollisionEventHandler(DisableTeleport);
                    headset.HeadsetCollisionEnded += new HeadsetCollisionEventHandler(EnableTeleport);
                }
                else
                {
                    headset.HeadsetCollisionDetect -= new HeadsetCollisionEventHandler(DisableTeleport);
                    headset.HeadsetCollisionEnded -= new HeadsetCollisionEventHandler(EnableTeleport);
                }
            }
        }

        private void DisableTeleport(object sender, HeadsetCollisionEventArgs e)
        {
            enableTeleport = false;
        }

        private void EnableTeleport(object sender, HeadsetCollisionEventArgs e)
        {
            enableTeleport = true;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" type="image/png" href="https://just2us.com/img/favicon-180.png" />
    <link rel="apple-touch-icon" href="https://just2us.com/img/favicon-192.png"/>

    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/clean-blog.min.css">
    <link rel="stylesheet" href="/css/syntax.css">

    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic&display=swap' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&display=swap' rel='stylesheet' type='text/css'>

    <link type="application/atom+xml" rel="alternate" href="https://just2me.com/feed.xml" title="Just2me" />

<title>What really are mission statements? | Just2me</title>
<meta name="generator" content="Jekyll v4.0.0" />
<meta property="og:title" content="What really are mission statements?" />
<meta name="author" content="Junda Ong" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="The day-to-day operations of a business is a state of controlled chaos." />
<meta property="og:description" content="The day-to-day operations of a business is a state of controlled chaos." />
<link rel="canonical" href="https://just2me.com/2009/01/20/what-really-are-mission-statements/" />
<meta property="og:url" content="https://just2me.com/2009/01/20/what-really-are-mission-statements/" />
<meta property="og:site_name" content="Just2me" />
<meta property="og:image" content="https://just2me.com/img/jewel-fountain.jpeg" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2009-01-20T02:30:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:image" content="https://just2me.com/img/jewel-fountain.jpeg" />
<meta property="twitter:title" content="What really are mission statements?" />
<meta name="twitter:site" content="@samwize" />
<meta name="twitter:creator" content="@Junda Ong" />
<meta property="fb:admins" content="704185456" />

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Just2me

                  Stories

                  Apps

                  Quotes

                  About

What really are mission statements?

                    Published on January 20, 2009

The day-to-day operations of a business is a state of controlled chaos.

Anyone who works in a company/corporation should recognize the fact - rushing to meet datelines, continuous piling up of requests, constraints in time and resources, etc.. While we are constantly working in this 'chaos', we must also have a sense of direction. This direction serves not only to keep us moving towards our objectives, but also serves to motivate us when we are lost.

So how do we find this direction?

Every company has a mission statement. Taking Singtel as an example:

We enable communication by breaking barriers and building bonds. We help businesses and people communicate anytime, anywhere and in many ways. We make communications easier, faster, more economical and reliable by …

That is a kind of direction, but a company's mission statement is more like a smoke screen! They are feel-good mottos developed for only the public! We can even generate with a Mission Generator.

What a company really needs are working mission statements. Working mission statements are clear and meaningful statements, which employees are able to digest and commit to memory easily. Different teams/employees would have different working mission statements that sum up their job activities.

But a working mission is still not enough. To completely define our direction, we need to have a one page Operating Charter, which contains our working mission, primary objectives, secondary objectives, aspirations, quantifiable measures of success and constraints. This is a guide line for a one page Operating Charter:

Working Mission: List two or three ideas that sum up your job activities + One core principle + Who you are helping

Scope: Defines the parameters in which you work. Be it a particular domain, technology, product or country you work in.

Primary Objectives: List no more than six clearly stated roles. This includes primary job responsibilities, areas where you lead and areas where you assist.

Secondary Objectives: List no more than two other clearly stated roles that are hoped for, but not mandatory.

Aspirations: List no more than three dreams.

Quantifiable measures of success: Means you will use to track whether or not you are accomplishing what you set out to do.

Constraints: List external factors you cannot control which could have a negative impact on the stated objectives.

Your Operating Charter must be written in one page, and is preferably pinned up on your wall. Operating Charter is flexible and is applicable to a team or to an individual employee.

This post is what I have learnt from the first chapter in The Marketing Game by Eric Schuiz.

    TAGGED WITH

    companies

                        SG Girls - Appreciation of Oriental Beauty →

                        ← SG Blood - A blood donation app

                Please enable JavaScript to view the comments powered by Disqus.

Copyright © Junda Ong 1983-2021


text:
#ifndef __CURL_CURLVER_H
#define __CURL_CURLVER_H

/* This header file contains nothing but libcurl version info, generated by
   a script at release-time. This was made its own header file in 7.11.2 */

/* This is the version number of the libcurl package from which this header
   file origins: */
#define LIBCURL_VERSION "7.16.1"

/* The numeric version number is also available "in parts" by using these
   defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 16
#define LIBCURL_VERSION_PATCH 1

/* This is the numeric version of the libcurl version number, meant for easier
   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
   always follow this syntax:

         0xXXYYZZ

   Where XX, YY and ZZ are the main version, release and patch numbers in
   hexadecimal (using 8 bits each). All three numbers are always represented
   using two digits.  1.2 would appear as "0x010200" while version 9.11.7
   appears as "0x090b07".

   This 6-digit (24 bits) hexadecimal number does not show pre-release number,
   and it is always a greater number in a more recent release. It makes
   comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071001

#endif /* __CURL_CURLVER_H */


text:
require 'spec_helper'

describe HH::API::Region do
  let(:client) { HH::Client.new }

  describe "#regions" do
    before do
      stub_get("areas").to_return(body: fixture("regions_all.json"), headers: {content_type: "application/json; charset=utf-8"})
    end

    it "requests the correct resource" do
      client.regions
      expect(a_get("areas")).to have_been_made
    end

    it "returns the requested regions all" do
      regions = client.regions
      expect(regions).to be_an Array
      expect(regions.first).to be_an Hash
      expect(regions.first[:name]).to eq "Москва"
    end
  end

  describe "#region" do
    before do
      stub_get("areas/1").to_return(body: fixture("region.json"), headers: {content_type: "application/json; charset=utf-8"})
    end

    it "requests the correct resource" do
      client.region(1)
      expect(a_get("areas/1")).to have_been_made
    end

    it "returns the requested regions all" do
      region = client.region(1)
      expect(region).to be_an Hash
      expect(region[:name]).to eq "Москва"
    end
  end
end


text:
package com.planet_ink.coffee_mud.Items.MiscMagic;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.AccountStats.PrideStat;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class GenSuperPill extends GenPill implements ArchonOnly
{
	@Override public String ID(){	return "GenSuperPill";}
	public GenSuperPill()
	{
		super();

		setName("a pill");
		basePhyStats.setWeight(1);
		setDisplayText("A strange pill lies here.");
		setDescription("Large and round, with strange markings.");
		secretIdentity="";
		baseGoldValue=200;
		recoverPhyStats();
		material=RawMaterial.RESOURCE_CORN;
	}

	@Override public boolean isGeneric(){return true;}

	@Override
	public String secretIdentity()
	{
		final String tx=StdScroll.makeSecretIdentity("super pill",super.secretIdentity(),"",getSpells());
		String id=readableText;
		int x=id.toUpperCase().indexOf("ARM");
		for(final StringBuffer ID=new StringBuffer(id);((x>0)&&(x<id.length()));x++)
			if(id.charAt(x)=='-')
			{
				ID.setCharAt(x,'+');
				id=ID.toString();
				break;
			}
			else
			if(id.charAt(x)=='+')
			{
				ID.setCharAt(x,'-');
				id=ID.toString();
				break;
			}
			else
			if(Character.isDigit(id.charAt(x)))
				break;
		x=id.toUpperCase().indexOf("DIS");
		if(x>=0)
		{
			final long val=CMParms.getParmPlus(id,"dis");
			final int y=id.indexOf(""+val,x);
			if((val!=0)&&(y>x))
			{
				final StringBuffer middle=new StringBuffer("");
				for(int num=0;num<PhyStats.IS_VERBS.length;num++)
					if(CMath.bset(val,CMath.pow(2,num)))
						middle.append(PhyStats.IS_VERBS[num]+" ");
				id=id.substring(0,x)+middle.toString().trim()+id.substring(y+((""+val).length()));
			}
		}
		x=id.toUpperCase().indexOf("SEN");
		if(x>=0)
		{
			final long val=CMParms.getParmPlus(id,"sen");
			final int y=id.indexOf(""+val,x);
			if((val!=0)&&(y>x))
			{
				final StringBuffer middle=new StringBuffer("");
				for(int num=0;num<PhyStats.CAN_SEE_VERBS.length;num++)
					if(CMath.bset(val,CMath.pow(2,num)))
						middle.append(PhyStats.CAN_SEE_VERBS[num]+" ");
				id=id.substring(0,x)+middle.toString().trim()+id.substring(y+((""+val).length()));
			}
		}
		return tx+"\n("+id+")\n";
	}

	public void EATME(MOB mob)
	{
		boolean redress=false;
		if(getSpells().size()>0)
			eatIfAble(mob);
		if((CMParms.getParmPlus(readableText,"beacon")>0)
		&&(mob.location()!=null))
			mob.setStartRoom(mob.location());
		mob.basePhyStats().setAbility(mob.basePhyStats().ability()+CMParms.getParmPlus(readableText,"abi"));
		mob.basePhyStats().setArmor(mob.basePhyStats().armor()+CMParms.getParmPlus(readableText,"arm"));
		mob.basePhyStats().setAttackAdjustment(mob.basePhyStats().attackAdjustment()+CMParms.getParmPlus(readableText,"att"));
		mob.basePhyStats().setDamage(mob.basePhyStats().damage()+CMParms.getParmPlus(readableText,"dam"));
		mob.basePhyStats().setDisposition(mob.basePhyStats().disposition()|CMParms.getParmPlus(readableText,"dis"));
		final int levels=CMParms.getParmPlus(readableText,"lev");
		for(int i=0;i<levels;i++)
			CMLib.leveler().level(mob);
		mob.basePhyStats().setLevel(mob.basePhyStats().level());
		mob.basePhyStats().setRejuv(mob.basePhyStats().rejuv()+CMParms.getParmPlus(readableText,"rej"));
		mob.basePhyStats().setSensesMask(mob.basePhyStats().sensesMask()|CMParms.getParmPlus(readableText,"sen"));
		mob.basePhyStats().setSpeed(mob.basePhyStats().speed()+CMParms.getParmPlus(readableText,"spe"));
		mob.basePhyStats().setWeight(mob.basePhyStats().weight()+CMParms.getParmPlus(readableText,"wei"));
		if(CMParms.getParmPlus(readableText,"wei")!=0)
			redress=true;
		mob.basePhyStats().setHeight(mob.basePhyStats().height()+CMParms.getParmPlus(readableText,"hei"));
		if(CMParms.getParmPlus(readableText,"hei")!=0)
			redress=true;

		String val=CMParms.getParmStr(readableText,"gen","").toUpperCase();
		if((val.length()>0)&&((val.charAt(0)=='M')||(val.charAt(0)=='F')||(val.charAt(0)=='N')))
			mob.baseCharStats().setStat(CharStats.STAT_GENDER,val.charAt(0));
		val=CMParms.getParmStr(readableText,"cla","").toUpperCase();
		if(val.length()>0)
		{
			final CharClass C=CMClass.findCharClass(val);
			if((C!=null)&&(C.availabilityCode()!=0))
			{
				mob.baseCharStats().setCurrentClass(C);
				if((!mob.isMonster())&&(mob.soulMate()==null))
					CMLib.coffeeTables().bump(mob,CoffeeTableRow.STAT_CLASSCHANGE);
			}
		}
		if(CMParms.getParmPlus(readableText,"lev")!=0)
			mob.baseCharStats().setClassLevel(mob.baseCharStats().getCurrentClass(),mob.baseCharStats().getClassLevel(mob.baseCharStats().getCurrentClass())+CMParms.getParmPlus(readableText,"lev"));
		val=CMParms.getParmStr(readableText,"rac","").toUpperCase();
		if((val.length()>0)&&(CMClass.getRace(val)!=null))
		{
			redress=true;
			mob.baseCharStats().setMyRace(CMClass.getRace(val));
			mob.baseCharStats().getMyRace().startRacing(mob,false);
		}
		for(final int i : CharStats.CODES.BASECODES())
		{
			mob.baseCharStats().setStat(i,mob.baseCharStats().getStat(i)+CMParms.getParmPlus(readableText,CMStrings.limit(CharStats.CODES.NAME(i).toLowerCase(),3)));
			final int max = CharStats.CODES.toMAXBASE(i);
			mob.baseCharStats().setStat(max,mob.baseCharStats().getStat(max)+CMParms.getParmPlus(readableText,"max"+CMStrings.limit(CharStats.CODES.NAME(i).toLowerCase(),3)));
		}

		mob.baseState().setHitPoints(mob.baseState().getHitPoints()+CMParms.getParmPlus(readableText,"hit"));
		mob.curState().setHunger(mob.curState().getHunger()+CMParms.getParmPlus(readableText,"hun"));
		mob.baseState().setMana(mob.baseState().getMana()+CMParms.getParmPlus(readableText,"man"));
		mob.baseState().setMovement(mob.baseState().getMovement()+CMParms.getParmPlus(readableText,"mov"));
		mob.curState().setThirst(mob.curState().getThirst()+CMParms.getParmPlus(readableText,"thi"));

		mob.setPractices(mob.getPractices()+CMParms.getParmPlus(readableText,"prac"));
		mob.setTrains(mob.getTrains()+CMParms.getParmPlus(readableText,"trai"));
		final int qp=CMParms.getParmPlus(readableText,"ques");
		if(qp!=0)
			mob.setQuestPoint(mob.getQuestPoint()+qp);
		if(qp>0)
			CMLib.players().bumpPrideStat(mob,PrideStat.QUESTPOINTS_EARNED, qp);
		final int newMoney=CMParms.getParmPlus(readableText,"coin");
		if(newMoney!=0)
			CMLib.beanCounter().setMoney(mob,CMLib.beanCounter().getMoney(mob)+newMoney);
		final int exp=CMParms.getParmPlus(readableText,"expe");
		if(exp!=0)
			CMLib.leveler().postExperience(mob,null,null,exp,false);
		mob.recoverCharStats();
		mob.recoverPhyStats();
		mob.recoverMaxState();
		if(redress)
			CMLib.utensils().confirmWearability(mob);
	}

	@Override
	public void executeMsg(final Environmental myHost, final CMMsg msg)
	{
		if(msg.amITarget(this))
		{
			final MOB mob=msg.source();
			switch(msg.targetMinor())
			{
			case CMMsg.TYP_EAT:
				if((msg.sourceMessage()==null)&&(msg.othersMessage()==null))
				{
					EATME(mob);
					super.executeMsg(myHost,msg);
				}
				else
					msg.addTrailerMsg(CMClass.getMsg(msg.source(),msg.target(),msg.tool(),CMMsg.NO_EFFECT,null,msg.targetCode(),msg.targetMessage(),CMMsg.NO_EFFECT,null));
				break;
			default:
				super.executeMsg(myHost,msg);
				break;
			}
		}
		else
			super.executeMsg(myHost,msg);
	}
}