text:
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}

module Main (main) where

import Data.HashRing (HashRing, (!))
import qualified Data.HashRing as R
import Data.List ((\\), nub)
import Data.Word (Word8)
import Test.QuickCheck (Arbitrary (..), Gen, Property, (==>), listOf, resize)
import Test.Framework (defaultMain, testGroup )
import Test.Framework.Providers.QuickCheck2 (testProperty)

main :: IO ()
main = defaultMain
  [ testGroup "basic properties"
    [ testProperty "empty ring is null" pEmptyIsNull
    , testProperty "nonempty rings are not null" pNonemptyNonNull
    , testProperty "size is # of nodes" pSize
    , testProperty "replicas is # of replicas" pReplicas
    , testProperty "equality" pInequality ]
  , testGroup "query properties"
    [ testProperty "lookup in empty ring" pLookupEmpty
    , testProperty "member identity" pMember
    , testProperty "lookup identity" pLookupId
    , testProperty "find identity" pFindId
    , testProperty "index (bang) identity" pIndexId
    , testProperty "lookup not Nothing" pLookupJust
    , testProperty "lookup wraps" pLookupWrap ]
  , testGroup "insert/delete properties"
    [ testProperty "insert into empty" pSingleton
    , testProperty "insert idempotency" pInsertIdem
    , testProperty "insert then delete" pInsertDelete
    , testProperty "delete nonmember" pDeleteNonMember ]
  , testGroup "conversion properties"
    [ testProperty "show/read identity" pShowRead
    , testProperty "list conversion" pListConvert ] ]

type IRing = HashRing Int
newtype NReps = NReps Int deriving (Show)

instance Arbitrary NReps where
  arbitrary = fmap (NReps . (+1) . fromIntegral) (arbitrary :: Gen Word8)

instance Arbitrary IRing where
  arbitrary = do
    NReps nreps <- arbitrary
    nodes <- resize 100 $ listOf arbitrary
    return $ R.fromList nreps nodes

pEmptyIsNull :: NReps -> Bool
pEmptyIsNull (NReps nreps) = R.null $ R.empty nreps

pNonemptyNonNull :: IRing -> Property
pNonemptyNonNull ring = R.size ring > 0 ==> not (R.null ring)

pSize :: NReps -> [Int] -> Bool
pSize (NReps nreps) nodes = go nodes $ R.empty nreps
  where
    go [] ring = R.size ring == length (nub nodes)
    go (n:ns) ring = go ns $ R.insert n ring

pReplicas :: NReps -> Bool
pReplicas (NReps nreps) = R.replicas (R.empty nreps) == nreps

pInequality :: NReps -> Int -> Bool
pInequality (NReps nreps) node = R.singleton nreps node /= R.empty nreps

pLookupEmpty :: Int -> NReps -> Bool
pLookupEmpty node (NReps nreps) =
  R.lookup node (R.empty nreps :: IRing) == Nothing

pMember :: Int -> IRing -> Bool
pMember node ring = R.member node (R.insert node ring) == True

pLookupId :: Int -> IRing -> Bool
pLookupId msgnode ring = R.lookup msgnode (R.insert msgnode ring) == Just msgnode

pFindId :: Int -> IRing -> Bool
pFindId msgnode ring = R.find msgnode (R.insert msgnode ring) == msgnode

pIndexId :: Int -> IRing -> Bool
pIndexId msgnode ring = R.insert msgnode ring ! msgnode == msgnode

pLookupJust :: Int -> IRing -> Property
pLookupJust msg ring = not (R.null ring) ==> R.lookup msg ring /= Nothing

pLookupWrap :: Int -> NReps -> Property
pLookupWrap msgnode (NReps nreps) = msgnode /= maxBound ==>
  R.lookup (msgnode + 1) (R.insert msgnode $ R.empty nreps) == Just msgnode

pSingleton :: NReps -> Int -> Bool
pSingleton (NReps nreps) node =
  R.insert node (R.empty nreps) == R.singleton nreps node

pInsertIdem :: Int -> IRing -> Bool
pInsertIdem node ring =
  R.insert node (R.insert node ring) == R.insert node ring

pInsertDelete :: Int -> IRing -> Bool
pInsertDelete node ring
    | (R.member node ring) = True -- if item is in ring - it's removing will break the ring
    | otherwise = ring == R.delete node (R.insert node ring)

pDeleteNonMember :: Int -> IRing -> Property
pDeleteNonMember node ring =
  not (R.member node ring) ==> R.delete node ring == ring

pShowRead :: IRing -> Bool
pShowRead ring = ring == read (show ring)

pListConvert :: NReps -> [Int] -> Bool
pListConvert (NReps nreps) ints =
  let innodes = nub ints
      outnodes = R.toList $ R.fromList nreps innodes
  in innodes \\ outnodes == [] && outnodes \\ innodes == []


text:
/**
 * Created by azu on 2014/05/25.
 * LICENSE : MIT
 */
"use strict";
const checkInlineScript = require("./inline-script-tester").checkInlineScript;
checkInlineScript("../../").catch((error) => {
    if (error) {
        console.error(error);
    }
});

redpajama_set_name: RedPajamaGithub


text:
import argparse
import os
import yaml

import jinja2

def run_template_engine(blacklist_file, template_file, output_file):
    template_path, template_file = os.path.split(template_file)

    with open(blacklist_file) as bf:
        context = yaml.load(bf)

    context['domains'] = [d for blockset in context['blacklist']
                          for d in blockset['domains']]

    result = jinja2.Environment(
        loader=jinja2.FileSystemLoader(template_path or './')
    ).get_template(template_file).render(context)

    with open(output_file, 'w') as of:
        of.write(result)

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('blacklist')
    parser.add_argument('template')
    parser.add_argument('outfile')
    args = parser.parse_args()
    run_template_engine(args.blacklist, args.template, args.outfile)

if __name__ == '__main__':
    main()


text:
package org.datagr4m.viewer.renderer;

import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import org.jzy3d.maths.IntegerCoord2d;

public class TextUtils {
	public static IntegerCoord2d centeredTextCoords(String text){
		int height = TextUtils.textHeight();
		int width = TextUtils.textWidth(text);
		return new IntegerCoord2d(-width/2, height/2);
	}

	public static int textHeight(){
	    if(!initialized)
	        init();
		return height;
	}

	public static int textWidth(String txt){
	    if(!initialized)
            init();
		return graphic.getFontMetrics().stringWidth(txt);
	}

	public static void changeFontSize(Graphics2D graphic, int size){
	    TextUtils.size = size;
	    TextUtils.font = new Font(name, style, size);
        graphic.setFont(font);

    }

	public static void changeFontSize(int size){
        TextUtils.size = size;
        TextUtils.font = new Font(name, style, size);
        graphic.setFont(font);

    }

   public static void changeFontStyle(int style){
        TextUtils.style = style;
        TextUtils.font = new Font(name, style, size);
        graphic.setFont(font);
    }

	protected static void init(){
        graphic = (Graphics2D)helperImg.getGraphics();
        graphic.setFont(font);	// there's one by default
        height = graphic.getFontMetrics().getHeight();
	}

	protected static boolean initialized = false;

	public static String name = "Arial";
	public static int style = Font.PLAIN;
	public static int size = 12;
	public static Font font = new Font(name, style, size);
	protected static int height;

	protected static BufferedImage helperImg = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
    protected static Graphics2D graphic;
}


text:
using System.Collections.Generic;
using RailDataEngine.Domain.Entity.TrainDescriber.Signal;

namespace RailDataEngine.Api.Models
{
    public class SignalMessagesResponseModel
    {
        public List<SignalMessage> SignalMessages { get; set; }
    }
}


text:
Note: This directory contains the BLEU scorer. The code is a slight modification
of the source code available at https://code.google.com/p/lingutil/.
The modification includes the computation of a smoothed BLEU scores, as well as
a changed segment input/output command-line interface.

The BLEU scorer code is released under the New ("3-clause") BSD License.


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.github.godness84.appbarsnapbehaviorproject">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

    </application>

</manifest>


text:
<title>File List</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="search/search.css" rel="stylesheet" type="text/css"/>

Main Page

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

File Members

File List

Here is a list of all files with brief descriptions:

__init__.py [code]

dish_viz.cpp [code]

dish_viz.h [code]

DishVisualizer.cpp [code]

DishVisualizer.h [code]

 All Classes Namespaces Files Functions Variables Defines

dish_viz

Author(s): Abraham Shultz

autogenerated on Thu Feb 7 2013 13:13:02


text:
class User < ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable,
           :recoverable, :lockable, :trackable, :validatable

    has_many :event, foreign_key: :userid, primary_key: :userid
end


text:
use crate::Thickness;

// todo:  documentation
pub trait Spacer {
    /// Gets left.
    fn left(&self) -> f64;

    /// Sets left.
    fn set_left(&mut self, left: f64);

    /// Gets top.
    fn top(&self) -> f64;

    /// Sets top.
    fn set_top(&mut self, top: f64);

    /// Gets right.
    fn right(&self) -> f64;

    /// Sets right.
    fn set_right(&mut self, right: f64);

    /// Gets bottom.
    fn bottom(&self) -> f64;

    /// Sets bottom.
    fn set_bottom(&mut self, bottom: f64);

    /// Gets thickness.
    fn thickness(&self) -> Thickness;

    /// Sets thickness.
    fn set_thickness<T: Into<Thickness>>(&mut self, thickness: T);
}


text:
package com.parse.starter;

import android.app.Application;

import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseInstallation;
import com.parse.ParseUser;

public class StarterApplication extends Application {

  @Override
  public void onCreate() {
    super.onCreate();
    Parse.initialize(this, "BR0BDh6cfKSJ7G5Mjje82Db24rBpVA5JAfgRXrKj", "OIZiCe9uSkJ0Aee8AxuPUewcHXCmKjGNqhXymOLs");
    ParseInstallation.getCurrentInstallation().saveInBackground();

  }
}


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic; //maybe?
using SimpleJSON;

public class CharacterStruct {

	public string name;
	public string type; //student, animal, politician, etc.
	public string sprite; //takes in the person's png
	private Dictionary<string, string> data;

	public static CharacterStruct createFromJSONString(string jsonString) { //parses a JSON file and turns it into a type character struct
		JSONNode jsonParsed = JSON.Parse(jsonString);

		string theName = jsonParsed ["name"];
		string theType = jsonParsed ["type"];
		string theSprite = jsonParsed ["sprite"];

		if (theName != null && theType != null && theSprite != null) {
			var charStr = new CharacterStruct ();
			charStr.name = theName;
			charStr.type = theType;
			charStr.sprite = theSprite;

			return charStr;
		} else {
			Debug.LogError ("trouble parsing JSON");

			return null;
		}
	}

	public string toString() {
		return this.name;
	}
}


text:
using namespace dns;

Server::Server() {
    m_resolver.init("/Users/zhaoxy/Desktop/hosts");
}

void Server::init(int &port) {
    struct sockaddr_in servAddr;
    memset(&servAddr, 0, sizeof(servAddr));
    //protocol domain
    servAddr.sin_family = AF_INET;
    //default ip
    servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    //port
    servAddr.sin_port = htons(port);
    //create socket
    if ((m_socketfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
        printf("create socket error: %s(errno: %d)\n",strerror(errno),errno);
        return;
    }
    unsigned value = 1;
    setsockopt(m_socketfd, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(value));
    //bind socket to port
    if (bind(m_socketfd, (struct sockaddr *)&servAddr, sizeof(servAddr))) {
        printf("bind socket error: %s(errno: %d)\n",strerror(errno),errno);
        return;
    }
    //dynamically allocating a port
    if (port == 0) {
        socklen_t namelen = sizeof(servAddr);
        if (getsockname(m_socketfd, (struct sockaddr *)&servAddr, &namelen) == -1) {
            printf("getsockname error: %s(errno: %d)\n",strerror(errno),errno);
            return;
        }
        port = ntohs(servAddr.sin_port);
    }
    std::cout<<"server running on port:"<<port<<std::endl;
}

void Server::run() {
    char buff[512];
    struct sockaddr_in clientAddr;
    socklen_t len = sizeof(struct sockaddr_in);
    while (1) {
        int n = (int)recvfrom(m_socketfd, buff, sizeof(buff), 0, (struct sockaddr *)&clientAddr, &len);
        if (n <= 0) continue;
        m_query.decode(buff, n);
        std::cout<<m_query.to_string();

        m_resolver.process(m_query, m_response);
        memset(buff, 0, sizeof(buff));
        n = m_response.encode(buff);
        std::cout<<m_response.to_string();
        sendto(m_socketfd, buff, n, 0, (struct sockaddr *)&clientAddr, len);

        std::cout<<std::endl;
    }
}


text:
<!-- :
@setlocal EnableDelayedExpansion EnableExtensions
@for %%i in (%~dp0\_packer_config*.cmd) do @call "%%~i"
@if defined PACKER_DEBUG (@echo on) else (@echo off)

echo ==^> Disabling Windows Updates

:: stop the service and disable it
SC stop wuauserv
SC config wuauserv start= disabled

:: Notify before download
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 2 /f

:: turn the whole thing off
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f

:: disable the update prompt scheduled tasks
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" /disable
schtasks.exe /change /tn "\Microsoft\Windows\UpdateOrchestrator\MusUx_UpdateInterval" /disable
schtasks.exe /change /tn "\Microsoft\Windows\WindowsUpdate\sih" /disable

exit /b


text:
package android.support.v4.app;

import android.content.Context;
import android.view.View;

// Referenced classes of package android.support.v4.app:
//            FragmentTabHost

static class mContext
    implements android.widget.Factory
{

    private final Context mContext;

    public View createTabContent(String s)
    {
        View view = new View(mContext);
        view.setMinimumWidth(0);
        view.setMinimumHeight(0);
        return view;
    }

    public (Context context)
    {
        mContext = context;
    }
}


text:
// Copyright 2015 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Unit tests for Logic Proof rules.
 *
 * @author wxyxinyu@gmail.com (Xinyu Wu)
 */

describe('Logic Proof rules service', function() {
  beforeEach(module('oppia'));

  var lprs = null;
  beforeEach(inject(function($injector) {
    lprs = $injector.get('logicProofRulesService');
  }));

  var CORRECT_EXAMPLE = {
    assumptions_string: 'p',
    target_string: 'q',
    proof_string: 'a proof',
    correct: true
  };
  var INCORRECT_EXAMPLE_PARSING = {
    assumptions_string: 'p',
    target_string: 'q',
    proof_string: 'a proof',
    correct: false,
    error_category: 'parsing',
    error_code: 'a code',
    error_message: 'a message',
    error_line_number: 3
  };
  var INCORRECT_EXAMPLE_TYPING = {
    assumptions_string: 'p',
    target_string: 'q',
    proof_string: 'a proof',
    correct: false,
    error_category: 'typing',
    error_code: 'a code',
    error_message: 'a message',
    error_line_number: 4
  };

  it('should have a correct \'correct\' rule', function() {
    expect(lprs.Correct(CORRECT_EXAMPLE, null)).toBe(true);
    expect(lprs.Correct(INCORRECT_EXAMPLE_PARSING, null)).toBe(false);
    expect(lprs.Correct(INCORRECT_EXAMPLE_TYPING, null)).toBe(false);
  });

  it('should have a correct \'not correct\' rule', function() {
    expect(lprs.NotCorrect(CORRECT_EXAMPLE, null)).toBe(false);
    expect(lprs.NotCorrect(INCORRECT_EXAMPLE_PARSING, null)).toBe(true);
    expect(lprs.NotCorrect(INCORRECT_EXAMPLE_TYPING, null)).toBe(true);
  });

  it('should have a correct \'not correct by category\' rule', function() {
    var RULE_INPUT = {
      c: 'typing'
    };
    expect(lprs.NotCorrectByCategory(CORRECT_EXAMPLE, RULE_INPUT)).toBe(false);
    expect(lprs.NotCorrectByCategory(
      INCORRECT_EXAMPLE_PARSING, RULE_INPUT)).toBe(false);
    expect(lprs.NotCorrectByCategory(
      INCORRECT_EXAMPLE_TYPING, RULE_INPUT)).toBe(true);
  });
});


text:
import axios from 'axios';
import requestInterceptor from './requestInterceptor';

const axiosInstance = axios.create({
  baseURL: process.env.API_URL
});

// Add a request interceptor
axiosInstance.interceptors.request.use(requestInterceptor);

export default axiosInstance;


text:
{% macro _render_badge_form_button(regform, tpl, format='text', text='') %}
    {% set no_registrations = not regform.registrations|rejectattr('is_deleted')|list %}
    {% set no_registrations_msg %}
        {% trans %}Registration Form has no registrations{% endtrans %}
    {% endset %}
    {% set print_title -%}
        {%- if tpl.is_ticket -%}
            {% trans %}Print tickets{% endtrans %}
        {%- else -%}
            {% trans %}Print badges{% endtrans %}
        {%- endif -%}
    {%- endset %}
    {% set endpoint = 'registrations_config_tickets' if tpl.is_ticket else 'registrations_config_badges' %}
    {% if format == 'icon' %}

    {% else %}
        {% if no_registrations %}

                {{ text }}

        {% else %}

                {{ text }}

        {% endif %}
    {% endif %}
{% endmacro %}

{% macro _render_template(tpl, target, inherited=false, event=none, default_ticket=none, default_badge=none,
                          not_deletable_templates=[]) -%}

            {{ tpl.title }}

            {% if inherited %}
                {% if not tpl.category.is_root %}
                    {% trans title=tpl.category.title -%}
                        from category "{{ title }}"
                    {% endtrans %}
                {% endif %}
            {% endif %}

                    {% if not event and tpl.type.name == 'badge' and tpl.is_ticket %}
                        {% set inherited_default = default_ticket == tpl and tpl.category != target and
                                not target.default_ticket_template %}
                        {% set global_default = default_ticket == tpl and target.is_root %}
                        <button class="i-button icon-ticket icon-only borderless hide-if-locked toggle-default
                                {{ 'default-on-category' if default_ticket == tpl }}
                                {{ 'inherited' if inherited_default }}
                                {{ 'global-default' if global_default }}"
                                {% if inherited_default %}
                                    title="{% trans %}This is the inherited default ticket template{% endtrans %}"
                                {% elif global_default %}
                                    title="{% trans %}This is the global default ticket template{% endtrans %}"
                                {% else %}
                                    title="{% trans %}Toggle default ticket template for this category{% endtrans %}"
                                    data-href="{{ url_for('.toggle_category_default_ticket', target, template_id=tpl.id) }}"
                                    data-method="POST"
                                    data-update="#template-list"
                                {% endif %}>
                        </button>
                    {% endif %}
                    {% if not event and tpl.type.name == 'badge' and not tpl.is_ticket %}
                        {% set inherited_default = default_badge == tpl and tpl.category != target and
                                not target.default_badge_template %}
                        {% set global_default = default_badge == tpl and target.is_root %}
                        <button class="i-button icon-tag icon-only borderless hide-if-locked toggle-default
                                {{ 'default-on-category' if default_badge == tpl }}
                                {{ 'inherited' if inherited_default }}
                                {{ 'global-default' if global_default }}"
                                {% if inherited_default %}
                                    title="{% trans %}This is the inherited default badge template{% endtrans %}"
                                {% elif global_default %}
                                    title="{% trans %}This is the global default badge template{% endtrans %}"
                                {% else %}
                                    title="{% trans %}Toggle default badge template for this category{% endtrans %}"
                                    data-href="{{ url_for('.toggle_category_default_badge', target, template_id=tpl.id) }}"
                                    data-method="POST"
                                    data-update="#template-list"
                                {% endif %}>
                        </button>
                    {% endif %}
                    {% set clonable = tpl.is_clonable or (not event and tpl.owner == target) %}
                    <button class="i-button icon-copy icon-only text-color borderless hide-if-locked
                        {{ 'not-clonable' if not clonable }}"
                        {% if not clonable %}
                            title="{% trans %}This template cannot be cloned{% endtrans %}">
                        {% else %}
                            title="{% trans %}Clone this template{% endtrans %}"
                            data-href="{{ url_for('.clone_template', target, template_id=tpl.id) }}"
                            data-method="POST"
                            data-update="#template-list"
                            data-confirm="{% trans title=tpl.title -%}
                                              Are you sure you want to clone template '{{ title }}'?
                                          {%- endtrans %}">
                        {% endif %}
                    </button>
                    {% if not inherited %}

                    {% endif %}
                    {% if not inherited %}
                        <button class="i-button icon-remove icon-only text-color borderless danger hide-if-locked
                                {{ 'not-deletable' if tpl in not_deletable_templates }}"
                                {% if tpl in not_deletable_templates %}
                                    {% if tpl.is_system_template %}
                                        title="{% trans %}This template cannot be deleted.{% endtrans %}"
                                    {% else %}
                                        title="{% trans %}This template cannot be deleted because it is used in a registration form or as a backside for another template.{% endtrans %}"
                                    {% endif %}
                                {% else %}
                                    title="{% trans %}Delete template{% endtrans %}"
                                    data-href="{{ url_for('.delete_template', tpl) }}"
                                    data-method="DELETE"
                                    data-update="#template-list"
                                    data-confirm="{% trans title=tpl.title -%}
                                                      Are you sure you want to delete the template '{{ title }}'?
                                                  {%- endtrans %}">
                                {% endif %}
                        </button>
                    {%- endif %}

                    {% if tpl.type.name == 'poster' and event %}
                        <button class="i-button icon-print icon-only highlight text-color borderless"
                                title="{% trans %}Print poster for the event{% endtrans %}"
                                data-href="{{ url_for('event_management.poster_settings', event, template_id=tpl.id) }}"
                                data-title="{% trans %}Poster Printing Settings{% endtrans %}"
                                data-ajax-dialog>
                        </button>
                    {% elif event %}
                        {% set single_form = event.registration_forms|first if event.registration_forms|length == 1 %}
                        {% if single_form %}
                            {{ _render_badge_form_button(single_form, tpl, format='icon') }}
                        {% else %}
                            {% set print_title -%}
                                {%- if tpl.is_ticket -%}
                                    {% trans %}Print tickets{% endtrans %}
                                {%- else -%}
                                    {% trans %}Print badges{% endtrans %}
                                {%- endif -%}
                            {%- endset %}
                            <button class="i-button icon-print icon-only highlight text-color js-dropdown borderless
                                                    {{ 'disabled' if not event.registration_forms }}"
                                    title="{{ print_title if event.registration_forms
                                                else _('There are no registration forms in this event') }}"
                                    data-toggle="dropdown"></button>

                                {% for regform in event.registration_forms %}

                                        {{ _render_badge_form_button(regform, tpl, format='text', text=regform.title) }}

                                {% endfor %}

                        {% endif %}
                    {% endif %}

{% endmacro -%}

{% macro render_template_list(templates, target, inherited_templates=[], event=none, default_ticket=none,
                              default_badge=none, not_deletable_templates=[]) -%}
    {% if inherited_templates %}

{% trans %}Inherited templates{% endtrans %}

                    {% for tpl in inherited_templates | sort(attribute='title') | sort(attribute='type') %}
                        {{ _render_template(tpl, target, inherited=true, event=event,
                                            default_ticket=default_ticket, default_badge=default_badge,
                                            not_deletable_templates=not_deletable_templates) }}
                    {% endfor %}

    {% endif %}

{% trans %}Custom templates{% endtrans %}

            <button class="i-button highlight icon-plus hide-if-locked"
                    data-href="{{ url_for('.add_template', target) }}"
                    data-title="{% trans %}Add a new blank designer template{% endtrans %}"
                    data-update="#template-list"
                    data-ajax-dialog>
                {% trans %}Add new{% endtrans %}
            </button>

        {% if templates %}

                    {% for tpl in templates | sort(attribute='title') | sort(attribute='type') %}
                        {{ _render_template(tpl, target, event=event, default_ticket=default_ticket,
                                            default_badge=default_badge,
                                            not_deletable_templates=not_deletable_templates) }}
                    {% endfor %}

        {% else %}

                {% trans %}No templates{% endtrans %}

        {% endif %}

{% endmacro -%}


text:
<?php

namespace Magento\Sales\Model\Order\Validation;

use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\ValidatorInterface;

/**
 * Class CanShip
 */
class CanShip implements ValidatorInterface
{
    /**
     * @param OrderInterface $entity
     * @return array
     */
    public function validate($entity)
    {
        $messages = [];
        if (!$this->isStateReadyForShipment($entity)) {
            $messages[] = __('A shipment cannot be created when an order has a status of %1', $entity->getStatus());
        } elseif (!$this->canShip($entity)) {
            $messages[] = __('The order does not allow a shipment to be created.');
        }

        return $messages;
    }

    /**
     * @param OrderInterface $order
     * @return bool
     */
    private function isStateReadyForShipment(OrderInterface $order)
    {
        if ($order->getState() === Order::STATE_PAYMENT_REVIEW ||
            $order->getState() === Order::STATE_HOLDED ||
            $order->getIsVirtual() ||
            $order->getState() === Order::STATE_CANCELED
        ) {
            return false;
        }

        return true;
    }

    /**
     * @param OrderInterface $order
     * @return bool
     */
    private function canShip(OrderInterface $order)
    {
        /** @var \Magento\Sales\Model\Order\Item $item */
        foreach ($order->getItems() as $item) {
            if ($item->getQtyToShip() > 0 && !$item->getIsVirtual() && !$item->getLockedDoShip()) {
                return true;
            }
        }

        return false;
    }
}


text:
package org.tmu;

/**
 * Created with IntelliJ IDEA.
 * User: saeed
 * Date: 5/5/13
 * Time: 5:30 PM
 * To change this template use File | Settings | File Templates.
 */
public enum MRSUBCounters {
    Enumerated_SUBGRAPHS,
    Graph_Loaded,
    Finished_States,
    HashMap_Spills,
    Unique_Labels,
    Total_Labels,
    Subgraph_Size,
    Max_State_Elapsed_Millis
}


text:
<?php
namespace TRex\Reflection;

/**
 * Class ClassReflection
 * Reflected a class (but not an object)
 *
 * @package TRex\Reflection
 * @author Raphaël Lefebvre <raphael@raphaellefebvre.be>
 * @transient
 * @method \ReflectionClass getReflector()
 */
class ClassReflection extends Reflection
{
    /*
     * Accepts only the name of the reflected class.
     *
     * var string $className
     */
    public function __construct($className)
    {
        parent::__construct(new \ReflectionClass((string)$className));
    }

    /**
     * Returns the property of the reflected class and all of its parents
     * (This last point is the main difference with the PHP reflection).
     * Filter is the same as \ReflectionProperty of PHP reflection:
     * You can use these constants or use AttributeReflection constants.
     *
     * @param int $filter
     * @return PropertyReflection[]
     */
    public function getReflectionProperties($filter = AttributeReflection::NO_FILTER)
    {
        $result = array();
        foreach ($this->extractProperties($this->getReflector(), $filter) as $key => $reflectedProperty) {
            $result[$key] = PropertyReflection::instantiate($reflectedProperty);
        }
        return $result;
    }

    /**
     *
     * Recursive properties extraction. Returns properties of the $reflectedClass and parents.
     *
     * @param \ReflectionClass $reflectedClass
     * @param int $filter
     * @return \ReflectionProperty[]
     */
    private function extractProperties(\ReflectionClass $reflectedClass, $filter)
    {
        $result = $reflectedClass->getProperties($filter);
        if ($reflectedClass->getParentClass()) {
            $result = array_merge($result, $this->extractProperties($reflectedClass->getParentClass(), $filter));
        }
        return $result;
    }
}


text:
Predicates

Types

                                            <input type="radio"> Auto On

                                            <input type="radio"> Auto Off

                                        <button type="button" title="Zoom In" class="btn btn-default"
                                                ng-click="zoomIn()">
                                        </button>
                                        <button type="button" title="Zoom Out" class="btn btn-default"
                                                ng-click="zoomOut()">
                                        </button>

                                        #
                                        Predicate
                                        Score
                                        Active

                                        {{$index + 1}}
                                        {{clean_label(item.predicate)}}
                                        {{item.score}}

                                            <input type="checkbox" ng-model="item.active"
                                                   ng-disabled="auto_mode" ng-click="update_graph()">

                                Type Hierarchy

                                    {{ clean_label(item.id) }}

                                        <input type="checkbox" ng-model="item.data.active"
                                               ng-disabled="item.data.locked" ng-click="update_graph()">

                                    {{ item.data.count }}

 Layout

                        <form class="form-horizontal">

                                Layout Name

                                    <select class="form-control" id="layout-name" ng-model="layout" ng-options="layout.name for layout in layouts" ng-change="update_layout()"></select>

                                <button type="button" class="btn btn-block btn-default" ng-click="update_layout()"> Redo Layout</button>

                        </form>

Click an Item in the Graph to check its details

                            {{focusedItem.data('name')}}
                            <button class="btn btn-default pull-right" title="Check More Details" ng-click="open_explore_window(focusedItem)"></button>

Type: {{clean_label(type_dict[focusedItem.data('id')][0])}}

Neighbour List

                                    #
                                    Predicate
                                    Node
                                    Locate

                                    {{$index + 1}}
                                    {{clean_label(edge.predicate)}}
                                    {{clean_compound_label(view_model.label_dict[edge.node])}}
                                    <button class="btn btn-sm btn-default btn-locate-edge" ng-click="highlight_edge(focusedItem.data('id'), edge)"></button>

                            {{focusedItem.data('name')}}

Sub Node List

                                    #
                                    Node
                                    Type

                                    {{$index + 1}}
                                    {{clean_label(node)}}
                                    {{clean_label(type_dict[node][0])}}

                            {{focusedItem.data('name')}}

 Export

                    <button type="button" class="btn btn-block btn-default" ng-click="saveImage()"> Save Current Viewport</button>
                    <button type="button" class="btn btn-block btn-default" ng-click="saveGraphJson()"> Save Original Graph (JSON)</button>

        <button type="button" class="btn btn-default btn-sm" title="Reset Viewport" ng-click="reset_viewport()"></button>

{{app.copyright}}

            Check Rankings

Path Ranking

                    #
                    Path
                    Comment
                    Score
                    Do you like it?

                    {{$index+1}}

{{r.comment}}

                    <input ng-model="r.score" type="text" score-input>
                    <input ng-model="r.rating" type="text" rating-input>

Pattern Ranking

                    #
                    Pattern
                    Score
                    Comment

                    {{$index+1}}

                    {{r.score}}

{{r.comment}}


text:
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="generator" content="Google Web Designer 1.7.0.1114">
  <meta name="template" content="Banner 3.0.0">
  <meta name="environment" content="gwd-doubleclick">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="banner/banner/gwdpage_style.css" rel="stylesheet" data-version="8" data-exports-type="gwd-page">
  <link href="banner/banner/gwdpagedeck_style.css" rel="stylesheet" data-version="9" data-exports-type="gwd-pagedeck">
  <link href="banner/banner/gwddoubleclick_style.css" rel="stylesheet" data-version="14" data-exports-type="gwd-doubleclick">
  <link href="banner/banner/gwdimage_style.css" rel="stylesheet" data-version="9" data-exports-type="gwd-image">
  <link href="banner/banner/gwdtaparea_style.css" rel="stylesheet" data-version="4" data-exports-type="gwd-taparea">
  <style type="text/css" id="gwd-lightbox-style">
    .gwd-lightbox {
      overflow: hidden;
    }
  </style>
  <style type="text/css" id="gwd-text-style">
    p {
      margin: 0px;
    }
    h1 {
      margin: 0px;
    }
    h2 {
      margin: 0px;
    }
    h3 {
      margin: 0px;
    }
  </style>
  <style type="text/css">
    html, body {
      width: 100%;
      height: 100%;
      margin: 0px;
    }
    .gwd-page-container {
      position: relative;
      width: 100%;
      height: 100%;
    }
    .gwd-page-content {
      transform: perspective(1400px) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
      transform-style: preserve-3d;
      position: absolute;
      background-color: transparent;
    }
    .gwd-page-wrapper {
      position: absolute;
      transform: translateZ(0px);
      background-color: rgb(255, 255, 255);
    }
    .gwd-page-size {
      width: 600px;
      height: 300px;
    }
    .gwd-img-qt7z {
      position: absolute;
      width: 122px;
      height: 137px;
      left: 26px;
      top: 76px;
      transform-style: preserve-3d;
      border-image-source: none;
      border-color: rgb(232, 231, 243);
      transform-origin: 490px 62px 0px;
      transform: translate3d(-15px, 3px, 0px);
      opacity: 0.37;
    }
    @keyframes gwd-gen-1cnbgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-15px, 3px, 0px);
        border-color: rgb(232, 231, 243);
        transform-origin: 490px 62px 0px;
        opacity: 0.37;
        animation-timing-function: ease;
      }
      80.77% {
        transform: translate3d(418px, 8px, 0px);
        border-color: rgb(0, 0, 0);
        transform-origin: 305px 56px 0px;
        opacity: 1;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(418px, 8px, 0px);
        border-color: rgb(0, 0, 0);
        transform-origin: 305px 56px 0px;
        opacity: 1;
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-1cnbgwdanimation {
      animation: gwd-gen-1cnbgwdanimation_gwd-keyframes 2.6s linear 0s 1 normal forwards;
    }
    .gwd-img-oues {
      position: absolute;
      top: 0px;
      left: 0px;
      transform-style: preserve-3d;
      border-image-source: none;
      border-color: rgb(54, 51, 90);
      opacity: 0.2;
      width: 1024px;
      height: 640px;
      transform: translate3d(-212px, -170px, 0px) scale3d(0.586526, 0.468359, 1);
      background-image: none;
      background-color: rgb(241, 240, 246);
    }
    .gwd-span-1pdo {
      font-size: 47px;
      color: rgb(247, 241, 241);
      font-family: "Amatic SC";
    }
    .gwd-span-11or {
      font-family: "Amatic SC";
    }
    .gwd-span-1tjn {
      font-size: 47px;
      color: rgb(15, 14, 14);
      font-family: "Amatic SC";
    }
    .gwd-span-1tsl {
      font-family: "Amatic SC";
    }
    .gwd-span-187b {
      font-size: 49px;
    }
    .gwd-span-1i19 {
      font-size: 48px;
    }
    .gwd-span-1m4c {
      font-size: 42px;
    }
    .gwd-p-1k0s {
      position: absolute;
      left: 79px;
      top: 97px;
      font-family: Comfortaa;
      font-size: 30px;
      opacity: 1;
      visibility: visible;
      transform-origin: 86px 19px 0px;
      transform-style: preserve-3d;
      transform: translate3d(-77px, 204px, 0px);
    }
    .gwd-p-1k0s.hover {
      background-color: yellow;
    }
    @keyframes gwd-gen-14jwgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-77px, 204px, 0px);
        opacity: 1;
        transform-origin: 86px 19px 0px;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-72px, 148px, 0px);
        opacity: 1;
        transform-origin: 75px -22px 0px;
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-14jwgwdanimation {
      animation: gwd-gen-14jwgwdanimation_gwd-keyframes 0.36s linear 4.874s 1 normal forwards;
    }
    .gwd-p-14dt {
      position: absolute;
      left: 125px;
      top: 114px;
      font-family: Comfortaa;
      font-size: 30px;
      transform-style: preserve-3d;
      visibility: visible;
      transform: translate3d(2px, 186px, 0px);
    }
    .gwd-p-1kml {
      position: absolute;
      left: 162px;
      top: 155px;
      font-family: Comfortaa;
      font-size: 30px;
      transform-style: preserve-3d;
      visibility: visible;
      transform-origin: 71px 20px 0px;
      transform: translate3d(-182px, -193px, 0px);
    }
    @keyframes gwd-gen-ha14gwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-154px, -193px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
      68.76% {
        transform: translate3d(-154px, -193px, 0px);
        animation-timing-function: linear;
      }
      73.52% {
        transform: translate3d(-154px, -193px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
      83.24% {
        transform: translate3d(-154px, -189.29px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-154px, -138px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-ha14gwdanimation {
      animation: gwd-gen-ha14gwdanimation_gwd-keyframes 2.5s linear 0s 1 normal forwards;
    }
    .gwd-gen-ha14gwdanimation p.gwd-gen-ha14gwdanimation:hover {
      color: rgb(221, 221, 221);
    }
    .gwd-p-147p {
      position: absolute;
      left: 119px;
      top: 206px;
      font-family: Comfortaa;
      font-size: 30px;
      transform-style: preserve-3d;
      visibility: visible;
      transform: translate3d(8px, -244px, 0px);
    }
    @keyframes gwd-gen-iekvgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(8px, -244px, 0px);
        animation-timing-function: linear;
      }
      8.94% {
        transform: translate3d(8px, -244px, 0px);
        animation-timing-function: linear;
      }
      9.12% {
        transform: translate3d(8px, -243.927px, 0px);
        animation-timing-function: linear;
      }
      12.02% {
        transform: translate3d(8px, -242.751px, 0px);
        animation-timing-function: linear;
      }
      18.32% {
        transform: translate3d(8px, -240.199px, 0px);
        animation-timing-function: linear;
      }
      29.02% {
        transform: translate3d(8px, -240px, 0px);
        animation-timing-function: linear;
      }
      44.22% {
        transform: translate3d(8px, -142px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(8px, -147px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-iekvgwdanimation {
      animation: gwd-gen-iekvgwdanimation_gwd-keyframes 3.86s linear 1.374s 1 normal forwards;
    }
    .gwd-p-kjkn {
      position: absolute;
      left: 162px;
      top: 225px;
      font-family: Comfortaa;
      font-size: 30px;
      transform-style: preserve-3d;
      visibility: visible;
      transform: translate3d(89px, -263px, 0px);
    }
    @keyframes gwd-gen-mj9kgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(89px, -263px, 0px);
        animation-timing-function: linear;
      }
      58.87% {
        transform: translate3d(89px, -259px, 0px);
        animation-timing-function: linear;
      }
      62.57% {
        transform: translate3d(89px, -219.764px, 0px);
        animation-timing-function: linear;
      }
      66.62% {
        transform: translate3d(89px, -176.887px, 0px);
        animation-timing-function: linear;
      }
      66.87% {
        transform: translate3d(89px, -174.258px, 0px);
        animation-timing-function: linear;
      }
      71.44% {
        transform: translate3d(89px, -125.921px, 0px);
        animation-timing-function: linear;
      }
      72.39% {
        transform: translate3d(89px, -115.809px, 0px);
        animation-timing-function: linear;
      }
      72.47% {
        transform: translate3d(89px, -122px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(89px, -122px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-mj9kgwdanimation {
      animation: gwd-gen-mj9kgwdanimation_gwd-keyframes 5.234s linear 0s 1 normal forwards;
    }
    .gwd-p-1hxb {
      position: absolute;
      left: 344px;
      top: 251px;
      font-family: Comfortaa;
      font-size: 30px;
      transform-style: preserve-3d;
      visibility: visible;
      transform: translate3d(-91px, 49px, 0px);
    }
    @keyframes gwd-gen-jotqgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-91px, 49px, 0px);
        animation-timing-function: linear;
      }
      10.12% {
        transform: translate3d(-91px, 49.5685px, 0px);
        animation-timing-function: linear;
      }
      58.58% {
        transform: translate3d(-91px, 47.4917px, 0px);
        animation-timing-function: linear;
      }
      76.97% {
        transform: translate3d(-91px, -99px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-91px, -99px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-jotqgwdanimation {
      animation: gwd-gen-jotqgwdanimation_gwd-keyframes 3.508s linear 1.726s 1 normal forwards;
    }
    .gwd-taparea-141d {
      position: absolute;
      width: 200px;
      height: 140px;
      left: 51px;
      top: 32px;
      transform-style: preserve-3d;
      transform: translate3d(-69px, -124px, 0px) scale3d(0.670625, 0.196236, 1);
    }
    @keyframes gwd-gen-19ubgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-69px, -124px, 0px) scale3d(0.670625, 0.196236, 1);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-72px, -66px, 0px) scale3d(0.698438, 0.262498, 1);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-19ubgwdanimation {
      animation: gwd-gen-19ubgwdanimation_gwd-keyframes 0.599s linear 2s 1 normal forwards;
    }
    @keyframes gwd-gen-ie5egwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(2px, 186px, 0px);
        animation-timing-function: linear;
      }
      82.86% {
        transform: translate3d(2px, 186px, 0px);
        animation-timing-function: linear;
      }
      93.14% {
        transform: translate3d(2px, 88px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(2px, 88px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-ie5egwdanimation {
      animation: gwd-gen-ie5egwdanimation_gwd-keyframes 5.234s linear 0s 1 normal forwards;
    }
    .gwd-img-1jhw {
      position: absolute;
      transform-style: preserve-3d;
      opacity: 0;
      width: 234px;
      height: 234px;
      top: 0px;
      left: 0px;
      transform-origin: 116.902px 117.088px 0px;
      transform: translate3d(391px, 41px, 0px) rotateZ(0deg) scale3d(0.704657, 0.704657, 1);
    }
    @keyframes gwd-empty-animation {
      0% {
        opacity: 0.001;
      }
      100% {
        opacity: 0;
      }
    }
    @keyframes gwd-gen-ciypgwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586526, 0.468359, 1);
        opacity: 0.2;
        animation-timing-function: ease;
        background-color: rgb(241, 240, 246);
      }
      80.77% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586903, 0.468193, 1);
        opacity: 1;
        animation-timing-function: linear;
        background-color: rgb(247, 246, 253);
      }
      100% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586903, 0.468193, 1);
        opacity: 1;
        animation-timing-function: linear;
        background-color: rgb(247, 246, 253);
      }
    }
    #page1.gwd-play-animation .gwd-gen-ciypgwdanimation {
      animation: gwd-gen-ciypgwdanimation_gwd-keyframes 2.6s linear 0s 1 normal forwards;
    }
    #page1.start .gwd-gen-19ubgwdanimation {
      animation: gwd-gen-19ubgwdanimation_gwd-keyframes_start 0.599s linear -0.599s 1 normal forwards;
    }
    @keyframes gwd-gen-19ubgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-69px, -124px, 0px) scale3d(0.670625, 0.196236, 1);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-72px, -66px, 0px) scale3d(0.698438, 0.262498, 1);
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-jotqgwdanimation {
      animation: gwd-gen-jotqgwdanimation_gwd-keyframes_start 3.508s linear -0.874s 1 normal forwards;
    }
    @keyframes gwd-gen-jotqgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-91px, 49px, 0px);
        animation-timing-function: linear;
      }
      10.12% {
        transform: translate3d(-91px, 49.5685px, 0px);
        animation-timing-function: linear;
      }
      58.58% {
        transform: translate3d(-91px, 47.4917px, 0px);
        animation-timing-function: linear;
      }
      76.97% {
        transform: translate3d(-91px, -99px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-91px, -99px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-mj9kgwdanimation {
      animation: gwd-gen-mj9kgwdanimation_gwd-keyframes_start 5.234s linear -2.6s 1 normal forwards;
    }
    @keyframes gwd-gen-mj9kgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(89px, -263px, 0px);
        animation-timing-function: linear;
      }
      58.87% {
        transform: translate3d(89px, -259px, 0px);
        animation-timing-function: linear;
      }
      62.57% {
        transform: translate3d(89px, -219.764px, 0px);
        animation-timing-function: linear;
      }
      66.62% {
        transform: translate3d(89px, -176.887px, 0px);
        animation-timing-function: linear;
      }
      66.87% {
        transform: translate3d(89px, -174.258px, 0px);
        animation-timing-function: linear;
      }
      71.44% {
        transform: translate3d(89px, -125.921px, 0px);
        animation-timing-function: linear;
      }
      72.39% {
        transform: translate3d(89px, -115.809px, 0px);
        animation-timing-function: linear;
      }
      72.47% {
        transform: translate3d(89px, -122px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(89px, -122px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-iekvgwdanimation {
      animation: gwd-gen-iekvgwdanimation_gwd-keyframes_start 3.86s linear -1.226s 1 normal forwards;
    }
    @keyframes gwd-gen-iekvgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(8px, -244px, 0px);
        animation-timing-function: linear;
      }
      8.94% {
        transform: translate3d(8px, -244px, 0px);
        animation-timing-function: linear;
      }
      9.12% {
        transform: translate3d(8px, -243.927px, 0px);
        animation-timing-function: linear;
      }
      12.02% {
        transform: translate3d(8px, -242.751px, 0px);
        animation-timing-function: linear;
      }
      18.32% {
        transform: translate3d(8px, -240.199px, 0px);
        animation-timing-function: linear;
      }
      29.02% {
        transform: translate3d(8px, -240px, 0px);
        animation-timing-function: linear;
      }
      44.22% {
        transform: translate3d(8px, -142px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(8px, -147px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-ha14gwdanimation {
      animation: gwd-gen-ha14gwdanimation_gwd-keyframes_start 2.5s linear -2.5s 1 normal forwards;
    }
    @keyframes gwd-gen-ha14gwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-154px, -193px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
      68.76% {
        transform: translate3d(-154px, -193px, 0px);
        animation-timing-function: linear;
      }
      73.52% {
        transform: translate3d(-154px, -193px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
      83.24% {
        transform: translate3d(-154px, -189.29px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-154px, -138px, 0px);
        transform-origin: 71px 20px 0px;
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-ie5egwdanimation {
      animation: gwd-gen-ie5egwdanimation_gwd-keyframes_start 5.234s linear -2.6s 1 normal forwards;
    }
    @keyframes gwd-gen-ie5egwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(2px, 186px, 0px);
        animation-timing-function: linear;
      }
      82.86% {
        transform: translate3d(2px, 186px, 0px);
        animation-timing-function: linear;
      }
      93.14% {
        transform: translate3d(2px, 88px, 0px);
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(2px, 88px, 0px);
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-14jwgwdanimation {
      animation: gwd-gen-14jwgwdanimation_gwd-keyframes_start 0.36s linear 2.274s 1 normal forwards;
    }
    @keyframes gwd-gen-14jwgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-77px, 204px, 0px);
        opacity: 1;
        transform-origin: 86px 19px 0px;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(-72px, 148px, 0px);
        opacity: 1;
        transform-origin: 75px -22px 0px;
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-1cnbgwdanimation {
      animation: gwd-gen-1cnbgwdanimation_gwd-keyframes_start 2.6s linear -2.6s 1 normal forwards;
    }
    @keyframes gwd-gen-1cnbgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-15px, 3px, 0px);
        border-color: rgb(232, 231, 243);
        transform-origin: 490px 62px 0px;
        opacity: 0.37;
        animation-timing-function: ease;
      }
      80.77% {
        transform: translate3d(418px, 8px, 0px);
        border-color: rgb(0, 0, 0);
        transform-origin: 305px 56px 0px;
        opacity: 1;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(418px, 8px, 0px);
        border-color: rgb(0, 0, 0);
        transform-origin: 305px 56px 0px;
        opacity: 1;
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-ciypgwdanimation {
      animation: gwd-gen-ciypgwdanimation_gwd-keyframes_start 2.6s linear -2.6s 1 normal forwards;
    }
    @keyframes gwd-gen-ciypgwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586526, 0.468359, 1);
        opacity: 0.2;
        animation-timing-function: ease;
        background-color: rgb(241, 240, 246);
      }
      80.77% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586903, 0.468193, 1);
        opacity: 1;
        animation-timing-function: linear;
        background-color: rgb(247, 246, 253);
      }
      100% {
        transform: translate3d(-212px, -170px, 0px) scale3d(0.586903, 0.468193, 1);
        opacity: 1;
        animation-timing-function: linear;
        background-color: rgb(247, 246, 253);
      }
    }
    @keyframes gwd-gen-1mr6gwdanimation_gwd-keyframes {
      0% {
        transform: translate3d(391px, 41px, 0px) rotateZ(0deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0;
        transform-origin: 116.902px 117.088px 0px;
        top: 0px;
        left: 0px;
        animation-timing-function: linear;
      }
      18.59% {
        transform: translate3d(391px, 41px, 0px) rotateZ(0deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0.79;
        transform-origin: 116.699px 118.022px 0px;
        top: 1px;
        left: 1px;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(391px, 41px, 0px) rotateZ(360deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0.79;
        transform-origin: 116.688px 118.016px 0px;
        top: 1px;
        left: 1px;
        animation-timing-function: linear;
      }
    }
    #page1.gwd-play-animation .gwd-gen-1mr6gwdanimation {
      animation: gwd-gen-1mr6gwdanimation_gwd-keyframes 3.222s linear 2.006s 1 normal forwards;
    }
    @keyframes gwd-gen-1mr6gwdanimation_gwd-keyframes_start {
      0% {
        transform: translate3d(391px, 41px, 0px) rotateZ(0deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0;
        transform-origin: 116.902px 117.088px 0px;
        top: 0px;
        left: 0px;
        animation-timing-function: linear;
      }
      18.59% {
        transform: translate3d(391px, 41px, 0px) rotateZ(0deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0.79;
        transform-origin: 116.699px 118.022px 0px;
        top: 1px;
        left: 1px;
        animation-timing-function: linear;
      }
      100% {
        transform: translate3d(391px, 41px, 0px) rotateZ(360deg) scale3d(0.704657, 0.704657, 1);
        opacity: 0.79;
        transform-origin: 116.688px 118.016px 0px;
        top: 1px;
        left: 1px;
        animation-timing-function: linear;
      }
    }
    #page1.start .gwd-gen-1mr6gwdanimation {
      animation: gwd-gen-1mr6gwdanimation_gwd-keyframes_start 3.222s linear -0.594s 1 normal forwards;
    }
    .gwd-taparea-1pdq {
      position: absolute;
      left: 127px;
      top: 59px;
      height: 37px;
      width: 117px;
      transform-origin: 58.2635px 18.5514px 0px;
    }
    .gwd-taparea-yeyx {
      position: absolute;
      left: 251px;
      top: 103px;
      width: 167px;
      height: 37px;
      transform-origin: 83.6485px 18.5px 0px;
    }
    .gwd-taparea-iimt {
      position: absolute;
      left: 253px;
      top: 152px;
      width: 154px;
      height: 37px;
      transform-origin: 76.758px 18.5px 0px;
    }
    .gwd-taparea-1l2t {
      position: absolute;
      left: 127px;
      top: 202px;
      width: 169px;
      height: 37px;
      transform-origin: 84.672px 18.5px 0px;
    }
    .gwd-taparea-10j7 {
      position: absolute;
      left: 7px;
      top: 245px;
      width: 181px;
      height: 37px;
      transform-origin: 90.5315px 18.5px 0px;
    }
  </style>
  <link href="https://fonts.googleapis.com/css?family=Amatic+SC|Comfortaa" rel="stylesheet" type="text/css"><script data-source="googbase_min.js" data-version="3" data-exports-type="googbase" src="googbase_min.js"></script><script data-source="gwd_webcomponents_min.js" data-version="5" data-exports-type="gwd_webcomponents" src="gwd_webcomponents_min.js"></script>
  <script
  data-source="gwdpage_min.js" data-version="8" data-exports-type="gwd-page" src="gwdpage_min.js"></script><script data-source="gwdpagedeck_min.js" data-version="9" data-exports-type="gwd-pagedeck" src="gwdpagedeck_min.js"></script><script data-source="https://s0.2mdn.net/ads/studio/Enabler.js" data-exports-type="gwd-doubleclick" src="https://s0.2mdn.net/ads/studio/Enabler.js"></script>
    <script
    data-source="gwddoubleclick_min.js" data-version="14" data-exports-type="gwd-doubleclick" src="gwddoubleclick_min.js"></script><script data-source="gwdimage_min.js" data-version="9" data-exports-type="gwd-image" src="gwdimage_min.js"></script><script data-source="gwdtaparea_min.js" data-version="4" data-exports-type="gwd-taparea" src="gwdtaparea_min.js"></script>
      <script
      type="text/javascript" gwd-events="support" src="gwd-events-support.1.0.js"></script>
        <script type="text/javascript" gwd-events="handlers">
          gwd.auto_Gwd_taparea_1Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exit('gwd-ad', 'About', 'http://amandadepasquale.blogspot.com/', true, true);
          };
          gwd.auto_Gwd_taparea_2Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exitOverride('gwd-ad', 'contactEvent', 'http://amandadepasquale.blogspot.com/', true, true);
          };
          gwd.auto_Gwd_taparea_3Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exit('gwd-ad', 'characterEvent', 'http://amandadepasquale.blogspot.com/p/blog-page_23.html', true, true);
          };
          gwd.auto_Gwd_taparea_4Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exit('gwd-ad', 'demoEvent', 'http://amandadepasquale.blogspot.com/p/demo-reel.html', true, true);
          };
          gwd.auto_Gwd_taparea_5Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exit('gwd-ad', 'illustEvent', 'http://amandadepasquale.blogspot.com/p/blog-page_5641.html', true, true);
          };
          gwd.auto_Gwd_taparea_6Action = function(event) {
            // GWD Predefined Function
            gwd.actions.gwdDoubleclick.exit('gwd-ad', 'storyEvent', 'http://amandadepasquale.blogspot.com/p/storyboard.html', true, true);
          };
        </script>
        <script type="text/javascript" gwd-events="registration">
          // Support code for event handling in Google Web Designer
           // This script block is auto-generated. Please do not edit!
          gwd.actions.events.registerEventHandlers = function(event) {
            gwd.actions.events.addHandler('gwd-taparea_1', 'action', gwd.auto_Gwd_taparea_1Action, false);
            gwd.actions.events.addHandler('gwd-taparea_2', 'action', gwd.auto_Gwd_taparea_2Action, false);
            gwd.actions.events.addHandler('gwd-taparea_3', 'action', gwd.auto_Gwd_taparea_3Action, false);
            gwd.actions.events.addHandler('gwd-taparea_4', 'action', gwd.auto_Gwd_taparea_4Action, false);
            gwd.actions.events.addHandler('gwd-taparea_5', 'action', gwd.auto_Gwd_taparea_5Action, false);
            gwd.actions.events.addHandler('gwd-taparea_6', 'action', gwd.auto_Gwd_taparea_6Action, false);
          };
          gwd.actions.events.deregisterEventHandlers = function(event) {
            gwd.actions.events.removeHandler('gwd-taparea_1', 'action', gwd.auto_Gwd_taparea_1Action, false);
            gwd.actions.events.removeHandler('gwd-taparea_2', 'action', gwd.auto_Gwd_taparea_2Action, false);
            gwd.actions.events.removeHandler('gwd-taparea_3', 'action', gwd.auto_Gwd_taparea_3Action, false);
            gwd.actions.events.removeHandler('gwd-taparea_4', 'action', gwd.auto_Gwd_taparea_4Action, false);
            gwd.actions.events.removeHandler('gwd-taparea_5', 'action', gwd.auto_Gwd_taparea_5Action, false);
            gwd.actions.events.removeHandler('gwd-taparea_6', 'action', gwd.auto_Gwd_taparea_6Action, false);
          };
          document.addEventListener("DOMContentLoaded", gwd.actions.events.registerEventHandlers);
          document.addEventListener("unload", gwd.actions.events.deregisterEventHandlers);
        </script>
</head>

<body>
  <gwd-doubleclick id="gwd-ad" polite-load="">
    <gwd-metric-configuration>
      <gwd-metric-event source="gwd-taparea_1" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
      <gwd-metric-event source="gwd-taparea_2" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
      <gwd-metric-event source="gwd-taparea_3" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
      <gwd-metric-event source="gwd-taparea_4" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
      <gwd-metric-event source="gwd-taparea_5" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
      <gwd-metric-event source="gwd-taparea_6" event="tapareaexit" metric="" exit="Exit"></gwd-metric-event>
    </gwd-metric-configuration>
    <div is="gwd-pagedeck" class="gwd-page-container" id="pagedeck">
      <div is="gwd-page" id="page1" class="gwd-page-wrapper gwd-page-size gwd-lightbox" data-gwd-width="600px" data-gwd-height="300px">
        <div class="gwd-page-content gwd-page-size">
          <img is="gwd-image" source="assets/bgbg.jpg" id="gwd-image_3" class="gwd-img-oues gwd-gen-ciypgwdanimation">
          <img is="gwd-image" source="assets/adlogo.png" id="gwd-image_1" class="gwd-img-qt7z gwd-gen-1cnbgwdanimation">
          <p class="gwd-p-1k0s gwd-gen-14jwgwdanimation">Storyboards</p>
          <p class="gwd-p-14dt gwd-gen-ie5egwdanimation">Illustrations</p>
          <p class="gwd-p-1kml gwd-gen-ha14gwdanimation">About Me</p>
          <p class="gwd-p-147p gwd-gen-iekvgwdanimation">Contact</p>
          <p class="gwd-p-kjkn gwd-gen-mj9kgwdanimation">Characters</p>
          <p class="gwd-p-1hxb gwd-gen-jotqgwdanimation">Demo Reel</p>
          <gwd-taparea id="gwd-taparea_1" class="gwd-taparea-141d gwd-gen-19ubgwdanimation"></gwd-taparea>
          <img is="gwd-image" source="assets/circle4140.png" id="Ring" class="gwd-img-1jhw gwd-gen-1mr6gwdanimation" width="2" 34="">
          <gwd_animation_label_element data-label-name="start" data-label-time="2600" data-label-animation-class-name="start"></gwd_animation_label_element>
          <gwd-taparea id="gwd-taparea_2" class="gwd-taparea-1pdq"></gwd-taparea>
          <gwd-taparea id="gwd-taparea_3" class="gwd-taparea-yeyx"></gwd-taparea>
          <gwd-taparea id="gwd-taparea_4" class="gwd-taparea-iimt"></gwd-taparea>
          <gwd-taparea id="gwd-taparea_5" class="gwd-taparea-1l2t"></gwd-taparea>
          <gwd-taparea id="gwd-taparea_6" class="gwd-taparea-10j7"></gwd-taparea>
        </div>
      </div>
    </div>
    <gwd-exit metric="About" url="http://amandadepasquale.blogspot.com/"></gwd-exit>
    <gwd-exit metric="characterEvent" url="http://amandadepasquale.blogspot.com/p/blog-page_23.html"></gwd-exit>
    <gwd-exit metric="demoEvent" url="http://amandadepasquale.blogspot.com/p/demo-reel.html"></gwd-exit>
    <gwd-exit metric="illustEvent" url="http://amandadepasquale.blogspot.com/p/blog-page_5641.html"></gwd-exit>
    <gwd-exit metric="storyEvent" url="http://amandadepasquale.blogspot.com/p/storyboard.html"></gwd-exit>
    <gwd-exit metric="contactEvent" url="http://amandadepasquale.blogspot.com/"></gwd-exit>
  </gwd-doubleclick>
  <script type="text/javascript" id="gwd-init-code">
    (function() {
      var gwdAd = document.getElementById('gwd-ad');

      /**
       * Handles the DOMContentLoaded event. The DOMContentLoaded event is
       * fired when the document has been completely loaded and parsed.
       */
      function handleDomContentLoaded(event) {

      }

      /**
       * Handles the WebComponentsReady event. This event is fired when all
       * custom elements have been registered and upgraded.
       */
      function handleWebComponentsReady(event) {
        // Start the Ad lifecycle.
        setTimeout(function() {
          gwdAd.initAd();
        }, 0);
      }

      /**
       * Handles the event that is dispatched after the Ad has been
       * initialized and before the default page of the Ad is shown.
       */
      function handleAdInitialized(event) {}

      window.addEventListener('DOMContentLoaded',
        handleDomContentLoaded, false);
      window.addEventListener('WebComponentsReady',
        handleWebComponentsReady, false);
      window.addEventListener('adinitialized',
        handleAdInitialized, false);
    })();
  </script>
</body>

</html>


text:
<?php

namespace Chromabits\Illuminated\Conference\Views;

use Chromabits\Nucleus\View\Bootstrap\DropdownFactory;
use Chromabits\Nucleus\View\Common\Anchor;
use Chromabits\Nucleus\View\Common\Div;
use Chromabits\Nucleus\View\Common\Italic;

/**
 * Class NavbarDropdownFactory.
 *
 * @author Eduardo Trujillo <ed@chromabits.com>
 * @package Chromabits\Illuminated\Conference\Views
 */
class NavbarDropdownFactory extends DropdownFactory
{
    /**
     * @var mixed
     */
    protected $content;

    /**
     * Construct an instance of a NavbarDropdownFactory.
     */
    public function __construct()
    {
        parent::__construct();

        $this->content = new Italic(['class' => 'fa fa-ellipsis-h']);
    }

    /**
     * Set content.
     *
     * @param mixed $content
     *
     * @return NavbarDropdownFactory
     */
    public function setContent($content)
    {
        $copy = clone $this;

        $copy->content = $content;

        return $copy;
    }

    /**
     * Build the dropdown element.
     *
     * @return Div
     */
    public function make()
    {
        $menuClasses = ['dropdown-menu'];

        if ($this->right) {
            $menuClasses[] = 'dropdown-menu-right';
        }

        return new Div(['class' => 'dropdown nav-item'], [
            new Anchor(
                [
                    'id' => $this->hash,
                    'class' => 'nav-link',
                    'data-toggle' => 'dropdown',
                    'aria-haspopup' => 'true',
                    'aria-expanded' => 'false',
                ],
                $this->content
            ),
            new Div(
                [
                    'class' => $menuClasses,
                    'aria-labelledby' => $this->hash,
                ],
                $this->options
            ),
        ]);
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<response status="ok" version="1.2"
					xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					xsi:noNamespaceSchemaLocation="http://api.7digital.com/1.2/static/7digitalAPI.xsd">
	<taggedResults>
		<page>1</page>
		<pageSize>1</pageSize>
		<totalItems>7953</totalItems>
		<type>release</type>
		<taggedItem>
			<release id="358263">
				<title>The Fame</title>
				<version></version>
				<type>Album</type>
				<barcode></barcode>
				<year></year>
				<explicitContent>false</explicitContent>
				<artist id="237973">
					<name>Lady GaGa</name>
					<appearsAs>Lady GaGa</appearsAs>
					<url>http://www.7digital.com/artists/lady-gaga/?partner=1300</url>
				</artist>
				<url>http://www.7digital.com/artists/lady-gaga/the-fame-2/?partner=1300</url>
				<image>http://cdn.7static.com/static/img/sleeveart/00/003/582/0000358263_50.jpg</image>
				<releaseDate>2009-01-11T00:00:00Z</releaseDate>
				<formats availableDrmFree="true">
					<format id="17">
						<fileFormat>MP3</fileFormat>
						<bitRate>320</bitRate>
						<drmFree>true</drmFree>
					</format>
				</formats>
				<label id="45">
					<name>Polydor Associated Labels</name>
				</label>
			</release>
		</taggedItem>
	</taggedResults>
</response>


text:
Capistrano::Configuration.instance(:must_exist).load do

  namespace :log do
    desc "Add logrotate entry for this application"
    task :rotate, :roles => :app do
      if yes(msg(:iptables))
        upload_from_erb '/etc/rotate.conf', binding, :folder => 'log'
        sudo_each [
          'cp -f /etc/logrotate.conf /etc/logrotate2.conf',
          'chmod 777 /etc/logrotate2.conf',
          'cat /etc/rotate.conf >> /etc/logrotate2.conf',
          'cp -f /etc/logrotate2.conf /etc/logrotate.conf',
          'rm -f /etc/logrotate2.conf',
          'rm -f /etc/rotate.conf'
        ]
      end
    end
  end

end


text:
#ifndef _MManipData
#define _MManipData
//
//-
// ==========================================================================
// Copyright (C) 1995 - 2006 Autodesk, Inc., and/or its licensors.  All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Autodesk, Inc. ("Autodesk") and/or its
// licensors,  which is protected by U.S. and Canadian federal copyright law
// and by international treaties.
//
// The Data may not be disclosed or distributed to third parties or be
// copied or duplicated, in whole or in part, without the prior written
// consent of Autodesk.
//
// The copyright notices in the Software and this entire statement,
// including the above license grant, this restriction and the following
// disclaimer, must be included in all copies of the Software, in whole
// or in part, and all derivative works of the Software, unless such copies
// or derivative works are solely in the form of machine-executable object
// code generated by a source language processor.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
// AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED
// WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF
// NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
// OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE. IN NO
// EVENT WILL AUTODESK AND/OR ITS LICENSORS BE LIABLE FOR ANY LOST
// REVENUES, DATA, OR PROFITS, OR SPECIAL, DIRECT, INDIRECT, OR
// CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS LICENSORS HAS
// BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
// ==========================================================================
//+
//
// CLASS:    MManipData
//
// *****************************************************************************
//
// CLASS DESCRIPTION (MManipData)
//
//  This class encapulates manipulator data which is returned from the
//  manipulator conversion functions.
//
// *****************************************************************************
//
#if defined __cplusplus

// *****************************************************************************

// INCLUDED HEADER FILES

#include <maya/MStatus.h>
#include <maya/MObject.h>

// *****************************************************************************

// DECLARATIONS

// *****************************************************************************

// CLASS DECLARATION (MManipData)

/// Manipulator Data (OpenMayaUI)
/**
This class encapulates manipulator data which is returned from the
manipulator conversion functions.
*/
#ifdef _WIN32
#pragma warning(disable: 4522)
#endif // _WIN32

class OPENMAYAUI_EXPORT MManipData
{
public:
	///
	MManipData();
	///
	~MManipData();
	///
	MManipData(const MManipData &);
	///
	MManipData(bool);
	///
	MManipData(short);
	///
	MManipData(int);
	///
	MManipData(unsigned int);
	///
	MManipData(float);
	///
	MManipData(double);
	///
	MManipData(const MObject &);

	///
	MManipData &	operator=(const MManipData &);
	///
	MManipData &	operator=(bool);
	///
	MManipData &	operator=(short);
	///
	MManipData &	operator=(int);
	///
	MManipData &	operator=(unsigned int);
	///
	MManipData &	operator=(float);
	///
	MManipData &	operator=(double);
	///
	MManipData &	operator=(const MObject &);

	///
	bool			isSimple()		const;

	///
	bool			asBool()		const;
	///
	short			asShort()		const;
	///
	int			asLong()		const;
	///
	unsigned int		asUnsigned()	const;
	///
	float			asFloat()		const;
	///
	double			asDouble()		const;
	///
	MObject			asMObject()		const;

private:
	const char *className() const;
	bool		fIsSimple;
	double		fSimpleData;
	MObject		fComplexData;
};

#ifdef _WIN32
#pragma warning(default: 4522)
#endif // _WIN32

// *****************************************************************************
#endif /* __cplusplus */
#endif /* _MManipData */


text:
package com.streamsets.pipeline.lib.io;

import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

/**
 * A LiveFileChunk is a data segmented of a {@link LiveFile} that is guaranteed to be comprised of
 * full text lines.
 */
public class LiveFileChunk {
  private final String tag;
  private final LiveFile file;
  private final byte[] data;
  private final Charset charset;
  private final long dataOffset;
  private final int length;
  private final boolean truncated;
  private final List<FileLine> lines;

  // creates a chunk using  existing FileLines instead of a raw buffer to create them
  LiveFileChunk(String tag, LiveFile file, Charset charset, List<FileLine> lines, boolean truncated) {
    this.tag = tag;
    this.file = file;
    this.charset = charset;
    data = null;
    dataOffset = -1;
    length = -1;
    this.lines = lines;
    this.truncated = truncated;
  }

  // creates a chunk using  a raw buffer and creates the FileLines from it
  LiveFileChunk(String tag, LiveFile file, Charset charset, byte[] data, long dataOffset, int length,
      boolean truncated) {
    this.tag = tag;
    this.file = file;
    this.data = data;
    this.charset = charset;
    this.dataOffset = dataOffset;
    this.length = length;
    lines = createLines();
    this.truncated = truncated;
  }

  /**
   * Returns the tag associated with file where the chunk was read from.
   *
   * @return the tag associated with file where the chunk was read from.
   */
  public String getTag() {
      return tag;
  }

  /**
   * Returns the file the chunk was read from.
   *
   * @return the file the chunk was read from.
   */
  public LiveFile getFile() {
    return file;
  }

  /**
   * Returns the chunk charset.
   *
   * @return  the chunk charset.
   */
  public Charset getCharset() {
    return charset;
  }

  /**
   * Returns the chunk buffer. It is reference, do not modify.
   *
   * @return the chunk buffer. It is reference, do not modify.
   */
  public byte[] getBuffer() {
    return data;
  }

  /**
   * Returns a {@link Reader} to the data in the chunk.
   *

   * The {@link Reader} is created using the {@link java.nio.charset.Charset} specified in the {@link SingleLineLiveFileReader}.
   *
   * @return a {@link Reader} to the data in the chunk.
   */
  public Reader getReader() {
    return new InputStreamReader(new ByteArrayInputStream(data, 0, length), charset);
  }

  /**
   * Returns the byte offset of the chunk in the {@link LiveFile}.
   *
   * @return the byte offset of the chunk in the {@link LiveFile}.
   */
  public long getOffset() {
    return dataOffset;
  }

  /**
   * Returns the byte length of the data in the chunk.
   *
   * @return the byte length of the data in the chunk.
   */
  public int getLength() {
    return length;
  }

  /**
   * Returns if the chunk has been truncated. This happens if the last line of the data chunk exceeds the maximum
   * length specified in the {@link SingleLineLiveFileReader}.
   *
   * @return true if the chunk has been truncated, false if not.
   */
  public boolean isTruncated() {
    return truncated;
  }

  /**
   * Returns a list with the {@link FileLine} in the chunk. Using FileLines gives access to the
   * byte offset of each line (which is important when using multi-byte character encodings).
   *
   * @return a list with the {@link FileLine} in the chunk.
   */
  public List<FileLine> getLines() {
    return lines;
  }

  private List<FileLine> createLines() {
    List<FileLine> lines = new ArrayList<>();
    int start = 0;
    for (int i = 0; i < length; i++) {
      if (data[i] == '\n') {
        lines.add(new FileLine(this, start, i + 1 - start));
        start = i + 1;
      } else if (data[i] == '\r') {
        if (i + 1 < length && data[i + 1] == '\n') {
          lines.add(new FileLine(this, start, i + 2 - start));
          start = i + 2;
          i++;
        }
      }
    }
    if (start < length) {
      lines.add(new FileLine(this, start, length - start));
    }
    return lines;
  }

}


text:
extern zend_class_entry *stub_constants_ce;

ZEPHIR_INIT_CLASS(Stub_Constants);

PHP_METHOD(Stub_Constants, getPropWsVarsGet);
PHP_METHOD(Stub_Constants, getPropertyC1);
PHP_METHOD(Stub_Constants, getPropertyC2);
PHP_METHOD(Stub_Constants, getPropertyC3);
PHP_METHOD(Stub_Constants, getPropertyC4);
PHP_METHOD(Stub_Constants, getPropertyC5);
PHP_METHOD(Stub_Constants, getPropertyC6);
PHP_METHOD(Stub_Constants, getPropertyC7);
PHP_METHOD(Stub_Constants, getPropertyC8);
PHP_METHOD(Stub_Constants, getPropertyC9);
PHP_METHOD(Stub_Constants, testReadConstant);
PHP_METHOD(Stub_Constants, testReadClassConstant1);
PHP_METHOD(Stub_Constants, testReadClassConstant2);
PHP_METHOD(Stub_Constants, testReadClassConstant3);
PHP_METHOD(Stub_Constants, testPHPVersionEnvConstant);
PHP_METHOD(Stub_Constants, testClassMagicConstant);
PHP_METHOD(Stub_Constants, testMethodMagicConstant);
PHP_METHOD(Stub_Constants, testFunctionMagicConstant);
PHP_METHOD(Stub_Constants, testNamespaceMagicConstant);
PHP_METHOD(Stub_Constants, testDirConstant);
PHP_METHOD(Stub_Constants, testPHPVersionEnvConstantInExpValue);
PHP_METHOD(Stub_Constants, testStringDelimiterConstantDoubleQuoted);
PHP_METHOD(Stub_Constants, testStringConstantWithVars);
PHP_METHOD(Stub_Constants, testStringPropertyWithVarsAssigned);
PHP_METHOD(Stub_Constants, testStringPropertyWithVarsGet);

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropwsvarsget, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc1, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc2, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc3, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc4, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc5, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc6, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc7, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc8, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_getpropertyc9, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testreadconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testreadclassconstant1, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testreadclassconstant2, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testreadclassconstant3, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testphpversionenvconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testclassmagicconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testmethodmagicconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testfunctionmagicconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testnamespacemagicconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testdirconstant, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_testphpversionenvconstantinexpvalue, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_teststringdelimiterconstantdoublequoted, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_teststringconstantwithvars, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_teststringpropertywithvarsassigned, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_stub_constants_teststringpropertywithvarsget, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEPHIR_INIT_FUNCS(stub_constants_method_entry) {
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropWsVarsGet, arginfo_stub_constants_getpropwsvarsget, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropWsVarsGet, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC1, arginfo_stub_constants_getpropertyc1, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC1, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC2, arginfo_stub_constants_getpropertyc2, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC2, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC3, arginfo_stub_constants_getpropertyc3, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC3, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC4, arginfo_stub_constants_getpropertyc4, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC4, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC5, arginfo_stub_constants_getpropertyc5, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC5, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC6, arginfo_stub_constants_getpropertyc6, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC6, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC7, arginfo_stub_constants_getpropertyc7, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC7, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC8, arginfo_stub_constants_getpropertyc8, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC8, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, getPropertyC9, arginfo_stub_constants_getpropertyc9, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, getPropertyC9, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testReadConstant, arginfo_stub_constants_testreadconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testReadConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testReadClassConstant1, arginfo_stub_constants_testreadclassconstant1, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testReadClassConstant1, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testReadClassConstant2, arginfo_stub_constants_testreadclassconstant2, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testReadClassConstant2, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testReadClassConstant3, arginfo_stub_constants_testreadclassconstant3, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testReadClassConstant3, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testPHPVersionEnvConstant, arginfo_stub_constants_testphpversionenvconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testPHPVersionEnvConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testClassMagicConstant, arginfo_stub_constants_testclassmagicconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testClassMagicConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testMethodMagicConstant, arginfo_stub_constants_testmethodmagicconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testMethodMagicConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testFunctionMagicConstant, arginfo_stub_constants_testfunctionmagicconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testFunctionMagicConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testNamespaceMagicConstant, arginfo_stub_constants_testnamespacemagicconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testNamespaceMagicConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testDirConstant, arginfo_stub_constants_testdirconstant, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testDirConstant, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testPHPVersionEnvConstantInExpValue, arginfo_stub_constants_testphpversionenvconstantinexpvalue, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testPHPVersionEnvConstantInExpValue, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testStringDelimiterConstantDoubleQuoted, arginfo_stub_constants_teststringdelimiterconstantdoublequoted, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testStringDelimiterConstantDoubleQuoted, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testStringConstantWithVars, arginfo_stub_constants_teststringconstantwithvars, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testStringConstantWithVars, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testStringPropertyWithVarsAssigned, arginfo_stub_constants_teststringpropertywithvarsassigned, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testStringPropertyWithVarsAssigned, NULL, ZEND_ACC_PUBLIC)
#endif
#if PHP_VERSION_ID >= 80000
	PHP_ME(Stub_Constants, testStringPropertyWithVarsGet, arginfo_stub_constants_teststringpropertywithvarsget, ZEND_ACC_PUBLIC)
#else
	PHP_ME(Stub_Constants, testStringPropertyWithVarsGet, NULL, ZEND_ACC_PUBLIC)
#endif
	PHP_FE_END
};


text:
static int schedule_shape[2] = { 3, 10000000 };

Schedule *schedule__create() {
  Schedule *schedule;
  schedule = xmalloc( sizeof(Schedule) );

  schedule->narr_schedule = Qnil;
  schedule->schedule_ptr = NULL;

  return schedule;
}

void schedule__init_arrays( Schedule *schedule ) {
  int *ptr,i;
  struct NARRAY *narr;

  schedule->narr_schedule = na_make_object( NA_LINT, 2, schedule_shape, cNArray );
  GetNArray( schedule->narr_schedule, narr );
  ptr = (int*) narr->ptr;
  for( i=0; i<30000000; i++ ) { ptr[i] = 0; }
  schedule->schedule_ptr = ptr;

  return;
}

void schedule__destroy( Schedule *schedule ) {
  xfree( schedule );
  // No need to free NArrays - they will be handled by Ruby's GC, and may still be reachable
  return;
}

// Called by Ruby's GC, we have to mark all child objects that could be in Ruby
// space, so that they don't get deleted.
void schedule__gc_mark( Schedule *schedule ) {
  rb_gc_mark( schedule->narr_schedule );
  return;
}

int schedule__toy_planned( Schedule *schedule, int toy_id ) {
  return ( schedule->schedule_ptr[ toy_id * 3 + 1 ] ? 1 : 0 );
}

ScheduleItem *schedule_item__create() {
  ScheduleItem *schedule_item;
  schedule_item = xmalloc( sizeof(ScheduleItem) );

  schedule_item->toy_id = 0;
  schedule_item->elf_id = 0;
  schedule_item->abs_mins = 0;
  schedule_item->duration = 0;

  return schedule_item;
}

void schedule_item__destroy( ScheduleItem *schedule_item ) {
  xfree( schedule_item );
  // No need to free NArrays - they will be handled by Ruby's GC, and may still be reachable
  return;
}

void schedule__read_item( Schedule *schedule, ScheduleItem *si ) {
  int toy_offset = si->toy_id * 3;
  si->elf_id = schedule->schedule_ptr[ toy_offset ];
  si->abs_mins = schedule->schedule_ptr[ toy_offset + 1 ];
  si->duration = schedule->schedule_ptr[ toy_offset + 2 ];
  return;
}

void schedule__write_item( Schedule *schedule, ScheduleItem *si ) {
  int toy_offset = si->toy_id * 3;
  schedule->schedule_ptr[ toy_offset ] = si->elf_id;
  schedule->schedule_ptr[ toy_offset + 1 ] = si->abs_mins;
  schedule->schedule_ptr[ toy_offset + 2 ] = si->duration;
  return;
}


text:
function [ C, D, E ] = project( obj, coords )
%PROJECT Projects coords onto network given be edge start vectors
%edge_x and edge length vectors edge_d.
% C: cartesian coordinate represenation of projected coords
% D: displacement (row) vectors
% E: edge/network representation of projected coords, like follows:
%    first column has the edge id,
%    second column the (euclidian) distance of target point from start
%      vertex (of given edge)
%
% NB: Projection is done onto network EDGES, i.e. a projection can happen
% only onto points which also have an edge attached.

% number of input points
N = size(coords, 1);

% number of coordinate dimensions
nd = size(coords, 2);

% number of edges
M = obj.numedges;

% edge vectors
[XD,X1,~,V1,V2] = obj.XD;

% edge lengths
L = obj.L;

% vertex coordinates
XY = obj.vertex_coordinates;

assert( M == size(XD,1) );
assert( nd == size(X1,2) );
assert( nd == size(XD,2) );

% projected output coordinates C and displacement vectors D
C = zeros(N,nd);
D = zeros(N,nd);
E = zeros(N,2);

% norm of a matrix of row vectors
norm = @(X) sqrt(sum(X.^2,2));

% dot product of matrices of row vectors
vdot = @(a, b) sum( bsxfun( @times, a, b ), 2 );

% M-by-nd matrix ; normalized edge_d vectors
[d_hat, norms_d] = normalize(XD);

% calculate closest poinst
[closest_points, closest_points_d] = obj.nearest_vertex( coords );

for i=1:N
  s = coords(i,:);

  % length of vector b
  len_b = vdot( d_hat, s ) - vdot( d_hat, X1 );
  b = bsxfun( @times, d_hat, len_b );

  delta = bsxfun( @plus, X1, b );
  delta = bsxfun( @minus, delta, s );
  delta_norms = norm(delta);
  [~,J] = sort(delta_norms);
  % indices of valid projections
  % validity depends on the length of b: valid <=> b >= 0 AND b <= |d|
  valid = len_b >= 0 & len_b <= norms_d;
  valid = find( valid(J) );
  if isempty(valid)
    warning('projection failed for index %d, choosing nearest vertex.', i);
    D(i,:) = XY( closest_points(i), : ) - s;
    E(i,:) = map_point(i);
  else
    valid = valid(1);
    valid = paren(paren(1:M,J),valid);
    D(i,:) = delta(valid,:);
    if closest_points_d(i) < delta_norms(valid)
      % disp(['Found a closer vertex for point ', num2str(i)]);
      try
        cp = closest_points(i);
        [E(i,1), E(i,2)] = map_point(i);
        D(i,:) = XY( cp, : ) - s;
      catch
        warning(['Tried to map mark %d [%f x %f] to network point %d [%f x %f], but failed.\n',...
          'Using usual edge mapping.'], ...
          i, s(1), s(2), cp, XY(cp,1), XY(cp,2) );
        [E(i,1), E(i,2)] = map_edge(i);
      end
    else
      [E(i,1), E(i,2)] = map_edge(i);
    end
  end
  C(i,:) = s + D(i,:);

end

  function [edge_index, d] = map_edge( i )
    edge_index = valid;
    x1 = X1(valid,:);
    x2 = XY(V2(valid),:);
    d = dot( s + D(i,:) -x1 , (x2-x1)/norm(x2-x1) );
  end

  function [edge_index, d] = map_point( i )
    point_index = closest_points(i);
    edge_index = find( V1 == point_index );
    if isempty(edge_index)
      edge_index = find( V2 == point_index );
      if isempty(edge_index)
        error('this point has no edge and is invalid');
      else
        edge_index = edge_index(1);
        d = L(edge_index);
      end
    else
      edge_index = edge_index(1);
      d = 0;
    end
  end

end


text:
<Server port="8005" shutdown="SHUTDOWN">
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
  <Service name="LPS">
    <Connector port="8080"
               compression="on"
               compressionMinSize="2048"
               noCompressionUserAgents="gozilla, traviata"
               compressableMimeType="application/xml,text/html,text/xml,text/javascript,application/x-javascript,application/javascript"/>
    <Engine name="LPS" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger" />
      <Host name="localhost" appBase="webapps" />
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    </Engine>
  </Service>
  <!-- User database for the manager webapp -->
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase"
              type="org.apache.catalina.UserDatabase"/>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
</Server>