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

<title>org.apache.cassandra.db.compaction Class Hierarchy (apache-cassandra API)</title>
<meta name="date" content="2016-04-13">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package org.apache.cassandra.db.compaction

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.apache.cassandra.db.compaction.AbstractCompactionStrategy

org.apache.cassandra.db.compaction.DateTieredCompactionStrategy

org.apache.cassandra.db.compaction.LeveledCompactionStrategy

org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy

org.apache.cassandra.db.compaction.AbstractCompactionStrategy.ScannerList (implements java.lang.AutoCloseable)

org.apache.cassandra.db.compaction.CompactionController (implements java.lang.AutoCloseable)

org.apache.cassandra.db.compaction.SSTableSplitter.SplitController

org.apache.cassandra.db.compaction.CompactionHistoryTabularData

org.apache.cassandra.db.compaction.CompactionInfo (implements java.io.Serializable)

org.apache.cassandra.db.compaction.CompactionInfo.Holder

org.apache.cassandra.db.compaction.CompactionIterator (implements org.apache.cassandra.db.partitions.UnfilteredPartitionIterator)

org.apache.cassandra.db.compaction.CompactionManager (implements org.apache.cassandra.db.compaction.CompactionManagerMBean)

org.apache.cassandra.db.compaction.CompactionStrategyManager (implements org.apache.cassandra.notifications.INotificationConsumer)

org.apache.cassandra.db.compaction.DateTieredCompactionStrategyOptions

org.apache.cassandra.db.compaction.LeveledManifest

org.apache.cassandra.db.compaction.LeveledManifest.CompactionCandidate

org.apache.cassandra.db.compaction.Scrubber (implements java.io.Closeable)

org.apache.cassandra.db.compaction.Scrubber.ScrubResult

org.apache.cassandra.db.compaction.SizeTieredCompactionStrategyOptions

org.apache.cassandra.db.compaction.SSTableSplitter

org.apache.cassandra.db.compaction.SSTableSplitter.StatsCollector (implements org.apache.cassandra.db.compaction.CompactionManager.CompactionExecutorStatsCollector)

java.lang.Throwable (implements java.io.Serializable)

java.lang.Exception

java.lang.RuntimeException

org.apache.cassandra.db.compaction.CompactionInterruptedException

org.apache.cassandra.db.compaction.Upgrader

org.apache.cassandra.db.compaction.Verifier (implements java.io.Closeable)

org.apache.cassandra.utils.WrappedRunnable (implements java.lang.Runnable)

org.apache.cassandra.db.compaction.AbstractCompactionTask

org.apache.cassandra.db.compaction.CompactionTask

org.apache.cassandra.db.compaction.LeveledCompactionTask

org.apache.cassandra.db.compaction.SSTableSplitter.SplittingCompactionTask

Interface Hierarchy

org.apache.cassandra.db.compaction.CompactionManager.CompactionExecutorStatsCollector

org.apache.cassandra.db.compaction.CompactionManagerMBean

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)

org.apache.cassandra.db.compaction.OperationType

org.apache.cassandra.db.compaction.CompactionManager.AllSSTableOpStatus

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2016 The Apache Software Foundation


text:
        {% include 'resume-hdr.html' %}

Work

            {% for job in work %} {% include 'work-block.html' %} {% endfor %}

Education

            {% for school in education %} {% include 'edu-block.html' %} {% endfor %}

Awards

            {% for award in awards %} {% include 'award-block.html' %} {% endfor %}

Skills

            // (A)dvanced (M)oderate (N)ovice
            {% for skill in skills %}

# {{skill.name}}

                {% for word in skill.keywords %} {% include 'skill-token.html' %} {% endfor %}

            {% endfor %}

Languages

                {% for language in languages %}

{{language.language}} ({{language.fluency | lower}})

                {% endfor %}

Interests

                {% for interest in interests %}

{{interest.name}} {% if interest.keywords | length %}({{interest.keywords[0]}}) {% endif %}

                {% endfor %}

Links

                {% for profile in basics.profiles %}

{{profile.url}}

                {% endfor %}

References are available upon request. See this resume at {{basics.website}}.

redpajama_set_name: RedPajamaGithub


text:
<?php

use DateTimeImmutable;
use stdClass;

use DateTime;

use function phpversion;
use const PHP_VERSION_ID;

use const PHP_VERSION;

use DateTimeInterface;

use function strpos;

use function stripos;

class Whatever
{

}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
    <corners android:radius="8dp"/>
    <solid android:color="#00ffffff" />
    <stroke android:width="1dip" android:color="#4fa5d5"/>
</shape>


text:
/** (July 2012, Erik Weitnauer)
The html-plugin will load and display an arbitrary number of html pages. To proceed to the next, the
user might either press a button on the page or a specific key. Afterwards, the page get hidden and
the plugin will wait of a specified time before it proceeds.

documentation: docs.jspsych.org
*/
(function($) {
    jsPsych.html = (function() {

        var plugin = {};

        plugin.create = function(params) {

            params = jsPsych.pluginAPI.enforceArray(params, ['pages']);

            var trials = [];

            for (var i = 0; i < params.pages.length; i++) {
                trials.push({
                    url: params.pages[i].url,
                    cont_key: params.pages[i].cont_key || params.cont_key,
                    cont_btn: params.pages[i].cont_btn || params.cont_btn,
                    check_fn: params.pages[i].check_fn || function(){ return true; },
                    force_refresh: (typeof params.force_refresh === 'undefined') ? false : params.force_refresh
                });
            }
            return trials;
        };

        plugin.trial = function(display_element, trial) {

            // if any trial variables are functions
            // this evaluates the function and replaces
            // it with the output of the function
            trial = jsPsych.pluginAPI.evaluateFunctionParameters(trial, ["check_fn"]);

            var url = trial.url;
            if (trial.force_refresh) {
                url = trial.url + "?time=" + (new Date().getTime());
            }

            display_element.load(trial.url, function() {
                var t0 = (new Date()).getTime();
                var finish = function() {
                    if (trial.check_fn && !trial.check_fn(display_element)) return;
                    if (trial.cont_key) $(document).unbind('keydown', key_listener);
                    jsPsych.data.write({
                        rt: (new Date()).getTime() - t0,
                        url: trial.url
                    });
                    display_element.empty();
                    jsPsych.finishTrial();
                };
                if (trial.cont_btn) $('#' + trial.cont_btn).click(finish);
                if (trial.cont_key) {
                    var key_listener = function(e) {
                        if (e.which == trial.cont_key) finish();
                    };
                    $(document).keydown(key_listener);
                }
            });
        };

        return plugin;
    })();
})(jQuery);


text:
package org.apache.fineract.portfolio.collateral.exception;

import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;

public class CollateralCannotBeUpdatedException extends AbstractPlatformDomainRuleException {

    /*** enum of reasons of why Loan Charge cannot be waived **/
    public static enum LOAN_COLLATERAL_CANNOT_BE_UPDATED_REASON {
        LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE;

        public String errorMessage() {
            if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) { return "This collateral cannot be updated as the loan it is associated with is not in submitted and pending approval stage"; }
            return name().toString();
        }

        public String errorCode() {
            if (name().toString().equalsIgnoreCase("LOAN_NOT_IN_SUBMITTED_AND_PENDING_APPROVAL_STAGE")) { return "error.msg.loan.collateral.associated.loan.not.in.submitted.and.pending.approval.stage"; }
            return name().toString();
        }
    }

    public CollateralCannotBeUpdatedException(final LOAN_COLLATERAL_CANNOT_BE_UPDATED_REASON reason, final Long loanCollateralId) {
        super(reason.errorCode(), reason.errorMessage(), loanCollateralId);
    }
}


text:
package kg.jl.pickerview.listener;

public interface OnItemSelectedListener {
    void onItemSelected(int index);
}


text:
package trust

import (
	"context"
	"fmt"
	"os"
	"strings"

	"github.com/docker/cli/cli"
	"github.com/docker/cli/cli/command"
	"github.com/docker/cli/cli/command/image"
	"github.com/docker/cli/cli/trust"
	"github.com/pkg/errors"
	"github.com/spf13/cobra"
	"github.com/theupdateframework/notary/client"
	"github.com/theupdateframework/notary/tuf/data"
)

type signerRemoveOptions struct {
	signer   string
	repos    []string
	forceYes bool
}

func newSignerRemoveCommand(dockerCli command.Cli) *cobra.Command {
	options := signerRemoveOptions{}
	cmd := &cobra.Command{
		Use:   "remove [OPTIONS] NAME REPOSITORY [REPOSITORY...]",
		Short: "Remove a signer",
		Args:  cli.RequiresMinArgs(2),
		RunE: func(cmd *cobra.Command, args []string) error {
			options.signer = args[0]
			options.repos = args[1:]
			return removeSigner(dockerCli, options)
		},
	}
	flags := cmd.Flags()
	flags.BoolVarP(&options.forceYes, "force", "f", false, "Do not prompt for confirmation before removing the most recent signer")
	return cmd
}

func removeSigner(cli command.Cli, options signerRemoveOptions) error {
	var errRepos []string
	for _, repo := range options.repos {
		fmt.Fprintf(cli.Out(), "Removing signer \"%s\" from %s...\n", options.signer, repo)
		if err := removeSingleSigner(cli, repo, options.signer, options.forceYes); err != nil {
			fmt.Fprintln(cli.Err(), err.Error()+"\n")
			errRepos = append(errRepos, repo)
		} else {
			fmt.Fprintf(cli.Out(), "Successfully removed %s from %s\n\n", options.signer, repo)
		}
	}
	if len(errRepos) > 0 {
		return fmt.Errorf("Error removing signer from: %s", strings.Join(errRepos, ", "))
	}
	return nil
}

func isLastSignerForReleases(roleWithSig data.Role, allRoles []client.RoleWithSignatures) (bool, error) {
	var releasesRoleWithSigs client.RoleWithSignatures
	for _, role := range allRoles {
		if role.Name == releasesRoleTUFName {
			releasesRoleWithSigs = role
			break
		}
	}
	counter := len(releasesRoleWithSigs.Signatures)
	if counter == 0 {
		return false, fmt.Errorf("All signed tags are currently revoked, use docker trust sign to fix")
	}
	for _, signature := range releasesRoleWithSigs.Signatures {
		for _, key := range roleWithSig.KeyIDs {
			if signature.KeyID == key {
				counter--
			}
		}
	}
	return counter < releasesRoleWithSigs.Threshold, nil
}

func removeSingleSigner(cli command.Cli, repoName, signerName string, forceYes bool) error {
	ctx := context.Background()
	imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, image.AuthResolver(cli), repoName)
	if err != nil {
		return err
	}

	signerDelegation := data.RoleName("targets/" + signerName)
	if signerDelegation == releasesRoleTUFName {
		return fmt.Errorf("releases is a reserved keyword and cannot be removed")
	}
	notaryRepo, err := cli.NotaryClient(imgRefAndAuth, trust.ActionsPushAndPull)
	if err != nil {
		return trust.NotaryError(imgRefAndAuth.Reference().Name(), err)
	}
	delegationRoles, err := notaryRepo.GetDelegationRoles()
	if err != nil {
		return errors.Wrapf(err, "error retrieving signers for %s", repoName)
	}
	var role data.Role
	for _, delRole := range delegationRoles {
		if delRole.Name == signerDelegation {
			role = delRole
			break
		}
	}
	if role.Name == "" {
		return fmt.Errorf("No signer %s for repository %s", signerName, repoName)
	}
	allRoles, err := notaryRepo.ListRoles()
	if err != nil {
		return err
	}
	if ok, err := isLastSignerForReleases(role, allRoles); ok && !forceYes {
		removeSigner := command.PromptForConfirmation(os.Stdin, cli.Out(), fmt.Sprintf("The signer \"%s\" signed the last released version of %s. "+
			"Removing this signer will make %s unpullable. "+
			"Are you sure you want to continue?",
			signerName, repoName, repoName,
		))

		if !removeSigner {
			fmt.Fprintf(cli.Out(), "\nAborting action.\n")
			return nil
		}
	} else if err != nil {
		return err
	}
	if err = notaryRepo.RemoveDelegationKeys(releasesRoleTUFName, role.KeyIDs); err != nil {
		return err
	}
	if err = notaryRepo.RemoveDelegationRole(signerDelegation); err != nil {
		return err
	}
	if err = notaryRepo.Publish(); err != nil {
		return err
	}
	return nil
}


text:
#ifndef _JIMI_CONFIG_CONFIG_COMM_H_
#define _JIMI_CONFIG_CONFIG_COMM_H_

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#if defined(__linux__) || defined(__LINUX__)
//
#elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
//
#elif defined(__CYGWIN__)
//
#elif defined(_WIN32) || defined(_MSC_VER) || defined(__ICL) || defined(__INTEL_COMPILER)
//
#else
//
#endif

#endif  /* !_JIMI_CONFIG_CONFIG_COMM_H_ */


text:
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "mkdir-parents.h"
#include "master-service.h"
#include "mail-index-modseq.h"
#include "mail-index-alloc-cache.h"
#include "mailbox-log.h"
#include "mailbox-list-private.h"
#include "dbox-mail.h"
#include "dbox-save.h"
#include "mdbox-map.h"
#include "mdbox-file.h"
#include "mdbox-sync.h"
#include "mdbox-storage-rebuild.h"
#include "mdbox-storage.h"

extern struct mail_storage mdbox_storage;
extern struct mailbox mdbox_mailbox;

static struct mail_storage *mdbox_storage_alloc(void)
{
	struct mdbox_storage *storage;
	pool_t pool;

	pool = pool_alloconly_create("mdbox storage", 2048);
	storage = p_new(pool, struct mdbox_storage, 1);
	storage->storage.v = mdbox_dbox_storage_vfuncs;
	storage->storage.storage = mdbox_storage;
	storage->storage.storage.pool = pool;
	return &storage->storage.storage;
}

int mdbox_storage_create(struct mail_storage *_storage,
			 struct mail_namespace *ns, const char **error_r)
{
	struct mdbox_storage *storage = (struct mdbox_storage *)_storage;
	const char *dir;

	storage->set = mail_storage_get_driver_settings(_storage);
	storage->preallocate_space = storage->set->mdbox_preallocate_space;

	if (*ns->list->set.mailbox_dir_name == '\0') {
		*error_r = "mdbox: MAILBOXDIR must not be empty";
		return -1;
	}

	_storage->unique_root_dir =
		p_strdup(_storage->pool, ns->list->set.root_dir);

	dir = mailbox_list_get_root_forced(ns->list, MAILBOX_LIST_PATH_TYPE_DIR);
	storage->storage_dir = p_strconcat(_storage->pool, dir,
					   "/"MDBOX_GLOBAL_DIR_NAME, NULL);
	storage->alt_storage_dir = p_strconcat(_storage->pool,
					       ns->list->set.alt_dir,
					       "/"MDBOX_GLOBAL_DIR_NAME, NULL);
	i_array_init(&storage->open_files, 64);

	storage->map = mdbox_map_init(storage, ns->list);
	return dbox_storage_create(_storage, ns, error_r);
}

void mdbox_storage_destroy(struct mail_storage *_storage)
{
	struct mdbox_storage *storage = (struct mdbox_storage *)_storage;

	mdbox_files_free(storage);
	mdbox_map_deinit(&storage->map);
	if (storage->to_close_unused_files != NULL)
		timeout_remove(&storage->to_close_unused_files);

	if (array_is_created(&storage->move_from_alt_map_uids))
		array_free(&storage->move_from_alt_map_uids);
	if (array_is_created(&storage->move_to_alt_map_uids))
		array_free(&storage->move_to_alt_map_uids);
	array_free(&storage->open_files);
	dbox_storage_destroy(_storage);
}

static const char *
mdbox_storage_find_root_dir(const struct mail_namespace *ns)
{
	bool debug = ns->mail_set->mail_debug;
	const char *home, *path;

	if (ns->owner != NULL &&
	    mail_user_get_home(ns->owner, &home) > 0) {
		path = t_strconcat(home, "/mdbox", NULL);
		if (access(path, R_OK|W_OK|X_OK) == 0) {
			if (debug)
				i_debug("mdbox: root exists (%s)", path);
			return path;
		}
		if (debug)
			i_debug("mdbox: access(%s, rwx): failed: %m", path);
	}
	return NULL;
}

static bool mdbox_storage_autodetect(const struct mail_namespace *ns,
				     struct mailbox_list_settings *set)
{
	bool debug = ns->mail_set->mail_debug;
	struct stat st;
	const char *path, *root_dir;

	if (set->root_dir != NULL)
		root_dir = set->root_dir;
	else {
		root_dir = mdbox_storage_find_root_dir(ns);
		if (root_dir == NULL) {
			if (debug)
				i_debug("mdbox: couldn't find root dir");
			return FALSE;
		}
	}

	path = t_strconcat(root_dir, "/"MDBOX_GLOBAL_DIR_NAME, NULL);
	if (stat(path, &st) < 0) {
		if (debug)
			i_debug("mdbox autodetect: stat(%s) failed: %m", path);
		return FALSE;
	}

	if (!S_ISDIR(st.st_mode)) {
		if (debug)
			i_debug("mdbox autodetect: %s not a directory", path);
		return FALSE;
	}

	set->root_dir = root_dir;
	dbox_storage_get_list_settings(ns, set);
	return TRUE;
}

static struct mailbox *
mdbox_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
		    const char *vname, enum mailbox_flags flags)
{
	struct mdbox_mailbox *mbox;
	struct index_mailbox_context *ibox;
	pool_t pool;

	/* dbox can't work without index files */
	flags &= ~MAILBOX_FLAG_NO_INDEX_FILES;

	pool = pool_alloconly_create("mdbox mailbox", 1024*3);
	mbox = p_new(pool, struct mdbox_mailbox, 1);
	mbox->box = mdbox_mailbox;
	mbox->box.pool = pool;
	mbox->box.storage = storage;
	mbox->box.list = list;
	mbox->box.mail_vfuncs = &mdbox_mail_vfuncs;

	index_storage_mailbox_alloc(&mbox->box, vname, flags, MAIL_INDEX_PREFIX);

	ibox = INDEX_STORAGE_CONTEXT(&mbox->box);
	ibox->index_flags |= MAIL_INDEX_OPEN_FLAG_KEEP_BACKUPS |
		MAIL_INDEX_OPEN_FLAG_NEVER_IN_MEMORY;

	mbox->storage = (struct mdbox_storage *)storage;
	return &mbox->box;
}

int mdbox_mailbox_open(struct mailbox *box)
{
	struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box;

	if (dbox_mailbox_open(box) < 0)
		return -1;

	mbox->ext_id =
		mail_index_ext_register(mbox->box.index, "mdbox", 0,
					sizeof(struct mdbox_mail_index_record),
					sizeof(uint32_t));
	mbox->hdr_ext_id =
		mail_index_ext_register(mbox->box.index, "mdbox-hdr",
					sizeof(struct mdbox_index_header), 0, 0);
	mbox->guid_ext_id =
		mail_index_ext_register(mbox->box.index, "guid",
					0, GUID_128_SIZE, 1);
	return 0;
}

static void mdbox_mailbox_close(struct mailbox *box)
{
	struct mdbox_storage *mstorage = (struct mdbox_storage *)box->storage;

	if (mstorage->corrupted && !mstorage->rebuilding_storage)
		(void)mdbox_storage_rebuild(mstorage);

	index_storage_mailbox_close(box);
}

int mdbox_read_header(struct mdbox_mailbox *mbox,
		      struct mdbox_index_header *hdr, bool *need_resize_r)
{
	const void *data;
	size_t data_size;

	i_assert(mbox->box.opened);

	mail_index_get_header_ext(mbox->box.view, mbox->hdr_ext_id,
				  &data, &data_size);
	if (data_size < MDBOX_INDEX_HEADER_MIN_SIZE &&
	    (!mbox->creating || data_size != 0)) {
		mail_storage_set_critical(&mbox->storage->storage.storage,
			"mdbox %s: Invalid dbox header size: %"PRIuSIZE_T,
			mailbox_get_path(&mbox->box), data_size);
		mdbox_storage_set_corrupted(mbox->storage);
		return -1;
	}
	memset(hdr, 0, sizeof(*hdr));
	memcpy(hdr, data, I_MIN(data_size, sizeof(*hdr)));
	*need_resize_r = data_size < sizeof(*hdr);
	return 0;
}

void mdbox_update_header(struct mdbox_mailbox *mbox,
			 struct mail_index_transaction *trans,
			 const struct mailbox_update *update)
{
	struct mdbox_index_header hdr, new_hdr;
	bool need_resize;

	if (mdbox_read_header(mbox, &hdr, &need_resize) < 0) {
		memset(&hdr, 0, sizeof(hdr));
		need_resize = TRUE;
	}

	new_hdr = hdr;

	if (update != NULL && !guid_128_is_empty(update->mailbox_guid)) {
		memcpy(new_hdr.mailbox_guid, update->mailbox_guid,
		       sizeof(new_hdr.mailbox_guid));
	} else if (guid_128_is_empty(new_hdr.mailbox_guid)) {
		guid_128_generate(new_hdr.mailbox_guid);
	}

	new_hdr.map_uid_validity =
		mdbox_map_get_uid_validity(mbox->storage->map);
	if (need_resize) {
		mail_index_ext_resize_hdr(trans, mbox->hdr_ext_id,
					  sizeof(new_hdr));
	}
	if (memcmp(&hdr, &new_hdr, sizeof(hdr)) != 0) {
		mail_index_update_header_ext(trans, mbox->hdr_ext_id, 0,
					     &new_hdr, sizeof(new_hdr));
	}
}

static int ATTR_NULL(2, 3)
mdbox_write_index_header(struct mailbox *box,
			 const struct mailbox_update *update,
			 struct mail_index_transaction *trans)
{
	struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box;
	struct mail_index_transaction *new_trans = NULL;
	struct mail_index_view *view;
	const struct mail_index_header *hdr;
	uint32_t uid_validity, uid_next;

	if (mdbox_map_open_or_create(mbox->storage->map) < 0)
		return -1;

	if (trans == NULL) {
		new_trans = mail_index_transaction_begin(box->view, 0);
		trans = new_trans;
	}

	view = mail_index_view_open(box->index);
	hdr = mail_index_get_header(view);
	uid_validity = hdr->uid_validity;
	if (update != NULL && update->uid_validity != 0)
		uid_validity = update->uid_validity;
	else if (uid_validity == 0) {
		/* set uidvalidity */
		uid_validity = dbox_get_uidvalidity_next(box->list);
	}

	if (hdr->uid_validity != uid_validity) {
		mail_index_update_header(trans,
			offsetof(struct mail_index_header, uid_validity),
			&uid_validity, sizeof(uid_validity), TRUE);
	}
	if (update != NULL && hdr->next_uid < update->min_next_uid) {
		uid_next = update->min_next_uid;
		mail_index_update_header(trans,
			offsetof(struct mail_index_header, next_uid),
			&uid_next, sizeof(uid_next), TRUE);
	}
	if (update != NULL && update->min_first_recent_uid != 0 &&
	    hdr->first_recent_uid < update->min_first_recent_uid) {
		uint32_t first_recent_uid = update->min_first_recent_uid;

		mail_index_update_header(trans,
			offsetof(struct mail_index_header, first_recent_uid),
			&first_recent_uid, sizeof(first_recent_uid), FALSE);
	}
	if (update != NULL && update->min_highest_modseq != 0 &&
	    mail_index_modseq_get_highest(view) < update->min_highest_modseq) {
		mail_index_modseq_enable(box->index);
		mail_index_update_highest_modseq(trans,
						 update->min_highest_modseq);
	}
	mail_index_view_close(&view);

	mdbox_update_header(mbox, trans, update);
	if (new_trans != NULL) {
		if (mail_index_transaction_commit(&new_trans) < 0) {
			mailbox_set_index_error(box);
			return -1;
		}
	}
	return 0;
}

int mdbox_mailbox_create_indexes(struct mailbox *box,
				 const struct mailbox_update *update,
				 struct mail_index_transaction *trans)
{
	struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box;
	int ret;

	mbox->creating = TRUE;
	ret = mdbox_write_index_header(box, update, trans);
	mbox->creating = FALSE;
	return ret;
}

void mdbox_storage_set_corrupted(struct mdbox_storage *storage)
{
	if (storage->corrupted) {
		/* already set it corrupted (possibly recursing back here) */
		return;
	}

	storage->corrupted = TRUE;
	storage->corrupted_rebuild_count = (uint32_t)-1;

	if (mdbox_map_open(storage->map) > 0 &&
	    mdbox_map_refresh(storage->map) == 0) {
		storage->corrupted_rebuild_count =
			mdbox_map_get_rebuild_count(storage->map);
	}
}

static const char *
mdbox_get_attachment_path_suffix(struct dbox_file *file ATTR_UNUSED)
{
	return "";
}

void mdbox_set_mailbox_corrupted(struct mailbox *box)
{
	struct mdbox_storage *mstorage = (struct mdbox_storage *)box->storage;

	mdbox_storage_set_corrupted(mstorage);
}

void mdbox_set_file_corrupted(struct dbox_file *file)
{
	struct mdbox_storage *mstorage = (struct mdbox_storage *)file->storage;

	mdbox_storage_set_corrupted(mstorage);
}

static int
mdbox_mailbox_get_guid(struct mdbox_mailbox *mbox, guid_128_t guid_r)
{
	const struct mail_index_header *idx_hdr;
	struct mdbox_index_header hdr;
	bool need_resize;
	int ret = 0;

	i_assert(!mbox->creating);

	/* there's a race condition between mkdir and getting the mailbox GUID.
	   normally this is handled by mdbox syncing, but GUID can be looked up
	   without syncing. when mbox->creating=TRUE, the errors are hidden
	   and we'll simply finish the mailbox creation */
	idx_hdr = mail_index_get_header(mbox->box.view);
	mbox->creating = idx_hdr->uid_validity == 0 && idx_hdr->next_uid == 1;
	if (mdbox_read_header(mbox, &hdr, &need_resize) < 0)
		memset(&hdr, 0, sizeof(hdr));

	if (guid_128_is_empty(hdr.mailbox_guid)) {
		/* regenerate it */
		if (mdbox_write_index_header(&mbox->box, NULL, NULL) < 0 ||
		    mdbox_read_header(mbox, &hdr, &need_resize) < 0)
			ret = -1;
	}
	if (ret == 0)
		memcpy(guid_r, hdr.mailbox_guid, GUID_128_SIZE);
	mbox->creating = FALSE;
	return ret;
}

static int
mdbox_mailbox_get_metadata(struct mailbox *box,
			   enum mailbox_metadata_items items,
			   struct mailbox_metadata *metadata_r)
{
	struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box;

	if (index_mailbox_get_metadata(box, items, metadata_r) < 0)
		return -1;
	if ((items & MAILBOX_METADATA_GUID) != 0) {
		if (mdbox_mailbox_get_guid(mbox, metadata_r->guid) < 0)
			return -1;
	}
	return 0;
}

static int
mdbox_mailbox_update(struct mailbox *box, const struct mailbox_update *update)
{
	if (!box->opened) {
		if (mailbox_open(box) < 0)
			return -1;
	}
	if (mdbox_write_index_header(box, update, NULL) < 0)
		return -1;
	return index_storage_mailbox_update_common(box, update);
}

struct mail_storage mdbox_storage = {
	.name = MDBOX_STORAGE_NAME,
	.class_flags = MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT |
		MAIL_STORAGE_CLASS_FLAG_HAVE_MAIL_GUIDS |
		MAIL_STORAGE_CLASS_FLAG_HAVE_MAIL_SAVE_GUIDS |
		MAIL_STORAGE_CLASS_FLAG_BINARY_DATA,

	.v = {
                mdbox_get_setting_parser_info,
		mdbox_storage_alloc,
		mdbox_storage_create,
		mdbox_storage_destroy,
		NULL,
		dbox_storage_get_list_settings,
		mdbox_storage_autodetect,
		mdbox_mailbox_alloc,
		mdbox_purge
	}
};

struct mailbox mdbox_mailbox = {
	.v = {
		index_storage_is_readonly,
		index_storage_mailbox_enable,
		index_storage_mailbox_exists,
		mdbox_mailbox_open,
		mdbox_mailbox_close,
		index_storage_mailbox_free,
		dbox_mailbox_create,
		mdbox_mailbox_update,
		index_storage_mailbox_delete,
		index_storage_mailbox_rename,
		index_storage_get_status,
		mdbox_mailbox_get_metadata,
		index_storage_set_subscribed,
		index_storage_attribute_set,
		index_storage_attribute_get,
		index_storage_attribute_iter_init,
		index_storage_attribute_iter_next,
		index_storage_attribute_iter_deinit,
		index_storage_list_index_has_changed,
		index_storage_list_index_update_sync,
		mdbox_storage_sync_init,
		index_mailbox_sync_next,
		index_mailbox_sync_deinit,
		NULL,
		dbox_notify_changes,
		index_transaction_begin,
		index_transaction_commit,
		index_transaction_rollback,
		NULL,
		dbox_mail_alloc,
		index_storage_search_init,
		index_storage_search_deinit,
		index_storage_search_next_nonblock,
		index_storage_search_next_update_seq,
		mdbox_save_alloc,
		mdbox_save_begin,
		dbox_save_continue,
		mdbox_save_finish,
		mdbox_save_cancel,
		mdbox_copy,
		mdbox_transaction_save_commit_pre,
		mdbox_transaction_save_commit_post,
		mdbox_transaction_save_rollback,
		index_storage_is_inconsistent
	}
};

struct dbox_storage_vfuncs mdbox_dbox_storage_vfuncs = {
	mdbox_file_unrefed,
	mdbox_file_create_fd,
	mdbox_mail_open,
	mdbox_mailbox_create_indexes,
	mdbox_get_attachment_path_suffix,
	mdbox_set_mailbox_corrupted,
	mdbox_set_file_corrupted
};


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.11.30 at 08:24:17 PM JST
//

package eu.datex2.schema._2_0rc1._2_0;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for GroupOfNonOrderedLocations complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="GroupOfNonOrderedLocations">
 *   <complexContent>
 *     <extension base="{http://datex2.eu/schema/2_0RC1/2_0}GroupOfLocations">
 *       <sequence>
 *         <element name="locationContainedInGroup" type="{http://datex2.eu/schema/2_0RC1/2_0}Location" maxOccurs="unbounded"/>
 *         <element name="groupOfNonOrderedLocationsExtension" type="{http://datex2.eu/schema/2_0RC1/2_0}ExtensionType" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GroupOfNonOrderedLocations", propOrder = {
    "locationContainedInGroup",
    "groupOfNonOrderedLocationsExtension"
})
public class GroupOfNonOrderedLocations
    extends GroupOfLocations
{

    @XmlElement(required = true)
    protected List<Location> locationContainedInGroup;
    protected ExtensionType groupOfNonOrderedLocationsExtension;

    /**
     * Gets the value of the locationContainedInGroup property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the locationContainedInGroup property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getLocationContainedInGroup().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Location }
     *
     *
     */
    public List<Location> getLocationContainedInGroup() {
        if (locationContainedInGroup == null) {
            locationContainedInGroup = new ArrayList<Location>();
        }
        return this.locationContainedInGroup;
    }

    /**
     * Gets the value of the groupOfNonOrderedLocationsExtension property.
     *
     * @return
     *     possible object is
     *     {@link ExtensionType }
     *
     */
    public ExtensionType getGroupOfNonOrderedLocationsExtension() {
        return groupOfNonOrderedLocationsExtension;
    }

    /**
     * Sets the value of the groupOfNonOrderedLocationsExtension property.
     *
     * @param value
     *     allowed object is
     *     {@link ExtensionType }
     *
     */
    public void setGroupOfNonOrderedLocationsExtension(ExtensionType value) {
        this.groupOfNonOrderedLocationsExtension = value;
    }

}


text:
package net.bull.javamelody;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.bull.javamelody.internal.model.ProcessInformations;
import net.bull.javamelody.internal.model.RemoteCollector;
import net.bull.javamelody.internal.web.html.HtmlProcessInformationsReport;
import net.bull.javamelody.internal.web.pdf.PdfOtherReport;
import net.bull.javamelody.swing.MButton;
import net.bull.javamelody.swing.MHyperLink;
import net.bull.javamelody.swing.Utilities;
import net.bull.javamelody.swing.table.MTable;
import net.bull.javamelody.swing.table.MTableScrollPane;

/**
 * Panel de la liste des process.
 * @author Emeric Vernat
 */
class ProcessInformationsPanel extends MelodyPanel {
	private static final long serialVersionUID = 1L;

	@SuppressWarnings("all")
	private Map<String, List<ProcessInformations>> processInformationsByTitle;

	ProcessInformationsPanel(RemoteCollector remoteCollector) throws IOException {
		super(remoteCollector);

		refresh();
	}

	final void refresh() throws IOException {
		removeAll();

		this.processInformationsByTitle = getRemoteCollector().collectProcessInformations();

		setName(getString("Processus"));

		add(createScrollPanes(), BorderLayout.CENTER);

		add(createButtonsPanel(), BorderLayout.SOUTH);
	}

	private JPanel createScrollPanes() {
		final JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		panel.setOpaque(false);
		for (final Map.Entry<String, List<ProcessInformations>> entry : processInformationsByTitle
				.entrySet()) {
			final String title;
			if (processInformationsByTitle.size() == 1) {
				title = getString("Processus");
			} else {
				title = entry.getKey();
			}
			final List<ProcessInformations> processInformationsList = entry.getValue();
			final boolean windows = HtmlProcessInformationsReport
					.isWindowsProcessList(processInformationsList);
			final MTableScrollPane<ProcessInformations> tableScrollPane = new MTableScrollPane<>();
			final MTable<ProcessInformations> table = tableScrollPane.getTable();
			table.addColumn("user", getString("Utilisateur"));
			table.addColumn("pid", getString("PID"));
			if (!windows) {
				table.addColumn("cpuPercentage", getString("cpu"));
				table.addColumn("memPercentage", getString("mem"));
			}
			table.addColumn("vsz", getString("vsz"));
			if (!windows) {
				table.addColumn("rss", getString("rss"));
				table.addColumn("tty", getString("tty"));
				table.addColumn("stat", getString("stat"));
				table.addColumn("start", getString("start"));
			}
			table.addColumn("cpuTime", getString("cpuTime"));
			table.addColumn("command", getString("command"));

			table.setList(processInformationsList);

			final JLabel titleLabel = Utilities.createParagraphTitle(title, "processes.png");
			panel.add(titleLabel);
			panel.add(tableScrollPane);

			if (!windows) {
				final MHyperLink hyperLink = new MHyperLink(" ps command reference",
						"http://en.wikipedia.org/wiki/Ps_(Unix)");
				panel.add(hyperLink);
			}
		}

		for (final Component component : panel.getComponents()) {
			((JComponent) component).setAlignmentX(Component.LEFT_ALIGNMENT);
		}
		return panel;
	}

	private JPanel createButtonsPanel() {
		final MButton pdfButton = createPdfButton();
		pdfButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					actionPdf();
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});
		final Serializable serializable;
		if (processInformationsByTitle.size() == 1) {
			serializable = (Serializable) processInformationsByTitle.values().iterator().next();
		} else {
			serializable = (Serializable) processInformationsByTitle;
		}
		final MButton xmlJsonButton = createXmlJsonButton(serializable);

		final MButton refreshButton = createRefreshButton();
		refreshButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					refresh();
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});

		return Utilities.createButtonsPanel(refreshButton, pdfButton, xmlJsonButton);
	}

	final void actionPdf() throws IOException {
		final File tempFile = createTempFileForPdf();
		final PdfOtherReport pdfOtherReport = createPdfOtherReport(tempFile);
		try {
			pdfOtherReport.writeProcessInformations(processInformationsByTitle);
		} finally {
			pdfOtherReport.close();
		}
		Desktop.getDesktop().open(tempFile);
	}
}


text:
<?php

namespace Guzzle\Aws\ProductAdvertising\Command;

use Guzzle\Aws\ProductAdvertising\Command\AbstractCommand;
use Guzzle\Aws\ProductAdvertising\Model\Item;

/**
 * @guzzle ItemId required="true"
 * @guzzle SearchIndex type="string" default="All"
 * @guzzle IdType type="enum" values="ASIN,SKU,UPC,EAN,ISBN" required="true" default="ASIN"
 * @guzzle ResponseGroup default="Small" type="string"
 */
class ItemLookup extends AbstractCommand
{
    const CONDITION_NEW         = 'New';
    const CONDITION_USED        = 'Used';
    const CONDITION_COLLECTIBLE = 'Collectible';
    const CONDITION_REFURBISHED = 'Refurbished';
    const CONDITION_ALL         = 'All';

    protected function build()
    {
        parent::build();

        $query = $this->request->getQuery();

        $query->set('Operation', 'ItemLookup')
              ->set('ItemId', $this->get('ItemId'))
              ->set('IdType', $this->get('IdType'))
              ->set('SearchIndex', $this->get('SearchIndex'));

        if ($query->get('IdType') == 'ISBN' && !$query->hasKey('SearchIndex')) {
            throw new \InvalidArgumentException('If IdType is ISBN, SearchIndex must be set');
        }
    }

    public function setCondition($condition)
    {
        $this->set('Condition', (string) $condition);
        return $this;
    }

    public function setItemId($id)
    {
        $this->set('ItemId', $id);
        return $this;
    }

    public function setIdType($idType)
    {
        $this->set('IdType', (string) $idType);
        return $this;
    }

    public function setRelationshipType($type)
    {
        $this->set('RelationshipType', $type);
        return $this;
    }

    public function setSearchIndex($index)
    {
        $this->set('SearchIndex', $index);
        return $this;
    }

    public function process()
    {
        parent::process();

        // ItemLookup response should never contain more than one Item element
        if ($this->result && count($this->result->Items->Item) == 1) {
            $item = new Item($this->result->Items->Item);
            $this->result = $item;
        } else {
            $this->result = null;
        }
    }
}


text:
module NodeHash
  CONTENT_ROOT = '__content__'.freeze

  def insert_node_hash_into_parent(hash, name, node_hash)
    case hash[name]
      when Array then
        hash[name] << node_hash
      when Hash then
        hash[name] = [hash[name], node_hash]
      when nil then
        hash[name] = node_hash
    end
  end

  def handle_child_element(child, node_hash)
    if child.element?
      child.to_hash(node_hash)
    elsif child.text? || child.cdata?
      node_hash[CONTENT_ROOT] ||= ''
      node_hash[CONTENT_ROOT] << child.content
    end
  end

  def remove_blank_content_node(node_hash)
    if node_hash.length > 1 && node_hash[CONTENT_ROOT].blank?
      node_hash.delete(CONTENT_ROOT)
    end
  end
end


text:
using System;
using System.Collections.Generic;
using CloneExtensions.UnitTests.Base;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace CloneExtensions.UnitTests
{
    [TestClass]
    public class ComplexTypeTests : TestBase
    {
        [TestMethod]
        public void GetClone_Class_Cloned()
        {
            var source = new SimpleClass() { Property = 10, _field = 3 };
            var target = CloneFactory.GetClone(source);
            Assert.AreEqual(source.Property, target.Property);
            Assert.AreEqual(source._field, target._field);
        }

        [TestMethod]
        public void GetClone_Struct_Cloned()
        {
            var source = new SimpleStruct() { Property = 10, _field = 3 };
            var target = CloneFactory.GetClone(source);

        }

        [TestMethod]
        public void GetClone_SameTypepProperty_Cloned()
        {
            var source = new SelfReferencedClass { Value = new SelfReferencedClass() };
            var target = CloneFactory.GetClone(source);
            Assert.IsNotNull(target.Value);
            Assert.IsNull(target.Value.Value);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void GetClone_AbstractClassInitializerNotSpecified_InvalidOperationExceptionThrown()
        {
            var source = (AbstractClass)new DerivedClass() { AbstractProperty = 10 };
            var target = CloneFactory.GetClone(source);
        }

        [TestMethod]
        public void GetCLone_AbstractClassInitializerSpecified_InstanceCloned()
        {
            var source = (AbstractClass)new DerivedClass() { AbstractProperty = 10 };
            var initializers = new Dictionary<Type, Func<object, object>>() {
                { typeof(AbstractClass), (s) => new DerivedClass() }
            };
            var target = CloneFactory.GetClone(source, initializers);
            Assert.AreEqual(source.AbstractProperty, target.AbstractProperty);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void GetClone_InterfaceInitializerNotSpecified_InvalidOperationExceptionThrown()
        {
            IInterface source = new DerivedClass() { InterfaceProperty = 10 };
            var target = CloneFactory.GetClone(source);
        }

        [TestMethod]
        public void GetClone_InterfaceInitializerSpecified_InstanceCloned()
        {
            IInterface source = new DerivedClass() { InterfaceProperty = 10};
            var initializers = new Dictionary<Type, Func<object, object>>() {
                { typeof(IInterface), (s) => new DerivedClass() }
            };
            var target = CloneFactory.GetClone(source, initializers);

            Assert.AreNotSame(source, target);
            Assert.AreEqual(source.InterfaceProperty, target.InterfaceProperty);
        }

        [TestMethod]
        public void GetClone_CircularDependency_ItemsClonedCorrectly()
        {
            CircularReference1 one = new CircularReference1();
            CircularReference2 two = new CircularReference2();
            one.First = two;
            one.Second = two;
            two.Other = one;

            var target = CloneFactory.GetClone(one);

            Assert.AreSame(target.First, target.Second, "Are the same");
        }

        [TestMethod]
        public void GetClone_DerivedTypeWithShadowedProperty_ClonnedProperly()
        {
            DerivedClassOne source = new DerivedClassOne()
            {
                MyField = 1,
                Property = 1,
                VirtualProperty = 2,
                VirtualProperty2 = 3,
                AbstractProperty = 4,
                VirtualProperty3 = "test1"
            };

            Assert.AreEqual(2, ((BaseClassOne)source).VirtualProperty);
            Assert.AreEqual(3, ((BaseClassOne)source).VirtualProperty2);
            Assert.AreEqual(4, ((BaseClassOne)source).AbstractProperty);
            Assert.AreEqual("test1", ((BaseClassOne)source).VirtualProperty3);

            ((BaseClassOne) source).MyField = 2;
            ((BaseClassOne)source).Property = 5;
            ((BaseClassOne)source).VirtualProperty = 6;
            ((BaseClassOne)source).VirtualProperty2 = 7;
            ((BaseClassOne)source).AbstractProperty = 8;
            ((BaseClassOne)source).VirtualProperty3 = "test2";

            Assert.AreEqual(1, source.MyField);
            Assert.AreEqual(2, ((BaseClassOne)source).MyField);

            Assert.AreEqual(1, source.Property);
            Assert.AreEqual(5, ((BaseClassOne)source).Property);

            Assert.AreEqual(6, source.VirtualProperty);
            Assert.AreEqual(6, ((BaseClassOne)source).VirtualProperty);

            Assert.AreEqual(7, source.VirtualProperty2);
            Assert.AreEqual(7, ((BaseClassOne)source).VirtualProperty2);

            Assert.AreEqual(8, source.AbstractProperty);
            Assert.AreEqual(8, ((BaseClassOne)source).AbstractProperty);

            Assert.AreEqual("test2", source.VirtualProperty3);
            Assert.AreEqual("test2", ((BaseClassOne)source).VirtualProperty3);

            var target = CloneFactory.GetClone(source);

            Assert.AreEqual(1, target.MyField);
            Assert.AreEqual(2, ((BaseClassOne)target).MyField);

            Assert.AreEqual(1, target.Property);
            Assert.AreEqual(5, ((BaseClassOne)target).Property);

            Assert.AreEqual(6, target.VirtualProperty);
            Assert.AreEqual(6, ((BaseClassOne)target).VirtualProperty);

            Assert.AreEqual(7, target.VirtualProperty2);
            Assert.AreEqual(7, ((BaseClassOne)target).VirtualProperty2);

            Assert.AreEqual(8, target.AbstractProperty);
            Assert.AreEqual(8, ((BaseClassOne)target).AbstractProperty);

            Assert.AreEqual("test2", target.VirtualProperty3);
            Assert.AreEqual("test2", ((BaseClassOne)target).VirtualProperty3);
        }

        [TestMethod]
        public void GetClone_DerivedTypeWithShadowedProperty_ClonnedProperly2()
        {
            D source = new D()
            {
                Foo = "D"
            };

            ((C)source).Foo = "C";
            ((B)source).Foo = "B";
            ((A)source).Foo = "A";

            Assert.AreEqual("C", source.Foo);
            Assert.AreEqual("C", ((C)source).Foo);
            Assert.AreEqual("A", ((B)source).Foo);
            Assert.AreEqual("A", ((A)source).Foo);

            var target = source.GetClone();

            Assert.AreEqual("C", target.Foo);
            Assert.AreEqual("C", ((C)target).Foo);
            Assert.AreEqual("A", ((B)target).Foo);
            Assert.AreEqual("A", ((A)target).Foo);
        }

        struct SimpleStruct
        {
            public int _field;
            public int Property { get; set; }
        }

        class SimpleClass
        {
            public int _field;
            public int Property { get; set; }
        }

        class SelfReferencedClass
        {
            public SelfReferencedClass Value { get; set; }
        }

        interface IInterface
        {
            int InterfaceProperty { get; set; }
        }

        abstract class AbstractClass
        {
            public abstract int AbstractProperty { get; set; }
        }

        class DerivedClass : AbstractClass, IInterface
        {
            public override int AbstractProperty { get; set; }

            public int InterfaceProperty { get; set; }
        }

        class CircularReference1
        {
            public CircularReference2 First { get;set; }

            public CircularReference2 Second { get; set; }
        }

        class CircularReference2
        {
            public CircularReference1 Other { get;set; }
        }

        abstract class BaseClassOne : IInterface
        {
            public int MyField;

            public int Property { get; set; }
            virtual public int VirtualProperty { get; set; }
            abstract public int AbstractProperty { get; set; }
            virtual public int VirtualProperty2 { get; set; }

            virtual public string VirtualProperty3
            {
                get { return _virtualProperty; }
                set { _virtualProperty = string.Empty; }
            }

            public int InterfaceProperty { get; set; }

            private string _virtualProperty;
        }

        class DerivedClassOne : BaseClassOne
        {
            public new int MyField;

            public new int Property { get; set; }
            public override int AbstractProperty { get; set; }
            public override int VirtualProperty { get; set; }
            // use the default implementation for VirtualProperty2
            public override string VirtualProperty3 { get; set; }
        }

        public class A
        {
            public virtual string Foo { get; set; }
        }

        public class B : A
        {
            public override string Foo { get; set; }
        }

        public class C : B
        {
            public virtual new string Foo { get; set; }
        }

        public class D : C
        {
            public override string Foo { get; set; }
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.OS;
using RealWorldRx.Objects.ViewModels;
using Android.Support.V7.Widget;
using RealWorldRx.Android.Ui.Adapters;
using System.Reactive.Linq;
using System.Reactive.Concurrency;
using System.Threading;
using Android.App;

namespace RealWorldRx.Android.Ui.Activities
{
    [Activity(Label = "TopStoryActivity")]
    public class TopStoryActivity : BaseActivity<TopStoryViewModel>
    {
        private RecyclerView topStoryRecyclerView;
        private TopStoryAdapter topStoryAdapter;

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.top_story_layout);

            topStoryRecyclerView = FindViewById<RecyclerView>(Resource.Id.topStoryRecyclerView);
            topStoryAdapter = new TopStoryAdapter(this);
            topStoryRecyclerView.SetAdapter(topStoryAdapter);
            topStoryRecyclerView.SetLayoutManager(new LinearLayoutManager(this));

            viewModel.Outputs.StoryEnvelope
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(x => topStoryAdapter.TakeTopStories(x.Stories));
        }
    }
}


text:
package main.java.de.c4.view;

import java.awt.AWTException;
import java.awt.Image;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ButtonGroup;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButtonMenuItem;

import com.esotericsoftware.minlog.Log;

import main.java.de.c4.model.messages.ContactList;
import main.java.de.c4.model.messages.EOnlineState;

public class ChatTrayIcon extends TrayIcon implements ActionListener{
	private static final String BTN_QUIT = "qui";
	private static final String BTN_OPEN = "ope";
	private static final String STATE_ONLINE = "on";
	private static final String STATE_OFFLINE = "off";
	private static final String STATE_AFK = "afk";
	private static final String STATE_DND = "dnd";
	private final JPopupMenu popup = new JPopupMenu();
	private JMenu stateItem;
	private final ContactListFrame frame;
	private JRadioButtonMenuItem onlineStateRadio;
	private JRadioButtonMenuItem offlineStateRadio;
	private JRadioButtonMenuItem afkStateRadio;
	private JRadioButtonMenuItem dndStateRadio;

	private boolean isInTray = false;

	public ChatTrayIcon(Image image, final ContactListFrame frame) {
		super(image);
		this.frame = frame;
		// setToolTipMin(Patience.INSTANCE.getRemTimeString());
		JMenuItem openItem = new JMenuItem("Öffnen");
		JMenuItem quitItem = new JMenuItem("Beenden");
		stateItem = new JMenu("Status");
		ButtonGroup group = new ButtonGroup();
		JRadioButtonMenuItem radio = new JRadioButtonMenuItem("Online");
		radio.addActionListener(this);
		radio.setActionCommand(STATE_ONLINE);
		group.add(radio);
		stateItem.add(radio);
		onlineStateRadio = radio;

		radio = new JRadioButtonMenuItem("AFK (Abwesend)");
		radio.addActionListener(this);
		radio.setActionCommand(STATE_AFK);
		group.add(radio);
		stateItem.add(radio);
		afkStateRadio = radio;

		radio = new JRadioButtonMenuItem("DND (Bitte nicht stören)");
		radio.addActionListener(this);
		radio.setActionCommand(STATE_DND);
		group.add(radio);
		stateItem.add(radio);
		dndStateRadio = radio;

		radio = new JRadioButtonMenuItem("Offline");
		radio.addActionListener(this);
		radio.setActionCommand(STATE_OFFLINE);
		group.add(radio);
		stateItem.add(radio);
		offlineStateRadio = radio;

		popup.add(openItem);
		popup.add(stateItem);
		popup.add(quitItem);
		openItem.addActionListener(this);
		openItem.setActionCommand(BTN_OPEN);
		quitItem.addActionListener(this);
		quitItem.setActionCommand(BTN_QUIT);

		addMouseListener(new MouseListener() {
			public void mouseReleased(MouseEvent e) {}
			public void mousePressed(MouseEvent e) {}
			public void mouseExited(MouseEvent e) {}
			public void mouseEntered(MouseEvent e) {}

			public void mouseClicked(MouseEvent e) {
				if (e.getButton()==MouseEvent.BUTTON1 && e.getClickCount() > 1){
					openFrame();
				} else if (e.getButton()==MouseEvent.BUTTON3) {
					popup.setLocation(e.getX(), e.getY());
					popup.setInvoker(popup);
					popup.setVisible(true);
				}
			}

		});

	}

	public void openFrame() {
		SystemTray.getSystemTray().remove(this);
		FrameUtil.bringToFront(frame);
		isInTray = false;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		popup.setVisible(false);
		String c = e.getActionCommand();
		if (BTN_QUIT.equals(c)) {
			frame.exit();
		} else if (BTN_OPEN.equals(c)) {
			openFrame();
		} else if (STATE_AFK.equals(c)) {
			frame.setOnlineState(EOnlineState.AFK);
			updatePopupLabels();
		} else if (STATE_DND.equals(c)) {
			frame.setOnlineState(EOnlineState.DND);
			updatePopupLabels();
		} else if (STATE_OFFLINE.equals(c)) {
			frame.setOnlineState(EOnlineState.OFFLINE);
			updatePopupLabels();
		} else if (STATE_ONLINE.equals(c)) {
			frame.setOnlineState(EOnlineState.ONLINE);
			updatePopupLabels();
		}
	}

	public void addToTray() {
		updatePopupLabels();
		try {
			SystemTray.getSystemTray().add(this);
			isInTray = true;
		} catch (AWTException e) {
			Log.error("Could not add systemtray icon: "+e.getMessage());
		}
	}

	private void updatePopupLabels(){
		EOnlineState state = EOnlineState.getByNr(ContactList.getMe().state);
		String text = "Status: "+state.toString();
		stateItem.setText(text);
		setToolTip(text);
		switch (state) {
		case ONLINE:
			setSelectedStateRadio(onlineStateRadio);
			break;
		case AFK:
			setSelectedStateRadio(afkStateRadio);
			break;
		case DND:
			setSelectedStateRadio(dndStateRadio);
			break;
		case OFFLINE:
			setSelectedStateRadio(offlineStateRadio);
			break;
		}
	}
	private void setSelectedStateRadio(JRadioButtonMenuItem item){
		item.removeActionListener(this);
		item.setSelected(true);
		item.addActionListener(this);
	}

	public boolean isInTray() {
		return isInTray;
	}

}


text:
using Academy.Commands.Contracts;
using Academy.Core.Contracts;
using System.Collections.Generic;

namespace Academy.Commands.Creating
{
    public class CreateSeasonCommand : ICommand
    {
        private readonly IAcademyFactory factory;
        private readonly IAcademyDatabase academyDatabase;

        public CreateSeasonCommand(IAcademyFactory factory, IAcademyDatabase academyDatabase)
        {
            this.factory = factory;
            this.academyDatabase= academyDatabase;
        }

        public string Execute(IList<string> parameters)
        {
            var startingYear = parameters[0];
            var endingYear = parameters[1];
            var initiative = parameters[2];

            var season = this.factory.CreateSeason(startingYear, endingYear, initiative);
            this.academyDatabase.Seasons.Add(season);

            return $"Season with ID {this.academyDatabase.Seasons.Count - 1} was created.";
        }
    }
}


text:
class Address < ContactMethod

  # Callbacks
  before_validation :set_formatted

  # Attributes
  field :formatted, type: String
  field :streetAddress, type: String # Address
  field :locality, type: String # City
  field :region, type: String # State
  field :postalCode, type: String
  field :country, type: String

  # Validations
  validates :formatted, presence: true
  validates :streetAddress, presence: true
  validates :locality, presence: true
  validates :region, presence: true
  validates :postalCode, presence: true
  validates :country, presence: true

  # Sets formatted attribute
  # Complete address as a single string
  def set_formatted
    self.formatted = "#{self.streetAddress}\n#{self.locality}, #{self.region} #{self.postalCode}\n#{self.country}"
  end

  def cache_id
    return :address
  end

  def to_cache
    cache = {
      pref:           self.pref,
      label:          self.label,
      formatted:      self.formatted,
      streetAddress:  self.streetAddress,
      locality:       self.locality,
      region:         self.region,
      postalCode:     self.postalCode,
      country:        self.country
    }
    return cache
  end

end


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

#include "ustdlib.h"
#include "uart_irda_cir.h"
#include "hw_uart_irda_cir.h"
#include "hw_types.h"
#include "interrupt.h"
#include "soc_AM335x.h"
#include "evmskAM335x.h"
#include "raster.h"
#include "grlib.h"
#include "widget.h"
#include "canvas.h"
#include "pushbutton.h"
#include "checkbox.h"
#include "radiobutton.h"
#include "container.h"
#include "slider.h"
#include "usblib.h"
#include "usbcdc.h"
#include "usbdcdc.h"
#include "usb.h"
#include "usb-ids.h"
#include "usbdevice.h"
#include "hw_usb.h"
#include "usb_structs.h"
#include "delay.h"
#include "cp15.h"
#include "mmu.h"

/*****************************************************************************
*
* Variables tracking transmit and receive counts.
*
*****************************************************************************/

volatile unsigned int g_ulUARTTxCount1 = 0;
volatile unsigned int g_ulUARTRxCount1 = 0;
volatile unsigned int g_ulUARTTxCount2 = 0;
volatile unsigned int g_ulUARTRxCount2 = 0;

/*****************************************************************************
*
*  Status variable used by the composite main routine to display the status of
*  the device.
*
******************************************************************************/

char *g_pcStatus;

/******************************************************************************
*
*  External Graphics context used to show text on the color STN display.
*
*******************************************************************************/

extern tContext g_sContext;

/****************************************************************************
*
* External flag variable which holds command bits used to signal the main loop
* to perform various tasks.
*
*****************************************************************************/

extern unsigned int g_ulFlags;

/******************************************************************************
*                                                                             *
* \brief  Handles CDC driver notifications related to control and setup of    *
*         the device.\n                                                       *
*                                                                             *
* \param pvCBData is the client-supplied callback pointer for this channel.   *
*                                                                             *
* \param ulEvent identifies the event we are being notified about.            *
*                                                                             *
* \param ulMsgValue is an event-specific value.                               *
*                                                                             *
* \param pvMsgData is an event-specific pointer.                              *
*                                                                             *
* \return The return value is event-specific.                                 *
*                                                                             *
******************************************************************************/
unsigned int ControlHandler(void *pvCBData, unsigned int ulEvent,
                            unsigned int ulMsgValue, void *pvMsgData)
{
    unsigned char ulIntsOff;

    /* Which event are we being asked to process? */
    switch(ulEvent)
    {

        /* We are connected to a host and communication is now possible. */

        case USB_EVENT_CONNECTED:

            /* Flush our buffers. */

            USBBufferFlush(&g_sTxBuffer1);
            USBBufferFlush(&g_sRxBuffer1);
            USBBufferFlush(&g_sTxBuffer2);
            USBBufferFlush(&g_sRxBuffer2);
            ulIntsOff = IntDisable();
            g_pcStatus = "Host connected.";
            g_ulFlags |= COMMAND_STATUS_UPDATE;
            IntEnable(ulIntsOff);
            break;

         /* The host has disconnected. */

        case USB_EVENT_DISCONNECTED:

            ulIntsOff = IntDisable();
            g_pcStatus = "Host disconnected.";
            g_ulFlags |= COMMAND_STATUS_UPDATE;
            IntEnable(ulIntsOff);
            break;

        /* We don't expect to receive any other events.  Ignore any that show
           up in a release build or hang in a debug build.
        */
        default:
            break;
    }

    return(0);
}

/******************************************************************************
*                                                                             *
* \brief  Handles CDC driver notifications related to the transmit1 channel   *
*         (data to the USB host).\n                                           *
*                                                                             *
*         This function is called by the CDC driver to notify us of any       *
*         events related to operation of the transmit data channel            *
*         (the IN channel carrying data to the USB host)                      *
*                                                                             *
* \param pvCBData is the client-supplied callback pointer for this channel.   *
*                                                                             *
* \param ulEvent identifies the event we are being notified about.            *
*                                                                             *
* \param ulMsgValue is an event-specific value.                               *
*                                                                             *
* \param pvMsgData is an event-specific pointer.                              *
*                                                                             *
* \return The return value is event-specific.                                 *
*                                                                             *
******************************************************************************/
unsigned int TxHandler1(void *pvCBData, unsigned int ulEvent,
                        unsigned int ulMsgValue, void *pvMsgData)
{

    /* Which event have we been sent? */

    switch(ulEvent)
    {
        case USB_EVENT_TX_COMPLETE:

            /* Since we are using the USBBuffer, we don't need to do anything
             here.
            */
            break;

        /* We don't expect to receive any other events.  Ignore any that show
           up in a release build or hang in a debug build.
        */
        default:
            break;
    }

    return(0);
}

/******************************************************************************
*                                                                             *
* \brief  Handles CDC driver notifications related to the transmit2 channel   *
*         (data to the USB host).                                             *
*                                                                             *
*         This function is called by the CDC driver to notify us of any       *
*         events related to operation of the transmit data channel            *
*         (the IN channel carrying data to the USB host)                      *
*                                                                             *
* \param pvCBData is the client-supplied callback pointer for this channel.   *
*                                                                             *
* \param ulEvent identifies the event we are being notified about.            *
*                                                                             *
* \param ulMsgValue is an event-specific value.                               *
*                                                                             *
* \param pvMsgData is an event-specific pointer.                              *
*                                                                             *
* \return The return value is event-specific.                                 *
*                                                                             *
******************************************************************************/
unsigned int TxHandler2(void *pvCBData, unsigned int ulEvent,
                        unsigned int ulMsgValue, void *pvMsgData)
{

    /* Which event have we been sent? */

    switch(ulEvent)
    {
        case USB_EVENT_TX_COMPLETE:

            /* Since we are using the USBBuffer, we don't need to do anything
               here.
            */
            break;

        /* We don't expect to receive any other events.  Ignore any that show
           up in a release build or hang in a debug build.
        */
        default:
            break;
    }
    return(0);
}

/******************************************************************************
*                                                                             *
* \brief  Handles CDC driver notifications related to the receive1  channel   *
*         (data from the USB host).                                           *
*                                                                             *
*        This function is called by the CDC driver to notify us of any events *
*        related to operation of the receive data channel (the OUT channel    *
*        carrying data from the USB host)                                     *
*                                                                             *
* \param pvCBData is the client-supplied callback pointer for this channel.   *
*                                                                             *
* \param ulEvent identifies the event we are being notified about.            *
*                                                                             *
* \param ulMsgValue is an event-specific value.                               *
*                                                                             *
* \param pvMsgData is an event-specific pointer.                              *
*                                                                             *
* \return The return value is event-specific.                                 *
*                                                                             *
******************************************************************************/
unsigned int RxHandler1(void *pvCBData, unsigned int ulEvent,
                        unsigned int ulMsgValue, void *pvMsgData)
{
    unsigned char ucChar;

    /* Which event are we being sent? */

    switch(ulEvent)
    {

        /* A new packet has been received. */

        case USB_EVENT_RX_AVAILABLE:
        {

            /* Feed the characters into the txbuffer of other device */
            while(USBBufferRead((tUSBBuffer *)&g_sRxBuffer1, &ucChar, 1))
            {
                USBBufferWrite((tUSBBuffer *)&g_sTxBuffer2,
                               (unsigned char *)&ucChar, 1);
                g_ulUARTTxCount2++;
                g_ulUARTRxCount1++;
            }
            break;
        }

        /* We are being asked how much unprocessed data we have still to
           process. We return 0 if the UART is currently idle or 1 if it is
           in the process of transmitting something. The actual number of
           bytes in the UART FIFO is not important here, merely whether or
           not everything previously sent to us has been transmitted.
        */
        case USB_EVENT_DATA_REMAINING:
        {
            return(0);
        }

        /* We are being asked to provide a buffer into which the next packet
           can be read. We do not support this mode of receiving data so let
           the driver know by returning 0. The CDC driver should not be sending
           this message but this is included just for illustration and
           completeness.
        */
        case USB_EVENT_REQUEST_BUFFER:
        {
            return(0);
        }

        /* We don't expect to receive any other events.  Ignore any that show
           up in a release build or hang in a debug build.
        */
        default:
            break;
    }

    return(0);
}

/******************************************************************************
*                                                                             *
* \brief  Handles CDC driver notifications related to the receive2  channel   *
*         (data from the USB host).                                           *
*                                                                             *
*        This function is called by the CDC driver to notify us of any events *
*        related to operation of the receive data channel (the OUT channel    *
*        carrying data from the USB host)                                     *
*                                                                             *
* \param pvCBData is the client-supplied callback pointer for this channel.   *
*                                                                             *
* \param ulEvent identifies the event we are being notified about.            *
*                                                                             *
* \param ulMsgValue is an event-specific value.                               *
*                                                                             *
* \param pvMsgData is an event-specific pointer.                              *
*                                                                             *
* \return The return value is event-specific.                                 *
*                                                                             *
******************************************************************************/
unsigned int RxHandler2(void *pvCBData, unsigned int ulEvent,
                        unsigned int ulMsgValue, void *pvMsgData)
{
    unsigned char ucChar;

    /* Which event are we being sent? */

    switch(ulEvent)
    {

        /* A new packet has been received. */

        case USB_EVENT_RX_AVAILABLE:
        {
            /* Feed the characters into the txbuffer of other device */
            while(USBBufferRead((tUSBBuffer *)&g_sRxBuffer2, &ucChar, 1))
            {
                USBBufferWrite((tUSBBuffer *)&g_sTxBuffer1,
                               (unsigned char *)&ucChar, 1);
                g_ulUARTTxCount1++;
                g_ulUARTRxCount2++;
            }
            break;
        }

        /* We are being asked how much unprocessed data we have still to
           process. We return 0 if the UART is currently idle or 1 if it is
           in the process of transmitting something. The actual number of
           bytes in the UART FIFO is not important here, merely whether or
           not everything previously sent to us has been transmitted.
        */
        case USB_EVENT_DATA_REMAINING:
        {
            return(0);
        }

        /* We are being asked to provide a buffer into which the next packet
           can be read. We do not support this mode of receiving data so let
           the driver know by returning 0. The CDC driver should not be sending
           this message but this is included just for illustration and
           completeness.
        */
        case USB_EVENT_REQUEST_BUFFER:
        {
            return(0);
        }

        /* We don't expect to receive any other events.  Ignore any that show
           up in a release build or hang in a debug build.
        */
        default:
            break;
    }

    return(0);
}

/******************************************************************************
*                                                                             *
* \brief  Shows the status string on the color STN display.                   *
*                                                                             *
* \param psContext is a pointer to the graphics context representing the      *
*        display.                                                             *
*                                                                             *
* \param pcStatus is a pointer to the string to be shown.                     *
*                                                                             *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void DisplayStatus(tContext *psContext, char *pcStatus)
{
    tRectangle rectLine;
    int lY;

    /* Calculate the Y coordinate of the top left of the character cell
       for our line of text.
    */
    lY = (GrContextDpyHeightGet(psContext) / 8) -
         (GrFontHeightGet(TEXT_FONT) / 2);

    /* Determine the bounding rectangle for this line of text. We add 4 pixels
       to the height just to ensure that we clear a couple of pixels above and
       below the line of text.
    */
    rectLine.sXMin = 0;
    rectLine.sXMax = GrContextDpyWidthGet(psContext) - 1;
    rectLine.sYMin = lY;
    rectLine.sYMax = lY + GrFontHeightGet(TEXT_FONT) + 3;

    /* Clear the line with black. */

    GrContextForegroundSet(&g_sContext, ClrBlack);
    GrRectFill(psContext, &rectLine);

    /* Draw the new status string */

    GrContextForegroundSet(&g_sContext, ClrWhite);
    GrStringDrawCentered(psContext, pcStatus, -1,
                         GrContextDpyWidthGet(psContext) / 2,
                         GrContextDpyHeightGet(psContext) / 8 , false);
}

/******************************************************************************
*                                                                             *
* \brief Draw a horizontal meter at a given position on the display and fill  *
*         fill it with green.                                                 *
*                                                                             *
* \param psContext is a pointer to the graphics context representing the      *
*        display.                                                             *
*                                                                             *
* \param lX    X - Cordinate.                                                 *
*                                                                             *
* \param lY    Y - Cordinate.                                                 *
*                                                                             *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void DrawBufferMeter(tContext *psContext, int lX, int lY)
{
    tRectangle sRect;
    int lCorrectedY;

    /* Correct the Y coordinate so that the meter is centered on the same line
       as the text caption to its left.
    */
    lCorrectedY = lY - (BUFFER_METER_HEIGHT - TEXT_HEIGHT) ;

    /* Determine the bounding rectangle of the meter. */

    sRect.sXMin = lX;
    sRect.sXMax = lX + BUFFER_METER_WIDTH - 1;
    sRect.sYMin = lCorrectedY;
    sRect.sYMax = lCorrectedY + BUFFER_METER_HEIGHT - 1;

    /* Fill the meter with green to indicate empty */

    GrContextForegroundSet(psContext, ClrGreen);
    GrRectFill(psContext, &sRect);

    /* Put a white box around the meter. */

    GrContextForegroundSet(psContext, ClrWhite);
    GrRectDraw(psContext, &sRect);
}

/******************************************************************************
*                                                                             *
* \brief Draw green and red blocks within a graphical meter on the display to *
*        indicate percentage fullness of some quantity (transmit and receive  *
*        buffers in this case.                                                *
*                                                                             *
* \param psContext is a pointer to the graphics context representing the      *
*        display.                                                             *
*                                                                             *
* \param ulFullPercent is a percentage value to indicate how much to fill.    *
*                                                                             *
* \param lX    X - Cordinate.                                                 *
*                                                                             *
* \param lY    Y - Cordinate.                                                 *
*                                                                             *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void UpdateBufferMeter(tContext *psContext, unsigned int ulFullPercent, int lX,
                       int lY)
{
    tRectangle sRect;
    int lCorrectedY;
    int lXBreak;

    /* Correct the Y coordinate so that the meter is centered on the same line
       as the text caption to its left and so that we avoid the meter's 1 pixel
       white border.
    */
    lCorrectedY = lY - ((BUFFER_METER_HEIGHT - TEXT_HEIGHT) / 2) + 1;

    /*  Determine where the break point between full (red) and empty (green)
        sections occurs.
    */
    lXBreak = (lX + 1) + (ulFullPercent * (BUFFER_METER_WIDTH - 2)) / 100;

    /* Determine the bounding rectangle of the full section. */

    sRect.sXMin = lX + 1;
    sRect.sXMax = lXBreak;
    sRect.sYMin = lCorrectedY;
    sRect.sYMax = lCorrectedY + BUFFER_METER_HEIGHT - 3;

    /* Fill the full section with red (if there is anything to draw) */

    if(ulFullPercent)
    {
        GrContextForegroundSet(psContext, ClrRed);
        GrRectFill(psContext, &sRect);
    }

    /* Fill the empty section with green. */

    sRect.sXMin = lXBreak;
    sRect.sXMax = lX + BUFFER_METER_WIDTH - 2;
    if(sRect.sXMax > sRect.sXMin)
    {
        GrContextForegroundSet(psContext, ClrGreen);
        GrRectFill(psContext, &sRect);
    }

    /* Revert to white for text drawing which may occur later. */

    GrContextForegroundSet(psContext, ClrWhite);

}

/******************************************************************************
*                                                                             *
* \brief Serial initilalization routine.                                      *
*                                                                             *
* \param none.                                                                *
*                                                                             *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void SerialInit(void)
{

    DelayTimerSetup();

    USBBufferInit((tUSBBuffer *)&g_sTxBuffer1);
    USBBufferInit((tUSBBuffer *)&g_sRxBuffer1);
    USBBufferInit((tUSBBuffer *)&g_sTxBuffer2);
    USBBufferInit((tUSBBuffer *)&g_sRxBuffer2);
}

/******************************************************************************
*                                                                             *
* \brief Main loop for serial handling function.                              *
*                                                                             *
* \param none.                                                                *
*                                                                             *
* \return none.                                                               *
*                                                                             *
******************************************************************************/
void SerialMain(void)
{
    static unsigned int ulTxCount1 = 0;
    static unsigned int ulRxCount1 = 0;
    static unsigned int ulTxCount2 = 0;
    static unsigned int ulRxCount2 = 0;
    unsigned char Intstatus;
    char pcBuffer[16];
    unsigned int ulFullness;

    /* Have we been asked to update the status display? */

    if(g_ulFlags & COMMAND_STATUS_UPDATE)
    {

        /* Clear the command flag */

        Intstatus = IntDisable();
        g_ulFlags &= ~COMMAND_STATUS_UPDATE;
        IntEnable(Intstatus);
        GrContextFontSet(&g_sContext, TEXT_FONT);
        DisplayStatus(&g_sContext, g_pcStatus);
    }

    /* Has there been any transmit traffic since we last checked? */

    if(ulTxCount1 != g_ulUARTTxCount1)
    {

        /* Take a snapshot of the latest transmit count. */

        ulTxCount1 = g_ulUARTTxCount1;

        /* Update the display of bytes transmitted by the UART. */

        GrContextFontSet(&g_sContext, TEXT_FONT);
        usnprintf(pcBuffer, 16, "%d ", ulTxCount1);
        GrStringDraw(&g_sContext, pcBuffer, -1, CDC1_BUF_METER_X_POS,
                      (CDC1_STR_Y_POSITION + CDC_STR_Y_DIFF), true);

        /* Update the RX buffer fullness. Remember that the buffers are
           named relative to the USB whereas the status display is from
           the UART's perspective. The USB's receive buffer is the UART's
           transmit buffer.
        */
        ulFullness = ((USBBufferDataAvailable(&g_sRxBuffer1) * 100) /
                      UART_BUFFER_SIZE);
        UpdateBufferMeter(&g_sContext, ulFullness, CDC1_BUF_METER_X_POS,
                           CDC1_BUF_METER_Y_POS);
    }

    /* Has there been any transmit traffic since we last checked? */

    if(ulTxCount2 != g_ulUARTTxCount2)
    {

        /* Take a snapshot of the latest transmit count. */

        ulTxCount2 = g_ulUARTTxCount2;

        /* Update the display of bytes transmitted by the UART. */

        GrContextFontSet(&g_sContext, TEXT_FONT);
        usnprintf(pcBuffer, 16, "%d ", ulTxCount2);
        GrStringDraw(&g_sContext, pcBuffer, -1, CDC2_BUF_METER_X_POS,
                      (CDC1_STR_Y_POSITION + CDC_STR_Y_DIFF), true);

        /* Update the RX buffer fullness. Remember that the buffers are
           named relative to the USB whereas the status display is from
           the UART's perspective. The USB's receive buffer is the UART's
           transmit buffer.
        */
        ulFullness = ((USBBufferDataAvailable(&g_sRxBuffer2) * 100) /
                      UART_BUFFER_SIZE);
        UpdateBufferMeter(&g_sContext, ulFullness, CDC2_BUF_METER_X_POS,
                           CDC2_BUF_METER_Y_POS);
    }

    /* Has there been any receive traffic since we last checked? */

    if(ulRxCount1 != g_ulUARTRxCount1)
    {

        /* Take a snapshot of the latest receive count. */

        ulRxCount1 = g_ulUARTRxCount1;

        /* Update the display of bytes received by the UART. */

        GrContextFontSet(&g_sContext, TEXT_FONT);
        usnprintf(pcBuffer, 16, "%d ", ulRxCount1);
        GrStringDraw(&g_sContext, pcBuffer, -1, CDC1_BUF_METER_X_POS,
                      (CDC1_STR_Y_POSITION + (CDC_STR_Y_DIFF * 4)), true);

        /* Update the TX buffer fullness. Remember that the buffers are
           named relative to the USB whereas the status display is from
           the UART's perspective. The USB's transmit buffer is the UART's
           receive buffer.
        */
        ulFullness = ((USBBufferDataAvailable(&g_sTxBuffer1) * 100) /
                      UART_BUFFER_SIZE);
        UpdateBufferMeter(&g_sContext, ulFullness, CDC1_BUF_METER_X_POS,
                      (CDC2_BUF_METER_Y_POS + CDC_BUF_METER_Y_DIFF));
    }

    /* Has there been any receive traffic since we last checked? */

    if(ulRxCount2 != g_ulUARTRxCount2)
    {

        /* Take a snapshot of the latest receive count. */

        ulRxCount2 = g_ulUARTRxCount2;

        /* Update the display of bytes received by the UART. */

        GrContextFontSet(&g_sContext, TEXT_FONT);
        usnprintf(pcBuffer, 16, "%d ", ulRxCount2);
        GrStringDraw(&g_sContext, pcBuffer, -1, CDC2_BUF_METER_X_POS,
                     (CDC1_STR_Y_POSITION + (CDC_STR_Y_DIFF * 4)), true);

        /* Update the TX buffer fullness. Remember that the buffers are
           named relative to the USB whereas the status display is from
           the UART's perspective. The USB's transmit buffer is the UART's
           receive buffer.
        */
        ulFullness = ((USBBufferDataAvailable(&g_sTxBuffer2) * 100) /
                      UART_BUFFER_SIZE);
        UpdateBufferMeter(&g_sContext, ulFullness, CDC2_BUF_METER_X_POS,
                          (CDC2_BUF_METER_Y_POS + CDC_BUF_METER_Y_DIFF));
    }
}


text:
import {HttpClient} from 'aurelia-fetch-client';
import {AuthService} from 'aurelia-auth';
import {inject} from 'aurelia-framework';

import config from '../authentication/config';

@inject(AuthService)
export class CustomHttpClient extends HttpClient
{
  constructor(authService) {
    super();

    this.configure(httpConfig => {
      httpConfig
        .withBaseUrl(config.baseUrl)
        .withDefaults({
          credentials: 'same-origin',
          headers: {
            'Content-Type': 'application/json',
            'Accept': 'application/json',
            'X-Requested-With': 'Fetch'
          }
        })
        .withInterceptor(authService.tokenInterceptor)
        .withInterceptor({
          request(request) {
            console.log('Requesting ' + request.method + ' ' + request.url);
            return request;
          },
          response(response) {
            console.log('Recieved ' + response.status + ' ' + response.url);
            if (response.status >= 200 && response.status < 300) {
              return response.json();
            }

            let error = new Error(response.statusText);
            error.response = response;
            throw error;
          }
        });
    });
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Threading;

namespace MvcTestApplication.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            // Service location just to prove it works :-)
            var container = TinyIoC.TinyIoCContainer.Current;
            var applicationObject = container.Resolve<IApplicationDependency>();
            var requestObject = container.Resolve<IRequestDependency>();
            // Just to the time increments :-)
            Thread.Sleep(2000);
            var requestObject2 = container.Resolve<IRequestDependency>();

            ViewData["Message"] = "Welcome to ASP.NET MVC!";
            ViewData["ApplicationMessage"] = applicationObject.GetContent();
            ViewData["RequestMessage"] = requestObject.GetContent();
            ViewData["RequestMessage2"] = requestObject2.GetContent();
            ViewData["ResultMessage"] = String.Format("Both request dependencies are the same instance: {0}", object.ReferenceEquals(requestObject, requestObject2));

            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}