text:
{#-
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
-#}

{% set page_num = page %}
{% set page = 'search_results' %}
{% set hide_left_bar = True %}

{% extends 'allura:templates/site_admin.html' %}

{% block title %}Search {{ type_s }}s{% endblock %}
{% block header %}Search {{ type_s }}s{% endblock %}

{% block content %}

Back to Site Admin Home

    {{ c.search_form.display(q=q, f=f) }}

  {% if objects %}

        {% include search_results_template %}

  {% endif %}

    {{c.page_list.display(limit=limit, page=page_num, count=count)}}
    {{c.page_size.display(limit=limit, page=page_num, count=count)}}

{% endblock %}

{% block extra_css %}

{% endblock %}


text:
FTDI FT4222H                             {#ft4222}
============

The FT4222H is a High/Full Speed USB2.0-to-Quad SPI/I2C device controller. Mraa
supports it as a USB subplatform using the libft4222 library from FTDI which
can be found
[here](http://www.ftdichip.com/Support/SoftwareExamples/libft4222-1.2.1.4.tgz).
You need the latest version for the GPIO to work.

The FT4222H has 4 configuration modes selected by {DCNF1, DCNF0}.  The chip
configuration mode will determine the number of USB interfaces for data streams
and for GPIOs control. Mraa supports chip modes CNFMODE0 and CNFMODE3. In
CNFMODE0 the chip can provide either 4 GPIOs and SPI, or 2 GPIOs and I2C
since SCL/SDA are shared with GPIO0/GPIO1. It is possible to change this
selection dynamically by calling the corresponding mraa init functions.
CNFMODE3 on the other hand will only provide SPI or I2C.

By default, both modes start with I2C enabled and the driver will scan for
known GPIO expanders on the I2C bus when the FT4222H is initialized.

Supported GPIO expanders:
* PCA9672
* PCA9555
* PCF8575

Output from 'mraa-gpio list' would be as follows:
~~~~~~~~~~~~~
512 IGPIO0/SCL0: GPIO I2C
513 IGPIO1/SDA0: GPIO I2C
514   INT-GPIO2: GPIO
515   INT-GPIO3: GPIO
~~~~~~~~~~~~~

When an I2C GPIO expander is present, the pins on the expander will appear after
the 4 FT4222H GPIO pins (i.e. starting at physical pin #4, logical pin #516).
~~~~~~~~~~~~~
512 IGPIO0/SCL0: GPIO I2C
513 IGPIO1/SDA0: GPIO I2C
514   INT-GPIO2: GPIO
515   INT-GPIO3: GPIO
516   EXP-GPIO0: GPIO
517   EXP-GPIO1: GPIO
518   EXP-GPIO2: GPIO
519   EXP-GPIO3: GPIO
520   EXP-GPIO4: GPIO
521   EXP-GPIO5: GPIO
522   EXP-GPIO6: GPIO
523   EXP-GPIO7: GPIO
~~~~~~~~~~~~~

If a PCA9545 I2C switch is detected an extra four I2C busses will appear,
representing the four downstream busses. Output from 'mraa-i2c list'
would be as follows:
~~~~~~~~~~~~~
Bus 512: id=00 type=ft4222  default
Bus 513: id=01 type=ft4222
Bus 514: id=02 type=ft4222
Bus 515: id=03 type=ft4222
Bus 516: id=04 type=ft4222
~~~~~~~~~~~~~

Please note that some mraa features might not be fully implemented yet and they
are still under development (e.g. SPI replacement functions).

We tested the module using FTDI's UMFT4222EV reference board. More details on
this board can be found
[here](http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT4222EV.pdf).

Interface notes
---------------

You will need to unload all ftdi kernel modules for libft4222 to work
correctly. You will also have to compile mraa with FT4222 support which may not
be enabled by default.

The cmake options to build this driver are:
~~~~~~~~~~~~~
FTDI4222=ON
USBPLAT=ON
~~~~~~~~~~~~~

redpajama_set_name: RedPajamaGithub


text:
class AddFeedTypeToFeed < ActiveRecord::Migration
  disable_ddl_transaction!
  def up
    add_column :feeds, :feed_type, :integer
    change_column_default(:feeds, :feed_type, Feed.feed_types[:xml])
    add_index :feeds, :feed_type, algorithm: :concurrently
  end
  def down
    remove_column :feeds, :feed_type
  end
end


text:
<!DOCTYPE html >

          <title>ButtonBase - org.widok.bindings.Bootstrap.ButtonBase</title>
          <meta name="description" content="ButtonBase - org.widok.bindings.Bootstrap.ButtonBase" />
          <meta name="keywords" content="ButtonBase org.widok.bindings.Bootstrap.ButtonBase" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.widok.bindings.Bootstrap

ButtonBase

Related Doc:
            package Bootstrap

        trait

        ButtonBase[T] extends Widget[T]

Self Type

ButtonBase[T] with T

          Linear Supertypes

Widget[T], Node, View, AnyRef, Any

            Known Subclasses

AnchorButton, Button

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

ButtonBase

Widget

Node

View

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Abstract Value Members

        abstract
        def

        element: Element

Concrete Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        append(widget: Widget[_]): Unit

Adds child widget

Adds child widget

Definition Classes

Widget

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        attribute(key: String, value: ReadChannel[String]): T

Definition Classes

Widget

        def

        attribute(key: String, value: String): T

Definition Classes

Widget

        def

        attributeOpt(key: String, value: PartialChannel[String]): T

Definition Classes

Widget

        lazy val

        attributes: Dict[String, String]

Definition Classes

Node

        def

        block(state: Boolean): T

        lazy val

        change: Channel[Event]

Definition Classes

Node

        lazy val

        className: BufSet[String]

Definition Classes

Node

        lazy val

        click: Channel[MouseEvent]

Definition Classes

Node

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        lazy val

        contextMenu: Channel[MouseEvent]

Definition Classes

Node

        def

        css(tags: ReadChannel[Seq[String]]): T

Definition Classes

Widget

        def

        css(cssTags: String*): T

Definition Classes

Widget

        def

        cssState(state: ReadChannel[Boolean], cssTags: String*): T

Definition Classes

Widget

        def

        cssState(state: Boolean, cssTags: String*): T

Definition Classes

Widget

        def

        cursor(cursor: ReadChannel[Cursor]): T

Definition Classes

Widget

        def

        cursor(cursor: Cursor): T

Definition Classes

Widget

        lazy val

        doubleClick: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        drag: Channel[DragEvent]

Definition Classes

Node

        lazy val

        dragEnd: Channel[DragEvent]

Definition Classes

Node

        lazy val

        dragEnter: Channel[DragEvent]

Definition Classes

Node

        lazy val

        dragLeave: Channel[DragEvent]

Definition Classes

Node

        lazy val

        dragOver: Channel[DragEvent]

Definition Classes

Node

        lazy val

        dragStart: Channel[DragEvent]

Definition Classes

Node

        lazy val

        drop: Channel[DragEvent]

Definition Classes

Node

        def

        enabled(value: ReadChannel[Boolean]): T

Definition Classes

Widget

        def

        enabled(value: Boolean): T

Definition Classes

Widget

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        def

        focus(): T

Definition Classes

Widget

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        def

        height(height: ReadChannel[Length]): T

Definition Classes

Widget

        def

        height(height: Length): T

Definition Classes

Widget

        def

        id(value: ReadChannel[String]): T

Definition Classes

Widget

        def

        id(value: String): T

Definition Classes

Widget

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        lazy val

        keyDown: Channel[KeyboardEvent]

Definition Classes

Node

        lazy val

        keyPress: Channel[KeyboardEvent]

Definition Classes

Node

        lazy val

        keyUp: Channel[KeyboardEvent]

Definition Classes

Node

        def

        link(state: Boolean): T

        lazy val

        mouseDown: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseEnter: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseLeave: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseMove: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseOut: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseOver: Channel[MouseEvent]

Definition Classes

Node

        lazy val

        mouseUp: Channel[MouseEvent]

Definition Classes

Node

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        lazy val

        nodeId: Opt[String]

Definition Classes

Node

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        def

        onChange(f: (Event) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onClick(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onContextMenu(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDoubleClick(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDrag(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDragEnd(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDragEnter(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDragLeave(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDragOver(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDragStart(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onDrop(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onKeyDown(f: (KeyboardEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onKeyPress(f: (KeyboardEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onKeyUp(f: (KeyboardEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseDown(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseEnter(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseLeave(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseMove(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseOut(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseOver(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onMouseUp(f: (MouseEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onPaste(f: (DragEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onTouchEnd(f: (TouchEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onTouchMove(f: (TouchEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        def

        onTouchStart(f: (TouchEvent) ⇒ Unit): Widget[T] with T

Definition Classes

Widget

        lazy val

        paste: Channel[DragEvent]

Definition Classes

Node

        def

        relativeCoordinates: Coordinates

Coordinates relative to the padding box of offsetParent

Coordinates relative to the padding box of offsetParent

Definition Classes

Widget

        def

        remove(widget: Widget[_]): Unit

Removes child widget

Removes child widget

Definition Classes

Widget

        def

        render(parent: scalajs.dom.Node, offset: scalajs.dom.Node): Unit

Definition Classes

Node → View

        val

        rendered: Element

Definition Classes

ButtonBase → Node

        def

        show(value: ReadChannel[Boolean]): T

Definition Classes

Widget

        def

        show(value: Boolean): T

Definition Classes

Widget

        def

        size(value: Size): T

        def

        style(value: Style): T

        lazy val

        style: CSSStyle

Definition Classes

Node

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        tabIndex(value: ReadChannel[Int]): T

Definition Classes

Widget

        def

        tabIndex(value: Int): T

Definition Classes

Widget

        def

        title(value: ReadChannel[String]): T

Definition Classes

Widget

        def

        title(value: String): T

Definition Classes

Widget

        def

        toString(): String

Definition Classes

AnyRef → Any

        lazy val

        touchEnd: Channel[TouchEvent]

Definition Classes

Node

        lazy val

        touchMove: Channel[TouchEvent]

Definition Classes

Node

        lazy val

        touchStart: Channel[TouchEvent]

Definition Classes

Node

        def

        visible(value: ReadChannel[Boolean]): T

Definition Classes

Widget

        def

        visible(value: Boolean): T

Definition Classes

Widget

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        def

        width(width: ReadChannel[Length]): T

Definition Classes

Widget

        def

        width(width: Length): T

Definition Classes

Widget

Inherited from Widget[T]

Inherited from Node

Inherited from View

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
package org.apache.shardingsphere.sql.parser.sql.segment.generic.table;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.AliasAvailable;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.AliasSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.OwnerAvailable;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.OwnerSegment;
import org.apache.shardingsphere.sql.parser.sql.value.identifier.IdentifierValue;

import java.util.Optional;

/**
 * Simple table segment.
 */
@RequiredArgsConstructor
@Getter
@ToString
public final class SimpleTableSegment implements TableSegment, OwnerAvailable, AliasAvailable {

    private final TableNameSegment tableName;

    @Setter
    private OwnerSegment owner;

    @Setter
    private AliasSegment alias;

    public SimpleTableSegment(final int startIndex, final int stopIndex, final IdentifierValue identifierValue) {
        tableName = new TableNameSegment(startIndex, stopIndex, identifierValue);
    }

    @Override
    public int getStartIndex() {
        return null == owner ? tableName.getStartIndex() : owner.getStartIndex();
    }

    @Override
    public int getStopIndex() {
        return tableName.getStopIndex();
        //FIXME: Rewriter need to handle alias as well
//        return null == alias ? tableName.getStopIndex() : alias.getStopIndex();
    }

    @Override
    public Optional<OwnerSegment> getOwner() {
        return Optional.ofNullable(owner);
    }

    @Override
    public Optional<String> getAlias() {
        return null == alias ? Optional.empty() : Optional.ofNullable(alias.getIdentifier().getValue());
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="e8ba1641-d549-4d9b-8dea-1c123cc9ca96" name="Default" comment="" />
    <ignored path="localhost.iws" />
    <ignored path=".idea/workspace.xml" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
  <component name="FavoritesManager">
    <favorites_list name="localhost" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="controllers.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/front/js/controllers.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="2255" max-vertical-offset="3145">
              <caret line="98" column="0" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="services.js" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/front/js/services.js">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="935" max-vertical-offset="1207">
              <caret line="55" column="42" selection-start-line="55" selection-start-column="42" selection-end-line="55" selection-end-column="42" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="auth.html" pinned="false" current="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/front/layouts/auth.html">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="459">
              <caret line="7" column="135" selection-start-line="7" selection-start-column="135" selection-end-line="7" selection-end-column="135" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="index.php" pinned="false" current="true" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/index.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.15507412" vertical-offset="357" max-vertical-offset="5831">
              <caret line="29" column="58" selection-start-line="29" selection-start-column="58" selection-end-line="29" selection-end-column="58" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="true" />
    </FindUsagesManager>
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/db_test.php" />
        <option value="$PROJECT_DIR$/front/js/app.js" />
        <option value="$PROJECT_DIR$/front/js/modules.js" />
        <option value="$PROJECT_DIR$/front/js/filters.js" />
        <option value="$PROJECT_DIR$/front/js/routes.js" />
        <option value="$PROJECT_DIR$/front/index.html" />
        <option value="$PROJECT_DIR$/front/layouts/dashboard.html" />
        <option value="$PROJECT_DIR$/front/layouts/auth.html" />
        <option value="$PROJECT_DIR$/index.php" />
        <option value="$PROJECT_DIR$/front/js/services.js" />
        <option value="$PROJECT_DIR$/front/js/controllers.js" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1696" />
    <option name="height" value="1026" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="localhost" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="localhost" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="localhost" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
    <property name="settings.editor.splitter.proportion" value="0.2" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="last_opened_file_path" value="$PROJECT_DIR$/../norma" />
    <property name="FullScreen" value="false" />
    <property name="recentsLimit" value="5" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="name" value="Dart" />
      <option name="saveOutputToFile" value="false" />
      <option name="showConsoleOnStdErr" value="false" />
      <option name="showConsoleOnStdOut" value="false" />
      <method />
    </configuration>
    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
      <option name="VMOptions" />
      <option name="arguments" />
      <option name="filePath" />
      <option name="scope" value="ALL" />
      <option name="testName" />
      <method />
    </configuration>
    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
      <setting name="configLocationType" value="CONFIG_FILE" />
      <setting name="settingsFile" value="" />
      <setting name="serverType" value="INTERNAL" />
      <setting name="preferredDebugBrowser" value="Chrome" />
      <method />
    </configuration>
    <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
      <envs />
      <method />
    </configuration>
    <configuration default="true" type="CucumberJavaScriptRunConfigurationType" factoryName="Cucumber.js">
      <option name="cucumberJsArguments" />
      <option name="executablePath" />
      <option name="filePath" />
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="e8ba1641-d549-4d9b-8dea-1c123cc9ca96" name="Default" comment="" />
      <created>1448446216527</created>
      <updated>1448446216527</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1696" height="1026" extended-state="0" />
    <editor active="false" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/front/js/controllers.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="3145">
          <caret line="98" column="0" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/services.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="935" max-vertical-offset="1207">
          <caret line="55" column="42" selection-start-line="55" selection-start-column="42" selection-end-line="55" selection-end-column="42" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/layouts/auth.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="459">
          <caret line="7" column="135" selection-start-line="7" selection-start-column="135" selection-end-line="7" selection-end-column="135" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="5831">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/layouts/auth.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="459">
          <caret line="14" column="94" selection-start-line="14" selection-start-column="94" selection-end-line="14" selection-end-column="94" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/services.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="11" max-vertical-offset="901">
          <caret line="26" column="35" selection-start-line="26" selection-start-column="35" selection-end-line="26" selection-end-column="35" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/controllers.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="731" max-vertical-offset="952">
          <caret line="43" column="36" selection-start-line="43" selection-start-column="36" selection-end-line="43" selection-end-column="36" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="487" max-vertical-offset="1377">
          <caret line="58" column="31" selection-start-line="58" selection-start-column="31" selection-end-line="58" selection-end-column="31" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/libs/bootstrap/js/bootstrap.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.33333334" vertical-offset="2318" max-vertical-offset="40324">
          <caret line="153" column="39" selection-start-line="153" selection-start-column="35" selection-end-line="153" selection-end-column="39" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/libs/bootstrap/css/bootstrap.min.css">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.25199544" vertical-offset="0" max-vertical-offset="877">
          <caret line="13" column="52" selection-start-line="13" selection-start-column="52" selection-end-line="13" selection-end-column="52" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/modules.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="374">
          <caret line="7" column="14" selection-start-line="7" selection-start-column="14" selection-end-line="7" selection-end-column="14" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/app.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.26741573" vertical-offset="0" max-vertical-offset="890">
          <caret line="14" column="23" selection-start-line="14" selection-start-column="23" selection-end-line="14" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/routes.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="595">
          <caret line="24" column="10" selection-start-line="24" selection-start-column="10" selection-end-line="24" selection-end-column="10" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/layouts/dashboard.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.57931846" vertical-offset="867" max-vertical-offset="3740">
          <caret line="80" column="138" selection-start-line="80" selection-start-column="138" selection-end-line="80" selection-end-column="138" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/filters.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.26741573" vertical-offset="0" max-vertical-offset="890">
          <caret line="14" column="85" selection-start-line="14" selection-start-column="85" selection-end-line="14" selection-end-column="85" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.4988426" vertical-offset="113" max-vertical-offset="1003">
          <caret line="32" column="27" selection-start-line="32" selection-start-column="27" selection-end-line="32" selection-end-column="27" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/layouts/auth.html">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="119" max-vertical-offset="459">
          <caret line="7" column="135" selection-start-line="7" selection-start-column="135" selection-end-line="7" selection-end-column="135" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/services.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1207">
          <caret line="55" column="42" selection-start-line="55" selection-start-column="42" selection-end-line="55" selection-end-column="42" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/front/js/controllers.js">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="2255" max-vertical-offset="3145">
          <caret line="98" column="0" selection-start-line="98" selection-start-column="0" selection-end-line="98" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.15507412" vertical-offset="357" max-vertical-offset="5831">
          <caret line="29" column="58" selection-start-line="29" selection-start-column="58" selection-end-line="29" selection-end-column="58" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
<?php
if (!defined('__GOOSE__')) exit();

// set title type
$titleType = ($this->param['action'] == 'modify') ? '수정' : "만들기";
?>

JSON <?=$titleType?>

<?=$this->set['description']?>

	<form action="<?=__GOOSE_ROOT__.'json/'.$this->param['action'].'/'?>" method="post" name="post" id="regsterForm">
		<input type="hidden" name="json_srl" value="<?=$repo['json']['srl']?>" />
		<input type="hidden" name="json" />

		<fieldset class="form-group">

이름

<input type="text" name="name" id="name" size="22" maxlength="50" value="<?=$repo['json']['name']?>" class="block"/>

JSON DATA

		</fieldset>

			<button type="submit" class="gs-button col-key"><?=$titleType?></button>
			<button type="button" class="gs-button" onclick="history.back(-1)">뒤로가기</button>

	</form>

<link rel="stylesheet" href="<?=__GOOSE_ROOT__?>ext/JSONEditor/css/JSONEditor.css" media="screen" />


text:
module Mkspec

  module Matchers

    class EqualityMatcher
      def initialize(expected)
        @expected = expected
      end

      def match(expectation)
        "expect(#{expectation.action}).#{expectation.inclination} eq(#{@expected})"
      end
    end

  end

end


text:
/*
 * Created on Dec 18, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package xal.tools.beam;

/**
 * @author Christopher K. Allen
 *
 * @deprecated  use RelativisticParameterConverter
 *
 * @see gov.sns.tool.beam#RelativisticParameterConverter
 */
@Deprecated
public class ParameterConverter {

    /**
     *  Computes the relativistic factor gamma from the current beta value
     *
     *  @param  beta    speed of probe w.r.t. the speed of light
     *  @return         relativistic factor gamma
     */
    static public double computeGammaFromBeta(double beta) {
        return 1.0/Math.sqrt(1.0 - beta*beta);
    };

    /**
     *  Convenience function for computing the relativistic factor gamma from a
     *  particle's kinetic energy and rest energy.
     *
     *  @param  W       kinetic energy of the particle
     *  @param  Er      rest energy of particle
     *
     *  @return         relativistic factor gamma
     */
    static public double computeGammaFromEnergies(double W, double Er)   {
        double gamma = W/Er + 1.0;

        return gamma;
    };

    /**
     *  Convenience function for computing the probe's velocity beta (w.r.t. the
     *  speed of light) from the relativistic factor gamma.
     *
     *  @param beta     relativistic factor gamma
     *  @return         speed of probe (w.r.t. speed of light)
     */
    static public double computeBetaFromGamma(double gamma) {
        double beta = Math.sqrt(1.0 - 1.0/(gamma*gamma));

        return beta;
    };
    /**
     *  Convenience function for computing the probe's velocity beta (w.r.t. the
     *  speed of light) from the kinetic energy.
     *
     *  @param W     kinetic energy (eV)
     *  @param  Er      rest energy of particle  (eV)
     *  @return         speed of probe (w.r.t. speed of light)
     */
    static public double computeBetaFromEnergies(double W, double Er) {
	double gamma = computeGammaFromEnergies(W, Er);
        double beta = Math.sqrt(1.0 - 1.0/(gamma*gamma));

        return beta;
    };

    /**
     * Convenience function for computing momentum from kinetic energy
     *
     * @param  W       kinetic energy of the particle (eV)
     * @param  Er      rest energy of particle (eV)
     * @return         particle momentum in eV/c where c is the speed of light
     */
    static public double computeMomentumFromEnergies(double W, double Er) {
       double gamma = computeGammaFromEnergies(W, Er);
       double beta = computeBetaFromGamma(gamma);

       return beta*gamma*Er;
    }
}


text:
Moving from one data format to another is one of the core features of Pogues. This transformations may be accomplished using XSL transformations, external API calls, a set of serializer or whatever future expectation may require. Transformations may be chained together as well as used separately.

To help will this, every transformation implementation will have to rely on a common interface, easing the process of chaining or swapping transformations all accross the application.

## The Transformer  Interface

Consequently, as soon as we need to implement a transformation we will implement the Transformer interface which defines a set of ```transform``` methods with different types of inputs and outputs.

[include](../../../src/main/java/fr/insee/pogues/transforms/Transformer.java)

The params Map can be used to pass parameters along the transformation process that can be used by transformers to produce their output.

## The transform functional interface

To be able to use the Transformer interface methods using java 8 [method references](https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html) we define a Functional Interface which every Transformer method will conform to:

[import:'marker0'](../../../src/main/java/fr/insee/pogues/transforms/PipeLine.java)

## The Pipeline class

The Pipeline class is where we can chain our transform methods together to set up a more complex transformation process.

For instance, visualization is accomplished using the Pipeline class and a the following transformer chain:

```[Pogues JSON] -> [Pogues XML] -> [DDI] -> [XForm] -> [Form URI]```

Here is what the code will look like:
```java
class PipeSample{
    public String pipe(HttpServletRequest request){
        return pipeline
            .from(request.getInputStream())
            .map(jsonToXML::transform, params)
            .map(xmlToDDI::transform, params)
            .map(ddiToXForm::transform, params)
            .map(xformToUri::transform, params)
            .transform()
            .getBytes();
    }
}
```

Currently our very first implementation of the Pipeline class sticks to String inputs and String outputs.

Building a transformation chain begins with setting the input of the chain in the ```from``` method of the pipeline class (in the example we get our input from a request as a stream but input could be passed as well as a string argument).
Then we can chain transformers using the ```map``` method of the Pipeline. Both the from and the map method return the Pipeline instance, allowing us to chain call fluently.

Once we chained our Transformers we can then trigger the transformation process by calling transform on the pipeline. We have to notice that no transformation will be applied until we call this method.


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SoftJail.Data.Models
{
    public class Prisoner
    {
        //•	Id – integer, Primary Key
        //•	FullName – text with min length 3 and max length 20 (required)
        //•	Nickname – text starting with "The " and a single word only of letters with an uppercase letter for beginning(example: The Prisoner) (required)
        //•	Age – integer in the range[18, 65] (required)
        //•	IncarcerationDate ¬– Date(required)
        //•	ReleaseDate– Date
        //•	Bail– decimal (non-negative, minimum value: 0)
        //•	CellId - integer, foreign key
        //•	Cell – the prisoner's cell
        //•	Mails - collection of type Mail
        //•	PrisonerOfficers - collection of type OfficerPrisoner

        public Prisoner()
        {
            this.PrisonerOfficers = new List<OfficerPrisoner>();
            this.Mails = new List<Mail>();
        }

        public int Id { get; set; }

        [Required]
        [StringLength(20, MinimumLength = 3)]
        public string FullName { get; set; }

        [Required]
        [RegularExpression("^The [A-Z][a-z]+$")]
        public string Nickname { get; set; }

        [Required]
        [Range(18, 65)]
        public int Age { get; set; }

        [Required]
        public DateTime IncarcerationDate { get; set; }

        public DateTime? ReleaseDate { get; set; }

        [Range(typeof(decimal), "0", "79228162514264337593543950335")]
        public decimal? Bail { get; set; }

        public int? CellId { get; set; }
        public Cell Cell { get; set; }

        public ICollection<Mail> Mails { get; set; }

        public ICollection<OfficerPrisoner> PrisonerOfficers { get; set; }

    }
}


text:
import attr from 'ember-data/attr'
import Model from 'ember-data/model'
import {hasMany} from 'ember-data/relationships'

export default Model.extend({
  label: attr('string'),
  models: hasMany('model'),
  value: attr()
})


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Gdx Invaders</string>
</resources>


text:
import Debug.QuickCheck
import System.IO.Unsafe
import Control.Concurrent.Chan
import Control.Concurrent
import Control.Monad

data Action = NewChan | ReadChan | WriteChan Int | IsEmptyChan | ReturnInt Int
            | ReturnBool Bool
  deriving (Eq,Show)

main = do
  t <- myThreadId
  forkIO (threadDelay 1000000 >> killThread t)
        -- just in case we deadlock
  testChan

testChan :: IO ()
testChan = do
  quickCheck prop_NewIs_NewRet
  quickCheck prop_NewWriteIs_NewRet
  quickCheck prop_NewWriteRead_NewRet

prop_NewIs_NewRet =
  [NewChan,IsEmptyChan] =^ [NewChan,ReturnBool True]

prop_NewWriteIs_NewRet n =
  [NewChan,WriteChan n,IsEmptyChan] =^ [NewChan,WriteChan n,ReturnBool False]

prop_NewWriteRead_NewRet n =
  [NewChan,WriteChan n,ReadChan] =^ [NewChan,ReturnInt n]

perform :: [Action] -> IO ([Bool],[Int])
perform [] = return ([],[])

perform (a:as) =
  case a of
    ReturnInt v  -> liftM (\(b,l) -> (b,v:l)) (perform as)
    ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform as)
    NewChan      -> newChan >>= \chan -> perform' chan as
    _            -> error $ "Please use NewChan as first action"

perform' :: Chan Int -> [Action] -> IO ([Bool],[Int])
perform' _ [] = return ([],[])

perform' chan (a:as) =
  case a of
    ReturnInt v  -> liftM (\(b,l) -> (b,v:l)) (perform' chan as)
    ReturnBool v -> liftM (\(b,l) -> (v:b,l)) (perform' chan as)
    ReadChan     -> liftM2 (\v (b,l) -> (b,v:l)) (readChan chan)
                                (perform' chan as)
    WriteChan n  -> writeChan chan n >> perform' chan as
    IsEmptyChan  -> liftM2 (\v (b,l) -> (v:b,l)) (isEmptyChan chan)
                                (perform' chan as)
    _                -> error $ "If you want to use " ++ show a
                                ++ " please use the =^ operator"

actions :: Gen [Action]
actions =
  liftM (NewChan:) (actions' 0)

actions' :: Int -> Gen [Action]
actions' contents =
  oneof ([return [],
          liftM (IsEmptyChan:) (actions' contents),
          liftM2 (:) (liftM WriteChan arbitrary) (actions' (contents+1))]
          ++
          if contents==0
             then []
             else [liftM (ReadChan:) (actions' (contents-1))])

(=^) :: [Action] -> [Action] -> Property
c =^ c' =
  forAll (actions' (delta 0 c))
         (\suff -> observe c suff == observe c' suff)
  where observe x suff = unsafePerformIO (perform (x++suff))

(^=^) :: [Action] -> [Action] -> Property
c ^=^ c' =
  forAll actions
         (\pref -> forAll (actions' (delta 0 (pref++c)))
                          (\suff -> observe c pref suff ==
                                      observe c' pref suff))
  where observe x pref suff = unsafePerformIO (perform (pref++x++suff))

delta :: Int -> [Action] -> Int
delta i [] = i

delta i (ReturnInt _:as) = delta i as

delta i (ReturnBool _:as) = delta i as

delta _ (NewChan:as) = delta 0 as

delta i (WriteChan _:as) = delta (i+1) as

delta i (ReadChan:as) = delta (if i==0
                                  then error "read on empty Chan"
                                  else i-1) as

delta i (IsEmptyChan:as) = delta i as


text:
package flexiblepower.kisensum.simulation.house;

import java.util.Date;

import javax.measure.Measurable;
import javax.measure.quantity.Power;

import flexiblepower.kisensum.drivers.house.HouseState;

public final class HouseStateImpl implements HouseState {
    private final Measurable<Power> demand;
    private final Date time;
    private final HouseSimulation simulation;

    public HouseStateImpl(Measurable<Power> demand, Date time, HouseSimulation simulation) {
        this.demand = demand;
        this.time = time;
        this.simulation = simulation;
    }

    @Override
    public boolean isConnected() {
        return true;
    }

    @Override
    public Measurable<Power> getCurrentUsage() {
        return demand;
    }

    public Date getTime() {
        return time;
    }

    public HouseSimulation getSimulation() {
    	return simulation;
    }
}


text:
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'

module Google
  module Apis
    module DatastoreV1beta3

      class AllocateIdsRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class AllocateIdsResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ArrayValue
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class BeginTransactionRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class BeginTransactionResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class CommitRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class CommitResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class CompositeFilter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Entity
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class EntityResult
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Filter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1CommonMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1EntityFilter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1ExportEntitiesMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1ExportEntitiesResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1ImportEntitiesMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1IndexOperationMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1Progress
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1CommonMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1EntityFilter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1ExportEntitiesResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GoogleDatastoreAdminV1beta1Progress
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GqlQuery
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class GqlQueryParameter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Key
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class KindExpression
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class LatLng
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class LookupRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class LookupResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Mutation
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class MutationResult
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class PartitionId
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class PathElement
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Projection
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class PropertyFilter
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class PropertyOrder
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class PropertyReference
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Query
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class QueryResultBatch
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ReadOnly
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ReadOptions
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ReadWrite
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ReserveIdsRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class ReserveIdsResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class RollbackRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class RollbackResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class RunQueryRequest
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class RunQueryResponse
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class TransactionOptions
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class Value
        class Representation < Google::Apis::Core::JsonRepresentation; end

        include Google::Apis::Core::JsonObjectSupport
      end

      class AllocateIdsRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :keys, as: 'keys', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

        end
      end

      class AllocateIdsResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :keys, as: 'keys', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

        end
      end

      class ArrayValue
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :values, as: 'values', class: Google::Apis::DatastoreV1beta3::Value, decorator: Google::Apis::DatastoreV1beta3::Value::Representation

        end
      end

      class BeginTransactionRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :transaction_options, as: 'transactionOptions', class: Google::Apis::DatastoreV1beta3::TransactionOptions, decorator: Google::Apis::DatastoreV1beta3::TransactionOptions::Representation

        end
      end

      class BeginTransactionResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :transaction, :base64 => true, as: 'transaction'
        end
      end

      class CommitRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :mode, as: 'mode'
          collection :mutations, as: 'mutations', class: Google::Apis::DatastoreV1beta3::Mutation, decorator: Google::Apis::DatastoreV1beta3::Mutation::Representation

          property :transaction, :base64 => true, as: 'transaction'
        end
      end

      class CommitResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :index_updates, as: 'indexUpdates'
          collection :mutation_results, as: 'mutationResults', class: Google::Apis::DatastoreV1beta3::MutationResult, decorator: Google::Apis::DatastoreV1beta3::MutationResult::Representation

        end
      end

      class CompositeFilter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :filters, as: 'filters', class: Google::Apis::DatastoreV1beta3::Filter, decorator: Google::Apis::DatastoreV1beta3::Filter::Representation

          property :op, as: 'op'
        end
      end

      class Entity
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :key, as: 'key', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          hash :properties, as: 'properties', class: Google::Apis::DatastoreV1beta3::Value, decorator: Google::Apis::DatastoreV1beta3::Value::Representation

        end
      end

      class EntityResult
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :cursor, :base64 => true, as: 'cursor'
          property :entity, as: 'entity', class: Google::Apis::DatastoreV1beta3::Entity, decorator: Google::Apis::DatastoreV1beta3::Entity::Representation

          property :version, :numeric_string => true, as: 'version'
        end
      end

      class Filter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :composite_filter, as: 'compositeFilter', class: Google::Apis::DatastoreV1beta3::CompositeFilter, decorator: Google::Apis::DatastoreV1beta3::CompositeFilter::Representation

          property :property_filter, as: 'propertyFilter', class: Google::Apis::DatastoreV1beta3::PropertyFilter, decorator: Google::Apis::DatastoreV1beta3::PropertyFilter::Representation

        end
      end

      class GoogleDatastoreAdminV1CommonMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :end_time, as: 'endTime'
          hash :labels, as: 'labels'
          property :operation_type, as: 'operationType'
          property :start_time, as: 'startTime'
          property :state, as: 'state'
        end
      end

      class GoogleDatastoreAdminV1EntityFilter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :kinds, as: 'kinds'
          collection :namespace_ids, as: 'namespaceIds'
        end
      end

      class GoogleDatastoreAdminV1ExportEntitiesMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :common, as: 'common', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata::Representation

          property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1EntityFilter, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1EntityFilter::Representation

          property :output_url_prefix, as: 'outputUrlPrefix'
          property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress::Representation

          property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress::Representation

        end
      end

      class GoogleDatastoreAdminV1ExportEntitiesResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :output_url, as: 'outputUrl'
        end
      end

      class GoogleDatastoreAdminV1ImportEntitiesMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :common, as: 'common', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata::Representation

          property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1EntityFilter, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1EntityFilter::Representation

          property :input_url, as: 'inputUrl'
          property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress::Representation

          property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress::Representation

        end
      end

      class GoogleDatastoreAdminV1IndexOperationMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :common, as: 'common', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1CommonMetadata::Representation

          property :index_id, as: 'indexId'
          property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1Progress::Representation

        end
      end

      class GoogleDatastoreAdminV1Progress
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :work_completed, :numeric_string => true, as: 'workCompleted'
          property :work_estimated, :numeric_string => true, as: 'workEstimated'
        end
      end

      class GoogleDatastoreAdminV1beta1CommonMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :end_time, as: 'endTime'
          hash :labels, as: 'labels'
          property :operation_type, as: 'operationType'
          property :start_time, as: 'startTime'
          property :state, as: 'state'
        end
      end

      class GoogleDatastoreAdminV1beta1EntityFilter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :kinds, as: 'kinds'
          collection :namespace_ids, as: 'namespaceIds'
        end
      end

      class GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :common, as: 'common', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1CommonMetadata, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1CommonMetadata::Representation

          property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1EntityFilter::Representation

          property :output_url_prefix, as: 'outputUrlPrefix'
          property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress::Representation

          property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress::Representation

        end
      end

      class GoogleDatastoreAdminV1beta1ExportEntitiesResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :output_url, as: 'outputUrl'
        end
      end

      class GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :common, as: 'common', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1CommonMetadata, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1CommonMetadata::Representation

          property :entity_filter, as: 'entityFilter', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1EntityFilter, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1EntityFilter::Representation

          property :input_url, as: 'inputUrl'
          property :progress_bytes, as: 'progressBytes', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress::Representation

          property :progress_entities, as: 'progressEntities', class: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress, decorator: Google::Apis::DatastoreV1beta3::GoogleDatastoreAdminV1beta1Progress::Representation

        end
      end

      class GoogleDatastoreAdminV1beta1Progress
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :work_completed, :numeric_string => true, as: 'workCompleted'
          property :work_estimated, :numeric_string => true, as: 'workEstimated'
        end
      end

      class GqlQuery
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :allow_literals, as: 'allowLiterals'
          hash :named_bindings, as: 'namedBindings', class: Google::Apis::DatastoreV1beta3::GqlQueryParameter, decorator: Google::Apis::DatastoreV1beta3::GqlQueryParameter::Representation

          collection :positional_bindings, as: 'positionalBindings', class: Google::Apis::DatastoreV1beta3::GqlQueryParameter, decorator: Google::Apis::DatastoreV1beta3::GqlQueryParameter::Representation

          property :query_string, as: 'queryString'
        end
      end

      class GqlQueryParameter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :cursor, :base64 => true, as: 'cursor'
          property :value, as: 'value', class: Google::Apis::DatastoreV1beta3::Value, decorator: Google::Apis::DatastoreV1beta3::Value::Representation

        end
      end

      class Key
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :partition_id, as: 'partitionId', class: Google::Apis::DatastoreV1beta3::PartitionId, decorator: Google::Apis::DatastoreV1beta3::PartitionId::Representation

          collection :path, as: 'path', class: Google::Apis::DatastoreV1beta3::PathElement, decorator: Google::Apis::DatastoreV1beta3::PathElement::Representation

        end
      end

      class KindExpression
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :name, as: 'name'
        end
      end

      class LatLng
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :latitude, as: 'latitude'
          property :longitude, as: 'longitude'
        end
      end

      class LookupRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :keys, as: 'keys', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          property :read_options, as: 'readOptions', class: Google::Apis::DatastoreV1beta3::ReadOptions, decorator: Google::Apis::DatastoreV1beta3::ReadOptions::Representation

        end
      end

      class LookupResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :deferred, as: 'deferred', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          collection :found, as: 'found', class: Google::Apis::DatastoreV1beta3::EntityResult, decorator: Google::Apis::DatastoreV1beta3::EntityResult::Representation

          collection :missing, as: 'missing', class: Google::Apis::DatastoreV1beta3::EntityResult, decorator: Google::Apis::DatastoreV1beta3::EntityResult::Representation

        end
      end

      class Mutation
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :base_version, :numeric_string => true, as: 'baseVersion'
          property :delete, as: 'delete', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          property :insert, as: 'insert', class: Google::Apis::DatastoreV1beta3::Entity, decorator: Google::Apis::DatastoreV1beta3::Entity::Representation

          property :update, as: 'update', class: Google::Apis::DatastoreV1beta3::Entity, decorator: Google::Apis::DatastoreV1beta3::Entity::Representation

          property :upsert, as: 'upsert', class: Google::Apis::DatastoreV1beta3::Entity, decorator: Google::Apis::DatastoreV1beta3::Entity::Representation

        end
      end

      class MutationResult
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :conflict_detected, as: 'conflictDetected'
          property :key, as: 'key', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          property :version, :numeric_string => true, as: 'version'
        end
      end

      class PartitionId
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :namespace_id, as: 'namespaceId'
          property :project_id, as: 'projectId'
        end
      end

      class PathElement
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :id, :numeric_string => true, as: 'id'
          property :kind, as: 'kind'
          property :name, as: 'name'
        end
      end

      class Projection
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :property, as: 'property', class: Google::Apis::DatastoreV1beta3::PropertyReference, decorator: Google::Apis::DatastoreV1beta3::PropertyReference::Representation

        end
      end

      class PropertyFilter
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :op, as: 'op'
          property :property, as: 'property', class: Google::Apis::DatastoreV1beta3::PropertyReference, decorator: Google::Apis::DatastoreV1beta3::PropertyReference::Representation

          property :value, as: 'value', class: Google::Apis::DatastoreV1beta3::Value, decorator: Google::Apis::DatastoreV1beta3::Value::Representation

        end
      end

      class PropertyOrder
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :direction, as: 'direction'
          property :property, as: 'property', class: Google::Apis::DatastoreV1beta3::PropertyReference, decorator: Google::Apis::DatastoreV1beta3::PropertyReference::Representation

        end
      end

      class PropertyReference
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :name, as: 'name'
        end
      end

      class Query
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          collection :distinct_on, as: 'distinctOn', class: Google::Apis::DatastoreV1beta3::PropertyReference, decorator: Google::Apis::DatastoreV1beta3::PropertyReference::Representation

          property :end_cursor, :base64 => true, as: 'endCursor'
          property :filter, as: 'filter', class: Google::Apis::DatastoreV1beta3::Filter, decorator: Google::Apis::DatastoreV1beta3::Filter::Representation

          collection :kind, as: 'kind', class: Google::Apis::DatastoreV1beta3::KindExpression, decorator: Google::Apis::DatastoreV1beta3::KindExpression::Representation

          property :limit, as: 'limit'
          property :offset, as: 'offset'
          collection :order, as: 'order', class: Google::Apis::DatastoreV1beta3::PropertyOrder, decorator: Google::Apis::DatastoreV1beta3::PropertyOrder::Representation

          collection :projection, as: 'projection', class: Google::Apis::DatastoreV1beta3::Projection, decorator: Google::Apis::DatastoreV1beta3::Projection::Representation

          property :start_cursor, :base64 => true, as: 'startCursor'
        end
      end

      class QueryResultBatch
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :end_cursor, :base64 => true, as: 'endCursor'
          property :entity_result_type, as: 'entityResultType'
          collection :entity_results, as: 'entityResults', class: Google::Apis::DatastoreV1beta3::EntityResult, decorator: Google::Apis::DatastoreV1beta3::EntityResult::Representation

          property :more_results, as: 'moreResults'
          property :skipped_cursor, :base64 => true, as: 'skippedCursor'
          property :skipped_results, as: 'skippedResults'
          property :snapshot_version, :numeric_string => true, as: 'snapshotVersion'
        end
      end

      class ReadOnly
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
        end
      end

      class ReadOptions
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :read_consistency, as: 'readConsistency'
          property :transaction, :base64 => true, as: 'transaction'
        end
      end

      class ReadWrite
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :previous_transaction, :base64 => true, as: 'previousTransaction'
        end
      end

      class ReserveIdsRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :database_id, as: 'databaseId'
          collection :keys, as: 'keys', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

        end
      end

      class ReserveIdsResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
        end
      end

      class RollbackRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :transaction, :base64 => true, as: 'transaction'
        end
      end

      class RollbackResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
        end
      end

      class RunQueryRequest
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :gql_query, as: 'gqlQuery', class: Google::Apis::DatastoreV1beta3::GqlQuery, decorator: Google::Apis::DatastoreV1beta3::GqlQuery::Representation

          property :partition_id, as: 'partitionId', class: Google::Apis::DatastoreV1beta3::PartitionId, decorator: Google::Apis::DatastoreV1beta3::PartitionId::Representation

          property :query, as: 'query', class: Google::Apis::DatastoreV1beta3::Query, decorator: Google::Apis::DatastoreV1beta3::Query::Representation

          property :read_options, as: 'readOptions', class: Google::Apis::DatastoreV1beta3::ReadOptions, decorator: Google::Apis::DatastoreV1beta3::ReadOptions::Representation

        end
      end

      class RunQueryResponse
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :batch, as: 'batch', class: Google::Apis::DatastoreV1beta3::QueryResultBatch, decorator: Google::Apis::DatastoreV1beta3::QueryResultBatch::Representation

          property :query, as: 'query', class: Google::Apis::DatastoreV1beta3::Query, decorator: Google::Apis::DatastoreV1beta3::Query::Representation

        end
      end

      class TransactionOptions
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :read_only, as: 'readOnly', class: Google::Apis::DatastoreV1beta3::ReadOnly, decorator: Google::Apis::DatastoreV1beta3::ReadOnly::Representation

          property :read_write, as: 'readWrite', class: Google::Apis::DatastoreV1beta3::ReadWrite, decorator: Google::Apis::DatastoreV1beta3::ReadWrite::Representation

        end
      end

      class Value
        # @private
        class Representation < Google::Apis::Core::JsonRepresentation
          property :array_value, as: 'arrayValue', class: Google::Apis::DatastoreV1beta3::ArrayValue, decorator: Google::Apis::DatastoreV1beta3::ArrayValue::Representation

          property :blob_value, :base64 => true, as: 'blobValue'
          property :boolean_value, as: 'booleanValue'
          property :double_value, as: 'doubleValue'
          property :entity_value, as: 'entityValue', class: Google::Apis::DatastoreV1beta3::Entity, decorator: Google::Apis::DatastoreV1beta3::Entity::Representation

          property :exclude_from_indexes, as: 'excludeFromIndexes'
          property :geo_point_value, as: 'geoPointValue', class: Google::Apis::DatastoreV1beta3::LatLng, decorator: Google::Apis::DatastoreV1beta3::LatLng::Representation

          property :integer_value, :numeric_string => true, as: 'integerValue'
          property :key_value, as: 'keyValue', class: Google::Apis::DatastoreV1beta3::Key, decorator: Google::Apis::DatastoreV1beta3::Key::Representation

          property :meaning, as: 'meaning'
          property :null_value, as: 'nullValue'
          property :string_value, as: 'stringValue'
          property :timestamp_value, as: 'timestampValue'
        end
      end
    end
  end
end


text:
#region Apache License Version 2.0

#endregion Apache License Version 2.0

/*----------------------------------------------------------------
    Copyright (C) 2017 Senparc

    文件名:MessageContext.cs
    文件功能描述:微信消息上下文(单个用户)接口

    创建标识:Senparc - 20150211

    修改标识:Senparc - 20150303
    修改描述:整理接口

    修改标识:Senparc - 20150708
    修改描述:完善备注
----------------------------------------------------------------*/

using System;
using Senparc.Weixin.Entities;

namespace Senparc.Weixin.Context
{
    /// <summary>
    /// 微信消息上下文(单个用户)接口
    /// </summary>
    /// <typeparam name="TRequest">请求消息类型</typeparam>
    /// <typeparam name="TResponse">响应消息类型</typeparam>
    public interface IMessageContext<TRequest, TResponse>
        where TRequest : IRequestMessageBase
        where TResponse : IResponseMessageBase
    {
        /// <summary>
        /// 用户名(OpenID)
        /// </summary>
        string UserName { get; set; }
        /// <summary>
        /// 最后一次活动时间(用户主动发送Resquest请求的时间)
        /// </summary>
        DateTime LastActiveTime { get; set; }
        /// <summary>
        /// 接收消息记录
        /// </summary>
        MessageContainer<TRequest> RequestMessages { get; set; }
        /// <summary>
        /// 响应消息记录
        /// </summary>
        MessageContainer<TResponse> ResponseMessages { get; set; }
        /// <summary>
        /// 最大储存容量(分别针对RequestMessages和ResponseMessages)
        /// </summary>
        int MaxRecordCount { get; set; }
        /// <summary>
        /// 临时储存数据,如用户状态等,出于保持.net 3.5版本,这里暂不使用dynamic
        /// </summary>
        object StorageData { get; set; }

        /// <summary>
        /// 用于覆盖WeixinContext所设置的默认过期时间
        /// </summary>
        Double? ExpireMinutes { get; set; }

        /// <summary>
        /// AppStore状态,系统属性,请勿操作
        /// </summary>
        AppStoreState AppStoreState { get; set; }

        event EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> MessageContextRemoved;

        void OnRemoved();
    }

    /// <summary>
    /// 微信消息上下文(单个用户)
    /// </summary>
    public class MessageContext<TRequest, TResponse> : IMessageContext<TRequest, TResponse>
        where TRequest : IRequestMessageBase
        where TResponse : IResponseMessageBase
    {
        private int _maxRecordCount;

        public string UserName { get; set; }
        public DateTime LastActiveTime { get; set; }
        public MessageContainer<TRequest> RequestMessages { get; set; }
        public MessageContainer<TResponse> ResponseMessages { get; set; }
        public int MaxRecordCount
        {
            get
            {
                return _maxRecordCount;
            }
            set
            {
                RequestMessages.MaxRecordCount = value;
                ResponseMessages.MaxRecordCount = value;

                _maxRecordCount = value;
            }
        }
        public object StorageData { get; set; }

        public Double? ExpireMinutes { get; set; }

        /// <summary>
        /// AppStore状态,系统属性,请勿操作
        /// </summary>
        public AppStoreState AppStoreState { get; set; }

        /// <summary>
        /// 当MessageContext被删除时触发的事件
        /// </summary>
        public virtual event EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> MessageContextRemoved = null;

        /// <summary>
        /// 执行上下文被移除的事件
        /// 注意:此事件不是实时触发的,而是等过期后任意一个人发过来的下一条消息执行之前触发。
        /// </summary>
        /// <param name="e"></param>
        private void OnMessageContextRemoved(WeixinContextRemovedEventArgs<TRequest, TResponse> e)
        {
            EventHandler<WeixinContextRemovedEventArgs<TRequest, TResponse>> temp = MessageContextRemoved;

            if (temp != null)
            {
                temp(this, e);
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="maxRecordCount">maxRecordCount如果小于等于0,则不限制</param>
        public MessageContext(/*MessageContainer<IRequestMessageBase> requestMessageContainer,
            MessageContainer<IResponseMessageBase> responseMessageContainer*/)
        {
            /*
             * 注意:即使使用其他类实现IMessageContext,
             * 也务必在这里进行下面的初始化,尤其是设置当前时间,
             * 这个时间关系到及时从缓存中移除过期的消息,节约内存使用
             */

            RequestMessages = new MessageContainer<TRequest>(MaxRecordCount);
            ResponseMessages = new MessageContainer<TResponse>(MaxRecordCount);
            LastActiveTime = DateTime.Now;
        }

        /// <summary>
        /// 此上下文被清除的时候触发
        /// </summary>
        public virtual void OnRemoved()
        {
            var onRemovedArg = new WeixinContextRemovedEventArgs<TRequest, TResponse>(this);
            OnMessageContextRemoved(onRemovedArg);
        }
    }
}


text:
import Users from 'meteor/vulcan:users';

Users.addField([
  {
    fieldName: 'stripeCustomerId',
    fieldSchema: {
      type: String,
      optional: true,
    },
  },
]);


text:
Carrierwave plugin that allows to create images from data uri

:warning: Please read the [migration notes](#migration-notes) before upgrading to a new major version.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'carrierwave-data-uri'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install carrierwave-data-uri

## Usage

```ruby
class User < ActiveRecord::Base
  mount_uploader :avatar, AvatarUploader
end
```

Then a data string can be used as a source for the uploader

```
user = User.find 123
user.avatar_data_uri = 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP////8AAP///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
user.save
```

the data string can be retrieved too

```
user.avatar_data_uri # => data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP////8AAP///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==
```

There will be no error in case of empty or invalid data.
There is a loud version available that could be used to raise an error on empty or invalid data:

```
user = User.find 123
user.avatar_data_uri_loud = '' # will raise `CarrierWave::DataUri::InvalidData` error
```

Optionally, to customize the file name, specify the `#{column}_data_filename` and `#{column}_data_mimetype` attributes before the `#{column}_data_uri` attribute.

```ruby
user = User.find 123
user.avatar_data_filename = 'somefile.jpg'
user.avatar_data_mimetype = 'image/jpeg'
user.avatar_data_uri = 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP////8AAP///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw=='
user.save
```

## Migration Notes

#### Version 0.2.0

- Assigning empty data is not raising an error now. Use loud version(`model.field_data_uri_loud =`) instead.

## Contributing

1. Fork it ( https://github.com/[my-github-username]/carrierwave-data-uri/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

## Credits

* http://www.davehulihan.com/uploading-data-uris-in-carrierwave/