text:
from __future__ import annotations

def get_valid_pos(position: tuple[int, int], n: int) -> list[tuple[int, int]]:
    """
    Find all the valid positions a knight can move to from the current position.

    >>> get_valid_pos((1, 3), 4)
    [(2, 1), (0, 1), (3, 2)]
    """

    y, x = position
    positions = [
        (y + 1, x + 2),
        (y - 1, x + 2),
        (y + 1, x - 2),
        (y - 1, x - 2),
        (y + 2, x + 1),
        (y + 2, x - 1),
        (y - 2, x + 1),
        (y - 2, x - 1),
    ]
    permissible_positions = []

    for position in positions:
        y_test, x_test = position
        if 0 <= y_test < n and 0 <= x_test < n:
            permissible_positions.append(position)

    return permissible_positions

def is_complete(board: list[list[int]]) -> bool:
    """
    Check if the board (matrix) has been completely filled with non-zero values.

    >>> is_complete([[1]])
    True

    >>> is_complete([[1, 2], [3, 0]])
    False
    """

    return not any(elem == 0 for row in board for elem in row)

def open_knight_tour_helper(
    board: list[list[int]], pos: tuple[int, int], curr: int
) -> bool:
    """
    Helper function to solve knight tour problem.
    """

    if is_complete(board):
        return True

    for position in get_valid_pos(pos, len(board)):
        y, x = position

        if board[y][x] == 0:
            board[y][x] = curr + 1
            if open_knight_tour_helper(board, position, curr + 1):
                return True
            board[y][x] = 0

    return False

def open_knight_tour(n: int) -> list[list[int]]:
    """
    Find the solution for the knight tour problem for a board of size n. Raises
    ValueError if the tour cannot be performed for the given size.

    >>> open_knight_tour(1)
    [[1]]

    >>> open_knight_tour(2)
    Traceback (most recent call last):
    ...
    ValueError: Open Kight Tour cannot be performed on a board of size 2
    """

    board = [[0 for i in range(n)] for j in range(n)]

    for i in range(n):
        for j in range(n):
            board[i][j] = 1
            if open_knight_tour_helper(board, (i, j), 1):
                return board
            board[i][j] = 0

    raise ValueError(f"Open Kight Tour cannot be performed on a board of size {n}")

if __name__ == "__main__":
    import doctest

    doctest.testmod()


text:
// Copyright 2012 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 "ash/constants/ash_paths.h"
#include "ash/constants/ash_switches.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "chrome/browser/ash/login/enrollment/enrollment_screen.h"
#include "chrome/browser/ash/login/enrollment/mock_enrollment_screen.h"
#include "chrome/browser/ash/login/login_wizard.h"
#include "chrome/browser/ash/login/oobe_screen.h"
#include "chrome/browser/ash/login/startup_utils.h"
#include "chrome/browser/ash/login/test/device_state_mixin.h"
#include "chrome/browser/ash/login/test/enrollment_ui_mixin.h"
#include "chrome/browser/ash/login/test/js_checker.h"
#include "chrome/browser/ash/login/test/oobe_base_test.h"
#include "chrome/browser/ash/login/test/oobe_screen_waiter.h"
#include "chrome/browser/ash/login/ui/login_display_host.h"
#include "chrome/browser/ash/login/ui/webui_login_view.h"
#include "chrome/browser/ash/login/wizard_controller.h"
#include "chrome/browser/ui/webui/chromeos/login/tpm_error_screen_handler.h"
#include "chromeos/dbus/tpm_manager/fake_tpm_manager_client.h"
#include "chromeos/dbus/tpm_manager/tpm_manager_client.h"
#include "chromeos/test/chromeos_test_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

namespace ash {
namespace {
const test::UIPath kEnrollmentTPMCheckCancelButton = {
    "enterprise-enrollment", "step-tpm-checking", "cancelButton"};
}  // namespace

using ::testing::_;
using ::testing::InvokeWithoutArgs;
using ::testing::Mock;

class EnrollmentScreenTest : public OobeBaseTest {
 public:
  EnrollmentScreenTest() = default;

  EnrollmentScreenTest(const EnrollmentScreenTest&) = delete;
  EnrollmentScreenTest& operator=(const EnrollmentScreenTest&) = delete;

  ~EnrollmentScreenTest() override = default;

  // OobeBaseTest:
  bool SetUpUserDataDirectory() override {
    if (!OobeBaseTest::SetUpUserDataDirectory())
      return false;

    // Make sure chrome paths are overridden before proceeding - this is usually
    // done in chrome main, which has not happened yet.
    base::FilePath user_data_dir;
    EXPECT_TRUE(base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
    ash::RegisterStubPathOverrides(user_data_dir);

    return true;
  }

  // OobeBaseTest:
  void SetUpOnMainThread() override {
    OobeBaseTest::SetUpOnMainThread();
    LoginDisplayHost::default_host()->StartWizard(
        EnrollmentScreenView::kScreenId);
    OobeScreenWaiter(EnrollmentScreenView::kScreenId).Wait();
  }

  EnrollmentScreen* enrollment_screen() {
    EXPECT_TRUE(WizardController::default_controller());
    EnrollmentScreen* enrollment_screen = EnrollmentScreen::Get(
        WizardController::default_controller()->screen_manager());
    EXPECT_TRUE(enrollment_screen);
    return enrollment_screen;
  }

  test::EnrollmentUIMixin enrollment_ui_{&mixin_host_};
};

IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, TestCancel) {
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnCancel();
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::BACK, screen_result);

  EXPECT_FALSE(StartupUtils::IsDeviceRegistered());
}

IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, TestSuccess) {
  WizardController::SkipEnrollmentPromptsForTesting();
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnDeviceAttributeUpdatePermission(false /* granted */);
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::COMPLETED, screen_result);

  EXPECT_TRUE(StartupUtils::IsDeviceRegistered());
}

IN_PROC_BROWSER_TEST_F(EnrollmentScreenTest, EnrollmentSpinner) {
  EnrollmentScreenView* view = enrollment_screen()->GetView();
  ASSERT_TRUE(view);

  // Run through the flow
  view->Show();
  OobeScreenWaiter(EnrollmentScreenView::kScreenId).Wait();
  enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepSignin);

  view->ShowEnrollmentWorkingScreen();
  enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepWorking);

  view->ShowEnrollmentSuccessScreen();
  enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepSuccess);
}

class EnrollmentScreenHandsOffTest : public EnrollmentScreenTest {
 public:
  EnrollmentScreenHandsOffTest() = default;
  ~EnrollmentScreenHandsOffTest() override = default;

  EnrollmentScreenHandsOffTest(const EnrollmentScreenHandsOffTest&) = delete;
  EnrollmentScreenHandsOffTest& operator=(const EnrollmentScreenHandsOffTest&) =
      delete;

  // EnrollmentScreenTest:
  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    command_line->AppendSwitchASCII(
        switches::kEnterpriseEnableZeroTouchEnrollment, "hands-off");
  }
};

IN_PROC_BROWSER_TEST_F(EnrollmentScreenHandsOffTest,
                       SkipEnrollmentCompleteScreen) {
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnDeviceAttributeUpdatePermission(false /* granted */);
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::COMPLETED, screen_result);

  EXPECT_TRUE(StartupUtils::IsDeviceRegistered());
}

class EnrollmentScreenChromadMigrationTest : public EnrollmentScreenTest {
 public:
  EnrollmentScreenChromadMigrationTest() = default;
  ~EnrollmentScreenChromadMigrationTest() override = default;

  EnrollmentScreenChromadMigrationTest(
      const EnrollmentScreenChromadMigrationTest&) = delete;
  EnrollmentScreenChromadMigrationTest& operator=(
      const EnrollmentScreenChromadMigrationTest&) = delete;

  // EnrollmentScreenTest:
  bool SetUpUserDataDirectory() override {
    if (!EnrollmentScreenTest::SetUpUserDataDirectory())
      return false;

    base::FilePath preinstalled_components_dir;
    EXPECT_TRUE(base::PathService::Get(ash::DIR_PREINSTALLED_COMPONENTS,
                                       &preinstalled_components_dir));

    base::FilePath preserve_dir =
        preinstalled_components_dir.AppendASCII("preserve/");
    EXPECT_TRUE(base::CreateDirectory(preserve_dir));
    EXPECT_TRUE(base::WriteFile(
        preserve_dir.AppendASCII("chromad_migration_skip_oobe"), "1"));

    return true;
  }
};

IN_PROC_BROWSER_TEST_F(EnrollmentScreenChromadMigrationTest,
                       SkipEnrollmentCompleteScreen) {
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnDeviceAttributeUpdatePermission(false /* granted */);
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::COMPLETED, screen_result);

  EXPECT_TRUE(StartupUtils::IsDeviceRegistered());
}

// Class to test TPM pre-enrollment check that happens only with
// --tpm-is-dynamic switch enabled. Test parameter represents take TPM
// ownership reply possible statuses.
class EnrollmentScreenDynamicTPMTest
    : public EnrollmentScreenTest,
      public ::testing::WithParamInterface<::tpm_manager::TpmManagerStatus> {
 public:
  EnrollmentScreenDynamicTPMTest() = default;
  EnrollmentScreenDynamicTPMTest(const EnrollmentScreenDynamicTPMTest&) =
      delete;
  EnrollmentScreenDynamicTPMTest& operator=(
      const EnrollmentScreenDynamicTPMTest&) = delete;

  ~EnrollmentScreenDynamicTPMTest() override = default;

  // EnrollmentScreenTest:
  void SetUpOnMainThread() override {
    original_tpm_check_callback_ =
        enrollment_screen()->get_tpm_ownership_callback_for_testing();
    enrollment_screen()->set_tpm_ownership_callback_for_testing(base::BindOnce(
        &EnrollmentScreenDynamicTPMTest::HandleTakeTPMOwnershipResponse,
        base::Unretained(this)));

    enrollment_ui_.SetExitHandler();
    EnrollmentScreenTest::SetUpOnMainThread();
  }

  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    command_line->AppendSwitch(switches::kTpmIsDynamic);
  }

  void WaitForTPMCheckReply() {
    if (tpm_reply_.has_value()) {
      std::move(original_tpm_check_callback_).Run(tpm_reply_.value());
      return;
    }

    base::RunLoop run_loop;
    tpm_check_callback_ = run_loop.QuitClosure();
    run_loop.Run();
    std::move(original_tpm_check_callback_).Run(tpm_reply_.value());
  }

  bool tpm_is_owned() { return tpm_is_owned_; }
  EnrollmentScreen::TpmStatusCallback original_tpm_check_callback_;
  absl::optional<::tpm_manager::TakeOwnershipReply> tpm_reply_;

 private:
  void HandleTakeTPMOwnershipResponse(
      const ::tpm_manager::TakeOwnershipReply& reply) {
    EXPECT_FALSE(tpm_reply_.has_value());
    tpm_reply_ = reply;
    // Here we substitute fake reply with status that we want to test.
    tpm_reply_.value().set_status(GetParam());

    if (tpm_check_callback_)
      std::move(tpm_check_callback_).Run();
  }

  base::OnceClosure tpm_check_callback_;
  bool tpm_is_owned_ = false;
};

IN_PROC_BROWSER_TEST_P(EnrollmentScreenDynamicTPMTest, TPMCheckCompleted) {
  switch (GetParam()) {
    case ::tpm_manager::STATUS_DEVICE_ERROR: {
      enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepTPMChecking);
      WaitForTPMCheckReply();
      EnrollmentScreen::Result screen_result =
          enrollment_ui_.WaitForScreenExit();
      EXPECT_EQ(screen_result, EnrollmentScreen::Result::TPM_ERROR);
      return;
    }
    case ::tpm_manager::STATUS_SUCCESS:
    case ::tpm_manager::STATUS_NOT_AVAILABLE:
      enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepTPMChecking);
      WaitForTPMCheckReply();
      enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepSignin);
      return;
    case ::tpm_manager::STATUS_DBUS_ERROR: {
      enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepTPMChecking);
      WaitForTPMCheckReply();
      EnrollmentScreen::Result screen_result =
          enrollment_ui_.WaitForScreenExit();
      EXPECT_EQ(screen_result, EnrollmentScreen::Result::TPM_DBUS_ERROR);
      return;
    }
  }
}

IN_PROC_BROWSER_TEST_P(EnrollmentScreenDynamicTPMTest, TPMCheckCanceled) {
  enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepTPMChecking);
  test::OobeJS().TapOnPath(kEnrollmentTPMCheckCancelButton);
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(screen_result, EnrollmentScreen::Result::BACK);
}

INSTANTIATE_TEST_SUITE_P(All,
                         EnrollmentScreenDynamicTPMTest,
                         ::testing::Values(::tpm_manager::STATUS_SUCCESS,
                                           ::tpm_manager::STATUS_DEVICE_ERROR,
                                           ::tpm_manager::STATUS_NOT_AVAILABLE,
                                           ::tpm_manager::STATUS_DBUS_ERROR));

class AttestationAuthEnrollmentScreenTest : public EnrollmentScreenTest {
 public:
  AttestationAuthEnrollmentScreenTest() = default;

  AttestationAuthEnrollmentScreenTest(
      const AttestationAuthEnrollmentScreenTest&) = delete;
  AttestationAuthEnrollmentScreenTest& operator=(
      const AttestationAuthEnrollmentScreenTest&) = delete;

  ~AttestationAuthEnrollmentScreenTest() override = default;

 private:
  // EnrollmentScreenTest:
  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    command_line->AppendSwitch(switches::kEnterpriseEnableZeroTouchEnrollment);
  }
};

IN_PROC_BROWSER_TEST_F(AttestationAuthEnrollmentScreenTest, TestCancel) {
  ASSERT_FALSE(enrollment_screen()->AdvanceToNextAuth());
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnCancel();
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::BACK, screen_result);
}

class ForcedAttestationAuthEnrollmentScreenTest : public EnrollmentScreenTest {
 public:
  ForcedAttestationAuthEnrollmentScreenTest() = default;

  ForcedAttestationAuthEnrollmentScreenTest(
      const ForcedAttestationAuthEnrollmentScreenTest&) = delete;
  ForcedAttestationAuthEnrollmentScreenTest& operator=(
      const ForcedAttestationAuthEnrollmentScreenTest&) = delete;

  ~ForcedAttestationAuthEnrollmentScreenTest() override = default;

 private:
  // EnrollmentScreenTest:
  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    command_line->AppendSwitchASCII(
        switches::kEnterpriseEnableZeroTouchEnrollment, "forced");
  }
};

IN_PROC_BROWSER_TEST_F(ForcedAttestationAuthEnrollmentScreenTest, TestCancel) {
  ASSERT_FALSE(enrollment_screen()->AdvanceToNextAuth());
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnCancel();
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::BACK_TO_AUTO_ENROLLMENT_CHECK,
            screen_result);
}

class MultiAuthEnrollmentScreenTest : public EnrollmentScreenTest {
 public:
  MultiAuthEnrollmentScreenTest() = default;

  MultiAuthEnrollmentScreenTest(const MultiAuthEnrollmentScreenTest&) = delete;
  MultiAuthEnrollmentScreenTest& operator=(
      const MultiAuthEnrollmentScreenTest&) = delete;

  ~MultiAuthEnrollmentScreenTest() override = default;

 private:
  // EnrollmentScreenTest:
  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    command_line->AppendSwitch(switches::kEnterpriseEnableZeroTouchEnrollment);
    // Kiosk mode will force OAuth enrollment.
    base::FilePath test_data_dir;
    ASSERT_TRUE(chromeos::test_utils::GetTestDataPath(
        "app_mode", "kiosk_manifest", &test_data_dir));
    command_line->AppendSwitchPath(
        switches::kAppOemManifestFile,
        test_data_dir.AppendASCII("kiosk_manifest.json"));
  }
};

IN_PROC_BROWSER_TEST_F(MultiAuthEnrollmentScreenTest, TestCancel) {
  ASSERT_TRUE(enrollment_screen()->AdvanceToNextAuth());
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnCancel();
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::BACK_TO_AUTO_ENROLLMENT_CHECK,
            screen_result);
}

class ProvisionedEnrollmentScreenTest : public EnrollmentScreenTest {
 public:
  ProvisionedEnrollmentScreenTest() = default;

  ProvisionedEnrollmentScreenTest(const ProvisionedEnrollmentScreenTest&) =
      delete;
  ProvisionedEnrollmentScreenTest& operator=(
      const ProvisionedEnrollmentScreenTest&) = delete;

  ~ProvisionedEnrollmentScreenTest() override = default;

 private:
  // EnrollmentScreenTest:
  void SetUpCommandLine(base::CommandLine* command_line) override {
    EnrollmentScreenTest::SetUpCommandLine(command_line);
    base::FilePath test_data_dir;
    ASSERT_TRUE(chromeos::test_utils::GetTestDataPath(
        "app_mode", "kiosk_manifest", &test_data_dir));
    command_line->AppendSwitchPath(
        switches::kAppOemManifestFile,
        test_data_dir.AppendASCII("kiosk_manifest.json"));
  }
};

IN_PROC_BROWSER_TEST_F(ProvisionedEnrollmentScreenTest, TestBackButton) {
  enrollment_ui_.SetExitHandler();
  enrollment_screen()->OnCancel();
  EnrollmentScreen::Result screen_result = enrollment_ui_.WaitForScreenExit();
  EXPECT_EQ(EnrollmentScreen::Result::BACK_TO_AUTO_ENROLLMENT_CHECK,
            screen_result);
}

class OobeCompletedUnownedTest : public OobeBaseTest {
  DeviceStateMixin device_state{
      &mixin_host_, DeviceStateMixin::State::OOBE_COMPLETED_UNOWNED};
};

// Tests that enrollment screen could be triggered after OOBE completed and
// Chrome restarted (or device rebooted).
IN_PROC_BROWSER_TEST_F(OobeCompletedUnownedTest, TriggerEnrollment) {
  OobeScreenWaiter(GetFirstSigninScreen()).Wait();
  LoginDisplayHost::default_host()->StartWizard(
      EnrollmentScreenView::kScreenId);
  OobeScreenWaiter(EnrollmentScreenView::kScreenId).Wait();
}

}  // namespace ash

redpajama_set_name: RedPajamaGithub


text:
'use strict';

module.exports = {
    EXTERNAL: {
        // Personal Links
        DECKBOX_PERSONAL: 'https://deckbox.org/users/adamRenny',
        GITHUB_PERSONAL: 'https://github.com/adamRenny',
        LINKEDIN_PERSONAL: 'https://www.linkedin.com/in/adamrenny',
        NPM_PERSONAL: 'https://www.npmjs.org/~adamrenny',
        TWITTER_PERSONAL: 'https://twitter.com/AdamRenny',
        CODEPEN_PERSONAL: 'http://codepen.io/adamRenny/',

        // Extra Curricular Activities
        KARATE: 'http://southmetrokarate.com/',
        TOYAMA_RYU_MN: 'http://www.seiryuukandojo.com/',
        UMN: 'http://umn.edu'
    }
};


text:
<!doctype html>

    <title>Code coverage report for ble-bean/lib/ScratchTwo.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../prettify.css" />
    <link rel="stylesheet" href="../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files / ble-bean/lib/ ScratchTwo.js

        73.33%
        Statements
        11/15

        40%
        Branches
        2/5

        0%
        Functions
        0/5

        73.33%
        Lines
        11/15

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29	1×
1×

1×
1×
1×

1×

1×

1×

1×

1×

1×

var SCRATCH_UUID = 'a495ff20-c5b1-4b44-b512-1370f02d74de';
var SCRATCH_TWO = 'a495ff22-c5b1-4b44-b512-1370f02d74de';

Eif(process.platform == 'darwin' || process.platform == 'linux' || process.platform == 'win32'){
  SCRATCH_UUID = 'a495ff20c5b14b44b5121370f02d74de';
  SCRATCH_TWO = 'a495ff22c5b14b44b5121370f02d74de';
}

function ScratchTwo() {
}

ScratchTwo.prototype.readTwo = function(callback) {
  this.readDataCharacteristic(SCRATCH_UUID, SCRATCH_TWO, callback);
};

ScratchTwo.prototype.writeTwo = function(data, callback) {
  this.writeDataCharacteristic(SCRATCH_UUID, SCRATCH_TWO, data, callback);
};

ScratchTwo.prototype.notifyTwo = function(onRead, callback) {
  this.notifyCharacteristic(SCRATCH_UUID, SCRATCH_TWO, true, onRead, callback);
};

ScratchTwo.prototype.unnotifyTwo = function(onRead, callback) {
  this.notifyCharacteristic(SCRATCH_UUID, SCRATCH_TWO, false, onRead, callback);
};

module.exports = ScratchTwo;

  Code coverage
  generated by istanbul at Wed Mar 30 2016 15:15:09 GMT-0700 (MST)


text:
#include <iostream>
#include <string>
#include "alphabetTree.h"

/* ************************************************ *
 * This program will check if it is possible to     *
 * scrabble the input to obtain the desired outuput.*
 *  Ex:                                             *
 *  longest("dcthoyueorza") ->  "coauthored"        *
 *  longest("uruqrnytrois") -> "turquois"           *
 * ************************************************ */

// This vareable will hold our dictionary
AlphabetTree* dic;

int main()
{   // Create our dictionary based in the file given
	dic = new AlphabetTree("dictionary.txt");
	string alphabet;
	cin >> alphabet;
	do
	{
		cout << "longest(\"" << alphabet << "\") -> " << dic->longest(alphabet) << endl;
	}while( cin >> alphabet );
	return 0;
}


text:
from django.forms.models import model_to_dict

def diary_presentation(diary):
    diary_dict = model_to_dict(diary, exclude=['extra_params'])
    return diary_dict


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

<title>Uses of Interface org.nvonop.selenium.framework.controls.interfaces.Readable</title>
<meta name="date" content="2014-06-14">
<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

Next

Frames

No Frames

All Classes

Uses of Interface
org.nvonop.selenium.framework.controls.interfaces.Readable

Packages that use Readable

Package
Description

org.nvonop.selenium.framework.controls

Uses of Readable in org.nvonop.selenium.framework.controls

Classes in org.nvonop.selenium.framework.controls that implement Readable

Modifier and Type
Class and Description

class
Button

This class comprises of functionality that would be used when interacting
 with a typical button control.

class
CheckBox

This class comprises of functionality that would be used when interacting
 with a typical checkbox control.

class
GenericHtmlElement

This class comprises of functionality that would be used when interacting
 with a typical HTML element.

class
Link

This class comprises of functionality that would be used when interacting
 with a typical link control.

class
Message

This class comprises of functionality that would be used when interacting
 with a validation message of some sort.

class
RadioButton

This class comprises of functionality that would be used when interacting
 with a typical radio button control.

class
SelectBox

This class comprises of functionality that would be used when interacting
 with a typical select box control.

class
TextBox

This class comprises of functionality that would be used when interacting
 with a typical text box control.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
var locale = '';
var uri = window.location.pathname.substr(1);

if(uri.substr(0,2)=='de' || uri.substr(0,2)=='en' || uri.substr(0,2)=='es' || uri.substr(0,2)=='hi'){
		locale = '/'+uri.substr(0,2);
}else{
		locale = '/en';
}

function UpdateDetails(ex){
	var delay = 30000;
	var now, before = new Date();
	GetDetails(ex,delay/1000);
	setInterval(function() {
    now = new Date();
    var elapsedTime = (now.getTime() - before.getTime());
    GetDetails(ex,delay/1000);
    before = new Date();
}, delay);

}
function GetDetails(ex,counter){
	var refreshID = setInterval(function() {
		counter = counter - 1;
		$("#Timer").html(counter);
		if(counter <= 0){
			clearInterval(refreshID);
			return;
			}
	}	,1000);
	user_id = $("#User_ID").html();
	if(ex=="/EX/DASHBOARD"){ex = "BTC/GBP";}
	CheckServer();

	$.getJSON(locale+'/Updates/Rates/'+ex,
		function(ReturnValues){
			if(ReturnValues['Refresh']=="Yes"){
							$('#BuyOrders').html("

Updating...

");
							$('#SellOrders').html("

Updating...

");
							$('#YourCompleteOrders').html("

Updating...

");
							$('#YourOrders').html("

Updating...

");

					$.getJSON(locale+'/Updates/Orders/'+ex,
						function(Orders){
							$('#BuySpanTotal').html('Total: '+Orders['BuySpanTotal']);
							$('#SellSpanTotal').html('Total: '+Orders['SellSpanTotal']);
							$('#BuyOrders').html(Orders['BuyOrdersHTML']);
							$('#SellOrders').html(Orders['SellOrdersHTML']);
					});
					$.getJSON(locale+'/Updates/YourOrders/'+ex+'/'+user_id,
						function(Orders){
							$('#YourCompleteOrders').html(Orders['YourCompleteOrdersHTML']);
							$('#YourOrders').html(Orders['YourOrdersHTML']);
					});
			}

			$("#LowPrice").html(ReturnValues['Low']);
			$("#HighPrice").html(ReturnValues['High']);
			$("#LowestAskPrice").html(ReturnValues['High']);
			if($("#BuyPriceper").val()=="" || $("#BuyPriceper").val()==0){
				$("#BuyPriceper").val(ReturnValues['High']);
			}
			$("#HighestBidPrice").html(ReturnValues['Low']);
			if($("#SellPriceper").val()=="" || $("#SellPriceper").val()==0){
				$("#SellPriceper").val(ReturnValues['Low']);
			}
			$("#LastPrice").html(ReturnValues['Last']);
			Volume = ReturnValues['VolumeFirst'] + " " + ReturnValues['VolumeFirstUnit'] +
			" / " + ReturnValues['VolumeSecond'] + " " + ReturnValues['VolumeSecondUnit'];
			$("#Volume").html(Volume);
		});
}
function CheckServer(){
		$.getJSON(locale+'/Updates/CheckServer/',
		function(ReturnValues){
			if(ReturnValues['Refresh']=="No"){
				window.location.assign(locale+"/login");
			}
		});
}

function BuyFormCalculate (){
	Multiple = $('#BuyMultiple').val();
	if(Multiple=="Y"){
		if(!confirm("Do you want to execute Multiple orders?")){
			return;
		}
	}
	BalanceSecond = $('#BalanceSecond').html();
	FirstCurrency = $('#BuyFirstCurrency').val();
	SecondCurrency = $('#BuySecondCurrency').val();
	BuyAmount = $('#BuyAmount').val();
	BuyPriceper = $('#BuyPriceper').val();
	if(BuyAmount=="" || BuyAmount<=0){
			$("#BuySummary").html("Amount less than 0 (ZERO)!");
			$("#BuySubmitButton").attr("disabled", "disabled");
			$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(BuyAmount>999999){
			$("#BuySummary").html("Amount greater than 1000000!");
			$("#BuySubmitButton").attr("disabled", "disabled");
			$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(BuyPriceper=="" || BuyPriceper<=0){
		$("#BuySummary").html("Price less than Zero!");
		$("#BuySubmitButton").attr("disabled", "disabled");
		$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(BuyPriceper>999999){
		$("#BuySummary").html("Price greater than 1000000!");
		$("#BuySubmitButton").attr("disabled", "disabled");
		$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}

	TotalValue = BuyAmount * BuyPriceper;
	TotalValue = TotalValue.toFixed(8);

	$.getJSON(locale+'/Updates/Commission/',
		function(ReturnValues){
			$("#BuyCommission").val(ReturnValues['Commission']);
			Commission = $('#BuyCommission').val();
			Fees = BuyAmount * Commission / 100;
			Fees = Fees.toFixed(8);
			if(Fees<=0){return false;}
			$("#BuyFee").html(Fees);
			$('#BuyCommissionAmount').val(Fees);
			$('#BuyCommissionCurrency').val(FirstCurrency);
			$("#BuyTotal").html(TotalValue);

		GrandTotal = TotalValue;
	if(GrandTotal==0){
		BuySummary = "Amount cannot be Zero";
		$("#BuySummary").html(BuySummary);
		$("#BuySubmitButton").attr("disabled", "disabled");
		$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}

	if(parseFloat(BalanceSecond) < parseFloat(GrandTotal)){
		Excess = parseFloat(GrandTotal) - parseFloat(BalanceSecond);
		Excess = Excess.toFixed(8);
		BuySummary = "The transaction amount exceeds the balance by " + Excess + " " + SecondCurrency;
		$("#BuySummary").html(BuySummary);
		$("#BuySubmitButton").attr("disabled", "disabled");
		$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
	}else{
		if($("#AutoXGC").html() == "" || $("#AutoBTC").html() == ""){
			BuySummary = "Auto withdrawal address not given!";
			$("#BuySummary").html(BuySummary);
			$("#BuySubmitButton").attr("disabled", "disabled");
			$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
				return false;
		}else{
			if($("#BuyFirstCurrency").val()=='BTC'){
				if($("#AutoBTCVerified").html()=="" || $("#AutoBTCVerified").html()=="No"){
					BuySummary = "Auto withdrawal BTC address not given!";
					$("#BuySummary").html(BuySummary);
					$("#BuySubmitButton").attr("disabled", "disabled");
					$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}

			if($("#BuyFirstCurrency").val()=='XGC'){
				if($("#AutoXGCVerified").html()=="" || $("#AutoXGCVerified").html()=="No"){
					BuySummary = "Auto withdrawal XGC address not given!";
					$("#BuySummary").html(BuySummary);
					$("#BuySubmitButton").attr("disabled", "disabled");
					$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}

			if($("#BuySecondCurrency").val()=='XGC'){
				if($("#AutoXGCVerified").html()=="" || $("#AutoXGCVerified").html()=="No"){
					BuySummary = "Auto withdrawal XGC address not given!";
					$("#BuySummary").html(BuySummary);
					$("#BuySubmitButton").attr("disabled", "disabled");
					$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}

		}
		BuySummary = "The transaction amount " + GrandTotal  + " " + SecondCurrency;
		$("#BuySummary").html(BuySummary);
		$("#BuySubmitButton").removeAttr('disabled');
		$("#BuySubmitButton").attr("class", "btn btn-success btn-block");
	}
	if(parseFloat(GrandTotal)===0){$("#BuySubmitButton").attr("disabled", "disabled");}

		}
	);
}
function SellFormCalculate (){
	Multiple = $('#SellMultiple').val();
	if(Multiple=="Y"){
		if(!confirm("Do you want to execute Multiple orders?")){
			return;
		}
	}

	BalanceFirst = $('#BalanceFirst').html();
	FirstCurrency = $('#SellFirstCurrency').val();
	SecondCurrency = $('#SellSecondCurrency').val();
	SellAmount = $('#SellAmount').val();
	SellPriceper = $('#SellPriceper').val();
	if(SellAmount=="" || SellAmount<=0){
		$("#SellSummary").html("Amount less than 0 (ZERO)!");
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(SellAmount>999999){
		$("#SellSummary").html("Amount greater than 1000000!");
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(SellPriceper=="" || SellPriceper<=0){
		$("#SellSummary").html("Price less than Zero!");
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(SellPriceper>999999){
		$("#SellSummary").html("Price greater than 1000000!");
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}

	TotalValue = SellAmount * SellPriceper;
	TotalValue = TotalValue.toFixed(8);

	$.getJSON(locale+'/Updates/Commission/',
		function(ReturnValues){
			$("#SellCommission").val(ReturnValues['Commission']);
			Commission = $('#SellCommission').val();;
			Fees = TotalValue * Commission / 100;
			if(Fees<=0){return false;}
			Fees = Fees.toFixed(8);
			$("#SellFee").html(Fees);
			$('#SellCommissionAmount').val(Fees);
			$('#SellCommissionCurrency').val(SecondCurrency);
			$("#SellTotal").html(TotalValue);
	GrandTotal = SellAmount;
	if(SellAmount==0){
	SellSummary = "Amount cannot be Zero";
		$("#SellSummary").html(SellSummary);
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
		return false;
	}
	if(parseFloat(BalanceFirst) < parseFloat(GrandTotal)){
		Excess =  parseFloat(GrandTotal) - parseFloat(BalanceFirst)  ;
		Excess = Excess.toFixed(8)
		SellSummary = "The transaction amount exceeds the balance by " + Excess + " " + FirstCurrency;
		$("#SellSummary").html(SellSummary);
		$("#SellSubmitButton").attr("disabled", "disabled");
		$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
	}else{
		if($("#AutoXGC").html() == "" || $("#AutoBTC").html() == ""){
			SellSummary = "Auto withdrawal address not given!";
			$("#SellSummary").html(SellSummary);
			$("#SellSubmitButton").attr("disabled", "disabled");
			$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
				return false;
		}else{
			if($("#SellFirstCurrency").val()=="BTC"){
				if($("#AutoBTCVerified").html()=="" || $("#AutoBTCVerified").html()=="No"){
					SellSummary = "Auto withdrawal BTC address not given!";
					$("#SellSummary").html(SellSummary);
					$("#SellSubmitButton").attr("disabled", "disabled");
					$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}
			if($("#SellFirstCurrency").val()=="XGC"){
				if($("#AutoXGCVerified").html()=="" || $("#AutoXGCVerified").html()=="No"){
					SellSummary = "Auto withdrawal XGC address not given!";
					$("#SellSummary").html(SellSummary);
					$("#SellSubmitButton").attr("disabled", "disabled");
					$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}
			if($("#SellSecondCurrency").val()=="XGC"){
				if($("#AutoXGCVerified").html()=="" || $("#AutoXGCVerified").html()=="No"){
					SellSummary = "Auto withdrawal XGC address not given!";
					$("#SellSummary").html(SellSummary);
					$("#SellSubmitButton").attr("disabled", "disabled");
					$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
						return false;
				}
			}

		}

		SellSummary = "The transaction amount " + GrandTotal  + " " + FirstCurrency;
		$("#SellSummary").html(SellSummary);
		$("#SellSubmitButton").removeAttr('disabled');
		$("#SellSubmitButton").attr("class", "btn btn-success btn-block");
	}
	if(parseFloat(GrandTotal)===0){$("#SellSubmitButton").attr("disabled", "disabled");}

		}
	);

}
function SellOrderFill(SellOrderPrice,SellOrderAmount,IDs){

	$("#BuyMultiple").val("Y");
	$("#BuyIDs").val(IDs);
	$("#BuyAmount").val(SellOrderAmount)  ;
	$("#BuyPriceper").val(SellOrderPrice)  ;
	$("#BuySubmitButton").attr("disabled", "disabled");
	$("#BuySubmitButton").attr("class", "btn btn-warning btn-block");
}
function BuyOrderFill(BuyOrderPrice,BuyOrderAmount,IDs){

	$("#SellMultiple").val("Y");
	$("#SellIDs").val(IDs);
	$("#SellAmount").val(BuyOrderAmount)  ;
	$("#SellPriceper").val(BuyOrderPrice)  ;
	$("#SellSubmitButton").attr("disabled", "disabled");
	$("#SellSubmitButton").attr("class", "btn btn-warning btn-block");
}
function ConvertBalance(){
	BTCRate = $("#BTCRate").val();
	LTCRate = $("#LTCRate").val();
	USDRate = $("#USDRate").val();
	GBPRate = $("#GBPRate").val();
	EURRate = $("#EURRate").val();
	Currency = $("#Currency" ).val();
	switch(Currency){
		case "BTC":
		  break;
		case "LTC":
		  break;
		case "USD":
		  break;
		case "EUR":
		  break;
		case "GBP":
		  break;
	}

}
function SendPassword(){
	$.getJSON(locale+'/Users/SendPassword/'+$("#Username").val(),
		function(ReturnValues){
			if(ReturnValues['Password']=="Password Not sent"){
				$("#UserNameIcon").attr("class", "glyphicon glyphicon-remove");
				$("#LoginEmailPassword").hide();
				return false;
			}
			$("#LoginEmailPassword").show();
			$("#LoginButton").removeAttr('disabled');
			$("#UserNameIcon").attr("class", "glyphicon glyphicon-ok");

			if(ReturnValues['TOTP']=="Yes"){
				$("#TOTPPassword").show();
			}else{
				$("#TOTPPassword").hide();
			}
//			if(ReturnValues['EmailPasswordSecurity']=="true"){
//				$("#LoginEmailPassword").show();
//			}else{
//				$("#LoginEmailPassword").hide();
//			}

		}
	);
}

function SaveTOTP(){
	if($("#ScannedCode").val()==""){return false;}
	$.getJSON(locale+'/Users/SaveTOTP/',{
			  Login:$("#Login").is(':checked'),
			  Withdrawal:$("#Withdrawal").is(':checked'),
			  Security:$("#Security").is(':checked'),
			  ScannedCode:$("#ScannedCode").val()
			  },
		function(ReturnValues){
			if(ReturnValues){
				window.location.assign(locale+"/users/settings");
			}
		}
	);
}
function CheckTOTP(){
	if($("#CheckCode").val()==""){return false;}
	$.getJSON(locale+'/Users/CheckTOTP/',{
			  CheckCode:$("#CheckCode").val()
			  },
		function(ReturnValues){
			if(ReturnValues){
				window.location.assign(locale+"/users/settings");
			}
		}
	);
}

function DeleteTOTP(){
	$.getJSON(locale+'/Users/DeleteTOTP/',
		function(ReturnValues){}
	);
}
function CheckDeposit(){
	AmountFiat = $("#AmountFiat").val();
	if(AmountFiat==""){return false;}
	}
function CheckWithdrawal(){
	if($("#WithdrawalMethod").val()=="bank"){
		AccountName = $("#AccountName").val();
		if(AccountName==""){return false;}
		SortCode = $("#SortCode").val();
		if(SortCode==""){return false;}
		AccountNumber = $("#AccountNumber").val();
		if(AccountNumber==""){return false;}
	}
	if($("#WithdrawalMethod").val()=="bankBuss"){
		AccountName = $("#AccountName").val();
		if(AccountName==""){return false;}
		SortCode = $("#SortCode").val();
		if(SortCode==""){return false;}
		AccountNumber = $("#AccountNumber").val();
		if(AccountNumber==""){return false;}
		CompanyName = $("#CompanyName").val();
		if(CompanyName==""){return false;}
		CompanyNumber = $("#CompanyNumber").val();
		if(CompanyNumber==""){return false;}
	}
	if($("#WithdrawalMethod").val()=="post"){
		PostalName = $("#PostalName").val();
		if(PostalName==""){return false;}
		PostalStreet = $("#PostalStreet").val();
		if(PostalStreet==""){return false;}
		PostalAddress = $("#PostalAddress").val();
		if(PostalAddress==""){return false;}
		PostalCity = $("#PostalCity").val();
		if(PostalCity==""){return false;}
		PostalZip = $("#PostalZip").val();
		if(PostalZip==""){return false;}
		PostalCountry = $("#PostalCountry").val();
		if(PostalCountry==""){return false;}
	}
	WithdrawAmountFiat = $("#WithdrawAmountFiat").val();
	if(WithdrawAmountFiat==""){alert("Amount not entered");return false;}
	if(parseInt(WithdrawAmountFiat)<=5 && $("#WithdrawalMethod").val()!='okpay'){alert("Amount less than 5");return false;}
	if(parseInt(WithdrawAmountFiat)<1 && $("#WithdrawalMethod").val()=='okpay'){alert("Amount less than 1");return false;}
}

function RejectReason(value){
	url = $("#RejectURL").attr('href');
	len = url.length-2;
	nurl = url.substr(0,len)+value;
	$("#RejectURL").attr('href',nurl);
}
function currencyAddress(currency){
	address = $("#currencyaddress").val();
  $("#Send"+currency+"Address").html(address);
	SuccessButtonDisable();
	}
function SuccessButtonDisable(){
	$("#SendSuccessButton").attr("disabled", "disabled");
}
function CheckCurrencyPayment(currency){
	address = $("#currencyaddress").val();
	$("#AmountError").hide();
	if(address==""){return false;}
	amount = $("#Amount").val();
	if(parseFloat(amount)<=0){
		$("#AmountError").show();
		return false;
	}else{
	$("#AmountError").hide();
	}
	if(amount==""){return false;}
	maxValue = $("#maxValue").val();
	if(parseFloat(amount)==0){
		$("#AmountError").show();
		return false;}
	if(parseFloat(amount)>parseFloat(maxValue)){
		$("#AmountError").show();
		return false;
	}

	$("#Send"+currency+"Fees").html($("#txFee").val());

	$("#Send"+currency+"Amount").html(amount);
	$("#Send"+currency+"Total").html(parseFloat(amount)-parseFloat($("#txFee").val()));
	$("#TransferAmount").val(parseFloat(amount)-parseFloat($("#txFee").val()));

	$.getJSON(locale+'/Updates/CurrencyAddress/'+currency+'/'+address,
		function(ReturnValues){
			if(ReturnValues['verify']['isvalid']==true){
				switch(ReturnValues['currency'])
					{
					case "BTC":
					address = ""+ address +" ";
						break;
					case "XGC":
					address = ""+ address +" ";
						break;
					default:
					address = address +" ";
					}
					$("#Send"+currency+"SuccessButton").removeAttr('disabled');
				}else{
						address = address +" ";
				}
			$("#Send"+currency+"Address").html(address);
});
	return true;
	}
function PaymentMethod(value){
	if(value=="bank"){
		$("#WithdrawalBank").show();
		$("#WithdrawalBankBuss").hide();
		$("#WithdrawalPost").hide();
		$("#WithdrawalOkPay").hide();
	}
	if(value=="post"){
		$("#WithdrawalBank").hide();
		$("#WithdrawalBankBuss").hide();
		$("#WithdrawalPost").show();
		$("#WithdrawalOkPay").hide();
	}
	if(value=="bankBuss"){
		$("#WithdrawalBank").hide();
		$("#WithdrawalBankBuss").show();
		$("#WithdrawalPost").hide();
		$("#WithdrawalOkPay").hide();
	}
	if(value=="okpay"){
		$("#WithdrawalBank").hide();
		$("#WithdrawalBankBuss").hide();
		$("#WithdrawalPost").hide();
		$("#WithdrawalOkPay").show();
	}
}
function DepositByMethod(value){
	if(value=="okpay"){
		$("#DepositPost").hide();
		$("#DepositOkPay").show();
		$("#MailSelect").hide();
		$("#OkPaySelect").show();
	}
	if(value=="post"){
		$("#DepositPost").show();
		$("#DepositOkPay").hide();
		$("#MailSelect").show();
		$("#OkPaySelect").hide();
	}
}
function AutoFillBuy(){
	$("#BuyAmount").val($("#BalanceSecond").html());
}
function AutoFillSell(){
	$("#SellAmount").val($("#BalanceFirst").html());
}
function CheckFirstName(value){
	if(value.length>=2){
		$("#FirstNameIcon").attr("class", "glyphicon glyphicon-ok");
	}else{
		$("#FirstNameIcon").attr("class", "glyphicon glyphicon-remove");
	}
}
function CheckLastName(value){
	if(value.length>=2){
		$("#LastNameIcon").attr("class", "glyphicon glyphicon-ok");
	}else{
		$("#LastNameIcon").attr("class", "glyphicon glyphicon-remove");
	}
}
function CheckUserName(value){
	if(value.length>6){
		$.getJSON(locale+'/Users/username/'+value,
		function(ReturnValues){
			if(ReturnValues['Available']=='Yes'){
				$("#UserNameIcon").attr("class", "glyphicon glyphicon-ok");
			}else{
				$("#UserNameIcon").attr("class", "glyphicon glyphicon-remove");
			}
		});
	}else{
		$("#UserNameIcon").attr("class", "glyphicon glyphicon-remove");
	}
}
function CheckEmail(email){
	email = email.toLowerCase();
	$("#Email").val(email);
	if(validateEmail(email)){
		$.getJSON(locale+'/Users/signupemail/'+email,
			function(ReturnValues){
			if(ReturnValues['Available']=='Yes'){
				$("#EmailIcon").attr("class", "glyphicon glyphicon-ok");

			}else{
				$("#EmailIcon").attr("class", "glyphicon glyphicon-remove");
			}
		});
	}else{
		$("#EmailIcon").attr("class", "glyphicon glyphicon-remove");
	}
}
function CheckPassword(value){
	if(value.length>6){
		if($("#Password").val()==$("#Password2").val()){
			$("#PasswordIcon").attr("class", "glyphicon glyphicon-ok");
			$("#Password2Icon").attr("class", "glyphicon glyphicon-ok");
		}else{
			$("#PasswordIcon").attr("class", "glyphicon glyphicon-remove");
			$("#Password2Icon").attr("class", "glyphicon glyphicon-remove");
		}
	}else{
		$("#PasswordIcon").attr("class", "glyphicon glyphicon-remove");
		$("#Password2Icon").attr("class", "glyphicon glyphicon-remove");
	}
	}

	function EmailPasswordSecurity(value){
		$.getJSON(locale+'/Users/EmailPasswordSecurity/'+value,
		function(ReturnValues){});
	}
function validateEmail(email) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(email);
}
	function checkkyc(){
		var kyc = $("#KycId").val();
		$.getJSON(locale+'/ex/getKYC/',{
			  kyc:kyc
			  },
		function(ReturnValues){
			if(ReturnValues['success']==1){
				$("#email").val(ReturnValues["email"]);
//				$("#phone").val(ReturnValues["phone"]);
				$('#RegisterMe').removeAttr("disabled");
				$('#kyc_id').attr("disabled","disabled");
				$('#kyc_result').show();
				$('#kyc_result').html("Your KYC is approved");
				$('#Email').val(ReturnValues['email']);
				$('#kyc_result').css('color', 'green');
			}else{
				$("#email").val("");
				$("#phone").val("");
				$('#RegisterMe').attr("disabled","disabled");
				$('#kyc_result').show();
				$('#kyc_result').html("Your KYC is NOT approved");
				$('#kyc_result').css('color', 'red');
			}
		});
	}

function CheckDepositForm(){

	if($("#attached").is(':checked')==true && $("#agree").is(':checked')==true && $("#correct").is(':checked')==true ){
		$("#DepositSubmit").removeAttr("disabled");
		$("#AlertSelect").hide();
	}else{
		$("#AlertSelect").show();
		$('#DepositSubmit').attr("disabled","disabled");
	}
}

function CheckWithdrawForm(){
	$("#AlertWithdrawSelect").show();
	if($("#withdrawAmount").val()<=0){return false;}
	if($("#withdrawName").val()==""){return false;}
	if($("#withdrawBankName").val()==""){return false;}
	if($("#withdrawAccountNumber").val()==""){return false;}
	if($("#withdrawBankAddress").val()==""){return false;}
	if($("#withdrawSwiftCode").val()==""){return false;}

	if($("#withdrawAgree").is(':checked')){
		$("#WithdrawSubmit").removeAttr("disabled");
		$("#AlertWithdrawSelect").hide();
	}else{
		$("#AlertWithdrawSelect").show();
		$('#WithdrawSubmit').attr("disabled","disabled");
	}

	CalculateWithdrawAmount();
}

$("#DepositSelect").click(function() {
	$("#DepositInput").trigger("click");
    $('#DepositInput').change(function() {
       $("#SelectedFile").html($("#DepositInput").val());
							$("#SelectedSourceFile").val($("#DepositInput").val());

								$("#SaveButton").removeAttr("disabled");

    });
});
function CalculateWithdrawAmount(){
	var currency = $("#withdrawCurrency").val();
	var max = parseFloat($("#maxWithdraw").val());
	var value = parseFloat($("#withdrawAmount").val());

	var num = value * 0.2 / 100;
	var VantuMin = parseFloat($("#withdrawVantuChargesMin").val());
	var VantuMax = parseFloat($("#withdrawVantuChargesMax").val());
	var VantuPercent = parseFloat($("#withdrawVantuChargesPercent").val());

	if(value>max){value=max;}
	if(value>max){$("#withdrawAmount").val(max);return false;}
	if(value<VantuMin){value=VantuMin+5.16;}

	var VantuCharges = 0;
	VantuCharges = value * VantuPercent / 100;
	if (VantuCharges < VantuMin){VantuCharges = VantuMin;}
	if (VantuCharges > VantuMax){VantuCharges = VantuMax;}
	VantuCharges = (Math.round(VantuCharges * 100) / 100).toFixed(2);
	var ILS = (Math.round(num * 100) / 100).toFixed(2);

	$("#ILSCharges").html(ILS + " " + currency);
	$("#withdrawILSCharges").val(ILS);
	$("#NewwithdrawAmount").html((value - ILS - VantuCharges).toFixed(2) + " " + currency);
	$("#netWithdrawAmount").val((value - ILS - VantuCharges).toFixed(2));
	$("#VantuCharges").html(VantuCharges  + " " + currency);
	$("#withdrawAmount").val(value);
}

$("#WithdrawSelect").click(function() {
	$("#WithdrawInput").trigger("click");
    $('#WithdrawInput').change(function() {
       $("#SelectedWithdrawFile").html($("#WithdrawInput").val());
							$("#SelectedSourceFileWithdraw").val($("#WithdrawInput").val());

								$("#SaveWithdrawButton").removeAttr("disabled");

    });
});

function CallAdmin(){
	var Reference = $("#Reference").html();
	var AdminUser = $("#AdminUser").val();
	if(AdminUser==""){return false;}
	$.getJSON(locale+'/Users/CallAdmin/'+Reference+'/'+AdminUser,
		function(ReturnValues){
			if(ReturnValues){
				if(ReturnValues['success']==1){
					$("#alert-danger").hide();
					$("#alert-success").html('Calling...  +' + AdminUser);
					$("#alert-success").show();
				}
				if(ReturnValues['success']==0){
					$("#alert-danger").show();
					$("#alert-danger").html('Error!');
					$("#alert-success").hide();

				}
			}
		}
	);
}
function ConfirmAdmin(){
	var Reference = $("#Reference").html();
	var AdminUser = $("#AdminUser").val();
	var AdminTOTP = $("#AdminTOTP").val();
	if(AdminUser==""){return false;}
	$.getJSON(locale+'/Users/ConfirmAdmin/'+Reference+'/'+AdminUser+'/'+AdminTOTP,
		function(ReturnValues){
			if(ReturnValues){
				if(ReturnValues['success']==1){
					$("#alert-danger").hide();
					$("#alert-success").html('Confirmed!');
					$("#alert-success").show();
					alert("Confirmed!");
					window.location.assign(locale+"/users/confirmUpload/"+Reference);
				}
				if(ReturnValues['success']==0){
					$("#alert-danger").show();
					$("#alert-danger").html('NOT CONFIRMED! Error!');
					$("#alert-success").hide();

				}
			}
		}
	);
}
function RejectAdmin(){
	var Reference = $("#Reference").html();
	var AdminUser = $("#AdminUser").val();
	var AdminTOTP = $("#AdminTOTP").val();
	if(AdminUser==""){return false;}
		$.getJSON(locale+'/Users/RejectAdmin/'+Reference+'/'+AdminUser+'/'+AdminTOTP,
		function(ReturnValues){
			if(ReturnValues){
				if(ReturnValues['success']==1){
					$("#alert-danger").hide();
					$("#alert-success").html('Rejected!');
					$("#alert-success").show();
					alert("Rejected!");
					window.location.assign(locale+"/users/confirmUpload/"+Reference);

				}
				if(ReturnValues['success']==0){
					$("#alert-danger").show();
					$("#alert-danger").html('Error!');
					$("#alert-success").hide();

				}
			}
		}
	);
}
function SendtoILS(){
	var Reference = $("#Reference").html();
	var AdminUser = $("#FinalApprover").html();
	if(AdminUser==""){return false;}
	$.getJSON(locale+'/Users/SendtoILS/'+Reference+'/'+AdminUser,
		function(ReturnValues){
			if(ReturnValues){
				if(ReturnValues['success']==1){
					alert("Sent to ILS!");
					window.location.assign(locale+"/users/confirmUpload/"+Reference);
				}
				if(ReturnValues['success']==0){
				}
			}
		}
	);
}
function SendtoUser(){
	var Reference = $("#Reference").html();
	var AdminUser = $("#FinalApprover").html();
	if(AdminUser==""){return false;}
	$.getJSON(locale+'/Users/SendtoUser/'+Reference+'/'+AdminUser,
		function(ReturnValues){
			if(ReturnValues){
				if(ReturnValues['success']==1){
					alert("Rejection information sent to user!");
					window.location.assign(locale+"/users/confirmUpload/"+Reference);
				}
				if(ReturnValues['success']==0){
				}
			}
		}
	);

}
function ChangeLanguage(local,uri){
	locale = local;
	var nexturi = "";
	var uri = window.location.pathname.substr(1);

if(uri.substr(0,2)=='de' || uri.substr(0,2)=='en' || uri.substr(0,2)=='es' || uri.substr(0,2)=='hi'){
			nexturi = '/'+local+'/'+(uri.substr(3));
	}else{
			nexturi = '/'+local+'/'+uri;
	}

	window.location.assign(nexturi);
}
function AutoBTC(){
	var AutoBTC = $("#AutoBTC").val();
		$.getJSON(locale+'/Updates/AutoBTC/'+AutoBTC,
		function(ReturnValues){
			if(ReturnValues['Updated']=="Yes"){
				alert("Updated BTC address: "+ AutoBTC)
			}
		}
		);
}
function AutoXGC(){
	var AutoXGC = $("#AutoXGC").val();
			$.getJSON(locale+'/Updates/AutoXGC/'+AutoXGC,
			function(ReturnValues){
			if(ReturnValues['Updated']=="Yes"){
				alert("Updated XGC address: "+ AutoXGC)
			}
			}
		);
}
function VerifyBTC(){
	var AutoBTC = $("#AutoBTC").val();
		$.getJSON(locale+'/Updates/VerifyBTC/'+AutoBTC,
		function(ReturnValues){
			if(ReturnValues['Updated']=="Yes"){
				alert("Verified BTC address: "+ AutoBTC);
				window.location.assign(locale+"/ex/dashboard");
			}else{
				alert("Incorrect BTC address: "+ AutoBTC);
			}
		}
		);
}
function VerifyXGC(){
	var AutoXGC = $("#AutoXGC").val();
			$.getJSON(locale+'/Updates/VerifyXGC/'+AutoXGC,
			function(ReturnValues){
			if(ReturnValues['Updated']=="Yes"){
				alert("Verified XGC address: "+ AutoXGC);
				window.location.assign(locale+"/ex/dashboard");
			}else
			{
				alert("Incorrect XGC address: "+ AutoXGC);
			}
			}
		);
}


text:
GLOBAL.Q = require('q');
var jsFile = "./" + process.argv[2];
require(jsFile);


text:
Контейнер Vector, аналогичный std::vector, и итератор для него. Поддерживаются методы operator[], push_back, pop_back, empty, size, clear, begin, end, rbegin, rend, resize.

### Компиляция

make или  g++ -std=c++11 -Wall -Werror -Wextra main.cpp -o vector  -O2

### Запуск

./vector


text:
class CreateSpreeCopaymentRelations < ActiveRecord::Migration
  def change
    create_table :spree_copayment_relations do |t|
      t.integer :relatable_id
      t.integer :related_to_id
      t.decimal :discount_amount, precision: 8, scale: 2, default: 0.0
      t.integer :position

      t.timestamps null: false
    end

    add_index :spree_copayment_relations, :relatable_id
    add_index :spree_copayment_relations, :related_to_id
    add_index :spree_copayment_relations, [:relatable_id, :related_to_id], name: 'index_copayment_relations_ids'
  end
end


text:
<?php

namespace Tests\Modules\User\Auth;

use Config;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;

class SignUpControllerTest extends TestCase
{
    use DatabaseTransactions;

    public function testSignUpSuccessfully()
    {
        $this->post('api/auth/signup', [
            'name'     => 'Test User',
            'email'    => 'test@email.com',
            'password' => '123456'
        ])->assertJson([
            'status' => 'ok'
        ])->assertStatus(201);
    }

    public function testSignUpSuccessfullyWithTokenRelease()
    {
        Config::set('boilerplate.sign_up.release_token', true);

        $this->post('api/auth/signup', [
            'name'     => 'Test User',
            'email'    => 'test@email.com',
            'password' => '123456'
        ])->assertJsonStructure([
            'status', 'token'
        ])->assertJson([
            'status' => 'ok'
        ])->assertStatus(201);
    }

    public function testSignUpReturnsValidationError()
    {
        $this->post('api/auth/signup', [
            'name'  => 'Test User',
            'email' => 'test@email.com'
        ])->assertJsonStructure([
            'error'
        ])->assertStatus(422);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SFA.DAS.ProviderApprenticeshipsService.Domain.Models.Organisation
{
    public class LegalEntity
    {
        public string Name { get; set; }
        public string RegisteredAddress { get; set; }
        public short Source { get; set; }
        public long Id { get; set; }
        public string Code { get; set; }
        public string AccountLegalEntityPublicHashedId { get; set; }
    }
}


text:
local state
local lastState
local clearInput = require('input').clear
local renderList = {}

local update = function(dt)
  local initial = state ~= lastState
  lastState = state
  renderList = state(dt, initial)
  clearInput()
end

local getRenderList = function()
  return renderList
end

local setState = function(newState)
  state = newState
end

return {
  update = update,
  getRenderList = getRenderList,
  setState = setState,
}


text:
'use strict';

export function nameToUrl(name) {
  return name.replace(/[^a-zA-Z0-9]+/g, '-').toLowerCase().trim('-');
};


text:
package com.MayaProject.Ragusa.Federico.Adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;

import edu.cmu.pocketsphinx.demo.R;

/**
 * Created by Federico on 24/11/2016.
 */
public class MeteoAdapter extends RecyclerView.Adapter<MeteoAdapter.PlanetViewHolder> {

    ArrayList<String> songList;

    public MeteoAdapter(ArrayList<String> planetList, Context context) {
        this.songList = planetList;
    }

    @Override
    public MeteoAdapter.PlanetViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.meteo_row,parent,false);
        PlanetViewHolder viewHolder=new PlanetViewHolder(v);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(MeteoAdapter.PlanetViewHolder holder, int position) {
        holder.text.setText(songList.get(position).toString());
    }

    @Override
    public int getItemCount() {
        return songList.size();
    }

    public static class PlanetViewHolder extends RecyclerView.ViewHolder{

        protected ImageView image;
        protected TextView text;

        public PlanetViewHolder(View itemView) {
            super(itemView);
            image= (ImageView) itemView.findViewById(R.id.image_id);
            text= (TextView) itemView.findViewById(R.id.text_id);
        }
    }
}


text:
using UIKit;

namespace TransitionSubmitSample
{
    public class Application
    {
        static void Main(string[] args)
        {
            UIApplication.Main(args, null, typeof(AppDelegate));
        }
    }
}


text:
.class final Landroid/media/AudioService$SoundPoolCallback;
.super Ljava/lang/Object;
.source "AudioService.java"

# interfaces
.implements Landroid/media/SoundPool$OnLoadCompleteListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/media/AudioService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x12
    name = "SoundPoolCallback"
.end annotation

# instance fields
.field mSamples:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field mStatus:I

.field final synthetic this$0:Landroid/media/AudioService;

# direct methods
.method private constructor <init>(Landroid/media/AudioService;)V
    .locals 1
    .parameter

    .prologue
    .line 1994
    iput-object p1, p0, Landroid/media/AudioService$SoundPoolCallback;->this$0:Landroid/media/AudioService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 1997
    const/4 v0, 0x1

    iput v0, p0, Landroid/media/AudioService$SoundPoolCallback;->mStatus:I

    .line 1998
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Landroid/media/AudioService$SoundPoolCallback;->mSamples:Ljava/util/List;

    return-void
.end method

.method synthetic constructor <init>(Landroid/media/AudioService;Landroid/media/AudioService$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 1994
    invoke-direct {p0, p1}, Landroid/media/AudioService$SoundPoolCallback;-><init>(Landroid/media/AudioService;)V

    return-void
.end method

# virtual methods
.method public onLoadComplete(Landroid/media/SoundPool;II)V
    .locals 4
    .parameter "soundPool"
    .parameter "sampleId"
    .parameter "status"

    .prologue
    .line 2014
    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->this$0:Landroid/media/AudioService;

    #getter for: Landroid/media/AudioService;->mSoundEffectsLock:Ljava/lang/Object;
    invoke-static {v1}, Landroid/media/AudioService;->access$1500(Landroid/media/AudioService;)Ljava/lang/Object;

    move-result-object v2

    monitor-enter v2

    .line 2015
    :try_start_0
    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->mSamples:Ljava/util/List;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-interface {v1, v3}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result v0

    .line 2016
    .local v0, i:I
    if-ltz v0, :cond_0

    .line 2017
    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->mSamples:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    .line 2019
    :cond_0
    if-nez p3, :cond_1

    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->mSamples:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 2020
    :cond_1
    iput p3, p0, Landroid/media/AudioService$SoundPoolCallback;->mStatus:I

    .line 2021
    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->this$0:Landroid/media/AudioService;

    #getter for: Landroid/media/AudioService;->mSoundEffectsLock:Ljava/lang/Object;
    invoke-static {v1}, Landroid/media/AudioService;->access$1500(Landroid/media/AudioService;)Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->notify()V

    .line 2023
    :cond_2
    monitor-exit v2

    .line 2024
    return-void

    .line 2023
    .end local v0           #i:I
    :catchall_0
    move-exception v1

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public setSamples([I)V
    .locals 3
    .parameter "samples"

    .prologue
    .line 2005
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    array-length v1, p1

    if-ge v0, v1, :cond_1

    .line 2007
    aget v1, p1, v0

    if-lez v1, :cond_0

    .line 2008
    iget-object v1, p0, Landroid/media/AudioService$SoundPoolCallback;->mSamples:Ljava/util/List;

    aget v2, p1, v0

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 2005
    :cond_0
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 2011
    :cond_1
    return-void
.end method

.method public status()I
    .locals 1

    .prologue
    .line 2001
    iget v0, p0, Landroid/media/AudioService$SoundPoolCallback;->mStatus:I

    return v0
.end method


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

public class CargoHold : ScriptableObject
{
    public const int BadIndex = -1;

    [SerializeField]
    private List<ItemType> items = new List<ItemType>();

    public IEnumerable<ItemType> Items
    {
        get { return items; }
    }

    public ItemType this[int index]
    {
        get
        {
            return items[index];
        }
        set
        {
            items[index] = value;
        }
    }

    public int Size
    {
        get
        {
            return items.Count;
        }
        set
        {
            items.Resize(value);
        }
    }

    public int FreeCapacity
    {
        get
        {
            int empty = 0;
            items.ForEach(item =>
            {
                if (item == null)
                {
                    ++empty;
                }
            });
            return empty;
        }
    }

    public int ItemCount
    {
        get
        {
            return Size - FreeCapacity;
        }
    }

    public int FirstFreeIndex
    {
        get
        {
            for (int i = 0; i < Size; ++i)
            {
                if (this[i] == null)
                {
                    return i;
                }
            }

            return BadIndex;
        }
    }

    /// <summary>
    /// Adds an item in the first empty slot
    /// </summary>
    /// <param name="item">non-null item type to add</param>
    public void Add(ItemType item)
    {
        Debug.Assert(!!item, "item must not be null");
        Debug.AssertFormat(FreeCapacity > 0, "cargo hold does not have space to add item {0}, size is {1} and free capacity is {2}",
            item, Size, FreeCapacity);

        for (int index = 0; index < items.Count; ++index)
        {
            if (this[index] == null)
            {
                this[index] = item;
                break;
            }
        }
    }

    public ItemType RemoveAt(int index)
    {
        Debug.Assert(IsValidIndex(index), "RemoveAt should only reference valid indices");

        var removed = this[index];

        this[index] = null;
        return removed;
    }

    public void Swap(int src, int dest)
    {
        Debug.Assert(IsValidIndex(src) && IsValidIndex(dest), "Swap should only reference valid indices");

        var old = this[dest];
        this[dest] = this[src];
        this[src] = old;
    }

    public bool IsValidIndex(int index)
    {
        return index >= 0 && index < Size;
    }

    public bool IsIndexFree(int index)
    {
        return IsValidIndex(index) && this[index] == null;
    }

    public bool ContainsItems(ItemType itemType, int quantity)
    {
        int count = 0;

        for (int slot = 0; slot < Size; ++slot)
        {
            if (this[slot] == itemType)
            {
                ++count;
            }
        }

        return count >= quantity;
    }
}


text:
<!DOCTYPE html>

	<title>Entity Framework Designer T4 API - Search</title>
	<link rel="stylesheet" type="text/css" href="styles/branding.css" />
	<link rel="stylesheet" type="text/css" href="styles/branding-Website.css" />

		Entity Framework Designer T4 API - Search

				<form id="SearchForm" method="get" action="#" onsubmit="javascript:PerformSearch(); return false;">
				<input id="txtSearchText" type="text" maxlength="200" />
				<button id="HeaderSearchButton" type="submit" class="header-search-button">
				</button>
				</form>

			  <input type="checkbox" id="chkSortByTitle" onclick="javascript:PerformSearch();" />
			Sort by title

				Back


text:
using System;
using System.Collections.Generic;
using System.Linq;
using LogShark.Containers;
using LogShark.Plugins.Hyper.Model;
using LogShark.Shared;
using LogShark.Shared.LogReading.Containers;
using LogShark.Writers;
using LogShark.Writers.Containers;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace LogShark.Plugins.Hyper
{
    public class HyperPlugin : IPlugin
    {
        private static readonly List<LogType> ConsumedLogTypesInternal = new List<LogType> { LogType.Hyper };
        public IList<LogType> ConsumedLogTypes => ConsumedLogTypesInternal;

        public string Name => "Hyper";

        private static readonly DataSetInfo HyperErrorOutputInfo = new DataSetInfo("Hyper", "HyperErrors");
        private static readonly DataSetInfo HyperQueryOutputInfo = new DataSetInfo("Hyper", "HyperQueries");

        private IWriter<HyperError> _hyperErrorWriter;
        private IWriter<HyperEvent> _hyperQueryWriter;
        private IProcessingNotificationsCollector _processingNotificationsCollector;

        private readonly HashSet<string> _eventTypes = new HashSet<string>() { "query-end", "query-end-cancelled", "query-end-canceled", "connection-startup-begin", "connection-startup-end", "cancel-request-received", "connection-close-request",
            "dbregistry-load", "dbregistry-release", "query-result-sent", "tcp-ip-client-allowed", "tcp-ip-client-rejected", "query-plan-slow", "query-plan-spooling", "query-plan-cancelled",
            "startup-info", "resource-stats", "log-rate-limit-reached", "asio-continuation-slow" };

        public void Configure(IWriterFactory writerFactory, IConfiguration pluginConfig, IProcessingNotificationsCollector processingNotificationsCollector, ILoggerFactory loggerFactory)
        {
            _hyperErrorWriter = writerFactory.GetWriter<HyperError>(HyperErrorOutputInfo);
            _hyperQueryWriter = writerFactory.GetWriter<HyperEvent>(HyperQueryOutputInfo);
            _processingNotificationsCollector = processingNotificationsCollector;
        }

        public void ProcessLogLine(LogLine logLine, LogType logType)
        {
            if (!(logLine.LineContents is NativeJsonLogsBaseEvent baseEvent))
            {
                var errorMessage = $"Was not able to cast line contents as {nameof(NativeJsonLogsBaseEvent)}";
                _processingNotificationsCollector.ReportError(errorMessage, logLine, nameof(HyperPlugin));
                return;
            }

            try
            {

                WriteHyperErrorIfMatch(logLine, baseEvent);
                WriteHyperQueryIfMatch(logLine, baseEvent);
            }
            catch (Exception)
            {
                _processingNotificationsCollector.ReportError("Failed to parse line", logLine, nameof(HyperPlugin));
            }
        }

        private void WriteHyperErrorIfMatch(LogLine logLine, NativeJsonLogsBaseEvent jsonEvent)
        {
            if (jsonEvent.Severity != "error" && jsonEvent.Severity != "fatal")
            {
                return;
            }

            var valueString = GetHyperErrorValueString(jsonEvent.EventPayload);
            if (valueString == null)
            {
                _processingNotificationsCollector.ReportError("Failed to parse event payload message", logLine, nameof(HyperPlugin));
                return;
            }

            var hyperError = new HyperError()
            {
                FileName = logLine.LogFileInfo.FileName,
                FilePath = logLine.LogFileInfo.FilePath,
                Key = jsonEvent.EventType,
                Line = logLine.LineNumber,
                ProcessId = jsonEvent.ProcessId,
                RequestId = jsonEvent.RequestId,
                SessionId = jsonEvent.SessionId,
                Severity = jsonEvent.Severity,
                Site = jsonEvent.Site,
                ThreadId = jsonEvent.ThreadId,
                Timestamp = jsonEvent.Timestamp,
                User = jsonEvent.Username,
                Value = valueString,
                Worker = logLine.LogFileInfo.Worker,
            };

            _hyperErrorWriter.AddLine(hyperError);
        }

        private static string GetHyperErrorValueString(JToken value)
        {
            if (value == null)
            {
                return null;
            }

            var valueStrings = value
                .ToObject<Dictionary<string, object>>()
                .Select(kvp => $"{kvp.Key}: {kvp.Value}");
            return string.Join(Environment.NewLine, valueStrings);
        }

        private void WriteHyperQueryIfMatch(LogLine logLine, NativeJsonLogsBaseEvent jsonEvent)
        {
            if (!_eventTypes.Contains(jsonEvent.EventType))
            {
                return;
            }

            var payload = jsonEvent.EventPayload;

            if (jsonEvent.EventType == "log-rate-limit-reached")
            {
                //sub key.. currently only capture events for this one known subkey
                if (payload["key"]?.ToString() != "number-network-threads-low")
                {
                    return;
                }
            }

            var hyperQuery = new HyperEvent()
            {
                FileName = logLine.LogFileInfo.FileName,
                FilePath = logLine.LogFileInfo.FilePath,
                Line = logLine.LineNumber,

                Key = jsonEvent.EventType,
                ProcessId = jsonEvent.ProcessId,
                RequestId = jsonEvent.RequestId,
                SessionId = jsonEvent.SessionId,
                Severity = jsonEvent.Severity,
                Site = jsonEvent.Site,
                ThreadId = jsonEvent.ThreadId,
                Timestamp = jsonEvent.Timestamp,
                User = jsonEvent.Username,
                Worker = logLine.LogFileInfo.Worker,

                // log-rate-limit-reached
                SubKey = payload["key"]?.ToString(),
                CurrentCount = payload["current-count"]?.ToObject<long>() ?? default(long?),
                RemainingIntervalSeconds = payload["remaining-interval-seconds"]?.ToObject<double>() ?? default(double?),

                // asio-continuation-slow
                Source = payload["source"]?.ToString(),

                // *-end, *-release
                Elapsed = payload["elapsed"]?.ToObject<double>() ?? default(double?),

                // query-end, query-end-cancelled
                ClientSessionId = jsonEvent.ContextMetrics?.ClientSessionId ?? payload["client-session-id"]?.ToString(),
                ClientRequestId = jsonEvent.ContextMetrics?.ClientRequestId,
                Columns = payload["cols"]?.ToObject<double>() ?? default(double?),
                CopyDataSize = payload["copydata-size"]?.ToObject<long>() ?? default(long?),
                CopyDataTime = payload["copydata-time"]?.ToObject<double>() ?? default(double?),
                ExclusiveExecution = payload["ExclusiveExecution"]?.ToObject<bool>() ?? default(bool?),
                LockAcquisitionTime = payload["lock-acquisition-time"]?.ToObject<double>() ?? default(double?),
                PeakResultBufferMemoryMb = payload["peak-result-buffer-memory-mb"]?.ToObject<double>() ?? default(double?),
                PeakTransactionMemoryMb = payload["peak-transaction-memory-mb"]?.ToObject<double>() ?? default(double?),
                PlanCacheHitCount = payload["plan-cache-hit-count"]?.ToObject<double>() ?? default(double?),
                PlanCacheStatus = payload["plan-cache-status"]?.ToString(),
                QueryCompilationTime =
                    payload["compilation-time"]?.ToObject<double>()
                    ?? payload["query-compilation-time"]?.ToObject<double>()
                    ?? default(double?),
                QueryExecutionTime =
                    payload["execution-time"]?.ToObject<double>()
                    ?? payload["query-execution-time"]?.ToObject<double>()
                    ?? default(double?),
                QueryParsingTime =
                    payload["parsing-time"]?.ToObject<double>()
                    ?? payload["query-parsing-time"]?.ToObject<double>()
                    ?? default(double?),
                QueryTrunc = payload["query-trunc"]?.ToString(),
                ResultSizeMb = payload["result-size-mb"]?.ToObject<double>() ?? default(double?),
                Rows = payload["rows"]?.ToObject<double>() ?? default(double?),
                Spooling = payload["spooling"]?.ToObject<bool>() ?? default(bool?),
                StatementId = payload["statement-id"]?.ToString(),
                TimeToSchedule = payload["time-to-schedule"]?.ToObject<double>() ?? default(double?),
                TransactionId = payload["transaction-id"]?.ToString(),
                TransactionVisibleId = payload["transaction-visible-id"]?.ToString(),
                ExecThreadsCpuTime = payload["exec-threads"]?["cpu-time"]?.ToObject<double>() ?? default(double?),
                ExecThreadsWaitTime = payload["exec-threads"]?["wait-time"]?.ToObject<double>() ?? default(double?),
                ExecThreadsTotalTime = payload["exec-threads"]?["total-time"]?.ToObject<double>() ?? default(double?),
                StorageAccessTime = payload["exec-threads"]?["storage"]?["access-time"]?.ToObject<double>() ?? default(double?),
                StorageAccessCount = payload["exec-threads"]?["storage"]?["access-count"]?.ToObject<long>() ?? default(long?),
                StorageAccessBytes = payload["exec-threads"]?["storage"]?["access-bytes"]?.ToObject<long>() ?? default(long?),
                StorageWriteTime = payload["exec-threads"]?["storage"]?["write-time"]?.ToObject<double>() ?? default(double?),
                StorageWriteCount = payload["exec-threads"]?["storage"]?["write-count"]?.ToObject<long>() ?? default(long?),
                StorageWriteBytes = payload["exec-threads"]?["storage"]?["write-bytes"]?.ToObject<long>() ?? default(long?),

                // connection-startup-begin
                DbUser = payload["db-user"]?.ToString(),
                Options = payload["options"]?.ToString(),

                // connection-startup-end
                ElapsedInterpretOptions = payload["elapsed-interpret-options"]?.ToObject<double>() ?? default(double?),
                ElapsedCheckUser = payload["elapsed-check-user"]?.ToObject<double>() ?? default(double?),
                ElapsedCheckAuthentication = payload["elapsed-check-authentication"]?.ToObject<double>() ?? default(double?),
                HaveCred = payload["have-cred"]?.ToObject<bool>() ?? default(bool?),
                CredName = payload["cred-name"]?.ToString(),

                // cancel-request-received
                Id = payload["id"]?.ToString(Formatting.None), // some fields have a json object as an id, others have an int, this is a stop gap for our current parsing routine

                Secret = payload["secret"]?.ToObject<long>() ?? default(long?),

                // connection-close-request
                Reason = payload["reason"]?.ToString(),

                // dbregistry-*
                NewRefCount = payload["new-ref-count"]?.ToObject<long>() ?? default(long?),
                Error = payload["error"]?.ToString(),

                // dbregistry-load
                CanonicalPath = payload["canonical-path"]?.ToString(),
                PathGiven = payload["path-given"]?.ToString(),
                ElapseRegistryInsert = payload["elapsed-registry-insert"]?.ToObject<double>() ?? default(double?),
                AlreadyLoaded = payload["already-loaded"]?.ToObject<bool>() ?? default(bool?),
                Reopen = payload["reopen"]?.ToObject<bool>() ?? default(bool?),
                LoadSuccess = payload["load-success"]?.ToObject<bool>() ?? default(bool?),
                DatabaseUuid = payload["database-uuid"]?.ToString(),

                // dbregistry-release
                Saved = payload["saved"]?.ToObject<bool>() ?? default(bool?),
                FailedOnLoad = payload["failed-on-load"]?.ToObject<bool>() ?? default(bool?),
                WasUnloaded = payload["was-unloaded"]?.ToObject<bool>() ?? default(bool?),
                WasDropped = payload["was-dropped"]?.ToObject<bool>() ?? default(bool?),
                ElapsedSave = payload["elapsed-save"]?.ToObject<double>() ?? default(double?),
                Closed = payload["closed"]?.ToObject<bool>() ?? default(bool?),
                ElapsedRegistryClose = payload["elapsed-registry-close"]?.ToObject<double>() ?? default(double?),

                // query-result-sent
                Success = payload["success"]?.ToObject<bool>() ?? default(bool?),
                TimeSinceQueryEnd = payload["time-since-query-end"]?.ToObject<double>() ?? default(double?),
                TransferredVolumeMb = payload["transferred-volume-mb"]?.ToObject<double>() ?? default(double?),

                // tcp-ip-client-allowed, tcp-ip-client-rejected
                RemoteAddress = payload["remote-address"]?.ToString(),

                // query-plan-slow, query-plan-spooling, query-plan-cancelled
                Plan = payload["plan"]?.ToString(),

                // startup-info
                CommandLine = payload["command-line"]?.ToString(),
                ServerVersion = payload["server-version"]?.ToString(),
                BuildVersion = payload["build-version"]?.ToString(),
                BuildType = payload["build-type"]?.ToString(),
                BuildCpuFeatures = payload["build-cpu-features"]?.ToString(),
                NetworkThreads = payload["network-threads"]?.ToObject<long>() ?? default(long?),
                ParentPid = payload["parent-pid"]?.ToObject<long>() ?? default(long?),
                MinProtocolVersion = payload["min-protocol-version"]?.ToObject<long>() ?? default(long?),
                MaxProtocolVersion = payload["max-protocol-version"]?.ToObject<long>() ?? default(long?),

                // resource-stats
                VirtualTotalMb = payload["memory"]?["virtual"]?["total-mb"]?.ToObject<long>() ?? default(long?),
                VirtualSystemMb = payload["memory"]?["virtual"]?["system-mb"]?.ToObject<long>() ?? default(long?),
                VirtualProcessMb = payload["memory"]?["virtual"]?["process-mb"]?.ToObject<long>() ?? default(long?),
                PhysicalTotalMb = payload["memory"]?["physical"]?["total-mb"]?.ToObject<long>() ?? default(long?),
                PhysicalSystemMb = payload["memory"]?["physical"]?["system-mb"]?.ToObject<long>() ?? default(long?),
                PhysicalProcessMb = payload["memory"]?["physical"]?["process-mb"]?.ToObject<long>() ?? default(long?),
                GlobalCurrentMb = payload["mem-tracker"]?["global"]["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalPeakMb = payload["mem-tracker"]?["global"]["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalNetworkReadbufferCurrentMb = payload["mem-tracker"]?["global_network_readbuffer"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalNetworkReadbufferPeakMb = payload["mem-tracker"]?["global_network_readbuffer"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalNetworkWriteBufferCurrentMb = payload["mem-tracker"]?["global_network_writebuffer"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalNetworkWriteBufferPeakMb = payload["mem-tracker"]?["global_network_writebuffer"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalStringpoolCurrentMb = payload["mem-tracker"]?["global_stringpool"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalStringpoolPeakMb = payload["mem-tracker"]?["global_stringpool"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalTransactionsCurrentMb = payload["mem-tracker"]?["global_transactions"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalTransactionsPeakMb = payload["mem-tracker"]?["global_transactions"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalLockedCurrentMb = payload["mem-tracker"]?["global_locked"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalLockedPeakMb = payload["mem-tracker"]?["global_locked"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalTupleDataCurrentMb = payload["mem-tracker"]?["global_tuple_data"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalTupleDataPeakMb = payload["mem-tracker"]?["global_tuple_data"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalPlanCacheCurrentMb = payload["mem-tracker"]?["global_plan_cache"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalPlanCachePeakMb = payload["mem-tracker"]?["global_plan_cache"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalExternalTableCacheCurrentMb = payload["mem-tracker"]?["global_external_table_cache"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalExternalTableCachePeakMb = payload["mem-tracker"]?["global_external_table_cache"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskNetworkReadbufferCurrentMb = payload["mem-tracker"]?["global_disk_network_readbuffer"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskNetworkReadbufferPeakMb = payload["mem-tracker"]?["global_disk_network_readbuffer"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskNetworkWritebufferCurrentMb = payload["mem-tracker"]?["global_disk_network_writebuffer"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskNetworkWritebufferPeakMb = payload["mem-tracker"]?["global_disk_network_writebuffer"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskStringpoolCurrentMb = payload["mem-tracker"]?["global_disk_stringpool"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskStringpoolPeakMb = payload["mem-tracker"]?["global_disk_stringpool"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskTransactionCurrentMb = payload["mem-tracker"]?["global_disk_transaction"]?["current-mb"]?.ToObject<long>() ?? default(long?),
                GlobalDiskTransactionPeakMb = payload["mem-tracker"]?["global_disk_transaction"]?["peak-mb"]?.ToObject<long>() ?? default(long?),
            };

            _hyperQueryWriter.AddLine(hyperQuery);
        }

        public SinglePluginExecutionResults CompleteProcessing()
        {
            var writersLineCounts = new List<WriterLineCounts>
            {
                _hyperErrorWriter.Close(),
                _hyperQueryWriter.Close()
            };
            return new SinglePluginExecutionResults(writersLineCounts);
        }

        public void Dispose()
        {
            _hyperErrorWriter?.Dispose();
            _hyperQueryWriter?.Dispose();
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl N. Amer. 2:319. 1842

#### Original name
null

### Remarks
null


text:
package com.verizon.cab.management.util;

public class SendGridException extends Exception {
    public SendGridException(Exception e) {
        super(e);
    }
}


text:
/*! Echo v1.5.0 | (c) 2014 @toddmotto | MIT license | github.com/toddmotto/echo */
window.Echo = (function (global, document, undefined) {

  'use strict';

  /**
   * store
   * @type {Array}
   */
  var store = [];

  /**
   * offset, throttle, poll vars
   */
  var offset, throttle, poll;

  /**
   *  _inView
   * @private
   * @param {Element} element Image element
   * @returns {Boolean} Is element in viewport
   */
  var _inView = function (element) {
    var coords = element.getBoundingClientRect();
    return ((coords.top >= 0 && coords.left >= 0 && coords.top) <= (window.innerHeight || document.documentElement.clientHeight) + offset);
  };

  /**
   * _pollImages Loop through the images if present
   * or remove all event listeners
   * @private
   */
  var _pollImages = function () {
    var length = store.length;
    if (length > 0) {
      for (var i = 0; i < length; i++) {
        var self = store[i];
        if (self && _inView(self)) {
          self.src = self.getAttribute('data-echo');
          store.splice(i, 1);
          length = store.length;
          i--;
        }
      }
    } else {
      if (document.removeEventListener) {
        global.removeEventListener('scroll', _throttle);
      } else {
        global.detachEvent('onscroll', _throttle);
      }
      clearTimeout(poll);
    }
  };

  /**
   * _throttle Sensible event firing
   * @private
   */
  var _throttle = function () {
    clearTimeout(poll);
    poll = setTimeout(_pollImages, throttle);
  };

  /**
   * init Module init function
   * @param {Object} [obj] Passed in Object with options
   * @param {Number|String} [obj.throttle]
   * @param {Number|String} [obj.offset]
   */
  var init = function (obj) {

    var nodes = document.querySelectorAll('[data-echo]');
    var opts = obj || {};
    offset = parseInt(opts.offset || 0);
    throttle = parseInt(opts.throttle || 250);

    for (var i = 0; i < nodes.length; i++) {
      store.push(nodes[i]);
    }

    _pollImages();

    if (document.addEventListener) {
      global.addEventListener('scroll', _throttle, false);
      global.addEventListener('load', _throttle, false);
    } else {
      global.attachEvent('onscroll', _throttle);
      global.attachEvent('onload', _throttle);
    }

  };

  /**
   * return Public methods
   * @returns {Object}
   */
  return {
    init: init,
    render: _pollImages
  };

})(this, document);


text:
require 'test_helper'

class TriggerTest < ActiveSupport::TestCase

  #
  # Options and Configuration
  #
  context "options and configuration" do

    setup do
      @sample_search_trigger = Whenbot::Channels::Developer::Triggers::SampleSearch
    end

    should "allow a new option to be set for itself with #option" do
      display_title_text = "Sample Search Trigger"
      @sample_search_trigger.set_option :display_title, display_title_text
      assert_equal display_title_text, @sample_search_trigger.options[:display_title]
    end

    should "keep options separate for separate Triggers" do
      twitter_trigger = Whenbot::Channels::Twitter::Triggers::NewTweetFrom

      twitter_display_text = "New tweet from"
      sample_search_display_text = "Sample Search"

      @sample_search_trigger.set_option :display_title, sample_search_display_text
      twitter_trigger.set_option :display_title, twitter_display_text

      assert_not_equal @sample_search_trigger.options[:display_title], twitter_trigger.options[:display_title], "The display titles should be different. Are they sharing the same instance?"
    end

  end

  #
  # Saved Trigger (model) data
  #
  # parameters is an array of hashes with the saved parameters, plus
  # hashes for :match_data, :extra_data and :last_matched.
  #

  context "triggers_for method" do

    setup do
      @default_trigger = FactoryGirl.create(:trigger)
      @matching_trigger = FactoryGirl.create(:matching_trigger)
      @saved_triggers_count = 2
      @triggers, @trigger_ids = Trigger.triggers_for('Developer', 'SampleSearch')
    end

    should "return an array of Triggers for a given channel and trigger" do
      assert_kind_of Array, @triggers, "return value is not an Array"
    end

    should "only have one element in the array" do
      assert_equal @saved_triggers_count, @triggers.count, "Has more than one element in the array"
    end

    should "return an array of Trigger IDs for a given channel and trigger" do
      assert_kind_of Array, @trigger_ids, "return value is not an Array"
    end

    should "have one ID entry in the array for each Trigger returned" do
      assert_equal @triggers.count, @trigger_ids.count, "IDs array didn't contain the same number of elements as the Triggers array"
    end

    should "contain a hash" do
      @triggers.each do |trigger|
        assert_kind_of Hash, trigger, "Array did not contain hashes"
      end
    end

    should "have a :parameters key for each trigger" do
      @triggers.each do |trigger|
        assert trigger.has_key?(:parameters), "should have :parameters key"
      end
    end

    should "populate :parameters hash with saved parameters as a hash" do
      @triggers.each do |trigger|
        assert_not_nil trigger[:parameters], ":parameters should not be nil"
        assert_kind_of Hash, trigger[:parameters], ":parameters key is not a Hash"
      end

      @default_trigger.parameters.keys.each do |key|
        assert @triggers[0][:parameters].keys.include?(key), ":parameters hash is missing a \"#{key}\" key"
      end
    end

    should "have an empty hash called :match_data for each trigger" do
      @triggers.each do |trigger|
        assert trigger.has_key?(:match_data), "trigger didn't have a :match_data key"
        assert_kind_of Hash, trigger[:match_data], "trigger[:match_data] wasn't a Hash"
        assert trigger[:match_data].empty?, "trigger[:match_data] wasn't empty"
        assert_not_nil trigger[:match_data], "trigger[:match_data] should not be nil"
      end
    end

    should "have a hash called :extra_data for each trigger" do
      @triggers.each do |trigger|
        # Note: This hash can contain data, if the Trigger saved something there before.
        assert trigger.has_key?(:extra_data), "trigger didn't have an :extra_data key"
        assert_kind_of Hash, trigger[:extra_data], "trigger[:extra_data] wasn't a Hash"
      end
    end

    should "have a hash for :last_matched for each trigger" do
      @triggers.each do |trigger|
        assert trigger.has_key?(:last_matched), "trigger didn't have a :last_matched key"
        assert_kind_of ActiveSupport::TimeWithZone, trigger[:last_matched], "trigger[:last_matched] wasn't a Time object"
        assert_not_nil trigger[:last_matched], "trigger[:last_matched] was nil"
      end
    end

    should "return appropriate results with symbols as input" do
      assert_nothing_raised do
        triggers, trigger_ids = Trigger.triggers_for(:developer, :sample_search)
        assert_not_nil triggers, "no triggers were returned"
      end
    end

    should "return appropriate results with underscorized strings as input" do
      assert_nothing_raised do
        triggers, trigger_ids = Trigger.triggers_for('developer', 'sample_search')
        assert_not_nil triggers, "no triggers were returned"
      end
    end
  end
end


text:
title: KACF/AWGC
date: 2008-01-22T23:20:00-05:00
venue:
  name: Korean American Community Foundation and the Asian Women's Giving Circle, NEW YORK
link:
_slug: kacf_awgc
---

Korean American Community Foundation and the Asian Women's Giving Circle sponsor:
A Public Conversation with Kyung Yoon and Min Jin Lee about FREE FOOD FOR MILLIONAIRES

Tuesday, 6.30PM-8.30PM

SHIN CHOI BOUTIQUE in SOHO
119 Mercer Street, between Spring and Prince
Seating is limited: Please RSVP to John Rhee
john.rhee@kacfny.org or 201-670-1198


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

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <parent>
    <groupId>org.guvnor</groupId>
    <artifactId>guvnor-ala-openshift-ui</artifactId>
    <version>7.5.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>guvnor-ala-openshift-ui-client</artifactId>

  <name>Guvnor ALA :: OpenShift UI - Client</name>
  <description>Guvnor ALA :: OpenShift UI - Client</description>

  <dependencies>

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.jsinterop</groupId>
      <artifactId>jsinterop-annotations</artifactId>
    </dependency>

    <dependency>
      <groupId>org.gwtbootstrap3</groupId>
      <artifactId>gwtbootstrap3</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ui</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-common</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kie.soup</groupId>
      <artifactId>kie-soup-commons</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-client-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-core-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-commons</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-workbench-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons-editor-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-project-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-ala-ui-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-ala-ui-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-ala-openshift-ui-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.gwt.gwtmockito</groupId>
      <artifactId>gwtmockito</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-testing-utils</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-ala-ui-api</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-ala-ui-client</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>