text:
require "hanami/utils/blank"

module Hanami
  module Model
    class Migrator
      # PostgreSQL adapter
      #
      # @since 0.4.0
      # @api private
      class PostgresAdapter < Adapter
        # @since 0.4.0
        # @api private
        HOST     = "PGHOST"

        # @since 0.4.0
        # @api private
        PORT     = "PGPORT"

        # @since 0.4.0
        # @api private
        USER     = "PGUSER"

        # @since 0.4.0
        # @api private
        PASSWORD = "PGPASSWORD"

        # @since 1.0.0
        # @api private
        DB_CREATION_ERROR = "createdb: database creation failed. If the database exists, " \
                            "then its console may be open. See this issue for more details: " \
                            "https://github.com/hanami/model/issues/250"

        # @since 0.4.0
        # @api private
        def create
          call_db_command("createdb")
        end

        # @since 0.4.0
        # @api private
        def drop
          call_db_command("dropdb")
        end

        # @since 0.4.0
        # @api private
        def dump
          dump_structure
          dump_migrations_data
        end

        # @since 0.4.0
        # @api private
        def load
          load_structure
        end

        private

        # @since 1.3.3
        # @api private
        def environment_variables
          {}.tap do |env|
            env[HOST] = host unless host.nil?
            env[PORT] = port.to_s unless port.nil?
            env[PASSWORD] = password unless password.nil?
            env[USER] = username unless username.nil?
          end
        end

        # @since 0.4.0
        # @api private
        def dump_structure
          execute "pg_dump -s -x -O -T #{migrations_table} -f #{escape(schema)} #{database}", env: environment_variables
        end

        # @since 0.4.0
        # @api private
        def load_structure
          return unless schema.exist?

          execute "psql -X -q -f #{escape(schema)} #{database}", env: environment_variables
        end

        # @since 0.4.0
        # @api private
        def dump_migrations_data
          error = ->(err) { raise MigrationError.new(err) unless err =~ /no matching tables/i }
          execute "pg_dump -t #{migrations_table} #{database} >> #{escape(schema)}", error: error, env: environment_variables
        end

        # @since 0.5.1
        # @api private
        def call_db_command(command)
          require "open3"

          begin
            Open3.popen3(environment_variables, command, database) do |_stdin, _stdout, stderr, wait_thr|
              raise MigrationError.new(modified_message(stderr.read)) unless wait_thr.value.success? # wait_thr.value is the exit status
            end
          rescue SystemCallError => exception
            raise MigrationError.new(modified_message(exception.message))
          end
        end

        # @since 1.1.0
        # @api private
        def modified_message(original_message)
          case original_message
          when /already exists/
            DB_CREATION_ERROR
          when /does not exist/
            "Cannot find database: #{database}"
          when /No such file or directory/
            "Could not find executable in your PATH: `#{original_message.split.last}`"
          else
            original_message
          end
        end
      end
    end
  end
end


text:
from . import common as cm

class CampaignCriterionService(cm.BaseService):
    def __init__(self, client):
        super().__init__(client, 'CampaignCriterionService')

redpajama_set_name: RedPajamaGithub


text:
layout:		post
title:		"Reminiscing"
description: "Effectively tell a personal anecdote about your school year"
date:		2021-03-16
author:		"Yawei"
categories: "English"
keywords:
    - English
    - Communicating
---

# The order of telling a personal anecdote

1. **Lead-in**: That reminds me of my first trep abroad.
2. **Background**: I had never travelled outside of my city before, but I'd always dreamed of...
3. **Main events**: At first, I was so confused. I didn't even know how to cross the street.
4. **Outcome**: Since then, I've always looked for opportunities to experience nwe cultures.
5. **Hand-over**: How about you, John? Have you ever been to San Francisco?

# Dialogue

1. James: It was - it was pretty crazy, I'll never forget that first time I saw my new school and just thought, huh, my life is about to change in a really big way...
2. Lucy: Those kinds of moments really do stick with you.
3. James: And how about you two?
4. Did you experience something like that?
5. Maria: I still remember my own first time abroad.
6. I would've been I guess sixteen years old and- it was my friend's idea originally-we decided to apply for this student exchange program-
7. Lucy: Oh! They started offering those at my school and I-
8. Maria: And, and, and, I mean, I'd always wanted to go overseas, but I'd never thought about actually doing that in high school.
9. So the strange thing was, we both applied together, and I did it just for fun, but in the end I got in, so, off I went to Brazil!
10. James: Brazil? Wow, that's a long way to go. I heard life is pretty relaxed there
11. Maria: Yes-
12. James: -and that-
13. Maria:- althoughhh, it certainly wasnt' relaxing for me when first arrived.
14. I mean, you anticipate some culture shock and all that, but then part of you thinks, that's for other people,not for me. I'll be fine.
15. But as soon as I arrived, it was just - every little thing.
16. Lucy: Language issues?
17. Maria: Well, the language side of things was actually OK, because in the area I lived most people spoke some English.
18. It was more like-i don't know-every time I met someone, they'd hug and kiss me on the cheeks.
19. I felt this pressure to be very close friends straight away.
20. James: I guess the beaches made up for that, though, right?
21. Maria: The beaches were great-yeah, weekend after weekend, swimming, surfing, whatever we wanted to do.
22. But when I look back, it was much more than a long holiday.
23. I guess it's more the-how can I put it?
24. It's the way it's changed my outlook or my way of thinking about what's-
25. Lucy: -what's important in life.
26. Maria: Mm, before then it was just family, job, I didn't really think much beyond that. Now really make sure I'm living my life on my own terms.
27. James: Well, that's what matters, right.
28. Maria: Yep. Anyway, what about you, Lucy?
29. Were you saying that you went on a student exchange too?
30. Lucy: Well, it wasn't an exchange as such, but yes, when I was....


text:
FROM alpine:3.5
MAINTAINER Charlie Lewis <clewis@iqt.org>

RUN apk add --update \
    docker \
    libmagic \
    python \
    py2-pip \
    && rm -rf /var/cache/apk/*

RUN pip install rq
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt
ADD *.py /

ENTRYPOINT ["rqworker", "-c", "settings"]


text:
package org.apereo.cas.otp.repository.token;

/**
 * This is {@link OneTimeTokenRepository}.
 *
 * @author Misagh Moayyed
 * @since 5.1.0
 */
public interface OneTimeTokenRepository {

    /**
     * Clean expired/invalid tokens from the repository.
     * Clean up is likely run via a scheduler.
     */
    void clean();

    /**
     * Store token/code in the repository, marking it as invalid to be reused again.
     *
     * @param token the token
     */
    void store(OneTimeToken token);

    /**
     * Determine if the otp for user exists in repository.
     *
     * @param uid the uid
     * @param otp the otp
     * @return true/false.
     */
    boolean exists(String uid, Integer otp);
}


text:
PACKAGE_JSON=./package.json
BUILD_DIR=build

# parse command line
if [ $# != 1 ]; then
   echo "Usage: deploy-dev username" ; exit 1
fi
USER_NAME=${1}

# check prerequisite files
if [ ! -f $PACKAGE_JSON ]; then
   echo "Cannot find $PACKAGE_JSON" ; exit 1
fi
if [ ! -d $BUILD_DIR ]; then
   echo "Cannot find $BUILD_DIR" ; exit 1
fi

# read build configuration from package.json
function parseJSON() {
  echo `grep $1 ${PACKAGE_JSON} | awk -F ':' '{print $2}' | tr ",\"" " "`
}
NAME=`parseJSON \"name\":`
VERSION=`parseJSON \"version\":`

# copy to server
PHET_DEV_SERVER=${PHET_DEV_SERVER:=spot.colorado.edu}
PHET_DEV_ROOT=/htdocs/physics/phet/dev/html
echo "Deploying $NAME $VERSION to $PHET_DEV_SERVER"
scp -r $BUILD_DIR ${USER_NAME}@${PHET_DEV_SERVER}:${PHET_DEV_ROOT}/${NAME}/${VERSION}

# update dependencies.json
echo "Updating dependencies.json ..."
cp ${BUILD_DIR}/dependencies.json .
git add dependencies.json
git commit --message "updated dependencies.json for ${VERSION}"
git push

# print the deployed URL, so you can test quickly via copy-paste
echo "deployed:" http://www.colorado.edu/physics/phet/dev/html/${NAME}/${VERSION}/${NAME}_en.html

#====================================================================================================


text:
<?php

namespace Wasabi\Cms\View\Page;

use Cake\Utility\Hash;
use Wasabi\Cms\View\Layout\Grid;

class Cell extends ContentElement
{
    /**
     * Holds the grid representing the size of this cell.
     *
     * @var Grid
     */
    public $grid;

    /**
     * Holds all modules of this cell.
     *
     * @var Module[]
     */
    public $data = [];

    public function __construct($cellDefinition)
    {
        parent::__construct($cellDefinition);

        $this->grid = new Grid(
            Hash::get($cellDefinition, 'meta.grid.colWidth', 0),
            Hash::get($cellDefinition, 'meta.grid.baseWidth', 0)
        );

        foreach ($cellDefinition['data'] as $moduleDefintion) {
            $this->data[] = new Module($moduleDefintion);
        }
    }
}


text:
import datetime as dt

import pendulum
from pendulum.datetime import DateTime

from airflow.settings import TIMEZONE

# UTC time zone as a tzinfo instance.
utc = pendulum.tz.timezone('UTC')

def is_localized(value):
    """
    Determine if a given datetime.datetime is aware.
    The concept is defined in Python's docs:
    http://docs.python.org/library/datetime.html#datetime.tzinfo
    Assuming value.tzinfo is either None or a proper datetime.tzinfo,
    value.utcoffset() implements the appropriate logic.
    """
    return value.utcoffset() is not None

def is_naive(value):
    """
    Determine if a given datetime.datetime is naive.
    The concept is defined in Python's docs:
    http://docs.python.org/library/datetime.html#datetime.tzinfo
    Assuming value.tzinfo is either None or a proper datetime.tzinfo,
    value.utcoffset() implements the appropriate logic.
    """
    return value.utcoffset() is None

def utcnow() -> dt.datetime:
    """
    Get the current date and time in UTC

    :return:
    """
    # pendulum utcnow() is not used as that sets a TimezoneInfo object
    # instead of a Timezone. This is not pickable and also creates issues
    # when using replace()
    result = dt.datetime.utcnow()
    result = result.replace(tzinfo=utc)

    return result

def utc_epoch() -> dt.datetime:
    """
    Gets the epoch in the users timezone

    :return:
    """
    # pendulum utcnow() is not used as that sets a TimezoneInfo object
    # instead of a Timezone. This is not pickable and also creates issues
    # when using replace()
    result = dt.datetime(1970, 1, 1)
    result = result.replace(tzinfo=utc)

    return result

def convert_to_utc(value):
    """
    Returns the datetime with the default timezone added if timezone
    information was not associated

    :param value: datetime
    :return: datetime with tzinfo
    """
    if not value:
        return value

    if not is_localized(value):
        value = pendulum.instance(value, TIMEZONE)

    return value.astimezone(utc)

def make_aware(value, timezone=None):
    """
    Make a naive datetime.datetime in a given time zone aware.

    :param value: datetime
    :param timezone: timezone
    :return: localized datetime in settings.TIMEZONE or timezone
    """
    if timezone is None:
        timezone = TIMEZONE

    # Check that we won't overwrite the timezone of an aware datetime.
    if is_localized(value):
        raise ValueError("make_aware expects a naive datetime, got %s" % value)
    if hasattr(value, 'fold'):
        # In case of python 3.6 we want to do the same that pendulum does for python3.5
        # i.e in case we move clock back we want to schedule the run at the time of the second
        # instance of the same clock time rather than the first one.
        # Fold parameter has no impact in other cases so we can safely set it to 1 here
        value = value.replace(fold=1)
    if hasattr(timezone, 'localize'):
        # This method is available for pytz time zones.
        return timezone.localize(value)
    elif hasattr(timezone, 'convert'):
        # For pendulum
        return timezone.convert(value)
    else:
        # This may be wrong around DST changes!
        return value.replace(tzinfo=timezone)

def make_naive(value, timezone=None):
    """
    Make an aware datetime.datetime naive in a given time zone.

    :param value: datetime
    :param timezone: timezone
    :return: naive datetime
    """
    if timezone is None:
        timezone = TIMEZONE

    # Emulate the behavior of astimezone() on Python < 3.6.
    if is_naive(value):
        raise ValueError("make_naive() cannot be applied to a naive datetime")

    date = value.astimezone(timezone)

    # cross library compatibility
    naive = dt.datetime(
        date.year, date.month, date.day, date.hour, date.minute, date.second, date.microsecond
    )

    return naive

def datetime(*args, **kwargs):
    """
    Wrapper around datetime.datetime that adds settings.TIMEZONE if tzinfo not specified

    :return: datetime.datetime
    """
    if 'tzinfo' not in kwargs:
        kwargs['tzinfo'] = TIMEZONE

    return dt.datetime(*args, **kwargs)

def parse(string: str, timezone=None) -> DateTime:
    """
    Parse a time string and return an aware datetime

    :param string: time string
    """
    return pendulum.parse(string, tz=timezone or TIMEZONE, strict=False)  # type: ignore


text:
class Player(object):
    def play_turn(self, warrior):
        return None  # Your code here


text:
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ToyStore.Data.Contracts
{
    public class UnitOfWork : IUnitOfWork
    {
        private DbContext context;

        public UnitOfWork(DbContext context)
        {
            this.context = context;

            this.context.Configuration.AutoDetectChangesEnabled = false;
            this.context.Configuration.ValidateOnSaveEnabled = false;
        }

        public void Commit()
        {
            this.context.SaveChanges();
        }

        public void Dispose()
        {
        }
    }
}


text:
#ifndef MOLERAT_HTTP_STATUS_H
#define MOLERAT_HTTP_STATUS_H

/* HTTP status message lookup */

struct http_status {
	int code;
	int message_len;
	const char *message;
};

struct http_status *http_status_lookup(int code);

#endif


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace XMLProcessing
{
    public class DomParser
    {
        public static void Parse(string url)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(url);
            XmlNode rootNode = doc.DocumentElement;

            foreach (XmlNode node in rootNode)
            {
                try
                {
                    Console.WriteLine("__________________________________________________");
                    Console.WriteLine("Album name: {0}", node["name"].InnerText);
                    Console.WriteLine("Album artist: {0}", node["artist"].InnerText);
                    Console.WriteLine("Album year: {0}", node["year"].InnerText);
                    Console.WriteLine("Album price: {0}$", node["price"].InnerText);
                    foreach (XmlNode childNode in node.LastChild.ChildNodes)
                    {
                        Console.WriteLine("Song title: {0}", childNode["title"].InnerText);
                        Console.WriteLine("Song duration: {0} min", childNode["duration"].InnerText);
                    }
                }
                catch (NullReferenceException)
                {
                    Console.WriteLine("Deleted");
                }
            }

        }
    }
}


text:
#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"

/* mpn_scan0 can't be used for the u>0 search since there might not be a 0
   bit before the end of the data.  mpn_scan1 could be used for the inverted
   search under u<0, but usually the search won't go very far so it seems
   reasonable to inline that code.  */

mp_bitcnt_t
mpz_scan0 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW
{
  mp_srcptr      u_ptr = PTR(u);
  mp_size_t      size = SIZ(u);
  mp_size_t      abs_size = ABS(size);
  mp_srcptr      u_end = u_ptr + abs_size;
  mp_size_t      starting_limb = starting_bit / GMP_NUMB_BITS;
  mp_srcptr      p = u_ptr + starting_limb;
  mp_limb_t      limb;
  int            cnt;

  /* When past end, there's an immediate 0 bit for u>=0, or no 0 bits for
     u<0.  Notice this test picks up all cases of u==0 too. */
  if (starting_limb >= abs_size)
    return (size >= 0 ? starting_bit : ~(mp_bitcnt_t) 0);

  limb = *p;

  if (size >= 0)
    {
      /* Mask to 1 all bits before starting_bit, thus ignoring them. */
      limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1;

      /* Search for a limb which isn't all ones.  If the end is reached then
	 the zero bit immediately past the end is returned.  */
      while (limb == GMP_NUMB_MAX)
	{
	  p++;
	  if (p == u_end)
	    return (mp_bitcnt_t) abs_size * GMP_NUMB_BITS;
	  limb = *p;
	}

      /* Now seek low 1 bit. */
      limb = ~limb;
    }
  else
    {
      mp_srcptr  q;

      /* If there's a non-zero limb before ours then we're in the ones
	 complement region.  Search from *(p-1) downwards since that might
	 give better cache locality, and since a non-zero in the middle of a
	 number is perhaps a touch more likely than at the end.  */
      q = p;
      while (q != u_ptr)
	{
	  q--;
	  if (*q != 0)
	    goto inverted;
	}

      /* Adjust so ~limb implied by searching for 1 bit below becomes -limb.
	 If limb==0 here then this isn't the beginning of twos complement
	 inversion, but that doesn't matter because limb==0 is a zero bit
	 immediately (-1 is all ones for below).  */
      limb--;

    inverted:
      /* Now seeking a 1 bit. */

      /* Mask to 0 all bits before starting_bit, thus ignoring them. */
      limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS));

      if (limb == 0)
	{
	  /* If the high limb is zero after masking, then no 1 bits past
	     starting_bit.  */
	  p++;
	  if (p == u_end)
	    return ~(mp_bitcnt_t) 0;

	  /* Search further for a non-zero limb.  The high limb is non-zero,
	     if nothing else.  */
	  for (;;)
	    {
	      limb = *p;
	      if (limb != 0)
		break;
	      p++;
	      ASSERT (p < u_end);
	    }
	}
    }

  ASSERT (limb != 0);
  count_trailing_zeros (cnt, limb);
  return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt;
}


text:
package cn.sel.jutil.lang;

import java.util.Arrays;
import java.util.Objects;

public class JObject
{
    @SafeVarargs
    public static <T> boolean include(T object, T... array)
    {
        for(T item : array)
        {
            if(Objects.equals(item, object))
            {
                return true;
            }
        }
        return false;
    }

    @SafeVarargs
    public static <T> T[] joinArray(T[] first, T[]... others)
    {
        int length1 = first.length;
        int totalLength = length1;
        for(T[] array : others)
        {
            totalLength += array.length;
        }
        T[] result = Arrays.copyOf(first, totalLength);
        int offset = length1;
        for(T[] array : others)
        {
            int length = array.length;
            System.arraycopy(array, 0, result, offset, length);
            offset += length;
        }
        return result;
    }
}


text:
<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\User;
use App\Idea;
use Auth;
use Input;

use Illuminate\Http\Request;

class UserController extends Controller
{
    public function profile(Request $request, User $user)
	{
		if (is_null($user->id)) { $user = Auth::user(); }

		$supported_ideas = []; // TODO
		$created_ideas = Idea::where('user_id', $user->id)->get();

	    return view('users.profile', ['user' => $user, 'supported_ideas' => $supported_ideas, 'created_ideas' => $created_ideas]);
	}

    public function details(Request $request)
	{
		$user = Auth::user();

		if ($request->isMethod('get')) {

		    return view('users.details', ['user' => $user]);

		} else if ($request->isMethod('post')) {

		    $this->validate($request, [
		    	'name' => 'required|max:255',
	            'email' => 'required|email|max:255|unique:users,email,'.$user->id,
		        'phone' => 'max:255',
		        'bio' => 'required|max:2000'
		    ]);

			$user->name = $request->name;
			$user->email = $request->email;
			$user->phone = $request->phone;
			$user->bio = $request->bio;
			$user->avatar = $request->photo;

			$user->save();

		    return redirect()->action('UserController@profile', $user->id);
		}
	}
}


text:
package org.apache.spark.internal.config

import java.util.concurrent.TimeUnit

import scala.collection.JavaConverters._
import scala.collection.mutable.HashMap

import org.apache.spark.{SparkConf, SparkFunSuite}
import org.apache.spark.network.util.ByteUnit
import org.apache.spark.util.SparkConfWithEnv

class ConfigEntrySuite extends SparkFunSuite {

  private val PREFIX = "spark.ConfigEntrySuite"

  private def testKey(name: String): String = s"$PREFIX.$name"

  test("conf entry: int") {
    val conf = new SparkConf()
    val iConf = ConfigBuilder(testKey("int")).intConf.createWithDefault(1)
    assert(conf.get(iConf) === 1)
    conf.set(iConf, 2)
    assert(conf.get(iConf) === 2)
  }

  test("conf entry: long") {
    val conf = new SparkConf()
    val lConf = ConfigBuilder(testKey("long")).longConf.createWithDefault(0L)
    conf.set(lConf, 1234L)
    assert(conf.get(lConf) === 1234L)
  }

  test("conf entry: double") {
    val conf = new SparkConf()
    val dConf = ConfigBuilder(testKey("double")).doubleConf.createWithDefault(0.0)
    conf.set(dConf, 20.0)
    assert(conf.get(dConf) === 20.0)
  }

  test("conf entry: boolean") {
    val conf = new SparkConf()
    val bConf = ConfigBuilder(testKey("boolean")).booleanConf.createWithDefault(false)
    assert(!conf.get(bConf))
    conf.set(bConf, true)
    assert(conf.get(bConf))
  }

  test("conf entry: optional") {
    val conf = new SparkConf()
    val optionalConf = ConfigBuilder(testKey("optional")).intConf.createOptional
    assert(conf.get(optionalConf) === None)
    conf.set(optionalConf, 1)
    assert(conf.get(optionalConf) === Some(1))
  }

  test("conf entry: fallback") {
    val conf = new SparkConf()
    val parentConf = ConfigBuilder(testKey("parent")).intConf.createWithDefault(1)
    val confWithFallback = ConfigBuilder(testKey("fallback")).fallbackConf(parentConf)
    assert(conf.get(confWithFallback) === 1)
    conf.set(confWithFallback, 2)
    assert(conf.get(parentConf) === 1)
    assert(conf.get(confWithFallback) === 2)
  }

  test("conf entry: time") {
    val conf = new SparkConf()
    val time = ConfigBuilder(testKey("time")).timeConf(TimeUnit.SECONDS)
      .createWithDefaultString("1h")
    assert(conf.get(time) === 3600L)
    conf.set(time.key, "1m")
    assert(conf.get(time) === 60L)
  }

  test("conf entry: bytes") {
    val conf = new SparkConf()
    val bytes = ConfigBuilder(testKey("bytes")).bytesConf(ByteUnit.KiB)
      .createWithDefaultString("1m")
    assert(conf.get(bytes) === 1024L)
    conf.set(bytes.key, "1k")
    assert(conf.get(bytes) === 1L)
  }

  test("conf entry: string seq") {
    val conf = new SparkConf()
    val seq = ConfigBuilder(testKey("seq")).stringConf.toSequence.createWithDefault(Seq())
    conf.set(seq.key, "1,,2, 3 , , 4")
    assert(conf.get(seq) === Seq("1", "2", "3", "4"))
    conf.set(seq, Seq("1", "2"))
    assert(conf.get(seq) === Seq("1", "2"))
  }

  test("conf entry: int seq") {
    val conf = new SparkConf()
    val seq = ConfigBuilder(testKey("intSeq")).intConf.toSequence.createWithDefault(Seq())
    conf.set(seq.key, "1,,2, 3 , , 4")
    assert(conf.get(seq) === Seq(1, 2, 3, 4))
    conf.set(seq, Seq(1, 2))
    assert(conf.get(seq) === Seq(1, 2))
  }

  test("conf entry: transformation") {
    val conf = new SparkConf()
    val transformationConf = ConfigBuilder(testKey("transformation"))
      .stringConf
      .transform(_.toLowerCase())
      .createWithDefault("FOO")

    assert(conf.get(transformationConf) === "foo")
    conf.set(transformationConf, "BAR")
    assert(conf.get(transformationConf) === "bar")
  }

  test("conf entry: checkValue()") {
    def createEntry(default: Int): ConfigEntry[Int] =
      ConfigBuilder(testKey("checkValue"))
        .intConf
        .checkValue(value => value >= 0, "value must be non-negative")
        .createWithDefault(default)

    val conf = new SparkConf()

    val entry = createEntry(10)
    conf.set(entry, -1)
    val e1 = intercept[IllegalArgumentException] {
      conf.get(entry)
    }
    assert(e1.getMessage == "value must be non-negative")

    val e2 = intercept[IllegalArgumentException] {
      createEntry(-1)
    }
    assert(e2.getMessage == "value must be non-negative")
  }

  test("conf entry: valid values check") {
    val conf = new SparkConf()
    val enum = ConfigBuilder(testKey("enum"))
      .stringConf
      .checkValues(Set("a", "b", "c"))
      .createWithDefault("a")
    assert(conf.get(enum) === "a")

    conf.set(enum, "b")
    assert(conf.get(enum) === "b")

    conf.set(enum, "d")
    val enumError = intercept[IllegalArgumentException] {
      conf.get(enum)
    }
    assert(enumError.getMessage === s"The value of ${enum.key} should be one of a, b, c, but was d")
  }

  test("conf entry: conversion error") {
    val conf = new SparkConf()
    val conversionTest = ConfigBuilder(testKey("conversionTest")).doubleConf.createOptional
    conf.set(conversionTest.key, "abc")
    val conversionError = intercept[IllegalArgumentException] {
      conf.get(conversionTest)
    }
    assert(conversionError.getMessage === s"${conversionTest.key} should be double, but was abc")
  }

  test("default value handling is null-safe") {
    val conf = new SparkConf()
    val stringConf = ConfigBuilder(testKey("string")).stringConf.createWithDefault(null)
    assert(conf.get(stringConf) === null)
  }

  test("variable expansion of spark config entries") {
    val env = Map("ENV1" -> "env1")
    val conf = new SparkConfWithEnv(env)

    val stringConf = ConfigBuilder(testKey("stringForExpansion"))
      .stringConf
      .createWithDefault("string1")
    val optionalConf = ConfigBuilder(testKey("optionForExpansion"))
      .stringConf
      .createOptional
    val intConf = ConfigBuilder(testKey("intForExpansion"))
      .intConf
      .createWithDefault(42)
    val fallbackConf = ConfigBuilder(testKey("fallbackForExpansion"))
      .fallbackConf(intConf)

    val refConf = ConfigBuilder(testKey("configReferenceTest"))
      .stringConf
      .createWithDefault(null)

    def ref(entry: ConfigEntry[_]): String = "${" + entry.key + "}"

    def testEntryRef(entry: ConfigEntry[_], expected: String): Unit = {
      conf.set(refConf, ref(entry))
      assert(conf.get(refConf) === expected)
    }

    testEntryRef(stringConf, "string1")
    testEntryRef(intConf, "42")
    testEntryRef(fallbackConf, "42")

    testEntryRef(optionalConf, ref(optionalConf))

    conf.set(optionalConf, ref(stringConf))
    testEntryRef(optionalConf, "string1")

    conf.set(optionalConf, ref(fallbackConf))
    testEntryRef(optionalConf, "42")

    // Default string values with variable references.
    val parameterizedStringConf = ConfigBuilder(testKey("stringWithParams"))
      .stringConf
      .createWithDefault(ref(stringConf))
    assert(conf.get(parameterizedStringConf) === conf.get(stringConf))

    // Make sure SparkConf's env override works.
    conf.set(refConf, "${env:ENV1}")
    assert(conf.get(refConf) === env("ENV1"))

    // Conf with null default value is not expanded.
    val nullConf = ConfigBuilder(testKey("nullString"))
      .stringConf
      .createWithDefault(null)
    testEntryRef(nullConf, ref(nullConf))
  }

}


text:
import os.path
import sys

from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration

include_dirs = []
library_dirs = []
if sys.platform == 'win32':
    # Update the ``library_dir_option`` function in MSVCCompiler
    # to add quotes around /LIBPATH entries.
    import types

    def _lib_dir_option(self, dir):
        return '/LIBPATH:"%s"' % dir

    from distutils.msvc9compiler import MSVCCompiler

    setattr(MSVCCompiler, 'library_dir_option',
            types.MethodType(_lib_dir_option, None, MSVCCompiler))

    sdkdir = os.environ.get('WindowsSdkDir')
    if sdkdir:
        include_dirs.append(os.path.join(sdkdir, 'Include'))
        library_dirs.append(os.path.join(sdkdir, 'Lib'))
        # make sure we have mt.exe available in case we need it
        path = os.environ['PATH'].split(';')
        path.append(os.path.join(sdkdir, 'bin'))
        os.environ['PATH'] = ';'.join(path)

config = Configuration(name='conmin')
config.add_extension('conmin', sources=['conmin.f'],
                     include_dirs=include_dirs,
                     library_dirs=library_dirs)

kwds = {'install_requires': ['numpy'],
        'version': '1.0.1',
        'zip_safe': False,
        'license': 'public domain',
        # NOTE: we use 'url' here, but it really translates to 'home-page'
        # in the metadata. Go figure.
        'url': 'http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&fileID=1086',
        'package_data': {'openmdao.main': ['*.html']},
        }
kwds.update(config.todict())

setup(**kwds)


text:
  To import a review from the comments on this Google document please tell us the name
  of the reviewer as it appears in the comments.
  You can use "Anonymous" to import a review based on all the anonymous comments.

{% include "serializers/_field.html" with field=serializer.filter_a label="Reviewer name" icon="ri-user-line" autofocus=True help_text="Enter the name of the reviewer as it appears in the comments of the document." %}


text:
<resources>
    <string name="app_name">Pause/Play Animation</string>
</resources>


text:
[![Build Status](https://travis-ci.org/OpenBookPrices/country-data.png)](https://travis-ci.org/OpenBookPrices/country-data)

There are lots of little bits of data that you often need relating to countries,
and I couldn't find any easy to use source of it. So I compiled it all here.

## Work in Progress

This code base may change a bit until it hits `0.1.x` - feel free to use it, but be sure to check between upgrades.

I suspect that many of the `currencies` entries on the countries may be wrong. Help checking them would be appreciated.

## Countries

The data currently provided for each country is:

  * `name` The english name for the country
  * `alpha2` The [ISO 3166-1 alpha 2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code
  * `alpha3` The [ISO 3166-1 alpha 3](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code
  * `status`: The ISO status of the entry - see below.
  * `currencies` An array of [ISO 4217 currency codes](http://en.wikipedia.org/wiki/ISO_4217) with the primary one first
  * `languages` An array of [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) codes for languages (may not be complete).
  * `countryCallingCodes` An array of the international call prefixes for this country.
  * `ioc` The [International Olympic Committee country code](http://en.wikipedia.org/wiki/List_of_IOC_country_codes)
  * `emoji` The emoji of country's flag.

### Status notes

The `status` can be one of 'assigned', 'reserved', 'user assigned' or 'deleted'.

Assigned means that the code is properly in the ISO 3166 standard. Reserved means that the code is being prevented from being used. Deleted means that it has been deleted. User Assigned means that for some use cases it is required. Deleted means that it used to be in the standard but is now not.

See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for full details, especially the "User-assigned code elements" and "Reserved code elements" sections.

## Regions

Countries are ofter grouped into regions. The list of regions is by no means exhaustive, pull requests very welcome for additions.

  * `countries` An array of `alpha2` codes for the countries in this region.

## Currencies

It is not that useful to just have the currency code(s) for a country, so included is currency data too:

  * `name` The english name for the currency
  * `code` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) code
  * `number` The [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) number
  * `decimals` The number of decimal digits conventionally shown
  * `symbol` The currency symbol for the currency (e.g. ¥, $ etc.). Some symbols are not available, in which case
    `symbol` contains the ISO 4217 code.  Credit to [bengourley/currency-symbol-map](https://github.com/bengourley/currency-symbol-map)
    for the symbol database.

## Languages

A list of languages provided by [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2);

  * `name` The english name for the language
  * `alpha2` The two letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) code for the language (may be blank).
  * `alpha3` The three letter terminological [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) code for the language (may be blank).
  * `bibliograpic` The three letter bibliographic [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) code for the language (may be blank).

## Lookup

To make finding easier there are utility methods that can search the countries and currencies. See examples below.

## Installing

``` bash
npm install country-data
```

## Example usage

``` javascript
var countries        = require('country-data').countries,
    currencies       = require('country-data').currencies,
    regions          = require('country-data').regions,
    languages        = require('country-data').languages,
    callingCountries = require('country-data').callingCountries;

// .all gives you an array of all entries
console.log( countries.all );
console.log( currencies.all );

// countries are found using alpha2 or alpha3 (both uppercase)
console.log( countries.BE.name );        // 'Belgium'
console.log( countries.FRA.currencies ); // ['EUR']

// callingCountries is like countries but only has entries with dialing codes.

// currencies are accessed by their code (uppercase)
console.log( currencies.USD.name ); // 'United States dollar'

// regions are accessed using a camel case name
console.log( regions.europe.countries )
```

``` javascript
var lookup = require('country-data').lookup;

// Match a value (grab first from array)
var france = lookup.countries({name: 'France'})[0];

// Or match one of several possible values.
var eurozone_countries = lookup.countries({currencies: 'EUR'});
```

It is very simple for now - feel free to contribute more helpful accessors.

## Possible future additions

More data for each country is most welcome. Obvious things that it might be nice
to add are:

### Countries

  * Wikipedia links
  * Coordinates (centroid, bounding box, etc)

### Currencies

  * other currency that it is [pegged](http://en.wikipedia.org/wiki/Fixed_exchange_rate) to

## Using with webpack

As this code loads the data from JSON files you need to add the JSON loader to webpack:

``` bash
npm install json-loader --save-dev
```

and then include in your `webpack.config.js`:

``` javascript
// ...
   loaders: [
      // other loaders
      { test: /\.json$/, loader: 'json' },
  ],
// ...
```

## Other similar bits of code

* [libphonenumber](https://code.google.com/p/libphonenumber/) "Google's common Java, C++ and Javascript library for parsing, formatting, storing and validating international phone numbers."

## How to contribute

The final format is JSON, but it is easier to work with CSV. Hence in the `data`
folder there are CSV files and scripts that convert them to JSON. Please don't
edit the JSON directly, but do it via the CSV.

These are the steps required:

``` bash
# Clone the repo (or better your fork of it)
git clone https://github.com/OpenBookPrices/country-data.git
cd country-data

# install the dependencies
npm install .

# Edit the countries.csv
open data/countries.csv

# Convert the raw data (CSV or JS files) to JSON
make

# Run the tests
mocha

# If all is ok commit and push
git add .
git commit
git push

# Then send a pull request with your changes. Ideally use several small commits,
# and reference a source that backs up the change.
```

## Sources

The currency data was copied from the [Wikipedia ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) page.

The country calling codes came from the  [Wikipedia country calling codes](http://en.wikipedia.org/wiki/List_of_country_calling_codes) page.


text:
from CIM14.IEC61968.Common.Agreement import Agreement

class MerchantAgreement(Agreement):
    """A formal controlling contractual agreement between Supplier and Merchant, in terms of which Merchant is authorised to vend tokens and receipt payments on behalf of Supplier. Merchant is accountable to Supplier for revenue collected at PointOfSale.
    """

    def __init__(self, MerchantAccounts=None, *args, **kw_args):
        """Initialises a new 'MerchantAgreement' instance.

        @param MerchantAccounts: All merchant accounts instantiated as a result of this merchant agreement.
        """
        self._MerchantAccounts = []
        self.MerchantAccounts = [] if MerchantAccounts is None else MerchantAccounts

        super(MerchantAgreement, self).__init__(*args, **kw_args)

    _attrs = []
    _attr_types = {}
    _defaults = {}
    _enums = {}
    _refs = ["MerchantAccounts"]
    _many_refs = ["MerchantAccounts"]

    def getMerchantAccounts(self):
        """All merchant accounts instantiated as a result of this merchant agreement.
        """
        return self._MerchantAccounts

    def setMerchantAccounts(self, value):
        for x in self._MerchantAccounts:
            x.MerchantAgreement = None
        for y in value:
            y._MerchantAgreement = self
        self._MerchantAccounts = value

    MerchantAccounts = property(getMerchantAccounts, setMerchantAccounts)

    def addMerchantAccounts(self, *MerchantAccounts):
        for obj in MerchantAccounts:
            obj.MerchantAgreement = self

    def removeMerchantAccounts(self, *MerchantAccounts):
        for obj in MerchantAccounts:
            obj.MerchantAgreement = None


text:
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using Cassandra.Metrics;
using Cassandra.Metrics.Internal;
using Cassandra.Metrics.Providers.Null;
using Cassandra.Observers;
using Cassandra.Observers.Abstractions;
using Cassandra.Requests;
using Cassandra.Serialization;
using Cassandra.SessionManagement;
using Moq;

using NUnit.Framework;

namespace Cassandra.Tests
{
    [TestFixture]
    [SuppressMessage("ReSharper", "PossibleMultipleEnumeration", Justification = "Reviewed")]
    public class RequestHandlerMockTests
    {
        private static IInternalSession GetMockInternalSession()
        {
            var sessionMock = new Mock<IInternalSession>();
            var clusterMock = new Mock<IInternalCluster>();
            sessionMock.Setup(x => x.InternalCluster).Returns(clusterMock.Object);
            sessionMock.Setup(x => x.ObserverFactory)
                       .Returns(new MetricsObserverFactory(new MetricsManager(new NullDriverMetricsProvider(), new DriverMetricsOptions(), true, "s1")));
            return sessionMock.Object;
        }
        private static Configuration GetConfig(ILoadBalancingPolicy lbp)
        {
            var requestExecutionFactory = Mock.Of<IRequestExecutionFactory>();
            Mock.Get(requestExecutionFactory)
                .Setup(m => m.Create(
                    It.IsAny<IRequestHandler>(),
                    It.IsAny<IInternalSession>(),
                    It.IsAny<IRequest>(),
                    It.IsAny<IRequestObserver>()))
                .Returns(Mock.Of<IRequestExecution>());

            return new TestConfigurationBuilder
            {
                Policies = new Cassandra.Policies(lbp, null, null),
                RequestExecutionFactory = requestExecutionFactory
            }.Build();
        }

        [Test]
        public void Should_ThrowNoHostAvailableException_When_QueryPlanMoveNextReturnsFalse()
        {
            var sessionMock = GetMockInternalSession();
            var lbpMock = Mock.Of<ILoadBalancingPolicy>();
            Mock.Get(sessionMock).SetupGet(m => m.Cluster.Configuration).Returns(RequestHandlerMockTests.GetConfig(lbpMock));
            var enumerable = Mock.Of<IEnumerable<Host>>();
            var enumerator = Mock.Of<IEnumerator<Host>>();

            Mock.Get(enumerator).Setup(m => m.MoveNext()).Returns(false);
            Mock.Get(enumerable).Setup(m => m.GetEnumerator()).Returns(enumerator);
            Mock.Get(lbpMock)
                .Setup(m => m.NewQueryPlan(It.IsAny<string>(), It.IsAny<IStatement>()))
                .Returns(enumerable);
            var triedHosts = new Dictionary<IPEndPoint, Exception>();

            var sut = new RequestHandler(sessionMock, new SerializerManager(ProtocolVersion.V4).GetCurrentSerializer());
            Assert.Throws<NoHostAvailableException>(() => sut.GetNextValidHost(triedHosts));
        }

        [Test]
        public void Should_ThrowNoHostAvailableException_When_QueryPlanMoveNextReturnsTrueButCurrentReturnsNull()
        {
            var sessionMock = GetMockInternalSession();
            var lbpMock = Mock.Of<ILoadBalancingPolicy>();
            Mock.Get(sessionMock).SetupGet(m => m.Cluster.Configuration).Returns(RequestHandlerMockTests.GetConfig(lbpMock));
            var enumerable = Mock.Of<IEnumerable<Host>>();
            var enumerator = Mock.Of<IEnumerator<Host>>();

            Mock.Get(enumerator).Setup(m => m.MoveNext()).Returns(true);
            Mock.Get(enumerator).SetupGet(m => m.Current).Returns((Host)null);
            Mock.Get(enumerable).Setup(m => m.GetEnumerator()).Returns(enumerator);
            Mock.Get(lbpMock)
                .Setup(m => m.NewQueryPlan(It.IsAny<string>(), It.IsAny<IStatement>()))
                .Returns(enumerable);
            var triedHosts = new Dictionary<IPEndPoint, Exception>();

            var sut = new RequestHandler(sessionMock, new SerializerManager(ProtocolVersion.V4).GetCurrentSerializer());
            Assert.Throws<NoHostAvailableException>(() => sut.GetNextValidHost(triedHosts));
        }

        [Test]
        public void Should_ReturnHost_When_QueryPlanMoveNextReturnsTrueAndCurrentReturnsHost()
        {
            var sessionMock = GetMockInternalSession();
            var lbpMock = Mock.Of<ILoadBalancingPolicy>();
            Mock.Get(sessionMock).SetupGet(m => m.Cluster.Configuration).Returns(RequestHandlerMockTests.GetConfig(lbpMock));
            var enumerable = Mock.Of<IEnumerable<Host>>();
            var enumerator = Mock.Of<IEnumerator<Host>>();
            var host = new Host(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9047), contactPoint: null);
            Mock.Get(enumerator).Setup(m => m.MoveNext()).Returns(true);
            Mock.Get(enumerator).SetupGet(m => m.Current).Returns(host);
            Mock.Get(enumerable).Setup(m => m.GetEnumerator()).Returns(enumerator);
            Mock.Get(lbpMock)
                .Setup(m => m.NewQueryPlan(It.IsAny<string>(), It.IsAny<IStatement>()))
                .Returns(enumerable);
            Mock.Get(lbpMock).Setup(m => m.Distance(host)).Returns(HostDistance.Local);
            var triedHosts = new Dictionary<IPEndPoint, Exception>();

            var sut = new RequestHandler(sessionMock, new SerializerManager(ProtocolVersion.V4).GetCurrentSerializer());
            var validHost = sut.GetNextValidHost(triedHosts);
            Assert.NotNull(validHost);
            Assert.AreEqual(host, validHost.Host);
        }
    }
}


text:
//: gui/TrackEvent.java
package gui; /* Added by Eclipse.py */
// Show events as they happen.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import static net.mindview.util.SwingConsole.*;

public class TrackEvent extends JFrame {
  private HashMap<String,JTextField> h =
    new HashMap<String,JTextField>();
  private String[] event = {
    "focusGained", "focusLost", "keyPressed",
    "keyReleased", "keyTyped", "mouseClicked",
    "mouseEntered", "mouseExited", "mousePressed",
    "mouseReleased", "mouseDragged", "mouseMoved"
  };
  private MyButton
    b1 = new MyButton(Color.BLUE, "test1"),
    b2 = new MyButton(Color.RED, "test2");
  class MyButton extends JButton {
    void report(String field, String msg) {
      h.get(field).setText(msg);
    }
    FocusListener fl = new FocusListener() {
      public void focusGained(FocusEvent e) {
        report("focusGained", e.paramString());
      }
      public void focusLost(FocusEvent e) {
        report("focusLost", e.paramString());
      }
    };
    KeyListener kl = new KeyListener() {
      public void keyPressed(KeyEvent e) {
        report("keyPressed", e.paramString());
      }
      public void keyReleased(KeyEvent e) {
        report("keyReleased", e.paramString());
      }
      public void keyTyped(KeyEvent e) {
        report("keyTyped", e.paramString());
      }
    };
    MouseListener ml = new MouseListener() {
      public void mouseClicked(MouseEvent e) {
        report("mouseClicked", e.paramString());
      }
      public void mouseEntered(MouseEvent e) {
        report("mouseEntered", e.paramString());
      }
      public void mouseExited(MouseEvent e) {
        report("mouseExited", e.paramString());
      }
      public void mousePressed(MouseEvent e) {
        report("mousePressed", e.paramString());
      }
      public void mouseReleased(MouseEvent e) {
        report("mouseReleased", e.paramString());
      }
    };
    MouseMotionListener mml = new MouseMotionListener() {
      public void mouseDragged(MouseEvent e) {
        report("mouseDragged", e.paramString());
      }
      public void mouseMoved(MouseEvent e) {
        report("mouseMoved", e.paramString());
      }
    };
    public MyButton(Color color, String label) {
      super(label);
      setBackground(color);
      addFocusListener(fl);
      addKeyListener(kl);
      addMouseListener(ml);
      addMouseMotionListener(mml);
    }
  }
  public TrackEvent() {
    setLayout(new GridLayout(event.length + 1, 2));
    for(String evt : event) {
      JTextField t = new JTextField();
      t.setEditable(false);
      add(new JLabel(evt, JLabel.RIGHT));
      add(t);
      h.put(evt, t);
    }
    add(b1);
    add(b2);
  }
  public static void main(String[] args) {
    run(new TrackEvent(), 700, 500);
  }
} ///:~


text:
<?php
ob_start();
session_start();
require_once 'server/AdminDAO.php';
require_once 'server/model/Admin.php';
require_once 'server/CarDAO.php';

if (!isset($_SESSION['authenticated'])) {
    header('Location: sign-in.php');
} else {
    $q = new AdminDAO();
    $admin_data = $q->getAdminByUsername($_SESSION['adminUsername']);
    $c = new CarDAO();
}
?>
<!DOCTYPE html>

    <meta charset="utf-8">

    <title>AutoExpress - Raymart De Guzman</title>
    <meta name="title" content="AutoExpress - Raymart De Guzman">
    <meta name="description" content="AutoExpress a car dealership app built for both car dealer and car buyer. A car dealer manages the car being viewed on the website by adding, updating, deleting and uploading photos of a car. On the other hand, a car buyer can search for the vehicle he or she desired on the website. If the buyer finds the desired vehicle he or she can contact the seller to get more information of the vehicle. A car buyer can also calculate their monthly or bi-weekly payment.">
    <meta name="keywords" content="Raymart De Guzman, tramyardg.co.nf, tramyardg, PHP, car dealership, software engineer, car dealer, car buyer, AutoExpress.co.nf">

    <meta property="og:type" content="website">
    <meta property="og:title" content="AutoExpress.co.nf - Raymart De Guzman">
    <meta property="og:description" content="AutoExpress a car dealership app built for both car dealer and car buyer. A car dealer manages the car being viewed on the website by adding, updating, deleting and uploading photos of a car. On the other hand, a car buyer can search for the vehicle he or she desired on the website. If the buyer finds the desired vehicle he or she can contact the seller to get more information of the vehicle. A car buyer can also calculate their monthly or bi-weekly payment.">
    <meta property="og:image" content="https://raw.githubusercontent.com/tramyardg/autoexpress/master/image/homePage.PNG"/>

    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/templatemo_main.min.css">

Admin Panel

                <input type="text" class="hidden" id="admin-username" name="admin-username" value="<?php echo $admin_data[0]->getUsername(); ?>">

Dashboard

<?php echo count($q->getAllAdmin()); ?>

Administrators

                                    View Details

<?php echo $c->countAllCars(); ?>

Vehicles

                                    View Details


text:
#ifndef WebKitAnimationEvent_h
#define WebKitAnimationEvent_h

#include "Event.h"

namespace WebCore {

    class WebKitAnimationEvent : public Event {
    public:
        static PassRefPtr<WebKitAnimationEvent> create()
        {
            return adoptRef(new WebKitAnimationEvent);
        }
        static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
        {
            return adoptRef(new WebKitAnimationEvent(type, animationName, elapsedTime));
        }

        virtual ~WebKitAnimationEvent();

        void initWebKitAnimationEvent(const AtomicString& type,
                                bool canBubbleArg,
                                bool cancelableArg,
                                const String& animationName,
                                double elapsedTime);

        const String& animationName() const;
        double elapsedTime() const;

        virtual bool isWebKitAnimationEvent() const { return true; }

    private:
        WebKitAnimationEvent();
        WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime);

        String m_animationName;
        double m_elapsedTime;
    };

} // namespace WebCore

#endif // WebKitAnimationEvent_h


text:
package uz.support.v14.app.index;

import uz.support.v14.app.content.ContentFragment;

public abstract class IndexContentFragment extends ContentFragment {

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


text:
FROM node:8.9.0-alpine

# set pwd, ports, user, command
WORKDIR /ui
EXPOSE 4000
CMD ["node", "server.js"]

# copy application files
COPY stage/ /

# change ownership application files
RUN chown -R node:node /ui

# set user
USER node:node


text:
namespace Rollbar
{
    using System.IO;

    using Rollbar.Common;
    using Rollbar.PayloadStore;

    /// <summary>
    /// Class RollbarOfflineStoreOptions.
    /// Implements the <see cref="ReconfigurableBase{T, TBase}" />
    /// Implements the <see cref="IRollbarOfflineStoreOptions" />
    /// </summary>
    /// <seealso cref="ReconfigurableBase{T, TBase}" />
    /// <seealso cref="IRollbarOfflineStoreOptions" />
    public class RollbarOfflineStoreOptions
        : ReconfigurableBase<RollbarOfflineStoreOptions, IRollbarOfflineStoreOptions>
        , IRollbarOfflineStoreOptions
    {

        private const bool defaultEnableLocalPayloadStore = false;
        private static readonly string defaultLocalPayloadStoreFileName = PayloadStoreConstants.DefaultRollbarStoreDbFile;
        private static readonly string? defaultLocalPayloadStoreLocationPath = PayloadStoreConstants.DefaultRollbarStoreDbFileLocation;

        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarOfflineStoreOptions"/> class.
        /// </summary>
        public RollbarOfflineStoreOptions()
            : this(defaultEnableLocalPayloadStore, defaultLocalPayloadStoreFileName, defaultLocalPayloadStoreLocationPath)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarOfflineStoreOptions"/> class.
        /// </summary>
        /// <param name="enablePayloadStore">if set to <c>true</c> [enable payload store].</param>
        /// <param name="localPayloadStoreFileName">Name of the local payload store file.</param>
        /// <param name="LocalPayloadStoreLocationPath">The local payload store location path.</param>
        public RollbarOfflineStoreOptions(bool enablePayloadStore, string localPayloadStoreFileName, string? LocalPayloadStoreLocationPath)
        {
            this.EnableLocalPayloadStore = enablePayloadStore;
            this.LocalPayloadStoreFileName = localPayloadStoreFileName;
            this.LocalPayloadStoreLocationPath = LocalPayloadStoreLocationPath;
        }
        /// <summary>
        /// Gets a value indicating whether to enable local payload store.
        /// </summary>
        /// <value><c>true</c> if to enable local payload store; otherwise, <c>false</c>.</value>
        public bool EnableLocalPayloadStore
        {
            get;
            set;
        }
        /// <summary>
        /// Gets the name of the local payload store file.
        /// </summary>
        /// <value>The name of the local payload store file.</value>
        public string? LocalPayloadStoreFileName
        {
            get;
            set;
        }
        /// <summary>
        /// Gets the local payload store location path.
        /// </summary>
        /// <value>The local payload store location path.</value>
        public string? LocalPayloadStoreLocationPath
        {
            get;
            set;
        }

        /// <summary>
        /// Reconfigures this object similar to the specified one.
        /// </summary>
        /// <param name="likeMe">The pre-configured instance to be cloned in terms of its configuration/settings.</param>
        /// <returns>Reconfigured instance.</returns>
        public override RollbarOfflineStoreOptions Reconfigure(IRollbarOfflineStoreOptions likeMe)
        {
            return base.Reconfigure(likeMe);
        }

        /// <summary>
        /// Gets the proper validator.
        /// </summary>
        /// <returns>Validator.</returns>
        public override Validator? GetValidator()
        {
            return null;
        }

        /// <summary>
        /// Gets the name of the local payload store full path.
        /// </summary>
        /// <returns>System.String.</returns>
        internal string? GetLocalPayloadStoreFullPathName()
        {
            string? dbLocation = string.IsNullOrWhiteSpace(this.LocalPayloadStoreLocationPath)
                ? PayloadStoreConstants.DefaultRollbarStoreDbFileLocation
                : this.LocalPayloadStoreLocationPath;

            string? dbFile = string.IsNullOrWhiteSpace(this.LocalPayloadStoreFileName)
                ? PayloadStoreConstants.DefaultRollbarStoreDbFile
                : this.LocalPayloadStoreFileName;

            string? result = string.IsNullOrWhiteSpace(dbLocation)
                ? dbFile
                : Path.Combine(dbLocation, dbFile);

            return result;
        }

        IRollbarOfflineStoreOptions IReconfigurable<IRollbarOfflineStoreOptions, IRollbarOfflineStoreOptions>.Reconfigure(IRollbarOfflineStoreOptions likeMe)
        {
            return this.Reconfigure(likeMe);
        }
    }
}


text:
package org.vaadin.viritinv7.grid;

import com.vaadin.v7.data.Item;
import org.vaadin.viritinv7.ListContainer;

/**
 *
 * @author datenhahn (http://datenhahn.de)
 * @since 23.04.2016
 * @param <M> the entity type listed in the consumer of the generator's container, Vaadin Grid
 */
public class StringPropertyValueGenerator<M> extends TypedPropertyValueGenerator<M, String> {

    public StringPropertyValueGenerator(Class<M> modelType, ValueGenerator<M> valueGenerator) {
        super(modelType, String.class, valueGenerator);
    }

    @Override
    public String getValue(Item item, Object itemId, Object propertyId) {
        return valueGenerator.getValue((M) ((ListContainer.DynaBeanItem) item).getBean());
    }

    public interface ValueGenerator<M> extends TypedPropertyValueGenerator.ValueGenerator<M, String> {
        @Override
        String getValue(M bean);
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

     <item
        android:id="@+id/online_item"
        android:title="上线"
        />
     <item
        android:id="@+id/offline_item"
        android:title="下线"/>

</menu>


text:
Apache ActiveMQ Artemis distributes a native library, used as a bridge for its fast journal, between Apache ActiveMQ Artemis
and Linux libaio.

`libaio` is a library, developed as part of the Linux kernel project.
With `libaio` we submit writes to the operating system where they are
processed asynchronously. Some time later the OS will call our code back
when they have been processed.

We use this in our high performance journal if configured to do so,
please see [Persistence](persistence.md).

These are the native libraries distributed by Apache ActiveMQ Artemis:

-   libartemis-native-64.so - x86 64 bits
-   We distributed a 32-bit version until early 2017. While it's not available on the distribution any longer it should still be possible to compile to a 32-bit environment if needed.

When using libaio, Apache ActiveMQ Artemis will always try loading these files as long
as they are on the [library path](using-server.md#library-path)

## Runtime dependencies

If you just want to use the provided native binaries you need to install the required libaio dependency.

You can install libaio using the following steps as the root user:

Using yum, (e.g. on Fedora or Red Hat Enterprise Linux):

    yum install libaio

Using aptitude, (e.g. on Ubuntu or Debian system):

    apt-get install libaio

## Compiling the native libraries

In the case that you are using Linux on a platform other than x86\_32 or
x86\_64 (for example Itanium 64 bits or IBM Power) you may need to
compile the native library, since we do not distribute binaries for
those platforms with the release.

## Compilation dependencies

> **Note**
>
> The native layer is only available on Linux. If you are
> in a platform other than Linux the native compilation will not work

These are the required linux packages to be installed for the compilation to work:

-   gcc - C Compiler

-   gcc-c++ or g++ - Extension to gcc with support for C++

-   libtool - Tool for link editing native libraries

-   libaio - library to disk asynchronous IO kernel functions

-   libaio-dev - Compilation support for libaio

-   cmake

-   A full JDK installed with the environment variable JAVA\_HOME set to
    its location

To perform this installation on RHEL or Fedora, you can simply type this at a command line:

    sudo yum install libtool gcc-c++ gcc libaio libaio-devel cmake

Or on Debian systems:

    sudo apt-get install libtool gcc-g++ gcc libaio libaio- cmake

> **Note**
>
> You could find a slight variation of the package names depending on
> the version and Linux distribution. (for example gcc-c++ on Fedora
> versus g++ on Debian systems)

## Invoking the compilation

In the source distribution or git clone, in the `artemis-native` directory, execute the shell
script `compile-native.sh`. This script will invoke the proper commands to perform the native build.

If you want more information refer to the [cmake web pages](https://cmake.org).


text:
package kvledger

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"testing"

	"github.com/golang/protobuf/proto"
	"github.com/hyperledger/fabric-config/protolator"
	cb "github.com/hyperledger/fabric-protos-go/common"
	pb "github.com/hyperledger/fabric-protos-go/peer"
	"github.com/hyperledger/fabric/common/channelconfig"
	"github.com/hyperledger/fabric/common/configtx/test"
	"github.com/hyperledger/fabric/common/ledger/blkstorage"
	"github.com/hyperledger/fabric/common/ledger/testutil"
	"github.com/hyperledger/fabric/common/metrics/disabled"
	"github.com/hyperledger/fabric/core/ledger"
	"github.com/hyperledger/fabric/core/ledger/mock"
	"github.com/hyperledger/fabric/protoutil"
	"github.com/stretchr/testify/require"
)

func TestNamespacesAndCollections(t *testing.T) {
	channelName := "testnamespacesandcollections"
	basePath := t.TempDir()
	blkStoreProvider, blkStore := openBlockStorage(t, channelName, basePath)
	defer blkStoreProvider.Close()

	// add genesis block and another config block so that we can retrieve MSPIDs
	// 3 orgs/MSPIDs are added: SampleOrg/SampleOrg, org1/Org1MSP, org2/Org2MSP
	genesisBlock, err := test.MakeGenesisBlock(channelName)
	require.NoError(t, err)
	require.NoError(t, blkStore.AddBlock(genesisBlock))
	orgGroups := createTestOrgGroups(t)
	config := getConfigFromBlock(genesisBlock)
	config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups["org1"] = orgGroups["org1"]
	config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups["org2"] = orgGroups["org2"]
	configEnv := getEnvelopeFromConfig(channelName, config)
	configBlock := newBlock([]*cb.Envelope{configEnv}, 1, 1, protoutil.BlockHeaderHash(genesisBlock.Header))
	require.NoError(t, blkStore.AddBlock(configBlock))

	// prepare fakeDeployedCCInfoProvider to create mocked test data
	deployedccInfo := map[string]*ledger.DeployedChaincodeInfo{
		"cc1": {
			Name:                        "cc1",
			Version:                     "version",
			Hash:                        []byte("cc1-hash"),
			ExplicitCollectionConfigPkg: prepareCollectionConfigPackage([]string{"collectionA", "collectionB"}),
		},
		"cc2": {
			Name:    "cc2",
			Version: "version",
			Hash:    []byte("cc2-hash"),
		},
	}
	fakeDeployedCCInfoProvider := &mock.DeployedChaincodeInfoProvider{}
	fakeDeployedCCInfoProvider.NamespacesReturns([]string{"_lifecycle", "lscc"})
	fakeDeployedCCInfoProvider.AllChaincodesInfoReturns(deployedccInfo, nil)
	fakeDeployedCCInfoProvider.GenerateImplicitCollectionForOrgStub = func(mspID string) *pb.StaticCollectionConfig {
		return &pb.StaticCollectionConfig{
			Name: fmt.Sprintf("_implicit_org_%s", mspID),
		}
	}

	// verify NamespacesAndCollections
	channelInfoProvider := &channelInfoProvider{channelName, blkStore, fakeDeployedCCInfoProvider}
	expectedNamespacesAndColls := map[string][]string{
		"cc1":        {"_implicit_org_Org1MSP", "_implicit_org_Org2MSP", "_implicit_org_SampleOrg", "collectionA", "collectionB"},
		"cc2":        {"_implicit_org_Org1MSP", "_implicit_org_Org2MSP", "_implicit_org_SampleOrg"},
		"_lifecycle": {"_implicit_org_Org1MSP", "_implicit_org_Org2MSP", "_implicit_org_SampleOrg"},
		"lscc":       {},
		"":           {},
	}
	namespacesAndColls, err := channelInfoProvider.NamespacesAndCollections(nil)
	require.NoError(t, err)
	require.Equal(t, len(expectedNamespacesAndColls), len(namespacesAndColls))
	for ns, colls := range expectedNamespacesAndColls {
		require.ElementsMatch(t, colls, namespacesAndColls[ns])
	}
}

// TestGetAllMSPIDs verifies getAllMSPIDs by adding and removing organizations to the channel config.
func TestGetAllMSPIDs(t *testing.T) {
	channelName := "testgetallmspids"
	basePath := t.TempDir()

	blkStoreProvider, blkStore := openBlockStorage(t, channelName, basePath)
	defer blkStoreProvider.Close()
	channelInfoProvider := &channelInfoProvider{channelName, blkStore, nil}

	var block *cb.Block
	var configBlock *cb.Block
	lastBlockNum := uint64(0)
	lastConfigBlockNum := uint64(0)

	// verify GetAllMSPIDs in a corner case where the channel has no block
	verifyGetAllMSPIDs(t, channelInfoProvider, nil)

	// add genesis block and verify GetAllMSPIDs when the channel has only genesis block
	// the genesis block is created for org "SampleOrg" with MSPID "SampleOrg"
	configBlock, err := test.MakeGenesisBlock(channelName)
	require.NoError(t, err)
	require.NoError(t, blkStore.AddBlock(configBlock))
	verifyGetAllMSPIDs(t, channelInfoProvider, []string{"SampleOrg"})

	// add some blocks and verify GetAllMSPIDs
	block = configBlock
	for i := 0; i < 3; i++ {
		lastBlockNum++
		block = newBlock([]*cb.Envelope{}, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(block.Header))
		require.NoError(t, blkStore.AddBlock(block))
	}
	verifyGetAllMSPIDs(t, channelInfoProvider, []string{"SampleOrg"})

	// create test org groups, update the config by adding org1 (Org1MSP) and org2 (Org2MSP)
	orgGroups := createTestOrgGroups(t)
	config := getConfigFromBlock(configBlock)
	config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups["org1"] = orgGroups["org1"]
	config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups["org2"] = orgGroups["org2"]

	// add the config block and verify GetAllMSPIDs
	lastBlockNum++
	lastConfigBlockNum = lastBlockNum
	configEnv := getEnvelopeFromConfig(channelName, config)
	configBlock = newBlock([]*cb.Envelope{configEnv}, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(block.Header))
	require.NoError(t, blkStore.AddBlock(configBlock))
	verifyGetAllMSPIDs(t, channelInfoProvider, []string{"Org1MSP", "Org2MSP", "SampleOrg"})

	// update the config by removing "org1"
	config = getConfigFromBlock(configBlock)
	delete(config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups, "org1")

	// add the config block and verify GetAllMSPIDs
	lastBlockNum++
	lastConfigBlockNum = lastBlockNum
	configEnv = getEnvelopeFromConfig(channelName, config)
	configBlock = newBlock([]*cb.Envelope{configEnv}, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(configBlock.Header))
	require.NoError(t, blkStore.AddBlock(configBlock))
	verifyGetAllMSPIDs(t, channelInfoProvider, []string{"Org1MSP", "Org2MSP", "SampleOrg"})

	// add some blocks and verify GetAllMSPIDs
	block = configBlock
	for i := 0; i < 2; i++ {
		lastBlockNum++
		block = newBlock([]*cb.Envelope{}, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(block.Header))
		require.NoError(t, blkStore.AddBlock(block))
	}
	verifyGetAllMSPIDs(t, channelInfoProvider, []string{"Org1MSP", "Org2MSP", "SampleOrg"})

	// verify the orgs in most recent config block
	lastConfigBlock, err := channelInfoProvider.mostRecentConfigBlockAsOf(lastBlockNum)
	require.NoError(t, err)
	config = getConfigFromBlock(lastConfigBlock)
	require.Equal(t, 2, len(config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups))
	require.Contains(t, config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups, "SampleOrg")
	require.Contains(t, config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups, "org2")
}

func TestGetAllMSPIDs_NegativeTests(t *testing.T) {
	channelName := "testgetallmspidsnegativetests"
	basePath := t.TempDir()

	blkStoreProvider, blkStore := openBlockStorage(t, channelName, basePath)
	defer blkStoreProvider.Close()
	channelInfoProvider := &channelInfoProvider{channelName, blkStore, nil}

	var configBlock *cb.Block
	lastBlockNum := uint64(0)
	lastConfigBlockNum := uint64(0)

	// add genesis block
	configBlock, err := test.MakeGenesisBlock(channelName)
	require.NoError(t, err)
	require.NoError(t, blkStore.AddBlock(configBlock))

	// test ExtractMSPIDsForApplicationOrgs error by having a malformed config block
	lastBlockNum++
	lastConfigBlockNum++
	configBlock = newBlock([]*cb.Envelope{}, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(configBlock.Header))
	require.NoError(t, blkStore.AddBlock(configBlock))
	_, err = channelInfoProvider.getAllMSPIDs()
	require.EqualError(t, err, "malformed configuration block: envelope index out of bounds")

	// test RetrieveBlockByNumber error by using a non-existent block num for config block index
	lastBlockNum++
	lastConfigBlockNum++
	configBlock = newBlock(nil, lastBlockNum, lastBlockNum+1, protoutil.BlockHeaderHash(configBlock.Header))
	require.NoError(t, blkStore.AddBlock(configBlock))
	_, err = channelInfoProvider.getAllMSPIDs()
	require.EqualError(t, err, "no such block number [3] in index")

	// test GetLastConfigIndexFromBlock error by using invalid bytes for LastConfig metadata value
	lastBlockNum++
	lastConfigBlockNum++
	configBlock = newBlock(nil, lastBlockNum, lastConfigBlockNum, protoutil.BlockHeaderHash(configBlock.Header))
	configBlock.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = []byte("invalid_bytes")
	require.NoError(t, blkStore.AddBlock(configBlock))
	_, err = channelInfoProvider.getAllMSPIDs()
	require.ErrorContains(t, err, "failed to retrieve metadata: error unmarshalling metadata at index [SIGNATURES]")

	// test RetrieveBlockByNumber error (before calling GetLastConfigIndexFromBlock) by closing block store provider
	blkStoreProvider.Close()
	_, err = channelInfoProvider.getAllMSPIDs()
	require.Contains(t, err.Error(), "leveldb: closed")
}

func openBlockStorage(t *testing.T, channelName string, basePath string) (*blkstorage.BlockStoreProvider, *blkstorage.BlockStore) {
	blkStoreProvider, err := blkstorage.NewProvider(
		blkstorage.NewConf(basePath, maxBlockFileSize),
		&blkstorage.IndexConfig{AttrsToIndex: attrsToIndex},
		&disabled.Provider{},
	)
	require.NoError(t, err)
	blkStore, err := blkStoreProvider.Open(channelName)
	require.NoError(t, err)
	return blkStoreProvider, blkStore
}

func verifyGetAllMSPIDs(t *testing.T, channelInfoProvider *channelInfoProvider, expectedMSPIDs []string) {
	mspids, err := channelInfoProvider.getAllMSPIDs()
	require.NoError(t, err)
	require.ElementsMatch(t, expectedMSPIDs, mspids)
}

func newBlock(env []*cb.Envelope, blockNum uint64, lastConfigBlockNum uint64, previousHash []byte) *cb.Block {
	block := testutil.NewBlock(env, blockNum, previousHash)
	block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = protoutil.MarshalOrPanic(&cb.Metadata{
		Value: protoutil.MarshalOrPanic(&cb.OrdererBlockMetadata{
			LastConfig: &cb.LastConfig{Index: lastConfigBlockNum},
		}),
	})
	return block
}

func getConfigFromBlock(block *cb.Block) *cb.Config {
	blockDataEnvelope := &cb.Envelope{}
	err := proto.Unmarshal(block.Data.Data[0], blockDataEnvelope)
	if err != nil {
		panic(err)
	}

	blockDataPayload := &cb.Payload{}
	err = proto.Unmarshal(blockDataEnvelope.Payload, blockDataPayload)
	if err != nil {
		panic(err)
	}

	config := &cb.ConfigEnvelope{}
	err = proto.Unmarshal(blockDataPayload.Data, config)
	if err != nil {
		panic(err)
	}

	return config.Config
}

func getEnvelopeFromConfig(channelName string, config *cb.Config) *cb.Envelope {
	return &cb.Envelope{
		Payload: protoutil.MarshalOrPanic(&cb.Payload{
			Header: &cb.Header{
				ChannelHeader: protoutil.MarshalOrPanic(&cb.ChannelHeader{
					ChannelId: channelName,
					Type:      int32(cb.HeaderType_CONFIG),
				}),
			},
			Data: protoutil.MarshalOrPanic(&cb.ConfigEnvelope{
				Config: config,
			}),
		}),
	}
}

// createTestOrgGroups returns application org ConfigGroups based on test_configblock.json.
// The config block contains the following organizations(MSPIDs): org1(Org1MSP) and org2(Org2MSP)
func createTestOrgGroups(t *testing.T) map[string]*cb.ConfigGroup {
	blockData, err := ioutil.ReadFile("testdata/test_configblock.json")
	require.NoError(t, err)
	block := &cb.Block{}
	require.NoError(t, protolator.DeepUnmarshalJSON(bytes.NewBuffer(blockData), block))
	config := getConfigFromBlock(block)
	return config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey].Groups
}

func prepareCollectionConfigPackage(collNames []string) *pb.CollectionConfigPackage {
	collConfigs := make([]*pb.CollectionConfig, len(collNames))
	for i, name := range collNames {
		collConfigs[i] = &pb.CollectionConfig{
			Payload: &pb.CollectionConfig_StaticCollectionConfig{
				StaticCollectionConfig: &pb.StaticCollectionConfig{
					Name: name,
				},
			},
		}
	}
	return &pb.CollectionConfigPackage{Config: collConfigs}
}


text:
//
//  SKPreferenceWindow.m
//  Skim
//
//  Created by Christiaan Hofman on 3/15/10.

#import "SKPreferenceWindow.h"

@implementation SKPreferenceWindow

- (void)toggleToolbarShown:(id)sender {}
- (void)runToolbarCustomizationPalette:(id)sender {}

- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
    if ([menuItem action] == @selector(toggleToolbarShown:) || [menuItem action] == @selector(runToolbarCustomizationPalette:))
        return NO;
    else if ([[SKPreferenceWindow superclass] instancesRespondToSelector:_cmd])
        return [super validateMenuItem:menuItem];
    else
        return YES;
}

@end


text:
Reports

    			<?php
    				if($currentSurvey) {
    					echo '
View real-time results as soon as your survey responses roll in.
Select a Survey:
';

                        $form=$this->beginWidget('CActiveForm');

        					echo $form->dropDownList(new Survey(), 'id', $survey_list_data, array(
        						'onChange' => "this.form.submit()",
        						'options'=> array(
        							$currentSurvey->id => array('selected'=>true)
        						)
        					));

                        $this->endWidget();
    				} else {
    					echo '
To get started, please create a new survey.

';
    				}?>

        	<?php

        		//output report
        		echo "
";
        		if($currentSurvey){
        	        if ($currentSurvey->questions == null) {
        	            echo '
Oops! First, create some questions for "' . $currentSurvey->title . '".

';
        	        } else {
						echo '
' . $currentSurvey->title . '
';
						echo '

 Total number of people who took the survey:  ', count($currentSurvey->responseHashes), '

';

        	            echo CHtml::link('Download Full Report (.csv)', array('survey/export/id/'.$currentSurvey->id), array('class' => 'button'));
        	            echo "
";

                        $this->renderPartial('/site/_'.$type.'Chart',array(
                            'currentSurvey'=>$currentSurvey,
                            'survey_list_data'=>$survey_list_data,
                            'surveys'=>$surveys,
                        ));
        	        }

                }
        	?>


text:
'use strict'

const Model = require('trails/model')

/**
 * @module CustomerOrder
 * @description Customer Order
 */
module.exports = class CustomerOrder extends Model {

  static config (app, Sequelize) {
    return {
      options: {
        underscored: true
      }
    }
  }

  static schema (app, Sequelize) {
    return {
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      order_id: {
        type: Sequelize.INTEGER,
        unique: 'customerorder_order'
      },
      // order: {
      //   type: Sequelize.STRING,
      //   unique: 'customerorder_order'
      // },
      customer_id: {
        type: Sequelize.INTEGER,
        unique: 'customerorder_order',
        references: null
      }
    }
  }
}