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

#include "chrome/browser/ui/views/extensions/extension_install_friction_dialog_view.h"

#include "base/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/referrer.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#include "extensions/common/constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/layout_provider.h"

namespace {

void AutoConfirmDialog(base::OnceCallback<void(bool)> callback) {
  switch (extensions::ScopedTestDialogAutoConfirm::GetAutoConfirmValue()) {
    case extensions::ScopedTestDialogAutoConfirm::ACCEPT:
      base::ThreadTaskRunnerHandle::Get()->PostTask(
          FROM_HERE, base::BindOnce(std::move(callback), true));
      return;
    case extensions::ScopedTestDialogAutoConfirm::CANCEL:
      base::ThreadTaskRunnerHandle::Get()->PostTask(
          FROM_HERE, base::BindOnce(std::move(callback), false));
      return;
    default:
      NOTREACHED();
  }
}

}  // namespace

namespace extensions {

void ShowExtensionInstallFrictionDialog(
    content::WebContents* contents,
    base::OnceCallback<void(bool)> callback) {
  if (extensions::ScopedTestDialogAutoConfirm::GetAutoConfirmValue() !=
      extensions::ScopedTestDialogAutoConfirm::NONE) {
    AutoConfirmDialog(std::move(callback));
    return;
  }

  auto* view =
      new ExtensionInstallFrictionDialogView(contents, std::move(callback));

  constrained_window::CreateBrowserModalDialogViews(
      view, contents->GetTopLevelNativeWindow())
      ->Show();
}

}  // namespace extensions

namespace {

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class ExtensionInstallFrictionDialogAction {
  kClose = 0,
  kLearnMore = 1,
  kContinueToInstall = 2,
  kMaxValue = kContinueToInstall,
};

void ReportExtensionInstallFrictionDialogAction(
    ExtensionInstallFrictionDialogAction action) {
  base::UmaHistogramEnumeration("Extensions.InstallFrictionDialogAction",
                                action);
}

}  // namespace

ExtensionInstallFrictionDialogView::ExtensionInstallFrictionDialogView(
    content::WebContents* web_contents,
    base::OnceCallback<void(bool)> callback)
    : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
      parent_web_contents_(web_contents->GetWeakPtr()),
      callback_(std::move(callback)) {
  SetModalType(ui::MODAL_TYPE_WINDOW);
  set_fixed_width(views::LayoutProvider::Get()->GetDistanceMetric(
      views::DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH));

  SetDefaultButton(ui::DIALOG_BUTTON_CANCEL);
  SetButtonLabel(ui::DIALOG_BUTTON_OK,
                 l10n_util::GetStringUTF16(
                     IDS_EXTENSION_PROMPT_INSTALL_FRICTION_CONTINUE_BUTTON));
  SetButtonLabel(ui::DIALOG_BUTTON_CANCEL,
                 l10n_util::GetStringUTF16(IDS_CLOSE));

  SetShowIcon(true);
  SetTitle(
      l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_INSTALL_FRICTION_TITLE));

  SetAcceptCallback(base::BindOnce(
      [](ExtensionInstallFrictionDialogView* view) { view->accepted_ = true; },
      base::Unretained(this)));

  SetLayoutManager(std::make_unique<views::FillLayout>());
  const ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();

  set_margins(provider->GetDialogInsetsForContentType(
      views::DialogContentType::kControl, views::DialogContentType::kControl));
  set_draggable(true);

  auto warning_label = CreateWarningLabel();
  auto* scroll_view = AddChildView(std::make_unique<views::ScrollView>());
  scroll_view->SetHorizontalScrollBarMode(
      views::ScrollView::ScrollBarMode::kDisabled);
  scroll_view->SetContents(std::move(warning_label));
  scroll_view->ClipHeightTo(
      0, provider->GetDistanceMetric(
             views::DISTANCE_DIALOG_SCROLLABLE_AREA_MAX_HEIGHT));
}

std::unique_ptr<views::StyledLabel>
ExtensionInstallFrictionDialogView::CreateWarningLabel() {
  auto label = std::make_unique<views::StyledLabel>();

  std::u16string warning_text = l10n_util::GetStringUTF16(
      IDS_EXTENSION_PROMPT_INSTALL_FRICTION_WARNING_TEXT);
  std::u16string learn_more_text = l10n_util::GetStringUTF16(IDS_LEARN_MORE);

  std::u16string text = base::StrCat({warning_text, u" ", learn_more_text});

  label->SetText(text);
  gfx::Range details_range(warning_text.length() + 1, text.length());

  views::StyledLabel::RangeStyleInfo link_style =
      views::StyledLabel::RangeStyleInfo::CreateForLink(base::BindRepeating(
          &ExtensionInstallFrictionDialogView::OnLearnMoreLinkClicked,
          base::Unretained(this)));

  label->AddStyleRange(details_range, link_style);
  return label;
}

ExtensionInstallFrictionDialogView::~ExtensionInstallFrictionDialogView() {
  // Another modal dialog (ExtensionInstallDialogView) is displayed when
  // clicking through this friction dialog. The callback is invoked in the
  // destructor to make sure the current modal dialog is closed before showing
  // the next one.
  //
  // On MacOS, a modal dialog silently fails to display if another modal dialog
  // is already displayed. The issue is tracked in crbug.com/1199383
  ExtensionInstallFrictionDialogAction action;
  if (accepted_) {
    action = ExtensionInstallFrictionDialogAction::kContinueToInstall;
  } else if (learn_more_clicked_) {
    action = ExtensionInstallFrictionDialogAction::kLearnMore;
  } else {
    action = ExtensionInstallFrictionDialogAction::kClose;
  }
  ReportExtensionInstallFrictionDialogAction(action);

  std::move(callback_).Run(accepted_);
}

// override
ui::ImageModel ExtensionInstallFrictionDialogView::GetWindowIcon() {
  return ui::ImageModel::FromVectorIcon(
      vector_icons::kGppMaybeIcon, ui::kColorAlertMediumSeverity,
      extension_misc::EXTENSION_ICON_SMALLISH);
}

void ExtensionInstallFrictionDialogView::OnLearnMoreLinkClicked() {
  GURL url(chrome::kCwsEnhancedSafeBrowsingLearnMoreURL);
  content::OpenURLParams params(
      url, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
      ui::PAGE_TRANSITION_LINK, /*is_renderer_initiated=*/false);

  learn_more_clicked_ = true;
  if (parent_web_contents_) {
    parent_web_contents_->OpenURL(params);
  } else {
    chrome::ScopedTabbedBrowserDisplayer displayer(profile_);
    displayer.browser()->OpenURL(params);
  }

  CancelDialog();

  // TODO(jeffcyr): Record UMA metric
}

void ExtensionInstallFrictionDialogView::ClickLearnMoreLinkForTesting() {
  OnLearnMoreLinkClicked();
}

BEGIN_METADATA(ExtensionInstallFrictionDialogView,
               views::BubbleDialogDelegateView)
END_METADATA


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFteamsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
	    Schema::create('fTeams', function($table)
            {

                $table->engine = 'InnoDB';

                $table->increments('id');
                $table->integer('fId');
                $table->integer('riotId')->unique();
                $table->string('name');
                $table->string('shortName');
                $table->text('flavorText')->nullable();
                $table->string('positions');

                $table->timestamps();

            });
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
	    Schema::drop('fTeams');
	}

}

redpajama_set_name: RedPajamaGithub


text:
	{% load comments %}
    {% get_comment_count for comment_object as count %}

Kommentare ({{ count }})

	{% get_comment_list for comment_object as comments %}
	{% for comment in comments %}

{{ comment.user_name }}

{{ comment.comment }}

{{ comment.submit_date|date:"d. F. Y H:i:s" }}

	{% endfor %}

		{% render_comment_form for comment_object %}


text:
      {{I18n "data-manager.create-scenario"}}

<form>

              {{I18n "data-manager.scenarios-description"}}

      <select id="bundleId" class="form-control">
      </select>

        {{I18n "data-manager.scenario-name"}}

      <input id="name" name="name" value="{{name}}" type="text" class="form-control"/>

        {{I18n "data-manager.scenario-description"}}

      <input id="description" name="description" value="{{description}}" type='text' class="form-control"/>

      {{I18n "data-manager.banned-routes"}}
      <select id="bannedRoutes" multiple style="width: 400px">
      </select>

<button id="scenarioSave" type="button" class="save btn btn-primary">{{I18n "app.shared.create"}}</button> <button type="button" id="scenarioCancel" class="cancel btn btn-default">{{I18n "app.shared.cancel"}}</button>
</form>


text:
// Created by John Åkerblom 2014-12-10

#ifndef __FORMAT_SELECT_H_DEF__
#define __FORMAT_SELECT_H_DEF__

//
// This file provides a macro interface for correctly accessing
// members of unions by selecting union based on the passed
// h3m format value. The code generated is unoptimized as the
// format comparison is repeated in every macro use, at least
// in all MSVC compiler output I have looked at.
//
// Some alternatives:
// 1. Simply have separate handtailored code for each format version. This was
//    my initial approach and some code is still written like this. It was out
//    of frustration when improving the parsing for the map specifications part
//    of the format (ai, additional info) which is very long and has extra bytes
//    for later versions added several places throughout that I decided to take
//    a different approach.
//    Pros: Optimized and conceptually simple.
//    Cons: This means a lot of copy-paste code as the only main difference is
//          the type of the struct used, with most members being the same
//          (offsets, which is handled automatically by the compiler being the
//          only difference). Annoying to maintain as most changes need to be
//          done 3 times (+x for any mod supported in the future).
//
// 2. Have a macro that generates EVERYTHING, meaning there is only a single
//    format comparison after which code with the approriate offsets and members
//    generated by the macro is executed.
//    Pros: Optimized.
//    Cons: This means the only the disassembly will be available for debugging.
//          Also even amongst these several ugly options it will look the
//          ugliest and be the most cancerous to work with.
//
// 3. Instead of using data structures that resemble the original data
//    structures as closely as possible and are binary compatible where that can
//    reasonably be achieved, simply use the same structure for all versions of
//    the game with extra members going unused for versions that do not use
//    them. This means all offsets will always be the same.
//    Pros: Optimized and very simple, although will ALWAYS use more memory than
//          needed for non-SOD/<mod supported in the future>. Of course still
//          not more memory than non-dynamically allocated unions though.
//    Cons: Debatable. Resemblance to the actual structures is drastically
//          decreased for non-SOD which can be viewed as a problem for a
//          multitude of reasons but could be argued to be worth it. All binary
//          compatibility lost and could get ridiculous when supporting mods
//          that add many things or just supporting many mods that add different
//          things.
//
// 4. Write a strange macro interface that no one understand what it does
//    (this file).
//    Pros: None? Well at least the CALLING code is pretty readable and short if
//          you don't instantly close your eyes when you see a macro being used.
//    Cons: Unoptimized, rough, causes dissapointment at MSVC and
//          life in general. At the end of the day though it's a matter of worst
//          case having to do a couple of unnecessary CMPs per macro use, which
//          is not exactly a lot of overhead in this context. Just a bit
//          mentally challenged.
//
// 5. Write the code in a language that is not from the 70s and actually
//    supports dynamic structures/metaprogramming/auto auto auto
//    Pros: Potentially optimized, simple
//    Cons: None? ;)
//

#include "safe_read.h"

#ifdef _MSC_VER
    // Disable different array subscripts warning.
    // This warning triggers for the first argument of memcpy,
    // when it is a ternary with arrays of different sizes and uses
    // & style address of address of array. There is no actual issue
    // in the memcpy usage here as size is separately specified for each
    // respective structure.
#pragma warning(disable:4048)
#endif

//
// FS_*: Retrieve (rvalue of) AB member of format F
//
#define FS_ANY(A, B, FM) \
    ((H3M_FORMAT_ROE == FM)? A.roe.B : \
    (H3M_FORMAT_AB == FM)? A.ab.B : \
    A.sod.B)

#define FS_ABSOD(A, B, FM) \
    ((H3M_FORMAT_AB == FM)? A.ab.B : \
    A.sod.B)

#define FS_SOD(A, B, FM) \
    A.sod.B

#define FS_ANY_PTR(A, B, FM) \
    ((H3M_FORMAT_ROE == FM) ? A->roe.B : \
    (H3M_FORMAT_AB == FM) ? A->ab.B : \
    A->sod.B)

#define FS_ABSOD_PTR(A, B, FM) \
    ((H3M_FORMAT_AB == FM) ? A->ab.B : \
    A->sod.B)

#define FS_SOD_PTR(A, B, FM) \
    A->sod.B

#define FS_ANY_VOIDCAST(A, B, FM) \
    ((H3M_FORMAT_ROE == FM) ? (void *)A.roe.B : \
    (H3M_FORMAT_AB == FM) ? (void *)A.ab.B : \
    (void *)A.sod.B)

#define FS_ABSOD_VOIDCAST(A, B, FM) \
    ((H3M_FORMAT_AB == FM) ? (void *)A.ab.B : \
    (void *)A.sod.B)

#define FS_SOD_VOIDCAST(A, B, FM) \
    (void *)A.sod.B

//
// FS_*_SIZEOF: Retrieve size of AB member of format F
//
#define FS_ANY_SIZEOF(A, B, FM) \
    ((H3M_FORMAT_ROE == FM) ? sizeof(A.roe.B) : \
    (H3M_FORMAT_AB == FM) ? sizeof(A.ab.B) : \
    sizeof(A.sod.B))

#define FS_ABSOD_SIZEOF(A, B, FM) \
    ((H3M_FORMAT_AB == FM) ? sizeof(A.ab.B) : \
    sizeof(A.sod.B))

#define FS_SOD_SIZEOF(A, B, FM) \
    sizeof(A.sod.B)

//
// FS_*_ASSIGN: Assign value to AB member of format F
//
#define FS_ANY_ASSIGN(A, B, V, FM) \
    switch (FM) \
    { \
    case H3M_FORMAT_ROE: \
        A.roe.B = V; \
        break; \
    case H3M_FORMAT_AB: \
        A.ab.B = V; \
        break; \
    case H3M_FORMAT_SOD: \
    /* fall through */ \
    default: \
        A.sod.B = V; \
        break; \
    }

#define FS_ABSOD_ASSIGN(A, B, V, FM) \
    switch (FM) \
    { \
    case H3M_FORMAT_ROE: \
        break; \
    case H3M_FORMAT_AB: \
        A.ab.B = V; \
        break; \
    case H3M_FORMAT_SOD: \
    /* fall through */ \
    default: \
        A.sod.B = V; \
        break; \
    }

#define FS_SOD_ASSIGN(A, B, V, FM) \
    switch (FM) \
    { \
    case H3M_FORMAT_ROE: \
        break; \
    case H3M_FORMAT_AB: \
        break; \
    case H3M_FORMAT_SOD: \
    /* fall through */ \
    default: \
        A.sod.B = V; \
        break; \
    }

//
// FS_*_READ_SIZEOF: Read into AB member of format F the size of the member
//                   Supports arrays and other variables (not pointers, but
//                   there is no point in using this _SIZEOF macro for pointers)
//
// & operator seen here in &DESTA is redudant for arrays as there exists no such
// thing as an implicit address of an array address, but it's not worth it to
// use an additional macro separately for arrays as opposed to other variables
// just for that reason when it works for both like this.
#define FS_ANY_READ_SIZEOF(DESTA, DESTB, PAR, FM) \
    SAFE_READ_N(FS_ANY_VOIDCAST(&DESTA, DESTB, FM), FS_ANY_SIZEOF(DESTA, DESTB, FM), PAR)

#define FS_ABSOD_READ_SIZEOF(DESTA, DESTB, PAR, FM) \
    if (FM >= H3M_FORMAT_AB) { \
        SAFE_READ_N(FS_ABSOD_VOIDCAST(&DESTA, DESTB, FM), FS_ABSOD_SIZEOF(DESTA, DESTB, FM), PAR) \
    }

#define FS_SOD_READ_SIZEOF(DESTA, DESTB, PAR, FM) \
    if (FM >= H3M_FORMAT_SOD) { \
        SAFE_READ_N(FS_SOD_VOIDCAST(&DESTA, DESTB, FM), FS_SOD_SIZEOF(DESTA, DESTB, FM), PAR) \
    }

//
// FS_*_WRITE_SIZEOF: Write from AB member of format F the size of the member
//                    See FS_*_READ_SIZEOF for more details.
//
#define FS_ANY_WRITE_SIZEOF(SRCA, SRCB, F, FM) \
    fwrite(FS_ANY_VOIDCAST(&SRCA, SRCB, FM), FS_ANY_SIZEOF(SRCA, SRCB, FM), 1, F);

#define FS_ABSOD_WRITE_SIZEOF(SRCA, SRCB, F, FM) \
    if (FM >= H3M_FORMAT_AB) { \
        fwrite(FS_ABSOD_VOIDCAST(&SRCA, SRCB, FM), FS_ABSOD_SIZEOF(SRCA, SRCB, FM), 1, F); \
    }

#define FS_SOD_WRITE_SIZEOF(SRCA, SRCB, F, FM) \
    if (FM >= H3M_FORMAT_SOD) { \
        fwrite(FS_SOD_VOIDCAST(&SRCA, SRCB, FM), FS_SOD_SIZEOF(SRCA, SRCB, FM), 1, F); \
    }

//
// FS_*_READ_N: Read into AB member of format F N bytes
//
#define FS_ANY_READ_N(DESTA, DESTB, N, PAR, FM) \
    SAFE_READ_N(FS_ANY_VOIDCAST(&DESTA, DESTB, FM), N, PAR)

/*#define FS_ABSOD_READ_N(SRCA, SRCB, N, F, FM) \
    if (FM >= H3M_FORMAT_AB) \
    { \
        SAFE_READ_N(FS_ABSOD(&DESTA, DESTB, FM), RAW, RAW_SIZE, OFFSET, N) \
    }

#define FS_SOD_READ_N(SRCA, SRCB, N, F, FM) \
    if (FM >= H3M_FORMAT_SOD) \
    { \
        SAFE_READ_N(FS_SOD(&DESTA, DESTB, FM), RAW, RAW_SIZE, OFFSET, N) \
    }*/

//
// FS_*_WRITE_N: Write from AB member of format F N bytes
//
#define FS_ANY_WRITE_N(SRCA, SRCB, N, F, FM) \
    fwrite(FS_ANY_VOIDCAST(&SRCA, SRCB, FM), N, 1, F);

#define FS_ABSOD_WRITE_N(SRCA, SRCB, N, F, FM) \
    if (FM >= H3M_FORMAT_AB) { \
        fwrite(FS_ABSOD_VOIDCAST(&SRCA, SRCB, FM), N, 1, F); \
    }

#define FS_SOD_WRITE_N(SRCA, SRCB, N, F, FM) \
    if (FM >= H3M_FORMAT_SOD) { \
        fwrite(FS_SOD_VOIDCAST(&SRCA, SRCB, FM), N, 1, F); \
    }

//
// FS_*_CALL: Call A, and return on error, for the right formats
//
#define FS_ANY_CALL(A, FM) \
    if (0 != A) { \
        return 1; \
    } \

#define FS_ABSOD_CALL(A, FM) \
    if (FM >= H3M_FORMAT_AB) { \
        if (0 != A) { \
            return 1; \
        } \
    }

#define FS_SOD_CALL(A, FM) \
    if (FM >= H3M_FORMAT_SOD) { \
        if (0 != A) { \
            return 1; \
        } \
    }

#endif


text:
require "spec_helper"

describe Savon::SOAP do

  it "should contain the SOAP namespace for each supported SOAP version" do
    Savon::SOAP::VERSIONS.each do |soap_version|
      Savon::SOAP::NAMESPACE[soap_version].should be_a(String)
      Savon::SOAP::NAMESPACE[soap_version].should_not be_empty
    end
  end

  it "should contain a Range of supported SOAP versions" do
    Savon::SOAP::VERSIONS.should == (1..2)
  end

end


text:
SOLVE-Brain 1.0.4
===========

Brain-specific annotation of next-generation sequencing data.

Release date 22 October 2015

Authors: Dalia Ghoneim, Francis James, Jimmy Zhang, Jeff Clegg, Alex Paciorkowski

The Paciorkowski Lab

*****
The MIT License (MIT)

Copyright (c) 2013 Paciorkowski Lab

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*****
To use on Linux or MacOSX systems just clone our GitHub repository:

$ git clone https://github.com/Paciorkowski-Lab/SOLVE-Brain.git

That's it.

*****
Installation on Windows

We haven't made SOLVE-Brain Windows compatible yet. You can probably do this through installing Cygwin (http://ww.cygwin.com/), but we haven't tested in this environment yet.

Tutorial:

Start with an Annovar-annotated multisample vcf, as well as a vcf that has not been subject to annotation (optional, see below). The vcf file should be consistent with VCFv4.1 to properly use all functionality. We recommend labeling your trio members the following way: (i.e. proband is first, father is second, mother is third). But this could be different so it is important to know how your data is laid out.

For recessive pedigree analyses it is important that for each family the columns in the vcf are consistent with the following order: affected(1), [affected(2), affected(3)...affected(n)], father, mother. SOLVE-Brain can only handle vcfs that are in this order. You can read more about this in Tutorial 2 for recessive analysis below.

The Set-Up:
-----------
When running SOLVE-Brain you have two options for letting the program know how your data is laid out.
	OPTION 1: You can provide the software with an unnannoted vcf file, where the program will go and search for your cohort identifier names. It will then ask you for each identifer found, whether the individual is a proband or not in which you respond with a simple (y/n). It will then ask how many affected siblings the proband has in the cohort, followed by a question of whether the proband has any missing parents in the cohort.This file is placed in your output folder and can be used with OPTION 2 for subsequent runs (different pedigree hypothesis).
	OPTION 2: You pre-make a text file that has the name of your cohort identifiers in column one along with the index they correspond to in column two (OPTION 1 handles this for you) as well as the word 'proband' in the third column, if the individual is a proband. Column 4 should contain the number of affected ('1' if proband has no affected siblings). Lastly, Column 5 should contain a string representing any absent parents. This can be 'M', 'F', 'MF', or just a blank string '' if both parents are present (capitalization is not important).

	Demonstration of OPTION 1:
		Is 'Identifier_1' a proband? (y/n)?
		y
		Number of affected siblings? (or just [ENTER] for 0)
		1
		Any absent parents? Enter 'm' for absent mother, 'f' for father or 'mf' for both or [ENTER] for neither.

		Is 'Identifier_2' a proband? (y/n)?
		y
		Number of affected siblings? (or just [ENTER] for 0)

		Any absent parents? Enter 'm' for absent mother, 'f' for father or 'mf' for both or [ENTER] for neither.

		Is 'Identifier_3' a proband? (y/n)?
		y
		Number of affected siblings? (or just [ENTER] for 0)

		Any absent parents? Enter 'm' for absent mother, 'f' for father or 'mf' for both or [ENTER] for neither.
		mf
		Is 'Identifier_n' a proband? (y/n)?
		.
		.
		.
		*The program uses the information provided by the user to know which members of the cohort are probands, while it asks "Is 'Identifier_n' a proband? (y/n)?", it knows based on input that this is a proband. The question is to allow the user to exclude probands, by saying 'n' or even just pressing [ENTER] the user can have SOLVE-Brain exclude 'Identifier_n' from analysis. In both subsequent questions, [ENTER] may be used for the default answer, i.e. '0' sibilings in the cohort, and both parents present in the cohort (a typical trio).
		In the above demonstration, the software has been told that proband1 has one sibling directly following in the VCF as well as both parents, proband2 is a classic trio, and proband3 has no siblings as well as both parents absent (i.e. only data for proband3 is present). In cases such as proband3 it is important to note that many results will come up since referencing parents is not an option. All pedigree hypotheses are available they just carry a slightly different meaning, for instance De Novo will find any '0/1' in the proband but a parent could possibly posses this variant as well.

This software makes use of command line flags or options in order to know exactly what it is the user wants to happen. It is recommended that you look at the usage which can be accessed by running 'sh solve.sh -h' in the command line, however a small summary will be provided here.

To start, the software is looking for a couple required flags in which it cannot run without. The following are flags you must include:

	-P followed by a two letter pedigree hypothesis. (DN, AR, AD, XL, none)

	-O followed by the path to your output location.

	AT LEAST one of the following:

		-S followed by the path to your Annovar annotated snv file.

		-I followed by the path to your Annovar annotated indel file.

			*Note: it is common to run both the snv and indel files simultanously.

		-C followed by the path to your Annovar annotated combined snv/indel file.

	ONLY one of the following:

		-i followed by the path to your Who is who file described above.

		-U followed by the path to your Unannotated vcf file. (type does not matter)

The following are optional flags that can be used depending on your data/needs:

	-T 'Training Wheels', this will default enable a few commonly used flags: -X, -v, -R will all be enabled.

	-g followed by the index of gene names in your annotated vcf (if not labeled)

	-N followed by the desired name of Who is who file. (only if -U also used)

		*Note: if -U is used and -N is not, the Who is who file will be named with the date.

	-d will have the program NOT filter out known SNPs.

	-q will have the program NOT filter out varation with GQ scores less than 99.

	-k will have the program cross reference found variation with a list of known genes. (provided in a seperate file)

	-x will display the outputed 'ALL' gene file. (List of all found genes for cohort)

	-X same as '-x' with pauses in between files for clearer visualization.

		*NOTE: if verbose mode is activated, verbose files will display after the consolidated gene files.

	-v will create 'VERBOSE' files that also contain the raw data related to found variation.

	-R will create files similar to verbose, filtering out variants found in other families (unless only in probands) as these are unlikely disease causing.

		*NOTE: for variants that are not filtered out, a convenient Analysis section is added after all variants are listed for a gene. (this matches with the available searches on SOLVE-Brain's web interface)

The following are some short tutorials to provide an example of how to use this software in a few common use cases.

Tutorial 1: De novo analysis:
-----------------------------
This first set of examples illustrates the command-line use of SOLVE-Brain to identify potentially interesting variants in a pedigree with hypothesized de novo inheritance. NOTE: While in the following three examples only one annotated file is used (snv or indel) both can be given in the same command producing output for snv's and indel's in a single run.

Example 1: Identify all nonsynonymous snv's in a de novo pedigree, keeping members of dbSNP, excluding snv's where GQ score is less than 99, generating a who is who file:

$ sh solve.sh -d -P DN -U /path/to/your/unannotated.vcf -S /path/to/your/annotated_snv.vcf -O /path/to/your/output/

This will give two output files for each proband, plus two final files:
Identifiers_snv_exons_utr_nosynon_GQ99_DN.vcf (This is a new vcf with your full results.)
Identifiers_snv_exons_utr_nosynon_GQ99_DN_genes.txt (This is a extract of just the gene symbols from your new vcf.)
ALL_snv_exons_utr_nosynon_GQ99_DN_genes.txt (This is a compilation of all gene files sorted by proband identifiers.)
Who_is_who_[date].txt (This is a Who's who file to be used in later runs with '-i' flag.)

Example 2: Identify all nonsynonymous snv's in a de novo pedigree, and exclude members of dbSNP, including snv's with a GQ score less than 99, using an already generated who is who file, and results displayed (no pauses):

$ sh solve.sh -q -P DN -i /path/to/your/whos_who.txt -S /path/to/your/annotated_snv.vcf -O /path/to/your/output/ -x

This will give two output files for each proband, plus one final file:
Identifiers_snv_exons_utr_nosynon_nodbSNP_DN.vcf (This is a new vcf with your full results, this time excluding snv's with membership in dbSNP.)
Identifiers_snv_exons_utr_nosynon_nodbSNP_DN_genes.txt (This is a extract of just the gene symbols from your new vcf.)
ALL_snv_exons_utr_nosynon_nodbSNP_DN_genes.txt (This is a compilation of all gene files sorted by proband identifiers.)

Example 3: Identify all framshift indels in a de novo pedigree, exclude members of dbSNP, excluding indel's with a GQ score less than 99, generating a who is who file, displaying results with pauses, creating a verbose file, creating a rare variant only file (These last three are included in 'Training Wheels'):

$ sh solve.sh -P DN -U /path/to/your/unannotated.vcf -I /path/to/your/annotated_indel.vcf -O /path/to/your/output/ -X -v -R
or
$ sh solve.sh -P DN -U /path/to/your/unannotated.vcf -I /path/to/your/annotated_indel.vcf -O /path/to/your/output/ -T

This will give two output files for each proband, plus three additional files:
Identifiers_indel_exons_utr_no_nonframe_nodbSNP_GQ99_DN.vcf (This is a new vcf with full results, this time excluding indel's in dbSNP and/or with a GQ score less than 99)
Identifiers_indel_exons_utr_no_nonframe_nodbSNP_GQ99_DN_genes.txt (This is a extract of just the gene symbols from your new vcf.)
ALL_indel_exons_utr_no_nonframe_nodbSNP_GQ99_DN_genes.txt (This is a compilation of all gene files sorted by proband identifiers.)
VERBOSE_indel_exons_utr_no_nonframe_nodbSNP_GQ99_DN_genes.txt (This file contains all variants found for each proband as well as relavent vcf data for the variant all in one file)
rare_only_VERBOSE_indel_exons_utr_no_nonframe_nodbSNP_GQ99_DN_genes.txt (This is similar to previous file, with vcf data removed for variants found outside the affected family [i.e. in unrelated parents])
Who_is_who_[date].txt

Tutorial 2: Autosomal recessive analysis:
-----------------------------------------
This set of examples illustrates the command-line use of SOLVE-Brain to identify potentially interesting variants in a pedigree with hypothesized autosomal recessive inheritance. We will show you how to use this tool to analyze both snv's and indels.

Autosomal recessive analysis poses a bit of extra complexity, since one can have any of the following combinations of variants for genotype:
	1. snvA & snvA (Homozygosity for snv's)
	2. snvA & snvB (Compound heterozygosity for snv's)
	3. snvA & indelA (Compound heterozygosity for snv + indel)
	4. indelA & indelB (Compound heterozygosity for indels)
	5. indelA & indelA (Homozygosity for indels)

	*NOTE: Compound heterozygous cases are only valid if both parents are present in the cohort.

Also, we expect that either allele will be inhertied from either parent. So it helps to have parental sequencing data to evaluate these.

Fortunately, SOLVE-Brain can handle all of these situations. All it takes is knowing how to use the flags at the command-line.

Example 1: Identify all nonsynonymous snv's in an autosomal recessive pedigree, keeping members of dbSNP, excluding snv's with a GQ score less than 99, with already generated who is who file, no results displayed, creating a verbose file:

$ sh solve.sh -d -P AR -i /path/to/your/whos_who.txt -S /path/to/your/annotated_snv.vcf -O /path/to/your/output/ -v

This will give four output files for each proband, plus four additional files:
Identifiers_snv_exons_utr_nosynon_GQ99_HM.vcf (This is a new vcf with recessive variants that are homozygous in the proband and heterozygous in the parents.)
Identifiers_snv_exons_utr_nosynon_GQ99_HM_genes.txt (This is an extract of just the gene symbols from the homozygous variants vcf.)
Identifiers_snv_exons_utr_nosynon_GQ99_CH.vcf (This is a new vcf with recessive variants that are compound heterozygous in the proband, and appropriately heterozygous in the parents.)
Identifiers_snv_exons_utr_nosynon_GQ99_CH_genes.txt (This is an extract of just the gene symbols for compound heterozygous snvs)
ALL_snv_exons_utr_nosynon_GQ99_HM_genes.txt (This is a compilation of all homozygous snv gene symbols, labeled by proband identifier)
ALL_snv_exons_utr_nosynon_GQ99_CH_genes.txt (This is a compilation of all compound heterozygous snv gene symbols, labeled by proband identifier)
VERBOSE_snv_exons_utr_nosynon_GQ99_HM_genes.txt (This file contains all homozygous snv's found for each proband as well as relavent vcf data for the variant all in one file)
VERBOSE_snv_exons_utr_nosynon_GQ99_CH_genes.txt (This file contains all compound heterozygous snv's found for each proband as well as relavent vcf data for the variant all in one file)

Example 2: Identify all nonsynonymous snv's and frameshift indels in an autosomal recessive pedigree, including members of dbSNP, including snv's with a GQ score less than 99, generating a who is who file with a provided name, with 'Training Wheels' enabled:
*This is very verbose for Autosomal recessive*

$ sh solve.sh -d -q -P AR -U /path/to/your/unannotated.vcf -S /path/to/your/annotated_snv.vcf -I /path/to/your/annotated_indel.vcf -O /path/to/your/output/ -N Name_of_whos_who_file -T

This will give the following five output *.vcf along with their five corresponding *.txt files for each proband, plus 16 additional files listed:
Identifiers_snv_exons_utr_nosynon_HM.vcf
Identifiers_snv_exons_utr_nosynon_CH.vcf
Identifiers_indel_exons_utr_no_nonframe_HM.vcf
Identifiers_indel_exons_utr_no_nonframe_CH.vcf
Identifiers_snv_exons_utr_nosynon_indels_CH.vcf
ALL_snv_exons_utr_nosynon_HM_genes.txt
ALL_snv_exons_utr_nosynon_CH_genes.txt
ALL_indel_exons_utr_no_nonframe_HM_genes.txt
ALL_indel_exons_utr_no_nonframe_CH_genes.txt
ALL_snv_exons_utr_nosynon_indels_CH_genes.txt
VERBOSE_indel_exons_utr_no_nonframe_CH_genes.txt
VERBOSE_indel_exons_utr_no_nonframe_HM_genes.txt
VERBOSE_snv_exons_utr_nosynon_CH_genes.txt
VERBOSE_snv_exons_utr_nosynon_HM_genes.txt
VERBOSE_snv_exons_utr_nosynon_indels_CH_genes.txt
rare_only_VERBOSE_indel_exons_utr_no_nonframe_CH_genes.txt
rare_only_VERBOSE_indel_exons_utr_no_nonframe_HM_genes.txt
rare_only_VERBOSE_snv_exons_utr_nosynon_CH_genes.txt
rare_only_VERBOSE_snv_exons_utr_nosynon_HM_genes.txt
rare_only_VERBOSE_snv_exons_utr_nosynon_indels_CH_genes.txt
Name_of_whos_who_file.txt

Tutorial 3: X-linked analysis:
------------------------------

Example 1: Identify all nonsynonymous snv's inherited from the mother in an X-linked manner, providing the column that gene names are located in, with an already generated who is who file, using 'Training Wheels':

$ sh solve.sh -g 6 -P XL -i /path/to/your/whos_who.txt -S /path/to/your/annotated_snv.vcf -O /path/to/your/output/ -T

This will output the following two output files for each proband as well as three additional files listed below:
Identifiers_snv_exons_utr_nosynon_nodbSNP_GQ99_XL_genes.txt
Identifiers_snv_exons_utr_nosynon_nodbSNP_GQ99_XL.vcf
ALL_snv_exons_utr_nosynon_nodbSNP_GQ99_XL_genes.txt
VERBOSE_snv_exons_utr_nosynon_nodbSNP_GQ99_XL_genes.txt
rare_only_VERBOSE_snv_exons_utr_nosynon_nodbSNP_GQ99_XL_genes.txt


text:
package eu.monnetproject.label.xbrl;

import eu.monnetproject.label.LabelExtractor;
import eu.monnetproject.label.custom.CustomLabelExtractionPolicy;
import eu.monnetproject.label.impl.AggregateLabelExtractor;
import java.net.URI;
import java.util.Arrays;

/**
 * XBRL Label Extraction Policy to extract labels from XBRL-RDF files with the following label types
 *
 *   - xbrl 2003: role label, verbose label, total label, terse label
 *   - xbrl iasb: role label negated, terse label negated, net label
 *
 * @author Tobias Wunner
 *
 */
public class XBRLLabelExtractionPolicy extends AggregateLabelExtractor {

	private static final String XBRL_2003 = "http://www.xbrl.org/2003/role/";
	private static final String XBRL_IASB = "http://xbrl.iasb.org/role/";

	// label xbrl 2003
	private static final URI LABEL_ROLE = URI.create(XBRL_2003+"label");
	private static final URI LABEL_VERBOSE = URI.create(XBRL_2003+"verbose");
	private static final URI LABEL_TOTAL = URI.create(XBRL_2003+"totalLabel");
	private static final URI LABEL_TERSE = URI.create(XBRL_2003+"terseLabel");

	// label xbrl iasb
	private static final URI LABEL_ROLE_NEGATED = URI.create(XBRL_IASB+"label/labelNegated");
	private static final URI LABEL_TERSE_NEGATED = URI.create(XBRL_IASB+"label/terseLabelNegated");
	private static final URI LABEL_NET = URI.create(XBRL_IASB+"label/netLabel");

        public XBRLLabelExtractionPolicy() {
            super(Arrays.asList(new LabelExtractor[] {
                new CustomLabelExtractionPolicy(LABEL_ROLE),
                new CustomLabelExtractionPolicy(LABEL_VERBOSE),
                new CustomLabelExtractionPolicy(LABEL_TOTAL),
                new CustomLabelExtractionPolicy(LABEL_TERSE),
                new CustomLabelExtractionPolicy(LABEL_NET)
            }),true);
        }

	/*
	private boolean isXBRLLabel(AnnotationProperty annoProp) {
		URI uri = annoProp.getURI();
		if (
				uri.equals(LABEL_ROLE) ||
				uri.equals(LABEL_VERBOSE) ||
				uri.equals(LABEL_TOTAL) ||
				uri.equals(LABEL_TERSE) ||
				uri.equals(LABEL_ROLE_NEGATED) ||
				uri.equals(LABEL_TERSE_NEGATED) ||
				uri.equals(LABEL_NET)
		)
			return true;
		return false;
	}

	@Override
	public Map<Language, Collection<String>> getLabels(Entity entity) {
		Map<Language, Collection<String>> labelMap = new HashMap<Language, Collection<String>>();
		for (AnnotationProperty annoProp : entity.getAnnotations().keySet()) {
			if (isXBRLLabel(annoProp)) {
				for (AnnotationValue annoValue : entity.getAnnotationValues(annoProp)) {
                    if (annoValue instanceof LiteralValue) {
                        LiteralValue value = (LiteralValue) annoValue;
                        Language lang = value.getLanguage() == null ? LabelExtractor.NO_LANGUAGE : value.getLanguage();
                        Collection<String> labels;
                        if (!labelMap.containsKey(lang))
                        	labels = new HashSet<String>();
                        else
                        	labels = labelMap.get(lang);
                        // remove properties in label
                        String labelValue = value.getValue();
                        labelValue = labelValue.replaceAll("( ){0,1}\\[.*\\]$", "");
                        labels.add(labelValue);
                        labelMap.put(lang, labels);
                    }
                }
			}
		}
		if (entity instanceof Individual) {
			// TODO
		}
		return labelMap;
	}*/

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<rules
    xmlns="http://namespaces.plone.org/diazo"
    xmlns:css="http://namespaces.plone.org/diazo/css"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <theme href="dist/signin/index.html" css:if-content="body.template-login_form" />
    <theme href="dist/signin/index.html" css:if-content="body.template-logged_out" />
    <theme href="dist/signin/index.html" css:if-content="body.template-login_failed" />
    <theme href="dist/signin/index.html" css:if-content="body.template-mail_password_form" />
    <theme href="dist/signin/index.html" css:if-content="body.template-mail_password_response" />
    <theme href="dist/signin/index.html" css:if-content="body.template-pwreset_form" />
    <theme href="dist/signin/index.html" css:if-content="body.template-pwreset_finish" />
    <theme href="dist/frontpage/index.html" css:if-content="body.template-frontpage-view" />

    <theme href="dist/index.html" css:if-content="body.subsection-einzelzimmer-basic" />
    <theme href="dist/index.html" css:if-content="body.subsection-einzelzimmer-komfort" />
    <theme href="dist/index.html" css:if-content="body.subsection-doppelzimmer" />
    <theme href="dist/index.html" css:if-content="body.subsection-familienzimmer" />
    <theme href="dist/index.html" css:if-content="body.subsection-appartement-ferienwohnung" />

    <theme href="dist/index.html" css:if-content="body.subsection-basic-single-room" />
    <theme href="dist/index.html" css:if-content="body.subsection-comfort-single-room" />
    <theme href="dist/index.html" css:if-content="body.subsection-double-room" />
    <theme href="dist/index.html" css:if-content="body.subsection-double-room" />
    <theme href="dist/index.html" css:if-content="body.subsection-family-room" />
    <theme href="dist/index.html" css:if-content="body.subsection-apartment-or-holiday-home" />
    <theme href="dist/index.html" css:if-content="body.subsection-journey" />
    <theme href="dist/index.html" css:if-content="body.subsection-parking" />

    <theme href="dist/stay/index.html" css:if-content="body.section-uebernachten" />
    <theme href="dist/stay/index.html" css:if-content="body.section-accommodation" />

    <theme href="dist/index.html" css:if-content="body.subsection-hakuna-matata-grosser-saal" />
    <theme href="dist/index.html" css:if-content="body.subsection-tutaonana-kleiner-saal" />
    <theme href="dist/index.html" css:if-content="body.subsection-weitblick" />
    <theme href="dist/index.html" css:if-content="body.subsection-seminarraum-1-und-2" />
    <theme href="dist/index.html" css:if-content="body.subsection-konferenzraum-1-und-2" />
    <theme href="dist/index.html" css:if-content="body.subsection-efeueck" />
    <theme href="dist/index.html" css:if-content="body.subsection-tagungstechnik-und-equipment" />
    <theme href="dist/index.html" css:if-content="body.subsection-fuer-leib-und-seele" />
    <theme href="dist/meet/index.html" css:if-content="body.section-tagen-mitten-in-der-stadt" />
    <theme href="dist/booking/index.html" css:if-content="body.section-booking" />
    <theme href="dist/augsburg/index.html" css:if-content="body.section-augsburg" />

    <theme href="dist/drz/index.html" css:if-content="body.section-restaurant-zeit-los" />
    <theme href="dist/index.html" css:if-content="body.portaltype-dhp-sitecontent-contentpage" />
    <theme href="dist/full/index.html" css:if-content="body.template-search" />

    <rules css:if-content="#visual-portal-wrapper">

        <notheme if="$ajax_load" />
        <theme href="dist/index.html" />

        <copy attributes="*" css:theme="html" css:content="html" />
        <replace css:theme="title" css:content="title" />
        <after theme="/html/head/title" css:content="base" />

        <drop css:content="meta[name='viewport']" />
        <before content="/html/head/meta" theme="/html/head/title" />

        <after
            content="/html/head/link | /html/head/style | /html/head/script"
            theme="/html/head/script"
        />

        <rules css:if-content="body.userrole-authenticated">

            <drop theme="/html/head/style" />
        </rules>

        <drop theme="/html/body/script" />

        <drop css:content="head link[rel='apple-touch-icon-precomposed']" />
        <drop css:content="head link[rel='apple-touch-icon']" />
        <drop css:content="head link[rel='shortcut icon']" />

        <merge attributes="class" css:content="body" css:theme="body" />
        <copy attributes="*" css:content="body" css:theme="body" />

        <drop css:theme="#app-toolbar"
            css:if-content=".userrole-anonymous" />

        <replace css:theme="#app-toolbar"
            css:content="#edit-bar"
            css:if-not-content=".ajax_load"
            css:if-content=".userrole-authenticated"/>

        <copy attributes="href" css:content="#portal-logo" css:theme="a.app-brandname" />
        <copy attributes="href" css:content="#portal-logo" css:theme="a.app-navbar-brand" />
        <copy attributes="href" css:content="#portal-logo" css:theme="a.app-navbar-section" />

        <replace css:theme="#app-nav-bar" css:content="#app-nav-bar" />

        <replace css:content="#portal-breadcrumbs" method="raw" if-content="//*[@id='breadcrumbs-1']">

                <xsl:for-each select="./div/ol/li[not(position() = last())]//a">

                        <xsl:apply-templates select="."/>

                </xsl:for-each>

                    <xsl:apply-templates select="./div/ol/li[position() = last()]/*"/>

        </replace>
        <replace css:theme-children="#app-pathbar" css:content="#portal-breadcrumbs" />

        <replace css:content-children="#content-core"
                css:theme-children="#app-signin-body"
                css:if-content="body.template-login_form" />
        <replace css:content-children="#content-core"
                css:theme-children="#app-signin-content"
                css:if-content="body.template-login_failed" />
        <replace css:content-children="#content-core"
                css:theme-children="#app-signin-body"
                css:if-content="body.template-logged_out" />
        <replace css:content-children="#content"
                css:theme-children="#app-signin-content"
                css:if-content="body.template-mail_password_form" />
        <replace css:content-children="#content"
                css:theme-children="#app-signin-content"
                css:if-content="body.template-mail_password_response" />
        <replace css:content-children="#content"
                css:theme-children="#app-signin-content"
                css:if-content="body.template-pwreset_form" />
        <replace css:content-children="#content"
                css:theme-children="#app-signin-content"
                css:if-content="body.template-pwreset_finish" />

        <drop css:theme="#app-banner"
                css:if-not-content="#app-banner" />

        <replace css:content="#app-banner"
                css:theme="#app-banner"
                css:if-content="#app-banner" />

        <replace css:content=".documentFirstHeading">

                    <xsl:apply-templates />

        </replace>

        <replace css:content=".documentDescription">

                <xsl:apply-templates />

        </replace>

         <replace css:content="#content-core">

                 <xsl:apply-templates />

         </replace>

        <replace css:content-children="#content"
            css:theme-children="#content" />

            <replace css:content="table.listing">

                <xsl:copy-of select="@*"/>
                <xsl:attribute name="class">table table-hover</xsl:attribute>
                <xsl:apply-templates />

            </replace>

        <after css:theme="#content"
          css:content="#app-contact-viewlet-elements"
          css:if-content="#app-contact-viewlet-elements" />

        <before css:content=".portalMessage" css:theme="#content" />
        <strip css:content=".portalMessage dd"/>
        <replace css:content=".portalMessage" >
          <xsl:choose>
              <xsl:when css:test=".portalMessage[style]"/>
              <xsl:when css:test=".portalMessage">

                      <xsl:choose>
                          <xsl:when css:test=".info">
                              <xsl:attribute name="class">app-callout app-callout-success alert-dismissable</xsl:attribute>
                          </xsl:when>
                          <xsl:when css:test=".error">
                              <xsl:attribute name="class">app-callout app-callout-danger alert-dismissable</xsl:attribute>
                          </xsl:when>
                          <xsl:when css:test=".warning">
                              <xsl:attribute name="class">app-callout app-callout-warning alert-dismissable</xsl:attribute>
                          </xsl:when>
                      </xsl:choose>

<xsl:apply-templates select="./dt/*"/>

                      <xsl:apply-templates />

              </xsl:when>
          </xsl:choose>
        </replace>

        <replace css:content=".formHelp">
              <xsl:copy>
                <xsl:copy-of select="@*" />
                <xsl:attribute name="class"><xsl:value-of select="./@class" /> help-block</xsl:attribute>
                <xsl:apply-templates />
              </xsl:copy>
            </replace>

        <replace css:content="span.required">
          <xsl:copy>
            <xsl:copy-of select="@*" />
            <xsl:attribute name="class"><xsl:value-of select="./@class" /> text-warning</xsl:attribute>
            <xsl:apply-templates />
          </xsl:copy>
        </replace>

        <replace content="//*[contains(@class, 'fieldRequired')]/@class">
          <xsl:attribute name="class"><xsl:value-of select="." /> text-warning</xsl:attribute>
        </replace>

        <drop content="//label/span[@class='label']/@class" />

        <replace css:content=".field">
          <xsl:copy>
            <xsl:copy-of select="@*" />
            <xsl:choose>
               <xsl:when css:test=".error">
                 <xsl:attribute name="class"><xsl:value-of select="./@class" /> form-group has-error</xsl:attribute>
               </xsl:when>
               <xsl:otherwise>
                 <xsl:attribute name="class"><xsl:value-of select="./@class" /> form-group</xsl:attribute>
               </xsl:otherwise>
            </xsl:choose>
            <xsl:if test="not(*[@class='widget']) and not(table)">
              <xsl:choose>
                  <xsl:when css:test="[type='xradio']">
                      <xsl:attribute name="class">form-control radio</xsl:attribute>
                  </xsl:when>
                  <xsl:when css:test="[type='xcheckbox']">
                      <xsl:attribute name="class">form-control checkbox</xsl:attribute>
                  </xsl:when>
              </xsl:choose>
            </xsl:if>
              <xsl:apply-templates />
          </xsl:copy>

        </replace>

        <replace css:content="input">
            <xsl:choose>
                <xsl:when css:test="[type='submit'],[type='button']">
                    <button>
                        <xsl:copy-of select="@*" />
                        <xsl:choose>
                            <xsl:when css:test=".delete, .destructive, [value='Delete']">
                                <xsl:attribute name="class"><xsl:value-of select="./@class" /> btn btn-danger</xsl:attribute>
                            </xsl:when>
                            <xsl:when css:test=".searchButton, .context">
                                <xsl:attribute name="class"><xsl:value-of select="./@class" /> btn btn-primary</xsl:attribute>
                            </xsl:when>
                            <xsl:when css:test=".standalone, .submit, .submit-widget, [type='file']">
                                <xsl:attribute name="class"><xsl:value-of select="./@class" /> btn btn-default</xsl:attribute>
                            </xsl:when>
                            <xsl:otherwise>
                              <xsl:attribute name="class"><xsl:value-of select="./@class" /> btn btn-default</xsl:attribute>
                            </xsl:otherwise>
                        </xsl:choose>
                        <xsl:value-of select="./@value"/>
                    </button>
                </xsl:when>
                <xsl:when css:test="[type='text'][name$='.title'],#title, textarea">
                    <xsl:copy>
                        <xsl:copy-of select="@*" />
                        <xsl:attribute name="class"><xsl:value-of select="./@class" /> form-control</xsl:attribute>
                        <xsl:apply-templates />
                    </xsl:copy>
                </xsl:when>
                <xsl:when css:test="[class='label checkboxType']">
                    <xsl:copy>
                        <xsl:copy-of select="@*" />
                        <xsl:attribute name="class">checkboxType</xsl:attribute>
                        <xsl:apply-templates />
                    </xsl:copy>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:copy-of select="."/>
                </xsl:otherwise>
            </xsl:choose>
        </replace>

        <replace css:content=".configlets">

                <xsl:apply-templates />

        </replace>

         <replace css:content=".portletNavigationTree" css:if-not-content=".template-overview-controlpanel">

                        <xsl:for-each css:select=".portletContent > *">

                                <xsl:if test="@class[contains(.,'navTreeLevel0')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-0</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeLevel1')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-1</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeLevel2')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-2</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeItem')]">
                                    <xsl:attribute name="class"><xsl:value-of select="./@class" /> app-nav-list-item</xsl:attribute>
                                </xsl:if>
                                <xsl:for-each css:select=".navTreeItem">

                                        <xsl:copy-of select="./a/@*[local-name() != 'class']"/>
                                       <xsl:attribute name="class"><xsl:value-of select="./@class" /> app-nav-list-link</xsl:attribute>
                                       <xsl:copy-of select="./a/text()" />

                                </xsl:for-each>

                        </xsl:for-each>

        </replace>

        <replace css:content=".portlet" css:if-content=".portletNavigationTree">

                        <xsl:for-each css:select=".portletContent > *">

                                <xsl:if test="@class[contains(.,'navTreeLevel0')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-0</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeLevel1')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-1</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeLevel2')]">
                                    <xsl:attribute name="class">app-nav-list app-nav-level-2</xsl:attribute>
                                </xsl:if>
                                <xsl:if test="@class[contains(.,'navTreeItem')]">
                                    <xsl:attribute name="class"><xsl:value-of select="./@class" /> app-nav-list-item</xsl:attribute>
                                </xsl:if>
                                <xsl:copy-of select="node()" />

                        </xsl:for-each>

        </replace>

        <replace css:content=".portlet" css:if-not-content=".portletNavigationTree">

                <xsl:choose>
                    <xsl:when css:test=".portletNavigationTree">
                        <xsl:attribute name="class">app-card app-card-nav app-nav-list</xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:attribute name="class">app-card app-card-default</xsl:attribute>
                    </xsl:otherwise>
                </xsl:choose>
                <xsl:for-each css:select=".portlet > *">

                        <xsl:if test="@class[contains(.,'portletHeader')]">
                            <xsl:attribute name="class">app-card-header</xsl:attribute>
                        </xsl:if>
                        <xsl:if test="@class[contains(.,'portletContent')]">
                            <xsl:attribute name="class">app-card-main</xsl:attribute>
                        </xsl:if>
                        <xsl:if test="@class[contains(.,'portletFooter')]">
                            <xsl:attribute name="class">app-card-footer</xsl:attribute>
                        </xsl:if>
                        <xsl:copy-of select="node()"/>

                </xsl:for-each>

        </replace>

        <replace css:content-children="#app-news-list"
            css:theme-children="#app-news-list-frontpage" />

        <replace css:content-children="#portal-column-one > *"
            css:theme-children="#app-sidebar" />
        <replace css:content-children="#portal-column-two > *"
            css:theme-children="#app-sidebar" />

        <after css:theme-children="#app-sidebar"
          css:content-children="#app-contact-viewlet-cards" />

        <drop css:theme="#app-actionbar-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-actionbar-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-languageselector-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-languageselector-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-intro-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-intro-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-frontpage-cards-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-frontpage-cards-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-section-cards-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-section-cards-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-footer-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-footer-en"
          css:if-content="body.site-de" />

        <drop css:theme="#app-booking-intro-de"
          css:if-content="body.site-en" />

        <drop css:theme="#app-booking-intro-en"
          css:if-content="body.site-de" />

        <after css:theme-children="#app-footer"
               css:content="#cookie-consent"
               css:if-content="#cookie-consent" />

    </rules>

</rules>


text:
namespace Apache.Ignite.Core.Cluster
{
    using System;
    using System.Collections.Generic;

    ///
    /// Interface representing a single cluster node. Use <see cref="IClusterNode.Attribute{T}(string)"/> or
    /// <see cref="IClusterNode.Metrics()"/> to get static and dynamic information about remote nodes.
    /// You can get a list of all nodes in grid by calling <see cref="IClusterGroup.Nodes()"/>
    /// on <see cref="IIgnite"/> instance.
    /// <para />
    /// You can use Ignite node attributes to provide static information about a node.
    /// This information is initialized once within grid, during node startup, and
    /// remains the same throughout the lifetime of a node.
    /// <para/>
    /// All members are thread-safe and may be used concurrently from multiple threads.
    ///
    public interface IClusterNode {
        ///
        /// Globally unique node ID. A new ID is generated every time a node restarts.
        ///
        Guid Id
        {
            get;
        }

        ///
        /// Gets node's attribute. Attributes are assigned to nodes at startup.
        /// <para />
        /// Note that attributes cannot be changed at runtime.
        ///
        /// <param name="name">Attribute name.</param>
        /// <returns>Attribute value.</returns>
        T Attribute<T>(string name);

        ///
        /// Try getting node's attribute. Attributes are assigned to nodes at startup.
        /// <para />
        /// Note that attributes cannot be changed at runtime.
        ///
        /// <param name="name">Attribute name.</param>
        /// <param name="attr">Attribute value.</param>
        /// <returns>true in case such attribute exists.</returns>
        bool TryGetAttribute<T>(string name, out T attr);

        ///
        /// Gets all node attributes. Attributes are assigned to nodes at startup.
        /// <para />
        /// Note that attributes cannot be changed at runtime.
        ///
        /// <returns>All node attributes.</returns>
        IDictionary<string, object> Attributes();

        ///
        /// Collection of addresses this node is known by.
        ///
        /// <returns>Collection of addresses.</returns>
        ICollection<string> Addresses
        {
            get;
        }

        ///
        /// Collection of host names this node is known by.
        ///
        /// <returns>Collection of host names.</returns>
        ICollection<string> HostNames
        {
            get;
        }

        ///
        /// Node order within grid topology. Discovery SPIs that support node ordering will
        /// assign a proper order to each node and will guarantee that discovery event notifications
        /// for new nodes will come in proper order. All other SPIs not supporting ordering
        /// may choose to return node startup time here.
        ///
        long Order
        {
            get;
        }

        ///
        /// Tests whether or not this node is a local node.
        ///
        bool IsLocal
        {
            get;
        }

        ///
        /// Tests whether or not this node is a daemon.
        ///

        /// Daemon nodes are the usual Ignite nodes that participate in topology but not
        /// visible on the main APIs, i.e. they are not part of any projections.
        ///

        /// Daemon nodes are used primarily for management and monitoring functionality that
        /// is build on Ignite and needs to participate in the topology but should be
        /// excluded from "normal" topology so that it won't participate in task execution
        /// or in-memory database.
        ///

        /// Application code should never use daemon nodes.
        ///
        bool IsDaemon
        {
            get;
        }

        ///
        /// Gets metrics snapshot for this node. Note that node metrics are constantly updated
        /// and provide up to date information about nodes. For example, you can get
        /// an idea about CPU load on remote node via <see cref="IClusterMetrics.CurrentCpuLoad"/>.
        /// <para/>
        /// Node metrics are updated with some delay which is directly related to heartbeat
        /// frequency. For example, when used with default GridTcpDiscoverySpi the
        /// update will happen every 2 seconds.
        ///
        /// <returns>Runtime metrics snapshot for this node.</returns>
        IClusterMetrics Metrics();
    }
}


text:
package ch.usi.dag.disl.test.suite.exception.junit;

import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import ch.usi.dag.disl.test.suite.DislOnlyTest;

@RunWith (JUnit4.class)
public class ExceptionTest extends DislOnlyTest {

}


text:
from __future__ import unicode_literals
from urllib import unquote

from django.contrib.gis.db.models import GeometryField
from django.utils import simplejson
from django.contrib.gis.geos import GEOSGeometry

from tastypie.fields import ApiField, CharField
from tastypie import resources

class GeometryApiField(ApiField):
    """
    Custom ApiField for dealing with data from GeometryFields (by serializing
    them as GeoJSON).
    """
    dehydrated_type = 'geometry'
    help_text = 'Geometry data.'

    def hydrate(self, bundle):
        value = super(GeometryApiField, self).hydrate(bundle)
        if value is None:
            return value
        return simplejson.dumps(value)

    def dehydrate(self, obj, for_list=False):
        return self.convert(super(GeometryApiField, self).dehydrate(obj))

    def convert(self, value):
        if value is None:
            return None

        if isinstance(value, dict):
            return value

        # Get ready-made geojson serialization and then convert it _back_ to
        # a Python object so that tastypie can serialize it as part of the
        # bundle.
        return simplejson.loads(value.geojson)

class ModelResource(resources.ModelResource):
    """
    ModelResource subclass that handles geometry fields as GeoJSON.
    """
    @classmethod
    def api_field_from_django_field(cls, f, default=CharField):
        """
        Overrides default field handling to support custom GeometryApiField.
        """
        if isinstance(f, GeometryField):
            return GeometryApiField

        return super(ModelResource, cls).api_field_from_django_field(f, default)

    def filter_value_to_python(self, value, field_name, filters, filter_expr,
            filter_type):
        value = super(ModelResource, self).filter_value_to_python(
            value, field_name, filters, filter_expr, filter_type)

        # If we are filtering on a GeometryApiField then we should try
        # and convert this to a GEOSGeometry object.  The conversion
        # will fail if we don't have value JSON, so in that case we'll
        # just return ``value`` as normal.
        if isinstance(self.fields[field_name], GeometryApiField):
            try:
                value = GEOSGeometry(unquote(value))
            except ValueError:
                pass
        return value


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.

#include <stdint.h>

#include "native_client/src/shared/platform/nacl_check.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_core.h"
#include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h"
#include "ppapi/native_client/tests/ppapi_test_lib/test_interface.h"

namespace {

void CrashingCallback(void* /*user_data*/, int32_t /*result*/) {
  printf("--- CrashingCallback\n");
  CRASH;
}

void CrashInCallback() {
  printf("--- CrashInCallback\n");
  PP_CompletionCallback callback =
      PP_MakeCompletionCallback(CrashingCallback, NULL);
  PPBCore()->CallOnMainThread(0 /*delay*/, callback, PP_OK);
}

}  // namespace

void SetupTests() {
  RegisterTest("CrashInCallback", CrashInCallback);
}

void SetupPluginInterfaces() {
  // none
}


text:
export function walk ( ast, { enter, leave }) {
	visit( ast, null, enter, leave );
}

const context = {
	skip: () => context.shouldSkip = true,
	shouldSkip: false
};

let childKeys = {};

const toString = Object.prototype.toString;

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

function visit ( node, parent, enter, leave, prop, index ) {
	if ( !node ) return;

	if ( enter ) {
		context.shouldSkip = false;
		enter.call( context, node, parent, prop, index );
		if ( context.shouldSkip ) return;
	}

	const keys = childKeys[ node.type ] || (
		childKeys[ node.type ] = Object.keys( node ).filter( key => typeof node[ key ] === 'object' )
	);

	for ( let i = 0; i < keys.length; i += 1 ) {
		const key = keys[i];
		const value = node[ key ];

		if ( isArray( value ) ) {
			for ( let j = 0; j < value.length; j += 1 ) {
				visit( value[j], node, enter, leave, key, j );
			}
		}

		else if ( value && value.type ) {
			visit( value, node, enter, leave, key, null );
		}
	}

	if ( leave ) {
		leave( node, parent, prop, index );
	}
}


text: export * from "./texts.component";


text:
package com.android.volley;

import android.os.Process;
import androidx.annotation.VisibleForTesting;
import java.util.concurrent.BlockingQueue;

/**
 * Provides a thread for performing cache triage on a queue of requests.
 *
 * <p>Requests added to the specified cache queue are resolved from cache. Any deliverable response
 * is posted back to the caller via a {@link ResponseDelivery}. Cache misses and responses that
 * require refresh are enqueued on the specified network queue for processing by a {@link
 * NetworkDispatcher}.
 */
public class CacheDispatcher extends Thread {

    private static final boolean DEBUG = VolleyLog.DEBUG;

    /** The queue of requests coming in for triage. */
    private final BlockingQueue<Request<?>> mCacheQueue;

    /** The queue of requests going out to the network. */
    private final BlockingQueue<Request<?>> mNetworkQueue;

    /** The cache to read from. */
    private final Cache mCache;

    /** For posting responses. */
    private final ResponseDelivery mDelivery;

    /** Used for telling us to die. */
    private volatile boolean mQuit = false;

    /** Manage list of waiting requests and de-duplicate requests with same cache key. */
    private final WaitingRequestManager mWaitingRequestManager;

    /**
     * Creates a new cache triage dispatcher thread. You must call {@link #start()} in order to
     * begin processing.
     *
     * @param cacheQueue Queue of incoming requests for triage
     * @param networkQueue Queue to post requests that require network to
     * @param cache Cache interface to use for resolution
     * @param delivery Delivery interface to use for posting responses
     */
    public CacheDispatcher(
            BlockingQueue<Request<?>> cacheQueue,
            BlockingQueue<Request<?>> networkQueue,
            Cache cache,
            ResponseDelivery delivery) {
        mCacheQueue = cacheQueue;
        mNetworkQueue = networkQueue;
        mCache = cache;
        mDelivery = delivery;
        mWaitingRequestManager = new WaitingRequestManager(this, networkQueue, delivery);
    }

    /**
     * Forces this dispatcher to quit immediately. If any requests are still in the queue, they are
     * not guaranteed to be processed.
     */
    public void quit() {
        mQuit = true;
        interrupt();
    }

    @Override
    public void run() {
        if (DEBUG) VolleyLog.v("start new dispatcher");
        Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);

        // Make a blocking call to initialize the cache.
        mCache.initialize();

        while (true) {
            try {
                processRequest();
            } catch (InterruptedException e) {
                // We may have been interrupted because it was time to quit.
                if (mQuit) {
                    Thread.currentThread().interrupt();
                    return;
                }
                VolleyLog.e(
                        "Ignoring spurious interrupt of CacheDispatcher thread; "
                                + "use quit() to terminate it");
            }
        }
    }

    // Extracted to its own method to ensure locals have a constrained liveness scope by the GC.
    // This is needed to avoid keeping previous request references alive for an indeterminate amount
    // of time. Update consumer-proguard-rules.pro when modifying this. See also
    // https://github.com/google/volley/issues/114
    private void processRequest() throws InterruptedException {
        // Get a request from the cache triage queue, blocking until
        // at least one is available.
        final Request<?> request = mCacheQueue.take();
        processRequest(request);
    }

    @VisibleForTesting
    void processRequest(final Request<?> request) throws InterruptedException {
        request.addMarker("cache-queue-take");
        request.sendEvent(RequestQueue.RequestEvent.REQUEST_CACHE_LOOKUP_STARTED);

        try {
            // If the request has been canceled, don't bother dispatching it.
            if (request.isCanceled()) {
                request.finish("cache-discard-canceled");
                return;
            }

            // Attempt to retrieve this item from cache.
            Cache.Entry entry = mCache.get(request.getCacheKey());
            if (entry == null) {
                request.addMarker("cache-miss");
                // Cache miss; send off to the network dispatcher.
                if (!mWaitingRequestManager.maybeAddToWaitingRequests(request)) {
                    mNetworkQueue.put(request);
                }
                return;
            }

            // Use a single instant to evaluate cache expiration. Otherwise, a cache entry with
            // identical soft and hard TTL times may appear to be valid when checking isExpired but
            // invalid upon checking refreshNeeded(), triggering a soft TTL refresh which should be
            // impossible.
            long currentTimeMillis = System.currentTimeMillis();

            // If it is completely expired, just send it to the network.
            if (entry.isExpired(currentTimeMillis)) {
                request.addMarker("cache-hit-expired");
                request.setCacheEntry(entry);
                if (!mWaitingRequestManager.maybeAddToWaitingRequests(request)) {
                    mNetworkQueue.put(request);
                }
                return;
            }

            // We have a cache hit; parse its data for delivery back to the request.
            request.addMarker("cache-hit");
            Response<?> response =
                    request.parseNetworkResponse(
                            new NetworkResponse(entry.data, entry.responseHeaders));
            request.addMarker("cache-hit-parsed");

            if (!response.isSuccess()) {
                request.addMarker("cache-parsing-failed");
                mCache.invalidate(request.getCacheKey(), true);
                request.setCacheEntry(null);
                if (!mWaitingRequestManager.maybeAddToWaitingRequests(request)) {
                    mNetworkQueue.put(request);
                }
                return;
            }
            if (!entry.refreshNeeded(currentTimeMillis)) {
                // Completely unexpired cache hit. Just deliver the response.
                mDelivery.postResponse(request, response);
            } else {
                // Soft-expired cache hit. We can deliver the cached response,
                // but we need to also send the request to the network for
                // refreshing.
                request.addMarker("cache-hit-refresh-needed");
                request.setCacheEntry(entry);
                // Mark the response as intermediate.
                response.intermediate = true;

                if (!mWaitingRequestManager.maybeAddToWaitingRequests(request)) {
                    // Post the intermediate response back to the user and have
                    // the delivery then forward the request along to the network.
                    mDelivery.postResponse(
                            request,
                            response,
                            new Runnable() {
                                @Override
                                public void run() {
                                    try {
                                        mNetworkQueue.put(request);
                                    } catch (InterruptedException e) {
                                        // Restore the interrupted status
                                        Thread.currentThread().interrupt();
                                    }
                                }
                            });
                } else {
                    // request has been added to list of waiting requests
                    // to receive the network response from the first request once it returns.
                    mDelivery.postResponse(request, response);
                }
            }
        } finally {
            request.sendEvent(RequestQueue.RequestEvent.REQUEST_CACHE_LOOKUP_FINISHED);
        }
    }
}


text:
#ifndef util_gui_cutscene_h
#define util_gui_cutscene_h

#include "fadetool.h"
#include "util/pointer.h"
#include "animation.h"
#include "util/file-system.h"

#include <string>
#include <vector>

class Token;
namespace Graphics{
class Bitmap;
}

namespace Gui{

/*! Cut scenes or story boards */
class Scene{
public:
    Scene(const Token *);
    virtual ~Scene();

    virtual void forward(int tickCount = 1);
    virtual void reverse(int tickCount = 1);
    virtual void act();
    virtual void render(const Graphics::Bitmap &);

    virtual void addAnimation(const Util::ReferenceCount<Gui::Animation> &);

    virtual void reset();
    virtual void setToEnd();

    virtual bool done() const;

    virtual inline void setEnd(int ticks){
        this->endTicks = ticks;
    }

    virtual inline Gui::AnimationManager & getManager(){
        return this->backgrounds;
    }

protected:
    void parseScene(const Token * token);

protected:
    int ticks;
    int endTicks;

    Gui::AnimationManager backgrounds;

    Gui::FadeTool fader;
};

class CutScene{
public:
    CutScene();
    CutScene(const Filesystem::AbsolutePath & path);
    CutScene(const Token *);
    virtual ~CutScene();

    virtual void setName(const std::string &);
    virtual inline const std::string & getName() const {
        return this->name;
    }
    virtual void setResolution(int w, int h);
    virtual void setScene(unsigned int scene);
    virtual inline int getScene() const{
        return this->current;
    }

    /*! Return current scene */
    virtual Util::ReferenceCount<Scene> getCurrent();

    /* play all scenes in order */
    virtual void playAll();

    /* plays the current scene which may consists of several animations */
    virtual void playScene();

    /* play a specific scene */
    virtual void playScene(unsigned scene);

    /* advance to the next scene */
    virtual void next();
    virtual bool hasMore();

protected:
    virtual void load(const Token * token);

protected:
    std::string name;
    int width;
    int height;
    std::vector< Util::ReferenceCount<Scene> > scenes;
    unsigned int current;
};
}
#endif


text:
/**
 * jBeep
 *
 * Play WAV beeps easily in javascript!
 * Tested on all popular browsers and works perfectly, including IE6.
 *
 * @date 10-19-2012
 * @license MIT
 * @author Everton (www.ultraduz.com.br)
 * @version 1.0
 * @params soundFile The .WAV sound path
 */
function jBeep(soundFile){

	if (!soundFile) soundFile = "jBeep/jBeep.wav";

	var soundElem, bodyElem, isHTML5;

	isHTML5 = true;
	try {
		if (typeof document.createElement("audio").play=="undefined") isHTML5 = false;
	}
	catch (ex){
		isHTML5 = false;
	}

	bodyElem = document.getElementsByTagName("body")[0];
	if (!bodyElem) bodyElem = document.getElementsByTagName("html")[0];

	soundElem = document.getElementById("jBeep");
	if (soundElem) bodyElem.removeChild(soundElem);

	if (isHTML5) {

		soundElem = document.createElement("audio");
		soundElem.setAttribute("id", "jBeep");
		soundElem.setAttribute("src", soundFile);
		soundElem.play();

	}
	else if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){

		soundElem = document.createElement("bgsound");
		soundElem.setAttribute("id", "jBeep");
		soundElem.setAttribute("loop", 1);
		soundElem.setAttribute("src", soundFile);

		bodyElem.appendChild(soundElem);

	}
	else {

		var paramElem;

		soundElem = document.createElement("object");
		soundElem.setAttribute("id", "jBeep");
		soundElem.setAttribute("type", "audio/wav");
		soundElem.setAttribute("style", "display:none;");
		soundElem.setAttribute("data", soundFile);

		paramElem = document.createElement("param");
		paramElem.setAttribute("name", "autostart");
		paramElem.setAttribute("value", "false");

		soundElem.appendChild(paramElem);
		bodyElem.appendChild(soundElem);

		try {
			soundElem.Play();
		}
		catch (ex) {
			soundElem.object.Play();
		}

	}

}


text:
namespace google {
namespace cloud {
namespace automl_internal {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN

std::shared_ptr<AutoMlStub> CreateDefaultAutoMlStub(
    google::cloud::CompletionQueue cq, Options const& options) {
  auto auth = google::cloud::internal::CreateAuthenticationStrategy(
      std::move(cq), options);
  auto channel = auth->CreateChannel(options.get<EndpointOption>(),
                                     internal::MakeChannelArguments(options));
  auto service_grpc_stub = google::cloud::automl::v1::AutoMl::NewStub(channel);
  std::shared_ptr<AutoMlStub> stub = std::make_shared<DefaultAutoMlStub>(
      std::move(service_grpc_stub),
      google::longrunning::Operations::NewStub(channel));

  if (auth->RequiresConfigureContext()) {
    stub = std::make_shared<AutoMlAuth>(std::move(auth), std::move(stub));
  }
  stub = std::make_shared<AutoMlMetadata>(std::move(stub));
  if (internal::Contains(options.get<TracingComponentsOption>(), "rpc")) {
    GCP_LOG(INFO) << "Enabled logging for gRPC calls";
    stub = std::make_shared<AutoMlLogging>(
        std::move(stub), options.get<GrpcTracingOptionsOption>(),
        options.get<TracingComponentsOption>());
  }
  return stub;
}

GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}  // namespace automl_internal
}  // namespace cloud
}  // namespace google


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

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>G-Index</title>
<meta name="date" content="2015-01-22">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M N O P R S T U W

G

get(CharSequence) - Static method in class com.share.mod.common.utils.HttpRequest

Start a 'GET' request to the given URL

get(URL) - Static method in class com.share.mod.common.utils.HttpRequest

Start a 'GET' request to the given URL

get(CharSequence, Map<?, ?>, boolean) - Static method in class com.share.mod.common.utils.HttpRequest

Start a 'GET' request to the given URL along with the query params

get(CharSequence, boolean, Object...) - Static method in class com.share.mod.common.utils.HttpRequest

Start a 'GET' request to the given URL along with the query params

getBean(HttpServletRequest, Class<T>) - Static method in class com.share.mod.common.utils.ReqBeanUtil

getBean(Map<String, String[]>, Class<T>) - Static method in class com.share.mod.common.utils.ReqBeanUtil

getCause() - Method in exception com.share.mod.common.utils.HttpRequest.HttpRequestException

Get IOException that triggered this request exception

getConnection() - Method in class com.share.mod.common.utils.HttpRequest

Get underlying connection

getInterfaceImpl(Class<T>) - Static method in class com.share.mod.common.utils.ClassUtil

getParameter(String) - Method in class com.share.mod.common.req.ParameterRequestWrapper

getParameterMap() - Method in class com.share.mod.common.req.ParameterRequestWrapper

getParameterNames() - Method in class com.share.mod.common.req.ParameterRequestWrapper

getParameterValues(String) - Method in class com.share.mod.common.req.ParameterRequestWrapper

A B C D E F G H I K L M N O P R S T U W

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
![banner](https://raw.github.com/Intermark/IMQuickSearch/master/Images/banner.png)

## About

IMQuickSearch is a tool for quickly filtering multiple NSArrays that contain a variety of custom NSObject classes. It takes any value, and is not limited purely by an NSString. You can filter an NSObject by an NSNumber if you so choose. However, since its primary focus is for quickly filtering objects, when you filter by an NSString it performs a contains search - searching for "Bo" returns "Bob," "Probowl" and "Bojangles."

[![Build Status](https://travis-ci.org/Intermark/IMQuickSearch.png)](https://travis-ci.org/Intermark/IMQuickSearch)

![Demo](Images/Demo.gif)

## Installation

All of the important classes are located in the top-level directory `Classes`. The files you want to copy into your project are:

* `IMQuickSearch.{h,m}`
* `IMQuickSearchFilter.{h,m}`

Just `#import "IMQuickSearch.h"` in any class you want to use IMQuickSearch in.

**Cocoapods**

`pod 'IMQuickSearch'`

## Setting Up IMQuickSearch

To begin, you are going to want to have your NSArrays of NSObjects already populated and at your disposal. From here, you're going to create your IMQuickSearchFilter objects like so:

```objc
// Create People
IMPerson *p1 = ({
    IMPerson *p = [IMPerson new];
    p.firstName = @"Bob";
    p.LastName = @"Williams";
    p;
});

IMPerson *p2 = ({
    IMPerson *p = [IMPerson new];
    p.firstName = @"Alice";
    p.LastName = @"Johnson";
    p;
});

// Create Animals
IMAnimal *a1 = ({
    IMAnimal *a = [IMAnimal new];
    a.name = @"Aligator";
    a;
});

IMAnimal *a2 = ({
    IMAnimal *a = [IMAnimal new];
    a.name = @"Bison";
    a;
});

// Create Filters
IMQuickSearchFilter *peopleFilter = [IMQuickSearchFilter filterWithSearchArray:@[p1, p2] keys:@[@"firstName",@"lastName"]];
IMQuickSearchFilter *animalFilter = [IMQuickSearchFilter filterWithSearchArray:@[a1, a2] keys:@[@"name"]];
```
So here I just created two filters, one for an array of people and one for an array of animals. The keys parameter corresponds directly to properties on the objects inside of each array. For instance, I have a Person object with a `firstName` and a `lastName` property, hence the two keys I added to the first filter. You don't have to add all of the properties to the keys array; just add the ones you want to filter by.

Next you are going to initialize your IMQuickSearch master object with the two filters you created:

```objc
self.QuickSearch = [[IMQuickSearch alloc] initWithFilters:@[peopleFilter,animalFilter]];
```

After this, you are ready to search!

## Searching using IMQuickSearch

Searching through your arrays could not be easier. There is but one method call to make:

```objc
NSArray *filteredResults = [self.QuickSearch filteredObjectsWithValue:@"al"];

// filteredResults = @[p2,a1];
```

Here I filtered both arrays from the first example by the value `@"al"` which returned one combined array with the p2 and the a1 object. This is because `p2.firstName == @"Alice"` and `a1.name == @"Aligator"`. The other objects in both arrays don't match the value to be filtered by.

Filtering with NSStrings will probably be the most common use case, but you can filter by other class types as well. NSString filtering runs a comparison search over the property, resulting in fast filtering by strings. Any other value runs an equals search over the property matching value types exactly. For instance, if you are searching an NSNumber property with a value of `@4` then only properties that match will be returned, not a property whose value is `@40`.

**Asyncronously Searching**

The main `filteredObjectsWithValue:` method searches the objects synchronously, on the main thread. However, if your data set is fairly large, you may want to move this work to a background thread so as not to disrupt or freeze the UI. You can do this with the following method:

```objc
__block NSArray *results;
[self.QuickSearch asynchronouslyFilterObjectsWithValue:@"Hello" completion:^(NSArray *filteredResults)
{
    if (filteredResults) {
        results = filteredResults;
    }
}];
```

**Extras**
* Filtering by `@""` returns ALL objects with NSString properties
* Filtering by `nil` returns ALL objects
* IMQuickSearch returns UNIQUE results.

**Manipulating Filters on the fly**

You can also add/remove IMQuickSearchFilter objects on the fly with this method:

```objc
IMQuickSearchFilter *someFilter;

// Add
[self.QuickSearch addFilter:someFilter];

// Remove
[self.QuickSearch removeFilter:someFilter];
```

## What IMQuickSearch CAN'T Do

This library's great, but it does have some short-comings. Here they are:

**No recursive object graph searching.**

Basically this means that if you have a `Family` object that has an array of `Person` objects, and each `Person` object has a `firstName` property - you can't filter over a list of families for a person that has a firstName like what you're searching for. It doesn't go down the object graph looking for keys, only top-level object properties work. However arrays work for base checks. If you have an `NSArray` of `NSStrings` it will traverse the array seeing if one of the strings match to return `YES/NO` to.

**No parallel searching.**

Right now, each IMQuickSearchFilter is searched serially, and then a union set is made at the end. For each filter, the set of keys is done the exact same way. Theoretically it would be faster to do everything in parallel. Theoretically... Right now if you take a peek at the [`multithreaded` branch](https://github.com/Intermark/IMQuickSearch/tree/multithreaded) you can see my attempt at doing this. The quick benchmarks show that doing it serially actually takes only 72% of the time doing it concurrently does. Which is wacky. Since this is bad, it's not ready for production use, but we still think doing it this way has merit if done right. The problems may have to do with more and heavier instantiations done concurrently to manage this instead of the lightweight serial method.

**No saving the world.**

Unfortunately, this library cannot save the world if dire conditions arise. Though we are open to pull requests.

## Benchmarks

After some basic tests with the same kind of `IMPerson` and `IMAnimal` objects from the demo project, it appears that this grows linearlly with the growth of the data size. A 10x increase in objects results in about a 10x decrease in speed. Here's the quick and dirty results (each set is 1/2 People, 1/2 Animals):

```
iPhone 5C

200    objects - Avg. Runtime:     944661 ns    (0.0009 s)
2000   objects - Avg. Runtime:    6899177 ns    (0.0069 s)
20000  objects - Avg. Runtime:   79806582 ns    (0.08 s)
```

Now, let's benchmark against subsequent searches. This is using the same 2000 object data set (1/2 people, 1/2 animals). Because we're keeping the last search set around, and the idea that a subsequent search is contained by the last set, we don't have to use the master list of objects every time - only when the previous set won't contain the newest search set. Here's these benchmarks.

```
Value: @"a"
2014-04-28 08:38:23.575 IMQuickSearch[27953:60b] Start
2014-04-28 08:38:23.621 IMQuickSearch[27953:60b] Stop
0.046s

Value: @"al"
2014-04-28 08:38:25.497 IMQuickSearch[27953:60b] Start
2014-04-28 08:38:25.533 IMQuickSearch[27953:60b] Stop
0.036s

Value: @"ali"
2014-04-28 08:38:26.645 IMQuickSearch[27953:60b] Start
2014-04-28 08:38:26.655 IMQuickSearch[27953:60b] Stop
0.010s

Value: @"alig"
2014-04-28 08:40:39.194 IMQuickSearch[27953:60b] Start
2014-04-28 08:40:39.196 IMQuickSearch[27953:60b] Stop
0.002s
```

## Demo Project

Run, play, and read through the demo project to understand how it all works and functions, including how to use it in your own app.

## Unit Tests

There are tests located inside of the Demo Project to run. The library is also tested and run against a [Travis-CI](https://travis-ci.org/Intermark/IMQuickSearch) continuous integration server.

## License

This repository is licensed under the standard MIT License. You can read the license [here](https://github.com/Intermark/IMQuickSearch/blob/master/License).


text:
package org.codehaus.mojo.cassandra;

import org.apache.commons.exec.*;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;

import java.io.IOException;
import java.util.Map;

/**
 * Runs {@code nodetool repair} on a Cassandra instance.
 *
 * @author stephenc
 */
@Mojo(name = "repair", threadSafe = true)
public class RepairCassandraMojo extends AbstractCassandraMojo
{
    /**
     * {@inheritDoc}
     */
    public void execute() throws MojoExecutionException, MojoFailureException
    {
        if (skip)
        {
            getLog().info("Skipping cassandra: cassandra.skip==true");
            return;
        }
        try
        {
            Map<String, String> environment = createEnvironmentVars();
            CommandLine commandLine = newNodetoolCommandLine("repair");

            Executor exec = new DefaultExecutor();
            exec.setWorkingDirectory(cassandraDir);
            exec.setProcessDestroyer(new ShutdownHookProcessDestroyer());

            LogOutputStream stdout = new MavenLogOutputStream(getLog());
            LogOutputStream stderr = new MavenLogOutputStream(getLog());

            try
            {
                getLog().debug("Executing command line: " + commandLine);

                exec.setStreamHandler(new PumpStreamHandler(stdout, stderr, System.in));

                exec.execute(commandLine, environment);

                getLog().info("Repair triggered.");
            } catch (IOException e)
            {
                throw new MojoExecutionException("Command execution failed.", e);
            }
        } catch (IOException e)
        {
            throw new MojoExecutionException(e.getLocalizedMessage(), e);
        }
    }
}