text:
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*  Fluent Bit
 *  ==========
 *  Copyright (C) 2015 Treasure Data Inc.
 *
 *  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.
 */

#include <stdlib.h>
#include <string.h>

#include <fluent-bit/flb_macros.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_error.h>
#include <fluent-bit/flb_utils.h>

static struct flb_input_plugin *plugin_lookup(char *name, struct flb_config *config)
{
    struct mk_list *head;
    struct flb_input_plugin *plugin;

    mk_list_foreach(head, &config->inputs) {
        plugin = mk_list_entry(head, struct flb_input_plugin, _head);
        if (strncmp(plugin->name, name, strlen(name)) == 0) {
            return plugin;
        }
    }

    return NULL;
}

/* Enable an input */
int flb_input_set(struct flb_config *config, char *name)
{
    struct flb_input_plugin *plugin;

    plugin = plugin_lookup(name, config);
    if (!plugin) {
        return -1;
    }

    plugin->active = FLB_TRUE;

    return 0;
}

/* Initialize all inputs */
void flb_input_initialize_all(struct flb_config *config)
{
    int ret;
    struct mk_list *head;
    struct flb_input_plugin *in;

    mk_list_foreach(head, &config->inputs) {
        in = mk_list_entry(head, struct flb_input_plugin, _head);
        /* Initialize the input */
        if (in->active == FLB_TRUE && in->cb_init) {
            ret = in->cb_init(config);
            if (ret != 0) {
                flb_error("Failed ininitalize input %s",
                in->name);
            }
        }
    }
}

/* Invoke all pre-run input callbacks */
void flb_input_pre_run_all(struct flb_config *config)
{
    struct mk_list *head;
    struct flb_input_plugin *in;

    mk_list_foreach(head, &config->inputs) {
        in = mk_list_entry(head, struct flb_input_plugin, _head);
        if (in->active == FLB_TRUE) {
            if (in->cb_pre_run) {
                in->cb_pre_run(in->in_context, config);
            }
        }
    }
}

/* Invoke all exit input callbacks */
void flb_input_exit_all(struct flb_config *config)
{
    struct mk_list *head;
    struct flb_input_plugin *in;

    mk_list_foreach(head, &config->inputs) {
        in = mk_list_entry(head, struct flb_input_plugin, _head);
        if (in->active == FLB_TRUE) {
            if (in->cb_exit) {
                in->cb_exit(in->in_context, config);
            }
        }
    }
}

/* Check that at least one Input is enabled */
int flb_input_check(struct flb_config *config)
{
    struct mk_list *head;
    struct flb_input_plugin *plugin;

    mk_list_foreach(head, &config->inputs) {
        plugin = mk_list_entry(head, struct flb_input_plugin, _head);
        if (plugin->active == FLB_TRUE) {
            return 0;
        }
    }

    return -1;
}

/*
 * API for Input plugins
 * =====================
 * The Input interface provides a certain number of functions that can be
 * used by Input plugins to configure it own behavior and request specific
 *
 *  1. flb_input_set_context()
 *
 *     let an Input plugin set a context data reference that can be used
 *     later when invoking other callbacks.
 *
 *  2. flb_input_set_collector_time()
 *
 *     request the Engine to trigger a specific collector callback at a
 *     certain interval time. Note that this callback will run in the main
 *     thread so it computing time must be short, otherwise it will block
 *     the main loop.
 *
 *     The collector can runs in timeouts of the order of seconds.nanoseconds
 *
 *      note: 1 Second = 1000000000 Nanosecond
 *
 *  3. flb_input_set_collector_event()
 *
 *     for a registered file descriptor, associate the READ events to a
 *     specified plugin. Every time there is some data to read, the collector
 *     callback will be triggered. Oriented to a file descriptor that already
 *     have information that may be read through iotctl(..FIONREAD..);
 *
 *  4. flb_input_set_collector_server()
 *
 *     it register a collector based on TCP socket events. It register a socket
 *     who did bind() and listen() and for each event on the socket it triggers
 *     the registered callbacks.
 */

/* Assign an Configuration context to an Input */
int flb_input_set_context(char *name, void *in_context, struct flb_config *config)
{
    struct flb_input_plugin *plugin;

    plugin = plugin_lookup(name, config);
    if (!plugin) {
        return -1;
    }

    plugin->in_context = in_context;
    return 0;
}

int flb_input_set_collector_time(char *name,
                                 int (*cb_collect) (struct flb_config *, void *),
                                 time_t seconds,
                                 long   nanoseconds,
                                 struct flb_config *config)
{
    struct flb_input_plugin *plugin;
    struct flb_input_collector *collector;

    plugin = plugin_lookup(name, config);
    if (!plugin) {
        return -1;
    }

    collector = malloc(sizeof(struct flb_input_collector));
    collector->type        = FLB_COLLECT_TIME;
    collector->cb_collect  = cb_collect;
    collector->fd_event    = -1;
    collector->fd_timer    = -1;
    collector->seconds     = seconds;
    collector->nanoseconds = nanoseconds;
    collector->plugin      = plugin;

    mk_list_add(&collector->_head, &config->collectors);
    return 0;
}

int flb_input_set_collector_event(char *name,
                                  int (*cb_collect) (struct flb_config *, void *),
                                  int fd,
                                  struct flb_config *config)
{
    struct flb_input_plugin *plugin;
    struct flb_input_collector *collector;

    plugin = plugin_lookup(name, config);
    if (!plugin) {
        return -1;
    }

    collector = malloc(sizeof(struct flb_input_collector));
    collector->type        = FLB_COLLECT_FD_EVENT;
    collector->cb_collect  = cb_collect;
    collector->fd_event    = fd;
    collector->fd_timer    = -1;
    collector->seconds     = -1;
    collector->nanoseconds = -1;
    collector->plugin      = plugin;

    mk_list_add(&collector->_head, &config->collectors);
    return 0;
}

int flb_input_set_collector_socket(char *name,
                                   int (*cb_new_connection) (struct flb_config *, void*),
                                   int fd,
                                   struct flb_config *config)
{
    struct flb_input_plugin *plugin;
    struct flb_input_collector *collector;

    plugin = plugin_lookup(name, config);
    if (!plugin) {
        return -1;
    }

    collector = malloc(sizeof(struct flb_input_collector));
    collector->type        = FLB_COLLECT_FD_SERVER;
    collector->cb_collect  = cb_new_connection;
    collector->fd_event    = fd;
    collector->fd_timer    = -1;
    collector->seconds     = -1;
    collector->nanoseconds = -1;
    collector->plugin      = plugin;

    mk_list_add(&collector->_head, &config->collectors);
    return 0;
}


text:
package com.yammer.breakerbox.azure.core;

public interface AzureTableName {
}

redpajama_set_name: RedPajamaGithub


text:
import numpy as np
import tensorflow as tf

def softmax(x):
  """
  Compute the softmax function in tensorflow.

  You might find the tensorflow functions tf.exp, tf.reduce_max,
  tf.reduce_sum, tf.expand_dims useful. (Many solutions are possible, so you may
  not need to use all of these functions). Recall also that many common
  tensorflow operations are sugared (e.g. x * y does a tensor multiplication
  if x and y are both tensors). Make sure to implement the numerical stability
  fixes as in the previous homework!

  Args:
    x:   tf.Tensor with shape (n_samples, n_features). Note feature vectors are
         represented by row-vectors. (For simplicity, no need to handle 1-d
         input as in the previous homework)
  Returns:
    out: tf.Tensor with shape (n_sample, n_features). You need to construct this
         tensor in this problem.
  """

  ### YOUR CODE HERE
  # softmax is exp(x) / sum(exp(x))
  # softmax(x+c) == softmax(x)
  # learn about the properties of our input
  print(x)
  print(x.shape)
  #sess = tf.Session()
  # since x is already a tf.Tensor it can be passed directly to the operation
  maxes = tf.reduce_max(x, axis=len(x.shape)-1, keep_dims=True)
  x = x - maxes
  exp = tf.exp(x)
  out = exp / tf.reduce_sum(exp,axis=len(x.shape)-1, keep_dims=True)
  #print(sess.run(maxes))
  #print(sess.run(x))
  #print(sess.run(exp))
  #print(sess.run(out))
  ### END YOUR CODE

  return out

def cross_entropy_loss(y, yhat):
  """
  Compute the cross entropy loss in tensorflow.

  y is a one-hot tensor of shape (n_samples, n_classes) and yhat is a tensor
  of shape (n_samples, n_classes). y should be of dtype tf.int32, and yhat should
  be of dtype tf.float32.

  The functions tf.to_float, tf.reduce_sum, and tf.log might prove useful. (Many
  solutions are possible, so you may not need to use all of these functions).

  Note: You are NOT allowed to use the tensorflow built-in cross-entropy
        functions.

  Args:
    y:    tf.Tensor with shape (n_samples, n_classes). One-hot encoded.
    yhat: tf.Tensorwith shape (n_sample, n_classes). Each row encodes a
          probability distribution and should sum to 1.
  Returns:
    out:  tf.Tensor with shape (1,) (Scalar output). You need to construct this
          tensor in the problem.
  """
  ### YOUR CODE HERE
  print(y)
  print(yhat)
  #out = - tf.reduce_sum(tf.matmul(tf.to_float(y), tf.log(yhat)))
  out = -tf.reduce_sum(tf.to_float(y) * tf.log(yhat))
  ### END YOUR CODE
  return out

def test_softmax_basic():
  """
  Some simple tests to get you started.
  Warning: these are not exhaustive.
  """
  print "Running basic tests..."
  test1 = softmax(tf.convert_to_tensor(
      np.array([[1001,1002],[3,4]]), dtype=tf.float32))
  with tf.Session():
      test1 = test1.eval()
  assert np.amax(np.fabs(test1 - np.array(
      [0.26894142,  0.73105858]))) <= 1e-6

  test2 = softmax(tf.convert_to_tensor(
      np.array([[-1001,-1002]]), dtype=tf.float32))
  with tf.Session():
      test2 = test2.eval()
  assert np.amax(np.fabs(test2 - np.array(
      [0.73105858, 0.26894142]))) <= 1e-6

  print "Basic (non-exhaustive) softmax tests pass\n"

def test_cross_entropy_loss_basic():
  """
  Some simple tests to get you started.
  Warning: these are not exhaustive.
  """
  y = np.array([[0, 1], [1, 0], [1, 0]])
  yhat = np.array([[.5, .5], [.5, .5], [.5, .5]])

  test1 = cross_entropy_loss(
      tf.convert_to_tensor(y, dtype=tf.int32),
      tf.convert_to_tensor(yhat, dtype=tf.float32))
  with tf.Session():
    test1 = test1.eval()
  result = -3 * np.log(.5)
  print(test1)
  print(result)
  assert np.amax(np.fabs(test1 - result)) <= 1e-6
  print "Basic (non-exhaustive) cross-entropy tests pass\n"

if __name__ == "__main__":
  test_softmax_basic()
  test_cross_entropy_loss_basic()


text:
package com.bosi.chineseclass.han.fragments;

import android.annotation.SuppressLint;
import android.net.Uri;
import android.util.Log;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.MediaController;
import android.widget.VideoView;

import com.bosi.chineseclass.BaseFragment;
import com.bosi.chineseclass.R;
import com.lidroid.xutils.view.annotation.ViewInject;

public class ZjjzyFragment extends BaseFragment {
    @ViewInject(R.id.video_zjjzy)
    private VideoView mVideoView;

    @ViewInject(R.id.webview_zjjzy_index)
    private WebView mWebView;

    private final String PATH = "http://www.yuwen100.cn/yuwen100/hzzy/jbzy-clips/video/";

    @Override
    protected View getBasedView() {
        return inflater.inflate(R.layout.fragment_layout_zjjzy, null);
    }

    @Override
    protected void afterViewInject() {
        mVideoView.setMediaController(new MediaController(mActivity));
        //TODO:设置正确的专家讲字源路径
        String path = "http://www.yuwen100.cn/yuwen100/zy/hanzi-flash/120001.mp4";
        playVideo(path);

        initWebView();
        mWebView.loadUrl("file:///android_asset/zjjzy/videoindex.html");

    }

    private void playVideo(String path) {
    	mVideoView.setScrollContainer(false);
        mVideoView.setVideoURI(Uri.parse(path));
        mVideoView.requestFocus();
        mVideoView.start();
    }

    @SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled" })
    private void initWebView() {

        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mWebView.addJavascriptInterface(new WebAppShowObjectInterface(), "zjjzy");

        }

    public class WebAppShowObjectInterface {
        @JavascriptInterface
        public void showObject(final String id) {
            Log.e("HNX", "Zjjzy showObject id  " + id);

            mActivity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                  //TODO:设置正确的专家讲字源路径
//                    String path = PATH + id + ".mp4";
                    String path = "http://www.yuwen100.cn/yuwen100/zy/hanzi-flash/120001.mp4";
                    playVideo(path);
                }
            });
        }
    }

    @Override
    public void onDestroy() {
        mWebView.clearCache(true);
        mWebView.clearHistory();

        super.onDestroy();
    }

}


text:
// CLASS HEADER
#include <dali/internal/event/common/thread-local-storage.h>

// INTERNAL INCLUDES
#include <dali/internal/common/core-impl.h>
#include <dali/public-api/common/dali-common.h>

namespace Dali
{

namespace Internal
{

namespace
{
#if defined(EMSCRIPTEN)
ThreadLocalStorage* threadLocal = NULL;
#else
__thread ThreadLocalStorage* threadLocal = NULL;
#endif
}

ThreadLocalStorage::ThreadLocalStorage(Core* core)
: mCore( core )
{
  DALI_ASSERT_ALWAYS( threadLocal == NULL && "Cannot create more than one ThreadLocalStorage object" );

  threadLocal = this;
}

ThreadLocalStorage::~ThreadLocalStorage()
{
}

void ThreadLocalStorage::Remove()
{
  threadLocal = NULL;
}

ThreadLocalStorage& ThreadLocalStorage::Get()
{
  DALI_ASSERT_ALWAYS(threadLocal);

  return *threadLocal;
}

bool ThreadLocalStorage::Created()
{
  // see if the TLS has been set yet
  return (threadLocal != NULL);
}

ThreadLocalStorage* ThreadLocalStorage::GetInternal()
{
  return threadLocal;
}

Dali::Integration::PlatformAbstraction& ThreadLocalStorage::GetPlatformAbstraction()
{
  return mCore->GetPlatform();
}

SceneGraph::UpdateManager& ThreadLocalStorage::GetUpdateManager()
{
  return mCore->GetUpdateManager();
}

NotificationManager& ThreadLocalStorage::GetNotificationManager()
{
  return mCore->GetNotificationManager();
}

ResourceManager& ThreadLocalStorage::GetResourceManager()
{
  return mCore->GetResourceManager();
}

ResourceClient& ThreadLocalStorage::GetResourceClient()
{
  return mCore->GetResourceClient();
}

ImageFactory& ThreadLocalStorage::GetImageFactory()
{
  return mCore->GetImageFactory();
}

ShaderFactory& ThreadLocalStorage::GetShaderFactory()
{
  return mCore->GetShaderFactory();
}

StagePtr ThreadLocalStorage::GetCurrentStage()
{
  return mCore->GetCurrentStage();
}

GestureEventProcessor& ThreadLocalStorage::GetGestureEventProcessor()
{
  return mCore->GetGestureEventProcessor();
}

RelayoutController& ThreadLocalStorage::GetRelayoutController()
{
  return mCore->GetRelayoutController();
}

} // namespace Internal

} // namespace Dali


text:
<!--<?php
# 文件名称
require_once template('head');
require_once template('sidebar');
echo <<<EOT
-->
        <div class="active" id="memberbox">
<!--
EOT;
include templatemember($mfname);
echo <<<EOT
-->
        </div>
<!--
EOT;
require_once template('gap');
require_once template('foot');
?>


text:
import unittest
import mock
from meld.system import get_runner, RunOptions

class TestGetRunner(unittest.TestCase):
    def test_runner_equals_openmm_should_create_openmm_runner(self):
        system = mock.Mock()
        comm = mock.Mock()
        options = RunOptions()
        options.runner = 'openmm'
        with mock.patch('meld.system.runner.OpenMMRunner') as mock_runner:
            get_runner(system, options, comm)
            self.assertEqual(mock_runner.call_count, 1)

    def test_runner_equals_fake_runner_should_create_fake_runner(self):
        system = mock.Mock()
        comm = mock.Mock()
        options = RunOptions()
        options.runner = 'fake_runner'
        with mock.patch('meld.system.runner.FakeSystemRunner') as mock_runner:
            get_runner(system, options, comm)
            self.assertEqual(mock_runner.call_count, 1)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: packing Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

OR-Tools
    9.4

packing Directory Reference

Directory dependency graph for packing:

<map name="adir__9544e94844c800b2034da286ad05b914__dep" id="adir__9544e94844c800b2034da286ad05b914__dep">
<area shape="rect" href="dir_4d3a5a688e4550f3d7725aaa5ab9c27b.html" title="linear_solver" alt="" coords="27,148,122,196"/>
<area shape="rect" href="dir_725f3a5915051842f84e3ea508be2a62.html" title="graph" alt="" coords="147,148,219,196"/>
<area shape="rect" href="dir_8f9dc966244f4c6e9b2fa0dee1e4ef1a.html" title="base" alt="" coords="243,148,315,196"/>
<area shape="rect" href="dir_a3328a0ea67a2aaa160c2783ffbaa5dc.html" title="util" alt="" coords="339,148,411,196"/>
<area shape="rect" href="dir_9544e94844c800b2034da286ad05b914.html" title="packing" alt="" coords="195,52,267,100"/>
<area shape="rect" href="dir_000023_000018.html" title="1" alt="" coords="129,138,137,153"/>
<area shape="rect" href="dir_000023_000012.html" title="1" alt="" coords="206,128,214,143"/>
<area shape="rect" href="dir_000023_000001.html" title="10" alt="" coords="259,121,273,135"/>
<area shape="rect" href="dir_000023_000037.html" title="2" alt="" coords="325,123,333,138"/>
<area shape="rect" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html" title="ortools" alt="" coords="16,16,421,207"/>
</map>

Files

file  	arc_flow_builder.cc [code]

file  	arc_flow_builder.h [code]

file  	arc_flow_solver.cc [code]

file  	arc_flow_solver.h [code]

file  	binpacking_2d_parser.cc [code]

file  	binpacking_2d_parser.h [code]

file  	vector_bin_packing_parser.cc [code]

file  	vector_bin_packing_parser.h [code]

ortools

packing

Generated by

     1.9.4


text:
using namespace shogun;

TEST(CommUlongStringKernel, kernel_matrix)
{
	const char* doc_1 = "stringkernelngram1";
	const char* doc_2 = "kernelngram1string";
	const char* doc_3 = "nrgam1kernelstring";

	SGString<char> string_1(65);
	for (index_t i=0; i<65; i++)
		string_1.string[i] = doc_1[i];

	SGString<char> string_2(72);
	for (index_t i=0; i<72; i++)
		string_2.string[i] = doc_2[i];

	SGString<char> string_3(85);
	for (index_t i=0; i<85; i++)
		string_3.string[i] = doc_3[i];

	SGStringList<char> list(3,85);
	list.strings[0] = string_1;
	list.strings[1] = string_2;
	list.strings[2] = string_3;

	CStringFeatures<char>* s_feats = new CStringFeatures<char>(list, RAWBYTE);

	CAlphabet* alphabet = s_feats->get_alphabet();
	CStringFeatures<uint64_t>* l_feats = new CStringFeatures<uint64_t>(alphabet);
	l_feats->obtain_from_char(s_feats, 5-1, 5, 0, false);
	CSortUlongString* preproc = new CSortUlongString();
	preproc->init(l_feats);
	l_feats->add_preprocessor(preproc);
	l_feats->apply_preprocessor();
	CCommUlongStringKernel* kernel = new CCommUlongStringKernel(l_feats, l_feats);
	CIdentityKernelNormalizer* normalizer = new CIdentityKernelNormalizer();
	kernel->set_normalizer(normalizer);

	CHashedDocDotFeatures* h_feats = new CHashedDocDotFeatures(20, s_feats, new CNGramTokenizer(5), false);

	SGMatrix<float64_t> kernel_matrix = kernel->get_kernel_matrix();

	SGMatrix<float64_t> feat_matrix(3,3);

	for (index_t i=0; i<3; i++)
	{
		for (index_t j=0; j<3; j++)
			feat_matrix(i,j) = h_feats->dot(i, h_feats, j);
	}

	for (index_t i=0; i<3; i++)
	{
		for (index_t j=0; j<3; j++)
			EXPECT_EQ(feat_matrix(i,j), kernel_matrix(i,j));
	}

	SG_UNREF(kernel);
	SG_UNREF(alphabet);
	SG_UNREF(h_feats);
}


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

import java.awt.Color;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import docking.widgets.fieldpanel.field.*;
import docking.widgets.fieldpanel.support.FieldLocation;
import docking.widgets.fieldpanel.support.RowColLocation;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.app.util.HighlightProvider;
import ghidra.app.util.viewer.format.FieldFormatModel;
import ghidra.app.util.viewer.proxy.ProxyObj;
import ghidra.framework.options.Options;
import ghidra.framework.options.ToolOptions;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.mem.MemoryBlock;
import ghidra.program.model.mem.MemoryBlockType;
import ghidra.program.util.MemoryBlockStartFieldLocation;
import ghidra.program.util.ProgramLocation;

/**
  *  Generates a text label on each {@link CodeUnit} that marks the start of a memory block. The
  *  label will will appear as part of the PLATE group in the field map.
  */
public class MemoryBlockStartFieldFactory extends FieldFactory {

	private static final String FIELD_NAME = "Memory Block Start";
	private static final Color BLOCK_COLOR = Palette.getColor("indigo");

	/**
	 * Constructor
	 */
	public MemoryBlockStartFieldFactory() {
		super(FIELD_NAME);
		color = BLOCK_COLOR;
	}

	/**
	 * Constructor
	 * @param model the model that the field belongs to.
	 * @param hlProvider the HightLightStringProvider.
	 * @param displayOptions the Options for display properties.
	 * @param fieldOptions the Options for field specific properties.
	 */
	private MemoryBlockStartFieldFactory(FieldFormatModel model, HighlightProvider hlProvider,
			Options displayOptions, Options fieldOptions) {
		super(FIELD_NAME, model, hlProvider, displayOptions, fieldOptions);
		color = BLOCK_COLOR;
	}

	/**
	 * @see ghidra.app.util.viewer.field.FieldFactory#getField(ProxyObj, int)
	 */
	@Override
	public ListingField getField(ProxyObj<?> proxy, int varWidth) {

		if (!enabled) {
			return null;
		}

		// Exit if we're not at a code unit.
		Object obj = proxy.getObject();
		if (!(obj instanceof CodeUnit)) {
			return null;
		}
		CodeUnit cu = (CodeUnit) obj;

		// Create the text block we want to show.
		List<AttributedString> attributedStrings = createBlockStartText(cu);
		if (attributedStrings == null || attributedStrings.isEmpty()) {
			return null;
		}

		// Convert the text to field elements.
		FieldElement[] elements = createFieldElements(attributedStrings);

		// And put the elements in a text field.
		ListingTextField ltf = ListingTextField.createMultilineTextField(this, proxy, elements,
			startX + varWidth, width, 10, hlProvider);
		ltf.setPrimary(true);

		return ltf;
	}

	/**
	 * Overridden to ensure that we return a {@link MemoryBlockStartFieldLocation} instance.
	 *
	 * @see ghidra.app.util.viewer.field.FieldFactory#getProgramLocation(int, int, ghidra.app.util.viewer.field.ListingField)
	 */
	@Override
	public ProgramLocation getProgramLocation(int row, int col, ListingField bf) {

		Object proxyObject = bf.getProxy().getObject();
		if (!(proxyObject instanceof CodeUnit)) {
			return null;
		}
		CodeUnit cu = (CodeUnit) proxyObject;

		String[] comments;
		List<AttributedString> attributedStrings = createBlockStartText(cu);
		if (attributedStrings == null) {
			comments = new String[0];
		}
		else {
			comments = new String[attributedStrings.size()];
			for (int i = 0; i < comments.length; i++) {
				comments[i] = attributedStrings.get(i).getText();
			}
		}

		return new MemoryBlockStartFieldLocation(cu.getProgram(), cu.getMinAddress(), null, row,
			col, comments, 0);
	}

	/**
	 * Overridden to ensure that we only place block comments on the first {@link CodeUnit} of
	 * the block.
	 *
	 * @see ghidra.app.util.viewer.field.FieldFactory#getFieldLocation(ghidra.app.util.viewer.field.ListingField, BigInteger, int, ghidra.program.util.ProgramLocation)
	 */
	@Override
	public FieldLocation getFieldLocation(ListingField listingField, BigInteger index, int fieldNum,
			ProgramLocation programLoc) {

		// Only handle this if it's the right kind of location object.
		if (!(programLoc instanceof MemoryBlockStartFieldLocation)) {
			return null;
		}
		MemoryBlockStartFieldLocation blockLocation = (MemoryBlockStartFieldLocation) programLoc;

		Object obj = listingField.getProxy().getObject();
		if (obj instanceof CodeUnit) {
			CodeUnit cu = (CodeUnit) obj;

			MemoryBlock block = cu.getMemory().getBlock(cu.getAddress());
			if (block == null) {
				return null;
			}

			// If the code unit does NOT rest at the beginning of a memory block, no need
			// to handle this.
			if (cu.getMinAddress().equals(block.getStart())) {

				if (listingField instanceof ListingTextField) {
					ListingTextField listingTextField = (ListingTextField) listingField;

					RowColLocation location = listingTextField.dataToScreenLocation(
						blockLocation.getRow(), blockLocation.getCharOffset());

					return new FieldLocation(index, fieldNum, location.row(), location.col());
				}
			}
		}

		return null;
	}

	/**
	 * @see ghidra.app.util.viewer.field.FieldFactory#acceptsType(int, java.lang.Class)
	 */
	@Override
	public boolean acceptsType(int category, Class<?> proxyObjectClass) {
		return (category == FieldFormatModel.PLATE);
	}

	@Override
	public FieldFactory newInstance(FieldFormatModel formatModel, HighlightProvider provider,
			ToolOptions displayOptions, ToolOptions fieldOptions) {
		return new MemoryBlockStartFieldFactory(formatModel, provider, displayOptions,
			fieldOptions);
	}

	/**
	 * Creates a comment to be show at the beginning of each block that shows the following:
	 *   - block name
	 *   - block type
	 *   - block start/end address (size)
	 *   - block comment
	 *
	 * @param cu
	 */
	protected List<AttributedString> createBlockStartText(CodeUnit cu) {

		List<AttributedString> lines = new ArrayList<>();

		// Need to get the memory block that this code unit is a part of, so we can check
		// its start address.
		MemoryBlock block = cu.getMemory().getBlock(cu.getAddress());

		if (block == null) {
			return null;
		}

		// If the code unit is not at the start of the block, just return.
		if (!(cu.getMinAddress().equals(block.getStart()))) {
			return null;
		}

		MemoryBlockType blockType = block.getType();

		String type = "";
		if (blockType != MemoryBlockType.DEFAULT) {
			if (block.isMapped()) {
				type = "(" + block.getSourceInfos().get(0).getDescription() + ")";
			}
			else {
				type = "(" + blockType + ")";
			}
		}
		String line1 = block.getName() + " " + type;
		String line2 = block.getComment();
		String line3 = block.getStart().toString(true) + "-" + block.getEnd().toString(true);

		AttributedString borderAS = new AttributedString("//", color, getMetrics());
		lines.add(borderAS);
		lines.add(new AttributedString("// " + line1, color, getMetrics()));
		if (line2 != null && !line2.isEmpty()) {
			lines.add(new AttributedString("// " + line2, color, getMetrics()));
		}
		lines.add(new AttributedString("// " + line3, color, getMetrics()));
		lines.add(borderAS);

		return lines;
	}

	/**
	 * Creates {@link FieldElement} instances for each given {@link AttributedString}.
	 *
	 * @param attributedStrings
	 * @return
	 */
	private FieldElement[] createFieldElements(List<AttributedString> attributedStrings) {
		List<FieldElement> elements = new ArrayList<>();
		int lineNum = 0;
		for (AttributedString line : attributedStrings) {
			FieldElement blockElement = new TextFieldElement(line, lineNum, 0);
			elements.add(blockElement);
			lineNum++;
		}

		// Convert to an array
		FieldElement[] elementsArray = new FieldElement[elements.size()];
		elements.toArray(elementsArray);

		return elementsArray;
	}

	/**
	 * Returns the length of the longest string in the given list.
	 *
	 * @param lines
	 * @return
	 */
	private int getLongestLineSize(String... lines) {

		int longest = 0;
		for (String line : lines) {
			if (line.length() > longest) {
				longest = line.length();
			}
		}
		return longest;

	}

}


text:
Imports System.Xml
Imports System.IO

Public Class ScriptureDisplay

    Dim close_on_timer As Boolean = False
    'Dim modifiedHtml As String

    Dim verseText1 As String
    Dim verseText2 As String
    Dim verseText3 As String
    Dim verseText4 As String

    Dim chapterCount As New Hashtable
    Dim chapterCount2 As New Hashtable
    Dim chapterCount3 As New Hashtable
    Dim chapterCount4 As New Hashtable

    Dim errorProvider As New ErrorProvider

    Dim dashboard As Dashboard = Nothing

    Private Sub ScriptureDisplay_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        If Not dashboard Is Nothing Then
            dashboard.updateButton()
        End If
    End Sub

    Private Sub ScriptureDisplay_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.ControlBox = False
        Me.WindowState = FormWindowState.Maximized

        ToolTip1.SetToolTip(CheckBox2, "Enable this button to send quick reference directly to projector. " + vbCrLf + _
                                        "By default, this will be clicked.")
        ToolTip1.SetToolTip(ComboBox1, "As you type, you get the available selections. Use arrow to quickly " + vbCrLf + _
                                        "select the book and type the chapter and verse seperated by space " + vbCrLf + _
                                        "and press enter. This will directly display the verse into projector." + vbCrLf + _
                                         "e.g., Exodus 3 4")
        Timer1.Enabled = True
    End Sub

    Private Sub loadInit()
        'Populate Bibles in popup...
        Bible1.Items.AddRange(GlobalMemory.getAvailableBibles.ToArray)
        Bible1.SelectedIndex = 0
        Bible2.Items.AddRange(GlobalMemory.getAvailableBibles.ToArray)
        Bible2.SelectedIndex = 0
        Bible3.Items.AddRange(GlobalMemory.getAvailableBibles.ToArray)
        Bible3.SelectedIndex = 0
        Bible4.Items.AddRange(GlobalMemory.getAvailableBibles.ToArray)
        Bible4.SelectedIndex = 0

        '
        Dim xmldoc As New Xml.XmlDocument
        If Bible1.Text = "King James Version (1769)" Then
            xmldoc.LoadXml(GlobalMemory.UnZip(My.Resources.KJV))
        Else
            xmldoc.Load(GlobalMemory.getSharedDataPath + Path.DirectorySeparatorChar + "bibles" + Path.DirectorySeparatorChar + Bible1.Text)
        End If

        Dim xmlnodes = xmldoc.SelectNodes("/XMLBIBLE/BIBLEBOOK")

        Dim bibleBooks(65) As String
        chapterCount = New Hashtable
        Dim i As Integer = 0
        For Each xmlnode As Xml.XmlNode In xmlnodes
            bibleBooks(i) = xmlnode.Attributes.GetNamedItem("bname").Value
            i = i + 1
            chapterCount.Add(xmlnode.Attributes.GetNamedItem("bname").Value.ToLower, xmlnode.SelectNodes("CHAPTER").Count)
        Next
        BibleBooksComboBox.Items.Clear()
        BibleBooksComboBox.Items.AddRange(bibleBooks)
        BibleBooksComboBox.SelectedIndex = 0
        dashboard.loadInit()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.Cursor = Cursors.WaitCursor
        Timer1.Stop()
        If (close_on_timer) Then
            Me.Dispose()
            Return
        End If

        dashboard = New Dashboard(Me)
        Me.Controls.Add(dashboard)
        Dim tmp_i As Integer = GroupBox1.Location.X + GroupBox1.Width
        dashboard.Location = New Point(tmp_i + 10, 10)

        Me.Enabled = False
        MainWindow.setStatus("Working...", My.Resources.status_loading)
        loadInit()
        '
        Dim i As Integer = 0
        For Each oo As Object In BibleBooksComboBox.Items
            If Not oo Is Nothing Then
                ComboBox1.Items.Add(oo)
            End If
        Next
        '
        MainWindow.setStatus("Ready", My.Resources.status_ok)
        Me.Enabled = True
        dashboard.doPreview()
        Me.Cursor = Cursors.Default
        Me.BringToFront()
    End Sub

    Private Sub BibleBooksComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BibleBooksComboBox.SelectedIndexChanged
        Dim count As Integer = chapterCount.Item(BibleBooksComboBox.Text.ToLower)
        ChapterComboBox.Items.Clear()
        For i As Integer = 1 To count
            ChapterComboBox.Items.Add(Str(i))
        Next
        ChapterComboBox.SelectedIndex = 0

        If Sync2.Checked And SecondVerseCheckBox.Checked Then
            Book2.SelectedIndex = BibleBooksComboBox.SelectedIndex
            Chapter2.SelectedIndex = 0
        End If
        If Sync3.Checked And ThirdVerseCheckBox.Checked Then
            Book3.SelectedIndex = BibleBooksComboBox.SelectedIndex
            Chapter3.SelectedIndex = 0
        End If
        If Sync4.Checked And FourthVerseCheckBox.Checked Then
            Book4.SelectedIndex = BibleBooksComboBox.SelectedIndex
            Chapter4.SelectedIndex = 0
        End If
    End Sub

    Private Sub Bible1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bible1.SelectedIndexChanged
        Dim xmldoc As New Xml.XmlDocument
        If Bible1.Text = "King James Version (1769)" Then
            xmldoc.LoadXml(GlobalMemory.UnZip(My.Resources.KJV))
        Else
            xmldoc.Load(GlobalMemory.getSharedDataPath + Path.DirectorySeparatorChar + "bibles" + Path.DirectorySeparatorChar + Bible1.Text)
        End If
        Dim xmlnodes As Xml.XmlNodeList = xmldoc.SelectNodes("/XMLBIBLE/BIBLEBOOK")

        Dim bibleBooks(xmlnodes.Count - 1) As String
        chapterCount = New Hashtable
        Dim i As Integer = 0
        For Each xmlnode As Xml.XmlNode In xmlnodes
            bibleBooks(i) = xmlnode.Attributes.GetNamedItem("bname").Value
            i = i + 1
            chapterCount.Add(xmlnode.Attributes.GetNamedItem("bname").Value.ToLower, xmlnode.SelectNodes("CHAPTER").Count)
        Next
        BibleBooksComboBox.Items.Clear()
        BibleBooksComboBox.Items.AddRange(bibleBooks)
        BibleBooksComboBox.SelectedIndex = 0
    End Sub

    Private Sub Bible2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bible2.SelectedIndexChanged
        Dim xmldoc As New Xml.XmlDocument
        If Bible2.Text = "King James Version (1769)" Then
            xmldoc.LoadXml(GlobalMemory.UnZip(My.Resources.KJV))
        Else
            xmldoc.Load(GlobalMemory.getSharedDataPath + Path.DirectorySeparatorChar + "bibles" + Path.DirectorySeparatorChar + Bible2.Text)
        End If
        Dim xmlnodes As Xml.XmlNodeList = xmldoc.SelectNodes("/XMLBIBLE/BIBLEBOOK")

        Dim bibleBooks(xmlnodes.Count - 1) As String
        chapterCount2 = New Hashtable
        Dim i As Integer = 0
        For Each xmlnode As Xml.XmlNode In xmlnodes
            bibleBooks(i) = xmlnode.Attributes.GetNamedItem("bname").Value
            i = i + 1
            chapterCount2.Add(xmlnode.Attributes.GetNamedItem("bname").Value.ToLower, xmlnode.SelectNodes("CHAPTER").Count)
        Next
        Book2.Items.Clear()
        Book2.Items.AddRange(bibleBooks)
        Book2.SelectedIndex = 0
    End Sub

    Private Sub Book2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Book2.SelectedIndexChanged
        Dim count As Integer = chapterCount2.Item(Book2.Text.ToLower)
        Chapter2.Items.Clear()
        For i As Integer = 1 To count
            Chapter2.Items.Add(Str(i))
        Next
        Chapter2.SelectedIndex = 0
    End Sub

    Private Sub SecondVerseCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SecondVerseCheckBox.CheckedChanged
        Bible2.Enabled = Not Bible2.Enabled
        Book2.Enabled = Not Book2.Enabled
        Chapter2.Enabled = Not Chapter2.Enabled
        Verse2.Enabled = Not Verse2.Enabled
        dashboard.doPreview()
    End Sub

    Private Sub Bible3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bible3.SelectedIndexChanged
        Dim xmldoc As New Xml.XmlDocument
        If Bible3.Text = "King James Version (1769)" Then
            xmldoc.LoadXml(GlobalMemory.UnZip(My.Resources.KJV))
        Else
            xmldoc.Load(GlobalMemory.getSharedDataPath + Path.DirectorySeparatorChar + "bibles" + Path.DirectorySeparatorChar + Bible3.Text)
        End If
        Dim xmlnodes = xmldoc.SelectNodes("/XMLBIBLE/BIBLEBOOK")

        Dim bibleBooks(65) As String
        chapterCount3 = New Hashtable
        Dim i As Integer = 0
        For Each xmlnode As Xml.XmlNode In xmlnodes
            bibleBooks(i) = xmlnode.Attributes.GetNamedItem("bname").Value
            i = i + 1
            chapterCount3.Add(xmlnode.Attributes.GetNamedItem("bname").Value.ToLower, xmlnode.SelectNodes("CHAPTER").Count)
        Next
        Book3.Items.Clear()
        Book3.Items.AddRange(bibleBooks)
        Book3.SelectedIndex = 0
    End Sub

    Private Sub Book3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Book3.SelectedIndexChanged
        Dim count As Integer = chapterCount3.Item(Book3.Text.ToLower)
        Chapter3.Items.Clear()
        For i As Integer = 1 To count
            Chapter3.Items.Add(Str(i))
        Next
        Chapter3.SelectedIndex = 0
    End Sub

    Private Sub Bible4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bible4.SelectedIndexChanged
        Dim xmldoc As New Xml.XmlDocument
        If Bible4.Text = "King James Version (1769)" Then
            xmldoc.LoadXml(GlobalMemory.UnZip(My.Resources.KJV))
        Else
            xmldoc.Load(GlobalMemory.getSharedDataPath + Path.DirectorySeparatorChar + "bibles" + Path.DirectorySeparatorChar + Bible4.Text)
        End If
        Dim xmlnodes = xmldoc.SelectNodes("/XMLBIBLE/BIBLEBOOK")

        Dim bibleBooks(65) As String
        chapterCount4 = New Hashtable
        Dim i As Integer = 0
        For Each xmlnode As Xml.XmlNode In xmlnodes
            bibleBooks(i) = xmlnode.Attributes.GetNamedItem("bname").Value
            i = i + 1
            chapterCount4.Add(xmlnode.Attributes.GetNamedItem("bname").Value.ToLower, xmlnode.SelectNodes("CHAPTER").Count)
        Next
        Book4.Items.Clear()
        Book4.Items.AddRange(bibleBooks)
        Book4.SelectedIndex = 0
    End Sub

    Private Sub Book4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Book4.SelectedIndexChanged
        Dim count As Integer = chapterCount4.Item(Book4.Text.ToLower)
        Chapter4.Items.Clear()
        For i As Integer = 1 To count
            Chapter4.Items.Add(Str(i))
        Next
        Chapter4.SelectedIndex = 0
    End Sub

    Private Sub ThirdVerseCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThirdVerseCheckBox.CheckedChanged
        Bible3.Enabled = Not Bible3.Enabled
        Book3.Enabled = Not Book3.Enabled
        Chapter3.Enabled = Not Chapter3.Enabled
        Verse3.Enabled = Not Verse3.Enabled
        dashboard.doPreview()
    End Sub

    Private Sub FourthVerseCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FourthVerseCheckBox.CheckedChanged
        Bible4.Enabled = Not Bible4.Enabled
        Book4.Enabled = Not Book4.Enabled
        Chapter4.Enabled = Not Chapter4.Enabled
        Verse4.Enabled = Not Verse4.Enabled
        dashboard.doPreview()
    End Sub

    'must be called from dashboard
    Public Function smartyTags(ByVal modifiedHtml As String)
        modifiedHtml = modifiedHtml.Replace("_VERSE_ONE_", verseText1)
        modifiedHtml = modifiedHtml.Replace("_VERSE_TWO_", verseText2)
        modifiedHtml = modifiedHtml.Replace("_VERSE_THREE_", verseText3)
        modifiedHtml = modifiedHtml.Replace("_VERSE_FOUR_", verseText4)

        If SecondVerseCheckBox.Checked Then
            modifiedHtml = modifiedHtml.Replace("<!--V2", "<!--V2_B-->")
            modifiedHtml = modifiedHtml.Replace("V2-->", "<!--V2_E-->")
        Else
            modifiedHtml = modifiedHtml.Replace("<!--V2_B-->", "<!--V2")
            modifiedHtml = modifiedHtml.Replace("<!--V2_E-->", "V2-->")
        End If

        If ThirdVerseCheckBox.Checked Then
            modifiedHtml = modifiedHtml.Replace("<!--V3", "<!--V3_B-->")
            modifiedHtml = modifiedHtml.Replace("V3-->", "<!--V3_E-->")
        Else
            modifiedHtml = modifiedHtml.Replace("<!--V3_B-->", "<!--V3")
            modifiedHtml = modifiedHtml.Replace("<!--V3_E-->", "V3-->")
        End If

        If FourthVerseCheckBox.Checked Then
            modifiedHtml = modifiedHtml.Replace("<!--V4", "<!--V4_B-->")
            modifiedHtml = modifiedHtml.Replace("V4-->", "<!--V4_E-->")
        Else
            modifiedHtml = modifiedHtml.Replace("<!--V4_B-->", "<!--V4")
            modifiedHtml = modifiedHtml.Replace("<!--V4_E-->", "V4-->")
        End If
        Return modifiedHtml
    End Function

    'must be called from dashboard
    Public Sub PreProcess()
        If Bible1.Text.Trim = "" Then
            'dont process
            Return
        End If

        Dim versetxt = GlobalMemory.getBibleVerse(BibleBooksComboBox.Text.Trim, ChapterComboBox.Text.Trim, Verse1.Text.Trim, Bible1.Text)
        verseText1 = versetxt
        verseText1 = verseText1 + " - " + BibleBooksComboBox.Text.Trim + " " + ChapterComboBox.Text.Trim + ":" + Verse1.Text.Trim
        '-----------------------------------------------------------------------
        If SecondVerseCheckBox.Checked Then
            versetxt = GlobalMemory.getBibleVerse(Book2.Text.Trim, Chapter2.Text.Trim, Verse2.Text.Trim, Bible2.Text)
            verseText2 = versetxt
            verseText2 = verseText2 + " - " + Book2.Text.Trim + " " + Chapter2.Text.Trim + ":" + Verse2.Text.Trim
        End If
        '-----------------------------------------------------------------------
        If ThirdVerseCheckBox.Checked Then
            versetxt = GlobalMemory.getBibleVerse(Book3.Text.Trim, Chapter3.Text.Trim, Verse3.Text.Trim, Bible3.Text)
            verseText3 = versetxt
            verseText3 = verseText3 + " - " + Book3.Text.Trim + " " + Chapter3.Text.Trim + ":" + Verse3.Text.Trim
        End If
        '-----------------------------------------------------------------------
        If FourthVerseCheckBox.Checked Then
            versetxt = GlobalMemory.getBibleVerse(Book4.Text.Trim, Chapter4.Text.Trim, Verse4.Text.Trim, Bible4.Text)
            verseText4 = versetxt
            verseText4 = verseText4 + " - " + Book4.Text.Trim + " " + Chapter4.Text.Trim + ":" + Verse4.Text.Trim
        End If
    End Sub

    Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
        If e.KeyCode = Keys.Return Then
            Try
                ComboBox1.Text = ComboBox1.Text.Replace("  ", " ").Replace("  ", " ").Trim

                Dim codes() As String = ComboBox1.Text.Split(" ")

                Dim chp As String = codes(codes.Length - 2)
                Dim vrs As String = codes(codes.Length - 1)

                If codes.Length = 3 Then
                    BibleBooksComboBox.SelectedItem = codes(0)
                ElseIf codes.Length = 4 Then
                    BibleBooksComboBox.SelectedItem = codes(0) + " " + codes(1)
                ElseIf codes.Length = 5 Then
                    BibleBooksComboBox.SelectedItem = codes(0) + " " + codes(1) + " " + codes(2)
                ElseIf codes.Length = 6 Then
                    BibleBooksComboBox.SelectedItem = codes(0) + " " + codes(1) + " " + codes(2) + " " + codes(3)
                ElseIf codes.Length = 7 Then
                    BibleBooksComboBox.SelectedItem = codes(0) + " " + codes(1) + " " + codes(2) + " " + codes(3) + " " + codes(4)
                End If

                Try
                    ChapterComboBox.SelectedIndex = Integer.Parse(chp) - 1
                    errorProvider.SetError(ChapterComboBox, "")
                Catch ex As Exception
                    ChapterComboBox.SelectedIndex = ChapterComboBox.Items.Count - 1
                    errorProvider.SetError(ChapterComboBox, "Chapter out of range")
                End Try
                Verse1.Text = vrs
                errorProvider.SetError(ComboBox1, "")
                If CheckBox2.Checked = True Then
                    dashboard.sendOrUpdateProjector()
                Else
                    dashboard.doPreview()
                End If
            Catch
                errorProvider.SetError(ComboBox1, "Quick search did not find any relavant match!")
            End Try
        End If
    End Sub

    Private Sub ChapterComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChapterComboBox.SelectedIndexChanged
        If Sync2.Checked And SecondVerseCheckBox.Checked Then
            Chapter2.SelectedIndex = ChapterComboBox.SelectedIndex
        End If
        If Sync3.Checked And ThirdVerseCheckBox.Checked Then
            Chapter3.SelectedIndex = ChapterComboBox.SelectedIndex
        End If
        If Sync4.Checked And FourthVerseCheckBox.Checked Then
            Chapter4.SelectedIndex = ChapterComboBox.SelectedIndex
        End If
    End Sub

    Private Sub Verse1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Verse1.TextChanged
        If Sync2.Checked And SecondVerseCheckBox.Checked Then
            Verse2.Text = Verse1.Text
        End If
        If Sync3.Checked And ThirdVerseCheckBox.Checked Then
            Verse3.Text = Verse1.Text
        End If
        If Sync4.Checked And FourthVerseCheckBox.Checked Then
            Verse4.Text = Verse1.Text
        End If
    End Sub

    Private Sub BtnAddVerse_Click(sender As System.Object, e As System.EventArgs) Handles BtnAddVerse.Click
        Dim verse As Integer
        Dim diff As Integer
        If Integer.TryParse(Verse1.Text, verse) Then
            Verse1.Text = (verse + 1).ToString()
        Else
            Dim varray() As String = Verse1.Text.Split(New Char() {"-"})
            diff = Integer.Parse(varray(1)) - Integer.Parse(varray(0))
            Verse1.Text = (Integer.Parse(varray(1)) + 1).ToString() + "-" + (Integer.Parse(varray(1) + 1 + diff)).ToString()
        End If
    End Sub

    Private Sub BtnSubVerse_Click(sender As System.Object, e As System.EventArgs) Handles BtnSubVerse.Click
        Dim verse As Integer
        If Integer.TryParse(Verse1.Text, verse) Then
            If verse - 1 <> 0 Then
                Verse1.Text = (verse - 1).ToString()
            End If
        Else
            Dim varray() As String = Verse1.Text.Split(New Char() {"-"})
            If Integer.Parse(varray(0)) - 1 <> 0 Then
                Verse1.Text = (Integer.Parse(varray(0)) - 1).ToString() + "-" + (Integer.Parse(varray(1)) - 1).ToString()
            Else
                Verse1.Text = "1-" + (Integer.Parse(varray(1)) - 1).ToString()
                If Verse1.Text = "1-1" Then
                    Verse1.Text = "1"
                End If
            End If
        End If
    End Sub
End Class


text:
package multichain

import (
	"github.com/hyperledger/fabric/orderer/common/blockcutter"
	cb "github.com/hyperledger/fabric/protos/common"
)

type mockConsenter struct {
}

func (mc *mockConsenter) HandleChain(support ConsenterSupport) (Chain, error) {
	return &mockChain{
		queue:   make(chan *cb.Envelope),
		cutter:  support.BlockCutter(),
		support: support,
	}, nil
}

type mockChain struct {
	queue   chan *cb.Envelope
	support ConsenterSupport
	cutter  blockcutter.Receiver
}

func (mch *mockChain) Enqueue(env *cb.Envelope) bool {
	mch.queue <- env
	return true
}

func (mch *mockChain) Start() {
	go func() {
		for {
			msg, ok := <-mch.queue
			if !ok {
				return
			}
			batches, committers, _ := mch.cutter.Ordered(msg)
			for i, batch := range batches {
				mch.support.WriteBlock(batch, nil, committers[i])
			}
		}
	}()
}

func (mch *mockChain) Halt() {
	close(mch.queue)
}

type mockConfigtxManager struct {
	config *cb.ConfigurationEnvelope
}

func (mcm *mockConfigtxManager) Apply(configtx *cb.ConfigurationEnvelope) error {
	mcm.config = configtx
	return nil
}

func (mcm *mockConfigtxManager) Validate(configtx *cb.ConfigurationEnvelope) error {
	panic("Unimplemented")
}

func (mcm *mockConfigtxManager) ChainID() string {
	panic("Unimplemented")
}

type mockLedgerWriter struct {
}

func (mlw *mockLedgerWriter) Append(blockContents []*cb.Envelope, metadata [][]byte) *cb.Block {
	logger.Debugf("Committed block")
	return nil
}


text:
namespace Envoy {
namespace Extensions {
namespace NetworkFilters {
namespace MySQLProxy {

std::string MySQLTestUtils::encodeServerGreeting(int protocol) {
  ServerGreeting mysql_greet_encode{};
  mysql_greet_encode.setProtocol(protocol);
  std::string ver(MySQLTestUtils::getVersion());
  mysql_greet_encode.setVersion(ver);
  mysql_greet_encode.setThreadId(MYSQL_THREAD_ID);
  std::string salt(getSalt());
  mysql_greet_encode.setSalt(salt);
  mysql_greet_encode.setServerCap(MYSQL_SERVER_CAPAB);
  mysql_greet_encode.setServerLanguage(MYSQL_SERVER_LANGUAGE);
  mysql_greet_encode.setServerStatus(MYSQL_SERVER_STATUS);
  mysql_greet_encode.setExtServerCap(MYSQL_SERVER_EXT_CAPAB);
  std::string data = mysql_greet_encode.encode();
  std::string mysql_msg = BufferHelper::encodeHdr(data, GREETING_SEQ_NUM);
  return mysql_msg;
}

std::string MySQLTestUtils::encodeClientLogin(uint16_t client_cap, std::string user, uint8_t seq) {
  ClientLogin mysql_clogin_encode{};
  mysql_clogin_encode.setClientCap(client_cap);
  mysql_clogin_encode.setExtendedClientCap(MYSQL_EXT_CLIENT_CAPAB);
  mysql_clogin_encode.setMaxPacket(MYSQL_MAX_PACKET);
  mysql_clogin_encode.setCharset(MYSQL_CHARSET);
  mysql_clogin_encode.setUsername(user);
  std::string auth_resp(getAuthResp());
  mysql_clogin_encode.setAuthResp(auth_resp);
  std::string data = mysql_clogin_encode.encode();
  std::string mysql_msg = BufferHelper::encodeHdr(data, seq);
  return mysql_msg;
}

std::string MySQLTestUtils::encodeClientLoginResp(uint8_t srv_resp, int it, int seq_force) {
  ClientLoginResponse mysql_loginok_encode{};
  mysql_loginok_encode.setRespCode(srv_resp);
  mysql_loginok_encode.setAffectedRows(MYSQL_SM_AFFECTED_ROWS);
  mysql_loginok_encode.setLastInsertId(MYSQL_SM_LAST_ID);
  mysql_loginok_encode.setServerStatus(MYSQL_SM_SERVER_OK);
  mysql_loginok_encode.setWarnings(MYSQL_SM_SERVER_WARNINGS);
  std::string data = mysql_loginok_encode.encode();
  int seq = CHALLENGE_RESP_SEQ_NUM + 2 * it;
  if (seq_force > 0) {
    seq = seq_force;
  }
  std::string mysql_msg = BufferHelper::encodeHdr(data, seq);
  return mysql_msg;
}

std::string MySQLTestUtils::encodeAuthSwitchResp() {
  ClientSwitchResponse mysql_switch_resp_encode{};
  std::string resp_opaque_data("mysql_opaque");
  mysql_switch_resp_encode.setAuthPluginResp(resp_opaque_data);
  std::string data = mysql_switch_resp_encode.encode();
  std::string mysql_msg = BufferHelper::encodeHdr(data, AUTH_SWITH_RESP_SEQ);
  return mysql_msg;
}

} // namespace MySQLProxy
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy


text:
<?php

namespace MyApp;

class FileSystem {

  public function readFile($path) {
    if(!file_exists($path)) return false;

    return file_get_contents($path);
  }
}


text:
import simplejson as json

from eve.tests import TestBase
from eve.tests.utils import DummyEvent
from eve.tests.test_settings import MONGO_DBNAME

from eve import STATUS_OK, LAST_UPDATED, ID_FIELD, DATE_CREATED, ISSUES, \
    STATUS, ETAG
from eve.methods.post import post
from eve.methods.post import post_internal

class TestPost(TestBase):
    def test_unknown_resource(self):
        _, status = self.post(self.unknown_resource_url, data={})
        self.assert404(status)

    def test_readonly_resource(self):
        _, status = self.post(self.readonly_resource_url, data={})
        self.assert405(status)

    def test_post_to_item_endpoint(self):
        _, status = self.post(self.item_id_url, data={})
        self.assert405(status)

    def test_validation_error(self):
        r, status = self.post(self.known_resource_url, data={"ref": "123"})
        self.assertValidationErrorStatus(status)
        self.assertValidationError(r, {'ref': 'min length is 25'})

        r, status = self.post(self.known_resource_url, data={"prog": 123})
        self.assertValidationErrorStatus(status)
        self.assertValidationError(r, {'ref': 'required'})

    def test_post_empty_bulk_insert(self):
        r, status = self.post(self.empty_resource_url, data=[])
        self.assert400(status)

    def test_post_empty_resource(self):
        data = []
        for _ in range(10):
            data.append({"inv_number": self.random_string(10)})
        r, status = self.post(self.empty_resource_url, data=data)
        self.assert201(status)
        self.assertPostResponse(r)

    def test_post_string(self):
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_integer(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'prog'
        test_value = 1
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_list_as_array(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "role"
        test_value = ["vendor", "client"]
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_rows(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "rows"
        test_value = [
            {'sku': 'AT1234', 'price': 99},
            {'sku': 'XF9876', 'price': 9999}
        ]
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_list(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "alist"
        test_value = ["a_string", 99]
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_integer_zero(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "aninteger"
        test_value = 0
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_float_zero(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "afloat"
        test_value = 0.0
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_dict(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "location"
        test_value = {'address': 'an address', 'city': 'a city'}
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_datetime(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = "born"
        test_value = "Tue, 06 Nov 2012 10:33:31 GMT"
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_objectid(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'tid'
        test_value = "50656e4538345b39dd0414f0"
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_null_objectid(self):
        # verify that #341 is fixed.
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'tid'
        test_value = None
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_default_value(self):
        test_field = 'title'
        test_value = "Mr."
        data = {'ref': '9234567890123456789054321'}
        self.assertPostItem(data, test_field, test_value)

    def test_post_default_value_none(self):
        # default values that assimilate to None (0, '', False) were ignored
        # prior to 0.1.1
        title = self.domain['contacts']['schema']['title']
        title['default'] = ''
        self.app.set_defaults()
        data = {"ref": "UUUUUUUUUUUUUUUUUUUUUUUUU"}
        self.assertPostItem(data, 'title', '')

        title['type'] = 'integer'
        title['default'] = 0
        self.app.set_defaults()
        data = {"ref": "TTTTTTTTTTTTTTTTTTTTTTTTT"}
        self.assertPostItem(data, 'title', 0)

        title['type'] = 'boolean'
        title['default'] = False
        self.app.set_defaults()
        data = {"ref": "QQQQQQQQQQQQQQQQQQQQQQQQQ"}
        self.assertPostItem(data, 'title', False)

    def test_multi_post_valid(self):
        data = [
            {"ref": "9234567890123456789054321"},
            {"ref": "5432112345678901234567890", "role": ["agent"]},
        ]
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        results = r['_items']

        self.assertEqual(results[0]['_status'], 'OK')
        self.assertEqual(results[1]['_status'], 'OK')

        with self.app.test_request_context():
            contacts = self.app.data.driver.db['contacts']
            r = contacts.find({"ref": "9234567890123456789054321"}).count()
            self.assertTrue(r == 1)
            r = contacts.find({"ref": "5432112345678901234567890"}).count()
            self.assertTrue(r == 1)

    def test_multi_post_invalid(self):
        data = [
            {"ref": "9234567890123456789054321"},
            {"prog": 9999},
            {"ref": "5432112345678901234567890", "role": ["agent"]},
            {"ref": self.item_ref},
            {"ref": "9234567890123456789054321", "tid": "12345678"},
        ]
        r, status = self.post(self.known_resource_url, data=data)
        self.assertValidationErrorStatus(status)
        results = r['_items']

        self.assertEqual(results[0]['_status'], 'OK')
        self.assertEqual(results[2]['_status'], 'OK')

        self.assertValidationError(results[1], {'ref': 'required'})
        self.assertValidationError(results[3], {'ref': 'unique'})
        self.assertValidationError(results[4], {'tid': 'ObjectId'})

        self.assertTrue(ID_FIELD not in results[0])
        self.assertTrue(ID_FIELD not in results[1])
        self.assertTrue(ID_FIELD not in results[2])
        self.assertTrue(ID_FIELD not in results[3])

        with self.app.test_request_context():
            contacts = self.app.data.driver.db['contacts']
            r = contacts.find({"prog": 9999}).count()
            self.assertTrue(r == 0)
            r = contacts.find({"ref": "9234567890123456789054321"}).count()
            self.assertTrue(r == 0)

    def test_post_x_www_form_urlencoded(self):
        test_field = "ref"
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        r, status = self.parse_response(self.test_client.post(
            self.known_resource_url, data=data))
        self.assert201(status)
        self.assertTrue('OK' in r[STATUS])
        self.assertPostResponse(r)

    def test_post_referential_integrity(self):
        data = {"person": self.unknown_item_id}
        r, status = self.post('/invoices/', data=data)
        self.assertValidationErrorStatus(status)
        expected = ("value '%s' must exist in resource '%s', field '%s'" %
                    (self.unknown_item_id, 'contacts',
                     self.app.config['ID_FIELD']))
        self.assertValidationError(r, {'person': expected})

        data = {"person": self.item_id}
        r, status = self.post('/invoices/', data=data)
        self.assert201(status)
        self.assertPostResponse(r)

    def test_post_referential_integrity_list(self):
        data = {"invoicing_contacts": [self.item_id, self.unknown_item_id]}
        r, status = self.post('/invoices/', data=data)
        self.assertValidationErrorStatus(status)
        expected = ("value '%s' must exist in resource '%s', field '%s'" %
                    (self.unknown_item_id, 'contacts',
                     self.app.config['ID_FIELD']))
        self.assertValidationError(r, {'invoicing_contacts': expected})

        data = {"invoicing_contacts": [self.item_id, self.item_id]}
        r, status = self.post('/invoices/', data=data)
        self.assert201(status)
        self.assertPostResponse(r)

    def test_post_allow_unknown(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        data = {"unknown": "unknown"}
        r, status = self.post(self.known_resource_url, data=data)
        self.assertValidationErrorStatus(status)
        self.assertValidationError(r, {'unknown': 'unknown'})

        # since resource settings are only set at app startup we set
        # those that influence the 'allow_unknown' property by hand (so we
        # don't have to re-initialize the whole app.)
        settings = self.app.config['DOMAIN'][self.known_resource]
        settings['allow_unknown'] = True
        settings['datasource']['projection'] = None

        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        self.assertPostResponse(r)

        # test that the unknown field is also returned with subsequent get
        # requests
        id = r[self.app.config['ID_FIELD']]
        r = self.test_client.get('%s/%s' % (self.known_resource_url, id))
        r_data = json.loads(r.get_data())
        self.assertTrue('unknown' in r_data)
        self.assertEqual('unknown', r_data['unknown'])

    def test_post_with_content_type_charset(self):
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data,
                              content_type='application/json; charset=utf-8')
        self.assert201(status)
        self.assertPostResponse(r)

    def test_post_with_extra_response_fields(self):
        self.domain['contacts']['extra_response_fields'] = ['ref', 'notreally']
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        self.assertTrue('ref' in r and 'notreally' not in r)

    def test_post_write_concern(self):
        # should get a 500 since there's no replicaset on mongod test instance
        self.domain['contacts']['mongo_write_concern'] = {'w': 2}
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        _, status = self.post(self.known_resource_url, data=data)
        self.assert500(status)
        # 0 and 1 are the only valid values for 'w' on our mongod instance
        self.domain['contacts']['mongo_write_concern'] = {'w': 0}
        test_value = "1234567890123456789054329"
        data = {test_field: test_value}
        _, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)

    def test_post_with_get_override(self):
        # a GET request with POST override turns into a POST request.
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = json.dumps({test_field: test_value})
        headers = [('X-HTTP-Method-Override', 'POST'),
                   ('Content-Type', 'application/json')]
        r = self.test_client.get(self.known_resource_url, data=data,
                                 headers=headers)
        self.assert201(r.status_code)
        self.assertPostResponse(json.loads(r.get_data()))

    def test_post_list_of_objectid(self):
        objectid = '50656e4538345b39dd0414f0'
        del(self.domain['contacts']['schema']['ref']['required'])
        data = {'id_list': ['%s' % objectid]}
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        r, status = self.get(self.known_resource, '?where={"id_list": '
                             '{"$in": ["%s"]}}' % objectid)
        self.assert200(status)
        self.assertTrue(len(r), 1)
        self.assertTrue('%s' % objectid in r['_items'][0]['id_list'])

    def test_post_nested_dict_objectid(self):
        objectid = '50656e4538345b39dd0414f0'
        del(self.domain['contacts']['schema']['ref']['required'])
        data = {'id_list_of_dict': [{'id': '%s' % objectid}]}
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        r, status = self.get(self.known_resource,
                             '?where={"id_list_of_dict.id": ' '"%s"}'
                             % objectid)
        self.assertTrue(len(r), 1)
        self.assertTrue('%s' % objectid in
                        r['_items'][0]['id_list_of_dict'][0]['id'])

    def test_post_list_fixed_len(self):
        objectid = '50656e4538345b39dd0414f0'
        del(self.domain['contacts']['schema']['ref']['required'])
        data = {'id_list_fixed_len': ['%s' % objectid]}
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        r, status = self.get(self.known_resource,
                             '?where={"id_list_fixed_len": '
                             '{"$in": ["%s"]}}' % objectid)
        self.assert200(status)
        self.assertTrue(len(r), 1)
        self.assertTrue('%s' % objectid in r['_items'][0]['id_list_fixed_len'])

    def test_custom_issues(self):
        self.app.config['ISSUES'] = 'errors'
        r, status = self.post(self.known_resource_url, data={"ref": "123"})
        self.assertValidationErrorStatus(status)
        self.assertTrue('errors' in r and ISSUES not in r)

    def test_custom_status(self):
        self.app.config['STATUS'] = 'report'
        r, status = self.post(self.known_resource_url, data={"ref": "123"})
        self.assertValidationErrorStatus(status)
        self.assertTrue('report' in r and STATUS not in r)

    def test_custom_etag_update_date(self):
        self.app.config['ETAG'] = '_myetag'
        r, status = self.post(self.known_resource_url,
                              data={"ref": "1234567890123456789054321"})
        self.assert201(status)
        self.assertTrue('_myetag' in r and ETAG not in r)

    def test_custom_date_updated(self):
        self.app.config['LAST_UPDATED'] = '_update_date'
        r, status = self.post(self.known_resource_url,
                              data={"ref": "1234567890123456789054321"})
        self.assert201(status)
        self.assertTrue('_update_date' in r and LAST_UPDATED not in r)

    def test_subresource(self):
        response, status = self.post('users/%s/invoices' %
                                     self.item_id, data={})
        self.assert201(status)
        self.assertPostResponse(response)

        invoice_id = response.get(self.app.config['ID_FIELD'])
        response, status = self.get('users/%s/invoices/%s' %
                                    (self.item_id, invoice_id))
        self.assert200(status)
        self.assertEqual(response.get('person'), self.item_id)

    def test_subresource_required_ref(self):
        response, status = self.post('users/%s/required_invoices' %
                                     self.item_id, data={})
        self.assert201(status)
        self.assertPostResponse(response)

        invoice_id = response.get(self.app.config['ID_FIELD'])
        response, status = self.get('users/%s/required_invoices/%s' %
                                    (self.item_id, invoice_id))
        self.assert200(status)
        self.assertEqual(response.get('person'), self.item_id)

    def test_post_ifmatch_disabled(self):
        # if IF_MATCH is disabled, then we get no etag in the payload.
        self.app.config['IF_MATCH'] = False
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data)
        self.assertTrue(ETAG not in r)

    def test_post_custom_idfield(self):
        # test that we can post a document with a custom id_field
        id_field = 'id'
        test_value = '1234'
        data = {id_field: test_value}

        self.app.config['ID_FIELD'] = id_field

        # custom id_fields also need to be included in the resource schema
        self.domain['contacts']['schema'][id_field] = {
            'type': 'string',
            'required': True,
            'unique': True
        }
        del(self.domain['contacts']['schema']['ref']['required'])

        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        self.assertTrue(id_field in r)
        self.assertItemLink(r['_links'], r[id_field])

    def test_post_bandwidth_saver(self):
        data = {'inv_number': self.random_string(10)}

        # bandwidth_saver is on by default
        self.assertTrue(self.app.config['BANDWIDTH_SAVER'])
        r, status = self.post(self.empty_resource_url, data=data)
        self.assert201(status)
        self.assertPostResponse(r)
        self.assertFalse('inv_number' in r)
        etag = r[self.app.config['ETAG']]
        r, status = self.get(
            self.empty_resource, '', r[self.app.config['ID_FIELD']])
        self.assertEqual(etag, r[self.app.config['ETAG']])

        # test return all fields (bandwidth_saver off)
        self.app.config['BANDWIDTH_SAVER'] = False
        r, status = self.post(self.empty_resource_url, data=data)
        self.assert201(status)
        self.assertPostResponse(r)
        self.assertTrue('inv_number' in r)
        etag = r[self.app.config['ETAG']]
        r, status = self.get(
            self.empty_resource, '', r[self.app.config['ID_FIELD']])
        self.assertEqual(etag, r[self.app.config['ETAG']])

    def test_post_alternative_payload(self):
        payl = {"ref": "5432112345678901234567890", "role": ["agent"]}
        with self.app.test_request_context(self.known_resource_url):
            r, _, _, status = post(self.known_resource, payl=payl)
        self.assert201(status)
        self.assertPostResponse(r)

    def test_post_dependency_fields_with_default(self):
        # test that default values are resolved before validation. See #353.
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'dependency_field2'
        test_value = 'a value'
        data = {test_field: test_value}
        self.assertPostItem(data, test_field, test_value)

    def test_post_dependency_fields_with_values(self):
        # test that dependencies values are validated correctly. See #547.
        del(self.domain['contacts']['schema']['ref']['required'])

        schema = {
            'field1': {
                'required': False
            },
            'field2': {
                'required': True,
                'dependencies': {'field1': ['one', 'two']}
            }
        }
        settings = {
            'RESOURCE_METHODS': ['GET', 'POST', 'DELETE'],
            'ITEM_METHODS': ['GET', 'PATCH', 'PUT', 'DELETE'],
            'schema': schema
        }
        self.app.register_resource('posts', settings)

        data = {"field1": "three", "field2": 7}
        r, s = self.post('posts', data=data)
        self.assert422(s)

        data = {"field2": 7}
        r, s = self.post('posts', data=data)
        self.assert422(s)

        data = {"field1": "one", "field2": 7}
        r, s = self.post('posts', data=data)
        self.assert201(s)

        data = {"field1": "two", "field2": 7}
        r, s = self.post('posts', data=data)
        self.assert201(s)

    def test_post_readonly_field_with_default(self):
        # test that a read only field with a 'default' setting is correctly
        # validated now that we resolve field values before validation.
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'read_only_field'
        # thou shalt not pass.
        test_value = 'a random value'
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data)
        self.assertValidationErrorStatus(status)
        # this will not pass even if value matches 'default' setting.
        # (hey it's still a read-onlu field so you can't reset it)
        test_value = 'default'
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data)
        self.assertValidationErrorStatus(status)

    def test_post_readonly_in_dict(self):
        # Test that a post with a readonly field inside a dict is properly
        # validated (even if it has a defult value)
        del(self.domain['contacts']['schema']['ref']['required'])
        test_field = 'dict_with_read_only'
        test_value = {'read_only_in_dict': 'default'}
        data = {test_field: test_value}
        r, status = self.post(self.known_resource_url, data=data)
        self.assertValidationErrorStatus(status)

    def test_post_keyschema_dict(self):
        """ make sure Cerberus#48 is fixed """
        del(self.domain['contacts']['schema']['ref']['required'])
        r, status = self.post(self.known_resource_url,
                              data={"keyschema_dict": {"k1": "1"}})
        self.assertValidationErrorStatus(status)
        issues = r[ISSUES]
        self.assertTrue('keyschema_dict' in issues)
        self.assertEqual(issues['keyschema_dict'],
                         {'k1': 'must be of integer type'})

        r, status = self.post(self.known_resource_url,
                              data={"keyschema_dict": {"k1": 1}})
        self.assert201(status)

    def test_post_internal(self):
        # test that post_internal is available and working properly.
        test_field = 'ref'
        test_value = "1234567890123456789054321"
        payload = {test_field: test_value}
        with self.app.test_request_context(self.known_resource_url):
            r, _, _, status = post_internal(self.known_resource, payl=payload)
        self.assert201(status)

    def test_post_nested(self):
        del(self.domain['contacts']['schema']['ref']['required'])
        data = {'location.city': 'a nested city',
                'location.address': 'a nested address'}
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        values = self.compare_post_with_get(r[ID_FIELD], ['location']).pop()
        self.assertEqual(values['city'], 'a nested city')
        self.assertEqual(values['address'], 'a nested address')

    def perform_post(self, data, valid_items=[0]):
        r, status = self.post(self.known_resource_url, data=data)
        self.assert201(status)
        self.assertPostResponse(r, valid_items)
        return r

    def assertPostItem(self, data, test_field, test_value):
        r = self.perform_post(data)
        item_id = r[ID_FIELD]
        item_etag = r[ETAG]
        db_value = self.compare_post_with_get(item_id, [test_field, ETAG])
        self.assertTrue(db_value[0] == test_value)
        self.assertTrue(db_value[1] == item_etag)

    def assertPostResponse(self, response, valid_items=[0], id_field=ID_FIELD):
        if '_items' in response:
            results = response['_items']
        else:
            results = [response]

        for i in valid_items:
            item = results[i]
            self.assertTrue(STATUS in item)
            self.assertTrue(STATUS_OK in item[STATUS])
            self.assertFalse(ISSUES in item)
            self.assertTrue(ID_FIELD in item)
            self.assertTrue(LAST_UPDATED in item)
            self.assertTrue('_links' in item)
            self.assertItemLink(item['_links'], item[ID_FIELD])
            self.assertTrue(ETAG in item)

    def compare_post_with_get(self, item_id, fields):
        raw_r = self.test_client.get("%s/%s" % (self.known_resource_url,
                                                item_id))
        item, status = self.parse_response(raw_r)
        self.assert200(status)
        self.assertTrue(ID_FIELD in item)
        self.assertTrue(item[ID_FIELD] == item_id)
        self.assertTrue(DATE_CREATED in item)
        self.assertTrue(LAST_UPDATED in item)
        self.assertEqual(item[DATE_CREATED], item[LAST_UPDATED])
        if isinstance(fields, list):
            return [item[field] for field in fields]
        else:
            return item[fields]

    def post(self, url, data, headers=[], content_type='application/json'):
        headers.append(('Content-Type', content_type))
        r = self.test_client.post(url, data=json.dumps(data), headers=headers)
        return self.parse_response(r)

class TestEvents(TestBase):
    new_contact_id = "0123456789012345678901234"

    def test_on_pre_POST(self):
        devent = DummyEvent(self.before_insert)
        self.app.on_pre_POST += devent
        self.post()
        self.assertFalse(devent.called is None)

    def test_on_pre_POST_contacts(self):
        devent = DummyEvent(self.before_insert)
        self.app.on_pre_POST_contacts += devent
        self.post()
        self.assertFalse(devent.called is None)

    def test_on_post_POST(self):
        devent = DummyEvent(self.after_insert)
        self.app.on_post_POST += devent
        self.post()
        self.assertEqual(devent.called[0], self.known_resource)

    def test_on_POST_post_resource(self):
        devent = DummyEvent(self.after_insert)
        self.app.on_post_POST_contacts += devent
        self.post()
        self.assertFalse(devent.called is None)

    def test_on_insert(self):
        devent = DummyEvent(self.before_insert, True)
        self.app.on_insert += devent
        self.post()
        self.assertEqual(self.known_resource, devent.called[0])
        self.assertEqual(self.new_contact_id, devent.called[1][0]['ref'])

    def test_on_insert_contacts(self):
        devent = DummyEvent(self.before_insert, True)
        self.app.on_insert_contacts += devent
        self.post()
        self.assertEqual(self.new_contact_id, devent.called[0][0]['ref'])

    def test_on_inserted(self):
        devent = DummyEvent(self.after_insert, True)
        self.app.on_inserted += devent
        self.post()
        self.assertEqual(self.known_resource, devent.called[0])
        self.assertEqual(self.new_contact_id, devent.called[1][0]['ref'])

    def test_on_inserted_contacts(self):
        devent = DummyEvent(self.after_insert, True)
        self.app.on_inserted_contacts += devent
        self.post()
        self.assertEqual(self.new_contact_id, devent.called[0][0]['ref'])

    def post(self):
        headers = [('Content-Type', 'application/json')]
        data = json.dumps({"ref": self.new_contact_id})
        self.test_client.post(
            self.known_resource_url, data=data, headers=headers)

    def before_insert(self):
        db = self.connection[MONGO_DBNAME]
        return db.contacts.find_one({"ref": self.new_contact_id}) is None

    def after_insert(self):
        return not self.before_insert()


text:
//
//  YXDLockScreenView.h
//
//  Created by dd .
//  Copyright (c) 2015年 YangXudong. All rights reserved.
//

#import <UIKit/UIKit.h>

//解锁通知
static NSString *YXDDisLockScreenNotification   = @"YXDDisLockScreenNotification";
//设置密码成功通知
static NSString *YXDCreatePasswordNotification  = @"YXDCreatePasswordNotification";
//删除密码成功通知
static NSString *YXDDeletePasswordNotification  = @"YXDDeletePasswordNotification";

@interface YXDLockScreenView : UIControl

/**
 *  是否需要 锁屏/解锁   并选择是否需要动画
 *
 *  @param lockScreen 锁屏/解锁
 *  @param animated   是否需要动画
 */
+ (void) lockScreen:(BOOL)lockScreen animated:(BOOL)animated;

/**
 *  是否在锁屏状态
 */
+ (BOOL) isLocking;

/**
 *  用户是否设有密码
 */
+ (BOOL) userHasPassword;

/**
 *  如果没有密码 则创建密码   如果有密码 则删除密码
 */
+ (void) modifyPassword;

@end


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
NHttpClientConnection (HttpComponents Core 4.2.2 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.http.nio.NHttpClientConnection interface">

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.apache.http.nio

Interface NHttpClientConnection

All Superinterfaces:
Closeable, HttpConnection, IOControl, NHttpConnection

All Known Subinterfaces:
NHttpClientIOTarget

All Known Implementing Classes:
DefaultNHttpClientConnection

public interface NHttpClientConnection
extends NHttpConnection

Abstract non-blocking client-side HTTP connection interface. It can be used
 to submit HTTP requests and asynchronously receive HTTP responses.

Since:

4.0

See Also:
NHttpConnection

Field Summary

Fields inherited from interface org.apache.http.nio.NHttpConnection

ACTIVE, CLOSED, CLOSING

Method Summary

 boolean
isRequestSubmitted()

          Returns true if an HTTP request has been submitted to the
 target server.

 void
resetInput()

          Resets input state.

 void
resetOutput()

          Resets output state.

 void
submitRequest(HttpRequest request)

          Submits HttpRequest to be sent to the target server.

Methods inherited from interface org.apache.http.nio.NHttpConnection

getContext, getHttpRequest, getHttpResponse, getStatus

Methods inherited from interface org.apache.http.HttpConnection

close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown

Methods inherited from interface org.apache.http.nio.IOControl

requestInput, requestOutput, shutdown, suspendInput, suspendOutput

Method Detail

submitRequest

void submitRequest(HttpRequest request)
                   throws IOException,
                          HttpException

Submits HttpRequest to be sent to the target server.

Parameters:
request - HTTP request

Throws:

IOException - if I/O error occurs while submitting the request

HttpException - if the HTTP request violates the HTTP protocol.

isRequestSubmitted

boolean isRequestSubmitted()

Returns true if an HTTP request has been submitted to the
 target server.

Returns:
true if an HTTP request has been submitted,
 false otherwise.

resetOutput

void resetOutput()

Resets output state. This method can be used to prematurely terminate
 processing of the outgoing HTTP request.

resetInput

void resetInput()

Resets input state. This method can be used to prematurely terminate
 processing of the incoming HTTP response.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.


text:
package org.semanticweb.elk.owl.implementation;

import java.util.List;

import org.semanticweb.elk.owl.interfaces.ElkObjectPropertyChain;
import org.semanticweb.elk.owl.interfaces.ElkObjectPropertyExpression;
import org.semanticweb.elk.owl.visitors.ElkObjectPropertyChainVisitor;
import org.semanticweb.elk.owl.visitors.ElkObjectVisitor;
import org.semanticweb.elk.owl.visitors.ElkSubObjectPropertyExpressionVisitor;

public class ElkObjectPropertyChainImpl extends
		ElkObjectPropertyExpressionListObject implements ElkObjectPropertyChain {

	ElkObjectPropertyChainImpl(
			List<? extends ElkObjectPropertyExpression> properties) {
		super(properties);
	}

	@Override
	public <O> O accept(ElkSubObjectPropertyExpressionVisitor<O> visitor) {
		return accept((ElkObjectPropertyChainVisitor<O>) visitor);
	}

	@Override
	public <O> O accept(ElkObjectVisitor<O> visitor) {
		return accept((ElkObjectPropertyChainVisitor<O>) visitor);
	}

	@Override
	public <O> O accept(ElkObjectPropertyChainVisitor<O> visitor) {
		return visitor.visit(this);
	}

}


text:
import mongoose from 'mongoose';

let PolicySchema = new mongoose.Schema({
	policyNumber: {type: String},
	annexedNumber: {type: String},
	certificateNumber: {type: String},
	idInsurance: {type: String},
	insurance: { type: mongoose.Schema.ObjectId, ref: "Insurance"},
	idRamo: {type: String},
	ramo: { type: mongoose.Schema.ObjectId, ref: "Ramo"},
	typeRecipient: {type: String},
	idRecipient: {type: String}, //CLIENT, BUSINESS, INSURANCE, USER
	recipient: {type: Object},
	idPaymentType: {type: String},
	porcentajeRamo: {type: Number},
	guarantor: {type: String},
	idDeductible: {type: String},
	deductible: { type: mongoose.Schema.ObjectId, ref: "Deductible"},
	futureYears: {type: Boolean},
	insured: {type: String},
	startDate: {type: Date},
	finishDate: {type: Date},
	daysofValidity: {type: Number},
	idPolicyType: {type: String},
	policyType: { type: mongoose.Schema.ObjectId, ref: "PolicyType"},
	idFrequencyPayment: {type: String},
	frequencyPayment: { type: mongoose.Schema.ObjectId, ref: "FrequencyPayment"},
	idCity: {type: String},
	city: { type: mongoose.Schema.ObjectId, ref: "City"},
	dateAdmission: {type: String},
	dateCancellation: {type: String},
	dateCreate: {type: Date, require: true},
	userCreate: {type: String, require: true},
	branchCreate: {type: String, require: true},
	dateUpdate: {type: Date, require: true},
	userUpdate: {type: String, require: true},
	idPlan:{type: String},
	dateDelete: {type: Date}
});

export default mongoose.model('Policy', PolicySchema)


text:
@interface SettingViewController : UIViewController

- (IBAction)btnBlk1:(id)sender;
- (IBAction)btnBlk2:(id)sender;
- (IBAction)btnBlk3:(id)sender;
- (IBAction)btnBlk4:(id)sender;
- (IBAction)btnBlk5:(id)sender;
- (IBAction)btnBlk6:(id)sender;
- (IBAction)btnBlk7:(id)sender;
- (IBAction)btnBlk8:(id)sender;
- (IBAction)btnBlk9:(id)sender;
- (IBAction)btnBlk10:(id)sender;

@end


text:
'use strict';
var cursors, jumpButton;
var jumpTimer, slideTimer;
var jumpAnim;
var jumpCount, jumpLimit;
var effect;

BasicGame.Hero = function (game, x, y, frame, isDummy, name) {
	//console.log(BasicGame.CharSelect.prototype);
	Phaser.Sprite.call(this, game, x, y, BasicGame.selectedChar, frame);
	this.isDummy = isDummy;
	this.name = name;
	console.log(this.name);

	// Max jumps
	this.jumpCount = 0;
	this.jumpLimit = 2;
	this.jumpTimer = 0;
	this.jumpStrength = -1200;
	this.moveSpeed = 800;
	this.skillACooldown = 1000;
	this.skillBCooldown = 1000;
	this.skillCCooldown = 1000;
	this.skillDCooldown = 1000;

	// Enable physics
	this.game.physics.arcade.enableBody(this);

	// Set invidual scale and collider
	if (BasicGame.selectedChar === "player_ninja") {
		this.scaleX = 0.32;
		this.scaleY = 0.32;
		this.body.setSize(220, 440, 0, -5);
	} else if (BasicGame.selectedChar === "player_robot") {
		this.scaleX = 0.3;
		this.scaleY = 0.3;
		this.body.setSize(230, 470, 0, 0);
	} else if (BasicGame.selectedChar === "player_cowgirl") {
		this.scaleX = 0.3;
		this.scaleY = 0.3;
		this.body.setSize(250, 470, 0, 0);
	} else {
		this.scaleX = 0.25;
		this.scaleY = 0.25;
		this.body.setSize(300, 540, 0, 5);
	}

	// Set anchor to middle
	this.anchor.setTo(0.5, 0.5);

	// Set scale
	this.scale.x = this.scaleX;
	this.scale.y = this.scaleY;

	// Add animations of player, can refer to json
	// generateFrameNames takes in a suffix, followed by range of index, so for example ('Idle ', 1, 10) will produce an
	// array ['Idle 1', 'Idle 2', ..... 'Idle 10'] to automate it for you
	// 16 is frame rate, boolean is whether animation should loop
	this.animations.add('anim_idle', Phaser.Animation.generateFrameNames('Idle ', 1, 10), 16, true);
	this.animations.add('anim_run', Phaser.Animation.generateFrameNames('Walk__00', 0, 9), 16, true);
	this.animations.add('anim_attack', Phaser.Animation.generateFrameNames('Shoot__00', 0, 9), 16, false);
	this.animations.add('anim_jump', Phaser.Animation.generateFrameNames('Jump__00', 0, 9), 16, false);
	this.animations.add('anim_dead', Phaser.Animation.generateFrameNames('Dead__00', 0, 9), 16, false);

	// Controls
	this.cursors = this.game.input.keyboard.createCursorKeys();
	this.jumpButton = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
	this.skillA = this.game.input.keyboard.addKey(Phaser.Keyboard.A);
	this.skillB = this.game.input.keyboard.addKey(Phaser.Keyboard.S);
	this.skillC = this.game.input.keyboard.addKey(Phaser.Keyboard.D);
	this.skillD = this.game.input.keyboard.addKey(Phaser.Keyboard.F);

	this.skillATimer = 0;
	this.skillBTimer = 0;
	this.skillCTimer = 0;
	this.skillDTimer = 0;

	// Keep track of animation
	this.jumpAnim = this.animations.getAnimation('anim_jump');
	this.attackAnim = this.animations.getAnimation('anim_attack');
	this.attackAnim.onComplete.add(this.attackCallback, this);

	// Effect
	this.effectName = 'anim_';
	this.effectCount = 1;
	this.effectTimer = 0;

	// Add this object into existing game
	this.game.add.existing(this);

	// Each hero will have an effect object which basically plays whatever effect they have
	this.effect = new BasicGame.Effect(this.game, 100, 1000, 'blood_effect_sprite', false, 0);
	this.game.add.existing(this.effect);

    this.attackCollider = new BasicGame.Collider(this.game, this);
    this.game.add.existing(this.attackCollider);
    BasicGame.colliderCG.add(this.attackCollider);

	this.facingRight = 1;
}

// Kind of like inherts Sprite
BasicGame.Hero.prototype = Object.create(Phaser.Sprite.prototype);
BasicGame.Hero.prototype.constructor = BasicGame.Player;

BasicGame.Hero.prototype.update = function() {
	if (!this.isDummy) {
		this.handleControls();
		//this.game.debug.body(this);
	} else {
		this.animations.play('anim_idle');
		//this.game.debug.spriteInfo(this, 32, 32);
		this.game.debug.body(this);
	}
};

BasicGame.Hero.prototype.handleControls = function() {
	this.body.velocity.x = 0;

    if (this.skillA.isDown && this.game.time.now > this.effectTimer) {

    	/*this.effect.play(this.effectName + this.effectCount, this);
    	this.effectCount++;
    	if (this.effectCount > 4) {
    		this.effectCount = 1;
    	}*//*
		var test = this.game.add.tween(this.body.velocity);
		test.to({x: 1500 * this.facingRight}, 250, Phaser.Easing.Cubic.Out);
		test.start();

    	// Play the animation
    	this.animations.play('anim_attack');

    	var projectile = new BasicGame.Effect(this.game, this.x, this.y, 'bolt_effect_sprite', true, 1);
    	this.game.add.existing(projectile);
    	projectile.play('anim_1', this);

    	BasicGame.projectileCG.add(projectile);

    	this.effectTimer = this.game.time.now + 500;
    	this.jumpCount = 0;*/
    }
    this.handleSkillA();
    this.handleSkillB();

	// If moving left
	if (this.cursors.left.isDown && !this.attackAnim.isPlaying) {
		this.facingRight = -1;
    	this.scale.x = -this.scaleX;
		this.body.velocity.x = -this.moveSpeed;

		if (this.body.onFloor()) {
			this.animations.play('anim_run');
		}

	} else if (this.cursors.right.isDown && !this.attackAnim.isPlaying) {
		this.facingRight = 1;
    	this.scale.x = this.scaleX;
		this.body.velocity.x = this.moveSpeed;

		if (this.body.onFloor()) {
			this.animations.play('anim_run');
		}
	}
	//console.log(jumpCount);

	// If jump is pressed, body is on floor, and jump timer is over&& this.body.onFloor()
 	if (this.cursors.up.isDown  && this.game.time.now > this.jumpTimer && this.jumpCount < this.jumpLimit)
    {
    	if (this.jumpCount > 0) {
    		//this.animations.stop(null, true);
    		this.jumpAnim.frame = 0;
    	}
    	//console.log("jump");
        this.body.velocity.y = this.jumpStrength;
        this.jumpTimer = this.game.time.now + 350;
		this.animations.play('anim_jump');
		this.jumpCount++;
    }
    // Idle | if not moving and on the floor
    else if (this.body.velocity.x == 0 && this.body.onFloor()  && !this.attackAnim.isPlaying) {
    	this.animations.play('anim_idle');
    	this.jumpCount = 0;
    }
    else if (this.body.onFloor()) {
    	this.jumpCount = 0;
    }
};

BasicGame.Hero.prototype.handleSkillA = function() {
	if (this.skillA.isDown && this.game.time.now > this.skillATimer) {
		var skillTween = this.game.add.tween(this.body.velocity);
		skillTween.to({x: 1500 * this.facingRight}, 250, Phaser.Easing.Cubic.Out);
		skillTween.start();

    	// Play the animation
    	this.animations.play('anim_attack');
		this.skillATimer = this.game.time.now + this.skillACooldown;
		this.attackCollider.activate();
	}

};

BasicGame.Hero.prototype.handleSkillB = function() {
	if (this.skillB.isDown && this.game.time.now > this.skillBTimer) {
		var skillTween = this.game.add.tween(this.body.velocity);
		skillTween.to({x: 2000 * this.facingRight}, 100, Phaser.Easing.Linear.None);
		skillTween.to({y: -2000}, 10, Phaser.Easing.Linear.None);
		skillTween.start();

    	// Play the animation
    	this.animations.play('anim_attack');
		this.skillBTimer = this.game.time.now + this.skillBCooldown;
		this.attackCollider.activate();
	}

};

BasicGame.Hero.prototype.attackCallback = function() {
	this.attackCollider.deactivate();
};

BasicGame.Hero.prototype.getHit = function() {
	this.effect.play('anim_4', this);
};

BasicGame.Hero.prototype.render = function() {
	game.debug.bodyInfo(this, 32, 32);
	game.debug.body(this);
}


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.validator.constraintvalidation;

import java.util.List;

import jakarta.validation.ConstraintValidatorContext;

import org.hibernate.validator.Incubating;

/**
 * A custom {@link ConstraintValidatorContext} which provides additional functionality for cross parameter validation contexts.
 *
 * @author Marko Bekhta
 * @since 6.1.0
 */
@Incubating
public interface HibernateCrossParameterConstraintValidatorContext extends HibernateConstraintValidatorContext {

	/**
	 * @return the list of the parameter names of the validated method.
	 */
	List<String> getMethodParameterNames();
}