text:
#ifndef RUBYSPEC_H
#define RUBYSPEC_H
/* First define all function flags */

/* Array */
#define HAVE_RARRAY                        1
#define HAVE_RARRAY_LEN                    1
#define HAVE_RARRAY_PTR                    1
#define HAVE_RB_ARY_AREF                   1
#define HAVE_RB_ARY_CLEAR                  1
#define HAVE_RB_ARY_DELETE                 1
#define HAVE_RB_ARY_DELETE_AT              1
#define HAVE_RB_ARY_DUP                    1
#define HAVE_RB_ARY_ENTRY                  1
#define HAVE_RB_ARY_FREEZE                 1
#define HAVE_RB_ARY_INCLUDES               1
#define HAVE_RB_ARY_JOIN                   1
#define HAVE_RB_ARY_NEW                    1
#define HAVE_RB_ARY_NEW2                   1
#define HAVE_RB_ARY_NEW3                   1
#define HAVE_RB_ARY_NEW4                   1
#define HAVE_RB_ARY_POP                    1
#define HAVE_RB_ARY_PUSH                   1
#define HAVE_RB_ARY_REVERSE                1
#define HAVE_RB_ARY_SHIFT                  1
#define HAVE_RB_ARY_STORE                  1
#define HAVE_RB_ARY_TO_ARY                 1
#define HAVE_RB_ARY_TO_S                   1
#define HAVE_RB_ARY_UNSHIFT                1
#define HAVE_RB_ASSOC_NEW                  1
#define HAVE_RB_INSPECTING_P               1
#define HAVE_RB_PROTECT_INSPECT            1

#define HAVE_RB_EACH                       1
#define HAVE_RB_ITERATE                    1
#define HAVE_RB_MEM_CLEAR                  1

/* Bignum */
#define HAVE_RBIGNUM_NEGATIVE_P            1
#define HAVE_RBIGNUM_POSITIVE_P            1
#define HAVE_RBIGNUM_SIGN                  1
#define HAVE_RB_BIG2DBL                    1
#define HAVE_RB_BIG2LL                     1
#define HAVE_RB_BIG2LONG                   1
#define HAVE_RB_BIG2STR                    1
#define HAVE_RB_BIG2ULONG                  1

/* Class */
#define HAVE_RB_CALL_SUPER                 1
#define HAVE_RB_CLASS2NAME                 1
#define HAVE_RB_CLASS_INHERITED            1
#define HAVE_RB_CLASS_NAME                 1
#define HAVE_RB_CLASS_NEW                  1
#define HAVE_RB_CLASS_NEW_INSTANCE         1
#define HAVE_RB_CVAR_DEFINED               1
#define HAVE_RB_CVAR_GET                   1
#define HAVE_RB_CVAR_SET                   1
#define HAVE_RB_CV_GET                     1
#define HAVE_RB_CV_SET                     1
#define HAVE_RB_DEFINE_ATTR                1
#define HAVE_RB_DEFINE_CLASS_VARIABLE      1
#define HAVE_RB_INCLUDE_MODULE             1
#define HAVE_RB_PATH2CLASS                 1
#define HAVE_RB_PATH_TO_CLASS              1

/* Constants */
#define HAVE_RB_CARRAY                     1
#define HAVE_RB_CBIGNUM                    1
#define HAVE_RB_CCLASS                     1
#define HAVE_RB_CDATA                      1
#define HAVE_RB_CFALSECLASS                1
#define HAVE_RB_CFILE                      1
#define HAVE_RB_CFIXNUM                    1
#define HAVE_RB_CFLOAT                     1
#define HAVE_RB_CHASH                      1
#define HAVE_RB_CINTEGER                   1
#define HAVE_RB_CIO                        1
#define HAVE_RB_CMATCH                     1
#define HAVE_RB_CMODULE                    1
#define HAVE_RB_CNILCLASS                  1
#define HAVE_RB_CNUMERIC                   1
#define HAVE_RB_COBJECT                    1
#define HAVE_RB_CPROC                      1
#define HAVE_RB_CMETHOD                    1
#define HAVE_RB_CRANGE                     1
#define HAVE_RB_CREGEXP                    1
#define HAVE_RB_CSTRING                    1
#define HAVE_RB_CSTRUCT                    1
#define HAVE_RB_CSYMBOL                    1
#define HAVE_RB_CTHREAD                    1
#define HAVE_RB_CTRUECLASS                 1
#define HAVE_RB_EARGERROR                  1
#define HAVE_RB_EEOFERROR                  1
#define HAVE_RB_EEXCEPTION                 1
#define HAVE_RB_EFLOATDOMAINERROR          1
#define HAVE_RB_EINDEXERROR                1
#define HAVE_RB_EINTERRUPT                 1
#define HAVE_RB_EIOERROR                   1
#define HAVE_RB_ELOADERROR                 1
#define HAVE_RB_ELOCALJUMPERROR            1
#define HAVE_RB_EMATHDOMAINERROR           1
#define HAVE_RB_ENAMEERROR                 1
#define HAVE_RB_ENOMEMERROR                1
#define HAVE_RB_ENOMETHODERROR             1
#define HAVE_RB_ENOTIMPERROR               1
#define HAVE_RB_ERANGEERROR                1
#define HAVE_RB_EREGEXPERROR               1
#define HAVE_RB_ERUNTIMEERROR              1
#define HAVE_RB_ESCRIPTERROR               1
#define HAVE_RB_ESECURITYERROR             1
#define HAVE_RB_ESIGNAL                    1
#define HAVE_RB_ESTANDARDERROR             1
#define HAVE_RB_ESYNTAXERROR               1
#define HAVE_RB_ESYSSTACKERROR             1
#define HAVE_RB_ESYSTEMCALLERROR           1
#define HAVE_RB_ESYSTEMEXIT                1
#define HAVE_RB_ETHREADERROR               1
#define HAVE_RB_ETYPEERROR                 1
#define HAVE_RB_EZERODIVERROR              1
#define HAVE_RB_MCOMPARABLE                1
#define HAVE_RB_MENUMERABLE                1
#define HAVE_RB_MERRNO                     1
#define HAVE_RB_MKERNEL                    1

/* Data */
#define HAVE_DATA_WRAP_STRUCT              1
#define HAVE_RDATA                         1

/* Exception */
#define HAVE_RB_EXC_NEW                    1
#define HAVE_RB_EXC_NEW2                   1
#define HAVE_RB_EXC_NEW3                   1
#define HAVE_RB_EXC_RAISE                  1
#define HAVE_RB_SET_ERRINFO                1

/* File */
#define HAVE_RB_FILE_OPEN                  1

/* Float */
#define HAVE_RB_FLOAT_NEW                  1
#define HAVE_RB_RFLOAT                     1
#define HAVE_RFLOAT                        1
#define HAVE_RFLOAT_VALUE                  1

/* Globals */
#define HAVE_RB_DEFINE_HOOKED_VARIABLE     1
#define HAVE_RB_DEFINE_READONLY_VARIABLE   1
#define HAVE_RB_DEFINE_VARIABLE            1
#define HAVE_RB_F_GLOBAL_VARIABLES         1
#define HAVE_RB_GV_GET                     1
#define HAVE_RB_GV_SET                     1
#define HAVE_RB_SET_KCODE                  1

/* Hash */
#define HAVE_RB_HASH                       1
#define HAVE_RB_HASH_AREF                  1
#define HAVE_RB_HASH_ASET                  1
#define HAVE_RB_HASH_DELETE                1
#define HAVE_RB_HASH_DELETE_IF             1
#define HAVE_RB_HASH_FOREACH               1
#define HAVE_RB_HASH_LOOKUP                1
#define HAVE_RB_HASH_NEW                   1
#define HAVE_RB_HASH_SIZE                  1

/* IO */
#define HAVE_GET_OPEN_FILE                 1
#define HAVE_RB_IO_CHECK_CLOSED            1
#define HAVE_RB_IO_CHECK_READABLE          1
#define HAVE_RB_IO_CHECK_WRITABLE          1
#define HAVE_RB_IO_CLOSE                   1
#define HAVE_RB_IO_WAIT_READABLE           1
#define HAVE_RB_IO_WAIT_WRITABLE           1
#define HAVE_RB_IO_WRITE                   1

/* Kernel */
#define HAVE_RB_BLOCK_GIVEN_P              1
#define HAVE_RB_BLOCK_PROC                 1
#define HAVE_RB_ENSURE                     1
#define HAVE_RB_EVAL_STRING                1
#define HAVE_RB_EXEC_RECURSIVE             1
#define HAVE_RB_F_SPRINTF                  1
#define HAVE_RB_NEED_BLOCK                 1
#define HAVE_RB_RAISE                      1
#define HAVE_RB_RESCUE                     1
#define HAVE_RB_RESCUE2                    1
#define HAVE_RB_SET_END_PROC               1
#define HAVE_RB_SYS_FAIL                   1
#define HAVE_RB_THROW                      1
#define HAVE_RB_WARN                       1
#define HAVE_RB_YIELD                      1
#define HAVE_RB_YIELD_SPLAT                1
#define HAVE_RB_YIELD_VALUES               1

/* GC */
#define HAVE_RB_GC_REGISTER_ADDRESS        1

/* Marshal */
#define HAVE_RB_MARSHAL_DUMP               1
#define HAVE_RB_MARSHAL_LOAD               1

/* Module */
#define HAVE_RB_ALIAS                      1
#define HAVE_RB_CONST_DEFINED              1
#define HAVE_RB_CONST_DEFINED_AT           1
#define HAVE_RB_CONST_GET                  1
#define HAVE_RB_CONST_GET_AT               1
#define HAVE_RB_CONST_GET_FROM             1
#define HAVE_RB_CONST_SET                  1
#define HAVE_RB_DEFINE_ALIAS               1
#define HAVE_RB_DEFINE_CLASS_UNDER         1
#define HAVE_RB_DEFINE_CONST               1
#define HAVE_RB_DEFINE_GLOBAL_CONST        1
#define HAVE_RB_DEFINE_GLOBAL_FUNCTION     1
#define HAVE_RB_DEFINE_METHOD              1
#define HAVE_RB_DEFINE_MODULE_FUNCTION     1
#define HAVE_RB_DEFINE_MODULE_UNDER        1
#define HAVE_RB_DEFINE_PRIVATE_METHOD      1
#define HAVE_RB_DEFINE_PROTECTED_METHOD    1
#define HAVE_RB_DEFINE_SINGLETON_METHOD    1
#define HAVE_RB_UNDEF                      1
#define HAVE_RB_UNDEF_METHOD               1

/* Numeric */
#define HAVE_NUM2CHR                       1
#define HAVE_RB_CMPINT                     1
#define HAVE_RB_INT2INUM                   1
#define HAVE_RB_INTEGER                    1
#define HAVE_RB_LL2INUM                    1
#define HAVE_RB_NUM2DBL                    1
#define HAVE_RB_NUM2LONG                   1
#define HAVE_RB_NUM2ULONG                  1
#define HAVE_RB_NUM_COERCE_BIN             1
#define HAVE_RB_NUM_COERCE_CMP             1
#define HAVE_RB_NUM_COERCE_RELOP           1
#define HAVE_RB_NUM_ZERODIV                1

/* Object */
#define HAVE_OBJ_TAINT                     1
#define HAVE_OBJ_TAINTED                   1
#define HAVE_RB_ANY_TO_S                   1
#define HAVE_RB_ATTR_GET                   1
#define HAVE_RB_CHECK_ARRAY_TYPE           1
#define HAVE_RB_CHECK_CONVERT_TYPE         1
#define HAVE_RB_CHECK_TO_INTEGER           1
#define HAVE_RB_CHECK_FROZEN               1
#define HAVE_RB_CHECK_STRING_TYPE          1
#define HAVE_RB_CLASS_OF                   1
#define HAVE_RB_CONVERT_TYPE               1
#define HAVE_RB_EQUAL                      1
#define HAVE_RB_CLASS_INHERITED_P          1
#define HAVE_RB_EXTEND_OBJECT              1
#define HAVE_RB_INSPECT                    1
#define HAVE_RB_IVAR_DEFINED               1
#define HAVE_RB_IVAR_GET                   1
#define HAVE_RB_IVAR_SET                   1
#define HAVE_RB_IV_GET                     1
#define HAVE_RB_IV_SET                     1
#define HAVE_RB_OBJ_ALLOC                  1
#define HAVE_RB_OBJ_CALL_INIT              1
#define HAVE_RB_OBJ_CLASSNAME              1
#define HAVE_RB_OBJ_DUP                    1
#define HAVE_RB_OBJ_FREEZE                 1
#define HAVE_RB_OBJ_FROZEN_P               1
#define HAVE_RB_OBJ_ID                     1
#define HAVE_RB_OBJ_INSTANCE_EVAL          1
#define HAVE_RB_OBJ_IS_INSTANCE_OF         1
#define HAVE_RB_OBJ_IS_KIND_OF             1
#define HAVE_RB_OBJ_TAINT                  1
#define HAVE_RB_REQUIRE                    1
#define HAVE_RB_RESPOND_TO                 1
#define HAVE_RB_OBJ_RESPOND_TO             1
#define HAVE_RB_SPECIAL_CONST_P            1
#define HAVE_RB_TO_ID                      1
#define HAVE_RB_TO_INT                     1
#define HAVE_RTEST                         1
#define HAVE_TYPE                          1
#define HAVE_BUILTIN_TYPE                  1

/* Proc */
#define HAVE_RB_PROC_NEW                   1

/* Range */
#define HAVE_RB_RANGE_NEW                  1

/* Rational */
#define HAVE_RB_RATIONAL                   1
#define HAVE_RB_RATIONAL1                  1
#define HAVE_RB_RATIONAL2                  1

/* Regexp */
#define HAVE_RB_BACKREF_GET                1
#define HAVE_RB_REG_MATCH                  1
#define HAVE_RB_REG_NEW                    1
#define HAVE_RB_REG_NTH_MATCH              1
#define HAVE_RB_REG_OPTIONS                1
#define HAVE_RB_REG_REGCOMP                1

/* Safe */
#define HAVE_RB_SAFE_LEVEL                 1
#define HAVE_RB_SECURE                     1

/* String */
#define HAVE_RB_CSTR2INUM                  1
#define HAVE_RB_STR2CSTR                   1
#define HAVE_RB_STR2INUM                   1
#define HAVE_RB_STR_APPEND                 1
#define HAVE_RB_STR_BUF_CAT                1
#define HAVE_RB_STR_BUF_NEW                1
#define HAVE_RB_STR_BUF_NEW2               1
#define HAVE_RB_STR_CAT                    1
#define HAVE_RB_STR_CAT2                   1
#define HAVE_RB_STR_CMP                    1
#define HAVE_RB_STR_DUP                    1
#define HAVE_RB_STR_FLUSH                  1
#define HAVE_RB_STR_FREEZE                 1
#define HAVE_RB_STR_HASH                   1
#define HAVE_RB_STR_INTERN                 1
#define HAVE_RB_STR_LEN                    1
#define HAVE_RB_STR_NEW                    1
#define HAVE_RB_STR_NEW_CSTR               1
#define HAVE_RB_STR_NEW2                   1
#define HAVE_RB_STR_NEW3                   1
#define HAVE_RB_STR_NEW4                   1
#define HAVE_RB_STR_PLUS                   1
#define HAVE_RB_STR_PTR                    1
#define HAVE_RB_STR_PTR_READONLY           1
#define HAVE_RB_STR_RESIZE                 1
#define HAVE_RB_STR_SET_LEN                1
#define HAVE_RB_STR_SPLIT                  1
#define HAVE_RB_STR_SUBSTR                 1
#define HAVE_RB_STR_TO_STR                 1
#define HAVE_RSTRING                       1
#define HAVE_RSTRING_LEN                   1
#define HAVE_RSTRING_PTR                   1
#define HAVE_STR2CSTR                      1
#define HAVE_STRINGVALUE                   1

/* Struct */
#define HAVE_RB_STRUCT_AREF                1
#define HAVE_RB_STRUCT_ASET                1
#define HAVE_RB_STRUCT_DEFINE              1
#define HAVE_RB_STRUCT_NEW                 1
#define HAVE_RB_STRUCT_GETMEMBER           1

/* Symbol */
#define HAVE_RB_ID2NAME                    1
#define HAVE_RB_INTERN                     1
#define HAVE_RB_IS_CLASS_ID                1
#define HAVE_RB_IS_CONST_ID                1
#define HAVE_RB_IS_INSTANCE_ID             1

/* Thread */
#define HAVE_RB_THREAD_ALONE               1
#define HAVE_RB_THREAD_BLOCKING_REGION     1
#define HAVE_RB_THREAD_CURRENT             1
#define HAVE_RB_THREAD_LOCAL_AREF          1
#define HAVE_RB_THREAD_LOCAL_ASET          1
#define HAVE_RB_THREAD_SELECT              1
#define HAVE_RB_THREAD_WAIT_FOR            1
#define HAVE_RB_THREAD_WAKEUP              1

/* Time */
#define HAVE_RB_TIME_NEW                   1

/* Util */
#define HAVE_RB_SCAN_ARGS                  1
#define HAVE_RUBY_SETENV                   1
#define HAVE_RUBY_STRDUP                   1

/* Define convenience macros similar to the RubySpec guards to assist
 * with version incompatibilities.
 */

#include "rubyspec_version.h"

#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 8
#define RUBY_VERSION_IS_1_8_EX_1_9
#endif

#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR >= 8
#define RUBY_VERSION_IS_1_8
#endif

#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 8 && RUBY_VERSION_TEENY < 7
#define RUBY_VERSION_IS_1_8_EX_1_8_7
#endif

#if (RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 9) || (RUBY_VERSION_MAJOR == 2)
#define RUBY_VERSION_IS_1_9
#endif

/* Now, create the differential set. The format of the preprocessor directives
 * is significant. The alternative implementations should define RUBY because
 * some extensions depend on that. But only one alternative implementation
 * macro should be defined at a time. The conditional is structured so that if
 * no alternative implementation is defined then MRI is assumed and "mri.h"
 * will be included.
 */

#if defined(RUBINIUS)
#include "rubinius.h"
#elif defined(JRUBY)
#include "jruby.h"
#else /* MRI */
#include "mri.h"
#endif

#endif


text:
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec

# hex: 0x000500
_REQUEST_MESSAGE_TYPE = 1280
# hex: 0x000501
_RESPONSE_MESSAGE_TYPE = 1281

_REQUEST_INITIAL_FRAME_SIZE = REQUEST_HEADER_SIZE

def encode_request(name, service_name):
    buf = create_initial_buffer(_REQUEST_INITIAL_FRAME_SIZE, _REQUEST_MESSAGE_TYPE)
    StringCodec.encode(buf, name)
    StringCodec.encode(buf, service_name, True)
    return OutboundMessage(buf, False)

redpajama_set_name: RedPajamaGithub


text: Prueba de README


text:
<?php
namespace Productsite;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Productsite\Model\WidgetTable;
use Productsite\Model\SalesTable;
use Productsite\Model\ChaseTable;
use Productsite\Model\EnquiryTable;

class Module
{
	public function onBootstrap(MvcEvent $e)
	{
		$eventManager = $e->getApplication()->getEventManager();
		$moduleRouteListener = new ModuleRouteListener();
		$moduleRouteListener->attach($eventManager);
	}

	public function getConfig()
	{
		return include __DIR__ . '/config/module.config.php';
	}

	public function getAutoloaderConfig()
	{
		return array(
			'Zend\Loader\StandardAutoloader' => array(
				'namespaces' => array(
					__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__
				)
			)
		);
	}

	public function getServiceConfig()
	{
		return array(
			'factories' => array(
				'Productsite\Model\WidgetTable' => function($sm) {
					$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
					$table = new WidgetTable($dbAdapter);
					return $table;
				},
				'Productsite\Model\SalesTable' => function($sm) {
					$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
					$table = new SalesTable($dbAdapter);
					return $table;
				},
				'Productsite\Model\ChaseTable' => function($sm) {
					$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
					$table = new ChaseTable($dbAdapter);
					return $table;
				},
				'Productsite\Model\EnquiryTable' => function($sm) {
					$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
					$table = new EnquiryTable($dbAdapter);
					return $table;
				}
			)
		);
	}
}


text:
import * as Json from "../../JsonDecoder";
import { Sums } from "./Sums";

/*
let decodeSums1 : Json.Decoder<Sums> = Json.object<Sums>({
  xxx: Json.oneOf<boolean|number|null>([Json.boolean, Json.number]), // null not assignable: does not compile
  yyy: Json.nullable(Json.string),
  zzz: Json.oneOf<string|boolean|number>([Json.string, Json.boolean, Json.number])
});
*/

/*
let decodeSums2 : Json.Decoder<Sums> = Json.object<Sums>({
  xxx: Json.oneOf<boolean|number>([Json.boolean, Json.number]),
  yyy: Json.oneOf([Json.string, Json.isnull(null)]),
  zzz: Json.oneOf([Json.string, Json.boolean, Json.number]) // missing type annotation: does not compile
});
*/


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Calendar on Asterisk, and other worldly endeavours</title>
    <link>http://blog.leifmadsen.com/tags/calendar/index.xml</link>
    <description>Recent content in Calendar on Asterisk, and other worldly endeavours</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <atom:link href="/tags/calendar/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Video of '5 Things You Didn't Know Asterisk Could Do' Presentation Now Available</title>
      <link>http://blog.leifmadsen.com/blog/2010/12/21/video-of-5-things-you-didnt-know-asterisk-could-do-presentation-now-available/</link>
      <pubDate>Tue, 21 Dec 2010 15:26:43 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2010/12/21/video-of-5-things-you-didnt-know-asterisk-could-do-presentation-now-available/</guid>
      <description>Check out the AstriCon website for my presentation that was recorded this year. I did three presentations this year (5 Things You Didn&rsquo;t Know Asterisk Could Do, Distributed Call Centres, and the Asterisk Project Update with Russell Bryant) but unfortunately the only one I see so far is the 5 Things presentation (which is a very good presentation! :))
The link to the presentations are here: http://www.astricon.net/videoPresentations.aspx#Digium7 with mine being at the top of the list.</description>
    </item>

    <item>
      <title>Scheduling automated calls between two participants with res_calendar</title>
      <link>http://blog.leifmadsen.com/blog/2010/09/29/scheduling-automated-calls-between-two-participants-with-res_calendar/</link>
      <pubDate>Wed, 29 Sep 2010 14:25:50 +0000</pubDate>

      <guid>http://blog.leifmadsen.com/blog/2010/09/29/scheduling-automated-calls-between-two-participants-with-res_calendar/</guid>
      <description>Here is a little dialplan snippet I wrote this morning for the next edition of the Asterisk book. While I&rsquo;m not going to delve into all the aspects of setting up res_calendar like we do in the book, I thought for those of you who might already have this working might enjoy it.
(The calendaring modules are available in Asterisk 1.8, which is currently in release candidate status. Check out http://www.</description>
    </item>

  </channel>
</rss>


text: PHP MVC micro framework fitting any new project


text:
/* When a graph view needs to create a data provider, this router will
   ensure that it gets the correct provider for the graph type */
(function (module) {

    module.GetDataProvider = function (graph, isNew) {
        // TODO Possibly create an enum out of these.
        if (graph.Type == 0) {
            return new module.LineDataProvider(graph);
        }
        if (graph.Type == 1) {
            return new module.RatioDataProvider(graph, isNew);
        }
        else if (graph.Type == 2) {
            return new module.CohortDataProvider(graph);
        }
        throw "error";
    };

})(ZM.module('dataProvider'))


text:
package org.apache.hadoop.hbase.regionserver;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.hadoop.hbase.HBaseTestCase;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.KeyValue.KVComparator;
import org.apache.hadoop.hbase.SmallTests;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.regionserver.ScanQueryMatcher.MatchCode;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
import org.junit.experimental.categories.Category;

@Category(SmallTests.class)
public class TestQueryMatcher extends HBaseTestCase {
  private static final boolean PRINT = false;

  private byte[] row1;
  private byte[] row2;
  private byte[] fam1;
  private byte[] fam2;
  private byte[] col1;
  private byte[] col2;
  private byte[] col3;
  private byte[] col4;
  private byte[] col5;

  private byte[] data;

  private Get get;

  long ttl = Long.MAX_VALUE;
  KVComparator rowComparator;
  private Scan scan;

  public void setUp() throws Exception {
    super.setUp();
    row1 = Bytes.toBytes("row1");
    row2 = Bytes.toBytes("row2");
    fam1 = Bytes.toBytes("fam1");
    fam2 = Bytes.toBytes("fam2");
    col1 = Bytes.toBytes("col1");
    col2 = Bytes.toBytes("col2");
    col3 = Bytes.toBytes("col3");
    col4 = Bytes.toBytes("col4");
    col5 = Bytes.toBytes("col5");

    data = Bytes.toBytes("data");

    //Create Get
    get = new Get(row1);
    get.addFamily(fam1);
    get.addColumn(fam2, col2);
    get.addColumn(fam2, col4);
    get.addColumn(fam2, col5);
    this.scan = new Scan(get);

    rowComparator = KeyValue.COMPARATOR;

  }

  public void testMatch_ExplicitColumns()
  throws IOException {
    //Moving up from the Tracker by using Gets and List<KeyValue> instead
    //of just byte []

    //Expected result
    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
    expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL);
    expected.add(ScanQueryMatcher.MatchCode.SEEK_NEXT_COL);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_ROW);
    expected.add(ScanQueryMatcher.MatchCode.DONE);

    // 2,4,5

    ScanQueryMatcher qm = new ScanQueryMatcher(scan, new HStore.ScanInfo(fam2,
        0, 1, ttl, false, 0, rowComparator), get.getFamilyMap().get(fam2),
        EnvironmentEdgeManager.currentTimeMillis() - ttl);

    List<KeyValue> memstore = new ArrayList<KeyValue>();
    memstore.add(new KeyValue(row1, fam2, col1, 1, data));
    memstore.add(new KeyValue(row1, fam2, col2, 1, data));
    memstore.add(new KeyValue(row1, fam2, col3, 1, data));
    memstore.add(new KeyValue(row1, fam2, col4, 1, data));
    memstore.add(new KeyValue(row1, fam2, col5, 1, data));

    memstore.add(new KeyValue(row2, fam1, col1, data));

    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();
    qm.setRow(memstore.get(0).getRow());

    for (KeyValue kv : memstore){
      actual.add(qm.match(kv));
    }

    assertEquals(expected.size(), actual.size());
    for(int i=0; i< expected.size(); i++){
      assertEquals(expected.get(i), actual.get(i));
      if(PRINT){
        System.out.println("expected "+expected.get(i)+
            ", actual " +actual.get(i));
      }
    }
  }

  public void testMatch_Wildcard()
  throws IOException {
    //Moving up from the Tracker by using Gets and List<KeyValue> instead
    //of just byte []

    //Expected result
    List<MatchCode> expected = new ArrayList<ScanQueryMatcher.MatchCode>();
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
    expected.add(ScanQueryMatcher.MatchCode.INCLUDE);
    expected.add(ScanQueryMatcher.MatchCode.DONE);

    ScanQueryMatcher qm = new ScanQueryMatcher(scan, new HStore.ScanInfo(fam2,
        0, 1, ttl, false, 0, rowComparator), null,
        EnvironmentEdgeManager.currentTimeMillis() - ttl);

    List<KeyValue> memstore = new ArrayList<KeyValue>();
    memstore.add(new KeyValue(row1, fam2, col1, 1, data));
    memstore.add(new KeyValue(row1, fam2, col2, 1, data));
    memstore.add(new KeyValue(row1, fam2, col3, 1, data));
    memstore.add(new KeyValue(row1, fam2, col4, 1, data));
    memstore.add(new KeyValue(row1, fam2, col5, 1, data));
    memstore.add(new KeyValue(row2, fam1, col1, 1, data));

    List<ScanQueryMatcher.MatchCode> actual = new ArrayList<ScanQueryMatcher.MatchCode>();

    qm.setRow(memstore.get(0).getRow());

    for(KeyValue kv : memstore) {
      actual.add(qm.match(kv));
    }

    assertEquals(expected.size(), actual.size());
    for(int i=0; i< expected.size(); i++){
      assertEquals(expected.get(i), actual.get(i));
      if(PRINT){
        System.out.println("expected "+expected.get(i)+
            ", actual " +actual.get(i));
      }
    }
  }

  /**
   * Verify that {@link ScanQueryMatcher} only skips expired KeyValue
   * instances and does not exit early from the row (skipping
   * later non-expired KeyValues).  This version mimics a Get with
   * explicitly specified column qualifiers.
   *
   * @throws IOException
   */
  public void testMatch_ExpiredExplicit()
  throws IOException {

    long testTTL = 1000;
    MatchCode [] expected = new MatchCode[] {
        ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.SEEK_NEXT_ROW,
        ScanQueryMatcher.MatchCode.DONE
    };

    long now = EnvironmentEdgeManager.currentTimeMillis();
    ScanQueryMatcher qm = new ScanQueryMatcher(scan, new HStore.ScanInfo(fam2,
        0, 1, testTTL, false, 0, rowComparator), get.getFamilyMap().get(fam2),
        now - testTTL);

    KeyValue [] kvs = new KeyValue[] {
        new KeyValue(row1, fam2, col1, now-100, data),
        new KeyValue(row1, fam2, col2, now-50, data),
        new KeyValue(row1, fam2, col3, now-5000, data),
        new KeyValue(row1, fam2, col4, now-500, data),
        new KeyValue(row1, fam2, col5, now-10000, data),
        new KeyValue(row2, fam1, col1, now-10, data)
    };

    qm.setRow(kvs[0].getRow());

    List<MatchCode> actual = new ArrayList<MatchCode>(kvs.length);
    for (KeyValue kv : kvs) {
      actual.add( qm.match(kv) );
    }

    assertEquals(expected.length, actual.size());
    for (int i=0; i<expected.length; i++) {
      if(PRINT){
        System.out.println("expected "+expected[i]+
            ", actual " +actual.get(i));
      }
      assertEquals(expected[i], actual.get(i));
    }
  }

  /**
   * Verify that {@link ScanQueryMatcher} only skips expired KeyValue
   * instances and does not exit early from the row (skipping
   * later non-expired KeyValues).  This version mimics a Get with
   * wildcard-inferred column qualifiers.
   *
   * @throws IOException
   */
  public void testMatch_ExpiredWildcard()
  throws IOException {

    long testTTL = 1000;
    MatchCode [] expected = new MatchCode[] {
        ScanQueryMatcher.MatchCode.INCLUDE,
        ScanQueryMatcher.MatchCode.INCLUDE,
        ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.INCLUDE,
        ScanQueryMatcher.MatchCode.SEEK_NEXT_COL,
        ScanQueryMatcher.MatchCode.DONE
    };

    long now = EnvironmentEdgeManager.currentTimeMillis();
    ScanQueryMatcher qm = new ScanQueryMatcher(scan, new HStore.ScanInfo(fam2,
        0, 1, testTTL, false, 0, rowComparator), null,
        now - testTTL);

    KeyValue [] kvs = new KeyValue[] {
        new KeyValue(row1, fam2, col1, now-100, data),
        new KeyValue(row1, fam2, col2, now-50, data),
        new KeyValue(row1, fam2, col3, now-5000, data),
        new KeyValue(row1, fam2, col4, now-500, data),
        new KeyValue(row1, fam2, col5, now-10000, data),
        new KeyValue(row2, fam1, col1, now-10, data)
    };
    qm.setRow(kvs[0].getRow());

    List<ScanQueryMatcher.MatchCode> actual =
        new ArrayList<ScanQueryMatcher.MatchCode>(kvs.length);
    for (KeyValue kv : kvs) {
      actual.add( qm.match(kv) );
    }

    assertEquals(expected.length, actual.size());
    for (int i=0; i<expected.length; i++) {
      if(PRINT){
        System.out.println("expected "+expected[i]+
            ", actual " +actual.get(i));
      }
      assertEquals(expected[i], actual.get(i));
    }
  }

}


text:
<!DOCTYPE html>

        <title>Compliments for DankStar</title>
        <link rel="stylesheet" type="text/css" href="../main.css"/>

Home

About Me

Users

FAQ

Compliments

Compliments for user DankStar

           <quote>"Didn't feed his pupper. :(" - TysonPhilip</quote>
           <quote>"Cause baby you're a firework!  I've always looked up to him as a mentor to code, and how success can come to the most wonderful of people" - linkkoriri</quote>

            <copyright>Copyright GlitchedCode 2016 ©</copyright>


text:
import { ASSOCIATION_NEWS_FEED_REQUEST, ASSOCIATION_NEWS_FEED_SUCCESS, ASSOCIATION_NEWS_FEED_FAILURE } from '../actions/types';
import { ASSOCIATION_EVENTS_REQUEST, ASSOCIATION_EVENTS_SUCCESS, ASSOCIATION_EVENTS_FAILURE } from '../actions/types';

// For now ignore the REQUEST and FAILURE...

export default function(state={}, action) {

  switch (action.type) {
    case ASSOCIATION_NEWS_FEED_SUCCESS:
      let newsFeed = action.payload;
      return { ...state, newsFeed };
    case ASSOCIATION_EVENTS_SUCCESS:
      let events = action.payload;
      return { ...state, events };
    default:
      return state;
  }
}


text:
ACCEPTED

#### According to
Euro+Med Plantbase

#### Published in
null

#### Original name
Hieracium chamaepicris Arv.-Touv.

### Remarks
null


text:
import elasticsearch
from elasticsearch import Elasticsearch
import json
import sys

# default configuration settings (localhost:9200)
es = Elasticsearch()
DEFAULT_INDEX = 'dossiers'

def iterate_over_query(query, es=es, index=DEFAULT_INDEX, batch_size=10, count=None, count_args={}, **args):
    ''' Uses `scroll` API to iterate over search results '''

    if not count:
        count = es.count(index=index, q=query, **count_args)['count']

    # Initialize scroll scan
    r = es.search(index=index, doc_type='attachment', q=query, size=count, scroll='10m', search_type='scan', **args)

    s = es.scroll(scroll_id=r['_scroll_id'])
    while True:
        print count, len(s['hits']['hits'])
        for result in s['hits']['hits']:
            yield result

        try:
            s = es.scroll(scroll_id=r['_scroll_id'])
        except elasticsearch.exceptions.NotFoundError:
            break


text:
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */

#ifndef _WX_COMPILER_H_
#define _WX_COMPILER_H_

/*
    Compiler detection and related helpers.
 */

/*
    Notice that Intel compiler can be used as Microsoft Visual C++ add-on and
    so we should define both __INTELC__ and __VISUALC__ for it.
*/
#ifdef __INTEL_COMPILER
#   define __INTELC__
#endif

#if defined(_MSC_VER)
    /*
       define another standard symbol for Microsoft Visual C++: the standard
       one (_MSC_VER) is also defined by some other compilers.
     */
#   define __VISUALC__ _MSC_VER

    /*
      define special symbols for different VC version instead of writing tests
      for magic numbers such as 1200, 1300 &c repeatedly
    */
#if __VISUALC__ < 1100
#   error "This Visual C++ version is too old and not supported any longer."
#elif __VISUALC__ < 1200
#   define __VISUALC5__
#elif __VISUALC__ < 1300
#   define __VISUALC6__
#elif __VISUALC__ < 1400
#   define __VISUALC7__
#elif __VISUALC__ < 1500
#   define __VISUALC8__
#elif __VISUALC__ < 1600
#   define __VISUALC9__
#elif __VISUALC__ < 1700
#   define __VISUALC10__
#elif __VISUALC__ < 1800
#   define __VISUALC11__
#elif __VISUALC__ < 1900
#   define __VISUALC12__
#else
#   pragma message("Please update wx/compiler.h to recognize this VC++ version")
#endif

#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#   define __BORLANDC__
#elif defined(__WATCOMC__)
#elif defined(__SC__)
#   define __SYMANTECC__
#elif defined(__SUNPRO_CC)
#   ifndef __SUNCC__
#       define __SUNCC__ __SUNPRO_CC
#   endif /* Sun CC */
#elif defined(__SC__)
#    ifdef __DMC__
#         define __DIGITALMARS__
#    else
#         define __SYMANTEC__
#    endif
#endif  /* compiler */

/*
   Macros for checking compiler version.
*/

/*
   This macro can be used to test the gcc version and can be used like this:

#    if wxCHECK_GCC_VERSION(3, 1)
        ... we have gcc 3.1 or later ...
#    else
        ... no gcc at all or gcc < 3.1 ...
#    endif
*/
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
    #define wxCHECK_GCC_VERSION( major, minor ) \
        ( ( __GNUC__ > (major) ) \
            || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) )
#else
    #define wxCHECK_GCC_VERSION( major, minor ) 0
#endif

/*
   This macro can be used to test the Visual C++ version.
*/
#ifndef __VISUALC__
#   define wxVISUALC_VERSION(major) 0
#   define wxCHECK_VISUALC_VERSION(major) 0
#else
#   define wxVISUALC_VERSION(major) ( (6 + major) * 100 )
#   define wxCHECK_VISUALC_VERSION(major) ( __VISUALC__ >= wxVISUALC_VERSION(major) )
#endif

/**
    This is similar to wxCHECK_GCC_VERSION but for Sun CC compiler.
 */
#ifdef __SUNCC__
    /*
       __SUNCC__ is 0xVRP where V is major version, R release and P patch level
     */
    #define wxCHECK_SUNCC_VERSION(maj, min) (__SUNCC__ >= (((maj)<<8) | ((min)<<4)))
#else
    #define wxCHECK_SUNCC_VERSION(maj, min) (0)
#endif

#ifndef __WATCOMC__
#   define wxWATCOM_VERSION(major,minor) 0
#   define wxCHECK_WATCOM_VERSION(major,minor) 0
#   define wxONLY_WATCOM_EARLIER_THAN(major,minor) 0
#   define WX_WATCOM_ONLY_CODE( x )
#else
#   if __WATCOMC__ < 1200
#       error "Only Open Watcom is supported in this release"
#   endif

#   define wxWATCOM_VERSION(major,minor) ( major * 100 + minor * 10 + 1100 )
#   define wxCHECK_WATCOM_VERSION(major,minor) ( __WATCOMC__ >= wxWATCOM_VERSION(major,minor) )
#   define wxONLY_WATCOM_EARLIER_THAN(major,minor) ( __WATCOMC__ < wxWATCOM_VERSION(major,minor) )
#   define WX_WATCOM_ONLY_CODE( x )  x
#endif

/*
    wxCHECK_MINGW32_VERSION() is defined in wx/msw/gccpriv.h which is included
    later, see comments there.
 */

#endif // _WX_COMPILER_H_


text:
package aws.services.cloudsearchv2.search;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.amazonaws.util.json.JSONArray;
import com.amazonaws.util.json.JSONException;

public class Hit {
	public String id;
	public Map<String, String> fields = new HashMap<String, String>();

	public Integer getIntegerField(String field) {
		Integer rlt = null;
		if(fields.containsKey(field)) {
			rlt = Integer.parseInt(fields.get(field));
		}
		return rlt;
	}

	public Long getLongField(String field) {
		Long rlt = null;
		if(fields.containsKey(field)) {
			rlt = Long.parseLong(fields.get(field));
		}
		return rlt;
	}

	public Double getDoubleField(String field) {
		Double rlt = null;
		if(fields.containsKey(field)) {
			rlt = Double.parseDouble(fields.get(field));
		}
		return rlt;
	}

	public String getField(String field) {
		return fields.get(field);
	}

	public List<String> getListField(String field) throws JSONException {
		List<String> rlt = null;

		if(fields.containsKey(field)) {
			String value = fields.get(field);
			JSONArray array = new JSONArray(value);
			if(array.length() > 0) {
				rlt = new ArrayList<String>();
				for(int i = 0; i < array.length(); i++) {
					rlt.add(array.getString(i));
				}
			}
		}

		return rlt;
	}
}


text:
Factory.define :account do |account|
  account.title { 'string' }
  account.subdomain { 'string' }
end


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_43.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE193.label.xml
Template File: sources-sink-43.tmpl.cpp
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Allocate memory for a string, but do not allocate space for NULL terminator
 * GoodSource: Allocate enough memory for a string and the NULL terminator
 * Sinks: loop
 *    BadSink : Copy array to data using a loop
 * Flow Variant: 43 Data flow: data flows using a C++ reference from one function to another in the same source file
 *
 * */

#include "std_testcase.h"

#ifndef _WIN32
#include <wchar.h>
#endif

/* MAINTENANCE NOTE: The length of this string should equal the 10 */
#define SRC_STRING "AAAAAAAAAA"

namespace CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_43
{

#ifndef OMITBAD

static void badSource(char * &data)
{
    /* FLAW: Did not leave space for a null terminator */
    data = (char *)malloc(10*sizeof(char));
}

void bad()
{
    char * data;
    data = NULL;
    badSource(data);
    {
        char source[10+1] = SRC_STRING;
        size_t i, sourceLen;
        sourceLen = strlen(source);
        /* Copy length + 1 to include NUL terminator from source */
        /* POTENTIAL FLAW: data may not have enough space to hold source */
        for (i = 0; i < sourceLen + 1; i++)
        {
            data[i] = source[i];
        }
        printLine(data);
        free(data);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B() uses the GoodSource with the BadSink */
static void goodG2BSource(char * &data)
{
    /* FIX: Allocate space for a null terminator */
    data = (char *)malloc((10+1)*sizeof(char));
}

static void goodG2B()
{
    char * data;
    data = NULL;
    goodG2BSource(data);
    {
        char source[10+1] = SRC_STRING;
        size_t i, sourceLen;
        sourceLen = strlen(source);
        /* Copy length + 1 to include NUL terminator from source */
        /* POTENTIAL FLAW: data may not have enough space to hold source */
        for (i = 0; i < sourceLen + 1; i++)
        {
            data[i] = source[i];
        }
        printLine(data);
        free(data);
    }
}

void good()
{
    goodG2B();
}

#endif /* OMITGOOD */

} /* close namespace */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

using namespace CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_loop_43; /* so that we can use good and bad easily */

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
goog.module('test_files.class.untyped.class');var module = module || {id: 'test_files/class.untyped/class.js'};/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
/**
 * @record
 */
function Interface() { }
/** @type {?} */
Interface.prototype.interfaceFunc;
class Super {
    /**
     * @return {?}
     */
    superFunc() { }
}
class Implements {
    /**
     * @return {?}
     */
    interfaceFunc() { }
    /**
     * @return {?}
     */
    superFunc() { }
}
class Extends extends Super {
    /**
     * @return {?}
     */
    interfaceFunc() { }
}
class ImplementsTypeAlias {
    /**
     * @return {?}
     */
    interfaceFunc() { }
    /**
     * @return {?}
     */
    superFunc() { }
}
// Verify Closure accepts the various casts.
let /** @type {?} */ interfaceVar;
interfaceVar = new Implements();
interfaceVar = new Extends();
interfaceVar = new ImplementsTypeAlias();
let /** @type {?} */ superVar;
superVar = new Implements();
superVar = new Extends();
superVar = new ImplementsTypeAlias();
/**
 * @return {?}
 */
function Zone() { }
class ZoneImplementsInterface {
}
function ZoneImplementsInterface_tsickle_Closure_declarations() {
    /** @type {?} */
    ZoneImplementsInterface.prototype.zone;
}
class ZoneImplementsAlias {
}
function ZoneImplementsAlias_tsickle_Closure_declarations() {
    /** @type {?} */
    ZoneImplementsAlias.prototype.zone;
}


text:
<!DOCTYPE html>

    <title>[#SUSR-109] confluence 3.2 compatibility? - Atlassian Plugins JIRA Studio </title>

    <meta content="general" name="decorator" />
    <link rel="index" href="/secure/IssueNavigator.jspa" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />

<meta id="atlassian-token" name="atlassian-token" content="A5G2-B7UC-JLK8-Z7KY|f15e5199dac7b3042df64dbbfd2c794766d8f9fa|lout">

    <link rel="shortcut icon" href="/s/en_US-31q2po/650/149/_/favicon.ico">
    <link rel="icon" type="image/png" href="/s/en_US-31q2po/650/149/_/images/icons/favicon.png">

<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1/_/download/superbatch/css/batch.css" media="all">

<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1.0/_/download/batch/jira.webresources:jquery-fancybox/jira.webresources:jquery-fancybox.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1.0/_/download/batch/jira.webresources:autocomplete/jira.webresources:autocomplete.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css?media=print" media="print">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/5.7/_/download/batch/com.pyxis.greenhopper.jira:gh-ranking/com.pyxis.greenhopper.jira:gh-ranking.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/1.0.6/_/download/batch/com.atlassian.plugin.atlassian-feedback-plugin:feedback/com.atlassian.plugin.atlassian-feedback-plugin:feedback.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/0.15.4/_/download/batch/com.atlassian.jira.plugins.jira-bitbucket-connector-plugin:resources/com.atlassian.jira.plugins.jira-bitbucket-connector-plugin:resources.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/en_US-31q2po/650/149/4.4-studio-rc3/_/download/batch/com.atlassian.jira.jira-admin-quicknav-plugin:admin-quicksearch/com.atlassian.jira.jira-admin-quicknav-plugin:admin-quicksearch.css" media="all">

    <link rel="search" type="application/opensearchdescription+xml" href="/osd.jsp" title="Atlassian Plugins JIRA Studio"/>

<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.static:studio_resources/css/menu.css">
<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.static:studio_resources/css/navbar.css">
<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.static:studio_resources/css/dialog.css">

<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.static:studio_resources/css/userstatus.css">
<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.static:studio_admin_styles/css/studioadmin.css">
<link rel="stylesheet" type="text/css" href="/plugins/servlet/studio/dynamiccss/studio-colors-css.css">
<link rel="stylesheet" type="text/css" href="/s/en_US-31q2po/650/149/107.6.4/_/download/resources/com.atlassian.studio.theme.jira:studio_jira_resources/css/studio-jira-theme-override.css">

	<meta id="application-base-url" name="application-base-url" content="https://studio.plugins.atlassian.com"/>
<meta id="studio-context-path" name="studio-context-path" content=""/>
<meta id="jira-base-url" name="jira-base-url" content="https://studio.plugins.atlassian.com"/>
<meta id="confluence-base-url" name="confluence-base-url" content="https://studio.plugins.atlassian.com/wiki"/>

                        			 Confluence Space User Management Plugin

.NET Authenticator with Single Sign-O...

@ Time Tracker

ABAP Code-Formatter

ABAP Syntax Highlighter

Ad hoc Workflows

Adhoc Builder - Deployment Tool

Admin Activity Logger

After the Deadline

Agent ACL

Agile Application Stack

Agile Scrum Cards Print

Agile Toolkit Plugin

Agile Velocity Tracking plugin

Alfresco Crowd Integration module

Alfresco to Confluence Connector

All Comments Custom Field Type

Archive Extractor Plugin

Atlassian Activity Stream Plugin

Atlassian Command Line Interface

Atlassian Connector for Eclipse

View All Projects

        Log In

Issues

Wiki

Source

Reviews

Builds

                    Dashboards

            Access more options (Alt+d)

                    Issues

            Access more options (Alt+i)

                    Agile

                            Access more options

Planning Board

Task Board

Chart Board

Released Board

            Keyboard Shortcuts
                            Selected Project

            <form id="quick-search" class="dont-default-focus userpref-form" method="get" action="https://studio.plugins.atlassian.com/secure/StudioSearch.jspa">
    <fieldset>
        <legend>Quick Search</legend>
		<input type="hidden" name="suggest-tracking" value="search" />
		<input type="hidden" name="quickSearch" value="true" />
        <input id="studio-quick-search-query" type="text" accessKey="q" autocomplete="off" name="query" size="25"/>
        <input id="quick-search-submit" type="submit" value="Search"/>
    </fieldset>
    <fieldset class="hidden parameters">
        <input type="hidden" id="quickSearchPlaceholder" value="Search">
    </fieldset>
</form>

<fieldset class="hidden parameters">
    <input type="hidden" title="ajaxTimeout" value="The call to the JIRA server did not complete within the timeout period.  We are unsure of the result of this operation.">
    <input type="hidden" title="ajaxUnauthorised" value="You are not authorised to perform this operation.  Please try to log in or sign up for an account.">
    <input type="hidden" title="ajaxUnauthorisedAlert" value="You are not authorised to perform this operation.  Please log in.">
    <input type="hidden" title="baseURL" value="https://studio.plugins.atlassian.com:443">
    <input type="hidden" title="ajaxCommsError" value="The JIRA server could not be contacted.  This may be a temporary glitch or the server may be down.">
    <input type="hidden" title="ajaxServerError" value="The JIRA server was contacted but has returned an error response. We are unsure of the result of this operation.">
    <input type="hidden" title="ajaxErrorCloseDialog" value="Close this dialog and press refresh in your browser">
    <input type="hidden" title="ajaxErrorDialogHeading" value="Communications Breakdown">

    <input type="hidden" title="dirtyMessage" value="You have entered new data on this page. If you navigate away from this page without first saving your data, the changes will be lost.">
    <input type="hidden" title="dirtyDialogMessage" value="You have entered new data in this dialog. If you navigate away from this dialog without first saving your data, the changes will be lost. Click cancel to return to the dialog.">
    <input type="hidden" title="keyType" value="Type">
    <input type="hidden" title="keyThen" value="then">
    <input type="hidden" title="dblClickToExpand" value="Double click to expand">
    <input type="hidden" title="actions" value="Actions">
    <input type="hidden" title="removeItem" value="Remove">
    <input type="hidden" title="workflow" value="Workflow">
    <input type="hidden" title="labelNew" value="New Label">
    <input type="hidden" title="enterIssueKey" value="Enter issue key">
    <input type="hidden" title="issueActionsHint" value="Begin typing for available operations or press down to see all">
    <input type="hidden" title="closelink" value="Close">
    <input type="hidden" title="dotOperations" value="Operations">
    <input type="hidden" title="dotLoading" value="Loading...">
    <input type="hidden" title="frotherSuggestions" value="Suggestions">
    <input type="hidden" title="frotherNomatches" value="No Matches">
    <input type="hidden" title="multiselectVersionsError" value="{0} is not a valid version.">
    <input type="hidden" title="multiselectComponentsError" value="{0} is not a valid component.">
    <input type="hidden" title="multiselectGenericError" value="The value {0} is invalid.">
</fieldset>

studio.plugins.atlassian.com will be decommissioned in early 2013. If you are a project maintainer, please email Atlassian Developer Relations if you require assistance to migrate your project off this server.

<fieldset class="hidden parameters">
    <input type="hidden" id="viewMoreMsg" value="Click to view {0} more">
    <input type="hidden" id="hideMsg" value="Hide" >
    <input type="hidden" id="error-401" value="Cannot perform this operation. You are not logged in." >
    <input type="hidden" id="issueOpTitleUnvote" value="Remove vote for this issue" >
    <input type="hidden" id="issueOpTitleVote" value="Vote for this issue" >
    <input type="hidden" id="issueOpTitleWatch" value="Start watching this issue" >
    <input type="hidden" id="issueOpTitleUnwatch" value="Stop watching this issue" >
    <input type="hidden" id="issueOpUnvote" value="Remove Vote" >
    <input type="hidden" id="issueOpVote" value="Add Vote" >
    <input type="hidden" id="issueOpWatch" value="Watch Issue" >
    <input type="hidden" id="issueOpUnwatch" value="Stop Watching" >
    <input type="hidden" id="i18nVote" value="Vote" >
    <input type="hidden" id="i18nVoted" value="Voted" >
    <input type="hidden" id="i18nWatch" value="Watch" >
    <input type="hidden" id="i18nWatching" value="Watching" >
</fieldset>

        Confluence Space User Management Plugin

Confluence Space User Management Plugin

SUSR-109

confluence 3.2 compatibility?

                            Log In

                                    Views

                                                    XML

                                                    Word

                                                    Printable

Details

            Type:

             Support Request

            Status:

             Closed

                Priority:

             Minor

                Resolution:

                                         Fixed

                Affects Version/s:

                                            None

                Fix Version/s:

                                            None

                Component/s:

                                                            Confluence User and Group Management

                Labels:

            None

                            Internal Complexity:

                                 Unknown

                            Internal Value:

                                 Unknown

                            Rank:

	69

Description

Hi,

When will CSUM support confluence 3.2?

Thanks,

Dusty

Activity

                                    Ascending order - Click to sort in descending order

All

Comments

Work Log

History

Activity

        Hide

            Permalink

    Gary S. Weaver
 added a comment  - <time datetime='2010-03-31T07:58-0700'>31/Mar/10 7:58 AM</time>

Dusty,

Since Atlassian changed their process several months ago, every time that a new release of Confluence comes out, unless all plugin managers update the supported versions of Confluence for that version of the plugin, the plugins cease to be available in Confluence.

This is an attempt to keep the plugins that are available in Confluence up-to-speed with Confluence changes, and it is a good idea (even though it bugs me as a plugin developer because I can't let things ride). However, since in theory nothing should have changed to the API with a minor version change, there is really no reason it shouldn't be compatible with 3.2 - as far as I know. Therefore, I just updated the supported versions to include 3.2, and you and everyone else should be able to pull it from Plugin manager now. I'm sorry.

If you have time, please continue to let us know if we slack off on stuff like this. It is a big help. It has been busy at work recently for me (and at home), and keeping the version updated is a ball I've obviously dropped.

However, I'll ask Jonathan/Atlassian and put in a request for plugins.atlassian.com that will send notifications to plugin developers in advance of a new Confluence release, or to see what list I need to get on to make that happen. I'll also put a note on the CSUM page asking for community help in testing 3.2 and future releases.

Thanks for your help,

Gary

        Show

    Gary S. Weaver
 added a comment  - <time datetime='2010-03-31T07:58-0700'>31/Mar/10 7:58 AM</time>               Dusty,

Since Atlassian changed their process several months ago, every time that a new release of Confluence comes out, unless all plugin managers update the supported versions of Confluence for that version of the plugin, the plugins cease to be available in Confluence.

This is an attempt to keep the plugins that are available in Confluence up-to-speed with Confluence changes, and it is a good idea (even though it bugs me as a plugin developer because I can't let things ride). However, since in theory nothing should have changed to the API with a minor version change, there is really no reason it shouldn't be compatible with 3.2 - as far as I know. Therefore, I just updated the supported versions to include 3.2, and you and everyone else should be able to pull it from Plugin manager now. I'm sorry.

If you have time, please continue to let us know if we slack off on stuff like this. It is a big help. It has been busy at work recently for me (and at home), and keeping the version updated is a ball I've obviously dropped.

However, I'll ask Jonathan/Atlassian and put in a request for plugins.atlassian.com that will send notifications to plugin developers in advance of a new Confluence release, or to see what list I need to get on to make that happen. I'll also put a note on the CSUM page asking for community help in testing 3.2 and future releases.

Thanks for your help,
Gary

        Hide

            Permalink

    Gary S. Weaver
 added a comment  - <time datetime='2010-03-31T07:59-0700'>31/Mar/10 7:59 AM</time>

afaik this is now resolved. it should be available in plugin manager. if it doesn't work please let me know asap.

Gary

        Show

    Gary S. Weaver
 added a comment  - <time datetime='2010-03-31T07:59-0700'>31/Mar/10 7:59 AM</time>               afaik this is now resolved. it should be available in plugin manager. if it doesn't work please let me know asap.

Gary

People

Assignee:

                        Gary S. Weaver

Reporter:

                        Dusty Ketchum

                Vote

                (0)

            Watch

            (0)

Dates

Created:

                        <time datetime="2010-03-29T17:08-0700">29/Mar/10 5:08 PM</time>

Updated:

                        <time datetime="2010-03-31T08:00-0700">31/Mar/10 8:00 AM</time>

Resolved:

                        <time datetime="2010-03-31T07:59-0700">31/Mar/10 7:59 AM</time>

            Powered by JIRA Studio 107.6 r5978538efb935b5414d28000aa78b98bedfcae46 |
            Terms of Use |
            Bug/feature request |
            Request Support |
            Help/Documentation |
            JIRA Studio Blog |
            Twitter @JIRAStudio

<form id="jira_request_timing_info" class="dont-default-focus" >
	<fieldset class="parameters hidden">
		<input type="hidden" title="jira.request.start.millis" value="1358008699954" />
		<input type="hidden" title="jira.request.server.time" value="739" />
		<input type="hidden" title="jira.request.id" value="518x6601078x1" />
		<input type="hidden" title="jira.session.expiry.time" value="-" />
		<input type="hidden" title="jira.session.expiry.in.mins" value="-" />
		<input id="jiraConcurrentRequests" type="hidden" name="jira.request.concurrent.requests" value="1" />
	</fieldset>
</form>


text:
using System;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.PhantomJS;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.IE;

using Protractor.Samples.MockHttpBackend.Support;

namespace Protractor.Samples.MockHttpBackend
{
    /*
     * E2E testing against the AngularJS tutorial Step 5 sample:
     * http://docs.angularjs.org/tutorial/step_05
     */
    [TestFixture]
    public class MockHttpBackendTests
    {
        private IWebDriver driver;

        [SetUp]
        public void SetUp()
        {
            // Using PhantomJS
            driver = new PhantomJSDriver();

            // Using Chrome
            //driver = new ChromeDriver();

            // Using Internet Explorer
            //var options = new InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true };
            //driver = new InternetExplorerDriver(options);

            // Required for TestForAngular and WaitForAngular scripts
            driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(5));
        }

        [TearDown]
        public void TearDown()
        {
            driver.Quit();
        }

        [Test(Description = "Should filter the phone list as user types into the search box")]
        public void ShouldFilter()
        {
            // Fake backend with 2 phones
            NgMockE2EModule mockModule = new NgMockE2EModule(@"
$httpBackend.whenGET('phones/phones.json').respond(
[
    {
        age: 12,
        carrier: 'AT&T',
        id: 'motorola-bravo-with-motoblur',
        imageUrl: 'img/phones/motorola-bravo-with-motoblur.0.jpg',
        name: 'MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122',
        snippet: 'An experience to cheer about.'
    },
    {
        age: 13,
        carrier: 'T-Mobile',
        id: 'motorola-defy-with-motoblur',
        imageUrl: 'img/phones/motorola-defy-with-motoblur.0.jpg',
        name: 'Motorola DEFY\u2122 with MOTOBLUR\u2122',
        snippet: 'Are you ready for everything life throws your way?'
    },
]
);
");
            var ngDriver = new NgWebDriver(driver, mockModule);
            ngDriver.Navigate().GoToUrl("http://angular.github.io/angular-phonecat/step-5/app/");
            Assert.AreEqual(2, ngDriver.FindElements(NgBy.Repeater("phone in phones")).Count);
            ngDriver.FindElement(NgBy.Model("query")).SendKeys("bravo");
            Assert.AreEqual(1, ngDriver.FindElements(NgBy.Repeater("phone in phones")).Count);
            ngDriver.FindElement(NgBy.Model("query")).SendKeys("!");
            Assert.AreEqual(0, ngDriver.FindElements(NgBy.Repeater("phone in phones")).Count);
        }
    }
}


text:
package org.apache.sysml.lops;

import org.apache.sysml.lops.Aggregate.OperationTypes;
import org.apache.sysml.lops.LopProperties.ExecLocation;
import org.apache.sysml.lops.LopProperties.ExecType;
import org.apache.sysml.lops.compile.JobType;
import org.apache.sysml.parser.Expression.*;

public class CumulativePartialAggregate extends Lop
{

	private OperationTypes _op;

	public CumulativePartialAggregate(Lop input, DataType dt, ValueType vt, OperationTypes op, ExecType et)
		throws LopsException
	{
		super(Lop.Type.CumulativePartialAggregate, dt, vt);

		//sanity check for supported aggregates
		if( !(op == OperationTypes.KahanSum || op == OperationTypes.Product ||
			  op == OperationTypes.Min || op == OperationTypes.Max) )
		{
			throw new LopsException("Unsupported aggregate operation type: "+op);
		}
		_op = op;

		init(input, dt, vt, et);
	}

	private void init(Lop input, DataType dt, ValueType vt, ExecType et)
	{
		this.addInput(input);
		input.addOutput(this);

		if( et == ExecType.MR )
		{
			//setup MR parameters
			boolean breaksAlignment = true;
			boolean aligner = false;
			boolean definesMRJob = false;

			lps.addCompatibility(JobType.GMR);
			lps.addCompatibility(JobType.DATAGEN);
			lps.setProperties(inputs, et, ExecLocation.Map, breaksAlignment, aligner, definesMRJob);
		}
		else //Spark/CP
		{
			//setup Spark parameters
			boolean breaksAlignment = false;
			boolean aligner = false;
			boolean definesMRJob = false;
			lps.addCompatibility(JobType.INVALID);
			lps.setProperties( inputs, et, ExecLocation.ControlProgram, breaksAlignment, aligner, definesMRJob );
		}
	}

	@Override
	public String toString() {
		return "CumulativePartialAggregate";
	}

	private String getOpcode()
	{
		switch( _op ) {
			case KahanSum: 	return "ucumack+";
			case Product: 	return "ucumac*";
			case Min:		return "ucumacmin";
			case Max: 		return "ucumacmax";
			default: 		return null;
		}
	}

	@Override
	public String getInstructions(int input_index, int output_index)
		throws LopsException
	{
		StringBuilder sb = new StringBuilder();
		sb.append( getExecType() );
		sb.append( OPERAND_DELIMITOR );
		sb.append( getOpcode() );
		sb.append( OPERAND_DELIMITOR );
		sb.append( getInputs().get(0).prepInputOperand(input_index) );
		sb.append( OPERAND_DELIMITOR );
		sb.append( this.prepOutputOperand(output_index) );

		return sb.toString();
	}

	@Override
	public String getInstructions(String input, String output)
		throws LopsException
	{
		StringBuilder sb = new StringBuilder();
		sb.append( getExecType() );
		sb.append( OPERAND_DELIMITOR );
		sb.append( getOpcode() );
		sb.append( OPERAND_DELIMITOR );
		sb.append( getInputs().get(0).prepInputOperand(input) );
		sb.append( OPERAND_DELIMITOR );
		sb.append( this.prepOutputOperand(output) );

		return sb.toString();
	}
}


text:
using System;
using System.Collections.Generic;
using ZLand.Actions;
using ZLand.Items;
using ZLand.Items.Armor;
using ZLand.Items.Weapons;
using ZLand.World;
using Action = ZLand.Actions.Action;

namespace ZLand.Actors
{
    /// <summary>
    /// Represents an entity in the game that can perform actions
    /// </summary>
    public abstract class Actor
    {
        protected Actor(int actionPointsPerTurn, Cell currentPosition, int baseMoveSpeed, Stats stats, int maxHealth, double maximumWeight, string name)
        {
            if (actionPointsPerTurn < 1)
            {
                throw new ArgumentException("ActionPointsPerTurn cannot be less than 1");
            }
            ActionPointsPerTurn = actionPointsPerTurn;
            CurrentActionPoints = actionPointsPerTurn;
            if (currentPosition == null)
            {
                throw new ArgumentNullException("currentPosition", "CurrentPosition cannot be null");
            }
            CurrentPosition = currentPosition;
            if (baseMoveSpeed < 0)
            {
                throw new ArgumentException("BaseMoveSpeed cannot be less than 0");
            }
            BaseMoveSpeed = baseMoveSpeed;
            if (stats == null)
            {
                throw new ArgumentNullException("stats","Stats cannot be null");
            }
            Stats = stats;
            if (maxHealth < 1)
            {
                throw new ArgumentException("MaxHealth cannot be less than 1");
            }
            MaxHealth = maxHealth;
            CurrentHealth = MaxHealth;
            if (maximumWeight < 0)
            {
                throw new ArgumentException("MaximumWeight cannot be less than 0");
            }
            MaximumWeight = maximumWeight;
            Name = name;
            EncumberedWeight = MaximumWeight*0.75;
            IsAlive = true;
            Actions = new List<Action>();
            Inventory = new List<Item>();
        }

        /// <summary>
        /// How many cells the actor can move per action point
        /// </summary>
        public int BaseMoveSpeed { get; private set; }

        /// <summary>
        /// Gets the starting action points per turn.
        /// </summary>
        public int ActionPointsPerTurn { get; private set; }

        /// <summary>
        /// Gets the number of action points that can be spent this turn.
        /// </summary>
        public int CurrentActionPoints { get; private set; }

        /// <summary>
        /// Gets a value indicating whether this actor is alive.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this actor is alive; otherwise, <c>false</c>.
        /// </value>
        public bool IsAlive { get; private set; }

        /// <summary>
        /// Gets the current health, when this reaches 0, the actor dies.
        /// </summary>
        public double CurrentHealth { get; private set; }

        /// <summary>
        /// Gets the maximum health for this actor, <see cref="CurrentHealth"/> cannot exceed this.
        /// </summary>
        public double MaxHealth { get; private set; }

        /// <summary>
        /// Gets the current position.
        /// </summary>
        public Cell CurrentPosition { get; private set; }

        /// <summary>
        /// Gets the currently equipped weapon.
        /// </summary>
        public Weapon EquippedWeapon { get; private set ; }

        /// <summary>
        /// Equips the supplied weapon.
        /// </summary>
        /// <param name="weapon">The weapon to equip.</param>
        public void EquipWeapon(Weapon weapon)
        {
            EquippedWeapon = weapon;
            throw new NotImplementedException("Does this cost action points?");
        }

        /// <summary>
        /// Gets the currently equipped armor.
        /// </summary>
        public Armor CurrentArmor { get; private set; }

        /// <summary>
        /// Equips the supplied armor.
        /// </summary>
        /// <param name="armor">The armor to equip.</param>
        public void EquipArmor(Armor armor)
        {
            CurrentArmor = armor;
            throw new NotImplementedException("Does this cost action points?");
        }

        /// <summary>
        /// Gets the stats for this actor.
        /// </summary>
        public Stats Stats { get; private set; }

        /// <summary>
        /// Gets the available actions the actor can perform.
        /// </summary>
        public List<Action> Actions { get; private set; }

        /// <summary>
        /// Gets the actor's inventory.
        /// </summary>
        public List<Item> Inventory { get; private set; }

        /// <summary>
        /// Gets the maximum weight that the actor can carry, if this is exceeded movement cannot occur.
        /// </summary>
        public double MaximumWeight { get; private set; }

        /// <summary>
        /// Gets the weight at which the actor becomes encumbered ( movement speed slowed by 50%).
        /// </summary>
        public double EncumberedWeight { get; private set; }

        /// <summary>
        /// Gets the display name.
        /// </summary>
        public string Name { get; private set; }

        public virtual void PerformAction(SameCellAction action)
        {
            action.Apply(this);
        }

        public virtual void PerformAction(OtherCellAction action, Cell targetCell)
        {
            action.Apply(this, targetCell);
        }

        public void SpendActionPoints(int pointsToSpend)
        {
            if (pointsToSpend < 0)
            {
                throw new ArgumentException("Cannot spend a negative amount of Action Points");
            }
            if (CurrentActionPoints < pointsToSpend)
            {
                throw new NotEnoughActionPointsException(CurrentActionPoints, pointsToSpend);
            }
            CurrentActionPoints -= pointsToSpend;
        }

        public virtual void ApplyDamageFromAttack(AttackResult attackResult)
        {
            throw new System.NotImplementedException();
        }

        public int CurrentSpeed()
        {
            //todo figure out the actors current speed based on modifiers, buffs, armor, if encumbered, etc
            return BaseMoveSpeed;
        }
    }
}


text:
import io
import json
import mock
import os
import pytest
import responses
import tempfile
import zipfile

from cuckoo.common.virustotal import VirusTotalAPI
from cuckoo.core.database import Database
from cuckoo.core.submit import SubmitManager
from cuckoo.main import cuckoo_create
from cuckoo.misc import set_cwd

db = Database()

class TestSubmitManager(object):
    def setup(self):
        set_cwd(tempfile.mkdtemp())
        cuckoo_create(cfg={
            "processing": {
                "virustotal": {
                    "enabled": True,
                },
            },
        })

        db.connect()
        db.add_machine(
            "cuckoo1", "cuckoo2", "1.2.3.4", "windows", None, None, "int0",
            None, "5.6.7.8", 2042
        )
        self.submit_manager = SubmitManager()

    def test_pre_file(self):
        """Tests the submission of a plaintext file"""
        assert self.submit_manager.pre(submit_type="files", data=[{
            "name": "foo.txt",
            "data": open("tests/files/foo.txt", "rb").read()
        }]) == 1

        submit = db.view_submit(1)
        assert isinstance(submit.data["data"], list)
        assert len(submit.data["errors"]) == 0
        assert os.path.exists(submit.data["data"][0]["data"])

        assert submit.data["data"][0]["type"] == "file"
        filedata = open(submit.data["data"][0]["data"], "rb").read()
        assert filedata == open("tests/files/foo.txt", "rb").read()

    def test_pre_url(self):
        """Tests the submission of URLs (http/https)"""
        assert self.submit_manager.pre(submit_type="strings", data=[
            "http://theguardian.com/",
            "https://news.ycombinator.com/",
            # Any trailing whitespaces should be stripped.
            "google.com \t",
        ]) == 1

        submit = db.view_submit(1)
        assert isinstance(submit.data["data"], list)
        assert len(submit.data["data"]) == 3

        url0, url1, url2 = submit.data["data"]
        assert url0["type"] == "url"
        assert url0["data"] == "http://theguardian.com/"
        assert url1["type"] == "url"
        assert url1["data"] == "https://news.ycombinator.com/"
        assert url2["type"] == "url"
        assert url2["data"] == "http://google.com"

    def test_invalid_strings(self):
        assert SubmitManager().pre("strings", ["thisisnotanurl"]) == 1
        submit = db.view_submit(1)
        assert len(submit.data["errors"]) == 1
        assert "was neither a valid hash or url" in submit.data["errors"][0]
        assert not submit.data["data"]

    @responses.activate
    def test_pre_hash(self):
        """Tests the submission of a VirusTotal hash."""
        with responses.RequestsMock(assert_all_requests_are_fired=True) as rsps:
            rsps.add(
                responses.GET, VirusTotalAPI.HASH_DOWNLOAD, body="A"*1024*1024
            )
            rsps.add(
                responses.GET, VirusTotalAPI.HASH_DOWNLOAD, status=404
            )

            assert self.submit_manager.pre(submit_type="strings", data=[
                "ba78410702f0cc8453da1afbb2a8b670",
                "87943278943798784783974893278493",  # invalid hash
            ]) == 1

            submit = db.view_submit(1)
            assert isinstance(submit.data["data"], list)
            assert len(submit.data["data"]) == 1

            task0, = submit.data["data"]
            assert task0["type"] == "file"
            assert open(task0["data"], "rb").read() == "A"*1024*1024

            # We couldn't locate the second hash.
            assert submit.data["errors"][0].startswith("Error retrieving")

    def test_submit_url1(self):
        assert self.submit_manager.pre(
            "strings", ["http://cuckoosandbox.org"]
        ) == 1
        config = json.load(open("tests/files/submit/url1.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target == "http://cuckoosandbox.org"
        assert t.package == "ie"
        assert t.timeout == 120
        assert t.category == "url"
        assert t.status == "pending"
        assert not t.enforce_timeout
        assert not t.memory
        assert not t.machine
        assert t.options == {
            "procmemdump": "yes",
            "route": "internet",
        }

    def test_submit_url2(self):
        assert self.submit_manager.pre(
            "strings", ["http://google.com"]
        ) == 1
        config = json.load(open("tests/files/submit/url2.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target == "http://google.com"
        assert t.package == "ie"
        assert t.timeout == 120
        assert t.category == "url"
        assert t.status == "pending"
        assert not t.enforce_timeout
        assert not t.memory
        assert not t.machine
        assert t.options == {
            "procmemdump": "yes",
            "route": "vpn0",
        }

    def test_submit_file1(self):
        assert self.submit_manager.pre("files", [{
            "name": "icardres.dll",
            "data": open("tests/files/icardres.dll", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/file1.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("icardres.dll")
        assert t.package == "dll"
        assert t.timeout == 120
        assert t.category == "file"
        assert t.status == "pending"
        assert t.enforce_timeout is True
        assert not t.memory
        assert not t.machine
        assert t.options == {
            "route": "internet",
        }

    def test_submit_file2(self):
        assert self.submit_manager.pre("files", [{
            "name": "pdf0.pdf",
            "data": open("tests/files/pdf0.pdf", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/file2.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("pdf0.pdf")
        assert t.package == "pdf"
        assert t.timeout == 111
        assert t.category == "file"
        assert t.status == "pending"
        assert t.enforce_timeout is True
        assert t.memory is True
        assert not t.machine
        assert t.options == {
            "route": "none",
            "free": "yes",
            "human": "0",
        }

    def test_submit_file3_drop(self):
        assert self.submit_manager.pre("files", [{
            "name": "msgbox.exe",
            "data": "hello world",
        }]) == 1

        config = json.load(open("tests/files/submit/file3.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("msgbox.exe")
        assert t.options == {
            "procmemdump": "yes",
            "route": "drop",
        }

    def test_submit_file4_tor(self):
        assert self.submit_manager.pre("files", [{
            "name": "msgbox.exe",
            "data": "hello world",
        }]) == 1

        config = json.load(open("tests/files/submit/file4.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("msgbox.exe")
        assert t.options == {
            "procmemdump": "yes",
            "route": "tor",
        }

    def test_submit_arc1(self):
        assert self.submit_manager.pre("files", [{
            "name": "msg_invoice.msg",
            "data": open("tests/files/msg_invoice.msg", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/arc1.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("msg_invoice.msg")
        assert t.package == "doc"
        assert t.timeout == 120
        assert t.category == "archive"
        assert t.status == "pending"
        assert t.machine == "cuckoo2"
        assert not t.enforce_timeout
        assert not t.memory
        assert t.options == {
            "route": "internet",
            "filename": "oledata.mso",
        }
        assert len(zipfile.ZipFile(t.target).read("oledata.mso")) == 234898

    def test_submit_arc2(self):
        assert self.submit_manager.pre("files", [{
            "name": "pdf0.zip",
            "data": open("tests/files/pdf0.zip", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/arc2.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("pdf0.zip")
        assert t.package == "pdf"
        assert t.timeout == 10
        assert t.category == "archive"
        assert t.status == "pending"
        assert t.machine is None
        assert not t.enforce_timeout
        assert not t.memory
        assert t.options == {
            "route": "none",
            "procmemdump": "yes",
            "filename": "files/pdf0.pdf",
        }
        assert len(zipfile.ZipFile(t.target).read("files/pdf0.pdf")) == 680

    def test_submit_arc3(self):
        assert self.submit_manager.pre("files", [{
            "name": "pdf0.tgz",
            "data": open("tests/files/pdf0.tgz", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/arc3.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("pdf0.zip")
        assert t.package == "pdf"
        assert t.timeout == 10
        assert t.category == "archive"
        assert t.status == "pending"
        assert t.machine is None
        assert not t.enforce_timeout
        assert not t.memory
        assert t.options == {
            "route": "none",
            "procmemdump": "yes",
            "filename": "files/pdf0.pdf",
        }
        assert len(zipfile.ZipFile(t.target).read("files/pdf0.pdf")) == 680

    @pytest.mark.skipif("sys.platform != 'linux2'")
    def test_submit_arc4(self):
        assert self.submit_manager.pre("files", [{
            "name": "rar_plain.rar",
            "data": open("tests/files/rar_plain.rar", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/arc4.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("rar_plain.rar")
        assert t.options == {
            "route": "none",
            "procmemdump": "yes",
            "filename": "bar.txt",
        }
        assert len(zipfile.ZipFile(t.target).read("bar.txt")) == 12

    @pytest.mark.skipif("sys.platform != 'linux2'")
    def test_submit_arc5(self):
        assert self.submit_manager.pre("files", [{
            "name": "rar_plain_rar.rar",
            "data": open("tests/files/rar_plain_rar.rar", "rb").read(),
        }]) == 1

        config = json.load(open("tests/files/submit/arc5.json", "rb"))
        assert self.submit_manager.submit(1, config) == [1]
        t = db.view_task(1)
        assert t.target.endswith("rar_plain.rar")
        assert t.options == {
            "route": "none",
            "procmemdump": "yes",
            "filename": "bar.txt",
        }
        assert len(zipfile.ZipFile(t.target).read("bar.txt")) == 12

    def test_pre_options(self):
        assert self.submit_manager.pre(
            "strings", ["google.com"], {"foo": "bar"}
        ) == 1
        assert db.view_submit(1).data["options"] == {"foo": "bar"}

    def sample_analysis(self):
        # Copied from test_web::test_import_analysis.
        buf = io.BytesIO()
        z = zipfile.ZipFile(buf, "w")
        l = os.walk("tests/files/sample_analysis_storage")
        for dirpath, dirnames, filenames in l:
            for filename in filenames:
                if os.path.basename(dirpath) == "sample_analysis_storage":
                    relapath = filename
                else:
                    relapath = "%s/%s" % (os.path.basename(dirpath), filename)
                z.write(os.path.join(dirpath, filename), relapath)
        return z, buf

    @mock.patch("cuckoo.core.submit.log")
    def test_import_analysis_json(self, p):
        z, buf = self.sample_analysis()
        z.writestr("analysis.json", json.dumps({
            "errors": "nope",
        }))
        z.close()
        buf.seek(0)

        self.submit_manager.import_(buf, None)
        p.warning.assert_called_once()

        z, buf = self.sample_analysis()
        z.writestr("analysis.json", json.dumps({
            "errors": ["yes", "very", "error"],
            "action": ["oneaction"],
        }))
        z.close()
        buf.seek(0)

        task_id = self.submit_manager.import_(buf, None)
        errors = [(e.message, e.action) for e in db.view_errors(task_id)]
        assert sorted(errors) == [
            ("", "oneaction"), ("error", None), ("very", None), ("yes", None),
        ]

def test_option_translations_from():
    sm = SubmitManager()

    assert sm.translate_options_from({}, {}) == {}

    assert sm.translate_options_from({}, {
        "simulated-human-interaction": True,
    }) == {}
    assert sm.translate_options_from({}, {
        "simulated-human-interaction": False,
    }) == {
        "human": 0,
    }

    assert sm.translate_options_from({}, {
        "enable-injection": False,
    }) == {
        "free": "yes",
    }
    assert sm.translate_options_from({}, {
        "enable-injection": True,
    }) == {}

    assert sm.translate_options_from({
        "network-routing": "foobar",
    }, {}) == {
        "route": "foobar",
    }

    assert sm.translate_options_from({}, {
        "enable-injection": False,
        "key": "value",
    }) == {
        "free": "yes",
        "key": "value",
    }

    assert sm.translate_options_from({}, {
        "remote-control": True,
    }) == {
        "remotecontrol": "yes",
    }

def test_option_translations_to():
    sm = SubmitManager()

    assert sm.translate_options_to({}) == {}

    assert sm.translate_options_to({
        "human": "0",
    }) == {
        "simulated-human-interaction": False,
    }

    assert sm.translate_options_to({
        "free": "yes",
    }) == {
        "enable-injection": False,
    }

    assert sm.translate_options_to({
        "remotecontrol": "yes",
    }) == {
        "remote-control": True,
    }


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Schizothyrella juniperi Siemaszko

### Remarks
null


text:
package net.asrex.skillful.pack;

import java.util.LinkedList;
import java.util.List;
import lombok.extern.log4j.Log4j2;
import net.asrex.skillful.skill.SkillDefinition;
import net.asrex.skillful.skill.SkillRegistry;

/**
 * A confusingly-named meta-skill-pack that includes all currently defined skill
 * packs, with default parameters.
 */
@Log4j2
public class AllSkillPacksSkillPack extends SkillPack {

	@Override
	public List<SkillDefinition> createSkillDefintions() {
		List<SkillDefinition> ret = new LinkedList<>();

		for (Class<? extends SkillPack> pack : SkillRegistry.getPacks()) {
			if (getClass().isAssignableFrom(pack)) {
				// don't recurse D:
				continue;
			}

			try {
				SkillPack instance = pack.newInstance();
				ret.addAll(instance.createSkillDefintions());
			} catch (ReflectiveOperationException ex) {
				log.warn("Unable to create skill pack: " + pack.getName(), ex);
			}
		}

		return ret;
	}

}


text:
package org.apache.solr.search.join;

import com.codahale.metrics.Metric;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import org.apache.lucene.search.BoostQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.join.ScoreMode;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.metrics.MetricsMap;
import org.apache.solr.metrics.SolrMetricManager;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestInfo;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.QParser;
import org.apache.solr.search.SolrCache;
import org.junit.BeforeClass;
import org.junit.Ignore;

public class TestScoreJoinQPScore extends SolrTestCaseJ4 {

  private static final String idField = "id";
  private static final String toField = "movieId_s";

  @BeforeClass
  public static void beforeTests() throws Exception {
    System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
    System.setProperty("solr.filterCache.async", "true");
    initCore("solrconfig.xml", "schema12.xml");
  }

  public void testSimple() throws Exception {
    final String idField = "id";
    final String toField = "productId_s";

    clearIndex();

    // 0
    assertU(add(doc("t_description", "random text", "name", "name1", idField, "1")));

    // 1

    assertU(add(doc("price_s", "10.0", idField, "2", toField, "1")));
    // 2
    assertU(add(doc("price_s", "20.0", idField, "3", toField, "1")));
    // 3
    assertU(add(doc("t_description", "more random text", "name", "name2", idField, "4")));
    // 4
    assertU(add(doc("price_s", "10.0", idField, "5", toField, "4")));
    // 5
    assertU(add(doc("price_s", "20.0", idField, "6", toField, "4")));

    assertU(commit());

    // Search for product
    assertJQ(
        req(
            "q",
            "{!join from=" + idField + " to=" + toField + " score=None}name:name2",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'5'},{'id':'6'}]}");

    /*Query joinQuery =
        JoinUtil.createJoinQuery(idField, false, toField, new TermQuery(new Term("name", "name2")), indexSearcher, ScoreMode.None);

    TopDocs result = indexSearcher.search(joinQuery, 10);
    assertEquals(2, result.totalHits);
    assertEquals(4, result.scoreDocs[0].doc);
    assertEquals(5, result.scoreDocs[1].doc);
    */
    assertJQ(
        req(
            "q",
            "{!join from=" + idField + " to=" + toField + " score=None}name:name1",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'2'},{'id':'3'}]}");

    /*joinQuery = JoinUtil.createJoinQuery(idField, false, toField, new TermQuery(new Term("name", "name1")), indexSearcher, ScoreMode.None);
    result = indexSearcher.search(joinQuery, 10);
    assertEquals(2, result.totalHits);
    assertEquals(1, result.scoreDocs[0].doc);
    assertEquals(2, result.scoreDocs[1].doc);*/

    // Search for offer
    assertJQ(
        req("q", "{!join from=" + toField + " to=" + idField + " score=None}id:5", "fl", "id"),
        "/response=={'numFound':1,'start':0,'numFoundExact':true,'docs':[{'id':'4'}]}");
    /*joinQuery = JoinUtil.createJoinQuery(toField, false, idField, new TermQuery(new Term("id", "5")), indexSearcher, ScoreMode.None);
    result = indexSearcher.search(joinQuery, 10);
    assertEquals(1, result.totalHits);
    assertEquals(3, result.scoreDocs[0].doc);

    indexSearcher.getIndexReader().close();
    dir.close();*/
  }

  public void testDeleteByScoreJoinQuery() throws Exception {
    indexDataForScoring();
    String joinQuery = "{!join from=" + toField + " to=" + idField + " score=Max}title:random";
    assertJQ(
        req("q", joinQuery, "fl", "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'1'},{'id':'4'}]}");
    assertU(delQ(joinQuery));
    assertU(commit());
    assertJQ(
        req("q", joinQuery, "fl", "id"),
        "/response=={'numFound':0,'start':0,'numFoundExact':true,'docs':[]}");
  }

  public void testSimpleWithScoring() throws Exception {
    indexDataForScoring();

    // Search for movie via subtitle
    assertJQ(
        req(
            "q",
            "{!join from=" + toField + " to=" + idField + " score=Max}title:random",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'1'},{'id':'4'}]}");
    // dump(req("q","{!scorejoin from="+toField+" to="+idField+" score=Max}title:random",
    // "fl","id,score", "debug", "true"));
    /*
    Query joinQuery =
        JoinUtil.createJoinQuery(toField, false, idField, new TermQuery(new Term("title", "random")), indexSearcher, ScoreMode.Max);
    TopDocs result = indexSearcher.search(joinQuery, 10);
    assertEquals(2, result.totalHits);
    assertEquals(0, result.scoreDocs[0].doc);
    assertEquals(3, result.scoreDocs[1].doc);*/

    // Score mode max.
    // dump(req("q","{!scorejoin from="+toField+" to="+idField+" score=Max}title:movie",
    // "fl","id,score", "debug", "true"));

    // dump(req("q","title:movie", "fl","id,score", "debug", "true"));
    assertJQ(
        req(
            "q",
            "{!join from=" + toField + " to=" + idField + " score=Max}title:movie",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'4'},{'id':'1'}]}");

    /*joinQuery = JoinUtil.createJoinQuery(toField, false, idField, new TermQuery(new Term("title", "movie")), indexSearcher, ScoreMode.Max);
    result = indexSearcher.search(joinQuery, 10);
    assertEquals(2, result.totalHits);
    assertEquals(3, result.scoreDocs[0].doc);
    assertEquals(0, result.scoreDocs[1].doc);*/

    // Score mode total
    assertJQ(
        req(
            "q",
            "{!join from=" + toField + " to=" + idField + " score=Total}title:movie",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'1'},{'id':'4'}]}");
    /*  joinQuery = JoinUtil.createJoinQuery(toField, false, idField, new TermQuery(new Term("title", "movie")), indexSearcher, ScoreMode.Total);
        result = indexSearcher.search(joinQuery, 10);
        assertEquals(2, result.totalHits);
        assertEquals(0, result.scoreDocs[0].doc);
        assertEquals(3, result.scoreDocs[1].doc);
    */
    // Score mode avg
    assertJQ(
        req(
            "q",
            "{!join from=" + toField + " to=" + idField + " score=Avg}title:movie",
            "fl",
            "id"),
        "/response=={'numFound':2,'start':0,'numFoundExact':true,'docs':[{'id':'4'},{'id':'1'}]}");

    /*  joinQuery = JoinUtil.createJoinQuery(toField, false, idField, new TermQuery(new Term("title", "movie")), indexSearcher, ScoreMode.Avg);
    result = indexSearcher.search(joinQuery, 10);
    assertEquals(2, result.totalHits);
    assertEquals(3, result.scoreDocs[0].doc);
    assertEquals(0, result.scoreDocs[1].doc);*/

  }

  @Ignore("SOLR-7814, also don't forget cover boost at testCacheHit()")
  public void testBoost() throws Exception {
    indexDataForScoring();
    ScoreMode score = ScoreMode.values()[random().nextInt(ScoreMode.values().length)];

    final SolrQueryRequest req =
        req(
            "q",
            "{!join from=movieId_s to=id score=" + score + " b=200}title:movie",
            "fl",
            "id,score",
            "omitHeader",
            "true");
    SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, new SolrQueryResponse()));
    final Query luceneQ =
        QParser.getParser(req.getParams().get("q"), req)
            .getQuery()
            .rewrite(req.getSearcher().getSlowAtomicReader());
    assertTrue(luceneQ instanceof BoostQuery);
    float boost = ((BoostQuery) luceneQ).getBoost();
    assertEquals("" + luceneQ, Float.floatToIntBits(200), Float.floatToIntBits(boost));
    SolrRequestInfo.clearRequestInfo();
    req.close();
  }

  public void testCacheHit() throws Exception {
    indexDataForScoring();

    Map<String, Metric> metrics =
        h.getCoreContainer()
            .getMetricManager()
            .registry(h.getCore().getCoreMetricManager().getRegistryName())
            .getMetrics();

    @SuppressWarnings("rawtypes")
    MetricsMap mm =
        (MetricsMap)
            ((SolrMetricManager.GaugeWrapper) metrics.get("CACHE.searcher.queryResultCache"))
                .getGauge();
    {
      Map<String, Object> statPre = mm.getValue();
      h.query(
          req(
              "q",
              "{!join from=movieId_s to=id score=Avg}title:first",
              "fl",
              "id",
              "omitHeader",
              "true"));
      assertHitOrInsert(mm.getValue(), statPre);
    }

    {
      Map<String, Object> statPre = mm.getValue();
      h.query(
          req(
              "q",
              "{!join from=movieId_s to=id score=Avg}title:first",
              "fl",
              "id",
              "omitHeader",
              "true"));
      assertHit(mm.getValue(), statPre);
    }

    {
      Map<String, Object> statPre = mm.getValue();

      Random r = random();
      boolean changed = false;
      boolean x = false;
      String from = (x = r.nextBoolean()) ? "id" : "movieId_s";
      changed |= x;
      String to = (x = r.nextBoolean()) ? "movieId_s" : "id";
      changed |= x;
      String score = (x = r.nextBoolean()) ? not(ScoreMode.Avg).name() : "Avg";
      changed |= x;
      /* till SOLR-7814
       * String boost = (x = r.nextBoolean()) ? "23" : "1";
      changed |= x; */
      String q = (!changed) ? (r.nextBoolean() ? "title:first^67" : "title:night") : "title:first";

      final String resp =
          h.query(
              req(
                  "q",
                  "{!join from="
                      + from
                      + " to="
                      + to
                      + " score="
                      + score
                      +
                      // " b=" + boost +
                      "}"
                      + q,
                  "fl",
                  "id",
                  "omitHeader",
                  "true"));
      assertInsert(mm.getValue(), statPre);

      statPre = mm.getValue();
      final String repeat =
          h.query(
              req(
                  "q",
                  "{!join from="
                      + from
                      + " to="
                      + to
                      + " score="
                      + score.toLowerCase(Locale.ROOT)
                      +
                      // " b=" + boost
                      "}"
                      + q,
                  "fl",
                  "id",
                  "omitHeader",
                  "true"));
      assertHit(mm.getValue(), statPre);

      assertEquals("lowercase shouldn't change anything", resp, repeat);

      final String aMod = score.substring(0, score.length() - 1);
      assertQEx(
          "exception on " + aMod,
          "ScoreMode",
          req(
              "q",
              "{!join from=" + from + " to=" + to + " score=" + aMod + "}" + q,
              "fl",
              "id",
              "omitHeader",
              "true"),
          SolrException.ErrorCode.BAD_REQUEST);
    }
    // these queries are not overlapping with others in this test case.
    // however, it might be better to extract this method into a separate suite
    // for a while let's nuke a cache content, in case of repetitions
    @SuppressWarnings("rawtypes")
    SolrCache cache = (SolrCache) h.getCore().getInfoRegistry().get("queryResultCache");
    cache.clear();
  }

  private ScoreMode not(ScoreMode s) {
    Random r = random();
    final List<ScoreMode> l = new ArrayList<>(Arrays.asList(ScoreMode.values()));
    l.remove(s);
    return l.get(r.nextInt(l.size()));
  }

  private void assertInsert(Map<String, Object> current, final Map<String, Object> statPre) {
    assertEquals("it lookups", 1, delta("lookups", current, statPre));
    assertEquals("it doesn't hit", 0, delta("hits", current, statPre));
    assertEquals("it inserts", 1, delta("inserts", current, statPre));
  }

  private void assertHit(Map<String, Object> current, final Map<String, Object> statPre) {
    assertEquals("it lookups", 1, delta("lookups", current, statPre));
    assertEquals("it hits", 1, delta("hits", current, statPre));
    assertEquals("it doesn't insert", 0, delta("inserts", current, statPre));
  }

  private void assertHitOrInsert(Map<String, Object> current, final Map<String, Object> statPre) {
    assertEquals("it lookups", 1, delta("lookups", current, statPre));
    final long mayHit = delta("hits", current, statPre);
    assertTrue("it may hit", 0 == mayHit || 1 == mayHit);
    assertEquals("or insert on cold", 1, delta("inserts", current, statPre) + mayHit);
  }

  private long delta(String key, Map<String, Object> a, Map<String, Object> b) {
    return (Long) a.get(key) - (Long) b.get(key);
  }

  private void indexDataForScoring() {
    clearIndex();
    // 0
    assertU(add(doc("t_description", "A random movie", "name", "Movie 1", idField, "1")));
    // 1

    assertU(add(doc("title", "The first subtitle of this movie", idField, "2", toField, "1")));

    // 2

    assertU(add(doc("title", "random subtitle; random event movie", idField, "3", toField, "1")));

    // 3

    assertU(add(doc("t_description", "A second random movie", "name", "Movie 2", idField, "4")));
    // 4

    assertU(
        add(
            doc(
                "title",
                "a very random event happened during christmas night",
                idField,
                "5",
                toField,
                "4")));

    // 5

    assertU(
        add(doc("title", "movie end movie test 123 test 123 random", idField, "6", toField, "4")));

    assertU(commit());
  }
}