text:
#include <assert.h>
#include <errno.h>
#include <string.h>

#include <arch_helpers.h>
#include <arch_features.h>
#include <bl31/bl31.h>
#include <common/debug.h>
#include <common/runtime_svc.h>
#include <context.h>
#include <lib/el3_runtime/context_mgmt.h>
#include <lib/el3_runtime/pubsub.h>
#include <lib/gpt_rme/gpt_rme.h>

#include <lib/spinlock.h>
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/common_def.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <services/gtsi_svc.h>
#include <services/rmi_svc.h>
#include <services/rmmd_svc.h>
#include <smccc_helpers.h>
#include "rmmd_initial_context.h"
#include "rmmd_private.h"

/*******************************************************************************
 * RMM context information.
 ******************************************************************************/
rmmd_rmm_context_t rmm_context[PLATFORM_CORE_COUNT];

/*******************************************************************************
 * RMM entry point information. Discovered on the primary core and reused
 * on secondary cores.
 ******************************************************************************/
static entry_point_info_t *rmm_ep_info;

/*******************************************************************************
 * Static function declaration.
 ******************************************************************************/
static int32_t rmm_init(void);
static uint64_t rmmd_smc_forward(uint32_t smc_fid, uint32_t src_sec_state,
					uint32_t dst_sec_state, uint64_t x1,
					uint64_t x2, uint64_t x3, uint64_t x4,
					void *handle);

/*******************************************************************************
 * This function takes an RMM context pointer and performs a synchronous entry
 * into it.
 ******************************************************************************/
uint64_t rmmd_rmm_sync_entry(rmmd_rmm_context_t *rmm_ctx)
{
	uint64_t rc;

	assert(rmm_ctx != NULL);

	cm_set_context(&(rmm_ctx->cpu_ctx), REALM);

	/* Save the current el1/el2 context before loading realm context. */
	cm_el1_sysregs_context_save(NON_SECURE);
	cm_el2_sysregs_context_save(NON_SECURE);

	/* Restore the realm context assigned above */
	cm_el1_sysregs_context_restore(REALM);
	cm_el2_sysregs_context_restore(REALM);
	cm_set_next_eret_context(REALM);

	/* Enter RMM */
	rc = rmmd_rmm_enter(&rmm_ctx->c_rt_ctx);

	/* Save realm context */
	cm_el1_sysregs_context_save(REALM);
	cm_el2_sysregs_context_save(REALM);

	/* Restore the el1/el2 context again. */
	cm_el1_sysregs_context_restore(NON_SECURE);
	cm_el2_sysregs_context_restore(NON_SECURE);

	return rc;
}

/*******************************************************************************
 * This function returns to the place where rmmd_rmm_sync_entry() was
 * called originally.
 ******************************************************************************/
__dead2 void rmmd_rmm_sync_exit(uint64_t rc)
{
	rmmd_rmm_context_t *ctx = &rmm_context[plat_my_core_pos()];

	/* Get context of the RMM in use by this CPU. */
	assert(cm_get_context(REALM) == &(ctx->cpu_ctx));

	/*
	 * The RMMD must have initiated the original request through a
	 * synchronous entry into RMM. Jump back to the original C runtime
	 * context with the value of rc in x0;
	 */
	rmmd_rmm_exit(ctx->c_rt_ctx, rc);

	panic();
}

static void rmm_el2_context_init(el2_sysregs_t *regs)
{
	regs->ctx_regs[CTX_SPSR_EL2 >> 3] = REALM_SPSR_EL2;
	regs->ctx_regs[CTX_SCTLR_EL2 >> 3] = SCTLR_EL2_RES1;
}

/*******************************************************************************
 * Jump to the RMM for the first time.
 ******************************************************************************/
static int32_t rmm_init(void)
{

	uint64_t rc;

	rmmd_rmm_context_t *ctx = &rmm_context[plat_my_core_pos()];

	INFO("RMM init start.\n");
	ctx->state = RMM_STATE_RESET;

	/* Initialize RMM EL2 context. */
	rmm_el2_context_init(&ctx->cpu_ctx.el2_sysregs_ctx);

	rc = rmmd_rmm_sync_entry(ctx);
	if (rc != 0ULL) {
		ERROR("RMM initialisation failed 0x%llx\n", rc);
		panic();
	}

	ctx->state = RMM_STATE_IDLE;
	INFO("RMM init end.\n");

	return 1;
}

/*******************************************************************************
 * Load and read RMM manifest, setup RMM.
 ******************************************************************************/
int rmmd_setup(void)
{
	uint32_t ep_attr;
	unsigned int linear_id = plat_my_core_pos();
	rmmd_rmm_context_t *rmm_ctx = &rmm_context[linear_id];

	/* Make sure RME is supported. */
	assert(get_armv9_2_feat_rme_support() != 0U);

	rmm_ep_info = bl31_plat_get_next_image_ep_info(REALM);
	if (rmm_ep_info == NULL) {
		WARN("No RMM image provided by BL2 boot loader, Booting "
		     "device without RMM initialization. SMCs destined for "
		     "RMM will return SMC_UNK\n");
		return -ENOENT;
	}

	/* Under no circumstances will this parameter be 0 */
	assert(rmm_ep_info->pc == RMM_BASE);

	/* Initialise an entrypoint to set up the CPU context */
	ep_attr = EP_REALM;
	if ((read_sctlr_el3() & SCTLR_EE_BIT) != 0U) {
		ep_attr |= EP_EE_BIG;
	}

	SET_PARAM_HEAD(rmm_ep_info, PARAM_EP, VERSION_1, ep_attr);
	rmm_ep_info->spsr = SPSR_64(MODE_EL2,
					MODE_SP_ELX,
					DISABLE_ALL_EXCEPTIONS);

	/* Initialise RMM context with this entry point information */
	cm_setup_context(&rmm_ctx->cpu_ctx, rmm_ep_info);

	INFO("RMM setup done.\n");

	/* Register init function for deferred init.  */
	bl31_register_rmm_init(&rmm_init);

	return 0;
}

/*******************************************************************************
 * Forward SMC to the other security state
 ******************************************************************************/
static uint64_t	rmmd_smc_forward(uint32_t smc_fid, uint32_t src_sec_state,
					uint32_t dst_sec_state, uint64_t x1,
					uint64_t x2, uint64_t x3, uint64_t x4,
					void *handle)
{
	/* Save incoming security state */
	cm_el1_sysregs_context_save(src_sec_state);
	cm_el2_sysregs_context_save(src_sec_state);

	/* Restore outgoing security state */
	cm_el1_sysregs_context_restore(dst_sec_state);
	cm_el2_sysregs_context_restore(dst_sec_state);
	cm_set_next_eret_context(dst_sec_state);

	SMC_RET8(cm_get_context(dst_sec_state), smc_fid, x1, x2, x3, x4,
			SMC_GET_GP(handle, CTX_GPREG_X5),
			SMC_GET_GP(handle, CTX_GPREG_X6),
			SMC_GET_GP(handle, CTX_GPREG_X7));
}

/*******************************************************************************
 * This function handles all SMCs in the range reserved for RMI. Each call is
 * either forwarded to the other security state or handled by the RMM dispatcher
 ******************************************************************************/
uint64_t rmmd_rmi_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2,
				uint64_t x3, uint64_t x4, void *cookie,
				void *handle, uint64_t flags)
{
	rmmd_rmm_context_t *ctx = &rmm_context[plat_my_core_pos()];
	uint32_t src_sec_state;

	/* Determine which security state this SMC originated from */
	src_sec_state = caller_sec_state(flags);

	/* RMI must not be invoked by the Secure world */
	if (src_sec_state == SMC_FROM_SECURE) {
		WARN("RMM: RMI invoked by secure world.\n");
		SMC_RET1(handle, SMC_UNK);
	}

	/*
	 * Forward an RMI call from the Normal world to the Realm world as it
	 * is.
	 */
	if (src_sec_state == SMC_FROM_NON_SECURE) {
		VERBOSE("RMM: RMI call from non-secure world.\n");
		return rmmd_smc_forward(smc_fid, NON_SECURE, REALM,
					x1, x2, x3, x4, handle);
	}

	assert(src_sec_state == SMC_FROM_REALM);

	switch (smc_fid) {
	case RMI_RMM_REQ_COMPLETE:
		if (ctx->state == RMM_STATE_RESET) {
			VERBOSE("RMM: running rmmd_rmm_sync_exit\n");
			rmmd_rmm_sync_exit(x1);
		}

		return rmmd_smc_forward(x1, REALM, NON_SECURE,
					x2, x3, x4, 0, handle);

	default:
		WARN("RMM: Unsupported RMM call 0x%08x\n", smc_fid);
		SMC_RET1(handle, SMC_UNK);
	}
}

/*******************************************************************************
 * This cpu has been turned on. Enter RMM to initialise R-EL2.  Entry into RMM
 * is done after initialising minimal architectural state that guarantees safe
 * execution.
 ******************************************************************************/
static void *rmmd_cpu_on_finish_handler(const void *arg)
{
	int32_t rc;
	uint32_t linear_id = plat_my_core_pos();
	rmmd_rmm_context_t *ctx = &rmm_context[linear_id];

	ctx->state = RMM_STATE_RESET;

	/* Initialise RMM context with this entry point information */
	cm_setup_context(&ctx->cpu_ctx, rmm_ep_info);

	/* Initialize RMM EL2 context. */
	rmm_el2_context_init(&ctx->cpu_ctx.el2_sysregs_ctx);

	rc = rmmd_rmm_sync_entry(ctx);
	if (rc != 0) {
		ERROR("RMM initialisation failed (%d) on CPU%d\n", rc,
		      linear_id);
		panic();
	}

	ctx->state = RMM_STATE_IDLE;
	return NULL;
}

/* Subscribe to PSCI CPU on to initialize RMM on secondary */
SUBSCRIBE_TO_EVENT(psci_cpu_on_finish, rmmd_cpu_on_finish_handler);

static int gtsi_transition_granule(uint64_t pa,
					unsigned int src_sec_state,
					unsigned int target_pas)
{
	int ret;

	ret = gpt_transition_pas(pa, PAGE_SIZE_4KB, src_sec_state, target_pas);

	/* Convert TF-A error codes into GTSI error codes */
	if (ret == -EINVAL) {
		ERROR("[GTSI] Transition failed: invalid %s\n", "address");
		ERROR("       PA: 0x%llx, SRC: %d, PAS: %d\n", pa,
		      src_sec_state, target_pas);
		ret = GRAN_TRANS_RET_BAD_ADDR;
	} else if (ret == -EPERM) {
		ERROR("[GTSI] Transition failed: invalid %s\n", "caller/PAS");
		ERROR("       PA: 0x%llx, SRC: %d, PAS: %d\n", pa,
		      src_sec_state, target_pas);
		ret = GRAN_TRANS_RET_BAD_PAS;
	}

	return ret;
}

/*******************************************************************************
 * This function handles all SMCs in the range reserved for GTF.
 ******************************************************************************/
uint64_t rmmd_gtsi_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2,
				uint64_t x3, uint64_t x4, void *cookie,
				void *handle, uint64_t flags)
{
	uint32_t src_sec_state;

	/* Determine which security state this SMC originated from */
	src_sec_state = caller_sec_state(flags);

	if (src_sec_state != SMC_FROM_REALM) {
		WARN("RMM: GTF call originated from secure or normal world\n");
		SMC_RET1(handle, SMC_UNK);
	}

	switch (smc_fid) {
	case SMC_ASC_MARK_REALM:
		SMC_RET1(handle, gtsi_transition_granule(x1, SMC_FROM_REALM,
								GPT_GPI_REALM));
	case SMC_ASC_MARK_NONSECURE:
		SMC_RET1(handle, gtsi_transition_granule(x1, SMC_FROM_REALM,
								GPT_GPI_NS));
	default:
		WARN("RMM: Unsupported GTF call 0x%08x\n", smc_fid);
		SMC_RET1(handle, SMC_UNK);
	}
}


text:
// Copyright (c) Aghyad khlefawi. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.

using System;

namespace Coddee.Data
{
    /// <summary>
    /// Contains the information of a <seealso cref="IRepositorySyncService"/> sync call.
    /// </summary>
    public class RepositorySyncEventArgs
    {
        public RepositorySyncEventArgs()
        {

        }

        public RepositorySyncEventArgs(OperationType operationType, object item)
        {
            Item = item;
            OperationType = operationType;
        }

        /// <summary>
        /// The items that was added, edited or deleted.
        /// </summary>
        public object Item { get; set; }

        /// <summary>
        /// The operation that occurred on the <see cref="Item"/>.
        /// </summary>
        public OperationType OperationType { get; set; }
    }

    /// <summary>
    /// A sync service contract that should provide the ability to sync
    /// the repository objects between multiple clients in real-time.
    /// </summary>
    public interface IRepositorySyncService
    {

        /// <summary>
        /// Triggered whenever this client receives a sync call.
        /// </summary>
        event Action<string, RepositorySyncEventArgs> SyncReceived;

        /// <summary>
        /// Send a sync call to the other clients.
        /// </summary>
        /// <param name="identifire">An object identifier to be able to determine
        /// which repository should handle the sync call.</param>
        /// <param name="args">The sync object information.</param>
        void SyncItem(string identifire, RepositorySyncEventArgs args);
    }

}

redpajama_set_name: RedPajamaGithub


text:
package software.amazon.awssdk.services.s3;

import java.util.concurrent.Callable;
import software.amazon.awssdk.core.async.AsyncRequestBody;
import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest;
import software.amazon.awssdk.services.s3.model.AbortMultipartUploadResponse;
import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest;
import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadResponse;
import software.amazon.awssdk.services.s3.model.CreateMultipartUploadResponse;
import software.amazon.awssdk.services.s3.model.ListMultipartUploadsResponse;
import software.amazon.awssdk.services.s3.model.UploadPartRequest;
import software.amazon.awssdk.services.s3.model.UploadPartResponse;

public class AsyncUploadMultiplePartIntegrationTest extends UploadMultiplePartTestBase {

    @Override
    public Callable<CreateMultipartUploadResponse> createMultipartUpload(String bucket, String key) {
        return () -> s3Async.createMultipartUpload(b -> b.bucket(bucket).key(key)).join();
    }

    @Override
    public Callable<UploadPartResponse> uploadPart(UploadPartRequest request, String requestBody) {
        return () -> s3Async.uploadPart(request, AsyncRequestBody.fromString(requestBody)).join();
    }

    @Override
    public Callable<ListMultipartUploadsResponse> listMultipartUploads(String bucket) {
        return () -> s3Async.listMultipartUploads(b -> b.bucket(bucket)).join();
    }

    @Override
    public Callable<CompleteMultipartUploadResponse> completeMultipartUpload(CompleteMultipartUploadRequest request) {
        return () -> s3Async.completeMultipartUpload(request).join();
    }

    @Override
    public Callable<AbortMultipartUploadResponse> abortMultipartUploadResponseCallable(AbortMultipartUploadRequest request) {
        return () -> s3Async.abortMultipartUpload(request).join();
    }
}


text:
<?xml version="1.0"?>
<package format="2">
  <name>visor</name>
  <version>0.1.0</version>
  <description>The ViSor package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="ferdian.adi@gmail.com">Ferdi Pratama</maintainer>

  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>BSD</license>

  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <url type="website">http://github.com/ferdianap/eris</url>

  <!-- Author tags are optional, mutiple are allowed, one per tag -->
  <!-- Authors do not have to be maintianers, but could be -->
  <!-- Example: -->
  <author email="ferdian.adi@gmail.com">Ferdi Pratama</author>

  <!-- The *_depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use build_depend for packages you need at compile time: -->
  <build_depend>message_generation</build_depend>
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use run_depend for packages you need at runtime: -->
  <build_export_depend>message_runtime</build_export_depend>
  <exec_depend>message_runtime</exec_depend>
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <buildtool_depend>catkin</buildtool_depend>

  <!--depend>dynamic_reconfigure</depend-->
  <depend>cv_bridge</depend>
  <depend>image_transport</depend>
  <depend>roscpp</depend>
  <depend>rospy</depend>
  <depend>std_msgs</depend>

  <!--depend>visor_generate_messages_cpp</depend-->

  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- You can specify that this package is a metapackage here: -->
    <!-- <metapackage/> -->
    <!-- <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -lvattnlib"/> -->
    <!-- Other tools can request additional information be placed here -->
  </export>
</package>


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Cancion */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'nombre')->textInput(['maxlength' => 100]) ?>

        <?= Html::submitButton($model->isNewRecord ? 'Añadir' : 'Guardar cambios', ['class' => $model->isNewRecord ? 'btn btn-form' : 'btn btn-form']) ?>

    <?php ActiveForm::end(); ?>


text:
package sous

import (
	"fmt"
	"strings"
)

type (
	// ResolveErrors collect all the errors for a resolve action into a single
	// error to be handled elsewhere
	ResolveErrors struct {
		Causes []error
	}

	// MissingImageNameError reports that we couldn't get names for one or
	// more source IDs.
	MissingImageNameError struct {
		Cause error
	}

	// An UnacceptableAdvisory reports that there is an advisory on an image
	// which hasn't been whitelisted on the target cluster
	UnacceptableAdvisory struct {
		Quality
		*SourceID
	}

	// CreateError is returned when there's an error trying to create a deployment
	CreateError struct {
		Deployment *Deployment
		Err        error
	}

	// DeleteError is returned when there's an error while trying to delete a deployment
	DeleteError struct {
		Deployment *Deployment
		Err        error
	}

	// ChangeError describes an error that occurred while trying to change one deployment into another
	ChangeError struct {
		Deployments *DeploymentPair
		Err         error
	}

	// RectificationError is an interface that extends error with methods to get
	// the deployments the preceeded and were intended when the error occurred
	RectificationError interface {
		error
		ExistingDeployment() *Deployment
		IntendedDeployment() *Deployment
	}
)

func (re *ResolveErrors) Error() string {
	s := []string{"Errors during resolve:"}
	for _, e := range re.Causes {
		s = append(s, e.Error())
	}
	return strings.Join(s, "\n  ")
}

func (e *MissingImageNameError) Error() string {
	return fmt.Sprintf("Image name unknown to Sous for source IDs: %s", e.Cause.Error())
}

func (e *UnacceptableAdvisory) Error() string {
	return fmt.Sprintf("Advisory unacceptable on image: %s for %v", e.Quality.Name, e.SourceID)
}

func (e *CreateError) Error() string {
	return fmt.Sprintf("Couldn't create deployment\n  %+v: %v", e.Deployment, e.Err)
}

// ExistingDeployment returns the deployment that was already existent in a change error
func (e *CreateError) ExistingDeployment() *Deployment {
	return nil
}

// IntendedDeployment returns the deployment that was intended in a ChangeError
func (e *CreateError) IntendedDeployment() *Deployment {
	return e.Deployment
}

func (e *DeleteError) Error() string {
	return fmt.Sprintf("%v: Couldn't delete deployment %+v", e.Err, e.Deployment)
}

// ExistingDeployment returns the deployment that was already existent in a change error
func (e *DeleteError) ExistingDeployment() *Deployment {
	return e.Deployment
}

// IntendedDeployment returns the deployment that was intended in a ChangeError
func (e *DeleteError) IntendedDeployment() *Deployment {
	return nil
}

func (e *ChangeError) Error() string {
	return fmt.Sprintf("%v: Couldn't change from deployment\n  %+v\n\n  to deployment\n\n  %+v", e.Err, e.Deployments.Prior, e.Deployments.Post)
}

// ExistingDeployment returns the deployment that was already existent in a change error
func (e *ChangeError) ExistingDeployment() *Deployment {
	return e.Deployments.Prior
}

// IntendedDeployment returns the deployment that was intended in a ChangeError
func (e *ChangeError) IntendedDeployment() *Deployment {
	return e.Deployments.Post
}


text:
use ggez::audio::SoundSource;
use ggez::{Context, GameResult};

use crate::{
    controllers::Event,
    view::Resources,
};

pub fn play_sounds(ctx: &Context, events: &mut Vec<Event>, resources: &mut Resources) -> GameResult<()> {
    use self::Event::*;
    for event in events.drain(..) {
        match event {
            EnemyDestroyed => resources.enemy_destroyed_sound.play(ctx)?,
            PlayerDestroyed => resources.player_destroyed_sound.play(ctx)?,
            PowerupGained => resources.powerup_sound.play(ctx)?,
            ShotFired => resources.shot_sound.play(ctx)?,
            EnemySpawned => resources.enemy_spawn_sound.play(ctx)?,
            GameStart => resources.game_start_sound.play(ctx)?
        }
    }

    Ok(())
}


text:
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using EncompassRest.Utilities;

namespace EncompassRest.CustomDataObjects
{
    /// <summary>
    /// Base Custom Data Objects Apis.
    /// </summary>
    public interface ICustomDataObjects : IApiObject
    {
        /// <summary>
        /// Updates the specified custom data object. This call adds the data provided in the body to the end of the dataObject.
        /// </summary>
        /// <param name="cdo">The custom data object to update.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task AppendToCustomDataObjectAsync(CustomDataObject cdo, CancellationToken cancellationToken = default);
        /// <summary>
        /// Updates the specified custom data object. This call adds the data provided in the body to the end of the dataObject. Optionally populates the custom data object with the response's body through the use of the entity view query parameter.
        /// </summary>
        /// <param name="cdo">The custom data object to update.</param>
        /// <param name="populate">Indicates if the custom data object should be populated with the response's body through the use of the entity view query parameter.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task AppendToCustomDataObjectAsync(CustomDataObject cdo, bool populate, CancellationToken cancellationToken = default);
        /// <summary>
        /// Updates the specified custom data object from raw json. This call adds the data provided in the body to the end of the dataObject.
        /// </summary>
        /// <param name="objectName">Name of the custom data object to update.</param>
        /// <param name="cdo">The custom data object to update as raw json.</param>
        /// <param name="queryString">The query string to include in the request.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<string> AppendToCustomDataObjectRawAsync(string objectName, string cdo, string? queryString = null, CancellationToken cancellationToken = default);
        /// <summary>
        /// Creates or replaces a custom data object.
        /// </summary>
        /// <param name="cdo">The custom data object to create or replace.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task CreateOrReplaceCustomDataObjectAsync(CustomDataObject cdo, CancellationToken cancellationToken = default);
        /// <summary>
        /// Creates or replaces a custom data object from raw json.
        /// </summary>
        /// <param name="objectName">Name to assign to the custom data object. Or, the name of an existing custom data object to replace.</param>
        /// <param name="cdo">The custom data object to create or replace as raw json.</param>
        /// <param name="queryString">The query string to include in the request.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<string> CreateOrReplaceCustomDataObjectRawAsync(string objectName, string cdo, string? queryString = null, CancellationToken cancellationToken = default);
        /// <summary>
        /// Removes a custom data object.
        /// </summary>
        /// <param name="objectName">Name of the custom data object to delete.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task DeleteCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default);
        /// <summary>
        /// Retrieves the contents of a custom data object. Contents are retrieved as a Base64 string.
        /// </summary>
        /// <param name="objectName">The name of the custom data object to retrieve.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<CustomDataObject> GetCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default);
        /// <summary>
        /// Retrieves the contents of a custom data object as raw json. Contents are retrieved as a Base64 string.
        /// </summary>
        /// <param name="objectName">The name of the custom data object to retrieve.</param>
        /// <param name="queryString">The query string to include in the request.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<string> GetCustomDataObjectRawAsync(string objectName, string? queryString = null, CancellationToken cancellationToken = default);
        /// <summary>
        /// Provides a list of names of custom data objects.
        /// </summary>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<List<string>> GetCustomDataObjectsAsync(CancellationToken cancellationToken = default);
        /// <summary>
        /// Provides a list of names of custom data objects as raw json.
        /// </summary>
        /// <param name="queryString">The query string to include in the request.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<string> GetCustomDataObjectsRawAsync(string? queryString = null, CancellationToken cancellationToken = default);
        /// <summary>
        /// Removes a custom data object.
        /// </summary>
        /// <param name="objectName">Name of the custom data object to delete.</param>
        /// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None"/>.</param>
        /// <returns></returns>
        Task<bool> TryDeleteCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default);
    }

    /// <summary>
    /// Base Custom Data Objects Apis.
    /// </summary>
    public abstract class CustomDataObjects : ApiObject, ICustomDataObjects
    {
        internal CustomDataObjects(EncompassRestClient client, string baseApiPath)
            : base(client, baseApiPath)
        {
        }

        /// <inheritdoc/>
        public Task<List<string>> GetCustomDataObjectsAsync(CancellationToken cancellationToken = default) => GetAsync<List<string>>(null, null, nameof(GetCustomDataObjectsAsync), null, cancellationToken);

        /// <inheritdoc/>
        public Task<string> GetCustomDataObjectsRawAsync(string? queryString = null, CancellationToken cancellationToken = default) => GetRawAsync(null, queryString, nameof(GetCustomDataObjectsRawAsync), null, cancellationToken);

        /// <inheritdoc/>
        public Task<CustomDataObject> GetCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));

            return GetAsync<CustomDataObject>(objectName, null, nameof(GetCustomDataObjectAsync), objectName, cancellationToken);
        }

        /// <inheritdoc/>
        public Task<string> GetCustomDataObjectRawAsync(string objectName, string? queryString = null, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));

            return GetRawAsync(objectName, queryString, nameof(GetCustomDataObjectRawAsync), objectName, cancellationToken);
        }

        /// <inheritdoc/>
        public Task CreateOrReplaceCustomDataObjectAsync(CustomDataObject cdo, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNull(cdo, nameof(cdo));
            Preconditions.NotNullOrEmpty(cdo.Name, $"{nameof(cdo)}.{nameof(cdo.Name)}");

            return PutAsync(cdo.Name, null, JsonStreamContent.Create(cdo), nameof(CreateOrReplaceCustomDataObjectAsync), cdo.Name, cancellationToken);
        }

        /// <inheritdoc/>
        public Task<string> CreateOrReplaceCustomDataObjectRawAsync(string objectName, string cdo, string? queryString = null, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));
            Preconditions.NotNullOrEmpty(cdo, nameof(cdo));

            return PutRawAsync(objectName, queryString, new JsonStringContent(cdo), nameof(CreateOrReplaceCustomDataObjectRawAsync), objectName, cancellationToken);
        }

        /// <inheritdoc/>
        public Task<bool> TryDeleteCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));

            return TryDeleteAsync(objectName, null, cancellationToken);
        }

        /// <inheritdoc/>
        public Task DeleteCustomDataObjectAsync(string objectName, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));

            return DeleteAsync(objectName, null, cancellationToken);
        }

        /// <inheritdoc/>
        public Task AppendToCustomDataObjectAsync(CustomDataObject cdo, CancellationToken cancellationToken = default) => AppendToCustomDataObjectAsync(cdo, false, cancellationToken);

        /// <inheritdoc/>
        public Task AppendToCustomDataObjectAsync(CustomDataObject cdo, bool populate, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNull(cdo, nameof(cdo));
            Preconditions.NotNullOrEmpty(cdo.Name, $"{nameof(cdo)}.{nameof(cdo.Name)}");

            return PatchPopulateDirtyAsync(cdo.Name, JsonStreamContent.Create(cdo), nameof(AppendToCustomDataObjectAsync), cdo.Name, cdo, populate, cancellationToken);
        }

        /// <inheritdoc/>
        public Task<string> AppendToCustomDataObjectRawAsync(string objectName, string cdo, string? queryString = null, CancellationToken cancellationToken = default)
        {
            Preconditions.NotNullOrEmpty(objectName, nameof(objectName));
            Preconditions.NotNullOrEmpty(cdo, nameof(cdo));

            return PatchRawAsync(objectName, queryString, new JsonStringContent(cdo), nameof(AppendToCustomDataObjectRawAsync), objectName, cancellationToken);
        }
    }
}


text:
<?php
require_once("./init.php");
if (!defined('is_florensia')) die('Hacking attempt');

$flolang->load("statistic,character,guild");
$florensia->sitetitle("Statistics");

$dbwhere = array();
$dblimit = 13;
if ($_GET['server'] && in_array($_GET['server'], $florensia->validserver)) {
    $statisticserver = $_GET['server'];
    $serverpagetitle = "> ".$florensia->escape($_GET['server']);
    $florensia->sitetitle($florensia->escape($_GET['server']));
}
else {
    unset($_GET['server'], $serverpagetitle);
    $statisticserver = "global";
}

    #load cached statistics into tmp variable
    $querystatistic = MYSQL_QUERY("SELECT content, statistic FROM flobase_statistics WHERE server='{$statisticserver}'");
    while ($tmpstatistic = MYSQL_FETCH_ARRAY($querystatistic)) {
        $statistic[$tmpstatistic['statistic']] = explode("\n", $tmpstatistic['content']);
    }

    foreach ($statistic['guild_mostmember'] as $cacheline) {
        # guildid, guild, server, amount
        $cacheline = explode("\t", $cacheline);
        $mostmemberguild .= "

            {$cacheline[3]}
            outlink(array('guilddetails', $cacheline[0], $cacheline[2], $cacheline[1]))."'>".$florensia->escape($cacheline[1])."
            outlink(array('statistics', $cacheline[1]))."'>{$cacheline[2]}

";
    }

    foreach(array('guild_topland', 'guild_topsea') as $key) {
        foreach ($statistic[$key] as $cacheline) {
            # id, guildname, server, averagelandlevel, averagesealevel, memberamount
            $cacheline = explode("\t", $cacheline);
            $topguildlist[$key] .= "

                {$cacheline[3]} layer_rel}/land.gif' style='height:11px;'>
                {$cacheline[4]} layer_rel}/sealv.gif' style='height:11px;'>
                outlink(array('guilddetails', $cacheline[0], $cacheline[2], $cacheline[1]))."'>".$florensia->escape($cacheline[1])."
                outlink(array('statistics', $cacheline[2]))."'>{$cacheline[2]}
                ".$flolang->sprintf($flolang->guild_memberamount, $cacheline[5])."

";
        }
    }

    ########## $flolang->statistic_title_guildtopaveragelevel

    foreach(array('character_topland', 'character_topsea') as $key) {
        foreach ($statistic[$key] as $cacheline) {
            # charname, levelland, levelsea, guild, guildid, server
            $cacheline = explode("\t", $cacheline);
            $topcharlist[$key] .= "

                {$cacheline[1]} layer_rel}/land.gif' style='height:11px;'>
                {$cacheline[2]} layer_rel}/sealv.gif' style='height:11px;'>
                outlink(array('characterdetails', $cacheline[0]))."'>{$cacheline[0]}
                outlink(array('guilddetails', $cacheline[4], $cacheline[5], $cacheline[3]))."'>".$florensia->escape($cacheline[3])."
                outlink(array('statistics', $cacheline[5]))."'>{$cacheline[5]}

";
        }
    }
    /*
    foreach(array('character_toplevelerland', 'character_toplevelersea') as $key) {
        foreach ($statistic[$key] as $cacheline) {
            # charname, levelland, levelsea, guild, guildid, server, lastdifflevelland, lastdifflevelsea
            $cacheline = explode("\t", $cacheline);
            $topcharlist[$key] .= "

                {$cacheline[1]} (+{$cacheline[6]}) layer_rel}/land.gif' style='height:11px;'>
                {$cacheline[2]} (+{$cacheline[7]})layer_rel}/sealv.gif' style='height:11px;'>
                outlink(array('characterdetails', $cacheline[0]))."'>{$cacheline[0]}
                outlink(array('guilddetails', $cacheline[4], $cacheline[5], $cacheline[3]))."'>".$florensia->escape($cacheline[3])."
                outlink(array('statistics', $cacheline[5]))."'>{$cacheline[5]}

";
        }
    }*/

    foreach ($statistic['character_classes'] as $cacheline) {
        # COUNT(charname), jobclass, gender
        $cacheline = explode("\t", $cacheline);
        if (!$cacheline[1]) continue;
        $characterclassestmp[$cacheline[1]][$cacheline[2]] = $cacheline[0];
    }

    foreach ($characterclassestmp as $jobclass => $genderamount) {
        $characterclasses .= "

            ".bcadd($genderamount['m'], $genderamount['f'])."
            {$jobclass}
            {$genderamount['f']} layer_rel}/gender_female.gif' border='0' alt='male' style='height:12px;'> + {$genderamount['m']} layer_rel}/gender_male.gif' border='0' alt='male' style='height:12px;'>

";
    }

    /*
    foreach(array("land", "sea") as $type) {
        foreach ($statistic['character_level'.$type] as $cacheline) {
            # COUNT(charname), jobclass, gender
            $cacheline = explode("\t", $cacheline);
            $characterclassestmp[$type][bcdiv($cacheline[1],10,0)][$cacheline[2]] = $cacheline[0];
        }

        foreach ($characterclassestmp[$type] as $level => $genderamount) {
            $topcharlist['character_level'.$type] .= "

                ".bcadd($genderamount['m'], $genderamount['f'])."
                ".bcmul($level,10)."-".bcadd($level*10, 9)."
                {$genderamount['f']} layer_rel}/gender_female.gif' border='0' alt='male' style='height:12px;'> + {$genderamount['m']} layer_rel}/gender_male.gif' border='0' alt='male' style='height:12px;'>

";
        }
    }

Land

{$topcharlist['character_levelland']}

Sea

{$topcharlist['character_levelsea']}

    */

    foreach ($florensia->validserver as $server) {
        $validserverlinks[] = "outlink(array('statistics', $server))."'>{$server}";
    }
    $content = "

        root}/statistics'>{$flolang->statistic_sitetitle} {$serverpagetitle}

        ".$flolang->sprintf($flolang->statistic_notice_createdon, date("m.d.Y - H:i", $statistic['statistic_timestamp'][0]))."

".$flolang->sprintf($flolang->statistic_notice_seealso, join(", ", $validserverlinks))."

outlink(array('ranking'), array('order'=>'land'))."'>{$flolang->statistic_notice_watchfullranking}

{$flolang->statistic_title_chartopland}

{$topcharlist['character_topland']}

outlink(array('ranking'), array('order'=>'sea'))."'>{$flolang->statistic_notice_watchfullranking}

{$flolang->statistic_title_chartopsea}

{$topcharlist['character_topsea']}

";
 /*

{$flolang->statistic_title_chartoplevelerland}

{$topcharlist['character_toplevelerland']}

{$flolang->statistic_title_chartoplevelersea}

{$topcharlist['character_toplevelersea']}

*/
$content .= "

{$flolang->statistic_title_charclasses}

{$characterclasses}

outlink(array('guildranking'), array('order'=>'member'))."'>{$flolang->statistic_notice_watchfullranking}

{$flolang->statistic_title_guildmostmember}

{$mostmemberguild}

outlink(array('guildranking'), array('order'=>'land'))."'>{$flolang->statistic_notice_watchfullranking}

{$flolang->statistic_title_guildtopland}

{$topguildlist['guild_topland']}

outlink(array('guildranking'), array('order'=>'sea'))."'>{$flolang->statistic_notice_watchfullranking}

{$flolang->statistic_title_guildtopsea}

{$topguildlist['guild_topsea']}

    ";

$content .= '

';

$data = json_decode(file_get_contents("{$florensia->root_abs}/api.statistics.json"));
foreach ($data as $sibling_key => $sibling_val) {
  $content .= '

'.nl2br($florensia->escape($sibling_val->comment)).'

  ';
}

    $florensia->output_page($content);

?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;

namespace Shellscape.UI.Controls {
	public class FlickerFreeListView : ListView {

		[StructLayout(LayoutKind.Sequential)]
		struct NMHDR {
			public IntPtr hwndFrom;
			public IntPtr idFrom;
			public int code;
		}

		protected Boolean isInWmPaint;

		public FlickerFreeListView() : base() {
			this.DoubleBuffered = true;
		}

		protected override void OnDrawItem(DrawListViewItemEventArgs e) {
			if (this.isInWmPaint) {
				base.OnDrawItem(e);
			}
		}

		protected override void WndProc(ref Message m) {
			switch (m.Msg) {
				case 0x0F: // WM_PAINT
					this.isInWmPaint = true;
					base.WndProc(ref m);
					this.isInWmPaint = false;
					break;
				case 0x204E: // WM_REFLECT_NOTIFY
					NMHDR nmhdr = (NMHDR)m.GetLParam(typeof(NMHDR));
					if (nmhdr.code == -12) { // NM_CUSTOMDRAW
						if (this.isInWmPaint)
							base.WndProc(ref m);
					}
					else
						base.WndProc(ref m);
					break;
				default:
					base.WndProc(ref m);
					break;
			}
		}

	}
}


text:
0.5
===

*Unreleased*
Change the way the project is tested, from docker-compose to rely on OpenShift.
Drop now unneeded mock services
Add checker for tv-thumbnails, to replace the use of [http-ticket-checker](https://github.com/kb-dk/http-ticket-checker)

0.4
===

Building necessary docker infrastructure to do local integration tests.
Brought in newspaper-usage-statistics module for easier development.

/tra 2017-09-19

0.3.1
===

"ignored_resource_pattern" is now a required configuration parameter
(which defines what to log to the usage log).

Added create-deployment-targz.sh which transparently adds the versioned
extraction directory.

/tra 2017-09-11

0.3 (2017-08-31)
===

Incorrect usage of "or" triggered by Perl 5.16 in stage changed to
intended meaning (and minor refactoring).

2016-09-08:
====

* New configuration file entry "statistics_file" needs to point to
  location of statistics file, where JSON entries are written to for
  each request for later analysis.  flock and +>> is used to have
  multiple fcgid instances write to the same file without dataloss.

* New optional configuration file entry "ignored_resource_pattern"
  defines a regexp of ignored resources when logging statistics.

* Remove temporary time logging

2014-12-15:
====

 * ini-files are now expected to be next to a symbolic link
   pointing to check.pl.  If the symbolic link is named "/foo/a.pl",
   the ini-file is "/foo/a.ini".

 * The cause for a given rejection is printed to STDERR which goes
   in the Apache error_log.

 * (TEMPORARY) The time taken to do the memcached lookup is
   unconditionally logged to STDERR.

 * (TEMPORARY) The total time taken in our code is unconditionally
   logged to STDERR.

Known issues:
----

 * Currently supports exactly _one_ memcached server.

 * Performance scripts are single threaded.


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

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
package proguard.classfile.editor;

import proguard.classfile.*;
import proguard.classfile.attribute.*;
import proguard.classfile.attribute.annotation.*;
import proguard.classfile.attribute.annotation.visitor.*;
import proguard.classfile.attribute.visitor.AttributeVisitor;
import proguard.classfile.constant.*;
import proguard.classfile.constant.visitor.ConstantVisitor;
import proguard.classfile.util.*;
import proguard.classfile.visitor.*;

/**
 * This ClassVisitor fixes constant pool field and method references to fields
 * and methods whose names or descriptors have changed.
 *
 * @author Eric Lafortune
 */
public class MemberReferenceFixer
extends      SimplifiedVisitor
implements   ClassVisitor,
             ConstantVisitor,
             MemberVisitor,
             AttributeVisitor,
             AnnotationVisitor,
             ElementValueVisitor
{
    private static final boolean DEBUG = false;

    private final StackSizeUpdater stackSizeUpdater = new StackSizeUpdater();

    // Parameter for the visitor methods.
    private int constantIndex;

    // Return values for the visitor methods.
    private boolean isInterfaceMethod;
    private boolean stackSizesMayHaveChanged;

    // Implementations for ClassVisitor.

    public void visitProgramClass(ProgramClass programClass)
    {
        stackSizesMayHaveChanged = false;

        // Fix the constant pool entries.
        for (int index = 1; index < programClass.u2constantPoolCount; index++)
        {
            Constant constant = programClass.constantPool[index];
            if (constant != null)
            {
                // Fix the entry, replacing it entirely if needed.
                this.constantIndex = index;

                constant.accept(programClass, this);
            }
        }

        // Fix the class members.
        programClass.fieldsAccept(this);
        programClass.methodsAccept(this);

        // Fix the attributes.
        programClass.attributesAccept(this);
    }

    // Implementations for ConstantVisitor.

    public void visitAnyConstant(Clazz clazz, Constant constant) {}

    public void visitStringConstant(Clazz clazz, StringConstant stringConstant)
    {
        // Does the string refer to a class member, due to a
        // Class.get[Declared]{Field,Method} construct?
        Member referencedMember = stringConstant.referencedMember;
        if (referencedMember != null)
        {
            Clazz referencedClass = stringConstant.referencedClass;

            // Does it have a new name?
            String newName = referencedMember.getName(referencedClass);

            if (!stringConstant.getString(clazz).equals(newName))
            {
                if (DEBUG)
                {
                    debug(clazz, stringConstant, referencedClass, referencedMember);
                }

                // Update the name.
                stringConstant.u2stringIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newName);
            }
        }
    }

    public void visitFieldrefConstant(Clazz clazz, FieldrefConstant fieldrefConstant)
    {
        // Do we know the referenced field?
        Member referencedMember = fieldrefConstant.referencedMember;
        if (referencedMember != null)
        {
            Clazz referencedClass = fieldrefConstant.referencedClass;

            // Does it have a new name or type?
            String newName = referencedMember.getName(referencedClass);
            String newType = referencedMember.getDescriptor(referencedClass);

            if (!fieldrefConstant.getName(clazz).equals(newName) ||
                !fieldrefConstant.getType(clazz).equals(newType))
            {
                if (DEBUG)
                {
                    debug(clazz, fieldrefConstant, referencedClass, referencedMember);
                }

                // Update the name and type index.
                fieldrefConstant.u2nameAndTypeIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addNameAndTypeConstant(newName, newType);
            }
        }
    }

    public void visitInterfaceMethodrefConstant(Clazz clazz, InterfaceMethodrefConstant interfaceMethodrefConstant)
    {
        // Do we know the referenced interface method?
        Member referencedMember = interfaceMethodrefConstant.referencedMember;
        if (referencedMember != null)
        {
            Clazz referencedClass = interfaceMethodrefConstant.referencedClass;

            // Does it have a new name or type?
            String newName = referencedMember.getName(referencedClass);
            String newType = referencedMember.getDescriptor(referencedClass);

            if (!interfaceMethodrefConstant.getName(clazz).equals(newName) ||
                !interfaceMethodrefConstant.getType(clazz).equals(newType))
            {
                if (DEBUG)
                {
                    debug(clazz, interfaceMethodrefConstant, referencedClass, referencedMember);
                }

                // Update the name and type index.
                interfaceMethodrefConstant.u2nameAndTypeIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addNameAndTypeConstant(newName, newType);

                // Remember that the stack sizes of the methods in this class
                // may have changed.
                stackSizesMayHaveChanged = true;
            }

            // Check if this is an interface method.
            isInterfaceMethod = true;
            clazz.constantPoolEntryAccept(interfaceMethodrefConstant.u2classIndex, this);

            // Has the method become a non-interface method?
            if (!isInterfaceMethod)
            {
                if (DEBUG)
                {
                    System.out.println("MemberReferenceFixer:");
                    System.out.println("  Class file     = "+clazz.getName());
                    System.out.println("  Ref class      = "+referencedClass.getName());
                    System.out.println("  Ref method     = "+interfaceMethodrefConstant.getName(clazz)+interfaceMethodrefConstant.getType(clazz));
                    System.out.println("    -> ordinary method");
                }

                // Replace the interface method reference by a method reference.
                ((ProgramClass)clazz).constantPool[this.constantIndex] =
                    new MethodrefConstant(interfaceMethodrefConstant.u2classIndex,
                                          interfaceMethodrefConstant.u2nameAndTypeIndex,
                                          referencedClass,
                                          referencedMember);
            }
        }
    }

    public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
    {
        // Do we know the referenced method?
        Member referencedMember = methodrefConstant.referencedMember;
        if (referencedMember != null)
        {
            Clazz referencedClass = methodrefConstant.referencedClass;

            // Does it have a new name or type?
            String newName = referencedMember.getName(referencedClass);
            String newType = referencedMember.getDescriptor(referencedClass);

            if (!methodrefConstant.getName(clazz).equals(newName) ||
                !methodrefConstant.getType(clazz).equals(newType))
            {
                if (DEBUG)
                {
                    debug(clazz, methodrefConstant, referencedClass, referencedMember);
                }

                // Update the name and type index.
                methodrefConstant.u2nameAndTypeIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addNameAndTypeConstant(newName, newType);

                // Remember that the stack sizes of the methods in this class
                // may have changed.
                stackSizesMayHaveChanged = true;
            }

            // Check if this is an interface method.
            isInterfaceMethod = false;
            clazz.constantPoolEntryAccept(methodrefConstant.u2classIndex, this);

            // Has the method become an interface method?
            if (isInterfaceMethod)
            {
                if (DEBUG)
                {
                    System.out.println("MemberReferenceFixer:");
                    System.out.println("  Class file     = "+clazz.getName());
                    System.out.println("  Ref class      = "+referencedClass.getName());
                    System.out.println("  Ref method     = "+methodrefConstant.getName(clazz)+methodrefConstant.getType(clazz));
                    System.out.println("    -> interface method");
                }

                // Replace the method reference by an interface method reference.
                ((ProgramClass)clazz).constantPool[this.constantIndex] =
                    new InterfaceMethodrefConstant(methodrefConstant.u2classIndex,
                                                   methodrefConstant.u2nameAndTypeIndex,
                                                   referencedClass,
                                                   referencedMember);
            }
        }
    }

    public void visitClassConstant(Clazz clazz, ClassConstant classConstant)
    {
        // Check if this class entry is an array type.
        if (ClassUtil.isInternalArrayType(classConstant.getName(clazz)))
        {
            isInterfaceMethod = false;
        }
        else
        {
            // Check if this class entry refers to an interface class.
            Clazz referencedClass = classConstant.referencedClass;
            if (referencedClass != null)
            {
                isInterfaceMethod = (referencedClass.getAccessFlags() & ClassConstants.ACC_INTERFACE) != 0;
            }
        }
    }

    // Implementations for MemberVisitor.

    public void visitProgramMember(ProgramClass programClass, ProgramMember programMember)
    {
        // Fix the attributes.
        programMember.attributesAccept(programClass, this);
    }

    // Implementations for AttributeVisitor.

    public void visitAnyAttribute(Clazz clazz, Attribute attribute) {}

    public void visitEnclosingMethodAttribute(Clazz clazz, EnclosingMethodAttribute enclosingMethodAttribute)
    {
        Member referencedMember = enclosingMethodAttribute.referencedMethod;
        if (referencedMember != null)
        {
            Clazz referencedClass = enclosingMethodAttribute.referencedClass;

            // Does it have a new name or type?
            String newName = referencedMember.getName(referencedClass);
            String newType = referencedMember.getDescriptor(referencedClass);

            if (!enclosingMethodAttribute.getName(clazz).equals(newName) ||
                !enclosingMethodAttribute.getType(clazz).equals(newType))
            {
                // Update the name and type index.
                enclosingMethodAttribute.u2nameAndTypeIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addNameAndTypeConstant(newName,
                                                                                newType);
            }
        }
    }

    public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
    {
        // Recompute the maximum stack size if necessary.
        if (stackSizesMayHaveChanged)
        {
            stackSizeUpdater.visitCodeAttribute(clazz, method, codeAttribute);
        }

        // Fix the nested attributes.
        codeAttribute.attributesAccept(clazz, method, this);
    }

    public void visitAnyAnnotationsAttribute(Clazz clazz, AnnotationsAttribute annotationsAttribute)
    {
        // Fix the annotations.
        annotationsAttribute.annotationsAccept(clazz, this);
    }

    public void visitAnyParameterAnnotationsAttribute(Clazz clazz, Method method, ParameterAnnotationsAttribute parameterAnnotationsAttribute)
    {
        // Fix the annotations.
        parameterAnnotationsAttribute.annotationsAccept(clazz, method, this);
    }

    public void visitAnnotationDefaultAttribute(Clazz clazz, Method method, AnnotationDefaultAttribute annotationDefaultAttribute)
    {
        // Fix the annotation.
        annotationDefaultAttribute.defaultValueAccept(clazz, this);
    }

    // Implementations for AnnotationVisitor.

    public void visitAnnotation(Clazz clazz, Annotation annotation)
    {
        // Fix the element values.
        annotation.elementValuesAccept(clazz, this);
    }

    // Implementations for ElementValueVisitor.

    public void visitConstantElementValue(Clazz clazz, Annotation annotation, ConstantElementValue constantElementValue)
    {
        fixElementValue(clazz, annotation, constantElementValue);
    }

    public void visitEnumConstantElementValue(Clazz clazz, Annotation annotation, EnumConstantElementValue enumConstantElementValue)
    {
        fixElementValue(clazz, annotation, enumConstantElementValue);
    }

    public void visitClassElementValue(Clazz clazz, Annotation annotation, ClassElementValue classElementValue)
    {
        fixElementValue(clazz, annotation, classElementValue);
    }

    public void visitAnnotationElementValue(Clazz clazz, Annotation annotation, AnnotationElementValue annotationElementValue)
    {
        fixElementValue(clazz, annotation, annotationElementValue);

        // Fix the annotation.
        annotationElementValue.annotationAccept(clazz, this);
    }

    public void visitArrayElementValue(Clazz clazz, Annotation annotation, ArrayElementValue arrayElementValue)
    {
        fixElementValue(clazz, annotation, arrayElementValue);

        // Fix the element values.
        arrayElementValue.elementValuesAccept(clazz, annotation, this);
    }

    // Small utility methods.

    /**
     * Fixes the method reference of the element value, if any.
     */
    private void fixElementValue(Clazz        clazz,
                                 Annotation   annotation,
                                 ElementValue elementValue)
    {
        // Do we know the referenced method?
        Member referencedMember = elementValue.referencedMethod;
        if (referencedMember != null)
        {
            // Does it have a new name or type?
            String methodName    = elementValue.getMethodName(clazz);
            String newMethodName = referencedMember.getName(elementValue.referencedClass);

            if (!methodName.equals(newMethodName))
            {
                // Update the element name index.
                elementValue.u2elementNameIndex =
                    new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newMethodName);
            }
        }
    }

    private void debug(Clazz          clazz,
                       StringConstant stringConstant,
                       Clazz          referencedClass,
                       Member         referencedMember)
    {
        System.out.println("MemberReferenceFixer:");
        System.out.println("  ["+clazz.getName()+"]: String ["+
                           stringConstant.getString(clazz)+"] -> ["+
                           referencedClass.getName()+"."+referencedMember.getName(referencedClass)+" "+referencedMember.getDescriptor(referencedClass)+"]");
    }

    private void debug(Clazz       clazz,
                       RefConstant refConstant,
                       Clazz       referencedClass,
                       Member      referencedMember)
    {
        System.out.println("MemberReferenceFixer:");
        System.out.println("  ["+clazz.getName()+"]: ["+
                           refConstant.getClassName(clazz)+"."+refConstant.getName(clazz)+" "+refConstant.getType(clazz)+"] -> ["+
                           referencedClass.getName()+"."+referencedMember.getName(referencedClass)+" "+referencedMember.getDescriptor(referencedClass)+"]");
    }
}


text:
<?php

namespace Titon\Db\Pgsql\Type;

/**
 * Represents a timestamp with a time zone.
 *
 * @package Titon\Db\Pgsql\Type
 */
class DatetimeTzType extends \Titon\Db\Driver\Type\DatetimeType {

    /**
     * {@inheritdoc}
     */
    public $format = 'Y-m-d H:i:sO';

    /**
     * {@inheritdoc}
     */
    public function getName() {
        return self::DATETIME . 'tz';
    }

}


text:
layout: page_2020
---

# A3: Play with Extraction

Updates:

3/19: we extend the deadline to Apr 1 11:59PM

Due: Apr 1 11:59PM (EST)

In this assignment, you will try out interfaces for data and text extraction.

## Wrangler: text extraction

Trifacta Wrangler is an interface that employs a programming-by-example interaction modality.

Datasets:

[2013films.txt](/files/hdisys/2013films.txt):  A dataset of all the movies in 2013 from January to March. It contains Movie name, Production house, Genre, Publisher and other details.

Access [Trifacta for students from their website](https://www.trifacta.com/start-wrangling/).

Some tips using Wrangler:

* Check out the introduction [video](https://vimeo.com/19185801) to get a feel of how wrangler works.
* You may wanna start off by loading ~50 lines of data instead of the entire files and play around with the tool.
* Wrangler responds to mouse highlights and clicks on the displayed table cells by suggesting operations on the left sidebar.
* Hovering over each element shows the result in the table view.
* Clicking adds the operation.
* Clear the sidebar by clicking the colored row above the schema row.

#### Your Task

Load the 2013films dataset into Wrangler, and then use the tool to generate output as follows, i.e., Movie name, Production/Distribution house, Director, Genre and publisher.

	A dark truth, Magnolia Pictures, Damian Lee, Action,ComingSoon.net
	Table No. 21, Eros International, Aditya Datt, Thriller, BoxOfficeMojo.com
	[...more rows...]

For the purpose of explanation columns are separated by `||`. You can choose any pattern to extract information.

1. Movie name can be identified as first column in every line formatted as ``[[ <movie name> ]]``
1. Production/Distribution house is the following column that is formatted as ``[[< Production house>]]``
1. Director name can be identified with `(director)` tag that follows the name. Just extracting one name near the tag would be enough.
1. Genre is present in the next column but make sure to extract only second part that is separated by the `|` operator. For eg. in `[Action film|Action]` relevant information is Action
1. Publisher name can be identified in the last column with format `publisher=<publisher name>`
1. It may help to skip first few lines that contains html code, so that you process actual records.

#### Questions

* Use wrangler to clean the data, then determine
  * Which Production/Distribution house produced maximum movies.
  * What is the most popular genre.
* Share your experience with Trifacta. Which part of the cleaning procedure does it make easier? Which part is hard? Any comments on Trifacta, pros or cons or further improvements.

#### Notes

* Your wrangler script is not expected to be sophisticated enough to generate the results for the question asked. It just needs to clean/combine the data enough for you to observe the data and answer the question.

#### Files you need to submit

* _Recipe and Data_ You need to download the wrangler "recipe" (script) and "sample data as csv" as follows: The recipe is simply a text file with a sequence of transformations. And the sample is your final table.
  *
* _Screenshot and Short Answers in One pdf file_  You need to create a screenshot of your dashboard like below. Make sure the picture/pictures includes ALL your recipe steps. Then, insert your sceenshot in your pdf file and answer the question above.
  *

## Instabase: text extraction from PDF/images

This assignment will introduce you to another state of the art document extraction application called Refiner.
It provides a visual-programming interface for writing and debugging document extraction programs.

As with the Draco assignment, the point is to get experience with another text extraction modality.
Do you best to form an opinion about what you like, and what would be great for future tools to solve.

**Refiner V5 is in beta.  So if you encounter a bug, click save and refresh the page.  Contact the staff if you hit issues that are hard to resolve**

#### Setup

First create an account on the instabase website below (note that this URL is special for this class).
The service is still in beta, so there are some weird hurdles, such as editing the url:

* Go to [https://www.instabase.com/account/register?use_token=true](https://www.instabase.com/account/register?use_token=true)
* USE THE FOLLOWING TOKEN IN ORDER TO REGISTER: `ewu-columbia-2020`
* Make sure you sign up with your `AB1235@columbia email`!!!
* If you did not register using the token, you can still enter the token at this login page: https://www.instabase.com/account/login?use_token=true

Create a workspace

* Click on the icon in the upper left, and go to workspaces. Choose _public_ workspace.
* In the right, click New Workspace and name it whatever you want.

The tool we will be using is called Refiner 5, which is in beta.  You need to enable beta apps as followings:

* Once you are in your workspace, click on the icon in the upper left and then click "Apps".
  The url should end with `<your username>/<your workspace>/apps`
* Change `apps` in the url into `beta-apps`.
* Now you will be able to use Refiner 5.

Now you will copy the assignment into your workspace

* go to [https://dogfood.instabase.com/ewu/hdi20seminar/fs/Instabase%20Drive/](https://dogfood.instabase.com/ewu/hdi20seminar/fs/Instabase%20Drive/)
* right click and copy `ADP assignment` and `Gusto assignment` into your account's workspace

#### Loading refiner

First, let's open refiner and extract data from the ADP paystubs

* Go to your account's workspace
* Click on `ADP assignment`.  The page should look like the following image
  *
* **THIS IS THE KEY STEP**: edit the URL by replacing `www.instabase.com` with `dogfood.instabase.com`.
  This is needed to use the current version of Refiner.
* Click on `Edit` under `Edit Refiner V5 Program`.   You should see something like the following:

#### The Refiner Interface

Let's walk through the interface!  There are 5 main parts

1. This lists the documens we've loaded.  You can click `Output Table` to see all of your extracted fields as columns, and each document as row.
2. This shows the current document you are extracting.
   * Refiner works by letting you define "anchors" which are fixed locations in the document that you can reference to extract nearby text.
     The blue and red boxes correspond to the "anchor" and the extracted text for the current field you are defining, respectively.
   * To the right of the red "2" circle, you can click on the "A" button to see the extracted OCR text.
      Notice that its spacing is consistent with the document image.
      This text is the variable `INPUT_COL` that you will write extraction programs from.
3. This panel lists the fields that you wish to extract.  As examples, we have defined three already.
   * `thisperiodleft` defines a field that looks for the first instance of the string `this period` and finds the left position of its bounding box.
   * `thisperiodright` finds the right position of the string's bounding box.
   * `Medicare` defines a field that looks for the string `Medicare Tax` as an anchor, and extracts all the text ot the right of the anchor
     that are between `thisperiodleft` and `thisperiodright`.  Thus it extracts `-25.88` rather than the entire row of text.
   * Note the "save" button in the right!  Refiner does NOT autosave, so you need to click it often :)
4. This is where you define the extraction function for a field.  For this assignment you will primarily use the following functions:
   * `scan_right`, `scan_below`, `left_pos`, `right_pos`
   * Functions can be nested within each other
5. This shows the documentation for the functions you are currently writing.  There are 3 useful tabs
   * "Function" shows the function documentation
   * "Output" shows the result of running the function on the current document
   * "Run": you need to click this before there is an output.

There are two useful documentations to help you

* [A walkthrough of refiner](../files/hdisys/refiner-walkthrough.pdf) provides a mental model of how refiner works.
* [API reference of refiner functions](https://dogfood.instabase.com/docs/reference/refiner/parsing-functions/).  There are a ton of refiner functions beyond the ones we mentioned above.

#### Your Task

Note: if you meet the issue that (XXX is not found in the table), click the arrow near `<Run>` button and use `<Run all>` instead.

##### ADP Assignment:

Write additional fields to extract the year-to-date federal income tax, the social security tax, and the net pay for each document.

##### Gusto Assignment:

Write fields to extract the

* The current gross earnings from employee earnings table.
* The current guideline traditional 401(k) from employee deduction.
* The remaining paid time off balance from the paid time off policy.

##### Question:

* How this tool differs from the paper's? Any advantages or disadvantages?

* What features and reserach problems do you think would be useful in the future?

#### How to submit this task

For ADP and Gusto assignment, just paste your workspace link in your pdf file.  Also, write your answer to the questions in the pdf.

Note: To find your workspace link, click on the icon in the upper left, then workspace. Choose your workspace containing the assignments and copy link from url bar. The link ends with `<your username>/<your workspace>` + "/fs/Instabase%20Drive/".

# Submission Instructions

#### Read BEFORE Submitting

* You need to submit 3 files:
  * Recipe log(.wrangle)
  * Final data table(.csv)
  * Pdf File includes all question answers and url(.pdf)
* Zip these three files and name it "NAME_UNI_A3.zip"

#### Submission Link

[https://www.dropbox.com/request/HerKJnYpm1satGNRyGz9](https://www.dropbox.com/request/HerKJnYpm1satGNRyGz9)


text:
package com.amazonaws.services.connectcases.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS
 *      API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SearchRelatedItemsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * A unique identifier of the case.
     *

     */
    private String caseId;
    /**
     *

     * The unique identifier of the Cases domain.
     *

     */
    private String domainId;
    /**
     *

     * The list of types of related items and their parameters to use for filtering.
     *

     */
    private java.util.List<RelatedItemTypeFilter> filters;
    /**
     *

     * The maximum number of results to return per page.
     *

     */
    private Integer maxResults;
    /**
     *

     * The token for the next set of results. Use the value returned in the previous response in the next request to
     * retrieve the next set of results.
     *

     */
    private String nextToken;

    /**
     *

     * A unique identifier of the case.
     *

     *
     * @param caseId
     *        A unique identifier of the case.
     */

    public void setCaseId(String caseId) {
        this.caseId = caseId;
    }

    /**
     *

     * A unique identifier of the case.
     *

     *
     * @return A unique identifier of the case.
     */

    public String getCaseId() {
        return this.caseId;
    }

    /**
     *

     * A unique identifier of the case.
     *

     *
     * @param caseId
     *        A unique identifier of the case.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withCaseId(String caseId) {
        setCaseId(caseId);
        return this;
    }

    /**
     *

     * The unique identifier of the Cases domain.
     *

     *
     * @param domainId
     *        The unique identifier of the Cases domain.
     */

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    /**
     *

     * The unique identifier of the Cases domain.
     *

     *
     * @return The unique identifier of the Cases domain.
     */

    public String getDomainId() {
        return this.domainId;
    }

    /**
     *

     * The unique identifier of the Cases domain.
     *

     *
     * @param domainId
     *        The unique identifier of the Cases domain.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withDomainId(String domainId) {
        setDomainId(domainId);
        return this;
    }

    /**
     *

     * The list of types of related items and their parameters to use for filtering.
     *

     *
     * @return The list of types of related items and their parameters to use for filtering.
     */

    public java.util.List<RelatedItemTypeFilter> getFilters() {
        return filters;
    }

    /**
     *

     * The list of types of related items and their parameters to use for filtering.
     *

     *
     * @param filters
     *        The list of types of related items and their parameters to use for filtering.
     */

    public void setFilters(java.util.Collection<RelatedItemTypeFilter> filters) {
        if (filters == null) {
            this.filters = null;
            return;
        }

        this.filters = new java.util.ArrayList<RelatedItemTypeFilter>(filters);
    }

    /**
     *

     * The list of types of related items and their parameters to use for filtering.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setFilters(java.util.Collection)} or {@link #withFilters(java.util.Collection)} if you want to override
     * the existing values.
     *

     *
     * @param filters
     *        The list of types of related items and their parameters to use for filtering.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withFilters(RelatedItemTypeFilter... filters) {
        if (this.filters == null) {
            setFilters(new java.util.ArrayList<RelatedItemTypeFilter>(filters.length));
        }
        for (RelatedItemTypeFilter ele : filters) {
            this.filters.add(ele);
        }
        return this;
    }

    /**
     *

     * The list of types of related items and their parameters to use for filtering.
     *

     *
     * @param filters
     *        The list of types of related items and their parameters to use for filtering.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withFilters(java.util.Collection<RelatedItemTypeFilter> filters) {
        setFilters(filters);
        return this;
    }

    /**
     *

     * The maximum number of results to return per page.
     *

     *
     * @param maxResults
     *        The maximum number of results to return per page.
     */

    public void setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
    }

    /**
     *

     * The maximum number of results to return per page.
     *

     *
     * @return The maximum number of results to return per page.
     */

    public Integer getMaxResults() {
        return this.maxResults;
    }

    /**
     *

     * The maximum number of results to return per page.
     *

     *
     * @param maxResults
     *        The maximum number of results to return per page.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withMaxResults(Integer maxResults) {
        setMaxResults(maxResults);
        return this;
    }

    /**
     *

     * The token for the next set of results. Use the value returned in the previous response in the next request to
     * retrieve the next set of results.
     *

     *
     * @param nextToken
     *        The token for the next set of results. Use the value returned in the previous response in the next request
     *        to retrieve the next set of results.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * The token for the next set of results. Use the value returned in the previous response in the next request to
     * retrieve the next set of results.
     *

     *
     * @return The token for the next set of results. Use the value returned in the previous response in the next
     *         request to retrieve the next set of results.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * The token for the next set of results. Use the value returned in the previous response in the next request to
     * retrieve the next set of results.
     *

     *
     * @param nextToken
     *        The token for the next set of results. Use the value returned in the previous response in the next request
     *        to retrieve the next set of results.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public SearchRelatedItemsRequest withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getCaseId() != null)
            sb.append("CaseId: ").append(getCaseId()).append(",");
        if (getDomainId() != null)
            sb.append("DomainId: ").append(getDomainId()).append(",");
        if (getFilters() != null)
            sb.append("Filters: ").append(getFilters()).append(",");
        if (getMaxResults() != null)
            sb.append("MaxResults: ").append(getMaxResults()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof SearchRelatedItemsRequest == false)
            return false;
        SearchRelatedItemsRequest other = (SearchRelatedItemsRequest) obj;
        if (other.getCaseId() == null ^ this.getCaseId() == null)
            return false;
        if (other.getCaseId() != null && other.getCaseId().equals(this.getCaseId()) == false)
            return false;
        if (other.getDomainId() == null ^ this.getDomainId() == null)
            return false;
        if (other.getDomainId() != null && other.getDomainId().equals(this.getDomainId()) == false)
            return false;
        if (other.getFilters() == null ^ this.getFilters() == null)
            return false;
        if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == false)
            return false;
        if (other.getMaxResults() == null ^ this.getMaxResults() == null)
            return false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getCaseId() == null) ? 0 : getCaseId().hashCode());
        hashCode = prime * hashCode + ((getDomainId() == null) ? 0 : getDomainId().hashCode());
        hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode());
        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        return hashCode;
    }

    @Override
    public SearchRelatedItemsRequest clone() {
        return (SearchRelatedItemsRequest) super.clone();
    }

}


text:
using Machine.Specifications;
using ShopifySharp.Filters;
using ShopifySharp.Tests.ShopifyCollectService_Tests.Test_Data;
using System.Collections.Generic;
using System.Linq;

namespace ShopifySharp.Tests.ShopifyCollectService_Tests
{
    [Subject(typeof(ShopifyCollectService))]
    class When_listing_collects_with_a_filter
    {
        Establish context = () =>
        {
            Service = new ShopifyCollectService(Utils.MyShopifyUrl, Utils.AccessToken);

            for (var i = 0; i <3 ; i++)
            {
                var product = CollectCreation.CreateProduct().Await().AsTask.Result;
                var collect = Service.CreateAsync(new ShopifyCollect()
                {
                    CollectionId = CollectCreation.CollectionId,
                    ProductId = product.Id.Value
                }).Await().AsTask.Result;

                Products.Add(product);
                Created.Add(collect);
            }
        };

        Because of = () =>
        {
            Result = Service.ListAsync(new ShopifyCollectFilter()
            {
                ProductId = Products[0].Id.Value
            }).Await().AsTask.Result;
        };

        It should_list_collects_with_a_filter = () =>
        {
            Result.ShouldNotBeNull();
            Result.Count().ShouldBeGreaterThanOrEqualTo(1);
            Result.All(c => c.ProductId == Products[0].Id.Value).ShouldBeTrue();
        };

        Cleanup after = () =>
        {
            foreach (var collect in Created)
            {
                Service.DeleteAsync(collect.Id.Value).Await();
            }

            foreach (var product in Products)
            {
                CollectCreation.DeleteProduct(product.Id.Value).Await();
            }
        };

        static ShopifyCollectService Service;

        static List<ShopifyCollect> Created = new List<ShopifyCollect>();

        static List<ShopifyProduct> Products = new List<ShopifyProduct>();

        static IEnumerable<ShopifyCollect> Result;
    }
}


text:
| English | Bahasa Indonesia |
|-|-|
| Valid | Berlaku; Sah |
| vCard | vCard |
| Version | Versi |
| Vertical | Vertikal |
| Video conferencing | Konferensi video |
| Video text | Teks video |
| View | Lihat; tilik |
| View data | Lihat data |
| Viewing screen | Layar lihat |
| Voice mail | Surat suara |
| Vote | Pilih |
| Voting | Suara; Pemilihan |

[← Kembali](../)


text:
/*global chai*/
window.expect = chai.expect;


text:
module Spree
    module Admin
        class PastReport
            def initialize(product_id, sum_target_revenue, weekly_target_revenue, weekly_revenue, cumulative_weekly_revenue,
                           weekly_margin, cumulative_weekly_margin, inventory_positions, cumulative_last_year_revenue,weekly_last_year_revenue,from_date,
                          stats_report)
                @product_id = product_id
                @sum_target_revenue = sum_target_revenue
                @weekly_target_revenue = weekly_target_revenue
                @weekly_revenue = weekly_revenue
                @cumulative_weekly_revenue = cumulative_weekly_revenue
                @weekly_margin =  weekly_margin
                @cumulative_weekly_margin = cumulative_weekly_margin
                @inventory_positions = inventory_positions
                @cumulative_last_year_revenue = cumulative_last_year_revenue
                @weekly_last_year_revenue = weekly_last_year_revenue
                @from_date = from_date
                @stats_report = stats_report
            end
        end
    end
end


text:
using System;
using System.ComponentModel.DataAnnotations;

namespace Toscana.Common
{
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    internal class RestrictedValuesAttribute : ValidationAttribute
    {
        private readonly string[] validValues;

        public RestrictedValuesAttribute(string[] validValues)
            : this(validValues, "Specified value is not one of the valid values: " + string.Join(", ", validValues))
        {
            this.validValues = validValues;
        }

        public RestrictedValuesAttribute(string[] validValues, string errorMessage) :
            this(validValues, () => errorMessage)
        {
        }

        protected RestrictedValuesAttribute(string[] validValues, Func<string> errorMessageAccessor)
            : base(errorMessageAccessor)
        {
            this.validValues = validValues;
        }

        protected override ValidationResult IsValid(object value, ValidationContext validationContext)
        {
            if (((string) value).EqualsAny(validValues))
            {
                return ValidationResult.Success;
            }

            return new ValidationResult(ErrorMessage, new[] {validationContext.MemberName});
        }
    }
}


text:
from m5.objects import *
from alpha_generic import *

root = LinuxAlphaFSSystemUniprocessor(mem_mode='timing',
                                      mem_class=DDR3_1600_x64,
                                      cpu_class=TimingSimpleCPU).create_root()


text:
//
//  NSBundle+Categories.h
//  XLFCommonKit
//
//  Created by Marike Jave on 14-10-27.
//  Copyright (c) 2014年 Marike Jave. All rights reserved.
//

#import "NSBundle+Categories.h"
#import "CategoryMacros.h"

CategoryKit_LoadCategory(NSBundle_Categories)

@implementation NSBundle(Categories)

+ (void)load{
    [super load];
    NSLog(@"%@", [[[NSBundle mainBundle] infoDictionary] description]);
}

/**
 *  获取应用名称
 *  @return 应用名称
 */

+ (NSString *)bundleDisplayName{

    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];//获取info-plist
}

/**
 *  获取应用标识号
 *  @return 标识号
 */

+ (NSString *)bundleIdentifier{

    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];//获取info-plist
}

/**
 *  获取应用版本
 *  @return 版本号
 */

+ (NSString *)appVersion{

    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];//获取info-plist
}

/**
 *  获取Bundle版本
 *  @return 版本号
 */

+ (NSString *)bundleVersion;{

    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];//获取info-plist
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2016, WSO2 Inc. (http://wso2.com) All Rights Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.wso2.carbon.security.caas</groupId>
        <artifactId>org.wso2.carbon.security.caas.parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>org.wso2.carbon.security.caas.feature</artifactId>

    <packaging>carbon-feature</packaging>
    <name>WSO2 Carbon Security CAAS - Feature</name>
    <url>http://wso2.org</url>
    <description>This feature contains the core bundles required by the Carbon Security feature
    </description>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.security.caas</groupId>
            <artifactId>org.wso2.carbon.security.caas.boot</artifactId>
            <version>${carbon.security.caas.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.security.caas</groupId>
            <artifactId>org.wso2.carbon.security.caas</artifactId>
            <version>${carbon.security.caas.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.security.caas</groupId>
            <artifactId>org.wso2.carbon.security.caas.userstore.filebased</artifactId>
            <version>${carbon.security.caas.version}</version>
        </dependency>
        <dependency>
            <groupId>net.minidev.wso2</groupId>
            <artifactId>json-smart</artifactId>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prefilter-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>resources</directory>
                                    <includes>
                                        <include>conf/carbon-jaas.config</include>
                                        <include>conf/permissions.yml</include>
                                        <include>conf/security.policy</include>
                                        <include>conf/store-config.yml</include>
                                        <include>conf/claim-store.yml</include>
                                        <include>conf/domain-config.yml</include>
                                        <include>conf/user-mapping.csv</include>
                                        <include>conf/identity-store-connector.csv</include>
                                        <include>conf/credential-store-connector.csv</include>
                                        <include>p2.inf</include>
                                        <include>build.properties</include>

                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.carbon.maven</groupId>
                <artifactId>carbon-feature-plugin</artifactId>
                <version>${carbon.feature.plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>1-p2-feature-generation</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <propertyFile>etc/feature.properties</propertyFile>
                            <adviceFileContents>
                                <advice>
                                    <name>org.wso2.carbon.p2.category.type</name>
                                    <value>server</value>
                                </advice>
                                <advice>
                                    <name>org.eclipse.equinox.p2.type.group</name>
                                    <value>false</value>
                                </advice>
                            </adviceFileContents>
                            <bundles>
                                <bundle>
                                    <symbolicName>org.wso2.carbon.security.caas.boot</symbolicName>
                                    <version>${carbon.security.caas.version}</version>
                                </bundle>
                                <bundle>
                                    <symbolicName>org.wso2.carbon.security.caas</symbolicName>
                                    <version>${carbon.security.caas.version}</version>
                                </bundle>
                                <bundle>
                                    <symbolicName>org.wso2.carbon.security.caas.userstore.filebased</symbolicName>
                                    <version>${carbon.security.caas.version}</version>
                                </bundle>
                                <bundle>
                                    <symbolicName>json-smart</symbolicName>
                                    <version>${json.smart.version}</version>
                                </bundle>
                            </bundles>
                            <importFeatures>
                                <feature>
                                    <id>org.wso2.carbon.messaging.feature</id>
                                    <version>${org.wso2.carbon.messaging.version}</version>
                                </feature>
                                <feature>
                                    <id>org.wso2.carbon.caching.feature</id>
                                    <version>${org.wso2.carbon.caching.version}</version>
                                </feature>
                            </importFeatures>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean_target</id>
                        <phase>install</phase>
                        <configuration>
                            <target>
                                <delete dir="src/main/resources" />
                                <delete dir="src/main" />
                                <delete dir="src" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>OpenNI 1.5.7: Capabilities Mechanism</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

OpenNI 1.5.7

Main Page

Related Pages

Modules

Namespaces

Classes

Files

OpenNI Overview

Concepts

Capabilities Mechanism

OpenNI defines core functionality which is always supported by all node implementations of a specific node type. Additional optional functionality is also defined by OpenNI and exposed as "capabilities". The xn::ProductionNode class provides the IsCapabilitySupported() method to check if this specific implementation supports a certain capability.

In summary, there are two separate functionality sets:

Obligatory functionality that is accessible through the methods provided by the principle OpenNI production node classes, i.e., the ProductionNode class and its derivatives. Developers wishing to implement their own nodes are obliged to implement these functionalities (events, methods, etc.)

Optional functionality that is accessible through the capabilities mechanism. The developers can optionally implement these classes and their members. The capability's functionality is then accessible through the capability's name. OpenNI supports a defined list of optional capabilities.

An example of a capability is the MirrorCapability class. When this capability is supported by any particular production node, the application can call its SetMirror() method.

<address class="footer">
Generated on Tue Nov 12 2013 13:40:21 for OpenNI 1.5.7 by

 1.8.3.1
</address>