text:
package com.joestelmach.natty;

import java.text.DateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;

import junit.framework.Assert;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.BeforeClass;

import com.joestelmach.natty.CalendarSource;
import com.joestelmach.natty.DateGroup;
import com.joestelmach.natty.Parser;

/**
 *
 * @author Joe Stelmach
 */
public class SearchTest extends AbstractTest {
  @BeforeClass
  public static void oneTime() {
    Locale.setDefault(Locale.US);
    TimeZone.setDefault(TimeZone.getTimeZone("US/Eastern"));
    initCalendarAndParser();
  }

  @Test
  @Ignore
  public void test() throws Exception {
    Date reference = DateFormat.getDateInstance(DateFormat.SHORT).parse("2/20/2011");
    CalendarSource.setBaseDate(reference);

    Parser parser = new Parser();
    List<DateGroup> groups = parser.parse("golf tomorrow at 9 AM at pebble beach");
    Assert.assertEquals(1, groups.size());
    DateGroup group = groups.get(0);
    Assert.assertEquals(1, group.getLine());
    Assert.assertEquals(5, group.getPosition());
    Assert.assertEquals(1, group.getDates().size());
    validateDate(group.getDates().get(0), 2, 21, 2011);
    validateTime(group.getDates().get(0), 9, 0, 0);

    groups = parser.parse("golf with friends tomorrow at 10 ");
    Assert.assertEquals(1, groups.size());
    group = groups.get(0);
    Assert.assertEquals(1, group.getLine());
    Assert.assertEquals(18, group.getPosition());
    Assert.assertEquals(1, group.getDates().size());
    validateDate(group.getDates().get(0), 2, 21, 2011);
    validateTime(group.getDates().get(0), 10, 0, 0);

    parser = new Parser();
    groups = parser.parse("golf with freinds tomorrow at 9 or Thursday at 10 am");
    Assert.assertEquals(1, groups.size());
    List<Date> dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 21, 2011);
    validateTime(dates.get(0), 9, 0, 0);
    validateDate(dates.get(1), 2, 24, 2011);
    validateTime(dates.get(1), 10, 0, 0);

    groups = parser.parse("golf with friends tomorrow at 9 or Thursday at 10");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 21, 2011);
    validateTime(dates.get(0), 9, 0, 0);
    validateDate(dates.get(1), 2, 24, 2011);
    validateTime(dates.get(1), 10, 0, 0);

    groups = parser.parse("I want to go to park tomorrow and then email john@aol.com");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 21, 2011);

    groups = parser.parse("I want to pay off all my debt in the next two years.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);
    validateDate(dates.get(1), 2, 20, 2013);

    groups = parser.parse("I want to purchase a car in the next month.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 3, 20, 2011);

    groups = parser.parse("I want to plan a get-together with my friends for this Friday.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 25, 2011);

    groups = parser.parse("I want to lose five pounds in the next two months.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);
    validateDate(dates.get(1), 4, 20, 2011);

    groups = parser.parse("I want to finalize my college schedule by next week.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 27, 2011);

    groups = parser.parse("I want to read this weekend.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 26, 2011);

    groups = parser.parse("I want to travel a big chunk of world next year.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 20, 2012);

    groups = parser.parse("last 2 weeks");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);
    validateDate(dates.get(1), 2, 6, 2011);

    groups = parser.parse("last 5 years");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);
    validateDate(dates.get(1), 2, 20, 2006);

    groups = parser.parse("next 5 years");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(2, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);
    validateDate(dates.get(1), 2, 20, 2016);

    groups = parser.parse("I want to go to my doctors appointment on May 15, 2011.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 5, 15, 2011);

    groups = parser.parse("I intend to become a zombie on December, 21st 2012.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 12, 21, 2012);

    groups = parser.parse("I want to hire a virtual assistant to do research for me on March 15, 2011");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 3, 15, 2011);

    groups = parser.parse("I want to see my mother on sunday.");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 27, 2011);

    groups = parser.parse("I want to be able to jog 3 miles non-stop by September.");
    Assert.assertEquals(2, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 3, 0, 0);
    dates = groups.get(1).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 9, 1, 2011);

    groups = parser.parse("I want to lose 10 lbs in 10 days");
    Assert.assertEquals(2, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 10, 0, 0);
    dates = groups.get(1).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 3, 2, 2011);

    groups = parser.parse("I want to visit my grandfathers grave on December 30 2011");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 12, 30, 2011);

    groups = parser.parse("i want to have 1 kid this year");
    Assert.assertEquals(2, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 1, 0, 0);
    dates = groups.get(1).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 2, 20, 2011);

    groups = parser.parse("save $1000 by September");
    Assert.assertEquals(2, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 10, 0, 0);
    dates = groups.get(1).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 9, 1, 2011);

    groups = parser.parse("have my son play at muse music in provo UT at the 3 band cause they always have fog on the third band at 7:30");
    Assert.assertEquals(2, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 3, 0, 0);
    dates = groups.get(1).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 7, 30, 0);

    groups = parser.parse("i want to eat chinese tonight");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDateTime(dates.get(0), 2, 20, 2011, 20, 0, 0);

    groups = parser.parse("Watch School Spirits on June 20 on syfy channel");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 6, 20, 2011);

    groups = parser.parse("Watch School Spirits on June 20 on");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 6, 20, 2011);

    groups = parser.parse("Watch School Spirits on June 20");
    Assert.assertEquals(1, groups.size());
    dates = groups.get(0).getDates();
    Assert.assertEquals(1, dates.size());
    validateDate(dates.get(0), 6, 20, 2011);

  }
}


text:
from glob import glob

from setuptools import setup, find_packages

def read_file(filename):
    try:
        return open(filename, "r").read()
    except IOError:
        return ""

setup(
    name="circuits",
    description="Asynchronous Component based Event Application Framework",
    long_description=open("README.rst").read().replace(
        ".. include:: examples/index.rst",
        read_file("examples/index.rst")
    ),
    author="James Mills",
    author_email="prologic@shortcircuit.net.au",
    url="http://circuitsframework.com/",
    download_url="http://bitbucket.org/circuits/circuits/downloads/",
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Environment :: Console",
        "Environment :: No Input/Output (Daemon)",
        "Environment :: Other Environment",
        "Environment :: Plugins",
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "Intended Audience :: Information Technology",
        "Intended Audience :: Science/Research",
        "Intended Audience :: System Administrators",
        "Intended Audience :: Telecommunications Industry",
        "License :: OSI Approved :: MIT License",
        "Natural Language :: English",
        "Operating System :: POSIX :: BSD",
        "Operating System :: POSIX :: Linux",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
        "Programming Language :: Python :: 2.6",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3.1",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: Implementation :: CPython",
        "Programming Language :: Python :: Implementation :: PyPy",
        "Topic :: Adaptive Technologies",
        "Topic :: Communications :: Chat :: Internet Relay Chat",
        "Topic :: Communications :: Email :: Mail Transport Agents",
        "Topic :: Database",
        "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
        "Topic :: Software Development :: Libraries :: Application Frameworks",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: System :: Clustering",
        "Topic :: System :: Distributed Computing"],
    license="MIT",
    keywords="event framework distributed concurrent component asynchronous",
    platforms="POSIX",
    packages=find_packages(
        exclude=[
            "*.tests",
            "*.tests.*",
            "tests.*",
            "tests",
            "*.fabfile",
            "*.fabfile.*",
            "fabfile.*",
            "fabfile",
        ]
    ),
    scripts=glob("bin/*"),
    install_requires=[],
    entry_points={
        "console_scripts": [
            "circuits.web=circuits.web.main:main",
        ]
    },
    test_suite="tests.main.main",
    zip_safe=True,
    use_scm_version={
        "write_to": "circuits/version.py",
    },
    setup_requires=[
        "setuptools_scm"
    ],
)

redpajama_set_name: RedPajamaGithub


text:
<script type="text/javascript" src="{{STATIC_URL}}js/farbtastic.js"></script>
<link rel="stylesheet" href="{{STATIC_URL}}css/farbtastic.css" type="text/css" />


text:
SCRIPT_NAME=$0

#########################
# FUNCTION: debug()
#   print a debug message
##########################
debug(){
  # print the message
  if [ "${DEBUG}" = "Y" ]; then
    echo "DEBUG:: $1"
  fi
  # $2=echo blank lines
  c=$2
  x=0
  if [ "${c}" != "" ]; then
    while [ ${x} -lt ${c} ]
    do
      echo ""
      x="`expr ${x} + 1`"
    done
  fi
}

#########################
# FUNCTION: usage()
#   print a usage message
##########################
usage() {
  echo "usage: ${SCRIPT_NAME} [CONFIG_FILE]  [PLAN_FILE_LIST]  [PDTOOL_HOME]  [REGRESSION_HOME]  [LOG_PATH] [DEBUG]"
  echo "   Missing parameter: $1"
  echo "TRUE" > status/status_exit_${INP_VERSION}.txt
  exit 2
}

#########################
# FUNCTION: logDate()
#   log the date
##########################
logDate() {
  _LOG_PATH=$1
  _TEXT=$2
  echo "`date +%Y-%m-%d-%H:%M:%S`${_TEXT}" >> "${_LOG_PATH}"
}

#########################
# BEGIN MAIN
##########################
# Get the parameters and remove surrounding quotes
CONFIG_FILE=$1
if [ "${CONFIG_FILE}" = "" ]; then usage "CONFIG_FILE"; fi

PLAN_FILE_LIST=$2
if [ "${PLAN_FILE_LIST}" = "" ]; then usage "PLAN_FILE_LIST"; fi

PDTOOL_HOME=$3
if [ "${PDTOOL_HOME}" = "" ]; then usage "PDTOOL_HOME"; fi

export REGRESSION_HOME=$4
if [ "${REGRESSION_HOME}" = "" ]; then usage "REGRESSION_HOME"; fi

LOG_PATH=$5
if [ "${LOG_PATH}" = "" ]; then usage "LOG_PATH"; fi

LOG_HOME=$6
if [ "${LOG_HOME}" = "" ]; then usage "LOG_HOME"; fi

STATUS_DIR=$7
if [ "${STATUS_DIR}" = "" ]; then usage "STATUS_DIR"; fi

DEBUG=$8
if [ "${LOG_HOME}" = "" ]; then DEBUG="N"; fi

if [ "${INP_VERSION}" = "" ]; then
  echo "USAGE: regression_config_driver.sh [regression_config_list.txt] [PDTOOL_HOME] [DEBUG=Y or N] [INP_VERSION]"
  echo "Provide the input version INP_VERSION."
  echo ""
  echo "e.g. regression_config_driver.bat regression_win_6.2_config.txt \"/u01/qa/home/PDTool6.2\" Y 6.2"
  exit 2
fi

# Set environment variables
CONFIG_FILE_PROP="${CONFIG_FILE}.properties"
REGRESSION_CONFIG="${REGRESSION_HOME}/config"
REGRESSION_PLANS="${REGRESSION_HOME}/plans"
REGRESSION_PLAN_LISTS="${REGRESSION_HOME}/plan_lists"
PDTOOL_CONFIG="${PDTOOL_HOME}/resources/config"

# Check existence of files and directories
if [ ! -d "${REGRESSION_HOME}" ]; then
  echo "The regression home directory that was provided does not exist: ${REGRESSION_HOME}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -d "${PDTOOL_HOME}" ]; then
  echo "The PDtool home directory that was provided does not exist: ${PDTOOL_HOME}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -f "${REGRESSION_CONFIG}/${CONFIG_FILE_PROP}" ]; then
  echo "The PDTool configuration file that was provided does not exist: ${CONFIG_FILE_PROP}"
  echo "PDTool regression config directory: ${REGRESSION_CONFIG}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -f "${REGRESSION_PLAN_LISTS}/${PLAN_FILE_LIST}" ]; then
  echo "The regression list file that was provided does not exist: ${PLAN_FILE_LIST}"
  echo "PDTool regression plan list directory: ${REGRESSION_PLAN_LISTS}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -f "${LOG_PATH}" ]; then
  echo "The regression log file that was provided does not exist: ${LOG_PATH}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -d "${REGRESSION_PLANS}" ]; then
  echo "The regression deployment plans directory does not exist: ${REGRESSION_PLANS}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi
if [ ! -d "${LOG_HOME}" ]; then
  echo "The regression log file that was provided does not exist: ${LOG_HOME}"
  echo "TRUE" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
  exit 3
fi

cd "${REGRESSION_HOME}"

# Save the current log file
if [ ! -d "${PDTOOL_HOME}/logs" ]; then
  mkdir -p "${PDTOOL_HOME}/logs"
fi
if [ -f "${PDTOOL_HOME}/logs/app.log" ]; then
  cp -f "${PDTOOL_HOME}/logs/app.log"  "${PDTOOL_HOME}/logs/app.log.sav"
fi

# Copy the regression configuration file to PDTool/config
cp -f "${REGRESSION_CONFIG}/${CONFIG_FILE_PROP}" "${PDTOOL_CONFIG}"

# Initialize the log file for this configuration execution
echo "-----------------------------------------------------" >> "${LOG_PATH}"
echo "Regression Test for ${CONFIG_FILE_PROP}" >> "${LOG_PATH}"
logDate "${LOG_PATH}" ""
echo "-----------------------------------------------------" >> "${LOG_PATH}"

STATUS_PLAN_OVERALL="`cat ${STATUS_DIR}/status_plan_overall_${INP_VERSION}.txt`"
STATUS_EXIT="`cat ${STATUS_DIR}/status_exit_${INP_VERSION}.txt`"
debug "${SCRIPT_NAME}: STATUS_PLAN_OVERALL=${STATUS_PLAN_OVERALL}" 0
debug "${SCRIPT_NAME}: STATUS_EXIT=${STATUS_EXIT}" 0

NUM_PLANS=0
echo "${NUM_PLANS}">${STATUS_DIR}/num_plans_${INP_VERSION}.txt

# Read the file
IFS="\n"
while read fileline
do
  # Remove leading/trailing white space
  filelineTrim="`echo ${fileline} | sed 's/^ *//g'`"
  # Test for comment (#) in 1st character or blank line
  CHAR1="`echo ${filelineTrim} | cut -b 0-1`"
  proceed="Y"
  if [ "${CHAR1}" == "#" ]; then proceed="N"; fi
  if [ "${filelineTrim}" == "" ]; then proceed="N"; fi

  # Proceed if not a comment or blank line
  if [ "${proceed}" == "Y" ]; then
    c=0
    IFS=" "
    for word in ${fileline}
    do
      c="`expr ${c} + 1`"
      if [ ${c} -eq 1 ]; then
          planFile="${word}"
      fi
    done

	# Execute the plan file using PDTool ExecutePDTool.sh script
    echo ""
    echo "###########################################################################"
    echo "Execute: "
    echo "   Plan file Name = ${planFile}"
    echo "###########################################################################"
    echo ""
    # Initialize the PDTool log file (app.log)
    echo "" > "${PDTOOL_HOME}/logs/app.log"

    PLAN_FILE_PATH="${REGRESSION_PLANS}/${planFile}"

    if [ -f "${PLAN_FILE_PATH}" ]; then
	  CURR_DIR="`pwd`"
	  cd "${PDTOOL_HOME}/bin"
	  echo "./ExecutePDTool.sh -exec \"${PLAN_FILE_PATH}\" -config ${CONFIG_FILE_PROP}"
	  echo ""
	  ./ExecutePDTool.sh -exec "${PLAN_FILE_PATH}" -config ${CONFIG_FILE_PROP}
	  ERROR=$?
	  if [ $ERROR -ne 0 ]; then
		ret="FAIL"
	  else
		ret="PASS"
	  fi

	  # Increment the number of plans executed by 1
	  NUM_PLANS="`expr ${NUM_PLANS} + 1`"

	  cd "${CURR_DIR}"
	  MSG="${ret}: ${PLAN_FILE_PATH}"
	  echo "$MSG" >> "${LOG_PATH}"
	  debug "" 0
	  debug "${SCRIPT_NAME}: $MSG" 0
	  if [ "${ret}" = "FAIL"  ]; then
	    echo "${ret}" > ${STATUS_DIR}/status_plan_overall_${INP_VERSION}.txt
	    echo "${ret}" > ${STATUS_DIR}/status_config_overall_${INP_VERSION}.txt
	  fi
    else
	  MSG="FAIL: Plan file does not exist at location: ${PLAN_FILE_PATH}"
	  echo "$MSG" >> "${LOG_PATH}"
      echo "$MSG" >> "${PDTOOL_HOME}/logs/app.log"
	  echo "$MSG"
      STATUS_EXIT="TRUE"
	  echo "${STATUS_EXIT}" > ${STATUS_DIR}/status_exit_${INP_VERSION}.txt
	  STATUS_PLAN_OVERALL="FAIL"
      echo "${STATUS_PLAN_OVERALL}" > ${STATUS_DIR}/status_plan_overall_${INP_VERSION}.txt
      echo "${STATUS_PLAN_OVERALL}" > ${STATUS_DIR}/status_config_overall_${INP_VERSION}.txt
    fi

    # Copy the PDTool log (app.log) to the specified plan file log
    cp -f "${PDTOOL_HOME}/logs/app.log"  "${LOG_HOME}/${CONFIG_FILE}-${planFile}.log"

    # Check for exit status
    if [ "${STATUS_EXIT}" = "TRUE" ]; then
	  break;
	fi
  fi
  IFS="\n"
done < "${REGRESSION_PLAN_LISTS}/${PLAN_FILE_LIST}"

echo "${NUM_PLANS}">${STATUS_DIR}/num_plans_${INP_VERSION}.txt

# Output the end date/time
echo "-----------------------------------------------------" >> "${LOG_PATH}"
logDate "${LOG_PATH}" "  Number Plans Executed: ${NUM_PLANS}"

# Overall status for this configuration and plan file list
STATUS_PLAN_OVERALL="`cat ${STATUS_DIR}/status_plan_overall_${INP_VERSION}.txt`"
debug "${SCRIPT_NAME}: STATUS_PLAN_OVERALL=${STATUS_PLAN_OVERALL}" 0
echo "${STATUS_PLAN_OVERALL}: Overall status for ${CONFIG_FILE_PROP} and ${PLAN_FILE_LIST}" >> "${LOG_PATH}"
echo "-----------------------------------------------------" >> "${LOG_PATH}"
echo "" >> "${LOG_PATH}"

# Restore the current log file
mv "${PDTOOL_HOME}/logs/app.log.sav"  "${PDTOOL_HOME}/logs/app.log"

if [ "${STATUS_PLAN_OVERALL}" = "PASS" ]; then
  exit 0
else
  exit 1
fi


text:
"""
Buy and sell items on the auction house.
"""
import datetime
import logging
import time
import os

import pydarkstar.logutils
import pydarkstar.itemlist
import pydarkstar.options
import pydarkstar.common

import pydarkstar.database
import pydarkstar.auction.manager

class Options(pydarkstar.options.Options):
    """
    Reads options from config file, then from command line.
    """
    def __init__(self):
        super(Options, self).__init__(config='broker.yaml', description=__doc__)

        # logging
        self.verbose  = False # error, info, and debug
        self.silent   = False # error only

        # input
        self.data     = []    # list of itemdata
        self.find     = False # search for item data

        # output
        self.save     = False # save config

        # sql
        self.hostname = '127.0.0.1'
        self.database = 'dspdb'
        self.username = 'root'
        self.password = ''
        self.fail     = False # fail on SQL errors

        # cleaning
        self.clear    = False # clear items sold by broker
        self.all      = False # clear all items
        self.force    = False # clear all items check

        # selling
        self.name     = 'Zissou' # seller name
        self.restock  = 3600     # restock tick
        self.refill   = False    # restock at start

        # buying
        self.tick     = 30    # buying interval

        # logging
        self.add_argument('--verbose', action='store_true',
            help='report debug, info, and error')
        self.add_argument('--silent', action='store_true',
            help='report error only')

        # input
        self.add_argument(dest='data', nargs='*', type=str, default=self.data,
            metavar='str', help='item data CSV file(s)')
        self.add_argument('--find', action='store_true',
            help='search for item data files')

        # output
        self.add_argument('--save', action='store_true',
            help='save config file (and exit)')

        # sql
        self.add_argument('--hostname', default=self.hostname, type=str,
            metavar='str', help='SQL address')
        self.add_argument('--database', default=self.database, type=str,
            metavar='str', help='SQL database')
        self.add_argument('--username', default=self.username, type=str,
            metavar='str', help='SQL username')
        self.add_argument('--password', default=self.password, type=str,
            metavar='str', help='SQL password')
        self.exclude('password')
        self.add_argument('--fail', action='store_true',
            help='fail on SQL errors')

        # cleaning
        self.add_argument('--clear', action='store_true',
            help='clear items sold by seller')
        self.add_argument('--all', action='store_true',
            help='clear *all* items')
        self.add_argument('--force', action='store_true',
            help='clear *all* items')

        # selling
        self.add_argument('--name', type=str, default=self.name,
            metavar='str', help='seller name')
        self.add_argument('--restock', type=int, default=self.restock,
            metavar='int', help='restock interval in seconds')
        self.add_argument('--refill', action='store_true',
            help='restock items at start and exit')

        # buying
        self.add_argument('--tick', type=int, default=self.tick,
            metavar='int', help='buying interval in seconds')

    def parse_args(self, args=None):
        super(Options, self).parse_args(args)
        self.data = set(self.data)

        # find data files
        if self.find:
            found = list(pydarkstar.common.findFiles(
                top=os.getcwd(), regex=r'.*\.csv', r=False, ignorecase=True))
            self.data.update(found)

        self.data = list(self.data)

def main():
    """
    Main function.
    """
    # get options
    opts = Options()
    opts.parse_args()
    pydarkstar.logutils.basicConfig(
        verbose=opts.verbose, silent=opts.silent, fname='broker.log')
    logging.info('start')

    # log options
    opts.log_values(level=logging.INFO)

    # save options
    if opts.save:
        opts.save = False
        opts.dump()
        return

    # connect to database
    db = pydarkstar.database.Database.pymysql(
        hostname=opts.hostname,
        database=opts.database,
        username=opts.username,
        password=opts.password,
    )

    # create auction house manager
    manager = pydarkstar.auction.manager.Manager(db, fail=opts.fail)
    manager.seller.seller_name = opts.name
    manager.buyer.buyer_name   = opts.name

    if opts.clear:
        # clear all items
        if opts.all:
            # really?
            if not opts.force:
                raise RuntimeError('clearing all items from auction house is dangerous. use --force')
            else:
                manager.cleaner.clear(seller=None)
        # clear seller items
        else:
            manager.cleaner.clear(seller=manager.seller.seller)

        # exit after clearing
        logging.info('exit after clear')
        return

    # make sure there is data
    if not opts.data:
        raise RuntimeError('missing item data CSV!')

    # load data
    logging.info('loading item data...')
    idata = pydarkstar.itemlist.ItemList()
    for f in opts.data:
        idata.loadcsv(f)

    if opts.refill:
        logging.info('restocking...')
        manager.restockItems(itemdata=idata)
        logging.info('exit after restock')
        return

    logging.info('starting main loop...')
    start = datetime.datetime.now()
    last  = start
    while True:
        now = datetime.datetime.now()
        delta = (now - last).total_seconds()
        elapsed = (now - start).total_seconds()
        logging.debug('time=%012.1f s last restock=%012.1f s next restock=%012.1f s',
            elapsed, delta, opts.restock - delta)

        if delta >= opts.restock:
            logging.info('restocking...')
            manager.restockItems(itemdata=idata)
            last = datetime.datetime.now()

        # buy items
        manager.buyItems(itemdata=idata)

        # sleep until next tick
        logging.debug('wait=%012.1f s', opts.tick)
        time.sleep(opts.tick)

def cleanup():
    logging.info('exit\n')

if __name__ == '__main__':
    with pydarkstar.logutils.capture():
        main()
    cleanup()


text:
layout: post
title: 50 Must-have plugins for extending Twitter Bootstrap
date: 2014-10-15 11:30
author: administrator
comments: true
categories: [HTML/CSS]
---
http://tutorialzine.com/2013/07/50-must-have-plugins-for-extending-twitter-bootstrap/


text:
<?php

namespace eXistenZNL\PermCheck\Config;

/**
 * The abstract class for the config
 *
 * @package eXistenZNL\PermCheck\Config
 */
abstract class AbstractConfig implements ConfigInterface
{
    /**
     * @var \ArrayIterator
     */
    protected $excludedFiles;

    /**
     * @var \ArrayIterator
     */
    protected $excludedDirs;

    /**
     * @var \ArrayIterator
     */
    protected $executableFiles;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->excludedFiles = new \ArrayIterator();
        $this->excludedDirs = new \ArrayIterator();
        $this->executableFiles = new \ArrayIterator();
    }

    /**
     * Add a file that's excluded from checking
     *
     * @param string $file The file that's excluded from checking.
     * @return void
     */
    public function addExcludedFile($file)
    {
        $this->excludedFiles->append($file);
    }

    /**
     * Add a directory that's excluded from checking
     *
     * @param string $dir The directory that's excluded from checking.
     * @return void
     */
    public function addExcludedDir($dir)
    {
        $this->excludedDirs->append($dir);
    }

    /**
     * Add a file that's supposed to be executable
     *
     * @param string $file The file that should be executable.
     * @return void
     */
    public function addExecutableFile($file)
    {
        $this->executableFiles->append($file);
    }

    /**
     * Get the excluded dirs
     *
     * @return \ArrayIterator
     */
    public function getExcludedDirs()
    {
        return $this->excludedDirs;
    }

    /**
     * Get the excluded files
     *
     * @return \ArrayIterator
     */
    public function getExcludedFiles()
    {
        return $this->excludedFiles;
    }

    /**
     * Get the executable files
     *
     * @return \ArrayIterator
     */
    public function getExecutableFiles()
    {
        return $this->executableFiles;
    }
}


text:
namespace ppatierno.AzureSBLite.Messaging
{
    /// <summary>
    /// Interface for message client entity
    /// </summary>
    internal interface IMessageClientEntity
    {
        /// <summary>
        /// Close the message client entity
        /// </summary>
        void Close();

        /// <summary>
        /// Message client entity closed status
        /// </summary>
        bool IsClosed { get; }
    }
}


text:
package info.tregmine.zonemapper;

/* Generic biome mapping */
public class BiomeMap
{
    private static BiomeMap[] biome_by_index = new BiomeMap[0];
    public static final BiomeMap NULL = new BiomeMap(-1, "NULL", 0.5, 0.5, 0xFFFFFF, 0, 0);

    public static final BiomeMap OCEAN = new BiomeMap(0, "OCEAN");
    public static final BiomeMap PLAINS = new BiomeMap(1, "PLAINS", 0.8, 0.4);
    public static final BiomeMap DESERT = new BiomeMap(2, "DESERT", 2.0, 0.0);
    public static final BiomeMap EXTREME_HILLS = new BiomeMap(3, "EXTREME_HILLS", 0.2, 0.3);
    public static final BiomeMap FOREST = new BiomeMap(4, "FOREST", 0.7, 0.8);
    public static final BiomeMap TAIGA = new BiomeMap(5, "TAIGA", 0.05, 0.8);
    public static final BiomeMap SWAMPLAND = new BiomeMap(6, "SWAMPLAND", 0.8, 0.9, 0xE0FFAE, 0x4E0E4E, 0x4E0E4E);
    public static final BiomeMap RIVER = new BiomeMap(7, "RIVER");
    public static final BiomeMap HELL = new BiomeMap(8, "HELL", 2.0, 0.0);
    public static final BiomeMap SKY = new BiomeMap(9, "SKY");
    public static final BiomeMap FROZEN_OCEAN = new BiomeMap(10, "FROZEN_OCEAN", 0.0, 0.5);
    public static final BiomeMap FROZEN_RIVER = new BiomeMap(11, "FROZEN_RIVER", 0.0, 0.5);
    public static final BiomeMap ICE_PLAINS = new BiomeMap(12, "ICE_PLAINS", 0.0, 0.5);
    public static final BiomeMap ICE_MOUNTAINS = new BiomeMap(13, "ICE_MOUNTAINS", 0.0, 0.5);
    public static final BiomeMap MUSHROOM_ISLAND = new BiomeMap(14, "MUSHROOM_ISLAND", 0.9, 1.0);
    public static final BiomeMap MUSHROOM_SHORE = new BiomeMap(15, "MUSHROOM_SHORE", 0.9, 1.0);
    public static final BiomeMap BEACH = new BiomeMap(16, "BEACH", 0.8, 0.4);
    public static final BiomeMap DESERT_HILLS = new BiomeMap(17, "DESERT_HILLS", 2.0, 0.0);
    public static final BiomeMap FOREST_HILLS = new BiomeMap(18, "FOREST_HILLS", 0.7, 0.8);
    public static final BiomeMap TAIGA_HILLS = new BiomeMap(19, "TAIGA_HILLS", 0.05, 0.8);
    public static final BiomeMap SMALL_MOUNTAINS = new BiomeMap(20, "SMALL_MOUNTAINS", 0.2, 0.8);
    public static final BiomeMap JUNGLE = new BiomeMap(21, "JUNGLE", 1.2, 0.9);
    public static final BiomeMap JUNGLE_HILLS = new BiomeMap(22, "JUNGLE_HILLS", 1.2, 0.9);

    public static final int LAST_WELL_KNOWN = 22;

    private double tmp;
    private double rain;
    private int watercolormult;
    private int grassmult;
    private int foliagemult;
    private final String id;
    private final int index;
    private int biomeindex256; // Standard biome mapping index (for 256 x 256)

    private static boolean isUniqueID(String id) {
        for(int i = 0; i < biome_by_index.length; i++) {
            if(biome_by_index[i] == null) continue;
            if(biome_by_index[i].id.equals(id))
                return false;
        }
        return true;
    }

    private BiomeMap(int idx, String id, double tmp, double rain, int waterColorMultiplier, int grassmult, int foliagemult) {
        /* Clamp values : we use raw values from MC code, which are clamped during color mapping only */
        setTemperature(tmp);
        setRainfall(rain);
        this.watercolormult = waterColorMultiplier;
        this.grassmult = grassmult;
        this.foliagemult = foliagemult;
        // Handle null biome
        if (id == null) { id = "biome_" + idx; }
        id = id.toUpperCase().replace(' ', '_');
        if(isUniqueID(id) == false) {
            id = id + "_" + idx;
        }
        this.id = id;
        idx++;  /* Insert one after ID value - null is zero index */
        this.index = idx;
        if(idx >= 0) {
            if(idx >= biome_by_index.length) {
                BiomeMap newmap[] = new BiomeMap[idx+1];
                int oldlen = biome_by_index.length;
                System.arraycopy(biome_by_index, 0, newmap, 0, oldlen);
                biome_by_index = newmap;

                for(int i = oldlen; i < idx; i++) {
                    new BiomeMap(i-1, "BIOME_" + (i-1));
                }
            }
            biome_by_index[idx] = this;
        }
    }

    public BiomeMap(int idx, String id) {
        this(idx, id, 0.5, 0.5, 0xFFFFFF, 0, 0);
    }

    public BiomeMap(int idx, String id, double tmp, double rain) {
        this(idx, id, tmp, rain, 0xFFFFFF, 0, 0);
    }

    private final int biomeLookup(int width) {
        int w = width-1;
        int t = (int)((1.0-tmp)*w);
        int h = (int)((1.0 - (tmp*rain))*w);
        return width*h + t;
    }

    public final int biomeLookup() {
        return this.biomeindex256;
    }

    public final int getModifiedGrassMultiplier(int rawgrassmult) {
        if(grassmult == 0)
            return rawgrassmult;
        else if(grassmult > 0xFFFFFF)
            return grassmult & 0xFFFFFF;
        else
            return ((rawgrassmult & 0xfefefe) + grassmult) / 2;
    }

    public final int getModifiedFoliageMultiplier(int rawfoliagemult) {
        if(foliagemult == 0)
            return rawfoliagemult;
        else if(foliagemult > 0xFFFFFF)
            return foliagemult & 0xFFFFFF;
        else
            return ((rawfoliagemult & 0xfefefe) + foliagemult) / 2;
    }

    public final int getWaterColorMult() {
        return watercolormult;
    }

    public final int ordinal() {
        return index;
    }

    public static final BiomeMap byBiomeID(int idx) {
        idx++;
        if((idx >= 0) && (idx < biome_by_index.length))
            return biome_by_index[idx];
        else
            return NULL;
    }

    public int getBiomeID() {
        return index - 1;   // Index of biome in MC biome table
    }

    public final String toString() {
        return id;
    }

    public static final BiomeMap[] values() {
        return biome_by_index;
    }

    public void setWaterColorMultiplier(int watercolormult) {
        this.watercolormult = watercolormult;
    }

    public void setGrassColorMultiplier(int grassmult) {
        this.grassmult = grassmult;
    }

    public void setFoliageColorMultiplier(int foliagemult) {
        this.foliagemult = foliagemult;
    }

    public void setTemperature(double tmp) {
        if(tmp < 0.0) tmp = 0.0;
        if(tmp > 1.0) tmp = 1.0;
        this.tmp = tmp;
    }

    public void setRainfall(double rain) {
        if(rain < 0.0) rain = 0.0;
        if(rain > 1.0) rain = 1.0;
        this.rain = rain;
        this.biomeindex256 = this.biomeLookup(256);
    }

    public final double getTemperature() {
        return this.tmp;
    }

    public final double getRainfall() {
        return this.rain;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/youth/portraits#young-mexican-man-605468" xml:lang="eng" locale="eng" status="publish">
  <search-meta>
      <uri-title its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">young-mexican-man-605468</uri-title>
      <source>young-mexican-man-605468</source>
      <publication-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</publication-type>
      <media-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-04-09">2012-04-09</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">global-search</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">media</collection>
          <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">images</collection>
      </collections>
      <subjects>
          <subject>young man</subject>
          <subject>young men</subject>
          <subject>youth</subject>
          <subject>teen</subject>
          <subject>blue shirt</subject>
          <subject>smiling</subject>
          <subject>portrait</subject>
          <subject>boy</subject>
          <subject>mexico</subject>
          <subject>hispanic</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>214 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>309 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>749 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>1.2 MB</size>
                  <path>http://media.ldscdn.org/images/media-library/youth/portraits/young-mexican-man-605468-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
<ldse-meta its:translate="no" xmlns="http://lds.org/code/lds-edit" xmlns:its="http://www.w3.org/2005/11/its"><document id="young-mexican-man-605468" locale="eng" uri="/media-library/images/youth/portraits#young-mexican-man-605468" status="publish" site="ldsorg" source="chq" words="135" tgp="0.472"/><created username="lds-edit" userid=""/><last-modified date="2012-05-10T12:26:25.859613-06:00" username="lds-edit" userid=""/></ldse-meta></ldswebml>


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import itertools

import numpy as np
from astropy.io import fits
from astropy.wcs import WCS
from astropy.utils.data import get_pkg_data_filename
import pytest

from .. import reproject_interp, reproject_exact

# TODO: add reference comparisons

ALL_MODES = ('nearest-neighbor',
             'bilinear',
             'biquadratic',
             'bicubic',
             'flux-conserving')

ALL_DTYPES = []
for endian in ('<', '>'):
    for kind in ('u', 'i', 'f'):
        for size in ('1', '2', '4', '8'):
            if kind == 'f' and size == '1':
                continue
            ALL_DTYPES.append(np.dtype(endian + kind + size))

class TestReproject(object):

    def setup_method(self, method):

        self.header_in = fits.Header.fromtextfile(get_pkg_data_filename('data/gc_ga.hdr'))
        self.header_out = fits.Header.fromtextfile(get_pkg_data_filename('data/gc_eq.hdr'))

        self.header_out_size = self.header_out.copy()
        self.header_out_size['NAXIS'] = 2
        self.header_out_size['NAXIS1'] = 600
        self.header_out_size['NAXIS2'] = 550

        self.array_in = np.ones((700, 690))

        self.hdu_in = fits.ImageHDU(self.array_in, self.header_in)

        self.wcs_in = WCS(self.header_in)
        self.wcs_out = WCS(self.header_out)
        self.shape_out = (600, 550)

    def test_hdu_header(self):

        with pytest.raises(ValueError) as exc:
            reproject_interp(self.hdu_in, self.header_out)
        assert exc.value.args[0] == "Need to specify shape since output header does not contain complete shape information"

        reproject_interp(self.hdu_in, self.header_out_size)

    def test_hdu_wcs(self):
        reproject_interp(self.hdu_in, self.wcs_out, shape_out=self.shape_out)

    def test_array_wcs_header(self):

        with pytest.raises(ValueError) as exc:
            reproject_interp((self.array_in, self.wcs_in), self.header_out)
        assert exc.value.args[0] == "Need to specify shape since output header does not contain complete shape information"

        reproject_interp((self.array_in, self.wcs_in), self.header_out_size)

    def test_array_wcs_wcs(self):
        reproject_interp((self.array_in, self.wcs_in), self.wcs_out, shape_out=self.shape_out)

    def test_array_header_header(self):
        reproject_interp((self.array_in, self.header_in), self.header_out_size)

INPUT_HDR = """
WCSAXES =                    2 / Number of coordinate axes
CRPIX1  =                  0.5 / Pixel coordinate of reference point
CRPIX2  =                  0.5 / Pixel coordinate of reference point
CDELT1  =         -0.001666666 / [deg] Coordinate increment at reference point
CDELT2  =          0.001666666 / [deg] Coordinate increment at reference point
CUNIT1  = 'deg'                / Units of coordinate increment and value
CUNIT2  = 'deg'                / Units of coordinate increment and value
CTYPE1  = 'GLON-CAR'           / galactic longitude, plate caree projection
CTYPE2  = 'GLAT-CAR'           / galactic latitude, plate caree projection
CRVAL1  =                  0.0 / [deg] Coordinate value at reference point
CRVAL2  =                  0.0 / [deg] Coordinate value at reference point
LONPOLE =                  0.0 / [deg] Native longitude of celestial pole
LATPOLE =                 90.0 / [deg] Native latitude of celestial pole
"""

@pytest.mark.parametrize('projection_type, dtype', itertools.product(ALL_MODES, ALL_DTYPES))
def test_surface_brightness(projection_type, dtype):

    header_in = fits.Header.fromstring(INPUT_HDR, sep='\n')
    header_in['NAXIS'] = 2
    header_in['NAXIS1'] = 10
    header_in['NAXIS2'] = 10

    header_out = header_in.copy()

    header_out['CDELT1'] /= 2
    header_out['CDELT2'] /= 2
    header_out['NAXIS1'] *= 2
    header_out['NAXIS2'] *= 2

    data_in = np.ones((10, 10), dtype=dtype)

    if projection_type == 'flux-conserving':
        data_out, footprint = reproject_exact((data_in, header_in), header_out)
    else:
        data_out, footprint = reproject_interp((data_in, header_in), header_out,
                                               order=projection_type)

    assert data_out.shape == (20, 20)

    # Here we check that the values are still 1 despite the change in
    # resolution, which demonstrates that we are preserving surface
    # brightness.
    np.testing.assert_allclose(data_out, 1)


text:
var data = (function () {
    const LOCAL_STORAGE_USERNAME_KEY = 'signed-in-user-username',
        LOCAL_STORAGE_AUTHKEY_KEY = 'signed-in-user-auth-key';

    /* Users */
    function register(user) {
        var reqUser = {
            username: user.username,
            passHash: CryptoJS.SHA1(user.username + user.password).toString()
        };

        return jsonRequester.post('api/users', {
            data: reqUser
        }).then(function (resp) {
            var user = resp.result;
            return {
                username: resp.result.username
            };
        });
    }

    function signIn(user) {
        var reqUser = {
            username: user.username,
            passHash: CryptoJS.SHA1(user.username + user.password).toString()
        };

        var options = {
            data: reqUser
        };

        return jsonRequester.put('api/auth', options)
            .then(function (resp) {
                var user = resp.result;
                localStorage.setItem(LOCAL_STORAGE_USERNAME_KEY, user.username);
                localStorage.setItem(LOCAL_STORAGE_AUTHKEY_KEY, user.authKey);
                return user;
            });
    }

    function signOut() {
        var promise = new Promise(function (resolve, reject) {
            localStorage.removeItem(LOCAL_STORAGE_USERNAME_KEY);
            localStorage.removeItem(LOCAL_STORAGE_AUTHKEY_KEY);
            resolve();
        });
        return promise;
    }

    function hasUser() {
        return !!localStorage.getItem(LOCAL_STORAGE_USERNAME_KEY) && !!localStorage.getItem(LOCAL_STORAGE_AUTHKEY_KEY);
    }

    function usersGet() {
        return jsonRequester.get('api/users')
            .then(function (res) {
                return res.result;
            });
    }

    // Cookies
    function getAllCookie() {
        return jsonRequester.get('api/cookies')
            .then(function (res) {
                return res.result;
            });
    }

    function getMyCookies() {
        var options = {
            headers: {
                'x-auth-key': localStorage.getItem(LOCAL_STORAGE_AUTHKEY_KEY)
            }
        };

        return jsonRequester.get('api/my-cookie', options)
            .then(function(res) {
                return res.result;
            });
    }

    return {
        users: {
            signIn,
            signOut,
            register,
            hasUser,
            get: usersGet
        },
        cookies: {
            get: getAllCookie,
            getMyCookies: getMyCookies
        }
    };
}());


text:
from __future__ import unicode_literals, division, print_function

"""
Script process the GW output generated by GWsetup using VASP or ABINIT.
"""

__author__ = "Michiel van Setten"
__copyright__ = " "
__version__ = "0.9"
__maintainer__ = "Michiel van Setten"
__email__ = "mjvansetten@gmail.com"
__date__ = "May 2014"

import os
import os.path

from pymatgen.io.gwwrapper.helpers import load_ps
from pymatgen.io.gwwrapper.datastructures import get_spec

MODULE_DIR = os.path.dirname(os.path.abspath(__file__))

if __name__ == "__main__":
    if os.path.isfile('plots'):
        os.remove('plots')
    load_ps()
    spec = get_spec('GW')
    spec.read_from_file('spec.in')
    print('Found setup for ', spec.get_code())
    spec.loop_structures('o')


text:
var appsettings = {
    consumerkey: 'LLCyxwHfGIAM7mq4Wc6mEFpNi',
    consumersecret: 'WmFz7fntSDb4IpqDS2L59fYExD68hiC7wLkSyvF4Pt5yDXIura',
    bearertoken: '',
     since_id : '',
    searchquery : '',
    sumarray :  new Object(),
    addinfo : new Array(),
     schedule : {
                    hashtag : new Array(),
                    name : new Array(),
                    since_id : new Array()
        },
    twitterdata : new Object(),
    arrcrawTwitter : {
                    text : new Array(),
                    name : new Array(),
                    img : new Array()
        },
    Twitt : new Array()

};

module.exports = appsettings;


text:
<!DOCTYPE html>

    {% include head.html %}

    {% include nav.html %}

    {% include header.html %}

    {% for order in site.page-sections %}
        {% for page in site.pages %}
            {% assign name = page.name | remove: '.md' %}

            {% if name == order.name %}

                                        {{ page.content | markdownify }}

            {% endif %}
         {% endfor %}
    {% endfor %}

    {% include footer.html %}
    {% include js.html %}


text:
"""
Extract aligned (i.e., padded) queries in FASTA format from a SAM/BAM file.
"""

from __future__ import division, print_function

import sys
import argparse

from dark.filter import (
    addFASTAFilteringCommandLineOptions, parseFASTAFilteringCommandLineOptions)
from dark.reads import Reads
from dark.sam import SAMFilter, PaddedSAM
from dark.utils import nucleotidesToStr

parser = argparse.ArgumentParser(
    formatter_class=argparse.ArgumentDefaultsHelpFormatter,
    description='Produce aligned FASTA queries from a SAM/BAM file.')

parser.add_argument(
    '--rcSuffix', default='',
    help=('A string to add to the end of query names that are reverse '
          'complemented. This is added before the /1, /2, etc., that are '
          'added for duplicated ids (if there are duplicates and '
          '--allowDuplicateIds is not used)'))

parser.add_argument(
    '--rcNeeded', default=False, action='store_true',
    help=('If given, queries that are flagged as matching when reverse '
          'complemented will be reverse complemented in the output. This '
          'must be used if the program that created the SAM/BAM input '
          'flags reversed matches but does not also store the reverse '
          'complemented query. The bwa program (mem and aln followed by '
          'samse) stores the queries reversed complemented if the match '
          'was, so this option is not needed for bwa. If in doubt, test the '
          'output of your matching program as this is very important!'))

parser.add_argument(
    '--listReferenceInsertions', default=False, action='store_true',
    help=('If given, information about reference sequence insertions will be '
          'printed to standard error. These correspond to "I" CIGAR '
          'operations that for the match would require inserting query bases '
          'into the reference. Because we cannot change the reference (in '
          'fact we typically do not have the reference in the SAM/BAM file), '
          'we cut the inserted bases out of the aligned query and save the '
          'information about what would have been inserted and where. That '
          'information is printed by this option. The output gives the '
          '0-based offset where the inserted base would be placed, followed '
          'by a list of the nucleotides that were suggested as being '
          'inserted and the number of times each nucleotide was suggested. '
          'So for example the output might contain "27: T:3, G:10" which '
          'indicates that 13 query (3 with T and 10 with G) matches would '
          'insert a nucleotide into the reference at offset 27.'))

SAMFilter.addFilteringOptions(parser)
addFASTAFilteringCommandLineOptions(parser)

args = parser.parse_args()
reads = parseFASTAFilteringCommandLineOptions(args, Reads())
samFilter = SAMFilter.parseFilteringOptions(
    args, filterRead=reads.filterRead)
paddedSAM = PaddedSAM(samFilter)

for read in paddedSAM.queries(rcSuffix=args.rcSuffix, rcNeeded=args.rcNeeded):
    print(read.toString('fasta'), end='')

if args.listReferenceInsertions:
    if paddedSAM.referenceInsertions:
        print('(0-based) insertions into the reference:\n%s' %
              nucleotidesToStr(paddedSAM.referenceInsertions, '  '),
              file=sys.stderr)
    else:
        print('No matches required an insertion into the reference.',
              file=sys.stderr)


text:
/* ----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2014-2014
 *
 * Declarations for C fallback primitives implemented by 'ghc-prim' package.
 *
 * Do not #include this file directly: #include "Rts.h" instead.
 *
 * To understand the structure of the RTS headers, see the wiki:
 *   http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
 *
 * -------------------------------------------------------------------------- */

#pragma once

/* libraries/ghc-prim/cbits/atomic.c */
StgWord hs_atomic_add8(StgWord x, StgWord val);
StgWord hs_atomic_add16(StgWord x, StgWord val);
StgWord hs_atomic_add32(StgWord x, StgWord val);
StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
StgWord hs_atomic_sub8(StgWord x, StgWord val);
StgWord hs_atomic_sub16(StgWord x, StgWord val);
StgWord hs_atomic_sub32(StgWord x, StgWord val);
StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
StgWord hs_atomic_and8(StgWord x, StgWord val);
StgWord hs_atomic_and16(StgWord x, StgWord val);
StgWord hs_atomic_and32(StgWord x, StgWord val);
StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
StgWord hs_atomic_nand8(StgWord x, StgWord val);
StgWord hs_atomic_nand16(StgWord x, StgWord val);
StgWord hs_atomic_nand32(StgWord x, StgWord val);
StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
StgWord hs_atomic_or8(StgWord x, StgWord val);
StgWord hs_atomic_or16(StgWord x, StgWord val);
StgWord hs_atomic_or32(StgWord x, StgWord val);
StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
StgWord hs_atomic_xor8(StgWord x, StgWord val);
StgWord hs_atomic_xor16(StgWord x, StgWord val);
StgWord hs_atomic_xor32(StgWord x, StgWord val);
StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new_);
StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new_);
StgWord hs_atomicread8(StgWord x);
StgWord hs_atomicread16(StgWord x);
StgWord hs_atomicread32(StgWord x);
StgWord64 hs_atomicread64(StgWord x);
void hs_atomicwrite8(StgWord x, StgWord val);
void hs_atomicwrite16(StgWord x, StgWord val);
void hs_atomicwrite32(StgWord x, StgWord val);
void hs_atomicwrite64(StgWord x, StgWord64 val);

/* libraries/ghc-prim/cbits/bswap.c */
StgWord16 hs_bswap16(StgWord16 x);
StgWord32 hs_bswap32(StgWord32 x);
StgWord64 hs_bswap64(StgWord64 x);

/* TODO: longlong.c */

/* libraries/ghc-prim/cbits/popcnt.c */
StgWord hs_popcnt8(StgWord x);
StgWord hs_popcnt16(StgWord x);
StgWord hs_popcnt32(StgWord x);
StgWord hs_popcnt64(StgWord64 x);
StgWord hs_popcnt(StgWord x);

/* libraries/ghc-prim/cbits/word2float.c */
StgFloat hs_word2float32(StgWord x);
StgDouble hs_word2float64(StgWord x);

/* libraries/ghc-prim/cbits/clz.c */
StgWord hs_clz8(StgWord x);
StgWord hs_clz16(StgWord x);
StgWord hs_clz32(StgWord x);
StgWord hs_clz64(StgWord64 x);

/* libraries/ghc-prim/cbits/ctz.c */
StgWord hs_ctz8(StgWord x);
StgWord hs_ctz16(StgWord x);
StgWord hs_ctz32(StgWord x);
StgWord hs_ctz64(StgWord64 x);


text:
Code-base accompanying the [paper](https://arxiv.org/abs/2003.05997) (to appear
in [TACL](https://transacl.org/index.php/tacl)).
See also the accompanying
[slides](https://drive.google.com/file/d/1maX-UQbtnVtxQqLmHvWVN6LNYtnBaTd9/view?usp=sharing)
for a quick overview.

## Table of Contents

-   [Updates](#updates)
-   [Pre-trained PG-19 Checkpoint](#pg19)
-   [Explanation of hyperparameters](#hparam)
    *   [Local Attention](#local)
    *   [Routing Attention](#routing)
-   [Samples](#samples)
    *   [PG-19 (sequence length 8k)](#pg19-samples)
    *   [Document Machine Translation (sequence length 4k)](#doc-mt)
-   [Acknowledgments](#ack)
-   [How to Cite](#cite)

## Updates

* Routing Transformer + [REALM](https://github.com/google-research/language/tree/master/language/realm)
  is now [SOTA](https://eval.ai/web/challenges/challenge-page/689/leaderboard/1908#leaderboardrank-1)
  on long form Question Answering (QA) on the
  [ELI5 data-set](https://github.com/facebookresearch/ELI5) on the Knowledge
  Intensive Language Tasks (KILT) [benchmark](https://github.com/facebookresearch/KILT)
  from [Facebook AI](https://ai.facebook.com/blog/introducing-kilt-a-new-unified-benchmark-for-knowledge-intensive-nlp-tasks/),
  with **significant improvements** in generation quality over [BART](https://arxiv.org/abs/1910.13461),
  [RAG](https://ai.facebook.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/),
  [T5](https://arxiv.org/abs/1910.10683)/[Mesh TF](https://arxiv.org/abs/1811.02084)
  , e.g. **+4.11, +5.78, +9.14 Rouge-L improvement** over T5/Mesh TF, BART + DPR
  and RAG respectively. Check out the source code and pre-trained model weights
  at Kalpesh's Github [repository](https://github.com/martiansideofthemoon/hurdles-longform-qa).

## Pre-trained PG-19 Checkpoint

Model     | Hparams  | Context Length | Data-set | Vocab                                                                                | Download
--------- |  ---------------------- | -------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------- | --------
`Local-base` | `pg19_local8k`         | 8192           | [PG-19](https://github.com/deepmind/pg19) | [vocab98K](https://storage.googleapis.com/rt-checkpoint/vocab.pg19_length8k.32768.subwords) | [checkpoint.zip](https://storage.googleapis.com/rt-checkpoint/pg19_local.zip)
`RT-base`    | `pg19_local_cluster8k` | 8192           | [PG-19](https://github.com/deepmind/pg19) | [vocab98K](https://storage.googleapis.com/rt-checkpoint/vocab.pg19_length8k.32768.subwords) | [checkpoint.zip](https://storage.googleapis.com/rt-checkpoint/checkpoint.zip)
`RT-base`    | `pg19_local_cluster8k` | 8192           | [ELI-5](https://github.com/facebookresearch/ELI5) | [vocab98K](https://storage.googleapis.com/rt-checkpoint/vocab.pg19_length8k.32768.subwords) | [checkpoint.zip](https://storage.googleapis.com/rt-checkpoint/eli5_checkpoint.zip)

## Explanation of hyperparameters

### Local Attention

*   `local_num_heads`: Number of local attention heads
*   `query_shape`: This represents the shape of the query block.
    *   For 1-d local attention with block size `b`, this would be `(b,)`
*   `memory_query_shape`: This represents the query shape of memory antecedent
    and is useful for encoder-decoder attention
    * This is usually set the same as `query_shape` by default
    * This is useful when inputs and targets are of different lengths
    * E.g., if inputs are of length `4096` and targets of length `8192`
    * Plausible setting:`query_shape = (256,)`, `memory_flange = (256,)` and
      `memory_query_shape = (128,)`
    * This is because with block size `256`, the targets will have `32` blocks
    * To match this in enc-dec attention, the inputs must have `32` blocks
    * This is why we set `memory_query_shape = (4096/32,) = (128,)`
*   `memory_flange`: This represents the overlap of the memory block
    * Example setting: `query_shape = (b,)` and `memory_flange = (m * b, )`
    * Masked: Each query block attends to `m` previous blocks
    * Unmasked: Each query block attends to `m` previous & `m` subsequent blocks
    * Setting this to `(0,)` means all the blocks are independent of each other
    * Setting to `(0,)` is used for full attention, or for axial attention
    * This must be a multiple of `query_shape` in every dimension
*   Example setting can be found in `sparse_transformer.py` under `pg19_local8k`

### Routing Attention

*   `sparsity_cluster_num_heads`: Number of routing attention heads
*   `sparsity_cluster_size`: Number of clusters
*   `sparsity_cluster_attention_window`: Average size of each cluster
*   `sparsity_skip_first`: Number of initial layers to skip routing attention
    *   `sparsity_skip_first = 0` would have routing attention in every layer
    *   `sparsity_skip_first` equalling total layers would have no routing
        attention
*   Example setting can be found in `sparse_transformer.py` under
    `pg19_local_cluster8k`

## Samples

### PG-19 (sequence length 8k)

#### Unconditional Samples

-   [sample1](samples/pg19_sample1.txt)
-   [sample2](samples/pg19_sample2.txt)
-   [sample3](samples/pg19_sample3.txt)
-   [sample4](samples/pg19_sample4.txt)
-   [sample5](samples/pg19_sample5.txt)
-   [sample6](samples/pg19_sample6.txt)
-   [sample7](samples/pg19_sample7.txt)
-   [sample8](samples/pg19_sample8.txt)
-   [sample9](samples/pg19_sample9.txt)
-   [sample10](samples/pg19_sample10.txt)

#### Conditional Samples

-   [sample](samples/pg19_cond_sample.txt)

### Document Machine Translation (sequence length 4k)

-   [sample](samples/doc_mt_sample.txt)

## Acknowledgments
The authors would like to thank Phillip Wang and
Aran Komatsuzaki for a [Pytorch implementation](https://github.com/lucidrains/routing-transformer)
of Routing Transformer. The authors would also like
to thank Yonghui Wu, Weikang Zhou and Dehao
Chen for helpful feedback in improving the implementation of this work.
The authors would also
like to thank anonymous reviewers and the Action
Editor Xavier Carreras of TACL for their constructive comments
which helped improve the exposition of this work.

## How to Cite

If you extend or use this work, please cite the
[paper](https://arxiv.org/abs/2003.05997) where it was introduced:

```
@article{roy2020efficient,
  title={Efficient content-based sparse attention with routing transformers},
  author={Roy, Aurko and Saffar, Mohammad and Vaswani, Ashish and Grangier, David},
  journal={arXiv preprint arXiv:2003.05997},
  year={2020}
}
```


text:
title: Visio i le Initoneti
inshort: Diagramming i le palausa
translator: Microsoft Cognitive Services
---

Visio i le Initoneti o se lomiga e faavae i le palausa o le Microsoft Visio, o le a le ofisa o le vector o diagramming app. Visio i le Initoneti o se lomiga "lite" o le polokalama o le komepiuta eseese ma anapogi amata taimi ua saunia mo le maimoaina .vsdx ma faila .vsd, ma le faasaoina o le faila o le .vsdx. E tele mo le maimoaina o le faila Visio ma faia faasaoga o faigofie mai lava le soo se palausa i le toetoe lava o soo se masini visio i le Initoneti. Maimoaina Visio faila o loo aofia ai i le Lesitalaga o le ofisa o le 365 uma, ae o le vaega o le faasao e manaomia ai le faatauina mai o se lesitala faaopoopo.

Ua saunia mo le tele o ituaiga o ata, ma siepi patino, Visio i le Initoneti, ma mafai ona sii mai se aofaiga tele o isi siepi mai le uepi. A tatala tele Visio faila sao i Visio i le Initoneti pe a faaaoga i le Initoneti o le SharePoint, OneDrive mo le Yammer pisinisi, MS Teams, ma isi polokalama o le ofisa o le 365. Faila o tatala i le amataga i le tulaga o le faitauina, ae e faasao le faila, na kiliki le faamau o le "Tatala ata" ma filifili "Faasao i Visio", e mo le komepiuta, po o le "Faafou i palausa" e faaaoga Visio i le Initoneti sao i le palausa.

O le faatinoga i Visio i le Initoneti e masani lava ona faatapulaaina i lea aso ma lea faasaosaoina, anotusi ulufale, fesootai o le siepi, nisi faatulagaga, ma manatu faaalia. E otometi ona; sefeina suiga uma na faia i Visio i le Initoneti e leai se sefe le faamau.

E mafai ona faasao le mamanu o faamaumauga po o le hyperlinks i Visio i le Initoneti, pe faaaoga soo se tasi o le add-ons ua tuuina atu i le lomiga o le komepiuta. Macros o le a foi le tamoe i Visio i le Initoneti, ma mafai ai ona tatalaina ia pepa o faamatalaga e puipuia.

Afai o Visio i le Initoneti e le o maua le vaega e manaomia ona e faia le galuega, na kiliki le faamau o le "Faasao i Visio" i le pa o le lisi autu e maua ai le lomiga komepiuta o le polokalama o le ma ona vaega sili ona faigata. Tagata visio mo ofisa 365 e tutusa ma le ofisa o le 365 ma e masani ona faafouina. Ae peitai, e mafai ai e anaina o tulaga faatonuina o le Visio po o le faapolofesa 2016 i latou ia tutusa.

Punaoa
---------

-[I le Initoneti le Visio vaega seti](https://technet.microsoft.com/library/visio-online-service-descriptoin.aspx)
    \[Microsoft\]

-[Visio i le Initoneti FAQ](https://support.office.com/en-us/article/Visio-Online-Frequently-Asked-Questions-e6647040-2fca-42ec-9fa5-d16a4e39e0ee?ui=en-US&rs=en-US&ad=US)
    \[Microsoft\]

Manatu faaalia
---------

-[Visio i le Initoneti UserVoice](https://visio.uservoice.com/forums/368199-visio-online)
    \[UserVoice\]

-[Visio i TechCommunity](https://techcommunity.microsoft.com/t5/Visio/ct-p/Visio)
    \[Microsoft\]

Tusitala
---------

-[David Parker](https://www.linkedin.com/in/bvisual/), Visio le faailoga MVP


text:
import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Marker} from 'react-leaflet';
import {Icon} from 'leaflet';
import {setLocation} from '../actions';
import {getLocation} from '../selectors';
import {latLngToArray} from '../helpers';

const createIcon = () =>
  new Icon({
    iconUrl: require('@assets/markers/location.png'),
    iconRetinaUrl: require('@assets/markers/location@2x.png'),
    iconSize: [12, 23],
    iconAnchor: [6, 23],
  });

class UserLocationMarker extends Component {
  constructor(props) {
    super(props);

    this.handleDragEnd = this.handleDragEnd.bind(this);
  }

  handleDragEnd() {
    const {location} = this.refs;
    this.props.setLocation(latLngToArray(location.leafletElement.getLatLng()));
  }

  render() {
    const {...rest} = this.props;
    return (
    <Marker
      ref="location"
      icon={createIcon()}
      zIndexOffset={1000}
      draggable={true}
      onDragEnd={this.handleDragEnd}
      {...rest}/>);
  }
}

const mapStateToProps = (state) => ({
  position: getLocation(state),
});

const mapDispatchToProps = (dispatch) =>
  bindActionCreators({setLocation}, dispatch);

export default connect(mapStateToProps, mapDispatchToProps)(UserLocationMarker);


text:
/**
 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v4.0.6
 * @link http://www.ag-grid.com/
 * @license MIT
 */
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = require('../utils');
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var selectionRendererFactory_1 = require("../selectionRendererFactory");
var gridPanel_1 = require("../gridPanel/gridPanel");
var expressionService_1 = require("../expressionService");
var templateService_1 = require("../templateService");
var valueService_1 = require("../valueService");
var eventService_1 = require("../eventService");
var floatingRowModel_1 = require("../rowControllers/floatingRowModel");
var renderedRow_1 = require("./renderedRow");
var groupCellRendererFactory_1 = require("../cellRenderers/groupCellRendererFactory");
var events_1 = require("../events");
var constants_1 = require("../constants");
var context_1 = require("../context/context");
var context_2 = require("../context/context");
var gridCore_1 = require("../gridCore");
var columnController_1 = require("../columnController/columnController");
var context_3 = require("../context/context");
var context_4 = require("../context/context");
var logger_1 = require("../logger");
var context_5 = require("../context/context");
var focusedCellController_1 = require("../focusedCellController");
var context_6 = require("../context/context");
var cellNavigationService_1 = require("../cellNavigationService");
var gridCell_1 = require("../entities/gridCell");
var RowRenderer = (function () {
    function RowRenderer() {
        // map of row ids to row objects. keeps track of which elements
        // are rendered for which rows in the dom.
        this.renderedRows = {};
        this.renderedTopFloatingRows = [];
        this.renderedBottomFloatingRows = [];
    }
    RowRenderer.prototype.agWire = function (loggerFactory) {
        this.logger = this.loggerFactory.create('RowRenderer');
        this.logger = loggerFactory.create('BalancedColumnTreeBuilder');
    };
    RowRenderer.prototype.init = function () {
        this.cellRendererMap = {
            'group': groupCellRendererFactory_1.groupCellRendererFactory(this.gridOptionsWrapper, this.selectionRendererFactory, this.expressionService, this.eventService),
            'default': function (params) {
                return params.value;
            }
        };
        this.getContainersFromGridPanel();
        this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_GROUP_OPENED, this.onColumnEvent.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_VISIBLE, this.onColumnEvent.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnEvent.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_PINNED, this.onColumnEvent.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGE, this.onColumnEvent.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_MODEL_UPDATED, this.refreshView.bind(this));
        this.eventService.addEventListener(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED, this.refreshView.bind(this, null));
        //this.eventService.addEventListener(Events.EVENT_COLUMN_VALUE_CHANGE, this.refreshView.bind(this, null));
        //this.eventService.addEventListener(Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.refreshView.bind(this, null));
        //this.eventService.addEventListener(Events.EVENT_COLUMN_ROW_GROUP_CHANGE, this.refreshView.bind(this, null));
        this.refreshView();
    };
    RowRenderer.prototype.onColumnEvent = function (event) {
        if (event.isContainerWidthImpacted()) {
            this.setMainRowWidths();
        }
    };
    RowRenderer.prototype.getContainersFromGridPanel = function () {
        this.eBodyContainer = this.gridPanel.getBodyContainer();
        this.ePinnedLeftColsContainer = this.gridPanel.getPinnedLeftColsContainer();
        this.ePinnedRightColsContainer = this.gridPanel.getPinnedRightColsContainer();
        this.eFloatingTopContainer = this.gridPanel.getFloatingTopContainer();
        this.eFloatingTopPinnedLeftContainer = this.gridPanel.getPinnedLeftFloatingTop();
        this.eFloatingTopPinnedRightContainer = this.gridPanel.getPinnedRightFloatingTop();
        this.eFloatingBottomContainer = this.gridPanel.getFloatingBottomContainer();
        this.eFloatingBottomPinnedLeftContainer = this.gridPanel.getPinnedLeftFloatingBottom();
        this.eFloatingBottomPinnedRightContainer = this.gridPanel.getPinnedRightFloatingBottom();
        this.eBodyViewport = this.gridPanel.getBodyViewport();
        this.eAllBodyContainers = [this.eBodyContainer, this.eFloatingBottomContainer,
            this.eFloatingTopContainer];
        this.eAllPinnedLeftContainers = [
            this.ePinnedLeftColsContainer,
            this.eFloatingBottomPinnedLeftContainer,
            this.eFloatingTopPinnedLeftContainer];
        this.eAllPinnedRightContainers = [
            this.ePinnedRightColsContainer,
            this.eFloatingBottomPinnedRightContainer,
            this.eFloatingTopPinnedRightContainer];
    };
    RowRenderer.prototype.setRowModel = function (rowModel) {
        this.rowModel = rowModel;
    };
    RowRenderer.prototype.getAllCellsForColumn = function (column) {
        var eCells = [];
        utils_1.Utils.iterateObject(this.renderedRows, callback);
        utils_1.Utils.iterateObject(this.renderedBottomFloatingRows, callback);
        utils_1.Utils.iterateObject(this.renderedBottomFloatingRows, callback);
        function callback(key, renderedRow) {
            var eCell = renderedRow.getCellForCol(column);
            if (eCell) {
                eCells.push(eCell);
            }
        }
        return eCells;
    };
    RowRenderer.prototype.setMainRowWidths = function () {
        var mainRowWidth = this.columnController.getBodyContainerWidth() + "px";
        this.eAllBodyContainers.forEach(function (container) {
            var unpinnedRows = container.querySelectorAll(".ag-row");
            for (var i = 0; i < unpinnedRows.length; i++) {
                unpinnedRows[i].style.width = mainRowWidth;
            }
        });
    };
    RowRenderer.prototype.refreshAllFloatingRows = function () {
        this.refreshFloatingRows(this.renderedTopFloatingRows, this.floatingRowModel.getFloatingTopRowData(), this.eFloatingTopPinnedLeftContainer, this.eFloatingTopPinnedRightContainer, this.eFloatingTopContainer);
        this.refreshFloatingRows(this.renderedBottomFloatingRows, this.floatingRowModel.getFloatingBottomRowData(), this.eFloatingBottomPinnedLeftContainer, this.eFloatingBottomPinnedRightContainer, this.eFloatingBottomContainer);
    };
    RowRenderer.prototype.refreshFloatingRows = function (renderedRows, rowNodes, pinnedLeftContainer, pinnedRightContainer, bodyContainer) {
        var _this = this;
        renderedRows.forEach(function (row) {
            row.destroy();
        });
        renderedRows.length = 0;
        // if no cols, don't draw row - can we get rid of this???
        var columns = this.columnController.getAllDisplayedColumns();
        if (!columns || columns.length == 0) {
            return;
        }
        if (rowNodes) {
            rowNodes.forEach(function (node, rowIndex) {
                var renderedRow = new renderedRow_1.RenderedRow(_this.$scope, _this.cellRendererMap, _this, bodyContainer, pinnedLeftContainer, pinnedRightContainer, node, rowIndex);
                _this.context.wireBean(renderedRow);
                renderedRows.push(renderedRow);
            });
        }
    };
    RowRenderer.prototype.refreshView = function (refreshEvent) {
        this.logger.log('refreshView');
        var refreshFromIndex = refreshEvent ? refreshEvent.fromIndex : null;
        if (!this.gridOptionsWrapper.isForPrint()) {
            var containerHeight = this.rowModel.getRowCombinedHeight();
            this.eBodyContainer.style.height = containerHeight + "px";
            this.ePinnedLeftColsContainer.style.height = containerHeight + "px";
            this.ePinnedRightColsContainer.style.height = containerHeight + "px";
        }
        this.refreshAllVirtualRows(refreshFromIndex);
        this.refreshAllFloatingRows();
    };
    RowRenderer.prototype.softRefreshView = function () {
        utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
            renderedRow.softRefresh();
        });
    };
    RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) {
        var renderedRow = this.renderedRows[rowIndex];
        renderedRow.addEventListener(eventName, callback);
    };
    RowRenderer.prototype.refreshRows = function (rowNodes) {
        if (!rowNodes || rowNodes.length == 0) {
            return;
        }
        // we only need to be worried about rendered rows, as this method is
        // called to whats rendered. if the row isn't rendered, we don't care
        var indexesToRemove = [];
        utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
            var rowNode = renderedRow.getRowNode();
            if (rowNodes.indexOf(rowNode) >= 0) {
                indexesToRemove.push(key);
            }
        });
        // remove the rows
        this.removeVirtualRow(indexesToRemove);
        // add draw them again
        this.drawVirtualRows();
    };
    RowRenderer.prototype.refreshCells = function (rowNodes, colIds) {
        if (!rowNodes || rowNodes.length == 0) {
            return;
        }
        // we only need to be worried about rendered rows, as this method is
        // called to whats rendered. if the row isn't rendered, we don't care
        utils_1.Utils.iterateObject(this.renderedRows, function (key, renderedRow) {
            var rowNode = renderedRow.getRowNode();
            if (rowNodes.indexOf(rowNode) >= 0) {
                renderedRow.refreshCells(colIds);
            }
        });
    };
    RowRenderer.prototype.rowDataChanged = function (rows) {
        // we only need to be worried about rendered rows, as this method is
        // called to whats rendered. if the row isn't rendered, we don't care
        var indexesToRemove = [];
        var renderedRows = this.renderedRows;
        Object.keys(renderedRows).forEach(function (key) {
            var renderedRow = renderedRows[key];
            // see if the rendered row is in the list of rows we have to update
            if (renderedRow.isDataInList(rows)) {
                indexesToRemove.push(key);
            }
        });
        // remove the rows
        this.removeVirtualRow(indexesToRemove);
        // add draw them again
        this.drawVirtualRows();
    };
    RowRenderer.prototype.agDestroy = function () {
        var rowsToRemove = Object.keys(this.renderedRows);
        this.removeVirtualRow(rowsToRemove);
    };
    RowRenderer.prototype.refreshAllVirtualRows = function (fromIndex) {
        // remove all current virtual rows, as they have old data
        var rowsToRemove = Object.keys(this.renderedRows);
        this.removeVirtualRow(rowsToRemove, fromIndex);
        // add in new rows
        this.drawVirtualRows();
    };
    // public - removes the group rows and then redraws them again
    RowRenderer.prototype.refreshGroupRows = function () {
        // find all the group rows
        var rowsToRemove = [];
        var that = this;
        Object.keys(this.renderedRows).forEach(function (key) {
            var renderedRow = that.renderedRows[key];
            if (renderedRow.isGroup()) {
                rowsToRemove.push(key);
            }
        });
        // remove the rows
        this.removeVirtualRow(rowsToRemove);
        // and draw them back again
        this.ensureRowsRendered();
    };
    // takes array of row indexes
    RowRenderer.prototype.removeVirtualRow = function (rowsToRemove, fromIndex) {
        var that = this;
        // if no fromIndex then set to -1, which will refresh everything
        var realFromIndex = (typeof fromIndex === 'number') ? fromIndex : -1;
        rowsToRemove.forEach(function (indexToRemove) {
            if (indexToRemove >= realFromIndex) {
                that.unbindVirtualRow(indexToRemove);
            }
        });
    };
    RowRenderer.prototype.unbindVirtualRow = function (indexToRemove) {
        var renderedRow = this.renderedRows[indexToRemove];
        renderedRow.destroy();
        var event = { node: renderedRow.getRowNode(), rowIndex: indexToRemove };
        this.eventService.dispatchEvent(events_1.Events.EVENT_VIRTUAL_ROW_REMOVED, event);
        delete this.renderedRows[indexToRemove];
    };
    RowRenderer.prototype.drawVirtualRows = function () {
        this.workOutFirstAndLastRowsToRender();
        this.ensureRowsRendered();
    };
    RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () {
        if (!this.rowModel.isRowsToRender()) {
            this.firstVirtualRenderedRow = 0;
            this.lastVirtualRenderedRow = -1; // setting to -1 means nothing in range
            return;
        }
        var rowCount = this.rowModel.getRowCount();
        if (this.gridOptionsWrapper.isForPrint()) {
            this.firstVirtualRenderedRow = 0;
            this.lastVirtualRenderedRow = rowCount;
        }
        else {
            var topPixel = this.eBodyViewport.scrollTop;
            var bottomPixel = topPixel + this.eBodyViewport.offsetHeight;
            var first = this.rowModel.getRowAtPixel(topPixel);
            var last = this.rowModel.getRowAtPixel(bottomPixel);
            //add in buffer
            var buffer = this.gridOptionsWrapper.getRowBuffer();
            first = first - buffer;
            last = last + buffer;
            // adjust, in case buffer extended actual size
            if (first < 0) {
                first = 0;
            }
            if (last > rowCount - 1) {
                last = rowCount - 1;
            }
            this.firstVirtualRenderedRow = first;
            this.lastVirtualRenderedRow = last;
        }
    };
    RowRenderer.prototype.getFirstVirtualRenderedRow = function () {
        return this.firstVirtualRenderedRow;
    };
    RowRenderer.prototype.getLastVirtualRenderedRow = function () {
        return this.lastVirtualRenderedRow;
    };
    RowRenderer.prototype.ensureRowsRendered = function () {
        //var start = new Date().getTime();
        var _this = this;
        // at the end, this array will contain the items we need to remove
        var rowsToRemove = Object.keys(this.renderedRows);
        // add in new rows
        for (var rowIndex = this.firstVirtualRenderedRow; rowIndex <= this.lastVirtualRenderedRow; rowIndex++) {
            // see if item already there, and if yes, take it out of the 'to remove' array
            if (rowsToRemove.indexOf(rowIndex.toString()) >= 0) {
                rowsToRemove.splice(rowsToRemove.indexOf(rowIndex.toString()), 1);
                continue;
            }
            // check this row actually exists (in case overflow buffer window exceeds real data)
            var node = this.rowModel.getRow(rowIndex);
            if (node) {
                this.insertRow(node, rowIndex);
            }
        }
        // at this point, everything in our 'rowsToRemove' . . .
        this.removeVirtualRow(rowsToRemove);
        // if we are doing angular compiling, then do digest the scope here
        if (this.gridOptionsWrapper.isAngularCompileRows()) {
            // we do it in a timeout, in case we are already in an apply
            setTimeout(function () { _this.$scope.$apply(); }, 0);
        }
        //var end = new Date().getTime();
        //console.log(end-start);
    };
    RowRenderer.prototype.onMouseEvent = function (eventName, mouseEvent, eventSource, cell) {
        var renderedRow;
        switch (cell.floating) {
            case constants_1.Constants.FLOATING_TOP:
                renderedRow = this.renderedTopFloatingRows[cell.rowIndex];
                break;
            case constants_1.Constants.FLOATING_BOTTOM:
                renderedRow = this.renderedBottomFloatingRows[cell.rowIndex];
                break;
            default:
                renderedRow = this.renderedRows[cell.rowIndex];
                break;
        }
        if (renderedRow) {
            renderedRow.onMouseEvent(eventName, mouseEvent, eventSource, cell);
        }
    };
    RowRenderer.prototype.insertRow = function (node, rowIndex) {
        var columns = this.columnController.getAllDisplayedColumns();
        // if no cols, don't draw row
        if (!columns || columns.length == 0) {
            return;
        }
        var renderedRow = new renderedRow_1.RenderedRow(this.$scope, this.cellRendererMap, this, this.eBodyContainer, this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, node, rowIndex);
        this.context.wireBean(renderedRow);
        this.renderedRows[rowIndex] = renderedRow;
    };
    RowRenderer.prototype.getRenderedNodes = function () {
        var renderedRows = this.renderedRows;
        return Object.keys(renderedRows).map(function (key) {
            return renderedRows[key].getRowNode();
        });
    };
    // we use index for rows, but column object for columns, as the next column (by index) might not
    // be visible (header grouping) so it's not reliable, so using the column object instead.
    RowRenderer.prototype.navigateToNextCell = function (key, rowIndex, column, floating) {
        var nextCell = new gridCell_1.GridCell(rowIndex, floating, column);
        // we keep searching for a next cell until we find one. this is how the group rows get skipped
        while (true) {
            nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell);
            if (utils_1.Utils.missing(nextCell)) {
                break;
            }
            var skipGroupRows = this.gridOptionsWrapper.isGroupUseEntireRow();
            if (skipGroupRows) {
                var rowNode = this.rowModel.getRow(nextCell.rowIndex);
                if (!rowNode.group) {
                    break;
                }
            }
            else {
                break;
            }
        }
        // no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid
        if (!nextCell) {
            return;
        }
        // this scrolls the row into view
        if (utils_1.Utils.missing(nextCell.floating)) {
            this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
        }
        if (!nextCell.column.isPinned()) {
            this.gridPanel.ensureColumnVisible(nextCell.column);
        }
        // need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
        // floating cell, the scrolls get out of sync
        this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
        this.focusedCellController.setFocusedCell(nextCell.rowIndex, nextCell.column, nextCell.floating, true);
        if (this.rangeController) {
            this.rangeController.setRangeToCell(new gridCell_1.GridCell(nextCell.rowIndex, nextCell.floating, nextCell.column));
        }
    };
    // called by the cell, when tab is pressed while editing
    RowRenderer.prototype.startEditingNextCell = function (rowIndex, column, floating, shiftKey) {
        var nextCell = new gridCell_1.GridCell(rowIndex, floating, column);
        while (true) {
            if (shiftKey) {
                nextCell = this.cellNavigationService.getNextTabbedCellBackwards(nextCell);
            }
            else {
                nextCell = this.cellNavigationService.getNextTabbedCellForwards(nextCell);
            }
            var nextRenderedRow;
            switch (nextCell.floating) {
                case constants_1.Constants.FLOATING_TOP:
                    nextRenderedRow = this.renderedTopFloatingRows[nextCell.rowIndex];
                    break;
                case constants_1.Constants.FLOATING_BOTTOM:
                    nextRenderedRow = this.renderedBottomFloatingRows[nextCell.rowIndex];
                    break;
                default:
                    nextRenderedRow = this.renderedRows[nextCell.rowIndex];
                    break;
            }
            if (!nextRenderedRow) {
                // this happens if we are on floating row and try to jump to body
                return;
            }
            var nextRenderedCell = nextRenderedRow.getRenderedCellForColumn(nextCell.column);
            if (nextRenderedCell.isCellEditable()) {
                // this scrolls the row into view
                if (utils_1.Utils.missing(nextCell.floating)) {
                    this.gridPanel.ensureIndexVisible(nextCell.rowIndex);
                }
                this.gridPanel.ensureColumnVisible(nextCell.column);
                // need to nudge the scrolls for the floating items. otherwise when we set focus on a non-visible
                // floating cell, the scrolls get out of sync
                this.gridPanel.horizontallyScrollHeaderCenterAndFloatingCenter();
                nextRenderedCell.startEditing();
                nextRenderedCell.focusCell(false);
                if (this.rangeController) {
                    this.rangeController.setRangeToCell(new gridCell_1.GridCell(nextCell.rowIndex, nextCell.floating, nextCell.column));
                }
                return;
            }
        }
    };
    __decorate([
        context_4.Autowired('columnController'),
        __metadata('design:type', columnController_1.ColumnController)
    ], RowRenderer.prototype, "columnController", void 0);
    __decorate([
        context_4.Autowired('gridOptionsWrapper'),
        __metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
    ], RowRenderer.prototype, "gridOptionsWrapper", void 0);
    __decorate([
        context_4.Autowired('gridCore'),
        __metadata('design:type', gridCore_1.GridCore)
    ], RowRenderer.prototype, "gridCore", void 0);
    __decorate([
        context_4.Autowired('selectionRendererFactory'),
        __metadata('design:type', selectionRendererFactory_1.SelectionRendererFactory)
    ], RowRenderer.prototype, "selectionRendererFactory", void 0);
    __decorate([
        context_4.Autowired('gridPanel'),
        __metadata('design:type', gridPanel_1.GridPanel)
    ], RowRenderer.prototype, "gridPanel", void 0);
    __decorate([
        context_4.Autowired('$compile'),
        __metadata('design:type', Object)
    ], RowRenderer.prototype, "$compile", void 0);
    __decorate([
        context_4.Autowired('$scope'),
        __metadata('design:type', Object)
    ], RowRenderer.prototype, "$scope", void 0);
    __decorate([
        context_4.Autowired('expressionService'),
        __metadata('design:type', expressionService_1.ExpressionService)
    ], RowRenderer.prototype, "expressionService", void 0);
    __decorate([
        context_4.Autowired('templateService'),
        __metadata('design:type', templateService_1.TemplateService)
    ], RowRenderer.prototype, "templateService", void 0);
    __decorate([
        context_4.Autowired('valueService'),
        __metadata('design:type', valueService_1.ValueService)
    ], RowRenderer.prototype, "valueService", void 0);
    __decorate([
        context_4.Autowired('eventService'),
        __metadata('design:type', eventService_1.EventService)
    ], RowRenderer.prototype, "eventService", void 0);
    __decorate([
        context_4.Autowired('floatingRowModel'),
        __metadata('design:type', floatingRowModel_1.FloatingRowModel)
    ], RowRenderer.prototype, "floatingRowModel", void 0);
    __decorate([
        context_4.Autowired('context'),
        __metadata('design:type', context_3.Context)
    ], RowRenderer.prototype, "context", void 0);
    __decorate([
        context_4.Autowired('loggerFactory'),
        __metadata('design:type', logger_1.LoggerFactory)
    ], RowRenderer.prototype, "loggerFactory", void 0);
    __decorate([
        context_4.Autowired('rowModel'),
        __metadata('design:type', Object)
    ], RowRenderer.prototype, "rowModel", void 0);
    __decorate([
        context_4.Autowired('focusedCellController'),
        __metadata('design:type', focusedCellController_1.FocusedCellController)
    ], RowRenderer.prototype, "focusedCellController", void 0);
    __decorate([
        context_6.Optional('rangeController'),
        __metadata('design:type', Object)
    ], RowRenderer.prototype, "rangeController", void 0);
    __decorate([
        context_4.Autowired('cellNavigationService'),
        __metadata('design:type', cellNavigationService_1.CellNavigationService)
    ], RowRenderer.prototype, "cellNavigationService", void 0);
    __decorate([
        __param(0, context_2.Qualifier('loggerFactory')),
        __metadata('design:type', Function),
        __metadata('design:paramtypes', [logger_1.LoggerFactory]),
        __metadata('design:returntype', void 0)
    ], RowRenderer.prototype, "agWire", null);
    __decorate([
        context_5.PostConstruct,
        __metadata('design:type', Function),
        __metadata('design:paramtypes', []),
        __metadata('design:returntype', void 0)
    ], RowRenderer.prototype, "init", null);
    RowRenderer = __decorate([
        context_1.Bean('rowRenderer'),
        __metadata('design:paramtypes', [])
    ], RowRenderer);
    return RowRenderer;
})();
exports.RowRenderer = RowRenderer;


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class com.licel.jcardsim.samples.SecureRMIDemo.MySecurityService (Java Card Runime Environment Simulator 2.2.1-SNAPSHOT API)
</TITLE>

<META NAME="date" CONTENT="2013-07-17">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
com.licel.jcardsim.samples.SecureRMIDemo.MySecurityService

No usage of com.licel.jcardsim.samples.SecureRMIDemo.MySecurityService

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
package org.apache.calcite.runtime;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

/**
 * Map that allows you to partition values into lists according to a common
 * key, and then convert those lists into an iterator of sorted arrays.
 *
 * @param <K> Key type
 * @param <V> Value type
 */
public class SortedMultiMap<K, V> extends HashMap<K, List<V>> {
  public void putMulti(K key, V value) {
    List<V> list = put(key, Collections.singletonList(value));
    if (list == null) {
      return;
    }
    if (list.size() == 1) {
      list = new ArrayList<>(list);
    }
    list.add(value);
    put(key, list);
  }

  public Iterator<V[]> arrays(final Comparator<V> comparator) {
    final Iterator<List<V>> iterator = values().iterator();
    return new Iterator<V[]>() {
      @Override public boolean hasNext() {
        return iterator.hasNext();
      }

      @Override public V[] next() {
        List<V> list = iterator.next();
        @SuppressWarnings("unchecked")
        final V[] vs = (V[]) list.toArray();
        Arrays.sort(vs, comparator);
        return vs;
      }

      @Override public void remove() {
        throw new UnsupportedOperationException();
      }
    };
  }

  /** Shortcut method if the partition key is empty. We know that we would end
   * up with a map with just one entry, so save ourselves the trouble of all
   * that hashing. */
  public static <V> Iterator<V[]> singletonArrayIterator(
      Comparator<V> comparator, List<V> list) {
    final SortedMultiMap<Object, V> multiMap =
        new SortedMultiMap<>();
    multiMap.put("x", list);
    return multiMap.arrays(comparator);
  }
}


text:
package me.ianhe.pp.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.ianhe.pp.dao.QuestionDao;
import me.ianhe.pp.entity.QuestionEntity;
import org.springframework.stereotype.Service;

/**
 * @author iHelin ihelin@outlook.com
 * @since 2021-04-16 12:01:34
 */
@Service
public class QuestionService extends ServiceImpl<QuestionDao, QuestionEntity> {

}


text:
using System;
using System.Linq;
using Vexe.Runtime.Extensions;
using Vexe.Runtime.Helpers;
using Vexe.Runtime.Types;
using Vexe.Editor.Types;

namespace Vexe.Editor.Drawers
{
	public class ShowTypeDrawer : AttributeDrawer<Type, ShowTypeAttribute>
	{
		private Type[] availableTypes;
		private string[] typesNames;
		private int index;

		protected override void Initialize()
		{
			if (attribute.FromThisGo)
			{
				availableTypes = gameObject.GetAllComponents()
										   .Select(x => x.GetType())
										   .Where(x => x.IsA(attribute.baseType))
										   .ToArray();
			}
			else
			{
				availableTypes = ReflectionHelper.GetAllTypesOf(attribute.baseType)
												 .Where(t => !t.IsAbstract)
												 .ToArray();
			}

			typesNames = availableTypes.Select(t => t.Name)
									   .ToArray();
		}

		public override void OnGUI()
		{
			index = member.IsNull() ? -1 : availableTypes.IndexOf(memberValue);
			var selection = gui.Popup(displayText, index, typesNames);
			{
				if (index != selection)
				{
					memberValue = availableTypes[selection];
					index = selection;
				}
			}
		}
	}
}


text:
package Tangerine::hook::prefixedlist;
{
  $Tangerine::hook::prefixedlist::VERSION = '0.11';
}
use 5.010;
use strict;
use warnings;
use List::MoreUtils qw(any);
use Mo;
use Tangerine::HookData;
use Tangerine::Occurence;
use Tangerine::Utils qw(stripquotelike);

extends 'Tangerine::Hook';

sub run {
    my ($self, $s) = @_;
    if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 &&
        (any { $s->[1] eq $_ } qw(Inline Mo POE))) {
        my ($version) = $s->[2] =~ /^(\d.*)$/o;
        $version //= '';
        my $voffset = $version ? 3 : 2;
        my @args;
        if (scalar(@$s) > $voffset) {
            return if $s->[$voffset] eq ';';
            @args = @$s;
            @args = @args[($voffset) .. $#args];
            @args = stripquotelike(@args);
        }
        @args = $args[0] if $s->[1] eq 'Inline';
        return Tangerine::HookData->new(
            modules => {
                map {
                    ( $s->[1].'::'.$_ => Tangerine::Occurence->new() )
                    } @args,
                },
            );
    }
    return;
}

1;

__END__

=pod

=encoding utf8

=head1 NAME

Tangerine::hook::prefixedlist - Process simple sub-module lists.

=head1 DESCRIPTION

This hook catches C<use> statements with modules loading more modules
listed as their arguments.  The difference from L<Tangerine::hook::list>
is these modules use the same namespace as the module loading them.

Currently this hook knows about L<Inline>, L<Mo> and L<POE>.

=head1 AUTHOR

Petr Šabata <contyk@redhat.com>

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2014 Petr Šabata

See LICENSE for licensing details.

=cut