text:
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
  <report_format_detail>
    <FileFormat>
      <FormatID>2026</FormatID>
      <FormatName>Lotus Freelance Show</FormatName>
      <FormatVersion>
      </FormatVersion>
      <FormatAliases>
      </FormatAliases>
      <FormatFamilies>
      </FormatFamilies>
      <FormatTypes>Presentation</FormatTypes>
      <FormatDisclosure>
      </FormatDisclosure>
      <FormatDescription>Lotus Freelance is a presentation/slide show application. A slide show viewer called Mobile Screen Show Player is available from the Lotus FTP site: ftp://ftp.lotus.com/pub/lotusweb/product/freelance/</FormatDescription>
      <BinaryFileFormat>
      </BinaryFileFormat>
      <ByteOrders>
      </ByteOrders>
      <ReleaseDate>
      </ReleaseDate>
      <WithdrawnDate>
      </WithdrawnDate>
      <ProvenanceSourceID>1</ProvenanceSourceID>
      <ProvenanceName>Digital Preservation Department / The National Archives</ProvenanceName>
      <ProvenanceSourceDate>20 Aug 2018</ProvenanceSourceDate>
      <ProvenanceDescription>
      </ProvenanceDescription>
      <LastUpdatedDate>20 Aug 2018</LastUpdatedDate>
      <FormatNote>
      </FormatNote>
      <FormatRisk>
      </FormatRisk>
      <TechnicalEnvironment>
      </TechnicalEnvironment>
      <FileFormatIdentifier>
        <Identifier>application/vnd.lotus-freelance</Identifier>
        <IdentifierType>MIME</IdentifierType>
      </FileFormatIdentifier>
      <FileFormatIdentifier>
        <Identifier>fmt/1216</Identifier>
        <IdentifierType>PUID</IdentifierType>
      </FileFormatIdentifier>
      <Developers>
        <DeveloperID>95</DeveloperID>
        <DeveloperName>
        </DeveloperName>
        <OrganisationName>Lotus Corporation</OrganisationName>
        <DeveloperCompoundName>Lotus Corporation</DeveloperCompoundName>
      </Developers>
      <Support>
        <SupportID>95</SupportID>
        <SupportName>
        </SupportName>
        <OrganisationName>Lotus Corporation</OrganisationName>
        <SupportCompoundName>Lotus Corporation</SupportCompoundName>
      </Support>
      <ExternalSignature>
        <ExternalSignatureID>2254</ExternalSignatureID>
        <Signature>prz</Signature>
        <SignatureType>File extension</SignatureType>
      </ExternalSignature>
      <InternalSignature>
        <SignatureID>1593</SignatureID>
        <SignatureName>Lotus Freelance Show</SignatureName>
        <SignatureNote>0x00010F00 'FREELANCE, 0x000A</SignatureNote>
        <ByteSequence>
          <ByteSequenceID>1864</ByteSequenceID>
          <PositionType>Absolute from BOF</PositionType>
          <Offset>0</Offset>
          <MaxOffset>0</MaxOffset>
          <IndirectOffsetLocation>
          </IndirectOffsetLocation>
          <IndirectOffsetLength>
          </IndirectOffsetLength>
          <Endianness>
          </Endianness>
          <ByteSequenceValue>00010F00465245454C414E434504000A</ByteSequenceValue>
        </ByteSequence>
      </InternalSignature>
    </FileFormat>
    <SearchCriteria>Criteria</SearchCriteria>
  </report_format_detail>
</PRONOM-Report>


text:
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace ConfigWithStartWizard.Common {
    /// <summary>
    ///If the string length > 0 is "true" then true is returned, otherwise false.
    /// </summary>
    /// <remarks>If the string value "true" is passed as the parameter the returned bool is flipped</remarks>
    public class StringToBoolConverter : IValueConverter {
        /// <summary>
        /// Converts OnlineUri query string length to a bool. A query string length > 0 returns true
        /// </summary>
        /// <returns>Pass "true" as the parameter to flip (reverse) the returned bool (i.e. !true or !false)</returns>
        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) {

            string content = value == null ? "" : (string)value;
            var enable = content.Length > 0;

            if (parameter != null) {
                if (parameter.ToString().ToLower().CompareTo("true") == 0) {
                    //invert the enabled
                    enable = !enable;
                }
            }

            return enable;
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) {
            throw new InvalidOperationException("Converter cannot convert back.");
        }

    }

    public class ReverseBoolConverter : IValueConverter {

        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) {
            return !(bool)value;
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) {
            throw new InvalidOperationException("Converter cannot convert back.");
        }

    }

    /// <summary>
    /// Converts the given bool to a Visibility
    /// </summary>
    public class BoolToVisibilityConverter : IValueConverter {

        public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) {
            if (value == null)
                return Visibility.Hidden;
            bool val = (bool)value;
            return val ? Visibility.Visible : Visibility.Hidden;
        }

        public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) {
            throw new InvalidOperationException("Converter cannot convert back.");
        }

    }

    //private class ImageUtilities {
    //    BitmapImage BitmapToImageSource(Bitmap bitmap) {
    //        using (MemoryStream memory = new MemoryStream()) {
    //            bitmap.Save(memory, System.Drawing.Imaging.ImageFormat.Bmp);
    //            memory.Position = 0;
    //            BitmapImage bitmapimage = new BitmapImage();
    //            bitmapimage.BeginInit();
    //            bitmapimage.StreamSource = memory;
    //            bitmapimage.CacheOption = BitmapCacheOption.OnLoad;
    //            bitmapimage.EndInit();

    //            return bitmapimage;
    //        }
    //    }
    //}
}

redpajama_set_name: RedPajamaGithub


text:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke android:width="4dp" android:color="#FF00FF00" />
	<solid android:color="#FF808080" />
    <padding android:left="7dp" android:top="7dp"
            android:right="7dp" android:bottom="7dp" />
    <corners android:radius="4dp" />
</shape>


text:
.class public Landroid/widget/Gallery$LayoutParams;
.super Landroid/view/ViewGroup$LayoutParams;
.source "Gallery.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/widget/Gallery;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "LayoutParams"
.end annotation

# direct methods
.method public constructor <init>(II)V
    .locals 0
    .parameter "w"
    .parameter "h"

    .prologue
    .line 1479
    invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    .line 1480
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "c"
    .parameter "attrs"

    .prologue
    .line 1475
    invoke-direct {p0, p1, p2}, Landroid/view/ViewGroup$LayoutParams;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 1476
    return-void
.end method

.method public constructor <init>(Landroid/view/ViewGroup$LayoutParams;)V
    .locals 0
    .parameter "source"

    .prologue
    .line 1483
    invoke-direct {p0, p1}, Landroid/view/ViewGroup$LayoutParams;-><init>(Landroid/view/ViewGroup$LayoutParams;)V

    .line 1484
    return-void
.end method


text:
#ifndef COLUSA_H
#define COLUSA_H

 // Defines specific for Colusa

 // Comments

#define BASE_ALERT_NONE                         0
#define BASE_ALERT_FALSE_ALARM                  1
#define BASE_ALERT_GATE                         2
#define BASE_ALERT_GAS_STATION                  3
#define BASE_ALERT_FULL                         4
#define REPLACEMENTS_UNKNOWN                    0
#define REPLACEMENTS_KNOWN                      1
#define REPLACEMENTS_REPORT                     2

#endif // COLUSA_H


text:
namespace phi {

template <typename Context>
void AssignKernel(const Context& dev_ctx,
                  const DenseTensor& x,
                  DenseTensor* out);

template <typename Context>
DenseTensor Assign(const Context& dev_ctx, const DenseTensor& x) {
  DenseTensor out;
  MetaTensor meta_out(&out);
  MetaTensor meta_x(x);
  UnchangedInferMeta(meta_x, &meta_out);
  AssignKernel<Context>(dev_ctx, x, &out);
  return out;
}

// In order to be compatible with the `AsDispensable` input in the original
// assign op maker, the input parameter here needs to be dispensable, but
// this looks weird
template <typename Context>
void AssignRawKernel(const Context& dev_ctx,
                     const paddle::optional<DenseTensor>& x,
                     DenseTensor* out);

template <typename Context>
void AssignArrayKernel(const Context& dev_ctx,
                       const TensorArray& x,
                       TensorArray* out);

template <typename T, typename Context>
void AssignValueKernel(const Context& dev_ctx,
                       const std::vector<int>& shape,
                       DataType dtype,
                       const std::vector<Scalar>& values,
                       DenseTensor* out);

}  // namespace phi


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Clitocybe fibulotuba Ramain

### Remarks
null


text:
/**
 * @exports ZeroElevationModel
 * @version $Id: ZeroElevationModel.js 2936 2015-03-27 22:04:59Z tgaskins $
 */
define([
        '../error/ArgumentError',
        '../globe/ElevationModel',
        '../geom/Location',
        '../util/Logger',
        '../geom/Sector'],
    function (ArgumentError,
              ElevationModel,
              Location,
              Logger,
              Sector) {
        "use strict";

        /**
         * Constructs a Zero elevation model whose elevations are zero at every location.
         * @alias ZeroElevationModel
         * @constructor
         * @classdesc Represents an elevation model whose elevations are zero at all locations.
         * @augments ElevationModel
         */
        var ZeroElevationModel = function () {
            ElevationModel.call(this, Sector.FULL_SPHERE, new Location(45, 45), 1, " ", " ", 150, 150);

            /**
             * Indicates this elevation model's display name.
             * @type {string}
             * @default "Zero Elevations"
             */
            this.displayName = "Zero Elevations";

            /**
             * Indicates the last time this elevation model changed. Since a zero elevation model never changes, this
             * property always returns the date and time at which the elevation model was constructed, in milliseconds
             * since midnight Jan 1, 1970.
             * @type {number}
             * @default Date.getTime() at construction
             * @readonly
             */
            this.timestamp = Date.now();

            /**
             * This elevation model's minimum elevation, which is always 0.
             * @type {number}
             * @default 0
             * @readonly
             */
            this.minElevation = 0;

            /**
             * This elevation model's maximum elevation, which is always 0.
             * @type {number}
             * @default 0
             * @readonly
             */
            this.maxElevation = 0;
        };

        // Inherit from the abstract elevation model class.
        ZeroElevationModel.prototype = Object.create(ElevationModel.prototype);

        /**
         * Returns minimum and maximum elevations of 0.
         * @param {Sector} sector The sector for which to determine extreme elevations.
         * @returns {Number[]} An array containing minimum and maximum elevations of 0.
         */
        ZeroElevationModel.prototype.minAndMaxElevationsForSector = function (sector) {
            return [0, 0];
        };

        /**
         * Returns 0 as the elevation at a specified location.
         * @param {Number} latitude The location's latitude in degrees.
         * @param {Number} longitude The location's longitude in degrees.
         * @returns {Number} 0.
         */
        ZeroElevationModel.prototype.elevationAtLocation = function (latitude, longitude) {
            return 0;
        };

        /**
         * Returns the elevations at locations within a specified sector. For this elevation model they are all 0.
         * @param {Sector} sector The sector for which to determine the elevations.
         * @param {Number} numLat The number of latitudinal sample locations within the sector.
         * @param {Number} numLon The number of longitudinal sample locations within the sector.
         * @param {Number} targetResolution The desired elevation resolution.
         * @param {Number[]} result An array of size numLat x numLon to contain the requested elevations.
         * This array must be allocated when passed to this function.
         * @returns {Number} The resolution actually achieved, which may be greater than that requested if the
         * elevation data for the requested resolution is not currently available.
         * @throws {ArgumentError} If the specified sector or result array is null or undefined, if either of the
         * specified numLat or numLon values is less than 1, or the result array is not of sufficient length
         * to hold numLat x numLon values.
         */
        ZeroElevationModel.prototype.elevationsForGrid = function (sector, numLat, numLon, targetResolution, result) {
            if (!sector) {
                throw new ArgumentError(
                    Logger.logMessage(Logger.LEVEL_SEVERE, "ZeroElevationModel", "elevationsForSector", "missingSector"));
            }

            if (numLat <= 0 || numLon <= 0) {
                throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "ZeroElevationModel",
                    "elevationsForSector", "numLat or numLon is less than 1"));
            }

            if (!result || result.length < numLat * numLon) {
                throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "ZeroElevationModel",
                    "elevationsForSector", "missingArray"));
            }

            for (var i = 0, len = result.length; i < len; i++) {
                result[i] = 0;
            }

            return 0;
        };

        return ZeroElevationModel;
    });


text:
package org.apache.tomcat.websocket;

import java.nio.ByteBuffer;

import jakarta.websocket.PongMessage;

public class WsPongMessage implements PongMessage {

    private final ByteBuffer applicationData;

    public WsPongMessage(ByteBuffer applicationData) {
        byte[] dst = new byte[applicationData.limit()];
        applicationData.get(dst);
        this.applicationData = ByteBuffer.wrap(dst);
    }

    @Override
    public ByteBuffer getApplicationData() {
        return applicationData;
    }
}


text:
package org.openkilda.floodlight.command.flow.egress;

import org.openkilda.floodlight.model.FlowSegmentMetadata;
import org.openkilda.floodlight.switchmanager.SwitchManager;
import org.openkilda.floodlight.utils.OfFlowModBuilderFactory;
import org.openkilda.floodlight.utils.OfFlowModDelMultiTableMessageBuilderFactory;
import org.openkilda.floodlight.utils.OfFlowModDelSingleTableMessageBuilderFactory;
import org.openkilda.messaging.MessageContext;
import org.openkilda.model.FlowEndpoint;
import org.openkilda.model.FlowTransitEncapsulation;
import org.openkilda.model.MirrorConfig;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.UUID;

public class EgressMirrorFlowSegmentRemoveCommand extends EgressFlowSegmentRemoveCommand {
    private static OfFlowModBuilderFactory makeFlowModBuilderFactory(boolean isMultiTable) {
        if (isMultiTable) {
            return new OfFlowModDelMultiTableMessageBuilderFactory(SwitchManager.MIRROR_FLOW_PRIORITY);
        } else {
            return new OfFlowModDelSingleTableMessageBuilderFactory(SwitchManager.MIRROR_FLOW_PRIORITY);
        }
    }

    @JsonCreator
    public EgressMirrorFlowSegmentRemoveCommand(
            @JsonProperty("message_context") MessageContext context,
            @JsonProperty("command_id") UUID commandId,
            @JsonProperty("metadata") FlowSegmentMetadata metadata,
            @JsonProperty("endpoint") FlowEndpoint endpoint,
            @JsonProperty("ingress_endpoint") FlowEndpoint ingressEndpoint,
            @JsonProperty("isl_port") int islPort,
            @JsonProperty("encapsulation") FlowTransitEncapsulation encapsulation,
            @JsonProperty("mirror_config") MirrorConfig mirrorConfig) {
        super(
                context, commandId, metadata, endpoint, ingressEndpoint, islPort, encapsulation,
                makeFlowModBuilderFactory(metadata.isMultiTable()), mirrorConfig);
    }
}


text:
from __future__ import unicode_literals

"""Contains container classes to represent different protocol buffer types.

This file defines container classes which represent categories of protocol
buffer field types which need extra maintenance. Currently these categories
are:
  - Repeated scalar fields - These are all repeated fields which aren't
    composite (e.g. they are of simple types like int32, string, etc).
  - Repeated composite fields - Repeated fields which are composite. This
    includes groups and nested messages.
"""

__author__ = 'petar@google.com (Petar Petrov)'

from google.protobuf.internal.utils import cmp

class BaseContainer(object):

  """Base container class."""

  # Minimizes memory usage and disallows assignment to other attributes.
  __slots__ = ['_message_listener', '_values']

  def __init__(self, message_listener):
    """
    Args:
      message_listener: A MessageListener implementation.
        The RepeatedScalarFieldContainer will call this object's
        Modified() method when it is modified.
    """
    self._message_listener = message_listener
    self._values = []

  def __getitem__(self, key):
    """Retrieves item by the specified key."""
    return self._values[key]

  def __len__(self):
    """Returns the number of elements in the container."""
    return len(self._values)

  def __ne__(self, other):
    """Checks if another instance isn't equal to this one."""
    # The concrete classes should define __eq__.
    return not self == other

  def __hash__(self):
    raise TypeError('unhashable object')

  def __repr__(self):
    return repr(self._values)

  def sort(self, *args, **kwargs):
    # Continue to support the old sort_function keyword argument.
    # This is expected to be a rare occurrence, so use LBYL to avoid
    # the overhead of actually catching KeyError.
    if 'sort_function' in kwargs:
      kwargs['cmp'] = kwargs.pop('sort_function')
    self._values.sort(*args, **kwargs)

class RepeatedScalarFieldContainer(BaseContainer):

  """Simple, type-checked, list-like container for holding repeated scalars."""

  # Disallows assignment to other attributes.
  __slots__ = ['_type_checker']

  def __init__(self, message_listener, type_checker):
    """
    Args:
      message_listener: A MessageListener implementation.
        The RepeatedScalarFieldContainer will call this object's
        Modified() method when it is modified.
      type_checker: A type_checkers.ValueChecker instance to run on elements
        inserted into this container.
    """
    super(RepeatedScalarFieldContainer, self).__init__(message_listener)
    self._type_checker = type_checker

  def append(self, value):
    """Appends an item to the list. Similar to list.append()."""
    self._type_checker.CheckValue(value)
    self._values.append(value)
    if not self._message_listener.dirty:
      self._message_listener.Modified()

  def insert(self, key, value):
    """Inserts the item at the specified position. Similar to list.insert()."""
    self._type_checker.CheckValue(value)
    self._values.insert(key, value)
    if not self._message_listener.dirty:
      self._message_listener.Modified()

  def extend(self, elem_seq):
    """Extends by appending the given sequence. Similar to list.extend()."""
    if not elem_seq:
      return

    new_values = []
    for elem in elem_seq:
      self._type_checker.CheckValue(elem)
      new_values.append(elem)
    self._values.extend(new_values)
    self._message_listener.Modified()

  def MergeFrom(self, other):
    """Appends the contents of another repeated field of the same type to this
    one. We do not check the types of the individual fields.
    """
    self._values.extend(other._values)
    self._message_listener.Modified()

  def remove(self, elem):
    """Removes an item from the list. Similar to list.remove()."""
    self._values.remove(elem)
    self._message_listener.Modified()

  def __setitem__(self, key, value):
    """Sets the item on the specified position."""
    if isinstance(key, slice):
        new_values = []
        for val in value:
          self._type_checker.CheckValue(val)
          new_values.append(val)
        self._values[key.start:key.stop] = new_values
        self._message_listener.Modified()
    else:
        self._type_checker.CheckValue(value)
        self._values[key] = value
        self._message_listener.Modified()

  def __getitem__(self, key):
    """Retrieves the subset of items from between the specified indices."""
    if isinstance(key, slice):
        return self._values[key.start:key.stop]
    else:
        return super(RepeatedScalarFieldContainer, self).__getitem__(key)

  def __delitem__(self, key):
    """Deletes the subset of items from between the specified indices."""
    if isinstance(key, slice):
        del self._values[key.start:key.stop]
    else:
        del self._values[key]
    self._message_listener.Modified()

  def __eq__(self, other):
    """Compares the current instance with another one."""
    if self is other:
      return True
    # Special case for the same type which should be common and fast.
    if isinstance(other, self.__class__):
      return other._values == self._values
    # We are presumably comparing against some other sequence type.
    return other == self._values

class RepeatedCompositeFieldContainer(BaseContainer):

  """Simple, list-like container for holding repeated composite fields."""

  # Disallows assignment to other attributes.
  __slots__ = ['_message_descriptor']

  def __init__(self, message_listener, message_descriptor):
    """
    Note that we pass in a descriptor instead of the generated directly,
    since at the time we construct a _RepeatedCompositeFieldContainer we
    haven't yet necessarily initialized the type that will be contained in the
    container.

    Args:
      message_listener: A MessageListener implementation.
        The RepeatedCompositeFieldContainer will call this object's
        Modified() method when it is modified.
      message_descriptor: A Descriptor instance describing the protocol type
        that should be present in this container.  We'll use the
        _concrete_class field of this descriptor when the client calls add().
    """
    super(RepeatedCompositeFieldContainer, self).__init__(message_listener)
    self._message_descriptor = message_descriptor

  def add(self, **kwargs):
    """Adds a new element at the end of the list and returns it. Keyword
    arguments may be used to initialize the element.
    """
    new_element = self._message_descriptor._concrete_class(**kwargs)
    new_element._SetListener(self._message_listener)
    self._values.append(new_element)
    if not self._message_listener.dirty:
      self._message_listener.Modified()
    return new_element

  def extend(self, elem_seq):
    """Extends by appending the given sequence of elements of the same type
    as this one, copying each individual message.
    """
    message_class = self._message_descriptor._concrete_class
    listener = self._message_listener
    values = self._values
    for message in elem_seq:
      new_element = message_class()
      new_element._SetListener(listener)
      new_element.MergeFrom(message)
      values.append(new_element)
    listener.Modified()

  def MergeFrom(self, other):
    """Appends the contents of another repeated field of the same type to this
    one, copying each individual message.
    """
    self.extend(other._values)

  def remove(self, elem):
    """Removes an item from the list. Similar to list.remove()."""
    self._values.remove(elem)
    self._message_listener.Modified()

  def __getitem__(self, key):
    """Retrieves the subset of items from between the specified indices."""
    if isinstance(key, slice):
        return self._values[key.start:key.stop]
    else:
        return super(RepeatedCompositeFieldContainer, self).__getitem__(key)

  def __delitem__(self, key):
    """Deletes the subset of items from between the specified indices."""
    if isinstance(key, slice):
        del self._values[key.start:key.stop]
    else:
        del self._values[key]
    self._message_listener.Modified()

  def __eq__(self, other):
    """Compares the current instance with another one."""
    if self is other:
      return True
    if not isinstance(other, self.__class__):
      raise TypeError('Can only compare repeated composite fields against '
                      'other repeated composite fields.')
    return self._values == other._values


text:
:: Include configurations
call mi_mini_pppoe_relay_config.cmd

:::::::::::::::::::::::::::::::::::::::::::::
:: Please update configurations above only ::
:::::::::::::::::::::::::::::::::::::::::::::

SET STORAGE_DIR=/extdisks/sda1/xiaomi_router
SET PROGRAM_DIR=%STORAGE_DIR%/pppoe_relay_mi_mini

:: router connection check
ping -n 1 %DEFAULT_IP% | find "TTL=" >nul
if errorlevel 1 (
    echo host not reachable
	goto PROGRAM_END
) else (
    echo host reachable
)

:: create target directory
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% mkdir -p %PROGRAM_DIR%

:: put all related file
pscp.exe -scp -pw %DEFAULT_PW% INSTALL.sh %DEFAULT_ID%@%DEFAULT_IP%:%PROGRAM_DIR%
pscp.exe -scp -pw %DEFAULT_PW% init.pppoe.relay.sh %DEFAULT_ID%@%DEFAULT_IP%:%PROGRAM_DIR%
pscp.exe -scp -pw %DEFAULT_PW% pppoe-relay %DEFAULT_ID%@%DEFAULT_IP%:%PROGRAM_DIR%
pscp.exe -scp -pw %DEFAULT_PW% startPPPoErelay.sh %DEFAULT_ID%@%DEFAULT_IP%:%PROGRAM_DIR%

:: chmod
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% chmod 755 %PROGRAM_DIR%/*

:: install to system
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% %PROGRAM_DIR%/INSTALL.sh

:: run program
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% /etc/init.pppoe.relay.sh

:: sync
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% sync

:: system reboot
plink.exe -ssh -t -C -2 -pw %DEFAULT_PW% %DEFAULT_ID%@%DEFAULT_IP% reboot

echo.
echo.
echo Rebooting Xiaomi router now. Please wait.

echo.
echo.
echo Success

:PROGRAM_END
echo.
echo.
pause


text:
using Newtonsoft.Json.Linq;
using System;
using DiscordSharp.Objects;
namespace DiscordSharp
{
    public class DiscordLeftVoiceChannelEventArgs : EventArgs
    {
        public DiscordMember user { get; internal set; }
        public DiscordServer guild { get; internal set; }

        public JObject RawJson { get; internal set; }
    }
}


text:
/**
 *
 */
package bixie.checker.faultlocalization;

import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import bixie.boogie.ProgramFactory;
import bixie.boogie.ast.Attribute;
import bixie.boogie.ast.NamedAttribute;
import bixie.boogie.controlflow.BasicBlock;
import bixie.boogie.controlflow.CfgAxiom;
import bixie.boogie.controlflow.CfgProcedure;
import bixie.boogie.controlflow.statement.CfgStatement;
import bixie.checker.reportprinter.SourceLocation;
import bixie.checker.transition_relation.AbstractTransitionRelation;
import bixie.checker.transition_relation.FaultLocalizationTransitionRelation;
import bixie.prover.Prover;
import bixie.prover.ProverExpr;
import bixie.prover.ProverFactory;
import bixie.prover.ProverResult;
import bixie.transformation.SingleStaticAssignment;
import bixie.util.Log;

/**
 * @author schaef
 *
 */
public class FaultLocalizationThread implements Runnable {

	private List<Map<CfgStatement, SourceLocation>> reports = new LinkedList<Map<CfgStatement, SourceLocation>>();
	private Set<BasicBlock> infeasibleBlocks;
	private AbstractTransitionRelation tr;
	private Prover prover = null;

	public FaultLocalizationThread(AbstractTransitionRelation tr,
			Set<BasicBlock> infeasibleBlocks) {
		this.infeasibleBlocks = infeasibleBlocks;
		this.tr = tr;
	}

	public List<Map<CfgStatement, SourceLocation>> getReports() {
		return this.reports;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run() {
		if (this.tr != null && this.infeasibleBlocks != null) {
			this.reports = localizeFaults(tr, infeasibleBlocks);
			this.tr = null;
			this.infeasibleBlocks = null;
			shutDownProver();
		}
	}

	public void shutDownProver() {
		if (this.prover != null) {
			this.prover.stop();
			this.prover.setConstructProofs(false);
			prover.shutdown();
			prover = null;
		}

	}

	/**
	 * Applies fault localization to a set of (not necessarily connected)
	 * infeasible blocks.
	 *
	 * @param tr
	 * @param infeasibleBlocks
	 */
	private List<Map<CfgStatement, SourceLocation>> localizeFaults(
			AbstractTransitionRelation tr, Set<BasicBlock> infeasibleBlocks) {

		List<Map<CfgStatement, SourceLocation>> reports = new LinkedList<Map<CfgStatement, SourceLocation>>();
		LinkedList<HashSet<BasicBlock>> components = findConnectedComponents(infeasibleBlocks);

		ProverFactory pf = new bixie.prover.princess.PrincessProverFactory();
		for (HashSet<BasicBlock> cmp : components) {
			try {
				this.prover = pf.spawn();
				this.prover.setConstructProofs(true);
				HashMap<CfgStatement, SourceLocation> res = localizeFault(tr,
						cmp, this.prover);
				if (res != null && !res.isEmpty()) {
					reports.add(res);
				}
			} catch (Throwable e) {
				e.printStackTrace();
				// throw e;
			} finally {
				shutDownProver();
			}
		}
		return reports;
	}

	/**
	 * Applies fault localization to a set of connected infeasible blocks
	 *
	 * @param tr
	 * @param component
	 */
	private HashMap<CfgStatement, SourceLocation> localizeFault(
			AbstractTransitionRelation tr, Set<BasicBlock> component,
			Prover prover) {

		// TODO: check if this contains a noverify tag and ignore it.
		for (BasicBlock b : component) {
			if (containsNamedAttribute(b, ProgramFactory.NoVerifyTag)) {
				return new HashMap<CfgStatement, SourceLocation>();
			}
		}

		// System.err.println("compute slice");
		CfgProcedure slice = tr.getProcedure().computeSlice(
				getSubprog(component), tr.getProcedure().getRootNode());

		if (slice.getRootNode() == null) {
			Log.debug("Cannot construct slice for " + tr.getProcedureName());
			// tr.getProcedure().toDot("DEBUG_"+tr.getProcedureName()+".dot");
			// tr.getProcedure().toFile("DEBUG_"+tr.getProcedureName()+".bpl");
			return new HashMap<CfgStatement, SourceLocation>();
		}
		// System.err.println("compute ssa");
		// TODO do I have to recompute SSA?
		SingleStaticAssignment ssa = new SingleStaticAssignment();
		ssa.updateBlockSSA(slice);

		// slice.pruneUnreachableBlocks();

		// tr.getProcedure().toDot("./orig_"+slice.getProcedureName()+".dot");
		// slice.toDot("./slice_" + slice.getProcedureName() + ".dot");

		// System.err.println("compute tr");
		FaultLocalizationTransitionRelation sliceTr = new FaultLocalizationTransitionRelation(
				slice, tr.getControlFlowFactory(), prover);

		// System.err.println("1");
		// prover.addAssertion(sliceTr.getEnsures());
		//
		for (Entry<CfgAxiom, ProverExpr> entry : sliceTr.getPreludeAxioms()
				.entrySet()) {
			prover.addAssertion(entry.getValue());
		}

		// System.err.println("2");

		if (sliceTr.getRequires() != null)
			prover.addAssertion(sliceTr.getRequires());

		int partition = 0;
		prover.setPartitionNumber(partition);

		// System.err.println("obligations "+ sliceTr.obligations.size());
		for (ProverExpr assertion : sliceTr.obligations) {
			prover.addAssertion(assertion);
			prover.setPartitionNumber(++partition);
		}

		if (sliceTr.getEnsures() != null) {
			prover.addAssertion(sliceTr.getEnsures());

		}
		prover.setPartitionNumber(++partition);

		// System.err.println("check sat");
		ProverResult res = prover.checkSat(true);
		if (res != ProverResult.Unsat) {
			throw new RuntimeException("Fault Localization failed! "
					+ res.toString() + " in proc "+tr.getProcedureName());
		}
		int[][] ordering = new int[partition][1];
		for (int i = 0; i < partition; i++) {
			ordering[i][0] = i;
		}

		// System.err.println("compute interpolants");
		ProverExpr[] interpolants = prover.interpolate(ordering);

		boolean allInfeasibleCloned = true;
		boolean anyCloned = false;

		SourceLocation maxLoc = null;

		// System.err.println("compute abstract slice");
		// System.err.println("\t\t **");
		HashMap<CfgStatement, SourceLocation> interestingStatements = new HashMap<CfgStatement, SourceLocation>();
		ProverExpr currentInterpolant = interpolants[0];
		for (int i = 1; i < interpolants.length; i++) {
			if (!interpolants[i].equals(currentInterpolant)) {
				currentInterpolant = interpolants[i];
				CfgStatement statement = sliceTr.pe2StmtMap
						.get(sliceTr.obligations.get(i));

				if (statement == null) {
					// TODO:
					statement = sliceTr.pe2StmtMap.get(sliceTr.obligations
							.get(i - 1));
				}

				BasicBlock origin = sliceTr.stmtOriginMap.get(statement);
				if (origin == null) {
					Log.debug("could not find statement " + statement + " in "
							+ sliceTr.getProcedureName() + "\n");
					continue;
				}
				// if (origin==null || containsNamedAttribute(origin,
				// ProgramFactory.Cloned)) {
				// continue;
				// }

				SourceLocation loc = null;

				if (containsNamedAttribute(statement,
						ProgramFactory.GeneratedThenBlock)
						|| containsNamedAttribute(statement,
								ProgramFactory.GeneratedElseBlock)) {
					int pos = origin.getStatements().indexOf(statement);

					while (pos < origin.getStatements().size()) {
						CfgStatement st = origin.getStatements().get(pos);
						// System.err.println("\t"+st);
						loc = praseLocationTags(st.getAttributes());
						if (loc != null) {
							break;
						}
						pos++;
					}
					// System.err.println("FWD");
				} else {
					// if its a statement without location attributes
					// go backwards until we find the last location attibute.
					int pos = origin.getStatements().indexOf(statement);

					while (pos >= 0) {
						CfgStatement st = origin.getStatements().get(pos);
						loc = praseLocationTags(st.getAttributes());
						if (loc != null) {
							break;
						}
						pos--;
					}

					if (loc == null) {
						// then try it in the other direction.
						pos = origin.getStatements().indexOf(statement);

						while (pos < origin.getStatements().size()) {
							CfgStatement st = origin.getStatements().get(pos);
							// System.err.println("\t"+st);
							loc = praseLocationTags(st.getAttributes());
							if (loc != null) {
								break;
							}
							pos++;
						}
					}

					// System.err.println("BWD");
				}

				if (loc != null) {

					if (containsNamedAttribute(origin, ProgramFactory.Cloned)) {
						loc.isCloned = true;
						anyCloned = true;
					}

					if (containsNamedAttribute(origin,
							ProgramFactory.NoVerifyTag)) {
						loc.isNoVerify = true;
					}

					for (BasicBlock b : component) {
						if (b.getLabel().equals(origin.getLabel())) {
							// compare them by name because we cloned them,
							// so
							// they are not
							// the same by reference.
							loc.inInfeasibleBlock = true;
							break;
						}
					}

					if (loc.inInfeasibleBlock && !loc.isCloned) {
						allInfeasibleCloned = false;
					}

					if (maxLoc == null) {
						maxLoc = loc;
					} else {
						if (loc.StartLine > maxLoc.StartLine) {
							maxLoc = loc;
						} else if (loc.StartLine == maxLoc.StartLine) {
							maxLoc.isNoVerify = maxLoc.isNoVerify
									|| loc.isNoVerify;
						}
					}
					interestingStatements.put(statement, loc);

				} else {
					Log.debug("no location tag " + statement + " in ");
					Log.debug(origin);
					continue;
				}

				// System.err.println("\t" + statement);
				// System.err.println("with interpolant: " + interpolants[i]);
			}
		}
		// System.err.println("============");
		// System.err.println("done");
		// TODO:
		if (anyCloned && allInfeasibleCloned)
			interestingStatements.clear();

		if (maxLoc != null && maxLoc.isNoVerify) {
			// TODO: this is sort of a hack that helps to suppress
			// strange try/catch false positives.
			interestingStatements.clear();
		}
		return interestingStatements;
	}

	private SourceLocation praseLocationTags(Attribute[] attributes) {
		if (attributes == null)
			return null;
		return SourceLocation.readSourceLocationFromAttributes(attributes);
	}

	private boolean containsNamedAttribute(BasicBlock b, String name) {
		for (CfgStatement s : b.getStatements()) {
			if (containsNamedAttribute(s, name))
				return true;
		}
		return false;
	}

	private boolean containsNamedAttribute(CfgStatement s, String name) {
		if (s.getAttributes() != null) {
			for (Attribute attr : s.getAttributes()) {
				if (attr instanceof NamedAttribute) {
					NamedAttribute na = (NamedAttribute) attr;
					if (na.getName().equals(name)) {
						return true;
					}
				}
			}
		}
		return false;
	}

	/**
	 * Collect all blocks that must can reach or can be reached by the elements
	 * in component
	 *
	 * @param component
	 * @return
	 */
	private Set<BasicBlock> getSubprog(Set<BasicBlock> component) {
		HashSet<BasicBlock> result = new HashSet<BasicBlock>();
		result.addAll(getNeighbors(component, true));
		result.addAll(getNeighbors(component, false));
		return result;
	}

	private Set<BasicBlock> getNeighbors(Set<BasicBlock> blocks, boolean forward) {
		LinkedList<BasicBlock> todo = new LinkedList<BasicBlock>();
		HashSet<BasicBlock> done = new HashSet<BasicBlock>();
		todo.addAll(blocks);
		while (!todo.isEmpty()) {
			BasicBlock current = todo.pop();
			done.add(current);
			for (BasicBlock b : getNeighbors(current, forward)) {
				if (!todo.contains(b) && !done.contains(b)) {
					todo.add(b);
				}
			}
		}
		return done;
	}

	private Set<BasicBlock> getNeighbors(BasicBlock b, boolean forward) {
		if (forward)
			return b.getSuccessors();
		return b.getPredecessors();
	}

	private LinkedList<HashSet<BasicBlock>> findConnectedComponents(
			Set<BasicBlock> blocks) {
		LinkedList<HashSet<BasicBlock>> components = new LinkedList<HashSet<BasicBlock>>();
		LinkedList<BasicBlock> allblocks = new LinkedList<BasicBlock>();
		allblocks.addAll(blocks);
		while (!allblocks.isEmpty()) {
			HashSet<BasicBlock> subprog = new HashSet<BasicBlock>();
			LinkedList<BasicBlock> todo = new LinkedList<BasicBlock>();
			todo.add(allblocks.pop());

			while (!todo.isEmpty()) {
				BasicBlock current = todo.pop();
				allblocks.remove(current);
				subprog.add(current);
				for (BasicBlock b : current.getPredecessors()) {
					if (!subprog.contains(b) && !todo.contains(b)
							&& allblocks.contains(b)) {
						todo.add(b);
					}
				}
				for (BasicBlock b : current.getSuccessors()) {
					if (!subprog.contains(b) && !todo.contains(b)
							&& allblocks.contains(b)) {
						todo.add(b);
					}
				}
			}
			if (subprog.size() > 0) {
				components.add(subprog);
			}
		}
		return components;
	}

}


text:
namespace extensions {

// Support for a simplified implementation of the chrome.app.runtime API.
class ShellAppRuntime {
 public:
  // Returns the API name.
  static const char* GetName();

  // Returns a simplified schema for the API.
  static const char* GetSchema();

 private:
  DISALLOW_IMPLICIT_CONSTRUCTORS(ShellAppRuntime);
};

}  // namespace extensions

#endif  // APPS_SHELL_COMMON_SHELL_APP_RUNTIME_H_


text: SELECT func1_sql_setint_vol(func2_mod_int_vol(5)) order by 1;


text:
import xml.etree.ElementTree as ET, math, abc, sys
from collections import Counter
import Tinker
from IP import IP, parse_list, parse_int

class Memory(IP):
    _C_LATENCY_RANGE= (1,1000)
    _C_PORT_TYPES = set(["r", "w", "rw"])
    _C_RESOURCE_RANGE= (0,10000)
    _C_CLOCK_RATIOS = []
    _C_RATIOS = set(["Full", "Half", "Quarter"])
    _C_ROLES = set(["primary", "secondary", "independent"])

    def __init__(self, e):
        """

        Construct a generic Memory object that encapsulates a IP object
        using the provided element tree.

        Arguments:

        e -- An element tree element containing the description of this
        Memory object

        """
        super(Memory, self).__init__(e)

    @classmethod
    def validate(cls, d):
        """

        Validate the parameters that describe the intrinsic settings of
        this IP

        Arguments:

        d -- A Description object, containing the parsed user description
        of a custom board

        """
        super(Memory,cls).validate(d)
        cls.check_resources(d)
        cls.check_latency(d)
        cls.check_ports(d)

    @classmethod
    def parse(cls, e):
        """
        Parse the description of this Memory object from an element tree
        element and return a dictionary with the parameters
        found.

        Arguments:

        e -- An element tree element containing the description of this
        object

        """
        d = dict()
        d["resources"] = cls._parse_resources(e)
        d["latency"] = parse_int(e, "latency")
        d["ports"] = cls.parse_ports(e)
        d["ratios"] = cls.parse_ratios(e)
        d["roles"] = cls.parse_roles(e)
        return d

    def configure(self, d):
        """

        Configure this object according to a high level description
        fill in any missing defaults, and verify that the description
        can be implemented

        Arguments:

        d -- A Description object, containing the parsed user description
        of a custom board

        """
        super(Memory,self).configure(d)

    def verify(self):
        """

        Verify that this object can implement the high level description

        Arguments:

        d -- A Description object, containing the complete description
        of a the IP configuration

        """
        self.validate(self)

    @classmethod
    def check_ports(cls, d):
        ports = d.get("ports")
        if(ports is None):
            Tinker.key_error("ports", Tinker.tostr_dict(d))
        for p in ports:
            if(p not in cls._C_PORT_TYPES):
                Tinker.value_error_xml("ports", p, str(list(cls._C_PORT_TYPES)),
                                        Tinker.tostr_dict(d))

    @classmethod
    def _parse_resources(cls, e):
        d = Counter()
        for rt in cls._C_RESOURCE_TYPES:
            d[rt] = parse_int(e, rt)
        return d

    def get_macros(self,s):
        return []

    def get_resources(self):
        self.check_resources(self)
        return self["resources"]

    @classmethod
    def check_latency(cls, d):
        l = d.get("latency")
        l_min = cls._C_LATENCY_RANGE[0]
        l_max = cls._C_LATENCY_RANGE[1]
        if(l is None):
            Tinker.key_error("latency", Tinker.tostr_dict(d))
        if(not Tinker.is_in_range(l, l_min, l_max)):
            Tinker.value_error_map("latency", str(hex(l)),
                                   "Range(0x%x, 0x%x)" % (l_min, l_max),
                                    Tinker.tostr_dict(d))

    @classmethod
    def check_resources(cls, d):
        rs = d.get("resources")
        r_min = cls._C_RESOURCE_RANGE[0]
        r_max = cls._C_RESOURCE_RANGE[1]
        for rt in cls._C_RESOURCE_TYPES:
            r = rs.get(rt, None)
            if(r is None):
                Tinker.key_error(rt, Tinker.tostr_dict(d))
            if(not Tinker.is_in_range(r, r_min, r_max)):
                Tinker.value_error_map(rt, str(hex(r)),
                                       "Range(0x%x, 0x%x)" % (r_min, r_max),
                                       Tinker.tostr_dict(d))

    @classmethod
    def parse_ports(cls, e):
        mem_ports = parse_list(e,"ports")
        for mp in mem_ports:
            if(mp not in cls._C_PORT_TYPES):
                Tinker.value_error_xml("ports", mp, str(ports), ET.tostring(e))
        return mem_ports

    @classmethod
    def parse_ratios(cls, e):
        mem_ratios = parse_list(e, "ratios")
        for mr in mem_ratios:
            if(mr not in cls._C_RATIOS):
                Tinker.value_error_xml("ratios", mr, str(ratios), ET.tostring(e))
        return mem_ratios

    @classmethod
    def parse_roles(cls, e):
        roles = parse_list(e, "roles")
        for mr in roles:
            if(mr not in cls._C_ROLES):
                Tinker.value_error_xml("roles", mr, str(roles), ET.tostring(e))
        return roles


text:
'use strict';

/**
 * @ngdoc function
 * @name frontendApp.controller:AboutCtrl
 * @description
 * # AboutCtrl
 * Controller of the frontendApp
 */
angular.module('frontendApp')
  .controller('AboutCtrl', function () {
    this.awesomeThings = [
      'HTML5 Boilerplate',
      'AngularJS',
      'Karma'
    ];
  });


text:
**************************
初めてのスキル開発
**************************

このガイドでは、ASK SDK v2 for Node.jsを使ったスキル開発の手順を説明します。

前提条件
========

-  `Amazon開発者 <https://developer.amazon.com/>`__\ アカウント。Alexaスキルの作成と設定に必要です。
-  `アマゾンウェブサービス(AWS) <https://aws.amazon.com/>`__\ アカウント。このガイドで、AWS Lambdaでスキルをホスティングする手順を確認できます。
-  インストールされたSDKに対応した\ `NPM <https://www.npmjs.com/>`__ プロジェクト。標準ASK SDKモジュールのインストールについては \ `ASK SDK v2 for Node.jsのセットアップ <Setting-Up-The-ASK-SDK.html>`__\ を参照してください。このサンプルスキルには、標準SDK配布パッケージが必要です。依存関係をカスタマイズしている場合は、コアSDKのサポートモジュールをインストールする必要があります。

スキルコードの記述
======================

以下のセクションでは、ハンドラーごとのスキルコードの記述について説明します。

.. note::

  ASK SDK v2 for Node.jsには、TypeScriptプロジェクトで使用するためのTypeScript定義ファイルがバンドルされています。このガイドでは、ネイティブのJavaScriptを使用したAlexaスキルの作成について説明し、それに対応したTypeScriptコードのスニペットもリファレンスとして提供します。TypeScriptプロジェクトの開始に関する情報については、こちらの\ `リンク <https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html>`_\ を参照してください。

依存関係の読み込み
------------------------------

``index.js``\ (以下のセクションでTypeScript.Sameを使用する場合は、\ ``index.ts``\ )というファイルを作成し、以下のコードを貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const Alexa = require('ask-sdk-core');

  .. code-tab:: typescript

    import {
      ErrorHandler,
      HandlerInput,
      RequestHandler,
      SkillBuilders,
    } from 'ask-sdk-core';
    import {
      Response,
      SessionEndedRequest,
    } from 'ask-sdk-model';

リクエストハンドラーの追加
-----------------------------

まず、スキルで受信するさまざまなタイプのリクエストを処理するのに必要なリクエストハンドラーを作成します。.

LaunchRequestハンドラー
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

以下は、スキルが\ ``LaunchRequest``\ を受信した時に呼び出されるハンドラーを設定するコードのサンプルです。特定のインテントなしでスキルが呼び出された場合、\ ``LaunchRequest``\ イベントが発生します。

.. tabs::

  .. code-tab:: javascript

    const LaunchRequestHandler = {
      canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
      },
      handle(handlerInput) {
        const speechText = 'Welcome to the Alexa Skills Kit, you can say hello!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .reprompt(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      }
    };

  .. code-tab:: typescript

    const LaunchRequestHandler : RequestHandler = {
      canHandle(handlerInput : HandlerInput) : boolean {
        return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
      },
      handle(handlerInput : HandlerInput) : Response {
        const speechText = 'Welcome to the Alexa Skills Kit, you can say hello!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .reprompt(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      },
    };

受信したリクエストが\ ``LaunchRequest``\ の場合、\ ``canHandle``\ 関数はtrueを返します。\ ``handle``\ 関数は、基本的なあいさつの応答を生成して返します。

HelloWorldIntentハンドラー
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

以下は、スキルが\ ``HelloWorldIntent``\ を受信した時に呼び出されるハンドラーを設定するコードのサンプルです。

以下のコードを\ ``index.js``\ ファイルの、前述のハンドラーの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const HelloWorldIntentHandler = {
      canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent';
      },
      handle(handlerInput) {
        const speechText = 'Hello World!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      }
    };

  .. code-tab:: typescript

    const HelloWorldIntentHandler : RequestHandler = {
      canHandle(handlerInput : HandlerInput) : boolean {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && handlerInput.requestEnvelope.request.intent.name === 'HelloWorldIntent';
      },
      handle(handlerInput : HandlerInput) : Response {
        const speechText = 'Hello World!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      },
    };

``canHandle``\ 関数は受信するリクエストが\ ``IntentRequest``\ かどうかを検出し、インテント名が\ ``HelloWorldIntent``\ の場合にtrueを返します。\ ``handle``\ 関数は、基本的な「こんにちは」という応答を生成して返します。

HelpIntentハンドラー
^^^^^^^^^^^^^^^^^^^^^^

以下は、スキルがビルトインインテント\ ``AMAZON.HelpIntent``\ を受信した時に呼び出されるハンドラーを設定するコードのサンプルです。

以下のコードを\ ``index.js``\ ファイルの、前述のハンドラーの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const HelpIntentHandler = {
      canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
      },
      handle(handlerInput) {
        const speechText = 'You can say hello to me!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .reprompt(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      }
    };

  .. code-tab:: typescript

    const HelpIntentHandler : RequestHandler = {
      canHandle(handlerInput : HandlerInput) : boolean {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
      },
      handle(handlerInput : HandlerInput) : Response {
        const speechText = 'You can say hello to me!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .reprompt(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      },
    };

さきほどのハンドラー同様、このハンドラーは\ ``IntentRequest``\ を想定されるインテント名と照合します。基本のヘルプ手順が返されます。

CancelAndStopIntentハンドラー
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

CancelAndStopIntentハンドラーもビルトインインテントによって呼び出されるため、HelpIntentハンドラーに似ています。以下は、1つのハンドラーを使って\ ``Amazon.CancelIntent``\ と\ ``Amazon.StopIntent``\ という2つのインテントに応答している例です。

以下のコードを\ ``index.js``\ ファイルの、前述のハンドラーの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const CancelAndStopIntentHandler = {
      canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
            || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
      },
      handle(handlerInput) {
        const speechText = 'Goodbye!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      }
    };

  .. code-tab:: typescript

    const CancelAndStopIntentHandler : RequestHandler = {
      canHandle(handlerInput : HandlerInput) : boolean {
        return handlerInput.requestEnvelope.request.type === 'IntentRequest'
          && (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
            || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
      },
      handle(handlerInput : HandlerInput) : Response {
        const speechText = 'Goodbye!';

        return handlerInput.responseBuilder
          .speak(speechText)
          .withSimpleCard('Hello World', speechText)
          .getResponse();
      },
    };

両方のインテントに対する応答は同じであるため、1つのハンドラーにすることで重複するコードを減らせます。

SessionEndedRequestハンドラー
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``SessionEndedRequest``\ を受信した後は音声、カード、ディレクティブを使った応答を返すことはできませんが、クリーンアップロジックを追加するにはSessionEndedRequestハンドラーが最適な場所です

以下のコードを\ ``index.js``\ ファイルの、前述のハンドラーの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const SessionEndedRequestHandler = {
      canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
      },
      handle(handlerInput) {
        //any cleanup logic goes here
        return handlerInput.responseBuilder.getResponse();
      }
    };

  .. code-tab:: typescript

    const SessionEndedRequestHandler : RequestHandler = {
      canHandle(handlerInput : HandlerInput) : boolean {
        return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
      },
      handle(handlerInput : HandlerInput) : Response {
        console.log(`Session ended with reason: ${(handlerInput.requestEnvelope.request as SessionEndedRequest).reason}`);

        return handlerInput.responseBuilder.getResponse();
      },
    };

エラーハンドラーの追加
----------------------------------------

ASK SDK v2 for Node.jsはエラー処理が簡単で、スムーズなユーザーエクスペリエンスを実現するスキルが作成しやすくなります。エラーハンドラーは、未処理のリクエストやAPIサービスのタイムアウトなどのエラー処理ロジックを組み込むのに最適です。以下の例では、catch allエラーハンドラーをスキルに追加して、すべてのエラーに対してスキルが意味のあるメッセージを返すようにしています。

以下のコードを\ ``index.js``\ ファイルの、前述のハンドラーの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    const ErrorHandler = {
      canHandle() {
        return true;
      },
      handle(handlerInput, error) {
        console.log(`Error handled: ${error.message}`);

        return handlerInput.responseBuilder
          .speak('Sorry, I can\'t understand the command. Please say again.')
          .reprompt('Sorry, I can\'t understand the command. Please say again.')
          .getResponse();
      },
    };

  .. code-tab:: typescript

    const ErrorHandler : ErrorHandler = {
      canHandle(handlerInput : HandlerInput, error : Error ) : boolean {
        return true;
      },
      handle(handlerInput : HandlerInput, error : Error) : Response {
        console.log(`Error handled: ${error.message}`);

        return handlerInput.responseBuilder
          .speak('Sorry, I can\'t understand the command. Please say again.')
          .reprompt('Sorry, I can\'t understand the command. Please say again.')
          .getResponse();
      },
    };

Lambdaハンドラーを作成する
---------------------------

Lambdaハンドラーは、AWS Lambda関数のエントリーポイントとなります。以下は、スキルが受信するすべてのリクエストのルーティングを行うLambdaハンドラー関数のコードサンプルです。Lambdaハンドラー関数は、作成したリクエストハンドラーを使用して設定されたSDKの\ ``Skill``\ インスタンスを作成します。

以下のコードを\ ``index.js``\ ファイルの、前述のセクションの後に貼り付けます。

.. tabs::

  .. code-tab:: javascript

    let skill;

    exports.handler = async function (event, context) {
      console.log(`REQUEST++++${JSON.stringify(event)}`);
      if (!skill) {
        skill = Alexa.SkillBuilders.custom()
          .addRequestHandlers(
            LaunchRequestHandler,
            HelloWorldIntentHandler,
            HelpIntentHandler,
            CancelAndStopIntentHandler,
            SessionEndedRequestHandler,
          )
          .addErrorHandlers(ErrorHandler)
          .create();
      }

      const response = await skill.invoke(event, context);
      console.log(`RESPONSE++++${JSON.stringify(response)}`);

      return response;
    };

  .. code-tab:: typescript

    let skill;

    exports.handler = async (event, context) => {
      console.log(`REQUEST++++${JSON.stringify(event)}`);
      if (!skill) {
        skill = SkillBuilders.custom()
          .addRequestHandlers(
            LaunchRequestHandler,
            HelloWorldIntentHandler,
            HelpIntentHandler,
            CancelAndStopIntentHandler,
            SessionEndedRequestHandler,
          )
          .addErrorHandlers(ErrorHandler)
          .create();
      }

      const response = await skill.invoke(event, context);
      console.log(`RESPONSE++++${JSON.stringify(response)}`);

      return response;
    };

関数は、\ ``SkillBuilders.custom``\ ビルダーを使用してSDKインスタンスを作成します。\ ``addRequestHandlers``\ ビルダー関数はリクエストハンドラーを登録します。関数は、Lambdaハンドラー関数としてエクスポートされます。

また、ASK SDK v2 for Node.jsで提供されるlambdaビルダー関数を使って、\ ``Skill``\ のインスタンスを呼び出して応答を返す\ ``Lambda``\ ハンドラー関数を簡単に作成することもできます。以下の例を参照してください。

.. tabs::

  .. code-tab:: javascript

    exports.handler = Alexa.SkillBuilders.custom()
      .addRequestHandlers(
        LaunchRequestHandler,
        HelloWorldIntentHandler,
        HelpIntentHandler,
        CancelAndStopIntentHandler,
        SessionEndedRequestHandler)
      .addErrorHandlers(ErrorHandler)
      .lambda();

  .. code-tab:: typescript

    exports.handler = SkillBuilders.custom()
      .addRequestHandlers(
        LaunchRequestHandler,
        HelloWorldIntentHandler,
        HelpIntentHandler,
        CancelAndStopIntentHandler,
        SessionEndedRequestHandler,
      )
      .addErrorHandlers(ErrorHandler)
      .lambda();

スキルパッケージを作成する
==========================

スキルのコードが完成したら、スキルパッケージを作成できます。スキルをAWS Lambdaにアップロードするには、スキルファイルと\ ``node_modules``\ フォルダーを含むzipファイルを作成します。すべてのプロジェクトファイルは、プロジェクトフォルダーでは\ **なく**\ 、ファイルを直接圧縮するようにしてください。

スキルをAWS Lambdaにアップロードする
===========================================

スキルに適切なロールでAWS Lambda関数を作成する手順については、\ `カスタムスキルをAWS Lambda関数としてホスティングする <https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html>`_\ を参照してください。関数作成時には、一から作成オプションを選択し、ランタイムとしてNode.js 8.10を選択します。

AWS Lambda関数を作成しトリガーとして「Alexa Skills Kit」を設定したら、前のステップで作成した.zipファイルをアップロードします。ハンドラーはデフォルトの\ ``index.handler``\ のままにします。最後に、AWS Lambda関数のARNをコピーします。このARNはAmazon開発者コンソールでスキルを設定する際に必要となります。

スキルの設定とテストを行う
==================================

スキルコードをAWS Lambdaにアップロードしたら、Alexaのスキルを設定できます。新しいスキルを作成するには、

1. \ `Alexa Skills Kit開発者コンソール <https://developer.amazon.com/alexa/console/ask>`_\ に移動してログインします。
2. 右上の\ **スキルの作成**\ ボタンをクリックします。
3. スキル名として「HelloWorld」と入力します。
4. \ **カスタム**\ スキルを選択してから\ **スキルを作成**\ をクリックします。

次に、スキルの対話モデルを定義します。サイドバーの\ **呼び出し名**\ を選択し、\ **スキルの呼び出し名**\ に「ごあいさつ」を入力します。

次に、\ ``HelloWorldIntent``\ というインテントを対話モデルに追加します。対話モデルのインテントセクションの下の\ **追加**\ ボタンをクリックします。カスタムインテントを作成を選択した状態で、インテント名として「HelloWorldIntent」を入力し、インテントを作成します。インテントの詳細ページで、ユーザーがこのインテントを呼び出すのに使用できるサンプル発話をいくつか追加します。この例では、以下のサンプル発話を追加しましたが、これ以外でもかまいません。

::

  こんにちはと言って
  ハローワールドと言って
  こんにちは
  ハイと言って
  ハイワールドと言って
  ハイ
  ごきげんいかが

\ ``AMAZON.CancelIntent``\ 、\ ``AMAZON.HelpIntent``\ 、\ ``AMAZON.StopIntent``\ はAlexaのビルトインインテントのため、サンプル発話を追加する必要はありません。

開発者コンソールでは、スキルモデル全体をJSON形式で編集することもできます。サイドバーで\ **JSONエディター**\ を選択します。この例では、以下のJSONスキーマを使用できます。

.. code:: json

  {
    "interactionModel": {
      "languageModel": {
        "invocationName": "greeter",
        "intents": [
          {
            "name": "AMAZON.CancelIntent",
            "samples": []
          },
          {
            "name": "AMAZON.HelpIntent",
            "samples": []
          },
          {
            "name": "AMAZON.StopIntent",
            "samples": []
          },
          {
            "name": "HelloWorldIntent",
            "slots": [],
            "samples": [
              "ごきげんいかが",
              "ハイ",
              "ハイワールドと言って",
              "ハイと言って",
              "こんにちは",
              "ハローワールドと言って",
              "こんにちはと言って"
            ]
          }
        ],
        "types": []
      }
    }
  }

対話モデルの編集が完了したら、モデルを保存してビルドします。

次に、スキルのエンドポイントを設定します。\ **エンドポイント**\ で\ **AWS LambdaのARN**\ を選択し、さきほど作成した関数のARNを貼り付けます。残りの設定は、デフォルト値のままでかまいません。\ **エンドポイントを保存**\ をクリックします。

この時点で、スキルをテストできるようになります。上部にあるメニューで\ **テスト**\ をクリックし、テストページに移動します。\ **このスキルでは、テストは有効になっています**\ オプションがONになっていることを確認します。テストページを使って、テキストや音声でリクエストをシミュレーションできます。

呼び出し名と、さきほど設定したサンプル発話のうち1つを使います。たとえば、「アレクサ、ごあいさつを開いてこんにちはと言って」と言うと、スキルは「こんにちは」と答えるはずです。また、(スマートフォンやhttps://alexa.amazon.comで)Alexaアプリを開くと、\ **スキル一覧**\ が表示されます。ここから、Alexaが使えるデバイスでテストできるように、アカウントでスキルを有効にすることができます。

この時点で、さまざまなインテントや、スキルコードに対応するリクエストハンドラーを試してみてください。一通りのテストが完了したら、スキルの認定を申請してAlexaユーザーに公開するプロセスに進むことができます。


text:
package org.keycloak.federation.ldap.mappers;

import java.util.List;

import org.keycloak.Config;
import org.keycloak.federation.ldap.LDAPFederationProvider;
import org.keycloak.federation.ldap.LDAPFederationProviderFactory;
import org.keycloak.mappers.FederationConfigValidationException;
import org.keycloak.mappers.UserFederationMapper;
import org.keycloak.mappers.UserFederationMapperFactory;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.KeycloakSessionFactory;
import org.keycloak.models.RealmModel;
import org.keycloak.models.UserFederationMapperModel;
import org.keycloak.provider.ProviderConfigProperty;
import org.keycloak.representations.idm.UserFederationMapperSyncConfigRepresentation;

/**
 * @author Marek Posolda
 */
public abstract class AbstractLDAPFederationMapperFactory implements UserFederationMapperFactory {

    // Used to map attributes from LDAP to UserModel attributes
    public static final String ATTRIBUTE_MAPPER_CATEGORY = "Attribute Mapper";

    // Used to map roles from LDAP to UserModel users
    public static final String ROLE_MAPPER_CATEGORY = "Role Mapper";

    // Used to map group from LDAP to UserModel users
    public static final String GROUP_MAPPER_CATEGORY = "Group Mapper";

    @Override
    public void init(Config.Scope config) {
    }

    @Override
    public UserFederationMapper create(KeycloakSession session) {
        return new LDAPFederationMapperBridge(this);
    }

    // Used just by LDAPFederationMapperBridge.
    protected abstract AbstractLDAPFederationMapper createMapper(UserFederationMapperModel mapperModel, LDAPFederationProvider federationProvider, RealmModel realm);

    @Override
    public String getFederationProviderType() {
        return LDAPFederationProviderFactory.PROVIDER_NAME;
    }

    @Override
    public void postInit(KeycloakSessionFactory factory) {
    }

    @Override
    public UserFederationMapperSyncConfigRepresentation getSyncConfig() {
        return new UserFederationMapperSyncConfigRepresentation(false, null, false, null);
    }

    @Override
    public void close() {
    }

    public static ProviderConfigProperty createConfigProperty(String name, String label, String helpText, String type, List<String> options) {
        ProviderConfigProperty configProperty = new ProviderConfigProperty();
        configProperty.setName(name);
        configProperty.setLabel(label);
        configProperty.setHelpText(helpText);
        configProperty.setType(type);
        configProperty.setOptions(options);
        return configProperty;
    }

    protected void checkMandatoryConfigAttribute(String name, String displayName, UserFederationMapperModel mapperModel) throws FederationConfigValidationException {
        String attrConfigValue = mapperModel.getConfig().get(name);
        if (attrConfigValue == null || attrConfigValue.trim().isEmpty()) {
            throw new FederationConfigValidationException("Missing configuration for '" + displayName + "'");
        }
    }

}


text:
module Channel9
  module Instruction
    # message_splat
    # ---
    # Takes a message and a tuple off the stack, appends the
    # contents of the tuple to the message, and returns the
    # resulting message.
    #
    # Takes message and tuple:
    #  SP -> tuple -> message
    # Leaves the message on the stack:
    #  SP -> message
    #
    class MESSAGE_SPLAT < Base
      def initialize(stream)
        super(stream, 2, 1)
      end

      def run(env)
        tuple = env.context.pop
        msg = env.context.pop
        env.context.push(msg.splat(tuple.real_ary))
      end
    end
  end
end


text:
class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :username
      t.string :email
      t.string :encrypted_password
      t.timestamps
    end
  end
end


text: sudo killall node &


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.edu.ifrn.pdscfyp.Model;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpSession;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author mateus
 */
@Getter
@Setter
public class Usuario implements Comparable<Usuario> {

    private Long id;
    private String nome;
    private String email;
    private String login;
    private String senha;
    private boolean isProfissional;
    private Endereco endereco;

    public Usuario() {
    }

    public Usuario(String nome, String email, String login, String senha,
            boolean isProfissional, String rua, String cep, String numero,
            String complemento, String cidade, String estado) {
        this.senha = senha;
        this.email = email;
        this.login = login;
        this.nome = nome;
        this.endereco = new Endereco(rua, cep, numero, complemento, cidade, estado, 0, 0);
    }

    public static Usuario getProfissionalByLogin(String login) {
        Client c = Client.create();
        WebResource wr = c.resource("https://apifyp.herokuapp.com/GetProfissionalByLogin?login=" + login);
        String json = wr.get(String.class);

        Gson gson = new Gson();
        return gson.fromJson(json, new TypeToken<Usuario>() {
        }.getType());
    }

    public static Set<Usuario> getProfissionais() {
        Client c = Client.create();
        WebResource wr = c.resource("https://apifyp.herokuapp.com/ListProfissionais");
        String json = wr.get(String.class);

        Gson gson = new Gson();
        return gson.fromJson(json, new TypeToken<Set<Usuario>>() {
        }.getType());
    }

    public static void addUsuario(Usuario u) {
        Client c = Client.create();

        Gson gson = new Gson();

        WebResource wr = c.resource("https://apifyp.herokuapp.com/AdicionarUsuario");

        ClientResponse cr = wr.accept("application/json").
                type("application/json").post(ClientResponse.class, gson.toJson(u));
    }

    public static Usuario login(String login, String senha) {

        Client c = Client.create();

        WebResource wr = c.resource("https://apifyp.herokuapp.com/Login?login=" + login + "&senha=" + senha);
        String json = wr.get(String.class);

        Gson gson = new Gson();

        return gson.fromJson(json, new TypeToken<Usuario>() {
        }.getType());
    }

    @Override
    public int compareTo(Usuario o) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}


text:
angular.module('MyApp')
  .controller('SignupCtrl', function($scope, $alert, $auth) {
    $scope.signup = function() {
      $auth.signup({
        displayName: $scope.displayName,
        email: $scope.email,
        password: $scope.password,
        role: "user"
      }).catch(function(response) {
        $alert({
          content: response.data.message,
          animation: 'fadeZoomFadeDown',
          type: 'material',
          duration: 3
        });
      });
    };
  });


text:
"""
Sequence Interfaces

Importing this module does *not* mark any standard classes as
implementing any of these interfaces.

While this module is not deprecated, new code should generally use
:mod:`zope.interface.common.collections`, specifically
:class:`~zope.interface.common.collections.ISequence` and
:class:`~zope.interface.common.collections.IMutableSequence`. This
module is occasionally useful for its fine-grained breakdown of interfaces.

The standard library :class:`list`, :class:`tuple` and
:class:`collections.UserList`, among others, implement ``ISequence``
or ``IMutableSequence`` but *do not* implement any of the interfaces
in this module.
"""

__docformat__ = 'restructuredtext'
from zope.interface import Interface
from zope.interface.common import collections
from zope.interface._compat import PYTHON2 as PY2

class IMinimalSequence(collections.IIterable):
    """Most basic sequence interface.

    All sequences are iterable.  This requires at least one of the
    following:

    - a `__getitem__()` method that takes a single argument; integer
      values starting at 0 must be supported, and `IndexError` should
      be raised for the first index for which there is no value, or

    - an `__iter__()` method that returns an iterator as defined in
      the Python documentation (http://docs.python.org/lib/typeiter.html).

    """

    def __getitem__(index):
        """``x.__getitem__(index) <==> x[index]``

        Declaring this interface does not specify whether `__getitem__`
        supports slice objects."""

class IFiniteSequence(collections.ISized, IMinimalSequence):
    """
    A sequence of bound size.

    .. versionchanged:: 5.0.0
       Extend ``ISized``
    """

class IReadSequence(collections.IContainer, IFiniteSequence):
    """
    read interface shared by tuple and list

    This interface is similar to
    :class:`~zope.interface.common.collections.ISequence`, but
    requires that all instances be totally ordered. Most users
    should prefer ``ISequence``.

    .. versionchanged:: 5.0.0
       Extend ``IContainer``
    """

    def __contains__(item):
        """``x.__contains__(item) <==> item in x``"""
        # Optional in IContainer, required here.

    def __lt__(other):
        """``x.__lt__(other) <==> x < other``"""

    def __le__(other):
        """``x.__le__(other) <==> x <= other``"""

    def __eq__(other):
        """``x.__eq__(other) <==> x == other``"""

    def __ne__(other):
        """``x.__ne__(other) <==> x != other``"""

    def __gt__(other):
        """``x.__gt__(other) <==> x > other``"""

    def __ge__(other):
        """``x.__ge__(other) <==> x >= other``"""

    def __add__(other):
        """``x.__add__(other) <==> x + other``"""

    def __mul__(n):
        """``x.__mul__(n) <==> x * n``"""

    def __rmul__(n):
        """``x.__rmul__(n) <==> n * x``"""

    if PY2:
        def __getslice__(i, j):
            """``x.__getslice__(i, j) <==> x[i:j]``

            Use of negative indices is not supported.

            Deprecated since Python 2.0 but still a part of `UserList`.
            """

class IExtendedReadSequence(IReadSequence):
    """Full read interface for lists"""

    def count(item):
        """Return number of occurrences of value"""

    def index(item, *args):
        """index(value, [start, [stop]]) -> int

        Return first index of *value*
        """

class IUniqueMemberWriteSequence(Interface):
    """The write contract for a sequence that may enforce unique members"""

    def __setitem__(index, item):
        """``x.__setitem__(index, item) <==> x[index] = item``

        Declaring this interface does not specify whether `__setitem__`
        supports slice objects.
        """

    def __delitem__(index):
        """``x.__delitem__(index) <==> del x[index]``

        Declaring this interface does not specify whether `__delitem__`
        supports slice objects.
        """

    if PY2:
        def __setslice__(i, j, other):
            """``x.__setslice__(i, j, other) <==> x[i:j] = other``

            Use of negative indices is not supported.

            Deprecated since Python 2.0 but still a part of `UserList`.
            """

        def __delslice__(i, j):
            """``x.__delslice__(i, j) <==> del x[i:j]``

            Use of negative indices is not supported.

            Deprecated since Python 2.0 but still a part of `UserList`.
            """

    def __iadd__(y):
        """``x.__iadd__(y) <==> x += y``"""

    def append(item):
        """Append item to end"""

    def insert(index, item):
        """Insert item before index"""

    def pop(index=-1):
        """Remove and return item at index (default last)"""

    def remove(item):
        """Remove first occurrence of value"""

    def reverse():
        """Reverse *IN PLACE*"""

    def sort(cmpfunc=None):
        """Stable sort *IN PLACE*; `cmpfunc(x, y)` -> -1, 0, 1"""

    def extend(iterable):
        """Extend list by appending elements from the iterable"""

class IWriteSequence(IUniqueMemberWriteSequence):
    """Full write contract for sequences"""

    def __imul__(n):
        """``x.__imul__(n) <==> x *= n``"""

class ISequence(IReadSequence, IWriteSequence):
    """
    Full sequence contract.

    New code should prefer
    :class:`~zope.interface.common.collections.IMutableSequence`.

    Compared to that interface, which is implemented by :class:`list`
    (:class:`~zope.interface.common.builtins.IList`), among others,
    this interface is missing the following methods:

        - clear

        - count

        - index

    This interface adds the following methods:

        - sort
    """


text:
@import url("../common/domButtons/DomButtonColorButtons.css");

@import url("../common/domButtons/DomButtonBlackCircleCross.css");

@import url("../common/IconContainer_keyframes.css");
/* dojox.mobile.IconContainer */
.mblIconContainer {
  margin: 20px 10px;
  padding: 0;
}
/* dojox.mobile.IconItem */
.mblIconItem {
  position: relative;
  overflow: hidden;
  /* for focus frame */

  list-style-type: none;
  float: left;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
.mblIconItemTerminator {
  list-style-type: none;
  clear: both;
}
.mblIconItemPane {
  list-style-type: none;
  background-color: white;
  color: black;
}
.mblIconArea {
  position: relative;
  height: 78px;
  font-family: Helvetica;
  font-size: 12px;
  text-align: center;
  margin-top: 5px;
  margin-bottom: 5px;
  width: 74px;
  color: black;
}
.mblIconArea img {
  vertical-align: middle;
}
.mblIconAreaInner {
  position: relative;
  height: 65px;
  line-height: 65px;
  text-align: center;
}
.mblIconItemDeleteIcon {
  position: absolute;
  top: -4px;
  left: -2px;
}
.mblIconItemSpriteIcon {
  position: absolute;
}
.mblContent {
  clear: both;
  padding-bottom: 20px;
}
table.mblClose {
  clear: both;
  cursor: pointer;
}
.mblVibrate {
  position: relative;
  -webkit-animation-duration: .5s;
  -webkit-animation-timing-function: ease-in-out;
  -webkit-animation-iteration-count: infinite;
  -webkit-animation-name: mblVibrate;
  -webkit-transform: rotate(0deg);
}
.mblCloseContent {
  -webkit-animation-duration: .3s;
  -webkit-animation-timing-function: ease-in-out;
  -webkit-animation-name: mblShrink;
  -webkit-transform: scale(0.01);
}
.mblCloseContent.mblShrink0 {
  -webkit-animation-name: mblShrink0;
}
.mblCloseContent.mblShrink1 {
  -webkit-animation-name: mblShrink1;
}
.mblCloseContent.mblShrink2 {
  -webkit-animation-name: mblShrink2;
}
.mblCloseContent.mblShrink3 {
  -webkit-animation-name: mblShrink3;
}
/* dojox.mobile._IconItemPane */
.mblIconItemPaneHeading {
  position: relative;
  clear: both;
  overflow: hidden;
  margin-top: 0px;
  padding-left: 40px;
  height: 25px;
  border-top: 1px solid #f1f3f4;
  border-bottom: 1px solid #717d85;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#e0e4e7), to(#b4bec6), color-stop(0.5, #c4ccd2), color-stop(0.5, #bfc8ce));
  font-family: Helvetica;
  font-size: 14px;
  color: white;
  line-height: 26px;
  text-shadow: rgba(0, 0, 0, 0.6) 0px -1px 0px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mblIconItemPaneIcon {
  position: absolute;
  top: -2px;
  left: 1px;
}


text:
class GuessGame
  GUESS = 8
  def initialize(player_name)
    @player_name  = player_name
    @number       = generate_number
    @attempts     = 1
    play
  end

  def try_to_guess
    puts "This is your attempt number #{@attempts}"
    puts "Please enter number:"
    @guess_number = gets.chomp.to_i
    @attempts += 1
  end

  def check_guess?
    @guess_number == @number
  end

  def check_if_less_or_greater
    @guess_number < @number ? puts("Bigger!") : puts("Smaller!")
  end

  def you_win
    puts "Congrats! #{@player_name} you won!!!"
    @attempts = 9
  end

  def exceded_attempts?
    @attempts >= GUESS
  end

  def generate_number
    rand(100)
  end

  def play
    begin
      try_to_guess
      check_guess? ? you_win : check_if_less_or_greater
    end while not exceded_attempts?
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.android.wearable.takeponto.ItemFragment">

    <ListView android:id="@android:id/list" android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <TextView android:id="@android:id/empty" android:layout_width="match_parent"
        android:layout_height="match_parent" android:gravity="center" />

    <com.melnykov.fab.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|right"
        android:src="@drawable/ic_control_add"
        android:layout_margin="16dp"
        fab:fab_colorNormal="@color/primary"
        fab:fab_colorPressed="@color/primary_pressed"
        fab:fab_colorRipple="@color/primary"
        fab:fab_shadow="true"/>

</FrameLayout>
<!-- From: file:/Volumes/Backup/Projetos/TakePonto/Application/src/main/res/layout/fragment_item_list.xml -->


text:
package org.dynamicfinder;

/**
 * Define how to handle null parameter value in {@link Restriction#getValue()}.
 * @author xsalefter (xsalefter[at]gmail.com)
 */
public enum Nullable {

	/**
	 * Default value for {@link Restriction#nullable}. This option will make
	 * {@link RestrictionHandler} by pass the {@link Restriction} if
	 * {@link Restriction#getValues()} is null. For {@link String} based value,
	 * this option also will by pass the empty {@link String}.
	 */
	DISCARD,

	/**
	 * This option make {@link RestrictionHandler} implementation keep producing
	 * restriction string although the {@link Restriction#getValue()}
	 * is null, and thus produce query like
	 * entityInstance.property = null. Furthermore, if null
	 * {@link Restriction#getValues()} passed, {@link RestrictionHandler}
	 * shouldn't add current {@link Restriction} to
	 * {@link RestrictionHandler#getDefinedRestrictions()}.
	 */
	KEEP;

	/**
	 * Get the lower-case version of this {@link Nullable#toString()}.
	 * @return {@link String#toLowerCase()} version of {@link Nullable#toString()}.
	 */
	public String toLowerCase() {
		return this.toString().toLowerCase();
	}

	/**
	 * Get the upper-case version of this {@link Nullable#toString()}.
	 * @return {@link String#toLowerCase()} version of {@link Nullable#toString()}.
	 */
	public String toUpperCase() {
		return this.toString().toUpperCase();
	}
}


text:
package org.jfree.ui;

import javax.swing.table.AbstractTableModel;

public abstract class SortableTableModel extends AbstractTableModel {
    private boolean ascending;
    private int sortingColumn;

    public SortableTableModel() {
        this.sortingColumn = -1;
        this.ascending = true;
    }

    public int getSortingColumn() {
        return this.sortingColumn;
    }

    public boolean isAscending() {
        return this.ascending;
    }

    public void setAscending(boolean flag) {
        this.ascending = flag;
    }

    public void sortByColumn(int column, boolean ascending) {
        if (isSortable(column)) {
            this.sortingColumn = column;
        }
    }

    public boolean isSortable(int column) {
        return false;
    }
}


text:
<?php include('header.php'); ?>
<?php include('dbconn.php'); ?>

<?php
error_reporting(0);
session_start();
if (!isset($_SESSION['user'])) {
    header('location:logout.php');
}
$userID = $_SESSION['id'];
$username = $_SESSION['user'];

//echo $username;

?>

<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css" rel="stylesheet">

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

Registration

    <form name="regiForm" class="form-horizontal" method="POST" onsubmit="return validateForm()" action="insert_user_auth_info.php">

  <input type="text" name="username" id="username" placeholder="Age" required/>

  <input type="text" name="password" id="password" placeholder="Blood group" required/>

  <input type="text" name="email" id="email" placeholder="weight" required/>

  <input type="text" name="contact" id="contact" placeholder="Food Habit" required/>

  <input type="text" name="location" id="location" placeholder="location" required/>

  <input type="text" name="excercise" id="excercise" placeholder="excercise" required/>

    <select name="cars" id="gender">
  <option value="1">Male</option>
  <option value="2">female</option>
  </select>

 <button type="submit" class="button">Register</button>

<?php include('footer.php'); ?>


text:
using System;
using Eisk.Helpers;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using Eisk.BusinessEntities;
namespace Eisk.BusinessLogicLayer
{
    public partial class EmployeeBLL
    {
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
        public List<Employee> GetEmployeesByFilter(
            string lastName = "", string firstName = "",
            int? reportsTo = 0,
            DateTime birthDate = default(DateTime),
            DateTime hireDateFrom = default(DateTime), DateTime hireDateTo = default(DateTime))
        {
            if (hireDateFrom.IsEmpty()) hireDateFrom = (DateTime)SqlDateTime.MinValue;
            if (hireDateTo.IsEmpty()) hireDateTo = (DateTime)SqlDateTime.MaxValue;

            return (
                from employee in _DatabaseContext.Employees
                    where
                        (lastName.IsEmpty() ? true : employee.LastName.Contains(lastName)) &&
                        (firstName.IsEmpty() ? true : employee.LastName.Contains(firstName)) &&
                        (reportsTo.IsEmpty() ? true : (reportsTo == null ? employee.ReportsTo == null : employee.ReportsTo == reportsTo)) &&
                        (birthDate.IsEmpty() ? true : birthDate == employee.BirthDate) &&
                        (employee.HireDate.CompareTo(hireDateFrom) > 0 && employee.HireDate.CompareTo(hireDateTo) < 0)
                    select employee
                    ).ToList();
        }

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
        public List<EmployeeWithSupervisorName> GetAllEmployeesWithSupervisors()
        {
            var result =
                from
                    subordinates in _DatabaseContext.Employees
                join
                    supervisors in _DatabaseContext.Employees
                on
                    subordinates.ReportsTo equals supervisors.EmployeeId
                select new EmployeeWithSupervisorName
                {
                    EmployeeID = subordinates.EmployeeId,
                    FirstName = subordinates.FirstName,
                    LastName = subordinates.LastName,
                    SupervisorFirstName = supervisors.FirstName,
                    SupervisorLastName = supervisors.LastName
                };

            return result.ToList();
        }

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
        public Tuple<List<Employee>, List<EmployeeWithSupervisorName>> GetAllTopAndGeneralEmployees()
        {
            List<Employee> topEmployees = GetEmployeesByReportsTo(null);

            List<EmployeeWithSupervisorName> generalEmployees = GetAllEmployeesWithSupervisors();

            return new Tuple<List<Employee>, List<EmployeeWithSupervisorName>>(topEmployees, generalEmployees);
        }

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, false)]
        public void UpdateEmployee(string firstName, string lastName, int employeeId)
        {
            Employee emp = GetEmployeeByEmployeeId(employeeId);

            emp.FirstName = firstName;
            emp.LastName = lastName;

            UpdateEmployee(emp);
        }
    }
}


text:
@import url("default/default.css.uncompressed.css");
@import url("default/mobilenav.css.uncompressed.css");
@import url("default/smartphone.css.uncompressed.css");
@import url("default/layoutTemplates.css.uncompressed.css");


text:
@echo off
rem Script para fazer deploy de aplicações em modo silent do Windows para caso onde não possível fazer a implementação das aplicações automaticamente

if "%1" == "/u" goto uninstall
if "%1" == "/i" goto install

:install
	start /wait "%2" /passive /norestart

:uninstall
	start /wait msiexec /uninstall "%2" /passive /norestart


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

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

namespace Microsoft.Azure.Commands.Resources.Models
{
    public class TemplateFileParameterV2
    {
        [JsonProperty("$schema")]
        public string Schema { get; set; }

        [JsonProperty("contentVersion")]
        public string ContentVersion { get; set; }

        [JsonProperty("parameters")]
        public IDictionary<string, TemplateFileParameterV1> Parameters { get; set; }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commando
{
	internal class Parser
	{
		private string[] arguments;
		private List<ArgumentSpecification> argumentSpecifications;
		private Dictionary<string, object> parsedArguments;
		private Queue<string> argQueue;

		public Parser (string[] arguments, List<ArgumentSpecification> argumentSpecifications)
		{
			parsedArguments = new Dictionary<string, object> ();
			argQueue = new Queue<string> ();
			this.argumentSpecifications = argumentSpecifications;
			this.arguments = arguments;
		}

		public Dictionary<string, object> Parse() {
			foreach (string arg in arguments)
				argQueue.Enqueue (arg);

			while (argQueue.Count > 0) {
				string arg = argQueue.Dequeue ();
				if (arg.StartsWith ("-")) {
					string pArg = arg.TrimStart ('-');
					ArgumentSpecification spec;
					if (IsSpecifiedArgument (pArg, out spec)) {
						if (spec.IsParameter) {
							if (argQueue.Peek ().StartsWith ("-")) {
								throw new ArgumentException ("Expected value, got parameter instead: " + arg + " " + argQueue.Peek ());
							} else {
								parsedArguments.Add (ReplaceDashes(spec.Long), argQueue.Dequeue ());
							}
						} else {
							if (spec.Long == "version") {
								Console.WriteLine (spec.Value);
								Environment.Exit (0);
							} else if (spec.Long == "help") {
								WriteHelp ();
								Environment.Exit (0);
							}
							parsedArguments.Add (ReplaceDashes(spec.Long), true);
						}
					} else {
						throw new ArgumentException ("Unrecognized argument " + arg);
					}
				}
			}

			parsedArguments = AddMissingNonMandatoryArguments (parsedArguments);
			Validate ();
			return parsedArguments;
		}

		private string ReplaceDashes(string str) {
			while (str.Contains("-")) {
				int dashIndex = str.IndexOf ("-");
				if (dashIndex < str.Length - 1)
					str = str.Replace (str [dashIndex].ToString(), str [++dashIndex].ToString ().ToUpper ());
				str = str.Remove (dashIndex, 1);
			}
			return str;
		}

		private Dictionary<string, object> AddMissingNonMandatoryArguments(Dictionary<string, object> parsedArguments)
		{
			IEnumerable<ArgumentSpecification> mandatoriesMissing = argumentSpecifications.Where (i => !parsedArguments.Keys.Contains (i.Long) && !i.Mandatory);
			foreach (ArgumentSpecification spec in mandatoriesMissing)
				parsedArguments.Add (spec.Long, false);
			return parsedArguments;
		}

		private void Validate()
		{
			IEnumerable<ArgumentSpecification> mandatoriesMissing = argumentSpecifications.Where (i => !parsedArguments.Keys.Contains (ReplaceDashes(i.Long)) && i.Mandatory);
			if (mandatoriesMissing.Count() > 0) {
				StringBuilder strb = new StringBuilder ("Missing mandatory arguments:\n");
				foreach (ArgumentSpecification arg in mandatoriesMissing)
					strb.AppendLine (arg.Long);
				throw new ArgumentException (strb.ToString());
			}
		}

		private bool IsSpecifiedArgument(string arg, out ArgumentSpecification spec) {
			spec = argumentSpecifications.Where (i => i.Short.Equals (arg) || i.Long.Equals (arg)).FirstOrDefault ();
			return !spec.Equals(default(ArgumentSpecification));
		}

		private void WriteHelp () {
			Console.WriteLine ("\n\n\tUsage: <program> [options]\n\n\tOptions:");
			int longestArgName = argumentSpecifications.Select (i => i.Long.Length).Max ();
			int longestDescription = argumentSpecifications.Select (i => i.Description).Max ().Length;

			foreach (ArgumentSpecification spec in argumentSpecifications) {
				string argNameWhiteSpaces = new string (' ', 2 + longestArgName - spec.Long.Length);
				string descWhiteSpaces = new string (' ', 2 + longestDescription - spec.Description.Length);
				string str = $"\t-{spec.Short}, --{spec.Long}{argNameWhiteSpaces}{spec.Description}{descWhiteSpaces}";
				if (spec.Mandatory)
					str += "(Mandatory)";
				Console.WriteLine(str);
			}
		}
	}
}


text:
#ifndef WEBSOCKETCLIENTADAPTER_H_
#define WEBSOCKETCLIENTADAPTER_H_

#include <Client.h>
#include <Hash.h>
#include <WebSocketsClient.h>

#include "ws/CircularByteBuffer.h"

/*
 * WebSocketParams provides connection parameters for the WebSocketClientAdapter
 *
 * Using an abstract class instead of a plain data struct allows parameters that
 * are more dynamic in nature, such as signatures based on current date/time.
 * An example of this is AWS sigv4 signature authentication
 */
class WebSocketParams
{
public:
  virtual char* getHost()        =0;
  virtual unsigned int getPort() =0;
  virtual char* getPath()        =0;
  virtual char* getFingerprint() =0;
  virtual char* getProtocol()    =0;
  virtual bool useSsl()          =0;
  virtual ~WebSocketParams()     =0;
};

/**
 * Implements the Arduino Client interface used by mqtt client and IpStack,
 * see https://github.com/esp8266/Arduino/blob/master/cores/esp8266/Client.h
 *
 * Delegates to WebSockets for Arduino.
 *
 * Note that adapting the Client.h interface to a websocket implementation can
 * not really be done in a good way. Client.h is a TCP/IP layer interface and
 * uses only hosts and ports for addressing. Websockets, on the other hand, is a
 * higher layer protocol. It's an independent TCP-based protocol with a
 * handshake that mimics a HTTP upgrade request, after which it establishes an
 * open, two-way connection. Websockets thus uses port 80 (or 443 for TLS) and
 * URL addressing (most notably path and protocol arguments), which is not
 * really possible to squeeze into a TCP/IP interface. This is instead passed
 * to the adapter at creation time.
 */
class WebSocketClientAdapter : public Client
{
public:

  WebSocketClientAdapter(WebSocketParams& p, size_t bufferSize = 1000);
  ~WebSocketClientAdapter();

  // Arduino Client.h interface
  virtual int connect(IPAddress ip, uint16_t port);
  virtual int connect(const char *host, uint16_t port);
  virtual size_t write(uint8_t b);
  virtual size_t write(const uint8_t *buf, size_t size);
  virtual int available();
  virtual int read();
  virtual int read(uint8_t *buf, size_t size);
  virtual int peek();
  virtual void flush();
  virtual void stop();
  virtual uint8_t connected();
  virtual operator bool();

private:

  // Websocket implementation
  WebSocketsClient ws;

  // Used for buffering data when reading/writing
  CircularByteBuffer fifo;

  // Connection params used instead of connect() arguments
  WebSocketParams& params;

  // Tracks connection state
  bool isConnected;

  // Callback handling websocket events
  void webSocketEvent(WStype_t type, uint8_t * payload, size_t length);
};

#endif