text:
Projet Linux NSY103 2017

Hello to the SACA, once a plane is connected, the feed will automatically starts showing in front of you.

The only commands supported is: c {planeID} {valueToChange} {value}.

PlaneID is the name of the plane showing with the feed, example : TQ790.

ValueToChange is either of these 3 : 'alt' for altitude, 'spd' for speed, 'cap' for cap aka angle.

Value is int and the actual value depends on the type, for alt between 1 and 20000, for spd between 200 and 1000, cap between 0 and 359.

Developped by Ephrem BEAINO at CNAM Naher Ibrahim for the NSY103 project.

Voir l'[idée du projet](https://sites.google.com/a/isae.edu.lb/projet2017/les-projets-2017/nsy103) à réalisé ici : https://sites.google.com/a/isae.edu.lb/projet2017/les-projets-2017/nsy103

redpajama_set_name: RedPajamaGithub


text:
import type { ReactElement } from "react";
import type { MarkdownProps } from "components/Markdown/Markdown";
import Markdown from "components/Markdown/Markdown";

import styles from "./DemoDescription.module.scss";

export default function DemoDescription(props: MarkdownProps): ReactElement {
  return <Markdown {...props} className={styles.container} />;
}


text:
/**
 * @fileoverview This file contains all the globs required for babel
 * transformation and for closure compilation. Try and maintain the glob
 * for both the babel and closure sources to be as close as possible.
 */

const tempy = require('tempy');

const SRC_TEMP_DIR = tempy.directory();

const COMMON_GLOBS = [
  'third_party/amp-toolbox-cache-url/**/*.js',
  'third_party/caja/html-sanitizer.js',
  'third_party/closure-library/sha384-generated.js',
  'third_party/css-escape/css-escape.js',
  'third_party/d3/**/*.js',
  'third_party/fuzzysearch/index.js',
  'third_party/inputmask/**/*.js',
  'third_party/mustache/**/*.js',
  'third_party/react-dates/bundle.js',
  'third_party/set-dom/set-dom.js',
  'third_party/subscriptions-project/*.js',
  'third_party/timeagojs/**/*.js',
  'third_party/vega/**/*.js',
  'third_party/webcomponentsjs/ShadowCSS.js',
  'node_modules/dompurify/dist/purify.es.js',
  'node_modules/promise-pjs/promise.mjs',
  'node_modules/web-animations-js/web-animations.install.js',
  'node_modules/web-activities/activity-ports.js',
  'node_modules/@ampproject/animations/dist/animations.mjs',
  'node_modules/@ampproject/worker-dom/dist/amp/main.mjs',
];

/**
 * NOTE: Keep the globs here in sync with the `CLOSURE_SRC_GLOBS`.
 */
const BABEL_SRC_GLOBS = [
  'src/**/*.js',
  'builtins/**/*.js',
  'build/**/*.js',
  'extensions/**/*.js',
  '3p/**/*.js',
  'ads/**/*.js',
].concat(COMMON_GLOBS);

/**
 * NOTE: Keep the globs here in sync with the `BABEL_SRC_GLOBS`.
 */
const CLOSURE_SRC_GLOBS = [
  '3p/3p.js',
  // Ads config files.
  'ads/_*.js',
  'ads/alp/**/*.js',
  'ads/google/**/*.js',
  'ads/inabox/**/*.js',
  // Files under build/. Should be sparse.
  'build/*.css.js',
  'build/fake-module/**/*.js',
  'build/patched-module/**/*.js',
  'build/experiments/**/*.js',
  'build/parsers/**/*.js',
  // A4A has these cross extension deps.
  'extensions/amp-ad-network*/**/*-config.js',
  'extensions/amp-ad/**/*.js',
  'extensions/amp-a4a/**/*.js',
  // TODO(#24080) Remove this when story ads have full ad network support.
  // Needed for amp-story-auto-ads to validate amp-ad-exit config.
  'extensions/amp-ad-exit/**/*.js',
  // Currently needed for crypto.js and visibility.js.
  // Should consider refactoring.
  'extensions/amp-analytics/**/*.js',
  // Needed for WebAnimationService
  'extensions/amp-animation/**/*.js',
  // Needed for amp-carousel 0.2, amp-inline-gallery, amp-stream-gallery
  'extensions/amp-base-carousel/**/*.js',
  // For amp-bind in the web worker (ww.js).
  'extensions/amp-bind/**/*.js',
  // Needed to access to Variant interface from other extensions
  'extensions/amp-experiment/**/*.js',
  // Needed to access form impl from other extensions
  'extensions/amp-form/**/*.js',
  // Needed by amp-facebook-* for the loader logo
  'extensions/amp-facebook/0.1/facebook-loader.js',
  // Needed to access inputmask impl from other extensions
  'extensions/amp-inputmask/**/*.js',
  // Needed for AccessService
  'extensions/amp-access/**/*.js',
  // Needed for AmpStoryVariableService
  'extensions/amp-story/**/*.js',
  // Needed for SubscriptionsService
  'extensions/amp-subscriptions/**/*.js',
  // Needed to access UserNotificationManager from other extensions
  'extensions/amp-user-notification/**/*.js',
  // Needed for VideoService
  'extensions/amp-video-service/**/*.js',
  // Needed to access ConsentPolicyManager from other extensions
  'extensions/amp-consent/**/*.js',
  // Needed to access AmpGeo type for service locator
  'extensions/amp-geo/**/*.js',
  // Needed for AmpViewerAssistanceService
  'extensions/amp-viewer-assistance/**/*.js',
  // Needed for AmpViewerIntegrationVariableService
  'extensions/amp-viewer-integration/**/*.js',
  // Needed for amp-smartlinks dep on amp-skimlinks
  'extensions/amp-skimlinks/0.1/**/*.js',
  'src/*.js',
  'src/**/*.js',
  '!third_party/babel/custom-babel-helpers.js',
  // Exclude since it's not part of the runtime/extension binaries.
  '!extensions/amp-access/0.1/amp-login-done.js',
  'builtins/**.js',
  // 'node_modules/core-js/modules/**.js',
  // Not sure what these files are, but they seem to duplicate code
  // one level below and confuse the compiler.
  '!node_modules/core-js/modules/library/**.js',
].concat(COMMON_GLOBS);

module.exports = {
  BABEL_SRC_GLOBS,
  CLOSURE_SRC_GLOBS,
  SRC_TEMP_DIR,
};


text:
@implementation CBService (Konashi)

- (CBCharacteristic *) kns_findCharacteristicFromUUID:(CBUUID *)UUID
{
	for (CBCharacteristic *c in self.characteristics) {
		if ([c.UUID kns_isEqualToUUID:UUID]) return c;
	}
    return nil;
}

@end


text:
Constance - Dynamic Django settings
===================================

Features
--------

* Easily migrate your static settings to dynamic settings.
* Edit the dynamic settings in the Django admin interface.

.. image:: screenshot2.png

Quick Installation
------------------

.. code-block::

    pip install "django-constance[redis]"

For complete installation instructions, including how to install the
database backend, see :ref:`Backends <backends>`.

Configuration
-------------

Modify your ``settings.py``. Add ``'constance'`` to your
:setting:`INSTALLED_APPS`, and move each key you want to turn dynamic into
the :setting:`CONSTANCE_CONFIG` section, like this:

.. code-block:: python

    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.staticfiles',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        ...
        'constance',
    )

    CONSTANCE_CONFIG = {
        'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
                           'The Universe, and Everything'),
    }

.. note:: Add constance *before* your project apps.

.. note::  If you use admin extensions like
   `Grapelli <https://grappelliproject.com/>`_, ``'constance'`` should be added
   in :setting:`INSTALLED_APPS` *before* those extensions.

Here, ``42`` is the default value for the key ``THE_ANSWER`` if it is
not found in the backend. The other member of the tuple is a help text the
admin will show.

See the :ref:`Backends <backends>` section how to setup the backend and
finish the configuration.

``django-constance``'s hashes generated in different instances of the same
application may differ, preventing data from being saved.

Use :setting:`CONSTANCE_IGNORE_ADMIN_VERSION_CHECK` in order to skip hash
verification.

.. code-block:: python

    CONSTANCE_IGNORE_ADMIN_VERSION_CHECK = True

Signals
-------

Each time a value is changed it will trigger a ``config_updated`` signal.

.. code-block:: python

    from constance.signals import config_updated

    @receiver(config_updated)
    def constance_updated(sender, key, old_value, new_value, **kwargs):
        print(sender, key, old_value, new_value)

The sender is the ``config`` object, and the ``key`` and ``new_value``
are the changed settings.

Custom fields
-------------

You can set the field type with the third value in the ``CONSTANCE_CONFIG`` tuple.

The value can be one of the supported types or a string matching a key in your :setting:``CONSTANCE_ADDITIONAL_FIELDS``

The supported types are:

* ``bool``
* ``int``
* ``float``
* ``Decimal``
* ``str``
* ``datetime``
* ``date``
* ``time``

For example, to force a value to be handled as a string:

.. code-block:: python

        'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
                                   'The Universe, and Everything', str),

Custom field types are supported using the dictionary :setting:``CONSTANCE_ADDITIONAL_FIELDS``.

This is a mapping between a field label and a sequence (list or tuple).  The first item in the sequence is the string
path of a field class, and the (optional) second item is a dictionary used to configure the field.

The ``widget`` and ``widget_kwargs`` keys in the field config dictionary can be used to configure the widget used in admin,
the other values will be passed as kwargs to the field's ``__init__()``

Note: Use later evaluated strings instead of direct classes for the field and widget classes:

.. code-block:: python

        CONSTANCE_ADDITIONAL_FIELDS = {
            'yes_no_null_select': ['django.forms.fields.ChoiceField', {
                'widget': 'django.forms.Select',
                'choices': ((None, "-----"), ("yes", "Yes"), ("no", "No"))
            }],
        }

        CONSTANCE_CONFIG = {
            'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
        }

If you want to work with files you can use this configuration:

.. code-block:: python

        CONSTANCE_ADDITIONAL_FIELDS = {
            'image_field': ['django.forms.ImageField', {}]
        }

        CONSTANCE_CONFIG = {
            'LOGO_IMAGE': ('default.png', 'Company logo', 'image_field'),
        }

When used in a template you probably need to use:

.. code-block:: html

        {% load static %}

        {% get_media_prefix as MEDIA_URL %}

Images are uploaded to MEDIA_ROOT.

Ordered Fields in Django Admin
------------------------------

To sort the fields, you can use an OrderedDict:

.. code-block:: python

        from collections import OrderedDict

        CONSTANCE_CONFIG = OrderedDict([
            ('SITE_NAME', ('My Title', 'Website title')),
            ('SITE_DESCRIPTION', ('', 'Website description')),
            ('THEME', ('light-blue', 'Website theme')),
        ])

Fieldsets
---------

You can define fieldsets to group settings together:

.. code-block:: python

        CONSTANCE_CONFIG = {
            'SITE_NAME': ('My Title', 'Website title'),
            'SITE_DESCRIPTION': ('', 'Website description'),
            'THEME': ('light-blue', 'Website theme'),
        }

        CONSTANCE_CONFIG_FIELDSETS = {
            'General Options': ('SITE_NAME', 'SITE_DESCRIPTION'),
            'Theme Options': ('THEME',),
        }

.. note:: CONSTANCE_CONFIG_FIELDSETS must contain all fields from CONSTANCE_CONFIG.

.. image:: screenshot3.png

Fieldsets collapsing
--------------------

To make some fieldsets collapsing you can use new format in CONSTANCE_CONFIG_FIELDSETS. Here's an example:

.. code-block:: python

        CONSTANCE_CONFIG = {
            'SITE_NAME': ('My Title', 'Website title'),
            'SITE_DESCRIPTION': ('', 'Website description'),
            'THEME': ('light-blue', 'Website theme'),
        }

        CONSTANCE_CONFIG_FIELDSETS = {
            'General Options': {
                'fields': ('SITE_NAME', 'SITE_DESCRIPTION'),
                'collapse': True
            },
            'Theme Options': ('THEME',),
        }

Field internationalization
--------------------------

Field description and fieldset headers can be integrated into Django's
internationalization using the ``gettext_lazy`` function. Note that the
``CONSTANCE_CONFIG_FIELDSETS`` must be converted to a tuple instead of dict
as it is not possible to have lazy proxy objects as dictionary keys in the
settings file. Example:

.. code-block:: python

        from django.utils.translation import gettext_lazy as _

        CONSTANCE_CONFIG = {
            'SITE_NAME': ('My Title', _('Website title')),
            'SITE_DESCRIPTION': ('', _('Website description')),
            'THEME': ('light-blue', _('Website theme')),
        }

        CONSTANCE_CONFIG_FIELDSETS = (
            (
                _('General Options'),
                {
                    'fields': ('SITE_NAME', 'SITE_DESCRIPTION'),
                    'collapse': True,
                },
            ),
            (_('Theme Options'), ('THEME',)),
        )

Usage
-----

Constance can be used from your Python code and from your Django templates.

Python
^^^^^^

Accessing the config variables is as easy as importing the config
object and accessing the variables with attribute lookups::

    from constance import config

    # ...

    if config.THE_ANSWER == 42:
        answer_the_question()

Django templates
^^^^^^^^^^^^^^^^

To access the config object from your template you can
pass the object to the template context:

.. code-block:: python

    from django.shortcuts import render
    from constance import config

    def myview(request):
        return render(request, 'my_template.html', {'config': config})

You can also use the included context processor.

Insert ``'constance.context_processors.config'`` at
the top of your ``TEMPLATES['OPTIONS']['context_processors']`` list.  See the
`Django documentation`_ for details.

.. _`Django documentation`: https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/#the-templates-settings

This will add the config instance to the context of any template
rendered with a ``RequestContext``.

Then, in your template you can refer to the config values just as
any other variable, e.g.:

.. code-block:: django

Welcome on {{ config.SITE_NAME }}

    {% if config.BETA_LAUNCHED %}
        Woohoo! Head over here to use the beta.
    {% else %}
        Sadly we haven't launched yet, click here
        to signup for our newletter.
    {% endif %}

Command Line
^^^^^^^^^^^^

Constance settings can be get/set on the command line with the manage command `constance`

Available options are:

list - output all values in a tab-separated format::

    $ ./manage.py constance list
    THE_ANSWER 42
    SITE_NAME  My Title

get KEY - output a single values::

    $ ./manage.py constance get THE_ANSWER
    42

set KEY VALUE - set a single value::

    $ ./manage.py constance set SITE_NAME "Another Title"

If the value contains spaces it should be wrapped in quotes.

.. note::  Set values are validated as per in admin, an error will be raised if validation fails:

E.g., given this config as per the example app::

   CONSTANCE_CONFIG = {
       ...
       'DATE_ESTABLISHED': (date(1972, 11, 30), "the shop's first opening"),
   }

Setting an invalid date will fail as follow::

   $ ./manage.py constance set DATE_ESTABLISHED '1999-12-00'
   CommandError: Enter a valid date.

.. note::  If the admin field is a `MultiValueField`, then the separate field values need to be provided as separate arguments.
E.g., a datetime using `SplitDateTimeField`::

   CONSTANCE_CONFIG = {
       'DATETIME_VALUE': (datetime(2010, 8, 23, 11, 29, 24), 'time of the first commit'),
   }

Then this works (and the quotes are optional)::

   ./manage.py constance set DATETIME_VALUE '2011-09-24' '12:30:25'

This doesn't work::

   ./manage.py constance set DATETIME_VALUE '2011-09-24 12:30:25'
   CommandError: Enter a list of values.

remove_stale_keys - delete all stale records in database::

    $ ./manage.py constance remove_stale_keys

Record is considered stale if it exists in database but absent in config

Editing
-------

Fire up your ``admin`` and you should see a new app called ``Constance``
with ``THE_ANSWER`` in the ``Config`` pseudo model.

By default, changing the settings via the admin is only allowed for superusers.
To change this, feel free to set the :setting:`CONSTANCE_SUPERUSER_ONLY`
setting to ``False`` and give users or user groups access to the
``constance.change_config`` permission.

.. figure:: screenshot1.png

   The virtual application ``Constance`` among your regular applications.

Custom settings form
--------------------

If you aim at creating a custom settings form this is possible in the following
way: You can inherit from ``ConstanceAdmin`` and set the ``form`` property on
your custom admin to use your custom form. This allows you to define your own
formsets and layouts, similar to defining a custom form on a standard
Django ModelAdmin. This way you can fully style your settings form and group
settings the way you like.

.. code-block:: python

    from constance.admin import ConstanceAdmin, ConstanceForm, Config
    class CustomConfigForm(ConstanceForm):
          def __init__(self, *args, **kwargs):
            super().__init__(*args, **kwargs)
            #... do stuff to make your settings form nice ...

    class ConfigAdmin(ConstanceAdmin):
        change_list_form = CustomConfigForm
        change_list_template = 'admin/config/settings.html'

    admin.site.unregister([Config])
    admin.site.register([Config], ConfigAdmin)

You can also override the ``get_changelist_form`` method which is called in
``changelist_view`` to get the actual form used to change the settings. This
allows you to pick a different form according to the user that makes the
request. For example:

.. code-block:: python

    class SuperuserForm(ConstanceForm):
        # Do some stuff here

    class MyConstanceAdmin(ConstanceAdmin):
        def get_changelist_form(self, request):
            if request.user.is_superuser:
              return SuperuserForm:
            else:
              return super().get_changelist_form(request)

Note that the default method returns ``self.change_list_form``.

More documentation
------------------

.. toctree::
   :maxdepth: 2

   backends
   testing
   changes

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
<?php
/* @var $this ProductsController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'Products',
);

$this->menu=array(
	array('label'=>'Create Products', 'url'=>array('create')),
	array('label'=>'Manage Products', 'url'=>array('admin')),
);
?>

<h1>Sản phẩm </h1>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
)); ?>


text:
import './src/shim'
import React from 'react'
import ReactDOM from 'react-dom'
import App from './src/components/App'
import style from './styles/style.scss'
import createHistory from 'history/createBrowserHistory'

const history = createHistory()

// add style
const styleEl = document.createElement('style')
styleEl.innerHTML = style
document.head.appendChild(styleEl)

// render app
const app = document.createElement('div')
document.body.appendChild(app)

class WithHistory extends React.Component {
  getChildContext() {
    return {
      history
    }
  }

  render() {
    return this.props.children
  }
}

WithHistory.childContextTypes = {
  history: React.PropTypes.object
}

ReactDOM.render((
  <WithHistory>
    <App />
  </WithHistory>
), app)


text:
package io.druid.cli;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableList;
import com.google.inject.Binder;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import com.google.inject.multibindings.MapBinder;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import com.google.inject.servlet.GuiceFilter;
import com.google.inject.util.Providers;
import io.airlift.airline.Command;
import io.druid.audit.AuditManager;
import io.druid.client.indexing.IndexingService;
import io.druid.client.indexing.IndexingServiceSelectorConfig;
import io.druid.discovery.DruidNodeDiscoveryProvider;
import io.druid.guice.IndexingServiceFirehoseModule;
import io.druid.guice.IndexingServiceModuleHelper;
import io.druid.guice.IndexingServiceTaskLogsModule;
import io.druid.guice.JacksonConfigProvider;
import io.druid.guice.Jerseys;
import io.druid.guice.JsonConfigProvider;
import io.druid.guice.LazySingleton;
import io.druid.guice.LifecycleModule;
import io.druid.guice.ListProvider;
import io.druid.guice.ManageLifecycle;
import io.druid.guice.PolyBind;
import io.druid.guice.annotations.Json;
import io.druid.indexing.common.actions.LocalTaskActionClientFactory;
import io.druid.indexing.common.actions.TaskActionClientFactory;
import io.druid.indexing.common.actions.TaskActionToolbox;
import io.druid.indexing.common.config.TaskConfig;
import io.druid.indexing.common.config.TaskStorageConfig;
import io.druid.indexing.common.tasklogs.SwitchingTaskLogStreamer;
import io.druid.indexing.common.tasklogs.TaskRunnerTaskLogStreamer;
import io.druid.indexing.overlord.ForkingTaskRunnerFactory;
import io.druid.indexing.overlord.HeapMemoryTaskStorage;
import io.druid.indexing.overlord.IndexerMetadataStorageAdapter;
import io.druid.indexing.overlord.hrtr.HttpRemoteTaskRunnerFactory;
import io.druid.indexing.overlord.MetadataTaskStorage;
import io.druid.indexing.overlord.RemoteTaskRunnerFactory;
import io.druid.indexing.overlord.TaskLockbox;
import io.druid.indexing.overlord.TaskMaster;
import io.druid.indexing.overlord.TaskRunnerFactory;
import io.druid.indexing.overlord.TaskStorage;
import io.druid.indexing.overlord.TaskStorageQueryAdapter;
import io.druid.indexing.overlord.autoscaling.PendingTaskBasedWorkerProvisioningConfig;
import io.druid.indexing.overlord.autoscaling.PendingTaskBasedWorkerProvisioningStrategy;
import io.druid.indexing.overlord.autoscaling.ProvisioningSchedulerConfig;
import io.druid.indexing.overlord.autoscaling.ProvisioningStrategy;
import io.druid.indexing.overlord.autoscaling.SimpleWorkerProvisioningConfig;
import io.druid.indexing.overlord.autoscaling.SimpleWorkerProvisioningStrategy;
import io.druid.indexing.overlord.config.TaskQueueConfig;
import io.druid.indexing.overlord.helpers.OverlordHelper;
import io.druid.indexing.overlord.helpers.TaskLogAutoCleaner;
import io.druid.indexing.overlord.helpers.TaskLogAutoCleanerConfig;
import io.druid.indexing.overlord.hrtr.HttpRemoteTaskRunnerResource;
import io.druid.indexing.overlord.http.OverlordRedirectInfo;
import io.druid.indexing.overlord.http.OverlordResource;
import io.druid.indexing.overlord.setup.WorkerBehaviorConfig;
import io.druid.indexing.overlord.supervisor.SupervisorManager;
import io.druid.indexing.overlord.supervisor.SupervisorResource;
import io.druid.indexing.worker.config.WorkerConfig;
import io.druid.java.util.common.logger.Logger;
import io.druid.segment.realtime.firehose.ChatHandlerProvider;
import io.druid.server.audit.AuditManagerProvider;
import io.druid.server.coordinator.CoordinatorOverlordServiceConfig;
import io.druid.server.http.RedirectFilter;
import io.druid.server.http.RedirectInfo;
import io.druid.server.initialization.jetty.JettyServerInitUtils;
import io.druid.server.initialization.jetty.JettyServerInitializer;
import io.druid.server.security.AuthConfig;
import io.druid.server.security.AuthenticationUtils;
import io.druid.server.security.Authenticator;
import io.druid.server.security.AuthenticatorMapper;
import io.druid.tasklogs.TaskLogStreamer;
import io.druid.tasklogs.TaskLogs;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.resource.ResourceCollection;

import java.util.List;

/**
 */
@Command(
    name = "overlord",
    description = "Runs an Overlord node, see http://druid.io/docs/latest/Indexing-Service.html for a description"
)
public class CliOverlord extends ServerRunnable
{
  private static Logger log = new Logger(CliOverlord.class);

  protected static List<String> UNSECURED_PATHS = ImmutableList.of(
      "/",
      "/console.html",
      "/old-console/*",
      "/images/*",
      "/js/*",
      "/druid/indexer/v1/isLeader",
      "/status/health"
  );

  public CliOverlord()
  {
    super(log);
  }

  @Override
  protected List<? extends Module> getModules()
  {
    return getModules(true);
  }

  protected List<? extends Module> getModules(final boolean standalone)
  {
    return ImmutableList.<Module>of(
        new Module()
        {
          @Override
          public void configure(Binder binder)
          {
            if (standalone) {
              binder.bindConstant()
                    .annotatedWith(Names.named("serviceName"))
                    .to(IndexingServiceSelectorConfig.DEFAULT_SERVICE_NAME);
              binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8090);
              binder.bindConstant().annotatedWith(Names.named("tlsServicePort")).to(8290);
            }

            JsonConfigProvider.bind(binder, "druid.coordinator.asOverlord", CoordinatorOverlordServiceConfig.class);
            JsonConfigProvider.bind(binder, "druid.indexer.queue", TaskQueueConfig.class);
            JsonConfigProvider.bind(binder, "druid.indexer.task", TaskConfig.class);

            binder.bind(TaskMaster.class).in(ManageLifecycle.class);

            binder.bind(TaskLogStreamer.class).to(SwitchingTaskLogStreamer.class).in(LazySingleton.class);
            binder.bind(
                new TypeLiteral<List<TaskLogStreamer>>()
                {
                }
            )
                  .toProvider(
                      new ListProvider<TaskLogStreamer>()
                          .add(TaskRunnerTaskLogStreamer.class)
                          .add(TaskLogs.class)
                  )
                  .in(LazySingleton.class);

            binder.bind(TaskActionClientFactory.class).to(LocalTaskActionClientFactory.class).in(LazySingleton.class);
            binder.bind(TaskActionToolbox.class).in(LazySingleton.class);
            binder.bind(TaskLockbox.class).in(LazySingleton.class);
            binder.bind(TaskStorageQueryAdapter.class).in(LazySingleton.class);
            binder.bind(IndexerMetadataStorageAdapter.class).in(LazySingleton.class);
            binder.bind(SupervisorManager.class).in(LazySingleton.class);

            binder.bind(ChatHandlerProvider.class).toProvider(Providers.<ChatHandlerProvider>of(null));

            configureTaskStorage(binder);
            configureAutoscale(binder);
            configureRunners(binder);
            configureOverlordHelpers(binder);

            binder.bind(AuditManager.class)
                  .toProvider(AuditManagerProvider.class)
                  .in(ManageLifecycle.class);

            if (standalone) {
              binder.bind(RedirectFilter.class).in(LazySingleton.class);
              binder.bind(RedirectInfo.class).to(OverlordRedirectInfo.class).in(LazySingleton.class);
              binder.bind(JettyServerInitializer.class)
                    .to(OverlordJettyServerInitializer.class)
                    .in(LazySingleton.class);
            }

            Jerseys.addResource(binder, OverlordResource.class);
            Jerseys.addResource(binder, SupervisorResource.class);
            Jerseys.addResource(binder, HttpRemoteTaskRunnerResource.class);

            if (standalone) {
              LifecycleModule.register(binder, Server.class);
            }

            binder.bind(DiscoverySideEffectsProvider.Child.class).annotatedWith(IndexingService.class).toProvider(
                new DiscoverySideEffectsProvider(
                    DruidNodeDiscoveryProvider.NODE_TYPE_OVERLORD,
                    ImmutableList.of()
                )
            ).in(LazySingleton.class);
            LifecycleModule.registerKey(binder, Key.get(DiscoverySideEffectsProvider.Child.class, IndexingService.class));
          }

          private void configureTaskStorage(Binder binder)
          {
            JsonConfigProvider.bind(binder, "druid.indexer.storage", TaskStorageConfig.class);

            PolyBind.createChoice(
                binder, "druid.indexer.storage.type", Key.get(TaskStorage.class), Key.get(HeapMemoryTaskStorage.class)
            );
            final MapBinder<String, TaskStorage> storageBinder = PolyBind.optionBinder(
                binder,
                Key.get(TaskStorage.class)
            );

            storageBinder.addBinding("local").to(HeapMemoryTaskStorage.class);
            binder.bind(HeapMemoryTaskStorage.class).in(LazySingleton.class);

            storageBinder.addBinding("metadata").to(MetadataTaskStorage.class).in(ManageLifecycle.class);
            binder.bind(MetadataTaskStorage.class).in(LazySingleton.class);
          }

          private void configureRunners(Binder binder)
          {
            JsonConfigProvider.bind(binder, "druid.worker", WorkerConfig.class);

            PolyBind.createChoice(
                binder,
                "druid.indexer.runner.type",
                Key.get(TaskRunnerFactory.class),
                Key.get(ForkingTaskRunnerFactory.class)
            );
            final MapBinder<String, TaskRunnerFactory> biddy = PolyBind.optionBinder(
                binder,
                Key.get(TaskRunnerFactory.class)
            );

            IndexingServiceModuleHelper.configureTaskRunnerConfigs(binder);
            biddy.addBinding("local").to(ForkingTaskRunnerFactory.class);
            binder.bind(ForkingTaskRunnerFactory.class).in(LazySingleton.class);

            biddy.addBinding(RemoteTaskRunnerFactory.TYPE_NAME).to(RemoteTaskRunnerFactory.class).in(LazySingleton.class);
            binder.bind(RemoteTaskRunnerFactory.class).in(LazySingleton.class);

            biddy.addBinding(HttpRemoteTaskRunnerFactory.TYPE_NAME).to(HttpRemoteTaskRunnerFactory.class).in(LazySingleton.class);
            binder.bind(HttpRemoteTaskRunnerFactory.class).in(LazySingleton.class);

            JacksonConfigProvider.bind(binder, WorkerBehaviorConfig.CONFIG_KEY, WorkerBehaviorConfig.class, null);
          }

          private void configureAutoscale(Binder binder)
          {
            JsonConfigProvider.bind(binder, "druid.indexer.autoscale", ProvisioningSchedulerConfig.class);
            JsonConfigProvider.bind(
                binder,
                "druid.indexer.autoscale",
                PendingTaskBasedWorkerProvisioningConfig.class
            );
            JsonConfigProvider.bind(binder, "druid.indexer.autoscale", SimpleWorkerProvisioningConfig.class);

            PolyBind.createChoice(
                binder,
                "druid.indexer.autoscale.strategy.type",
                Key.get(ProvisioningStrategy.class),
                Key.get(SimpleWorkerProvisioningStrategy.class)
            );
            final MapBinder<String, ProvisioningStrategy> biddy = PolyBind.optionBinder(
                binder,
                Key.get(ProvisioningStrategy.class)
            );
            biddy.addBinding("simple").to(SimpleWorkerProvisioningStrategy.class);
            biddy.addBinding("pendingTaskBased").to(PendingTaskBasedWorkerProvisioningStrategy.class);
          }

          private void configureOverlordHelpers(Binder binder)
          {
            JsonConfigProvider.bind(binder, "druid.indexer.logs.kill", TaskLogAutoCleanerConfig.class);
            Multibinder.newSetBinder(binder, OverlordHelper.class)
                       .addBinding()
                       .to(TaskLogAutoCleaner.class);
          }
        },
        new IndexingServiceFirehoseModule(),
        new IndexingServiceTaskLogsModule()
    );
  }

  /**
   */
  private static class OverlordJettyServerInitializer implements JettyServerInitializer
  {
    private final AuthConfig authConfig;

    @Inject
    OverlordJettyServerInitializer(AuthConfig authConfig)
    {
      this.authConfig = authConfig;
    }

    @Override
    public void initialize(Server server, Injector injector)
    {
      final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
      root.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
      root.setInitParameter("org.eclipse.jetty.servlet.Default.redirectWelcome", "true");
      root.setWelcomeFiles(new String[]{"index.html", "console.html"});

      ServletHolder holderPwd = new ServletHolder("default", DefaultServlet.class);

      root.addServlet(holderPwd, "/");
      root.setBaseResource(
          new ResourceCollection(
              new String[]{
                  TaskMaster.class.getClassLoader().getResource("static").toExternalForm(),
                  TaskMaster.class.getClassLoader().getResource("indexer_static").toExternalForm()
              }
          )
      );

      final ObjectMapper jsonMapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));
      final AuthenticatorMapper authenticatorMapper = injector.getInstance(AuthenticatorMapper.class);

      List<Authenticator> authenticators = null;
      AuthenticationUtils.addSecuritySanityCheckFilter(root, jsonMapper);

      // perform no-op authorization for these resources
      AuthenticationUtils.addNoopAuthorizationFilters(root, UNSECURED_PATHS);
      AuthenticationUtils.addNoopAuthorizationFilters(root, authConfig.getUnsecuredPaths());

      authenticators = authenticatorMapper.getAuthenticatorChain();
      AuthenticationUtils.addAuthenticationFilterChain(root, authenticators);

      AuthenticationUtils.addAllowOptionsFilter(root, authConfig.isAllowUnauthenticatedHttpOptions());

      JettyServerInitUtils.addExtensionFilters(root, injector);

      // Check that requests were authorized before sending responses
      AuthenticationUtils.addPreResponseAuthorizationCheckFilter(
          root,
          authenticators,
          jsonMapper
      );

      // add some paths not to be redirected to leader.
      root.addFilter(GuiceFilter.class, "/status/*", null);
      root.addFilter(GuiceFilter.class, "/druid-internal/*", null);

      // redirect anything other than status to the current lead
      root.addFilter(new FilterHolder(injector.getInstance(RedirectFilter.class)), "/*", null);

      // Can't use /* here because of Guice and Jetty static content conflicts
      root.addFilter(GuiceFilter.class, "/druid/*", null);

      root.addFilter(GuiceFilter.class, "/druid-ext/*", null);

      HandlerList handlerList = new HandlerList();
      handlerList.setHandlers(
          new Handler[]{
              JettyServerInitUtils.getJettyRequestLogHandler(),
              JettyServerInitUtils.wrapWithDefaultGzipHandler(root)
          }
      );

      server.setHandler(handlerList);
    }
  }
}


text:
#region Copyright

// Created by Jeremy
// 09 2013

#endregion

using System;
using TrekBattles.model;
using TrekBattles.util;

namespace TrekBattles.Model
{
    public class Fleet
    {
        private readonly string fleetName;
        private readonly Random randomShipTargeter;
        private int enemyFleetSize;
        private int[] shipsHitInCurrentBattle;

        public Fleet(string fleetName, SpaceShip[] spaceShips, Random randomShipTargeter)
        {
            this.fleetName = fleetName;
            SpaceShipsInService = spaceShips;
            this.randomShipTargeter = randomShipTargeter;
            this.shipsHitInCurrentBattle = new int[0];
            DestroyedSpaceShips = new SpaceShip[0];
        }

        private Random RandomShipTargeter
        {
            get { return randomShipTargeter; }
        }

        private int EnemyFleetSize
        {
            get { return enemyFleetSize; }
            set
            {
                if (value >= 1)
                {
                    enemyFleetSize = value;
                }
            }
        }

        public SpaceShip[] SpaceShipsInService { get; private set; }

        public SpaceShip[] DestroyedSpaceShips { get; private set; }

        public string FleetName
        {
            get { return fleetName; }
        }

        private int[] ShipsHitInCurrentBattle
        {
            get { return shipsHitInCurrentBattle; }
            set
            {
                if (value != null)
                {
                    shipsHitInCurrentBattle = value;
                }
            }
        }

        /// <summary>
        /// The number of ships that are active in this fleet, ie not destroyed
        /// </summary>
        public int SizeofActiveFleet
        {
            get { return SpaceShipsInService.Length; }
        }

        /// <summary>
        /// Total number of ships this fleet has lost
        /// </summary>
        public int TotalNumberOfLosses
        {
            get { return DestroyedSpaceShips.Length; }
        }

        /// <summary>
        /// Fires the fleet's targeting missiles.
        /// </summary>
        /// <returns></returns>
        public TargetingMissile[] FireTargetingMissiles()
        {
            TargetingMissile[] attackMissiles = new TargetingMissile[SpaceShipsInService.Length];
            for (int index = 0; index < SpaceShipsInService.Length; index++)
            {
                SpaceShip spaceShip = SpaceShipsInService[index];
                int damagePayload = spaceShip.FireWeapons();
                int enemyTargetPosition = DetermineEnemyTargetPosition();
                attackMissiles[index] = new TargetingMissile(damagePayload, enemyTargetPosition);
            }
            return attackMissiles;
        }

        private int DetermineEnemyTargetPosition()
        {
            int random = RandomShipTargeter.Next(EnemyFleetSize);
            return random;
        }

        public bool IsFleetOperational()
        {
            return SpaceShipsInService.Length >= 1;
        }

        /// <summary>
        /// Recives an array of incomming missile from the enemy fleet.
        /// The missiles will deal their specified damage to the target ships
        /// in this fleet. This Fleet will also update it's battle information on the
        /// ships that have been hit. Will have no effect if missile targets invalid ships
        /// </summary>
        /// <param name="incommingMissiles"></param>
        public void RecieveFireFromEnemyFleet(TargetingMissile[] incommingMissiles)
        {
            foreach (TargetingMissile targetingMissile in incommingMissiles)
            {
                RecieveFireFromEnemyFleet(targetingMissile);
            }
        }

        /// <summary>
        /// Recives a incomming missile from the enemy fleet. The missile will
        /// deal it's specified damage to the target ship in this
        /// fleet. This Fleet will also update it's battle information on the
        /// ship that has been hit. Will have no effect if missile targets invalid ship
        /// </summary>
        /// <param name="incommingMissile"></param>
        public void RecieveFireFromEnemyFleet(TargetingMissile incommingMissile)
        {
            if (incommingMissile.TargetShipPosition > SpaceShipsInService.Length ||
                incommingMissile.TargetShipPosition < 0)
            {
                return;
            }
            SpaceShip spaceShipUnderAttack =
                SpaceShipsInService[incommingMissile.TargetShipPosition];

            spaceShipUnderAttack.RecieveDamage(incommingMissile.DamageAmount);
            UpdateBattleInformation(incommingMissile.TargetShipPosition);
        }

        /// <summary>
        ///
        /// Records that a ship has been hit in the current battle. Will only
        /// record that a ship has been hit, not the number of
        /// times it has been hit.
        /// </summary>
        /// <param name="indexOfShipHit"></param>
        private void UpdateBattleInformation(int indexOfShipHit)
        {
            if (ArrayUtils.ArrayContainsNumber(ShipsHitInCurrentBattle, indexOfShipHit))
            {
                return;
            }
            ShipsHitInCurrentBattle = ArrayUtils.AddNumber(ShipsHitInCurrentBattle, indexOfShipHit);
        }

        /// <summary>
        /// Allows a fleet to be notifed that a new battle is about to commence
        /// </summary>
        /// <param name="updatedEnemyFleetSize">The size of the enemy fleet</param>
        public void NewBattleCommencing(int updatedEnemyFleetSize)
        {
            this.EnemyFleetSize = updatedEnemyFleetSize;
            ShipsHitInCurrentBattle = new int[0];
        }

        /// <summary>
        /// A ceasefire is carried out between Fleets, giving each fleet time to
        /// allow ships that have not been hit in the last round to regenerate.
        /// Also allows the fleet to update it's list of ships which have
        /// been destroyed.
        /// </summary>
        public string[] Ceasefire()
        {
            RegenerateShields();
            return UpdateBattleInformation();
        }

        /// <summary>
        /// Updates the list of ships which have been destroyed, and which are still in service.
        /// </summary>
        private string[] UpdateBattleInformation()
        {
            string[] destroyedShipNames = UpdateDestroyedShips();
            SpaceShipsInService = ArrayUtils.RemoveNullsFromArray(SpaceShipsInService);
            return destroyedShipNames;
        }

        /// <summary>
        /// Updates the list of ships destroyed and still in service.
        /// Returns the list of ships class names which have been destroyed.
        /// </summary>
        /// <returns></returns>
        private string[] UpdateDestroyedShips()
        {
            string[] destroyedShipNames = {};
            for (int index = 0; index < SpaceShipsInService.Length; index++)
            {
                SpaceShip spaceShip = SpaceShipsInService[index];
                if (spaceShip.IsDestroyed())
                {
                    RemoveDestroyedShipFromService(spaceShip, index);
                    destroyedShipNames = ArrayUtils.AddStringToArray(destroyedShipNames,
                        spaceShip.ShipClassName);
                }
            }
            return destroyedShipNames;
        }

        /// <summary>
        /// Each ship which is still in service and has not been hit
        /// in the current battle regenerates it's
        /// shields.
        /// </summary>
        private void RegenerateShields()
        {
            for (int index = 0; index < SpaceShipsInService.Length; index++)
            {
                if (HasShipBeenHitInCurrentBattle(index))
                {
                    continue;
                }
                SpaceShip spaceShip = SpaceShipsInService[index];
                spaceShip.RegenerateShield();
            }
        }

        private void RemoveDestroyedShipFromService(SpaceShip destroyedSpaceShip,
            int spaceShipIndex)
        {
            DestroyedSpaceShips = ArrayUtils.AddToArray(DestroyedSpaceShips, destroyedSpaceShip);
            SpaceShipsInService = ArrayUtils.RemoveFromArray(SpaceShipsInService, spaceShipIndex);
        }

        private bool HasShipBeenHitInCurrentBattle(int spaceShipPosition)
        {
            return ArrayUtils.ArrayContainsNumber(ShipsHitInCurrentBattle, spaceShipPosition);
        }
    }
}


text:
Aims paging
===========
[![Build Status](https://drone.io/github.com/aiyanbo/aims-paging/status.png)](https://drone.io/github.com/aiyanbo/aims-paging/latest)

Aims http response link header parser to pagination


text:
namespace media {

// PictureBuffer implementation.
PictureBuffer::PictureBuffer(int32 id,
                             gfx::Size pixel_size,
                             std::vector<uint32> color_format,
                             MemoryType memory_type,
                             std::vector<DataPlaneHandle> data_plane_handles)
    : id_(id),
      pixel_size_(pixel_size),
      color_format_(color_format),
      memory_type_(memory_type),
      data_plane_handles_(data_plane_handles) {
}

PictureBuffer::~PictureBuffer() {}

int32 PictureBuffer::GetId() {
  return id_;
}

gfx::Size PictureBuffer::GetSize() {
  return pixel_size_;
}

const std::vector<uint32>& PictureBuffer::GetColorFormat() {
  return color_format_;
}

PictureBuffer::MemoryType PictureBuffer::GetMemoryType() {
  return memory_type_;
}

std::vector<PictureBuffer::DataPlaneHandle>& PictureBuffer::GetPlaneHandles() {
  return data_plane_handles_;
}

// Picture implementation.
Picture::Picture(PictureBuffer* picture_buffer, gfx::Size decoded_pixel_size,
                 gfx::Size visible_pixel_size, void* user_handle)
    : picture_buffer_(picture_buffer),
      decoded_pixel_size_(decoded_pixel_size),
      visible_pixel_size_(visible_pixel_size),
      user_handle_(user_handle) {
}

Picture::~Picture() {}

PictureBuffer* Picture::picture_buffer() {
  return picture_buffer_;
}

gfx::Size Picture::GetDecodedSize() const {
  return decoded_pixel_size_;
}

gfx::Size Picture::GetVisibleSize() const {
  return visible_pixel_size_;
}

void* Picture::GetUserHandle() {
  return user_handle_;
}

}  // namespace media


text:
<!DOCTYPE html>

  <title>thlorenz.com home</title>
  <meta name="description" content="Thorsten Lorenz Developer Home Page">
  {{> _head_common }}

  {{> _sidebar }}

    {{#each collections.posts }}

        {{ this.date }}

{{ this.title }}

 {{{ this.excerpt }}}

        Read on →

    {{/each}}


text:
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({ name: 'duration' })
export class DurationPipe implements PipeTransform {

  transform(value: number, unit: string): string {
    return value ? value + '' + unit : '';
  }

}


text:
Follow a convention, and, stick to it

            Every developer has a preference when it comes to code style. Their choice of style goes far beyond tabs versus spaces. With recent updates to tools such as ESNext, using ESLint and TSLint has made it much easier to ensure that the code style is consistent across the entire codebase. When it comes to the convention of the codebase, the structure you choose to follow is critical. Keep in mind that enforcing the convention is even more crucial.

Document use cases

            Documenting use cases may feel tedious at first. However, the payoff longer term is monumental. When a developer wants to use that function in the future, they will understand what it does, how to use it, and where to use it. Use case documentation will drastically reduce confusion as you scale, enabling developers to orchestrate their work together, quickly and efficiently.

Test for predictability, not for code coverage

            Testing for the sake of code coverage should not be your intention. Create tests that focus on predictability instead. Future-proofing your functions in case other commits break functionality should be your priority. Worst case scenario, the test will fail when you practice this.

Good stack tracing saves time

            Making sure that it's easy to trace errors in your codebase is essential. A classic example of hard to debug mistakes are Null Pointer Exceptions in Java or the notorious segfaults of C and C++. Creating a predictable and easy to debug stack trace should be your priority. Perhaps use try, catch statements or other methods that will help you debug the stack trace easily if an error were to occur.


text:
function getRuntimeFunctionCallCount(function_name) {
  const stats = %GetAndResetRuntimeCallStats();
  const lines = stats.split("\n");
  for (let i = 3; i < lines.length - 3; ++i) {
    const line = lines[i];
    const m = line.match(/(?<name>\S+)\s+\S+\s+\S+\s+(?<count>\S+)/);
    if (function_name == m.groups.name) {
      return m.groups.count;
    }
  }
  return 0;
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Code Coverage for /home/gerard/sites/modules.w.doctrine/modules.zendframework.com/vendor/ZfcBase/src/ZfcBase/EventManager/EventProvider.php</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

/home/gerard/sites/modules.w.doctrine/modules.zendframework.com /

vendor /

ZfcBase /

src /

ZfcBase /

EventManager /

EventProvider.php

Code Coverage

Classes and Traits

Functions and Methods

Lines

      Total

0.00%

0 / 1

50.00%

1 / 2

      CRAP

50.00%

9 / 18

      EventProvider

0.00%

0 / 1

50.00%

1 / 2

      16.00

50.00%

9 / 18

       setEventManager(EventManagerInterface $events)

0.00%

0 / 1

      15.56

35.71%

5 / 14

       getEventManager()

100.00%

1 / 1

      2

100.00%

4 / 4

1
	<?php

2

3
	namespace ZfcBase\EventManager;

4

5
	use Traversable;

6
	use Zend\EventManager\EventManagerAwareInterface;

7
	use Zend\EventManager\EventManagerInterface;

8
	use Zend\EventManager\EventManager;

9

10
	abstract class EventProvider implements EventManagerAwareInterface

11
	{

12
	    /**

13
	     * @var EventManagerInterface

14
	     */

15
	    protected $events;

16

17
	    /**

18
	     * Set the event manager instance used by this context

19
	     *

20
	     * @param  EventManagerInterface $events

21
	     * @return mixed

22
	     */

23
	    public function setEventManager(EventManagerInterface $events)

24
	    {

     <tr class="success popin" data-title="5 tests cover line 25" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
25
	        $identifiers = array(__CLASS__, get_called_class());

     <tr class="success popin" data-title="5 tests cover line 26" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
26
	        if (isset($this->eventIdentifier)) {

27
	            if ((is_string($this->eventIdentifier))

28
	                || (is_array($this->eventIdentifier))

29
	                || ($this->eventIdentifier instanceof Traversable)

30
	            ) {

31
	                $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier));

32
	            } elseif (is_object($this->eventIdentifier)) {

33
	                $identifiers[] = $this->eventIdentifier;

34
	            }

35
	            // silently ignore invalid eventIdentifier types

36
	        }

     <tr class="success popin" data-title="5 tests cover line 37" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
37
	        $events->setIdentifiers($identifiers);

     <tr class="success popin" data-title="5 tests cover line 38" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
38
	        $this->events = $events;

     <tr class="success popin" data-title="5 tests cover line 39" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
39
	        return $this;

40
	    }

41

42
	    /**

43
	     * Retrieve the event manager

44
	     *

45
	     * Lazy-loads an EventManager instance if none registered.

46
	     *

47
	     * @return EventManagerInterface

48
	     */

49
	    public function getEventManager()

50
	    {

     <tr class="success popin" data-title="5 tests cover line 51" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
51
	        if (!$this->events instanceof EventManagerInterface) {

     <tr class="success popin" data-title="5 tests cover line 52" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
52
	            $this->setEventManager(new EventManager());

     <tr class="success popin" data-title="5 tests cover line 53" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
53
	        }

     <tr class="success popin" data-title="5 tests cover line 54" data-content="<ul><li class="success">CommentControllerTest::testAddReplyUriGoodData with data set &quot;0&quot;</li><li class="danger">CommentControllerTest::testAddReplyUriBadData with data set #0</li><li class="success">UserTest::testFindByEmailSuccess</li><li class="success">UserTest::testFindByEmailFailure</li><li class="success">UserTest::testFindAll</li></ul>" data-placement="bottom" data-html="true">
54
	        return $this->events;

55
	    }

56
	}

Legend

     Executed
     Not Executed
     Dead Code

     Generated by PHP_CodeCoverage 1.2.13 using PHP 5.3.10-1ubuntu3.8 and PHPUnit 3.7.27 at Sat Oct 12 3:31:18 CEST 2013.


text:
const struct DetailAttributes DetailAttributes = {
	.detailId = @"detailId",
	.detailName = @"detailName",
};

const struct DetailRelationships DetailRelationships = {
	.master = @"master",
};

@implementation DetailID
@end

@implementation _Detail

+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_ {
	NSParameterAssert(moc_);
	return [NSEntityDescription insertNewObjectForEntityForName:@"Detail" inManagedObjectContext:moc_];
}

+ (NSString*)entityName {
	return @"Detail";
}

+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_ {
	NSParameterAssert(moc_);
	return [NSEntityDescription entityForName:@"Detail" inManagedObjectContext:moc_];
}

- (DetailID*)objectID {
	return (DetailID*)[super objectID];
}

+ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
	NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];

	if ([key isEqualToString:@"detailIdValue"]) {
		NSSet *affectingKey = [NSSet setWithObject:@"detailId"];
		keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
		return keyPaths;
	}

	return keyPaths;
}

@dynamic detailId;

- (int32_t)detailIdValue {
	NSNumber *result = [self detailId];
	return [result intValue];
}

- (void)setDetailIdValue:(int32_t)value_ {
	[self setDetailId:@(value_)];
}

- (int32_t)primitiveDetailIdValue {
	NSNumber *result = [self primitiveDetailId];
	return [result intValue];
}

- (void)setPrimitiveDetailIdValue:(int32_t)value_ {
	[self setPrimitiveDetailId:@(value_)];
}

@dynamic detailName;

@dynamic master;

@end


text:
using std::string;
using namespace boost;
using namespace boost::python;
using namespace IECore;

namespace IECorePython
{

void bindBINMeshReader()
{
	RunTimeTypedClass<BINMeshReader>()
		.def(  init<const std::string &>() )
		.def( "canRead", &BINMeshReader::canRead).staticmethod( "canRead" )
	;
}

} // namespace IECorePython


text:
package org.eclipse.ceylon.common.tool;

public class NoSuchToolException extends OptionArgumentException.InvalidArgumentValueException {

    private static final long serialVersionUID = 4847884252620666903L;

    private String toolName;

    public NoSuchToolException(ArgumentModel<?> argumentModel, String toolName) {
        super(null, argumentModel, toolName);
        this.toolName = toolName;
    }

    public String getToolName() {
        return toolName;
    }

}


text:
declare class C {
  bar(n1: number, n2: number): number;
  bar(s1: string, s2: string): string;
}

function foo(c: C, x: any): string {
  let y = x.y;
  return c.bar(0, y); // should be able to select first case and error
}


text:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

#endregion Using Directives

namespace ScintillaNET
{
    /// <summary>
    ///     Defines a marker's appearance in a <see cref="Scintilla"/> control.
    /// </summary>
    [TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConverter))]
    public class Marker : ScintillaHelperBase
    {
        #region Fields

        private int _number;

        #endregion Fields

        #region Methods

        public MarkerInstance AddInstanceTo(int line)
        {
            return new MarkerInstance(Scintilla, this, NativeScintilla.MarkerAdd(line, _number));
        }

        public MarkerInstance AddInstanceTo(Line line)
        {
            return AddInstanceTo(line.Number);
        }

        public override bool Equals(object obj)
        {
            if (!IsSameHelperFamily(obj))
                return false;

            return ((Marker)obj).Number == this.Number;

        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public void Reset()
        {
            ResetAlpha();
            ResetBackColor();
            ResetForeColor();
            ResetSymbol();
        }

        private void ResetAlpha()
        {
            Alpha = 0xff;
        }

        private void ResetBackColor()
        {
            BackColor = Color.White;
        }

        private void ResetForeColor()
        {
            ForeColor = Color.Black;
        }

        private void ResetSymbol()
        {
            Symbol = MarkerSymbol.Circle;
        }

        internal void SetBackColorInternal(Color value)
        {
            Scintilla.ColorBag[ToString() + ".BackColor"] = value;
            NativeScintilla.MarkerSetBack(_number, Utilities.ColorToRgb(value));
        }

        internal void SetForeColorInternal(Color value)
        {
            Scintilla.ColorBag[ToString() + ".ForeColor"] = value;
            NativeScintilla.MarkerSetFore(_number, Utilities.ColorToRgb(value));
        }

        public void SetImage(string xpmImage)
        {
            NativeScintilla.MarkerDefinePixmap(_number, xpmImage);
        }

        public void SetImage(Bitmap image)
        {
            NativeScintilla.MarkerDefinePixmap(_number, XpmConverter.ConvertToXPM(image));
        }

        public void SetImage(Bitmap image, Color transparentColor)
        {
            NativeScintilla.MarkerDefinePixmap(_number, XpmConverter.ConvertToXPM(image, Utilities.ColorToHtml(transparentColor)));
        }

        internal void SetSymbolInternal(MarkerSymbol value)
        {
            Scintilla.PropertyBag[ToString() + ".Symbol"] = value;
            NativeScintilla.MarkerDefine(_number, (int)value);
        }

        internal bool ShouldSerialize()
        {
            return ShouldSerializeAlpha() ||
                ShouldSerializeBackColor() ||
                ShouldSerializeForeColor() ||
                ShouldSerializeSymbol();
        }

        private bool ShouldSerializeAlpha()
        {
            return Alpha != 0xff;
        }

        private bool ShouldSerializeBackColor()
        {
            if (Scintilla.Folding.MarkerScheme == FoldMarkerScheme.Custom)
                return BackColor != Color.White;

            return false;
        }

        private bool ShouldSerializeForeColor()
        {
            if (Scintilla.Folding.MarkerScheme == FoldMarkerScheme.Custom)
                return ForeColor != Color.Black;

            return false;
        }

        private bool ShouldSerializeSymbol()
        {
            if (Scintilla.Folding.MarkerScheme == FoldMarkerScheme.Custom)
                return Symbol != MarkerSymbol.Circle;

            return false;
        }

        public override string ToString()
        {
            return "MarkerNumber" + _number;
        }

        #endregion Methods

        #region Properties

        public int Alpha
        {
            get
            {

                try
                {
                    if (Scintilla.PropertyBag.ContainsKey(ToString() + ".Alpha"))
                        return (int)Scintilla.PropertyBag[ToString() + ".Alpha"];

                    return 0xff;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                    return 0xff;
                }
            }
            set
            {
                Scintilla.PropertyBag[ToString() + ".Alpha"] = value;
                NativeScintilla.MarkerSetAlpha(_number, value);
            }
        }

        public Color BackColor
        {
            get
            {
                if (Scintilla.ColorBag.ContainsKey(ToString() + ".BackColor"))
                    return Scintilla.ColorBag[ToString() + ".BackColor"];

                return Color.White;
            }
            set
            {
                SetBackColorInternal(value);
                Scintilla.Folding.MarkerScheme = FoldMarkerScheme.Custom;
            }
        }

        public Color ForeColor
        {
            get
            {
                if (Scintilla.ColorBag.ContainsKey(ToString() + ".ForeColor"))
                    return Scintilla.ColorBag[ToString() + ".ForeColor"];

                return Color.Black;
            }
            set
            {
                SetForeColorInternal(value);
                Scintilla.Folding.MarkerScheme = FoldMarkerScheme.Custom;
            }
        }

        public uint Mask
        {
            get
            {
                uint result = ((uint)1) << Number;
                return result;
            }
        }

        public int Number
        {
            get
            {
                return _number;
            }
            set
            {
                _number = value;
            }
        }

        /// <summary>
        ///     Gets or sets the marker symbol.
        /// </summary>
        /// <returns>One of the <see cref="MarkerSymbol" /> values. The default is <see cref="MarkerSymbol.Circle" />.</returns>
        /// <exception cref="InvalidEnumArgumentException">
        ///     The value assigned is not one of the <see cref="MarkerSymbol" /> values.
        /// </exception>
        public MarkerSymbol Symbol
        {
            get
            {
                if (Scintilla.PropertyBag.ContainsKey(ToString() + ".Symbol"))
                    return (MarkerSymbol)Scintilla.PropertyBag[ToString() + ".Symbol"];

                return MarkerSymbol.Circle;
            }
            set
            {
                if (!Enum.IsDefined(typeof(MarkerSymbol), value))
                    throw new InvalidEnumArgumentException("value", (int)value, typeof(MarkerSymbol));

                if (value != Symbol)
                {
                    SetSymbolInternal(value);
                    Scintilla.Folding.MarkerScheme = FoldMarkerScheme.Custom;
                }
            }
        }

        #endregion Properties

        #region Constructors

        internal Marker(Scintilla scintilla, int number) : base(scintilla)
        {
            _number = number;
        }

        #endregion Constructors
    }
}


text:
namespace System.Configuration
{
    public enum ConfigurationAllowDefinition
    {
        MachineOnly = 0,
        MachineToWebRoot = 100,
        MachineToApplication = 200,
        Everywhere = 300,
    }
}


text:
<?php

namespace Phalcon\Mvc;

use Phalcon\DiInterface;

interface ModuleDefinitionInterface
{

	/**
	 * Registers an autoloader related to the module
	 *
	 * @param DiInterface $dependencyInjector
	 */
	public function registerAutoloaders(DiInterface $dependencyInjector=null);

	/**
	 * Registers services related to the module
	 *
	 * @param DiInterface $dependencyInjector
	 */
	public function registerServices(DiInterface $dependencyInjector);

}


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

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Microsoft.IdentityModel.Clients.ActiveDirectory")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

[assembly: InternalsVisibleTo("Test.ADAL.WinRT.Unit, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]

// Assembly version information is in file ADAL.Common\CommonAssemblyInfo.cs


text:
// @(#)$Id: IntMathOps4.java,v 1.10 2005/12/04 18:09:42 leavens Exp $

// Copyright (C) 1998, 1999 Iowa State University

// This file is part of JML

// JML is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.

// JML is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with JML; see the file COPYING.  If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

package org.jmlspecs.samples.prelimdesign;

public class IntMathOps4 {

  /** Integer square root function.
   * @param y the number to take the root of
   * @return an integer approximating
   *         the positive square root of y
   *
<jml>
   *   public normal_behavior
   *     requires y >= 0;
   *     assignable \nothing;
   *     ensures 0 <= \result
   *        && \result * \result <= y
   *        && ((0 <= (\result + 1) * (\result + 1))
   *            ==> y < (\result + 1) * (\result + 1));
   * </jml>

   **/
  public static int isqrt(int y)
  {
     return (int) Math.sqrt(y);
  }
}


text:
namespace net {

SamePartyContext::SamePartyContext(Type context_type)
    : context_type_(context_type) {}

bool SamePartyContext::operator==(const SamePartyContext& other) const {
  return context_type_ == other.context_type_;
}

std::ostream& operator<<(std::ostream& os, const SamePartyContext& spc) {
  os << "{" << static_cast<int>(spc.context_type()) << "}";
  return os;
}

// static
SamePartyContext SamePartyContext::MakeInclusive() {
  return SamePartyContext(Type::kSameParty);
}

}  // namespace net


text:
layout: default
meta: Ricard Panadès Nadal - Disseny web i gràfic.
title: Inici
id: index
---

Hello! I'm Ricard, a designer (UX, UI, HTML, CSS) from Barcelona.

					See my design process

						{% include work.html %}


text:
import {module} from 'angular';
import {HELP_CONTENTS_REGISTRY, HelpContentsRegistry} from 'core/help/helpContents.registry';

const helpContents: any[] = [
  {
    key: 'application.chaos.enabled',
    contents: '
Chaos Monkey periodically terminates instances in your ASGs to ensure resiliency.
' +
    '
If you do not want your application to participate in Chaos Monkey, unselect this option.
'
  },
  {
    key: 'chaos.meanTime',
    contents: '
The average number of days between terminations for each group
'
  },
  {
    key: 'chaos.minTime',
    contents: '
The minimum number of days Chaos Monkey will leave the groups alone
'
  },
  {
    key: 'chaos.grouping',
    contents: '
Tells Chaos Monkey how to decide which instances to terminate:
' +
    '
' +
    '
App: Only terminate one instance in the entire application, across stacks and clusters
' +
    '
Stack: Only terminate one instance in each stack
' +
    '
Cluster: Terminate an instance in every cluster
' +
    '
'
  },
  {
    key: 'chaos.regions',
    contents: '
If selected, Chaos Monkey will treat each region in each group separately, e.g. if your cluster ' +
    'is deployed in three regions, an instance in each region would be terminated.
'
  },
  {
    key: 'chaos.exceptions',
    contents: '
When Chaos Monkey is enabled, exceptions tell Chaos Monkey to leave certain clusters alone. ' +
    'You can use wildcards (*) to include all matching fields.
'
  },
  {
    key: 'chaos.documentation',
    contents: `
Chaos Monkey documentation can be found

                       here
                     .

`
  }
];

export const CHAOS_MONKEY_HELP = 'spinnaker.core.chaosMonkey.help.contents';
module(CHAOS_MONKEY_HELP, [HELP_CONTENTS_REGISTRY])
  .run((helpContentsRegistry: HelpContentsRegistry) => {
    helpContents.forEach((entry: any) => helpContentsRegistry.register(entry.key, entry.contents));
});


text:
<?php

/*
 * Todos los derechos reservados por Manuel Jhobanny Morillo Ordoñez
 * 2015
 * Contacto: geomorillo@yahoo.com
 */

return
[
    "licencia" => "
The MIT License (MIT)

Copyright (c) 2016 PrestoMVC

    Por la presente se concede permiso, libre de cargos, a cualquier persona que obtenga
    una copia de este software y de los archivos de documentación asociados (el \"Software\"),
    a utilizar el Software sin restricción, incluyendo sin limitación los derechos a usar, copiar,
    modificar, fusionar, publicar, distribuir, sublicenciar, y/o vender copias del Software,
    y a permitir a las personas a las que se les proporcione el Software a hacer lo mismo,
    sujeto a las siguientes condiciones:
    El aviso de copyright anterior y este aviso de permiso se incluirán en todas las copias o partes sustanciales del Software.

    EL SOFTWARE SE PROPORCIONA \"COMO ESTÁ\", SIN GARANTÍA DE NINGÚN TIPO, EXPRESA O IMPLÍCITA,
    INCLUYENDO PERO NO LIMITADO A GARANTÍAS DE COMERCIALIZACIÓN, IDONEIDAD PARA UN PROPÓSITO PARTICULAR
    E INCUMPLIMIENTO. EN NINGÚN CASO LOS AUTORES O PROPIETARIOS DE LOS DERECHOS DE AUTOR SERÁN RESPONSABLES
    DE NINGUNA RECLAMACIÓN, DAÑOS U OTRAS RESPONSABILIDADES, YA SEA EN UNA ACCIÓN DE CONTRATO, AGRAVIO
    O CUALQUIER OTRO MOTIVO, DERIVADAS DE, FUERA DE O EN CONEXIÓN CON EL SOFTWARE O SU USO U OTRO TIPO DE ACCIONES EN EL SOFTWARE."
];


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

namespace ManaPHP\Event;

interface ManagerInterface
{
    public function attachEvent(string $event, callable $handler, int $priority = 0): void;

    public function detachEvent(string $event, callable $handler): void;

    public function fireEvent(string $event, mixed $data = null, ?object $source = null): EventArgs;

    public function peekEvent(string $group, callable $handler): void;
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Saxifraga elata Nutt.

### Remarks
null


text:
//
//  NKStringUtil.cpp
//  NodeKittenX
//
//  Created by Leif Shackelford on 1/18/15.
//  Copyright (c) 2015 structuresound. All rights reserved.
//

#include "util.h"

#include <cctype>
#include <bitset>

#pragma mark - namespace::POCO

namespace Poco {

    const int Ascii::CHARACTER_PROPERTIES[128] =
    {
        /* 00 . */ ACP_CONTROL,
        /* 01 . */ ACP_CONTROL,
        /* 02 . */ ACP_CONTROL,
        /* 03 . */ ACP_CONTROL,
        /* 04 . */ ACP_CONTROL,
        /* 05 . */ ACP_CONTROL,
        /* 06 . */ ACP_CONTROL,
        /* 07 . */ ACP_CONTROL,
        /* 08 . */ ACP_CONTROL,
        /* 09 . */ ACP_CONTROL | ACP_SPACE,
        /* 0a . */ ACP_CONTROL | ACP_SPACE,
        /* 0b . */ ACP_CONTROL | ACP_SPACE,
        /* 0c . */ ACP_CONTROL | ACP_SPACE,
        /* 0d . */ ACP_CONTROL | ACP_SPACE,
        /* 0e . */ ACP_CONTROL,
        /* 0f . */ ACP_CONTROL,
        /* 10 . */ ACP_CONTROL,
        /* 11 . */ ACP_CONTROL,
        /* 12 . */ ACP_CONTROL,
        /* 13 . */ ACP_CONTROL,
        /* 14 . */ ACP_CONTROL,
        /* 15 . */ ACP_CONTROL,
        /* 16 . */ ACP_CONTROL,
        /* 17 . */ ACP_CONTROL,
        /* 18 . */ ACP_CONTROL,
        /* 19 . */ ACP_CONTROL,
        /* 1a . */ ACP_CONTROL,
        /* 1b . */ ACP_CONTROL,
        /* 1c . */ ACP_CONTROL,
        /* 1d . */ ACP_CONTROL,
        /* 1e . */ ACP_CONTROL,
        /* 1f . */ ACP_CONTROL,
        /* 20   */ ACP_SPACE | ACP_PRINT,
        /* 21 ! */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 22 " */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 23 # */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 24 $ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 25 % */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 26 & */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 27 ' */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 28 ( */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 29 ) */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2a * */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2b + */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2c , */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2d - */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2e . */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 2f / */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 30 0 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 31 1 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 32 2 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 33 3 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 34 4 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 35 5 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 36 6 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 37 7 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 38 8 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 39 9 */ ACP_DIGIT | ACP_HEXDIGIT | ACP_GRAPH | ACP_PRINT,
        /* 3a : */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 3b ; */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 3c < */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 3d = */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 3e > */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 3f ? */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 40 @ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 41 A */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 42 B */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 43 C */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 44 D */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 45 E */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 46 F */ ACP_HEXDIGIT | ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 47 G */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 48 H */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 49 I */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4a J */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4b K */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4c L */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4d M */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4e N */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 4f O */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 50 P */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 51 Q */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 52 R */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 53 S */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 54 T */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 55 U */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 56 V */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 57 W */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 58 X */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 59 Y */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 5a Z */ ACP_ALPHA | ACP_UPPER | ACP_GRAPH | ACP_PRINT,
        /* 5b [ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 5c \ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 5d ] */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 5e ^ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 5f _ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 60 ` */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 61 a */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 62 b */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 63 c */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 64 d */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 65 e */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 66 f */ ACP_HEXDIGIT | ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 67 g */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 68 h */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 69 i */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6a j */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6b k */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6c l */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6d m */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6e n */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 6f o */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 70 p */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 71 q */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 72 r */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 73 s */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 74 t */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 75 u */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 76 v */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 77 w */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 78 x */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 79 y */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 7a z */ ACP_ALPHA | ACP_LOWER | ACP_GRAPH | ACP_PRINT,
        /* 7b { */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 7c | */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 7d } */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 7e ~ */ ACP_PUNCT | ACP_GRAPH | ACP_PRINT,
        /* 7f . */ ACP_CONTROL
    };

}

using namespace Poco;

#pragma mark - namespace::STRING

namespace String {

    string narrow( const wstring& str )
    {
        std::ostringstream stm ;
        const std::ctype<char>& ctfacet =
          std::use_facet< std::ctype<char> >( stm.getloc() ) ;
        for( size_t i=0 ; i<str.size() ; ++i )
            stm << ctfacet.narrow( str[i], 0 ) ;
        return stm.str() ;
    }

    string wstring2string(const wstring & wstr)
    {
        string str(wstr.length(),' ');
        copy(wstr.begin(),wstr.end(),str.begin());
        return str;
    }

    wstring string2wstring(const string & str)
    {
        wstring wstr(str.length(),L' ');
        copy(str.begin(),str.end(),wstr.begin());
        return wstr;
    }

    // POCO UTILS

    template <class S>
    S trimLeft(const S& str)
    /// Returns a copy of str with all leading
    /// whitespace removed.
    {
        typename S::const_iterator it  = str.begin();
        typename S::const_iterator end = str.end();

        while (it != end && Ascii::isSpace(*it)) ++it;
        return S(it, end);
    }

    template <class S>
    S& trimLeftInPlace(S& str)
    /// Removes all leading whitespace in str.
    {
        typename S::iterator it  = str.begin();
        typename S::iterator end = str.end();

        while (it != end && Ascii::isSpace(*it)) ++it;
        str.erase(str.begin(), it);
        return str;
    }

    template <class S>
    S trimRight(const S& str)
    /// Returns a copy of str with all trailing
    /// whitespace removed.
    {
        int pos = int(str.size()) - 1;

        while (pos >= 0 && Ascii::isSpace(str[pos])) --pos;
        return S(str, 0, pos + 1);
    }

    template <class S>
    S& trimRightInPlace(S& str)
    /// Removes all trailing whitespace in str.
    {
        int pos = int(str.size()) - 1;

        while (pos >= 0 && Ascii::isSpace(str[pos])) --pos;
        str.resize(pos + 1);

        return str;
    }

    template <class S>
    S trim(const S& str)
    /// Returns a copy of str with all leading and
    /// trailing whitespace removed.
    {
        int first = 0;
        int last  = int(str.size()) - 1;

        while (first <= last && Ascii::isSpace(str[first])) ++first;
        while (last >= first && Ascii::isSpace(str[last])) --last;

        return S(str, first, last - first + 1);
    }

    template <class S>
    S& trimInPlace(S& str)
    /// Removes all leading and trailing whitespace in str.
    {
        int first = 0;
        int last  = int(str.size()) - 1;

        while (first <= last && Ascii::isSpace(str[first])) ++first;
        while (last >= first && Ascii::isSpace(str[last])) --last;

        str.resize(last + 1);
        str.erase(0, first);

        return str;
    }

    template <class S>
    S toUpper(const S& str)
    /// Returns a copy of str containing all upper-case characters.
    {
        typename S::const_iterator it  = str.begin();
        typename S::const_iterator end = str.end();

        S result;
        result.reserve(str.size());
        while (it != end) result += Ascii::toUpper(*it++);
        return result;
    }

    template <class S>
    S& toUpperInPlace(S& str)
    /// Replaces all characters in str with their upper-case counterparts.
    {
        typename S::iterator it  = str.begin();
        typename S::iterator end = str.end();

        while (it != end) { *it = Ascii::toUpper(*it); ++it; }
        return str;
    }

    template <class S>
    S toLower(const S& str)
    /// Returns a copy of str containing all lower-case characters.
    {
        typename S::const_iterator it  = str.begin();
        typename S::const_iterator end = str.end();

        S result;
        result.reserve(str.size());
        while (it != end) result += Ascii::toLower(*it++);
        return result;
    }

    template <class S>
    S& toLowerInPlace(S& str)
    /// Replaces all characters in str with their lower-case counterparts.
    {
        typename S::iterator it  = str.begin();
        typename S::iterator end = str.end();

        while (it != end) { *it = Ascii::toLower(*it); ++it; }
        return str;
    }

    // CONVENIENCE FUNCTIONS

    string& getfile(const string& filename, string& buffer) {
        std::ifstream in(filename.c_str(), std::ios_base::binary | std::ios_base::ate);
        in.exceptions(std::ios_base::badbit | std::ios_base::failbit | std::ios_base::eofbit);
        buffer.resize(in.tellg());
        in.seekg(0, std::ios_base::beg);
        in.read(&buffer[0], buffer.size());
        return buffer;
    }

    //--------------------------------------------------
    vector <string> split(const string & source, const string & delimiter, bool ignoreEmpty, bool trim) {
        vector<string> result;
        if (delimiter.empty()) {
            result.push_back(source);
            return result;
        }
        string::const_iterator substart = source.begin(), subend;
        while (true) {
            subend = search(substart, source.end(), delimiter.begin(), delimiter.end());
            string sub(substart, subend);
            if(trim) {
                trimInPlace(sub);
            }
            if (!ignoreEmpty || !sub.empty()) {
                result.push_back(sub);
            }
            if (subend == source.end()) {
                break;
            }
            substart = subend + delimiter.size();
        }
        return result;
    }

    //--------------------------------------------------
    string join(vector <string> stringElements, const string & delimiter){
        string resultString = "";
        int numElements = stringElements.size();

        for(int k = 0; k < numElements; k++){
            if( k < numElements-1 ){
                resultString += stringElements[k] + delimiter;
            } else {
                resultString += stringElements[k];
            }
        }

        return resultString;
    }

    //--------------------------------------------------
    void replace(string& input, string searchStr, string replaceStr){
        size_t uPos = 0;
        size_t uFindLen = searchStr.length();
        size_t uReplaceLen = replaceStr.length();

        if( uFindLen == 0 ){
            return;
        }

        for( ;(uPos = input.find( searchStr, uPos )) != std::string::npos; ){
            input.replace( uPos, uFindLen, replaceStr );
            uPos += uReplaceLen;
        }
    }

    int occurancesOfSubstring(string haystack, string needle){
        const size_t step = needle.size();

        size_t count(0);
        size_t pos(0) ;

        while( (pos=haystack.find(needle, pos)) != std::string::npos) {
            pos +=step;
            ++count ;
        }

        return count;
    }

    //--------------------------------------------------
    string lowerCase(const string & src){
        string dst(src);
        transform(src.begin(),src.end(),dst.begin(),::tolower);
        return dst;
    }

    //--------------------------------------------------
    string upperCase(const string & src){
        string dst(src);
        transform(src.begin(),src.end(),dst.begin(),::toupper);
        return dst;
    }

    string filePath( const string & fullPath){
        return fullPath.substr(0, fullPath.find_last_of("/") + 1);
    }

    string lastPathExtension( const string & fullPath){
         return fullPath.substr(fullPath.find_last_of("/") + 1);
    }

    string fileType( const string & fullPath, bool upperCase){
        if (upperCase) {
            return String::upperCase(fullPath.substr(fullPath.find_last_of(".") + 1));
        }
        return fullPath.substr(fullPath.find_last_of(".") + 1);
    }

    //--------------------------------------------------
    string format(const char * format, ...){
        // variadic args to string:
        // http://www.codeproject.com/KB/string/string_format.aspx
        static char aux_buffer[10000];
        string retStr("");
        if (NULL != format){

            va_list marker;

            // initialize variable arguments
            va_start(marker, format);

            // Get formatted string length adding one for NULL
            size_t len = vsprintf(aux_buffer, format, marker) + 1;

            // Reset variable arguments
            va_end(marker);

            if (len > 0)
            {
                va_list args;

                // initialize variable arguments
                va_start(args, format);

                // Create a char vector to hold the formatted string.
                vector<char> buffer(len, '\0');
                vsprintf(&buffer[0], format, args);
                retStr = &buffer[0];
                va_end(args);
            }

        }
        return retStr;
    }

    string format(const char * format, va_list args){
        // variadic args to string:
        // http://www.codeproject.com/KB/string/string_format.aspx
        char aux_buffer[10000];
        string retStr("");
        if (NULL != format){

            // Get formatted string length adding one for NULL
            vsprintf(aux_buffer, format, args);
            retStr = aux_buffer;

        }
        return retStr;
    }

    //----------------------------------------
    string toHex(const string& value) {
        std::ostringstream out;
        // how many bytes are in the string
        int numBytes = value.size();
        for(int i = 0; i < numBytes; i++) {
            // print each byte as a 2-character wide hex value
            out << std::setfill('0') << std::setw(2) << std::hex << (unsigned int) ((unsigned char)value[i]);
        }
        return out.str();
    }

    //----------------------------------------
    string ofToHex(const char* value) {
        // this function is necessary if you want to print a string
        // using a syntax like ofToHex("test")
        return toHex((string) value);
    }

    //----------------------------------------
    int toInt(const string& intString) {
        int x = 0;
        std::istringstream cur(intString);
        cur >> x;
        return x;
    }

    //----------------------------------------
    int hexToInt(const string& intHexString) {
        int x = 0;
        std::istringstream cur(intHexString);
        cur >> std::hex >> x;
        return x;
    }

    //----------------------------------------
    char hexToChar(const string& charHexString) {
        int x = 0;
        std::istringstream cur(charHexString);
        cur >> std::hex >> x;
        return (char) x;
    }

    //----------------------------------------
    float hexToFloat(const string& floatHexString) {
        union intFloatUnion {
            int x;
            float f;
        } myUnion;
        myUnion.x = 0;
        std::istringstream cur(floatHexString);
        cur >> std::hex >> myUnion.x;
        return myUnion.f;
    }

    //----------------------------------------
    float toFloat(const string& floatString) {
        float x = 0;
        std::istringstream cur(floatString);
        cur >> x;
        return x;
    }

    //----------------------------------------
    double toDouble(const string& doubleString) {
        double x = 0;
        std::istringstream cur(doubleString);
        cur >> x;
        return x;
    }

    //----------------------------------------
    bool toBool(const string& boolString) {
        static const string trueString = "true";
        static const string falseString = "false";
        string lower = toLower(boolString);
        if(lower == trueString) {
            return true;
        }
        if(lower == falseString) {
            return false;
        }
        bool x = false;
        std::istringstream cur(lower);
        cur >> x;
        return x;
    }

    //----------------------------------------
    char toChar(const string& charString) {
        char x = '\0';
        std::istringstream cur(charString);
        cur >> x;
        return x;
    }

    //----------------------------------------
    string toBinary(const string& value) {
        std::stringstream out;
        int numBytes = value.size();
        for(int i = 0; i < numBytes; i++) {
            std::bitset<8> bitBuffer(value[i]);
            out << bitBuffer;
        }
        return out.str();
    }

    //----------------------------------------
    string toBinary(const char* value) {
        // this function is necessary if you want to print a string
        // using a syntax like ofToBinary("test")
        return toBinary((string) value);
    }

    //----------------------------------------
    int binaryToInt(const string& value) {
        const int intSize = sizeof(int) * 8;
        std::bitset<intSize> binaryString(value);
        return (int) binaryString.to_ulong();
    }

    //----------------------------------------
    char binaryToChar(const string& value) {
        const int charSize = sizeof(char) * 8;
        std::bitset<charSize> binaryString(value);
        return (char) binaryString.to_ulong();
    }

    //----------------------------------------
    float binaryToFloat(const string& value) {
        const int floatSize = sizeof(float) * 8;
        std::bitset<floatSize> binaryString(value);
        union ulongFloatUnion {
            unsigned long result;
            float f;
        } myUFUnion;
        myUFUnion.result = binaryString.to_ulong();
        return myUFUnion.f;
    }
    //----------------------------------------
    string binaryToString(const string& value) {
        std::ostringstream out;
        std::stringstream stream(value);
        std::bitset<8> byteString;
        int numBytes = value.size() / 8;
        for(int i = 0; i < numBytes; i++) {
            stream >> byteString;
            out << (char) byteString.to_ulong();
        }
        return out.str();
    }

    //----------------------------------------
    string fromHex(const string& stringHexString) {
        std::stringstream out;
        std::stringstream stream(stringHexString);
        // a hex string has two characters per byte
        int numBytes = stringHexString.size() / 2;
        for(int i = 0; i < numBytes; i++) {
            string curByte;
            // grab two characters from the hex string
            stream >> std::setw(2) >> curByte;
            // prepare to parse the two characters
            std::stringstream curByteStream(curByte);
            int cur = 0;
            // parse the two characters as a hex-encoded int
            curByteStream >> std::hex >> cur;
            // add the int as a char to our output stream
            out << (char) cur;
        }
        return out.str();
    }

    static vector<string> nk_quotes{
        "Stay Hungry. Stay Foolish. -Steve Jobs",
        "Good Artists Copy, Great Artists Steal. -Pablo Picasso",
        "Argue with idiots, and you become an idiot., -Paul Graham",
        "Be yourself; everyone else is already taken., -Oscar Wilde",
        "Simplicity is the ultimate sophistication., -Leonardo Da Vinci"
        "Life is about making an impact, not making an income. -Kevin Kruse",
        "Whatever the mind of man can conceive and believe, it can achieve. -Napoleon Hill",
        "Strive not to be a success, but rather to be of value. -Albert Einstein",
        "Two roads diverged in a wood, and I took the one less traveled by, And that has made all the difference.  -Robert Frost",
        "I attribute my success to this: I never gave or took any excuse. -Florence Nightingale",
        "You miss 100% of the shots you don't take. -Wayne Gretzky",
        "The most difficult thing is the decision to act, the rest is merely tenacity. -Amelia Earhart",
        "Every strike brings me closer to the next home run. -Babe Ruth",
        "Definiteness of purpose is the starting point of all achievement. -W. Clement Stone",
        "Life isn't about getting and having, it's about giving and being. -Kevin Kruse",
        "Life is what happens to you while you're busy making other plans. -John Lennon",
        "We become what we think about. -Earl Nightingale",
        "Life is 10% what happens to me and 90% of how I react to it. -Charles Swindoll",
        "The most common way people give up their power is by thinking they don't have any. -Alice Walker",
        "The mind is everything. What you think you become.  -Buddha",
        "The best time to plant a tree was 20 years ago. The second best time is now. -Chinese Proverb",
        "An unexamined life is not worth living. -Socrates",
        "Eighty percent of success is showing up. -Woody Allen",
        "Your time is limited, so don't waste it living someone else's life. -Steve Jobs",
        "Winning isn't everything, but wanting to win is. -Vince Lombardi",
        "I am not a product of my circumstances. I am a product of my decisions. -Stephen Covey",
        "Every child is an artist.  The problem is how to remain an artist once he grows up. -Pablo Picasso",
        "I've learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel. -Maya Angelou",
        "Either you run the day, or the day runs you. -Jim Rohn",
        "Whether you think you can or you think you can't, you're right. -Henry Ford",
        "The two most important days in your life are the day you are born and the day you find out why. -Mark Twain",
        "Whatever you can do, or dream you can, begin it.  Boldness has genius, power and magic in it. -Johann Wolfgang von Goethe",
        "The best revenge is massive success. -Frank Sinatra",
        "People often say that motivation doesn't last. Well, neither does bathing.  That's why we recommend it daily. -Zig Ziglar",
        "Life shrinks or expands in proportion to one's courage. -Anais Nin"
    };

    string randomQuote(){
        return nk_quotes[rand() % nk_quotes.size()];
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="LaravelPluginSettings">
    <option name="routerNamespace" value="" />
  </component>
</project>