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

import static org.ops4j.pax.web.service.tomcat.internal.ServerState.States.INSTALLED;

import org.ops4j.pax.web.service.spi.Configuration;

/**
 * @author Romain Gilles
 */
class InstalledServerState extends AbstractServerState {

	InstalledServerState(ServerStateFactory serverStateFactory) {
		super(serverStateFactory);
	}

	static ServerState getInstance(ServerStateFactory serverStateFactory) {
		return new InstalledServerState(serverStateFactory);
	}

	@Override
	public ServerState start() {
		return throwIllegalState();
	}

	@Override
	public ServerState stop() {
		return throwIllegalState();
	}

	@Override
	public boolean isStarted() {
		return false;
	}

	@Override
	public boolean isConfigured() {
		return false;
	}

	@Override
	public ServerState configure(Configuration configuration) {
		return getServerStateFactory().newInitializedState(configuration);
	}

	@Override
	public States getState() {
		return INSTALLED;
	}

}


text:
import * as Types from "../types";
import { ReadyValue } from "./ready";

export class StreamElement extends ReadyValue {
  public value: ReadyValue;
  public constructor(value: ReadyValue) {
    super(new Types.Stream(value.type));
    this.value = value;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package chronic.app;

import chronic4j.ChronicMonitor;
import chronic4j.ChronicMonitors;
import org.apache.log4j.Priority;
import org.apache.log4j.spi.LoggingEvent;
import vellum.jx.JMap;

/**
 *
 * @author evan.summers
 */
public class ChronicAppMonitor implements ChronicMonitor {
    int errorCount;
    int warnCount;

    ChronicApp app;

    public ChronicAppMonitor(ChronicApp app) {
        this.app = app;
    }

    @Override
    public void process(LoggingEvent le) {
        if (le.getLevel().toInt() == Priority.ERROR_INT) {
            errorCount++;
        } else if (le.getLevel().toInt() == Priority.WARN_INT) {
            warnCount++;
        }
    }

    @Override
    public String buildReport() {
        JMap map = app.getMetrics();
        map.put("error", errorCount);
        map.put("warn", warnCount);
        reset();
        return ChronicMonitors.buildReport(map);
    }

    public void reset() {
        errorCount = 0;
        warnCount = 0;
    }
}


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ca.dalezak.androidbase">

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

    <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name="ca.dalezak.androidbase.activities.ShutdownActivity"
            android:label="@string/app_name"
            android:noHistory="true"
            android:clearTaskOnLaunch="true"
            android:excludeFromRecents="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar">
        </activity>
    </application>

</manifest>


text:
package com.zcc.cryptex.lib.pipline.impl;

import com.zcc.cryptex.lib.pipline.CryptexContext;
import com.zcc.cryptex.lib.pipline.Pipline;
import com.zcc.cryptex.lib.pipline.Valve;
import com.zcc.cryptex.lib.pipline.exception.OutOfLimtException;

import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

/**
 * Created by Hengyun on 16/4/15.
 */
public class SimplePipline implements Pipline {

    private static final int DEFAULT_VALUE_LIMIT = 100;
    private ArrayList<Valve> valves = new ArrayList<>();
    private Set<Integer> disabled = new TreeSet<>();
    private Valve basicValve;

    @Override
    public void setBasic(Valve valve) {
        if (valve == null) {
            throw new NullPointerException("basic valve can not be null");
        }
        basicValve = valve;
    }

    @Override
    public void addValve(Valve valve) {
        if (valve == null) {
            return;
        }
        if(valves.size() == DEFAULT_VALUE_LIMIT){
            throw new OutOfLimtException();
        }
        valves.add(valve);
    }

    @Override
    public void removeValve(Valve valve) {
        if (valve == null) {
            return;
        }
        valves.remove(valve);
    }

    public void disableValve(Valve valve) {
        if (valve == null) {
            return;
        }
        int index = valves.indexOf(valve);
        if (index > -1) {
            disabled.add(index);
        }
    }

    public void resetDisable(){
        disabled.clear();
    }

    public void removeDisable(Valve valve){
        if(valve == null){
            return;
        }
        int index = valves.indexOf(valve);
        if (index > -1) {
            disabled.remove(index);
        }
    }

    @Override
    public void invoke(Map<String, Object> params) {
        new SimpleCryptexPipHandler().invokeNext(params);
    }

    private class SimpleCryptexPipHandler implements CryptexContext {

        private Map<String, Object> params;

        public SimpleCryptexPipHandler(){

        }

        public SimpleCryptexPipHandler(Map<String, Object> params) {
            this.params = params;
        }

        @Override
        public void invokeNext(Map<String, Object> params) {
            for(int i = 0 ; i <valves.size(); i ++){
                if(disabled.contains(i)){
                    continue;
                }
                valves.get(i).invoke(params,this);
            }
            SimplePipline.this.basicValve.invoke(params, this);
        }
    }
}


text:
package models.daos.slick

import javax.inject
import models.Session
import models.Subscribe
import models.daos.slick.DBTableDefinitions._
import play.api.db.slick._
import utils.MyPostgresDriver.simple._
import models.daos.slick.DBAuthTableDefinitions._
import com.mohiva.play.silhouette.api.LoginInfo
import scala.concurrent.Future
import java.util.{UUID, Date}
import play.Logger
import com.github.tminglei.slickpg.TsQuery

class SessionsDAO {
  import play.api.Play.current

  val plainToTsQuery= SimpleFunction.unary[String, TsQuery]("plainto_tsquery")

  def all(drop: Int, take: Int) = {
    DB.withSession { implicit s =>
      slickSessions.drop(drop).take(take).list
    }
  }

  def allSubscribedByUserId(uuid: UUID) = {
    DB.withSession { implicit s =>
      val q = for{
          sub <- slickSubscribes if sub.userId === uuid
          s <- slickSessions if sub.sessionId === sub.sessionId
        } yield (s.id, s.title, s.description, s.authorId, s.creationDate)

      q.list.map(x => Session(Some(x._1), x._2, x._3, Some(x._4), Some(x._5)))
    }
  }

  def subscribe(userId: UUID, sessionId: UUID) = {
    DB.withSession { implicit s =>
      slickSubscribes += Subscribe(UUID.randomUUID(),sessionId,userId, new Date())
    }
  }
  def find(sessionId: UUID) = {
    DB.withSession { implicit s =>
      slickSessions.filter(_.id === sessionId).firstOption
    }
  }

  def search(query: String, drop: Int, take: Int) = {
    DB.withSession { implicit s =>
      val formatted_query = query.split("\\W+").map(x=>x.trim + ":*").mkString(" & ")
      println(formatted_query)
      val q1 = slickSessions
      .filter(x => {
        (toTsVector(x.title, Some("french")) @+ toTsVector(x.description, Some("french"))) @@ toTsQuery(formatted_query, Some("French")) /*toTsQuery(query.bind, Some("french")*/
      })
      .map(r => (r.id, r.title, r.description, r.authorId, r.creationDate, tsRank(toTsVector(r.title),toTsQuery(formatted_query, Some("French")))))/*toTsQuery(query.bind, Some("french"))*/
      .sortBy(_._6)
      .drop(drop)
      .take(take)
      q1.list
      .map(s => Session(Some(s._1), s._2, s._3, Some(s._4), Some(s._5)))

    }
  }

  def save(session: Session) = {
      DB.withSession { implicit s =>
        session.sessionID match {
          case Some(uuid) => {
            println(uuid)
            session
          }
          case None => {
            val ses = session.copy(sessionID = Some(UUID.randomUUID()), creationDate = Some(new Date()))
            slickSessions.insert(ses)
            ses
          }
        }
      }
  }

  //def findWithMessages(sessionId: UUID)
}


text:
<?php

declare(strict_types=1);

namespace Doctrine\Migrations\Configuration\EntityManager\Exception;

use InvalidArgumentException;

use function sprintf;

final class FileNotFound extends InvalidArgumentException implements LoaderException
{
    public static function new(string $file): self
    {
        return new self(sprintf('Database configuration file "%s" does not exist.', $file));
    }
}


text:
namespace blink {

namespace {

absl::optional<bool> ToAbslOptionalBool(const absl::optional<bool>& value) {
  return value ? absl::optional<bool>(*value) : absl::nullopt;
}

webrtc::VideoTrackInterface::ContentHint ContentHintTypeToWebRtcContentHint(
    WebMediaStreamTrack::ContentHintType content_hint) {
  switch (content_hint) {
    case WebMediaStreamTrack::ContentHintType::kNone:
      return webrtc::VideoTrackInterface::ContentHint::kNone;
    case WebMediaStreamTrack::ContentHintType::kAudioSpeech:
    case WebMediaStreamTrack::ContentHintType::kAudioMusic:
      NOTREACHED();
      break;
    case WebMediaStreamTrack::ContentHintType::kVideoMotion:
      return webrtc::VideoTrackInterface::ContentHint::kFluid;
    case WebMediaStreamTrack::ContentHintType::kVideoDetail:
      return webrtc::VideoTrackInterface::ContentHint::kDetailed;
    case WebMediaStreamTrack::ContentHintType::kVideoText:
      return webrtc::VideoTrackInterface::ContentHint::kText;
  }
  NOTREACHED();
  return webrtc::VideoTrackInterface::ContentHint::kNone;
}

void RequestRefreshFrameOnRenderTaskRunner(MediaStreamComponent* component) {
  if (!component)
    return;
  if (MediaStreamVideoTrack* video_track =
          MediaStreamVideoTrack::From(component)) {
    if (MediaStreamVideoSource* source = video_track->source()) {
      source->RequestRefreshFrame();
    }
  }
}

void RequestRefreshFrame(
    scoped_refptr<base::SingleThreadTaskRunner> task_runner,
    CrossThreadWeakPersistent<MediaStreamComponent> component) {
  PostCrossThreadTask(*task_runner, FROM_HERE,
                      CrossThreadBindOnce(RequestRefreshFrameOnRenderTaskRunner,
                                          std::move(component)));
}

}  // namespace

// Simple help class used for receiving video frames on the IO-thread from a
// MediaStreamVideoTrack and forward the frames to a WebRtcVideoCapturerAdapter
// on libjingle's network thread. WebRtcVideoCapturerAdapter implements a video
// capturer for libjingle.
class MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter
    : public WTF::ThreadSafeRefCounted<WebRtcVideoSourceAdapter> {
 public:
  WebRtcVideoSourceAdapter(
      const scoped_refptr<base::SingleThreadTaskRunner>&
          libjingle_network_task_runner,
      const scoped_refptr<WebRtcVideoTrackSource>& source,
      scoped_refptr<base::SingleThreadTaskRunner> task_runner);

  // MediaStreamVideoWebRtcSink can be destroyed on the main render thread or
  // libjingles network thread since it posts video frames on that thread. But
  // |video_source_| must be released on the main render thread before the
  // PeerConnectionFactory has been destroyed. The only way to ensure that is to
  // make sure |video_source_| is released when MediaStreamVideoWebRtcSink() is
  // destroyed.
  void ReleaseSourceOnMainThread();

  void OnVideoFrameOnIO(
      scoped_refptr<media::VideoFrame> frame,
      std::vector<scoped_refptr<media::VideoFrame>> scaled_frames,
      base::TimeTicks estimated_capture_time);

 private:
  friend class WTF::ThreadSafeRefCounted<WebRtcVideoSourceAdapter>;

  void OnVideoFrameOnNetworkThread(
      scoped_refptr<media::VideoFrame> frame,
      std::vector<scoped_refptr<media::VideoFrame>> scaled_frames);

  virtual ~WebRtcVideoSourceAdapter();

  scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_;

  // |render_thread_checker_| is bound to the main render thread.
  THREAD_CHECKER(render_thread_checker_);
  // Used to DCHECK that frames are called on the IO-thread.
  THREAD_CHECKER(io_thread_checker_);

  // Used for posting frames to libjingle's network thread. Accessed on the
  // IO-thread.
  scoped_refptr<base::SingleThreadTaskRunner> libjingle_network_task_runner_;

  scoped_refptr<WebRtcVideoTrackSource> video_source_;

  // Used to protect |video_source_|. It is taken by libjingle's network
  // thread for each video frame that is delivered but only taken on the
  // main render thread in ReleaseSourceOnMainThread() when
  // the owning MediaStreamVideoWebRtcSink is being destroyed.
  base::Lock video_source_stop_lock_;
};

MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::WebRtcVideoSourceAdapter(
    const scoped_refptr<base::SingleThreadTaskRunner>&
        libjingle_network_task_runner,
    const scoped_refptr<WebRtcVideoTrackSource>& source,
    scoped_refptr<base::SingleThreadTaskRunner> task_runner)
    : render_task_runner_(std::move(task_runner)),
      libjingle_network_task_runner_(libjingle_network_task_runner),
      video_source_(source) {
  DCHECK(render_task_runner_->RunsTasksInCurrentSequence());
  DETACH_FROM_THREAD(io_thread_checker_);
}

MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::
    ~WebRtcVideoSourceAdapter() {
  DVLOG(3) << "~WebRtcVideoSourceAdapter()";
  DCHECK(!video_source_);
  // This object can be destroyed on the main render thread or libjingles
  // network thread since it posts video frames on that thread. But
  // |video_source_| must be released on the main render thread before the
  // PeerConnectionFactory has been destroyed. The only way to ensure that is to
  // make sure |video_source_| is released when MediaStreamVideoWebRtcSink() is
  // destroyed.
}

void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::
    ReleaseSourceOnMainThread() {
  DCHECK_CALLED_ON_VALID_THREAD(render_thread_checker_);
  // Since frames are posted to the network thread, this object might be deleted
  // on that thread. However, since |video_source_| was created on the render
  // thread, it should be released on the render thread.
  base::AutoLock auto_lock(video_source_stop_lock_);
  video_source_ = nullptr;
}

void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::OnVideoFrameOnIO(
    scoped_refptr<media::VideoFrame> frame,
    std::vector<scoped_refptr<media::VideoFrame>> scaled_frames,
    base::TimeTicks estimated_capture_time) {
  DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_);
  PostCrossThreadTask(
      *libjingle_network_task_runner_.get(), FROM_HERE,
      CrossThreadBindOnce(
          &WebRtcVideoSourceAdapter::OnVideoFrameOnNetworkThread,
          WrapRefCounted(this), std::move(frame), std::move(scaled_frames)));
}

void MediaStreamVideoWebRtcSink::WebRtcVideoSourceAdapter::
    OnVideoFrameOnNetworkThread(
        scoped_refptr<media::VideoFrame> frame,
        std::vector<scoped_refptr<media::VideoFrame>> scaled_frames) {
  DCHECK(libjingle_network_task_runner_->BelongsToCurrentThread());
  base::AutoLock auto_lock(video_source_stop_lock_);
  if (video_source_)
    video_source_->OnFrameCaptured(std::move(frame), std::move(scaled_frames));
}

MediaStreamVideoWebRtcSink::MediaStreamVideoWebRtcSink(
    MediaStreamComponent* component,
    PeerConnectionDependencyFactory* factory,
    scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
  MediaStreamVideoTrack* video_track = MediaStreamVideoTrack::From(component);
  DCHECK(video_track);

  absl::optional<bool> needs_denoising =
      ToAbslOptionalBool(video_track->noise_reduction());

  bool is_screencast = video_track->is_screencast();

  MediaStreamVideoSource* source = video_track->source();
  VideoCaptureFeedbackCB feedback_cb =
      source ? source->GetFeedbackCallback() : base::DoNothing();
  base::RepeatingClosure request_refresh_frame_closure =
      source ? ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
                   RequestRefreshFrame, task_runner,
                   WrapCrossThreadWeakPersistent(component)))
             : base::DoNothing();

  // TODO(pbos): Consolidate WebRtcVideoCapturerAdapter into WebRtcVideoSource
  // by removing the need for and dependency on a cricket::VideoCapturer.
  video_source_ = scoped_refptr<WebRtcVideoTrackSource>(
      new rtc::RefCountedObject<WebRtcVideoTrackSource>(
          is_screencast, needs_denoising, feedback_cb,
          request_refresh_frame_closure, factory->GetGpuFactories()));

  // TODO(pbos): Consolidate the local video track with the source proxy and
  // move into PeerConnectionDependencyFactory. This now separately holds on a
  // reference to the proxy object because
  // PeerConnectionFactory::CreateVideoTrack doesn't do reference counting.
  video_source_proxy_ =
      factory->CreateVideoTrackSourceProxy(video_source_.get());
  video_track_ = factory->CreateLocalVideoTrack(component->Id(),
                                                video_source_proxy_.get());

  video_track_->set_content_hint(
      ContentHintTypeToWebRtcContentHint(component->ContentHint()));
  video_track_->set_enabled(component->Enabled());

  source_adapter_ = base::MakeRefCounted<WebRtcVideoSourceAdapter>(
      factory->GetWebRtcNetworkTaskRunner(), video_source_.get(),
      std::move(task_runner));

  MediaStreamVideoSink::ConnectToTrack(
      WebMediaStreamTrack(component),
      ConvertToBaseRepeatingCallback(CrossThreadBindRepeating(
          &WebRtcVideoSourceAdapter::OnVideoFrameOnIO, source_adapter_)),
      MediaStreamVideoSink::IsSecure::kNo,
      MediaStreamVideoSink::UsesAlpha::kNo);

  DVLOG(3) << "MediaStreamVideoWebRtcSink ctor() : is_screencast "
           << is_screencast;
}

MediaStreamVideoWebRtcSink::~MediaStreamVideoWebRtcSink() {
  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
  DVLOG(3) << "MediaStreamVideoWebRtcSink dtor().";
  weak_factory_.InvalidateWeakPtrs();
  MediaStreamVideoSink::DisconnectFromTrack();
  source_adapter_->ReleaseSourceOnMainThread();
}

void MediaStreamVideoWebRtcSink::OnEnabledChanged(bool enabled) {
  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
  video_track_->set_enabled(enabled);
}

void MediaStreamVideoWebRtcSink::OnContentHintChanged(
    WebMediaStreamTrack::ContentHintType content_hint) {
  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
  video_track_->set_content_hint(
      ContentHintTypeToWebRtcContentHint(content_hint));
}

void MediaStreamVideoWebRtcSink::OnVideoConstraintsChanged(
    absl::optional<double> min_fps,
    absl::optional<double> max_fps) {
  DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
  DVLOG(3) << __func__ << " min " << min_fps.value_or(-1) << " max "
           << max_fps.value_or(-1);
  video_source_proxy_->ProcessConstraints(
      webrtc::VideoTrackSourceConstraints{min_fps, max_fps});
}

absl::optional<bool>
MediaStreamVideoWebRtcSink::SourceNeedsDenoisingForTesting() const {
  return video_source_->needs_denoising();
}

}  // namespace blink


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace QS.Fx.Value
{
    [QS.Fx.Reflection.ValueClass(QS.Fx.Reflection.ValueClasses._s_member_2)]
    [XmlType("Member")]
    [QS.Fx.Printing.Printable("Member", QS.Fx.Printing.PrintingStyle.Expanded, QS.Fx.Printing.SelectionOption.Explicit)]
    public sealed class Member<
        [QS.Fx.Reflection.Parameter("IdentifierClass", QS.Fx.Reflection.ParameterClass.ValueClass)] IdentifierClass,
        [QS.Fx.Reflection.Parameter("IncarnationClass", QS.Fx.Reflection.ParameterClass.ValueClass)] IncarnationClass,
        [QS.Fx.Reflection.Parameter("NameClass", QS.Fx.Reflection.ParameterClass.ValueClass)] NameClass,
        [QS.Fx.Reflection.Parameter("AddressClass", QS.Fx.Reflection.ParameterClass.ValueClass)] AddressClass>
        : QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass, AddressClass>
    {
        #region Constructor

        public Member(IdentifierClass identifier, bool operational, IncarnationClass incarnation, NameClass name, AddressClass[] addresses)
        {
            this.identifier = identifier;
            this.operational = operational;
            this.incarnation = incarnation;
            this.name = name;
            this.addresses = addresses;
        }

        public Member()
        {
        }

        #endregion

        #region Fields

        [QS.Fx.Printing.Printable("identifier")]
        private IdentifierClass identifier;
        [QS.Fx.Printing.Printable("operational")]
        private bool operational;
        [QS.Fx.Printing.Printable("incarnation")]
        private IncarnationClass incarnation;
        [QS.Fx.Printing.Printable("name")]
        private NameClass name;
        [QS.Fx.Printing.Printable("addresses")]
        private AddressClass[] addresses;

        #endregion

        #region Accessors

        [XmlElement("Identifier")]
        public IdentifierClass Identifier
        {
            get { return this.identifier; }
            set { this.identifier = value; }
        }

        [XmlElement("Operational")]
        public bool Operational
        {
            get { return this.operational; }
            set { this.operational = value; }
        }

        [XmlElement("Incarnation")]
        public IncarnationClass Incarnation
        {
            get { return this.incarnation; }
            set { this.incarnation = value; }
        }

        [XmlElement("Name")]
        public NameClass Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        [XmlElement("Address")]
        public AddressClass[] Addresses
        {
            get { return this.addresses; }
            set { this.addresses = value; }
        }

        #endregion

        #region IMember<IdentifierClass,IncarnationClass,NameClass,AddressClass> Members

        [XmlIgnore]
        IdentifierClass QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass>.Identifier
        {
            get { return this.identifier; }
        }

        [XmlIgnore]
        IncarnationClass QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass>.Incarnation
        {
            get { return this.incarnation; }
        }

        [XmlIgnore]
        NameClass QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass>.Name
        {
            get { return this.name; }
        }

        [XmlIgnore]
        bool QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass, AddressClass>.Operational
        {
            get { return this.operational; }
        }

        [XmlIgnore]
        IEnumerable<AddressClass> QS.Fx.Value.Classes.IMember<IdentifierClass, IncarnationClass, NameClass, AddressClass>.Addresses
        {
            get { return this.addresses; }
        }

        #endregion
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.spencerandbrown.midwifeclienttracker">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".ClientListActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ClientDetailActivity"
            android:label="@string/title_client_detail"
            android:parentActivityName=".ClientListActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.spencerandbrown.midwifeclienttracker.ClientListActivity" />
        </activity>
    </application>

</manifest>


text:
<?php
require_once 'tests/Session/Profile.php';

require_once 'PHPUnit/Framework/TestCase.php';

/**
 * Profile test case.
 */
class ProfileSessionTest extends PHPUnit_Framework_TestCase
{

    /**
     *
     * @var Profile
     */
    private $Profile;

    /**
     * Prepares the environment before running a test.
     */
    protected function setUp()
    {
        parent::setUp();

        // TODO Auto-generated ProfileSessionTest::setUp()

        $this->Profile = new Profile(/* parameters */);
    }

    /**
     * Cleans up the environment after running a test.
     */
    protected function tearDown()
    {
        // TODO Auto-generated ProfileSessionTest::tearDown()
        $this->Profile = null;

        parent::tearDown();
    }

    /**
     * Constructs the test case.
     */
    public function __construct()
    {
        // TODO Auto-generated constructor
    }

    /**
     * Tests Profile->__construct()
     */
    public function test__construct()
    {
        // TODO Auto-generated ProfileSessionTest->test__construct()
        $this->markTestIncomplete("__construct test not implemented");

        $this->Profile->__construct(/* parameters */);
    }

    /**
     * Tests Profile->isLoaded()
     */
    public function testIsLoaded()
    {
        // TODO Auto-generated ProfileSessionTest->testIsLoaded()
        $this->markTestIncomplete("isLoaded test not implemented");

        $this->Profile->isLoaded(/* parameters */);
    }

    /**
     * Tests Profile->getProfilName()
     */
    public function testGetProfilName()
    {
        // TODO Auto-generated ProfileSessionTest->testGetProfilName()
        $this->markTestIncomplete("getProfilName test not implemented");

        $this->Profile->getProfilName(/* parameters */);
    }

    /**
     * Tests Profile->get()
     */
    public function testGet()
    {
        // TODO Auto-generated ProfileSessionTest->testGet()
        $this->markTestIncomplete("get test not implemented");

        $this->Profile->get(/* parameters */);
    }
}


text:
"""
Module for formatting output data in Latex.
"""

from __future__ import print_function

from pandas.core.index import MultiIndex
from pandas import compat
from pandas.compat import range, map, zip, u
from pandas.io.formats.format import TableFormatter
import numpy as np

class LatexFormatter(TableFormatter):
    """ Used to render a DataFrame to a LaTeX tabular/longtable environment
    output.

    Parameters
    ----------
    formatter : `DataFrameFormatter`
    column_format : str, default None
        The columns format as specified in `LaTeX table format
        <https://en.wikibooks.org/wiki/LaTeX/Tables>`__ e.g 'rcl' for 3 columns
    longtable : boolean, default False
        Use a longtable environment instead of tabular.

    See Also
    --------
    HTMLFormatter
    """

    def __init__(self, formatter, column_format=None, longtable=False,
                 multicolumn=False, multicolumn_format=None, multirow=False):
        self.fmt = formatter
        self.frame = self.fmt.frame
        self.bold_rows = self.fmt.kwds.get('bold_rows', False)
        self.column_format = column_format
        self.longtable = longtable
        self.multicolumn = multicolumn
        self.multicolumn_format = multicolumn_format
        self.multirow = multirow

    def write_result(self, buf):
        """
        Render a DataFrame to a LaTeX tabular/longtable environment output.
        """

        # string representation of the columns
        if len(self.frame.columns) == 0 or len(self.frame.index) == 0:
            info_line = (u('Empty {name}\nColumns: {col}\nIndex: {idx}')
                         .format(name=type(self.frame).__name__,
                                 col=self.frame.columns,
                                 idx=self.frame.index))
            strcols = [[info_line]]
        else:
            strcols = self.fmt._to_str_columns()

        def get_col_type(dtype):
            if issubclass(dtype.type, np.number):
                return 'r'
            else:
                return 'l'

        # reestablish the MultiIndex that has been joined by _to_str_column
        if self.fmt.index and isinstance(self.frame.index, MultiIndex):
            out = self.frame.index.format(
                adjoin=False, sparsify=self.fmt.sparsify,
                names=self.fmt.has_index_names, na_rep=self.fmt.na_rep
            )

            # index.format will sparsify repeated entries with empty strings
            # so pad these with some empty space
            def pad_empties(x):
                for pad in reversed(x):
                    if pad:
                        break
                return [x[0]] + [i if i else ' ' * len(pad) for i in x[1:]]
            out = (pad_empties(i) for i in out)

            # Add empty spaces for each column level
            clevels = self.frame.columns.nlevels
            out = [[' ' * len(i[-1])] * clevels + i for i in out]

            # Add the column names to the last index column
            cnames = self.frame.columns.names
            if any(cnames):
                new_names = [i if i else '{}' for i in cnames]
                out[self.frame.index.nlevels - 1][:clevels] = new_names

            # Get rid of old multiindex column and add new ones
            strcols = out + strcols[1:]

        column_format = self.column_format
        if column_format is None:
            dtypes = self.frame.dtypes._values
            column_format = ''.join(map(get_col_type, dtypes))
            if self.fmt.index:
                index_format = 'l' * self.frame.index.nlevels
                column_format = index_format + column_format
        elif not isinstance(column_format,
                            compat.string_types):  # pragma: no cover
            raise AssertionError('column_format must be str or unicode, '
                                 'not {typ}'.format(typ=type(column_format)))

        if not self.longtable:
            buf.write('\\begin{{tabular}}{{{fmt}}}\n'
                      .format(fmt=column_format))
            buf.write('\\toprule\n')
        else:
            buf.write('\\begin{{longtable}}{{{fmt}}}\n'
                      .format(fmt=column_format))
            buf.write('\\toprule\n')

        ilevels = self.frame.index.nlevels
        clevels = self.frame.columns.nlevels
        nlevels = clevels
        if self.fmt.has_index_names and self.fmt.show_index_names:
            nlevels += 1
        strrows = list(zip(*strcols))
        self.clinebuf = []

        for i, row in enumerate(strrows):
            if i == nlevels and self.fmt.header:
                buf.write('\\midrule\n')  # End of header
                if self.longtable:
                    buf.write('\\endhead\n')
                    buf.write('\\midrule\n')
                    buf.write('\\multicolumn{{{n}}}{{r}}{{{{Continued on next '
                              'page}}}} \\\\\n'.format(n=len(row)))
                    buf.write('\\midrule\n')
                    buf.write('\\endfoot\n\n')
                    buf.write('\\bottomrule\n')
                    buf.write('\\endlastfoot\n')
            if self.fmt.kwds.get('escape', True):
                # escape backslashes first
                crow = [(x.replace('\\', '\\textbackslash ')
                         .replace('_', '\\_')
                         .replace('%', '\\%').replace('$', '\\$')
                         .replace('#', '\\#').replace('{', '\\{')
                         .replace('}', '\\}').replace('~', '\\textasciitilde ')
                         .replace('^', '\\textasciicircum ')
                         .replace('&', '\\&')
                         if (x and x != '{}') else '{}') for x in row]
            else:
                crow = [x if x else '{}' for x in row]
            if self.bold_rows and self.fmt.index:
                # bold row labels
                crow = ['\\textbf{{{x}}}'.format(x=x)
                        if j < ilevels and x.strip() not in ['', '{}'] else x
                        for j, x in enumerate(crow)]
            if i < clevels and self.fmt.header and self.multicolumn:
                # sum up columns to multicolumns
                crow = self._format_multicolumn(crow, ilevels)
            if (i >= nlevels and self.fmt.index and self.multirow and
                    ilevels > 1):
                # sum up rows to multirows
                crow = self._format_multirow(crow, ilevels, i, strrows)
            buf.write(' & '.join(crow))
            buf.write(' \\\\\n')
            if self.multirow and i < len(strrows) - 1:
                self._print_cline(buf, i, len(strcols))

        if not self.longtable:
            buf.write('\\bottomrule\n')
            buf.write('\\end{tabular}\n')
        else:
            buf.write('\\end{longtable}\n')

    def _format_multicolumn(self, row, ilevels):
        r"""
        Combine columns belonging to a group to a single multicolumn entry
        according to self.multicolumn_format

        e.g.:
        a &  &  & b & c &
        will become
        \multicolumn{3}{l}{a} & b & \multicolumn{2}{l}{c}
        """
        row2 = list(row[:ilevels])
        ncol = 1
        coltext = ''

        def append_col():
            # write multicolumn if needed
            if ncol > 1:
                row2.append('\\multicolumn{{{ncol:d}}}{{{fmt:s}}}{{{txt:s}}}'
                            .format(ncol=ncol, fmt=self.multicolumn_format,
                                    txt=coltext.strip()))
            # don't modify where not needed
            else:
                row2.append(coltext)
        for c in row[ilevels:]:
            # if next col has text, write the previous
            if c.strip():
                if coltext:
                    append_col()
                coltext = c
                ncol = 1
            # if not, add it to the previous multicolumn
            else:
                ncol += 1
        # write last column name
        if coltext:
            append_col()
        return row2

    def _format_multirow(self, row, ilevels, i, rows):
        r"""
        Check following rows, whether row should be a multirow

        e.g.:     becomes:
        a & 0 &   \multirow{2}{*}{a} & 0 &
          & 1 &     & 1 &
        b & 0 &   \cline{1-2}
                  b & 0 &
        """
        for j in range(ilevels):
            if row[j].strip():
                nrow = 1
                for r in rows[i + 1:]:
                    if not r[j].strip():
                        nrow += 1
                    else:
                        break
                if nrow > 1:
                    # overwrite non-multirow entry
                    row[j] = '\\multirow{{{nrow:d}}}{{*}}{{{row:s}}}'.format(
                        nrow=nrow, row=row[j].strip())
                    # save when to end the current block with \cline
                    self.clinebuf.append([i + nrow - 1, j + 1])
        return row

    def _print_cline(self, buf, i, icol):
        """
        Print clines after multirow-blocks are finished
        """
        for cl in self.clinebuf:
            if cl[0] == i:
                buf.write('\\cline{{{cl:d}-{icol:d}}}\n'
                          .format(cl=cl[1], icol=icol))
        # remove entries that have been written to buffer
        self.clinebuf = [x for x in self.clinebuf if x[0] != i]


text:
      <?php
      use ScientiaMobile\WurflCloud\Config;
      use ScientiaMobile\WurflCloud\Cache\Null;
      use ScientiaMobile\WurflCloud\Cache\Cookie;
      use ScientiaMobile\WurflCloud\Client;
      require_once 'application/libraries/wurfl/src/autoload.php';
      try {
      	// Create a WURFL Cloud Config
      	$config = new Config();
      	// Set your API Key here
      	$config->api_key = '218222:AS5ztPSQfG0G6DB80WEvzO5CIaNoQCOV';
      	// Create a WURFL Cloud Client
      	$client = new Client($config, new Null());
      	// Detect the visitor's device
      	$client->detectDevice();
      	// Show all the capabilities returned by the WURFL Cloud Service
      	foreach ($client->capabilities as $name => $value) {
      		echo "$name: ".(is_bool($value)? var_export($value, true): $value) ."
";
      	}
      } catch (Exception $e) {
      	// Show any errors
      	echo "Error: ".$e->getMessage();
      }
      ?>
       powered by Joanal © 2016


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>scripts</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

Module scripts

Functions

    add_ghc_scope
    gen_conll_file_hc
    gen_conll_file_scope
    postprocess_scope_learning_results

[hide private]


text:
namespace armnn
{

arm_compute::Status NeonStridedSliceWorkloadValidate(const TensorInfo& input,
                                                     const TensorInfo& output,
                                                     const StridedSliceDescriptor& descriptor);

class NeonStridedSliceWorkload : public NeonBaseWorkload<StridedSliceQueueDescriptor>
{
public:
    NeonStridedSliceWorkload(const StridedSliceQueueDescriptor& descriptor, const WorkloadInfo& info);
    virtual void Execute() const override;

private:
    mutable std::unique_ptr<arm_compute::NEStridedSlice> m_Layer;
};

} //namespace armnn


text:
<?php
// When reloading using AJAX make sure
// sessions and functions are valid
if (!isset($_SESSION))
{
	session_name("lassist");
	session_start();

	require_once('../data/functions.php');
}

$result = $mysqli->query("SELECT * FROM notify WHERE n_Id='$_GET[n_Id]' ");
$row = $result->fetch_array();

?>
	Active: <?php
		if ($row['active']=='y')
			echo "Active";
		else
			echo "In-Active"; ?>
	Type: <?php
		switch ($row['type'])
		{
			case 0:
				echo "Mandatory";
				break;
			case 1:
				echo "Optional";
				break;
			case 2:
				echo "Selective";
				break;
			default:
				echo "Unknown Type";
				break;
		} ?>
	Message:	<?php echo $row['message']; ?>

	<button class="buttons" onclick="clearDiv('#viewNotify')" > Close </button>
<?php
$mysqli->close();
?>


text:
<?php
/**
 * @author Noah Goodrich
 * @date 10/13/11
 * @brief
 *
 */
 ?>

Criteria Examples

Total Students: <?= count($this->totalStudents)?>

Students with no address: <?= count($this->noAddresses)?>

Query Examples

MySQL Examples

Active Teachers: <?= count($this->withCourse) ?>

Active Teachers without an E in their last name: <?= count($this->noE) ?>

Inactive Teachers: <?= count($this->withoutCourse) ?>


text:
"""
Python implementation of the Gradient Frequency Neural Network model proposed by

Edward W. Large, Felix V. Almonte, and Marc J. Velasco.
A canonical model for gradient frequency neural networks.
Physica D: Nonlinear Phenomena, 239(12):905-911, 2010.

"""

__version_info__ = ('0', '1', '0')
__version__ = '.'.join(__version_info__)

import logging
pygrfnn_logger = logging.getLogger('pygrfnn')
pygrfnn_logger.addHandler(logging.NullHandler())

from grfnn import GrFNN
from oscillator import Zparam
from network import Model, make_connections

# from oscillator import *
# from grfnn import *
# from network import *
# from defines import *
# from utils import *
# from vis import *
# from moviegen import *


text:
    </div> <!-- /container -->

<!-- Placed at the end of the document so the pages load faster -->
    <script src="<?= base_url();?>assets/js/jquery-1.11.3.min"></script>
    <script src="<?= base_url();?>assets/js/bootstrap.min.js"></script>
    <script src="<?= base_url();?>assets/js/validaciones.js"></script>
  </body>
</html>


text:
namespace Chalmers.ILL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class AddPatronAffiliation : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.OrderItemModels", "PatronAffiliation", c => c.String());
        }

        public override void Down()
        {
            DropColumn("dbo.OrderItemModels", "PatronAffiliation");
        }
    }
}


text:
<?php
namespace ReactiveRoom\Terminal;

use ReactiveRoom\Hardware\HardwareModel;
use ReactiveRoom\Software\SoftwareModel;
use ReactiveRoom\Network\NetworkModel;

class TerminalModel
{
    private $id;
    private $created;
    private $updated;
    private $name;
    private $ipAddress;
    private $hardware = array();
    private $software = array();
    private $networkId;
    private $network;

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setCreated($created)
    {
        $this->created = $created;
    }

    public function getCreated()
    {
        return $this->created;
    }

    public function setUpdated($updated)
    {
        $this->updated = $updated;
    }

    public function getUpdated()
    {
        return $this->updated;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setIpAddress($ipAddress)
    {
        $this->ipAddress = $ipAddress;
    }

    public function getIpAddress()
    {
        return $this->ipAddress;
    }

    public function addHardware(HardwareModel $hardware)
    {
        $this->hardware[] = $hardware;
    }

    public function getHardware()
    {
        return $this->hardware;
    }

    public function addSoftware(SoftwareModel $software)
    {
        $this->software[] = $software;
    }

    public function getSoftware()
    {
        return $this->software;
    }

    public function setNetworkId($networkId)
    {
        $this->networkId = $networkId;
    }

    public function getNetworkId()
    {
        return $this->networkId;
    }

    public function setNetwork(NetworkModel $network)
    {
        $this->network = $network;
        $this->setNetworkId($network->getId());
    }

    public function getNetwork()
    {
        return $this->network;
    }
}


text:
This julia package accompanies the paper "The Alternating Descent Conditional Gradient Method for Sparse Inverse Problems",
which should be available on the arxiv.
A [copy](paper.pdf) of the paper is included in this repository.

Install with `Pkg.clone("git@github.com:nboyd/SparseInverseProblems.jl.git")`.

In the directory ~/.julia/v0.4/SparseInverseProblems/examples you will find three
simple [examples](examples/README.md).


text:
<resources>
  <style name="FBReader.Activity" parent="android:Theme">
  </style>
  <style name="FBReader.Activity.NoActionBar" parent="android:Theme">
  </style>
  <style name="FBReader.Dialog" parent="android:Theme.Dialog">
	</style>
	<color name="transparent">#00000000</color>
  <style name="FBReader.Transparent" parent="android:Theme.Translucent.NoTitleBar">
    <item name="android:windowBackground">@color/transparent</item>
  </style>
</resources>


text:
using System;
using System.Security.Permissions;
using System.Text;

namespace OpenQA.Selenium.IE
{
    /// <summary>
    /// Wrapper class for Strings
    /// </summary>
    [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
    internal class StringWrapper : IDisposable
    {
        private SafeStringWrapperHandle handle;

        /// <summary>
        /// Initializes a new instance of the StringWrapper class
        /// </summary>
        /// <param name="stringHandle">Instance of the <see cref="SafeStringWrapperHandle"/></param>
        internal StringWrapper(SafeStringWrapperHandle stringHandle)
        {
            handle = stringHandle;
        }

        /// <summary>
        /// Gets the value the value of the string from the native driver
        /// </summary>
        public string Value
        {
            get
            {
                string returnValue = null;
                if (!handle.IsInvalid)
                {
                    int length = Length;
                    StringBuilder result = new StringBuilder(length);
                    if (NativeDriverLibrary.Instance.CopyString(handle, length, result) != WebDriverResult.Success)
                    {
                        Dispose();
                        throw new WebDriverException("Cannot copy string from native data to .NET string");
                    }

                    returnValue = result.ToString();
                }

                return returnValue;
            }
        }

        private int Length
        {
            get
            {
                int length = 0;
                if (!handle.IsInvalid)
                {
                    if (NativeDriverLibrary.Instance.StringLength(handle, ref length) != WebDriverResult.Success)
                    {
                        Dispose();
                        throw new WebDriverException("Cannot determine length of string");
                    }
                }

                return length;
            }
        }

        #region IDisposable Members

        /// <summary>
        /// Disposes of the objects
        /// </summary>
        public void Dispose()
        {
            handle.Dispose();
            GC.SuppressFinalize(this);
        }

        #endregion
    }
}


text:
class DataSource;

namespace search
{
class CitiesBoundariesTable
{
  friend void GetCityBoundariesInRectForTesting(CitiesBoundariesTable const &,
                                                m2::RectD const & rect,
                                                std::vector<uint32_t> & featureIds);

public:
  class Boundaries
  {
  public:
    Boundaries() = default;

    Boundaries(std::vector<indexer::CityBoundary> const & boundaries, double eps)
      : m_boundaries(boundaries), m_eps(eps)
    {
    }

    Boundaries(std::vector<indexer::CityBoundary> && boundaries, double eps)
      : m_boundaries(std::move(boundaries)), m_eps(eps)
    {
    }

    // Returns true iff |p| is inside any of the regions bounded by
    // |*this|.
    bool HasPoint(m2::PointD const & p) const;

    m2::RectD GetLimitRect() const
    {
      m2::RectD rect;
      for (auto const & boundary : m_boundaries)
      {
        rect.Add(boundary.m_bbox.Min());
        rect.Add(boundary.m_bbox.Max());
      }
      return rect;
    }

    std::vector<indexer::CityBoundary> const & GetBoundariesForTesting() const { return m_boundaries; }

    friend std::string DebugPrint(Boundaries const & boundaries)
    {
      std::ostringstream os;
      os << "Boundaries [";
      os << ::DebugPrint(boundaries.m_boundaries) << ", ";
      os << "eps: " << boundaries.m_eps;
      os << "]";
      return os.str();
    }

  private:
    std::vector<indexer::CityBoundary> m_boundaries;
    double m_eps = 0.0;
  };

  explicit CitiesBoundariesTable(DataSource const & dataSource) : m_dataSource(dataSource) {}

  bool Load();

  bool Has(FeatureID const & fid) const { return fid.m_mwmId == m_mwmId && Has(fid.m_index); }
  bool Has(uint32_t fid) const { return m_table.find(fid) != m_table.end(); }

  bool Get(FeatureID const & fid, Boundaries & bs) const;
  bool Get(uint32_t fid, Boundaries & bs) const;

  size_t GetSize() const { return m_table.size(); }

private:
  DataSource const & m_dataSource;
  MwmSet::MwmId m_mwmId;
  std::unordered_map<uint32_t, std::vector<indexer::CityBoundary>> m_table;
  double m_eps = 0.0;
};

/// \brief Fills |featureIds| with feature ids of city boundaries if bounding rect of
/// the city boundary crosses |rect|.
/// \note This method is inefficient and is written for debug and test purposes only.
void GetCityBoundariesInRectForTesting(CitiesBoundariesTable const &, m2::RectD const & rect,
                                       std::vector<uint32_t> & featureIds);
}  // namespace search


text:
(function () {

	var lang = YAHOO.lang, Event = YAHOO.util.Event, Dom = YAHOO.util.Dom;

	/**
	 * Create a radio button. Here are the added options :
	 *

	 *
choices: list of choices (array of string)

	 *
values: list of returned values (array )

	 *
allowAny: add an option with a string field

	 *

	 * @class inputEx.RadioField
	 * @extends inputEx.Field
	 * @constructor
	 * @param {Object} options inputEx.Field options object
	 */
	inputEx.RadioField = function (options) {

		inputEx.RadioField.superclass.constructor.call(this,options);

		// IE BUG: doesn't want to set the value if the node is not in the DOM
		if (YAHOO.env.ua.ie && !lang.isUndefined(this.options.value)) {
			// Set the initial value, use setTimeout to escape the stack (for nested usage in Group or Form)
			var that = this;
			setTimeout(function () {
				that.setValue(that.options.value, false);
			},0);
		}

	};

	lang.extend(inputEx.RadioField, inputEx.Field, {

		/**
		 * Adds the Radio button specific options
		 * @param {Object} options Options object as passed to the constructor
		 */
		setOptions: function (options) {

			var i, length;

			inputEx.RadioField.superclass.setOptions.call(this, options);

			// Display mode
			this.options.display = options.display === "vertically" ? "vertically" : "inline"; // default "inline"

			// Classname
			this.options.className = options.className ? options.className : 'inputEx-Field inputEx-RadioField';
			if (this.options.display === "vertically") {
				this.options.className +=  ' inputEx-RadioField-Vertically';
			}

			// Choices creation

			// Retro-compatibility with old pattern (DEPRECATED since 2010-06-30)
			if (lang.isArray(options.values)) {

				this.options.choices = [];

				for (i = 0, length = options.values.length; i < length; i += 1) {
					this.options.choices.push({ value: options.values[i], label: options.choices[i] });
				}

			// New pattern to define choices
			} else {

				this.options.choices = options.choices; // ['val1','val2'] or [{ value: 'val1', label: '1st Choice' }, etc.]

			}

			if (lang.isUndefined(options.allowAny) || options.allowAny === false ) {
				this.options.allowAny = false;
			} else {
				this.options.allowAny = {};
				if (lang.isArray(options.allowAny.separators)) { this.options.allowAny.separators = options.allowAny.separators;}
				this.options.allowAny.validator = lang.isFunction(options.allowAny.validator) ? options.allowAny.validator : function (val) {return true;};
				this.options.allowAny.value = !lang.isUndefined(options.allowAny.value) ? options.allowAny.value : "";
				this.options.allowAny.field = lang.isUndefined(options.allowAny.field) ? { type: "string", value: this.options.allowAny.value } : options.allowAny.field;
			}

		},

		/**
		 * Render the checkbox and the hidden field
		 */
		renderComponent: function () {

			var choices, length, i, sep;

			this.choicesList = [];

			choices = this.options.choices;

			for (i = 0, length = choices.length ; i < length ; i += 1 ) {

				this.addChoice(choices[i]);

			}

			// Build a "any" radio combined with a StringField
			if (this.options.allowAny) {

				this.allowAnyChoice = this.addChoice({ value: this.options.allowAny.value, label:'' });

				this.radioAny = this.allowAnyChoice.node.firstChild;

				this.anyField = new inputEx(this.options.allowAny.field);
				this.anyField.disable();

				Dom.setStyle(this.radioAny, "float","left");
				Dom.setStyle(this.anyField.getEl(), "float","left");

				// Hack for firefox 3.5+
				if (YAHOO.env.ua.gecko >= 1.91) { Dom.setStyle(this.radioAny, "marginTop","0.2em"); }

				if (this.options.allowAny.separators) {
					sep = inputEx.cn("div",null,{marginRight:"3px"},this.options.allowAny.separators[0] || '');
					Dom.setStyle(sep, "float","left");
					this.allowAnyChoice.node.appendChild(sep);
				}

				this.allowAnyChoice.node.appendChild(this.anyField.getEl());

				if (this.options.allowAny.separators) {
					sep = inputEx.cn("div",null,{marginLeft:"3px"},this.options.allowAny.separators[1] || '');
					Dom.setStyle(sep, "float","left");
					this.allowAnyChoice.node.appendChild(sep);
				}

			}

		},

		/**
		 * Listen for change events on all radios
		 */
		initEvents: function () {

			// Delegate event listening because list of choices is dynamic
			// so we can't listen on each <input type="radio" class='inputEx-RadioField-radio' />

			// Change event (IE does not fire "change" event, so listen to click instead)
			Event.delegate(this.fieldContainer, YAHOO.env.ua.ie ? "click" : "change", function(e, matchedEl, container) {
				this.onChange(e);
			}, "input.inputEx-RadioField-radio", this, true);

			// Focus / Blur events
			Event.delegate(this.fieldContainer, "focusin", function(e, matchedEl, container) {
				this.onFocus(e);
			}, "input.inputEx-RadioField-radio", this, true);

			Event.delegate(this.fieldContainer, "focusout", function(e, matchedEl, container) {
				this.onBlur(e);
			}, "input.inputEx-RadioField-radio", this, true);

			// AnyField events
			if (this.allowAnyChoice) {

				this.anyField.updatedEvt.subscribe(function (e, params) {

					var value = params[0];
					this.radioAny.value = value;

					this.setClassFromState();

					inputEx.RadioField.superclass.onChange.call(this,e);

				}, this, true);

				// Update radio field style after editing anyField content !
				Event.addBlurListener(this.anyField.el, this.onBlur, this, true);
			}
		},

		/**
		 * Add an additional class to the currently selected inputEx-RadioField-choice
		 */
		setSelectedClass: function () {

			var i, length;

			for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {

				if (this.choicesList[i].node.firstChild.checked) {
					Dom.addClass(this.choicesList[i].node,"inputEx-selected");
				} else {
					Dom.removeClass(this.choicesList[i].node,"inputEx-selected");
				}

			}
		},

		setClassFromState: function () {

			// call superclass method (will fire updatedEvt)
			inputEx.RadioField.superclass.setClassFromState.call(this);

			this.setSelectedClass();

		},

		/**
		 * Function called when the checkbox is toggled
		 * @param {Event} e The original 'change' event
		 */
		onChange: function (e) {

			var target = Event.getTarget(e);

			// Enable/disable the "any" field
			if (this.allowAnyChoice) {

				// if clicked another choice than allowAnyChoice
				if (inputEx.indexOf(target, this.choicesList, function(el,arrEl) { return el === arrEl.node.firstChild; }) !== -1 && this.radioAny !== target) {
					this.anyField.disable();
				} else {
					this.anyField.enable();
					lang.later( 50 , this.anyField , "focus");
				}

			}

			this.setSelectedClass();

			// call superclass method (will fire updatedEvt)
			inputEx.RadioField.superclass.onChange.call(this,e);
		},

		/**
		 * Get the field value
		 * @return {Any}
		 */
		getValue: function () {

			var i, length;

			for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {

				if (this.choicesList[i].node.firstChild.checked) {

					if (this.radioAny && this.radioAny == this.choicesList[i].node.firstChild) {
						return this.anyField.getValue();
					}

					return this.choicesList[i].value;
				}
			}

			return "";
		},

		/**
		 * Set the value of the Radio
		 * @param {Any} value The value schould be one of this.options.values (which defaults to this.options.choices if missing) if allowAny option not true.
		 * @param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event)
		 */
		setValue: function (value, sendUpdatedEvt) {

			var checkAny = true, i, length;

			for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {

				if (value === this.choicesList[i].value) {

					this.choicesList[i].node.firstChild.checked = true;
					checkAny = false;

				} else {
					this.choicesList[i].node.firstChild.checked = false;
				}

			}

			// Option allowAny
			if (this.radioAny) {

				if (checkAny) {
					this.radioAny.checked = true;
					this.radioAny.value = value;
					this.anyField.enable();
					this.anyField.setValue(value, false);
				} else {
					this.anyField.disable();
				}
			}

			// call parent class method to set style and fire updatedEvt
			inputEx.RadioField.superclass.setValue.call(this, value, sendUpdatedEvt);
		},

		/**
		 * Clear the field by setting the field value to this.options.value
		 * @param {boolean} [sendUpdatedEvt] (optional) Wether this clear should fire the updatedEvt or not (default is true, pass false to NOT send the event)
		 */
		clear: function (sendUpdatedEvt) {

			if (this.radioAny){
				this.anyField.setValue(this.options.allowAny.value, false);
			}

			inputEx.RadioField.superclass.clear.call(this, sendUpdatedEvt);
		},

		/**
		 * Should return true if empty
		 */
		isEmpty: function () {

			var i, length, radioInput;

			for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {

				radioInput = this.choicesList[i].node.firstChild;

				if (radioInput.checked) {

					// if "any" option checked
					if (this.radioAny && this.radioAny == radioInput) {

						return this.anyField.getValue() === '';

					} else {

						return false;

					}
				}
			}

			return true;

		},

		validate: function () {

			var i, length, radioInput, anyVal;

			if (this.options.allowAny) {

				for (i = 0, length = this.choicesList.length ; i < length ; i += 1) {

					radioInput = this.choicesList[i].node.firstChild;

					if (radioInput.checked) {

						// if "any" option checked
						if (this.radioAny && this.radioAny == radioInput) {
							anyVal = this.anyField.getValue();
							return this.anyField.validate() && this.options.allowAny.validator(anyVal);
						}
					}
				}
			}

			return true;
		},

		/**
		 * Disable the field
		 */
		disable: function () {

			var i, length;

			for (i = 0, length = this.choicesList.length; i < length; i += 1) {
				this.disableChoice(this.choicesList[i], false);
			}

		},

		/**
		 * Enable the field
		 */
		enable: function () {

			var i, length;

			for (i = 0, length = this.choicesList.length; i < length; i += 1) {
				this.enableChoice(this.choicesList[i]);
			}

		},

		createChoiceNode: function (choice) {

			var div, radioId, radioNode, labelNode;

			div = inputEx.cn('div', {className: 'inputEx-RadioField-choice'});

			// radioId MUST be different for each option, to allow click on label (with for:id trick)
			radioId = YAHOO.util.Dom.generateId();

			radioNode = inputEx.cn('input', { id: radioId, type: 'radio', name: this.options.name, value: choice.value, className: 'inputEx-RadioField-radio' });
			div.appendChild(radioNode);

			if (choice.label.length > 0) {
				labelNode = inputEx.cn('label', {"for": radioId, className: 'inputEx-RadioField-rightLabel'}, null, ""+choice.label);
				div.appendChild(labelNode);
			}

			return div;

		},

		removeChoiceNode: function (node) {

			// remove from selector
			//
			//   -> style.display = 'none' would work only on FF (when node is an <option>)
			//   -> other browsers (IE, Chrome...) require to remove <option> node from DOM
			//
			this.fieldContainer.removeChild(node);

		},

		disableChoiceNode: function (node) {

			//node.firstChild.disabled = "disabled";
			node.firstChild.disabled = true;
		},

		enableChoiceNode: function (node) {

			//node.firstChild.removeAttribute("disabled");
			node.firstChild.disabled = false;

		},

		/**
		 * Attach an <option> node to the <select> at the specified position
		 * @param {HTMLElement} node The <option> node to attach to the <select>
		 * @param {Int} position The position of the choice in choicesList (may not be the "real" position in DOM)
		 */
		appendChoiceNode: function (node, position) {

			var domPosition, i;

			// Compute real DOM position (since previous choices in choicesList may be hidden)
			domPosition = 0;

			for (i = 0; i < position; i += 1) {

				if (this.choicesList[i].visible) {

					domPosition += 1;

				}

			}

			// Insert in DOM
			if (domPosition < this.fieldContainer.childNodes.length) {

				YAHOO.util.Dom.insertBefore(node, this.fieldContainer.childNodes[domPosition]);

			} else {

				this.fieldContainer.appendChild(node);

			}
		}

	});

	// Augment prototype with choice mixin (functions : addChoice, removeChoice, etc.)
	lang.augmentObject(inputEx.RadioField.prototype, inputEx.mixin.choice);

	// Register this class as "radio" type
	inputEx.registerType("radio", inputEx.RadioField, [
		{
			type: 'list',
			name: 'choices',
			label: 'Choices',
			elementType: {
				type: 'group',
				fields: [
					{ label: 'Value', name: 'value', value: '' }, // not required to allow '' value (which is default)
					{ label: 'Label', name: 'label' } // optional : if left empty, label is not created
				]
			},
			value: [],
			required: true
		},
		{type: 'boolean', label: 'Allow custom value', name: 'allowAny', value: false  }
	]);

})();


text:
static int lcdHandle;
// ---

namespace Button {
	namespace Data {
		struct ButtonData {
			bool pressed = false;
			bool dampSound = false;
			float soundVolume = 100;

			sf::Sound sound;
		};

		ButtonData C;
		ButtonData CS;
		ButtonData D;
		ButtonData DS;
		ButtonData E;
		ButtonData F;
		ButtonData FS;
		ButtonData G;
		ButtonData GS;
		ButtonData A;
		ButtonData AS;
		ButtonData B;
		ButtonData C_High;

		bool instrumentChangePressed = false;
		bool octaveChangePressed = false;
	}

	// GPIO pin number mappings
	enum {
		C = 5,
		CS = 6,
		D = 13,
		DS = 21,
		E = 20,
		F = 16,
		FS = 12,
		G = 25,
		GS = 24,
		A = 23,
		AS = 18,
		B = 27,
		C_High = 22,
		InstrumentChange = 17,
		OctaveChange = 4
	};
}

enum Instrument {
	Piano,
	Guitar,
	Trumpet
} currentInstrument;

enum Octave {
	Low,
	Medium,
	High
} currentOctave;

void initialization(void);
void pinInitialization(void);
void soundInitialization(void);

void readNoteButtonInput(int pin, Button::Data::ButtonData & data);
void instrumentChange(Instrument & currentInstrument);
void octaveChange(Octave & currentOctave);
void soundChange(Instrument currentInstrument, Octave currentOctave);
void displayChange(Instrument currentInstrument, Octave currentOctave);

namespace SoundBuffer {
	const float dampingConstant = 0.0018;

	namespace Piano {
		namespace High {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Medium {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Low {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}
	}

	namespace Guitar {
		namespace High {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Medium {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Low {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}
	}

	namespace Trumpet {
		namespace High {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Medium {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}

		namespace Low {
			sf::SoundBuffer C;
			sf::SoundBuffer CS;
			sf::SoundBuffer D;
			sf::SoundBuffer DS;
			sf::SoundBuffer E;
			sf::SoundBuffer F;
			sf::SoundBuffer FS;
			sf::SoundBuffer G;
			sf::SoundBuffer GS;
			sf::SoundBuffer A;
			sf::SoundBuffer AS;
			sf::SoundBuffer B;
			sf::SoundBuffer C_High;
		}
	}
}

#endif


text:
import { Component, Input } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ControlPointService } from '../../../controlPoint/controlPoint.service';
import { ShiftService } from '../../../shift/shift.service';
import { ShiftTypeService } from '../../../shiftType/shiftType.service';

@Component({
    selector: 'plan-form-top',
    templateUrl: './planFormTop.html',
    providers: [
        ControlPointService,
        ShiftService,
        ShiftTypeService
    ]
})

export class PlanFormTop {
    @Input('formGroup')
    public formGroup: FormGroup;

    controlPoints: any[];
    shifts: any[];
    shiftTypes: any[];

    constructor(private controlPointService: ControlPointService,
        private shiftService: ShiftService,
        private shiftTypeService: ShiftTypeService) { }

    getControlPoints(): void {
        this.controlPointService.getCombo().subscribe(controlPoints => {
            this.controlPoints = controlPoints;
        });
    }

    getShifts(): void {
        this.shiftService.getAll().subscribe(shifts => {
            this.shifts = shifts;
        });
    }
    getShiftTypes(): void {
        this.shiftTypeService.getAll().subscribe(shiftTypes => {
            this.shiftTypes = shiftTypes;
        });
    }
    ngOnInit(): void {
        this.getControlPoints();
        this.getShifts();
        this.getShiftTypes();
    }

    /*================== Control Point Filter ===================*/
    filteredControlPoints: any[];
    controlPoint: any;

    filterControlPoints(event) {
        let query = event.query.toLowerCase();
        this.filteredControlPoints = [];
        for (let i = 0; i < this.controlPoints.length; i++) {
            let controlPoint = this.controlPoints[i];
            if (controlPoint.code.toLowerCase().indexOf(query) == 0 || controlPoint.name.toLowerCase().indexOf(query) == 0) {
                this.filteredControlPoints.push(controlPoint);
            }
        }
    }

    handleControlPointDropdownClick() {
        this.filteredControlPoints = [];
        //mimic remote call
        setTimeout(() => {
            this.filteredControlPoints = this.controlPoints;
        }, 100)
    }

    onControlPointSelect(event: any) {
        let controlPoint = this.formGroup.value.controlPoint;
        if (controlPoint != null && controlPoint != undefined) {
            let display = controlPoint.code != null && controlPoint.code != undefined ? controlPoint.code + ' : ' : '';
            display += controlPoint.name != null && controlPoint.name != undefined ? controlPoint.name : '';
            this.formGroup.value.controlPoint.display = display;
        }
    }
    /*================== End Of Control Point Filter ===================*/
    /*================== Shift Filter ===================*/
    filteredShifts: any[];
    Shift: any;

    filterShifts(event) {
        let query = event.query.toLowerCase();
        this.filteredShifts = [];
        for (let i = 0; i < this.shifts.length; i++) {
            let Shift = this.shifts[i];
            if (Shift.code.toLowerCase().indexOf(query) == 0 || Shift.name.toLowerCase().indexOf(query) == 0) {
                this.filteredShifts.push(Shift);
            }
        }
    }

    handleShiftDropdownClick() {
        this.filteredShifts = [];
        //mimic remote call
        setTimeout(() => {
            this.filteredShifts = this.shifts;
        }, 100)
    }

    onShiftSelect(event: any) {
        let shift = this.formGroup.value.shift;
        if (shift != null && shift != undefined) {
            let display = shift.code != null && shift.code != undefined ? shift.code + ' : ' : '';
            display += shift.name != null && shift.name != undefined ? shift.name : '';
            this.formGroup.value.shift.display = display;
        }
    }
    /*================== End Of Shift Filter ===================*/
    /*================== Shift Type Filter ===================*/
    filteredShiftTypes: any[];
    shiftType: any;

    filterShiftTypes(event) {
        let query = event.query.toLowerCase();
        this.filteredShiftTypes = [];
        for (let i = 0; i < this.shiftTypes.length; i++) {
            let shiftType = this.shiftTypes[i];
            if (shiftType.code.toLowerCase().indexOf(query) == 0 || shiftType.name.toLowerCase().indexOf(query) == 0) {
                this.filteredShiftTypes.push(shiftType);
            }
        }
    }

    handleShiftTypeDropdownClick() {
        this.filteredShiftTypes = [];
        //mimic remote call
        setTimeout(() => {
            this.filteredShiftTypes = this.shiftTypes;
        }, 100)
    }

    onShiftTypeSelect(event: any) {
        let shiftType = this.formGroup.value.shiftType;
        if (shiftType != null && shiftType != undefined) {
            let display = shiftType.code != null && shiftType.code != undefined ? shiftType.code + ' : ' : '';
            display += shiftType.name != null && shiftType.name != undefined ? shiftType.name : '';
            this.formGroup.value.shiftType.display = display;
        }
    }
    /*================== End Of Shift Type Filter ===================*/
}


text:
<?php

// - Edit Variables -
$auth_token = '';
$sub_domain = '';

// - Don't Edit Below -
$base_url = "https://$sub_domain.instructure.com/api/v1/accounts/self/users";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' .$auth_token));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    // - Edit Params -
    'user[name]' => 'Test User',
    'user[short_name]' => 'test_user',
    'pseudonym[unique_id]' => '1122',
));
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch);
$curlData = curl_exec($ch);
curl_close($ch);

?>


text:
<resources>
    <string name="app_name">易购商城</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="home">主页</string>
    <string name="hot">热卖</string>
    <string name="catagory">分类</string>
    <string name="cart">购物车</string>
    <string name="mine">我的</string>
    <string name="buy">立即购买</string>
    <string name="total">合计:</string>
    <string name="settlement">去结算</string>
    <string name="delete">删除</string>
    <string name="edit">编辑</string>
    <string name="select_all">全选</string>
    <string name="complete">完成</string>
    <string name="addToCart">已添加到购物车</string>
    <string name="warelist">商品列表</string>
    <string name="order_default">默认</string>
    <string name="order_price">价格</string>
    <string name="order_sales">销量</string>
    <string name="detail">商品详情</string>
    <string name="share">分享</string>
    <string name="phone_hint">请输入手机号码</string>
    <string name="passwd_hint">请输入登陆密码</string>
    <string name="login">登录</string>
    <string name="register">立即注册</string>
    <string name="forget_pass">忘记密码?</string>
    <string name="token_error">授权已过期,请重新登录</string>
    <string name="touch_login">点击登录</string>
    <string name="myOrder">我的订单</string>
    <string name="logout">退出登录</string>
    <string name="collect">我的收藏</string>
    <string name="address">收货地址</string>
    <string name="logistics">物流动态</string>

</resources>


text:
name: Bug report
about: Report a bug to improve the project
title: ''
labels: ''
assignees: ''

---

<!-- READ: Issues are used to receive focused bug reports from users and to track planned future enhancements by the authors. Topics like support, debugging help, advice, and operation are out of scope and should not use issues-->

**Description**

A clear and concise description of what the bug is.

**Steps to Reproduce**

Provide clear steps to reproduce the bug.

- [ ] Relevant error messages if appropriate (concise, not a dump of everything).

**Expected behavior**

A clear and concise description of what you expected to happen.

**Environment**

* OS: fedora-coreos, flatcar-linux (include release version)
* Release: Matchbox version or Git SHA (reporting latest is **not** helpful)

**Possible Solution**

<!-- Most bug reports should have some inkling about solutions. Otherwise, your report may be less of a bug and more of a support request (see top).-->

Link to a PR or description.


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.gbif</groupId>
    <artifactId>motherpom</artifactId>
    <version>37</version>
  </parent>

  <artifactId>portal-web</artifactId>
  <version>0.59-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>GBIF Portal</name>
  <description>The new, integrated GBIF Portal</description>
  <url>http://github.org/gbif/portal-web</url>

  <scm>
    <connection>scm:git:git@github.com:gbif/portal-web.git</connection>
    <url>https://github.com/gbif/portal-web</url>
    <developerConnection>scm:git:git@github.com:gbif/portal-web.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <!-- used for packaging and deploying only.
    We have used a system var localhost configuration for the failsafe and jetty plugin -->
    <jetty.port>8080</jetty.port>
    <servername>http://localhost:8080</servername>
    <!-- configure struts tags to include the servlet context by default -->
    <url.includeContext>true</url.includeContext>
    <!-- gbif proxy auth application key. Make sure the matching secret uses the same -->
    <portal.application.key>gbif.portal</portal.application.key>

    <!-- this looks silly, but we're not aware of a way to negate a variable, so we keep them separate to be used in struts config files -->
    <devMode>true</devMode>
    <notDevMode>false</notDevMode>
    <google.analytics />
    <occurrence.download.size.limit>-1</occurrence.download.size.limit>
    <occurrence.search.maxoffset>10000</occurrence.search.maxoffset>
    <occurrence.facets.enable>true</occurrence.facets.enable>
    <skipJetty>false</skipJetty>

    <!-- dependency versions -->
    <bval.version>0.5</bval.version>
    <checklistbank-ws-client.version>2.50</checklistbank-ws-client.version>
    <commons-beanutils.version>1.9.2</commons-beanutils.version>
    <commons-io.version>2.4</commons-io.version>
    <commons-lang3.version>3.4</commons-lang3.version>
    <download-query-tools.version>1.17</download-query-tools.version>
    <drupal-mybatis.version>0.19</drupal-mybatis.version>
    <dwc-api.version>1.16</dwc-api.version>
    <findbugs-jsr305.version>3.0.1</findbugs-jsr305.version>
    <freemarker.version>2.3.25-incubating</freemarker.version>
    <gbif-api.version>0.52</gbif-api.version>
    <gbif-common-ws.version>0.38</gbif-common-ws.version>
    <gbif-common.version>0.32</gbif-common.version>
    <guava.version>18.0</guava.version>
    <guice.version>4.0</guice.version>
    <httpclient.version>4.3.6</httpclient.version>
    <javax-validation-api.version>1.1.0.Final</javax-validation-api.version>
    <jersey.version>1.18.3</jersey.version>
    <jsp.version>2.2</jsp.version>
    <junit.version>4.12</junit.version>
    <lesscss-maven-plugin.version>1.3.3</lesscss-maven-plugin.version>
    <logback.version>1.1.7</logback.version>
    <lucene.version>5.4.1</lucene.version>
    <metrics-ws-client.version>0.26</metrics-ws-client.version>
    <mockito.version>1.9.5</mockito.version>
    <occurrence-ws-client.version>0.61</occurrence-ws-client.version>
    <registry-ws-client.version>2.64</registry-ws-client.version>
    <selenium.version>2.50.1</selenium.version>
    <servletapi.version>3.0.1</servletapi.version>
    <slf4j.version>1.7.21</slf4j.version>
    <struts.version>2.3.32</struts.version>
    <xerces.version>2.9.1</xerces.version>
  </properties>

  <build>
    <defaultGoal>jetty:run</defaultGoal>
    <plugins>
        <plugin>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-maven-plugin</artifactId>
          <configuration>
            <webAppConfig>
              <contextPath>/</contextPath>
            </webAppConfig>
            <!-- no scan if used with JRebel -->
            <scanIntervalSeconds>0</scanIntervalSeconds>
            <stopKey>stop</stopKey>
            <stopPort>9362</stopPort>
            <systemProperties>
              <systemProperty>
                <name>servername</name>
                <value>http://localhost:${jetty.port}</value>
              </systemProperty>
            </systemProperties>
          </configuration>
          <executions>
            <execution>
              <id>start-jetty</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>start</goal>
              </goals>
              <configuration>
                <skip>${skipJetty}</skip>
                <scanIntervalSeconds>0</scanIntervalSeconds>
                <daemon>true</daemon>
              </configuration>
            </execution>
            <execution>
              <id>stop-jetty</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>stop</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <skip>${skipJetty}</skip>
            <systemProperties>
              <property>
                <name>servername</name>
                <value>http://localhost:${jetty.port}</value>
              </property>
            </systemProperties>
          </configuration>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
            <execution>
              <id>verify</id>
              <goals>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      <plugin>
          <groupId>org.lesscss</groupId>
          <artifactId>lesscss-maven-plugin</artifactId>
          <version>${lesscss-maven-plugin.version}</version>
          <configuration>
              <sourceDirectory>${project.basedir}/src/main/webapp/less</sourceDirectory>
              <outputDirectory>${project.basedir}/src/main/webapp/css</outputDirectory>
              <compress>true</compress>
              <includes>
                <include>style.less</include>
                <include>print.less</include>
                <include>google.less</include>
                <include>leaflet.ie.less</include>
                <include>leaflet.less</include>
                <include>uniform.less</include>
                <include>occ_nofacets.less</include>
              </includes>
          </configuration>
          <executions>
              <execution>
                  <goals>
                      <goal>compile</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>struts.xml</exclude>
        </excludes>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>struts.xml</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
  </build>

  <repositories>
    <repository>
      <id>gbif-all</id>
      <url>http://repository.gbif.org/content/groups/gbif</url>
    </repository>
  </repositories>

  <dependencies>
    <!-- GBIF -->
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>dwc-api</artifactId>
      <version>${dwc-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-api</artifactId>
      <version>${gbif-api.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif.checklistbank</groupId>
      <artifactId>checklistbank-ws-client</artifactId>
      <version>${checklistbank-ws-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif.registry</groupId>
      <artifactId>registry-ws-client</artifactId>
      <version>${registry-ws-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif.occurrence</groupId>
      <artifactId>occurrence-ws-client</artifactId>
      <version>${occurrence-ws-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif.metrics</groupId>
      <artifactId>metrics-ws-client</artifactId>
      <version>${metrics-ws-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif.occurrence</groupId>
      <artifactId>download-query-tools</artifactId>
      <version>${download-query-tools.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>drupal-mybatis</artifactId>
      <version>${drupal-mybatis.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-common</artifactId>
      <version>${gbif-common.version}</version>
    </dependency>
    <dependency>
      <groupId>org.gbif</groupId>
      <artifactId>gbif-common-ws</artifactId>
      <version>${gbif-common-ws.version}</version>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-api</artifactId>
      <version>${selenium.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-htmlunit-driver</artifactId>
      <version>${selenium.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Google -->
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-servlet</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-struts2</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>${findbugs-jsr305.version}</version>
    </dependency>

    <!-- Struts2 -->
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>${struts.version}</version>
      <exclusions>
        <exclusion>
          <groupId>javassist</groupId>
          <artifactId>javassist</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.apache.struts.xwork</groupId>
      <artifactId>xwork-core</artifactId>
      <version>${struts.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-junit-plugin</artifactId>
      <version>${struts.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!--
     This plugin provides a faster Java implementation of tags in the "simple" theme then the default one
     http://struts.apache.org/2.x/docs/javatemplates-plugin.html
    -->
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-javatemplates-plugin</artifactId>
      <version>${struts.version}</version>
      <scope>runtime</scope>
    </dependency>

    <!-- View Engines, Servlet & other web things-->
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-sitemesh-plugin</artifactId>
      <version>${struts.version}</version>
    </dependency>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>${freemarker.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>${servletapi.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- For webservice guice modules -->
    <dependency>
      <groupId>com.sun.jersey.contribs</groupId>
      <artifactId>jersey-apache-client4</artifactId>
      <version>${jersey.version}</version>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-logging</artifactId>
          <groupId>commons-logging</groupId>
        </exclusion>
        <!-- excluding it as it causes conflicts with the latest httpclient version -->
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
      <version>${jersey.version}</version>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-server</artifactId>
      <version>${jersey.version}</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>${logback.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Commons logging bridge for Struts2 & Selenium -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- To ship JUL (e.g. Guice) logging to SLF4J -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
    </dependency>
    <!-- Test -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>${jsp.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- BVal validation framework - bval/guice plugin -->
    <dependency>
      <groupId>org.apache.bval</groupId>
      <artifactId>bval-guice</artifactId>
      <version>${bval.version}</version>
    </dependency>
    <!-- validation -->
    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>${javax-validation-api.version}</version>
    </dependency>

    <!-- Other commons projects -->
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <version>${commons-beanutils.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-core</artifactId>
      <version>${lucene.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-analyzers-common</artifactId>
      <version>${lucene.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpclient.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang3.version}</version>
    </dependency>
  </dependencies>

  <profiles>
    <!--
     Profile to activate during releases like this:
     mvn -P uat,secrets-uat,release -Darguments="-DskipTests" release:prepare
    -->
    <profile>
      <id>release</id>
      <properties>
        <skipJetty>true</skipJetty>
      </properties>
    </profile>

  </profiles>

</project>


text:
package com.twosigma.beaker.chart.xychart.plotitem;

import com.twosigma.beaker.chart.Color;
import java.util.List;

public class Points extends XYGraphics {

  private float baseSize = 6.0f;
  private List<Number> sizes;
  private ShapeType baseShape = ShapeType.DEFAULT;
  private List<ShapeType> shapes;
  private Boolean baseFill;
  private List<Boolean> fills;
  private Color baseColor;
  private List<Color> colors;
  private Color baseOutlineColor;
  private List<Color> outlineColors;

  public void setSize(Object size) {
    if (size instanceof Number) {
      this.baseSize = ((Number) size).floatValue();
    } else if (size instanceof List) {
      @SuppressWarnings("unchecked")
      List<Number> ss = (List<Number>) size;
      setSizes(ss);
    } else {
      throw new IllegalArgumentException(
          "setSize takes Number or List of Number");
    }
  }

  private void setSizes(List<Number> sizes) {
    this.sizes = sizes;
  }

  public float getSize() {
    return this.baseSize;
  }

  public List<Number> getSizes() {
    return this.sizes;
  }

  public void setShape(Object shape) {
    if (shape instanceof ShapeType) {
      this.baseShape = (ShapeType) shape;
    } else if (shape instanceof List) {
      @SuppressWarnings("unchecked")
      List<ShapeType> ss = (List<ShapeType>) shape;
      setShapes(ss);
    } else {
      throw new IllegalArgumentException(
          "setShape takes ShapeType or List of ShapeType");
    }
  }

  private void setShapes(List<ShapeType> shapes) {
    this.shapes = shapes;
  }

  public ShapeType getShape() {
    return this.baseShape;
  }

  public List<ShapeType> getShapes() {
    return this.shapes;
  }

  public void setFill(Object fill) {
    if (fill instanceof Boolean) {
      this.baseFill = (Boolean) fill;
    } else if (fill instanceof List) {
      @SuppressWarnings("unchecked")
      List<Boolean> fs = (List<Boolean>) fill;
      setFills(fs);
    } else {
      throw new IllegalArgumentException(
          "setFill takes ShapeType or List of ShapeType");
    }
  }

  private void setFills(List<Boolean> fills) {
    this.fills = fills;
  }

  public Boolean getFill() {
    return this.baseFill;
  }

  public List<Boolean> getFills() {
    return this.fills;
  }

  public void setColor(Object color) {
    if (color instanceof Color) {
      this.baseColor = (Color) color;
    } else if (color instanceof List) {
      @SuppressWarnings("unchecked")
      List<Color> cs = (List<Color>) color;
      setColors(cs);
    } else {
      throw new IllegalArgumentException(
          "setColor takes Color or List of Color");
    }
  }

  @Override
  public void setColori(Color color) {
    this.baseColor = color;
  }

  private void setColors(List<Color> colors) {
    this.colors = colors;
  }

  @Override
  public Color getColor() {
    return this.baseColor;
  }

  public List<Color> getColors() {
    return this.colors;
  }

  public void setOutlineColor(Object color) {
    if (color instanceof Color) {
      this.baseOutlineColor = (Color) color;
    } else if (color instanceof List) {
      @SuppressWarnings("unchecked")
      List<Color> cs = (List<Color>) color;
      setOutlineColors(cs);
    } else {
      throw new IllegalArgumentException(
          "setOutlineColor takes Color or List of Color");
    }
  }

  private void setOutlineColors(List<Color> colors) {
    this.outlineColors = colors;
  }

  public Color getOutlineColor() {
    return this.baseOutlineColor;
  }

  public List<Color> getOutlineColors() {
    return this.outlineColors;
  }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>REPORT-NETWORK-PROPERTY</title>

This is reports properties of a network starting from a set of nodes.

Begin micro-behaviour

REPORT-NETWORK-PROPERTY

Begin NetLogo code:

to-report movivational-quality [nodes nodes-already-visited]
 let quality 0

 report
end

End NetLogo code

Variants

You can edit the duration field to any positive number. You can add
micro-behaviours to the list.

Related Micro-behaviours

Provide links and short descriptions of similar
or related micro-behaviours. And those referenced in the code.

How this works

Explain how this works to a non-programming audience.

History

Who implemented this? Was it based upon some other micro-behaviours?


text:
<?php
namespace CacheQueue\Worker;
use CacheQueue\Connection\ConnectionInterface,
    CacheQueue\Logger\LoggerInterface,
    CacheQueue\Exception\Exception;

interface WorkerInterface
{
    public function __construct(ConnectionInterface $connection, $tasks, $config = array());

    /**
     * gets an entry, runs the associated task and
     * either deletes the entry if it was temporary,
     * or updated the entries value with the tasks return value (if not returned null)
     * throws an exception on error
     *
     * @param array $job the job to proceed
     *
     * @return mixed returns the result/output of the processed task
     */
    public function work($job);

    /**
     * runs a worker task and returns the result
     *
     * @param string $task the name of the task to run
     * @param mixed $params parameters/data for the task
     * @param array|bool the corresponding job data or false
     *
     * @return mixed returns the result/output of the processed task
     */
    public function executeTask($task, $params, $job = false);

    /**
     * gets a queued entry and removes it from queue
     *
     * @param int $channel the queue channel, default = 1
     *
     * @return array|bool the job data or false if no job was found
     */
    public function getJob($channel = 1);

    /**
     * gets the worker id
     *
     * @return int the worker id
     */
    public function getWorkerId();

    /**
     * sets the connection class
     *
     * @param ConnectionInterface $connection an ConnectionInterface instance
     */
    public function setConnection(ConnectionInterface $connection);

    /**
     * gets the connection
     *
     * @return ConnectionInterface the connection instance
     */
    public function getConnection();

    /**
     * sets a logger which can be accessed by the tasks
     *
     * @param LoggerInterface $logger an LoggerInterface instance
     */
    public function setLogger(LoggerInterface $logger);

    /**
     * gets the logger or null if no logger was set
     *
     * @return LoggerInterface the logger instance
     */
    public function getLogger();
}


text:
<?php

namespace api\forms;

use common\models\User;
use kartik\password\StrengthValidator;
use yii\base\InvalidConfigException;
use yii\base\Model;
use yii\helpers\ArrayHelper;

class RegisterUserForm extends Model
{
    public $username, $email, $password;

    public $deviceIdentifier;

    public function __construct($deviceIdentifier, $config = []) {
        if(empty($deviceIdentifier)) {
            throw new InvalidConfigException('Device identifier could not be found.');
        }

        $this->deviceIdentifier = $deviceIdentifier;

        parent::__construct($config);
    }

    public function rules()
    {
        return ArrayHelper::merge([
          [['username', 'email', 'password'], 'required'],
          [['username', 'email', 'password'], 'trim'],
          ['email', 'email'],
          [['username', 'email'], 'unique', 'targetClass' => User::className()],
          [['password'], StrengthValidator::className(), 'preset' => \Yii::$app->params['strongPassword']]
        ],User::getPasswordRules());
    }

    public function register()
    {
        $user = new User();
        $user->setScenario(User::SCENARIO_REGISTER_VIA_API);
        $user->attributes = $this->attributes;
        $user->save();

        return $user;
    }

}