text:
"""
Dialog report panel to show and summarize the results of
the invariant calculation.
"""
import wx
import os
import sys
import logging

from sas.sasgui.guiframe.report_dialog import BaseReportDialog

logger = logging.getLogger(__name__)

class ReportDialog(BaseReportDialog):
    """
    The report dialog box.
    """

    def __init__(self, report_list, *args, **kwds):
        """
        Initialization. The parameters added to Dialog are:

        :param report_list: list of html_str, text_str, image
        from invariant_state
        """
        super(ReportDialog, self).__init__(report_list, *args, **kwds)

        # title
        self.SetTitle("Report: Invariant computaion")

        # put image path in the report string
        self.report_html = self.report_list[0] % "memory:img_inv.png"
        # layout
        self._setup_layout()

    def onSave(self, event=None):
        """
        Save
        """
        # todo: complete saving fig file and as a txt file
        dlg = wx.FileDialog(self, "Choose a file",
                            wildcard=self.wild_card,
                            style=wx.SAVE | wx.OVERWRITE_PROMPT | wx.CHANGE_DIR)
        dlg.SetFilterIndex(0)  # Set .html files to be default

        if dlg.ShowModal() != wx.ID_OK:
            dlg.Destroy()
            return

        fName = dlg.GetPath()
        ext_num = dlg.GetFilterIndex()
        # set file extensions
        if ext_num == (0 + 2 * self.index_offset):
            # TODO: Sort this case out
            ext = '.pdf'
            img_ext = '_img.png'
            fName = os.path.splitext(fName)[0] + ext
            dlg.Destroy()

            # pic (png) file path/name
            pic_fname = os.path.splitext(fName)[0] + img_ext
            # save the image for use with pdf writer
            self.report_list[2].savefig(pic_fname)

            # put the image file path in the html data
            html = self.report_list[0] % str(pic_fname)

            # make/open file in case of absence
            f = open(fName, 'w')
            f.close()
            # write pdf as a pdf file
            pdf = self.HTML2PDF(data=html, filename=fName)

            # open pdf
            if pdf:
                try:
                    # Windows
                    os.startfile(str(fName))
                except:
                    try:
                        # Mac
                        os.system("open %s" % fName)
                    except:
                        # DO not open
                        logger.error("Could not open file: %s" % sys.exc_value)
            # delete image file
            os.remove(pic_fname)
            return
        elif ext_num == (1 - self.index_offset):
            ext = '.html'
            img_ext = '_img4html.png'
            report_frame = self.report_list[0]
        elif ext_num == (2 - self.index_offset):
            ext = '.txt'
            # changing the image extension actually changes the image
            # format on saving
            img_ext = '_img4txt.pdf'
            report = self.report_list[1]
        else:
            return

        # file name
        fName = os.path.splitext(fName)[0] + ext
        dlg.Destroy()
        # pic (png) file path/name
        pic_fname = os.path.splitext(fName)[0] + img_ext
        # put the image path in html string
        if ext_num == (1 - self.index_offset):
            report = report_frame % os.path.basename(pic_fname)

        f = open(fName, 'w')
        f.write(report)
        f.close()
        # save png file using pic_fname
        self.report_list[2].savefig(pic_fname)


text:
#region License

// Copyright (c) 2007 - 2014, Northwestern University, Vladimir Kleper, Skip Talbot
// and Pattanasak Mongkolwat.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   Redistributions of source code must retain the above copyright notice,
//   this list of conditions and the following disclaimer.
//
//   Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
//
//   Neither the name of the National Cancer Institute nor Northwestern University
//   nor the names of its contributors may be used to endorse or promote products
//   derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#endregion

using System.Collections.Generic;
using ClearCanvas.Common;
using ClearCanvas.Desktop;
using ClearCanvas.Desktop.Actions;

namespace SearchComponent
{
	[MenuAction("apply", NBIAExplorer.ToolbarSite + "/MenuRetrieveStudy", "Apply")]
	[ButtonAction("apply", NBIAExplorer.MenuSite + "/ToolRetrieveStudy", "Apply")]
	[Tooltip("apply", "Retrieve Selected Studies")]
	[IconSet("apply", "Icons.NBIARetrieveToolSmall.png", "Icons.NBIARetrieveToolMedium.png", "Icons.NBIARetrieveToolLarge.png")]

	[EnabledStateObserver("apply", "Enabled", "EnabledChanged")]

	[ExtensionOf(typeof(NBIASearchResultsToolExtensionPoint))]
	public class NBIARetrieveTool : SearchBaseTool
	{
		public NBIARetrieveTool()
		{
		}

		public void Apply()
		{
			ISelection selection = base.Context.Selection;
			if (selection == null || selection.Items == null)
				return;

			List<RetrieveQueryItem> queryItems = new List<RetrieveQueryItem>();
			foreach (NBIASearchResult result in selection.Items)
			{
				if (!string.IsNullOrEmpty(result.Study.StudyInstanceUid))
				{
					RetrieveQueryItem queryItem = new RetrieveQueryItem();
					queryItem.Study.StudyInstanceUid = result.Study.StudyInstanceUid;
					queryItem.Patient.PatientBirthDate = result.Patient.PatientBirthDate;
					queryItem.Patient.PatientId = result.Patient.PatientId;
					queryItem.Patient.PatientsName = result.Patient.PatientsName;
					queryItem.Patient.PatientsSex = result.Patient.PatientsSex;
					Series series = new Series();
					series.Modality = result.Series.Modality;
					series.SeriesInstanceUid = result.Series.SeriesInstanceUid;
					queryItem.Series.Add(series);

					queryItems.Add(queryItem);
				}
			}

			RetrieveCoordinator.Coordinator.RetrieveStudies(queryItems);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
import os
import subprocess

import pytest
from chalice.utils import OSUtils

CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIR = os.path.join(
    os.path.dirname(CURRENT_DIR),
    'aws',
    'testapp',
)

@pytest.fixture
def local_app(tmpdir):
    temp_dir_path = str(tmpdir)
    OSUtils().copytree(PROJECT_DIR, temp_dir_path)
    old_dir = os.getcwd()
    try:
        os.chdir(temp_dir_path)
        yield temp_dir_path
    finally:
        os.chdir(old_dir)

def test_stack_trace_printed_on_error(local_app):
    app_file = os.path.join(local_app, 'app.py')
    with open(app_file, 'w') as f:
        f.write(
            'from chalice import Chalice\n'
            'app = Chalice(app_name="test")\n'
            'foobarbaz\n'
        )
    p = subprocess.Popen(['chalice', 'local', '--no-autoreload'],
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stderr = p.communicate()[1].decode('ascii')
    rc = p.returncode

    assert rc == 2
    assert 'Traceback' in stderr
    assert 'foobarbaz' in stderr


text:
@interface ViewController : UITableViewController

@property(nonatomic, strong) UIWindow *window;
@end


text:
package org.apache.ignite.yardstick.cache.failover;

/**
 * Transactional write read failover benchmark.
 * <p>
 * Each client generates a random integer K in a limited range and creates keys in the form 'key-' + K + '-1',
 * 'key-' + K + '-2', ... Then client starts a pessimistic repeatable read transaction, reads value associated with
 * each key. Values must be equal. Client increments value by 1, commits the transaction.
 */
public class IgniteTransactionalOffHeapWriteReadBenchmark extends IgniteTransactionalWriteReadBenchmark {
    /** {@inheritDoc} */
    @Override protected String cacheName() {
        return "tx-offheap-write-read";
    }
}


text:
for i in `seq 1 1 10`
do
	Rscript NB_performance.R $i
	Rscript SVM_performance.R $i
done


text:
cweb: cweb.o helper.o servreq.o reqhead.o resphead.o resource.o
	gcc -o cweb cweb.o helper.o servreq.o reqhead.o resphead.o resource.o -Wall

cweb.o: cweb.c helper.h servreq.h
	gcc -o cweb.o cweb.c -c -ansi -pedantic -Wall

helper.o: helper.c helper.h
	gcc -o helper.o helper.c -c -ansi -pedantic -Wall

servreq.o: servreq.c servreq.h helper.h
	gcc -o servreq.o servreq.c -c -ansi -pedantic -Wall

reqhead.o: reqhead.c reqhead.h servreq.h helper.h
	gcc -o reqhead.o reqhead.c -c -ansi -pedantic -Wall

resphead.o: resphead.c resphead.h helper.h
	gcc -o resphead.o resphead.c -c -ansi -pedantic -Wall

resource.o: resource.c resource.h
	gcc -o resource.o resource.c -c -ansi -pedantic -Wall


text:
import math

# A 2D vector.
class Vector2(object):
    def __init__(self, x, y):
        self.x = float(x)
        self.y = float(y)

    def __str__(self):
        return "Vector2[%g,%g]" % (self.x, self.y)

    def __repr__(self):
        return str(self)

    def __hash__(self):
        return hash((self.x, self.y))

    def __eq__(self, other):
        return (self.x, self.y) == (other.x, other.y)

    def __neg__(self):
        return Vector2(-self.x, -self.y)

    def __add__(self, other):
        return Vector2(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Vector2(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return Vector2(self.x*other, self.y*other)

    def __div__(self, other):
        return Vector2(self.x/other, self.y/other)

    def dot(self, other):
        return self.x*other.x + self.y*other.y

    def length(self):
        return math.sqrt(self.dot(self))

    def normalized(self):
        return self/self.length()

    # Component-wise min.
    def min(self, other):
        return Vector2(min(self.x, other.x), min(self.y, other.y))

    # Component-wise max.
    def max(self, other):
        return Vector2(max(self.x, other.x), max(self.y, other.y))

    # Rotated 90 counter-clockwise.
    def reciprocal(self):
        return Vector2(-self.y, self.x)

    # Returns angle in radians.
    def angle(self):
        return math.atan2(self.y, self.x)

    def flipX(self):
        return Vector2(-self.x, self.y)

    def flipY(self):
        return Vector2(self.x, -self.y)

# A 3D vector.
class Vector3(object):
    def __init__(self, x, y, z):
        self.x = float(x)
        self.y = float(y)
        self.z = float(z)

    def __str__(self):
        return "Vector3[%g,%g,%g]" % (self.x, self.y, self.z)

    def __repr__(self):
        return str(self)

    def __neg__(self):
        return Vector3(-self.x, -self.y, -self.z)

    def __add__(self, other):
        return Vector3(self.x + other.x, self.y + other.y, self.z + other.z)

    def __sub__(self, other):
        return Vector3(self.x - other.x, self.y - other.y, self.z - other.z)

    def __mul__(self, other):
        return Vector3(self.x*other, self.y*other, self.z*other)

    def __div__(self, other):
        return Vector3(self.x/other, self.y/other, self.z/other)

    def dot(self, other):
        return self.x*other.x + self.y*other.y + self.z*other.z

    def length(self):
        return math.sqrt(self.dot(self))

    def normalized(self):
        return self/self.length()

    # Right-handed cross product.
    def cross(self, other):
        a = self
        b = other
        return Vector3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y*b.x)

    # Component-wise min.
    def min(self, other):
        return Vector3(min(self.x, other.x), min(self.y, other.y), min(self.z, other.z))

    # Component-wise max.
    def max(self, other):
        return Vector3(max(self.x, other.x), max(self.y, other.y), max(self.z, other.z))

    # Rotate the 3D vector around the Z axis by "angle", then project on the X
    # plane.
    def project(self, transform, angle):
        # Rotate around Z axis.
        rx = math.cos(angle)*self.x - math.sin(angle)*self.y
        ry = math.sin(angle)*self.x + math.cos(angle)*self.y
        rz = self.z

        x, y = transform.transform(ry, rz)

        return Vector2(x, y)

    # Return a copy of the vertex rotated 90 degrees around the X axis. This is for
    # converting models from around-Y to around-Z.
    def rotatex90(self):
        return Vector3(self.x, -self.z, self.y)


text:
"""Train an agent to solve the WaterWorld task.

In this task, an agent (yellow) tries to catch as much food (green) as possible
while avoiding poisons (red).
This task is based on:
https://cs.stanford.edu/people/karpathy/reinforcejs/waterworld.html

Example command to run this script: `python train_waterworld.py --gpu-id=0`
"""

import argparse
import os
import shutil
import jax

from evojax.task.waterworld import WaterWorld
from evojax.policy.mlp import MLPPolicy
from evojax.algo import PGPE
from evojax import Trainer
from evojax import util

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--pop-size', type=int, default=256, help='ES population size.')
    parser.add_argument(
        '--hidden-size', type=int, default=100, help='Policy hidden size.')
    parser.add_argument(
        '--num-tests', type=int, default=100, help='Number of test rollouts.')
    parser.add_argument(
        '--n-repeats', type=int, default=32, help='Training repetitions.')
    parser.add_argument(
        '--max-iter', type=int, default=500, help='Max training iterations.')
    parser.add_argument(
        '--test-interval', type=int, default=50, help='Test interval.')
    parser.add_argument(
        '--log-interval', type=int, default=10, help='Logging interval.')
    parser.add_argument(
        '--seed', type=int, default=42, help='Random seed for training.')
    parser.add_argument(
        '--center-lr', type=float, default=0.014, help='Center learning rate.')
    parser.add_argument(
        '--std-lr', type=float, default=0.088, help='Std learning rate.')
    parser.add_argument(
        '--init-std', type=float, default=0.069, help='Initial std.')
    parser.add_argument(
        '--gpu-id', type=str, help='GPU(s) to use.')
    parser.add_argument(
        '--debug', action='store_true', help='Debug mode.')
    config, _ = parser.parse_known_args()
    return config

def main(config):
    log_dir = './log/water_world'
    if not os.path.exists(log_dir):
        os.makedirs(log_dir, exist_ok=True)
    logger = util.create_logger(
        name='WaterWorld', log_dir=log_dir, debug=config.debug)
    logger.info('EvoJAX WaterWorld')
    logger.info('=' * 30)

    max_steps = 500
    train_task = WaterWorld(test=False, max_steps=max_steps)
    test_task = WaterWorld(test=True, max_steps=max_steps)
    policy = MLPPolicy(
        input_dim=train_task.obs_shape[0],
        hidden_dims=[config.hidden_size, ],
        output_dim=train_task.act_shape[0],
        output_act_fn='softmax',
    )
    solver = PGPE(
        pop_size=config.pop_size,
        param_size=policy.num_params,
        optimizer='adam',
        center_learning_rate=config.center_lr,
        stdev_learning_rate=config.std_lr,
        init_stdev=config.init_std,
        logger=logger,
        seed=config.seed,
    )

    # Train.
    trainer = Trainer(
        policy=policy,
        solver=solver,
        train_task=train_task,
        test_task=test_task,
        max_iter=config.max_iter,
        log_interval=config.log_interval,
        test_interval=config.test_interval,
        n_repeats=config.n_repeats,
        n_evaluations=config.num_tests,
        seed=config.seed,
        log_dir=log_dir,
        logger=logger,
    )
    trainer.run(demo_mode=False)

    # Test the final model.
    src_file = os.path.join(log_dir, 'best.npz')
    tar_file = os.path.join(log_dir, 'model.npz')
    shutil.copy(src_file, tar_file)
    trainer.model_dir = log_dir
    trainer.run(demo_mode=True)

    # Visualize the policy.
    task_reset_fn = jax.jit(test_task.reset)
    policy_reset_fn = jax.jit(policy.reset)
    step_fn = jax.jit(test_task.step)
    action_fn = jax.jit(policy.get_actions)
    best_params = trainer.solver.best_params[None, :]
    key = jax.random.PRNGKey(0)[None, :]

    task_state = task_reset_fn(key)
    policy_state = policy_reset_fn(task_state)
    screens = []
    for _ in range(max_steps):
        action, policy_state = action_fn(task_state, best_params, policy_state)
        task_state, reward, done = step_fn(task_state, action)
        screens.append(WaterWorld.render(task_state))

    gif_file = os.path.join(log_dir, 'water_world.gif')
    screens[0].save(
        gif_file, save_all=True, append_images=screens[1:], duration=40, loop=0)
    logger.info('GIF saved to {}.'.format(gif_file))

if __name__ == '__main__':
    configs = parse_args()
    if configs.gpu_id is not None:
        os.environ['CUDA_VISIBLE_DEVICES'] = configs.gpu_id
    main(configs)


text:
package algorithm.splay.splayTree;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.google.common.collect.Collections2;

/*
 This program takes an array which contains a permutation of
 0...n-1, and computes a sequence of prefix reversals that sorts
 the permutation.

 It's set up to take a permutation on the command line, like this:

 $ java Pancake 5 4 1 2 0 3
 6
 4
 2
 3

 The output is a sequence of prefixes to reverse in order to sort
 the permutation.

 D. Sleator, September 2012
 */

public class Pancake {
	public static void main(String[] args) {
		int n = 5;
		int[] A = new int[n];

		ArrayList<Integer> permute = new ArrayList<Integer>();
		for (int i = 0; i < n; i++) {
			A[i] = new Integer(i);
			permute.add(A[i]);
		}
		Collection<List<Integer>> allPermutations = Collections2
				.orderedPermutations(permute);

		for (List<Integer> perm : allPermutations) {
			for (int i = 0; i < n; i++) {
				A[i] = new Integer(perm.get(i));
			}
			System.out.print(perm.toString());
			FastSolve FS = new FastSolve(A);
			int[] ans = FS.solve();
			int m = ans.length;
			for (int i = 0; i < m; i++)
				System.out.print(ans[i]);
			System.out.println();
		}
	}
}


text:
package cc.factorie.util.namejuggler

import cc.factorie.util.namejuggler.StringUtils._

object PersonName {
  /**
   * Whenever one field is empty and the other is full, use the full one.  If both are full but don't match, emit a warning.
   * @param primary
   * @param secondary
   * @return
   */
  def merge(primary: PersonName, secondary: PersonName): CanonicalPersonName = {
    new CanonicalPersonName {
      override val preferredFullName = OptionUtils.mergeWarn(primary.preferredFullName, secondary.preferredFullName)
      override val prefixes = primary.prefixes ++ secondary.prefixes
      // ** careful: what if one variant has just the first name, and the other also has middle names?  Or, middle name vs. middle initial, etc.
      override val givenNames = combineGivenNames(Set(primary.givenNames, secondary.givenNames))
      //SeqUtils.mergeWarn(primary.givenNames, secondary.givenNames)
      override val nickNames = primary.nickNames ++ secondary.nickNames
      //OptionUtils.mergeWarn(primary.nickName, secondary.nickName)
      override val surNames = primary.surNames ++ secondary.surNames
      //SetUtils.mergeWarn(primary.surNames,
      // secondary.surNames)
      override val hereditySuffix = OptionUtils.mergeWarn(primary.hereditySuffix, secondary.hereditySuffix)
      override val degrees = primary.degrees ++ secondary.degrees //SeqUtils.mergeWarn(primary.degrees, secondary.degrees)
    }
  }

  def merge(s: Seq[PersonName]): PersonName = s.reduceLeft[PersonName](merge)

  private def bestIfCompatibleMaybeInitial(x: NonemptyString, y: NonemptyString): Option[NonemptyString] = {
    val xx = x.toLowerCase.stripPunctuation
    val yy = y.toLowerCase.stripPunctuation

    if (xx.isEmpty && yy.isEmpty) None
    else if (xx.isEmpty) Some(y)
    else if (yy.isEmpty) Some(x)
    else if (xx == yy) {
      if (x.length > y.length) Some(x) else Some(y)
    }
    else {
      val xI = xx.head
      val yI = yy.head

      if ((xx.length == 1) && xI == yI) Some(y)
      else if ((yy.length == 1) && xI == yI) Some(x)
      else None
    }
  }

  // see also noMismatchingNameOrInitial
  def combineGivenNames(a: Seq[NonemptyString], b: Seq[NonemptyString]): Seq[NonemptyString] = {

    val longer = a //.map(_.toLowerCase.stripPunctuation.n)
    val shorter = b //.map(_.toLowerCase.stripPunctuation.n)

    // should do a real alignment here
    // instead, for now, require that every element of the shorter sequence match something in the longer sequence, in order

    //val (s, l) = if (bb.length >= aa.length) (aa, bb) else (bb, aa)

    def mergeGivenNamesRecursion(longer: List[NonemptyString], shorter: List[NonemptyString]): List[NonemptyString] = {

      if (shorter.isEmpty) longer
      else
      if (longer.isEmpty) shorter
      else {
        bestIfCompatibleMaybeInitial(longer.head, shorter.head).map(
          x => x :: mergeGivenNamesRecursion(longer.tail, shorter.tail) // consume head of each sequence
        ).getOrElse(
          mergeGivenNamesRecursion(longer.tail, shorter) // drop incompatible entry from longer sequence
        )

      }
    }

    mergeGivenNamesRecursion(longer.toList, shorter.toList)

  }

  def combineGivenNames(set: Set[Seq[NonemptyString]]): Seq[NonemptyString] = {
    // ** align all the sequences, allowing initials to align with full names, and output the consensus sequence

    // note we've already decided that these are compatible (one matching

    val longestFirst = set.toList.sortBy((x: Seq[NonemptyString]) => {
      -x.length
    })

    val result = longestFirst.reduceLeft((a, b) => combineGivenNames(a, b))

    result

    // throw new NotImplementedException
    // ** just pick the longest for now

    //val longest = SeqUtils.argMax(set, (s: Seq[NonemptyString]) => s.map(_.length).sum)

    // if there is a tie, pick the one with more elements
    //SeqUtils.argMax(longest, (s: Seq[NonemptyString]) => s.size).head
  }
}

/**
 * An attempt to represent names as a set of canonical atomic fields.  Being really comprehensive and accurate about this is not possible due to too many
 * cultural variations and ambiguities.  Still this should cover most of the cases we care about re authorship of journal articles.
 *
 * A name is not a fixed thing; it is a probabilistic cloud of strings, all denoting the same person.  Here we don't cover the case that a person changes
 * names completely; in that case there are two disjoint clouds of strings, so that should be modeled by allowing a Person to have multiple PersonNames.
 *
 * Here we try to model different representations of "the same name".  Variations may include: omitting some components; using initials for some components;
 * reordering; etc.  The most "different" case to model is that of married names vs. maiden names.  Since one or both of these may appear,
 * but the other name components are not affected, we consider this a case of multiple surnames within one name.
 *
 * Subclasses propagate name fragments around the various representations, in an attempt to provide some reasonable value for each field.
 *
 * Here we want to take multiple name variants as input and coordinate them into a single record.  For instance,
 * if we assert that Amanda Jones and A. Jones-Archer are the same person, then we should later recognize Amanda Archer as a valid variant.
 */
trait PersonName {
  /** Out of the cloud of possible name representations, the person probably prefers one variant.  This is how we know to use the first-initial form,
    * or a married name, etc.
    * @return
    */
  def preferredFullName: Option[NonemptyString] = None

  def prefixes: Set[NonemptyString] = Set.empty

  // typically first name + middle initial, etc.
  def givenNames: Seq[NonemptyString] = Nil

  def nickNames: Set[NonemptyString] = Set.empty

  final def nickNamesInQuotes: Option[NonemptyString] = nickNames.map(s => NonemptyString("'" + s.toString + "'")).mkString(" ")

  final def allGivenAndNick: Seq[NonemptyString] = (givenNames ++ nickNamesInQuotes).toSeq

  /**
   * Each element of this list should be a complete and valid surname (i.e., using only one should produce a valid full name)
   *
   * Includes single surnames, multiple sequential surnames (in joined form), hyphenated names (in joined form), maiden names, and married names.
   *
   * The point is to facilitate recognizing both "Jorge Martinez" and "Ivan Renteria" as variants of "Jorge Ivan Renteria Martinez".
   *
   * Also: Camille Rosenthal-Sabroux Lamsade might have surnames "Rosenthal-Sabroux Lamsade", "Rosenthal-Sabroux", "Rosenthal", "Sabroux",
   * and "Lamsade".  Here we should record only those variants that are actually observed, but these may later be tokenized for matching purposes.
   *
   * Names with particles should simply include the particle, e.g. "de la Mouliere".  The later tokenization for matching should produce at least
   * "Mouliere" and "la Mouliere", since it's not predictable which particles are "dropping" and which are not.
   *
   * Variants that can be inferred at matching time (e.g., with particles removed, or accented characters reduced to roman) need not be stored explicitly.
   *
   * Surnames may also include known alternate spellings, e.g. Jouline/Zhulin
   */
  def surNames: Set[NonemptyString] = Set.empty

  // e.g., Jr. or III
  def hereditySuffix: Option[NonemptyString] = None

  // ** Careful: don't duplicate degrees when merging, but also don't assume they're unique (Kermit the Frog, Ph.D., Ph.D.)
  // ** no problem: assume unique for now, and assume order doesn't matter
  def degrees: Set[NonemptyString] = Set.empty

  def fieldsInCanonicalOrder: Seq[Iterable[NonemptyString]] = Seq(prefixes, givenNames, nickNamesInQuotes, surNames, hereditySuffix, degrees, preferredFullName)

}

/**
 * allow declaring a record canonical, to ensure that there are no explicit derivations
 */
trait CanonicalPersonName extends PersonName {

  lazy val withDerivations = new CanonicalPersonNameWithDerivations(this)

  override def toString = withDerivations.toString

  //def inferFully: PersonNameWithDerivations = withDerivations.inferFully

  /**
   * Very liberal definition: just look for incontrovertible conflicts
   * @param other
   * @return
   */
  def compatibleWith(other: CanonicalPersonName): Boolean = {

    def noMismatchingNameOrInitial(a: Seq[NonemptyString], b: Seq[NonemptyString]): Boolean = {
      lazy val aa = a.map(_.toLowerCase.stripPunctuation)
      lazy val bb = b.map(_.toLowerCase.stripPunctuation)

      // should do a real alignment here
      // instead, for now, require that every element of the shorter sequence match something in the longer sequence, in order

      val (s, l) = if (bb.length >= aa.length) (aa, bb) else (bb, aa)

      def isCompatible(s: Seq[NonemptyString], l: Seq[NonemptyString]): Boolean = {

        def compatibleMaybeInitial(x: NonemptyString, y: NonemptyString): Boolean = {
          val xI = x.s.head
          val yI = y.s.head
          x == y || ((x.length == 1 || y.length == 1) && xI == yI)
        }

        if (s.isEmpty) true
        else
        if (l.isEmpty) false
        else {
          if (compatibleMaybeInitial(s.head, l.head))
            isCompatible(s.tail, l.tail) // consume head of each sequence
          else
            isCompatible(s, l.tail) // drop incompatible entry from longer sequence
        }
      }
      isCompatible(s, l)

    }

    def atLeastOneMatchingNameOrInitial(a: Set[NonemptyString], b: Set[NonemptyString]): Boolean = {
      lazy val aa = a.map(_.toLowerCase)
      lazy val bb = b.map(_.toLowerCase)

      // At least one given name or nickname matches fully
      lazy val matching = aa.intersect(bb).nonEmpty

      // if a given name is provided only as an initial, see if a full given name or initial from the other name matches
      lazy val aInitialsOnly: Set[String] = aa.filter(_.s.stripPunctuation.length == 1).map(x => x.s.head.toString)
      lazy val bInitialsOnly: Set[String] = bb.filter(_.s.stripPunctuation.length == 1).map(x => x.s.head.toString)
      lazy val aAsInitials: Set[String] = aa.map(x => x.s.head.toString)
      lazy val bAsInitials: Set[String] = bb.map(x => x.s.head.toString)

      lazy val matchingInitial = aInitialsOnly.intersect(bAsInitials).nonEmpty || bInitialsOnly.intersect(aAsInitials).nonEmpty

      a.isEmpty || b.isEmpty || matching || matchingInitial
    }

    // ** these are redundant?  Well, maybe not, due to withDerivations...
    val matchingFirst = noMismatchingNameOrInitial(allGivenAndNick, other.allGivenAndNick)

    val matchingMiddle = noMismatchingNameOrInitial(withDerivations.middleNames, other.withDerivations.middleNames)

    val sA = surNames.flatMap(expandSurname)
    val sB = other.surNames.flatMap(expandSurname)

    val matchingLast = atLeastOneMatchingNameOrInitial(sA, sB)
    // val sAB = sA.intersect(sB)
    // val matchingLast = sAB.nonEmpty

    val result = matchingLast && matchingFirst && matchingMiddle
    result
  }

  private def expandSurname(s: NonemptyString): Set[NonemptyString] = {
    import StringUtils._
    val deAccented = NonemptyString(s.s.deAccent)
    val base: Set[String] = if (deAccented == s) {
      Set(s)
    } else {
      Set(s, deAccented)
    }
    base.map(_.toLowerCase).flatMap(removeParticles).flatMap(splitOnWhitespace).flatMap(splitOnHyphens)
  }

  private def removeParticles(s: String): Set[String] = {
    val result = s.s.split(" ").scanRight(List[String]())((element: String, prev: List[String]) => (element :: prev))
    result.map(_.mkString(" ")).toSet
  }

  private def splitOnHyphens(s: String): Set[String] = {
    s.s.split("-").toSet
  }

  private def splitOnWhitespace(s: String): Set[String] = {
    s.s.split("\\s").toSet
  }

  private def splitOnSpacesAndHyphens(s: String): Set[String] = {
    s.s.split("[ -]").toSet
  }

}

object InferredCanonicalPersonName {
  implicit def inferCanonical(n: PersonNameWithDerivations) = new InferredCanonicalPersonName(n)
}

/**
 * Infer any empty canonical fields, if possible, from provided derived fields.
 *
 * The approach is to generate full names from the derived fields, and then parse those full names back to canonical fields.  On the one hand,
 * that risks losing information.  On the other hand, this is generally used upstream of a merge where the "correct" derived fields will take priority anyway.
 * Also, this may help clean up mistagged data.
 *
 * In cases of single-value fields, nonempty explicit data overrides implicit data resulting from full-name parsing.  Thus, e.g.,
 * an explicit Mr. overrides an implicit Dr.  Should there be precedence rules?
 *
 * Set-valued fields are just merged.
 *
 * Note relationship with PersonName.merge().  Really we want to a) derive canonical fields only from derived fields; b) merge those with existing canonical
 * fields.
 *
 *
 * @param n
 */
class InferredCanonicalPersonName(n: PersonNameWithDerivations) extends CanonicalPersonName {
  private val nParsedFullNames = n.originalFullNames.map(n => PersonNameParser.parseFullName(n))

  // ** if the prefix is populated in more than one input, pick a random one.  Better: emit warning, choose best (?)
  override val prefixes = nParsedFullNames.flatMap(_.prefixes)
  override val givenNames = PersonName.combineGivenNames(nParsedFullNames.map(_.givenNames))
  override val nickNames = nParsedFullNames.flatMap(_.nickNames)
  override val surNames = nParsedFullNames.flatMap(_.surNames).toSet
  // e.g., Jr. or III
  // ** if the hereditySuffix is populated in more than one input, pick a random one.  Better: emit warning, choose best (?)
  override val hereditySuffix = nParsedFullNames.map(_.hereditySuffix).flatten.headOption
  override val degrees = nParsedFullNames.toSeq.map(_.degrees).flatten.toSet
}


text:
#ifndef __axtam_OutputStream__
#define __axtam_OutputStream__

namespace axtam
{
	/**
	 * ConsoleOutputStream is a subclass of OutputStream
	 * that writes output to the standard output.
	 *
	 * This is used for routing print() statements and
	 * exception messages to stdout in the AVM+
	 * command-line shell.
	 */
	class OutputStream : public avmplus::OutputStream
	{
	public:
		int write(const void *buffer, int count);
	};
}

#endif /* __axtam_OutputStream__ */


text:
module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        concat: {
            //"options": { "separator": ";" },
            css: {
                src: ["public/css/backend.css", "public/css/font-awesome.min.css", 'public/css/ionicons.min.css', 'public/css/adminDTE.css', 'public/css/datatables/dataTables.bootstrap.css', 'js/material/public/css/roboto.min.css', 'js/material/public/css/material-fullpalette.min.css', 'js/material/public/css/ripples.min.css', 'public/css/ripple.css', 'public/css/overide.css'],
                dest: "public/css/combined-all.css"
            },
            js: {
                src: [],
                dest: "public/js/combined-all.js"
            }
        },
        cssmin: {
          options: {
            shorthandCompacting: false,
            roundingPrecision: -1
          },
          target: {
            files: {
              "public/dist/css/combined-all.css" : ["public/css/backend.css", "public/css/font-awesome.min.css", 'public/css/ionicons.min.css', 'public/css/adminDTE.css', 'public/css/datatables/dataTables.bootstrap.css', 'js/material/public/css/roboto.min.css', 'js/material/public/css/material-fullpalette.min.css', 'js/material/public/css/ripples.min.css', 'public/css/ripple.css', 'public/css/overide.css']
            }
          }
        },
        uglify: {
            my_target: {
                files: {
                    'public/dist/combined-all.js': ['public/js/jquery/jquery.min.js', 'public/js/bootstrap/bootstrap.min.js', 'public/js/plugins/datatables/jquery.dataTables.js', 'public/js/plugins/datatables/dataTables.bootstrap.js', 'public/js/app.js', 'public/js/material/js/material.min.js', 'public/js/material/js/ripples.min.js', 'public/js/ripple.js']
                }
            }
        }
    });

    // Load required modules
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-uglify');

    // Task definitions
    grunt.registerTask('default', ['concat', 'min']);
};


text:
package assembler;

import ast.AST;
import base.Cosmos;
import config.PathHolder;

public abstract class Assembler extends Cosmos {
    protected Assembler(PathHolder context, AST ast)  {
        super(context, ast);
    }

    public abstract void assemble(String[] strings);
}


text:
// Copyright 2020 PingCAP, 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,
// See the License for the specific language governing permissions and
// limitations under the License.

package executor_test

import (
	. "github.com/pingcap/check"
	"github.com/pingcap/tidb/sessionctx/variable"
	"github.com/pingcap/tidb/util/testkit"
)

func (s *partitionTableSuite) TestFourReader(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("drop table if exists pt")
	tk.MustExec(`create table pt (id int, c int, key i_id(id), key i_c(c)) partition by range (c) (
partition p0 values less than (4),
partition p1 values less than (7),
partition p2 values less than (10))`)
	tk.MustExec("insert into pt values (0, 0), (2, 2), (4, 4), (6, 6), (7, 7), (9, 9), (null, null)")

	// Table reader
	tk.MustQuery("select * from pt").Sort().Check(testkit.Rows("0 0", "2 2", "4 4", "6 6", "7 7", "9 9", "<nil> <nil>"))
	// Table reader: table dual
	tk.MustQuery("select * from pt where c > 10").Check(testkit.Rows())
	// Table reader: one partition
	tk.MustQuery("select * from pt where c > 8").Check(testkit.Rows("9 9"))
	// Table reader: more than one partition
	tk.MustQuery("select * from pt where c < 2 or c >= 9").Check(testkit.Rows("0 0", "9 9"))

	// Index reader
	tk.MustQuery("select c from pt").Sort().Check(testkit.Rows("0", "2", "4", "6", "7", "9", "<nil>"))
	tk.MustQuery("select c from pt where c > 10").Check(testkit.Rows())
	tk.MustQuery("select c from pt where c > 8").Check(testkit.Rows("9"))
	tk.MustQuery("select c from pt where c < 2 or c >= 9").Check(testkit.Rows("0", "9"))

	// Index lookup
	tk.MustQuery("select /*+ use_index(pt, i_id) */ * from pt").Sort().Check(testkit.Rows("0 0", "2 2", "4 4", "6 6", "7 7", "9 9", "<nil> <nil>"))
	tk.MustQuery("select /*+ use_index(pt, i_id) */ * from pt where id < 4 and c > 10").Check(testkit.Rows())
	tk.MustQuery("select /*+ use_index(pt, i_id) */ * from pt where id < 10 and c > 8").Check(testkit.Rows("9 9"))
	tk.MustQuery("select /*+ use_index(pt, i_id) */ * from pt where id < 10 and c < 2 or c >= 9").Check(testkit.Rows("0 0", "9 9"))

	// Index Merge
	tk.MustExec("set @@tidb_enable_index_merge = 1")
	tk.MustQuery("select /*+ use_index(i_c, i_id) */ * from pt where id = 4 or c < 7").Check(testkit.Rows("0 0", "2 2", "4 4", "6 6"))
}

func (s *partitionTableSuite) TestPartitionIndexJoin(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("drop table if exists p, t")
	tk.MustExec(`create table p (id int, c int, key i_id(id), key i_c(c)) partition by range (c) (
partition p0 values less than (4),
partition p1 values less than (7),
partition p2 values less than (10))`)
	tk.MustExec("create table t (id int)")
	tk.MustExec("insert into p values (3,3), (4,4), (6,6), (9,9)")
	tk.MustExec("insert into t values (4), (9)")

	// Build indexLookUp in index join
	tk.MustQuery("select /*+ INL_JOIN(p) */ * from p, t where p.id = t.id").Sort().Check(testkit.Rows("4 4 4", "9 9 9"))
	// Build index reader in index join
	tk.MustQuery("select /*+ INL_JOIN(p) */ p.id from p, t where p.id = t.id").Check(testkit.Rows("4", "9"))
}

func (s *partitionTableSuite) TestPartitionUnionScanIndexJoin(c *C) {
	// For issue https://github.com/pingcap/tidb/issues/19152
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("drop table if exists t1, t2")
	tk.MustExec("create table t1  (c_int int, c_str varchar(40), primary key (c_int)) partition by range (c_int) ( partition p0 values less than (10), partition p1 values less than maxvalue)")
	tk.MustExec("create table t2  (c_int int, c_str varchar(40), primary key (c_int, c_str)) partition by hash (c_int) partitions 4")
	tk.MustExec("insert into t1 values (10, 'interesting neumann')")
	tk.MustExec("insert into t2 select * from t1")
	tk.MustExec("begin")
	tk.MustExec("insert into t2 values (11, 'hopeful hoover');")
	tk.MustQuery("select /*+ INL_JOIN(t1,t2) */  * from t1 join t2 on t1.c_int = t2.c_int and t1.c_str = t2.c_str where t1.c_int in (10, 11)").Check(testkit.Rows("10 interesting neumann 10 interesting neumann"))
	tk.MustQuery("select /*+ INL_HASH_JOIN(t1,t2) */  * from t1 join t2 on t1.c_int = t2.c_int and t1.c_str = t2.c_str where t1.c_int in (10, 11)").Check(testkit.Rows("10 interesting neumann 10 interesting neumann"))
	tk.MustExec("commit")
}

func (s *partitionTableSuite) TestPartitionReaderUnderApply(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("use test")

	// For issue 19458.
	tk.MustExec("drop table if exists t")
	tk.MustExec("create table t(c_int int)")
	tk.MustExec("insert into t values(1), (2), (3), (4), (5), (6), (7), (8), (9)")
	tk.MustExec("DROP TABLE IF EXISTS `t1`")
	tk.MustExec(`CREATE TABLE t1 (
		  c_int int NOT NULL,
		  c_str varchar(40) NOT NULL,
		  c_datetime datetime NOT NULL,
		  c_timestamp timestamp NULL DEFAULT NULL,
		  c_double double DEFAULT NULL,
		  c_decimal decimal(12,6) DEFAULT NULL,
		  PRIMARY KEY (c_int,c_str,c_datetime)
		) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
		 PARTITION BY RANGE (c_int)
		(PARTITION p0 VALUES LESS THAN (2) ENGINE = InnoDB,
		 PARTITION p1 VALUES LESS THAN (4) ENGINE = InnoDB,
		 PARTITION p2 VALUES LESS THAN (6) ENGINE = InnoDB,
		 PARTITION p3 VALUES LESS THAN (8) ENGINE = InnoDB,
		 PARTITION p4 VALUES LESS THAN (10) ENGINE = InnoDB,
		 PARTITION p5 VALUES LESS THAN (20) ENGINE = InnoDB,
		 PARTITION p6 VALUES LESS THAN (50) ENGINE = InnoDB,
		 PARTITION p7 VALUES LESS THAN (1000000000) ENGINE = InnoDB)`)
	tk.MustExec("INSERT INTO `t1` VALUES (19,'nifty feistel','2020-02-28 04:01:28','2020-02-04 06:11:57',32.430079,1.284000),(20,'objective snyder','2020-04-15 17:55:04','2020-05-30 22:04:13',37.690874,9.372000)")
	tk.MustExec("begin")
	tk.MustExec("insert into t1 values (22, 'wizardly saha', '2020-05-03 16:35:22', '2020-05-03 02:18:42', 96.534810, 0.088)")
	tk.MustQuery("select c_int from t where (select min(t1.c_int) from t1 where t1.c_int > t.c_int) > (select count(*) from t1 where t1.c_int > t.c_int) order by c_int").Check(testkit.Rows(
		"1", "2", "3", "4", "5", "6", "7", "8", "9"))
	tk.MustExec("rollback")

	// For issue 19450.
	tk.MustExec("drop table if exists t1, t2")
	tk.MustExec("create table t1  (c_int int, c_str varchar(40), c_decimal decimal(12, 6), primary key (c_int))")
	tk.MustExec("create table t2  (c_int int, c_str varchar(40), c_decimal decimal(12, 6), primary key (c_int)) partition by hash (c_int) partitions 4")
	tk.MustExec("insert into t1 values (1, 'romantic robinson', 4.436), (2, 'stoic chaplygin', 9.826), (3, 'vibrant shamir', 6.300), (4, 'hungry wilson', 4.900), (5, 'naughty swartz', 9.524)")
	tk.MustExec("insert into t2 select * from t1")
	tk.MustQuery("select * from t1 where c_decimal in (select c_decimal from t2 where t1.c_int = t2.c_int or t1.c_int = t2.c_int and t1.c_str > t2.c_str)").Check(testkit.Rows(
		"1 romantic robinson 4.436000",
		"2 stoic chaplygin 9.826000",
		"3 vibrant shamir 6.300000",
		"4 hungry wilson 4.900000",
		"5 naughty swartz 9.524000"))

	// For issue 19450 release-4.0
	tk.MustExec(`set @@tidb_partition_prune_mode='` + string(variable.StaticOnly) + `'`)
	tk.MustQuery("select * from t1 where c_decimal in (select c_decimal from t2 where t1.c_int = t2.c_int or t1.c_int = t2.c_int and t1.c_str > t2.c_str)").Check(testkit.Rows(
		"1 romantic robinson 4.436000",
		"2 stoic chaplygin 9.826000",
		"3 vibrant shamir 6.300000",
		"4 hungry wilson 4.900000",
		"5 naughty swartz 9.524000"))
}

func (s *partitionTableSuite) TestImproveCoverage(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("use test")
	tk.MustExec(`create table coverage_rr (
pk1 varchar(35) NOT NULL,
pk2 int NOT NULL,
c int,
PRIMARY KEY (pk1,pk2)) partition by hash(pk2) partitions 4;`)
	tk.MustExec("create table coverage_dt (pk1 varchar(35), pk2 int)")
	tk.MustExec("insert into coverage_rr values ('ios', 3, 2),('android', 4, 7),('linux',5,1)")
	tk.MustExec("insert into coverage_dt values ('apple',3),('ios',3),('linux',5)")
	tk.MustExec("set @@tidb_partition_prune_mode = 'dynamic-only'")
	tk.MustQuery("select /*+ INL_JOIN(dt, rr) */ * from coverage_dt dt join coverage_rr rr on (dt.pk1 = rr.pk1 and dt.pk2 = rr.pk2);").Sort().Check(testkit.Rows("ios 3 ios 3 2", "linux 5 linux 5 1"))
	tk.MustQuery("select /*+ INL_MERGE_JOIN(dt, rr) */ * from coverage_dt dt join coverage_rr rr on (dt.pk1 = rr.pk1 and dt.pk2 = rr.pk2);").Sort().Check(testkit.Rows("ios 3 ios 3 2", "linux 5 linux 5 1"))
}

func (s *globalIndexSuite) TestGlobalIndexScan(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("drop table if exists p")
	tk.MustExec(`create table p (id int, c int) partition by range (c) (
partition p0 values less than (4),
partition p1 values less than (7),
partition p2 values less than (10))`)
	tk.MustExec("alter table p add unique idx(id)")
	tk.MustExec("insert into p values (1,3), (3,4), (5,6), (7,9)")
	tk.MustQuery("select id from p use index (idx)").Check(testkit.Rows("1", "3", "5", "7"))
}

func (s *globalIndexSuite) TestGlobalIndexDoubleRead(c *C) {
	tk := testkit.NewTestKitWithInit(c, s.store)
	tk.MustExec("drop table if exists p")
	tk.MustExec(`create table p (id int, c int) partition by range (c) (
partition p0 values less than (4),
partition p1 values less than (7),
partition p2 values less than (10))`)
	tk.MustExec("alter table p add unique idx(id)")
	tk.MustExec("insert into p values (1,3), (3,4), (5,6), (7,9)")
	tk.MustQuery("select * from p use index (idx)").Check(testkit.Rows("1 3", "3 4", "5 6", "7 9"))
}


text:
var ArrayUtilities = function() {};

ArrayUtilities.prototype.isArray = function(object) {
    return Object.prototype.toString.call(object) === '[object Array]';
};

ArrayUtilities.prototype.isEmptyArray = function(object) {
    var self = this;
    var result = false;

    if (self.isArray(object)) {
        if (object.length === 0) {
            result = true;
        }
    }

    return result;
};

ArrayUtilities.prototype.isEmptyArrayOrNull = function(object) {
    var self = this;
    var result = true;

    if (self.isArray(object)) {
        if (object.length > 0) {
            result = false;
        }
    }

    return result;
};

ArrayUtilities.prototype.isNotEmptyArray = function(object) {
    var self = this;

    return object !== null && self.isArray(object) && !self.isEmptyArray(object);
};

export default new ArrayUtilities();


text:
<!DOCTYPE html>

    <title>Photo Fight! Taiwan Countryside vs Delicious Food</title>

    Alpha
    Bravo


text:
<meta charset="utf-8">
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.title }}</title>
<meta name="description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
{% if page.tags %}<meta name="keywords" content="{{ page.tags | join: ', ' }}">{% endif %}

{% if site.owner.twitter or site.twitter %}<!-- Twitter Cards -->
{% if page.image.feature %}<meta name="twitter:card" content="summary_large_image">
{% else %}<meta name="twitter:card" content="summary">{% endif %}
<meta name="twitter:site" content="@{% if site.twitter %}{{ site.twitter }}{% else %}{{ site.owner.twitter }}{% endif %}">
<meta name="twitter:creator" content="@{% if site.owner.twitter %}{{ site.owner.twitter }}{% else %}{{ site.twitter }}{% endif %}">{% endif %}

<!-- Open Graph -->
<meta property="og:locale" content="{{ site.locale }}">
<meta property="og:type" content="article">
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}">
<meta property="og:description" content="{% if page.description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:site_name" content="{{ site.title }}">
{% if page.image.feature %}<meta property="og:image" content="{{ site.url }}/images/{{ page.image.feature }}">
{% else %}<meta property="og:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}">{% endif %}

{% if site.google_verify %}<meta name="google-site-verification" content="{{ site.google_verify }}">{% endif %}
{% if site.bing_verify %}<meta name="msvalidate.01" content="{{ site.bing_verify }}">{% endif %}

{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
<link rel="canonical" href="{{ canonical }}">
<link href="{{ site.url }}/feed.xml" type="application/atom+xml" rel="alternate" title="{{ site.title }} Feed">

<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

<!-- For all browsers -->
<link rel="stylesheet" href="{{ site.url }}/assets/css/main.css">
<link rel="stylesheet" href="{{ site.url }}/assets/css/jquery.mmenu.all.css">
<link rel="stylesheet" href="{{ site.url }}/assets/css/jquery.floating-social-share.min.css">
<!-- Webfonts -->
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">

<meta http-equiv="cleartype" content="on">

<!-- Load Modernizr -->
<script type="text/javascript" src="{{ site.url }}/assets/js/vendor/modernizr-2.6.2.custom.min.js"></script>

{% include icons.html %}

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-75229569-1', 'auto');
  ga('send', 'pageview');

</script>

{% if page.image.background or site.background %}
{% capture background %}{% if page.image.background %}{{ page.image.background }}{% else %}{{ site.background }}{% endif %}{% endcapture %}
{% unless background contains 'http://' or background contains 'https://' %}{% capture background %}{{ site.url }}/images/{{ background }}{% endcapture %}{% endunless %}
<style type="text/css">body {background-image:url({{ background }});}</style>
{% endif %}


text:
<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use app\models\Account;
use app\models\Users;

class IndexController extends Controller
{
    public $enableCsrfValidation = false;
    public $layout   = 'index';
    public $userid   = '';
    public $username = '';

    function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        $session = Yii::$app->session;
        $session->open();
        if ($session->has('userid'))
        {
            $user = new users;
            $userinfo = $user->findone($session->get('userid'));
            if ($userinfo->sessionId != session_id()) {
                echo "<script>alert('账号异常登录!您已被迫下线!')</script>";
                return $this->redirect('index.php?r=login/login');
            }
            $this->userid   = $session->get('userid');
            $this->username = $session->get('username');
            $view = Yii::$app->getView();
            $view->params['username'] = $this->username;
            return true;
        }
        else
        {
            return $this->redirect('index.php?r=login/login');
        }
    }

    public function actionIndex()
    {
        $account = new account;
        $account = $account->find()->where(['uid' => $this->userid])->asArray()->all();
        return $this->render('index', ['account' => $account]);
    }

    public function actionAdd()
    {
        return $this->render('add');
    }

    public function actionAjaxadd(){
        $request = Yii::$app->request;
        if ($request->isPost) {
            $name = $request->post('name');
            $appid = $request->post('appid');
            $appsecret = $request->post('appsecret');
            $account = new account;
            $account->uid = $this->userid;
            $account->account = $name;
            $account->appid = $appid;
            $account->appsecret = $appsecret;
            $account->token = md5(time());
            $result = $account->save();
            if ($result)
            {
                $id = $account->attributes['Id'];
                $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
//            $account->apiurl = $protocol . $_SERVER['SERVER_NAME'] . '/wepro/web/index.php?r=manage/valid&id=' . $id;
                $account->apiurl = $protocol . $_SERVER['SERVER_ADDR'] . '/wepro/web/index.php?r=manage/valid&id=' . $id;
                $account->save();
                echo $id;
            }
        }
    }

    public function actionManage()
    {
        $request = Yii::$app->request;
        if ($id = $request->get('id')) {
            $account = new account;
            $account = $account->find()->where(['Id' => $id, 'uid' => $this->userid])->asArray()->one();
            return $this->render('manage', ['account' => $account]);
        }
        return $this->redirect('index.php');
    }

    public function actionDel()
    {
        $request = Yii::$app->request;
        if ($request->isPost) {
            $id = $request->post('id');
            $account = new account;
            $result = $account->findOne($id)->delete();
            if ($result)
            {
                echo 1;
            }
        }
    }
}


text:
layout: default
---

{{page.note-name}}

  {{page.note-time}}

  {{ content }}


text:
* [How to update sources and issue a new release](new-release.md)
* [Finding and fixing errors](errors.md)
* [Patch system](patch.md)
* [Addressing feedback issues](feedback.md)
* [Adding a new taxonomic source](new-source.md)
* [How the OTT build system works](build-system.md) (diagram [here](ott-management-design.svg))
* [GBIF 2016 update case study](gbif-2016-case-study.md)

For information on the taxonomy and on how smasher works, please see:

* [Automated assembly of a reference taxonomy for phylogenetic data synthesis](https://doi.org/10.1101/116418) (preprint; article accepted to Biodiversity Data Journal)


text:
Jason K
Wilson L

##September 16, 2016##

Added random() function to Welcome.php to allow for random display of quote author.

Added quote to mouse-hover over picture.

Added new quote and picture for Lord Harambe.

Created Changelog.


text:
package com.beatofthedrum.alacdecoder;

class LeadingZeros {
  public int curbyte = 0;
  public int output = 0;
}


text:
require 'multi_json'

require 'pearl/http'
require 'pearl/pretty_table'

module Pearl
  class Client
    Dir[File.expand_path('../client/*.rb', __FILE__)].each { |f| require f }

    include Droplets
    include Images
    include Regions
    include Sizes
    include SshKeys

    include PrettyTable

    attr_reader :client_id
    attr_reader :api_key
    attr_reader :api_host

    def initialize(options = {})
      @client_id = options[:client_id] || ENV['DIGITAL_OCEAN_CLIENT_ID']
      @api_key = options[:api_key]  || ENV['DIGITAL_OCEAN_API_KEY']
      @api_host = options[:api_host] || 'api.digitalocean.com'

      extend Pearl::HTTP

      raise 'Error: Invalid client id.' if @client_id.nil?
      raise 'Error: Invalid api key.' if @api_key.nil?
    end

    def base_url
      "https://#{@api_host}/"
    end

    def authenticated?
      @client_id != nil && @api_key != nil
    end
  end
end


text:
<title>gcloud compute addresses delete</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="project_path" value="/sdk/_project.yaml">
<meta name="book_path" value="/sdk/_book.yaml">

NAME

gcloud compute addresses delete - release reserved IP addresses

SYNOPSIS

gcloud compute addresses delete   <var>NAME</var>   <nobr>[<var>NAME</var>   …]</nobr>   <nobr>[--format   <var>FORMAT</var>]</nobr>   <nobr>[--help]</nobr>   <nobr>[--log-http]</nobr>   <nobr>[--project   <var>PROJECT_ID</var>]</nobr>   <nobr>[--quiet,   -q]</nobr>   <nobr>[--global   |</nobr> <nobr>  --region   <var>REGION</var>]</nobr>   <nobr>[--trace-token   <var>TRACE_TOKEN</var>]</nobr>   <nobr>[-h]</nobr>

DESCRIPTION

gcloud compute addresses delete releases one or more Google Compute Engine IP addresses.

POSITIONAL ARGUMENTS

<var>NAME</var> [<var>NAME</var> …]

The names of the addresses to delete.

FLAGS

--global

If provided, it is assumed the addresses are global.

--region <var>REGION</var>

The region of the address to operate on. If not specified, you will be prompted to select a region.

To avoid prompting when this flag is omitted, you can set the
<var>compute/region</var> property:

$ gcloud config set compute/region REGION

A list of regions can be fetched by running:

$ gcloud compute regions list

To unset the property, run:

$ gcloud config unset compute/region

Alternatively, the region can be stored in the environment
variable <var>CLOUDSDK_COMPUTE_REGION</var>.

GLOBAL FLAGS

--format <var>FORMAT</var>

Specify a format for printed output. By default, a command-specific
human-friendly output format is used. Setting this flag to one of
the available options will serialize the result of the command in
the chosen format and print it to stdout. Supported formats are:
json, text, yaml.

--help

Display detailed help.

--log-http

Logs all HTTP server requests and responses to stderr.

--project <var>PROJECT_ID</var>

The Google Cloud Platform project name to use for this invocation. If
omitted then the current project is assumed.

--quiet, -q

Disable all interactive prompts when running gcloud commands. If input
is required, defaults will be used, or an error will be raised.

--trace-token <var>TRACE_TOKEN</var>

Token used to route traces of service requests for investigation of issues.

-h

Print a summary help and exit.

NOTES

This command is in the Google Cloud SDK compute component. See
installing components
if it is not installed.


text:
package org.elasticsearch.common.breaker;

import static org.assertj.core.api.Assertions.assertThat;

import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.indices.breaker.BreakerSettings;
import org.junit.Test;

public class ChildMemoryCircuitBreakerTest {

    @Test
    public void test_get_free_returns_max_long_if_breaking_is_disabled() {
        var breaker = new ChildMemoryCircuitBreaker(
            new BreakerSettings("test", -1, CircuitBreaker.Type.MEMORY),
            Loggers.getLogger(getClass()),
            null
        );

        assertThat(breaker.getFree()).isEqualTo(Long.MAX_VALUE);
    }

    @Test
    public void test_get_free_returns_zero_if_usage_is_disabled() {
        var breaker = new ChildMemoryCircuitBreaker(
            new BreakerSettings("test", 0, CircuitBreaker.Type.MEMORY),
            Loggers.getLogger(getClass()),
            null
        );

        assertThat(breaker.getFree()).isEqualTo(0L);
    }
}


text:
using System.Threading.Tasks;
using Metrics;
using Microsoft.ServiceFabric.Actors;
using Microsoft.ServiceFabric.Actors.Client;
using MOUSE.Core;
using MOUSE.Core.Fibers;
using MOUSE.Core.Interfaces;
using MOUSE.Core.Interfaces.Configuration;
using MOUSE.Core.Interfaces.Logging;
using MOUSE.Core.Interfaces.MessageProcessing;
using MOUSE.Core.Interfaces.Serialization;
using MOUSE.Core.MessageProcessing;
using Orleans;
using OrleansTestActor.Interface;
using PerfTests.Protocol;
using SFTestActor.Interfaces;

namespace SFActors.Gateway
{
    public class OrleansBackendClientNetChannel : AsyncProcessingNetChannel
    {
        static readonly Timer BackendCallsTimer = Metric.Context("PublicNet").Timer("BackendCallsTimer", Unit.Calls);

        ITestGrain _actor;
        public OrleansBackendClientNetChannel(INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool)
            : base(node, transportChannel, serializer, logger, config, bufferPool)
        {
        }

        protected override IMessageProcessingPipeBuilder Configure(IMessageProcessingPipeBuilder builder)
        {
            return builder
                //.UseIdleDisconnect(TimeSpan.FromSeconds(60 * 10), this)
                //.UseInvalidHandshakeDisconnect<JoinRoomS2S>(TimeSpan.FromSeconds(5))
                .UseFiber(new SimpleFiber(TaskScheduler.Default, 10))
                .UseConfigurableDispatcher(config => config
                    .HandleRequest<UseActor, OperationResult>(OnUseActor)
                    .HandleRequestAsync<PingGateway, OperationResult>(OnPingGateway)
                    .HandleRequestAsync<TestStateless, OperationResult>(OnTestStateless)
                    .HandleRequestAsync<TestStateful, OperationResult>(OnTestStateful),

                    throwIfUnhandled: false);
        }

        OperationResult OnUseActor(UseActor msg, IOperationContext context)
        {
            _actor = GrainClient.GrainFactory.GetGrain<ITestGrain>(msg.ActorName);
            return OperationResult.Success;
        }

        async Task<OperationResult> OnTestStateless(TestStateless msg, IOperationContext context)
        {
            using (BackendCallsTimer.NewContext())
                return await _actor.TestStateless(msg);
        }

        async Task<OperationResult> OnPingGateway(PingGateway msg, IOperationContext context)
        {
            using (BackendCallsTimer.NewContext())
            {
                await Task.Delay(msg.SleepDurationMs);
                return OperationResult.Success;
            }
        }

        async Task<OperationResult> OnTestStateful(TestStateful msg, IOperationContext context)
        {
            using (BackendCallsTimer.NewContext())
                return await _actor.TestStateful(msg);
        }
    }
}


text:
package androidx.car.app.navigation.model;

import static androidx.car.app.navigation.model.LaneDirection.SHAPE_NORMAL_LEFT;

import static com.google.common.truth.Truth.assertThat;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.internal.DoNotInstrument;

/** Tests for {@link LaneDirection}. */
@RunWith(RobolectricTestRunner.class)
@DoNotInstrument
public class LaneDirectionTest {

    @Test
    public void createInstance() {
        int shape = SHAPE_NORMAL_LEFT;
        LaneDirection laneDirection = LaneDirection.create(shape, true);

        assertThat(shape).isEqualTo(laneDirection.getShape());
        assertThat(laneDirection.isRecommended()).isTrue();
    }

    @Test
    public void equals() {
        LaneDirection laneDirection = LaneDirection.create(SHAPE_NORMAL_LEFT, true);
        assertThat(LaneDirection.create(SHAPE_NORMAL_LEFT, true)).isEqualTo(laneDirection);
    }

    @Test
    public void notEquals_differentShape() {
        LaneDirection laneDirection = LaneDirection.create(SHAPE_NORMAL_LEFT, true);
        assertThat(LaneDirection.create(LaneDirection.SHAPE_STRAIGHT, true))
                .isNotEqualTo(laneDirection);
    }

    @Test
    public void notEquals_differentHighlighted() {
        LaneDirection laneDirection = LaneDirection.create(SHAPE_NORMAL_LEFT, true);
        assertThat(LaneDirection.create(SHAPE_NORMAL_LEFT, false)).isNotEqualTo(laneDirection);
    }
}


text:
package com.ikaeesoft.facerecognitionlibrary.PreProcessor.Contours;

import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;

import java.util.ArrayList;
import java.util.List;

import com.ikaeesoft.facerecognitionlibrary.PreProcessor.Command;
import com.ikaeesoft.facerecognitionlibrary.PreProcessor.PreProcessor;

public class Masking implements Command {

    public PreProcessor preprocessImage(PreProcessor preProcessor) {
        List<Mat> images = preProcessor.getImages();
        List<Mat> processed = new ArrayList<Mat>();
        for (Mat img : images){
            preProcessor.normalize0255(img);

            /***************************************************************************************
             *    Title: Automatic calculation of low and high thresholds for the Canny operation in opencv
             *    Author: VP
             *    Date: 16.04.2013
             *    Code version: -
             *    Availability: http://stackoverflow.com
             *
             ***************************************************************************************/

            double otsu_thresh_val = Imgproc.threshold(img, img, 0, 255, Imgproc.THRESH_OTSU);
            Imgproc.Canny(img, img, otsu_thresh_val * 0.5, otsu_thresh_val);
            processed.add(img);
        }
        preProcessor.setImages(processed);
        return preProcessor;
    }
}


text:
/* tslint:disable:max-line-length */
/**
 * Test Swagger
 * v1
 * example.com/api-base-path
 */

import {createFeatureSelector} from '@ngrx/store';

import {HttpErrorResponse} from '@angular/common/http';
import * as actions from './actions';

export interface LoginState {
  data: object | null;
  loading: boolean;
  error: HttpErrorResponse | null;
}

export const initialLoginState: LoginState = {
  data: null,
  loading: false,
  error: null,
};

export const selectorName = 'Login_Login';
export const getLoginStateSelector = createFeatureSelector<LoginState>(selectorName);

export function LoginReducer(
  state: LoginState = initialLoginState,
  action: actions.LoginAction): LoginState {
  switch (action.type) {
    case actions.Actions.START: return {...state, loading: true, error: null};
    case actions.Actions.SUCCESS: return {...state, data: action.payload, loading: false};
    case actions.Actions.ERROR: return {...state, error: action.payload, loading: false};
    default: return state;
  }
}


text:
using System.Web.Mvc;
using Microsoft.Practices.Unity;
using Chamber.Domain.Interfaces;
using Chamber.Domain.Interfaces.Services;
using Chamber.Domain.Interfaces.UnitOfWork;
using Chamber.Services.Data.Context;
using Chamber.Services.Data.UnitOfWork;
using Chamber.Services;

namespace Chamber.IOC
{
    /// <summary>
    /// Bind the given interface in request scope
    /// </summary>
    public static class IocExtensions
    {
        public static void BindInRequestScope<T1, T2>(this IUnityContainer container) where T2 : T1
        {
            container.RegisterType<T1, T2>(new HierarchicalLifetimeManager());
        }

    }

    /// <summary>
    /// The injection for Unity
    /// </summary>
    public static partial class UnityHelper
    {

        public static IUnityContainer Start()
        {
            var container = new UnityContainer();
            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
            var buildUnity = BuildUnityContainer(container);
            return buildUnity;
        }

        /// <summary>
        /// Inject
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer(UnityContainer container)
        {
            // register all your components with the container here
            // it is NOT necessary to register your controllers

            // Database context, one per request, ensure it is disposed
            container.BindInRequestScope<IChamberContext, ChamberContext>();
            container.BindInRequestScope<IUnitOfWorkManager, UnitOfWorkManager>();

            // Quartz
            //container.AddNewExtension<QuartzUnityExtension>();

            //Bind the various domain model services and repositories that e.g. our controllers require
            container.BindInRequestScope<IActivityService, ActivityService>();
            container.BindInRequestScope<IBusinessService, BusinessService>();
            container.BindInRequestScope<ICacheService, CacheService>();
            container.BindInRequestScope<IClassificationService, ClassificationService>();
            container.BindInRequestScope<IConfigService, ConfigService>();
            container.BindInRequestScope<IEmailService, EmailService>();
            container.BindInRequestScope<ILoggingService, LoggingService>();
            container.BindInRequestScope<IMembershipLevelService, MembershipLevelService>();
            container.BindInRequestScope<IMembershipService, MembershipService>();
            container.BindInRequestScope<IReflectionService, ReflectionService>();
            container.BindInRequestScope<IRoleService, RoleService>();
            container.BindInRequestScope<ISettingsService, SettingsService>();

            CustomBindings(container);

            return container;
        }

        static partial void CustomBindings(UnityContainer container);
    }

    // Example of adding your own bindings, just create a partial class and implement
    // the CustomBindings method and add your bindings as shown below
    //public static partial class UnityHelper
    //{
    //    static partial void CustomBindings(UnityContainer container)
    //    {
    //        container.BindInRequestScope<IBlockRepository, BlockRepository>();
    //        container.BindInRequestScope<IBlockService, BlockService>();
    //    }
    //}
}


text:
layout: post
title: "Life Transference"
date: 2015-07-14
source: PHB.242
tags: [cleric, wizard, level3, necromancy]
---

**3rd-level necromancy**

**Casting Time**: 1 action

**Range**: 30 feet

**Components**: V, S

**Duration**: Instantaneous

**Saving Throw**:

**Save For**:

**Damage**: [ { "dice": "4d8", "label": "necrotic", "damagebonus": 0, "addstat": false, "prof": false, "higherlevels": "" } ]

You sacrifice some of your health to mend another creature's injuries. You take 4d8 necrotic damage which can't be reduced in any way, and one creature of your choice that you can see within range regains
a number of hit points equal to twice the necrotic damage you take.

**At Higher Levels.** When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d8 for each slot level above 3rd.


text:
  P
  E
  G
  G
  E
  R

Welcome to the home of Pegger, a simple little peg jumping strategy game for two! If you're a curious developer there is also source code and a tutorial series that you can peruse.

Play Pegger


text:
using System;
using System.Collections.Generic;

namespace Microsoft.TemplateEngine.Cli
{
    public class TelemetryLogger : ITelemetryLogger
    {
        private readonly Action<string, IDictionary<string, string>, IDictionary<string, double>> _trackEvent;
        private readonly bool _writeToConsole;

        public TelemetryLogger(Action<string, IDictionary<string, string>, IDictionary<string, double>> trackEvent, bool writeToConsole = false)
        {
            _trackEvent = trackEvent;
            _writeToConsole = writeToConsole;
        }

        public void TrackEvent(string eventName, IDictionary<string, string> properties = null, IDictionary<string, double> measurements = null)
        {
            try
            {
                _trackEvent?.Invoke(eventName, properties, measurements);

                if (_writeToConsole)
                {
                    Console.WriteLine($"Telemetry event {eventName}");

                    if (properties != null)
                    {
                        Console.WriteLine("Properties:");
                        foreach (KeyValuePair<string, string> property in properties)
                        {
                            Console.WriteLine($"\t{property.Key} = {property.Value}");
                        }
                    }

                    if (measurements != null)
                    {
                        Console.WriteLine("Measurements:");
                        foreach (KeyValuePair<string, double> measurement in measurements)
                        {
                            Console.WriteLine($"\t{measurement.Key} = {measurement.Value}");
                        }
                    }
                }
            }
            catch
            {
            }
        }
    }
}


text:
package at.alladin.rmbt.client;

public class RMBTTestParameter
{

    // immutable! (accessed by multiple threads!)

    private final String host;
    private final int port;
    private final boolean encryption;
    private final String token;
    private final int pretestDuration = 2;
    private final int duration;
    private final int numThreads;
    private final int numPings;
    private final long startTime;

    public RMBTTestParameter(final String host, final int port, final boolean encryption, final String token,
            final int duration, final int numThreads, final int numPings, final long startTime)
    {
        super();
        this.host = host;
        this.port = port;
        this.encryption = encryption;
        this.token = token;
        this.duration = duration;
        this.numThreads = numThreads;
        this.numPings = numPings;
        this.startTime = startTime;
    }

    public RMBTTestParameter(final String host, final int port, final boolean encryption,
            final int duration, final int numThreads, final int numPings)
    {
        super();
        this.host = host;
        this.port = port;
        this.encryption = encryption;
        this.duration = duration;
        this.numThreads = numThreads;
        this.numPings = numPings;
        this.token = null;
        this.startTime = 0;
    }

    public String getHost()
    {
        return host;
    }

    public int getPort()
    {
        return port;
    }

    public boolean isEncryption()
    {
        return encryption;
    }

    public String getToken()
    {
        return token;
    }

    public String getUUID()
    {
        if (token == null)
            return null;
        final String[] parts = token.split("_");
        if (parts == null || parts.length <= 0)
            return null;
        return parts[0];
    }

    public int getDuration()
    {
        return duration;
    }

    public int getPretestDuration()
    {
        return pretestDuration;
    }

    public int getNumThreads()
    {
        return numThreads;
    }

    public int getNumPings()
    {
        return numPings;
    }

    public long getStartTime()
    {
        return startTime;
    }

    public void check() throws IllegalArgumentException
    {
        if (host == null || host.length() == 0)
            throw new IllegalArgumentException("no host");
        if (port <= 0)
            throw new IllegalArgumentException("no port");
        if (getUUID() == null)
            throw new IllegalArgumentException("no uuid");
        if (numThreads <= 0)
            throw new IllegalArgumentException("num threads <= 0");
//        if (pretestDuration < 0)
//            throw new IllegalArgumentException("pretestDuration < 0");
    }
}


text:
#ifndef __MALI_PROFILING_EVENTS_H__
#define __MALI_PROFILING_EVENTS_H__

/* Simple wrapper in order to find the OS specific location of this file */
#include <linux/mali/mali_utgard_profiling_events.h>

#endif /* __MALI_PROFILING_EVENTS_H__ */


text:
//  Copyright (c) 2013, Facebook, Inc.  All rights reserved.
//  This source code is licensed under the BSD-style license found in the
//  LICENSE file in the root directory of this source tree. An additional grant
//  of patent rights can be found in the PATENTS file in the same directory.
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#pragma once
#include <unistd.h>
#include "rocksdb/env.h"

// For non linux platform, the following macros are used only as place
// holder.
#if !(defined OS_LINUX) && !(defined CYGWIN)
#define POSIX_FADV_NORMAL 0     /* [MC1] no further special treatment */
#define POSIX_FADV_RANDOM 1     /* [MC1] expect random page refs */
#define POSIX_FADV_SEQUENTIAL 2 /* [MC1] expect sequential page refs */
#define POSIX_FADV_WILLNEED 3   /* [MC1] will need these pages */
#define POSIX_FADV_DONTNEED 4   /* [MC1] dont need these pages */
#endif

namespace rocksdb {

static Status IOError(const std::string& context, int err_number) {
  return Status::IOError(context, strerror(err_number));
}

class PosixSequentialFile : public SequentialFile {
 private:
  std::string filename_;
  FILE* file_;
  int fd_;
  bool use_os_buffer_;

 public:
  PosixSequentialFile(const std::string& fname, FILE* f,
                      const EnvOptions& options);
  virtual ~PosixSequentialFile();

  virtual Status Read(size_t n, Slice* result, char* scratch) override;
  virtual Status Skip(uint64_t n) override;
  virtual Status InvalidateCache(size_t offset, size_t length) override;
};

class PosixRandomAccessFile : public RandomAccessFile {
 private:
  std::string filename_;
  int fd_;
  bool use_os_buffer_;

 public:
  PosixRandomAccessFile(const std::string& fname, int fd,
                        const EnvOptions& options);
  virtual ~PosixRandomAccessFile();

  virtual Status Read(uint64_t offset, size_t n, Slice* result,
                      char* scratch) const override;
#ifdef OS_LINUX
  virtual size_t GetUniqueId(char* id, size_t max_size) const override;
#endif
  virtual void Hint(AccessPattern pattern) override;
  virtual Status InvalidateCache(size_t offset, size_t length) override;
};

class PosixWritableFile : public WritableFile {
 private:
  const std::string filename_;
  int fd_;
  uint64_t filesize_;
#ifdef ROCKSDB_FALLOCATE_PRESENT
  bool allow_fallocate_;
  bool fallocate_with_keep_size_;
#endif

 public:
  PosixWritableFile(const std::string& fname, int fd,
                    const EnvOptions& options);
  ~PosixWritableFile();

  // Means Close() will properly take care of truncate
  // and it does not need any additional information
  virtual Status Truncate(uint64_t size) override { return Status::OK(); }
  virtual Status Close() override;
  virtual Status Append(const Slice& data) override;
  virtual Status Flush() override;
  virtual Status Sync() override;
  virtual Status Fsync() override;
  virtual bool IsSyncThreadSafe() const override;
  virtual uint64_t GetFileSize() override;
  virtual Status InvalidateCache(size_t offset, size_t length) override;
#ifdef ROCKSDB_FALLOCATE_PRESENT
  virtual Status Allocate(off_t offset, off_t len) override;
  virtual Status RangeSync(off_t offset, off_t nbytes) override;
  virtual size_t GetUniqueId(char* id, size_t max_size) const override;
#endif
};

class PosixMmapReadableFile : public RandomAccessFile {
 private:
  int fd_;
  std::string filename_;
  void* mmapped_region_;
  size_t length_;

 public:
  PosixMmapReadableFile(const int fd, const std::string& fname, void* base,
                        size_t length, const EnvOptions& options);
  virtual ~PosixMmapReadableFile();
  virtual Status Read(uint64_t offset, size_t n, Slice* result,
                      char* scratch) const override;
  virtual Status InvalidateCache(size_t offset, size_t length) override;
};

class PosixMmapFile : public WritableFile {
 private:
  std::string filename_;
  int fd_;
  size_t page_size_;
  size_t map_size_;       // How much extra memory to map at a time
  char* base_;            // The mapped region
  char* limit_;           // Limit of the mapped region
  char* dst_;             // Where to write next  (in range [base_,limit_])
  char* last_sync_;       // Where have we synced up to
  uint64_t file_offset_;  // Offset of base_ in file
#ifdef ROCKSDB_FALLOCATE_PRESENT
  bool allow_fallocate_;  // If false, fallocate calls are bypassed
  bool fallocate_with_keep_size_;
#endif

  // Roundup x to a multiple of y
  static size_t Roundup(size_t x, size_t y) { return ((x + y - 1) / y) * y; }

  size_t TruncateToPageBoundary(size_t s) {
    s -= (s & (page_size_ - 1));
    assert((s % page_size_) == 0);
    return s;
  }

  Status MapNewRegion();
  Status UnmapCurrentRegion();
  Status Msync();

 public:
  PosixMmapFile(const std::string& fname, int fd, size_t page_size,
                const EnvOptions& options);
  ~PosixMmapFile();

  // Means Close() will properly take care of truncate
  // and it does not need any additional information
  virtual Status Truncate(uint64_t size) override { return Status::OK(); }
  virtual Status Close() override;
  virtual Status Append(const Slice& data) override;
  virtual Status Flush() override;
  virtual Status Sync() override;
  virtual Status Fsync() override;
  virtual uint64_t GetFileSize() override;
  virtual Status InvalidateCache(size_t offset, size_t length) override;
#ifdef ROCKSDB_FALLOCATE_PRESENT
  virtual Status Allocate(off_t offset, off_t len) override;
#endif
};

class PosixDirectory : public Directory {
 public:
  explicit PosixDirectory(int fd) : fd_(fd) {}
  ~PosixDirectory();
  virtual Status Fsync() override;

 private:
  int fd_;
};

}  // namespace rocksdb


text:
$(function () {
    var checkbox = $('<input>')
        .attr('type', 'checkbox')
        .addClass('permissions-modules-item-title-checkbox')
        .addClass('form-check-input')
        .click(function () {
            var checkedStatus = this.checked;
            $(this)
                .closest('.permissions-modules-item')
                .find('input:checkbox:not(:disabled)')
                .prop('checked', checkedStatus);
        });
    $('.permissions-modules-item-title').prepend(checkbox).wrap('<div class="form-check" />');
    $('.permissions-modules-item-title-checkbox').each(function (index, el) {
        var container = $(this).closest('.permissions-modules-item').find('.permissions-modules-item-checkbox'),
            all = container.find('input:checkbox').length,
            checked = container.find('input:checkbox:checked').length;
        if (all === checked) {
            $(this).prop('checked', true);
        }
    });
});


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Apricot Glazed Pears</title>
      <categories>
        <cat>Desserts</cat>
        <cat>Fruits</cat>
        <cat>Low fat</cat>
        <cat>Eat-lf mail</cat></categories>
      <yield>4</yield></head>
    <ingredients>
      <ing>
        <amt>
          <qty>1/3</qty>
          <unit>cups</unit></amt>
        <item>Apricot Jam</item></ing>
      <ing>
        <amt>
          <qty>1/4</qty>
          <unit>cups</unit></amt>
        <item>Orange Juice</item></ing>
      <ing>
        <amt>
          <qty>4</qty>
          <unit>medium</unit></amt>
        <item>Pears; Halve, Peel, Core</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Whipping Cream; Optional</item></ing>
      <ing>
        <amt>
          <qty/>
          <unit/></amt>
        <item>Ground Nutmeg; Optional</item></ing></ingredients>
    <directions>
      <step>  Bake this dessert slow and easy, or pop it into your microwave oven for a
  few minutes.

  In a 2 qt rectangular baking dish stir together jam and orange juice. Place
  pears in dish, cut side down; spoon sauce over top.  Bake, covered, in a
  350 deg F oven for 25 - 30 minutes or till tender.

  Serve warm in individual dessert dishes.  Spoon sauce over pears.  If
  desired, top with whipped cream and nutmeg.

  Makes 4 servings.

  This was very good even though I subbed peach jam for the apricot jam.

  Entered into MasterCook and tested for you by Reggie & Jeff Dwork
  <reggie@reggie.com>

  Microwave Directions: Prepare as directed, except decrease orange juice to
  3 T.  Arrange pear halves in a 2 qt microwave-safe baking dish. Cover with
  plastic wrap; turn back a corner to vent steam. cook on 100% power (HIGH)
  for 6 - 0 minutes or till tender, rearranging pears once during cooking.
  Serve as directed.
  Recipe By     : Sunset

  Posted to Digest eat-lf.v096.n216

  Date: Tue, 12 Nov 1996 11:48:07 -0800

  From: Reggie Dwork <reggie@reggie.com>

  NOTES : Cal 161.6,

  Fat  0.7g,

  Carbs  41.9g,

  Fib  4g,

  Pro  0.9g,

  Sod  11mg,

  CFF  3.5%.

</step></directions></recipe></recipeml>


text:
window.__devicetiming = {};
// start timing
__devicetiming.t = { start: new Date().getTime() };
// eval the code - the timer at the beginning of this string marks end of parse
eval("__devicetiming.t.parse = new Date().getTime();\n"+"// file content");
// end of parse to here is exec
__devicetiming.t.exec  = new Date().getTime();
// safe init window.__timing
window.__timing = window.__timing || {};
// epoch to ms
window.__timing['%%NAME%%'] = { parse: __devicetiming.t.parse - __devicetiming.t.start, exec: __devicetiming.t.exec - __devicetiming.t.parse };
// debounced becon - last file to run sends the timing data
clearTimeout(window.__timing_delay || -1);
window.__timing_delay = setTimeout(function(){
if (window.jQuery && jQuery.ajax) {
    jQuery.ajax({
    url: 'http://%%DEVICE_TIMING_SERVER_ADDR%%',
    type: 'POST',
    data: { results: JSON.stringify(window.__timing) },
        success: function() {
            window.location.reload();
        }
    });
} else {
    __devicetiming.r = new XMLHttpRequest();
    __devicetiming.r.open("POST", "http://%%DEVICE_TIMING_SERVER_ADDR%%", true);
    __devicetiming.r.onreadystatechange = function () {
    if (r.readyState != 4 || r.status != 200) return;
        window.location.reload();
    };
    __devicetiming.r.send("results="+encodeURIComponent(JSON.stringify(window.__timing)));
}
}, 6000);


text:
/*!
 * Angular Material Design
 * https://github.com/angular/material
 * @license MIT
 * v0.11.0-master-1a99821
 */
md-fab-speed-dial {
  position: relative;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  /*
   * Handle the animations
   */ }
  md-fab-speed-dial.md-fab-bottom-right {
    top: auto;
    right: 20px;
    bottom: 20px;
    left: auto;
    position: absolute; }
  md-fab-speed-dial.md-fab-bottom-left {
    top: auto;
    right: auto;
    bottom: 20px;
    left: 20px;
    position: absolute; }
  md-fab-speed-dial.md-fab-top-right {
    top: 20px;
    right: 20px;
    bottom: auto;
    left: auto;
    position: absolute; }
  md-fab-speed-dial.md-fab-top-left {
    top: 20px;
    right: auto;
    bottom: auto;
    left: 20px;
    position: absolute; }
  md-fab-speed-dial .md-css-variables {
    z-index: 20; }
  md-fab-speed-dial.md-is-open .md-fab-action-item {
    visibility: visible;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center; }
  md-fab-speed-dial md-fab-actions {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    height: auto; }
    md-fab-speed-dial md-fab-actions .md-fab-action-item {
      visibility: hidden;
      transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); }
  md-fab-speed-dial.md-down {
    -webkit-flex-direction: column;
        -ms-flex-direction: column;
            flex-direction: column; }
    md-fab-speed-dial.md-down md-fab-trigger {
      -webkit-order: 1;
          -ms-flex-order: 1;
              order: 1; }
    md-fab-speed-dial.md-down md-fab-actions {
      -webkit-flex-direction: column;
          -ms-flex-direction: column;
              flex-direction: column;
      -webkit-order: 2;
          -ms-flex-order: 2;
              order: 2; }
  md-fab-speed-dial.md-up {
    -webkit-flex-direction: column;
        -ms-flex-direction: column;
            flex-direction: column; }
    md-fab-speed-dial.md-up md-fab-trigger {
      -webkit-order: 2;
          -ms-flex-order: 2;
              order: 2; }
    md-fab-speed-dial.md-up md-fab-actions {
      -webkit-flex-direction: column-reverse;
          -ms-flex-direction: column-reverse;
              flex-direction: column-reverse;
      -webkit-order: 1;
          -ms-flex-order: 1;
              order: 1; }
  md-fab-speed-dial.md-left {
    -webkit-flex-direction: row;
        -ms-flex-direction: row;
            flex-direction: row; }
    md-fab-speed-dial.md-left md-fab-trigger {
      -webkit-order: 2;
          -ms-flex-order: 2;
              order: 2; }
    md-fab-speed-dial.md-left md-fab-actions {
      -webkit-flex-direction: row-reverse;
          -ms-flex-direction: row-reverse;
              flex-direction: row-reverse;
      -webkit-order: 1;
          -ms-flex-order: 1;
              order: 1; }
      md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item {
        transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); }
  md-fab-speed-dial.md-right {
    -webkit-flex-direction: row;
        -ms-flex-direction: row;
            flex-direction: row; }
    md-fab-speed-dial.md-right md-fab-trigger {
      -webkit-order: 1;
          -ms-flex-order: 1;
              order: 1; }
    md-fab-speed-dial.md-right md-fab-actions {
      -webkit-flex-direction: row;
          -ms-flex-direction: row;
              flex-direction: row;
      -webkit-order: 2;
          -ms-flex-order: 2;
              order: 2; }
      md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item {
        transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2); }
  md-fab-speed-dial.md-scale .md-fab-action-item {
    opacity: 0;
    -webkit-transform: scale(0);
            transform: scale(0);
    transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
    transition-duration: 0.14286s; }


text:
using NUnit.Framework;

namespace BaxterWorks.B2.NUnit.Tests
{
    /// <summary>
    /// I guess I was trying to start working on an IEnumerable bucket type, using the counter/paging function in the API
    /// </summary>
    [TestFixture]
    public class EnumerateBucketTest
    {
        [Test]
        public void TryCreateEnumerateBucketTestBucket()
        {
           Assert.Fail("Implement this!");
        }

        [Test]
        public void TestEnumerateFiles()
        {
            Assert.Fail("Implement this!");
        }
    }
}


text:
from __future__ import absolute_import, print_function

import logging
import os
import sys

from . import web

OPTIONAL_ENV = [
    "MESOS_CONFIG",
    "IMAGE"
]

REQUIRED_ENV = [
    "HOST",
    "EASYRSA_PKI"
]

def setup_logging():
    root = logging.getLogger()
    root.setLevel(logging.DEBUG)

    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)

    web.app.logger.addHandler(root)

def check_env():
    stop = False

    for k in REQUIRED_ENV:
        if not k in os.environ:
            logging.error("missing required env: {0}".format(k))
            stop = True

    if stop:
        sys.exit(1)

def main():
    setup_logging()

    check_env()
    context = ('/etc/openvpn/pki/issued/openvpn.dcos.crt', '/etc/openvpn/pki/private/openvpn.dcos.key')
    web.app.run(host='0.0.0.0', ssl_context=context, threaded=True)

if __name__ == "__main__":
    main()


text:
using System;
using Org.Apache.REEF.Common.Evaluator;
using Org.Apache.REEF.Common.Io;
using Org.Apache.REEF.Common.Protobuf.ReefProtocol;
using Org.Apache.REEF.Common.Runtime.Evaluator.Context;
using Org.Apache.REEF.Tang.Interface;
using Org.Apache.REEF.Wake.Remote;
using Org.Apache.REEF.Wake.Time;

namespace Org.Apache.REEF.Common.Runtime.Evaluator
{
    // TODO: merge with EvaluatorConfigurations class
    public class EvaluatorSettings
    {
        private readonly string _applicationId;

        private readonly string _evaluatorId;

        private readonly int _heartBeatPeriodInMs;

        private readonly int _maxHeartbeatRetries;

        private readonly ContextConfiguration _rootContextConfig;

        private readonly IClock _clock;

        private readonly IRemoteManager<REEFMessage> _remoteManager;

        private readonly IInjector _injector;

        private EvaluatorOperationState _operationState;

        private INameClient _nameClient;

        public EvaluatorSettings(
            string applicationId,
            string evaluatorId,
            int heartbeatPeriodInMs,
            int maxHeartbeatRetries,
            ContextConfiguration rootContextConfig,
            IClock clock,
            IRemoteManager<REEFMessage> remoteManager,
            IInjector injecor)
        {
            if (string.IsNullOrWhiteSpace(evaluatorId))
            {
                throw new ArgumentNullException("evaluatorId");
            }
            if (rootContextConfig == null)
            {
                throw new ArgumentNullException("rootContextConfig");
            }
            if (clock == null)
            {
                throw new ArgumentNullException("clock");
            }
            if (remoteManager == null)
            {
                throw new ArgumentNullException("remoteManager");
            }
            if (injecor == null)
            {
                throw new ArgumentNullException("injecor");
            }
            _applicationId = applicationId;
            _evaluatorId = evaluatorId;
            _heartBeatPeriodInMs = heartbeatPeriodInMs;
            _maxHeartbeatRetries = maxHeartbeatRetries;
            _rootContextConfig = rootContextConfig;
            _clock = clock;
            _remoteManager = remoteManager;
            _injector = injecor;
            _operationState = EvaluatorOperationState.OPERATIONAL;
        }

        public EvaluatorOperationState OperationState
        {
            get
            {
                return _operationState;
            }

            set
            {
                _operationState = value;
            }
        }

        public string EvalutorId
        {
            get
            {
                return _evaluatorId;
            }
        }

        public int HeartBeatPeriodInMs
        {
            get
            {
                return _heartBeatPeriodInMs;
            }
        }

        public string ApplicationId
        {
            get
            {
                return _applicationId;
            }
        }

        public int MaxHeartbeatFailures
        {
            get
            {
                return _maxHeartbeatRetries;
            }
        }

        public ContextConfiguration RootContextConfig
        {
            get
            {
                return _rootContextConfig;
            }
        }

        public IClock RuntimeClock
        {
            get
            {
                return _clock;
            }
        }

        public INameClient NameClient
        {
            get
            {
                return _nameClient;
            }

            set
            {
                _nameClient = value;
            }
        }

        public IRemoteManager<REEFMessage> RemoteManager
        {
            get
            {
                return _remoteManager;
            }
        }

        public IInjector Injector
        {
            get
            {
                return _injector;
            }
        }
    }
}


text:
//=================================================================================================

//=================================================================================================

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <cstdlib>
#include <iostream>
#include <blaze/math/HybridMatrix.h>
#include <blaze/math/SymmetricMatrix.h>
#include <blazetest/mathtest/Creator.h>
#include <blazetest/mathtest/dmatdmatsub/OperationTest.h>
#include <blazetest/system/MathTest.h>

//=================================================================================================
//
//  MAIN FUNCTION
//
//=================================================================================================

//*************************************************************************************************
int main()
{
   std::cout << "   Running 'SHbSHa'..." << std::endl;

   using blazetest::mathtest::TypeA;
   using blazetest::mathtest::TypeB;

   try
   {
      // Matrix type definitions
      typedef blaze::SymmetricMatrix< blaze::HybridMatrix<TypeB,128UL,128UL> >  SHb;
      typedef blaze::SymmetricMatrix< blaze::HybridMatrix<TypeA,128UL,128UL> >  SHa;

      // Creator type definitions
      typedef blazetest::Creator<SHb>  CSHb;
      typedef blazetest::Creator<SHa>  CSHa;

      // Running tests with small matrices
      for( size_t i=0UL; i<=9UL; ++i ) {
         RUN_DMATDMATSUB_OPERATION_TEST( CSHb( i ), CSHa( i ) );
      }

      // Running tests with large matrices
      RUN_DMATDMATSUB_OPERATION_TEST( CSHb(  67UL ), CSHa(  67UL ) );
      RUN_DMATDMATSUB_OPERATION_TEST( CSHb( 128UL ), CSHa( 128UL ) );
   }
   catch( std::exception& ex ) {
      std::cerr << "\n\n ERROR DETECTED during dense matrix/dense matrix subtraction:\n"
                << ex.what() << "\n";
      return EXIT_FAILURE;
   }

   return EXIT_SUCCESS;
}
//*************************************************************************************************


text:
package net.tridentsdk.entity;

import net.tridentsdk.entity.traits.FireworkProperties;

/**
 * A charge that explodes with various specified colors and properties
 *
 * @author The TridentSDK Team
 */
public interface Firework extends Entity {
    /**
     * Get the number of ticks that this Firework will explode at
     *
     * @return the number of ticks that this will explode at
     */
    int timeLived();

    /**
     * Returns the properties of the Firework launched
     *
     * @return the properties of the firework launched
     */
    FireworkProperties properties();
}


text:
<?php

use yii\db\Schema;
use yii\db\Migration;

class m151128_132336_fix_foreing_keys_for_article_tag extends Migration
{
    public function safeUp()
    {
        $this->dropForeignKey('article_tag_article_id', 'article_tag');
        $this->addForeignKey('article_tag_article_id', 'article_tag', 'article_id', 'articles', 'id', 'CASCADE', 'CASCADE');
    }

    public function safeDown()
    {

        $this->dropForeignKey('article_tag_article_id', 'article_tag');
        $this->addForeignKey('article_tag_article_id', 'article_tag', 'article_id', 'articles', 'id', 'RESTRICT', 'CASCADE');
    }
}


text:
class AClass
{
    final AClass f = null<caret>;
}