text:
==================================================================
Notes regarding fonts, code pages, and East Asian character widths
==================================================================

Registry settings
=================

 * There are console registry settings in `HKCU\Console`.  That key has many
   default settings (e.g. the default font settings) and also per-app subkeys
   for app-specific overrides.

 * It is possible to override the code page with an app-specific setting.

 * There are registry settings in
   `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console`.  In particular,
   the `TrueTypeFont` subkey has a list of suitable font names associated with
   various CJK code pages, as well as default font names.

 * There are two values in `HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage`
   that specify the current code pages -- `OEMCP` and `ACP`.  Setting the
   system locale via the Control Panel's "Region" or "Language" dialogs seems
   to change these code page values.

Console fonts
=============

 * The `FontFamily` field of `CONSOLE_FONT_INFOEX` has two parts:
    - The high four bits can be exactly one of the `FF_xxxx` font families:
          FF_DONTCARE(0x00)
          FF_ROMAN(0x10)
          FF_SWISS(0x20)
          FF_MODERN(0x30)
          FF_SCRIPT(0x40)
          FF_DECORATIVE(0x50)
    - The low four bits are a bitmask:
          TMPF_FIXED_PITCH(1) -- actually means variable pitch
          TMPF_VECTOR(2)
          TMPF_TRUETYPE(4)
          TMPF_DEVICE(8)

 * Each console has its own independent console font table.  The current font
   is identified with an index into this table.  The size of the table is
   returned by the undocumented `GetNumberOfConsoleFonts` API.  It is apparently
   possible to get the table size without this API, by instead calling
   `GetConsoleFontSize` on each nonnegative index starting with 0 until the API
   fails by returning (0, 0).

 * The font table grows dynamically.  Each time the console is configured with
   a previously-unused (FaceName, Size) combination, two entries are added to
   the font table -- one with normal weight and one with bold weight.  Fonts
   added this way are always TrueType fonts.

 * Initially, the font table appears to contain only raster fonts.  For
   example, on an English Windows 8 installation, here is the initial font
   table:
       font 0: 4x6
       font 1: 6x8
       font 2: 8x8
       font 3: 16x8
       font 4: 5x12
       font 5: 7x12
       font 6: 8x12 -- the current font
       font 7: 16x12
       font 8: 12x16
       font 9: 10x18
   `GetNumberOfConsoleFonts` returns 10, and this table matches the raster font
   sizes according to the console properties dialog.

 * With a Japanese or Chinese locale, the initial font table appears to contain
   the sizes applicable to both the East Asian raster font, as well as the
   sizes for the CP437/CP1252 raster font.

 * The index passed to `SetCurrentConsoleFontEx` apparently has no effect.
   The undocumented `SetConsoleFont` API, however, accepts *only* a font index,
   and on Windows 8 English, it switches between all 10 fonts, even font index
   #0.

 * If the index passed to `SetConsoleFont` identifies a Raster Font
   incompatible with the current code page, then another Raster Font is
   activated.

 * Passing "Terminal" to `SetCurrentConsoleFontEx` seems to have no effect.
   Perhaps relatedly, `SetCurrentConsoleFontEx` does not fail if it is given a
   bogus `FaceName`.  Some font is still chosen and activated.  Passing a face
   name and height seems to work reliably, modulo the CP936 issue described
   below.

Console fonts and code pages
============================

 * On an English Windows installation, the default code page is 437, and it
   cannot be set to 932 (Shift-JIS).  (The API call fails.)  Changing the
   system locale to "Japanese (Japan)" using the Region/Language dialog
   changes the default CP to 932 and permits changing the console CP between
   437 and 932.

 * A console has both an input code page and an output code page
   (`{Get,Set}ConsoleCP` and `{Get,Set}ConsoleOutputCP`).  I'm not going to
   distinguish between the two for this document; presumably only the output
   CP matters.  The code page can change while the console is open, e.g.
   by running `mode con: cp select={932,437,1252}` or by calling
   `SetConsoleOutputCP`.

 * The current code page restricts which TrueType fonts and which Raster Font
   sizes are available in the console properties dialog.  This can change
   while the console is open.

 * Changing the code page almost(?) always changes the current console font.
   So far, I don't know how the new font is chosen.

 * With a CP of 932, the only TrueType font available in the console properties
   dialog is "MS Gothic", displayed as "MS ゴシック".  It is still possible to
   use the English-default TrueType console fonts, Lucida Console and Consolas,
   via `SetCurrentConsoleFontEx`.

 * When using a Raster Font and CP437 or CP1252, writing a UTF-16 codepoint not
   representable in the code page instead writes a question mark ('?') to the
   console.  This conversion does not apply with a TrueType font, nor with the
   Raster Font for CP932 or CP936.

ReadConsoleOutput and double-width characters
==============================================

 * With a Raster Font active, when `ReadConsoleOutputW` reads two cells of a
   double-width character, it fills only a single `CHAR_INFO` structure.  The
   unused trailing `CHAR_INFO` structures are zero-filled.  With a TrueType
   font active, `ReadConsoleOutputW` instead fills two `CHAR_INFO` structures,
   the first marked with `COMMON_LVB_LEADING_BYTE` and the second marked with
   `COMMON_LVB_TRAILING_BYTE`.  The flag is a misnomer--there aren't two
   *bytes*, but two cells, and they have equal `CHAR_INFO.Char.UnicodeChar`
   values.

 * `ReadConsoleOutputA`, on the other hand, reads two `CHAR_INFO` cells, and
   if the UTF-16 value can be represented as two bytes in the ANSI/OEM CP, then
   the two bytes are placed in the two `CHAR_INFO.Char.AsciiChar` values, and
   the `COMMON_LVB_{LEADING,TRAILING}_BYTE` values are also used.  If the
   codepoint isn't representable, I don't remember what happens -- I think the
   `AsciiChar` values take on an invalid marker.

 * Reading only one cell of a double-width character reads a space (U+0020)
   instead.  Raster-vs-TrueType and wide-vs-ANSI do not matter.
    - XXX: what about attributes?  Can a double-width character have mismatched
      color attributes?
    - XXX: what happens when writing to just one cell of a double-width
      character?

Default Windows fonts for East Asian languages
==============================================
CP932 / Japanese: "MS ゴシック" (MS Gothic)
CP936 / Chinese Simplified: "新宋体" (SimSun)

Unreliable character width (half-width vs full-width)
=====================================================

The half-width vs full-width status of a codepoint depends on at least these variables:
 * OS version (Win10 legacy and new modes are different versions)
 * system locale (English vs Japanese vs Chinese Simplified vs Chinese Traditional, etc)
 * code page (437 vs 932 vs 936, etc)
 * raster vs TrueType (Terminal vs MS Gothic vs SimSun, etc)
 * font size
 * rendered-vs-model (rendered width can be larger or smaller than model width)

Example 1: U+2014 (EM DASH): East_Asian_Width: Ambiguous
--------------------------------------------------------
                                            rendered        modeled
CP932: Win7/8 Raster Fonts                  half            half
CP932: Win7/8 Gothic 14/15px                half            full
CP932: Win7/8 Consolas 14/15px              half            full
CP932: Win7/8 Lucida Console 14px           half            full
CP932: Win7/8 Lucida Console 15px           half            half
CP932: Win10New Raster Fonts                half            half
CP932: Win10New Gothic 14/15px              half            half
CP932: Win10New Consolas 14/15px            half            half
CP932: Win10New Lucida Console 14/15px      half            half

CP936: Win7/8 Raster Fonts                  full            full
CP936: Win7/8 SimSun 14px                   full            full
CP936: Win7/8 SimSun 15px                   full            half
CP936: Win7/8 Consolas 14/15px              half            full
CP936: Win10New Raster Fonts                full            full
CP936: Win10New SimSum 14/15px              full            full
CP936: Win10New Consolas 14/15px            half            half

Example 2: U+3044 (HIRAGANA LETTER I): East_Asian_Width: Wide
-------------------------------------------------------------
                                            rendered        modeled
CP932: Win7/8/10N Raster Fonts              full            full
CP932: Win7/8/10N Gothic 14/15px            full            full
CP932: Win7/8/10N Consolas 14/15px          half(*2)        full
CP932: Win7/8/10N Lucida Console 14/15px    half(*3)        full

CP936: Win7/8/10N Raster Fonts              full            full
CP936: Win7/8/10N SimSun 14/15px            full            full
CP936: Win7/8/10N Consolas 14/15px          full            full

Example 3: U+30FC (KATAKANA-HIRAGANA PROLONGED SOUND MARK): East_Asian_Width: Wide
----------------------------------------------------------------------------------
                                            rendered        modeled
CP932: Win7 Raster Fonts                    full            full
CP932: Win7 Gothic 14/15px                  full            full
CP932: Win7 Consolas 14/15px                half(*2)        full
CP932: Win7 Lucida Console 14px             half(*3)        full
CP932: Win7 Lucida Console 15px             half(*3)        half
CP932: Win8 Raster Fonts                    full            full
CP932: Win8 Gothic 14px                     full            half
CP932: Win8 Gothic 15px                     full            full
CP932: Win8 Consolas 14/15px                half(*2)        full
CP932: Win8 Lucida Console 14px             half(*3)        full
CP932: Win8 Lucida Console 15px             half(*3)        half
CP932: Win10New Raster Fonts                full            full
CP932: Win10New Gothic 14/15px              full            full
CP932: Win10New Consolas 14/15px            half(*2)        half
CP932: Win10New Lucida Console 14/15px      half(*2)        half

CP936: Win7/8 Raster Fonts                  full            full
CP936: Win7/8 SimSun 14px                   full            full
CP936: Win7/8 SimSun 15px                   full            half
CP936: Win7/8 Consolas 14px                 full            full
CP936: Win7/8 Consolas 15px                 full            half
CP936: Win10New Raster Fonts                full            full
CP936: Win10New SimSum 14/15px              full            full
CP936: Win10New Consolas 14/15px            full            full

Example 4: U+4000 (CJK UNIFIED IDEOGRAPH-4000): East_Asian_Width: Wide
----------------------------------------------------------------------
                                            rendered        modeled
CP932: Win7 Raster Fonts                    half(*1)        half
CP932: Win7 Gothic 14/15px                  full            full
CP932: Win7 Consolas 14/15px                half(*2)        full
CP932: Win7 Lucida Console 14px             half(*3)        full
CP932: Win7 Lucida Console 15px             half(*3)        half
CP932: Win8 Raster Fonts                    half(*1)        half
CP932: Win8 Gothic 14px                     full            half
CP932: Win8 Gothic 15px                     full            full
CP932: Win8 Consolas 14/15px                half(*2)        full
CP932: Win8 Lucida Console 14px             half(*3)        full
CP932: Win8 Lucida Console 15px             half(*3)        half
CP932: Win10New Raster Fonts                half(*1)        half
CP932: Win10New Gothic 14/15px              full            full
CP932: Win10New Consolas 14/15px            half(*2)        half
CP932: Win10New Lucida Console 14/15px      half(*2)        half

CP936: Win7/8 Raster Fonts                  full            full
CP936: Win7/8 SimSun 14px                   full            full
CP936: Win7/8 SimSun 15px                   full            half
CP936: Win7/8 Consolas 14px                 full            full
CP936: Win7/8 Consolas 15px                 full            half
CP936: Win10New Raster Fonts                full            full
CP936: Win10New SimSum 14/15px              full            full
CP936: Win10New Consolas 14/15px            full            full

(*1) Rendered as a half-width filled white box
(*2) Rendered as a half-width box with a question mark inside
(*3) Rendered as a half-width empty box
(!!) One of the only places in Win10New where rendered and modeled width disagree

Windows quirk: unreliable font heights with CP936 / Chinese Simplified
======================================================================

When I set the font to 新宋体 17px, using either the properties dialog or
`SetCurrentConsoleFontEx`, the height reported by `GetCurrentConsoleFontEx` is
not 17, but is instead 19.  The same problem does not affect Raster Fonts,
nor have I seen the problem in the English or Japanese locales.  I observed
this with Windows 7 and Windows 10 new mode.

If I set the font using the facename, width, *and* height, then the
`SetCurrentConsoleFontEx` and `GetCurrentConsoleFontEx` values agree.  If I
set the font using *only* the facename and height, then the two values
disagree.

Windows bug: GetCurrentConsoleFontEx is initially invalid
=========================================================

 - Assume there is no configured console font name in the registry.  In this
   case, the console defaults to a raster font.
 - Open a new console and call the `GetCurrentConsoleFontEx` API.
 - The `FaceName` field of the returned `CONSOLE_FONT_INFOEX` data
   structure is incorrect.  On Windows 7, 8, and 10, I observed that the
   field was blank.  On Windows 8, occasionally, it instead contained:
      U+AE72 U+75BE U+0001
   The other fields of the structure all appeared correct:
      nFont=6 dwFontSize=(8,12) FontFamily=0x30 FontWeight=400
 - The `FaceName` field becomes initialized easily:
    - Open the console properties dialog and click OK.  (Cancel is not
      sufficient.)
    - Call the undocumented `SetConsoleFont` with the current font table
      index, which is 6 in the example above.
 - It seems that the console uncritically accepts whatever string is
   stored in the registry, including a blank string, and passes it on the
   the `GetCurrentConsoleFontEx` caller.  It is possible to get the console
   to *write* a blank setting into the registry -- simply open the console
   (default or app-specific) properties and click OK.


text:
using Lombiq.Hosting.Azure.ApplicationInsights.Models;
using Microsoft.ApplicationInsights.DataContracts;
using Orchard.ContentManagement;
using Orchard.Environment.Configuration;
using Orchard.Services;
using Orchard.Settings;
using Orchard.Tasks;
using System.Collections.Generic;
using System.Linq;

namespace Lombiq.Hosting.Azure.ApplicationInsights.Services.BackgroundTaskTelemetry
{
    /// <summary>
    /// Decorator for the default <see cref="IBackgroundService"/> implementation so background sweeps can be tracked
    /// as an individual operation.
    /// </summary>
    internal class BackgroundServiceDecorator : IBackgroundService
    {
        private readonly IBackgroundService _decorated;
        private readonly ITelemetryClientFactory _telemetryClientFactory;
        private readonly ShellSettings _shellSettings;
        private readonly IEnumerable<IBackgroundTask> _backgroundTasks;
        private readonly IClock _clock;
        private readonly ISiteService _siteService;

        public BackgroundServiceDecorator(
            IBackgroundService decorated,
            ITelemetryClientFactory telemetryClientFactory,
            ShellSettings shellSettings,
            IEnumerable<IBackgroundTask> backgroundTasks,
            IClock clock,
            ISiteService siteService)
        {
            _decorated = decorated;
            _telemetryClientFactory = telemetryClientFactory;
            _shellSettings = shellSettings;
            _backgroundTasks = backgroundTasks;
            _clock = clock;
            _siteService = siteService;
        }

        public void Sweep()
        {
            var beginTime = _clock.UtcNow;

            _decorated.Sweep();

            var settingsPart = _siteService.GetSiteSettings().As<AzureApplicationInsightsTelemetrySettingsPart>();

            if (!settingsPart.BackgroundTaskTrackingIsEnabled) return;

            var telemetryClient = _telemetryClientFactory.CreateTelemetryClientFromCurrentConfiguration();

            if (telemetryClient == null) return;

            var eventTelemetry = new EventTelemetry { Name = "BackgroundServiceSweepEnd", Timestamp = _clock.UtcNow };
            eventTelemetry.SetShellName(_shellSettings);
            eventTelemetry.Metrics["Orchard.BackgroundTasksExecutionTimeSeconds"] = (_clock.UtcNow - beginTime).Seconds;
            eventTelemetry.Metrics["Orchard.BackgroundTaskCount"] = _backgroundTasks.Count();
            eventTelemetry.Properties["Orchard.BackgroundTasks"] =
                string.Join(", ", _backgroundTasks.Select(task => task.GetType().FullName));

            telemetryClient.TrackEvent(eventTelemetry);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
"""
    models.py
    ~~~~~~~~~
    application data models
"""

from enum import Enum
from datetime import datetime as dt

from sqlalchemy import Column, Integer
from sqlalchemy.ext.declarative import declared_attr

from application.extensions import db

class Base(db.Model):
    """Convenience base DB model class. Extends `db.Model`

    Helper class to inherit in database models that adds a set of helpful methods
    and automation steps like conventional table names, primary keys, and utility
    columns for created and updated timestamps.
    """

    @declared_attr
    def __tablename__(self):
        return "{}".format(self.__name__.lower())

    __abstract__ = True

    id = Column(Integer, primary_key=True, autoincrement=True, nullable=True)
    created_at = db.Column(db.DateTime, default=lambda: dt.utcnow(), nullable=False)
    updated_at = db.Column(db.DateTime, default=lambda: dt.utcnow(), onupdate=lambda: dt.utcnow(), nullable=False)

    def _isinstance(self, model, raise_error=True):
        """Checks if the specified model instance matches the base's model.

        By default this method will raise a `ValueError` if the model is not the
        expected type.

        Args:
            model: the model instance to check
            raise_error: flag to raise an error on a mismatch

        Returns:
            rv: returned if model is an instance of the class

        """
        rv = isinstance(model, self.__class__)
        if not rv and raise_error:
            raise ValueError("%s is not of type %s" % (model, self.__class__))
        return rv

    def _preprocess_params(self, kwargs):
        """Returns a preprocessed dictionary of parameters. Used by default
        before creating a new instance or updating an existing instance.

        :param kwargs: a dictionary of parameters
        """
        kwargs.pop("csrf_token", None)
        return kwargs

    def save(self, model):
        """Commits the model to the database and returns the model

        :param model: the model to save
        """
        self._isinstance(model)
        db.session.add(model)
        db.session.commit()
        return model

    def update(self, model, **kwargs):
        """Returns an updated instance of the base model class.

        :param model: the model to update
        :param ``**kwargs``: update parameters
        """
        self._isinstance(model)
        for k, v in self._preprocess_params(kwargs).items():
            setattr(model, k, v)
        db.session.commit()
        return model

    def all(self):
        """Returns a generator containing all instances of the base model."""
        return self.__class__.query.all()

    def get_by_id(self, id):
        """Returns an instance of the base model with the specified id. Returns `None` if an
        instance with the specified id does not exist.

        :param id: the instance id
        """
        return self.__class__.query.get(id)

    def get_all(self, *ids):
        """Returns a list of instances of the base model with the specified ids.

        :param `*ids`: instance ids
        """
        return self.__class__.query.filter(self.__class__.id.in_(ids)).all()

    def find(self, **kwargs):
        """Returns a list of instances of the base model filtered by the specified key word arguments.

        :param ``**kwargs``: filter parameters
        """
        return self.__class__.query.filter_by(**kwargs)

    def first(self, **kwargs):
        """Returns the first instance found of the base model filtered by the specified
        key word arguments.

        :param ``**kwargs``: filter parameters
        """
        return self.find(**kwargs).first()

    def get_or_404(self, id):
        """Returns an instance of the base model with the specified id or raises an 404 error
        if an instance with the specified id does not exist.

        :param id: the instance id
        """
        return self.__class__.query.get_or_404(id)

    def new(self, **kwargs):
        """Returns a new, unsaved instance of the base model class.

        :param ``**kwargs``: instance parameters
        """
        return self.__class__(**self._preprocess_params(kwargs))

    def create(self, **kwargs):
        """Returns a new, saved instance of the base model class.

        :param ``**kwargs``: instance parameters
        """
        return self.save(self.new(**kwargs))

    def delete(self, model):
        """Immediately deletes the specified model instance.

        :param model: the model instance to delete
        """
        self._isinstance(model)
        db.session.delete(model)
        db.session.commit()

    def to_dict(self, *args, **kwargs):
        """returns a dict of all model attributes.
        excludes primary_key and foreign_keys

        :param d: an empty dictionary
        """
        d = dict(
            (c.name, getattr(self, c.name)) for c in self.__table__.columns if not c.primary_key and not c.foreign_keys
        )
        d["type"] = self.__class__.__name__
        return d

class Status(Enum):
    """Status class, extends `enum`. Simple enumerable of submission statuses.

    Attributes:
        NEW (int): submission status is new
        INREVIEW (int): submission status is in-review
        SCHEDULED (int): submission status is scheduled
        ARCHIVED (int): submission status is archived
    """

    NEW = 1
    INREVIEW = 2
    SCHEDULED = 3
    ARCHIVED = 4

class Submission(Base):
    """Submission class

    Stores a talk submission and it's Trello card's identifiers

    Attributes:
        email    (str): email of the submitter
        card_id  (str): the Trello Card ID
        card_url (str): the Trello Card URL
        status   (int): the submission status, Int maps to the Status enum class.
        hook     (str): the ID for the Trello Card's webhook

    Todo:
        * Should store name of talk, though if we change on Trello it should update via webhook
    """

    title = Column(db.String(255), nullable=False)
    email = Column(db.String(255), nullable=False)
    card_id = Column(db.String(255), nullable=False, unique=True)
    card_url = Column(db.String(255), nullable=False, unique=True)
    status = Column(db.Integer, nullable=False, default=Status.NEW.value)
    hook = Column(db.String(255))
    card_email = Column(db.String(255))

class TrelloList(Base):
    """Trello List class

    Maps a trello list by symbolic name to its ID on this particular Trello board

    Attributes:
        email    (str): email of the submitter
        card_id  (str): the Trello Card ID
        card_url (str): the Trello Card URL
        status   (int): the submission status, Int maps to the Status enum class.
        hook     (str): the ID for the Trello Card's webhook

    Todo:
        * Should store name of talk, though if we change on Trello it should update via webhook
    """

    list_symbolic_name = Column(db.String(255), nullable=False, unique=True)
    list_id = Column(db.String(255), nullable=False, unique=True)


text:
"use babel";

import * as React from "react";
import quickFixing from "./quick-fixing";

export default {
  create(
    { jsx, filePath, regionRange, type },
    fixesForRange,
    editor,
    highlightRegionRangeFunction,
    lowlightRegionRangeFunction,
    getFunctionsMatchingTypeFunction,
    showFunctionsMatchingTypeFunction,
    addImportAsFunction
  ) {
    class IssueView extends React.PureComponent {
      render() {
        // return (
        //

        //       highlightRegionRangeFunction(filePath, regionRange, type)}
        //     onMouseLeave={e => lowlightRegionRangeFunction()}
        //   >
        //
{jsx}

        //

        // );
        const fixesView = fixesForRange
          ? fixesForRange.fixes.map(fix => {
              return (
                <button
                  className="linter-elm-make-quick-fix-button"
                  onClick={e => {
                    const prevActivePane = atom.workspace.getActivePane();
                    quickFixing.fixProblem(
                      editor,
                      fixesForRange.range,
                      fix,
                      getFunctionsMatchingTypeFunction,
                      showFunctionsMatchingTypeFunction,
                      addImportAsFunction
                    );
                    prevActivePane.activate();
                  }}
                >

                  {fix.type + ": "}
                  {fix.text}
                </button>
              );
            })
          : "";
        return (

              {jsx}

{fixesView}

        );
      }
    }
    return IssueView;
  }
};


text:
<?php

namespace Leaphub\Flow\Model;

use Leaphub\Flow\Exception\FlowException;

/**
 * A flow is a collection of jobs to be executed in a defined order
 */
class Flow implements FlowInterface
{
    /**
     * @var string $id
     */
    private $id;

    /**
     * @var JobInterface[] $jobs
     */
    private $jobs = array();

    /**
     * @param string $id A unique identifier for the flow
     */
    public function  __construct($id)
    {
        $this->id = $id;
    }

    /**
     * {@inheritdoc}
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * {@inheritdoc}
     */
    public function hasJob(JobInterface $job)
    {
        return $this->getJobById($job->getId()) !== null;
    }

    /**
     * {@inheritdoc}
     */
    public function addJob(JobInterface $job)
    {
        if (isset($this->jobs[$job->getId()])) {
            throw new FlowException(sprintf('The flow "%s" already contains a job with id "%s"', $this->getId(), $job->getId()));
        }

        $job->setFlow($this);
        $this->jobs[$job->getId()] = $job;
    }

    /**
     * {@inheritdoc}
     */
    public function getJobById($jobId)
    {
        if (isset($this->jobs[$jobId])) {
            return $this->jobs[$jobId];
        }

        return null;
    }

    /**
     * {@inheritdoc}
     */
    public function getJobs()
    {
        return $this->jobs;
    }

    /**
     * {@inheritdoc}
     */
    public function getJobCount()
    {
        return count($this->jobs);
    }
}


text:
<?php
namespace Df\Framework\Form\Element;
/**
 * 2016-05-30
 * @final Unable to use the PHP «final» keyword here because of the M2 code generation.
 * @used-by https://github.com/mage2pro/2checkout/blob/1.4.5/etc/adminhtml/system.xml#L318
 * @used-by https://github.com/mage2pro/checkout.com/blob/1.3.11/etc/adminhtml/system.xml#L165
 * @used-by https://github.com/mage2pro/dragonpay/blob/1.1.0/etc/adminhtml/system.xml#L115
 * @used-by https://github.com/mage2pro/omise/blob/1.8.8/etc/adminhtml/system.xml#L205
 * @used-by https://github.com/mage2pro/paymill/blob/1.4.6/etc/adminhtml/system.xml#L190
 * @used-by https://github.com/mage2pro/postfinance/blob/1.0.5/etc/adminhtml/system.xml#L208
 * @used-by https://github.com/mage2pro/qiwi/blob/1.0.0/etc/adminhtml/system.xml#L109
 * @used-by https://github.com/mage2pro/robokassa/blob/0.0.2/etc/adminhtml/system.xml#L163
 * @used-by https://github.com/mage2pro/square/blob/1.1.7/etc/adminhtml/system.xml#L189
 * @used-by https://github.com/mage2pro/stripe/blob/1.9.11/etc/adminhtml/system.xml#L154
 * @used-by https://github.com/mage2pro/yandex-kassa/blob/0.0.6/etc/adminhtml/system.xml#L99
 * @used-by https://github.com/mage2pro/yandex-kassa/blob/0.0.6/etc/adminhtml/system.xml#L112
 */
class Webhook extends Url {
	/**
	 * 2016-05-31
	 * @override
	 * @see \Df\Framework\Form\Element\Url::messageForThirdPartyLocalhost()
	 * @used-by \Df\Framework\Form\Element\Url::getElementHtml()
	 */
	final protected function messageForThirdPartyLocalhost():string {return
		'The notifications are not available, because the store is running on <b>localhost</b>'
	;}
}


text:
.. _formatcablecell:

Arbor Cable Cell
================

.. csv-table::
   :header: "Name", "File extension", "Read", "Write"

   "Arbor Cable Cell", "``acc``", "✓", "✓"

We define an s-expression format for describing :ref:`cable cells <cablecell>`.
Cable cells are constructed from three components: a :ref:`label dictionary <labels>`,
a :ref:`decoration object <cablecell-decoration>` and a :ref:`morphology <morph>`.
The cable cell *format* is constructed in the same way.

.. Note::

   Extra line breaks and indentations in the s-expressions presented below have been
   added for clarity. They are not a requirement of the format and will be treated as
   whitespace.

Label dictionary
----------------

The label dictionary stores :term:`region` and :term:`locset` s-expressions with
associated labels which can then be used to refer to the region or locset when
decorating the cable cell.

Arbor provides many useful :ref:`region expressions <labels-region-expr>` and
:ref:`locset expressions <labels-locset-expr>` which are explained in detail at the
provided links.

The components of the label dictionary are the following:

.. label:: (region-def label:string reg:region)

   This defines a ``label`` which can be used to refer to the region ``reg``.
   For example:

   .. code:: lisp

      (region-def "my_region" (branch 1))

   This expression identifies the branch with id 1 as "my_region".

.. label:: (locset-def label:string ls:locset)

   This defines a ``label`` which can be used to refer to the locset ``ls``.
   For example:

   .. code:: lisp

      (locset-def "my_locset" (location 3 0.5))

   This expression identifies the midpoint of the branch with id 3 as "my_locset".

Any number of locset and region definitions can be grouped in a label dictionary as follows:

.. label:: (label-dict [...def:region-def/locset-def])

   This describes a label dictionary of zero or more region and locset definitons.
   For example:

   .. code:: lisp

      (label-dict
        (region-def "my_soma" (tag 1))
        (locset-def "root" (root))
        (region-def "all" (all))
        (region-def "my_region" (radius-ge (region "my_soma") 1.5))
        (locset-def "terminal" (terminal)))

Decor
-----

The decor of a cable cell describes the dynamics and properties of the cell which can be assigned on
:term:`regions <region>` or :term:`locsets <locset>`, or set as defaults on the entire cell.

This table lists all supported dynamics and properties and whether they are *placeable* (i.e. they can
be placed on one or more locations on the cell described by a locset); *paintable* (i.e. they can be set
on an entire area of the cell described by a region) or *defaultable* (i.e. they are the default settings
of the cell):

.. csv-table:: Property applicability.
   :widths: 20, 10, 10, 10

                             ,         **placeable**, **paintable**, **defaultable**
   initial membrane potential,         --,             ✓,             ✓
   axial resistivity,                  --,             ✓,             ✓
   temperature,                        --,             ✓,             ✓
   membrane capacitance,               --,             ✓,             ✓
   ion initial internal concentration, --,             ✓,             ✓
   ion initial external concentration, --,             ✓,             ✓
   ion initial reversal potential,     --,             ✓,             ✓
   ion reversal potential method,      --,            --,             ✓
   density mechanism,                  --,             ✓,            --
   point mechanism,                    ✓,             --,            --
   junction mechanism,                 ✓,             --,            --
   current clamp,                      ✓,             --,            --
   threshold detector,                 ✓,             --,            --

The various properties and dynamics of the decor are described as follows:

.. label:: (membrane-potential val:real)

   This describes an *initial membrane potential* object with value ``val`` (unit mV).

.. label:: (axial-resistivity val:real)

   This describes an *axial resistivity* object with value ``val`` (unit Ω·cm).

.. label:: (temperature-kelvin val:real)

   This describes a *temperature* object with value ``val`` (unit K).

.. label:: (membrane-capacitance val:real)

   This describes a *membrane capacitance* object with value ``val`` (unit F/m²).

.. label:: (ion-internal-concentration ion:string val:real)

   This describes an *initial internal concentration* object for ion ``ion`` with value ``val`` (unit mM).

.. label:: (ion-external-concentration ion:string val:real)

   This describes an *initial external concentration* object for ion ``ion`` with value ``val`` (unit mM).

.. label:: (ion-reversal-potential ion:string val:real)

   This describes an *initial reversal potential* object for ion ``ion`` with value ``val`` (unit mV).

.. label:: (mechanism name:string [...(param:string val:real)])

   This describes a (point or density) mechanism object of the mechanism called ``name``. This expression
   accepts zero or more ``(param:string val:real)`` expressions. Each of these expressions sets the value of
   parameter ``param`` to ``val``.
   For example:

   .. code:: lisp

      (mechanism "hh" ("gl" 0.5) ("el" 2))

   This expression creates an "hh" mechanism and sets the "gl" and "el" parameters of the mechanism to 0.5
   and 2 respectively (units depend on the :ref:`nmodl <formatnmodl>` mechanism).

.. label:: (ion-reversal-potential-method ion:string method:mechanism)

   This creates a *reversal potential method* (able to modify the reversal potential) of ion ``ion`` from
   mechanism ``method``.
   For example:

   .. code:: lisp

      (ion-reversal-potential-method "ca" (mechanism "nernst/ca"))

.. label:: (density method:mechanism)

   This describes a *density* mechanism whose behavior is is defined by ``mechanism``.

.. label:: (synapse method:mechanism)

   This describes a *synapse* (point) mechanism whose behavior is is defined by ``mechanism``.

.. label:: (junction method:mechanism)

   This describes a *gap-junction* mechanism whose behavior is is defined by ``mechanism``.

.. label:: (current-clamp (envelope-pulse delay:real duration:real amplitude:real) freq:real phase:real)

   This creates a *current clamp*. If the frequency ``freq`` (unit kHz) is zero, the current is a square
   pulse with amplitude ``amplitude`` (unit nA) starting at ``delay`` (unit ms) and lasting for ``duration``
   (unit ms). If ``freq`` is non-zero, the current is sinusoidal with amplitude ``amplitude`` and frequency
   ``freq`` from time ``delay`` and lasting for ``duration``, with phase ``phase`` (unit rad) at time zero.
   (More information about current clamps can be found :ref:`here <cablecell-stimuli>`).

.. label:: (current-clamp [...(envelope time:real amplitude:real)] freq:real phase:real)

   This creates a *current clamp* with an amplitude governed by the given envelopes (``time`` unit ms and
   ``amplitude`` unit nA). A frequency ``freq`` (unit kHz) of zero implies that the generated current simply
   follows the envelope. A non-zero ``freq`` implies the current is sinusoidal with that frequency and amplitude
   that varies according to the envelope. The ``phase`` (unit rad) is the phase of the sinusoidal current
   clamp at time zero. (More information about current clamps can be found :ref:`here <cablecell-stimuli>`).
   For example:

   .. code::

      (current-clamp (envelope (0 10) (50 10) (50 0)) 0.04 0.15)

   This expression describes a sinusoidal current with amplitude 10 nA and frequency 40 Hz and that lasts
   from t = 0 ms to t = 50 ms, finally leaving the current at 0 nA (final amplitude in the envelope).

.. label:: (threshold-detector val:real).

   This describes a *threshold-detector* object with value ``val`` (unit mV).

*Paintable* and *placeable* properties and dynamics are placed on regions (generated from :ref:`region expressions
<labels-region-expr>`) and locsets (generated from :ref:`locset expressions <labels-locset-expr>`) respectively.
*Defaultable* properties and dynamics apply to an entire cell.

.. label:: (paint reg:region prop:paintable)

   This applies the painatble property ``prop`` to region ``reg``.
   For example:

   .. code:: lisp

      (paint (tag 1) (membrane-capacitance 0.02))

   This expression sets the membrane capacitance of the region tagged ``1`` to 0.02 F/m².

.. label:: (place ls:locset prop:placeable label:string)

   This places the property ``prop`` on locset ``ls`` and labels the group of items on the
   locset with ``label``. For example:

   .. code:: lisp

      (place (locset "mylocset") (threshold-detector 10) "mydetectors")

   This expression places 10 mV threshold detectors on the locset labeled ``mylocset``,
   and labels the detectors "mydetectors". The definition of ``mylocset`` should be provided
   in a label dictionary associated with the decor.

   The number of detectors placed depends on the number of locations in the "mylocset" locset.
   The placed detectors can be referred to (in the recipe for example) using the label
   "mydetectors".

.. label:: (default prop:defaultable)

   This sets the property ``prop`` as default for the entire cell. (This default property can be overridden on region
   using a ``paint`` expression).
   For example:

   .. code:: lisp

      (default (membrane-potential -65))

   This expression sets the default membrane potential of the cell to -65 mV.

Any number of paint, place and default expressions can be used to create a decor as follows:

.. label:: (decor [...def:paint/place/default])

   This describes a decor object with zero or more paint, place or default expressions in any order.
   For example:

   .. code:: lisp

      (decor
        (default (membrane-potential -55.000000))
        (paint (region "custom") (temperature-kelvin 270))
        (paint (region "soma") (membrane-potential -50.000000))
        (paint (all) (density (mechanism "pas")))
        (paint (tag 4) (density (mechanism "Ih" ("gbar" 0.001))))
        (place (locset "root") (synapse (mechanism "expsyn")) "root_synapse")
        (place (terminal) (junction (mechanism "gj")) "terminal_gj"))

Morphology
----------

The morphology of a cable cell can be described in terms of points, tagged segments and branches.

.. label:: (point x:real y:real z:real radius:real)

   This describes a 3D *point* in space with ``x``, ``y``, and ``z`` coordinates and a radius ``r`` (unit µm).

.. label:: (segment id:int prox:point dist:point tag:int)

   This describes a tapered segment from point ``prox`` to point ``dist`` with a tag ``tag`` and id ``id``.
   For example:

   .. code:: lisp

      (segment 3 (point 0 0 0 5) (point 0 0 10 2) 1)

   This expression creates a segment with id 3, with a radius that tapers linearly from 5 to 2 µm, which has a
   a tag of 1.

.. label:: (branch id:int parent_id:int seg:segment [...seg:segment])

   This describes a branch with a given ``id`` which has as a parent the branch with id ``parent_id`` (a
   ``parent_id`` equal to -1 means the branch is at the root of the morphology). The branch is composed of 1 or
   more contiguous segments ``seg``.

.. label:: (morphology [...b:branch])

   This creates the morphology from a set of branches. There exists more than one valid s-expression to
   describe the same morphology.

   For example, the shown morphology can be represented using the following s-expression. If we change
   any of the branch or segment ids, we would obtain an identical morphology.

   .. figure:: ../gen-images/label_morph.svg
     :width: 600
     :align: center

     On the left the morphology visualized using its segments, on the right using its branches.
     Python code to generate this cable cell is in the :class:`segment_tree<arbor.segment_tree>`
     documentation :ref:`here <morph-label-seg-code>`.

   .. code:: lisp

      (morphology
        (branch 0 -1
          (segment 0 (point 0 0 0 2) (point 4 0 0 2) 1)
          (segment 1 (point 4 0 0 0.8) (point 8 0 0 0.8) 3)
          (segment 2 (point 8 0 0 0.8) (point 12 -0.5 0 0.8) 3))
        (branch 1 0
          (segment 3 (point 12 -0.5 0 0.8) (point 20 4 0 0.4) 3)
          (segment 4 (point 20 4 0 0.4) (point 26 6 0 0.2) 3))
        (branch 2 0
          (segment 5 (point 12 -0.5 0 0.5) (point 19 -3 0 0.5) 3))
        (branch 3 2
          (segment 6 (point 19 -3 0 0.5) (point 24 -7 0 0.2) 3))
        (branch 4 2
          (segment 7 (point 19 -3 0 0.5) (point 23 -1 0 0.2) 3)
          (segment 8 (point 23 -1 0 0.3) (point 26 -2 0 0.2) 3))
        (branch 5 -1
          (segment 9 (point 0 0 0 2) (point -7 0 0 0.4) 2)
          (segment 10 (point -7 0 0 0.4) (point -10 0 0 0.4) 2)))

Cable cell
----------

The entire cable-cell can then be constructed given the 3 previously described component
expressions.

.. label:: (cable-cell morph:morphology dec:decor dict:label-dict)

   The arguments of the cable-cell can be in any order, as long as all 3 components are listed.
   For example:

   .. code:: lisp

      (cable-cell
        (label-dict
          (region-def "my_soma" (tag 1))
          (locset-def "root" (root))
          (region-def "all" (all))
          (region-def "my_region" (radius-ge (region "my_soma") 1.5))
          (locset-def "terminal" (terminal)))
        (decor
          (default (membrane-potential -55.000000))
          (paint (region "my_soma") (temperature-kelvin 270))
          (paint (region "my_region") (membrane-potential -50.000000))
          (paint (tag 4) (density (mechanism "Ih" ("gbar" 0.001))))
          (place (locset "root") (synapse (mechanism "expsyn")) "root_synapse")
          (place (location 1 0.2) (junction (mechanism "gj")) "terminal_gj"))
        (morphology
          (branch 0 -1
            (segment 0 (point 0 0 0 2) (point 4 0 0 2) 1)
            (segment 1 (point 4 0 0 0.8) (point 8 0 0 0.8) 3)
            (segment 2 (point 8 0 0 0.8) (point 12 -0.5 0 0.8) 3))
          (branch 1 0
            (segment 3 (point 12 -0.5 0 0.8) (point 20 4 0 0.4) 3)
            (segment 4 (point 20 4 0 0.4) (point 26 6 0 0.2) 3))
          (branch 2 0
            (segment 5 (point 12 -0.5 0 0.5) (point 19 -3 0 0.5) 3))
          (branch 3 2
            (segment 6 (point 19 -3 0 0.5) (point 24 -7 0 0.2) 3))
          (branch 4 2
            (segment 7 (point 19 -3 0 0.5) (point 23 -1 0 0.2) 3)
            (segment 8 (point 23 -1 0 0.3) (point 26 -2 0 0.2) 3))
          (branch 5 -1
            (segment 9 (point 0 0 0 2) (point -7 0 0 0.4) 2)
            (segment 10 (point -7 0 0 0.4) (point -10 0 0 0.4) 2))))

   This expression uses the *label-dictionary* in the *decoration* specification
   to get the descriptions of regions and locsets specified using labels.
   The *decor* is then applied on the provided *morphology*, creating a cable cell.

Parsable arbor-components and meta-data
---------------------------------------

The formats described above can be used to generate a :ref:`label dictionary <labels>`,
:ref:`decoration <cablecell-decoration>`, :ref:`morphology <morph>`, or :ref:`cable cell <cablecell>`
object. These are denoted as arbor-components. Arbor-components need to be accompanied by *meta-data*
specifying the version of the format being used. The only version currently supported is ``0.1-dev``.

.. label:: (version val:string)

   Specifies that the version of the component description format is ``val``.

.. label:: (meta-data v:version)

   Add the version information ``v`` to the meta-data of the described component.

.. label:: (arbor-component data:meta-data comp:decor/label-dict/morphology/cable-cell)

   Associates the component ``comp`` with meta-data ``data``.

The final form of each arbor-component looks as follows:

Label-dict
^^^^^^^^^^

.. code:: lisp

   (arbor-component
     (meta-data (version "0.1-dev"))
     (label-dict
       (region-def "my_soma" (tag 1))
       (locset-def "root" (root))))

Decoration
^^^^^^^^^^

.. code:: lisp

   (arbor-component
     (meta-data (version "0.1-dev"))
     (decor
       (default (membrane-potential -55.000000))
       (place (locset "root") (synapse (mechanism "expsyn")) "root_synapse")
       (paint (region "my_soma") (temperature-kelvin 270))))

Morphology
^^^^^^^^^^

.. code:: lisp

   (arbor-component
     (meta-data (version "0.1-dev"))
     (morphology
        (branch 0 -1
          (segment 0 (point 0 0 0 2) (point 4 0 0 2) 1)
          (segment 1 (point 4 0 0 0.8) (point 8 0 0 0.8) 3)
          (segment 2 (point 8 0 0 0.8) (point 12 -0.5 0 0.8) 3))))

Cable-cell
^^^^^^^^^^

.. code:: lisp

   (arbor-component
     (meta-data (version "0.1-dev"))
     (cable-cell
       (label-dict
         (region-def "my_soma" (tag 1))
         (locset-def "root" (root)))
       (decor
         (default (membrane-potential -55.000000))
         (place (locset "root") (synapse (mechanism "expsyn")) "root_synapse")
         (paint (region "my_soma") (temperature-kelvin 270)))
       (morphology
          (branch 0 -1
            (segment 0 (point 0 0 0 2) (point 4 0 0 2) 1)
            (segment 1 (point 4 0 0 0.8) (point 8 0 0 0.8) 3)
            (segment 2 (point 8 0 0 0.8) (point 12 -0.5 0 0.8) 3)))))

API
---

* :ref:`Python <pycablecellformat>`
* :ref:`C++ <cppcablecellformat>`


text:
require 'sinatra/base'
require 'split'
require 'bigdecimal'
require 'split/wimdu_dashboard/helpers'
require 'split_wimdu_dashboard/version'

module Split
  class WimduDashboard < Sinatra::Base
    include SplitWimduDashboard

    dir = File.dirname(File.expand_path(__FILE__))

    set :views,  "#{dir}/wimdu_dashboard/views"
    set :public_folder, "#{dir}/wimdu_dashboard/public"
    set :static, true
    set :method_override, true

    helpers Split::WimduDashboardHelpers
    get '/' do
      # Display experiments without a winner at the top of the dashboard
      @experiments = Split::Experiment.all_active_first

      @metrics = Split::Metric.all

      # Display Rails Environment mode (or Rack version if not using Rails)
      if Object.const_defined?('Rails')
        @current_env = Rails.env.titlecase
      else
        @current_env = "Rack: #{Rack.version}"
      end
      erb :index
    end

    post '/:experiment' do
      @experiment = Split::Experiment.find(params[:experiment])
      @alternative = Split::Alternative.new(params[:alternative], params[:experiment])
      @experiment.winner = @alternative.name
      redirect url('/')
    end

    post '/start/:experiment' do
      @experiment = Split::Experiment.find(params[:experiment])
      @experiment.start
      redirect url('/')
    end

    post '/reset/:experiment' do
      @experiment = Split::Experiment.find(params[:experiment])
      @experiment.reset
      redirect url('/')
    end

    post '/reopen/:experiment' do
      @experiment = Split::Experiment.find(params[:experiment])
      @experiment.reset_winner
      redirect url('/')
    end

    delete '/:experiment' do
      @experiment = Split::Experiment.find(params[:experiment])
      @experiment.delete
      redirect url('/')
    end

    after do
      ::SplitWimduDashboard.configuration.reporter.call(env)
    end
  end
end


text:
## 143. Reorder List [M]
Given a singly linked list L: `L0→L1→…→Ln-1→Ln`,
reorder it to: `L0→Ln→L1→Ln-1→L2→Ln-2→…`

You must do this in-place without altering the nodes' values.

For example,
Given `{1,2,3,4}`, reorder it to `{1,4,2,3}`.

## Code:
- Solution 2 - using length to divid the list, which is a stupid way (68 ms):
```c++
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution
{
    // date: 2016-08-18     location Santa Clara City Library
public:
    void reorderList(ListNode* head)
    {
        if (!head)  return ;
        int length = 0;
        ListNode* temp = head, *slow_head = head, *fast_head, *temp_fast, *temp_slow;
        // step 1, break the list to 2 parts.
        while (temp)
        {
            temp = temp -> next;
            length ++;
        }
        int half_length = length / 2;
        for (int i = 0; i < half_length; i ++)
            slow_head = slow_head -> next;
        // step 2, reverse the 2nd part.
        fast_head = reverse(slow_head -> next);
        slow_head -> next = nullptr;
        slow_head = head;
        // step 3, meger 2 parts one by one
        while (fast_head)
        {
            temp_fast = fast_head -> next;
            temp_slow = slow_head -> next;
            slow_head -> next = fast_head;
            fast_head -> next = temp_slow;
            fast_head = temp_fast;
            slow_head = temp_slow;
        }
    }

    ListNode* reverse(ListNode* node)
    {
        if (!node)  return nullptr;
        ListNode* prev = node, *curr = node -> next, *temp;
        node -> next = nullptr;
        while (prev && curr)
        {
            temp = curr -> next;
            curr -> next = prev;
            prev = curr;
            curr = temp;
        }
        return prev;
    }
};
```

- Solution 2 - using the slow and fast pointer to divid the list (64 ms)
```c++
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution
{
    // date: 2016-08-18     location Santa Clara City Library
public:
    void reorderList(ListNode* head)
    {
        if (!head)  return ;
        ListNode* temp = head, *slow_head = head, *fast_head = head, *temp_fast, *temp_slow;
        // step 1, divide the list to 2 parts.
        while (fast_head && fast_head -> next)
        {
            slow_head = slow_head -> next;
            fast_head = fast_head -> next -> next;
        }
        // step 2, reverse the 2nd part.
        fast_head = reverse(slow_head -> next);
        slow_head -> next = nullptr;
        slow_head = head;
        // step 3, meger 2 parts one by one
        while (fast_head)
        {
            temp_fast = fast_head -> next;
            temp_slow = slow_head -> next;
            slow_head -> next = fast_head;
            fast_head -> next = temp_slow;
            fast_head = temp_fast;
            slow_head = temp_slow;
        }
    }

    ListNode* reverse(ListNode* node)
    {
        if (!node)  return nullptr;
        ListNode* prev = node, *curr = node -> next, *temp;
        node -> next = nullptr;
        while (prev && curr)
        {
            temp = curr -> next;
            curr -> next = prev;
            prev = curr;
            curr = temp;
        }
        return prev;
    }
};
```


text:
from asposeemail import Settings
from com.aspose.email import PersonalStorage
from com.aspose.email import FileFormatVersion
from com.aspose.email import StandardIpmFolder

class AddFileToPST:

    def __init__(self):

        dataDir = Settings.dataDir + 'ProgrammingOutlook/WorkingWithOutlookPersonalStorage/AddFileToPST/'

        personalStorage=PersonalStorage()
        fileFormatVersion=FileFormatVersion
        pst = personalStorage.create(dataDir + "AddFile1.pst", fileFormatVersion.Unicode)

        standardIpmFolder=StandardIpmFolder
        fi = pst.createPredefinedFolder("Inbox", standardIpmFolder.Inbox)

        fi.addFile(dataDir + "Report.xlsx", "IPM.Document.Excel.Sheet.8")

        pst.dispose()

        print "Added file to PST"

if __name__ == '__main__':
    AddFileToPST()


text:
package io.spine.server.storage.jdbc.query;

/**
 * A marker interface for an SQL query.
 */
public interface StorageQuery {
}


text:
/* Regular Expressions */

module.exports = {

  sitePages: /^(guide|middleware)\.html$/

}


text:
package org.monospark.spongematchers.type.sponge;

import java.util.Map;

import org.monospark.spongematchers.matcher.sponge.DimensionMatcher;
import org.monospark.spongematchers.type.MatcherType;
import org.spongepowered.api.world.Dimension;

public final class DimensionType extends SpongeObjectType<Dimension> {

    public DimensionType() {
        super("dimension", Dimension.class, m -> DimensionMatcher.create(m));
    }

    @Override
    protected MatcherType<Map<String, Object>> createType() {
        return MatcherType.fixedMap()
                .addEntry("name", MatcherType.STRING)
                .addEntry("respawnAllowed", MatcherType.BOOLEAN)
                .addEntry("waterEvaporating", MatcherType.BOOLEAN)
                .addEntry("sky", MatcherType.BOOLEAN)
                .addEntry("height", MatcherType.INTEGER)
                .addEntry("buildHeight", MatcherType.INTEGER)
                .build();
    }
}


text:
'use strict';

var marked  = require('marked');
var getHTML = require('./htmlSnippets');

function Paragraph($el) {
  if(!$el) console.error('Please supply a jquery element to attatch to.');

  this.$el = $el;

  this.bind();

  this.unparsed = '';
  this.parsed   = '';

  this.focused = false;
}

Paragraph.prototype.bind = function() {
  var self = this;

  this.$el
    .focus(function onParagraphFocus() {

      self.focused = true;

      var isntJustWhitespace = (self.unparsed.trim().length !== 0);

      if(isntJustWhitespace)self.$el.text(self.unparsed);

    })
    .blur(function onParagraphBlur() {

      self.focused = false;

      self.$el.html( $(self.parsed).html() );

    });
};

Paragraph.prototype.rebind = function($el) {
  this.$el = $el;
  this.bind();
};

// Updates internal strings and rerenders based on markdown input
Paragraph.prototype.update = function(str) {
  // Store caret position
  var caretPos = this.$el.caret();
  var $newEl;
  var elementExists;

  this.unparsed = str;
  this.parsed = marked(str);

  elementExists = this.parsed.match(/\S/);

  if(elementExists) {

    $newEl = $(this.parsed);

    $newEl.attr('contenteditable', true);

  } else {
    // It's empty, so reset
    $newEl = $( getHTML('new-paragraph') );
  }

  this.$el.replaceWith($newEl);
  this.rebind($newEl);

  this.$el.focus();

  if(this.$el.text().length >= caretPos) this.$el.caret(caretPos);

};

// String slice alias
Paragraph.prototype.slice = function(a, b) {
  var stringToSlice = this.focused ? this.unparsed : this.parsed;

  if(b) {
    this.update(
      stringToSlice.slice(a, b)
    );
  } else {
    this.update(
      stringToSlice.slice(a)
    );
  }

};

// Convenience JQuery alias
Paragraph.prototype.focus = function() {
  this.$el.focus();
};

module.exports = Paragraph;


text:
namespace MetX.Fimm.Setup;

public class GenGenActor : FimmActorBase
{
    public GenGenActor()
    {

    }

    public GenGenActor(ArgumentVerb verb, ArgumentNoun noun) : base(verb, noun)
    {
    }

    public override ProcessorResult Run(ArgumentSettings settings)
    {
        throw new System.NotImplementedException();
    }
}


text:
from nipype.testing import assert_equal
from nipype.interfaces.io import SelectFiles

def test_SelectFiles_inputs():
    input_map = dict(base_directory=dict(),
    force_lists=dict(usedefault=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    raise_on_empty=dict(usedefault=True,
    ),
    sort_filelist=dict(usedefault=True,
    ),
    )
    inputs = SelectFiles.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value

def test_SelectFiles_outputs():
    output_map = dict()
    outputs = SelectFiles.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value


text:
<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you 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.
  -->

<!--
   Example cluster definition that can be used with falcon and standalone
   hadoop and oozie instances
-->
<cluster colo="local" description="Standalone cluster" name="local" xmlns="uri:falcon:cluster:0.1">
    <interfaces>
        <interface type="readonly" endpoint="hdfs://localhost:8020" version="1.1.2"/>

        <interface type="write" endpoint="hdfs://localhost:8020" version="1.1.2"/>

        <interface type="execute" endpoint="localhost:8021" version="1.1.2"/>

        <interface type="workflow" endpoint="http://localhost:11000/oozie/" version="4.0.0"/>

        <interface type="messaging" endpoint="tcp://localhost:61616?daemon=true"  version="5.4.3"/>
    </interfaces>
    <locations>
        <location name="staging" path="/projects/falcon/staging"/>
        <location name="temp" path="/projects/falcon/tmp"/>
        <location name="working" path="/projects/falcon/working"/>
    </locations>
    <properties>
    </properties>
</cluster>


text:
module Fakturan
  class Account < Base
    uri 'accounts/(:id)'
    has_many :users, uri: nil
    belongs_to :setting, uri: nil

    attributes :api_token

    accepts_nested_attributes_for :users, :setting

    def users=(attrs_or_obj_array)
      if attrs_or_obj_array.first.respond_to?(:each)
        send(:users_attributes=, attrs_or_obj_array)
      else
        super
      end
    end

    def setting=(attrs_or_obj)
      if attrs_or_obj.respond_to?(:each)
        send(:setting_attributes=, attrs_or_obj)
      else
        super
      end
    end
  end
end


text:
.. release-test documentation master file, created by
   sphinx-quickstart on Tue Jul  9 22:26:36 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to release-test's documentation!
========================================================

Contents:

.. toctree::
   :maxdepth: 2

   readme
   installation
   usage

For Contributors
================

* If you are a new contributor to release-test please refer: :doc:`contributor/contributing`

  .. toctree::
     :hidden:

     contributor/contributing

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

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


text:
package com.itjh.doushi.UI.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.text.TextUtils;
import android.view.View;

import com.itjh.doushi.DouShiApplication;
import com.itjh.doushi.R;
import com.itjh.doushi.UI.DetailActivity;
import com.itjh.doushi.UI.base.BaseActivity;
import com.itjh.doushi.UI.base.BaseFragment;
import com.itjh.doushi.adapter.HotVideoAdapter;
import com.itjh.doushi.adapter.base.BaseQuickAdapter;
import com.itjh.doushi.pojo.VideoEntity;
import com.malinskiy.superrecyclerview.OnMoreListener;
import com.malinskiy.superrecyclerview.SuperRecyclerView;
import com.orhanobut.logger.Logger;
import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration;

import java.util.List;

import butterknife.Bind;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class HotFragment extends BaseFragment implements OnMoreListener, BaseQuickAdapter.OnItemClickListener<VideoEntity> {

    private String videoType = "0";

    @Bind(R.id.fragment_list_rv)
    SuperRecyclerView recyclerView;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        videoType = getArguments().getString("videoType");
    }

    private HotVideoAdapter mAdapter;
//    private BaseQuickAdapter mAdapter;

    @Override
    public int layoutID() {
        return R.layout.fragment;
    }

    @Override
    public void init(View view) {
        recyclerView.setOnMoreListener(this);

        GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 2);
        recyclerView.setLayoutManager(gridLayoutManager);

        Logger.e(videoType);
        DouShiApplication.getRestClient().getVideoService().listRepos("0", "20", videoType, "0").subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread()).subscribe(videoListResponse -> {
            Logger.i(videoListResponse.toString());
            mAdapter.appendToList(arrangeData(videoListResponse.content));
        }, throwable -> {
            Logger.e(throwable.getMessage());
        });

        mAdapter = new HotVideoAdapter();

//                new BaseQuickAdapter<VideoEntity, BaseAdapterHelper>(getActivity(), R.layout.list_item) {
//            @Override
//            protected void convert(BaseAdapterHelper helper, VideoEntity item) {
//                helper.getTextView(R.id.tv_video_list_title).setText(item.title);
//                SimpleDraweeView simpleDraweeView = (SimpleDraweeView) helper.getView(R.id.my_image_view);
//                simpleDraweeView.setAspectRatio(1f);
////                LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) simpleDraweeView.getLayoutParams();
//////                layoutParams.height = (gridLayoutManager.getWidth() - ScreenUtils.dip2px(getContext(), 16)) / 2;
////                layoutParams.height =  helper.getView(R.id.rl_list_bottom_bg).getWidth();
////                simpleDraweeView.setLayoutParams(layoutParams);
//                simpleDraweeView.setImageURI(Uri.parse(item.pic));
//            }
//        };
//        mAdapter.setOnItemClickListener(this);
        recyclerView.setAdapter(mAdapter);

        recyclerView.addItemDecoration(new StickyRecyclerHeadersDecoration(mAdapter));
    }

    @Override
    public void onMoreAsked(int overallItemsCount, int itemsBeforeMore, int maxLastVisiblePosition) {
        DouShiApplication.getRestClient().getVideoService().listRepos(((VideoEntity) mAdapter.getItem(mAdapter.getItemCount() - 1)).id, "20", videoType, "0").subscribeOn(Schedulers.newThread())
                .observeOn(AndroidSchedulers.mainThread()).subscribe(videoListResponse -> {
            Logger.i(videoListResponse.toString());
            mAdapter.appendToList(arrangeData(videoListResponse.content));
        }, throwable -> {
            Logger.e(throwable.getMessage());
        });
    }

    @Override
    public void onClick(View v) {

    }

    String timep;

    private List<VideoEntity> arrangeData(List<VideoEntity> entities) {
        for (int i = 0; i < entities.size(); i++) {
            VideoEntity now = entities.get(i);
            VideoEntity next = null;
            if (i + 1 < entities.size())
                next = entities.get(i + 1);

            if (now != null && next != null && now.pushTime.startsWith("2016") && next.pushTime.startsWith("2016") && !TextUtils.equals(now.pushTime, next.pushTime) && i % 3 != 2) {
                if (i % 3 == 0) {
                    entities.add(i + 1, new VideoEntity(now.title, now.pic, now.pushTime, true));
                    entities.add(i + 2, new VideoEntity(now.title, now.pic, now.pushTime, true));
                } else if (i % 3 == 1) {
                    entities.add(i + 1, new VideoEntity(now.title, now.pic, now.pushTime, true));
                }
            }

        }
        return entities;

    }

    @Override
    public void onItemClick(View view, int position, VideoEntity object) {
//        ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
//                getActivity(), view, DetailActivity.EXTRA_IMAGE);
//        ActivityCompat.startActivity(getActivity(), new Intent(getContext(), DetailActivity.class),
//                options.toBundle());

        DetailActivity.navigate((BaseActivity) getActivity(), view.findViewById(R.id.my_image_view), object);
//        startActivity(new Intent(view.getContext(), TestActivity.class));
    }
}


text:
.. _azure_distributed_tracing:

Distributed Tracing in Azure
=========================================

This chapter describes how to perform distributed tracing on Azure.

.. _how_to_enable_distributed_tracing:

How to perform distributed tracing on Azure
--------------------------------------------------------------------------------------------------

  In Azure, distributed tracing is done using ``Azure Application Insights``.

  * `Distributed tracing in Azure Application Insights (external site) <https://docs.microsoft.com/en-us/azure/azure-monitor/app/distributed-tracing>`_

  A mechanism for enabling distributed tracing from Java applications is provided by using a Java agent (**Java 3.0 agent**).

  * `Azure Monitor Application Insights monitoring Java code-free applications (external site) <https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in- process-agent>`_

  .. important::
    The Java 3.0 agent loads a large number of jar files during the initialization process.
    This may cause frequent GC during the initialization process of the Java 3.0 agent.

    Therefore, note that the performance may temporarily deteriorate due to GC for a while after the application is launched.

    Also, under heavy load, the overhead caused by the processing of the Java 3.0 agent may affect the performance.
    Therefore, you should confirm the performance in the performance test with the Java 3.0 agent as in production.

  The following is an example of using the archetype for containers.

  First, download the agent from the official website of `Azure <https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent#quickstart>`_.
  Then, create an arbitrary directory under ``src/main/jib`` and store the agent.

  Next, place ``applicationinsights.json`` in the directory where you have just stored the agent.
  The ``connectionString`` is a connection string containing the instrumentation key that will be issued after the Azure Application Insights resource is created.
  For other configuration options, see the `Guide <https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config>`_.

  * applicationinsights.json

  .. code-block:: json

    {
      "connectionString": "InstrumentationKey=XXXXX"
    }

  Finally, add the environment variable ``CATALINA_OPTS`` to ``jib-maven-plugin`` in ``pom.xml``.
  (In the example, we specify ``applicationinsights-agent-3.0.2.jar``, which is located directly under the ``applicationInsights`` directory.

  * pom.xml

  .. code-block:: xml

    <! -- Docker containerization -->
    <plugin>
        <groupId>com.google.cloud.tools</groupId>
        <artifactId>jib-maven-plugin</artifactId>
        <configuration>
            <container>
                <appRoot>/usr/local/tomcat/webapps/ROOT</appRoot>
                <ports>
                    <port>8080</port>
                </ports>
                <environment>
                    <CATALINA_OPTS>-javaagent:/applicationInsights/applicationinsights-agent-3.0.2.jar</CATALINA_OPTS>
                </environment>
            </container>
        </configuration>
    </plugin>

Now you can use ``Azure Application Insights`` for distributed tracing by building with Jib.

For detailed configuration instructions, see the `Azure documentation <https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent#quickstart>`_.


text:
package com.framework.nio.net;

import java.io.Serializable;

public class Message implements Serializable  {
    private static final long serialVersionUID = 4842567358256189675L;
    private byte[] content;
    private int type;

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}


text:
<!DOCTYPE html>
<html>

  {% include head.html %}

    <body id="page-top" class="index">

    {% include header.html %}
    {% include dynamika.html %}
    {% include workflow.html %}
    {% include livedemo.html %}
    {% include contact.html %}
    {% include team.html %}
    {% include footer.html %}
    {% include modals.html %}
    {% include js.html %}

    </body>
</html>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Symb. bot. upsal. 20(no. 1): 269 (1972)

#### Original name
Sphaeria carbonaria Plowr., 1874

### Remarks
null


text:
function addBitmapGraphic(myFigure,myArg)

%% Powerpoint connecting

% Connect to PowerPoint
ppt = actxserver('PowerPoint.Application');

% Open current presentation
if get(ppt.Presentations,'Count') == 0
    op = invoke(ppt.Presentations,'Add');
else
    op = get(ppt,'ActivePresentation');
end

% Get information about the presentation

myArg.myPresentationHeight = op.PageSetup.SlideHeight; %in px
myArg.myPresentationWidth  = op.PageSetup.SlideWidth; %in px

% Set slide object to be the active pane
wind = get(ppt,'ActiveWindow');
panes = get(wind,'Panes');
slide_pane = invoke(panes,'Item',2);
invoke(slide_pane,'Activate');

% % Identify current slide
% try
%     currSlide = wind.Selection.SlideRange.SlideNumber;
% catch %#ok<CTCH>
%     % No slides
% end
%
% % Select the slide to which the figure will be exported
% slide_count = int32(get(op.Slides,'Count'));
% if strcmpi(myArg.defaultSlideNumber,'append')
%     slide = invoke(op.Slides,'Add',slide_count+1,11);
%     shapes = get(slide,'Shapes');
%     invoke(slide,'Select');
%     invoke(shapes.Range,'Delete');
% else
%     if strcmpi(myArg.defaultSlideNumber,'last')
%         slideNum = slide_count;
%     elseif strcmpi(myArg.defaultSlideNumber,'current');
%         slideNum = get(wind.Selection.SlideRange,'SlideNumber');
%     else
%         slideNum = myArg.defaultSlideNumber;
%     end
%     slide = op.Slides.Item(slideNum);
%     invoke(slide,'Select');
% end

[slide,~] = translateSlideNumberInformation2Slide(myArg,ppt,op,1);

%% Saveing the picture temporally

exportMode = myArg.defaultExportMode;%'matlab:emf';

exportFormatType = myArg.defaultExportFormatType;

imagePath = '';

exportModeDefined = 0;

if strcmp(exportMode,'exportFig')
    if strcmp(myArg.externalParameters,'')
        try
            export_fig(myFigure,[pwd '\pptfig.tif'],'-transparent',['-m',num2str(myArg.defaultMagnify)]);
            imageinfo = imfinfo([pwd '\pptfig.tif']);
            imagePath = [pwd '\pptfig.tif'];
        catch
            export_fig(myFigure,'.\pptfig.tif','-transparent',['-m',num2str(myArg.defaultMagnify)]);
            imageinfo = imfinfo('.\pptfig.tif');
            imagePath = '.\pptfig.tif';
        end

    else
        try
            export_fig(myFigure,[pwd '\pptfig.tif'],'-transparent',['-m',num2str(myArg.defaultMagnify)],myArg.externalParameters{1:length(myArg.externalParameters)});
            imageinfo = imfinfo([pwd '\pptfig.tif']);
            imagePath = [pwd '\pptfig.tif'];
        catch
            export_fig(myFigure,'.\pptfig.tif','-transparent',['-m',num2str(myArg.defaultMagnify)],myArg.externalParameters{1:length(myArg.externalParameters)});
            imageinfo = imfinfo('.\pptfig.tif');
            imagePath = '.\pptfig.tif';
        end

    end

    myArg.objectHeight = imageinfo.Height;
    myArg.objectWidth  = imageinfo.Width;
    exportModeDefined = 1;
end

doClipboardExport = 0;

if strcmp(exportMode,'matlab')

        [isAllowedFormat,indexAllowedFormat] = ismember(exportFormatType,myArg.allowedExportFormatType);

        if strcmp(exportFormatType,'clipboard')
            doClipboardExport = 1;
            exportModeDefined = 1;
        end

        if isAllowedFormat && ~doClipboardExport

            choosenExportFormat = myArg.allowedExportFormatType{indexAllowedFormat};
            choosenExportExt    = myArg.allowedExportFormatTypeExt{indexAllowedFormat};

            pathImage = fullfile(pwd, ['pptfig',choosenExportExt]);
            print(myFigure, ['-d',choosenExportFormat], pathImage);

            imagePath = pathImage;

            pixelPos = getpixelposition(myFigure);

            myArg.objectHeight = pixelPos(4);
            myArg.objectWidth  = pixelPos(3);

            exportModeDefined = 1;

        end

        if ~exportModeDefined
            warning('No valid exportFormatType defined.');
        end

end

if ~exportModeDefined
    warning('No valid exportMode defined: Use "matlab" or "exportFig".');
end

if doClipboardExport

     pixelPos = getpixelposition(myFigure);
     hgexport(myFigure,'-clipboard');

     myArg.objectHeight = pixelPos(4);
     myArg.objectWidth  = pixelPos(3);

end

% end

% if doClip
%
%     pixelPos = getpixelposition(myFigure);
%     hgexport(myFigure,'-clipboard');
%
%     myArg.objectHeight = pixelPos(4);
%     myArg.objectWidth  = pixelPos(3);
%
% end

%% Calculate position parameters%%%

postioningParameters = getPosParameters(myArg);

width  = postioningParameters.width;
height = postioningParameters.height;
top    = postioningParameters.top;
left   = postioningParameters.left;

%% Invoke into powerpoint
if ~doClipboardExport
    img = invoke(slide.Shapes,'AddPicture',imagePath,'msoFalse','msoTrue',left,top,width,height);
    invoke(img,'ZOrder','msoSendToBack');

    %% Clean up imagepath
    if myArg.cleanUpTempImages
        try
            delete(imagePath);
        catch
            warning('Cleaning up temp data failed.');
        end
    end

else
    img = invoke(slide.Shapes,'PasteSpecial');
    lastIndex = slide.Shapes.Range.Count;

    if lastIndex>10000
        slide.Shapes.Range(lastIndex).Top    = top;
        slide.Shapes.Range(lastIndex).Width  = width;
        slide.Shapes.Range(lastIndex).Height = height;
        slide.Shapes.Range(lastIndex).Left   = left;
    elseif lastIndex > 0;
        slide.Shapes.Range.Top    = top;
        slide.Shapes.Range.Width  = width;
        slide.Shapes.Range.Height = height;
        slide.Shapes.Range.Left   = left;
    end
end
% if doClip
%
% %     imgShape = invoke(slide.Shapes,'AddShape','msoShapeRectangle',...
% %     left,top,width,height);
%
%     img = invoke(slide.Shapes,'PasteSpecial');% DataType:=3 ' 3 = ppPasteMetafilePicture
%     img.Width = width;
%
%     set(img,'Width',width);
% end

% for ii=1:slide.Shapes.Count
%
%     ppShp = slide.Shapes.Shape(ii);
%
%     try
%              ppShp.Top = 100;
%              ppShp.Left = 5;
%              ppShp.Height = 100;
%              ppShp.Width = 100;
%              display(num2str(ii));
%     catch
%         display('error');
%     end
%
% end

end


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

<title>org.sesela.commons.validator クラス階層 (Validator API)</title>
<meta name="date" content="2017-02-26">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

ブラウザのJavaScriptが無効になっています。

ナビゲーション・リンクをスキップ

概要

パッケージ

クラス

階層ツリー

非推奨

索引

ヘルプ

前

次

フレーム

フレームなし

すべてのクラス

パッケージorg.sesela.commons.validatorの階層

パッケージ階層:

すべてのパッケージ

注釈型階層

org.sesela.commons.validator.CreditCardFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.DoubleMaxFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.LongMinFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.DoubleRangeFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.FloatFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.LongFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.IntFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.DoubleMinFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.PatternFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.DateFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.EmailFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.LongRangeFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.DoubleFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.LongMaxFormat (implements java.lang.annotation.Annotation)

org.sesela.commons.validator.UrlFormat (implements java.lang.annotation.Annotation)

ナビゲーション・リンクをスキップ

概要

パッケージ

クラス

階層ツリー

非推奨

索引

ヘルプ

前

次

フレーム

フレームなし

すべてのクラス


text:
App.ListController = Ember.ObjectController.extend({
  actions : {
  	removeList : function() {
        var list = this.get( 'model' );

        list.deleteRecord();
        list.save();
  	},
  	createCard : function() {
        var list = this.get( 'model' ),
            card;

        card = this.store.createRecord( 'card', {
        	description: this.get( 'cardDescription' ),
        	list : list
        });

        card.save().then(function(){
        	var cards = list.get( 'cards' );
        	cards.then( function(){
        		cards.pushObject( card );
        		list.save();
        	})
        });

        this.set( 'cardDescription', '');
  	},
  }
});