text:
include(RunCMake)

run_cmake(EmptyGet0)
run_cmake(EmptyRemoveAt0)
run_cmake(EmptyInsert-1)

run_cmake(NoArguments)
run_cmake(InvalidSubcommand)
run_cmake(GET-CMP0007-WARN)

run_cmake(GET-InvalidIndex)
run_cmake(INSERT-InvalidIndex)
run_cmake(REMOVE_AT-InvalidIndex)

run_cmake(LENGTH-TooManyArguments)
run_cmake(REMOVE_DUPLICATES-TooManyArguments)
run_cmake(REVERSE-TooManyArguments)
run_cmake(SORT-TooManyArguments)

run_cmake(REMOVE_AT-NotList)
run_cmake(REMOVE_DUPLICATES-NotList)
run_cmake(REMOVE_ITEM-NotList)
run_cmake(REVERSE-NotList)
run_cmake(SORT-NotList)


text:
package opts

import (
	"encoding/json"
	"errors"
	"regexp"
	"strings"
)

// Args stores a mapping of keys to a set of multiple values.
type Args struct {
	fields map[string]map[string]bool
}

// KeyValuePair are used to initialize a new Args
type KeyValuePair struct {
	Key   string
	Value string
}

// Arg creates a new KeyValuePair for initializing Args
func Arg(key, value string) KeyValuePair {
	return KeyValuePair{Key: key, Value: value}
}

// NewArgs returns a new Args populated with the initial args
func NewArgs(initialArgs ...KeyValuePair) Args {
	args := Args{fields: map[string]map[string]bool{}}
	for _, arg := range initialArgs {
		args.Add(arg.Key, arg.Value)
	}
	return args
}

// ParseFlag parses a key=value string and adds it to an Args.
//
// Deprecated: Use Args.Add()
func ParseFlag(arg string, prev Args) (Args, error) {
	filters := prev
	if len(arg) == 0 {
		return filters, nil
	}

	if !strings.Contains(arg, "=") {
		return filters, ErrBadFormat
	}

	f := strings.SplitN(arg, "=", 2)

	name := strings.ToLower(strings.TrimSpace(f[0]))
	value := strings.TrimSpace(f[1])

	filters.Add(name, value)

	return filters, nil
}

// ErrBadFormat is an error returned when a filter is not in the form key=value
//
// Deprecated: this error will be removed in a future version
var ErrBadFormat = errors.New("bad format of filter (expected name=value)")

// ToParam encodes the Args as args JSON encoded string
//
// Deprecated: use ToJSON
func ToParam(a Args) (string, error) {
	return ToJSON(a)
}

// MarshalJSON returns a JSON byte representation of the Args
func (args Args) MarshalJSON() ([]byte, error) {
	if len(args.fields) == 0 {
		return []byte{}, nil
	}
	return json.Marshal(args.fields)
}

// ToJSON returns the Args as a JSON encoded string
func ToJSON(a Args) (string, error) {
	if a.Len() == 0 {
		return "", nil
	}
	buf, err := json.Marshal(a)
	return string(buf), err
}

// Get returns the list of values associated with the key
func (args Args) Get(key string) []string {
	values := args.fields[key]
	if values == nil {
		return make([]string, 0)
	}
	slice := make([]string, 0, len(values))
	for key := range values {
		slice = append(slice, key)
	}
	return slice
}

// Add a new value to the set of values
func (args Args) Add(key, value string) {
	if _, ok := args.fields[key]; ok {
		args.fields[key][value] = true
	} else {
		args.fields[key] = map[string]bool{value: true}
	}
}

// Del removes a value from the set
func (args Args) Del(key, value string) {
	if _, ok := args.fields[key]; ok {
		delete(args.fields[key], value)
		if len(args.fields[key]) == 0 {
			delete(args.fields, key)
		}
	}
}

// Len returns the number of keys in the mapping
func (args Args) Len() int {
	return len(args.fields)
}

// MatchKVList returns true if all the pairs in sources exist as key=value
// pairs in the mapping at key, or if there are no values at key.
func (args Args) MatchKVList(key string, sources map[string]string) bool {
	fieldValues := args.fields[key]

	//do not filter if there is no filter set or cannot determine filter
	if len(fieldValues) == 0 {
		return true
	}

	if len(sources) == 0 {
		return false
	}

	for value := range fieldValues {
		testKV := strings.SplitN(value, "=", 2)

		v, ok := sources[testKV[0]]
		if !ok {
			return false
		}
		if len(testKV) == 2 && testKV[1] != v {
			return false
		}
	}

	return true
}

// Match returns true if any of the values at key match the source string
func (args Args) Match(field, source string) bool {
	if args.ExactMatch(field, source) {
		return true
	}

	fieldValues := args.fields[field]
	for name2match := range fieldValues {
		match, err := regexp.MatchString(name2match, source)
		if err != nil {
			continue
		}
		if match {
			return true
		}
	}
	return false
}

// ExactMatch returns true if the source matches exactly one of the values.
func (args Args) ExactMatch(key, source string) bool {
	fieldValues, ok := args.fields[key]
	//do not filter if there is no filter set or cannot determine filter
	if !ok || len(fieldValues) == 0 {
		return true
	}

	// try to match full name value to avoid O(N) regular expression matching
	return fieldValues[source]
}

// UniqueExactMatch returns true if there is only one value and the source
// matches exactly the value.
func (args Args) UniqueExactMatch(key, source string) bool {
	fieldValues := args.fields[key]
	//do not filter if there is no filter set or cannot determine filter
	if len(fieldValues) == 0 {
		return true
	}
	if len(args.fields[key]) != 1 {
		return false
	}

	// try to match full name value to avoid O(N) regular expression matching
	return fieldValues[source]
}

// FuzzyMatch returns true if the source matches exactly one value,  or the
// source has one of the values as a prefix.
func (args Args) FuzzyMatch(key, source string) bool {
	if args.ExactMatch(key, source) {
		return true
	}

	fieldValues := args.fields[key]
	for prefix := range fieldValues {
		if strings.HasPrefix(source, prefix) {
			return true
		}
	}
	return false
}

// Include returns true if the key exists in the mapping
//
// Deprecated: use Contains
func (args Args) Include(field string) bool {
	_, ok := args.fields[field]
	return ok
}

// Contains returns true if the key exists in the mapping
func (args Args) Contains(field string) bool {
	_, ok := args.fields[field]
	return ok
}

type invalidFilter string

func (e invalidFilter) Error() string {
	return "Invalid filter '" + string(e) + "'"
}

func (invalidFilter) InvalidParameter() {}

// Validate compared the set of accepted keys against the keys in the mapping.
// An error is returned if any mapping keys are not in the accepted set.
func (args Args) Validate(accepted map[string]bool) error {
	for name := range args.fields {
		if !accepted[name] {
			return invalidFilter(name)
		}
	}
	return nil
}

// WalkValues iterates over the list of values for a key in the mapping and calls
// op() for each value. If op returns an error the iteration stops and the
// error is returned.
func (args Args) WalkValues(field string, op func(value string) error) error {
	if _, ok := args.fields[field]; !ok {
		return nil
	}
	for v := range args.fields[field] {
		if err := op(v); err != nil {
			return err
		}
	}
	return nil
}

redpajama_set_name: RedPajamaGithub


text:
<?php
if ($EE_view_disable !== TRUE)
{
	$this->load->view('_shared/header');
	$this->load->view('_shared/main_menu');
	$this->load->view('_shared/sidebar');
	$this->load->view('_shared/breadcrumbs');
}
?>

<div id="mainContent"<?=$maincontent_state?>>
	<?php $this->load->view('_shared/right_nav')?>

		<?php $this->load->view('_shared/message');?>

<?=$cp_page_title?>

		<?=$message?>

<?php
if ($EE_view_disable !== TRUE)
{
	$this->load->view('_shared/accessories');
	$this->load->view('_shared/footer');
}

/* End of file message.php */
/* Location: ./themes/cp_themes/default/members/message.php */


text:
namespace mus {
namespace ws {
namespace {

base::TimeDelta GetDefaultAckTimerDelay() {
#if defined(NDEBUG)
  return base::TimeDelta::FromMilliseconds(100);
#else
  return base::TimeDelta::FromMilliseconds(1000);
#endif
}

bool EventsCanBeCoalesced(const ui::Event& one, const ui::Event& two) {
  if (one.type() != two.type() || one.flags() != two.flags())
    return false;

  // TODO(sad): wheel events can also be merged.
  if (one.type() != ui::ET_POINTER_MOVED)
    return false;

  return one.AsPointerEvent()->pointer_id() ==
         two.AsPointerEvent()->pointer_id();
}

scoped_ptr<ui::Event> CoalesceEvents(scoped_ptr<ui::Event> first,
                                     scoped_ptr<ui::Event> second) {
  DCHECK(first->type() == ui::ET_POINTER_MOVED)
      << " Non-move events cannot be merged yet.";
  // For mouse moves, the new event just replaces the old event.
  return second;
}

}  // namespace

class WindowManagerState::ProcessedEventTarget {
 public:
  ProcessedEventTarget(ServerWindow* window, bool in_nonclient_area)
      : in_nonclient_area_(in_nonclient_area) {
    tracker_.Add(window);
  }

  ~ProcessedEventTarget() {}

  // Return true if the event is still valid. The event becomes invalid if
  // the window is destroyed while waiting to dispatch.
  bool IsValid() const { return !tracker_.windows().empty(); }

  ServerWindow* window() {
    DCHECK(IsValid());
    return tracker_.windows().front();
  }

  bool in_nonclient_area() const { return in_nonclient_area_; }

 private:
  ServerWindowTracker tracker_;
  const bool in_nonclient_area_;

  DISALLOW_COPY_AND_ASSIGN(ProcessedEventTarget);
};

WindowManagerState::QueuedEvent::QueuedEvent() {}
WindowManagerState::QueuedEvent::~QueuedEvent() {}

WindowManagerState::WindowManagerState(Display* display,
                                       PlatformDisplay* platform_display,
                                       cc::SurfaceId surface_id)
    : WindowManagerState(display,
                         platform_display,
                         surface_id,
                         false,
                         mojo::shell::mojom::kRootUserID) {}

WindowManagerState::WindowManagerState(Display* display,
                                       PlatformDisplay* platform_display,
                                       cc::SurfaceId surface_id,
                                       const UserId& user_id)
    : WindowManagerState(display, platform_display, surface_id, true, user_id) {
}

WindowManagerState::~WindowManagerState() {}

void WindowManagerState::SetFrameDecorationValues(
    mojom::FrameDecorationValuesPtr values) {
  got_frame_decoration_values_ = true;
  frame_decoration_values_ = values.Clone();
  display_->display_manager()
      ->GetUserDisplayManager(user_id_)
      ->OnFrameDecorationValuesChanged(this);
}

bool WindowManagerState::SetCapture(ServerWindow* window,
                                    bool in_nonclient_area) {
  // TODO(sky): capture should be a singleton. Need to route to
  // ConnectionManager so that all other EventDispatchers are updated.
  DCHECK(IsActive());
  if (capture_window() == window)
    return true;
  DCHECK(!window || root_->Contains(window));
  return event_dispatcher_.SetCaptureWindow(window, in_nonclient_area);
}

void WindowManagerState::ReleaseCaptureBlockedByModalWindow(
    const ServerWindow* modal_window) {
  if (!capture_window() || !modal_window->is_modal() ||
      !modal_window->IsDrawn())
    return;

  if (modal_window->transient_parent() &&
      !modal_window->transient_parent()->Contains(capture_window())) {
    return;
  }

  SetCapture(nullptr, false);
}

void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() {
  if (!capture_window() || !capture_window()->IsBlockedByModalWindow())
    return;

  SetCapture(nullptr, false);
}

mojom::DisplayPtr WindowManagerState::ToMojomDisplay() const {
  mojom::DisplayPtr display_ptr = display_->ToMojomDisplay();
  // TODO(sky): set work area.
  display_ptr->work_area = display_ptr->bounds.Clone();
  display_ptr->frame_decoration_values = frame_decoration_values_.Clone();
  return display_ptr;
}

void WindowManagerState::OnWillDestroyTree(WindowTree* tree) {
  if (tree_awaiting_input_ack_ != tree)
    return;
  // The WindowTree is dying. So it's not going to ack the event.
  OnEventAck(tree_awaiting_input_ack_);
}

WindowManagerState::WindowManagerState(Display* display,
                                       PlatformDisplay* platform_display,
                                       cc::SurfaceId surface_id,
                                       bool is_user_id_valid,
                                       const UserId& user_id)
    : display_(display),
      platform_display_(platform_display),
      is_user_id_valid_(is_user_id_valid),
      user_id_(user_id),
      event_dispatcher_(this) {
  frame_decoration_values_ = mojom::FrameDecorationValues::New();
  frame_decoration_values_->normal_client_area_insets = mojo::Insets::New();
  frame_decoration_values_->maximized_client_area_insets = mojo::Insets::New();
  frame_decoration_values_->max_title_bar_button_width = 0u;

  ConnectionManager* connection_manager = display_->connection_manager();
  root_.reset(connection_manager->CreateServerWindow(
      connection_manager->display_manager()->GetAndAdvanceNextRootId(),
      ServerWindow::Properties()));
  // Our root is always a child of the Display's root. Do this
  // before the WindowTree has been created so that the client doesn't get
  // notified of the add, bounds change and visibility change.
  root_->SetBounds(gfx::Rect(display->root_window()->bounds().size()));
  root_->SetVisible(true);
  display->root_window()->Add(root_.get());

  event_dispatcher_.set_root(root_.get());
  event_dispatcher_.set_surface_id(surface_id);
}

bool WindowManagerState::IsActive() const {
  return display()->GetActiveWindowManagerState() == this;
}

void WindowManagerState::ProcessEvent(const ui::Event& event) {
  mojom::EventPtr mojo_event(mojom::Event::From(event));
  // If this is still waiting for an ack from a previously sent event, then
  // queue up the event to be dispatched once the ack is received.
  if (event_ack_timer_.IsRunning()) {
    if (!event_queue_.empty() && !event_queue_.back()->processed_target &&
        EventsCanBeCoalesced(*event_queue_.back()->event, event)) {
      event_queue_.back()->event = CoalesceEvents(
          std::move(event_queue_.back()->event), ui::Event::Clone(event));
      return;
    }
    QueueEvent(event, nullptr);
    return;
  }
  event_dispatcher_.ProcessEvent(event);
}

void WindowManagerState::OnEventAck(mojom::WindowTree* tree) {
  if (tree_awaiting_input_ack_ != tree) {
    // TODO(sad): The ack must have arrived after the timeout. We should do
    // something here, and in OnEventAckTimeout().
    return;
  }
  tree_awaiting_input_ack_ = nullptr;
  event_ack_timer_.Stop();
  ProcessNextEventFromQueue();
}

ConnectionManager* WindowManagerState::connection_manager() {
  return display_->connection_manager();
}

void WindowManagerState::OnEventAckTimeout() {
  // TODO(sad): Figure out what we should do.
  NOTIMPLEMENTED() << "Event ACK timed out.";
  OnEventAck(tree_awaiting_input_ack_);
}

void WindowManagerState::QueueEvent(
    const ui::Event& event,
    scoped_ptr<ProcessedEventTarget> processed_event_target) {
  scoped_ptr<QueuedEvent> queued_event(new QueuedEvent);
  queued_event->event = ui::Event::Clone(event);
  queued_event->processed_target = std::move(processed_event_target);
  event_queue_.push(std::move(queued_event));
}

void WindowManagerState::ProcessNextEventFromQueue() {
  // Loop through |event_queue_| stopping after dispatching the first valid
  // event.
  while (!event_queue_.empty()) {
    scoped_ptr<QueuedEvent> queued_event = std::move(event_queue_.front());
    event_queue_.pop();
    if (!queued_event->processed_target) {
      event_dispatcher_.ProcessEvent(*queued_event->event);
      return;
    }
    if (queued_event->processed_target->IsValid()) {
      DispatchInputEventToWindowImpl(
          queued_event->processed_target->window(),
          queued_event->processed_target->in_nonclient_area(),
          *queued_event->event);
      return;
    }
  }
}

void WindowManagerState::DispatchInputEventToWindowImpl(
    ServerWindow* target,
    bool in_nonclient_area,
    const ui::Event& event) {
  if (target == root_->parent())
    target = root_.get();

  if (event.IsMousePointerEvent()) {
    DCHECK(event_dispatcher_.mouse_cursor_source_window());
    display_->UpdateNativeCursor(
        event_dispatcher_.mouse_cursor_source_window()->cursor());
  }

  // If the event is in the non-client area the event goes to the owner of
  // the window. Otherwise if the window is an embed root, forward to the
  // embedded window.
  WindowTree* tree =
      in_nonclient_area
          ? connection_manager()->GetTreeWithId(target->id().connection_id)
          : connection_manager()->GetTreeWithRoot(target);
  if (!tree) {
    DCHECK(!in_nonclient_area);
    tree = connection_manager()->GetTreeWithId(target->id().connection_id);
  }

  // TOOD(sad): Adjust this delay, possibly make this dynamic.
  const base::TimeDelta max_delay = base::debug::BeingDebugged()
                                        ? base::TimeDelta::FromDays(1)
                                        : GetDefaultAckTimerDelay();
  event_ack_timer_.Start(FROM_HERE, max_delay, this,
                         &WindowManagerState::OnEventAckTimeout);

  tree_awaiting_input_ack_ = tree;
  tree->DispatchInputEvent(target, mojom::Event::From(event));
}

void WindowManagerState::OnAccelerator(uint32_t accelerator_id,
                                       const ui::Event& event) {
  DCHECK(IsActive());
  tree_->OnAccelerator(accelerator_id, mojom::Event::From(event));
}

void WindowManagerState::SetFocusedWindowFromEventDispatcher(
    ServerWindow* new_focused_window) {
  DCHECK(IsActive());
  display_->SetFocusedWindow(new_focused_window);
}

ServerWindow* WindowManagerState::GetFocusedWindowForEventDispatcher() {
  return display()->GetFocusedWindow();
}

void WindowManagerState::SetNativeCapture() {
  DCHECK(IsActive());
  platform_display_->SetCapture();
}

void WindowManagerState::ReleaseNativeCapture() {
  platform_display_->ReleaseCapture();
}

void WindowManagerState::OnServerWindowCaptureLost(ServerWindow* window) {
  DCHECK(window);
  display_->connection_manager()->ProcessLostCapture(window);
}

void WindowManagerState::DispatchInputEventToWindow(ServerWindow* target,
                                                    bool in_nonclient_area,
                                                    const ui::Event& event) {
  DCHECK(IsActive());
  // TODO(sky): this needs to see if another wms has capture and if so forward
  // to it.
  if (event_ack_timer_.IsRunning()) {
    scoped_ptr<ProcessedEventTarget> processed_event_target(
        new ProcessedEventTarget(target, in_nonclient_area));
    QueueEvent(event, std::move(processed_event_target));
    return;
  }

  DispatchInputEventToWindowImpl(target, in_nonclient_area, event);
}

}  // namespace ws
}  // namespace mus


text:
package com.example.dreamteam.beergram.aboutapp;

import com.example.dreamteam.beergram.data.IRepository;

import javax.inject.Inject;

public class AboutAppPresenter implements AboutAppContract.Presenter{
    private IRepository repository;
    private AboutAppContract.View view;

    @Inject
    public void CameraPresenter(AboutAppContract.View view, IRepository repository) {
        this.view = view;
        this.repository = repository;
    }

    @Override
    public void start() {

    }
}


text:
//  Search.cs  (c) 2003 Kari Laitinen

//  www.naturalprogramming.com

using System ;
using System.IO ;

class Search
{
   static void search_string_in_file( string  file_name_from_caller,
                                      string  string_to_be_searched )
   {
      try
      {
         StreamReader file_to_read  =  new  StreamReader(
                                                 file_name_from_caller ) ;
         Console.Write( "\n Searching ... \""
                     +  string_to_be_searched  + "\"\n" ) ;

         int   line_counter  =  0 ;
         bool  end_of_file_encountered  =  false ;

         while ( end_of_file_encountered  ==  false )
         {
            string  text_line_from_file   =  file_to_read.ReadLine() ;

            if ( text_line_from_file  ==  null )
            {
               end_of_file_encountered  =  true ;
            }
            else
            {
               line_counter  ++ ;

               if ( text_line_from_file.IndexOf(
                                           string_to_be_searched )  !=  -1 )
               {
                  Console.Write( "\n String \"" +  string_to_be_searched
                               + "\" was found on line "  +  line_counter ) ;
               }
            }
         }

         file_to_read.Close() ;
      }
      catch ( FileNotFoundException )
      {
         Console.Write( "\n Cannot open file " + file_name_from_caller ) ;
      }
   }

   static void Main( string[] command_line_parameters )
   {
      if ( command_line_parameters.Length  ==  2 )
      {
         search_string_in_file ( command_line_parameters[ 0 ],
                                 command_line_parameters[ 1 ] ) ;
      }
      else
      {
         Console.Write( "\n This program can search a string in a "
                      + "\n text file. Give first the file name :  " ) ;

         string  file_name_given_by_user  =  Console.ReadLine() ;

         Console.Write( "\n Type in the string to be searched: " ) ;

         string  string_to_be_searched    =  Console.ReadLine() ;

         search_string_in_file( file_name_given_by_user,
                                string_to_be_searched ) ;
      }
   }
}


text:
package com.suscipio_solutions.consecro_mud.Abilities.Songs;
import com.suscipio_solutions.consecro_mud.Abilities.interfaces.Ability;
import com.suscipio_solutions.consecro_mud.Items.interfaces.MusicalInstrument;
import com.suscipio_solutions.consecro_mud.core.CMClass;
import com.suscipio_solutions.consecro_mud.core.CMLib;

public class Play_Harps extends Play_Instrument
{
	@Override public String ID() { return "Play_Harps"; }
	private final static String localizedName = CMLib.lang().L("Harps");
	@Override public String name() { return localizedName; }
	@Override protected int requiredInstrumentType(){return MusicalInstrument.TYPE_HARPS;}
	@Override public String mimicSpell(){return "Spell_Friends";}
	private static Ability theSpell=null;
	@Override
	protected Ability getSpell()
	{
		if(theSpell!=null) return theSpell;
		if(mimicSpell().length()==0) return null;
		theSpell=CMClass.getAbility(mimicSpell());
		return theSpell;
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
<!--   <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>com.demo.server.GreetingServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/gwt_guice_dispatcher_demo1/greet</url-pattern>
  </servlet-mapping>

  Default page to serve
  <welcome-file-list>
    <welcome-file>Gwt_guice_dispatcher_demo1.html</welcome-file>
  </welcome-file-list> -->

  <filter>
  <filter-name>guiceFilter</filter-name>
  <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
 </filter>
 <filter-mapping>
  <filter-name>guiceFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <listener>
  <listener-class>com.demo.server.GWTDispatcherServletContextListener</listener-class>
 </listener>

 <welcome-file-list>
   <welcome-file>Gwt_guice_dispatcher_demo1.html</welcome-file>
 </welcome-file-list>

</web-app>


text:
/* *
 *
 *  (c) 2010-2020 Highsoft AS
 *
 *  Author: Sebastian Domas
 *
 *  License: www.highcharts.com/license
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
import BaseSeries from '../Core/Series/Series.js';
import DerivedSeriesMixin from '../Mixins/DerivedSeries.js';
import U from '../Core/Utilities.js';
var correctFloat = U.correctFloat, isNumber = U.isNumber, merge = U.merge;
/* ************************************************************************** *
 *  BELL CURVE                                                                *
 * ************************************************************************** */
/* eslint-disable valid-jsdoc */
/**
 * @private
 */
function mean(data) {
    var length = data.length, sum = data.reduce(function (sum, value) {
        return (sum += value);
    }, 0);
    return length > 0 && sum / length;
}
/**
 * @private
 */
function standardDeviation(data, average) {
    var len = data.length, sum;
    average = isNumber(average) ? average : mean(data);
    sum = data.reduce(function (sum, value) {
        var diff = value - average;
        return (sum += diff * diff);
    }, 0);
    return len > 1 && Math.sqrt(sum / (len - 1));
}
/**
 * @private
 */
function normalDensity(x, mean, standardDeviation) {
    var translation = x - mean;
    return Math.exp(-(translation * translation) /
        (2 * standardDeviation * standardDeviation)) / (standardDeviation * Math.sqrt(2 * Math.PI));
}
/* eslint-enable valid-jsdoc */
/**
 * Bell curve class
 *
 * @private
 * @class
 * @name Highcharts.seriesTypes.bellcurve
 *
 * @augments Highcharts.Series
 */
BaseSeries.seriesType('bellcurve', 'areaspline'
/**
 * A bell curve is an areaspline series which represents the probability
 * density function of the normal distribution. It calculates mean and
 * standard deviation of the base series data and plots the curve according
 * to the calculated parameters.
 *
 * @sample {highcharts} highcharts/demo/bellcurve/
 *         Bell curve
 *
 * @extends      plotOptions.areaspline
 * @since        6.0.0
 * @product      highcharts
 * @excluding    boostThreshold, connectNulls, dragDrop, stacking,
 *               pointInterval, pointIntervalUnit
 * @requires     modules/bellcurve
 * @optionparent plotOptions.bellcurve
 */
, {
    /**
     * @see [fillColor](#plotOptions.bellcurve.fillColor)
     * @see [fillOpacity](#plotOptions.bellcurve.fillOpacity)
     *
     * @apioption plotOptions.bellcurve.color
     */
    /**
     * @see [color](#plotOptions.bellcurve.color)
     * @see [fillOpacity](#plotOptions.bellcurve.fillOpacity)
     *
     * @apioption plotOptions.bellcurve.fillColor
     */
    /**
     * @see [color](#plotOptions.bellcurve.color)
     * @see [fillColor](#plotOptions.bellcurve.fillColor)
     *
     * @default   {highcharts} 0.75
     * @default   {highstock} 0.75
     * @apioption plotOptions.bellcurve.fillOpacity
     */
    /**
     * This option allows to define the length of the bell curve. A unit of
     * the length of the bell curve is standard deviation.
     *
     * @sample highcharts/plotoptions/bellcurve-intervals-pointsininterval
     *         Intervals and points in interval
     */
    intervals: 3,
    /**
     * Defines how many points should be plotted within 1 interval. See
     * `plotOptions.bellcurve.intervals`.
     *
     * @sample highcharts/plotoptions/bellcurve-intervals-pointsininterval
     *         Intervals and points in interval
     */
    pointsInInterval: 3,
    marker: {
        enabled: false
    }
}, merge(DerivedSeriesMixin, {
    setMean: function () {
        this.mean = correctFloat(mean(this.baseSeries.yData));
    },
    setStandardDeviation: function () {
        this.standardDeviation = correctFloat(standardDeviation(this.baseSeries.yData, this.mean));
    },
    setDerivedData: function () {
        if (this.baseSeries.yData.length > 1) {
            this.setMean();
            this.setStandardDeviation();
            this.setData(this.derivedData(this.mean, this.standardDeviation), false);
        }
        return (void 0);
    },
    derivedData: function (mean, standardDeviation) {
        var intervals = this.options.intervals, pointsInInterval = this.options.pointsInInterval, x = mean - intervals * standardDeviation, stop = intervals * pointsInInterval * 2 + 1, increment = standardDeviation / pointsInInterval, data = [], i;
        for (i = 0; i < stop; i++) {
            data.push([x, normalDensity(x, mean, standardDeviation)]);
            x += increment;
        }
        return data;
    }
}));
/**
 * A `bellcurve` series. If the [type](#series.bellcurve.type) option is not
 * specified, it is inherited from [chart.type](#chart.type).
 *
 * For options that apply to multiple series, it is recommended to add
 * them to the [plotOptions.series](#plotOptions.series) options structure.
 * To apply to all series of this specific type, apply it to
 * [plotOptions.bellcurve](#plotOptions.bellcurve).
 *
 * @extends   series,plotOptions.bellcurve
 * @since     6.0.0
 * @product   highcharts
 * @excluding dataParser, dataURL, data, boostThreshold, boostBlending
 * @requires  modules/bellcurve
 * @apioption series.bellcurve
 */
/**
 * An integer identifying the index to use for the base series, or a string
 * representing the id of the series.
 *
 * @type      {number|string}
 * @apioption series.bellcurve.baseSeries
 */
/**
 * @see [fillColor](#series.bellcurve.fillColor)
 * @see [fillOpacity](#series.bellcurve.fillOpacity)
 *
 * @apioption series.bellcurve.color
 */
/**
 * @see [color](#series.bellcurve.color)
 * @see [fillOpacity](#series.bellcurve.fillOpacity)
 *
 * @apioption series.bellcurve.fillColor
 */
/**
 * @see [color](#series.bellcurve.color)
 * @see [fillColor](#series.bellcurve.fillColor)
 *
 * @default   {highcharts} 0.75
 * @default   {highstock} 0.75
 * @apioption series.bellcurve.fillOpacity
 */
''; // adds doclets above to transpiled file


text:
var Item = Backbone.Model.extend({
	urlRoot: '/Twinkler1.2/web/app_dev.php/items',
	defaults: {
		name: 'Empty item ...',
		status: 'incomplete'
	},
	toggleStatus: function(){
		if(this.get('status') === 'incomplete'){
			this.set({'status': 'complete'});
		}else{
			this.set({'status': 'incomplete'});
		}
		this.save();
	},
	cancel: function(){
		if(this.get('status') === 'incomplete'){
			this.set({'status': 'cancelled'});
		}else{
			this.set({'status': 'removed'});
		}
		this.save();
	}
});

var ItemView = Backbone.View.extend({
	tagName: 'tr',
	id: 'item-view',
	className: 'item',
	template: _.template('<input type=checkbox <% if(status == "complete") print("checked") %>/>	'+
		'<td class="item-name <%= status %>"><%= name %>	' +
		'
x
	'),
	events: {
		'change .item-input input': 'toggleStatus',
		'click .name': 'edit',
		'click .remove': 'remove'
	},
	initialize: function(){
		this.model.on('change', this.render, this);
		this.model.on('destroy', this.remove, this);
		this.model.on('hide', this.remove, this);
	},
	toggleStatus: function(){
		this.model.toggleStatus();
	},
	render: function(){
		var attributes = this.model.toJSON()
		this.$el.html(this.template(attributes));
	},
	edit: function(){
		var editForm = new EditForm({model: this.model});
		editForm.render();
		this.$el.find('.item-name').html(editForm.el);
	},
	remove: function(){
		this.$el.remove();
		this.model.cancel();
	}
});

var ItemForm = Backbone.View.extend({
	model: Item,
	template: _.template('<form>' +
		'<input name=name placeholder="<%= name %>" />' +
		'<button>Save</button></form>'),
	events: {
		submit: 'save'
	},
	save: function(e){
		e.preventDefault();
		col = this.collection;
		mod = this.model;
		var newName = this.$('input[name=name]').val();
		this.model.save({name: newName}, {
			success: function(){
				this.$('input[name=name]').val('');
				col.add(mod);
			}
		});
		this.model = new Item({name: "Add an item to the list ..."});
		this.$el.focus();
	},
	render: function(){
		this.$el.html(this.template(this.model.attributes));
		return this;
	}
});

var EditForm = Backbone.View.extend({
	model: Item,
	template: _.template('<form>' +
		'<input name=name value="<%= name %>" />' +
		'<button>Save</button></form>'),
	events: {
		submit: 'save'
	},
	save: function(e){
		e.preventDefault();
		console.log('model name1: '+ this.model.get('name'));
		var newName = this.$('input[name=name]').val();
		this.model.set({name: newName});
		console.log('model name2: '+ this.model.get('name'));
		this.model.save();
		console.log('model name3: '+ this.model.get('name'));
	},
	render: function(){
		this.$el.html(this.template(this.model.attributes));
		return this;
	}
});

var ItemList = Backbone.Collection.extend({
	url: '/Twinkler1.2/web/app_dev.php/items',
	model: Item,
	initialize: function(){
		this.on('remove', this.hideModel);
	},
	hideModel: function(model){
		model.cancel();
		model.trigger('hide');
	}
});

var ItemListView = Backbone.View.extend({
	tagName: 'tbody',
	initialize: function(){
		this.collection.on('add', this.addOne, this);
		this.collection.on('reset', this.addAll, this);
	},
	render: function(){
		this.addAll();
		return this;
	},
	addOne: function(item){
		view = new ItemView({model: item});
	 	view.render();
	 	this.$el.append(view.el);
	},
	addAll: function(){
		this.collection.forEach(this.addOne, this);
	}
});

var Appstart = function(){
	var itemList = new ItemList();
	var itemListView = new ItemListView({collection: itemList});
	itemList.fetch({
		success: function(){

			itemList.forEach(function(item){
			  console.log(item.get('name'));
			});

			itemListView = new ItemListView({collection: itemList});
			itemListView.render();
			$('#list-box').append(itemListView.el);

			$('.item').mouseover(function(){
			$(this).find('.remove').fadeIn();
		});
		}
	});
	var formItem = new Item({name: "Add an item to the list ..."});
	var itemForm = new ItemForm({model: formItem, collection: itemList});
	itemForm.render();
	$('#form-box').append(itemForm.el);

	$("#list-menu").find('a').on('click', function(e){
		e.preventDefault();
		var id = $(this).data('id');
		$.get('/Twinkler1.2/web/app_dev.php/group/ajax/change/lists/'+id, function(response){
			$('#content-container').html(response);
			Appstart();
		});
	});
}

$(document).ready(function() {
	Appstart();
});


text:
using namespace gpopt;

//---------------------------------------------------------------------------
//	@function:
//		CColumnFactoryTest::EresUnittest
//
//	@doc:
//		Unittest for column factory
//
//---------------------------------------------------------------------------
GPOS_RESULT
CColumnFactoryTest::EresUnittest()
{
	CUnittest rgut[] =
		{
		GPOS_UNITTEST_FUNC(CColumnFactoryTest::EresUnittest_Basic)
		};

	return CUnittest::EresExecute(rgut, GPOS_ARRAY_SIZE(rgut));
}

//---------------------------------------------------------------------------
//	@function:
//		CColumnFactoryTest::EresUnittest_Basic
//
//	@doc:
//		Basic array allocation test
//
//---------------------------------------------------------------------------
GPOS_RESULT
CColumnFactoryTest::EresUnittest_Basic()
{
	CAutoMemoryPool amp;
	IMemoryPool *pmp = amp.Pmp();

	CMDProviderMemory *pmdp = CTestUtils::m_pmdpf;
	pmdp->AddRef();
	CMDAccessor mda(pmp, CMDCache::Pcache());
	mda.RegisterProvider(CTestUtils::m_sysidDefault, pmdp);

	const IMDTypeInt4 *pmdtypeint4 = mda.PtMDType<IMDTypeInt4>();

	CColumnFactory cf;

	// typed colref
	CColRef *pcrOne = cf.PcrCreate(pmdtypeint4);
	GPOS_ASSERT(pcrOne == cf.PcrLookup(pcrOne->m_ulId));
	cf.Destroy(pcrOne);

	// typed/named colref
	CWStringConst strName(GPOS_WSZ_LIT("C_CustKey"));
	CColRef *pcrTwo = cf.PcrCreate(pmdtypeint4, CName(&strName));
	GPOS_ASSERT(pcrTwo == cf.PcrLookup(pcrTwo->m_ulId));

	// clone previous colref
	CColRef *pcrThree = cf.PcrCreate(pcrTwo);
	GPOS_ASSERT(pcrThree != cf.PcrLookup(pcrTwo->m_ulId));
	GPOS_ASSERT(!pcrThree->Name().FEquals(pcrTwo->Name()));
	cf.Destroy(pcrThree);

	cf.Destroy(pcrTwo);

	return GPOS_OK;
}

// EOF


text:
<html xmlns:wicket>
<body>
<wicket:message key="myKey">
  This text will be replaced with text from the properties file.
  <span wicket:id="amount">[amount]</span>
  <a wicket:id="link">
    <wicket:message key="linkText"/>
  </a>
</wicket:message>
</body>
</html>


text:
package com.facebook.samples.litho.java.animations.expandableelement;

import android.graphics.Color;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import com.facebook.litho.ClickEvent;
import com.facebook.litho.Column;
import com.facebook.litho.Component;
import com.facebook.litho.ComponentContext;
import com.facebook.litho.Row;
import com.facebook.litho.StateValue;
import com.facebook.litho.Transition;
import com.facebook.litho.animation.AnimatedProperties;
import com.facebook.litho.annotations.LayoutSpec;
import com.facebook.litho.annotations.OnCreateLayout;
import com.facebook.litho.annotations.OnEvent;
import com.facebook.litho.annotations.OnUpdateStateWithTransition;
import com.facebook.litho.annotations.Param;
import com.facebook.litho.annotations.Prop;
import com.facebook.litho.annotations.State;
import com.facebook.litho.widget.Text;
import com.facebook.yoga.YogaAlign;
import com.facebook.yoga.YogaEdge;

@LayoutSpec
public class ExpandableElementOtherSpec {

  @OnCreateLayout
  static Component onCreateLayout(
      ComponentContext c,
      @Prop String messageText,
      @Prop String timestamp,
      @Prop(optional = true) boolean seen,
      @State Boolean expanded) {
    final boolean isExpanded = expanded == null ? false : expanded;
    return Column.create(c)
        .paddingDip(YogaEdge.TOP, 8)
        .transitionKey(ExpandableElementUtil.TRANSITION_MSG_PARENT)
        .transitionKeyType(Transition.TransitionKeyType.GLOBAL)
        .clickHandler(ExpandableElementOther.onClick(c))
        .child(ExpandableElementUtil.maybeCreateTopDetailComponent(c, isExpanded, timestamp))
        .child(
            Column.create(c)
                .transitionKey(ExpandableElementUtil.TRANSITION_TEXT_MESSAGE_WITH_BOTTOM)
                .transitionKeyType(Transition.TransitionKeyType.GLOBAL)
                .child(
                    Row.create(c)
                        .paddingDip(YogaEdge.END, 5)
                        .child(createSenderTile(c))
                        .child(createMessageContent(c, messageText)))
                .child(ExpandableElementUtil.maybeCreateBottomDetailComponent(c, isExpanded, seen)))
        .build();
  }

  @OnEvent(ClickEvent.class)
  static void onClick(ComponentContext c, @State Boolean expanded) {
    final boolean isExpanded = expanded == null ? false : expanded;
    ExpandableElementOther.updateExpandedStateWithTransition(c, !isExpanded);
  }

  @OnUpdateStateWithTransition
  static Transition updateExpandedState(StateValue<Boolean> expanded, @Param boolean expand) {
    expanded.set(expand);

    return Transition.parallel(
        Transition.allLayout(),
        Transition.create(
                Transition.TransitionKeyType.GLOBAL, ExpandableElementUtil.TRANSITION_TOP_DETAIL)
            .animate(AnimatedProperties.HEIGHT)
            .appearFrom(0)
            .disappearTo(0),
        Transition.create(
                Transition.TransitionKeyType.GLOBAL, ExpandableElementUtil.TRANSITION_BOTTOM_DETAIL)
            .animate(AnimatedProperties.HEIGHT)
            .appearFrom(0)
            .disappearTo(0));
  }

  static Component.Builder createSenderTile(ComponentContext c) {
    return Row.create(c)
        .marginDip(YogaEdge.ALL, 5)
        .alignSelf(YogaAlign.CENTER)
        .widthDip(55)
        .heightDip(55)
        .flexShrink(0)
        .background(getCircle(c));
  }

  static ShapeDrawable getCircle(ComponentContext c) {
    final ShapeDrawable oval = new ShapeDrawable(new OvalShape());
    oval.getPaint().setColor(Color.LTGRAY);
    return oval;
  }

  static Component.Builder createMessageContent(ComponentContext c, String messageText) {
    return Row.create(c)
        .paddingDip(YogaEdge.ALL, 8)
        .marginDip(YogaEdge.ALL, 8)
        .background(ExpandableElementUtil.getMessageBackground(c, 0xFFEAEAEA))
        .child(Text.create(c).textSizeDip(18).textColor(Color.BLACK).text(messageText));
  }
}


text:
using System;
using System.Threading.Tasks;
using Grpc.Core;

namespace Math
{
    class MainClass
    {
        const string Host = "0.0.0.0";
        const int Port = 23456;

        public static async Task Main(string[] args)
        {
            Server server = new Server
            {
                Services = { Math.BindService(new MathServiceImpl()) },
                Ports = { { Host, Port, ServerCredentials.Insecure } }
            };
            server.Start();

            Console.WriteLine("MathServer listening on port " + Port);

            Console.WriteLine("Press any key to stop the server...");
            Console.ReadKey();

            await server.ShutdownAsync();
        }
    }
}


text:
var Stream = require('stream').Stream
  , Buffers = require('buffers')
  , util = require('util')
  , path = require('path')
  , os = require('os');

var cv = module.exports = require('./bindings');

var Matrix = cv.Matrix
  , VideoCapture = cv.VideoCapture
  , ImageStream
  , ImageDataStream
  , ObjectDetectionStream
  , VideoStream;

Matrix.prototype.detectObject = function(classifier, opts, cb){
  var face_cascade;
  opts = opts || {};
  cv._detectObjectClassifiers = cv._detectObjectClassifiers || {};

  if (!(face_cascade = cv._detectObjectClassifiers[classifier])){
    face_cascade = new cv.CascadeClassifier(classifier);
    cv._detectObjectClassifiers[classifier] = face_cascade;
  }

  face_cascade.detectMultiScale(this, cb, opts.scale, opts.neighbors
    , opts.min && opts.min[0], opts.min && opts.min[1]);
}

Matrix.prototype.inspect = function(){
  var size = (this.size()||[]).join('x');
  return "[ Matrix " + size + " ]";
}

// we use the Opencv constants naming convention to extract the number of bytes (8, 16, 32, 64), and the number of channels from constants names
var getNumberOfBytesAndChannelsPerType = function(type){
  var regExp = /CV_([0-9]+)([A-Z]+)([0-9]+)/;
  for(var k in cv.Constants) if(cv.Constants.hasOwnProperty(k) && k.match(regExp) && cv.Constants[k] === type){
    var bytes, channels, dataType;
    k.replace(regExp, function(all, b, l, c){
      bytes = b;
      channels = c;
      dataType = l[0]
    });

    return {
      bytes : parseInt(bytes),
      channels : !isNaN(parseInt(channels)) && parseInt(channels),
      dataType : dataType,
      label : k
    };
  }
};

var getBufferMethodName = function(bytes, dataType, endianness, read){
  var fnName;

  if(read){
    fnName = "read";
  } else {
    fnName = "write";
  }

  if (bytes === 32 && (dataType === "F" || dataType === "S")){
    if(dataType === "F"){
      fnName += "Float"+endianness;
    } else {//dataType === "S"
      fnName += "Int32"+endianness;
    }
  } else if(bytes === 8){
    fnName += (dataType === "U" ? "U" : "")+"Int8";
  } else if(bytes === 16){
    fnName += (dataType === "U" ? "U" : "")+"Int16"+endianness;
  } else {
    throw("This matrix type (CV_"+bytes+dataType+") is not compatible with fromArray/toArray")
  }
  return fnName;
};

Matrix.fromArray = function(arr, type){
  var n_bytes;

  var bytesAndChannels = getNumberOfBytesAndChannelsPerType(type);
  var bytes = bytesAndChannels.bytes;
  var channels = bytesAndChannels.channels;
  var dataType = bytesAndChannels.dataType;
  var label = bytesAndChannels.label;

  if(!Array.isArray(arr) ||!Array.isArray(arr[0]) || !Array.isArray(arr[0][0]) || (channels && arr[0][0].length !== channels)) {
    throw(new Error("Input array must be a 3-level array/matrix with size rows x cols x channels corresponding to dataType ("+label+")"));
  }

  if(!channels){
    channels = 1;
  }

  var rows = arr.length;
  var cols = arr[0].length;

  var mat = new cv.Matrix(rows, cols, type);

  var n_bytes = bytes/8;
  var buf = new Buffer(rows * cols * channels * n_bytes);

  buf.fill(0);

  var fnName = getBufferMethodName(bytes, dataType, os.endianness(), false)

  for(var i=0;i<rows * cols * channels;i++){
    var c = i%channels;
    var r = Math.floor(i/channels);
    var y = r%cols;
    var x = Math.floor(r/cols);
    buf[fnName](arr[x][y][c], i*n_bytes);
  }

  mat.put(buf);

  return mat;
}

Matrix.prototype.toArray = function(){
  var size = this.size();
  var buf = this.getData();
  var type = this.type();
  var bytesAndChannels = getNumberOfBytesAndChannelsPerType(type);
  var bytes = bytesAndChannels.bytes;
  var channels = bytesAndChannels.channels || this.channels();
  var dataType = bytesAndChannels.dataType;

  var n_bytes = bytes/8;
  var fnName = getBufferMethodName(bytes, dataType, os.endianness(), true)

  var res = []
  for(var i = 0; i < size[0]; i++){
    var row = [];
    for(var j = 0; j < size[1]; j++){
      var channelsValues = [];
      for(var k = 0; k < channels; k++){
        var index = (i*size[1]+j)*channels+k;
        channelsValues.push(buf[fnName](index*n_bytes));
      }
      row.push(channelsValues);
    }
    res.push(row);
  }
  return res;
}

ImageStream = cv.ImageStream = function(){
  this.writable = true;
}
util.inherits(ImageStream, Stream);

ImageStream.prototype.write = function(buf){
  var self = this;
  cv.readImage(buf, function(err, matrix){
    if (err) return self.emit('error', err);
    self.emit('data', matrix);
  });
}

ImageDataStream = cv.ImageDataStream = function(){
  this.data = Buffers([]);
  this.writable = true;
}
util.inherits(ImageDataStream, Stream);

ImageDataStream.prototype.write = function(buf){
  this.data.push(buf);
  return true;
}

ImageDataStream.prototype.end = function(b){
  var self = this;
  if (b) ImageStream.prototype.write.call(this, b);

  var buf = this.data.toBuffer();
  cv.readImage(buf, function(err, im){
    if (err) return self.emit('error', err);
    self.emit('load', im);
  });
}

ObjectDetectionStream = cv.ObjectDetectionStream = function(cascade, opts){
  this.classifier = new cv.CascadeClassifier(cascade);
  this.opts = opts || {};
  this.readable = true;
  this.writable = true;
}
util.inherits(ObjectDetectionStream, Stream);

ObjectDetectionStream.prototype.write = function(m){
  var self = this;
  this.classifier.detectMultiScale(m, function(err, objs){
    if (err) return self.emit('error', err);
    self.emit('data', objs, m);
  }
  , this.opts.scale
  , this.opts.neighbors
  , this.opts.min && this.opts.min[0]
  , this.opts.min && this.opts.min[1]);
}

VideoStream = cv.VideoStream = function(src){
  if (!(src instanceof VideoCapture)) src = new VideoCapture(src);
  this.video = src;
  this.readable = true;
  this.paused = false;
}
util.inherits(VideoStream, Stream);

VideoStream.prototype.read = function(){
  var self = this;
  var frame = function(){
    self.video.read(function(err, mat){
      if (err) return self.emit('error', err);
      self.emit('data', mat);
      if (!self.paused) process.nextTick(frame);
    })
  }

  frame();
}

VideoStream.prototype.pause = function(){
  this.paused = true;
}

VideoStream.prototype.resume = function(){
  this.paused = false;
  this.read();
}

VideoCapture.prototype.toStream = function(){
  return new VideoStream(this);
}

// Provide cascade data for faces etc.
var CASCADES = {
  FACE_CASCADE: 'haarcascade_frontalface_alt.xml'
, EYE_CASCADE: 'haarcascade_eye.xml'
, EYEGLASSES_CASCADE: 'haarcascade_eye_tree_eyeglasses.xml'
, FULLBODY_CASCADE: 'haarcascade_fullbody.xml'
, CAR_SIDE_CASCADE: 'hogcascade_cars_sideview.xml'
}

Object.keys(CASCADES).forEach(function(k){
  cv[k] = path.resolve(__dirname, '../data', CASCADES[k])
})


text:
package org.elasticsearch.http.netty.pipelining;

import org.elasticsearch.common.network.NetworkAddress;
import org.elasticsearch.test.ESTestCase;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.jboss.netty.handler.codec.http.DefaultHttpChunk;
import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpChunk;
import org.jboss.netty.handler.codec.http.HttpClientCodec;
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import org.jboss.netty.util.HashedWheelTimer;
import org.jboss.netty.util.Timeout;
import org.jboss.netty.util.TimerTask;
import org.junit.After;
import org.junit.Before;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;

import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.jboss.netty.buffer.ChannelBuffers.EMPTY_BUFFER;
import static org.jboss.netty.buffer.ChannelBuffers.copiedBuffer;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONNECTION;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.CONTENT_TYPE;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.HOST;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Names.TRANSFER_ENCODING;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.CHUNKED;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.KEEP_ALIVE;
import static org.jboss.netty.handler.codec.http.HttpResponseStatus.OK;
import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import static org.jboss.netty.util.CharsetUtil.UTF_8;

/**
 *
 */
public class HttpPipeliningHandlerTests extends ESTestCase {

    private static final long RESPONSE_TIMEOUT = 10000L;
    private static final long CONNECTION_TIMEOUT = 10000L;
    private static final String CONTENT_TYPE_TEXT = "text/plain; charset=UTF-8";
    private static final String PATH1 = "/1";
    private static final String PATH2 = "/2";
    private static final String SOME_RESPONSE_TEXT = "some response for ";

    private ClientBootstrap clientBootstrap;
    private ServerBootstrap serverBootstrap;

    private CountDownLatch responsesIn;
    private final List<String> responses = new ArrayList<>(2);

    private HashedWheelTimer timer;

    private InetSocketAddress boundAddress;

    @Before
    public void startBootstraps() {
        clientBootstrap = new ClientBootstrap(new NioClientSocketChannelFactory());

        clientBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
                        new HttpClientCodec(),
                        new ClientHandler()
                );
            }
        });

        serverBootstrap = new ServerBootstrap(new NioServerSocketChannelFactory());

        serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
                        new HttpRequestDecoder(),
                        new HttpResponseEncoder(),
                        new HttpPipeliningHandler(10000),
                        new ServerHandler()
                );
            }
        });

        Channel channel = serverBootstrap.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
        boundAddress = (InetSocketAddress) channel.getLocalAddress();

        timer = new HashedWheelTimer();
    }

    @After
    public void releaseResources() {
        timer.stop();

        serverBootstrap.shutdown();
        serverBootstrap.releaseExternalResources();
        clientBootstrap.shutdown();
        clientBootstrap.releaseExternalResources();
    }

    public void testShouldReturnMessagesInOrder() throws InterruptedException {
        responsesIn = new CountDownLatch(1);
        responses.clear();

        final ChannelFuture connectionFuture = clientBootstrap.connect(boundAddress);

        assertTrue(connectionFuture.await(CONNECTION_TIMEOUT));
        final Channel clientChannel = connectionFuture.getChannel();

        // NetworkAddress.format makes a proper HOST header.
        final HttpRequest request1 = new DefaultHttpRequest(
                HTTP_1_1, HttpMethod.GET, PATH1);
        request1.headers().add(HOST, NetworkAddress.format(boundAddress));

        final HttpRequest request2 = new DefaultHttpRequest(
                HTTP_1_1, HttpMethod.GET, PATH2);
        request2.headers().add(HOST, NetworkAddress.format(boundAddress));

        clientChannel.write(request1);
        clientChannel.write(request2);

        responsesIn.await(RESPONSE_TIMEOUT, MILLISECONDS);

        assertTrue(responses.contains(SOME_RESPONSE_TEXT + PATH1));
        assertTrue(responses.contains(SOME_RESPONSE_TEXT + PATH2));
    }

    public class ClientHandler extends SimpleChannelUpstreamHandler {
        @Override
        public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent e) {
            final Object message = e.getMessage();
            if (message instanceof HttpChunk) {
                final HttpChunk response = (HttpChunk) e.getMessage();
                if (!response.isLast()) {
                    final String content = response.getContent().toString(UTF_8);
                    responses.add(content);
                    if (content.equals(SOME_RESPONSE_TEXT + PATH2)) {
                        responsesIn.countDown();
                    }
                }
            }
        }
    }

    public class ServerHandler extends SimpleChannelUpstreamHandler {
        private final AtomicBoolean sendFinalChunk = new AtomicBoolean(false);

        @Override
        public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent e) throws InterruptedException {
            final HttpRequest request = (HttpRequest) e.getMessage();

            final OrderedUpstreamMessageEvent oue = (OrderedUpstreamMessageEvent) e;
            final String uri = request.getUri();

            final HttpResponse initialChunk = new DefaultHttpResponse(HTTP_1_1, OK);
            initialChunk.headers().add(CONTENT_TYPE, CONTENT_TYPE_TEXT);
            initialChunk.headers().add(CONNECTION, KEEP_ALIVE);
            initialChunk.headers().add(TRANSFER_ENCODING, CHUNKED);

            ctx.sendDownstream(new OrderedDownstreamChannelEvent(oue, 0, false, initialChunk));

            timer.newTimeout(new ChunkWriter(ctx, e, uri, oue, 1), 0, MILLISECONDS);
        }

        private class ChunkWriter implements TimerTask {
            private final ChannelHandlerContext ctx;
            private final MessageEvent e;
            private final String uri;
            private final OrderedUpstreamMessageEvent oue;
            private final int subSequence;

            public ChunkWriter(final ChannelHandlerContext ctx, final MessageEvent e, final String uri,
                               final OrderedUpstreamMessageEvent oue, final int subSequence) {
                this.ctx = ctx;
                this.e = e;
                this.uri = uri;
                this.oue = oue;
                this.subSequence = subSequence;
            }

            @Override
            public void run(final Timeout timeout) {
                if (sendFinalChunk.get() && subSequence > 1) {
                    final HttpChunk finalChunk = new DefaultHttpChunk(EMPTY_BUFFER);
                    ctx.sendDownstream(new OrderedDownstreamChannelEvent(oue, subSequence, true, finalChunk));
                } else {
                    final HttpChunk chunk = new DefaultHttpChunk(copiedBuffer(SOME_RESPONSE_TEXT + uri, UTF_8));
                    ctx.sendDownstream(new OrderedDownstreamChannelEvent(oue, subSequence, false, chunk));

                    timer.newTimeout(new ChunkWriter(ctx, e, uri, oue, subSequence + 1), 0, MILLISECONDS);

                    if (uri.equals(PATH2)) {
                        sendFinalChunk.set(true);
                    }
                }
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 337622 $ -->

<refentry xml:id="cachingiterator.getflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>CachingIterator::getFlags</refname>
  <refpurpose>Get flags used</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>int</type><methodname>CachingIterator::getFlags</methodname>
   <void />
  </methodsynopsis>

  &warn.undocumented.func;

  <para>
   Get the bitmask of the flags used for this CachingIterator instance.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Description...
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
Edit Project

        <form name="projectForm" class="form-horizontal" data-ng-submit="update(projectForm.$valid)" novalidate>
            <fieldset>

                    {{field.label}}

                        <input  data-ng-required="field.required" data-ng-switch-default name="field" type="text" data-ng-model="project[field.field]" id="{{field.label}}" class="form-control" placeholder="{{field.label}}" >
                        <input  data-ng-required="field.required" data-ng-switch-when="String" name="field" type="text" data-ng-model="project[field.field]" id="{{field.label}}" class="form-control" placeholder="{{field.label}}" >
                        <input  data-ng-switch-when="Date" name="field" type="date" data-ng-model="project[field.field]" id="{{field.label}}" class="form-control" placeholder="{{field.label}}" >
                        <input  data-ng-switch-when="Ref" name="field" type="text" data-ng-model="project[field.field][field.key]" id="{{field.label}}" class="form-control" placeholder="{{field.label}}" >

{{field.label}} is required

                    <input type="submit" value="Update" ng-disabled="projectForm.$invalid" class="btn btn-default">

            </fieldset>
        </form>

{{project| json}}


text:
namespace extensions {

// A utility class for helping construct ArgumentSpecs in tests.
// NOTE: This is designed to be test-only. It's not worth adding to production
// code because it's a) only a bit of syntactic sugar and b) rife with footguns.
class ArgumentSpecBuilder {
 public:
  explicit ArgumentSpecBuilder(ArgumentType type);
  ArgumentSpecBuilder(ArgumentType type, base::StringPiece name);

  ~ArgumentSpecBuilder();

  ArgumentSpecBuilder& MakeOptional();
  ArgumentSpecBuilder& AddProperty(base::StringPiece property_name,
                                   std::unique_ptr<ArgumentSpec> property_spec);
  ArgumentSpecBuilder& SetMinimum(int minimum);
  ArgumentSpecBuilder& SetListType(std::unique_ptr<ArgumentSpec> list_type);
  ArgumentSpecBuilder& SetRef(base::StringPiece ref);
  ArgumentSpecBuilder& SetChoices(
      std::vector<std::unique_ptr<ArgumentSpec>> choices);
  ArgumentSpecBuilder& SetEnums(std::set<std::string> enum_values);
  ArgumentSpecBuilder& SetAdditionalProperties(
      std::unique_ptr<ArgumentSpec> additional_properties);
  ArgumentSpecBuilder& SetInstanceOf(std::string instance_of);
  ArgumentSpecBuilder& PreserveNull();
  std::unique_ptr<ArgumentSpec> Build();

 private:
  std::unique_ptr<ArgumentSpec> spec_;
  ArgumentSpec::PropertiesMap properties_;

  DISALLOW_COPY_AND_ASSIGN(ArgumentSpecBuilder);
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_BINDINGS_ARGUMENT_SPEC_BUILDER_H_


text:
const conf = require('./gulp.conf');

module.exports = function (config) {
    const configuration = {
        basePath: '../',
        singleRun: true,
        autoWatch: false,
        logLevel: 'INFO',
        junitReporter: {
            outputDir: 'test-reports'
        },
        browsers: [
            'PhantomJS'
        ],
        frameworks: [
            'jasmine'
        ],
        files: [
            'node_modules/es6-shim/es6-shim.js',
            conf.path.src('index.spec.js'),
            conf.path.src('**/*.html')
        ],
        preprocessors: {
            [conf.path.src('index.spec.js')]: [
                'webpack'
            ],
            [conf.path.src('**/*.html')]: [
                'ng-html2js'
            ]
        },
        ngHtml2JsPreprocessor: {
            stripPrefix: `${conf.paths.src}/`
        },
        reporters: ['progress', 'coverage'],
        coverageReporter: {
            type: 'html',
            dir: 'coverage/'
        },
        webpack: require('./webpack-test.conf'),
        webpackMiddleware: {
            noInfo: true
        },
        plugins: [
            require('karma-jasmine'),
            require('karma-junit-reporter'),
            require('karma-coverage'),
            require('karma-phantomjs-launcher'),
            require('karma-phantomjs-shim'),
            require('karma-ng-html2js-preprocessor'),
            require('karma-webpack')
        ]
    };

    config.set(configuration);
};


text:
<?php

	Class fieldPublish_Tabs extends Field{

		function __construct(){
			parent::__construct();
			$this->_name = __('Publish Tab');
			$this->_required = false;
			$this->set('hide', 'no');
		}

		public function processRawFieldData($data, &$status, $simulate=false, $entry_id=NULL) {
			$status = self::__OK__;
			return array(
				'value' => ''
			);
		}

		function commit(){
			if(!parent::commit()) return false;
			$id = $this->get('id');
			if($id === false) return false;
			$fields = array();
			$fields['field_id'] = $id;
			Symphony::Database()->query("DELETE FROM `tbl_fields_".$this->handle()."` WHERE `field_id` = '$id' LIMIT 1");
			return Symphony::Database()->insert($fields, 'tbl_fields_' . $this->handle());
		}

		function displayPublishPanel(&$wrapper, $data=NULL, $flagWithError=NULL, $fieldnamePrefix=NULL, $fieldnamePostfix=NULL){
			$wrapper->setValue($this->get('label'));
		}

		public function appendFormattedElement(&$wrapper, $data, $encode=false, $mode=NULL) {

		}

		public function prepareTableValue($data, XMLElement $link=NULL, $entry_id=NULL) {

			// build this entry fully
			$entries = EntryManager::fetch($entry_id);

			if ($entries === false) return parent::prepareTableValue(NULL, $link, $entry_id);

			$entry = reset(EntryManager::fetch($entry_id));

			// get the first field inside this tab
			$field_id = Symphony::Database()->fetchVar('id', 0, "SELECT `id` FROM `tbl_fields` WHERE `parent_section` = '".$this->get('parent_section')."' AND `sortorder` = ".($this->get('sortorder') + 1)." ORDER BY `sortorder` LIMIT 1");

			if ($field_id === NULL) return parent::prepareTableValue(NULL, $link, $entry_id);

			$field = FieldManager::fetch($field_id);

			// get the first field's value as a substitude for the tab's return value
			return $field->prepareTableValue($entry->getData($field_id), $link, $entry_id);
		}

		public function createTable(){

			return Symphony::Database()->query(

				"CREATE TABLE IF NOT EXISTS `tbl_entries_data_" . $this->get('id') . "` (
				  `id` int(11) unsigned NOT NULL auto_increment,
				  `entry_id` int(11) unsigned NOT NULL,
				  `value` double default NULL,
				  PRIMARY KEY  (`id`),
				  KEY `entry_id` (`entry_id`),
				  KEY `value` (`value`)
				) TYPE=MyISAM;"

			);
		}

	}

?>


text:
//
//  ISBannerDelegate.h
//  IronSource
//
//  Created by Pnina Rapoport on 02/04/2017.
//  Copyright © 2017 IronSource. All rights reserved.
//

#ifndef ISBannerDelegate_h
#define ISBannerDelegate_h

#import "ISBannerView.h"

@protocol ISBannerDelegate <NSObject>

@required
/**
 Called after a banner ad has been successfully loaded
 */
- (void)bannerDidLoad:(ISBannerView *)bannerView;

/**
 Called after a banner has attempted to load an ad but failed.

 @param error The reason for the error
 */
- (void)bannerDidFailToLoadWithError:(NSError *)error;

/**
 Called after a banner has been clicked.
 */
- (void)didClickBanner;

/**
 Called when a banner is about to present a full screen content.
 */
- (void)bannerWillPresentScreen;

/**
 Called after a full screen content has been dismissed.
 */
- (void)bannerDidDismissScreen;

/**
 Called when a user would be taken out of the application context.
 */
- (void)bannerWillLeaveApplication;

@end

#endif /* ISBannerDelegate_h */


text:
echo "Building fastCover dictionary with in=../../lib/common f=20 out=dict1"
./main in=../../../lib/common f=20 out=dict1
zstd -be3 -D dict1 -r ../../../lib/common -q
echo "Building fastCover dictionary with in=../../lib/common k=500 d=6 f=24 out=dict2 dictID=100 maxdict=140000"
./main in=../../../lib/common k=500 d=6 f=24 out=dict2 dictID=100 maxdict=140000
zstd -be3 -D dict2 -r ../../../lib/common -q
echo "Building fastCover dictionary with 2 sample sources"
./main in=../../../lib/common in=../../../lib/compress out=dict3
zstd -be3 -D dict3 -r ../../../lib/common -q
echo "Removing dict1 dict2 dict3"
rm -f dict1 dict2 dict3

echo "Testing with invalid parameters, should fail"
! ./main in=../../../lib/common r=10
! ./main in=../../../lib/common d=10


text:
package com.alibaba.csp.sentinel.metric.exporter.jmx;

import com.alibaba.csp.sentinel.config.SentinelConfig;
import com.alibaba.csp.sentinel.log.RecordLog;
import com.alibaba.csp.sentinel.node.metric.MetricNode;

import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
 * the metric bean writer, it provides {@link MetricBeanWriter#write} method for register the
 * MetricBean in {@link MBeanRegistry} or update the value of MetricBean
 *
 * @author chenglu
 * @date 2021-07-01 20:02
 * @since 1.8.3
 */
public class MetricBeanWriter {

    private final MBeanRegistry mBeanRegistry = MBeanRegistry.getInstance();

    private static final String DEFAULT_APP_NAME = "sentinel-application";

    /**
     * write the MetricNode value to MetricBean
     * if the MetricBean is not registered into {@link MBeanRegistry},
     * it will be created and registered into {@link MBeanRegistry}.
     * else it will update the value of MetricBean.
     * Notes. if the MetricNode is null, then {@link MetricBean} will be reset.
     * @param map metricNode value group by resource
     * @throws Exception write failed exception
     */
    public synchronized void write(Map<String, MetricNode> map) throws Exception {
        if (map == null || map.isEmpty()) {
            List<MetricBean> metricNodes = mBeanRegistry.listAllMBeans();
            if (metricNodes == null || metricNodes.isEmpty()) {
                return;
            }
            for (MetricBean metricNode : metricNodes) {
                metricNode.reset();
            }
            return;
        }
        String appName = SentinelConfig.getAppName();
        if (appName == null) {
            appName = DEFAULT_APP_NAME;
        }
        long version = System.currentTimeMillis();
        // set or update the new value
        for (MetricNode metricNode : map.values()) {
            final String mBeanName = "Sentinel:type=" + appName + ",name=\"" + metricNode.getResource()
                    +"\",classification=\"" + metricNode.getClassification() +"\"";
            MetricBean metricBean = mBeanRegistry.findMBean(mBeanName);
            if (metricBean != null) {
                metricBean.setValueFromNode(metricNode);
                metricBean.setVersion(version);
            } else {
                metricBean = new MetricBean();
                metricBean.setValueFromNode(metricNode);
                metricBean.setVersion(version);
                mBeanRegistry.register(metricBean, mBeanName);
                RecordLog.info("[MetricBeanWriter] Registering with JMX as Metric MBean [{}]", mBeanName);
            }
        }
        // reset the old value
        List<MetricBean> metricBeans = mBeanRegistry.listAllMBeans();
        if (metricBeans == null || metricBeans.isEmpty()) {
            return;
        }
        for (MetricBean metricBean : metricBeans) {
            if (!Objects.equals(metricBean.getVersion(), version)) {
                metricBean.reset();
                mBeanRegistry.unRegister(metricBean);
            }
        }
    }
}


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

		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />

		<title>JsDoc Reference - AppTime</title>

Class Index
| File Index

Classes

_global_

AppTime

Color

Content

Frame

GraphicsDevice

GraphicsHelper

JsBlitWindow

KeyboardState

MathHelper

Matrix4x4

MouseState

PerspectiveCamera

Quaternion

Rect2D

RenderTarget

SpriteBatch

SpriteDrawOptions

SpriteSortOrder

Texture2D

TextureLoadRequest

TextureLoadResponse

Utils

Vector2

Vector3

Vector4

Viewport

				Class AppTime

Defined in:  jsblit.js.

Class Summary

						Constructor Attributes
						Constructor Name and Description

								AppTime()

Represents time within the context of a running application

Method Summary

							Method Attributes
							Method Name and Description

getSeconds()

Returns the current app time.

setMultiplier(multiplier)

Allows a caller to speed up or slow down the app time, useful for debugging
animation issues.

update()

When called updates the AppTime instance to reflect
the current time

					Class Detail

						AppTime()

					Represents time within the context of a running application

					Method Detail

					{number}
					getSeconds()

						Returns the current app time. This is a number that is monotonically increasing

Returns:

{number}

					setMultiplier(multiplier)

						Allows a caller to speed up or slow down the app time, useful for debugging
animation issues. For example specifying a value of 0.5 would slow down time by a half

Parameters:

									{number} multiplier

					update()

						When called updates the AppTime instance to reflect
the current time

			Documentation generated by JsDoc Toolkit 2.3.2 on Sat Oct 02 2010 15:02:18 GMT-0700 (PDT)


text:
package com.google.sps;

import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.ArrayList;
import java.util.HashMap;
import com.google.appengine.api.blobstore.FileInfo;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import javax.servlet.http.HttpServletRequest;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.sps.data.CloudStorageLibrary;
import static org.mockito.Mockito.*;

@RunWith(JUnit4.class)
public final class MultipleGcsFilePathTest {
    private static BlobstoreService MOCK_BLOBSTORE = mock(BlobstoreService.class);
    private static HttpServletRequest MOCK_REQUEST = mock(HttpServletRequest.class);

    private static HttpServletRequest MOCK_REQUEST_NO_FILES = mock(HttpServletRequest.class);

    //Empty Map of files
    private static final Map<String, List<FileInfo>> NO_FILES = Collections.emptyMap();

    //Defining sample files for testing
    private static final Date date = new Date();
    private static final Long size = 27262L;
    private static final FileInfo file_1 = new FileInfo("contentTypeA", date, "file1", size,
                                                        "abcd1234", "/gs/myBucket/file1");
    private static final FileInfo file_2 = new FileInfo("contentTypeB", date, "file2", size,
                                                        "abce1235", "/gs/myBucket/file2");
    private static final FileInfo file_3 = new FileInfo("contentTypeC", date, "file3", size,
                                                        "abcf1236", "/gs/myBucket/file3");

    private static final List<FileInfo> FILE_LIST = new ArrayList<FileInfo>();

    private static final Map<String, List<FileInfo>> FILES = new HashMap<>();

    private static final ArrayList<String> GCSURIS = new ArrayList<String>();

    //Adding the sample files to Lists and then the Lists to the Map
    @Before
    public void setUp() {
        FILE_LIST.add(file_1);
        FILE_LIST.add(file_2);
        FILE_LIST.add(file_3);

        FILES.put("List", FILE_LIST);

        GCSURIS.add("/gs/myBucket/file1");
        GCSURIS.add("/gs/myBucket/file2");
        GCSURIS.add("/gs/myBucket/file3");

        when(MOCK_BLOBSTORE.getFileInfos(MOCK_REQUEST)).thenReturn(FILES);
        when(MOCK_BLOBSTORE.getFileInfos(MOCK_REQUEST_NO_FILES)).thenReturn(NO_FILES);
    }

    //Test what happens when you pass in a null request
    @Test
    public void multGetGcsFilePathNullRequest() {
        ArrayList<String> actual = CloudStorageLibrary.getMultipleGcsFilePath(null, MOCK_BLOBSTORE);
        ArrayList<String> expected = null;

        Assert.assertEquals(expected, actual);
    }

    //Test what happens when you pass in a null blobstore
    @Test
    public void multGetGcsFilePathNullBlobstore() {
        ArrayList<String> actual = CloudStorageLibrary.getMultipleGcsFilePath(MOCK_REQUEST, null);
        ArrayList<String> expected = null;

        Assert.assertEquals(expected, actual);
    }

    //Test what happens when you pass in an empty Map
    @Test
    public void multEmptyMapForGetGcsFilePath() {
        ArrayList<String> actual = CloudStorageLibrary.getMultipleGcsFilePath(MOCK_REQUEST_NO_FILES, MOCK_BLOBSTORE);
        ArrayList<String> expected = null;

        Assert.assertEquals(expected, actual);
    }

    //Test what happens when you pass in a map that contains files
    @Test
    public void multGetGcsFilePathIsSet() {
        ArrayList<String> actual = CloudStorageLibrary.getMultipleGcsFilePath(MOCK_REQUEST, MOCK_BLOBSTORE);
        ArrayList<String> expected = GCSURIS;

        Assert.assertEquals(expected, actual);
    }
}


text:
/* Try POH
 * author: Leonardone @ NEETSDKASU
 */
// ==================================================================================
#import <Foundation/Foundation.h>
// ==================================================================================
NSNumber* wrap(NSInteger val) { return [NSNumber numberWithInteger: val]; }
NSInteger ti(NSString *s) { return [s integerValue]; }
NSUInteger tu(NSString *s) { return [s integerValue]; }
NSArray* subArr(NSArray *a, NSUInteger f, NSUInteger e) { return [a subarrayWithRange: NSMakeRange(f, e)]; }
id getArr(NSArray *a, NSUInteger i) { return [a objectAtIndex: i]; }
NSArray* Uv2(NSArray *a, NSUInteger *v1, NSUInteger *v2) {
    *v1 = tu(getArr(a, 0)); *v2 = tu(getArr(a, 1)); return subArr(a, 2, [a count] - 2); }
NSArray* Iv2(NSArray *a, NSInteger *v1, NSInteger *v2) {
    *v1 = ti(getArr(a, 0)); *v2 = ti(getArr(a, 1)); return subArr(a, 2, [a count] - 2); }
NSArray* Iv3(NSArray *a, NSInteger *v1, NSInteger *v2, NSInteger *v3) {
    *v1 = ti(getArr(a, 0)); *v2 = ti(getArr(a, 1)); *v3 = ti(getArr(a, 2)); return subArr(a, 3, [a count] - 3); }
NSArray* Iv4(NSArray *a, NSInteger *v1, NSInteger *v2, NSInteger *v3, NSInteger *v4) {
    *v1 = ti(getArr(a, 0)); *v2 = ti(getArr(a, 1)); *v3 = ti(getArr(a, 2)); *v4 = ti(getArr(a, 3)); return subArr(a, 4, [a count] - 4); }
NSArray* sorted(NSArray *a) { return [a sortedArrayUsingSelector: @selector(compare:)]; }
NSMutableArray* makeArr(NSUInteger size, id initval) {
    NSMutableArray *a = [NSMutableArray new]; while (size-- > 0) { [a addObject: initval]; } return a; }
@interface MyIO : NSObject
{   NSArray *lines; NSInteger cur; NSFileHandle *stdOut; NSStringEncoding enc; NSArray *scn; NSInteger idx; }
- (NSString *)gs; - (NSInteger)gi; - (NSArray *)gss; - (NSArray *)gis;
- (NSArray *)ngs: (NSInteger)n; - (NSArray *)ngi: (NSInteger)n; - (NSArray *)ngss: (NSInteger)n; - (NSArray *)ngis: (NSInteger)n;
- (NSString *)scns; - (NSInteger)scni;
- (void)write:(NSString *)str; - (void)writeln:(NSString *)str;
- (void)writed:(id)dat;        - (void)writedln:(id)dat;
- (void)writei:(NSInteger)val; - (void)writeiln:(NSInteger)val;
@end
@interface MyIO ()
- (NSArray *)ngt:(NSInteger)n f:(id (^)(void))f;
@end
@implementation MyIO
{   NSArray *lines; NSInteger cur; NSFileHandle *stdOut; NSStringEncoding enc; NSArray *scn; NSInteger idx; }
- (id)init { self = [super init]; if (self) {
    stdOut = [NSFileHandle fileHandleWithStandardOutput]; idx = 0; enc = NSUTF8StringEncoding;
    NSData *data = [[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile];
    NSString *str = [[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:enc];
    lines = [str componentsSeparatedByString:@"\n"]; cur = 0; } return self; }
- (NSString *)gs { return [lines objectAtIndex:cur++]; }
- (NSInteger)gi { return [[self gs] integerValue]; }
- (NSArray *)gss { return [[self gs] componentsSeparatedByString:@" "]; }
- (NSArray *)gis { NSMutableArray *a = [NSMutableArray new]; for (id v in [self gss]) { [a addObject:wrap([v integerValue])]; } return a; }
- (NSArray *)ngt:(NSInteger)n f:(id (^)(void))f { NSMutableArray *a = [NSMutableArray new]; for (NSUInteger i = 0; i < n; i++) { [a addObject:f()]; } return a; }
- (NSArray *)ngs: (NSInteger)n { return [self ngt:n f:^{ return [self gs]; }]; }
- (NSArray *)ngi: (NSInteger)n { return [self ngt:n f:^{ return wrap([self gi]); }]; }
- (NSArray *)ngss: (NSInteger)n { return [self ngt:n f:^{ return [self gss]; }]; }
- (NSArray *)ngis: (NSInteger)n { return [self ngt:n f:^{ return [self gis]; }]; }
- (NSString *)scns { while ([scn count] == idx) { idx = 0; scn = [self gss]; } return [scn objectAtIndex:idx++]; }
- (NSInteger)scni { return [[self scns] integerValue]; }
- (void)write: (NSString *)str { [stdOut writeData:[str dataUsingEncoding:enc]]; }
- (void)writeln: (NSString *)str { [self write: str]; [self write: @"\n"]; }
- (void)writed: (id)dat { [self write:[dat stringValue]]; }
- (void)writedln: (id)dat { [self writed: dat]; [self write: @"\n"]; }
- (void)writei: (NSInteger)val { [self writed: wrap(val)]; }
- (void)writeiln: (NSInteger)val { [self writei: val]; [self write: @"\n"]; }
@end
void solve(MyIO *io); int main(void){ @autoreleasepool { solve([MyIO new]); } return 0; }
// ==================================================================================

void solve(MyIO *io) {

    NSUInteger n, m;
    Uv2([io gis], &n, &m);

    NSString
        *s = [io gs],
        *t = [io gs];

    NSMutableDictionary
        *d = [NSMutableDictionary new];

    for (NSUInteger i = 0; i < n; i++) {
        id key = [s substringWithRange: NSMakeRange(i, 1)];
        id val = [d objectForKey: key];
        if (val) {
            [d setObject: wrap([val integerValue] + 1) forKey: key];
        } else {
            [d setObject: @1 forKey: key];
        }
    }

    NSInteger answer = 0;

    for (NSUInteger i = 0; i < m; i++) {
        id key = [t substringWithRange: NSMakeRange(i, 1)];
        id val = [d objectForKey: key];
        if (val) {
            if ([val isEqual: @0]) {
                answer++;
            } else {
                [d setObject: wrap([val integerValue] - 1) forKey: key];
            }
        } else {
            answer++;
        }
    }

    [io writeiln: answer];
}


text:
#region License
//
// Copyright (c) 2013, Kooboo team
//
// Licensed under the BSD License
// See the file LICENSE.txt for details.
//
#endregion

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Kooboo.CMS.Content.Models;
using Kooboo.CMS.Content.Query;

namespace Kooboo.CMS.Content.Persistence.SqlServer.Tests
{
    /// <summary>
    /// Summary description for SimpleQueryTests
    /// </summary>
    [TestClass]
    public class SimpleQueryTests
    {
        static Repository repository = null;
        static Schema schema;
        static TextFolder folder;
        static TextContentProvider textContentProvider = new TextContentProvider();
        static SimpleQueryTests()
        {
            repository = new Repository("SimpleQueryTests");
            schema = new Schema(repository, "news");
            schema.AddColumn(new Column()
            {
                Name = "Title",
                DataType = Kooboo.Data.DataType.String,
                Length = 256
            });
            schema.AddColumn(new Column()
            {
                Name = "Comments",
                DataType = Kooboo.Data.DataType.Int
            });

            folder = new TextFolder(repository, "news");
            folder.SchemaName = schema.Name;

            ProviderFactory providerFactory = new ProviderFactory();
            Providers.DefaultProviderFactory = providerFactory;
            providerFactory.GetProvider<IRepositoryProvider>().Add(repository);
            providerFactory.GetProvider<ISchemaProvider>().Add(schema);
            providerFactory.GetProvider<ITextFolderProvider>().Add(folder);

            InitializeData();
        }
        [TestMethod]
        public void TestSimpleQuery()
        {

            var query = folder.CreateQuery();

            var result = textContentProvider.Execute(query) as IEnumerable<TextContent>;

            Assert.IsNotNull(result);

            Assert.AreEqual(2, result.Count());

            query = folder.CreateQuery().WhereEquals("UserKey", "userkeY1");

            result = textContentProvider.Execute(query) as IEnumerable<TextContent>;

            Assert.AreEqual(1, result.Count());

            query = folder.CreateQuery().WhereBetweenOrEqual("UtcCreationDate", DateTime.UtcNow.AddMinutes(-10), DateTime.UtcNow);

            result = textContentProvider.Execute(query) as IEnumerable<TextContent>;

            Assert.AreEqual(2, result.Count());

            query = folder.CreateQuery().WhereEquals("Published", true);

            result = textContentProvider.Execute(query) as IEnumerable<TextContent>;

            Assert.AreEqual(2, result.Count());

            query = folder.CreateQuery().WhereNotEquals("UserKey", "userkeY1");

            result = textContentProvider.Execute(query) as IEnumerable<TextContent>;

            Assert.AreEqual(1, result.Count());
        }

        [TestMethod]
        public void TestCount()
        {
            var query = folder.CreateQuery();

            int count = query.Count();

            Assert.AreEqual(2, count);
        }
        [TestMethod]
        public void TestFirst()
        {
            var query = folder.CreateQuery();
            var content = query.OrderBy("Id").First();
            Assert.AreEqual("userkey1", content.UserKey);

            query = folder.CreateQuery();
            content = query.OrderByDescending("Id").First();
            Assert.AreEqual("userkey2", content.UserKey);
        }

        [TestMethod]
        public void TestLast()
        {
            var query = folder.CreateQuery();
            var content = query.OrderBy("Id").Last();
            Assert.AreEqual("userkey2", content.UserKey);

            query = folder.CreateQuery();
            content = query.OrderByDescending("Id").Last();
            Assert.AreEqual("userkey1", content.UserKey);
        }

        private static void InitializeData()
        {
            TextContent textContent1 = new TextContent();
            textContent1.FolderName = folder.FullName;
            textContent1.SchemaName = schema.Name;
            textContent1.Repository = repository.Name;
            textContent1.UtcCreationDate = DateTime.UtcNow;
            textContent1.UtcLastModificationDate = DateTime.UtcNow;
            textContent1.UserKey = "userkey1";

            textContent1["Title"] = "news1";
            textContent1["Comments"] = 100;
            textContent1.Published = true;
            textContentProvider.Add(textContent1);

            TextContent textContent2 = new TextContent();
            textContent2.FolderName = folder.FullName;
            textContent2.SchemaName = schema.Name;
            textContent2.Repository = repository.Name;
            textContent2.UtcCreationDate = DateTime.UtcNow;
            textContent2.UtcLastModificationDate = DateTime.UtcNow;
            textContent2.UserKey = "userkey2";

            textContent2["Title"] = "news2";
            textContent2["Comments"] = 102;
            textContent2.Published = true;
            textContentProvider.Add(textContent2);
        }
    }
}


text:
<?php

namespace AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class RegistrationType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('username')
            ->add('password', 'repeated', [
                'type' => 'password',
                'first_options' => ['label' => 'Password'],
                'second_options' => ['label' => 'Password (again)'],
            ])
            ->add('register', 'submit');
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => 'AppBundle\Transfer\RegistrationTransfer',
        ]);
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'app_bundle_registration_type';
    }
}


text:
//-----------------------------------------------------------------------
// <copyright file="PreProcessAsserts.cs" company="SonarSource SA and Microsoft Corporation">
//   Copyright (c) SonarSource SA and Microsoft Corporation.  All rights reserved.
//   Licensed under the MIT License. See License.txt in the project root for license information.
// </copyright>
//-----------------------------------------------------------------------

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;

namespace SonarQube.TeamBuild.PreProcessor.Tests
{
    internal static class PreProcessAsserts
    {
        #region Public methods

        public static void AssertRuleSetContainsRules(string filePath, params string[] expectedRuleIds)
        {
            Assert.IsTrue(File.Exists(filePath), "Expected ruleset file does not exist: {0}", filePath);

            XDocument doc = XDocument.Load(filePath);

            foreach (string ruleId in expectedRuleIds)
            {
                AssertRuleIdExists(doc, ruleId);
            }

            AssertExpectedRuleCount(doc, expectedRuleIds.Length);
        }

        #endregion

        #region Private methods

        private static void AssertRuleIdExists(XDocument doc, string ruleId)
        {
            XElement element = doc.Descendants().Single(e => e.Name == "Rule" && HasRuleIdAttribute(e, ruleId));
            Assert.IsNotNull(element, "Could not find ruleId with expected id: {0}", ruleId);
        }

        private static bool HasRuleIdAttribute(XElement element, string ruleId)
        {
            return element.Attributes().Any(a => a.Name == "Id" && a.Value == ruleId);
        }

        private static void AssertExpectedRuleCount(XDocument doc, int expectedCount)
        {
            IEnumerable<XElement> rules = doc.Descendants().Where(e => e.Name == "Rule");
            Assert.AreEqual(expectedCount, rules.Count(), "Unexpected number of rules");
        }

        #endregion
    }
}


text:
import { File } from 'megajs'
import bytes from 'bytes'

const form = document.getElementsByTagName('form')[0]
form.addEventListener('submit', handleSubmit)

if (window.location.hash.match(/mega(\.co)?\.nz/)) {
  form.elements.url.value = window.location.hash.substr(1)
}

const output = document.getElementsByTagName('output')[0]

function handleSubmit (evt) {
  evt.preventDefault()

  const url = form.elements.url.value.trim()
    // Accept URLs without protocol
    .replace(/^(?!https?:\/\/)/i, 'https://')
    // Accept Direct MEGA URL input
    .replace(/https?:\/\/directme.ga\/(?:view)?[?#]([^&]+)/i, 'https://mega.nz/#$1')
    // Normalize mega.co.nz to mega.nz
    .replace('https://mega.co.nz/', 'https://mega.nz/')

  const size = bytes.parse(form.elements.size.value.trim())

  // Show that's possible loading from the hash
  window.location.hash = url

  output.textContent = 'Loading file info...'

  splitFromURL(url, size).then(result => {
    if (result.folder) {
      const list = document.createElement('ul')
      const files = createFileList(result.folder)
      for (let {file, filePath} of files) {
        const li = document.createElement('li')
        const anchor = document.createElement('a')
        anchor.textContent = filePath
        anchor.href = '#' + url + '!' + file.downloadId[1]
        anchor.addEventListener('click', handleFileClick)
        li.appendChild(anchor)
        list.appendChild(li)
      }
      output.innerHTML = `This URL points to a folder. Select a file:<br>`
      output.appendChild(list)
      return
    }

    if (!result.parts) {
      output.innerHTML = `This file is smaller than the part size. You can download it by this URL:

      ${result.base}`
      return
    }
    // Based on https://stackoverflow.com/a/19883965 Win64 should be uncommon, but Firefox uses it
    const isWindows = navigator.platform === 'Win32' || navigator.platform === 'Win64' || navigator.platform === 'Windows'
    const mergerName = `merge-${result.id}.${isWindows ? 'bat' : 'sh'}`
    const merger = isWindows
      ? `copy /b ${result.names.join('+')} "${result.name}"`
      : `cat ${result.names.join(' ')} "${result.name}"`
    output.innerHTML = `
Download all those links. Between downloading one file and other change your IP.
After downloading all files run "${mergerName}" to join those in a single file.

${result.parts.map(e => `<li><a href="${e}">${e}</a></li>`).join('')}

${mergerName}
(if you prefer you can run the command manually in ${isWindows ? 'cmd' : 'bash'})
${merger}

After joining the parts you can delete the temporary files.`
  }).catch(error => {
    output.innerHTML = `An error happened:

${error.stack}
`
  })
}

function splitFromURL (url, size) {
  return new Promise((resolve, reject) => {
    const root = File.fromURL(url)
    root.loadAttributes((error, node) => {
      if (error) return reject(error)

      resolve(node.directory
        ? { folder: node }
        : splitFile(url, node, size))
    })
  })
}

function splitFile (url, file, partSize) {
  const parts = []
  const names = []
  let start = 0
  const name = file.name
  const base = url.replace(
    /https?:\/\/mega(\.co)?\.nz\/#/i,
    'https://directme.ga/#'
  )
  const id = Array.isArray(file.downloadId)
    ? file.downloadId[0]
    : file.downloadId

  if (file.size < partSize) {
    return {base}
  }

  while (true) {
    const end = start + partSize - 1
    const partName = `${id}-${parts.length}.part`
    const url = `${base}&name=${partName}&start=${start}`
    names.push(partName)

    if (end > file.size) {
      parts.push(url)
      break
    } else {
      parts.push(`${url}&end=${end}`)
      start = end + 1
    }
  }

  return {parts, names, name, id}
}

function createFileList (topFile, basename) {
  return [].concat(topFile.children).map(file => {
    if (!file) return []
    const filename = file.name || '[encrypted filename]'
    const filePath = basename ? basename + '/' + filename : filename

    return file.directory
      ? createFileList(file, filePath)
      : {file, filePath}
  })
    .reduce((all, sub) => all.concat(sub), [])
    .sort((fileA, fileB) => fileA.filePath.localeCompare(fileB.filePath))
}

function handleFileClick (evt) {
  window.location.hash = evt.target.hash
  form.elements.url.value = window.location.hash.substr(1)
  handleSubmit(evt)
}


text:
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\modules\user\models\RoleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('user', 'Roles');
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'tableOptions'=>['class'=>'table table-condensed'],
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            'name',
            //'description:ntext',
            'ruleName',
            //'data:ntext',
            // 'createdAt',
            // 'updatedAt',
            [
              'class' => 'yii\grid\ActionColumn',
              'header' => Html::a(' '.Yii::t('user', 'Create Permission'), ['create'], ['class' => 'btn btn-success btn-sm btn-block']),
              'options' => ['style'=>'width:120px;'],
              'buttonOptions' => ['class'=>'btn btn-default'],
              'template' => '
 {view} {update} {delete}
',
            ],
        ],
    ]); ?>


text:
package com.fragmentnavigation.gabor.fragmentnavigationsample.navigation;

import android.os.Bundle;
import android.support.annotation.AnimRes;

import java.lang.reflect.Type;

public abstract class BaseNavigationFacade<T extends BaseActivity> {

    protected T activity;
    protected BaseNavigationStrategy<T> fragmentNavigationStrategy;

    /**
     * With this method you can navigate to other Fragment
     *
     * @param fragmentClass - your fragment instance or Class to navigate
     * @return true if the navigation was success.
     **/
    public abstract boolean navigateTo(Type fragmentClass);

    /**
     * With this method you can navigate to other Fragment
     *
     * @param fragmentClass - your fragment instance or Class to navigate
     * @param bundle        - bundle to send to the fragment
     * @return true if the navigation was success.
     **/
    public abstract boolean navigateTo(Type fragmentClass, Bundle bundle);

    /**
     * With this method you can navigate to other Fragment
     *
     * @param fragmentClass - your fragment instance or Class to navigate
     * @param bundle        - bundle to send to the fragment
     * @param enterAnimId   - your fragment`s enter animation
     * @param exitAnimId    - previous fragment`s exit animation
     * @return true if the navigation was success.
     **/
    public abstract boolean navigateTo(Type fragmentClass, Bundle bundle, @AnimRes int enterAnimId, @AnimRes int exitAnimId);

    /**
     * With this method you can navigate to other Fragment
     *
     * @param fragmentClass    - your fragment instance or Class to navigate
     * @param param            - param to send to the fragment
     * @param enterAnimationID - your fragment`s enter animation
     * @param exitAnimationID  - previous fragment`s exit animation
     * @return true if the navigation was success.
     **/
    public abstract boolean navigateTo(Type fragmentClass, Object param, @AnimRes int enterAnimationID, @AnimRes int exitAnimationID);

    /**
     * With this method you can navigate to other Fragment
     *
     * @param fragmentClass - your fragment instance or Class to navigate
     * @param param         - param to send to the fragment
     * @return true if the navigation was success.
     **/
    public abstract boolean navigateTo(Type fragmentClass, Object param);
}


text:
package com.tony.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;

/**
 * Created by user on 12/24/15.
 */
public class MeasureSpecView extends ViewGroup{
    public MeasureSpecView(Context context) {
        super(context);
    }

    public MeasureSpecView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MeasureSpecView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {

    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
}


text:
package org.apache.directory.server.core.partition.impl.btree.jdbm;

import java.util.Iterator;

import org.apache.directory.api.ldap.model.exception.LdapException;
import org.apache.directory.api.ldap.model.schema.LdapComparator;
import org.apache.directory.api.ldap.model.schema.parsers.LdapComparatorDescription;
import org.apache.directory.api.ldap.model.schema.registries.DefaultComparatorRegistry;

/**
 * TODO doc me!
 *
 * @author Apache Directory Project
 */
class MockComparatorRegistry extends DefaultComparatorRegistry
{
    public MockComparatorRegistry()
    {
        super();
    }

    private LdapComparator<Integer> comparator = new LdapComparator<Integer>( "1.1.1" )
    {
        public int compare( Integer i1, Integer i2 )
        {
            return i1.compareTo( i2 );
        }
    };

    public String getSchemaName( String oid ) throws LdapException
    {
        return null;
    }

    public void register( LdapComparatorDescription description, LdapComparator<?> comparator ) throws LdapException
    {
    }

    public LdapComparator<?> lookup( String oid ) throws LdapException
    {
        return comparator;
    }

    public void register( LdapComparator<?> comparator ) throws LdapException
    {
    }

    public boolean contains( String oid )
    {
        return true;
    }

    public Iterator<LdapComparator<?>> iterator()
    {
        return null;
    }

    public Iterator<String> oidsIterator()
    {
        return null;
    }

    public Iterator<LdapComparatorDescription> ldapComparatorDescriptionIterator()
    {
        return null;
    }

    public LdapComparator<Integer> unregister( String oid ) throws LdapException
    {
        return this.comparator;
    }

    public void unregisterSchemaElements( String schemaName )
    {
    }

    public void renameSchema( String originalSchemaName, String newSchemaName )
    {
    }
}