text:
import PropTypes from 'prop-types';
import React from 'react';
import cx from '../utils/classnames.js';
import visualizations from './visualization';

const {useState} = React;

function formatTime(time) {
  if (!time) {
    return null;
  }
  if (time < 1000) {
    return `${time}ms`;
  }
  return `${(time / 1000).toFixed(2)}s`;
}

export default function ASTOutput({parseResult={}, position=null}) {
  const [selectedOutput, setSelectedOutput] = useState(0);
  const {ast=null} = parseResult;
  let output;

  if (parseResult.error) {
    output =

        {parseResult.error.message}

;
  } else if (ast) {
    output = (
      <ErrorBoundary>
        {
          React.createElement(
            visualizations[selectedOutput],
            {parseResult, position},
          )
        }
      </ErrorBoundary>
    )
  }

  let buttons = visualizations.map(
    (cls, index) =>
      <button
        key={index}
        value={index}
        onClick={event => setSelectedOutput(event.target.value)}
        className={cx({
          active: selectedOutput == index,
        })}>
        {cls.name}
      </button>,
  );

  return (

        {buttons}

          {formatTime(parseResult.time)}

    {output}

  );
}

ASTOutput.propTypes = {
  parseResult: PropTypes.object,
  position: PropTypes.number,
};

class ErrorBoundary extends React.Component {
  constructor(props) {
    super(props);
    this.state = { hasError: false };
  }

  static getDerivedStateFromError() {
    // Update state so the next render will show the fallback UI.
    return { hasError: true };
  }

  render() {
    if (this.state.hasError) {
      // You can render any custom fallback UI
      return (

					An error was caught while rendering the AST. This usually is an issue with
          astexplorer itself. Have a look at the console for more information.
          Consider filing a bug report, but check first if one doesn"t already exist. Thank you!

			);
    }
    return this.props.children;
  }
}

ErrorBoundary.propTypes = {
  children: PropTypes.node,
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
	android:background="@color/light_background"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <!-- TAB SELECTOR -->
    <include layout="@layout/note_filter_tabs" />

	<LinearLayout android:background="@color/tab_selection"
	    android:layout_width="match_parent"
	    android:layout_height="1px"
	    android:orientation="vertical" />

	<LinearLayout android:orientation="vertical"
	    android:layout_width="match_parent"
	    android:layout_height="4dp" />

    <ViewAnimator android:id="@+id/filterTabController"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

	    <!-- TAB - BY CREATE DATE -->
	    <include layout="@layout/fragment_note_filter_tab1" />

	    <!-- TAB - BY REMIND DATE -->
	    <include layout="@layout/fragment_note_filter_tab2" />

	    <!-- TAB - BY TAGS -->
	    <include layout="@layout/fragment_note_filter_tab3" />

    </ViewAnimator>

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
define([
    'stream/transform',
    'inherits',
    'streamhub-hot-collections/metrics/collection-heat-metric'
], function (Transform, inherits, HeatMetric) {

    var CollectionToHeatMetric = function (opts) {
        Transform.apply(this, arguments);
    };

    inherits(CollectionToHeatMetric, Transform);

    CollectionToHeatMetric.prototype._transform = function (collection, done) {
        var metric = CollectionToHeatMetric.transform(collection);
        this.push(metric);
        done();
    };

    CollectionToHeatMetric.transform = function (collection) {
        var metric = new HeatMetric({
            collection: collection
        });
        return metric;
    };

    return CollectionToHeatMetric;
});


text:
package cs544.exercise6_1;

public class EmailSender implements IEmailSender {
	String outgoingMailServer = "smtp.acme.com";

	public String getOutgoingMailServer() {
		return outgoingMailServer;
	}

	public void sendEmail (String email, String message){
		System.out.println("EmailSender: sending '"+message+"' to "+email );
	}
}


text:
package net.sf.jailer.ui.databrowser;

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

/**
 * Experimental layout optimization.
 *
 * @author Ralf Wisser
 */
public class TreeLayoutOptimizer<T> {

	public static class Node<T> {
		private final T userObject;
		private final List<Node<T>> children = new ArrayList<Node<T>>();
		int level = 0;
		Node<T> parent = null;
		double position = 0;

		public T getUserObject() {
			return userObject;
		}

		public Node(T userObject) {
			this.userObject = userObject;
		}

		public void addChild(Node<T> child) {
			children.add(child);
			child.parent = this;
			child.level = level + 1;
		}

		public double getPosition() {
			return position;
		}

		public int getLevel() {
			return level;
		}

		public List<Node<T>> getChildren() {
			return children;
		}

		public int getDepth() {
			int maxChildDepth = 0;
			for (Node<T> child: children) {
				maxChildDepth = Math.max(maxChildDepth, child.getDepth());
			}
			return 1 + maxChildDepth;
		}

		public int getNodesCount() {
			int count = 1;
			for (Node<T> child: children) {
				count += child.getNodesCount();
			}
			return count;
		}

		public double getCompactness() {
			double compactness = 0;
			if (children.size() > 1) {
				compactness = children.get(children.size() - 1).position - children.get(0).position;
				compactness *= compactness;
				for (Node<T> child: children) {
					compactness += child.getCompactness();
				}
			}
			return compactness;
		}
	};

	public static <T> void optimizeTreeLayout(Node<T> root) {
		int numNodes = root.getNodesCount();
		optimizeChildrenOrder(root, System.currentTimeMillis(), MAX_OPTIM_TIME_MS, numNodes);
		layoutTree(root, numNodes);
		optimizeLeafs(root);
	}

	private static long MAX_OPTIM_TIME_MS = 1000;

	private static <T> double layoutTree(Node<T> root, int numNodes) {
		double[] maxPositionPerLevel = new double[root.getDepth()];
		for (int i = 0; i < maxPositionPerLevel.length; ++i) {
			maxPositionPerLevel[i] = -1;
		}
		root.position = 0.0;
		layoutNode(root, maxPositionPerLevel);

		double sumMaxPositionSqr = 0;
		for (int i = 0; i < maxPositionPerLevel.length; ++i) {
			if (maxPositionPerLevel[i] > 0) {
				sumMaxPositionSqr += maxPositionPerLevel[i] * maxPositionPerLevel[i];
			}
		}
		return sumMaxPositionSqr / numNodes + root.getCompactness();
	}

	private static <T> void layoutNode(Node<T> node, double[] maxPositionPerLevel) {
		for (Node<T> child: node.children) {
			child.position = Math.max(node.position - (node.children.size() - 1) / 2.0, maxPositionPerLevel[child.level] + 1);
			maxPositionPerLevel[child.level] = child.position;
			adjustParentPosition(node, maxPositionPerLevel);
			layoutNode(child, maxPositionPerLevel);
		}
	}

	private static <T> void adjustParentPosition(Node<T> node, double[] maxPositionPerLevel) {
		while (node != null) {
			double parentPos = node.children.get(0).position + (maxPositionPerLevel[node.level + 1] - node.children.get(0).position) / 2.0;
			if (node.position < parentPos) {
				node.position = parentPos;
				// node.position = (node.position + parentPos) / 2.0;
				maxPositionPerLevel[node.level] = parentPos;
			} else {
				break;
			}
			node = node.parent;
		}
	}

	private static <T> void optimizeLeafs(Node<T> node) {
		if (node.children.isEmpty() && node.parent != null && node.position < node.parent.position) {
			int i = node.parent.children.indexOf(node);
			if (i >= 0 && i < node.parent.children.size() - 1) {
				Node<T> brother = node.parent.children.get(i + 1);
				node.position = Math.min(node.parent.position, brother.position - 1);
			}
		}
		for (int i = node.children.size() - 1; i >= 0; --i) {
			optimizeLeafs(node.children.get(i));
		}
	}

	private static abstract class Modification {
		public abstract void doIt();
		public abstract void undoIt();
	}

	private static <T> void optimizeChildrenOrder(Node<T> root, long startTime, long maxTime, int numNodes) {
		Stack<Node<T>> toVisit = new Stack<TreeLayoutOptimizer.Node<T>>();
		toVisit.push(root);
		List<Modification> modifications = new ArrayList<TreeLayoutOptimizer.Modification>();

		while (!toVisit.isEmpty()) {
			final Node<T> node = toVisit.pop();
			for (Node<T> child: node.children) {
				toVisit.push(child);
			}
			for (int i = 0; i < node.children.size(); ++i) {
				for (int j = i + 1; j < node.children.size(); ++j) {
					final int a = i;
					final int b = j;
					modifications.add(new Modification() {
						@Override
						public void doIt() {
							Node<T> h = node.children.get(a);
							node.children.set(a, node.children.get(b));
							node.children.set(b, h);
						}
						@Override
						public void undoIt() {
							doIt();
						}
					});
				}

			}
		}

		// add modification pairs
		List<Modification> modificationPairs = new ArrayList<TreeLayoutOptimizer.Modification>();
		int l = modifications.size();
		int countDown = Math.max(100, 10 * l);
		for (int i = 0; i < l; ++i) {
			for (int j = i + 1; j < l; ++j) {
				final Modification a = modifications.get(i);
				final Modification b = modifications.get(j);
				modificationPairs.add(new Modification() {
					@Override
					public void doIt() {
						a.doIt();
						b.doIt();
					}
					@Override
					public void undoIt() {
						b.undoIt();
						a.undoIt();
					}
				});
				--countDown;
				if (countDown < 0) {
					break;
				}
			}
			if (countDown < 0) {
				break;
			}
		}
		modifications.addAll(modificationPairs);

		double currentMaxPosition = layoutTree(root, numNodes);
//		int steps = 0;
		while (System.currentTimeMillis() - startTime < maxTime) {
			Modification bestModification = null;
			double bestMaxPosition = 0;
			for (Modification modification: modifications) {
				modification.doIt();
				double maxPosition = layoutTree(root, numNodes);
				if (maxPosition < currentMaxPosition) {
					if (bestModification == null || maxPosition < bestMaxPosition) {
						bestMaxPosition = maxPosition;
						bestModification = modification;
					}
				}
				modification.undoIt();
//				++steps;
			}
			if (bestModification != null) {
				bestModification.doIt();
				currentMaxPosition = bestMaxPosition;
			} else {
				break;
			}
		}

//		System.out.println(System.currentTimeMillis() - startTime + " " + steps + " " + modifications.size());
	}

}


text:
/**
 * @param {Node} tree
 * @param {Options} [options]
 * @returns {string}
 */
export function toMarkdown(tree: Node, options?: import("./types.js").Options | undefined): string;
export type Node = import('./types.js').Node;
export type Options = import('./types.js').Options;
export type Context = import('./types.js').Context;
export type Handle = import('./types.js').Handle;
export type Join = import('./types.js').Join;
export type Unsafe = import('./types.js').Unsafe;


text:
<component name="libraryTable">
  <library name="Maven: org.seleniumhq.selenium:selenium-support:2.44.0">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/seleniumhq/selenium/selenium-support/2.44.0/selenium-support-2.44.0.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/seleniumhq/selenium/selenium-support/2.44.0/selenium-support-2.44.0-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/seleniumhq/selenium/selenium-support/2.44.0/selenium-support-2.44.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
The extensions that are used in the project, indirect and direct, in the order that they were added.

## Packages
_No packages._

## Plugins
_No plugins._


text:
#pragma once

#include <et/app/events.h>
#include <et/geometry/geometry.h>
#include <et/core/timedobject.h>

namespace et
{
template <typename T>
class InterpolationValue : public TimedObject
{
public:
	const float interpolationThreshold = 0.00001f;

	ET_DECLARE_EVENT0(updated);
	ET_DECLARE_EVENT1(valueUpdated, const T&);
	ET_DECLARE_EVENT0(finished);

public:
	void run()
	{
		TimedObject::startUpdates(nullptr);
		_updateTime = actualTime();
	}

	void finishInterpolation()
	{
		step(1.0f);
	}

	void cancelInterpolation()
	{
		setTargetValue(_value);
		step(1.0f);
	}

	void addTargetValue(const T& value)
	{
		_targetValue += value;
		_shouldInvokeFinish = true;
	}

	void resetLatestDelta()
	{
		_latestDelta = T(0);
	}

	const T& value() const
	{
		return _value;
	}

	void setValue(const T& value)
	{
		_value = value;
		_shouldInvokeFinish = true;
	}

	const T& targetValue() const
	{
		return _targetValue;
	}

	void setTargetValue(const T& targetValue)
	{
		_targetValue = targetValue;
		_shouldInvokeFinish = true;
	}

	void setRate(float rate)
	{
		_rate = rate;
	}

	const T& latestDelta() const { return _latestDelta; }

private:
	void update(float t)
	{
		step(std::min(1.0f, _rate * (t - _updateTime)));
		_updateTime = t;
	}

	void step(float dt)
	{
		auto delta = _targetValue - _value;
		_latestDelta = delta * dt;
		if (length(delta) > interpolationThreshold)
		{
			_shouldInvokeFinish = true;
			_value += _latestDelta;
			valueUpdated.invoke(_value);
			updated.invoke();
		}
		else if (_shouldInvokeFinish)
		{
			finished.invoke();
			_shouldInvokeFinish = false;
		}
	}

private:
	T _value = T(0);
	T _targetValue = T(0);
	T _latestDelta = T(0);
	float _updateTime = 0.0f;
	float _rate = 1.0f;
	bool _shouldInvokeFinish = false;
};
}


text:
        Lancamentos - {{contaPagamento.nome}}
        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-lancamento" [routerLink]="['/lancamento', contaPagamento?.id, 'new' ]">
            <fa-icon [icon]="'plus'"></fa-icon>

            Create new Lancamento

        </button>
        <button id="jh-return" class="btn btn-primary float-right" [routerLink]="['/conta-pagamento', contaPagamento?.id, 'view' ]">
            <fa-icon [icon]="'arrow-left'"></fa-icon>

            Back

        </button>

    <jhi-alert></jhi-alert>

            ID <fa-icon [icon]="'sort'"></fa-icon>
            Data <fa-icon [icon]="'sort'"></fa-icon>
            Descricao <fa-icon [icon]="'sort'"></fa-icon>
            Valor <fa-icon [icon]="'sort'"></fa-icon>

= links['last']" [infiniteScrollDistance]="0">

                {{lancamento.id}}
                {{lancamento.data | date:'dd/MM/yyyy'}}
                {{lancamento.descricao}}
                {{lancamento.valor | number:'1.2-2'}}

                        <button type="submit"
                                [routerLink]="['/lancamento', lancamento.id, 'view' ]"
                                class="btn btn-info btn-sm">
                            <fa-icon [icon]="'eye'"></fa-icon>
                            View
                        </button>
                        <button type="submit"
                                [routerLink]="['/lancamento', lancamento.id, 'edit']"
                                class="btn btn-primary btn-sm">
                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
                            Edit
                        </button>
                        <button type="submit"
                                [routerLink]="['/', 'lancamento', { outlets: { popup: lancamento.id + '/delete'} }]"
                                replaceUrl="true"
                                queryParamsHandling="merge"
                                class="btn btn-danger btn-sm">
                            <fa-icon [icon]="'times'"></fa-icon>
                            Delete
                        </button>


text:
import sys, os

sys.path.append(os.getcwd() + '/..')

from source.utils.utils import clean_text
import pytest

@pytest.mark.parametrize('txt, exp_result', [
	('\r vahid \r \t\t\t\\t    sanei was an intern at \n Google\t\t', 'vahid sanei was an intern at Google'),
	('\t\t\t Thanks YY and Xiang for helping \r                  me during this         internship! \t \n \r', 'Thanks YY and Xiang for helping me during this internship!'),
	('\t\t\t Advertiser\t\t    \r Quality from Their\n\t\rWebsites!!!', 'Advertiser Quality from Their Websites!!!')
])
def test_clean_text(txt, exp_result):
    assert clean_text(txt) == exp_result


text:
#include "binemul.h"

extern bin_emulation_xfer_type bin_dummy_emulation;

void
ar_emul_usage (FILE *fp)
{
  if (bin_dummy_emulation.ar_usage)
    bin_dummy_emulation.ar_usage (fp);
}

void
ar_emul_default_usage (FILE *fp)
{
  AR_EMUL_USAGE_PRINT_OPTION_HEADER (fp);
  /* xgettext:c-format */
  fprintf (fp, _("  No emulation specific options\n"));
}

bfd_boolean
ar_emul_append (bfd **after_bfd, char *file_name, bfd_boolean verbose)
{
  if (bin_dummy_emulation.ar_append)
    return bin_dummy_emulation.ar_append (after_bfd, file_name, verbose);

  return FALSE;
}

bfd_boolean
ar_emul_default_append (bfd **after_bfd, char *file_name,
			bfd_boolean verbose)
{
  bfd *temp;

  temp = *after_bfd;
  *after_bfd = bfd_openr (file_name, NULL);

  AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
  AR_EMUL_APPEND_PRINT_VERBOSE (verbose, file_name);

  (*after_bfd)->next = temp;

  return TRUE;
}

bfd_boolean
ar_emul_replace (bfd **after_bfd, char *file_name, bfd_boolean verbose)
{
  if (bin_dummy_emulation.ar_replace)
    return bin_dummy_emulation.ar_replace (after_bfd, file_name, verbose);

  return FALSE;
}

bfd_boolean
ar_emul_default_replace (bfd **after_bfd, char *file_name,
			 bfd_boolean verbose)
{
  bfd *temp;

  temp = *after_bfd;
  *after_bfd = bfd_openr (file_name, NULL);

  AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name);
  AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name);

  (*after_bfd)->next = temp;

  return TRUE;
}

bfd_boolean
ar_emul_create (bfd **abfd_out, char *archive_file_name, char *file_name)
{
  if (bin_dummy_emulation.ar_create)
    return bin_dummy_emulation.ar_create (abfd_out, archive_file_name,
					  file_name);

  return FALSE;
}

bfd_boolean
ar_emul_default_create (bfd **abfd_out, char *archive_file_name,
			char *file_name)
{
  char *target = NULL;

  /* Try to figure out the target to use for the archive from the
     first object on the list.  */
  if (file_name != NULL)
    {
      bfd *obj;

      obj = bfd_openr (file_name, NULL);
      if (obj != NULL)
	{
	  if (bfd_check_format (obj, bfd_object))
	    target = bfd_get_target (obj);
	  (void) bfd_close (obj);
	}
    }

  /* Create an empty archive.  */
  *abfd_out = bfd_openw (archive_file_name, target);
  if (*abfd_out == NULL
      || ! bfd_set_format (*abfd_out, bfd_archive)
      || ! bfd_close (*abfd_out))
    bfd_fatal (archive_file_name);

  return TRUE;
}

bfd_boolean
ar_emul_parse_arg (char *arg)
{
  if (bin_dummy_emulation.ar_parse_arg)
    return bin_dummy_emulation.ar_parse_arg (arg);

  return FALSE;
}

bfd_boolean
ar_emul_default_parse_arg (char *arg ATTRIBUTE_UNUSED)
{
  return FALSE;
}


text:
layout: wiki
title: At least once delivery
---
..


text:
import argparse

from git_code_debt.generate_config import DEFAULT_GENERATE_CONFIG_FILENAME

def add_color(argparser: argparse.ArgumentParser) -> None:
    argparser.add_argument(
        '--color',
        default='auto',
        choices=('always', 'never', 'auto'),
        help='Whether to use color in output.',
    )

def add_generate_config_filename(argparser: argparse.ArgumentParser) -> None:
    argparser.add_argument(
        '-C', '--config-filename', default=DEFAULT_GENERATE_CONFIG_FILENAME,
        help='Path to generate config.',
    )


text:
package jhetzel.vagar;

import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

public final class ViewModelProvider {

    /* ----------------------------- for Activity ----------------------------- */

    /**
     * Entry Point Method. This Method will retain a {@link ViewModel} subclass instance
     * of Type {@param <T>}
     *
     * @param activity the activity to which layout the {@link ViewModel} should be
     *                 bound to.
     * @param factory a {@link ViewModel.Factory} that provides an instance of {@link ViewModel}
     * @param tag the tag under which the {@link ViewModel} will be retained
     * @param <T> a subclass of {@link ViewModel}
     * @return the retained {@link ViewModel} instance provided by the {@param factory}
     */
    public static <T extends ViewModel> T get(@NonNull Activity activity,
                                              @NonNull ViewModel.Factory<T> factory,
                                              @NonNull String tag){
        return get(activity, factory, tag, null);
    }

    /**
     * Entry Point Method. This Method will retain a {@link ViewModel} subclass instance
     * of Type {@param <T>} and bind a {@link Navigator} provided by the {@param navigatorFactory}
     * to it.
     *
     * @param activity the {@link Activity} to which layout the {@link ViewModel} should be
     *                 bound to.
     * @param factory a {@link ViewModel.Factory} that provides an instance of {@link ViewModel}
     * @param tag the tag under which the {@link ViewModel} will be retained
     * @param navigatorFactory a {@link Navigator.Factory} that provides an instance of
     *                         the {@link Navigator}. This instance will react to
     *                         {@link ViewModel#navigateTo(NavigationEvent)}
     * @param <T> a subclass of {@link ViewModel}
     * @return the retained {@link ViewModel} instance provided by the {@param factory}
     */
    public static <T extends ViewModel> T get(@NonNull Activity activity,
                                               @NonNull ViewModel.Factory<T> factory,
                                               @NonNull String tag,
                                               @Nullable Navigator.Factory navigatorFactory) {
        return get(activity.getFragmentManager(), factory, tag, navigatorFactory);
    }

    /* ----------------------------- for Fragment ----------------------------- */

    /**
     * Entry Point Method. This Method will retain a {@link ViewModel} subclass instance
     * of Type {@param <T>}
     *
     * @param fragment the {@link Fragment} to which layout the {@link ViewModel} should be
     *                 bound to.
     * @param factory a {@link ViewModel.Factory} that provides an instance of {@link ViewModel}
     * @param tag the tag under which the {@link ViewModel} will be retained
     * @param <T> a subclass of {@link ViewModel}
     * @return the retained {@link ViewModel} instance provided by the {@param factory}
     */
    public static <T extends ViewModel> T get(@NonNull Fragment fragment,
                                              @NonNull ViewModel.Factory<T> factory,
                                              @NonNull String tag){
        return get(fragment, factory, tag, null);
    }

    /**
     * Entry Point Method. This Method will retain a {@link ViewModel} subclass instance
     * of Type {@param <T>} and bind a {@link Navigator} provided by the {@param navigatorFactory}
     * to it.
     *
     * @param fragment the {@link Fragment} to which layout the {@link ViewModel} should be
     *                 bound to.
     * @param factory a {@link ViewModel.Factory} that provides an instance of {@link ViewModel}
     * @param tag the tag under which the {@link ViewModel} will be retained
     * @param navigatorFactory a {@link Navigator.Factory} that provides an instance of
     *                         the {@link Navigator}. This instance will react to
     *                         {@link ViewModel#navigateTo(NavigationEvent)}
     * @param <T> a subclass of {@link ViewModel}
     * @return the retained {@link ViewModel} instance provided by the {@param factory}
     */
    public static <T extends ViewModel> T get(@NonNull Fragment fragment,
                                               @NonNull ViewModel.Factory<T> factory,
                                               @NonNull String tag,
                                               @Nullable Navigator.Factory navigatorFactory) {
        return get(fragment.getActivity().getFragmentManager(), factory, tag, navigatorFactory);
    }

    /* ----------------------------- internal ----------------------------- */

    /**
     * Returns the Config Persistent View Model or creates one if not existing
     * and saves it under the given {@param tag}
     *
     * @param fragmentManager Needed for the view model to get saved in a Retained Fragment
     * @param factory Needed to get a new instance of the view model
     * @param tag The tag under which the view model holding fragment will be saved in the fragment manager
     * @param <T> extends @link{ViewModel} the view model
     * @return the retained view model
     */
    private static <T extends ViewModel> T get(@NonNull FragmentManager fragmentManager,
                                       @NonNull ViewModel.Factory<T> factory,
                                       @NonNull String tag,
                                       @Nullable Navigator.Factory navigatorFactory) {
        ViewModelHolder<T> viewModelHolder = getViewModelHolder(fragmentManager, factory, tag, navigatorFactory);
        return viewModelHolder.getViewModel();
    }

    private static <T extends ViewModel> ViewModelHolder<T> getViewModelHolder(@NonNull FragmentManager fragmentManager,
                                                                               @NonNull ViewModel.Factory<T> factory,
                                                                               @NonNull String tag,
                                                                               @Nullable Navigator.Factory navigatorFactory){
        @SuppressWarnings("unchecked")
        ViewModelHolder<T> viewModelHolder = (ViewModelHolder<T>) fragmentManager.findFragmentByTag(tag);
        return viewModelHolder == null ? createViewModelHolder(fragmentManager, factory, tag, navigatorFactory) : viewModelHolder;
    }

    private static <T extends ViewModel> ViewModelHolder<T> createViewModelHolder(@NonNull FragmentManager fragmentManager,
                                                                                @NonNull ViewModel.Factory<T> factory,
                                                                                @NonNull String tag,
                                                                                @Nullable Navigator.Factory navigatorFactory){
        Navigator navigator = navigatorFactory != null ? navigatorFactory.createNavigator() : null;
        ViewModelHolder<T> viewModelHolder = ViewModelHolder.newInstance(factory.createViewModel(), navigator);
        fragmentManager.beginTransaction().add(viewModelHolder, tag).commit();
        return viewModelHolder;
    }
}


text:
import { Component } from '@angular/core';

@Component({
  // eslint-disable-next-line @angular-eslint/component-selector
  selector: 'div.tile2',
  templateUrl: './tile-demo-tile2.component.html',
})
export class TileDemoTile2Component {
  public onActionClick(): void {
    alert('Help inline button clicked!');
  }

  onHelpClick($event: MouseEvent) {
    $event.stopPropagation();
  }
}


text:
package com.google.youtube.gaming.chat;

import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.client.IModGuiFactory;

/**
 * Configuration factory for YouTube Chat.
 */
public class YouTubeConfigurationGuiFactory implements IModGuiFactory {

  @Override
  public void initialize(Minecraft minecraftInstance) {}

  @Override
  public boolean hasConfigGui() {
    return true;
  }

  @Override
  public GuiScreen createConfigGui(GuiScreen parentScreen) {
    return new YouTubeConfigurationGui(parentScreen);
  }

  @Override
  public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
    return null;
  }
}


text:
// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
// vi:set ts=4 sts=4 sw=4 noet :
// Copyright 2014, The TPIE development team
//
// This file is part of TPIE.
//
// TPIE is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
// License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TPIE.  If not, see <http://www.gnu.org/licenses/>

#ifndef __TPIE_PIPELINING_STORE_H__
#define __TPIE_PIPELINING_STORE_H__
#include <tpie/memory.h>
namespace tpie {

namespace bits {
template <typename T> struct remove_pointer {typedef T type;};
template <typename T> struct remove_pointer<T*> {typedef T type;};

template <typename pred_t, typename specific_store_t>
class store_pred {
private:
	typedef typename specific_store_t::store_type store_type;
	pred_t pred;
public:
	typedef store_type first_argument_type;
	typedef store_type second_argument_type;
	typedef bool result_type;

	store_pred(pred_t pred): pred(pred) {}

	bool operator()(const store_type & lhs, const store_type & rhs) const {
		return pred(
			specific_store_t::store_as_element(lhs),
			specific_store_t::store_as_element(rhs));
	}

	bool operator()(const store_type & lhs, const store_type & rhs) {
		return pred(
			specific_store_t::store_as_element(lhs),
			specific_store_t::store_as_element(rhs));
	}
};
} //namespace bits

/**
 * \brief Plain old store
 *
 * We sort elements of type T, they are pushed to us a T, and we store them as T.
 */
struct plain_store {
	template <typename outer_t>
	struct element_type {
		typedef outer_t type;
	};

	template <typename element_t>
	struct specific {
		// Type of element we compare and store in file_stream
		typedef element_t element_type;
		// Type we store in internal sort buffer
		typedef element_t store_type;
		// Type we accept in push and return in pop
		typedef element_t outer_type;
		// Internal memory usage per element in internal sort
		static const size_t item_size = sizeof(element_t);

		element_type store_to_element(const store_type & e) {return e;}
		store_type element_to_store(const element_type & e) {return e;}
		static const element_type & store_as_element(const store_type & e) {return e;}
		store_type outer_to_store(const outer_type & e) {return e;}
		outer_type store_to_outer(const store_type & e) {return e;}
	};

	template <typename element_t>
	specific<element_t> get_specific() {return specific<element_t>();}
};

/**
 * \brief Sort elements in tpie pointers
 *
 * We sort elements of type T, they are pushed to us as T * and we store them as T*.
 * Pointers pushed must be allocated with tpie_new,
 * and the sorter takes ownership.
 * When returned, ownership of the new pointer is given to user.
 * The elements are tpie_delete'ed and tpie_new'ed.
 */
struct explicit_tpie_pointer_store {
	template <typename outer_t>
	struct element_type {
		typedef typename bits::remove_pointer<outer_t>::type type;
	};

	template <typename element_t>
	struct specific {
		typedef element_t element_type;
		typedef element_t * store_type;
		typedef element_t * outer_type;

		static const size_t item_size = sizeof(element_t) + sizeof(store_type);

		element_type store_to_element(const store_type e) {
			element_type ans=*e;
			tpie_delete(e);
			return ans;
		}
		store_type element_to_store(const element_type & e) {return tpie_new<element_type>(e);}
		static const element_type & store_as_element(const store_type e) {return *e;}
		store_type outer_to_store(const outer_type & e) {return e;}
		outer_type store_to_outer(const store_type & e) {return e;}
	};

	template <typename element_t>
	specific<element_t> get_specific() {return specific<element_t>();}
};

#ifdef TPIE_CPP_RVALUE_REFERENCE
/**
 * \brief Sort elements in tpie unique pointers
 *
 * We sort elements of type T, they are pushed to us as tpie::unique_ptr<T> and we store them as tpie::unique_ptr<T>.
 */
struct explicit_tpie_unique_pointer_store {
	template <typename outer_t>
	struct element_type {
		typedef typename outer_t::element_type type;
	};

	template <typename element_t>
	struct specific {
		typedef element_t element_type;
		typedef tpie::unique_ptr<element_t> store_type;
		typedef tpie::unique_ptr<element_t> outer_type;

		static const size_t item_size = sizeof(element_t) + sizeof(store_type);

		element_type store_to_element(store_type e) {
			return *e;
		}
		store_type element_to_store(const element_type & e) {
			return outer_type(tpie_new<element_type>(e));
		}
		static const element_type & store_as_element(const store_type & e) {return *e;}
		store_type outer_to_store(outer_type e) {return std::move(e);}
		outer_type store_to_outer(store_type e) {return std::move(e);}
	};

	template <typename element_t>
	specific<element_t> get_specific() {return specific<element_t>();}
};
#endif //TPIE_CPP_RVALUE_REFERENCE

/**
 * \brief Sort elements using pointer indirection.
 *
 * We sort elements of type T, they are push to us a T. But internally they are storred as
 * T *.
 */
struct pointer_store {
	template <typename outer_t>
	struct element_type {
		typedef outer_t type;
	};

	template <typename element_t>
	struct specific {
		typedef element_t element_type;
		typedef element_t * store_type;
		typedef element_t outer_type;

		static const size_t item_size = sizeof(element_t) + sizeof(store_type);

		element_type store_to_element(const store_type e) {
			element_type ans=*e;
			tpie_delete(e);
			return ans;
		}
		store_type element_to_store(const element_type & e) {return tpie_new<element_type>(e);}
		static const element_type & store_as_element(const store_type e) {return *e;}
		store_type outer_to_store(const outer_type & e) {return tpie_new<element_type>(e);}
		outer_type store_to_outer(const store_type & e) {
			outer_type ans=*e;
			tpie_delete(e);
			return ans;
		}
	};

	template <typename element_t>
	specific<element_t> get_specific() {return specific<element_t>();}
};

namespace bits {

template <typename element_t, bool = (sizeof(element_t) > 256)>
struct dynamic_specific_selector: public plain_store::specific<element_t> {};

template <typename element_t>
struct dynamic_specific_selector<element_t, true>: public pointer_store::specific<element_t> {};

} //namespace bits

/**
 * \brief Fantastic store strategy.
 *
 * We sort elements of type T, they are push to us a T
 * If sizeof(T) is small, they are storred internally as T,
 * if on the other hand sizeof(T) is large they are sorted using pointer indirection.
 *
 * \note currently large means > 256 bytes, no experiments has been done to verify that this is sane.
 */
struct dynamic_store {
	template <typename outer_t>
	struct element_type {
		typedef outer_t type;
	};

	template <typename element_t>
	struct specific: public bits::dynamic_specific_selector<element_t> {};

	template <typename element_t>
	specific<element_t> get_specific() {return specific<element_t>();}
};

typedef dynamic_store default_store;

} //namespace tpie

#endif //__TPIE_PIPELINING_SPECIFIC_POINTER_H__


text:
const webpack = require('webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const GenerateJsonPlugin = require('generate-json-webpack-plugin')
const merge = require('webpack-merge')
const path = require('path')

// markdown convert to html
const marked = require('marked')
const renderer = new marked.Renderer()

module.exports = function (env, argv) {
  console.log(env)
  const [browser] = env.split(':')
  const version = require('./manifest/common.json').version

  const config = {
    entry: {
      background_page: './src/background_page/index.js',
      content_script: './src/content_script/index.js',
      content_script_loader: './src/content_script/loader.js',
      info: './src/pages/info/index.js',
      options: './src/pages/options/index.js'
    },
    output: {
      path: path.join(__dirname, '/dist'),
      filename: '[name].js',
      sourceMapFilename: '[name].js.map' // always generate source maps
    },
    devtool: argv.mode === 'production' ? 'source-map' : 'inline-source-map',
    module: {
      rules: [
        {
          test: /\.js$/,
          exclude: /node_modules/,
          loader: 'babel-loader'
        },
        {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
        },
        {
          test: /\.md$/,
          use: [
            {
              loader: 'html-loader'
            },
            {
              loader: 'markdown-loader',
              options: {
                renderer
              }
            }
          ]
        }
      ]
    },
    resolve: {
      modules: ['./src', './node_modules'],
      alias: {
        react: 'preact/compat',
        'react-dom': 'preact/compat'
      }
    },
    plugins: [
      new CopyWebpackPlugin([
        {
          from: 'static'
        },
        {
          context: 'src/options',
          from: '**/default.json',
          to: 'default_[folder].json'
        },
        {
          context: 'src/options',
          from: '**/config.json',
          to: 'config_[folder].json'
        }
      ]),
      new GenerateJsonPlugin(
        'manifest.json',
        merge(
          require('./manifest/common.json'),
          require(`./manifest/${browser}.json`),
          { version }
        ),
        null,
        2
      )
    ]
  }

  // extension id must be specified in calls to chrome.runtime.connect
  // otherwise clients won't be able to reconnect to background page
  // and background commands will stop working
  const EXTENSION_ID = JSON.stringify(
    browser === 'chrome'
      ? 'hhhpdkekipnbloiiiiaokibebpdpakdp'
      : 'a0dd2b80-9ba1-224b-b5fe-3ae14f12d85d'
  )

  if (argv.mode === 'production') {
    config.plugins = config.plugins.concat([
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('production'),
        SAKA_DEBUG: JSON.stringify(false),
        SAKA_VERSION: JSON.stringify(version),
        SAKA_PLATFORM: JSON.stringify(browser),
        EXTENSION_ID
      })
    ])
  } else {
    config.plugins = config.plugins.concat([
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('development'),
        SAKA_DEBUG: JSON.stringify(true),
        SAKA_VERSION: JSON.stringify(version + ' dev'),
        SAKA_PLATFORM: JSON.stringify(browser),
        EXTENSION_ID
      })
    ])
  }
  return config
}


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

    <item android:drawable="@drawable/ic_bz_selected" android:state_pressed="true"></item>
    <item android:drawable="@drawable/ic_bz_selected" android:state_selected="true"></item>
    <item android:drawable="@drawable/ic_bz_normal"></item>

</selector>


text:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chromoting;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.ContextMenu;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;

import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Log;
import org.chromium.chromoting.NavigationMenuAdapter.NavigationMenuItem;
import org.chromium.chromoting.accountswitcher.AccountSwitcher;
import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory;
import org.chromium.chromoting.base.OAuthTokenFetcher;
import org.chromium.chromoting.help.CreditsActivity;
import org.chromium.chromoting.help.HelpContext;
import org.chromium.chromoting.help.HelpSingleton;
import org.chromium.chromoting.jni.Client;
import org.chromium.chromoting.jni.ConnectionListener;
import org.chromium.chromoting.jni.JniInterface;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * The user interface for querying and displaying a user's host list from the directory server. It
 * also requests and renews authentication tokens using the system account manager.
 */
public class Chromoting extends AppCompatActivity implements ConnectionListener,
        AccountSwitcher.Callback, HostListManager.Callback, View.OnClickListener {
    private static final String TAG = "Chromoting";

    /** Only accounts of this type will be selectable for authentication. */
    private static final String ACCOUNT_TYPE = "com.google";

    /** Scope to use when fetching the OAuth token. */
    private static final String TOKEN_SCOPE = "oauth2:https://www.googleapis.com/auth/chromoting "
            + "https://www.googleapis.com/auth/googletalk";

    /** Result code used for starting {@link DesktopActivity}. */
    public static final int DESKTOP_ACTIVITY = 0;

    /** Result code used for starting {@link CardboardDesktopActivity}. */
    public static final int CARDBOARD_DESKTOP_ACTIVITY = 1;

    /** Preference names for storing selected and recent accounts. */
    private static final String PREFERENCE_SELECTED_ACCOUNT = "account_name";
    private static final String PREFERENCE_RECENT_ACCOUNT_PREFIX = "recent_account_";
    private static final String PREFERENCE_EXPERIMENTAL_FLAGS = "flags";

    /** User's account name (email). */
    private String mAccount;

    /** Helper for fetching the host list. */
    private HostListManager mHostListManager;

    /** List of hosts. */
    private HostInfo[] mHosts = new HostInfo[0];

    /** Refresh button. */
    private MenuItem mRefreshButton;

    /** Host list chooser view shown when at least one host is configured. */
    private ListView mHostListView;

    /** View shown when the user has no configured hosts or host list couldn't be retrieved. */
    private View mEmptyView;

    /** Progress view shown instead of the host list when the host list is loading. */
    private View mProgressView;

    /** Dialog for reporting connection progress. */
    private ProgressDialog mProgressIndicator;

    /**
     * Helper used by SessionConnection for session authentication. Receives onNewIntent()
     * notifications to handle third-party authentication.
     */
    private SessionAuthenticator mAuthenticator;

    private OAuthTokenConsumer mHostConnectingConsumer;

    private OAuthTokenConsumer mHostListRetrievingConsumer;

    private OAuthTokenConsumer mHostDeletingConsumer;

    private DrawerLayout mDrawerLayout;

    private ActionBarDrawerToggle mDrawerToggle;

    private AccountSwitcher mAccountSwitcher;

    /** The currently-connected Client, if any. */
    private Client mClient;

    /** Shows a warning explaining that a Google account is required, then closes the activity. */
    private void showNoAccountsDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(R.string.noaccounts_message);
        builder.setPositiveButton(R.string.noaccounts_add_account,
                new DialogInterface.OnClickListener() {
                    @SuppressLint("InlinedApi")
                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
                        intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES,
                                new String[] { ACCOUNT_TYPE });
                        ChromotingUtil.startActivitySafely(Chromoting.this, intent);
                        finish();
                    }
                });
        builder.setNegativeButton(R.string.close, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    finish();
                }
            });
        builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialog) {
                    finish();
                }
            });

        AlertDialog dialog = builder.create();
        dialog.show();
    }

    /**
     * Displays the loading indicator. Currently this also hides the host list, but that may
     * change.
     */
    private void showHostListLoadingIndicator() {
        mHostListView.setVisibility(View.GONE);
        mEmptyView.setVisibility(View.GONE);
        mProgressView.setVisibility(View.VISIBLE);
    }

    /**
     * Shows the appropriate view for the host list and hides the loading indicator. Shows either
     * the host list chooser or the host list empty view, depending on whether mHosts contains any
     * hosts.
     */
    private void updateHostListView() {
        mHostListView.setVisibility(mHosts.length == 0 ? View.GONE : View.VISIBLE);
        mEmptyView.setVisibility(mHosts.length == 0 ? View.VISIBLE : View.GONE);
        mProgressView.setVisibility(View.GONE);
    }

    private ListView createNavigationMenu() {
        ListView navigationMenu = (ListView) getLayoutInflater()
                .inflate(R.layout.navigation_list, null);

        NavigationMenuItem helpItem = new NavigationMenuItem(R.menu.help_list_item,
                new Runnable() {
                    @Override
                    public void run() {
                        HelpSingleton.getInstance().launchHelp(Chromoting.this,
                                HelpContext.HOST_LIST);
                    }
                });

        NavigationMenuItem creditsItem = new NavigationMenuItem(R.menu.credits_list_item,
                new Runnable() {
                    @Override
                    public void run() {
                        startActivity(new Intent(Chromoting.this, CreditsActivity.class));
                    }
                });

        NavigationMenuItem[] navigationMenuItems = { helpItem, creditsItem };
        NavigationMenuAdapter adapter = new NavigationMenuAdapter(this, navigationMenuItems);
        navigationMenu.setAdapter(adapter);
        navigationMenu.setOnItemClickListener(adapter);
        return navigationMenu;
    }

    /**
     * Called when the activity is first created. Loads the native library and requests an
     * authentication token from the system.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        mHostListManager = new HostListManager();

        // Get ahold of our view widgets.
        mHostListView = (ListView) findViewById(R.id.hostList_chooser);
        registerForContextMenu(mHostListView);
        mEmptyView = findViewById(R.id.hostList_empty);
        mHostListView.setOnItemClickListener(
                new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> parent, View view, int position,
                            long id) {
                        onHostClicked(position);
                    }
                });

        mProgressView = findViewById(R.id.hostList_progress);

        findViewById(R.id.host_setup_link_android).setOnClickListener(this);

        mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar,
                R.string.open_navigation_drawer, R.string.close_navigation_drawer);
        mDrawerLayout.setDrawerListener(mDrawerToggle);

        // Disable the hamburger icon animation. This is more complex than it ought to be.
        // The animation can be customized by tweaking some style parameters - see
        // http://developer.android.com/reference/android/support/v7/appcompat/R.styleable.html#DrawerArrowToggle .
        // But these can't disable the animation completely.
        // The icon can only be changed by disabling the drawer indicator, which has side-effects
        // that must be worked around. It disables the built-in click listener, so this has to be
        // implemented and added. This also requires that the toolbar be passed to the
        // ActionBarDrawerToggle ctor above (otherwise the listener is ignored and warnings are
        // logged).
        // Also, the animation itself is a private implementation detail - it is not possible to
        // simply access the first frame of the animation. And the hamburger menu icon doesn't
        // exist as a builtin Android resource, so it has to be provided as an application
        // resource instead (R.drawable.ic_menu). And, on Lollipop devices and above, it should be
        // tinted to match the colorControlNormal theme attribute.
        mDrawerToggle.setDrawerIndicatorEnabled(false);
        mDrawerToggle.setToolbarNavigationClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        if (mDrawerLayout.isDrawerOpen(Gravity.START)) {
                            mDrawerLayout.closeDrawer(Gravity.START);
                        } else {
                            mDrawerLayout.openDrawer(Gravity.START);
                        }
                    }
                });

        // Set the three-line icon instead of the default which is a tinted arrow icon.
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        Drawable menuIcon = ApiCompatibilityUtils.getDrawable(getResources(), R.drawable.ic_menu);
        DrawableCompat.setTint(menuIcon.mutate(),
                ChromotingUtil.getColorAttribute(this, R.attr.colorControlNormal));
        getSupportActionBar().setHomeAsUpIndicator(menuIcon);

        mAccountSwitcher = AccountSwitcherFactory.getInstance().createAccountSwitcher(this, this);
        mAccountSwitcher.setNavigation(createNavigationMenu());
        LinearLayout navigationDrawer = (LinearLayout) findViewById(R.id.navigation_drawer);
        mAccountSwitcher.setDrawer(navigationDrawer);
        View switcherView = mAccountSwitcher.getView();
        switcherView.setLayoutParams(new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.WRAP_CONTENT));
        navigationDrawer.addView(switcherView, 0);

        mHostConnectingConsumer = new OAuthTokenConsumer(this, TOKEN_SCOPE);
        mHostListRetrievingConsumer = new OAuthTokenConsumer(this, TOKEN_SCOPE);
        mHostDeletingConsumer = new OAuthTokenConsumer(this, TOKEN_SCOPE);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        mDrawerToggle.syncState();
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);

        if (mAuthenticator != null) {
            mAuthenticator.onNewIntent(intent);
        }
    }

    /**
     * Called when the activity becomes visible. This happens on initial launch and whenever the
     * user switches to the activity, for example, by using the window-switcher or when coming from
     * the device's lock screen.
     */
    @Override
    public void onStart() {
        super.onStart();

        getSupportActionBar().setTitle(R.string.mode_me2me);

        // Load any previously-selected account and recents from Preferences.
        SharedPreferences prefs = getPreferences(MODE_PRIVATE);

        String selected = prefs.getString(PREFERENCE_SELECTED_ACCOUNT, null);

        ArrayList<String> recents = new ArrayList<String>();
        for (int i = 0;; i++) {
            String prefName = PREFERENCE_RECENT_ACCOUNT_PREFIX + i;
            String recent = prefs.getString(prefName, null);
            if (recent != null) {
                recents.add(recent);
            } else {
                break;
            }
        }

        String[] recentsArray = recents.toArray(new String[recents.size()]);
        mAccountSwitcher.setSelectedAndRecentAccounts(selected, recentsArray);
        mAccountSwitcher.reloadAccounts();
    }

    @Override
    protected void onPause() {
        super.onPause();

        String[] recents = mAccountSwitcher.getRecentAccounts();

        SharedPreferences.Editor preferences = getPreferences(MODE_PRIVATE).edit();
        if (mAccount != null) {
            preferences.putString(PREFERENCE_SELECTED_ACCOUNT, mAccount);
        }

        for (int i = 0; i < recents.length; i++) {
            String prefName = PREFERENCE_RECENT_ACCOUNT_PREFIX + i;
            preferences.putString(prefName, recents[i]);
        }

        preferences.apply();
    }

    /** Called when the activity is finally finished. */
    @Override
    public void onDestroy() {
        super.onDestroy();
        mAccountSwitcher.destroy();

        // TODO(lambroslambrou): Determine whether we really need to tear down the connection here,
        // so we can remove this code.
        if (mClient != null) {
            mClient.destroy();
            mClient = null;
        }
    }

    /** Called when a child Activity exits and sends a result back to this Activity. */
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        mAccountSwitcher.onActivityResult(requestCode, resultCode, data);

        if (requestCode == OAuthTokenFetcher.REQUEST_CODE_RECOVER_FROM_OAUTH_ERROR) {
            if (resultCode == RESULT_OK) {
                // User gave OAuth permission to this app (or recovered from any OAuth failure),
                // so retry fetching the token.

                // We actually don't know which consumer triggers the startActivityForResult() but
                // refreshing the host list is the safest action.
                // TODO(yuweih): Distinguish token consumer.
                refreshHostList();
            } else {
                // User denied permission or cancelled the dialog, so cancel the request.
                updateHostListView();
            }
        }
    }

    /** Called when a permissions request has returned. */
    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions,
            int[] grantResults) {
        // This is currently only used by AccountSwitcherBasic.
        // Check that the user has granted the needed permission, and reload the accounts.
        // Otherwise, assume something unexpected occurred, or the user cancelled the request.
        if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            mAccountSwitcher.reloadAccounts();
        } else if (permissions.length == 0) {
            Log.e(TAG, "User cancelled the permission request.");
        } else {
            Log.e(TAG, "Permission %s was not granted.", permissions[0]);
        }
    }

    /** Called when the display is rotated (as registered in the manifest). */
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);

        mDrawerToggle.onConfigurationChanged(newConfig);
    }

    private static int getHostIndexForMenu(ContextMenu.ContextMenuInfo menuInfo) {
        return ((AdapterView.AdapterContextMenuInfo) menuInfo).position;
    }

    @Override
    public void onCreateContextMenu(ContextMenu menu, View v,
            ContextMenu.ContextMenuInfo menuInfo) {
        super.onCreateContextMenu(menu, v, menuInfo);
        if (v.getId() == R.id.hostList_chooser) {
            getMenuInflater().inflate(R.menu.host_context_menu, menu);
            HostInfo info = mHosts[getHostIndexForMenu(menuInfo)];
            menu.setHeaderTitle(info.name);
        }
    }

    @Override
    public boolean onContextItemSelected(MenuItem item) {
        int itemId = item.getItemId();
        int hostIndex = getHostIndexForMenu(item.getMenuInfo());
        if (itemId == R.id.connect) {
            onHostClicked(hostIndex);
        } else if (itemId == R.id.delete) {
            onDeleteHostClicked(hostIndex);
        } else {
            return false;
        }
        return true;
    }

    /** Called to initialize the action bar. */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.chromoting_actionbar, menu);
        mRefreshButton = menu.findItem(R.id.actionbar_directoryrefresh);

        if (mAccount == null) {
            // If there is no account, don't allow the user to refresh the listing.
            mRefreshButton.setEnabled(false);
        }

        ChromotingUtil.tintMenuIcons(this, menu);

        return super.onCreateOptionsMenu(menu);
    }

    /** Called whenever an action bar button is pressed. */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (mDrawerToggle.onOptionsItemSelected(item)) {
            return true;
        }

        int id = item.getItemId();
        if (id == R.id.actionbar_directoryrefresh) {
            refreshHostList();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /** Called when the user touches hyperlinked text. */
    @Override
    public void onClick(View view) {
        HelpSingleton.getInstance().launchHelp(this, HelpContext.HOST_SETUP);
    }

    private void onDeleteHostClicked(int hostIndex) {
        HostInfo hostInfo = mHosts[hostIndex];
        final String hostId = hostInfo.id;
        String message = getString(R.string.confirm_host_delete_android, hostInfo.name);
        new AlertDialog.Builder(this)
                .setMessage(message)
                .setPositiveButton(android.R.string.yes,
                        new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                deleteHost(hostId);
                                dialog.dismiss();
                            }
                        })
                .setNegativeButton(android.R.string.no, null)
                .create().show();
    }

    /** Called when the user taps on a host entry. */
    private void onHostClicked(int index) {
        HostInfo host = mHosts[index];
        if (host.isOnline) {
            connectToHost(host);
        } else {
            String tooltip = host.getHostOfflineReasonText(this);
            Toast.makeText(this, tooltip, Toast.LENGTH_SHORT).show();
        }
    }

    private void connectToHost(final HostInfo host) {
        if (mClient != null) {
            mClient.destroy();
        }

        mClient = new Client();
        mProgressIndicator = ProgressDialog.show(
                this,
                host.name,
                getString(R.string.footer_connecting),
                true,
                true,
                new DialogInterface.OnCancelListener() {
                    @Override
                    public void onCancel(DialogInterface dialog) {
                        if (mClient != null) {
                            mClient.destroy();
                            mClient = null;
                        }
                    }
                });

        final SessionConnector connector =
                new SessionConnector(mClient, this, this, mHostListManager);
        mAuthenticator = new SessionAuthenticator(this, mClient, host);
        mHostConnectingConsumer.consume(mAccount, new OAuthTokenFetcher.Callback() {
            @Override
            public void onTokenFetched(String token) {
                connector.connectToHost(mAccount, token, host, mAuthenticator,
                        getPreferences(MODE_PRIVATE).getString(PREFERENCE_EXPERIMENTAL_FLAGS, ""));
            }

            @Override
            public void onError(OAuthTokenFetcher.Error error) {
                showAuthErrorMessage(error);
            }
        });
    }

    private void showAuthErrorMessage(OAuthTokenFetcher.Error error) {
        String explanation = getString(error == OAuthTokenFetcher.Error.NETWORK
                ? R.string.error_network_error : R.string.error_unexpected);
        Toast.makeText(Chromoting.this, explanation, Toast.LENGTH_LONG).show();
    }

    private void refreshHostList() {
        showHostListLoadingIndicator();

        // The refresh button simply makes use of the currently-chosen account.
        mHostListRetrievingConsumer.consume(mAccount, new OAuthTokenFetcher.Callback() {
            @Override
            public void onTokenFetched(String token) {
                mHostListManager.retrieveHostList(token, Chromoting.this);
            }

            @Override
            public void onError(OAuthTokenFetcher.Error error) {
                showAuthErrorMessage(error);
                updateHostListView();
            }
        });
    }

    private void deleteHost(final String hostId) {
        showHostListLoadingIndicator();

        mHostDeletingConsumer.consume(mAccount, new OAuthTokenFetcher.Callback() {
            @Override
            public void onTokenFetched(String token) {
                mHostListManager.deleteHost(token, hostId, Chromoting.this);
            }

            @Override
            public void onError(OAuthTokenFetcher.Error error) {
                showAuthErrorMessage(error);
                updateHostListView();
            }
        });
    }

    @Override
    public void onAccountSelected(String accountName) {
        mAccount = accountName;
        JniInterface.setAccountForLogging(accountName);

        // The current host list is no longer valid for the new account, so clear the list.
        mHosts = new HostInfo[0];
        updateUi();
        refreshHostList();
    }

    @Override
    public void onAccountsListEmpty() {
        showNoAccountsDialog();
    }

    @Override
    public void onRequestCloseDrawer() {
        mDrawerLayout.closeDrawers();
    }

    @Override
    public void onHostListReceived(HostInfo[] hosts) {
        // Store a copy of the array, so that it can't be mutated by the HostListManager. HostInfo
        // is an immutable type, so a shallow copy of the array is sufficient here.
        mHosts = Arrays.copyOf(hosts, hosts.length);
        updateHostListView();
        updateUi();
    }

    @Override
    public void onHostUpdated() {
        // Not implemented Yet.
    }

    @Override
    public void onHostDeleted() {
        // Refresh the host list. there is no need to refetch the auth token again.
        // onHostListReceived is in charge to hide the progress indicator.
        mHostListManager.retrieveHostList(mHostDeletingConsumer.getLatestToken(), this);
    }

    @Override
    public void onError(HostListManager.Error error) {
        String explanation = null;
        switch (error) {
            case AUTH_FAILED:
                break;
            case NETWORK_ERROR:
                explanation = getString(R.string.error_network_error);
                break;
            case UNEXPECTED_RESPONSE:
            case SERVICE_UNAVAILABLE:
            case UNKNOWN:
                explanation = getString(R.string.error_unexpected);
                break;
            default:
                // Unreachable.
                return;
        }

        if (explanation != null) {
            Toast.makeText(this, explanation, Toast.LENGTH_LONG).show();
            updateHostListView();
            return;
        }

        // We don't know which consumer triggers onError. Refreshing host list is the most common
        // use case and the latest token should be mostly the same on all consumers.
        // TODO(yuweih): distinguish token consumer.
        mHostListRetrievingConsumer.revokeLatestToken(null);
        Log.e(TAG, "Fresh auth token was rejected.");
        explanation = getString(R.string.error_authentication_failed);
        Toast.makeText(this, explanation, Toast.LENGTH_LONG).show();
        updateHostListView();
    }

    /**
     * Updates the infotext and host list display.
     */
    private void updateUi() {
        if (mRefreshButton != null) {
            mRefreshButton.setEnabled(mAccount != null);
        }
        ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, mHosts);
        mHostListView.setAdapter(displayer);
    }

    @Override
    public void onConnectionState(ConnectionListener.State state, ConnectionListener.Error error) {
        boolean dismissProgress = false;
        switch (state) {
            case INITIALIZING:
            case CONNECTING:
            case AUTHENTICATED:
                // The connection is still being established.
                break;

            case CONNECTED:
                dismissProgress = true;
                // Display the remote desktop.
                startActivityForResult(new Intent(this, Desktop.class), DESKTOP_ACTIVITY);
                break;

            case FAILED:
                dismissProgress = true;
                Toast.makeText(this, getString(error.message()), Toast.LENGTH_LONG).show();
                // Close the Desktop view, if it is currently running.
                finishActivity(DESKTOP_ACTIVITY);
                break;

            case CLOSED:
                // No need to show toast in this case. Either the connection will have failed
                // because of an error, which will trigger toast already. Or the disconnection will
                // have been initiated by the user.
                dismissProgress = true;
                finishActivity(DESKTOP_ACTIVITY);
                break;

            default:
                // Unreachable, but required by Google Java style and findbugs.
                assert false : "Unreached";
        }

        if (dismissProgress && mProgressIndicator != null) {
            mProgressIndicator.dismiss();
            mProgressIndicator = null;
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;

namespace GitMind.Utils
{
	public static class Asserter
	{
		public static event EventHandler<AsserterEventArgs> AssertOccurred;

		public static void NotNull(
			object instance,
			[CallerMemberName] string memberName = "",
			[CallerFilePath] string sourceFilePath = "",
			[CallerLineNumber] int sourceLineNumber = 0)
		{
			Requires(instance != null, memberName, sourceFilePath, sourceLineNumber);
		}

		public static void Requires(
			bool predicate,
			[CallerMemberName] string memberName = "",
			[CallerFilePath] string sourceFilePath = "",
			[CallerLineNumber] int sourceLineNumber = 0)
		{
			if (!predicate)
			{
				Fail("assert", memberName, sourceFilePath, sourceLineNumber);
			}
		}

		public static Exception FailFast(
			string errorMessage,
			[CallerMemberName] string memberName = "",
			[CallerFilePath] string sourceFilePath = "",
			[CallerLineNumber] int sourceLineNumber = 0)
		{
			return Fail(errorMessage, memberName, sourceFilePath, sourceLineNumber);
		}

		public static Exception FailFast(
			Exception error,
			[CallerMemberName] string memberName = "",
			[CallerFilePath] string sourceFilePath = "",
			[CallerLineNumber] int sourceLineNumber = 0)
		{
			return Fail(error.Message, memberName, sourceFilePath, sourceLineNumber);
		}

		private static Exception Fail(
			 string error, string memberName, string sourceFilePath, int sourceLineNumber)
		{
			StackTrace stackTrace = new StackTrace(true);

			string message =
				$"Fail {error} at\n{sourceFilePath}({sourceLineNumber}) {memberName}\n\n{stackTrace}";

			Exception exception = new InvalidOperationException(message);

			AssertOccurred?.Invoke(null, new AsserterEventArgs(exception));
			return exception;
		}
	}
}


text:
package at.ac.tuwien.infosys.events;

import io.hummer.util.Util;
import io.hummer.util.ws.EndpointReference;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPBinding.Style;
import javax.jws.soap.SOAPBinding.Use;

import org.apache.log4j.Logger;

import at.ac.tuwien.infosys.events.ws.EventSubscriptionManager;
import at.ac.tuwien.infosys.events.ws.EventSubscriptionManagerProcessor;
import at.ac.tuwien.infosys.events.ws.WSEvent;

@WebService(targetNamespace = WSEvent.NAMESPACE)
public class EventDistributorNode extends EventSubscriptionNode implements EventSubscriptionManager {

	private static final Logger LOGGER = Util.getLogger(EventDistributorNode.class);

	public EventDistributorNode(EndpointReference epr,
			EventSubscriptionManagerProcessor eventProcessor) {
		super(epr, eventProcessor);
	}

	public EventDistributorNode(EndpointReference epr) {
		super(epr);
	}

	@WebMethod(operationName="event")
	@WebResult(name = "result")
	@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.BARE)
	public void processEvent(@WebParam WSEvent event) throws Exception {
		//TODO: check for the return type
		//WSEvent event = new WSEvent();
		//Object o = event.getContent();
		LOGGER.debug(String.format("Received event '%s'.", event.getIdentifier()));
		getEventProcessor().processEvent(event);
	}

}


text:
"""
A collection of EzProxy variants.
"""

import requests
from urllib.parse import urlparse, urlunparse
import logging

class LoginError(Exception): pass

class EzProxy(requests.Session):
    """
    rewrite requests to go through an EzProxy installation,
    which is a piece of software commonly used by institutional libraries
    to give single-signon access to paywalled content.

    EzProxy is a proxy for HTTP, but it is not an HTTP proxy in the usual transparent sense.
    Instead, EzProxy rewrites URLs and hands out a magical auth cookie ('ezproxy') and then required on every request.
    The rewriting protocol is http://domain/path -> http://domain.ezproxy/path
    (this has the advantage over standard SOCKS and HTTP proxies that users don't need to tweak any settings whatsoever on their side)

    Reference: https://www.oclc.org/support/services/ezproxy/documentation.en.html
    """
    address = None

    # requests.Session defines __setstate__ and __getstate__
    # this means that on pickle() or copy() the extensions this class adds get lost
    # requests.Session uses its own invented list __attrs__ to track which attrs to use
    # One approach is to extend that set with the local attrs, e.g.
    #  https://github.com/sigmavirus24/requests-toolbelt/pull/61
    # But I am wary of doing the extension like, especially @ util.wrap():
    #  if you mix together two subclasses which both cloned __attrs__,
    #  one set of attrs is going to get lost at copy-time because instead
    #  but the good ol' super() mechanism works just fine!
    #  So even though it's more code, I override and extend __getstate__ and __setstate__
    # Bloo
    # It would be better if requests blacklisted (as in the [example](https://docs.python.org/3.4/library/pickle.html#pickle-state)) instead of whitelisted attributes:
    # then I could add attrs willy nilly and assume
    # because really, the set of attrs is the *union* of attrs across all subclasses
    def __getstate__(self):
        state = super().__getstate__()
        for attr in ["address","_logged_in","_user"]:
            if hasattr(self,attr): state[attr] = getattr(self, attr)
        return state
    def __setstate__(self, state):
        for attr in ["address","_logged_in","_user"]:
            if attr in state:
                setattr(self, attr, state[attr])
                del state[attr]
        return super().__setstate__(state)

    def __init__(self, address, *args, **kwargs):
        """
        Proxy should be the domain name EzProxy is installed on.
        See the subclasses that come with with this code for some examples.
        """
        super().__init__(*args, **kwargs)
        self.address = address
        self._logged_in = False
        self._user = None

    def login(self, barcode, last_name, url=None):
        """
        login to an EzProxy proxy using its default login address and
        its default credentials of a library barcode number + last name

        login optionally takes a url= parameter which is meant for
        seamlessly bouncing users back to their target article database
        You almost certainly do not need this, but some URLs get mapped
        via a secret per-institution(?) database to a canonical URL, so
        this parameter is supported just in case.
        # XXX maybe this is feature creep

        For sites which do not use the default, anything else listed in,
        https://www.oclc.org/support/services/ezproxy/documentation/usr.en.html
        (which includes custom CGI scripts, so *anything* is possible)
        override or otherwise don't use this method.
        """
        assert not self._logged_in

        # Log in to by POSTing to https://login.{proxy}/login

        params = {#credentials
                  # yes, the EzProxy reverses what you'd expect to be
                  # the definition of 'username' and 'password'
                  "user": barcode,
                  "pass": last_name}

        # If you use url, /login sends you to
        # https://login.<proxy>/connect?session=s${SID}N&url=${URL} which,
        # if it recognizes the site, sends you to its canonical URL
        # If you don't use URL (or if it's not recognized??) you are sent to
        # https://login.<proxy>/menu
        if url is not None:
            params['url'] = url

        # we super().request() instead of super().post() to avoid
        # recursing badly into self.request() which expects the login up
        # (super().post() helpfully calls self.request(), see, and
        #  normally this is helpful but here it gets in the way)
        r = super().request('POST',
                            self.proxify("https://login/login"), #this funny looking URL will be fixed by proxify() munges it
                            data=params)

        r.raise_for_status() #quick way to make sure we have 200 OK

        #make sure that the login process appears to have given us the magic ticket
        if "ezproxy" not in self.cookies:
            raise LoginError()

        # if everything is peachy, record who's account we're using
        self._logged_in = True
        self._user = last_name

        logging.debug("Started new EzProxy session %s" % (self,))

    def request(self, verb, url, *args, **kwargs):
        """
        Rewrite all requests going through this session to go through the library proxy.
        """
        if not self._logged_in:
            # it will 302 to the login page if you're not logged in
            # since this would be confusing when scripting (you'd end up with a 200),
            # just disallow it.
            raise RuntimeError("Must be logged in to use the library proxy")

        # TODO: implement backoff on timeouts.
        #   My first guess is that right here is a good place for it,
        #   since I'm 99% sure it's EzProxy that's tracking request rates
        #   so if we accidentally go over their limits, here is where
        #  specifics: quadratic backoff + retry (like TCP)
        #        or : rate limit (perhaps add an instance attribute) so that we, hopefully, never
        #     the latter is probably easier to program with in general, because timeouts would immediately percolate up
        #  --> requests *already does* retrials, but gives up after 3 attempts

        # rewrite the referer to use the proxy too
        # TODO: where else do have leak URLs that might be leaking?
        #       anything in self.headers, for one.. what about other cookies?
        if 'headers' in kwargs:
            if 'Referer' in kwargs['headers']:
                kwargs['headers']['Referer'] = self.proxify(kwargs['headers']['Referer'])

        return super().request(verb, self.proxify(url), *args, **kwargs)

    def send(self, *args, **kwargs):
        "hook send() purely for tracing"
        logging.debug("%r.send(*%s, **%s)" % (self, args, kwargs))
        return super().send(*args, **kwargs)

    def proxify(self, url):
        scheme, host, path, params, query, fragment = urlparse(url)
        #    Response objects returned from this Session should have all references
        #    to the proxy in headers, cookies, and html silently stripped, so that following a link
        #    received from this class with this class doesn't end up going to "http://target.proxy.proxy"
        #  But that problem is unbounded in general. Instead we detect this common case and cancel it
        if not host.endswith(self.address):
            host = host + "." + self.address  #construct the fully

        return urlunparse((scheme, host, path, params, query, fragment))

    def __str__(self):
        if self.__dict__.get('_logged_in', False):
                return "<%s@%s [session:%s]>" % (self._user, self.address, self.cookies["ezproxy"])
        else:
                return "<EzProxy @%s>" % (self.address,)

class UWProxy(EzProxy):
    def __init__(self, last_name, barcode):
        """

        Notice: UW flips the order of user/pass: name is the username and barcode is the pass. By default, EzProxy has them the other way.
        """
        super().__init__("proxy.lib.uwaterloo.ca")

        # all connections through this proxy go through a single server
        #*disable* SSL verification because the UW
        #proxy has an out of date cert or something.
        #but only if verify= is not passed
        # TODO: figure out what's going on here; what if I explicitly add UW's cert to the search path (which python-requests lets me do by setting verify to a path instead of a boolean) ?
        # (be mindful: this must happen after super init since super init sets a default value)
        self.verify = False

        # automatically login, since why would you create a proxy without logging in?
        # the only reason EzProxy doesn't is because some sites might require complicated auth dances
        # which cannot(?) be done in one step and definitely
        self.login(barcode, last_name)

class GuelphProxy(EzProxy):
    def __init__(self, barcode, last_name):
        super().__init__("subzero.lib.uoguelph.ca")
        self.login(barcode, last_name)


text:
//
//  OCMockito - MKTClassObjectMock.h
//  Copyright 2013 Jonathan M. Reid. See LICENSE.txt
//
//  Created by: Jon Reid, http://qualitycoding.org/
//  Source: https://github.com/jonreid/OCMockito
//
//  Created by: David Hart
//

#import "MKTBaseMockObject.h"

/**
    Mock object of a given class object.
 */
@interface MKTClassObjectMock : MKTBaseMockObject

+ (id)mockForClass:(Class)aClass;
- (id)initWithClass:(Class)aClass;

@end


text:
<?
$MESS ['SL_MODULE_NAME'] = "Position of the page in the navigation block";
$MESS ['SL_MODULE_DESCRIPTION'] = "Setting in the public section Position page in the navigation block";
$MESS ['SL_PARTNER_NAME'] = "SLOBEL Studio";
?>