text:
//
//   Copyright 2016  Cityzen Data
//
//   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.
//

package io.warp10.script.functions;

import java.math.BigDecimal;

import io.warp10.DoubleUtils;
import io.warp10.continuum.gts.GTSHelper;
import io.warp10.continuum.gts.GeoTimeSerie;
import io.warp10.continuum.gts.GeoTimeSerie.TYPE;
import io.warp10.script.NamedWarpScriptFunction;
import io.warp10.script.WarpScriptStackFunction;
import io.warp10.script.WarpScriptException;
import io.warp10.script.WarpScriptStack;

/**
 * Perform Dynamic Time Warping distance computation
 * between values of two GTS.
 *
 */
public class DTW extends NamedWarpScriptFunction implements WarpScriptStackFunction {

  /**
   * Should we normalize?
   */
  private final boolean normalize;

  /**
   * Should we do Z-Normalization or 0-1 normalization?
   */
  private final boolean znormalize;

  public DTW(String name, boolean normalize, boolean znormalize) {
    super(name);
    this.normalize = normalize;
    this.znormalize = znormalize;
  }

  @Override
  public Object apply(WarpScriptStack stack) throws WarpScriptException {
    Object o = stack.pop();

    if (!(o instanceof Number)) {
      throw new WarpScriptException(getName() + " expects a numeric threshold on top of the stack.");
    }

    double threshold = ((Number) o).doubleValue();

    o = stack.pop();

    if (!(o instanceof GeoTimeSerie)) {
      throw new WarpScriptException(getName() + " expects two Geo Time Series below the threshold.");
    }

    GeoTimeSerie gts1 = (GeoTimeSerie) o;

    o = stack.pop();

    if (!(o instanceof GeoTimeSerie)) {
      throw new WarpScriptException(getName() + " expects two Geo Time Series below the threshold.");
    }

    GeoTimeSerie gts2 = (GeoTimeSerie) o;

    stack.push(compute(gts1,gts2,threshold));

    return stack;
  }

  /**
   * Compute Dynamic Time Warping on two GTS, aborting if the threshold is exceeded
   *
   * @param gts1 First GTS
   * @param gts2 Second GTS
   * @param threshold Threshold used to abort, use 0.0D if you don't want to abort the DTW
   * @return The computed DTW distance or -1 if the threshold is exceeded
   *
   * @throws WarpScriptException If an error occurs
   */
  public final double compute(GeoTimeSerie gts1, GeoTimeSerie gts2, double threshold) throws WarpScriptException {

    //
    // Check that the type of the GTS is numerical
    //

    if (TYPE.LONG != gts1.getType() && TYPE.DOUBLE != gts1.getType()) {
      throw new WarpScriptException(getName() + " can only operate on numerical Geo Time Series.");
    }

    if (TYPE.LONG != gts2.getType() && TYPE.DOUBLE != gts2.getType()) {
      throw new WarpScriptException(getName() + " can only operate on numerical Geo Time Series.");
    }

    //
    // Sort GTS in chronological order
    //

    GTSHelper.sort(gts1);
    GTSHelper.sort(gts2);

    //
    // Extract values, compute min/max and quantize values (x - max/(max - min))
    //

    double[] values1 = GTSHelper.getValuesAsDouble(gts1);
    double[] values2 = GTSHelper.getValuesAsDouble(gts2);

    if (this.normalize) {
      if (this.znormalize) {
        //
        // Perform Z-Normalization of values1 and values2
        //

        double[] musigma = DoubleUtils.musigma(values1, true);

        for (int i = 0; i < values1.length; i++) {
          values1[i] = (values1[i] - musigma[0]) / musigma[1];
        }

        musigma = DoubleUtils.muvar(values2);
        for (int i = 0; i < values2.length; i++) {
          values2[i] = (values2[i] - musigma[0]) / musigma[1];
        }
      } else {
        double min = Double.POSITIVE_INFINITY;
        double max = Double.NEGATIVE_INFINITY;

        for (int i = 0; i < values1.length; i++) {
          if (values1[i] < min) {
            min = values1[i];
          }
          if (values1[i] > max) {
            max = values1[i];
          }
        }

        if (min == max) {
          throw new WarpScriptException(getName() + " cannot (yet) operate on constant GTS.");
        }

        double range = max - min;

        for (int i = 0; i < values1.length; i++) {
          values1[i] = (values1[i] - min) / range;
        }

        min = Double.POSITIVE_INFINITY;
        max = Double.NEGATIVE_INFINITY;

        for (int i = 0; i < values2.length; i++) {
          if (values2[i] < min) {
            min = values2[i];
          }
          if (values2[i] > max) {
            max = values2[i];
          }
        }

        if (min == max) {
          throw new WarpScriptException(getName() + " cannot (yet) operate on constant GTS.");
        }

        range = max - min;

        for (int i = 0; i < values2.length; i++) {
          values2[i] = (values2[i] - min) / range;
        }
      }
    }

    return compute(values1, 0, values1.length, values2, 0, values2.length, threshold);
  }

  public double compute(double[] values1, int offset1, int len1, double[] values2, int offset2, int len2, double threshold) {
    return compute(values1, offset1, len1, values2, offset2, len2, threshold, true);
  }

  public double compute(double[] values1, int offset1, int len1, double[] values2, int offset2, int len2, double threshold, boolean manhattan) {
    //
    // Make sure value1 is the shortest array
    //

    if (len1 > len2) {
      double[] tmp = values1;
      values1 = values2;
      values2 = tmp;
      int tmpint = offset1;
      offset1 = offset2;
      offset2 = tmpint;
      tmpint = len1;
      len1 = len2;
      len2 = tmpint;
    }

    //
    // Now run DTW.
    // We allocate two columns so we can run DTW, only allocating
    //

    double[] a = new double[len1];
    double[] b = new double[len1];

    int w = values2.length;

    boolean belowThreshold = false;

    for (int i = 0; i < len2; i++) {
      int start = Math.max(0, i - w);
      int end = Math.min(len1 - 1, i + w);

      belowThreshold = false;

      for (int j = start; j <= end; j++) {

        //
        // Compute distance.
        // DTW simply considers the delta in values, not the delta in indices
        //

        double d = manhattan ? Math.abs(values1[offset1 + j] - values2[offset2 + i]) : Math.pow(values1[offset1 + j] - values2[offset2 + i], 2.0D);

        //
        // Extract surrounding values
        //

        double left = a[j];
        double bottom = j > start ? b[j - 1] : Double.POSITIVE_INFINITY;
        double sw = j > start ? a[j - 1] : Double.POSITIVE_INFINITY;

        b[j] = d + Math.min(left, Math.min(bottom, sw));
        //System.out.println(i + " " + j + " " + d + " " + left + " " + bottom + " " + sw + " >>> " + b[j]);

        if (!belowThreshold && (0.0D == threshold || b[j] <= threshold)) {
          belowThreshold = true;
        }
      }

      // Exit if no value is below threshold
      if (!belowThreshold) {
        break;
      }

      // Shift b into a
      double[] tmp = a;
      a = b;
      b = tmp;
    }

    if (!belowThreshold) {
      return -1.0D;
    }

    double dtwDist = Double.POSITIVE_INFINITY;

    for (int i = 0; i < a.length; i++) {
      if (a[i] < dtwDist) {
        dtwDist = a[i];
      }
    }

    if (!manhattan) {
      dtwDist = Math.sqrt(dtwDist);
    }

    return dtwDist;
  }
}


text:
from django.conf.urls import url
from . import views

urlpatterns = [

   # tipos de formacion complementaria

    url(r'^crear-tipo-formacion-complementaria/',
        views.TipoFormacionComplementariaCreateView.as_view(),
        name='crear_tipo_formacion_complementaria'),

    url(r'^editar-tipo-formacion-complementaria/(?P<pk>\d+)/',
        views.TipoFormacionComplementariaUpdateView.as_view(),
        name='editar_tipo_formacion_complementaria'),

    url(r'^lista-tipos-formacion-complementaria/',
        views.TipoFormacionComplementariaListView.as_view(),
        name='lista_tipos_formacion_complementaria'),

    # grados de escolaridad

    url(r'^crear-grado-escolaridad/',
        views.GradoEscolaridadCreateView.as_view(),
        name='crear_grado_escolaridad'),

    url(r'^editar-grado-escolaridad/(?P<pk>\d+)/',
        views.GradoEscolaridadUpdateView.as_view(),
        name='editar_grado_escolaridad'
        ),

    url(r'^lista-grados-escolaridad/',
        views.GradoEscolaridadListView.as_view(),
        name='lista_grados_escolaridad'),

    # titulos de grado

    url(r'^crear-titulo-grado/',
        views.TituloGradoCreateView.as_view(),
        name='crear_titulo_grado'),

    url(r'^editar-titulo-grado/(?P<pk>\d+)/',
        views.TituloGradoUpdateView.as_view(),
        name='editar_titulo_grado'),

    url(r'^lista-titulos-grado/',
        views.TituloGradoListView.as_view(),
        name='lista_titulos_grado'),

    # tipos de manzana

    url(r'^crear-tipo-manzana/',
        views.TipoManzanaCreateView.as_view(),
        name='crear_tipo_manzana'),

    url(r'^editar-tipo-manzana/(?P<pk>\d+)/',
        views.TipoManzanaUpdateView.as_view(),
        name='editar_tipo_manzana'),

    url(r'^lista-tipos-manzana/',
        views.TipoManzanaListView.as_view(),
        name='lista_tipos_manzana'),

    # tipos de vivienda

    url(r'^crear-tipo-vivienda/',
        views.TipoViviendaCreateView.as_view(),
        name='crear_tipo_vivienda'),

    url(r'^editar-tipo-vivienda/(?P<pk>\d+)/',
        views.TipoViviendaUpdateView.as_view(),
        name='editar_tipo_vivienda'),

    url(r'^lista-tipos-vivienda/',
        views.TipoViviendaListView.as_view(),
        name='lista_tipos_vivienda'),

    # manzanas

    url(r'^crear-manzana/',
        views.ManzanaCreateView.as_view(),
        name='crear_manzana'),

    url(r'^editar-manzana/(?P<pk>\d+)/',
        views.ManzanaUpdateView.as_view(),
        name='editar_manzana'),

    url(r'^lista-manzanas/',
        views.ManzanaListView.as_view(),
        name='lista_manzanas'),

    # casas

    url(r'^crear-casa/',
        views.CasaCreateView.as_view(),
        name='crear_casa'),

    url(r'^editar-casa/(?P<pk>\d+)/',
            views.CasaUpdateView.as_view(),
        name='editar_casa'),

    url(r'^lista-casas/',
        views.CasaListView.as_view(),
        name='lista_casas'),

    # personas

    url(r'^crear-persona/',
        views.crear_persona,
        name='crear_persona'),

    url(r'^editar-persona/(?P<pk>\d+)/',
        views.editar_persona,
        name='editar_persona'),

    url(r'^lista-personas/',
        views.PersonasListView.as_view(),
        name='lista_personas'),

    url(r'^detalle-persona/(?P<pk>\d+)/',
        views.PersonaDetailView.as_view(),
        name='detalle_persona'),

]

redpajama_set_name: RedPajamaGithub


text:
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Trippit.Models.ApiModels
{
    public class ApiStopAtDistanceConnection
    {
        [JsonProperty("edges")]
        public List<ApiStopAtDistanceEdge> Edges { get; set; }
        /// <summary>
        /// Non-nullable.
        /// </summary>
        [JsonProperty("pageInfo")]
        public ApiPageInfo PageInfo { get; set; }
    }
}


text:
import json
from datetime import datetime
from enum import Enum
from typing import Any, Dict, Hashable, List, Optional, Set, Type, Union

from flask_appbuilder.security.sqla.models import User
from sqlalchemy import and_, Boolean, Column, Integer, String, Text
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import foreign, Query, relationship, RelationshipProperty, Session

from superset import is_feature_enabled, security_manager
from superset.constants import NULL_STRING
from superset.models.helpers import AuditMixinNullable, ImportExportMixin, QueryResult
from superset.models.slice import Slice
from superset.typing import FilterValue, FilterValues, QueryObjectDict
from superset.utils import core as utils
from superset.utils.core import GenericDataType

METRIC_FORM_DATA_PARAMS = [
    "metric",
    "metric_2",
    "metrics",
    "metrics_b",
    "percent_metrics",
    "secondary_metric",
    "size",
    "timeseries_limit_metric",
    "x",
    "y",
]

COLUMN_FORM_DATA_PARAMS = [
    "all_columns",
    "all_columns_x",
    "columns",
    "entity",
    "groupby",
    "order_by_cols",
    "series",
]

class DatasourceKind(str, Enum):
    VIRTUAL = "virtual"
    PHYSICAL = "physical"

class BaseDatasource(
    AuditMixinNullable, ImportExportMixin
):  # pylint: disable=too-many-public-methods
    """A common interface to objects that are queryable
    (tables and datasources)"""

    # ---------------------------------------------------------------
    # class attributes to define when deriving BaseDatasource
    # ---------------------------------------------------------------
    __tablename__: Optional[str] = None  # {connector_name}_datasource
    baselink: Optional[str] = None  # url portion pointing to ModelView endpoint

    @property
    def column_class(self) -> Type["BaseColumn"]:
        # link to derivative of BaseColumn
        raise NotImplementedError()

    @property
    def metric_class(self) -> Type["BaseMetric"]:
        # link to derivative of BaseMetric
        raise NotImplementedError()

    owner_class: Optional[User] = None

    # Used to do code highlighting when displaying the query in the UI
    query_language: Optional[str] = None

    # Only some datasources support Row Level Security
    is_rls_supported: bool = False

    @property
    def name(self) -> str:
        # can be a Column or a property pointing to one
        raise NotImplementedError()

    # ---------------------------------------------------------------

    # Columns
    id = Column(Integer, primary_key=True)
    description = Column(Text)
    default_endpoint = Column(Text)
    is_featured = Column(Boolean, default=False)  # TODO deprecating
    filter_select_enabled = Column(Boolean, default=is_feature_enabled("UX_BETA"))
    offset = Column(Integer, default=0)
    cache_timeout = Column(Integer)
    params = Column(String(1000))
    perm = Column(String(1000))
    schema_perm = Column(String(1000))

    sql: Optional[str] = None
    owners: List[User]
    update_from_object_fields: List[str]

    @property
    def kind(self) -> DatasourceKind:
        return DatasourceKind.VIRTUAL if self.sql else DatasourceKind.PHYSICAL

    @property
    def is_virtual(self) -> bool:
        return self.kind == DatasourceKind.VIRTUAL

    @declared_attr
    def slices(self) -> RelationshipProperty:
        return relationship(
            "Slice",
            primaryjoin=lambda: and_(
                foreign(Slice.datasource_id) == self.id,
                foreign(Slice.datasource_type) == self.type,
            ),
        )

    columns: List["BaseColumn"] = []
    metrics: List["BaseMetric"] = []

    @property
    def type(self) -> str:
        raise NotImplementedError()

    @property
    def uid(self) -> str:
        """Unique id across datasource types"""
        return f"{self.id}__{self.type}"

    @property
    def column_names(self) -> List[str]:
        return sorted([c.column_name for c in self.columns], key=lambda x: x or "")

    @property
    def columns_types(self) -> Dict[str, str]:
        return {c.column_name: c.type for c in self.columns}

    @property
    def main_dttm_col(self) -> str:
        return "timestamp"

    @property
    def datasource_name(self) -> str:
        raise NotImplementedError()

    @property
    def connection(self) -> Optional[str]:
        """String representing the context of the Datasource"""
        return None

    @property
    def schema(self) -> Optional[str]:
        """String representing the schema of the Datasource (if it applies)"""
        return None

    @property
    def filterable_column_names(self) -> List[str]:
        return sorted([c.column_name for c in self.columns if c.filterable])

    @property
    def dttm_cols(self) -> List[str]:
        return []

    @property
    def url(self) -> str:
        return "/{}/edit/{}".format(self.baselink, self.id)

    @property
    def explore_url(self) -> str:
        if self.default_endpoint:
            return self.default_endpoint
        return f"/superset/explore/{self.type}/{self.id}/"

    @property
    def column_formats(self) -> Dict[str, Optional[str]]:
        return {m.metric_name: m.d3format for m in self.metrics if m.d3format}

    def add_missing_metrics(self, metrics: List["BaseMetric"]) -> None:
        existing_metrics = {m.metric_name for m in self.metrics}
        for metric in metrics:
            if metric.metric_name not in existing_metrics:
                metric.table_id = self.id
                self.metrics.append(metric)

    @property
    def short_data(self) -> Dict[str, Any]:
        """Data representation of the datasource sent to the frontend"""
        return {
            "edit_url": self.url,
            "id": self.id,
            "uid": self.uid,
            "schema": self.schema,
            "name": self.name,
            "type": self.type,
            "connection": self.connection,
            "creator": str(self.created_by),
        }

    @property
    def select_star(self) -> Optional[str]:
        pass

    @property
    def data(self) -> Dict[str, Any]:
        """Data representation of the datasource sent to the frontend"""
        order_by_choices = []
        # self.column_names return sorted column_names
        for column_name in self.column_names:
            column_name = str(column_name or "")
            order_by_choices.append(
                (json.dumps([column_name, True]), column_name + " [asc]")
            )
            order_by_choices.append(
                (json.dumps([column_name, False]), column_name + " [desc]")
            )

        verbose_map = {"__timestamp": "Time"}
        verbose_map.update(
            {o.metric_name: o.verbose_name or o.metric_name for o in self.metrics}
        )
        verbose_map.update(
            {o.column_name: o.verbose_name or o.column_name for o in self.columns}
        )
        return {
            # simple fields
            "id": self.id,
            "uid": self.uid,
            "column_formats": self.column_formats,
            "description": self.description,
            "database": self.database.data,  # pylint: disable=no-member
            "default_endpoint": self.default_endpoint,
            "filter_select": self.filter_select_enabled,  # TODO deprecate
            "filter_select_enabled": self.filter_select_enabled,
            "name": self.name,
            "datasource_name": self.datasource_name,
            "table_name": self.datasource_name,
            "type": self.type,
            "schema": self.schema,
            "offset": self.offset,
            "cache_timeout": self.cache_timeout,
            "params": self.params,
            "perm": self.perm,
            "edit_url": self.url,
            # sqla-specific
            "sql": self.sql,
            # one to many
            "columns": [o.data for o in self.columns],
            "metrics": [o.data for o in self.metrics],
            # TODO deprecate, move logic to JS
            "order_by_choices": order_by_choices,
            "owners": [owner.id for owner in self.owners],
            "verbose_map": verbose_map,
            "select_star": self.select_star,
        }

    def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
        """
        The representation of the datasource containing only the required data
        to render the provided slices.

        Used to reduce the payload when loading a dashboard.
        """
        data = self.data
        metric_names = set()
        column_names = set()
        for slc in slices:
            form_data = slc.form_data
            # pull out all required metrics from the form_data
            for metric_param in METRIC_FORM_DATA_PARAMS:
                for metric in utils.get_iterable(form_data.get(metric_param) or []):
                    metric_names.add(utils.get_metric_name(metric))
                    if utils.is_adhoc_metric(metric):
                        column_names.add(
                            (metric.get("column") or {}).get("column_name")
                        )

            # Columns used in query filters
            column_names.update(
                filter_["subject"]
                for filter_ in form_data.get("adhoc_filters") or []
                if filter_.get("clause") == "WHERE" and filter_.get("subject")
            )

            # columns used by Filter Box
            column_names.update(
                filter_config["column"]
                for filter_config in form_data.get("filter_configs") or []
                if "column" in filter_config
            )

            column_names.update(
                column
                for column_param in COLUMN_FORM_DATA_PARAMS
                for column in utils.get_iterable(form_data.get(column_param) or [])
            )

        filtered_metrics = [
            metric
            for metric in data["metrics"]
            if metric["metric_name"] in metric_names
        ]

        filtered_columns: List[Column] = []
        column_types: Set[GenericDataType] = set()
        for column in data["columns"]:
            generic_type = column.get("type_generic")
            if generic_type is not None:
                column_types.add(generic_type)
            if column["column_name"] in column_names:
                filtered_columns.append(column)

        data["column_types"] = list(column_types)
        del data["description"]
        data.update({"metrics": filtered_metrics})
        data.update({"columns": filtered_columns})
        verbose_map = {"__timestamp": "Time"}
        verbose_map.update(
            {
                metric["metric_name"]: metric["verbose_name"] or metric["metric_name"]
                for metric in filtered_metrics
            }
        )
        verbose_map.update(
            {
                column["column_name"]: column["verbose_name"] or column["column_name"]
                for column in filtered_columns
            }
        )
        data["verbose_map"] = verbose_map

        return data

    @staticmethod
    def filter_values_handler(
        values: Optional[FilterValues],
        target_column_type: utils.GenericDataType,
        is_list_target: bool = False,
    ) -> Optional[FilterValues]:
        if values is None:
            return None

        def handle_single_value(value: Optional[FilterValue]) -> Optional[FilterValue]:
            # backward compatibility with previous <select> components
            if (
                isinstance(value, (float, int))
                and target_column_type == utils.GenericDataType.TEMPORAL
            ):
                return datetime.utcfromtimestamp(value / 1000)
            if isinstance(value, str):
                value = value.strip("\t\n'\"")

                if target_column_type == utils.GenericDataType.NUMERIC:
                    # For backwards compatibility and edge cases
                    # where a column data type might have changed
                    return utils.cast_to_num(value)
                if value == NULL_STRING:
                    return None
                if value == "<empty string>":
                    return ""
            if target_column_type == utils.GenericDataType.BOOLEAN:
                return utils.cast_to_boolean(value)
            return value

        if isinstance(values, (list, tuple)):
            values = [handle_single_value(v) for v in values]  # type: ignore
        else:
            values = handle_single_value(values)
        if is_list_target and not isinstance(values, (tuple, list)):
            values = [values]  # type: ignore
        elif not is_list_target and isinstance(values, (tuple, list)):
            values = values[0] if values else None
        return values

    def external_metadata(self) -> List[Dict[str, str]]:
        """Returns column information from the external system"""
        raise NotImplementedError()

    def get_query_str(self, query_obj: QueryObjectDict) -> str:
        """Returns a query as a string

        This is used to be displayed to the user so that she/he can
        understand what is taking place behind the scene"""
        raise NotImplementedError()

    def query(self, query_obj: QueryObjectDict) -> QueryResult:
        """Executes the query and returns a dataframe

        query_obj is a dictionary representing Superset's query interface.
        Should return a ``superset.models.helpers.QueryResult``
        """
        raise NotImplementedError()

    def values_for_column(self, column_name: str, limit: int = 10000) -> List[Any]:
        """Given a column, returns an iterable of distinct values

        This is used to populate the dropdown showing a list of
        values in filters in the explore view"""
        raise NotImplementedError()

    @staticmethod
    def default_query(qry: Query) -> Query:
        return qry

    def get_column(self, column_name: Optional[str]) -> Optional["BaseColumn"]:
        if not column_name:
            return None
        for col in self.columns:
            if col.column_name == column_name:
                return col
        return None

    @staticmethod
    def get_fk_many_from_list(
        object_list: List[Any],
        fkmany: List[Column],
        fkmany_class: Type[Union["BaseColumn", "BaseMetric"]],
        key_attr: str,
    ) -> List[Column]:
        """Update ORM one-to-many list from object list

        Used for syncing metrics and columns using the same code"""

        object_dict = {o.get(key_attr): o for o in object_list}

        # delete fks that have been removed
        fkmany = [o for o in fkmany if getattr(o, key_attr) in object_dict]

        # sync existing fks
        for fk in fkmany:
            obj = object_dict.get(getattr(fk, key_attr))
            if obj:
                for attr in fkmany_class.update_from_object_fields:
                    setattr(fk, attr, obj.get(attr))

        # create new fks
        new_fks = []
        orm_keys = [getattr(o, key_attr) for o in fkmany]
        for obj in object_list:
            key = obj.get(key_attr)
            if key not in orm_keys:
                del obj["id"]
                orm_kwargs = {}
                for k in obj:
                    if k in fkmany_class.update_from_object_fields and k in obj:
                        orm_kwargs[k] = obj[k]
                new_obj = fkmany_class(**orm_kwargs)
                new_fks.append(new_obj)
        fkmany += new_fks
        return fkmany

    def update_from_object(self, obj: Dict[str, Any]) -> None:
        """Update datasource from a data structure

        The UI's table editor crafts a complex data structure that
        contains most of the datasource's properties as well as
        an array of metrics and columns objects. This method
        receives the object from the UI and syncs the datasource to
        match it. Since the fields are different for the different
        connectors, the implementation uses ``update_from_object_fields``
        which can be defined for each connector and
        defines which fields should be synced"""
        for attr in self.update_from_object_fields:
            setattr(self, attr, obj.get(attr))

        self.owners = obj.get("owners", [])

        # Syncing metrics
        metrics = (
            self.get_fk_many_from_list(
                obj["metrics"], self.metrics, self.metric_class, "metric_name"
            )
            if self.metric_class and "metrics" in obj
            else []
        )
        self.metrics = metrics

        # Syncing columns
        self.columns = (
            self.get_fk_many_from_list(
                obj["columns"], self.columns, self.column_class, "column_name"
            )
            if self.column_class and "columns" in obj
            else []
        )

    def get_extra_cache_keys(  # pylint: disable=no-self-use
        self, query_obj: QueryObjectDict  # pylint: disable=unused-argument
    ) -> List[Hashable]:
        """If a datasource needs to provide additional keys for calculation of
        cache keys, those can be provided via this method

        :param query_obj: The dict representation of a query object
        :return: list of keys
        """
        return []

    def __hash__(self) -> int:
        return hash(self.uid)

    def __eq__(self, other: object) -> bool:
        if not isinstance(other, BaseDatasource):
            return NotImplemented
        return self.uid == other.uid

    def raise_for_access(self) -> None:
        """
        Raise an exception if the user cannot access the resource.

        :raises SupersetSecurityException: If the user cannot access the resource
        """

        security_manager.raise_for_access(datasource=self)

    @classmethod
    def get_datasource_by_name(
        cls, session: Session, datasource_name: str, schema: str, database_name: str
    ) -> Optional["BaseDatasource"]:
        raise NotImplementedError()

class BaseColumn(AuditMixinNullable, ImportExportMixin):
    """Interface for column"""

    __tablename__: Optional[str] = None  # {connector_name}_column

    id = Column(Integer, primary_key=True)
    column_name = Column(String(255), nullable=False)
    verbose_name = Column(String(1024))
    is_active = Column(Boolean, default=True)
    type = Column(String(32))
    groupby = Column(Boolean, default=True)
    filterable = Column(Boolean, default=True)
    description = Column(Text)
    is_dttm = None

    # [optional] Set this to support import/export functionality
    export_fields: List[Any] = []

    def __repr__(self) -> str:
        return str(self.column_name)

    bool_types = ("BOOL",)
    num_types = (
        "DOUBLE",
        "FLOAT",
        "INT",
        "BIGINT",
        "NUMBER",
        "LONG",
        "REAL",
        "NUMERIC",
        "DECIMAL",
        "MONEY",
    )
    date_types = ("DATE", "TIME")
    str_types = ("VARCHAR", "STRING", "CHAR")

    @property
    def is_numeric(self) -> bool:
        return self.type and any(map(lambda t: t in self.type.upper(), self.num_types))

    @property
    def is_temporal(self) -> bool:
        return self.type and any(map(lambda t: t in self.type.upper(), self.date_types))

    @property
    def is_string(self) -> bool:
        return self.type and any(map(lambda t: t in self.type.upper(), self.str_types))

    @property
    def is_boolean(self) -> bool:
        return self.type and any(map(lambda t: t in self.type.upper(), self.bool_types))

    @property
    def type_generic(self) -> Optional[utils.GenericDataType]:
        if self.is_string:
            return utils.GenericDataType.STRING
        if self.is_boolean:
            return utils.GenericDataType.BOOLEAN
        if self.is_numeric:
            return utils.GenericDataType.NUMERIC
        if self.is_temporal:
            return utils.GenericDataType.TEMPORAL
        return None

    @property
    def expression(self) -> Column:
        raise NotImplementedError()

    @property
    def python_date_format(self) -> Column:
        raise NotImplementedError()

    @property
    def data(self) -> Dict[str, Any]:
        attrs = (
            "id",
            "column_name",
            "verbose_name",
            "description",
            "expression",
            "filterable",
            "groupby",
            "is_dttm",
            "type",
        )
        return {s: getattr(self, s) for s in attrs if hasattr(self, s)}

class BaseMetric(AuditMixinNullable, ImportExportMixin):

    """Interface for Metrics"""

    __tablename__: Optional[str] = None  # {connector_name}_metric

    id = Column(Integer, primary_key=True)
    metric_name = Column(String(255), nullable=False)
    verbose_name = Column(String(1024))
    metric_type = Column(String(32))
    description = Column(Text)
    d3format = Column(String(128))
    warning_text = Column(Text)

    """
    The interface should also declare a datasource relationship pointing
    to a derivative of BaseDatasource, along with a FK

    datasource_name = Column(
        String(255),
        ForeignKey('datasources.datasource_name'))
    datasource = relationship(
        # needs to be altered to point to {Connector}Datasource
        'BaseDatasource',
        backref=backref('metrics', cascade='all, delete-orphan'),
        enable_typechecks=False)
    """

    @property
    def perm(self) -> Optional[str]:
        raise NotImplementedError()

    @property
    def expression(self) -> Column:
        raise NotImplementedError()

    @property
    def data(self) -> Dict[str, Any]:
        attrs = (
            "id",
            "metric_name",
            "verbose_name",
            "description",
            "expression",
            "warning_text",
            "d3format",
        )
        return {s: getattr(self, s) for s in attrs}


text:
        <tf-alert tf-content="deal.alert" ng-show="deal.alert"></tf-alert>

You have a deal!

                    Summary of the negociation

{{ deal.job.name }}

{{ deal.job.metadata.profession }}

Final Rate

{{ deal.offer.metadata.payment.value }} {{ deal.offer.metadata.payment.currency.name }}

                            Start Date
                            <tf-date tf-date-expression="deal.job.startDate"></tf-date>

                            End Date
                            <tf-date tf-date-expression="deal.job.finishDate"></tf-date>

            GO HOME


text:
require 'sinatra/base'
require 'sinatra/strong-params/version'

class RequiredParamMissing < ArgumentError; end

module Sinatra
  module StrongParams
    def self.registered(app)
      #
      # A way to whitelist parameters.
      #
      #   get '/', allows: [:id, :action] do
      #     erb :index
      #   end
      #
      # Modifies the parameters available in the request scope.
      # Stashes unmodified params in @_params
      #
      app.set(:allows) do |*passable|
        condition do
          unless @params.empty?
            @_params = @_params || @params # for safety
            globals  = settings.globally_allowed_parameters
            needed   = @_needed || []
            passable = (globals | passable | needed).map(&:to_sym) # make sure it's a symbol

            # Keep only the allowed parameters.
            @params = @params.delete_if do |param, _value|
              !passable.include?(param.to_sym)
            end
          end
        end
      end

      #
      # A way to require parameters
      #
      #   get '/', needs: [:id, :action] do
      #     erb :index
      #   end
      #
      # Does not modify the parameters available to the request scope.
      # Raises a RequiredParamMissing error if a needed param is missing
      #
      app.set(:needs) do |*needed|
        condition do
          needed     = needed.map(&:to_sym) # make sure it's a symbol
          @_needed   = needed
          sym_params = @params.dup

          # symbolize the keys so we know what we're looking at
          sym_params.keys.each do |key|
            sym_params[(key.to_sym rescue key) || key] = sym_params.delete(key)
          end

          missing_params = needed.select { |key| sym_params[key].nil? || sym_params[key].empty? }
          if missing_params.any?
            fail RequiredParamMissing, "#{settings.missing_parameter_message} #{missing_params.join(', ')}"
          end
        end
      end

      # These will always pass through the 'allows' method
      # and will be mapped to symbols. I often use [:redirect_to, :_csrf] here
      # because I always want them to pass through for later processing
      app.set :globally_allowed_parameters, []

      # The default message when RequiredParamMissing is raised.
      app.set :missing_parameter_message, 'One or more required parameters were missing:'

      # Change the default behavior for missing parameters by overriding this route.
      # For example...
      #
      #   error RequiredParamMissing do
      #     flash[:error] = env['sinatra.error'].message
      #     redirect back
      #   end
      #
      app.error RequiredParamMissing do
        [400, env['sinatra.error'].message]
      end
    end
  end

  register StrongParams
end


text:
/* Custom fonts
-------------------------------------------------- */

@font-face {
  font-family: CianOT;
  src: url('ClanOT-Medium.ttf');
}

/* Navigation toolbar
-------------------------------------------------- */

/* navigation bar's main sections */

.navbar-fixed-top               { position: static; }
.navbar .navbar-inner           { height: 80px; background-color: #003A63; text-shadow: none; background-image: none; filter: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}
.navbar .brand                  { margin-top: 10px; }

.navbar .nav > li.dropdown > a  { color: #FFFFFF; font-size: 12px; }
.navbar .nav li.dropdown > .dropdown-toggle .caret {  border-bottom-color: #FFFFFF; border-top-color: #FFFFFF; margin-left: 0; }

div.nav-collapse    { margin-top: 22px;}
.navbar .nav        { margin-left: 20px; margin-right: 20px; }

#sections > li > a {  float: none;
										  color: #D0DEE7;
										  background-color: #125889;
										  text-transform: uppercase;
										  text-shadow: none;
										  border-top-left-radius: 3px;
										  border-top-right-radius: 3px;
										  padding-bottom: 25px;
										  margin-right: 3px;
										  -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}

#sections > li > a:focus,
#sections > li > a:hover        { color: #FFFFFF;  background-color: #125889; }

#sections > .active > a,
#sections > .active > a:hover,
#sections > .active > a:focus   { padding-bottom: 28px; }

#sections > .active > a,
#sections > .active > a:hover,
#sections > .active > a:focus,
.service-row > div                    { color: #FFFFFF;  background-color: #0093D0; }

/* user's menu */
.navbar .nav                            { padding-right: 0; margin-right: 0; }
.navbar .nav.pull-right > li > a        { padding-right: 0; margin-right: 0; text-shadow: none; }
.navbar .dropdown-menu .nav-header      { padding-right: 20px; padding-left: 20px; margin-top: 9px }
.navbar .user-separator                 { padding: 0 14px 0; }

/* ICE version and date selection bar
-------------------------------------------------- */
.service-row > div      { line-height: 80px; height: 80px; }
#serviceform            { margin: 0; }
#serviceform > *        { margin-left: 3px; margin-right: 3px; }
#serviceform > span > a { color: #D0DEE7; text-decoration: underline; margin: 0 5px; }
#serviceform > span > a:hover { color: #FFFFFF;}

/* full width background */
#serviceform            { position: relative; background-color: #0093D0; }
#serviceform:before, #serviceform:after
                        { content: "";  position: absolute;  background-color: #0093D0; top: 0; bottom: 0; width: 9999px; }
#serviceform:before     { right: 100%; }
#serviceform:after      { left: 100%; }

/* Body and subcomponents
-------------------------------------------------- */
body          { padding-bottom: 40px; font-family: Arial, sans-serif}

/* Nav */
#sidebar-nav                            { margin-top: -6px; }
#sidebar-nav li                         { margin-bottom: 10px; margin-top: 10px; font-weight: bold; font-size: 12px; color: #0079c2; text-shadow: none; }
#sidebar-nav li a                       { padding-top: 5px; padding-bottom: 5px; }
#sidebar-nav li a:hover                 { background-color: #ececec; color: #0079c2; text-shadow: none;}
#sidebar-nav li.active a                { color: #333333; background-color: #ececec; text-shadow: none; }
#sidebar-nav li.active a:hover          { text-shadow: none;}

#sidebar-nav li p                       { display: inline; margin-left: 10px;}

#sidebar-nav li img.icons               { background: url(/public/images/icons-nav.png) no-repeat; height: 22px; width: 22px; margin-left: -15px; }
#sidebar-nav li img.lifemap             { background-position: -10px -10px; }
#sidebar-nav li.active img.lifemap      { background-position: -10px -40px; }
#sidebar-nav li img.timeline            { background-position: -10px -70px; }
#sidebar-nav li.active img.timeline     { background-position: -10px -101px; }

h1            { font-family: CianOT, Trebuchet MS, sans-serif; font-size: 30px; margin-top: 0; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid #D1D1D1; }
h1 a small    { font-size: 12px; margin-left: 10px; font-family: Helvetica, Arial, sans-serif;}
div.expanding { display:none; }
.content-area { margin-top: 30px; }
h2            { font-family: CianOT, Trebuchet MS, sans-serif; font-size: 16px; line-height: 1em; margin-bottom: 10px; margin-top: 20px;}

div.graphtool {width: 439px; margin: 0 auto; text-align: right; float: right; }
#slider       { display: inline-block; margin: 0em 0.7em; }
div.graph     { margin: 0 0 10px 0; }

/* Stats table */

table.stats                             { border: 1px solid #d6d6d6; }
table.stats thead                       { font-weight: bold; font-size: 11px; color: #333333; background-color: #c3e5f5;}
table.stats tbody tr:nth-child(2n+2) td { background-color: #f1f1f1; }
table.stats tr th:first-child,
table.stats tr td:first-child           { border-right: 1px solid #d6d6d6; }

/* Lifemap controls */

#lifemap-toggler {
	position: absolute; top: 10px; right: 10px;
	/* width: 80px; height: 60px; */
	/* background-color: white; border: 1px solid #aaa; */
  -moz-box-shadow:    3px 3px 1px 2px #eee;
  -webkit-box-shadow: 3px 3px 1px 2px #eee;
  box-shadow:         3px 3px 1px 2px #eee;
  z-index: 9999; }

/* google map fix */

#googlemap img { max-width: none;}

/* Forms
-------------------------------------------------- */
form { margin: 20px 0;}

ul.permissions { list-style-type: none; }
ul.permissions li .btn { margin-top: 1em }

/* Footer
-------------------------------------------------- */

footer                    { padding: 15px 0; margin-top: 30px; border-top: 1px solid #999999; background-color: #d3d3d3; }
footer ul                 { margin-left: 0; font-size: 11px; }
footer ul li              { float: left; list-style: none; padding: 0 10px; border-right: 1px solid #999999; text-transform: uppercase; }
footer ul li:first-child  { padding-left: 0; }
footer ul li:last-child   { border-right: 0; text-transform: none; }
footer ul li a,
footer ul li a:hover      { color: #666666; }


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.compute.model;

/**
 * Model definition for ResourcePolicyWeeklyCycleDayOfWeek.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ResourcePolicyWeeklyCycleDayOfWeek extends com.google.api.client.json.GenericJson {

  /**
   * Allows to define schedule that runs specified day of the week.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String day;

  /**
   * [Output only] Duration of the time window, automatically chosen to be smallest possible in the
   * given scenario.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String duration;

  /**
   * Time within the window to start the operations. It must be in format "HH:MM", where HH :
   * [00-23] and MM : [00-00] GMT.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String startTime;

  /**
   * Allows to define schedule that runs specified day of the week.
   * @return value or {@code null} for none
   */
  public java.lang.String getDay() {
    return day;
  }

  /**
   * Allows to define schedule that runs specified day of the week.
   * @param day day or {@code null} for none
   */
  public ResourcePolicyWeeklyCycleDayOfWeek setDay(java.lang.String day) {
    this.day = day;
    return this;
  }

  /**
   * [Output only] Duration of the time window, automatically chosen to be smallest possible in the
   * given scenario.
   * @return value or {@code null} for none
   */
  public java.lang.String getDuration() {
    return duration;
  }

  /**
   * [Output only] Duration of the time window, automatically chosen to be smallest possible in the
   * given scenario.
   * @param duration duration or {@code null} for none
   */
  public ResourcePolicyWeeklyCycleDayOfWeek setDuration(java.lang.String duration) {
    this.duration = duration;
    return this;
  }

  /**
   * Time within the window to start the operations. It must be in format "HH:MM", where HH :
   * [00-23] and MM : [00-00] GMT.
   * @return value or {@code null} for none
   */
  public java.lang.String getStartTime() {
    return startTime;
  }

  /**
   * Time within the window to start the operations. It must be in format "HH:MM", where HH :
   * [00-23] and MM : [00-00] GMT.
   * @param startTime startTime or {@code null} for none
   */
  public ResourcePolicyWeeklyCycleDayOfWeek setStartTime(java.lang.String startTime) {
    this.startTime = startTime;
    return this;
  }

  @Override
  public ResourcePolicyWeeklyCycleDayOfWeek set(String fieldName, Object value) {
    return (ResourcePolicyWeeklyCycleDayOfWeek) super.set(fieldName, value);
  }

  @Override
  public ResourcePolicyWeeklyCycleDayOfWeek clone() {
    return (ResourcePolicyWeeklyCycleDayOfWeek) super.clone();
  }

}


text:
<?php

use common\models\issue\SummonDoc;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

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

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

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

		<?= Html::submitButton(Yii::t('backend', 'Save'), ['class' => 'btn btn-success']) ?>

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


text:
#ifndef _SmileTextRender_H_
#define _SmileTextRender_H_

#include "TextRender.h"
#include <Font.h>
#include <View.h>

#include <stdio.h>
#include <TranslationUtils.h>
#include <Resources.h>
#include <String.h>

#include "Emoticor.h"

extern float gEmoticonSize;

class SmileTextRender : public TextRender
{
    public:
          SmileTextRender():TextRender(){};

          virtual ~SmileTextRender() {};

       virtual void Render(BView *target,const char* txt,int16 num,BPoint pos)  {

            BBitmap *pointer=NULL;
            BString f(txt,num);

          	if(emoticor->config->FindPointer(f.String(),(void**)&pointer)==B_OK)
          	{
          		target->SetDrawingMode( B_OP_ALPHA );
          	 	target->DrawBitmapAsync( pointer,BPoint(pos.x, pos.y- (gEmoticonSize/2)) );
          		target->SetDrawingMode( B_OP_OVER );

/*		       	BRect r = pointer->Bounds();
          		r.OffsetTo(pos);
          		r.OffsetBy(0, - (gEmoticonSize/2 + 2) );
          		r.InsetBy(-1,-1);

          		rgb_color oldCol = target->HighColor();
          		target->SetHighColor( 255,0,0 );
          		target->StrokeRect( r );
          		target->SetHighColor( oldCol );
*/
          	}
        };

       virtual float Size(){ return gEmoticonSize;}

       virtual void GetHeight(font_height *h)
       {
       		h->ascent=gEmoticonSize/2;
       		h->descent=gEmoticonSize/2;
       		h->leading=0;
       	};

	   virtual void
	   GetEscapements(const char * /*charArray*/, int32 numChars,float escapementArray[])
	   {
  			//font.GetEscapements(charArray,numChars,escapementArray);
  			escapementArray[0]=1;
  			for(int i=1;i<numChars;i++) escapementArray[i]=0;
  	   }
};
#endif


text:
<?php namespace Bishopm\Connexion\Repositories;

use Bishopm\Connexion\Repositories\EloquentBaseRepository;

class BlogsRepository extends EloquentBaseRepository
{
    public function mostRecent($num=1)
    {
        return $this->model->with('individual')->where('status', 'published')->orderBy('created_at', 'DESC')->get()->take($num);
    }

    public function allPublished()
    {
        return $this->model->with('individual')->where('status', 'published')->orderBy('created_at', 'DESC')->get();
    }

    public function findByDateSlug($yr, $mth='', $slug='')
    {
        $testdate=$yr . '-' . $mth . '-%';
        $blog=$this->model->where('created_at', 'like', $testdate)->where('slug', $slug)->first();
        if (!$blog) {
            $blog=$this->model->where('slug', $yr)->first();
        }
        return $blog;
    }
}


text:
import _ from 'underscore';

import random from './random';
import sentence from './sentence';

let _patterns = ['UD', 'DU'],
    _groups = { D: '0123456789', U: 'ABCDEFGHJKMNPQRSTUVWXYZ' };

function getRandomSentence() {
    return sentence.getRandomSentence();
}

function generateRandomCharactersFromPattern(pattern) {
    return _.map(pattern.split(''), group => random.randomElement(_groups[group]));
}

let PasswordGenerator = {};

PasswordGenerator.generateRandomPassword = function () {
    let sentence = getRandomSentence();
    let chars = generateRandomCharactersFromPattern(random.randomElement(_patterns));
    return sentence.concat(chars.join(''));
}

PasswordGenerator.countCombinations = function () {

    let getPattern = p => _.chain(p)
        .map(c => _groups[c].length)
        .reduce((product, n) => product * n, 1)
        .value();

    let extraCharacters = _.chain(_patterns)
        .map(getPattern)
        .reduce((sum, n) => sum + n, 0)
        .value();

    return extraCharacters * sentence.countCombinations();
}

PasswordGenerator.init = function (words) {
    sentence.init(words);
}

export default PasswordGenerator;


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Crap Engine 2: crap::ComponentFactory Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Crap Engine 2

Main Page

Namespaces

Classes

Files

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

Class List

Class Index

Class Hierarchy

Class Members

crap

ComponentFactory

Public Member Functions |
List of all members

crap::ComponentFactory Class Reference

#include <componentfactory.h>

Inheritance diagram for crap::ComponentFactory:

  <map id="crap::ComponentFactory_map" name="crap::ComponentFactory_map">
<area href="classcrap_1_1_component_type.html" alt="crap::ComponentType< T >" shape="rect" coords="0,56,166,80"/>
</map>

Public Member Functions

 	ComponentFactory (crap::string_hash name, ComponentSystem *system)

virtual 	~ComponentFactory (void)

virtual Component * 	createComponent (void)

virtual void 	destroyComponent (Component *component)

CRAP_INLINE bool 	operator== (const string_hash &name)

CRAP_INLINE uint32_t 	id (void) const

Detailed Description

Definition at line 30 of file componentfactory.h.

Constructor & Destructor Documentation

          crap::ComponentFactory::ComponentFactory
          (
          crap::string_hash
          name,

          ComponentSystem *
          system

          )

Definition at line 10 of file componentfactory.cpp.

          virtual crap::ComponentFactory::~ComponentFactory
          (
          void
          	)

inlinevirtual

Definition at line 37 of file componentfactory.h.

Member Function Documentation

          virtual Component* crap::ComponentFactory::createComponent
          (
          void
          	)

inlinevirtual

Reimplemented in crap::ComponentType< T >.

Definition at line 39 of file componentfactory.h.

          virtual void crap::ComponentFactory::destroyComponent
          (
          Component *
          component	)

inlinevirtual

Reimplemented in crap::ComponentType< T >.

Definition at line 40 of file componentfactory.h.

          CRAP_INLINE uint32_t crap::ComponentFactory::id
          (
          void
          	)
           const

inline

Definition at line 49 of file componentfactory.h.

          CRAP_INLINE bool crap::ComponentFactory::operator==
          (
          const string_hash &
          name	)

inline

Definition at line 43 of file componentfactory.h.

The documentation for this class was generated from the following files:

/mnt/windows/data/programming/crapengine2/source/engine/include/componentfactory.h

/mnt/windows/data/programming/crapengine2/source/engine/source/componentfactory.cpp

<address class="footer">
Generated on Wed Jan 7 2015 21:59:10 for Crap Engine 2 by

 1.8.9.1
</address>


text:
<?php
//FIXME move to view
// page title
$title = "Recherche de Sites";
// page footer content
$footer = '
© 2017 Sharpbunny, Inc.
';
// buffer init
ob_start();
// le code html qui va suivre ne sera pas envoyé à l'écran mais dans un buffer pour être envoyé au template
$search = htmlspecialchars(isset($_POST['researchField'])?$_POST['researchField']:"");
?>

        <form action="search/view" method="POST">

                Champ de recherche
                <input  class="form-control" name="researchField" type="text" value="<?php echo $search; ?>"></input>

                <button type="submit" class="btn btn-default">Envoyer</button>
        </form>

<?php
// store buffer into $leftcontent
$leftcontent = ob_get_clean();
// start new buffer
ob_start();
?>

<?php
if(empty($arraySearch)) {
        echo "Remplissez le champ de gauche";
} else {
    $i = 0;
    while($i < count($arraySearch)) {
        echo '
';
        echo '';
        echo 'Identifiant du site = '.$arraySearch[$i]["ID_site"].' ';
        echo "
";
        echo "Nom du Site = ".$arraySearch[$i]['nom_site'];
        echo "
";
        echo "ID de la commune = ".$arraySearch[$i]['ID_commune'];
        echo '	';
        echo "
";
        $i++;
    }
}
?>

<?php
// store buffer into $content
$content = ob_get_clean();

// call template to display
include('Views/siteTemplate.php');


text:
package org.deeplearning4j.nn.layers.convolution;

import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.indexer.HalfIndexer;
import org.deeplearning4j.berkeley.Pair;
import org.deeplearning4j.nn.conf.ConvolutionMode;
import org.deeplearning4j.nn.conf.layers.ConvolutionLayer.AlgoMode;
import org.deeplearning4j.nn.gradient.DefaultGradient;
import org.deeplearning4j.nn.gradient.Gradient;
import org.deeplearning4j.nn.params.ConvolutionParamInitializer;
import org.deeplearning4j.util.ConvolutionUtils;
import org.nd4j.jita.allocator.Allocator;
import org.nd4j.jita.allocator.impl.AtomicAllocator;
import org.nd4j.linalg.activations.IActivation;
import org.nd4j.linalg.api.buffer.DataBuffer;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.executioner.GridExecutioner;
import org.nd4j.linalg.api.shape.Shape;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.jcublas.context.CudaContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.bytedeco.javacpp.cuda.*;
import static org.bytedeco.javacpp.cudnn.*;

/**
 * cuDNN-based helper for the convolution layer.
 *
 * @author saudet
 */
public class CudnnConvolutionHelper implements ConvolutionHelper {
    protected static final Logger log = LoggerFactory.getLogger(CudnnConvolutionHelper.class);

    static void checkCuda(int error) {
        if (error != cudaSuccess) {
            throw new RuntimeException("CUDA error = " + error + ": " + cudaGetErrorString(error).getString());
        }
    }

    static void checkCudnn(int status) {
        if (status != CUDNN_STATUS_SUCCESS) {
            throw new RuntimeException("cuDNN status = " + status + ": " + cudnnGetErrorString(status).getString());
        }
    }

    static class CudnnContext extends cudnnContext {

        static class Deallocator extends CudnnContext implements Pointer.Deallocator {
            Deallocator(CudnnContext c) {
                super(c);
            }

            @Override
            public void deallocate() {
                destroyHandles();
            }
        }

        cudnnTensorStruct srcTensorDesc = new cudnnTensorStruct(), dstTensorDesc = new cudnnTensorStruct(),
                        biasTensorDesc = new cudnnTensorStruct(), deltaTensorDesc = new cudnnTensorStruct();
        cudnnFilterStruct filterDesc = new cudnnFilterStruct();
        cudnnConvolutionStruct convDesc = new cudnnConvolutionStruct();
        cudnnActivationStruct activationDesc = new cudnnActivationStruct();

        CudnnContext() {
            // insure that cuDNN initializes on the same device as ND4J for this thread
            Nd4j.create(1);
            AtomicAllocator.getInstance();
            createHandles();
            deallocator(new Deallocator(this));
        }

        CudnnContext(CudnnContext c) {
            super(c);
            srcTensorDesc = new cudnnTensorStruct(c.srcTensorDesc);
            dstTensorDesc = new cudnnTensorStruct(c.dstTensorDesc);
            biasTensorDesc = new cudnnTensorStruct(c.biasTensorDesc);
            deltaTensorDesc = new cudnnTensorStruct(c.deltaTensorDesc);
            filterDesc = new cudnnFilterStruct(c.filterDesc);
            convDesc = new cudnnConvolutionStruct(c.convDesc);
            activationDesc = new cudnnActivationStruct(c.activationDesc);
        }

        void createHandles() {
            checkCudnn(cudnnCreate(this));
            checkCudnn(cudnnCreateTensorDescriptor(srcTensorDesc));
            checkCudnn(cudnnCreateTensorDescriptor(dstTensorDesc));
            checkCudnn(cudnnCreateTensorDescriptor(biasTensorDesc));
            checkCudnn(cudnnCreateTensorDescriptor(deltaTensorDesc));
            checkCudnn(cudnnCreateFilterDescriptor(filterDesc));
            checkCudnn(cudnnCreateConvolutionDescriptor(convDesc));
            checkCudnn(cudnnCreateActivationDescriptor(activationDesc));
        }

        void destroyHandles() {
            checkCudnn(cudnnDestroyActivationDescriptor(activationDesc));
            checkCudnn(cudnnDestroyConvolutionDescriptor(convDesc));
            checkCudnn(cudnnDestroyFilterDescriptor(filterDesc));
            checkCudnn(cudnnDestroyTensorDescriptor(srcTensorDesc));
            checkCudnn(cudnnDestroyTensorDescriptor(dstTensorDesc));
            checkCudnn(cudnnDestroyTensorDescriptor(biasTensorDesc));
            checkCudnn(cudnnDestroyTensorDescriptor(deltaTensorDesc));
            checkCudnn(cudnnDestroy(this));
        }
    }

    static class WorkSpace extends Pointer {

        static class Deallocator extends WorkSpace implements Pointer.Deallocator {
            Deallocator(WorkSpace w) {
                super(w);
            }

            @Override
            public void deallocate() {
                checkCuda(cudaFree(this));
                setNull();
            }
        }

        static class HostDeallocator extends WorkSpace implements Pointer.Deallocator {
            HostDeallocator(WorkSpace w) {
                super(w);
            }

            @Override
            public void deallocate() {
                checkCuda(cudaFreeHost(this));
                setNull();
            }
        }

        WorkSpace() {}

        WorkSpace(long size) {
            position = 0;
            limit = capacity = size;
            int error = cudaMalloc(this, size);
            if (error != cudaSuccess) {
                log.warn("Cannot allocate " + size + " bytes of device memory (CUDA error = " + error
                                + "), proceeding with host memory");
                checkCuda(cudaMallocHost(this, size));
                deallocator(new HostDeallocator(this));
            } else {
                deallocator(new Deallocator(this));
            }
        }

        WorkSpace(WorkSpace w) {
            super(w);
        }
    }

    CudnnContext cudnnContext = new CudnnContext();
    WorkSpace workSpace = new WorkSpace();
    int dataType = Nd4j.dataType() == DataBuffer.Type.DOUBLE ? CUDNN_DATA_DOUBLE
                    : Nd4j.dataType() == DataBuffer.Type.FLOAT ? CUDNN_DATA_FLOAT : CUDNN_DATA_HALF;
    int tensorFormat = CUDNN_TENSOR_NCHW;
    Pointer alpha = Nd4j.dataType() == DataBuffer.Type.DOUBLE ? new DoublePointer(1.0)
                    : Nd4j.dataType() == DataBuffer.Type.FLOAT ? new FloatPointer(1.0f)
                                    : new ShortPointer(new short[] {(short) HalfIndexer.fromFloat(1.0f)});
    Pointer beta = Nd4j.dataType() == DataBuffer.Type.DOUBLE ? new DoublePointer(0.0)
                    : Nd4j.dataType() == DataBuffer.Type.FLOAT ? new FloatPointer(0.0f)
                                    : new ShortPointer(new short[] {(short) HalfIndexer.fromFloat(0.0f)});;
    SizeTPointer sizeInBytes = new SizeTPointer(1);

    @Override
    public Pair<Gradient, INDArray> backpropGradient(INDArray input, INDArray weights, INDArray delta, int[] kernel,
                    int[] strides, int[] pad, INDArray biasGradView, INDArray weightGradView, IActivation afn,
                    AlgoMode mode, ConvolutionMode convolutionMode) {
        int miniBatch = input.size(0);
        int inH = input.size(2);
        int inW = input.size(3);

        int outDepth = weights.size(0);
        int inDepth = weights.size(1);
        int kH = weights.size(2);
        int kW = weights.size(3);

        int[] outSize;
        if (convolutionMode == ConvolutionMode.Same) {
            outSize = ConvolutionUtils.getOutputSize(input, kernel, strides, null, convolutionMode); //Also performs validation
            pad = ConvolutionUtils.getSameModeTopLeftPadding(outSize, new int[] {input.size(2), input.size(3)}, kernel,
                            strides);
        } else {
            outSize = ConvolutionUtils.getOutputSize(input, kernel, strides, pad, convolutionMode); //Also performs validation
        }

        int outH = outSize[0];
        int outW = outSize[1];

        if (!Shape.strideDescendingCAscendingF(delta)) {
            // apparently not supported by cuDNN
            delta = delta.dup();
        }

        int[] srcStride = input.stride();
        int[] deltaStride = delta.stride();
        int[] algo1 = new int[1];
        int[] algo2 = new int[1];

        if (Nd4j.getExecutioner() instanceof GridExecutioner)
            ((GridExecutioner) Nd4j.getExecutioner()).flushQueue();

        checkCudnn(cudnnSetTensor4dDescriptorEx(cudnnContext.srcTensorDesc, dataType, miniBatch, inDepth, inH, inW,
                        srcStride[0], srcStride[1], srcStride[2], srcStride[3]));
        checkCudnn(cudnnSetTensor4dDescriptorEx(cudnnContext.deltaTensorDesc, dataType, miniBatch, outDepth, outH, outW,
                        deltaStride[0], deltaStride[1], deltaStride[2], deltaStride[3]));
        checkCudnn(cudnnSetConvolution2dDescriptor_v5(cudnnContext.convDesc, pad[0], pad[1], strides[0], strides[1], 1, 1,
                        CUDNN_CROSS_CORRELATION, dataType));
        checkCudnn(cudnnSetFilter4dDescriptor(cudnnContext.filterDesc, dataType, tensorFormat, outDepth, inDepth, kH,
                        kW));
        checkCudnn(cudnnGetConvolutionBackwardFilterAlgorithm(cudnnContext, cudnnContext.srcTensorDesc,
                        cudnnContext.deltaTensorDesc, cudnnContext.convDesc, cudnnContext.filterDesc,
                        mode == AlgoMode.NO_WORKSPACE ? CUDNN_CONVOLUTION_BWD_FILTER_NO_WORKSPACE
                                        : CUDNN_CONVOLUTION_BWD_FILTER_PREFER_FASTEST,
                        0, algo1));
        checkCudnn(cudnnGetConvolutionBackwardDataAlgorithm(cudnnContext, cudnnContext.filterDesc,
                        cudnnContext.deltaTensorDesc, cudnnContext.convDesc, cudnnContext.srcTensorDesc,
                        mode == AlgoMode.NO_WORKSPACE ? CUDNN_CONVOLUTION_BWD_DATA_NO_WORKSPACE
                                        : CUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST,
                        0, algo2));

        INDArray epsNext = Nd4j.create(new int[] {miniBatch, inDepth, inH, inW}, 'c');
        int[] dstStride = epsNext.stride();

        Allocator allocator = AtomicAllocator.getInstance();
        CudaContext context = allocator.getFlowController().prepareActionAllWrite(input, weights, weightGradView,
                        biasGradView, delta, epsNext);
        Pointer srcData = allocator.getPointer(input, context);
        Pointer filterData = allocator.getPointer(weights, context);
        Pointer filterGradData = allocator.getPointer(weightGradView, context);
        Pointer biasGradData = allocator.getPointer(biasGradView, context);
        Pointer deltaData = allocator.getPointer(delta, context);
        Pointer dstData = allocator.getPointer(epsNext, context);

        checkCudnn(cudnnSetStream(cudnnContext, new CUstream_st(context.getOldStream())));
        checkCudnn(cudnnSetTensor4dDescriptorEx(cudnnContext.dstTensorDesc, dataType, miniBatch, inDepth, inH, inW,
                        dstStride[0], dstStride[1], dstStride[2], dstStride[3]));
        checkCudnn(cudnnGetConvolutionBackwardFilterWorkspaceSize(cudnnContext, cudnnContext.srcTensorDesc,
                        cudnnContext.deltaTensorDesc, cudnnContext.convDesc, cudnnContext.filterDesc, algo1[0],
                        sizeInBytes));
        long sizeInBytes1 = sizeInBytes.get(0);
        checkCudnn(cudnnGetConvolutionBackwardDataWorkspaceSize(cudnnContext, cudnnContext.filterDesc,
                        cudnnContext.deltaTensorDesc, cudnnContext.convDesc, cudnnContext.dstTensorDesc, algo2[0],
                        sizeInBytes));
        long sizeInBytes2 = sizeInBytes.get(0);
        if (sizeInBytes1 > workSpace.capacity() || sizeInBytes2 > workSpace.capacity()) {
            workSpace.deallocate();
            workSpace = new WorkSpace(Math.max(sizeInBytes1, sizeInBytes2));
        }

        checkCudnn(cudnnSetTensor4dDescriptor(cudnnContext.biasTensorDesc, tensorFormat, dataType, 1, outDepth, 1, 1));
        checkCudnn(cudnnConvolutionBackwardBias(cudnnContext, alpha, cudnnContext.deltaTensorDesc, deltaData, beta,
                        cudnnContext.biasTensorDesc, biasGradData));
        checkCudnn(cudnnConvolutionBackwardFilter(cudnnContext, alpha, cudnnContext.srcTensorDesc, srcData,
                        cudnnContext.deltaTensorDesc, deltaData, cudnnContext.convDesc, algo1[0], workSpace,
                        workSpace.capacity(), beta, cudnnContext.filterDesc, filterGradData));
        checkCudnn(cudnnConvolutionBackwardData(cudnnContext, alpha, cudnnContext.filterDesc, filterData,
                        cudnnContext.deltaTensorDesc, deltaData, cudnnContext.convDesc, algo2[0], workSpace,
                        workSpace.capacity(), beta, cudnnContext.dstTensorDesc, dstData));

        allocator.getFlowController().registerActionAllWrite(context, input, weights, weightGradView, biasGradView,
                        delta, epsNext);

        Gradient retGradient = new DefaultGradient();
        retGradient.setGradientFor(ConvolutionParamInitializer.BIAS_KEY, biasGradView);
        retGradient.setGradientFor(ConvolutionParamInitializer.WEIGHT_KEY, weightGradView, 'c');

        return new Pair<>(retGradient, epsNext);
    }

    @Override
    public INDArray preOutput(INDArray input, INDArray weights, INDArray bias, int[] kernel, int[] strides, int[] pad,
                    AlgoMode mode, ConvolutionMode convolutionMode) {
        int miniBatch = input.size(0);
        int inH = input.size(2);
        int inW = input.size(3);

        int outDepth = weights.size(0);
        int inDepth = weights.size(1);
        int kH = weights.size(2);
        int kW = weights.size(3);

        int[] srcStride = input.stride();

        if (Nd4j.getExecutioner() instanceof GridExecutioner)
            ((GridExecutioner) Nd4j.getExecutioner()).flushQueue();

        int[] outSize;
        if (convolutionMode == ConvolutionMode.Same) {
            outSize = ConvolutionUtils.getOutputSize(input, kernel, strides, null, convolutionMode); //Also performs validation
            pad = ConvolutionUtils.getSameModeTopLeftPadding(outSize, new int[] {input.size(2), input.size(3)}, kernel,
                            strides);
        } else {
            outSize = ConvolutionUtils.getOutputSize(input, kernel, strides, pad, convolutionMode); //Also performs validation
        }
        INDArray z = Nd4j.createUninitialized(new int[] {miniBatch, outDepth, outSize[0], outSize[1]});

        checkCudnn(cudnnSetTensor4dDescriptorEx(cudnnContext.srcTensorDesc, dataType, miniBatch, inDepth, inH, inW,
                        srcStride[0], srcStride[1], srcStride[2], srcStride[3]));
        checkCudnn(cudnnSetFilter4dDescriptor(cudnnContext.filterDesc, dataType, tensorFormat, outDepth, inDepth, kH,
                        kW));
        checkCudnn(cudnnSetConvolution2dDescriptor_v5(cudnnContext.convDesc, pad[0], pad[1], strides[0], strides[1], 1, 1,
                        CUDNN_CROSS_CORRELATION, dataType));

        // find dimension of convolution output
        //        checkCudnn(cudnnGetConvolution2dForwardOutputDim(cudnnContext.convDesc, cudnnContext.srcTensorDesc, cudnnContext.filterDesc, n, c, h, w));
        //        INDArray z = Nd4j.createUninitialized(new int[]{n[0],c[0],h[0],w[0]},'c');

        int[] algo = new int[1];
        int[] dstStride = z.stride();
        checkCudnn(cudnnSetTensor4dDescriptorEx(cudnnContext.dstTensorDesc, dataType, miniBatch, outDepth, outSize[0],
                        outSize[1], dstStride[0], dstStride[1], dstStride[2], dstStride[3]));
        checkCudnn(cudnnGetConvolutionForwardAlgorithm(cudnnContext, cudnnContext.srcTensorDesc,
                        cudnnContext.filterDesc,
                        cudnnContext.convDesc, cudnnContext.dstTensorDesc, mode == AlgoMode.NO_WORKSPACE
                                        ? CUDNN_CONVOLUTION_FWD_NO_WORKSPACE : CUDNN_CONVOLUTION_FWD_PREFER_FASTEST,
                        0, algo));

        Allocator allocator = AtomicAllocator.getInstance();
        CudaContext context = allocator.getFlowController().prepareAction(z, input, weights, bias);
        Pointer srcData = allocator.getPointer(input, context);
        Pointer filterData = allocator.getPointer(weights, context);
        Pointer biasData = allocator.getPointer(bias, context);
        Pointer dstData = allocator.getPointer(z, context);

        checkCudnn(cudnnSetStream(cudnnContext, new CUstream_st(context.getOldStream())));
        checkCudnn(cudnnGetConvolutionForwardWorkspaceSize(cudnnContext, cudnnContext.srcTensorDesc,
                        cudnnContext.filterDesc, cudnnContext.convDesc, cudnnContext.dstTensorDesc, algo[0],
                        sizeInBytes));
        if (sizeInBytes.get(0) > workSpace.capacity()) {
            workSpace.deallocate();
            workSpace = new WorkSpace(sizeInBytes.get(0));
        }
        checkCudnn(cudnnConvolutionForward(cudnnContext, alpha, cudnnContext.srcTensorDesc, srcData,
                        cudnnContext.filterDesc, filterData, cudnnContext.convDesc, algo[0], workSpace,
                        workSpace.capacity(), beta, cudnnContext.dstTensorDesc, dstData));

        checkCudnn(cudnnSetTensor4dDescriptor(cudnnContext.biasTensorDesc, tensorFormat, dataType, 1, outDepth, 1, 1));
        checkCudnn(cudnnAddTensor(cudnnContext, alpha, cudnnContext.biasTensorDesc, biasData, alpha,
                        cudnnContext.dstTensorDesc, dstData));

        allocator.registerAction(context, z, input, weights, bias);

        return z;
    }

    @Override
    public INDArray activate(INDArray z, IActivation afn) {
        if (Nd4j.getExecutioner() instanceof GridExecutioner)
            ((GridExecutioner) Nd4j.getExecutioner()).flushQueue();

        INDArray activation = z;

        Allocator allocator = AtomicAllocator.getInstance();
        CudaContext context = allocator.getFlowController().prepareAction(z);
        Pointer dstData = allocator.getPointer(z, context);

        checkCudnn(cudnnSetStream(cudnnContext, new CUstream_st(context.getOldStream())));
        switch (afn.toString()) {
            case "identity":
                break;
            case "sigmoid":
                checkCudnn(cudnnSetActivationDescriptor(cudnnContext.activationDesc, CUDNN_ACTIVATION_SIGMOID,
                                CUDNN_PROPAGATE_NAN, 0));
                checkCudnn(cudnnActivationForward(cudnnContext, cudnnContext.activationDesc, alpha,
                                cudnnContext.dstTensorDesc, dstData, beta, cudnnContext.dstTensorDesc, dstData));
                break;
            case "relu":
                checkCudnn(cudnnSetActivationDescriptor(cudnnContext.activationDesc, CUDNN_ACTIVATION_RELU,
                                CUDNN_PROPAGATE_NAN, 0));
                checkCudnn(cudnnActivationForward(cudnnContext, cudnnContext.activationDesc, alpha,
                                cudnnContext.dstTensorDesc, dstData, beta, cudnnContext.dstTensorDesc, dstData));
                break;
            case "tanh":
                checkCudnn(cudnnSetActivationDescriptor(cudnnContext.activationDesc, CUDNN_ACTIVATION_TANH,
                                CUDNN_PROPAGATE_NAN, 0));
                checkCudnn(cudnnActivationForward(cudnnContext, cudnnContext.activationDesc, alpha,
                                cudnnContext.dstTensorDesc, dstData, beta, cudnnContext.dstTensorDesc, dstData));
                break;
            case "softmax":
                checkCudnn(cudnnSoftmaxForward(cudnnContext, CUDNN_SOFTMAX_ACCURATE, CUDNN_SOFTMAX_MODE_CHANNEL, alpha,
                                cudnnContext.dstTensorDesc, dstData, beta, cudnnContext.dstTensorDesc, dstData));
                break;
            case "logsoftmax":
                checkCudnn(cudnnSoftmaxForward(cudnnContext, CUDNN_SOFTMAX_LOG, CUDNN_SOFTMAX_MODE_CHANNEL, alpha,
                                cudnnContext.dstTensorDesc, dstData, beta, cudnnContext.dstTensorDesc, dstData));
                break;
            default:
                activation = null;
        }

        allocator.registerAction(context, z);

        return activation;
    }

}


text:
Public Class TaskParameterException : Inherits System.Exception

    Public Sub New()
    End Sub

    Public Sub New(message As String)
        MyBase.New(message)
    End Sub

    Public Sub New(message As String, inner As Exception)
        MyBase.New(message, inner)
    End Sub

End Class


text:
int main(int argc, char **argv) {
  std::cout << "Test" << std::endl;
  return 0; // Set break point at this line.
}


text:
using Sautom.Domain.Entities;

namespace Sautom.Services.Repositories
{
    public partial interface IManagerRepository
    {
	    Manager GetManagerByName(string name);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:layout_gravity="center" android:gravity="center">

<Button android:layout_height="wrap_content" android:gravity="center" android:id="@+id/stop_button" android:layout_width="wrap_content" android:text="@string/stop_button"></Button>

</LinearLayout>


text:
require 'spec_helper'

describe TrafficSource do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
* Original: [Release electron v1.7.1 beta - electron/electron](https://github.com/electron/electron/releases/tag/v1.7.1)

## Bug Fixes

* Fixed a crash when launching with the `--debug` or `--debug-brk` command line flags. [#9436](https://github.com/electron/electron/pull/9436)
  * 起動時のコマンドライン引数に `--debug` か `--debug-brk` を付けるとクラッシュする問題を修正しました
  * Electron v1.7.0 で V8 を更新したことに起因する問題
* Fixed several issues with the `electron.d.ts` TypeScript definition file.
  * TypeScript 定義ファイル `electron.d.ts` 関連の問題を修正しました
  * Electron v1.6.9 から `electron.d.ts` 提供を開始したけれど問題があったようだ、issue としては v1.6.10 の release note にある [#9484](https://github.com/electron/electron/pull/9484) と思われる
* Popup windows and `<webview>` tags are now supported by the offscreen rendering option. [#8839](https://github.com/electron/electron/pull/8839)
  * ポップアップ ウィンドウと `<webview>` タグでオフスクリーン描画オプションをサポートするようにしました
  * [Offscreen Rendering](https://github.com/electron/electron/blob/master/docs/tutorial/offscreen-rendering.md) の対象にポップアップ ウィンドウと `<webview>` タグが含まれるようになった
* Fixed an issue where service worker scripts would not load when using `protocol.interceptBufferProtocol`. [#9360](https://github.com/electron/electron/pull/9360)
  * `protocol.interceptBufferProtocol` 使用時に Service Worker スクリプトが読み込まれない問題を修正しました
  * エラーになっていたとのこと

## API Changes

* Added support for using Chrome's default `window.open` implementation via the `nativeWindowOpen` option to the `BrowserWindow` constructor. [#8963](https://github.com/electron/electron/pull/8963)
  * `BrowserWindow` コンストラクターの `nativeWindowOpen` オプションを介して Chrome 標準の `window.open` 実装を利用するためのサポートを追加しました
  * Renderer プロセス上で新しい `BrowserWindow` を開き、その DOM を操作可能にするためのオプション、Main プロセスを介さずに済むためダイアログとか MDI 的なウィンドウ管理を実装しやすくなりそう
* Added a `will-prevent-unload` event to `webContents` that can be used to prevent a page from preventing the unload of a page. [#9331](https://github.com/electron/electron/pull/9331)
  * ページのアンロードを防ぐために使用できる `webContents` の `will-prevent-unload` イベントを追加しました
  * PR を読むに、ページがリロードされる時にこのイベントを処理してユーザーにリロード (ページのアンロードをともなう) の可否を問い合わせるなどの用法が想定される
* Added support for specifying the maximum disk space used by the cache via the `--disk-cache-size` Chrome option. [#9435](https://github.com/electron/electron/pull/9435)
  * Chrome オプション `--disk-cache-size` による最大ディスク容量の指定サポートを追加しました
  * HTTP リクエストのキャッシュ サイズをアプリからバイト単位で変更可能になった、主に増加させる目的で使用されるだろう、同一リソースを何度もダウンロードするようなアプリ、例えば Google Maps 的なもののパフォーマンス改善に有用そう
* Added a `webContents.getOSProcessId()` API to get the operating system pid for a renderer process. [#9222](https://github.com/electron/electron/pull/9222)
  * Renderer プロセス向けに OS の PID を取得する `webContents.getOSProcessId()` API を追加しました
  * ここ最近の Electron は CPU やメモリ使用量などシステム情報を取得する API の追加が多い


text:
require "letter_stamp_mail_delivery/version"
require "letter_stamp_mail_delivery/delivery_method"


text:
package wsa.fromwsdl.requiredfalse.client;

import junit.framework.Test;
import junit.framework.TestSuite;

/**
 * @author Arun Gupta
 */
public class AllTests extends TestSuite {
    public AllTests(String name) {
        super(name);
    }

    public static Test suite() {
        TestSuite suite = new TestSuite();
        suite.addTestSuite(AddNumbersClient.class);
        return suite;
    }
}


text:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

[Unreleased]
------------------------
##### Changed
- Reduce space between border and form on small screens.

[1.14.2] - 2015-08-05
------------------------
##### Changed
- Repeat background color in Grid theme.
- Background color of selected radiobutton/checkbox on touchscreen in non-Grid themes.

##### Fixed
- Repeat button location in Grid theme.
- Radio buttons inside cloned repeat, require 2 clicks if the master was selected.
- Radio button and checkbox default values not populated correctly in cloned repeat. Overriding values in first repeat.
- Indexed-repeat() result incorrect if expression is inside 2+ repeat.
- Webform not responsive when used in full-size iframe.

[1.14.1] - 2015-07-30
------------------------
##### Fixed
- In pages mode, an exception occurs after submission showing empty page.
- In pulldown select radiobuttons/checkboxes not aligned properly.

[1.14.0] - 2015-07-29
------------------------
##### Added
- Appearance "compact-n" support for media grid pickers.

##### Fixed
- Indexed-repeat() expressions not working if the position is dynamic.
- Page navigation buttons messed up on small screen in pages-mode.
- Top-level (non-grouped) questions on first row do not have a top border.
- Language options in form language selector oddly aligned when mix of rtl and ltr languages is used (FF).
- Title directionality is not displayed according to script used in Grid theme.

[1.13.0] - 2015-07-27
-----------------------
##### Added
- Right-to-left form language directionality support.

##### Changed
- Made page-swipe less sensitive on touchscreens in pages-mode.

[1.12.2] - 2015-07-24
-----------------------
##### Fixed
- Error message is not useful when formList is found to be empty.
- Form injection fails with certain arabic characters.

[1.12.1] - 2015-07-20
------------------------
##### Fixed
- Nested branches do not get evaluated when the parent is enabled.

[1.12.0] - 2015-07-08
------------------------
##### Added
- Right-to-left UI language directionality support.

##### Changed
- Vagrant setup script updated.

##### Fixed
- Validation error dialog message not translated.
- Fallback (english) language not cached in offline views.
- Geo Widget map tiles only partially loaded if widget not visible upon initial form load.

##### Removed
- Non-functional export button removed until the functionality can be added.

[1.11.1] - 2015-06-29
------------------------
##### Fixed
- API endpoint /surveys/list does not include server_url property in each survey item.
- Formhub authentication regression. **WARNING: Formhub users, see additional config.json setting to work around formhub bug.**
- Media for protected forms cannot be retrieved (on strict compliant OpenRosa servers).

[1.11.0] - 2015-06-25
------------------------
##### Added
- Auto-save unsaved data in offline-capable webform views
- API endpoint /surveys/list

##### Fixed
- A note preceding a traditional table is formatted as a group label.
- A note following a traditional table is formatted as a group label.
- Incorrect error message shown when loading a record with a file in the edit view.

[1.10.0] - 2015-06-18
------------------------
##### Changed
- OpenRosa Form ID is now case-sensitive. **WARNING: any existing forms that have a form ID that included a capitalized letter, will get a new Enketo ID. Existing Enketo IDs will keep working though.**

##### Fixed
- Groups and repeats missing from print view in pages mode.
- Sidebar handle is shown up in print view.
- Back button in pages shows merged pages after form reset.
- Incorrectly capitalized form IDs result in unlaunchable forms.
- First page in pages mode is shown if it is disabled.
- Existing trigger value not populated in form.

[1.9.1] - 2015-06-16
------------------
##### Added
- Swahili language

##### Changed
- Improved performance in logic evaluation.

##### Fixed
- Firefox only prints first page.
- Failing to load record.
- Records with nested repeats loaded incorrectly and completely corrupting model.

[1.9.0] - 2015-05-28
------------------
##### Added
- Index-repeat() support

##### Changed
- Faster loading

##### Fixed
- Calculations on select_one inside a repeat clone throw an exception.
- Irrelevant questions inside a repeat clone are shown but should be hidden.
- Calculations inside repeat clones are not evaluated upon form load.

[1.8.9] - 2015-05-08
------------------
##### Added
- Enable print script for themes based on Grid Theme that include "grid" in the theme name.

##### Changed
- Do not attempt to load table/radio/likert/media grid widgets when they are not required.
- Even faster validation for some forms.
- Better performance of large default repeat creation with jr:repeat-count.

##### Fixed
- Screen view remaining at full screen width after printing form with Grid Theme.
- Print dialog buttons not visible with Grid Theme (Enketo Express).
- Sequential notes overlapping each other with Grid Theme.
- Exception occuring in some specific cases when loading an existing record.
- Click lag (especially on mobile) due to slow progress bar update.

[1.8.8] - 2015-04-23
-------------------
##### Changed
- Branch update performance
- Calculate update performance
- Widget loading performance, **WARNING: remove triggerwidget, add horizontal choices widget, see [default-config](./config/default-config.json)**

##### Fixed
- Top border missing and margin too small when a visible note is preceded by a hidden note.
- Any branch containing a geoshape widget caused an exception to occur when it was made irrelevant.
- Appearance 'horizontal' no longer displays with evenly-spaced columns.
- Some buttons in Safari have border and background when they shouldn't have.
- Side bar in Safari is not stretching to bottom.

[1.8.7] - 2015-04-17
------------------
##### Added
- Italian language
- Romanian language

##### Fixed
- All forms with logic broken in Internet Explorer.
- When existing instance with multiple repeats is loaded, only the first repeat is created and populated.
- XML nodenames ending with hyphen or underscore failed to be found.

[1.8.6] - 2015-04-15
---------------
#### Fixed
- Broken submissions.

[1.8.5] - 2015-04-15
---------------------
##### Added
- Arabic language (left-to-right still).

##### Changed
- Text and number inputs in Grid Theme now displayed in full cell width.
- Updated Greek, German, and Dutch language.

##### Fixed
- Geowidget not displayed displayed in full width in pages mode with Grid Theme.
- Hide/show input fields button in Geo Widgets in Grid Theme not clickable after clicking show.
- Remove existing content form external instances to enable ODK Validate hack.
- Reliance on .csv extension for external data broke broke Aggregate support.

[1.8.4] - 2015-04-09
---------------
##### Changed
- Allow empty Google Analytics domain in configuration.

##### Fixed
- Authentication not working on https (reverse proxy).
- API URLs not returning https (reverse proxy).

[1.8.3] - 2015-04-08
---------------
##### Added
- German language
- Greek language

##### Changed
- Much faster form validation.

##### Fixed
- Not showing 'save as draft' in pages mode.

[1.8.2] - 2015-03-23
---------------
##### Added
- Show supported languages on front page.

##### Fixed
- Media files not submitted in offline-enabled views.

[1.8.1] - 2015-03-17
------------
##### Fixed
- Installation with Vagrant failed.
- Local Redis configuration was ignored.

[1.8.0] - 2015-03-09
-----------
##### Added
- Support for external instance sources, CSV and XML
- Spanish language

[1.7.1] - 2015-02-27
-----------
##### Changed
- Configuration now done with local config.json that overrides default (rename existing config/config.json before updating!).
- Dutch translation
- Authentication documentation

##### Fixed
- Installation with Vagrant.
- In media input widget, when media is too large, record is still populated with file name.
- Broken form retrieval with formhub servers.
- Error message 'ECONNREFUSED' not correctly changed to human-readable message.

[1.7.0] - 2015-02-19
-----------
##### Added
- Meta data for username
- Meta data for deviceid
- OpenRosa authentication
- Change log

##### Changed
- API v2 documentation

##### Fixed
- Form cache on server would not update if XForm content (only) changed

[1.6.1] - 2015-02-19
-----------
##### Added
- Panic button to clear browser database

##### Fixed
- Redirect IE9 and less to Modern Browsers page
- Manifest taking over all error pages and redirecting to 'offline' page.

[1.6.0] - 2015-02-12
-----------
##### Added
- Full offline capability
- Grid Theme
- Temporary API v2 documentation

##### Changed
- API access of parameters using a modern method.

##### Fixed
- Grid theme in pages mode shows all questions at full width.
- File inputs keep shows file name after input is emptied.

[1.5.1] - 2014-12-31
-----------
##### Fixed
- Repeat groups not working when they have no \<group\> wrapper.
- Multipe markdown links in a note are merged into one.

[1.5.0] - 2014-12-30
-----------
##### Added
- Internationalization of user interface
- Dutch language
- Populate page title with name of form

##### Fixed
- False 'edited' event firing.
- Multipe markdown links in a note are merged into one.
- Select minimal in first repeat not working right.

[1.4.0] - 2014-12-18
-----------
##### Added
- Support for multipe themes.
- Theme switching via API (v2)

##### Changed
- Styling of 'Pages mode' buttons

##### Fixed
- Stretch short forms and short pages to full height of screen.
- KoBo/Formhub themes occassionaly print in screen style when print button is used.
- Incorrect dialog positioning.

[1.3.1] - 2014-12-16
-----------
##### Fixed
- App breaks when form is loaded with a default value for geopoint/geotrace/geoshape.

[1.3.0] - 2014-12-12
-----------
##### Added
- Ability to paste KML coordinates in geoshape widgets.
- Ability to add Google Maps layers for geo widgets.

[1.2.1] - 2014-12-05
-----------
##### Added
- Ability to print from iframe views.

#### Fixed
- Send X-OpenRosa-Version header to comply with OpenRosa specs.

[1.2.0] - 2014-11-11
-----------
Added
- External authentication support.

[1.1.1] - 2014-11-08
-----------
Fixed
- Instance API endpoint does not add return URL to response.

[1.1.0] - 2014-11-08
-----------
##### Added
- Ability for iframed view to post message to parent window.

##### Changed
- Hide print button in iframe views

##### Fixed
- Crash in Internet Explorer 10 (due to use of console.time).
- Various iframe issues.
- Issue with reporting edit status of current form.

[1.0.3] - 2014-11-07
-----------
##### Fixed
- Various issues with modal dialogs

[1.0.2] - 2014-11-06
-----------
##### Fixed
- Time, date and datetimepickers are reset when user clicks Enter elsewhere in form


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>Module: ActiveModel::Conversion</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />

          Module
          ActiveModel::Conversion

            In:

                /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/conversion.rb

Handle default conversions: to_model,
to_key and to_param.

Example

Let‘s take for example this non persisted object.

  class ContactMessage
    include ActiveModel::Conversion

    # ContactMessage are never persisted in the DB
    def persisted?
      false
    end
  end

  cm = ContactMessage.new
  cm.to_model == self #=> true
  cm.to_key           #=> nil
  cm.to_param         #=> nil

Methods

      to_key
      to_model
      to_param

Public Instance methods

          to_key()

Returns an Enumerable of all (primary) key
attributes or nil if persisted? is fakse

[Source]

    # File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/conversion.rb, line 34
34:     def to_key
35:       persisted? ? [id] : nil
36:     end

          to_model()

If your object is already designed to implement all of the Active Model you
can use the default to_model
implementation, which simply returns self.

If your model does not act like an Active Model object, then you should
define <tt>:to_model</tt> yourself
returning a proxy object that wraps your object with Active Model compliant
methods.

[Source]

    # File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/conversion.rb, line 29
29:     def to_model
30:       self
31:     end

          to_param()

Returns a string representing the object‘s key suitable for use in
URLs, or nil if persisted? is false

[Source]

    # File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/conversion.rb, line 40
40:     def to_param
41:       to_key ? to_key.join('-') : nil
42:     end

[Validate]


text:
#include <Interface/Modules/Fields/SplitFieldByDomainDialog.h>
#include <Core/Algorithms/Legacy/Fields/DomainFields/SplitFieldByDomainAlgo.h>

using namespace SCIRun::Gui;
using namespace SCIRun::Dataflow::Networks;
using namespace SCIRun::Core::Algorithms::Fields;

SplitFieldByDomainDialog::SplitFieldByDomainDialog(const std::string& name, ModuleStateHandle state,
  QWidget* parent /* = 0 */)
  : ModuleDialogGeneric(state, parent)
{
  setupUi(this);
  setWindowTitle(QString::fromStdString(name));
  fixSize();

  addCheckBoxManager(sortBySizeCheckBox_, Parameters::SortBySize);
  addCheckBoxManager(sortAscendingCheckBox_, Parameters::SortAscending);
}