text:
rightPort = "COM12"

i01 = Runtime.createAndStart("i01", "InMoov")
ear = i01.startEar()
i01.startMouth()
i01.systemCheck()
##############
i01.startRightHand(rightPort)
# tweaking defaults settings of right hand
#i01.rightHand.thumb.setMinMax(55,135)
#i01.rightHand.index.setMinMax(0,160)
#i01.rightHand.majeure.setMinMax(0,140)
#i01.rightHand.ringFinger.setMinMax(48,145)
#i01.rightHand.pinky.setMinMax(45,146)
#i01.rightHand.thumb.map(0,180,55,135)
#i01.rightHand.index.map(0,180,0,160)
#i01.rightHand.majeure.map(0,180,0,140)
#i01.rightHand.ringFinger.map(0,180,48,145)
#i01.rightHand.pinky.map(0,180,45,146)
#################

# verbal commands

ear.addCommand("attach right hand", "i01.rightHand", "attach")
ear.addCommand("disconnect right hand", "i01.rightHand", "detach")
ear.addCommand("rest", i01.getName(), "rest")
ear.addCommand("open hand", "python", "handopen")
ear.addCommand("close hand", "python", "handclose")
ear.addCommand("capture gesture", ear.getName(), "captureGesture")
ear.addCommand("manual", ear.getName(), "lockOutAllGrammarExcept", "voice control")
ear.addCommand("voice control", ear.getName(), "clearLock")

ear.addComfirmations("yes","correct","yeah","ya")
ear.addNegations("no","wrong","nope","nah")

ear.startListening()

def handopen():
  i01.moveHand("left",0,0,0,0,0)
  i01.moveHand("right",0,0,0,0,0)

def handclose():
  i01.moveHand("left",180,180,180,180,180)
  i01.moveHand("right",180,180,180,180,180)


text:
import * as rilti from '../../../src/core.js'
const {dom, component, each, on, once, isNum, run} = rilti

// keep a number between a minimum and maximum ammount
const clamp = (n, min, max) => Math.min(Math.max(n, min), max)

// define element behavior
component('range-input', {
  // set up everything before element touches DOM
  create (range /* Proxy<Function => Element> */) {
    // local vars for easier logic
    let Value, ValueY

    // create element <div class="handle"> and append to <range-input>
    // also add property to range and get it as a const
    const handle = range.handle = dom.div.handle({$: range})

    // set the range limits at 0-100% by default for X and Y axis
    if (range.limit == null) range.limitX = range.limit = 100
    if (range.limit !== range.limitX) range.limitX = range.limit
    if (range.limitY == null) range.limitY = range.limit

    // set the X position by percentage/range number,
    // move the handle accordingly and change state
    range.setX = (value = range.value || 0, skipChecks) => {
      if (!skipChecks && value === Value) return
      if (value > range.limitX || value < 0) throw new Error('value out of range')

      // if the element is not in the dom
      // then wait for it to mount first
      if (!range.mounted) {
        range.once.mount(e => range.setX(value))
        return
      }

      // allow float values or round it to ints by default
      if (!range.decimals) value = Math.round(value)

      const hWidth = handle.offsetWidth
      // get pixel range
      const Min = hWidth / 2
      const Max = range.offsetWidth - Min
      // calculate pixel postion from range value
      const hLeft = (value / range.limitX) * (Max - Min)
      handle.style.left = hLeft + 'px'
      // update all the states
      Value = range.state.value = range.state.valueX = value
    }

    // same as setX but for Y axis
    range.setY = (value = range.valueY || 0, skipChecks) => {
      if (!skipChecks && value === Value) return
      if (value > range.limitY || value < 0) throw new Error('value out of range')
      if (!range.mounted) {
        range.once.mount(e => range.setY(value))
        return
      }
      const hHeight = handle.offsetHeight
      const Min = hHeight / 2
      const Max = range.offsetHeight - Min
      // const hTop = (value / range.limitY) * (Max - Min)
      const hTop = (1 - value / range.limitY) * (Max - Min)
      handle.style.top = hTop + 'px'

      if (!range.decimals) value = Math.round(value)
      ValueY = range.state.valueY = value
    }

    // get the raw Element/Node and define (s/g)etters
    Object.defineProperties(range() /* -> <range-input> */, {
      value: {get: () => Value, set: range.setX},
      valueX: {get: () => Value, set: range.setX},
      valueY: {get: () => ValueY, set: range.setY}
    })

    let rWidth // range.offsetWidth
    let rHeight // range.offsetHeight
    let rRect // cache of range.getBoundingClientRect()
    // called when user moves the handle
    const move = (x = 0, y = 0) => {
      // check the the axis is not locked
      // for when you want to use range-input as a slider
      if (!range.lockX) {
        // adjust for relative position
        if (x < rRect.left) x = rRect.left
        else if (x > rRect.left + rWidth) x = rRect.left + rWidth
        x -= rRect.left

        const hWidth = handle.offsetWidth

        // get pixel range
        const min = hWidth / 2
        const max = rWidth - min

        // keep it inside the block
        const hLeft = clamp(x, min, max) - min
        handle.style.left = hLeft + 'px'

        // pixel position -> percentage/value
        let value = (hLeft * range.limitX) / (max - min)

        // round value to an int by default
        if (!range.decimals) value = Math.round(value)

        // set it if it's not the same as the old value
        if (value !== Value) {
          Value = range.state.value = range.state.valueX = value
        }
      }

      // now do below as above for Y axis
      if (!range.lockY) { // when it's not locked
        if (y < rRect.top) y = rRect.top
        else if (y > rRect.top + rWidth) y = rRect.top + rHeight
        y -= rRect.top

        const hHeight = handle.offsetHeight
        const min = hHeight / 2
        const max = range.offsetHeight - min

        const hTop = clamp(y, min, max) - min
        handle.style.top = hTop + 'px'
        // let value = (hTop * range.limitY) / (max - min)
        let value = range.limitY - (hTop * range.limitY) / (max - min)
        if (!range.decimals) value = Math.round(value)
        if (value !== ValueY) {
          ValueY = range.state.valueY = value
        }
      }

      // .dispatchEvent(new CustomEvent('input'))
      range.emit('input')
      // call an update function if it's present as a prop
      if (range.update) range.update(range, handle)
    }

    // track and manage starting, stopping and moving events
    // for .pointer(up/down/move) event types respectively.
    const events = range.state.events = {
      move: on.pointermove(document, e => move(e.x, e.y)).off(),

      stop: on.pointerup(document, () => {
        events.move.off()
        events.start.on()
      }).off(),

      start: once.pointerdown([range, handle], () => {
        [rWidth, rHeight] = [range.offsetWidth, range.offsetHeight]
        rRect = range.getBoundingClientRect()
        if (range.lockY) {
          range.handle.style.top = `calc(50% - ${range.handle.offsetHeight / 2}px)`
        }
        events.move.on()
        events.stop.on()
      }).off()
    }
    //    ^-- all the events are off at the start
    //        they get turned on when the element mounts
  },

  // when Element enters DOM set the positions
  mount (range) {
    if (!range.lockY) range.handle.style.top = 0
    range.setX()
    range.setY()
    if (range.lockY) {
      range.handle.style.top = `calc(50% - ${range.handle.offsetHeight / 2}px)`
    }
    // start listening for user interactions
    range.state.events.start.on()
  },

  // start listening again on DOM re-entry
  remount (range) {
    range.state.events.start.on()
  },

  // stop listening when removed from DOM
  unmount ({state: {events}}) { each(events, e => e.off()) },

  // track custom attribute to set some props conveniently
  attr: {
    opts (range, val) {
      run(() => // wait for DOMContentLoaded first
        val.split(';')
          .filter(v => v != null && v.length)
          .map(pair => pair.trim().split(':').map(part => part.trim()))
          .forEach(([prop, value]) => {
            if (value.toLowerCase() === 'true') value = true
            else if (value.toLowerCase() === 'false') value = false
            else {
              const temp = Number(value)
              if (isNum(temp)) value = temp
            }
            if (prop === 'x' || prop === 'v') {
              range.setX(value, true)
            } else if (prop === 'y') {
              range.setY(value, true)
            } else {
              range[prop] = value
            }
          })
      )
    }
  }
})

redpajama_set_name: RedPajamaGithub


text:
package com.codahale.gpgj;

import java.util.*;

/**
 * Utility methods for dealing with untyped {@link Iterator} instances.
 */
final class Iterators {
    private Iterators() { /* singleton */ }

    @SuppressWarnings("unchecked")
    public static <T> List<T> toList(Iterator<?> iterator) {
        final List<T> items = new ArrayList<>();
        while (iterator.hasNext()) {
            items.add((T) iterator.next());

        }
        return Collections.unmodifiableList(items);
    }

    @SuppressWarnings("unchecked")
    public static <T> Set<T> toSet(Iterator<?> iterator) {
        final Set<T> items = new HashSet<>();
        while (iterator.hasNext()) {
            items.add((T) iterator.next());

        }
        return Collections.unmodifiableSet(items);
    }
}


text:
package net.onrc.onos.core.newintent;

import com.google.common.base.Predicates;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
import net.onrc.onos.api.flowmanager.FlowId;
import net.onrc.onos.api.flowmanager.FlowLink;
import net.onrc.onos.api.flowmanager.PacketPathFlow;
import net.onrc.onos.api.flowmanager.Path;
import net.onrc.onos.api.newintent.Intent;
import net.onrc.onos.api.newintent.IntentId;
import net.onrc.onos.api.newintent.PathIntent;
import net.onrc.onos.core.matchaction.match.Match;
import net.onrc.onos.core.matchaction.match.PacketMatch;
import net.onrc.onos.core.util.IdGenerator;
import net.onrc.onos.core.util.LinkTuple;

import java.util.Arrays;
import java.util.List;

/**
 * An intent compiler for {@link PathIntent}.
 */
public class PathIntentCompiler
        extends AbstractFlowGeneratingIntentCompiler<PathIntent> {

    /**
     * Construct an {@link net.onrc.onos.api.newintent.IntentCompiler}
     * for {@link PathIntent}.
     *
     * @param intentIdGenerator intent ID generator
     * @param flowIdGenerator flow ID generator
     */
    public PathIntentCompiler(IdGenerator<IntentId> intentIdGenerator,
                              IdGenerator<FlowId> flowIdGenerator) {
        super(intentIdGenerator, flowIdGenerator);
    }

    @Override
    public List<Intent> compile(PathIntent intent) {
        Match match = intent.getMatch();
        if (!(match instanceof PacketMatch)) {
            throw new IntentCompilationException(
                    "intent has unsupported type of match object: " + match
            );
        }

        Path path = convertPath(intent.getPath());
        PacketPathFlow flow = new PacketPathFlow(
                getNextFlowId(),
                (PacketMatch) match,
                intent.getIngressPort().getPortNumber(),
                path,
                packActions(intent, intent.getEgressPort()),
                0, 0
        );
        Intent compiled = new PathFlowIntent(getNextId(), flow);
        return Arrays.asList(compiled);
    }

    /**
     * Converts list of {@link LinkTuple LinkTuples} to a {@link Path}.
     *
     * @param tuples original list of {@link LinkTuple LinkTuples}
     * @return converted {@link Path}
     */
    private Path convertPath(List<LinkTuple> tuples) {
        // would like to use filter and transform, but Findbugs detects
        // inconsistency of use of @Nullable annotation. Then, use of the
        // transform is avoided.
        // Ref: https://code.google.com/p/guava-libraries/issues/detail?id=1812
        // TODO: replace with transform when the above issue is resolved
        ImmutableList<LinkTuple> links = FluentIterable.from(tuples)
                .filter(Predicates.notNull())
                .toList();

        Path path = new Path();
        for (LinkTuple link : links) {
            path.add(new FlowLink(link.getSrc(), link.getDst()));
        }
        return path;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 456 (1898)

#### Original name
Marasmius pilopus Kalchbr.

### Remarks
null


text:
package im.mange.flakeless.innards

import java.time.LocalDateTime

//TODO: pull out the json bit to another thing
//TODO: might be able to drop the whole flight number thing from the json soon

case class FlightDataRecord(suite: String, test: String, started: Option[LocalDateTime], finished: Option[LocalDateTime], dataPoints: Seq[DataPoint])

private [flakeless] case class FlightDataRecorder() {
  private var dataByFlightNumber: scala.collection.concurrent.TrieMap[Int, FlightDataRecord] =
    new scala.collection.concurrent.TrieMap()

  def start(flightNumber: Int, suite: String, name: String) = {
    dataByFlightNumber = new scala.collection.concurrent.TrieMap()
    val record = FlightDataRecord(suite, name, Some(LocalDateTime.now()), None, Seq.empty[DataPoint])
    dataByFlightNumber.update(flightNumber, record)
  }

  def stop(flightNumber: Int)= {
    val record = data(flightNumber).copy(finished = Some(LocalDateTime.now))
    dataByFlightNumber.update(flightNumber, record)
    FlightInvestigator.investigate(flightNumber, this)
  }

  def record(flightNumber: Int, description: String, log: Option[List[String]], isError: Boolean) {
    update(flightNumber, DataPoint(flightNumber, LocalDateTime.now, Some(description), None, Context(Nil, Some(!isError)), log))
  }

  def record(flightNumber: Int, command: Command, context: Context) {
    update(flightNumber, DataPoint(flightNumber, LocalDateTime.now, None, Some(command.report), context, None))
  }

  def jsonData(flight: Int) = FlightDataRecordJson.serialise(data(flight))

  def data(flightNumber: Int): FlightDataRecord = dataByFlightNumber.get(flightNumber).getOrElse(throw new RuntimeException(s"No Record for flightnumber: $flightNumber"))

  private def update(flightNumber: Int, dataPoint: DataPoint): Unit = {
    val current: FlightDataRecord = data(flightNumber)
    dataByFlightNumber.update(flightNumber, current.copy(dataPoints = current.dataPoints :+ dataPoint))
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/moodlemobile2.iml" filepath="$PROJECT_DIR$/moodlemobile2.iml" />
    </modules>
  </component>
</project>


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

  <title>pie_data_japanese (Fusioncharts::Utf8ExampleController)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />

# File app/controllers/fusioncharts/utf8_example_controller.rb, line 49
  def pie_data_japanese
      # xml content with charset=uttf-8
      response.content_type = Mime::XML
      response.charset = "utf-8"
      # Find all the factories
      @factories = Fusioncharts::JapaneseFactoryMaster.find(:all)
  end


text:
class AlgorithmLocal :
    public Algorithm
{
public:
    AlgorithmLocal();
    virtual ~AlgorithmLocal();
private:
    virtual Solution concreteSolve(const Problem& problem) override;
};


text:
require "json"

Puppet::Type.type(:qdr_connector).provide(:qdmanage) do

  # should rely on environment rather fq path
  commands :qdmanage => '/usr/bin/qdmanage'

  mk_resource_methods

  def initialize(value={})
    super(value)
    @property_flush = {}
  end

  def self.get_list_of_connectors
    begin
      @connectors=JSON.load(qdmanage('QUERY','--type=connector'))
    rescue Puppet::ExecutionFailure => e
      @connectors = {}
    end
  end

  def self.get_connector_properties(connector)
    connector_properties = {}

    connector_properties[:provider]       = :qdmanage
    connector_properties[:ensure]         = :present
    connector_properties[:name]           = connector["name"]
    connector_properties[:addr]           = connector["addr"]
    connector_properties[:port]           = connector["port"]
    connector_properties[:role]           = connector["role"].to_s
    connector_properties[:allow_redirect]       = connector["allowRedirect"].to_s
    connector_properties[:sasl_mechanisms]      = connector["saslMechanisms"].to_s
    connector_properties[:max_frame_size]       = connector["maxFrameSize"].to_s
    connector_properties[:idle_timeout_seconds] = connector["idleTimeoutSeconds"].to_s
    connector_properties[:strip_annotations]    = connector["stripAnnotations"].to_s

    connector_properties
  end

  def self.instances
    connectors = []
    get_list_of_connectors.each do |connector|
      connectors << new(:name                  => connector["name"],
                        :ensure                => :present,
                        :addr                  => connector["addr"],
                        :port                  => connector["port"],
                        :role                  => connector["role"].to_s,
                        :sasl_mechanisms       => connector["saslMechanisms"].to_s,
                        :allow_redirect        => connector["allowRedirect"].to_s,
                        :max_frame_size        => connector["maxFrameSize"].to_s,
                        :idle_timeout_seconds  => connector["idleTimeoutSeconds"].to_s,
                        :strip_annotations     => connector["stripAnnotations"].to_s)
    end
    connectors
  end

  def create
    @property_flush[:ensure] = :present
  end

  def exists?
    @property_hash[:ensure] == :present
  end

  def destroy
    @property_flush[:ensure] = :absent
  end

  def self.prefetch(resources)
    instances.each do |prov|
      if resource = resources[prov.name]
        resource.provider = prov
      end
    end
  end

  def set_connector
    # TODO(ansmith) - full CRUD once supported by qdmanage
    if @property_flush[:ensure] == :absent
      notice("Connector destroy not supported")
      return
    end

    begin
      # TODO(ansmith) - name, addr:port uniqueness check
      qdmanage('CREATE',
               '--type=connector',
               '--name',
               resource[:name],
               'addr='+resource[:addr],
               'port='+resource[:port],
               'role='+resource[:role].to_s,
               'saslMechanisms='+resource[:sasl_mechanisms].to_s,
               'allowRedirect='+resource[:allow_redirect].to_s,
               'maxFrameSize='+resource[:max_frame_size].to_s,
               'idleTimeoutSeconds='+resource[:idle_timeout_seconds].to_s,
               'stripAnnotations='+resource[:strip_annotations].to_s)
    rescue Puppet::ExecutionFailure => e
      return
    end

  end

  def flush
    set_connector

    @property_hash = self.class.get_connector_properties(resource[:name])
  end

end


text:
<TITLE>Review for Chiklo gouyeung (1992)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Chiklo gouyeung (1992)

reviewed by
Clarence Fok

Review - "Chiklo Gouyeung" or "Naked Killer"
Directed by
Clarence Yiu-leung Fok

Starring -
Simon Yam.... Tinam
Chingmy Yau.... Kitty
Kelly Carrie Ng.... Princess
Yao.... Sister Cindy

Rating * out of 5

        Sometimes I wonder just what the censors are thinking. Take
this film, "Naked Killer", among it's ingredients are heavy doses of
violence, rape sequences, straight and lesbian sex scenes and what our
system calls "coarse language". But what do those intelligent people
at the censorship bureau choose to remove in case someone will get
offended? One word - Penis.

        That's it. In spite of everything else in the movie the one
thing that the censors decide is too much is "Penis.". It really
restores you're faith in the system, huh?  Anyway, that's just a side
point. When Naked Killer was released in the local independent cinemas
around Melbourne, it was advertised ad nausuem as a hip, cool,
controversial thriller. What they forgot to mention was that it isn't
very good.

        The plot involves male cop Tinam (Simon Yam), investigating a
series of brutal murders. While getting a haircut he meets and finds
himself attracted to a girl named Kitty (Chingmy Yau), who, after
extracting revenge on the man who killed her father, falls in with
professional killer Sister Cindy (Svenwara Madoka).

        Realising Kitty has potential, Cindy decides to train Kitty in
several unusual and ridiculous ways and gives her a new
identity. However in the course of his investigation Tinam (Who
believed Kitty had disappeared), runs into her again, but isn't quite
sure if it's her. To complicate matters the actual serial killlers,
Princess and Baby, who a former students of Cindy, and have been told
to kill their old master and her new student. From then the action
ensues...

        All in all, This is not a well done movie. The script is
awful, the direction all over the place, the editing is jerky and
confusing and the subtitling is surprisingly poor. However the are a
few stand alone pieces that do entertain. The shoot out in the car
park is almost Woo-like in adrenaline. The fight scenes are energetic
and I guess it must get a few points for trying something a little
different.

        Let me put this way, If you like action - get something else,
if you like strong women in movies - get something else, if you have
do decide between this and "Black Cat" for your Hong Kong Female
Action - don't get either.  Even for curiosity value it just isn't
worth it. Let's face it - If ever the was a movie that became popular
on it's subject alone, this is it.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
import os
from datetime import datetime

import requests

import config
from templates.text import TextTemplate

MAPQUEST_CONSUMER_KEY = os.environ.get('MAPQUEST_CONSUMER_KEY', config.MAPQUEST_CONSUMER_KEY)
TIME_ZONE_DB_API_KEY = os.environ.get('TIME_ZONE_DB_API_KEY', config.TIME_ZONE_DB_API_KEY)

def process(input, entities):
    output = {}
    try:
        r = requests.get(
            'http://open.mapquestapi.com/nominatim/v1/search.php?key=' + MAPQUEST_CONSUMER_KEY + '&format=json&q=' +
            entities['time_location'][0]['value'] + '&limit=1')
        location_data = r.json()
        r = requests.get('http://api.timezonedb.com/?lat=' + location_data[0]['lat'] + '&lng=' + location_data[0][
            'lon'] + '&format=json&key=' + TIME_ZONE_DB_API_KEY)
        time_data = r.json()
        time = datetime.utcfromtimestamp(time_data['timestamp']).strftime('%a %b %d %Y %H:%M:%S')
        output['input'] = input
        output['output'] = TextTemplate(
            'Location: ' + location_data[0]['display_name'] + '\nTime: ' + time + ' ' + time_data[
                'abbreviation']).get_message()
        output['success'] = True
    except:
        error_message = 'I couldn\'t get the time at the location you specified.'
        error_message += '\nPlease ask me something else, like:'
        error_message += '\n  - time in new york'
        error_message += '\n  - india time'
        error_message += '\n  - time at paris'
        output['error_msg'] = TextTemplate(error_message).get_message()
        output['success'] = False
    return output


text:
If you installed mongodb via Homebrew:
```
brew services start mongodb
```
This uses the config file: /usr/local/etc/mongod.conf

# stop mongod
If you installed mongodb via Homebrew:
```
brew services stop mongodb
```


text:
class AddLimitToDesignsFilename < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_text_limit(:design_management_designs, :filename, 255, validate: false)
  end

  def down
    remove_text_limit(:design_management_designs, :filename)
  end
end


text:
#include "berryParameterValueConverterProxy.h"

#include "berryWorkbenchRegistryConstants.h"
#include "berryCommandExceptions.h"
#include "berryIConfigurationElement.h"
#include "berryCoreException.h"

namespace berry {

IParameterValueConverter* ParameterValueConverterProxy::GetConverter() const
{
  if (parameterValueConverter.isNull())
  {
    try
    {
      parameterValueConverter = QSharedPointer<IParameterValueConverter>(
            converterConfigurationElement->CreateExecutableExtension<IParameterValueConverter>(WorkbenchRegistryConstants::ATT_CONVERTER)
            );
    }
    catch (const CoreException& e)
    {
      throw ParameterValueConversionException(
          "Problem creating parameter value converter", e);
    }

    if (parameterValueConverter.isNull())
    {
      throw ParameterValueConversionException(
          "Parameter value converter was not a subclass of AbstractParameterValueConverter");
    }
  }
  return parameterValueConverter.data();
}

ParameterValueConverterProxy::ParameterValueConverterProxy(
    const SmartPointer<IConfigurationElement>& converterConfigurationElement)
  : converterConfigurationElement(converterConfigurationElement)
{
  if (converterConfigurationElement.IsNull())
  {
    throw ctkInvalidArgumentException(
        "converterConfigurationElement must not be null");
  }
}

Object::Pointer ParameterValueConverterProxy::ConvertToObject(const QString& parameterValue)
{
  return GetConverter()->ConvertToObject(parameterValue);
}

QString ParameterValueConverterProxy::ConvertToString(const Object::Pointer& parameterValue)
{
  return GetConverter()->ConvertToString(parameterValue);
}

}


text:
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 28, 2018 at 08:42 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.1.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `vubib_1`
--

-- --------------------------------------------------------

--
-- Table structure for table `attribute_option_subattribute`
--

CREATE TABLE `attribute_option_subattribute` (
  `id` int(11) NOT NULL,
  `workattribute_id` int(11) NOT NULL,
  `option_id` int(11) NOT NULL,
  `subattribute_id` int(11) NOT NULL,
  `subattr_value` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `attribute_option_subattribute`
--
ALTER TABLE `attribute_option_subattribute`
  ADD PRIMARY KEY (`id`),
  ADD KEY `workattribute_id` (`workattribute_id`),
  ADD KEY `option_id` (`option_id`),
  ADD KEY `subattribute_id` (`subattribute_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `attribute_option_subattribute`
--
ALTER TABLE `attribute_option_subattribute`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `attribute_option_subattribute`
--
ALTER TABLE `attribute_option_subattribute`
  ADD CONSTRAINT `option_subattr_id` FOREIGN KEY (`subattribute_id`) REFERENCES `workattribute_subattribute` (`id`),
  ADD CONSTRAINT `subattribute` FOREIGN KEY (`subattribute_id`) REFERENCES `workattribute_subattribute` (`id`),
  ADD CONSTRAINT `wkattr_option_id` FOREIGN KEY (`option_id`) REFERENCES `workattribute_option` (`id`);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="HandheldFriendly" content="true" />
  <link rel="shortcut icon" href="https://www.epa.gov/sites/all/themes/epa/favicon.ico" type="image/vnd.microsoft.icon" />
  <meta name="MobileOptimized" content="width" />
  <meta http-equiv="cleartype" content="on" />
  <meta http-equiv="ImageToolbar" content="false" />
  <meta name="viewport" content="width=device-width" />
  <meta name="version" content="20161218" />

  <meta name="DC.description" content="" />
  <meta name="DC.title" content="" />
  <title>
  QnD – Designing a Participatory Scenario Modeling Tool to Integrate Technology, Ecology, and Sociology in Guatemala’s Maya Biosphere Reserve and Beyond|

  Research Project Database | Grantee Research Project | ORD | US EPA</title>

  <meta name="keywords" content="" />
  <link rel="shortlink" href="" />
  <link rel="canonical" href="" />
  <meta name="DC.creator" content="" />
  <meta name="DC.language" content="en" />
  <meta name="DC.Subject.epachannel" content="" />
  <meta name="DC.type" content="" />
  <meta name="DC.date.created" content="" />
  <meta name="DC.date.modified" content="2006-09-29" />

  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/misc/ui/jquery.ui.autocomplete.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/themes/epa/css/lib/jquery.ui.theme.css" media="all" />
  <link type="text/css" rel="stylesheet" href="https://www.epa.gov/sites/all/libraries/template2/s.css" media="all" />

	<link rel="alternate" type="application/atom+xml" title="EPA.gov All Press Releases" href="https://www.epa.gov/newsreleases/search/rss" />
	<link rel="alternate" type="application/atom+xml" title="EPA.gov Headquarters Press Releases" href="https://www.epa.gov/newsreleases/search/rss/field_press_office/headquarters" />
	<link rel="alternate" type="application/atom+xml" title="Greenversations, EPA's Blog" href="https://blog.epa.gov/blog/feed/" />

Jump to main content

  <hgroup class="site-name-and-slogan">

US EPA

United States Environmental Protection Agency

  </hgroup>
  <form class="epa-search" method="get" action="https://search.epa.gov/epasearch/epasearch">
    Search
    <input class="form-text" placeholder="Search EPA.gov" name="querytext" id="search-box" value=""/>
    <button class="epa-search-button" id="search-button" type="submit" title="Search">Search</button>
    <input type="hidden" name="fld" value="" />
    <input type="hidden" name="areaname" value="" />
    <input type="hidden" name="areacontacts" value="" />
    <input type="hidden" name="areasearchurl" value="" />
    <input type="hidden" name="typeofsearch" value="epa" />
    <input type="hidden" name="result_template" value="2col.ftl" />
    <input type="hidden" name="filter" value="sample4filt.hts" />
  </form>

Contact Us

Project Research Results

Final Report

Related Information

Research Grants

P3: Student Design Competition

Research Fellowships

Small Business Innovation Research (SBIR)

Grantee Research Project Results Search

      QnD – Designing a Participatory Scenario Modeling Tool to Integrate Technology, Ecology, and Sociology in Guatemala’s Maya Biosphere Reserve and Beyond

    EPA Grant Number: SU833173

    Title: QnD – Designing a Participatory Scenario Modeling Tool to Integrate Technology, Ecology, and Sociology in Guatemala’s Maya Biosphere Reserve and Beyond

    Investigators:
     Kiker, Gregory
        ,  Branch, Lyn
        ,  Dain, Jonathan
        ,  Kike, Clyde
        ,  Monroe, Martha

        Current Investigators:

             Kiker, Gregory
            ,
             Barnes, Grenville
            ,
             Biedenweg, Kelly
            ,
             Branch, Lyn
            ,
             Dain, Jonathan
            ,
             Monroe, Martha
            ,
             Radachowsky, Jeremy
            ,
             Southworth, Jane

      Institution:

      University of Florida

    	EPA Project Officer:

           Nolt-Helms, Cynthia

        Phase: I

      Project Period:
      September 30, 2006 through
        May 30, 2007

        Project Amount:

          $10,000

      RFA:
      P3 Awards: A National Student Design Competition for Sustainability Focusing on People, Prosperity and the Planet (2006)

        		RFA Text |
          Recipients Lists

      Research Category:

          P3 Challenge Area - Information Technology
          ,
          Pollution Prevention/Sustainable Development
          ,
          P3 Awards
          ,
          Sustainability

Description:

Participatory scenario modeling – an interactive method for visualizing the future – is one of the most promising tools for achieving sustainable land use agreements amongst diverse stakeholder groups. The method has the potential to bridge the gap between the highly technical knowledge of scientists and the varied knowledge and values of non-scientists in order to create policies that respect livelihoods and maintain ecological integrity. However, most recent scenario model development has focused on the technical aspects of model building, often deemphasizing collaboration and participation.

We propose to develop and test a platform that fuses technology with lessons from many disparate disciplines in order to promote collaborative thinking, the creation of emergent ideas, and increased ownership and support for natural resource policies. In Phase I of this project, we will build upon an innovative, open-source, Java-based framework, the Questions and Decisions (QnD) model system, to design a beginning-to-end scenario modeling process that will be tested in one ideal study system: the Maya Biosphere Reserve of Guatemala. Subsequently, in Phase II, we will implement the process in Guatemala and evaluate its efficacy by testing whether the process: 1) increases the number of viable policy options; 2) improves the selection of the most economically, ecologically, and socially sustainable policy options; and 3) increases public support for selected policies.

This research will develop a new and innovative breed of scenario modeling tools that promotes sustainable policy creation in complex social-ecological systems. Although we will test the platform in Guatemala, its flexibility allows implementation anywhere in the developed or developing world. Through curricular and extracurricular research activities, formal and informal collaborations, and dissemination of results, this project will complement the educational programs of participating students and extend to a large international network of students, academics, and professionals.

Supplemental Keywords:

      decision making, community-based, scenario, modeling, Central America, conservation, pollution prevention, public policy, socio-economic, preferences, land use,, RFA, Scientific Discipline, Geographic Area, Sustainable Industry/Business, Sustainable Environment, Technology for Sustainable Environment, International, Social Science, sustainable development, Guatemala, biosphere, collaborative urban planning, pollution prevention, environmental education, land use

Progress and Final Reports:

                Final Report

Top of Page

 The perspectives, information and conclusions conveyed in research project abstracts, progress reports, final reports, journal abstracts and journal publications convey the viewpoints of the principal investigator and may not represent the views and policies of ORD and EPA.  Conclusions drawn by the principal investigators have not been reviewed by the Agency.

Main menu

Environmental Topics

Laws & Regulations

About EPA

Discover.

Accessibility

EPA Administrator

Budget & Performance

Contracting

Grants

No FEAR Act Data

Privacy and Security

Connect.

Data.gov

Inspector General

Jobs

Newsroom

Open Government

Regulations.gov

Subscribe

USA.gov

White House

Ask.

Contact Us

Hotlines

FOIA Requests

Frequent Questions

Follow.

Facebook

Twitter

YouTube

Flickr

Instagram

Last updated on Friday, September 29, 2006


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using ZyGames.Framework.Common.Log;

namespace ZyGames.Framework.Common.Event
{
    /// <summary>
    /// Event notifier
    /// </summary>
    public abstract class EventNotifier
    {
        private static readonly object syncRoot = new object();
        private static readonly ConcurrentQueue<NotifyEventArgs> _handlePools;
        private static readonly List<NotifyEventArgs> _asyncHandlePools;
        private static ManualResetEvent singal = new ManualResetEvent(false);
        private static Thread queueProcessThread;
        private static int _runningQueue;
        private static int _asyncQueue;
        private static Timer _notifyTimer;
        private static long _timerNum;

        /// <summary>
        /// process time
        /// </summary>
        public static long TimerNum
        {
            get { return _timerNum; }
        }

        static EventNotifier()
        {
            _handlePools = new ConcurrentQueue<NotifyEventArgs>();
            _asyncHandlePools = new List<NotifyEventArgs>();
            Interlocked.Exchange(ref _runningQueue, 1);
            queueProcessThread = new Thread(ProcessQueue);
            queueProcessThread.Start();
            _notifyTimer = new Timer(OnNotifyCallback, null, 100, 100);
        }

        /// <summary>
        /// Dispose
        /// </summary>
        public static void Dispose()
        {
            try
            {
                Interlocked.Exchange(ref _runningQueue, 0);
                _notifyTimer.Dispose();
                queueProcessThread.Abort();
            }
            catch
            { }
        }
        /// <summary>
        /// Not process time
        /// </summary>
        public static int WaitEventCount
        {
            get { return _asyncHandlePools.Count; }
        }

        /// <summary>
        ///
        /// </summary>
        public static int ActiveThreadCount
        {
            get
            {
                int n;
                int m;
                ThreadPool.GetAvailableThreads(out n, out m);
                return n;
            }
        }
        /// <summary>
        ///
        /// </summary>
        public static void Put(NotifyEventArgs handle)
        {
            _handlePools.Enqueue(handle);
            singal.Set();
        }

        private static void ProcessQueue()
        {
            try
            {
                while (_runningQueue == 1)
                {
                    singal.WaitOne();
                    while (_runningQueue == 1)
                    {
                        try
                        {
                            NotifyEventArgs handle;
                            if (_handlePools.TryDequeue(out handle))
                            {
                                var e = handle;
                                if (handle.Interrupt)
                                {
                                    continue;
                                }
                                if (handle.Check())
                                {
                                    ThreadPool.QueueUserWorkItem(obj => e.OnCallback());
                                    OnTimerNum();
                                }
                                else
                                {
                                    lock (syncRoot)
                                    {
                                        _asyncHandlePools.InsertSort(handle, (x, y) => x.ExpiredTime.CompareTo(y.ExpiredTime));
                                    }
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            TraceLog.WriteError("ProcessQueue Event Notifier error:{0}", ex);
                        }
                    }
                    //if (isInStopping) break;
                    singal.Reset();
                }
            }
            catch (Exception er)
            {
                TraceLog.WriteError("ProcessQueue Event Notifier error:{0}", er);
            }
        }

        private static void OnTimerNum()
        {
            if (_timerNum < 0)
            {
                Interlocked.Exchange(ref _timerNum, 0);
            }
            Interlocked.Increment(ref _timerNum);
        }

        private static void OnNotifyCallback(object state)
        {
            try
            {
                if (Interlocked.CompareExchange(ref _asyncQueue, 1, 0) == 0)
                {
                    List<NotifyEventArgs> removeList = new List<NotifyEventArgs>();

                    lock (syncRoot)
                    {
                        foreach (var handle in _asyncHandlePools)
                        {
                            var e = handle;
                            if (handle.Interrupt)
                            {
                                removeList.Add(handle);
                                continue;
                            }
                            if (handle.Check())
                            {
                                ThreadPool.QueueUserWorkItem(obj => e.OnCallback());
                                OnTimerNum();
                                removeList.Add(handle);
                            }
                        }
                        foreach (var args in removeList)
                        {
                            _asyncHandlePools.Remove(args);
                        }
                    }

                }
            }
            catch (Exception er)
            {
                TraceLog.WriteError("ProcessQueue async event notifier error:{0}", er);
            }
            finally
            {
                Interlocked.Exchange(ref _asyncQueue, 0);
            }
        }

    }
}


text:
    {{ site.data.settings.title }}

    {% for item in site.data.settings.menu %}
      {{ item.name }}
    {% endfor %}

    {% for item in site.data.settings.social %}

    {% endfor %}

    <button class="dropbtn"></button>

      {% for item in site.data.settings.menu %}
        {{ item.name }}
      {% endfor %}

      {% for item in site.data.settings.social %}

      {% endfor %}


text:
layout: post
title: "Acoustic S.T.ONE @ EMUFest 2015"
date:   2015-10-05 23:23:23 +0100
categories: activity

modified: 2015-11-10T01:00:28
excerpt: "omnidirectional points of listenings @ EMUFest 2015"
tags: [stone, omnidirectional, loudspeaker]
comments: true
---

Flute **Elena D'Alò**
Electronics **Giuseppe Silvi**

The ***S.T.ONE*** project grew up from the need of an electroacoustic environment in which acoustical and electronic instruments have the same impact on listeners. The first stage of development  involved a spherical sound diffusion technique of acousmatic music  (exposed during *EMUFest 2014*) while a research path concerning the *Sound Shape* of traditional instruments was taking place. *Sound Shape* is the perceived shape of an acoustic object. During  the recording of *13 Degrees of Darkness* (Alvin Lucier, 2013, for flute and pre-recorded flute, italian premiere during EMUFest 2014) the ***TetraREC*** technique, for *Sound Diffusion* recording of acoustical instruments, was developed.
Through ***acoustic S.T.ONE*** it is possible to read about state of the art research and to listen to instruments which are  both recorded and analysed to describe their *Sound Diffusion*.

![13 Degrees, Elena D'Alò Flute, TetraREC]({{ site.extmaterials }}/photos/20151005/ED01_tetrarec_lucier13degrees_CG_T.jpeg)
<!-- first TETRAREC session - september 25, 2014. Alvin Lucier, 13 Degrees of Darkness. Elena D'Alò, flute. -->

## TetraREC

***TetraREC*** is a spaced microphone technique which consists in surrounding the complex sound object (musician plus instrument) with four microphones, each at the vertices of an ideal tetrahedron.

The TETRAREC technique took its inspiration from Michael Gerzon's A-Format (four coincident microphones placed along the sides of a tetrahedron). The difference between the two techniques are the distance (coincident vs. spaced) and the purpose (3D reproduction of music/environment vs. 3D reproduction of acoustic objects).

The TETRAREC technique was developed to achieve the following objectives:

 1. Capture the Sound Shape of acoustic instruments
 2. Preserve the body shadow on sound propagation
 3. Preserve the movements performed by the musician
 4. Collect data on Sound Shapes of different acoustic instruments
 5. Collect data on Sound Shapes of similar acoustic instruments with different performers
 6. Analyse data and prototype a graphic visualisation of 3D Sound Shapes

### Forthcoming Research

The largest corpus of contemporary music for solo instruments is represented by Luciano Berio's *Sequences*. In this research about recording *Sound Shapes* through the ***TetraREC*** technique while diffusing them by ***S.T.ONE***, where instrument performances are displayed over printed maps which are then used to improve their musical listening, a *Sequenza* could focus the listener's attention on every nuance of the *Sound Shape*. At the same time reproducing a complex sound object like a musician performing a *Sequenza* (which very often implies a complex panoply of 3D movements) is the best possible research goal for a loudspeaker.

### acoustic S.T.ONE - Track List

 - *Density 21.5* - Edgar Varèse - flute Elena D'Alò
 - improvvisazione - Bayan - Alessandro Sbordoni
 - *Sequenza IXb* - Luciano Berio - Alto Sax Danilo Perticaro
 - *Suite for toy piano* - John Cage - Toy piano Francesco Ziello


text:
- **[MAINTENANCE]** General repository maintenance

## 0.1.0 (2013-11-11)

- **[NEW]** Initial implementation


text:
"""Shared helpers for different experiment flavours."""

import functools
from typing import Mapping, Sequence, Optional

from acme import specs
from acme import types
from acme.agents.tf.svg0_prior import utils as svg0_utils
from acme.tf import networks
from acme.tf import utils as tf2_utils

import numpy as np
import sonnet as snt

def make_default_networks(
    action_spec: specs.BoundedArray,
    policy_layer_sizes: Sequence[int] = (256, 256, 256),
    critic_layer_sizes: Sequence[int] = (512, 512, 256),
) -> Mapping[str, types.TensorTransformation]:
  """Creates networks used by the agent."""

  # Get total number of action dimensions from action spec.
  num_dimensions = np.prod(action_spec.shape, dtype=int)

  policy_network = snt.Sequential([
      tf2_utils.batch_concat,
      networks.LayerNormMLP(policy_layer_sizes, activate_final=True),
      networks.MultivariateNormalDiagHead(
          num_dimensions,
          tanh_mean=True,
          min_scale=0.3,
          init_scale=0.7,
          fixed_scale=False,
          use_tfd_independent=False)
  ])
  # The multiplexer concatenates the (maybe transformed) observations/actions.
  multiplexer = networks.CriticMultiplexer(
      action_network=networks.ClipToSpec(action_spec))
  critic_network = snt.Sequential([
      multiplexer,
      networks.LayerNormMLP(critic_layer_sizes, activate_final=True),
      networks.NearZeroInitializedLinear(1),
  ])

  return {
      "policy": policy_network,
      "critic": critic_network,
  }

def make_network_with_prior(
    action_spec: specs.BoundedArray,
    policy_layer_sizes: Sequence[int] = (200, 100),
    critic_layer_sizes: Sequence[int] = (400, 300),
    prior_layer_sizes: Sequence[int] = (200, 100),
    policy_keys: Optional[Sequence[str]] = None,
    prior_keys: Optional[Sequence[str]] = None,
) -> Mapping[str, types.TensorTransformation]:
  """Creates networks used by the agent."""

  # Get total number of action dimensions from action spec.
  num_dimensions = np.prod(action_spec.shape, dtype=int)
  flatten_concat_policy = functools.partial(
      svg0_utils.batch_concat_selection, concat_keys=policy_keys)
  flatten_concat_prior = functools.partial(
      svg0_utils.batch_concat_selection, concat_keys=prior_keys)

  policy_network = snt.Sequential([
      flatten_concat_policy,
      networks.LayerNormMLP(policy_layer_sizes, activate_final=True),
      networks.MultivariateNormalDiagHead(
          num_dimensions,
          tanh_mean=True,
          min_scale=0.1,
          init_scale=0.7,
          fixed_scale=False,
          use_tfd_independent=False)
  ])
  # The multiplexer concatenates the (maybe transformed) observations/actions.
  multiplexer = networks.CriticMultiplexer(
      observation_network=flatten_concat_policy,
      action_network=networks.ClipToSpec(action_spec))
  critic_network = snt.Sequential([
      multiplexer,
      networks.LayerNormMLP(critic_layer_sizes, activate_final=True),
      networks.NearZeroInitializedLinear(1),
  ])
  prior_network = snt.Sequential([
      flatten_concat_prior,
      networks.LayerNormMLP(prior_layer_sizes, activate_final=True),
      networks.MultivariateNormalDiagHead(
          num_dimensions,
          tanh_mean=True,
          min_scale=0.1,
          init_scale=0.7,
          fixed_scale=False,
          use_tfd_independent=False)
  ])
  return {
      "policy": policy_network,
      "critic": critic_network,
      "prior": prior_network,
  }


text:
from math import sqrt, floor

def is_prime(x):
    i = 2
    while i < int(floor(sqrt(x)))+1:
        if x % i == 0:
            return False
        i += 1
    return True

def multiplicative_order(a, n):
    k = 2
    while (a**k % n != 1):
        k += 1
    return k

def len_repetend(x):
    return multiplicative_order(10, x)

def max_recurring_cycle(limit=1000):
    '''
    We search for the order of 10 modulo x for all primes
    between 7 and the provided limit. See Wikipedia page for
    mathematical explanation
    https://en.wikipedia.org/wiki/Repeating_decimal
    '''
    max_order, max_order_x = 7, 0
    for x in range(7, limit):
        if is_prime(x):
            x_repetend = len_repetend(x)
            if x_repetend >= max_order:
                max_order, max_order_x = x_repetend, x
    return max_order_x

if __name__ == "__main__":
    print(max_recurring_cycle())


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reactive;
using System.Reactive.Disposables;

namespace Gohla.Shared
{
    public class ReactiveObservableCollection<T> : ObservableCollection<T>, IDisposable
    {
        private CompositeDisposable _disposable = new CompositeDisposable();

        public ReactiveObservableCollection(IEnumerable<T> initial, IObservable<T> addObservable,
            IObservable<T> removeObservable, IObservable<Unit> clearedObservable) :
            base(initial)
        {
            // TODO: Efficient removal
            _disposable.Add(addObservable.Subscribe(t => Add(t)));
            _disposable.Add(removeObservable.Subscribe(t => Remove(t)));
            _disposable.Add(clearedObservable.Subscribe(t => Clear()));
        }

        ~ReactiveObservableCollection()
        {
            _disposable.Dispose();
        }

        public void Dispose()
        {
            _disposable.Dispose();
            GC.SuppressFinalize(this);
        }
    }
}


text:
package armmsi_test

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi"
)

// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2022-01-31-preview/examples/MsiOperationsList.json
func ExampleOperationsClient_NewListPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armmsi.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}


text:
using UnityEngine;

namespace UnitySampleAssets.Vehicles.Aeroplane
{
    public class AeroplaneAudio : MonoBehaviour
    {
        [SerializeField] private AudioClip engineSound;// Looped engine sound, whose pitch and volume are affected by the plane's throttle setting.
        [SerializeField] private float engineMinThrottlePitch = 0.4f;// Pitch of the engine sound when at minimum throttle.
        [SerializeField] private float engineMaxThrottlePitch = 2f;// Pitch of the engine sound when at maximum throttle.
        [SerializeField] private float engineFwdSpeedMultiplier = 0.002f;// Additional multiplier for an increase in pitch of the engine from the plane's speed.
        [SerializeField] private AudioClip windSound;// Looped wind sound, whose pitch and volume are affected by the plane's velocity.
        [SerializeField] private float windBasePitch = 0.2f; // starting pitch for wind (when plane is at zero speed)
        [SerializeField] private float windSpeedPitchFactor = 0.004f;// Relative increase in pitch of the wind from the plane's speed.
        [SerializeField] private float windMaxSpeedVolume = 100;// the speed the aircraft much reach before the wind sound reaches maximum volume.

        private AudioSource engineSoundSource; // Reference to the AudioSource for the engine.
        private AudioSource windSoundSource; // Reference to the AudioSource for the wind.
        private AeroplaneController plane; // Reference to the aeroplane controller.

        [SerializeField] private AdvancedSetttings advanced = new AdvancedSetttings();// container to make advanced settings appear as rollout in inspector

        [System.Serializable]
        public class AdvancedSetttings // A class for storing the advanced options.
        {
            public float engineMinDistance = 50f; // The min distance of the engine audio source.
            public float engineMaxDistance = 1000f; // The max distance of the engine audio source.
            public float engineDopplerLevel = 1f; // The doppler level of the engine audio source.
            [Range(0f, 1f)] public float engineMasterVolume = 0.5f; // An overall control of the engine sound volume.
            public float windMinDistance = 10f; // The min distance of the wind audio source.
            public float windMaxDistance = 100f; // The max distance of the wind audio source.
            public float windDopplerLevel = 1f; // The doppler level of the wind audio source.
            [Range(0f, 1f)] public float windMasterVolume = 0.5f; // An overall control of the wind sound volume.
        }

        private void Awake()
        {
            // Set up the reference to the aeroplane controller.
            plane = GetComponent<AeroplaneController>();

            // Add the audiosources and get the references.
            engineSoundSource = gameObject.AddComponent<AudioSource>();
            engineSoundSource.playOnAwake = false;
            windSoundSource = gameObject.AddComponent<AudioSource>();
            windSoundSource.playOnAwake = false;

            // Assign clips to the audiosources.
            engineSoundSource.clip = engineSound;
            windSoundSource.clip = windSound;

            // Set the parameters of the audiosources.
            engineSoundSource.minDistance = advanced.engineMinDistance;
            engineSoundSource.maxDistance = advanced.engineMaxDistance;
            engineSoundSource.loop = true;
            engineSoundSource.dopplerLevel = advanced.engineDopplerLevel;

            windSoundSource.minDistance = advanced.windMinDistance;
            windSoundSource.maxDistance = advanced.windMaxDistance;
            windSoundSource.loop = true;
            windSoundSource.dopplerLevel = advanced.windDopplerLevel;

            // call update here to set the sounds pitch and volumes before they actually play
            Update();

            // Start the sounds playing.
            engineSoundSource.Play();
            windSoundSource.Play();

        }

        private void Update()
        {
            // Find what proportion of the engine's power is being used.
            var enginePowerProportion = Mathf.InverseLerp(0, plane.MaxEnginePower, plane.EnginePower);

            // Set the engine's pitch to be proportional to the engine's current power.
            engineSoundSource.pitch = Mathf.Lerp(engineMinThrottlePitch, engineMaxThrottlePitch, enginePowerProportion);

            // Increase the engine's pitch by an amount proportional to the aeroplane's forward speed.
            // (this makes the pitch increase when going into a dive!)
            engineSoundSource.pitch += plane.ForwardSpeed*engineFwdSpeedMultiplier;

            // Set the engine's volume to be proportional to the engine's current power.
            engineSoundSource.volume = Mathf.InverseLerp(0, plane.MaxEnginePower*advanced.engineMasterVolume,
                                                         plane.EnginePower);

            // Set the wind's pitch and volume to be proportional to the aeroplane's forward speed.
            float planeSpeed = rigidbody.velocity.magnitude;
            windSoundSource.pitch = windBasePitch + planeSpeed*windSpeedPitchFactor;
            windSoundSource.volume = Mathf.InverseLerp(0, windMaxSpeedVolume, planeSpeed)*advanced.windMasterVolume;

        }
    }
}


text:
blog CHANGELOG
==============

This file is used to list changes made in each version of the hso cookbook.

0.1.0
-----
- Ian Atkin - Initial release of hso

- - -
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.

The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.


text:
package cyclops.data;

import com.oath.cyclops.matching.Deconstruct.Deconstruct2;
import com.oath.cyclops.matching.SealedOr;
import cyclops.data.tuple.Tuple;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import cyclops.data.tuple.Tuple2;

import java.util.function.Function;
import java.util.function.Supplier;

//https://apocalisp.wordpress.com/2008/10/23/heterogeneous-lists-and-the-limits-of-the-java-type-system/
//inspired / influenced by Functional Java's HList
public interface HList<T1 extends HList<T1>> extends SealedOr<HList<T1>> {

    public static <T, HL extends HList<HL>> HCons<T, HL> cons(final T value, final HL l) {
        return new HCons<>(value, l);
    }
    public static <T> HCons<T, HNil> of(final T value) {
       return new HCons<>(value, empty());
    }
    public static HList<HNil> empty() {
        return HNil.Instance;
    }

   <TB> HCons<TB, T1> prepend(TB value);

    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    @EqualsAndHashCode(of={"head,tail"})
    public static class HCons<T1, T2 extends HList<T2>> implements Deconstruct2<T1,HList<T2>>, HList<HCons<T1,T2>> {

        public final T1 head;
        public final HList<T2> tail;

        @Override
        public Tuple2<T1, HList<T2>> unapply() {
            return Tuple.tuple(head,tail);
        }

        @Override
        public <R> R fold(Function<? super HList<HCons<T1, T2>>, ? extends R> fn1, Supplier<? extends R> s) {
            return fn1.apply(this);
        }

        @Override
        public <TB> HCons<TB, HCons<T1, T2>> prepend(TB value) {
            return cons(value,this);
        }
    }
    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    public static  class HNil implements HList<HNil> {

        final static HNil Instance = new HNil();

        @Override
        public <R> R fold(Function<? super HList<HNil>, ? extends R> fn1, Supplier<? extends R> s) {
            return s.get();
        }

        @Override
        public <TB> HCons<TB, HNil> prepend(TB value) {
            return cons(value,this);
        }
    }

}


text:
from nose.tools import raises
import pwny

SOURCE_ASM = 'mov al, [0xced]'
RESULT_BIN_32 = b'\xa0\xed\x0c\x00\x00'
RESULT_BIN_64 = b'\x8a\x04%\xed\x0c\x00\x00'

SOURCE_DISASM = b'\x5f'
RESULT_DISASM_32 = ['pop edi']
RESULT_DISASM_64 = ['pop rdi']

target_x86_32 = pwny.Target('x86', 32)
target_x86_64 = pwny.Target('x86', 64)
target_arm_32 = pwny.Target('arm', 32)

def test_asm_with_default_target():
    # Note: set up sets default arch to x86 32bit
    assert pwny.asm(SOURCE_ASM) == RESULT_BIN_32

def test_asm_with_target_x86_32():
    assert pwny.asm(SOURCE_ASM, target=target_x86_32) == RESULT_BIN_32

def test_asm_with_target_x86_64():
    assert pwny.asm(SOURCE_ASM, target=target_x86_64) == RESULT_BIN_64

@raises(SyntaxError)
def test_asm_syntax_error():
    pwny.asm('mov ced, 3')

@raises(NotImplementedError)
def test_asm_unsupported_target():
    pwny.asm(SOURCE_ASM, target=target_arm_32)

def test_disasm_with_default_target():
    # Note: set up sets default arch to x86 32bit
    assert pwny.disasm(SOURCE_DISASM) == RESULT_DISASM_32

def test_disasm_with_target_x86_32():
    assert pwny.disasm(SOURCE_DISASM, target=target_x86_32) == RESULT_DISASM_32

def test_disasm_with_target_x86_64():
    print(RESULT_DISASM_64, pwny.disasm(SOURCE_DISASM, target=target_x86_64))
    assert pwny.disasm(SOURCE_DISASM, target=target_x86_64) == RESULT_DISASM_64

@raises(NotImplementedError)
def test_disasm_unsupported_target():
    pwny.disasm(SOURCE_DISASM, target=target_arm_32)


text:
We intend to sunset the Programmable Chat API on July 25, 2022 to focus on the next generation of chat: the [Twilio Conversations API](https://www.twilio.com/docs/conversations). Find out about the [EOL process](https://www.twilio.com/changelog/programmable-chat-end-of-life). We have also prepared [this Migration Guide](https://www.twilio.com/docs/conversations/migrating-chat-conversations) to assist in the transition from Chat to Conversations.

# Twilio Chat for Objective-C
[![Build Status](https://travis-ci.org/TwilioDevEd/twiliochat-objc.svg?branch=master)](https://travis-ci.org/TwilioDevEd/twiliochat-objc)

Objective-C implementation of Twilio Chat

### Running the Application
1. Clone the repository and `cd` into it.
1. Install the application's dependencies with [CocoaPods](https://cocoapods.org/)

   ```bash
   $ pod install
   ```
1. Open the project with `XCode`, but don't use `twiliochat.xcodeproj` file, for
   CocoaPods dependencies to work, you must use `twiliochat.xcworkspace`.
1. [Twilio's Chat Client](https://www.twilio.com/docs/chat) requires an
   [access token](https://www.twilio.com/docs/chat/identity) generated using your
   Twilio credentials in order to connect. First, we need to setup a server that will generate this token
   for the mobile application to use. We have created web versions of Twilio Chat, you can use any of these
   applications to generate the token that this mobile app requires, just pick you favorite flavor:

   * [PHP - Laravel](https://github.com/TwilioDevEd/twiliochat-laravel)
   * [C# - .NET MVC](https://github.com/TwilioDevEd/twiliochat-csharp)
   * [Java - Servlets](https://github.com/TwilioDevEd/twiliochat-servlets)
   * [JS - Node](https://github.com/TwilioDevEd/twiliochat-node)

   Look for instructions on how to setup these servers in any of the links above.

1. Once you have the server running (from the previous step), you need to edit one
   file in the Xcode project.

   ```
   ProjectRoot -> twiliochat -> resources -> Keys.plist
   ```
   This file contains the `TokenRequestUrl` key. The default values is `http://localhost:8000/token`. This
   address refers to the host machine loopback interface when running this application
   in the iOS simulator. You must change this value to match the address of your server running
   the token generation application. We are using the [PHP - Laravel](https://github.com/TwilioDevEd/twiliochat-laravel)
   version in this case, that's why we use port 8000.

   ***Note:*** In some operating systems you need to specify the address for the development server
   when you run the Laravel application, like this:
   ```
   $ php artisan serve --host=127.0.0.1
   ```

1. Now Twilio Chat is ready to go. Run the application on the simulator or your own device, just
   make sure that you have properly set up the token generation server and the `TokenRequestUrl` key.
   To run the application in a real device you'll need to expose your local token generation server
   by manually forwarding ports, or using a tool like [ngrok](https://ngrok.com/).
   If you decide to work with ngrok, your Keys.plist file should hold a key like this one:

   ```
   TokenRequestUrl -> http://<your_subdomain>.ngrok.io/token
   ```
   No need to specify the port in this url, as ngrok will forward the request to the specified port.


text:
#include <linux/device.h>
#include <linux/gcd.h>
#include <linux/kernel.h>
#include <linux/lcm.h>
#include <linux/module.h>

#include "aptina-pll.h"

int aptina_pll_calculate(struct device *dev,
			 const struct aptina_pll_limits *limits,
			 struct aptina_pll *pll)
{
	unsigned int mf_min;
	unsigned int mf_max;
	unsigned int p1_min;
	unsigned int p1_max;
	unsigned int p1;
	unsigned int div;

	dev_dbg(dev, "PLL: ext clock %u pix clock %u\n",
		pll->ext_clock, pll->pix_clock);

	if (pll->ext_clock < limits->ext_clock_min ||
	    pll->ext_clock > limits->ext_clock_max) {
		dev_err(dev, "pll: invalid external clock frequency.\n");
		return -EINVAL;
	}

	if (pll->pix_clock == 0 || pll->pix_clock > limits->pix_clock_max) {
		dev_err(dev, "pll: invalid pixel clock frequency.\n");
		return -EINVAL;
	}

	/* Compute the multiplier M and combined N*P1 divisor. */
	div = gcd(pll->pix_clock, pll->ext_clock);
	pll->m = pll->pix_clock / div;
	div = pll->ext_clock / div;

	/* We now have the smallest M and N*P1 values that will result in the
	 * desired pixel clock frequency, but they might be out of the valid
	 * range. Compute the factor by which we should multiply them given the
	 * following constraints:
	 *
	 * - minimum/maximum multiplier
	 * - minimum/maximum multiplier output clock frequency assuming the
	 *   minimum/maximum N value
	 * - minimum/maximum combined N*P1 divisor
	 */
	mf_min = DIV_ROUND_UP(limits->m_min, pll->m);
	mf_min = max(mf_min, limits->out_clock_min /
		     (pll->ext_clock / limits->n_min * pll->m));
	mf_min = max(mf_min, limits->n_min * limits->p1_min / div);
	mf_max = limits->m_max / pll->m;
	mf_max = min(mf_max, limits->out_clock_max /
		    (pll->ext_clock / limits->n_max * pll->m));
	mf_max = min(mf_max, DIV_ROUND_UP(limits->n_max * limits->p1_max, div));

	dev_dbg(dev, "pll: mf min %u max %u\n", mf_min, mf_max);
	if (mf_min > mf_max) {
		dev_err(dev, "pll: no valid combined N*P1 divisor.\n");
		return -EINVAL;
	}

	/*
	 * We're looking for the highest acceptable P1 value for which a
	 * multiplier factor MF exists that fulfills the following conditions:
	 *
	 * 1. p1 is in the [p1_min, p1_max] range given by the limits and is
	 *    even
	 * 2. mf is in the [mf_min, mf_max] range computed above
	 * 3. div * mf is a multiple of p1, in order to compute
	 *	n = div * mf / p1
	 *	m = pll->m * mf
	 * 4. the internal clock frequency, given by ext_clock / n, is in the
	 *    [int_clock_min, int_clock_max] range given by the limits
	 * 5. the output clock frequency, given by ext_clock / n * m, is in the
	 *    [out_clock_min, out_clock_max] range given by the limits
	 *
	 * The first naive approach is to iterate over all p1 values acceptable
	 * according to (1) and all mf values acceptable according to (2), and
	 * stop at the first combination that fulfills (3), (4) and (5). This
	 * has a O(n^2) complexity.
	 *
	 * Instead of iterating over all mf values in the [mf_min, mf_max] range
	 * we can compute the mf increment between two acceptable values
	 * according to (3) with
	 *
	 *	mf_inc = p1 / gcd(div, p1)			(6)
	 *
	 * and round the minimum up to the nearest multiple of mf_inc. This will
	 * restrict the number of mf values to be checked.
	 *
	 * Furthermore, conditions (4) and (5) only restrict the range of
	 * acceptable p1 and mf values by modifying the minimum and maximum
	 * limits. (5) can be expressed as
	 *
	 *	ext_clock / (div * mf / p1) * m * mf >= out_clock_min
	 *	ext_clock / (div * mf / p1) * m * mf <= out_clock_max
	 *
	 * or
	 *
	 *	p1 >= out_clock_min * div / (ext_clock * m)	(7)
	 *	p1 <= out_clock_max * div / (ext_clock * m)
	 *
	 * Similarly, (4) can be expressed as
	 *
	 *	mf >= ext_clock * p1 / (int_clock_max * div)	(8)
	 *	mf <= ext_clock * p1 / (int_clock_min * div)
	 *
	 * We can thus iterate over the restricted p1 range defined by the
	 * combination of (1) and (7), and then compute the restricted mf range
	 * defined by the combination of (2), (6) and (8). If the resulting mf
	 * range is not empty, any value in the mf range is acceptable. We thus
	 * select the mf lwoer bound and the corresponding p1 value.
	 */
	if (limits->p1_min == 0) {
		dev_err(dev, "pll: P1 minimum value must be >0.\n");
		return -EINVAL;
	}

	p1_min = max(limits->p1_min, DIV_ROUND_UP(limits->out_clock_min * div,
		     pll->ext_clock * pll->m));
	p1_max = min(limits->p1_max, limits->out_clock_max * div /
		     (pll->ext_clock * pll->m));

	for (p1 = p1_max & ~1; p1 >= p1_min; p1 -= 2) {
		unsigned int mf_inc = p1 / gcd(div, p1);
		unsigned int mf_high;
		unsigned int mf_low;

		mf_low = roundup(max(mf_min, DIV_ROUND_UP(pll->ext_clock * p1,
					limits->int_clock_max * div)), mf_inc);
		mf_high = min(mf_max, pll->ext_clock * p1 /
			      (limits->int_clock_min * div));

		if (mf_low > mf_high)
			continue;

		pll->n = div * mf_low / p1;
		pll->m *= mf_low;
		pll->p1 = p1;
		dev_dbg(dev, "PLL: N %u M %u P1 %u\n", pll->n, pll->m, pll->p1);
		return 0;
	}

	dev_err(dev, "pll: no valid N and P1 divisors found.\n");
	return -EINVAL;
}
EXPORT_SYMBOL_GPL(aptina_pll_calculate);

MODULE_DESCRIPTION("Aptina PLL Helpers");
MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
MODULE_LICENSE("GPL v2");


text:
require 'kramdown'

# Markdown Parser.
#
# It parses markdown to formatted hash.
class MarkdownParser
  def self.to_hash(markdown)
    doc = Kramdown::Document.new(markdown).to_data
    JSON.parse(doc)
  end
end

module Kramdown
  module Converter
    # Markdown Converter implementation.
    #
    # It converts an Markdown in formatted data.
    class Data < Base
      def initialize(root, options)
        super(root, options)
        @sections = []
      end

      # Converts markdown in a formatted data.
      #
      def convert(root)
        root.children.map do |element|
          method = "convert_#{element.type}"
          send(method, element) if respond_to?(method)
        end.compact.flatten

        JSON.generate(@sections)
      end

      # Converts markdown header in a section item
      #
      def convert_header(element)
        @sections.push(
          text: element.options[:raw_text],
          level: element.options[:level],
          description: extract_text(element.children.pop),
          items: []
        )
      end

      # Converts markdown ul in a section item "Project"
      #
      def convert_ul(element)
        element.children.each do |li|
          @sections.last[:items].push(extract_list(li))
        end
      end

      # Converts a p element in a description section.
      #
      def convert_p(element)
        @sections.last.merge!(extract_p(element))
      end

      # Extracts a link from a given element.
      #
      def extract_link(element)
        {
          href: element.attr['href'],
          text: extract_text(element.children.first)
        }
      end

      def extract_text(element)
        element.value
      end

      def extract_list(element)
        element.children.map { |e| extract_p(e) }.inject({}) do |acc, elem|
          acc.merge(elem)
        end
      end

      def extract_p(element)
        item = {}
        element.children.each do |el|
          case el.type
          when :a
            item[:link] = extract_link(el)
          when :text
            item[:description] = extract_text(el)
          end
        end
        item
      end
    end
  end
end