text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>Musikapp Björk und Brian Eno auf Entdeckungsreise ins App-Universum</title>
  <meta name="description" content="Musik-Apps von Musikern kommen langsam in Schwung. Nachdem Brian Eno mit »Bloom« ein spannendes Konzept vorgelegt hat, will jetzt auch Björk mit »Biophilia« das Herz der Musikliebhaber erobern. Beide Musiker betreten aber unterschiedliche Pfade. Ein Vergleich.

Das neue Album von Björk ist mehr als ein Album. »Biophilia« kombiniert Musik, Kunst, Videos, Spiel und Programmierung als Multimedia-projekt. Sämtliche Formen bündelt Björk in einer iPad-App. »Biophilia« bedeutet wörtlich übersetzt die »Liebe zum Leben« und setzt sich aus den beiden altgriechischen Begriffen »bios« und »philia« zusammen.

Und genau darum dreht sich das Multimediaprojekt. »Leben« transformiert Björk zu einem Universum, in welchem innerhalb der App Musik, Songtexte und Instrumentierung mit Spielen und Interaktionen verknüpft werden. Björk versucht hierbei den Zuhörer als Zuschauer und Mitspieler zu gewinnen. Die Strategie hinter dem Multimediaprojekt zielt auf eine nähere Bindung des Zuhörers. Spielerisch soll dieser sich mit Musik, Texten, Ideen und Bildern auseinandersetzen: mit den Ideen, dem Universum Björks.

Björk ist nicht die erste Musikerin, die sich an einer iPad-App versucht. Ähnliche Wege haben bereits andere bestritten. Andere neugierige und experimentelle Künstler. Wie zum Beispiel Brian Eno, der bereits mit drei Apps für das iPhone und einer App namens »Bloom« für das iPad aufwarten kann. Auch der Ambient-Künstler Brian Eno sucht mit seinen Programmen für die mobile Glasplatten die Interaktion mit dem Benutzer.

Im Gegensatz zu Björk bildet aber nicht ein Musikalbum das Fundament der App, sondern Musik und Harmonielehre selbst. »Bloom« erlaubt als Musikinstrument auf einfache Weise dem Benutzer sanfte, beruhigende und sphärische Musik zu produzieren. Diese läuft in einer Endlos-schleife und füllt den Raum mit New Age-verwandter meditativer Musik.

Die Musik produziert der Benutzer einfach, indem er auf die Bildschirmfläche des iPads tippt. Jede Berührung der iPad-Glasplatte hinterlässt einen Pianotupfer oder runden vollen Sinuston. Die Töne reihen sich dabei in eine Schleife ein, die sich nach einiger Zeit wiederholt. Gleichzeitig erlaubt das Programm dem Musizierenden den Eingriff in verschiedene Parameter und vorgefertigte Stimmungen.

Die Arbeit und Kunstfertigkeit von Brian Eno liegt in der Verknüpfung von Musiktheorie, Klangsynthese und Programmierung. Dahingegen kreiert Björk ein Universum, in welches sie Musikliebhaber entführt, um sie auf Entdeckungsreise in ihr Reich zu begleiten. Die App von Björk ist somit ein spannender Versuch, den Hörer näher an Björk und vertrauter mit der Künstlerin zu machen. Dazu bietet die App zu jedem neuen Song eine Karaokeversion, eine (interaktive) Videoanimation, ein kleines Spiel, Hintergrundinformationen zum Musikstück und den kompletten Notensatz.

Neben den für ein Album typischen Bestandteilen wie Grafiken und Texten zu Songs, bietet die App somit auch wunderschön animierte Karaoke-Videos, in welchen kunstvoll grafisch der Song dahinfließt. Beim Song »Virus« rollen dann die Noten ähnlich wie bei dem Notenpapier einer Drehorgel von links nach rechts über den Bildschirm. Die Noten in Form von Balken variieren dabei in Farbe und Länge. Björks Gesang repräsentiert sich als dünner Faden, auf welchem blaue Kreise immer dann auftauchen, wenn Björk neue Töne und Wörter anstimmt. Die Größe der Kreise stellt dabei die Länge und Lautstärke der gesungenen Noten dar, die mit dem abebben von Tönen kleiner werden.

Gamification: Das Musikalbum als Spielplatz

Jeder neue Song von Björk kommt mit einem neuen kleinen Spiel daher. Während man bei »Cristalline« einen Kristall durch Röhren steuert, um weitere Kristalle durch kippen des iPads aufzusammeln, entpuppt sich das »Spiel« des Songs »Virus« als kleines Miniinstrument, welches auf die Bestandteile des Songs Zugriff erlaubt. Im Vergleich mit »Bloom« von Brian Eno sind die Spielansätze von Björk eher rudimentär und in einem vorgefertigten Korsett festgezurrt. Sie dienen der Auseinandersetzung mit den Song und ihrer Thematik. Die App von Brian Eno bietet dahingegen einen spielerischen Ansatz Musik selbst zu erforschen, zu verstehen und zu komponieren.

Neue Wege für Musiker

Das neue Album von Björk ist interdisziplinär und wäre ohne die technische Unterstützung von Designern und Programmierern so nicht möglich. Neben den Programmieren und Designern hat Björk laut den Informationen zur App auch »mit Künstlern, Wissenschaftlern, Instrumentenherstellern, Autoren und Softwareentwicklern zusammengearbeitet«, um ihre multimediale Entdeckungsreise durch das Universum und seine physikalischen Kräfte, Prozesse und Strukturen zu ermöglichen.

Somit wird auch der Programmierer hier offiziell zum Künstler. Im Zusammenhang mit der »Biophilia« App passt der Programiererslogan »Code is poetry«. Schließlich entsteht aus dem Programmiercode und den mathematischen Algorithmen ein wundersames Kunstwerk. Schon immer hat die experimentelle Isländerin gerne mit Innovatoren der unterschiedlichsten Disziplinen zusammengearbeitet und sich ausprobiert. Jetzt kommt zum ersten Mal die Programmierung samt Algorithmen ins Spiel.

Als Musikerin hat auch Björk mit der Problematik des »Download à la carte« zu kämpfen. Während früher das Musikalbum als Gesamtkunstwerk gekauft wurde, »rupft« heute der Kunde das Album auseinander und pickt sich die Rosinen heraus. Sperrige Songs finden so kein Gehör und es ist unmöglich einen längeren Pfaden zu spinnen.

Letzten Endes bedeutet das ein Loch im Portemonaie. Im schlimmsten Fall ruiniert sich der Musiker mit der Finanzierung eines Albums. Die »Programmierung« eines Kunstwerkes« liegt da nah. Insbesondere die Möglichkeit des »in-app purchase« ermöglicht weitere Verdienstmöglichkeiten. Denn die App selbst ist gratis. Möchte man das Universum erweitern, muss man einzelne Bestandteile über den »in-app purchase« nachkaufen. Ein cleveres Konzept, dass mit dem Spielspaß der Musikliebhaber liebäugelt und gleichzeitig auch einen Sesselmodus bie-tet. Schließlich darf man sich auch einfach zurücklehnen und zusehen, wie sich z.B. bei »Virus« die Viren langsam einer Zelle nähern, um sich anschließend einzunisten und diese zu zerstören. Das macht neugierig auf mehr und den nächsten Song samt Multimediainhalten.">
  <link rel="canonical" href="https://mo.phlow.de/biophilia-bjork-bloom-brian-eno/">

  <meta property="og:title" content="Musikapp Björk und Brian Eno auf Entdeckungsreise ins App-Universum">
  <meta property="og:description" content="Musik-Apps von Musikern kommen langsam in Schwung. Nachdem Brian Eno mit »Bloom« ein spannendes Konzept vorgelegt hat, will jetzt auch Björk mit »Biophilia« das Herz der Musikliebhaber erobern. Beide Musiker betreten aber unterschiedliche Pfade. Ein Vergleich.

Das neue Album von Björk ist mehr a...">
  <meta property="og:url" content="https://mo.phlow.de/biophilia-bjork-bloom-brian-eno/">
  <meta property="og:locale" content="de_DE">
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Sign 'O' The Times">
  <meta property="og:image" content="https://mo.phlow.de/images/bjoerk_biophilia-virus.png">

  <link rel="icon" sizes="32x32" href="https://mo.phlow.de/assets/img/favicon-32x32.png" />
  <link rel="icon" sizes="192x192" href="https://mo.phlow.de/assets/img/touch-icon-192x192.png" />
  <link rel="apple-touch-icon-precomposed" sizes="180x180" href="https://mo.phlow.de/assets/img/apple-touch-icon-180x180-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="152x152" href="https://mo.phlow.de/assets/img/apple-touch-icon-152x152-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://mo.phlow.de/assets/img/apple-touch-icon-144x144-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="120x120" href="https://mo.phlow.de/assets/img/apple-touch-icon-120x120-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://mo.phlow.de/assets/img/apple-touch-icon-114x114-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="76x76" href="https://mo.phlow.de/assets/img/apple-touch-icon-76x76-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://mo.phlow.de/assets/img/apple-touch-icon-72x72-precomposed.png" />
  <link rel="apple-touch-icon-precomposed" href="https://mo.phlow.de/assets/img/apple-touch-icon-precomposed.png" />
  <meta name="msapplication-TileImage" content="https://mo.phlow.de/assets/img/msapplication_tileimage.png" />
  <meta name="msapplication-TileColor" content="#fabb00" />

  <link rel="alternate" type="application/rss+xml" title="RSS Sign 'O' The Times" href="https://mo.phlow.de/feed.xml">
  <link type="text/plain" rel="author" href="https://mo.phlow.de/humans.txt">

  <link rel="stylesheet" href="https://mo.phlow.de/assets/css/styles.css">

    Sign 'O' The Times

    Digitale Kultur / Digitales Leben

  ARTIKEL

   /

  SUCHE

   /

  ÜBER

Musikapp

Björk und Brian Eno auf Entdeckungsreise ins App-Universum

Musik-Apps von Musikern kommen langsam in Schwung. Nachdem Brian Eno mit »Bloom« ein spannendes Konzept vorgelegt hat, will jetzt auch Björk mit »Biophilia« das Herz der Musikliebhaber erobern. Beide Musiker betreten aber unterschiedliche Pfade. Ein Vergleich.

Das neue Album von Björk ist mehr als ein Album. »Biophilia« kombiniert Musik, Kunst, Videos, Spiel und Programmierung als Multimedia-projekt. Sämtliche Formen bündelt Björk in einer iPad-App. »Biophilia« bedeutet wörtlich übersetzt die »Liebe zum Leben« und setzt sich aus den beiden altgriechischen Begriffen »bios« und »philia« zusammen.

Und genau darum dreht sich das Multimediaprojekt. »Leben« transformiert Björk zu einem Universum, in welchem innerhalb der App Musik, Songtexte und Instrumentierung mit Spielen und Interaktionen verknüpft werden. Björk versucht hierbei den Zuhörer als Zuschauer und Mitspieler zu gewinnen. Die Strategie hinter dem Multimediaprojekt zielt auf eine nähere Bindung des Zuhörers. Spielerisch soll dieser sich mit Musik, Texten, Ideen und Bildern auseinandersetzen: mit den Ideen, dem Universum Björks.

Björk ist nicht die erste Musikerin, die sich an einer iPad-App versucht. Ähnliche Wege haben bereits andere bestritten. Andere neugierige und experimentelle Künstler. Wie zum Beispiel Brian Eno, der bereits mit drei Apps für das iPhone und einer App namens »Bloom« für das iPad aufwarten kann. Auch der Ambient-Künstler Brian Eno sucht mit seinen Programmen für die mobile Glasplatten die Interaktion mit dem Benutzer.

Im Gegensatz zu Björk bildet aber nicht ein Musikalbum das Fundament der App, sondern Musik und Harmonielehre selbst. »Bloom« erlaubt als Musikinstrument auf einfache Weise dem Benutzer sanfte, beruhigende und sphärische Musik zu produzieren. Diese läuft in einer Endlos-schleife und füllt den Raum mit New Age-verwandter meditativer Musik.

Die Musik produziert der Benutzer einfach, indem er auf die Bildschirmfläche des iPads tippt. Jede Berührung der iPad-Glasplatte hinterlässt einen Pianotupfer oder runden vollen Sinuston. Die Töne reihen sich dabei in eine Schleife ein, die sich nach einiger Zeit wiederholt. Gleichzeitig erlaubt das Programm dem Musizierenden den Eingriff in verschiedene Parameter und vorgefertigte Stimmungen.

Die Arbeit und Kunstfertigkeit von Brian Eno liegt in der Verknüpfung von Musiktheorie, Klangsynthese und Programmierung. Dahingegen kreiert Björk ein Universum, in welches sie Musikliebhaber entführt, um sie auf Entdeckungsreise in ihr Reich zu begleiten. Die App von Björk ist somit ein spannender Versuch, den Hörer näher an Björk und vertrauter mit der Künstlerin zu machen. Dazu bietet die App zu jedem neuen Song eine Karaokeversion, eine (interaktive) Videoanimation, ein kleines Spiel, Hintergrundinformationen zum Musikstück und den kompletten Notensatz.

Neben den für ein Album typischen Bestandteilen wie Grafiken und Texten zu Songs, bietet die App somit auch wunderschön animierte Karaoke-Videos, in welchen kunstvoll grafisch der Song dahinfließt. Beim Song »Virus« rollen dann die Noten ähnlich wie bei dem Notenpapier einer Drehorgel von links nach rechts über den Bildschirm. Die Noten in Form von Balken variieren dabei in Farbe und Länge. Björks Gesang repräsentiert sich als dünner Faden, auf welchem blaue Kreise immer dann auftauchen, wenn Björk neue Töne und Wörter anstimmt. Die Größe der Kreise stellt dabei die Länge und Lautstärke der gesungenen Noten dar, die mit dem abebben von Tönen kleiner werden.

Gamification: Das Musikalbum als Spielplatz

Jeder neue Song von Björk kommt mit einem neuen kleinen Spiel daher. Während man bei »Cristalline« einen Kristall durch Röhren steuert, um weitere Kristalle durch kippen des iPads aufzusammeln, entpuppt sich das »Spiel« des Songs »Virus« als kleines Miniinstrument, welches auf die Bestandteile des Songs Zugriff erlaubt. Im Vergleich mit »Bloom« von Brian Eno sind die Spielansätze von Björk eher rudimentär und in einem vorgefertigten Korsett festgezurrt. Sie dienen der Auseinandersetzung mit den Song und ihrer Thematik. Die App von Brian Eno bietet dahingegen einen spielerischen Ansatz Musik selbst zu erforschen, zu verstehen und zu komponieren.

Neue Wege für Musiker

Das neue Album von Björk ist interdisziplinär und wäre ohne die technische Unterstützung von Designern und Programmierern so nicht möglich. Neben den Programmieren und Designern hat Björk laut den Informationen zur App auch »mit Künstlern, Wissenschaftlern, Instrumentenherstellern, Autoren und Softwareentwicklern zusammengearbeitet«, um ihre multimediale Entdeckungsreise durch das Universum und seine physikalischen Kräfte, Prozesse und Strukturen zu ermöglichen.

Somit wird auch der Programmierer hier offiziell zum Künstler. Im Zusammenhang mit der »Biophilia« App passt der Programiererslogan »Code is poetry«. Schließlich entsteht aus dem Programmiercode und den mathematischen Algorithmen ein wundersames Kunstwerk. Schon immer hat die experimentelle Isländerin gerne mit Innovatoren der unterschiedlichsten Disziplinen zusammengearbeitet und sich ausprobiert. Jetzt kommt zum ersten Mal die Programmierung samt Algorithmen ins Spiel.

Als Musikerin hat auch Björk mit der Problematik des »Download à la carte« zu kämpfen. Während früher das Musikalbum als Gesamtkunstwerk gekauft wurde, »rupft« heute der Kunde das Album auseinander und pickt sich die Rosinen heraus. Sperrige Songs finden so kein Gehör und es ist unmöglich einen längeren Pfaden zu spinnen.

Letzten Endes bedeutet das ein Loch im Portemonaie. Im schlimmsten Fall ruiniert sich der Musiker mit der Finanzierung eines Albums. Die »Programmierung« eines Kunstwerkes« liegt da nah. Insbesondere die Möglichkeit des »in-app purchase« ermöglicht weitere Verdienstmöglichkeiten. Denn die App selbst ist gratis. Möchte man das Universum erweitern, muss man einzelne Bestandteile über den »in-app purchase« nachkaufen. Ein cleveres Konzept, dass mit dem Spielspaß der Musikliebhaber liebäugelt und gleichzeitig auch einen Sesselmodus bie-tet. Schließlich darf man sich auch einfach zurücklehnen und zusehen, wie sich z.B. bei »Virus« die Viren langsam einer Zelle nähern, um sich anschließend einzunisten und diese zu zerstören. Das macht neugierig auf mehr und den nächsten Song samt Multimediainhalten.

      – <time datetime="2011-08-11T00:00:00+02:00" itemprop="datePublished">11. Aug 2011</time>

      /

        Moritz »mo.« Sauer

<button class="tem2" onclick="myFunction()">Was meinst Du? Kommentar schreiben!</button>

Was meinst Du? Kommentar schreiben!.

      Impressum & Datenschutz /

      Kontakt /

      RSS /
      ↑


text:
<?php

/**
 * @package CRM
 * @copyright CiviCRM LLC (c) 2004-2015
 *
 * Generated from xml/schema/CRM/Core/Job.xml
 * DO NOT EDIT.  Generated by CRM_Core_CodeGen
 */
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
class CRM_Core_DAO_Job extends CRM_Core_DAO
{
  /**
   * static instance to hold the table name
   *
   * @var string
   */
  static $_tableName = 'civicrm_job';
  /**
   * static instance to hold the field values
   *
   * @var array
   */
  static $_fields = null;
  /**
   * static instance to hold the keys used in $_fields for each field.
   *
   * @var array
   */
  static $_fieldKeys = null;
  /**
   * static instance to hold the FK relationships
   *
   * @var string
   */
  static $_links = null;
  /**
   * static instance to hold the values that can
   * be imported
   *
   * @var array
   */
  static $_import = null;
  /**
   * static instance to hold the values that can
   * be exported
   *
   * @var array
   */
  static $_export = null;
  /**
   * static value to see if we should log any modifications to
   * this table in the civicrm_log table
   *
   * @var boolean
   */
  static $_log = false;
  /**
   * Job Id
   *
   * @var int unsigned
   */
  public $id;
  /**
   * Which Domain is this scheduled job for
   *
   * @var int unsigned
   */
  public $domain_id;
  /**
   * Scheduled job run frequency.
   *
   * @var string
   */
  public $run_frequency;
  /**
   * When was this cron entry last run
   *
   * @var datetime
   */
  public $last_run;
  /**
   * Title of the job
   *
   * @var string
   */
  public $name;
  /**
   * Description of the job
   *
   * @var string
   */
  public $description;
  /**
   * Entity of the job api call
   *
   * @var string
   */
  public $api_entity;
  /**
   * Action of the job api call
   *
   * @var string
   */
  public $api_action;
  /**
   * List of parameters to the command.
   *
   * @var text
   */
  public $parameters;
  /**
   * Is this job active?
   *
   * @var boolean
   */
  public $is_active;
  /**
   * class constructor
   *
   * @return civicrm_job
   */
  function __construct()
  {
    $this->__table = 'civicrm_job';
    parent::__construct();
  }
  /**
   * Returns foreign keys and entity references
   *
   * @return array
   *   [CRM_Core_Reference_Interface]
   */
  static function getReferenceColumns()
  {
    if (!self::$_links) {
      self::$_links = static ::createReferenceColumns(__CLASS__);
      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
    }
    return self::$_links;
  }
  /**
   * Returns all the column names of this table
   *
   * @return array
   */
  static function &fields()
  {
    if (!(self::$_fields)) {
      self::$_fields = array(
        'id' => array(
          'name' => 'id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Job ID') ,
          'description' => 'Job Id',
          'required' => true,
        ) ,
        'domain_id' => array(
          'name' => 'domain_id',
          'type' => CRM_Utils_Type::T_INT,
          'title' => ts('Job Domain') ,
          'description' => 'Which Domain is this scheduled job for',
          'required' => true,
          'FKClassName' => 'CRM_Core_DAO_Domain',
          'pseudoconstant' => array(
            'table' => 'civicrm_domain',
            'keyColumn' => 'id',
            'labelColumn' => 'name',
          )
        ) ,
        'run_frequency' => array(
          'name' => 'run_frequency',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Job Frequency') ,
          'description' => 'Scheduled job run frequency.',
          'maxlength' => 8,
          'size' => CRM_Utils_Type::EIGHT,
          'default' => 'Daily',
          'html' => array(
            'type' => 'Select',
          ) ,
          'pseudoconstant' => array(
            'callback' => 'CRM_Core_SelectValues::getJobFrequency',
          )
        ) ,
        'last_run' => array(
          'name' => 'last_run',
          'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
          'title' => ts('Last Run') ,
          'description' => 'When was this cron entry last run',
          'default' => 'NULL',
        ) ,
        'name' => array(
          'name' => 'name',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Job Name') ,
          'description' => 'Title of the job',
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
        ) ,
        'description' => array(
          'name' => 'description',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('Job Description') ,
          'description' => 'Description of the job',
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
        ) ,
        'api_entity' => array(
          'name' => 'api_entity',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('API Entity') ,
          'description' => 'Entity of the job api call',
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
        ) ,
        'api_action' => array(
          'name' => 'api_action',
          'type' => CRM_Utils_Type::T_STRING,
          'title' => ts('API Action') ,
          'description' => 'Action of the job api call',
          'maxlength' => 255,
          'size' => CRM_Utils_Type::HUGE,
        ) ,
        'parameters' => array(
          'name' => 'parameters',
          'type' => CRM_Utils_Type::T_TEXT,
          'title' => ts('API Parameters') ,
          'description' => 'List of parameters to the command.',
          'rows' => 4,
          'cols' => 60,
          'html' => array(
            'type' => 'TextArea',
          ) ,
        ) ,
        'is_active' => array(
          'name' => 'is_active',
          'type' => CRM_Utils_Type::T_BOOLEAN,
          'title' => ts('Job Is Active?') ,
          'description' => 'Is this job active?',
        ) ,
      );
    }
    return self::$_fields;
  }
  /**
   * Returns an array containing, for each field, the arary key used for that
   * field in self::$_fields.
   *
   * @return array
   */
  static function &fieldKeys()
  {
    if (!(self::$_fieldKeys)) {
      self::$_fieldKeys = array(
        'id' => 'id',
        'domain_id' => 'domain_id',
        'run_frequency' => 'run_frequency',
        'last_run' => 'last_run',
        'name' => 'name',
        'description' => 'description',
        'api_entity' => 'api_entity',
        'api_action' => 'api_action',
        'parameters' => 'parameters',
        'is_active' => 'is_active',
      );
    }
    return self::$_fieldKeys;
  }
  /**
   * Returns the names of this table
   *
   * @return string
   */
  static function getTableName()
  {
    return self::$_tableName;
  }
  /**
   * Returns if this table needs to be logged
   *
   * @return boolean
   */
  function getLog()
  {
    return self::$_log;
  }
  /**
   * Returns the list of fields that can be imported
   *
   * @param bool $prefix
   *
   * @return array
   */
  static function &import($prefix = false)
  {
    if (!(self::$_import)) {
      self::$_import = array();
      $fields = self::fields();
      foreach($fields as $name => $field) {
        if (CRM_Utils_Array::value('import', $field)) {
          if ($prefix) {
            self::$_import['job'] = & $fields[$name];
          } else {
            self::$_import[$name] = & $fields[$name];
          }
        }
      }
    }
    return self::$_import;
  }
  /**
   * Returns the list of fields that can be exported
   *
   * @param bool $prefix
   *
   * @return array
   */
  static function &export($prefix = false)
  {
    if (!(self::$_export)) {
      self::$_export = array();
      $fields = self::fields();
      foreach($fields as $name => $field) {
        if (CRM_Utils_Array::value('export', $field)) {
          if ($prefix) {
            self::$_export['job'] = & $fields[$name];
          } else {
            self::$_export[$name] = & $fields[$name];
          }
        }
      }
    }
    return self::$_export;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.higherstate.jameson.validators

import org.higherstate.jameson.Path
import org.higherstate.jameson.failures.InvalidValueFailure

object IsUnique extends Validator  {

  def apply(value:Any, path:Path) =
    value match {
      case n:Seq[_] =>
        if (n.toSet.size != n.size) Some(InvalidValueFailure(this, "Elements in sequence are not unique", n, path))
        else None
      case v =>
        Some(InvalidValueFailure(this, "Value does not have a elements", v, path))
    }

  def schema = Map("uniqueItems" -> true)
}


text:
#import <CoreLocation/CoreLocation.h>

@interface CDYLocation : CLLocation

@property (nonatomic, assign) NSTimeInterval timeToNextLocation;

@end


text:
package cli

import (
	"fmt"
	"os"
	"time"

	"github.com/boltdb/bolt"
	"github.com/spolabs/spo/src/cipher"
	"github.com/spolabs/spo/src/visor"
	gcli "github.com/urfave/cli"
)

const (
	genesisPubkey = "0328c576d3f420e7682058a981173a4b374c7cc5ff55bf394d3cf57059bbe6456a"
)

func checkdbCmd() gcli.Command {
	name := "checkdb"
	return gcli.Command{
		Name:         name,
		Usage:        "Verify the database",
		ArgsUsage:    "[db path]",
		Description:  "If no argument is specificed, the default data.db in $HOME/.$COIN/ will be checked.",
		OnUsageError: onCommandUsageError(name),
		Action:       checkdb,
	}
}

func checkdb(c *gcli.Context) error {
	cfg := ConfigFromContext(c)

	// get db path
	dbpath, err := resolveDBPath(cfg, c.Args().First())
	if err != nil {
		return err
	}

	// check if this file is exist
	if _, err := os.Stat(dbpath); os.IsNotExist(err) {
		return fmt.Errorf("db file: %v does not exist", dbpath)
	}

	db, err := bolt.Open(dbpath, 0600, &bolt.Options{
		Timeout: 5 * time.Second,
	})

	if err != nil {
		return fmt.Errorf("open db failed: %v", err)
	}
	pubkey, err := cipher.PubKeyFromHex(genesisPubkey)
	if err != nil {
		return fmt.Errorf("decode genesis pubkey failed: %v", err)
	}

	if err := IntegrityCheck(db, pubkey); err != nil {
		return fmt.Errorf("checkdb failed: %v", err)
	}

	fmt.Println("check db success")
	return nil
}

func IntegrityCheck(db *bolt.DB, genesisPubkey cipher.PubKey) error {
	_, err := visor.NewBlockchain(db, genesisPubkey, visor.Arbitrating(true))
	return err
}


text:
define(['lib/news_special/bootstrap', 'bump-3'], function (news, bump) {

    var Video = function (videoContainerSelector, vpid, holdingImage) {
        this.selector = videoContainerSelector;
        this.$videoContainer = news.$(this.selector);
        this.videoEl = bump(this.selector).find('.section_video');
        this.vpid = vpid;
        this.holdingImage = holdingImage;
        this.mp = null;
        this.$overlay = this.$videoContainer.find('.section_video_overlay');
        this.cta_breakpoint = 612;

        this.init();
    };

    Video.prototype = {
        init: function () {
            this.$videoContainer.on('click', this.playVideo.bind(this));

            var playerSettings = {
                product: 'news',
                playlistObject: {
                    items : [{
                        vpid : this.vpid
                    }],
                    holdingImageURL: this.holdingImage
                },
                responsive: true,
                autoplay: false
            };
            this.mp = this.videoEl.player(playerSettings);
            this.mp.load();
            this.setEvents();

            if (this.getVideoWidth() >= this.cta_breakpoint) {
                this.disableSmpCta();
            }
        },

        setEvents: function () {
            this.mp.bind('ended', this.videoEnded.bind(this));
            this.mp.bind('playing', this.hideOverlay.bind(this));

            var self = this;
            news.$(window).on('resize', function () {
                if (self.getVideoWidth() >= self.cta_breakpoint) {
                    self.disableSmpCta();
                } else {
                    self.enableSmpCta();
                }
            });
        },

        playVideo: function () {
            this.hideOverlay();
            this.mp.play();
        },

        hideOverlay: function () {
            this.$overlay.addClass('section_video_overlay-hidden');
        },

        videoEnded: function () {
            this.$overlay.removeClass('section_video_overlay-hidden');
        },

        videoStop: function () {
            this.videoEnded();
            this.mp.stop();
        },

        getVideoWidth: function () {
            return this.$videoContainer.width();
        },

        disableSmpCta: function () {
            var ui_config = {
                cta: { enabled: false }
            };
            this.mp.updateUiConfig(ui_config);
        },

        enableSmpCta: function () {
            var ui_config = {
                cta: { enabled: true }
            };
            this.mp.updateUiConfig(ui_config);
        }
    };

    return Video;
});


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Connaropsis sericea Ridl.

### Remarks
null


text:
package org.insightech.er.editor.model.dbexport.ddl.validator.rule.table;

import java.util.ArrayList;
import java.util.List;

import org.insightech.er.db.DBManager;
import org.insightech.er.db.DBManagerFactory;
import org.insightech.er.editor.model.ERDiagram;
import org.insightech.er.editor.model.dbexport.ddl.validator.ValidateResult;
import org.insightech.er.editor.model.dbexport.ddl.validator.rule.BaseRule;
import org.insightech.er.editor.model.diagram_contents.element.node.table.ERTable;

public abstract class TableRule extends BaseRule {

	private List<ValidateResult> errorList;

	private String database;

	public TableRule() {
		this.errorList = new ArrayList<ValidateResult>();
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	protected void addError(ValidateResult errorMessage) {
		this.errorList.add(errorMessage);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public List<ValidateResult> getErrorList() {
		return this.errorList;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void clear() {
		this.errorList.clear();
	}

	public boolean validate(ERDiagram diagram) {
		this.database = diagram.getDatabase();

		for (ERTable table : diagram.getDiagramContents().getContents()
				.getTableSet()) {
			if (!this.validate(table)) {
				return false;
			}
		}

		return true;
	}

	protected DBManager getDBManager() {
		return DBManagerFactory.getDBManager(this.database);
	}

	abstract public boolean validate(ERTable table);
}


text:
<?php
/*-----------------------------------------------------------------------------------*/
/* CoLabsThemes Theme Version */
/*-----------------------------------------------------------------------------------*/
function colabs_version_init() {

    $colabs_framework_version = '1.5.1';

    if ( get_option( 'colabs_framework_version' ) != $colabs_framework_version ) {
    	update_option( 'colabs_framework_version', $colabs_framework_version );
    }

}

add_action( 'init', 'colabs_version_init', 10 );

function colabs_version(){

    $colabs_framework_version = get_option( 'colabs_framework_version' );

	echo "\n<!-- Theme version -->\n";
    echo '<meta name="generator" content="'. esc_attr( get_option( 'colabs_themename' ) ) . ' ' . COLABS_THEME_VER . '" />' ."\n";
    echo '<meta name="generator" content="CoLabsFramework '. esc_attr( $colabs_framework_version ) .'" />' ."\n";

}

// Add or remove Generator meta tags
if ( 'true' == get_option( 'framework_colabs_disable_generator' ) ) {
	remove_action( 'wp_head',  'wp_generator' );
} else {
	add_action( 'wp_head', 'colabs_version', 10 );
}

// Define directory constants
define('COLABS_FRAMEWORK', get_template_directory_uri() . '/functions');
define('COLABS_FRAMEWORK_CSS', COLABS_FRAMEWORK . '/css');
define('COLABS_FRAMEWORK_IMAGES', COLABS_FRAMEWORK . '/images');
define('COLABS_FRAMEWORK_JS', COLABS_FRAMEWORK . '/js');
define('COLABS_FUNCTIONS', get_template_directory_uri() . '/includes');
define('COLABS_FUNCTIONS_CSS', COLABS_FUNCTIONS . '/css');
define('COLABS_FUNCTIONS_JS', COLABS_FUNCTIONS . '/js');
define('COLABS_FUNCTIONS_WIDGETS', COLABS_FUNCTIONS . '/widgets');
define('COLABS_CUSTOM', get_stylesheet_directory() . '/custom');
if ( function_exists( 'wp_get_theme' ) ){
	$theme_data = wp_get_theme();
    $theme_version = $theme_data->Version;
	$theme_name = $theme_data->Name;
}
define( 'COLABS_THEME_VER', $theme_version );
define( 'COLABS_THEME_NAME', $theme_name );
/*-----------------------------------------------------------------------------------*/
/* Load the required Admin Panel Files */
/*-----------------------------------------------------------------------------------*/
$functions_path = get_template_directory() . '/functions/';
require_once ($functions_path . 'admin-functions.php');				// Custom functions and plugins
require_once ($functions_path . 'admin-setup.php');					// Options panel variables and functions
require_once ($functions_path . 'admin-custom.php');                // Custom fields
require_once ($functions_path . 'admin-interface.php');				// Admin Interfaces (options,framework, seo)
require_once ($functions_path . 'admin-interface-functions.php');	// Admin Interface - Functions
require_once ($functions_path . 'admin-framework-settings.php' );	// Framework Settings
require_once ($functions_path . 'admin-dashboard.php' );            // Dashboard Settings
require_once ($functions_path . 'admin-layout.php' );               // Layout Settings
require_once ($functions_path . 'admin-editor.php' );               // Custom File Editor
require_once ($functions_path . 'admin-seo.php');					// Admin Panel SEO controls
require_once ($functions_path . 'admin-medialibrary-uploader.php'); // Admin Panel Media Library Uploader Functions // 2011-28-05.
require_once ($functions_path . 'admin-readme.php');				// Admin Panel Readme Function
require_once ($functions_path . 'admin-hooks.php');					// Definition of CoLabsHooks
require_once ($functions_path . 'admin-sbm.php' ); 					// Framework Sidebar Manager
require_once ($functions_path . 'admin-shortcode-generator.php'); 	// Admin Panel Shortcode generator // 2011-05-27.
require_once ($functions_path . 'admin-shortcodes.php');			// CoLabs Shortcodes
require_once ($functions_path . 'admin-backup.php' ); 				// Theme Options Backup // 2011-08-26.
/*-----------------------------------------------------------------------------------*/
/* Load the required action */
/*-----------------------------------------------------------------------------------*/

?>


text:
title: How Weave Net Interprets Network Topology
menu_order: 20
---

This section contains the following topics:

 * [Communicating Topology Among Peers](#topology)
 * [How Messages are Formed](#messages)
 * [Removing Peers](#removing-peers)
 * [What Happens When The Topology is Out of Date?](#out-of-date-topology)

###Communicating Topology Among Peers

Topology messages capture which peers are connected to other peers.
Weave peers communicate their knowledge of the topology
(and changes to it) to others, so that all peers learn about the
entire topology.

Communication between peers occurs over TCP links using:
a) a spanning-tree based broadcast mechanism, and b) a
neighbor gossip mechanism.

Topology messages are sent by a peer in the following instances:

- when a connection has been added; if the remote peer appears to be
  new to the network, the entire topology is sent to it, and an
  incremental update, containing information on just the two peers at
  the ends of the connection, is broadcast,
- when a connection has been marked as 'established', indicating that
  the remote peer can receive UDP traffic from the peer; an update
  containing just information about the local peer is broadcast,
- when a connection has been torn down; an update containing just
  information about the local peer is broadcast,
- periodically, on a timer, the entire topology is "gossiped" to a
  subset of neighbors, based on a topology-sensitive random
  distribution. This is done in case some of the aforementioned
  broadcasts do not reach all peers, due to rapid changes in the
  topology causing broadcast routing tables to become outdated.

The receiver of a topology update merges that update with its own
topology model, adding peers hitherto unknown to it, and updating
peers for which the update contains a more recent version than known
to it. If there were any such new/updated peers, and the topology
update was received over gossip (rather than broadcast), then an
improved update containing them is gossiped.

If the update mentions a peer that the receiver does not know, then
the entire update is ignored.

####How Messages Are Formed

Every gossip message is structured as follows:

    +-----------------------------------+
    | 1-byte message type - Gossip      |
    +-----------------------------------+
    | 4-byte Gossip channel - Topology  |
    +-----------------------------------+
    | Peer Name of source               |
    +-----------------------------------+
    | Gossip payload (topology update)  |
    +-----------------------------------+

The topology update payload is laid out like this:

    +-----------------------------------+
    | Peer 1: Name                      |
    +-----------------------------------+
    | Peer 1: NickName                  |
    +-----------------------------------+
    | Peer 1: UID                       |
    +-----------------------------------+
    | Peer 1: Version number            |
    +-----------------------------------+
    | Peer 1: List of connections       |
    +-----------------------------------+
    |                ...                |
    +-----------------------------------+
    | Peer N: Name                      |
    +-----------------------------------+
    | Peer N: NickName                  |
    +-----------------------------------+
    | Peer N: UID                       |
    +-----------------------------------+
    | Peer N: Version number            |
    +-----------------------------------+
    | Peer N: List of connections       |
    +-----------------------------------+

Each List of connections is encapsulated as a byte buffer, within
which the structure is:

    +-----------------------------------+
    | Connection 1: Remote Peer Name    |
    +-----------------------------------+
    | Connection 1: Remote IP address   |
    +-----------------------------------+
    | Connection 1: Outbound            |
    +-----------------------------------+
    | Connection 1: Established         |
    +-----------------------------------+
    | Connection 2: Remote Peer Name    |
    +-----------------------------------+
    | Connection 2: Remote IP address   |
    +-----------------------------------+
    | Connection 2: Outbound            |
    +-----------------------------------+
    | Connection 2: Established         |
    +-----------------------------------+
    |                ...                |
    +-----------------------------------+
    | Connection N: Remote Peer Name    |
    +-----------------------------------+
    | Connection N: Remote IP address   |
    +-----------------------------------+
    | Connection N: Outbound            |
    +-----------------------------------+
    | Connection N: Established         |
    +-----------------------------------+

####Removing Peers

If a peer, after receiving a topology update, sees that another peer
no longer has any connections within the network, it drops all
knowledge of that second peer.

####What Happens When The Topology is Out of Date?

The propagation of topology changes to all peers is not instantaneous.
Therefore, it is very possible for a node elsewhere in the network to have an
out-of-date view.

If the destination peer for a packet is still reachable, then
out-of-date topology can result in it taking a less efficient route.

If the out-of-date topology makes it look as if the destination peer
is not reachable, then the packet is dropped.  For most protocols
(for example, TCP), the transmission will be retried a short time later, by
which time the topology should have updated.

**See Also**

 * [Weave Net Router Encapsulation](/site/how-it-works/router-encapsulation.md)


text:
I am ZnCallHierarchyRestUriSpace.
I am a ZnRestUriSpace.

I represent a class hierarchy of REST call subclasses, below my root class.


text:
package com.serial.Messages;

import com.map.Dot;
import com.serial.Serial;
import jssc.SerialPort;
import jssc.SerialPortException;

import java.util.*;

public class Message {
    protected byte[] content;
    protected byte[] checkPair;
    protected int    checkSum;
    protected int    confirmSum;
    protected int    failCount;
    protected Date   sent;

    protected Message() { //subclasses must call buildChecksums after making content
        failCount = 0;
    }

    public Message(byte[] data) {
        failCount	= 0;
        content     = data.clone();
        buildChecksum();
    }

    public void sendTime(Date date) {
        sent = (Date)date.clone();
    }

    public boolean isConfirmedBy(int confirmation) {
        return ((confirmation&0xFFFF) == (confirmSum&0xFFFF));
    }

    public boolean isPastExpiration(Date now) {
        return (now.getTime()-sent.getTime()) > Serial.MAX_CONFIRM_WAIT_MS;
    }

    public void addFailure() {
        failCount++;
    }

    public int numberOfFailures() {
        return failCount;
    }

    public int getConfirmSum() {
        return confirmSum;
    }

    public void send(SerialPort port) throws SerialPortException {
        port.writeBytes(Serial.HEADER);
        port.writeBytes(content);
        port.writeBytes(checkPair);
        port.writeBytes(Serial.FOOTER);
        sent = new Date();
    }

    private byte[] concat(byte[] a, byte[] b) {
        byte[] c = new byte[a.length+b.length];
        for(int i=0; i< a.length; i++) {
            c[i] = a[i];
        }
        for(int i=0; i< b.length; i++) {
            c[i+a.length] = b[i];
        }
        return c;
    }

    protected void buildChecksum() {
        checkPair  = Serial.fletcher16bytes(content);
        confirmSum = Serial.fletcher16( concat(content,checkPair) )&0xffff;
    }

    //these should be overridden
    public boolean needsConfirm() {
        return false;
    }

    @Override
    public String toString() {
        return "A message";
    }

    public static Message setWaypoint(byte index, Dot dot) {
        return new WaypointMessage(Serial.ALTER_WAYPOINT, index, dot);
    }

    public static Message addWaypoint(byte index, Dot dot) {
        return new WaypointMessage(Serial.ADD_WAYPOINT, index, dot);
    }

    public static Message confirmSum(int sum) {
        return new WordMessage(Serial.CONFIRMATION, sum);
    }

    public static Message syncMessage(byte resync) {
        return new WordMessage(Serial.SYNC_WORD, resync, (byte)0);
    }

    public static Message telemetry(byte index, float data) {
        return new DataMessage(Serial.TELEMETRY_DATA, index, data);
    }

    public static Message setSetting(byte index, float data) {
        return new DataMessage(Serial.SETTING_DATA, index, data);
    }

    public static Message sensor(byte index, float data) {
    	return new DataMessage(Serial.SENSOR_DATA, index, data);
    }

    public static Message errorString(String err) {
        return new StringMessage(Serial.ERROR_STRING, err);
    }

    public static Message stateString(String state) {
        return new StringMessage(Serial.STATE_STRING, state);
    }

    public static Message command(byte cmd, byte spec) {
        return new WordMessage(Serial.COMMAND_WORD, cmd, spec);
    }

    public static Message estop() {
        return new WordMessage(Serial.COMMAND_WORD, Serial.ESTOP_CMD, (byte)0);
    }

    public static Message setTarget(byte index) {
        return new WordMessage(Serial.COMMAND_WORD, Serial.TARGET_CMD, index);
    }

    public static Message setLooping(byte index) {
        return new WordMessage(Serial.COMMAND_WORD, Serial.LOOPING_CMD, index);
    }

    public static Message clearWaypoints() {
        return new WordMessage(Serial.COMMAND_WORD, Serial.CLEAR_CMD, (byte)0);
    }

    public static Message deleteWaypoint(byte index) {
        return new WordMessage(Serial.COMMAND_WORD, Serial.DELETE_CMD, index);
    }

    public static Message stopDriving() {
    	return new WordMessage(Serial.COMMAND_WORD, Serial.STOP_CMD, (byte)0);
    }

    public static Message startDriving() {
    	return new WordMessage(Serial.COMMAND_WORD, Serial.START_CMD, (byte)0);
    }

    public static Message requestAPMVersion() {
    	return new DataMessage(Serial.INFO_DATA, (byte)Serial.APM_VERSION, (byte)0);
    }

    public static Message enableBumper() {
    	return new WordMessage(Serial.COMMAND_WORD, Serial.ENABLE_BUMPER_CMD, (byte)0);
    }

    public static Message disableBumper() {
    	return new WordMessage(Serial.COMMAND_WORD, Serial.DISABLE_BUMPER_CMD, (byte)0);
    }
}


text:
package org.codehaus.mojo.exec;

import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.apache.maven.toolchain.MisconfiguredToolchainException;
import org.apache.maven.toolchain.RequirementMatcherFactory;
import org.apache.maven.toolchain.ToolchainFactory;
import org.apache.maven.toolchain.ToolchainPrivate;
import org.apache.maven.toolchain.model.ToolchainModel;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.xml.Xpp3Dom;

/**
 * Factory for {@link PathsToolchain}.
 *
 * @author Markus KARG (markus@headcrashing.eu)
 */
@Component( role = ToolchainFactory.class, hint = "paths" )
class PathsToolchainFactory
    implements ToolchainFactory
{

    @Requirement
    private Logger logger;

    public ToolchainPrivate createToolchain( final ToolchainModel model )
        throws MisconfiguredToolchainException
    {
        if ( model == null )
            return null;

        final PathsToolchain pathsToolchain = new PathsToolchain( model, this.logger );
        final Properties provides = this.getProvidesProperties( model );
        for ( final Map.Entry<Object, Object> provide : provides.entrySet() )
        {
            final String key = (String) provide.getKey();
            final String value = (String) provide.getValue();
            if ( value == null )
                throw new MisconfiguredToolchainException( "Provides token '" + key
                    + "' doesn't have any value configured." );

            pathsToolchain.addProvideToken( key, RequirementMatcherFactory.createExactMatcher( value ) );
        }

        final Xpp3Dom config = (Xpp3Dom) model.getConfiguration();
        if ( config == null )
            return pathsToolchain;

        final Xpp3Dom pathDom = config.getChild( "paths" );
        if ( pathDom == null )
            return pathsToolchain;

        final Xpp3Dom[] pathDoms = pathDom.getChildren( "path" );
        if ( pathDoms == null || pathDoms.length == 0 )
            return pathsToolchain;

        final List<String> paths = new ArrayList<String>( pathDoms.length );
        for ( final Xpp3Dom pathdom : pathDoms )
        {
            final String pathString = pathdom.getValue();

            if ( pathString == null )
                throw new MisconfiguredToolchainException( "path element is empty" );

            final String normalizedPath = FileUtils.normalize( pathString );
            final File file = new File( normalizedPath );
            if ( !file.exists() )
                throw new MisconfiguredToolchainException( "Non-existing path '" + file.getAbsolutePath() + "'" );

            paths.add( normalizedPath );
        }

        pathsToolchain.setPaths( paths );

        return pathsToolchain;
    }

    public ToolchainPrivate createDefaultToolchain()
    {
        return null;
    }

    protected Properties getProvidesProperties( final ToolchainModel model )
    {
        final Object value = this.getBeanProperty( model, "provides" );

        return value instanceof Properties ? (Properties) value : toProperties( (Xpp3Dom) value );
    }

    protected static Properties toProperties( final Xpp3Dom dom )
    {
        final Properties props = new Properties();

        final Xpp3Dom[] children = dom.getChildren();
        for ( final Xpp3Dom child : children )
            props.put( child.getName(), child.getValue() );

        return props;
    }

    protected Object getBeanProperty( final Object obj, final String property )
    {
        try
        {
            final Method method = new PropertyDescriptor( property, obj.getClass() ).getReadMethod();

            return method.invoke( obj );
        }
        catch ( final IntrospectionException e )
        {
            throw new RuntimeException( "Incompatible toolchain API", e );
        }
        catch ( final IllegalAccessException e )
        {
            throw new RuntimeException( "Incompatible toolchain API", e );
        }
        catch ( final InvocationTargetException e )
        {
            final Throwable cause = e.getCause();

            if ( cause instanceof RuntimeException )
                throw (RuntimeException) cause;

            throw new RuntimeException( "Incompatible toolchain API", e );
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />

  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="lang:clipboard.copy" content="Copy to clipboard">
  <meta name="lang:clipboard.copied" content="Copied to clipboard">
  <meta name="lang:search.language" content="en">
  <meta name="lang:search.pipeline.stopwords" content="True">
  <meta name="lang:search.pipeline.trimmer" content="True">
  <meta name="lang:search.result.none" content="No matching documents">
  <meta name="lang:search.result.one" content="1 matching document">
  <meta name="lang:search.result.other" content="# matching documents">
  <meta name="lang:search.tokenizer" content="[\s\-]+">

    <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin>
    <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet">

  <link rel="stylesheet" href="../_static/stylesheets/application.css"/>
  <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/>
  <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/>

  <link rel="stylesheet" href="../_static/fonts/material-icons.css"/>

  <meta name="theme-color" content="#3f51b5">

    <title>statsmodels.duration.hazard_regression.PHReg — statsmodels</title>
  <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png">
  <link rel="manifest" href="../_static/icons/site.webmanifest">
  <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191">
  <meta name="msapplication-TileColor" content="#2b5797">
  <meta name="msapplication-config" content="../_static/icons/browserconfig.xml">
  <link rel="stylesheet" href="../_static/stylesheets/examples.css">
    <link rel="stylesheet" href="../_static/material.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />

    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="statsmodels.duration.hazard_regression.PHReg.baseline_cumulative_hazard" href="statsmodels.duration.hazard_regression.PHReg.baseline_cumulative_hazard.html" />
    <link rel="prev" title="statsmodels.duration.survfunc.SurvfuncRight.summary" href="statsmodels.duration.survfunc.SurvfuncRight.summary.html" />

  <svg class="md-svg">
    <defs data-children-count="0">

      <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg>

    </defs>
  </svg>

  <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer">
  <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search">

   Skip to content

          statsmodels v0.11.1
           statsmodels.duration.hazard_regression.PHReg

    <form class="md-search__form" action="../search.html" method="GET" name="search">
      <input type="text" class="md-search__input" name="q" placeholder="Search"
             autocapitalize="off" autocomplete="off" spellcheck="false"
             data-md-component="query" data-md-state="active">

      <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
        
      </button>
    </form>

            Type to start searching

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
        <use xlink:href="#__github" width="24" height="24"></use>
      </svg>

    statsmodels

User Guide

Methods for Survival and Duration Analysis

    statsmodels v0.11.1

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28">
        <use xlink:href="#__github" width="24" height="24"></use>
      </svg>

    statsmodels

      Installing statsmodels

      Getting started

      User Guide

      Background

      Regression and Linear Models

      Time Series Analysis

      Other Models

      Methods for Survival and Duration Analysis

      Nonparametric Methods nonparametric

      Generalized Method of Moments gmm

      Other Models miscmodels

      Multivariate Statistics multivariate

      Statistics and Tools

      Data Sets

      Sandbox

      Examples

      API Reference

      About statsmodels

      Developer Page

      Release Notes

Show Source

statsmodels.duration.hazard_regression.PHReg¶

class statsmodels.duration.hazard_regression.PHReg(endog, exog, status=None, entry=None, strata=None, offset=None, ties='breslow', missing='drop', **kwargs)[source]¶

Cox Proportional Hazards Regression Model

The Cox PH Model is for right censored data.

Parameters

endogarray_like

The observed times (event or censoring)

exog2D array_like

The covariates or exogeneous variables

statusarray_like

The censoring status values; status=1 indicates that an
event occurred (e.g. failure or death), status=0 indicates
that the observation was right censored. If None, defaults
to status=1 for all cases.

entryarray_like

The entry times, if left truncation occurs

strataarray_like

Stratum labels.  If None, all observations are taken to be
in a single stratum.

tiesstr

The method used to handle tied times, must be either 'breslow'
or 'efron'.

offsetarray_like

Array of offset values

missingstr

The method used to handle missing data

Notes

Proportional hazards regression models should not include an
explicit or implicit intercept.  The effect of an intercept is
not identified using the partial likelihood approach.

endog, event, strata, entry, and the first dimension
of exog all must have the same length

Methods

<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>

baseline_cumulative_hazard(params)

Estimate the baseline cumulative hazard and survival functions.

baseline_cumulative_hazard_function(params)

Returns a function that calculates the baseline cumulative hazard function for each stratum.

breslow_gradient(params)

Returns the gradient of the log partial likelihood, using the Breslow method to handle tied times.

breslow_hessian(params)

Returns the Hessian of the log partial likelihood evaluated at params, using the Breslow method to handle tied times.

breslow_loglike(params)

Returns the value of the log partial likelihood function evaluated at params, using the Breslow method to handle tied times.

efron_gradient(params)

Returns the gradient of the log partial likelihood evaluated at params, using the Efron method to handle tied times.

efron_hessian(params)

Returns the Hessian matrix of the partial log-likelihood evaluated at params, using the Efron method to handle tied times.

efron_loglike(params)

Returns the value of the log partial likelihood function evaluated at params, using the Efron method to handle tied times.

fit([groups])

Fit a proportional hazards regression model.

fit_regularized([method, alpha, …])

Return a regularized fit to a linear regression model.

from_formula(formula, data[, status, entry, …])

Create a proportional hazards regression model from a formula and dataframe.

get_distribution(params)

Returns a scipy distribution object corresponding to the distribution of uncensored endog (duration) values for each case.

hessian(params)

Returns the Hessian matrix of the log partial likelihood function evaluated at params.

information(params)

Fisher information matrix of model.

initialize()

Initialize (possibly re-initialize) a Model instance.

loglike(params)

Returns the log partial likelihood function evaluated at params.

predict(params[, exog, cov_params, endog, …])

Returns predicted values from the proportional hazards regression model.

robust_covariance(params)

Returns a covariance matrix for the proportional hazards model regresion coefficient estimates that is robust to certain forms of model misspecification.

score(params)

Returns the score function evaluated at params.

score_residuals(params)

Returns the score residuals calculated at a given vector of parameters.

weighted_covariate_averages(params)

Returns the hazard-weighted average of covariate values for subjects who are at-risk at a particular time.

Properties

<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>

endog_names

Names of endogenous variables.

exog_names

Names of exogenous variables.

                   Previous  statsmodels.duration.survfunc.SurvfuncRight.summary

  Next  statsmodels.duration.hazard_regression.PHReg.baseline_cumulative_hazard

              © Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.

            Last updated on
              Feb 21, 2020.

            Created using
            Sphinx 2.4.2.
             and
            Material for
              Sphinx


text:
if [[ $MARATHONVERSION != '0.8.1' ]]; then
  LOGGER="--no-logger"
else
  LOGGER=""
fi

exec marathon --master local $LOGGER --hostname localhost


text:
package org.apache.pdfbox.pdmodel.interactive.form;

import static org.junit.Assert.assertEquals;

import java.io.IOException;

import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget;

import org.junit.Before;
import org.junit.Test;

/**
 * Test for the PDSignatureField class.
 *
 */
public class PDSignatureFieldTest
{
    private PDDocument document;
    private PDAcroForm acroForm;

    @Before
    public void setUp()
    {
        document = new PDDocument();
        acroForm = new PDAcroForm(document);
    }

    @Test
    public void createDefaultSignatureField() throws IOException
    {
        PDSignatureField sigField = new PDSignatureField(acroForm);

        assertEquals(sigField.getFieldType(), sigField.getCOSObject().getNameAsString(COSName.FT));
        assertEquals(sigField.getFieldType(), "Sig");

        assertEquals(COSName.ANNOT, sigField.getCOSObject().getItem(COSName.TYPE));
        assertEquals(PDAnnotationWidget.SUB_TYPE, sigField.getCOSObject().getNameAsString(COSName.SUBTYPE));
    }
}


text:
from __future__ import absolute_import
from __future__ import print_function

import sys
import string
import random
from six.moves import range
from typing import List, Dict

import zulip
from slacker import Slacker, Response, Error as SlackError

import zulip_slack_config as config

client = zulip.Client(email=config.ZULIP_USER, api_key=config.ZULIP_API_KEY, site=config.ZULIP_SITE)

class FromSlackImporter(object):
    def __init__(self, slack_token, get_archived_channels=True):
        # type: (str, bool) -> None
        self.slack = Slacker(slack_token)
        self.get_archived_channels = get_archived_channels

        self._check_slack_token()

    def get_slack_users_email(self):
        # type: () -> Dict[str, Dict[str, str]]

        r = self.slack.users.list()
        self._check_if_response_is_successful(r)
        results_dict = {}
        for user in r.body['members']:
            if user['profile'].get('email') and user.get('deleted') is False:
                results_dict[user['id']] = {'email': user['profile']['email'], 'name': user['profile']['real_name']}
        return results_dict

    def get_slack_public_channels_names(self):
        # type: () -> List[Dict[str, str]]

        r = self.slack.channels.list()
        self._check_if_response_is_successful(r)
        return [{'name': channel['name'], 'members': channel['members']} for channel in r.body['channels']]

    def get_slack_private_channels_names(self):
        # type: () -> List[str]

        r = self.slack.groups.list()
        self._check_if_response_is_successful(r)
        return [
            channel['name'] for channel in r.body['groups']
            if not channel['is_archived'] or self.get_archived_channels
        ]

    def _check_slack_token(self):
        # type: () -> None
        try:
            r = self.slack.api.test()
            self._check_if_response_is_successful(r)
        except SlackError as e:
            print(e)
            sys.exit(1)
        except Exception as e:
            print(e)
            sys.exit(1)

    def _check_if_response_is_successful(self, response):
        # type: (Response) -> None
        print(response)
        if not response.successful:
            print(response.error)
            sys.exit(1)

def _generate_random_password(size=10):
    # type: (int) -> str
    return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(size))

def get_and_add_users(slack_importer):
    # type: (Slacker) -> Dict[str, Dict[str, str]]
    users = slack_importer.get_slack_users_email()
    added_users = {}
    print('######### IMPORTING USERS STARTED #########\n')
    for user_id, user in users.items():
        r = client.create_user({
            'email': user['email'],
            'full_name': user['name'],
            'short_name': user['name']
        })
        if not r.get('msg'):
            added_users[user_id] = user
            print(u"{} -> {}\nCreated\n".format(user['name'], user['email']))
        else:
            print(u"{} -> {}\n{}\n".format(user['name'], user['email'], r.get('msg')))
    print('######### IMPORTING USERS FINISHED #########\n')
    return added_users

def create_streams_and_add_subscribers(slack_importer, added_users):
    # type: (Slacker, Dict[str, Dict[str, str]]) -> None
    channels_list = slack_importer.get_slack_public_channels_names()
    print('######### IMPORTING STREAMS STARTED #########\n')
    for stream in channels_list:
        subscribed_users = [added_users[member]['email'] for member in stream['members'] if member in added_users.keys()]
        if subscribed_users:
            r = client.add_subscriptions([{"name": stream['name']}], principals=subscribed_users)
            if not r.get('msg'):
                print(u"{} -> created\n".format(stream['name']))
            else:
                print(u"{} -> {}\n".format(stream['name'], r.get('msg')))
        else:
            print(u"{} -> wasn't created\nNo subscribers\n".format(stream['name']))
    print('######### IMPORTING STREAMS FINISHED #########\n')

def main():
    # type: () -> None
    importer = FromSlackImporter(config.SLACK_TOKEN)
    added_users = get_and_add_users(importer)
    create_streams_and_add_subscribers(importer, added_users)

if __name__ == '__main__':
    main()


text:
/*
 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 * OF SUCH DAMAGE.
 *
 * This file is part of the lwIP TCP/IP stack.
 *
 * Author: Adam Dunkels <adam@sics.se>
 *
 */

/*
 * Wed Apr 17 16:05:29 EDT 2002 (James Roth)
 *
 *  - Fixed an unlikely sys_thread_new() race condition.
 *
 *  - Made current_thread() work with threads which where
 *    not created with sys_thread_new().  This includes
 *    the main thread and threads made with pthread_create().
 *
 *  - Catch overflows where more than SYS_MBOX_SIZE messages
 *    are waiting to be read.  The sys_mbox_post() routine
 *    will block until there is more room instead of just
 *    leaking messages.
 */
#include "lwip/debug.h"

#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

#include <lib/support/CHIPPlatformMemory.h>

#include "lwip/opt.h"
#include "lwip/stats.h"
#include "lwip/sys.h"

#define UMAX(a, b) ((a) > (b) ? (a) : (b))

static struct timeval starttime;

#if !NO_SYS

static struct sys_thread * threads   = NULL;
static pthread_mutex_t threads_mutex = PTHREAD_MUTEX_INITIALIZER;

struct sys_mbox_msg
{
    struct sys_mbox_msg * next;
    void * msg;
};

#define SYS_MBOX_SIZE 128

struct sys_mbox
{
    int first, last;
    void * msgs[SYS_MBOX_SIZE];
    struct sys_sem * not_empty;
    struct sys_sem * not_full;
    struct sys_sem * mutex;
    int wait_send;
};

struct sys_sem
{
    unsigned int c;
    pthread_cond_t cond;
    pthread_mutex_t mutex;
};

struct sys_thread
{
    struct sys_thread * next;
    pthread_t pthread;
};

#if SYS_LIGHTWEIGHT_PROT
static pthread_mutex_t lwprot_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_t lwprot_thread      = (pthread_t) 0xDEAD;
static int lwprot_count             = 0;
#endif /* SYS_LIGHTWEIGHT_PROT */

static struct sys_sem * sys_sem_new_internal(u8_t count);
static void sys_sem_free_internal(struct sys_sem * sem);

static u32_t cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex, u32_t timeout);

/*-----------------------------------------------------------------------------------*/
static struct sys_thread * introduce_thread(pthread_t id)
{
    struct sys_thread * thread;

    thread = (struct sys_thread *) CHIPPlatformMemoryAlloc(sizeof(struct sys_thread));

    if (thread != NULL)
    {
        pthread_mutex_lock(&threads_mutex);
        thread->next    = threads;
        thread->pthread = id;
        threads         = thread;
        pthread_mutex_unlock(&threads_mutex);
    }

    return thread;
}
/*-----------------------------------------------------------------------------------*/
static void finish_thread(struct sys_thread * thread)
{
    struct sys_thread * cursor;
    struct sys_thread * previous;

    if (thread != NULL)
    {
        pthread_mutex_lock(&threads_mutex);

        previous = NULL;
        cursor   = threads;
        while (cursor != NULL)
        {
            if (cursor == thread)
            {
                if (previous != NULL)
                {
                    previous->next = cursor->next;
                }
                else
                {
                    threads = cursor->next;
                }
                cursor->next    = NULL;
                cursor->pthread = 0;
                break;
            }
            previous = cursor;
            cursor   = cursor->next;
        }

        pthread_mutex_unlock(&threads_mutex);
        CHIPPlatformMemoryFree(thread);
    }
}
/*-----------------------------------------------------------------------------------*/
sys_thread_t sys_thread_new(const char * name, lwip_thread_fn function, void * arg, int stacksize, int prio)
{
    int code;
    pthread_t tmp;
    struct sys_thread * st = NULL;
    LWIP_UNUSED_ARG(name);
    LWIP_UNUSED_ARG(stacksize);
    LWIP_UNUSED_ARG(prio);

    code = pthread_create(&tmp, NULL, (void * (*) (void *) ) function, arg);

    if (0 == code)
    {
        st = introduce_thread(tmp);
    }

    if (NULL == st)
    {
        LWIP_DEBUGF(SYS_DEBUG, ("sys_thread_new: pthread_create %d, st = 0x%lx", code, (unsigned long) st));
        abort();
    }
    return st;
}
/*-----------------------------------------------------------------------------------*/
err_t sys_thread_finish(sys_thread_t t)
{
    int code;

    code = pthread_join(t->pthread, NULL);
    if (0 == code)
    {
        finish_thread(t);
        return ERR_OK;
    }

    return ERR_VAL;
}
/*-----------------------------------------------------------------------------------*/
err_t sys_mbox_new_extra(void * pool, struct sys_mbox ** mb, int size)
{
    return sys_mbox_new(mb, size);
}

err_t sys_mbox_new(struct sys_mbox ** mb, int size)
{
    struct sys_mbox * mbox;
    LWIP_UNUSED_ARG(size);

    mbox = (struct sys_mbox *) CHIPPlatformMemoryAlloc(sizeof(struct sys_mbox));
    if (mbox == NULL)
    {
        return ERR_MEM;
    }
    mbox->first = mbox->last = 0;
    mbox->not_empty          = sys_sem_new_internal(0);
    mbox->not_full           = sys_sem_new_internal(0);
    mbox->mutex              = sys_sem_new_internal(1);
    mbox->wait_send          = 0;

    SYS_STATS_INC_USED(mbox);
    *mb = mbox;
    return ERR_OK;
}
/*-----------------------------------------------------------------------------------*/
void sys_mbox_free(struct sys_mbox ** mb)
{
    if ((mb != NULL) && (*mb != SYS_MBOX_NULL))
    {
        struct sys_mbox * mbox = *mb;
        SYS_STATS_DEC(mbox.used);
        sys_arch_sem_wait(&mbox->mutex, 0);

        sys_sem_free_internal(mbox->not_empty);
        sys_sem_free_internal(mbox->not_full);
        sys_sem_free_internal(mbox->mutex);
        mbox->not_empty = mbox->not_full = mbox->mutex = NULL;
        /*  LWIP_DEBUGF("sys_mbox_free: mbox 0x%lx\n", mbox); */
        CHIPPlatformMemoryFree(mbox);
    }
}
/*-----------------------------------------------------------------------------------*/
err_t sys_mbox_trypost(struct sys_mbox ** mb, void * msg)
{
    u8_t first;
    struct sys_mbox * mbox;
    LWIP_ASSERT("invalid mbox", (mb != NULL) && (*mb != NULL));
    mbox = *mb;

    sys_arch_sem_wait(&mbox->mutex, 0);

    LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_trypost: mbox %p msg %p\n", (void *) mbox, (void *) msg));

    if ((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE))
    {
        sys_sem_signal(&mbox->mutex);
        return ERR_MEM;
    }

    mbox->msgs[mbox->last % SYS_MBOX_SIZE] = msg;

    if (mbox->last == mbox->first)
    {
        first = 1;
    }
    else
    {
        first = 0;
    }

    mbox->last++;

    if (first)
    {
        sys_sem_signal(&mbox->not_empty);
    }

    sys_sem_signal(&mbox->mutex);

    return ERR_OK;
}
/*-----------------------------------------------------------------------------------*/
void sys_mbox_post(struct sys_mbox ** mb, void * msg)
{
    u8_t first;
    struct sys_mbox * mbox;
    LWIP_ASSERT("invalid mbox", (mb != NULL) && (*mb != NULL));
    mbox = *mb;

    sys_arch_sem_wait(&mbox->mutex, 0);

    LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_post: mbox %p msg %p\n", (void *) mbox, (void *) msg));

    while ((mbox->last + 1) >= (mbox->first + SYS_MBOX_SIZE))
    {
        mbox->wait_send++;
        sys_sem_signal(&mbox->mutex);
        sys_arch_sem_wait(&mbox->not_full, 0);
        sys_arch_sem_wait(&mbox->mutex, 0);
        mbox->wait_send--;
    }

    mbox->msgs[mbox->last % SYS_MBOX_SIZE] = msg;

    if (mbox->last == mbox->first)
    {
        first = 1;
    }
    else
    {
        first = 0;
    }

    mbox->last++;

    if (first)
    {
        sys_sem_signal(&mbox->not_empty);
    }

    sys_sem_signal(&mbox->mutex);
}
/*-----------------------------------------------------------------------------------*/
u32_t sys_arch_mbox_tryfetch(struct sys_mbox ** mb, void ** msg)
{
    struct sys_mbox * mbox;
    LWIP_ASSERT("invalid mbox", (mb != NULL) && (*mb != NULL));
    mbox = *mb;

    sys_arch_sem_wait(&mbox->mutex, 0);

    if (mbox->first == mbox->last)
    {
        sys_sem_signal(&mbox->mutex);
        return SYS_MBOX_EMPTY;
    }

    if (msg != NULL)
    {
        LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_tryfetch: mbox %p msg %p\n", (void *) mbox, *msg));
        *msg = mbox->msgs[mbox->first % SYS_MBOX_SIZE];
    }
    else
    {
        LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_tryfetch: mbox %p, null msg\n", (void *) mbox));
    }

    mbox->first++;

    if (mbox->wait_send)
    {
        sys_sem_signal(&mbox->not_full);
    }

    sys_sem_signal(&mbox->mutex);

    return 0;
}
/*-----------------------------------------------------------------------------------*/
u32_t sys_arch_mbox_fetch(struct sys_mbox ** mb, void ** msg, u32_t timeout)
{
    u32_t time_needed = 0;
    struct sys_mbox * mbox;
    LWIP_ASSERT("invalid mbox", (mb != NULL) && (*mb != NULL));
    mbox = *mb;

    /* The mutex lock is quick so we don't bother with the timeout
       stuff here. */
    sys_arch_sem_wait(&mbox->mutex, 0);

    while (mbox->first == mbox->last)
    {
        sys_sem_signal(&mbox->mutex);

        /* We block while waiting for a mail to arrive in the mailbox. We
           must be prepared to timeout. */
        if (timeout != 0)
        {
            time_needed = sys_arch_sem_wait(&mbox->not_empty, timeout);

            if (time_needed == SYS_ARCH_TIMEOUT)
            {
                return SYS_ARCH_TIMEOUT;
            }
        }
        else
        {
            sys_arch_sem_wait(&mbox->not_empty, 0);
        }

        sys_arch_sem_wait(&mbox->mutex, 0);
    }

    if (msg != NULL)
    {
        LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p msg %p\n", (void *) mbox, *msg));
        *msg = mbox->msgs[mbox->first % SYS_MBOX_SIZE];
    }
    else
    {
        LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_fetch: mbox %p, null msg\n", (void *) mbox));
    }

    mbox->first++;

    if (mbox->wait_send)
    {
        sys_sem_signal(&mbox->not_full);
    }

    sys_sem_signal(&mbox->mutex);

    return time_needed;
}
/*-----------------------------------------------------------------------------------*/
static struct sys_sem * sys_sem_new_internal(u8_t count)
{
    struct sys_sem * sem;

    sem = (struct sys_sem *) CHIPPlatformMemoryAlloc(sizeof(struct sys_sem));
    if (sem != NULL)
    {
        sem->c = count;
        pthread_cond_init(&(sem->cond), NULL);
        pthread_mutex_init(&(sem->mutex), NULL);
    }
    return sem;
}
/*-----------------------------------------------------------------------------------*/
err_t sys_sem_new(struct sys_sem ** sem, u8_t count)
{
    SYS_STATS_INC_USED(sem);
    *sem = sys_sem_new_internal(count);
    if (*sem == NULL)
    {
        return ERR_MEM;
    }
    return ERR_OK;
}
/*-----------------------------------------------------------------------------------*/
static u32_t cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex, u32_t timeout)
{
    time_t tdiff;
    time_t sec, usec;
    struct timeval rtime1, rtime2;
    struct timespec ts;
    int retval;

    if (timeout > 0)
    {
        /* Get a timestamp and add the timeout value. */
        gettimeofday(&rtime1, NULL);
        sec  = rtime1.tv_sec;
        usec = rtime1.tv_usec;
        usec += timeout % 1000 * 1000;
        sec += (int) (timeout / 1000) + (int) (usec / 1000000);
        usec       = usec % 1000000;
        ts.tv_nsec = usec * 1000;
        ts.tv_sec  = sec;

        retval = pthread_cond_timedwait(cond, mutex, &ts);

        if (retval == ETIMEDOUT)
        {
            return SYS_ARCH_TIMEOUT;
        }

        /* Calculate for how long we waited for the cond. */
        gettimeofday(&rtime2, NULL);
        tdiff = (rtime2.tv_sec - rtime1.tv_sec) * 1000 + (rtime2.tv_usec - rtime1.tv_usec) / 1000;

        if (tdiff <= 0)
        {
            return 0;
        }

        return (u32_t) tdiff;
    }

    pthread_cond_wait(cond, mutex);

    return 0;
}
/*-----------------------------------------------------------------------------------*/
u32_t sys_arch_sem_wait(struct sys_sem ** s, u32_t timeout)
{
    u32_t time_needed = 0;
    struct sys_sem * sem;
    LWIP_ASSERT("invalid sem", (s != NULL) && (*s != NULL));
    sem = *s;

    pthread_mutex_lock(&(sem->mutex));
    while (sem->c <= 0)
    {
        if (timeout > 0)
        {
            time_needed = cond_wait(&(sem->cond), &(sem->mutex), timeout);

            if (time_needed == SYS_ARCH_TIMEOUT)
            {
                pthread_mutex_unlock(&(sem->mutex));
                return SYS_ARCH_TIMEOUT;
            }
            /*      pthread_mutex_unlock(&(sem->mutex));
                    return time_needed; */
        }
        else
        {
            cond_wait(&(sem->cond), &(sem->mutex), 0);
        }
    }
    sem->c--;
    pthread_mutex_unlock(&(sem->mutex));
    return time_needed;
}
/*-----------------------------------------------------------------------------------*/
void sys_sem_signal(struct sys_sem ** s)
{
    struct sys_sem * sem;
    LWIP_ASSERT("invalid sem", (s != NULL) && (*s != NULL));
    sem = *s;

    pthread_mutex_lock(&(sem->mutex));
    sem->c++;

    if (sem->c > 1)
    {
        sem->c = 1;
    }

    pthread_cond_broadcast(&(sem->cond));
    pthread_mutex_unlock(&(sem->mutex));
}
/*-----------------------------------------------------------------------------------*/
static void sys_sem_free_internal(struct sys_sem * sem)
{
    pthread_cond_destroy(&(sem->cond));
    pthread_mutex_destroy(&(sem->mutex));
    CHIPPlatformMemoryFree(sem);
}
/*-----------------------------------------------------------------------------------*/
void sys_sem_free(struct sys_sem ** sem)
{
    if ((sem != NULL) && (*sem != SYS_SEM_NULL))
    {
        SYS_STATS_DEC(sem.used);
        sys_sem_free_internal(*sem);
    }
}
#endif /* !NO_SYS */
/*-----------------------------------------------------------------------------------*/
u32_t sys_now(void)
{
    struct timeval tv;
    u32_t msec;
    gettimeofday(&tv, NULL);

    msec = (u32_t)((tv.tv_sec - starttime.tv_sec) * 1000 + (tv.tv_usec - starttime.tv_usec) / 1000);

    return msec;
}
/*-----------------------------------------------------------------------------------*/
void sys_init(void)
{
    gettimeofday(&starttime, NULL);
}
/*-----------------------------------------------------------------------------------*/
#if SYS_LIGHTWEIGHT_PROT
/** sys_prot_t sys_arch_protect(void)

This optional function does a "fast" critical region protection and returns
the previous protection level. This function is only called during very short
critical regions. An embedded system which supports ISR-based drivers might
want to implement this function by disabling interrupts. Task-based systems
might want to implement this by using a mutex or disabling tasking. This
function should support recursive calls from the same task or interrupt. In
other words, sys_arch_protect() could be called while already protected. In
that case the return value indicates that it is already protected.

sys_arch_protect() is only required if your port is supporting an operating
system.
*/
sys_prot_t sys_arch_protect(void)
{
    /* Note that for the UNIX port, we are using a lightweight mutex, and our
     * own counter (which is locked by the mutex). The return code is not actually
     * used. */
    if (lwprot_thread != pthread_self())
    {
        /* We are locking the mutex where it has not been locked before *
         * or is being locked by another thread */
        pthread_mutex_lock(&lwprot_mutex);
        lwprot_thread = pthread_self();
        lwprot_count  = 1;
    }
    else
        /* It is already locked by THIS thread */
        lwprot_count++;
    return 0;
}
/*-----------------------------------------------------------------------------------*/

/** void sys_arch_unprotect(sys_prot_t pval)

This optional function does a "fast" set of critical region protection to the
value specified by pval. See the documentation for sys_arch_protect() for
more information. This function is only required if your port is supporting
an operating system.
*/
void sys_arch_unprotect(sys_prot_t pval)
{
    LWIP_UNUSED_ARG(pval);
    if (lwprot_thread == pthread_self())
    {
        if (--lwprot_count == 0)
        {
            lwprot_thread = (pthread_t) 0xDEAD;
            pthread_mutex_unlock(&lwprot_mutex);
        }
    }
}
#endif /* SYS_LIGHTWEIGHT_PROT */

/*-----------------------------------------------------------------------------------*/

#ifndef MAX_JIFFY_OFFSET
#define MAX_JIFFY_OFFSET ((~0U >> 1) - 1)
#endif

#ifndef HZ
#define HZ 100
#endif

u32_t sys_jiffies(void)
{
    struct timeval tv;
    unsigned long sec;
    long usec;

    gettimeofday(&tv, NULL);
    sec  = tv.tv_sec - starttime.tv_sec;
    usec = tv.tv_usec;

    if (sec >= (MAX_JIFFY_OFFSET / HZ))
        return MAX_JIFFY_OFFSET;
    usec += 1000000L / HZ - 1;
    usec /= 1000000L / HZ;
    return HZ * sec + usec;
}

#if PPP_DEBUG

#include <stdarg.h>

void ppp_trace(int level, const char * format, ...)
{
    va_list args;

    (void) level;
    va_start(args, format);
    vprintf(format, args);
    va_end(args);
}
#endif

#ifdef LWIP_DEBUG

unsigned char gLwIP_DebugFlags = 0;

#endif


text:
import CSSselect from './css-select/index'
export default CSSselect


text:
package com.example.config;

import java.io.IOException;
import java.util.UUID;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.filter.GenericFilterBean;

/**
 *
 * */
public class AuditLoggingFilter extends GenericFilterBean {

	private static final Logger LOGGER = LoggerFactory.getLogger("accessLogger");

	public static final String UUID_KEY = "uuid";
	public static final String CLIENT_IP_KEY = "clientIp";
	public static final String USERNAME_KEY = "username";
	public static final String URI_KEY = "uri";
	public static final String LOCALHOST_KEY = "localhost";

	@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
		final HttpServletRequest request = (HttpServletRequest) req;

		String uuid = UUID.randomUUID().toString();
		String clientIp = request.getRemoteAddr();
		String uri = request.getRequestURI();
		String username;
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		if (authentication != null) {
			username = (String) authentication.getPrincipal();
		} else {
			username = "ANONYMOUS";
		}

		MDC.clear();
		MDC.put(UUID_KEY, uuid);
		MDC.put(CLIENT_IP_KEY, clientIp);
		MDC.put(USERNAME_KEY, username);
		MDC.put(URI_KEY, uri);
		MDC.put(LOCALHOST_KEY, request.getLocalAddr());

		LOGGER.debug(request.getProtocol() + " " + request.getMethod());

		chain.doFilter(req, res);
	}

	public static String getValue(String key) {
		return MDC.get(key);
	}

}


text:
import getopt
from play.utils import *

MODULE = "secure"

COMMANDS = ["secure:", "secure:ov", "secure:override"]

HELP = {
    "secure:": "Show help for the secure module",
    "secure:override": "Override the CSS, login or layout"
}

def execute(**kargs):
    command = kargs.get("command")
    app = kargs.get("app")
    args = kargs.get("args")
    env = kargs.get("env")

    if command == 'secure:':
        print "~ Use: --css to override the Secure css"
        print "~      --login to override the login page"
        print "~      --layout to override the login layout page"
        print "~ "
        return

    try:
        optlist, args2 = getopt.getopt(args, '', ['css', 'login', 'layout'])
        for o, a in optlist:
            if o == '--css':
                app.override('public/stylesheets/secure.css', 'public/stylesheets/secure.css')
                print "~ "
                return
            if o == '--login':
                app.override('app/views/Secure/login.html', 'app/views/Secure/login.html')
                print "~ "
                return
            if o == '--layout':
                app.override('app/views/Secure/layout.html', 'app/views/Secure/layout.html')
                print "~ "
                return

    except getopt.GetoptError, err:
        print "~ %s" % str(err)
        print "~ "
        sys.exit(-1)


text:
require 'spec_helper'

describe RuboCop::Cop::Style::UnneededPercentQ do
  subject(:cop) { described_class.new }

  context 'with %q strings' do
    it 'registers an offense for only single quotes' do
      inspect_source(cop, "%q('hi')")
      expect(cop.messages).to eq(['Use `%q` only for strings that contain ' \
                                  'both single quotes and double quotes.'])
    end

    it 'registers an offense for only double quotes' do
      inspect_source(cop, '%q("hi")')
      expect(cop.offenses.size).to eq(1)
    end

    it 'accepts a string with single quotes and double quotes' do
      inspect_source(cop, %Q(%q('"hi"')))
      expect(cop.offenses).to be_empty
    end

    it 'normally auto-corrects %q to single quotes' do
      new_source = autocorrect_source(cop, '%q(hi)')
      expect(new_source).to eq("'hi'")
    end

    it 'auto-corrects %q to double quotes if necessary' do
      new_source = autocorrect_source(cop, "%q('hi')")
      expect(new_source).to eq(%q("'hi'"))
    end
  end

  context 'with %Q strings' do
    it 'registers an offense for static string with only double quotes' do
      inspect_source(cop, '%Q("hi")')
      expect(cop.messages).to eq(['Use `%Q` only for strings that contain ' \
                                  'both single quotes and double quotes, or ' \
                                  'for dynamic strings that contain double ' \
                                  'quotes.'])
    end

    it 'accepts a string with single quotes and double quotes' do
      inspect_source(cop, %Q(%Q('"hi"')))
      expect(cop.offenses).to be_empty
    end

    it 'accepts a dynamic %Q string with double quotes' do
      inspect_source(cop, '%Q("hi#{4}")')
      expect(cop.offenses).to be_empty
    end

    it 'auto-corrects static %Q to double quotes' do
      new_source = autocorrect_source(cop, '%Q(hi)')
      # One could argue that the double quotes are not necessary for a static
      # string, but that's the job of the StringLiterals cop to check.
      expect(new_source).to eq('"hi"')
    end

    it 'auto-corrects static %Q with inner double quotes to single quotes' do
      new_source = autocorrect_source(cop, '%Q("hi")')
      expect(new_source).to eq(%q('"hi"'))
    end

    it 'auto-corrects dynamic %Q to double quotes' do
      new_source = autocorrect_source(cop, '%Q(hi #{func})')
      expect(new_source).to eq('"hi #{func}"')
    end
  end
end


text:
/**
  * @constructor
  */

var TabBase = new function()
{
  var self = this;
  var id_count = 1;
  var ids = {};

  var getId = function()
  {
    return 'tab-' + (id_count++).toString();
  }

  this.init = function(ref_id, name, has_close_button)
  {
    this.name = name;
    this.ref_id = ref_id;
    this.has_close_button = has_close_button;
    ids [ this.id = getId() ] = this;
  }

  this.getTabById = function(id)
  {
    return ids[id];
  }

  this._delete = function(id)
  {
    delete ids[id];
  }

}

/**
  * @constructor
  * @extends TabBase
  */

var Tab = function(ref_id, name, has_close_button)
{
  // at some point all tabs will have a close button
  this.init(ref_id, name, has_close_button)
}

Tab.prototype = TabBase;


text:
var r1 = null + null;
var r2 = null + undefined;
var r3 = undefined + null;
var r4 = undefined + undefined;

//// [additionOperatorWithOnlyNullValueOrUndefinedValue.js]
var r1 = null + null;
var r2 = null + undefined;
var r3 = undefined + null;
var r4 = undefined + undefined;


text:
from sklearn import datasets, neighbors, linear_model
from sklearn.metrics import confusion_matrix, classification_report
"""
digitsデータの分類
k-NN vs ロジスティック回帰
"""

# digitsデータをロード
digits = datasets.load_digits()
X_digits = digits.data
y_digits = digits.target

# 訓練データとテストデータに分割
n_samples = len(X_digits)
pivot = n_samples * 0.9
X_train = X_digits[:pivot]
y_train = y_digits[:pivot]
X_test = X_digits[pivot:]
y_test = y_digits[pivot:]

# k-NNとロジスティック回帰の分類器を学習
knn = neighbors.KNeighborsClassifier()
logistic = linear_model.LogisticRegression()
knn.fit(X_train, y_train)
logistic.fit(X_train, y_train)

# クラスを予測
predict_knn = knn.predict(X_test)
predict_logistic = logistic.predict(X_test)

# 結果を表示
print "KNN"
print "score: %f" % knn.score(X_test, y_test)
print confusion_matrix(y_test, predict_knn)
print classification_report(y_test, predict_knn)

print "Logistic Regression"
print "score: %f" % logistic.score(X_test, y_test)
print confusion_matrix(y_test, predict_logistic)
print classification_report(y_test, predict_logistic)


text:
/**
 * https://projecteuler.net/problem=92
 *
 * Validated.
 */
class p092 {
    /**
     * Sums the squares of the digits of n.
     * @param n the number on which the calculation is being performed.
     * @return the sum of the squares of the digits of n.
     */
    private static int digPowSum (int n) {
        int sum = 0;
        String s = Integer.toString(n);
        for (int i = 0; i < s.length(); i++) {
            int j = Character.getNumericValue(s.charAt(i));
            sum += j*j;
        }
        return sum;
    }

    /**
     * Determines whether the chain created by continuously calculating digPowSum(n) loops to 89.
     * @param n the number to check.
     * @return true if it arrives at 89, false if it arrives at 1.
     */
    private static boolean arrives89 (int n) {
        while (n != 1 && n!= 89) {
            n = digPowSum(n);
        }
        return n == 89;
    }
    public static void main (String[] args) {
        long s = System.nanoTime();
        int count = 0;
        for (int i = 1; i < 10000000; i++) {
            if (arrives89(i))
                count++;
        }
        System.out.println(count);
        long e = System.nanoTime();
        System.out.println((e-s)/1000000000.0);
    }
}


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

/**
 *
 */

#pragma once
#include "BlueprintFactory.generated.h"

UCLASS(hidecategories=Object, collapsecategories)
class UNREALED_API UBlueprintFactory : public UFactory
{
	GENERATED_UCLASS_BODY()

	// The parent class of the created blueprint
	UPROPERTY(EditAnywhere, Category=BlueprintFactory, meta=(AllowAbstract = "", BlueprintBaseOnly = ""))
	TSubclassOf<class UObject> ParentClass;

	// UFactory Interface
	virtual bool ConfigureProperties() override;
	virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn, FName CallingContext) override;
	virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
	// End of UFactory Interface

protected:
	// Hook for derived classes to indicate if they want to skip some filtering that is unnecessary for macro libraries
	virtual bool IsMacroFactory() const { return false; }
};


text:
You created your first web page, modified a theme to provide a new useful feature and learned how to create a basic module.

We hope you will like the Framework and keep using it as it evolve over time. More guides will be created over time to cover even more subjects and more powerful ways to use the Framework.

Don't hesitate to contribute by submitting bug reports (if you find any) and suggestions or even improve it by writing code!

[Previous](./Page08-ThatsIt) | [Go home](../home)


text:
NS_DS_BEGIN
NS_UTIL_BOOST_BEGIN

template< class FunctionType >
class CUuidFunction
{
private:
	struct FunctionInfo{
		std::function<FunctionType> func;
		ds_uint32 timeTick;
	};

public:
	typedef std::map<boost::uuids::uuid, FunctionInfo > FunctionMap;

	CUuidFunction( std::function<FunctionType> default_func ){
		default_func_ = default_func;
	}

	boost::uuids::uuid Create( std::function<FunctionType> func ) {
		static boost::uuids::random_generator uuid_gen;
		mutex_.lock();
		boost::uuids::uuid uuid = uuid_gen();
		function_map_[uuid].func = func;
		function_map_[uuid].timeTick = dios::util::CTimer::GetMilliSecond();
		mutex_.unlock();
		return uuid;
	}

	std::function<FunctionType> operator[]( const boost::uuids::uuid& func_id ) {

		std::function<FunctionType> func = default_func_;
		mutex_.lock();
		typename FunctionMap::iterator itor = function_map_.find(func_id);
		if(itor != function_map_.end()) {
			func = itor->second.func;
		}
		mutex_.unlock();
		return func;
	}

	std::function<FunctionType> operator[]( const std::string& func_id_str ) {

		static boost::uuids::string_generator uuid_gen;
		boost::uuids::uuid func_id = uuid_gen(func_id_str);
		return operator[](func_id);
	}

	std::function<FunctionType> Release(const boost::uuids::uuid& func_id) {

		std::function<FunctionType> func = default_func_;
		mutex_.lock();
		typename FunctionMap::iterator itor = function_map_.find(func_id);
		if(itor != function_map_.end()) {
			func = itor->second.func;
			function_map_.erase(itor);
		}
		mutex_.unlock();
		return func;
	}

	std::function<FunctionType> Release(const std::string& func_id_str) {

		static boost::uuids::string_generator uuid_gen;
		boost::uuids::uuid func_id = uuid_gen(func_id_str);
		return Release(func_id);
	}

	void GC( int time_expired_ms ){
		std::function<FunctionType> func;
		mutex_.lock();
		typename FunctionMap::iterator itor = function_map_.begin();
		ds_uint32 nowTick = dios::util::CTimer::GetMilliSecond();
		while(itor != function_map_.end()) {
			int delta = nowTick - itor->second.timeTick;
			if( delta >= time_expired_ms ){
				function_map_.erase(itor++);
			}
			else{
				++itor;
			}
		}
		mutex_.unlock();
	}

	std::function<FunctionType> ReleaseFront() {

		std::function<FunctionType> func = default_func_;
		mutex_.lock();
		typename FunctionMap::iterator itor = function_map_.begin();
		if(itor != function_map_.end()) {
			func = itor->second.func;
			function_map_.erase(itor);
		}
		mutex_.unlock();
		return func;
	}

	bool empty(){
		return function_map_.empty();
	}

private:
	FunctionMap function_map_;
	boost::mutex mutex_;
	std::function<FunctionType> default_func_;
};

NS_UTIL_BOOST_END
NS_DS_END

#endif


text:
import * as React from 'react';
import TooltipOptions from '../tooltip/TooltipOptions';

declare namespace Rating {

    interface ChangeTargetOptions {
        name: string;
        id: string;
        value: number | undefined | null;
    }

    interface ChangeParams {
        originalEvent: React.SyntheticEvent;
        value: number | undefined | null;
        stopPropagation(): void;
        preventDefault(): void;
        target: ChangeTargetOptions;
    }

    interface RatingProps {
        id?: string;
        value?: number;
        disabled?: boolean;
        readOnly?: boolean;
        stars?: number;
        cancel?: boolean;
        style?: object;
        className?: string;
        tooltip?: string;
        tooltipOptions?: TooltipOptions;
        onChange?(e: ChangeParams): void;
    }
}

export declare class Rating extends React.Component<Rating.RatingProps, any> { }


text:
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
	<clientModule name="Carousel" version="0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
		<widgetFiles>
			<widgetFile	path="Carousel/Carousel.xml"/>
			<widgetFile	path="Carousel/DataviewCarousel.xml"/>
		</widgetFiles>
		<files>
			<file path="Carousel/widget/"/>
		</files>
	</clientModule>
</package>