text:
<?php

namespace BenGorUser\DoctrineORMBridge\Infrastructure\Persistence\Types;

use BenGorUser\User\Domain\Model\UserRole;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\JsonArrayType;

/**
 * Doctrine ORM user role collection custom type class.
 *
 * @author Beñat Espiña <benatespina@gmail.com>
 */
final class UserRolesType extends JsonArrayType
{
    /**
     * {@inheritdoc}
     */
    public function convertToDatabaseValue($value, AbstractPlatform $platform)
    {
        $roles = array_map(function (UserRole $role) {
            return $role->role();
        }, $value);

        return json_encode($roles);
    }

    /**
     * {@inheritdoc}
     */
    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if (null === $value) {
            return;
        }

        $userRoles = array_map(function ($role) {
            return new UserRole($role);
        }, json_decode($value));

        return $userRoles;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'user_roles';
    }
}


text:
/**@file
 *
 * @defgroup nrf_sdh_soc SoC support in SoftDevice Handler
 * @{
 * @ingroup  nrf_sdh
 * @brief    This file contains the declarations of types and functions required for SoftDevice Handler
 * SoC support.
 */

#ifndef NRF_SDH_SOC_H__
#define NRF_SDH_SOC_H__

#include "app_util.h"
#include "nrf_section_iter.h"
#include "nrf_soc.h"

#ifdef __cplusplus
extern "C" {
#endif

#if !(defined(__LINT__))
/**@brief   Macro for registering @ref nrf_sdh_soc_evt_observer_t. Modules that want to be
 *          notified about SoC events must register the handler using this macro.
 *
 * @details This macro places the observer in a section named "sdh_soc_observers".
 *
 * @param[in]   _name       Observer name.
 * @param[in]   _prio       Priority of the observer event handler.
 *                          The smaller the number, the higher the priority.
 * @param[in]   _handler    SoC event handler.
 * @param[in]   _context    Parameter to the event handler.
 * @hideinitializer
 */
#define NRF_SDH_SOC_OBSERVER(_name, _prio, _handler, _context)                                      \
STATIC_ASSERT(NRF_SDH_SOC_ENABLED, "NRF_SDH_SOC_ENABLED not set!");                                 \
STATIC_ASSERT(_prio < NRF_SDH_SOC_OBSERVER_PRIO_LEVELS, "Priority level unavailable.");             \
NRF_SECTION_SET_ITEM_REGISTER(sdh_soc_observers, _prio, static nrf_sdh_soc_evt_observer_t _name) =  \
{                                                                                \
    .handler   = _handler,                                                                          \
    .p_context = _context                                                                           \
}

/**@brief   Macro for registering an array of @ref nrf_sdh_soc_evt_observer_t.
 *          Modules that want to be notified about SoC events must register the handler using
 *          this macro.
 *
 * Each observer's handler will be dispatched an event with its relative context from @p _context.
 * This macro places the observer in a section named "sdh_soc_observers".
 *
 * @param[in]   _name       Observer name.
 * @param[in]   _prio       Priority of the observer event handler.
 *                          The smaller the number, the higher the priority.
 * @param[in]   _handler    SoC event handler.
 * @param[in]   _context    An array of parameters to the event handler.
 * @param[in]   _cnt        Number of observers to register.
 * @hideinitializer
 */
#define NRF_SDH_SOC_EVENT_OBSERVERS(_name, _prio, _handler, _context, _cnt)                              \
STATIC_ASSERT(NRF_SDH_SOC_ENABLED, "NRF_SDH_SOC_ENABLED not set!");                                      \
STATIC_ASSERT(_prio < NRF_SDH_SOC_OBSERVER_PRIO_LEVELS, "Priority level unavailable.");                  \
NRF_SECTION_SET_ITEM_REGISTER(sdh_soc_observers, _prio, static nrf_sdh_soc_evt_observer_t _name[_cnt]) = \
{                                                                                \
    MACRO_REPEAT_FOR(_cnt, HANDLER_SET, _handler, _context)                                              \
}

#if !(defined(DOXYGEN))
#define HANDLER_SET(_idx, _handler, _context)                                                       \
{                                                                                \
    .handler   = _handler,                                                                          \
    .p_context = _context[_idx],                                                                    \
},
#endif

#else // __LINT__

/* Swallow semicolons */
/*lint -save -esym(528, *) -esym(529, *) : Symbol not referenced. */
#define NRF_SDH_SOC_OBSERVER(A, B, C, D)     static int semicolon_swallow_##A
#define NRF_SDH_SOC_OBSERVERS(A, B, C, D, E) static int semicolon_swallow_##A
/*lint -restore */

#endif

/**@brief   SoC event handler. */
typedef void (*nrf_sdh_soc_evt_handler_t) (uint32_t evt_id, void * p_context);

/**@brief   SoC event observer. */
typedef struct
{
    nrf_sdh_soc_evt_handler_t   handler;    //!< SoC event handler.
    void                      * p_context;  //!< A parameter to the event handler.
} const nrf_sdh_soc_evt_observer_t;

#ifdef __cplusplus
}
#endif

#endif // NRF_SDH_SOC_H__

/** @} */

redpajama_set_name: RedPajamaGithub


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

package org.chromium.components.gcm_driver.instance_id;

import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;

import com.google.android.gms.iid.InstanceID;

import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 * Wraps InstanceID and InstanceIDWithSubtype so they can be used over JNI.
 * Performs disk/network operations on a background thread and replies asynchronously.
 */
@JNINamespace("instance_id")
public class InstanceIDBridge {
    private final Context mContext;
    private final String mSubtype;
    private long mNativeInstanceIDAndroid;
    /**
     * Underlying InstanceID. May be shared by multiple InstanceIDBridges. Must be initialized on
     * a background thread.
     */
    private InstanceID mInstanceID;

    private static boolean sBlockOnAsyncTasksForTesting;

    private InstanceIDBridge(
            long nativeInstanceIDAndroid, Context context, String subtype) {
        mContext = context.getApplicationContext(); // Storing activity context would leak activity.
        mSubtype = subtype;
        mNativeInstanceIDAndroid = nativeInstanceIDAndroid;
    }

    /**
     * Returns a wrapped {@link InstanceIDWithSubtype}. Multiple InstanceIDBridge instances may
     * share an underlying InstanceIDWithSubtype.
     */
    @CalledByNative
    public static InstanceIDBridge create(
            long nativeInstanceIDAndroid, Context context, String subtype) {
        return new InstanceIDBridge(nativeInstanceIDAndroid, context, subtype);
    }

    /**
     * Called when our C++ counterpart is destroyed. Clears the handle to our native C++ object,
     * ensuring it's not called by pending async tasks.
     */
    @CalledByNative
    private void destroy() {
        mNativeInstanceIDAndroid = 0;
    }

    /**
     * If enabled, methods that are usually asynchronous will block returning the control flow to
     * C++ until the asynchronous Java operation has completed. Used this in tests where the Java
     * message loop is not nested. The caller is expected to reset this to false when tearing down.
     */
    @CalledByNative
    private static boolean setBlockOnAsyncTasksForTesting(boolean block) {
        boolean wasBlocked = sBlockOnAsyncTasksForTesting;
        sBlockOnAsyncTasksForTesting = block;
        return wasBlocked;
    }

    /** Async wrapper for {@link InstanceID#getId}. */
    @CalledByNative
    public void getId(final int requestId) {
        new BridgeAsyncTask<String>() {
            @Override
            protected String doBackgroundWork() {
                return mInstanceID.getId();
            }
            @Override
            protected void sendResultToNative(String id) {
                nativeDidGetID(mNativeInstanceIDAndroid, requestId, id);
            }
        }.execute();
    }

    /** Async wrapper for {@link InstanceID#getCreationTime}. */
    @CalledByNative
    public void getCreationTime(final int requestId) {
        new BridgeAsyncTask<Long>() {
            @Override
            protected Long doBackgroundWork() {
                return mInstanceID.getCreationTime();
            }
            @Override
            protected void sendResultToNative(Long creationTime) {
                nativeDidGetCreationTime(mNativeInstanceIDAndroid, requestId, creationTime);
            }
        }.execute();
    }

    /** Async wrapper for {@link InstanceID#getToken(String, String, Bundle)}. */
    @CalledByNative
    private void getToken(final int requestId, final String authorizedEntity, final String scope,
            String[] extrasStrings) {
        final Bundle extras = new Bundle();
        assert extrasStrings.length % 2 == 0;
        for (int i = 0; i < extrasStrings.length; i += 2) {
            extras.putString(extrasStrings[i], extrasStrings[i + 1]);
        }
        new BridgeAsyncTask<String>() {
            @Override
            protected String doBackgroundWork() {
                try {
                    return mInstanceID.getToken(authorizedEntity, scope, extras);
                } catch (IOException ex) {
                    return "";
                }
            }
            @Override
            protected void sendResultToNative(String token) {
                nativeDidGetToken(mNativeInstanceIDAndroid, requestId, token);
            }
        }.execute();
    }

    /** Async wrapper for {@link InstanceID#deleteToken(String, String)}. */
    @CalledByNative
    private void deleteToken(
            final int requestId, final String authorizedEntity, final String scope) {
        new BridgeAsyncTask<Boolean>() {
            @Override
            protected Boolean doBackgroundWork() {
                try {
                    mInstanceID.deleteToken(authorizedEntity, scope);
                    return true;
                } catch (IOException ex) {
                    return false;
                }
            }
            @Override
            protected void sendResultToNative(Boolean success) {
                nativeDidDeleteToken(mNativeInstanceIDAndroid, requestId, success);
            }
        }.execute();
    }

    /** Async wrapper for {@link InstanceID#deleteInstanceID}. */
    @CalledByNative
    private void deleteInstanceID(final int requestId) {
        new BridgeAsyncTask<Boolean>() {
            @Override
            protected Boolean doBackgroundWork() {
                try {
                    mInstanceID.deleteInstanceID();
                    return true;
                } catch (IOException ex) {
                    return false;
                }
            }
            @Override
            protected void sendResultToNative(Boolean success) {
                nativeDidDeleteID(mNativeInstanceIDAndroid, requestId, success);
            }
        }.execute();
    }

    private native void nativeDidGetID(long nativeInstanceIDAndroid, int requestId, String id);
    private native void nativeDidGetCreationTime(
            long nativeInstanceIDAndroid, int requestId, long creationTime);
    private native void nativeDidGetToken(
            long nativeInstanceIDAndroid, int requestId, String token);
    private native void nativeDidDeleteToken(
            long nativeInstanceIDAndroid, int requestId, boolean success);
    private native void nativeDidDeleteID(
            long nativeInstanceIDAndroid, int requestId, boolean success);

    /**
     * Custom {@link AsyncTask} wrapper. As usual, this performs work on a background thread, then
     * sends the result back on the UI thread. Key differences:
     * 1. Lazily initializes mInstanceID before running doBackgroundWork.
     * 2. sendResultToNative will be skipped if the C++ counterpart has been destroyed.
     * 3. Tasks run in parallel (using THREAD_POOL_EXECUTOR) to avoid blocking other Chrome tasks.
     * 4. If setBlockOnAsyncTasksForTesting has been enabled, executing the task will block the UI
     *    thread, then directly call sendResultToNative. This is a workaround for use in tests
     *    that lack a nested Java message loop (which prevents onPostExecute from running).
     */
    private abstract class BridgeAsyncTask<Result> {
        protected abstract Result doBackgroundWork();

        protected abstract void sendResultToNative(Result result);

        public void execute() {
            AsyncTask<Void, Void, Result> task = new AsyncTask<Void, Void, Result>() {
                @Override
                protected Result doInBackground(Void... params) {
                    synchronized (InstanceIDBridge.this) {
                        if (mInstanceID == null) {
                            mInstanceID = InstanceIDWithSubtype.getInstance(mContext, mSubtype);
                        }
                    }
                    return doBackgroundWork();
                }
                @Override
                protected void onPostExecute(Result result) {
                    if (!sBlockOnAsyncTasksForTesting && mNativeInstanceIDAndroid != 0) {
                        sendResultToNative(result);
                    }
                }
            };
            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
            if (sBlockOnAsyncTasksForTesting) {
                Result result;
                try {
                    // Synchronously block the UI thread until doInBackground returns result.
                    result = task.get();
                } catch (InterruptedException | ExecutionException e) {
                    throw new IllegalStateException(e); // Shouldn't happen in tests.
                }
                sendResultToNative(result);
            }
        }
    }
}


text:
import gtk
import gobject
from bb.ui.crumbs.hobwidget import HobAltButton
from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog

"""
The following are convenience classes for implementing GNOME HIG compliant
BitBake GUI's
In summary: spacing = 12px, border-width = 6px
"""

#
# ParsingWarningsDialog
#
class ParsingWarningsDialog (CrumbsDialog):

    def __init__(self, title, warnings, parent, flags, buttons=None):
        super(ParsingWarningsDialog, self).__init__(title, parent, flags, buttons)

        self.warnings = warnings
        self.warning_on = 0
        self.warn_nb = len(warnings)

        # create visual elements on the dialog
        self.create_visual_elements()

    def cancel_button_cb(self, button):
        self.destroy()

    def previous_button_cb(self, button):
        self.warning_on = self.warning_on - 1
        self.refresh_components()

    def next_button_cb(self, button):
        self.warning_on = self.warning_on + 1
        self.refresh_components()

    def refresh_components(self):
        lbl = self.warnings[self.warning_on]
        #when the warning text has more than 400 chars, it uses a scroll bar
        if 0<= len(lbl) < 400:
            self.warning_label.set_size_request(320, 230)
            self.warning_label.set_use_markup(True)
            self.warning_label.set_line_wrap(True)
            self.warning_label.set_markup(lbl)
            self.warning_label.set_property("yalign", 0.00)
        else:
            self.textWindow.set_shadow_type(gtk.SHADOW_IN)
            self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
            self.msgView = gtk.TextView()
            self.msgView.set_editable(False)
            self.msgView.set_wrap_mode(gtk.WRAP_WORD)
            self.msgView.set_cursor_visible(False)
            self.msgView.set_size_request(320, 230)
            self.buf = gtk.TextBuffer()
            self.buf.set_text(lbl)
            self.msgView.set_buffer(self.buf)
            self.textWindow.add(self.msgView)
            self.msgView.show()

        if self.warning_on==0:
            self.previous_button.set_sensitive(False)
        else:
            self.previous_button.set_sensitive(True)

        if self.warning_on==self.warn_nb-1:
            self.next_button.set_sensitive(False)
        else:
            self.next_button.set_sensitive(True)

        if self.warn_nb>1:
            self.heading = "Warning " + str(self.warning_on + 1) + " of " + str(self.warn_nb)
            self.heading_label.set_markup('%s' % self.heading)
        else:
            self.heading = "Warning"
            self.heading_label.set_markup('%s' % self.heading)

        self.show_all()

        if 0<= len(lbl) < 400:
            self.textWindow.hide()
        else:
            self.warning_label.hide()

    def create_visual_elements(self):
        self.set_size_request(350, 350)
        self.heading_label = gtk.Label()
        self.heading_label.set_alignment(0, 0)
        self.warning_label = gtk.Label()
        self.warning_label.set_selectable(True)
        self.warning_label.set_alignment(0, 0)
        self.textWindow = gtk.ScrolledWindow()

        table = gtk.Table(1, 10, False)

        cancel_button = gtk.Button()
        cancel_button.set_label("Close")
        cancel_button.connect("clicked", self.cancel_button_cb)
        cancel_button.set_size_request(110, 30)

        self.previous_button = gtk.Button()
        image1 = gtk.image_new_from_stock(gtk.STOCK_GO_BACK, gtk.ICON_SIZE_BUTTON)
        image1.show()
        box = gtk.HBox(False, 6)
        box.show()
        self.previous_button.add(box)
        lbl = gtk.Label("Previous")
        lbl.show()
        box.pack_start(image1, expand=False, fill=False, padding=3)
        box.pack_start(lbl, expand=True, fill=True, padding=3)
        self.previous_button.connect("clicked", self.previous_button_cb)
        self.previous_button.set_size_request(110, 30)

        self.next_button = gtk.Button()
        image2 = gtk.image_new_from_stock(gtk.STOCK_GO_FORWARD, gtk.ICON_SIZE_BUTTON)
        image2.show()
        box = gtk.HBox(False, 6)
        box.show()
        self.next_button.add(box)
        lbl = gtk.Label("Next")
        lbl.show()
        box.pack_start(lbl, expand=True, fill=True, padding=3)
        box.pack_start(image2, expand=False, fill=False, padding=3)
        self.next_button.connect("clicked", self.next_button_cb)
        self.next_button.set_size_request(110, 30)

        #when there more than one warning, we need "previous" and "next" button
        if self.warn_nb>1:
            self.vbox.pack_start(self.heading_label, expand=False, fill=False)
            self.vbox.pack_start(self.warning_label, expand=False, fill=False)
            self.vbox.pack_start(self.textWindow, expand=False, fill=False)
            table.attach(cancel_button, 6, 7, 0, 1, xoptions=gtk.SHRINK)
            table.attach(self.previous_button, 7, 8, 0, 1, xoptions=gtk.SHRINK)
            table.attach(self.next_button, 8, 9, 0, 1, xoptions=gtk.SHRINK)
            self.vbox.pack_end(table, expand=False, fill=False)
        else:
            self.vbox.pack_start(self.heading_label, expand=False, fill=False)
            self.vbox.pack_start(self.warning_label, expand=False, fill=False)
            self.vbox.pack_start(self.textWindow, expand=False, fill=False)
            cancel_button = self.add_button("Close", gtk.RESPONSE_CANCEL)
            HobAltButton.style_button(cancel_button)

        self.refresh_components()


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>EAGER: Network-Driven Shared Resource Design and Management in Multicores</AwardTitle>
    <AwardEffectiveDate>09/01/2009</AwardEffectiveDate>
    <AwardExpirationDate>08/31/2013</AwardExpirationDate>
    <AwardAmount>261244</AwardAmount>
    <AwardInstrument>
      <Value>Standard Grant</Value>
    </AwardInstrument>
    <Organization>
      05010000
      <Directorate>
        <LongName>Direct For Computer & Info Scie & Enginr</LongName>
      </Directorate>
      <Division>
        <LongName>Division of Computing and Communication Foundations</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Hong Jiang</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>As more compute, memory, and storage resources continue to be integrated within multicore chips and multiprocessor systems built from multicores, significant advancements in the interconnect architecture that enable efficient connectivity and sharing among multiple heterogeneous system resources (including caches) across multiple hierarchy levels are needed. Escalating energy and reliability problems with nanometer technology scaling are making over-provisioning and static allocation of resources less viable for meeting increasing performance demands. This exploratory research investigates new and innovative on-chip network designs and network-driven shared resource management techniques that have the broader impact of laying important groundwork for realizing adaptive, fault-resilient, low-cost, energy- and performance-efficient multicore parallel computing systems with hundreds to thousnads of nodes.</AbstractNarration>
    <MinAmdLetterDate>09/16/2009</MinAmdLetterDate>
    <MaxAmdLetterDate>08/01/2012</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>0946388</AwardID>
    <Investigator>
      <FirstName>Timothy</FirstName>
      <LastName>Pinkston</LastName>
      <EmailAddress>tpink@usc.edu</EmailAddress>
      <StartDate>09/16/2009</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>University of Southern California</Name>
      <CityName>Los Angeles</CityName>
      <ZipCode>900890001</ZipCode>
      <PhoneNumber>2137407762</PhoneNumber>
      <StreetAddress>University Park</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>California</StateName>
      <StateCode>CA</StateCode>
    </Institution>
    <FoaInformation>
      0000912
      <Name>Computer Science</Name>
    </FoaInformation>
  </Award>
</rootTag>


text:
/*
 * plot.c
 *
 * This module takes care of actual plotting and writing postscript commands
 * to output file.
 *
 * Plot parameters given by macros below specify smoothness and number
 * of lines in resulting plot. Tweaking those can result in plots
 * with different smoothness properties.
 */

#include <stdio.h>
#include <stdlib.h>
#include <math.h>               /* for fabs() */
#include "parser.h"
#include "plot.h"

/** SMOOTHING PARAMETERS **/
#define PLOT_COLOR "0 0.4 0.9"
/* higher -> more postscript lines, but smoother */
#define SMOOTHNESS 3000
/* higher -> less postscript lines, but slower and occasionally will fail
   on smooth-then-dense plots (eg. sin(1/x^60) from -10 to 10) */
#define MAX_SMOOTHNESS_LVL 4
#define THRESHOLD .002

/** BOX PARAMETERS **/
/* bounding box LOWER-LEFT and UPPER-RIGHT corners */
#define LLX 18
#define LLY 18
#define URY 774
#define URX 594

/* blank space left from each side of a page */
#define BLANK 50

/** STACK for evaluating parsed expression and stack pointer **/
static double *stack;
static int sp = 0;

#define PUSH(x) stack[sp++] = (x)
#define POP()   stack[--sp]
#define PEEK()  stack[sp - 1]

/** PLOT x and y LIMITS. Initially set to range [-10, 10] **/
static double x_low = -10;
static double x_high = 10;
static double y_low = -10;
static double y_high = 10;

static double scale_x;
static double scale_y;

/* macro to detect if number is nan. x != x iff x is not a number. */
#define IS_NAN(x) (x != x)

/* Function that evaluates parsed expression at a given point 'x'.
 * 'x' is a number that is plugged for 'x' variable in expression.
 * Evaluation is not checked, parsed expression must be cleaned
 * at this stage.
 */
static double evaluate(parsed_expr p, double x)
{
    int i;
    symbol *sym;
    double a, b;

    sp = 0;
    /* if symbol is an operator, pop off two symbols, they are guaranteed
     * to be numbers or variable */
    for (i = 0; i < p.length; i++) {
        sym = p.expr[i];

        switch (sym->type) {
        case OP:
            a = POP();
            if (sym->op->binary) {
                b = POP();
                PUSH((sym->op->eval) (b, a));
            } else
                PUSH((sym->op->eval) (a, 0));
            break;

            /* nothing special happens in case of numbers and variables */
        case NUM:
            PUSH(sym->number);
            break;

        case VAR:
            PUSH(x);
            break;
        }
    }

    /* return remaining element on the stack */
    return stack[0];
}

/* Sets all global variables with values that are known initially */
static void plot_init(int size, Limits * lims)
{
    if (lims) {
        x_low = lims->x_low;
        x_high = lims->x_high;
        y_low = lims->y_low;
        y_high = lims->y_high;
    }

    stack = (double *) calloc(size, sizeof(double));
    sp = 0;

    /* find scale coefficients from real number coordinates to bounding box
     * coordinates */
    scale_x = (URY - LLY - 2 * BLANK) / (x_high - x_low);
    scale_y = (URX - LLX - 2 * BLANK) / (y_high - y_low);
}

/* Plotting procedure.
 * X-axis is segmented according to 'delta' distance, that is distance between
 * consecutive x's (x_i to x_{i + 1} distance). Infinity and NaN checks are
 * performed and corresponding action is taken to prevent mess.
 * Infinity case is handled by computing intersect with plot-box. NaNs
 * are not plotted at all.
 * Adaptive smoothing is performed at the end of plot loop.
 */
static void plot(FILE * out, parsed_expr p)
{
    double delta = (x_high - x_low) / SMOOTHNESS;
    double x_1 = x_low;
    double x_2 = x_low + delta;
    double y_1 = evaluate(p, x_1);
    double y_2 = evaluate(p, x_2);
    double old_x;
    double old_y;
    /* if y-value out of box, compute intersection of line with box */
    double x_intersect;
    int last_out = 1, last_nan = 0;
    int SMOOTHNESS_LVL = MAX_SMOOTHNESS_LVL;

/* Transformation of real number coordinates to plot box coordinates.
 * Plot is in lanscape mode, real x-coordinates are mappend to plot
 * y-coordinate and vice versa.
 * Plot y-coordinates are flipped vertically
 */
#define COORD_X(x) (((x) - x_low) * scale_x + LLY + BLANK)
#define COORD_Y(y) (URX - BLANK - (((y) - y_low) * scale_y))

/* Redefine postscript lineto and moveto commands, such that there is
 * no need to take care of coordinate transformations.
 * x and y coordinates are swapped here.
 */
#define LINETO(x, y) fprintf(out, "%.3f %.3f lineto\n", \
                             COORD_Y(y), COORD_X(x))
#define MOVETO(x, y) fprintf(out, "%.3f %.3f moveto\n", \
                             COORD_Y(y), COORD_X(x))

/* find intersection with y-boundary */
#define INTERSECT(boundary) (x_1 + ((boundary) - y_1) * \
                            (x_2 - x_1) / (y_2 - y_1));

    if (y_1 < y_low)
        y_1 = y_low;
    else if (y_1 > y_high)
        y_1 = y_high;
    else
        last_out = 0;

    /* New path exclusively for function plot */
    fprintf(out, "newpath\n");
    if (!IS_NAN(y_1))
        MOVETO(x_1, y_1);
    else
        last_nan = 1;

    old_x = x_1;
    old_y = y_1;

    /* plotting loop */
    while (x_2 <= x_high) {
        if (IS_NAN(y_2))
            last_nan = 1;
        /* next point is in bounding box, thus can be plotted */
        else if (y_low <= y_2 && y_2 <= y_high) {
            /* handle case where last point was NaN */
            if (last_nan) {
                MOVETO(x_2, y_2);
                last_nan = 0;
                /* handle case where last point was out of box,
                 * find intersections with box. Next line will start
                 * from this point
                 */
            } else if (last_out) {
                /* point is too high or too low? */
                if (y_2 > y_1) {
                    x_intersect = INTERSECT(y_low);
                    if (IS_NAN(x_intersect))
                        x_intersect = x_1;
                    MOVETO(x_intersect, y_low);
                } else {
                    x_intersect = INTERSECT(y_high);
                    if (IS_NAN(x_intersect))
                        x_intersect = x_1;
                    MOVETO(x_intersect, y_high);
                }
            }
            /* Draw a valid line. This plots most of the lines. */
            LINETO(x_2, y_2);

            last_out = 0;
            /* case where next point is out of the box */
        } else {
            /* if last point was in the box, stroke a line to the intersection
             * with y-boundary */
            if (!last_out && !last_nan) {
                if (y_2 > y_1) {
                    x_intersect = INTERSECT(y_high);
                    if (IS_NAN(x_intersect))
                        x_intersect = x_1;
                    LINETO(x_intersect, y_high);
                } else {
                    x_intersect = INTERSECT(y_low);
                    if (IS_NAN(x_intersect))
                        x_intersect = x_1;
                    LINETO(x_intersect, y_low);
                }
            }

            last_out = 1;
        }

/** smoothing procedure **/
/* SLOPE_JUMP is numerically evaluated second derivative, that is
 * difference of first derivatives. Expression is simplified algebraically
 */
#define SLOPE_JUMP (y_2 - y_1 - ((y_1 - old_y)*(x_2 - x_1))/(x_1 - old_x))
#define TOO_SHARP() (fabs(SLOPE_JUMP) > THRESHOLD)
#define TOO_SMOOTH() (fabs(SLOPE_JUMP) < THRESHOLD / 4)

        old_x = x_1;
        old_y = y_1;
        x_1 = x_2;
        y_1 = y_2;
        x_2 = x_1 + delta;
        y_2 = evaluate(p, x_2);

        /* If the plot is too sharp or too smooth,
         * find appropriate smoothness lvl
         * by increasing/decreasing smoothness until right one is found.
         */
        if (TOO_SHARP()) {
            while (SMOOTHNESS_LVL < MAX_SMOOTHNESS_LVL && TOO_SHARP()) {
                delta /= 2;
                x_2 = x_1 + delta;
                y_2 = evaluate(p, x_2);
                SMOOTHNESS_LVL++;
            }
        } else {
            while (SMOOTHNESS_LVL > 0 && TOO_SMOOTH()) {
                delta *= 2;
                x_2 = x_1 + delta;
                y_2 = evaluate(p, x_2);
                SMOOTHNESS_LVL--;
            }
        }

        /* make sure the last point is on the right boundary */
        if (x_1 < x_high && x_1 + delta > x_high) {
            x_2 = x_high;
            y_2 = evaluate(p, x_2);
        }
    }

    /* stroke the path */
    fprintf(out, "%s setrgbcolor\n", PLOT_COLOR);
    fprintf(out, "0.5 setlinewidth\n");
    fprintf(out, "stroke\n\n\n");
}

/* Write valid postscript header */
static void write_header(FILE * out, char *expression)
{
    fprintf(out, "%%!PS-Adobe-3.0 EPSF-3.0\n");
    fprintf(out, "%%%%DocumentMedia: Letter %d %d 0 () ()\n",
            LLX + URX, LLY + URY);
    fprintf(out, "%%%%Title: %s\n", expression);
    fprintf(out, "%%%%Creator: Plot utility\n");
    fprintf(out, "%%%%Pages: 1\n");
    fprintf(out, "%%%%Orientation: Landscape\n");
    fprintf(out, "%%%%BoundingBox: %d %d %d %d\n", LLX, LLY, URX, URY);
    fprintf(out, "%%%%EndComments\n\n");
    fprintf(out, "%%%%Page 1 1\n");
}

/* maximum number of plot labels */
#define MAX_UNITS 8
/* length of plot label line in standard postscript units */
#define LINE_LEN  8

/* write description of axis, can be used for both horizontal
 * and vertical axis as specified by 'horizontal' flag
 */
static void write_axis_units(FILE * out, int horizontal)
{
    double size;
    double axis_scale;
    double power;
    double unit_size;
    double unit_position;
    int print_precision = 0;

    /* x axis */
    if (horizontal)
        size = x_high - x_low;
    /* y axis */
    else
        size = y_high - y_low;

    /* Find scale of corresponding axis such that there will be no more than
     * MAX_UNITS labels.
     */
    power = ceil(log10(size / (MAX_UNITS - 1)) - 1);

    /* try all three allowed subdivisions (1, 2, 5) */
    if (size / (2 * pow(10, power)) < (MAX_UNITS - 1))
        axis_scale = 2;
    else if (size / (5 * pow(10, power)) < (MAX_UNITS - 1))
        axis_scale = 5;
    else {
        axis_scale = 1;
        power++;
    }

    /* find distance between two consecutive labels */
    unit_size = axis_scale * pow(10, power);
    /* find position of first label */
    if (horizontal) {
        unit_position = x_low - fmod(x_low, unit_size);
        if (x_low > 0)
            unit_position += unit_size;
    } else {
        unit_position = y_low - fmod(y_low, unit_size);
        if (y_low > 0)
            unit_position += unit_size;
    }

    /* Only print this many digits. There is no need for labels to have
     * more digits printed than necessary. Eg. we want 1.05, not 1.05000
     */
    if (power < 0)
        print_precision = -(int) power;

    fprintf(out, "newpath\n");

    /* branch on x or y axis */
    if (horizontal) {
        do {
            MOVETO(unit_position, y_low);
            fprintf(out, "%d %d rlineto\n", LINE_LEN, 0);
            fprintf(out, "%d %d rmoveto\n", 2 * LINE_LEN, 0);
            fprintf(out, "90 rotate\n");
            fprintf(out, "(%.*f) show\n", print_precision, unit_position);
            fprintf(out, "-90 rotate\n");

            unit_position += unit_size;
        } while (unit_position <= x_high);
        /* case of vertical axis, rotate more */
    } else {
        do {
            MOVETO(x_low, unit_position);
            fprintf(out, "%d %d rlineto\n", 0, -LINE_LEN);
            fprintf(out, "%d %d rmoveto\n", 0, -2 * LINE_LEN);
            fprintf(out, "180 rotate\n");
            fprintf(out, "(%.*f) show\n", print_precision, unit_position);
            fprintf(out, "-180 rotate\n");

            unit_position += unit_size;
        } while (unit_position <= y_high);
    }

    /* stroke all plot labels */
    fprintf(out, "0 setgray\n");
    fprintf(out, "0.4 setlinewidth\n");
    fprintf(out, "stroke\n\n");
}

/* Draws box around plot and plot labels */
static void write_box(FILE * out)
{
    fprintf(out, "newpath\n");
    MOVETO(x_low, y_low);
    LINETO(x_high, y_low);
    LINETO(x_high, y_high);
    LINETO(x_low, y_high);
    fprintf(out, "closepath\n");
    fprintf(out, "0 setgray\n");
    fprintf(out, "1 setlinewidth\n");
    fprintf(out, "stroke\n\n");

    fprintf(out, "/Helvetica findfont\n");
    fprintf(out, "12 scalefont setfont\n");

    write_axis_units(out, 0);
    write_axis_units(out, 1);
}

/* write ending postscript comments */
static void write_footer(FILE * out)
{
    fprintf(out, "%%%%Trailer\n");
    fprintf(out, "%%%%EOF\n\n");
}

/* plot parsed expression and write it to postscript file */
void write_ps(FILE * out, parsed_expr parsed, char *expr, Limits * lim)
{
    plot_init(parsed.length, lim);

    write_header(out, expr);
    plot(out, parsed);
    write_box(out);
    write_footer(out);

    free(stack);
}


text:
class ScheduleAssignmentCost < ActiveRecord::Base
end


text:
<!DOCTYPE html>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>STAGEBITZ</title>

Company Inventory

                                    <form action="#" method="get">

                                            <select id="searchItemTypes" name="find" data-role="none" onchange="selectChange();">
                                            </select>

                                    </form>

                                    <form action="#">

                                                <input type="search" id="searchText" placeholder="Search" data-role="none" onInput="onEnterPress()" onKeyPress="onEnterPress()"/>
                                                <button id="searchButton" type="button" data-role="none" onclick="search()">
                                                    </button>

                                    </form>


text:
package org.aieonf.model.serialise;

import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import java.util.Stack;
import java.util.logging.Logger;

import org.aieonf.commons.parser.ParseException;
import org.aieonf.commons.strings.StringUtils;
import org.aieonf.concept.IDescriptor;
import org.aieonf.concept.core.ConceptBase;
import org.aieonf.concept.core.Descriptor;
import org.aieonf.concept.core.IConceptBase;
import org.aieonf.model.core.IModelLeaf;
import org.aieonf.model.core.IModelNode;

import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;

public abstract class AbstractModelTypeAdapter<N extends Object, D extends Object> extends TypeAdapter<IModelLeaf<IDescriptor>> {

	public static final String S_ERR_NULL_CHILD = "The child is null: ";
	public static final String S_ERR_CYCLE_DETECTED = "A cycle has been detected ";
	public static final String S_ERR_NO_DESCRIPTOR = "The descriptor is null!";

	public enum Attributes{
		PROPERTIES,//Properties of the model
		DESCRIPTOR,//Descriptor
		CHILDREN,
		ID,
		LEAF,
		PARENT,
		REVERSED;

		public static boolean isAttribute( String str ) {
			for( Attributes attr: values() ){
				if( attr.name().equals(str.toUpperCase()))
					return true;
			}
			return false;
		}
	}

	private Stack<N> nodes;

	//The creation of nodes isd delayed until the descriptor is read, so the rest is temporarily
	//stored as a concept base
	private Store store;
	boolean reversed;

	private Logger logger = Logger.getLogger(this.getClass().getName());

	protected AbstractModelTypeAdapter() {
		nodes = new Stack<>();
		reversed = false;
	}

	@Override
	public IModelLeaf<IDescriptor> read(JsonReader reader) throws IOException {
		JsonToken token = reader.peek();
		if (token == JsonToken.NULL) {
			reader.nextNull();
			return null;
		}
		IModelLeaf<IDescriptor>  result = null;
		try {
			result= onTransform( readNode(reader, true ));
			token = reader.peek();
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return result;
	}

	protected abstract IModelLeaf<IDescriptor> onTransform( N node );

	protected abstract N onCreateNode( long id, IConceptBase base, boolean leaf, D descriptor );

	protected abstract boolean onAddParent( N model, N parent );

	protected abstract boolean onAddChild( N model, N child, boolean reversed, String label );

	protected abstract D onCreateDescriptor( IConceptBase properties );

	/**
	 * Handle cycles. Returns true if a cycle was detected
	 * @param parent
	 * @param child
	 * @param label
	 * @return
	 */
	protected boolean handleCycle( N parent, N child, String label ) {
		long parentId = Long.parseLong( getID( parent ));
		long childId = Long.parseLong( getID( child ));
		if(( parentId < 0 ) && ( childId < 0 ))
			return false;
		if( parentId != childId)
			return false;
		logger.warning( S_ERR_CYCLE_DETECTED + "(" + label + "):" + parentId + "->" + getID( child ));
		return true;
	}

	/**
	 * Get the id of the given node
	 * @param node
	 * @return
	 */
	protected abstract String getID( N node );

	protected Store readLeaf( JsonReader jsonReader) throws IOException {
		JsonToken token = jsonReader.peek();
		if( JsonToken.END_OBJECT == token ) {
			return null;
		}
		jsonReader.nextName().toUpperCase();
		long id = Descriptor.parseId( jsonReader.nextString());
		jsonReader.nextName().toUpperCase();
		boolean leaf = jsonReader.nextBoolean();
		String name = jsonReader.nextName();
		IConceptBase base = null;
		if( name.equals(IConceptBase.S_PROPERTIES)) {
			base = createBase(jsonReader, token);
		}
		else
			base = new ConceptBase();
		store = new Store( id, leaf, base );
		return store;
	}

	protected N readNode( JsonReader jsonReader, boolean root ) throws ParseException, IOException {
		String label;
		String key = null;
		N node = null;
		IConceptBase base;//stores intermediate key-value pairs
		JsonToken token = null;
		boolean completed = false;
		while(!completed && jsonReader.hasNext() ) {
			token = jsonReader.peek();
			logger.fine(token.toString());
			switch( token) {
			case BEGIN_OBJECT:
				jsonReader.beginObject();
				store = readLeaf( jsonReader);
				token = jsonReader.peek();
				if( JsonToken.END_OBJECT.equals(token)) {
					logger.warning(S_ERR_NO_DESCRIPTOR );
					node = onCreateNode( store.id, store.base, store.leaf, null);
					nodes.push(node);
					jsonReader.endObject();
				}

				if( node != null )
					completed = true;
				token = jsonReader.peek();
				break;
			case NAME:
				key = jsonReader.nextName().toUpperCase();
				logger.fine(key);
				D descriptor = null;
				if( Attributes.isAttribute( key )) {
					switch( Attributes.valueOf( key )) {
					case REVERSED:
						reversed = jsonReader.nextBoolean();
						break;
					case CHILDREN:
						node = nodes.peek();
						jsonReader.beginArray();
						token = jsonReader.peek();
						while( !JsonToken.END_ARRAY.equals(token )) {
							jsonReader.beginArray();
							N child = readNode( jsonReader, false );
							token = jsonReader.peek();
							logger.fine( token.name());
							label = IModelLeaf.IS_CHILD;
							if( JsonToken.STRING.equals(token))
								label = jsonReader.nextString();
							else if( JsonToken.NULL.equals(token))
								jsonReader.nextNull();
							if( child != null ) {
								boolean cycle = handleCycle(node, child, label);
								if(!cycle )
									onAddChild( node, child, reversed, label);
							}
							jsonReader.endArray();
							token = jsonReader.peek();
						}
						jsonReader.endArray();
						jsonReader.endObject();
						completed = true;
						break;
					case DESCRIPTOR:
						base = createBase( jsonReader, token);
						descriptor = onCreateDescriptor( base);
						node = onCreateNode( store.id, store.base, store.leaf, descriptor);
						nodes.push(node);
						//Close if it is a leaf
						token = jsonReader.peek();
						if( JsonToken.END_OBJECT.equals(token)) {
							jsonReader.endObject();
							completed = true;
						}
						break;
					case PARENT:
						if( !root ) {
							break;
						}
						jsonReader.beginObject();
						token = jsonReader.peek();
						Store pstore = readLeaf( jsonReader);
						jsonReader.nextName();
						base = createBase( jsonReader, token);
						descriptor = onCreateDescriptor( base);
						N pnode = onCreateNode( pstore.id, pstore.base, pstore.leaf, descriptor);
						onAddParent( node, pnode);
						jsonReader.endObject();
						token = jsonReader.peek();
						if( !JsonToken.END_OBJECT.equals(token))
							break;
						jsonReader.endObject();
						token = jsonReader.peek();
						break;
					case LEAF:
						jsonReader.nextBoolean();
						break;
					default:
						break;
					}
				}
				break;
			case END_ARRAY:
				jsonReader.endArray();
				break;
			case END_OBJECT:
				jsonReader.endObject();
				break;
			default:
				break;
			}
		}
		return ( node == null )? node: ( nodes.isEmpty()? node: nodes.pop());
	}

	protected IConceptBase createBase( JsonReader jsonReader, JsonToken token) throws IOException {
		IConceptBase base = new ConceptBase();
		jsonReader.beginArray();
		while( !JsonToken.END_ARRAY.equals( token )){
			jsonReader.beginObject();
			if( jsonReader.peek().equals(JsonToken.NAME)) {
				String name = jsonReader.nextName();
				token = jsonReader.peek();
				if( !JsonToken.NULL.equals(token)) {
					String value = jsonReader.nextString();
					if( !StringUtils.isEmpty(value))
						name = name.replace(".", "_");
					base.set( name, value);
				}else
					jsonReader.nextNull();
			}
			jsonReader.endObject();
			token = jsonReader.peek();
		}
		jsonReader.endArray();
		return base;
	}

	@Override
	public void write(JsonWriter arg0, IModelLeaf<IDescriptor> leaf) throws IOException {
		write( arg0, leaf, true );
	}

	protected void writeLeaf(JsonWriter arg0, IModelLeaf<IDescriptor> leaf) throws IOException {
		if( leaf == null ) {
			arg0.endObject();
			return;
		}
		arg0.name(Attributes.ID.name());
		arg0.value(leaf.getID());
		arg0.name(Attributes.LEAF.name());
		arg0.value(leaf.isLeaf());
		arg0.name(Attributes.PROPERTIES.name());
		Iterator<Map.Entry<String, String>> iterator = leaf.entrySet().iterator();
		arg0.beginArray();
		while(iterator.hasNext() ) {
			Map.Entry<String, String> entry = iterator.next();
			if( Attributes.ID.name().equals(entry.getKey()))
				continue;
			arg0.beginObject();
			arg0.name(entry.getKey());
			arg0.value(entry.getValue());
			arg0.endObject();
		}
		arg0.endArray();
		if( leaf.getData() != null ) {
			arg0.name(Attributes.DESCRIPTOR.name());
			iterator = leaf.getData().entrySet().iterator();
			arg0.beginArray();
			while(iterator.hasNext() ) {
				Map.Entry<String, String> entry = iterator.next();
				arg0.beginObject();
				arg0.name(entry.getKey());
				arg0.value(entry.getValue());
				arg0.endObject();
			}
			arg0.endArray();
		}
	}

	@SuppressWarnings("unchecked")
	protected void write(JsonWriter arg0, IModelLeaf<IDescriptor> leaf, boolean root ) throws IOException {
		arg0.beginObject();
		writeLeaf( arg0, leaf );
		if( root && leaf.getParent() != null ) {
			arg0.name(Attributes.PARENT.name());
			arg0.beginObject();
			writeLeaf( arg0, (IModelLeaf<IDescriptor>) leaf.getParent() );
			arg0.endObject();
		}
		if( !leaf.isLeaf()) {
			IModelNode<IDescriptor> model = (IModelNode<IDescriptor>) leaf;
			arg0.name(Attributes.REVERSED.name());
			arg0.value(model.isReverse());
			arg0.name(Attributes.CHILDREN.name());
			arg0.beginArray();
			for( Map.Entry<IModelLeaf<? extends IDescriptor>, String> entry: model.getChildren().entrySet() ) {
				IModelLeaf<? extends IDescriptor> child = entry.getKey();
				if( child.equals(model)) {
					logger.warning( S_ERR_CYCLE_DETECTED + model.getID() + "->" + child.getID());
					continue;
				}
				arg0.beginArray();
				write( arg0, (IModelLeaf<IDescriptor>) child, false);
				if( entry.getValue() == null)
					arg0.value( IModelLeaf.IS_CHILD);
				else
					arg0.value(entry.getValue());
				arg0.endArray();
			}
			arg0.endArray();
		}
		arg0.endObject();
	}

	private class Store{

		private long id;
		private boolean leaf;
		private IConceptBase base;

		protected Store(long id, boolean leaf, IConceptBase base) {
			super();
			this.id = id;
			this.leaf = leaf;
			this.base = base;
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebSpider.Data.DatabaseManager;
using WebSpider.SecLock.Objects.Internal;

namespace WebSpider.SecLock.Data.Internal
{
    public class InManufacturerSeriesManager : DataManager
    {
        #region [Constructror]
        public InManufacturerSeriesManager(string ConnectionString)
        {
            // TODO: Complete member initialization
            this.ConnectionString = ConnectionString;
        }
        #endregion

        #region [ Get Data ]
        public List<InManufacturerSeries> GetData()
        {
            String Query = "SELECT * FROM SecLockManufacturerSeries WITH (NOLOCK) ORDER BY Name";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return DataParser.ToList<InManufacturerSeries>(oDm.GetTable());
        }
        public List<InManufacturerSeries> GetData(InManufacturer manufacturer)
        {
            String Query = "SELECT * FROM SecLockManufacturerSeries WITH (NOLOCK) WHERE ManufacturerCode = '" + manufacturer.Code + "' ORDER BY Name";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return DataParser.ToList<InManufacturerSeries>(oDm.GetTable());
        }
        public List<InManufacturerSeries> GetData(InManufacturerSeries manufacturer)
        {
            String Query = "SELECT * FROM SecLockManufacturerSeries WITH (NOLOCK) WHERE ID = '" + manufacturer.ID +"' ORDER BY Name";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return DataParser.ToList<InManufacturerSeries>(oDm.GetTable());
        }
        #endregion

        #region [Count]
        public int Count()
        {
            String Query = "SELECT COUNT(1) FROM SecLockManufacturerSeries WITH (NOLOCK)";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return (int)oDm.GetTable().Rows[0][0];
        }
        public int Count(InManufacturer manufacturer)
        {
            String Query = "SELECT COUNT(1) FROM SecLockManufacturerSeries WITH (NOLOCK) WHERE ManufacturerCode = '" + manufacturer.Code + "'";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return (int)oDm.GetTable().Rows[0][0];
        }
        #endregion

        #region [ Save ]
        public int Save(String ManufacturerCode, InManufacturerSeries manufacturer)
        {
            var x = GetData(manufacturer);
            if (x.Count > 0)
                return Update(ManufacturerCode, manufacturer);
            else
                return Insert(ManufacturerCode, manufacturer);
        }
        #endregion

        #region [ Insert ]
        private int Insert(String ManufacturerCode, InManufacturerSeries manufacturer)
        {
            String Query = "INSERT INTO [SecLockManufacturerSeries]([ManufacturerCode],[Name]) VALUES('"
                +  ManufacturerCode + "','" + manufacturer.Name + "');";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return oDm.RunActionQuery();
        }
        #endregion

        #region [ Update ]
        private int Update(String ManufacturerCode, InManufacturerSeries manufacturer)
        {
            String Query = "UPDATE [SecLockManufacturerSeries] SET [Name] = '" + manufacturer.Name
                + "',[ManufacturerCode] = '" + ManufacturerCode
                + "' WHERE [Name] = '" + manufacturer.Name + "'";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);
            return oDm.RunActionQuery();
        }
        #endregion
    }
}


text:
package com.ppcxy.common.utils.html.jsoup;

import org.jsoup.helper.Validate;
import org.jsoup.nodes.*;
import org.jsoup.parser.Tag;

import java.util.List;

/**
 * The whitelist based HTML cleaner. Use to ensure that end-user provided HTML contains only the elements and attributes
 * that you are expecting; no junk, and no cross-site scripting attacks!
 *

 * The HTML cleaner parses the input as HTML and then runs it through a white-list, so the output HTML can only contain
 * HTML that is allowed by the whitelist.
 *

 * It is assumed that the input HTML is a body fragment; the clean methods only pull from the source's body, and the
 * canned white-lists only allow body contained tags.
 *

 * Rather than interacting directly with a Cleaner object, generally see the {@code clean} methods in {@link org.jsoup.Jsoup}.
 */
public class Cleaner {
    private Whitelist whitelist;

    /**
     * Create a new cleaner, that sanitizes documents using the supplied whitelist.
     *
     * @param whitelist white-list to clean with
     */
    public Cleaner(Whitelist whitelist) {
        Validate.notNull(whitelist);
        this.whitelist = whitelist;
    }

    /**
     * Creates a new, clean document, from the original dirty document, containing only elements allowed by the whitelist.
     * The original document is not modified. Only elements from the dirt document's body are used.
     *
     * @param dirtyDocument Untrusted base document to clean.
     * @return cleaned document.
     */
    public Document clean(Document dirtyDocument) {
        Validate.notNull(dirtyDocument);

        Document clean = Document.createShell(dirtyDocument.baseUri());
        copySafeNodes(dirtyDocument.body(), clean.body());

        return clean;
    }

    /**
     * Dertmines if the input document is valid, against the whitelist. It is considered valid if all the tags and attributes
     * in the input HTML are allowed by the whitelist.
     *

     * This method can be used as a validator for user input forms. An invalid document will still be cleaned successfully
     * using the {@link #clean(Document)} document. If using as a validator, it is recommended to still clean the document
     * to ensure enforced attributes are set correctly, and that the output is tidied.
     *
     * @param dirtyDocument document to test
     * @return true if no tags or attributes need to be removed; false if they do
     */
    public boolean isValid(Document dirtyDocument) {
        Validate.notNull(dirtyDocument);

        Document clean = Document.createShell(dirtyDocument.baseUri());
        int numDiscarded = copySafeNodes(dirtyDocument.body(), clean.body());
        return numDiscarded == 0;
    }

    /**
     * Iterates the input and copies trusted nodes (tags, attributes, text) into the destination.
     *
     * @param source source of HTML
     * @param dest   destination element to copy into
     * @return number of discarded elements (that were considered unsafe)
     */
    private int copySafeNodes(Element source, Element dest) {
        List<Node> sourceChildren = source.childNodes();
        int numDiscarded = 0;

        for (Node sourceChild : sourceChildren) {
            if (sourceChild instanceof Element) {
                Element sourceEl = (Element) sourceChild;

                if (whitelist.isSafeTag(sourceEl.tagName())) { // safe, clone and copy safe attrs
                    ElementMeta meta = createSafeElement(sourceEl);
                    Element destChild = meta.el;
                    dest.appendChild(destChild);

                    numDiscarded += meta.numAttribsDiscarded;
                    numDiscarded += copySafeNodes(sourceEl, destChild); // recurs
                } else { // not a safe tag, but it may have children (els or text) that are, so recurse
                    numDiscarded++;
                    numDiscarded += copySafeNodes(sourceEl, dest);
                }
            } else if (sourceChild instanceof TextNode) {
                TextNode sourceText = (TextNode) sourceChild;
                TextNode destText = new TextNode(sourceText.getWholeText(), sourceChild.baseUri());
                dest.appendChild(destText);
            } // else, we don't care about comments, xml proc instructions, etc
        }
        return numDiscarded;
    }

    private ElementMeta createSafeElement(Element sourceEl) {
        String sourceTag = sourceEl.tagName();
        Attributes destAttrs = new Attributes();
        Element dest = new Element(Tag.valueOf(sourceTag), sourceEl.baseUri(), destAttrs);
        int numDiscarded = 0;

        Attributes sourceAttrs = sourceEl.attributes();
        for (Attribute sourceAttr : sourceAttrs) {
            if (whitelist.isSafeAttribute(sourceTag, sourceEl, sourceAttr))
                destAttrs.put(sourceAttr);
            else
                numDiscarded++;
        }
        Attributes enforcedAttrs = whitelist.getEnforcedAttributes(sourceTag);
        destAttrs.addAll(enforcedAttrs);

        return new ElementMeta(dest, numDiscarded);
    }

    private static class ElementMeta {
        Element el;
        int numAttribsDiscarded;

        ElementMeta(Element el, int numAttribsDiscarded) {
            this.el = el;
            this.numAttribsDiscarded = numAttribsDiscarded;
        }
    }

}


text:
package com.koch.ambeth.merge.util;

import javax.persistence.OptimisticLockException;

import com.koch.ambeth.merge.transfer.ObjRef;
import com.koch.ambeth.service.merge.model.IObjRef;

public final class OptimisticLockUtil {
	public static OptimisticLockException throwDeleted(IObjRef objRef) {
		throw new OptimisticLockException(
				"Object outdated: " + objRef + " has been deleted concurrently", null, objRef);
	}

	public static OptimisticLockException throwDeleted(IObjRef objRef, Object obj) {
		throw new OptimisticLockException(
				"Object outdated: " + objRef + " has been deleted concurrently", null, obj);
	}

	public static OptimisticLockException throwModified(IObjRef objRef, Object givenVersion) {
		return throwModified(objRef, givenVersion, null);
	}

	public static OptimisticLockException throwModified(IObjRef objRef, Object givenVersion,
			Object obj) {
		String givenVersionString = "";
		if (givenVersion != null) {
			givenVersionString = " - given version: " + givenVersion;
		}
		if (obj != null) {
			throw new OptimisticLockException(
					"Object outdated: " + objRef + " has been modified concurrently" + givenVersionString,
					null, obj);
		}
		throw new OptimisticLockException(
				"Object outdated: " + objRef + " has been modified concurrently" + givenVersionString, null,
				new ObjRef(objRef.getRealType(), objRef.getIdNameIndex(), objRef.getId(), givenVersion));
	}

	private OptimisticLockUtil() {
		// Intended blank
	}
}


text:
package com.artemis;

import java.nio.ByteBuffer;

/**
 * Packs components into a memory-friendly storage, such as a primitive array or {@link ByteBuffer},
 * reuses the same instance for all entities.
 *

 * Constructor must either be zero-length or take a {@link World} instance.
 * Calling the constructor must not change the underlying component data - ie,
 * it's the equivalent of a {@link #clone()}.
 */
public abstract class PackedComponent extends Component {

	/**
	 * Sets the currently processed entity. Automatically
	 * called by {@link PackedComponentMapper}.
	 *
	 * @param e Entity to process.
	 */
	protected abstract void forEntity(Entity e);

	/**
	 * Internal method, used by the {@link ComponentManager},
	 * will always send the highest seen {@link Entity#getId()}.
	 *

	 * Ensures that the backing data storage can accomodate
	 * all entities.
	 *
	 * @param id Highest seen entity id.
	 */
	protected abstract void ensureCapacity(int id);

	/**
	 * Resets the component upon deletion.
	 */
	protected abstract void reset();

	/**
	 * Marks packed component for freeing of resources upon {@link World#dispose()}. Called once.
	 */
	public static interface DisposedWithWorld {
		void free(World world);
	}
}


text:
#ifndef PREP_H
#define PREP_H

#include "nodes/plannodes.h"
#include "nodes/relation.h"

/*
 * prototypes for prepjointree.c
 */
extern void pull_up_sublinks(PlannerInfo *root);
extern void inline_set_returning_functions(PlannerInfo *root);
extern Node *pull_up_subqueries(PlannerInfo *root, Node *jtnode,
				   JoinExpr *lowest_outer_join,
				   AppendRelInfo *containing_appendrel);
extern void flatten_simple_union_all(PlannerInfo *root);
extern void reduce_outer_joins(PlannerInfo *root);
extern Relids get_relids_in_jointree(Node *jtnode, bool include_joins);
extern Relids get_relids_for_join(PlannerInfo *root, int joinrelid);

/*
 * prototypes for prepqual.c
 */
extern Node *negate_clause(Node *node);
extern Expr *canonicalize_qual(Expr *qual);

/*
 * prototypes for preptlist.c
 */
extern List *preprocess_targetlist(PlannerInfo *root, List *tlist);

extern PlanRowMark *get_plan_rowmark(List *rowmarks, Index rtindex);

/*
 * prototypes for prepunion.c
 */
extern Plan *plan_set_operations(PlannerInfo *root, double tuple_fraction,
					List **sortClauses);

extern void expand_inherited_tables(PlannerInfo *root);

extern Node *adjust_appendrel_attrs(Node *node, AppendRelInfo *appinfo);

#endif   /* PREP_H */


text:
Deface::Override.new(:virtual_path => "spree/admin/products/_form",
                     :name => "admin_product_restriction",
                     :insert_top => "[data-hook='admin_product_form_additional_fields']",
                     :locals => {:stars => 3, :edit_enabled => true},
                     :text => '
<%= t(:restriction_label) %>

                                 <%= f.field_container :restrictions do %>
    <%= f.label :role_ids, t(:restriction_description) %>

      <%= f.select :role_ids, roles_for(@product), {}, :class => "select2", :multiple => true %>
    <% end %>

',
                     :disabled => false)


text:
<?php

namespace Loginbox;

use Http\Client\HttpClient;
use Loginbox\Connection\RestClient;
use stdClass;

/**
 * Class Loginbox
 *
 * @package Loginbox
 */
class Loginbox
{
    const API_USER = "api";
    const SDK_VERSION = "1.0";
    const SDK_USER_AGENT = "loginbox-sdk-php";
    const DEFAULT_TIME_ZONE = "UTC";

    /**
     * @var RestClient
     */
    protected $restClient;

    /**
     * @var null|string
     */
    protected $apiKey;

    /**
     * Loginbox constructor.
     *
     * @param string     $apiKey
     * @param HttpClient $httpClient
     */
    public function __construct($apiKey, HttpClient $httpClient = null)
    {
        $this->apiKey = $apiKey;
        $this->restClient = new RestClient($apiKey, $apiEndpoint = 'api.loginbox.io', $httpClient);
    }

    /**
     * @param string $endpointUrl
     * @param array  $postData
     * @param array  $files
     *
     * @return stdClass
     * @throws Connection\Exceptions\GenericHTTPError
     * @throws Connection\Exceptions\InvalidCredentials
     * @throws Connection\Exceptions\MissingEndpoint
     * @throws Connection\Exceptions\MissingRequiredParameters
     */
    public function post($endpointUrl, $postData = array(), $files = array())
    {
        return $this->restClient->post($endpointUrl, $postData, $files);
    }

    /**
     * @param string $endpointUrl
     * @param array  $queryString
     *
     * @return stdClass
     * @throws Connection\Exceptions\GenericHTTPError
     * @throws Connection\Exceptions\InvalidCredentials
     * @throws Connection\Exceptions\MissingEndpoint
     * @throws Connection\Exceptions\MissingRequiredParameters
     */
    public function get($endpointUrl, $queryString = array())
    {
        return $this->restClient->get($endpointUrl, $queryString);
    }

    /**
     * @param string $endpointUrl
     *
     * @return stdClass
     * @throws Connection\Exceptions\GenericHTTPError
     * @throws Connection\Exceptions\InvalidCredentials
     * @throws Connection\Exceptions\MissingEndpoint
     * @throws Connection\Exceptions\MissingRequiredParameters
     */
    public function delete($endpointUrl)
    {
        return $this->restClient->delete($endpointUrl);
    }

    /**
     * @param string $endpointUrl
     * @param array  $putData
     *
     * @return stdClass
     * @throws Connection\Exceptions\GenericHTTPError
     * @throws Connection\Exceptions\InvalidCredentials
     * @throws Connection\Exceptions\MissingEndpoint
     * @throws Connection\Exceptions\MissingRequiredParameters
     */
    public function put($endpointUrl, $putData)
    {
        return $this->restClient->put($endpointUrl, $putData);
    }

    /**
     * @param string $apiVersion
     *
     * @return $this
     */
    public function setApiVersion($apiVersion)
    {
        $this->restClient->setApiVersion($apiVersion);

        return $this;
    }

    /**
     * @param boolean $sslEnabled
     *
     * @return $this
     */
    public function setSslEnabled($sslEnabled)
    {
        $this->restClient->setSslEnabled($sslEnabled);

        return $this;
    }
}


text:
[![test](https://github.com/r7kamura/rspec-request_describer/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/rspec-request_describer/actions/workflows/test.yml)
[![Gem Version](https://badge.fury.io/rb/rspec-request_describer.svg)](https://rubygems.org/gems/rspec-request_describer)

An RSpec plugin to write self-documenting request-specs.

This gem is designed for:

- [rack-test](https://github.com/rack-test/rack-test)
- [rspec-rails](https://github.com/rspec/rspec-rails)

## Setup

### Install

Add this line to your application's Gemfile:

```ruby
gem 'rspec-request_describer'
```

And then execute:

```
bundle
```

Or install it yourself as:

```
gem install rspec-request_describer
```

### Include

Include `RSpec::RequestDescriber` to your example groups like this:

```ruby
require 'rspec/request_describer'

RSpec.configure do |config|
  config.include RSpec::RequestDescriber, type: :request
end
```

## Usage

Note that this is an example in a Rails app.

### subject

`RSpec::RequestDescriber` provides `subject` from its top-level description.

```ruby
# subject will be `get('/users')`.
RSpec.describe 'GET /users' do
  it 'returns 200' do
    subject
    expect(response).to have_http_status(200)
  end
end
```

### headers

If you want to modify request headers, change `headers` before calling `subject`.

```ruby
# `subject` will be `get('/users', headers: { 'Authorization' => 'token 12345' })`.
RSpec.describe 'GET /users' do
  context 'with Authorization header' do
    before do
      headers['Authorization'] = 'token 12345'
    end

    it 'returns 200' do
      subject
      expect(response).to have_http_status(200)
    end
  end
end
```

### params

If you want to modify request parameters, change `params` before calling `subject`.

```ruby
# `subject` will be `get('/users', params: { 'sort' => 'id' })`.
RSpec.describe 'GET /users' do
  context 'with sort parameter' do
    before do
      params['sort'] = 'id'
    end

    it 'returns 200 with expected JSON body' do
      subject
      expect(response).to have_http_status(200)
      expect(response.parsed_body).to match(
        [
          hash_including('id' => 1),
          hash_including('id' => 2),
        ]
      )
    end
  end
end
```

### path parameters

You can embed variables in URL path like `/users/:user_id`.
In this example, the returned value of `user_id` method will be emobeded as its real value.

```ruby
# `subject` will be `get("/users/#{user_id}")`.
RSpec.describe 'GET /users/:user_id' do
  let(:user) do
    User.create(name: 'alice')
  end

  let(:user_id) do
    user.id
  end

  it 'returns 200' do
    subject
    expect(response).to have_http_status(200)
  end
end
```


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>AdoNetAppender.GetLogStatement Method</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            Apache log4net™ SDK Documentation - Microsoft .NET Framework 4.0

AdoNetAppender.GetLogStatement Method

 Formats the log message into database statement text.

        [Visual Basic]

Overridable Protected Function GetLogStatement( _
   ByVal logEvent As LoggingEvent _
) As String

        [C#]

protected virtual string GetLogStatement(
   LoggingEvent logEvent
);

Parameters

          logEvent

The event being logged.

Return Value

 Text that can be passed to a IDbCommand.

Remarks

 This method can be overridden by subclasses to provide more control over the format of the database statement.

See Also

        AdoNetAppender Class | log4net.Appender Namespace

      <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
        <param name="Keyword" value="GetLogStatement method">
        </param>
        <param name="Keyword" value="GetLogStatement method, AdoNetAppender class">
        </param>
        <param name="Keyword" value="AdoNetAppender.GetLogStatement method">
        </param>
      </object>

Copyright 2004-2013 The Apache Software Foundation.

Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.


text:
<?php
/**
 * @link https://github.com/borodulin/yii2-services
 * @license https://github.com/borodulin/yii2-services/blob/master/LICENSE.md
 */

namespace conquer\services;

use yii\base\Component;

/**
 * DocumentSoapObjectWrapper is a wrapper class internally used
 * when generatorConfig contains bindingStyle key set to document value.
 *
 * @author Jan Was <jwas@nets.com.pl>
 * @package system.web.services
 */
class DocumentSoapObjectWrapper extends Component
{
    /**
     * @var object the service provider
     */
    public $object = null;

    /**
     * Constructor.
     * @param object $object the service provider
     * @param array $config
     */
    public function __construct($object, $config = [])
    {
        $this->object = $object;
        parent::__construct($config);
    }

    /**
     * PHP __call magic method.
     * This method calls the service provider to execute the actual logic.
     * @param string $name method name
     * @param array $arguments method arguments
     * @return mixed method return value
     */
    public function __call($name, $arguments)
    {
        if (is_array($arguments) && isset($arguments[0])) {
            $result = call_user_func_array([$this->object, $name], (array)$arguments[0]);
        } else {
            $result = call_user_func_array([$this->object, $name], $arguments);
        }
        return $result === null ? $result : [$name . 'Result' => $result];
    }

    /**
     * Returns the fully qualified name of this class.
     * @return string the fully qualified name of this class.
     */
    public static function className()
    {
        return get_called_class();
    }
}


text:
import chalk from 'chalk';
import moment from 'moment';

/**
 * Log writing system.
 */
class Log {

  /**
   * Log a message with blue (Docker) prefix. The message will not be chalked automatically.
   *
   * @param msg the message
   */
  static info(msg) {
    Log._log(chalk.blue('(Docker) ') + msg);
  }

  /**
   * Log a message with red (Docker) prefix. The msg will also be red.
   *
   * @param msg the message
   */
  static error(msg) {
    Log._log(chalk.red('(Docker) ' + msg));
  }

  /**
   * Log the msg and prepend it with a timestamp in the format of [HH:mm:ss].
   *
   * @param msg the message
   * @private
   */
  static _log(msg) {
    let time = moment().format('HH:mm:ss');
    console.log(`[${chalk.gray(time)}] ${msg}`);
  }
}

export default Log;


text:
<?php

namespace phpDocumentor\Reflection;

use phpDocumentor\Event\Dispatcher;
use phpDocumentor\Parser\Event\LogEvent;
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\DocBlock\Context;
use phpDocumentor\Reflection\DocBlock\Location;
use phpDocumentor\Reflection\Event\PostDocBlockExtractionEvent;
use phpDocumentor\Reflection\Exception;
use PhpParser\Node\Stmt\ClassMethod;
use Psr\Log\LogLevel;
use PhpParser\Comment\Doc;
use PhpParser\Node;
use PhpParser\Node\Const_;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\Include_;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassConst;
use PhpParser\Node\Stmt\Const_ as ConstStmt;
use PhpParser\Node\Stmt\Function_;
use PhpParser\Node\Stmt\InlineHTML;
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Property;
use PhpParser\Node\Stmt\PropertyProperty;
use PhpParser\Node\Stmt\Trait_;
use PhpParser\Node\Stmt\UseUse;
use PhpParser\NodeVisitor;

/**
 * Reflection class for a full file.
 *
 * @author    Mike van Riel <mike.vanriel@naenius.com>
 * @copyright 2010-2012 Mike van Riel / Naenius (http://www.naenius.com)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
 * @link      http://phpdoc.org
 */
class FileReflector extends ReflectionAbstract implements NodeVisitor
{
    /** @var string An MD5 hashed representation of the contents of this file */
    protected $hash;

    /** @var string The contents of this file. */
    protected $contents = '';

    /** @var IncludeReflector[] */
    protected $includes = array();

    /** @var ConstantReflector[] */
    protected $constants = array();

    /** @var ClassReflector[] */
    protected $classes = array();

    /** @var TraitReflector[] */
    protected $traits = array();

    /** @var InterfaceReflector[] */
    protected $interfaces = array();

    /** @var FunctionReflector[] */
    protected $functions = array();

    /** @var string The name of the file associated with this reflection object. */
    protected $filename = '';

    /** @var DocBlock */
    protected $doc_block;

    /** @var string The package name that should be used if none is present in the file */
    protected $default_package_name = 'Default';

    /** @var string[] A list of markers contained in this file. */
    protected $markers = array();

    /** @var string[] A list of errors during processing */
    protected $parse_markers = array();

    /** @var string[] A list of all marker types to search for in this file. */
    protected $marker_terms = array('TODO', 'FIXME');

    /** @var Context */
    protected $context;

    /**
     * Opens the file and retrieves its contents.
     *
     * During construction the given file is checked whether it is readable and
     * if the $validate argument is true a PHP Lint action is executed to
     * check whether the there are no parse errors.
     *
     * By default the Lint check is disabled because of the performance hit
     * introduced by this action.
     *
     * If the validation checks out, the file's contents are read, converted to
     * UTF-8 and the object is created from those contents.
     *
     * @param string  $file     Name of the file.
     * @param boolean $validate Whether to check the file using PHP Lint.
     * @param string  $encoding The encoding of the file.
     *
     * @throws Exception\UnreadableFile If the filename is incorrect or
     *   the file cannot be opened
     * @throws Exception\UnparsableFile If the file fails PHP lint checking
     *   (this can only happen when $validate is set to true)
     */
    public function __construct($file, $validate = false, $encoding = 'utf-8')
    {
        if (!is_string($file) || (!is_readable($file))) {
            throw new Exception\UnreadableFile(
                'The given file should be a string, should exist on the filesystem and should be readable'
            );
        }

        if ($validate) {
            exec('php -l ' . escapeshellarg($file), $output, $result);
            if ($result != 0) {
                throw new Exception\UnparsableFile(
                    'The given file could not be interpreted as it contains errors: '
                    . implode(PHP_EOL, $output)
                );
            }
        }

        $this->filename = $file;
        $this->contents = file_get_contents($file);
        $this->context = new Context();

        if (strtolower($encoding) !== 'utf-8' && extension_loaded('iconv')) {
            $this->contents = iconv(
                strtolower($encoding),
                'utf-8//IGNORE//TRANSLIT',
                $this->contents
            );
        }

        // filemtime($file) is sometimes between 0.00001 and 0.00005 seconds
        // faster but md5 is more accurate. It can also result in false
        // positives or false negatives after copying or checking out a codebase.
        $this->hash = md5($this->contents);
    }

    public function process()
    {
        // with big fluent interfaces it can happen that PHP-Parser's Traverser
        // exceeds the 100 recursions limit; we set it to 10000 to be sure.
        ini_set('xdebug.max_nesting_level', 10000);

        $traverser = new Traverser();
        $traverser->addVisitor($this);
        $traverser->traverse($this->contents);

        $this->scanForMarkers();
    }

    /**
     * @return ClassReflector[]
     */
    public function getClasses()
    {
        return $this->classes;
    }

    /**
     * @return TraitReflector[]
     */
    public function getTraits()
    {
        return $this->traits;
    }

    /**
     * @return ConstantReflector[]
     */
    public function getConstants()
    {
        return $this->constants;
    }

    /**
     * @return FunctionReflector[]
     */
    public function getFunctions()
    {
        return $this->functions;
    }

    /**
     * @return IncludeReflector[]
     */
    public function getIncludes()
    {
        return $this->includes;
    }

    /**
     * @return InterfaceReflector[]
     */
    public function getInterfaces()
    {
        return $this->interfaces;
    }

    public function beforeTraverse(array $nodes)
    {
        $node = null;
        $key = 0;
        foreach ($nodes as $k => $n) {
            if (!$n instanceof InlineHTML) {
                $node = $n;
                $key = $k;
                break;
            }
        }

        if ($node) {
            $comments = (array) $node->getAttribute('comments');

            // remove non-DocBlock comments
            $comments = array_values(
                array_filter(
                    $comments,
                    function ($comment) {
                        return $comment instanceof Doc;
                    }
                )
            );

            if (!empty($comments)) {
                try {
                    $docblock = new DocBlock(
                        (string) $comments[0],
                        null,
                        new Location($comments[0]->getLine())
                    );

                    // the first DocBlock in a file documents the file if
                    // * it precedes another DocBlock or
                    // * it contains a @package tag and doesn't precede a class
                    //   declaration or
                    // * it precedes a non-documentable element (thus no include,
                    //   require, class, function, define, const)
                    if (count($comments) > 1
                        || (!$node instanceof Class_
                        && !$node instanceof Interface_
                        && $docblock->hasTag('package'))
                        || !$this->isNodeDocumentable($node)
                    ) {
                        $this->doc_block = $docblock;

                        // remove the file level DocBlock from the node's comments
                        array_shift($comments);
                    }
                } catch (\Exception $e) {
                    $this->log($e->getMessage(), LogLevel::CRITICAL);
                }
            }

            // always update the comments attribute so that standard comments
            // do not stop DocBlock from being attached to an element
            $node->setAttribute('comments', $comments);
            $nodes[$key] = $node;
        }

        if (class_exists('phpDocumentor\Event\Dispatcher')) {
            Dispatcher::getInstance()->dispatch(
                'reflection.docblock-extraction.post',
                PostDocBlockExtractionEvent
                ::createInstance($this)->setDocblock($this->doc_block)
            );
        }

        return $nodes;
    }

    /**
     * Checks whether the given node is recogized by phpDocumentor as a
     * documentable element.
     *
     * The following elements are recognized:
     *
     * - Trait
     * - Class
     * - Interface
     * - Class constant
     * - Class method
     * - Property
     * - Include/Require
     * - Constant, both const and define
     * - Function
     *
     * @param Node $node
     *
     * @return bool
     */
    protected function isNodeDocumentable(Node $node)
    {
        return ($node instanceof Class_)
            || ($node instanceof Interface_)
            || ($node instanceof ClassConst)
            || ($node instanceof ClassMethod)
            || ($node instanceof ConstStmt)
            || ($node instanceof Function_)
            || ($node instanceof Property)
            || ($node instanceof PropertyProperty)
            || ($node instanceof Trait_)
            || ($node instanceof Include_)
            || ($node instanceof FuncCall
            && ($node->name instanceof Name)
            && $node->name == 'define');
    }

    public function enterNode(Node $node)
    {
    }

    public function getName()
    {
        return $this->filename;
    }

    public function getFilename()
    {
        return $this->filename;
    }

    public function getHash()
    {
        return $this->hash;
    }

    public function getDocBlock()
    {
        return $this->doc_block;
    }

    public function getLineNumber()
    {
        return 0;
    }

    public function getDefaultPackageName()
    {
        return $this->default_package_name;
    }

    /**
     * Adds a marker to scan the contents of this file for.
     *
     * @param string $name The Marker term, e.g. FIXME or TODO.
     *
     * @return void
     */
    public function addMarker($name)
    {
        $this->marker_terms[] = $name;
    }

    /**
     * Sets a list of markers to search for.
     *
     * @param string[] $markers A list of marker terms to scan for.
     *
     * @see phpDocumentor\Reflection\FileReflector::addMarker()
     *
     * @return void
     */
    public function setMarkers(array $markers)
    {
        $this->marker_terms = array();

        foreach ($markers as $marker) {
            $this->addMarker($marker);
        }
    }

    public function getMarkers()
    {
        return $this->markers;
    }

    /**
     * Adds a parse error to the system
     *
     * @param LogEvent $data Contains the type,
     *     message, line and code element.
     *
     * @return void
     */
    public function addParserMarker($data)
    {
        $this->parse_markers[] = array(
            $data->getType(),
            $data->getMessage(),
            $data->getLine(),
            $data->getCode()
        );
    }

    /**
     * Scans the file for markers and records them in the markers property.
     *
     * @see getMarkers()
     *
     * @todo this method may incur a performance penalty while the AST also
     * contains the comments. This method should be replaced by a piece of
     * code that interprets the comments in the AST.
     * This has not been done since that may be an extensive refactoring (each
     * PhpParser\Node* contains a 'comments' attribute and must thus recursively
     * be discovered)
     *
     * @return void
     */
    public function scanForMarkers()
    {
        // find all markers, get the entire file and check for marker terms.
        $marker_data = array();
        foreach (explode("\n", $this->contents) as $line_number => $line) {
            preg_match_all(
                '~//[\s]*(' . implode('|', $this->marker_terms) . ')\:?[\s]*(.*)~',
                $line,
                $matches,
                PREG_SET_ORDER
            );
            foreach ($matches as &$match) {
                $match[3] = $line_number + 1;
            }
            $marker_data = array_merge($marker_data, $matches);
        }

        // store marker results and remove first entry (entire match),
        // this results in an array with 2 entries:
        // marker name and content
        $this->markers = $marker_data;
        foreach ($this->markers as &$marker) {
            array_shift($marker);
        }
    }

    public function getParseErrors()
    {
        return $this->parse_markers;
    }

    public function getNamespace()
    {
        return $this->context->getNamespace();
    }

    public function getNamespaceAliases()
    {
        return $this->context->getNamespaceAliases();
    }

    public function getContents()
    {
        return $this->contents;
    }

    public function setDefaultPackageName($default_package_name)
    {
        $this->default_package_name = $default_package_name;
    }

    public function setFilename($filename)
    {
        $this->filename = $filename;
    }

    public function leaveNode(Node $node)
    {
        $prettyPrinter = new PrettyPrinter;

        switch (get_class($node)) {
            case 'PhpParser\Node\Stmt\Use_':
                /** @var \PhpParser\Node\Stmt\UseUse $use */
                foreach ($node->uses as $use) {
                    $this->context->setNamespaceAlias(
                        $use->alias,
                        implode('\\', $use->name->parts)
                    );
                }
                break;
            case 'PhpParser\Node\Stmt\Namespace_':
                $this->context->setNamespace(
                    isset($node->name) && ($node->name) ? implode('\\', $node->name->parts) : ''
                );
                break;
            case 'PhpParser\Node\Stmt\Class_':
                $class = new ClassReflector($node, $this->context);
                $class->parseSubElements();
                $this->classes[] = $class;
                break;
            case 'PhpParser\Node\Stmt\Trait_':
                $trait = new TraitReflector($node, $this->context);
                $trait->parseSubElements();
                $this->traits[] = $trait;
                break;
            case 'PhpParser\Node\Stmt\Interface_':
                $interface = new InterfaceReflector($node, $this->context);
                $interface->parseSubElements();
                $this->interfaces[] = $interface;
                break;
            case 'PhpParser\Node\Stmt\Function_':
                $function = new FunctionReflector($node, $this->context);
                $this->functions[] = $function;
                break;
            case 'PhpParser\Node\Stmt\Const_':
                foreach ($node->consts as $constant) {
                    $reflector = new ConstantReflector(
                        $node,
                        $this->context,
                        $constant
                    );
                    $this->constants[] = $reflector;
                }
                break;
            case 'PhpParser\Node\Expr\FuncCall':
                if (($node->name instanceof Name)
                    && ($node->name == 'define')
                    && isset($node->args[0])
                    && isset($node->args[1])
                ) {
                    // transform the first argument of the define function call into a constant name
                    $name = str_replace(
                        array('\\\\', '"', "'"),
                        array('\\', '', ''),
                        trim($prettyPrinter->prettyPrintExpr($node->args[0]->value), '\'')
                    );
                    $nameParts = explode('\\', $name);
                    $shortName = end($nameParts);

                    $constant = new Const_($shortName, $node->args[1]->value, $node->getAttributes());
                    $constant->namespacedName = new Name($name);

                    $constant_statement = new ConstStmt(array($constant));
                    $constant_statement->setAttribute('comments', array($node->getDocComment()));
                    $this->constants[] = new ConstantReflector($constant_statement, $this->context, $constant);
                }
                break;
            case 'PhpParser\Node\Expr\Include_':
                $include = new IncludeReflector($node, $this->context);
                $this->includes[] = $include;
                break;
        }
    }

    public function afterTraverse(array $nodes)
    {
    }
}


text:
package ru.job4j.strategy;

/**
 * Class Triangle.
 * @author Artem Bartenev (bartenev92@gmail.com)
 * @version $Id$
 * @since 04.10.2017
 */
public class Triangle implements Shape {
    /**
     * Override method pic from Shape.
     * @return string by triangle picture.
     */
    @Override
    public String pic() {
        StringBuilder pic = new StringBuilder();
        pic.append("  /\\  ");
        pic.append("\n");
        pic.append(" /  \\ ");
        pic.append("\n");
        pic.append("/    \\");
        return pic.toString();
    }
}


text:
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "recast/Recast/Recast.h"
#include "recast/Recast/RecastAlloc.h"
#include "RecastDump.h"

duFileIO::~duFileIO()
{
	// Empty
}

static void ioprintf(duFileIO* io, const char* format, ...)
{
	char line[256];
	va_list ap;
	va_start(ap, format);
	const int n = vsnprintf(line, sizeof(line), format, ap);
	va_end(ap);
	if (n > 0)
		io->write(line, sizeof(char)*n);
}

bool duDumpPolyMeshToObj(rcPolyMesh& pmesh, duFileIO* io)
{
	if (!io)
	{
		printf("duDumpPolyMeshToObj: input IO is null.\n");
		return false;
	}
	if (!io->isWriting())
	{
		printf("duDumpPolyMeshToObj: input IO not writing.\n");
		return false;
	}

	const int nvp = pmesh.nvp;
	const float cs = pmesh.cs;
	const float ch = pmesh.ch;
	const float* orig = pmesh.bmin;

	ioprintf(io, "# Recast Navmesh\n");
	ioprintf(io, "o NavMesh\n");

	ioprintf(io, "\n");

	for (int i = 0; i < pmesh.nverts; ++i)
	{
		const unsigned short* v = &pmesh.verts[i*3];
		const float x = orig[0] + v[0]*cs;
		const float y = orig[1] + (v[1]+1)*ch + 0.1f;
		const float z = orig[2] + v[2]*cs;
		ioprintf(io, "v %f %f %f\n", x,y,z);
	}

	ioprintf(io, "\n");

	for (int i = 0; i < pmesh.npolys; ++i)
	{
		const unsigned short* p = &pmesh.polys[i*nvp*2];
		for (int j = 2; j < nvp; ++j)
		{
			if (p[j] == RC_MESH_NULL_IDX) break;
			ioprintf(io, "f %d %d %d\n", p[0]+1, p[j-1]+1, p[j]+1);
		}
	}

	return true;
}

bool duDumpPolyMeshDetailToObj(rcPolyMeshDetail& dmesh, duFileIO* io)
{
	if (!io)
	{
		printf("duDumpPolyMeshDetailToObj: input IO is null.\n");
		return false;
	}
	if (!io->isWriting())
	{
		printf("duDumpPolyMeshDetailToObj: input IO not writing.\n");
		return false;
	}

	ioprintf(io, "# Recast Navmesh\n");
	ioprintf(io, "o NavMesh\n");

	ioprintf(io, "\n");

	for (int i = 0; i < dmesh.nverts; ++i)
	{
		const float* v = &dmesh.verts[i*3];
		ioprintf(io, "v %f %f %f\n", v[0],v[1],v[2]);
	}

	ioprintf(io, "\n");

	for (int i = 0; i < dmesh.nmeshes; ++i)
	{
		const unsigned int* m = &dmesh.meshes[i*4];
		const unsigned int bverts = m[0];
		const unsigned int btris = m[2];
		const unsigned int ntris = m[3];
		const unsigned char* tris = &dmesh.tris[btris*4];
		for (unsigned int j = 0; j < ntris; ++j)
		{
			ioprintf(io, "f %d %d %d\n",
					(int)(bverts+tris[j*4+0])+1,
					(int)(bverts+tris[j*4+1])+1,
					(int)(bverts+tris[j*4+2])+1);
		}
	}

	return true;
}

static const int CSET_MAGIC = ('c' << 24) | ('s' << 16) | ('e' << 8) | 't';
static const int CSET_VERSION = 2;

bool duDumpContourSet(struct rcContourSet& cset, duFileIO* io)
{
	if (!io)
	{
		printf("duDumpContourSet: input IO is null.\n");
		return false;
	}
	if (!io->isWriting())
	{
		printf("duDumpContourSet: input IO not writing.\n");
		return false;
	}

	io->write(&CSET_MAGIC, sizeof(CSET_MAGIC));
	io->write(&CSET_VERSION, sizeof(CSET_VERSION));

	io->write(&cset.nconts, sizeof(cset.nconts));

	io->write(cset.bmin, sizeof(cset.bmin));
	io->write(cset.bmax, sizeof(cset.bmax));

	io->write(&cset.cs, sizeof(cset.cs));
	io->write(&cset.ch, sizeof(cset.ch));

	io->write(&cset.width, sizeof(cset.width));
	io->write(&cset.height, sizeof(cset.height));
	io->write(&cset.borderSize, sizeof(cset.borderSize));

	for (int i = 0; i < cset.nconts; ++i)
	{
		const rcContour& cont = cset.conts[i];
		io->write(&cont.nverts, sizeof(cont.nverts));
		io->write(&cont.nrverts, sizeof(cont.nrverts));
		io->write(&cont.reg, sizeof(cont.reg));
		io->write(&cont.area, sizeof(cont.area));
		io->write(cont.verts, sizeof(int)*4*cont.nverts);
		io->write(cont.rverts, sizeof(int)*4*cont.nrverts);
	}

	return true;
}

bool duReadContourSet(struct rcContourSet& cset, duFileIO* io)
{
	if (!io)
	{
		printf("duReadContourSet: input IO is null.\n");
		return false;
	}
	if (!io->isReading())
	{
		printf("duReadContourSet: input IO not reading.\n");
		return false;
	}

	int magic = 0;
	int version = 0;

	io->read(&magic, sizeof(magic));
	io->read(&version, sizeof(version));

	if (magic != CSET_MAGIC)
	{
		printf("duReadContourSet: Bad voodoo.\n");
		return false;
	}
	if (version != CSET_VERSION)
	{
		printf("duReadContourSet: Bad version.\n");
		return false;
	}

	io->read(&cset.nconts, sizeof(cset.nconts));

	cset.conts = (rcContour*)rcAlloc(sizeof(rcContour)*cset.nconts, RC_ALLOC_PERM);
	if (!cset.conts)
	{
		printf("duReadContourSet: Could not alloc contours (%d)\n", cset.nconts);
		return false;
	}
	memset(cset.conts, 0, sizeof(rcContour)*cset.nconts);

	io->read(cset.bmin, sizeof(cset.bmin));
	io->read(cset.bmax, sizeof(cset.bmax));

	io->read(&cset.cs, sizeof(cset.cs));
	io->read(&cset.ch, sizeof(cset.ch));

	io->read(&cset.width, sizeof(cset.width));
	io->read(&cset.height, sizeof(cset.height));
	io->read(&cset.borderSize, sizeof(cset.borderSize));

	for (int i = 0; i < cset.nconts; ++i)
	{
		rcContour& cont = cset.conts[i];
		io->read(&cont.nverts, sizeof(cont.nverts));
		io->read(&cont.nrverts, sizeof(cont.nrverts));
		io->read(&cont.reg, sizeof(cont.reg));
		io->read(&cont.area, sizeof(cont.area));

		cont.verts = (int*)rcAlloc(sizeof(int)*4*cont.nverts, RC_ALLOC_PERM);
		if (!cont.verts)
		{
			printf("duReadContourSet: Could not alloc contour verts (%d)\n", cont.nverts);
			return false;
		}
		cont.rverts = (int*)rcAlloc(sizeof(int)*4*cont.nrverts, RC_ALLOC_PERM);
		if (!cont.rverts)
		{
			printf("duReadContourSet: Could not alloc contour rverts (%d)\n", cont.nrverts);
			return false;
		}

		io->read(cont.verts, sizeof(int)*4*cont.nverts);
		io->read(cont.rverts, sizeof(int)*4*cont.nrverts);
	}

	return true;
}

static const int CHF_MAGIC = ('r' << 24) | ('c' << 16) | ('h' << 8) | 'f';
static const int CHF_VERSION = 3;

bool duDumpCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io)
{
	if (!io)
	{
		printf("duDumpCompactHeightfield: input IO is null.\n");
		return false;
	}
	if (!io->isWriting())
	{
		printf("duDumpCompactHeightfield: input IO not writing.\n");
		return false;
	}

	io->write(&CHF_MAGIC, sizeof(CHF_MAGIC));
	io->write(&CHF_VERSION, sizeof(CHF_VERSION));

	io->write(&chf.width, sizeof(chf.width));
	io->write(&chf.height, sizeof(chf.height));
	io->write(&chf.spanCount, sizeof(chf.spanCount));

	io->write(&chf.walkableHeight, sizeof(chf.walkableHeight));
	io->write(&chf.walkableClimb, sizeof(chf.walkableClimb));
	io->write(&chf.borderSize, sizeof(chf.borderSize));

	io->write(&chf.maxDistance, sizeof(chf.maxDistance));
	io->write(&chf.maxRegions, sizeof(chf.maxRegions));

	io->write(chf.bmin, sizeof(chf.bmin));
	io->write(chf.bmax, sizeof(chf.bmax));

	io->write(&chf.cs, sizeof(chf.cs));
	io->write(&chf.ch, sizeof(chf.ch));

	int tmp = 0;
	if (chf.cells) tmp |= 1;
	if (chf.spans) tmp |= 2;
	if (chf.dist) tmp |= 4;
	if (chf.areas) tmp |= 8;

	io->write(&tmp, sizeof(tmp));

	if (chf.cells)
		io->write(chf.cells, sizeof(rcCompactCell)*chf.width*chf.height);
	if (chf.spans)
		io->write(chf.spans, sizeof(rcCompactSpan)*chf.spanCount);
	if (chf.dist)
		io->write(chf.dist, sizeof(unsigned short)*chf.spanCount);
	if (chf.areas)
		io->write(chf.areas, sizeof(unsigned char)*chf.spanCount);

	return true;
}

bool duReadCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io)
{
	if (!io)
	{
		printf("duReadCompactHeightfield: input IO is null.\n");
		return false;
	}
	if (!io->isReading())
	{
		printf("duReadCompactHeightfield: input IO not reading.\n");
		return false;
	}

	int magic = 0;
	int version = 0;

	io->read(&magic, sizeof(magic));
	io->read(&version, sizeof(version));

	if (magic != CHF_MAGIC)
	{
		printf("duReadCompactHeightfield: Bad voodoo.\n");
		return false;
	}
	if (version != CHF_VERSION)
	{
		printf("duReadCompactHeightfield: Bad version.\n");
		return false;
	}

	io->read(&chf.width, sizeof(chf.width));
	io->read(&chf.height, sizeof(chf.height));
	io->read(&chf.spanCount, sizeof(chf.spanCount));

	io->read(&chf.walkableHeight, sizeof(chf.walkableHeight));
	io->read(&chf.walkableClimb, sizeof(chf.walkableClimb));
	io->read(&chf.borderSize, sizeof(chf.borderSize));

	io->read(&chf.maxDistance, sizeof(chf.maxDistance));
	io->read(&chf.maxRegions, sizeof(chf.maxRegions));

	io->read(chf.bmin, sizeof(chf.bmin));
	io->read(chf.bmax, sizeof(chf.bmax));

	io->read(&chf.cs, sizeof(chf.cs));
	io->read(&chf.ch, sizeof(chf.ch));

	int tmp = 0;
	io->read(&tmp, sizeof(tmp));

	if (tmp & 1)
	{
		chf.cells = (rcCompactCell*)rcAlloc(sizeof(rcCompactCell)*chf.width*chf.height, RC_ALLOC_PERM);
		if (!chf.cells)
		{
			printf("duReadCompactHeightfield: Could not alloc cells (%d)\n", chf.width*chf.height);
			return false;
		}
		io->read(chf.cells, sizeof(rcCompactCell)*chf.width*chf.height);
	}
	if (tmp & 2)
	{
		chf.spans = (rcCompactSpan*)rcAlloc(sizeof(rcCompactSpan)*chf.spanCount, RC_ALLOC_PERM);
		if (!chf.spans)
		{
			printf("duReadCompactHeightfield: Could not alloc spans (%d)\n", chf.spanCount);
			return false;
		}
		io->read(chf.spans, sizeof(rcCompactSpan)*chf.spanCount);
	}
	if (tmp & 4)
	{
		chf.dist = (unsigned short*)rcAlloc(sizeof(unsigned short)*chf.spanCount, RC_ALLOC_PERM);
		if (!chf.dist)
		{
			printf("duReadCompactHeightfield: Could not alloc dist (%d)\n", chf.spanCount);
			return false;
		}
		io->read(chf.dist, sizeof(unsigned short)*chf.spanCount);
	}
	if (tmp & 8)
	{
		chf.areas = (unsigned char*)rcAlloc(sizeof(unsigned char)*chf.spanCount, RC_ALLOC_PERM);
		if (!chf.areas)
		{
			printf("duReadCompactHeightfield: Could not alloc areas (%d)\n", chf.spanCount);
			return false;
		}
		io->read(chf.areas, sizeof(unsigned char)*chf.spanCount);
	}

	return true;
}

static void logLine(rcContext& ctx, rcTimerLabel label, const char* name, const float pc)
{
	const int t = ctx.getAccumulatedTime(label);
	if (t < 0) return;
	ctx.log(RC_LOG_PROGRESS, "%s:\t%.2fms\t(%.1f%%)", name, t/1000.0f, t*pc);
}

void duLogBuildTimes(rcContext& ctx, const int totalTimeUsec)
{
	const float pc = 100.0f / totalTimeUsec;

	ctx.log(RC_LOG_PROGRESS, "Build Times");
	logLine(ctx, RC_TIMER_RASTERIZE_TRIANGLES,		"- Rasterize", pc);
	logLine(ctx, RC_TIMER_BUILD_COMPACTHEIGHTFIELD,	"- Build Compact", pc);
	logLine(ctx, RC_TIMER_FILTER_BORDER,				"- Filter Border", pc);
	logLine(ctx, RC_TIMER_FILTER_WALKABLE,			"- Filter Walkable", pc);
	logLine(ctx, RC_TIMER_ERODE_AREA,				"- Erode Area", pc);
	logLine(ctx, RC_TIMER_MEDIAN_AREA,				"- Median Area", pc);
	logLine(ctx, RC_TIMER_MARK_BOX_AREA,				"- Mark Box Area", pc);
	logLine(ctx, RC_TIMER_MARK_CONVEXPOLY_AREA,		"- Mark Convex Area", pc);
	logLine(ctx, RC_TIMER_MARK_CYLINDER_AREA,		"- Mark Cylinder Area", pc);
	logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD,		"- Build Distance Field", pc);
	logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD_DIST,	"    - Distance", pc);
	logLine(ctx, RC_TIMER_BUILD_DISTANCEFIELD_BLUR,	"    - Blur", pc);
	logLine(ctx, RC_TIMER_BUILD_REGIONS,				"- Build Regions", pc);
	logLine(ctx, RC_TIMER_BUILD_REGIONS_WATERSHED,	"    - Watershed", pc);
	logLine(ctx, RC_TIMER_BUILD_REGIONS_EXPAND,		"      - Expand", pc);
	logLine(ctx, RC_TIMER_BUILD_REGIONS_FLOOD,		"      - Find Basins", pc);
	logLine(ctx, RC_TIMER_BUILD_REGIONS_FILTER,		"    - Filter", pc);
	logLine(ctx, RC_TIMER_BUILD_LAYERS,				"- Build Layers", pc);
	logLine(ctx, RC_TIMER_BUILD_CONTOURS,			"- Build Contours", pc);
	logLine(ctx, RC_TIMER_BUILD_CONTOURS_TRACE,		"    - Trace", pc);
	logLine(ctx, RC_TIMER_BUILD_CONTOURS_SIMPLIFY,	"    - Simplify", pc);
	logLine(ctx, RC_TIMER_BUILD_POLYMESH,			"- Build Polymesh", pc);
	logLine(ctx, RC_TIMER_BUILD_POLYMESHDETAIL,		"- Build Polymesh Detail", pc);
	logLine(ctx, RC_TIMER_MERGE_POLYMESH,			"- Merge Polymeshes", pc);
	logLine(ctx, RC_TIMER_MERGE_POLYMESHDETAIL,		"- Merge Polymesh Details", pc);
	ctx.log(RC_LOG_PROGRESS, "=== TOTAL:\t%.2fms", totalTimeUsec/1000.0f);
}