text
stringlengths 4
5.48M
| meta
stringlengths 14
6.54k
|
---|---|
namespace {
bool contains(std::string str, std::string substr) {
return str.find(substr) != std::string::npos;
}
// A View that positions itself over another View to intercept clicks.
class ClickTrackingOverlayView : public views::View {
public:
explicit ClickTrackingOverlayView(OmniboxResultView* result) {
// |result|'s parent is the OmniboxPopupContentsView, which expects that all
// its children are OmniboxResultViews. So skip over it and add this to the
// OmniboxPopupContentsView's parent.
auto* contents = result->parent();
SetBoundsRect(contents->ConvertRectToParent(result->bounds()));
contents->parent()->AddChildView(this);
}
// views::View:
void OnMouseEvent(ui::MouseEvent* event) override {
last_click_ = event->location();
}
absl::optional<gfx::Point> last_click() const { return last_click_; }
private:
absl::optional<gfx::Point> last_click_;
};
// Helper to wait for theme changes. The wait is triggered when an instance of
// this class goes out of scope.
class ThemeChangeWaiter {
public:
explicit ThemeChangeWaiter(ThemeService* theme_service)
: waiter_(theme_service) {}
ThemeChangeWaiter(const ThemeChangeWaiter&) = delete;
ThemeChangeWaiter& operator=(const ThemeChangeWaiter&) = delete;
~ThemeChangeWaiter() {
waiter_.WaitForThemeChanged();
// Theme changes propagate asynchronously in DesktopWindowTreeHostX11::
// FrameTypeChanged(), so ensure all tasks are consumed.
content::RunAllPendingInMessageLoop();
}
private:
test::ThemeServiceChangedWaiter waiter_;
};
class TestAXEventObserver : public views::AXEventObserver {
public:
TestAXEventObserver() { views::AXEventManager::Get()->AddObserver(this); }
TestAXEventObserver(const TestAXEventObserver&) = delete;
TestAXEventObserver& operator=(const TestAXEventObserver&) = delete;
~TestAXEventObserver() override {
views::AXEventManager::Get()->RemoveObserver(this);
}
// views::AXEventObserver:
void OnViewEvent(views::View* view, ax::mojom::Event event_type) override {
if (!view->GetWidget())
return;
ui::AXNodeData node_data;
view->GetAccessibleNodeData(&node_data);
ax::mojom::Role role = node_data.role;
if (event_type == ax::mojom::Event::kTextChanged &&
role == ax::mojom::Role::kListBoxOption) {
text_changed_on_listboxoption_count_++;
} else if (event_type == ax::mojom::Event::kSelectedChildrenChanged &&
role == ax::mojom::Role::kListBox) {
selected_children_changed_count_++;
} else if (event_type == ax::mojom::Event::kSelection &&
role == ax::mojom::Role::kListBoxOption) {
selection_changed_count_++;
selected_option_name_ =
node_data.GetStringAttribute(ax::mojom::StringAttribute::kName);
} else if (event_type == ax::mojom::Event::kValueChanged &&
role == ax::mojom::Role::kTextField) {
value_changed_count_++;
omnibox_value_ =
node_data.GetStringAttribute(ax::mojom::StringAttribute::kValue);
} else if (event_type == ax::mojom::Event::kActiveDescendantChanged &&
role == ax::mojom::Role::kTextField) {
active_descendant_changed_count_++;
}
}
int text_changed_on_listboxoption_count() {
return text_changed_on_listboxoption_count_;
}
int selected_children_changed_count() {
return selected_children_changed_count_;
}
int selection_changed_count() { return selection_changed_count_; }
int value_changed_count() { return value_changed_count_; }
int active_descendant_changed_count() {
return active_descendant_changed_count_;
}
std::string omnibox_value() { return omnibox_value_; }
std::string selected_option_name() { return selected_option_name_; }
private:
int text_changed_on_listboxoption_count_ = 0;
int selected_children_changed_count_ = 0;
int selection_changed_count_ = 0;
int value_changed_count_ = 0;
int active_descendant_changed_count_ = 0;
std::string omnibox_value_;
std::string selected_option_name_;
};
} // namespace
class OmniboxPopupContentsViewTest : public InProcessBrowserTest {
public:
OmniboxPopupContentsViewTest() {}
OmniboxPopupContentsViewTest(const OmniboxPopupContentsViewTest&) = delete;
OmniboxPopupContentsViewTest& operator=(const OmniboxPopupContentsViewTest&) =
delete;
views::Widget* CreatePopupForTestQuery();
views::Widget* GetPopupWidget() { return popup_view()->GetWidget(); }
OmniboxResultView* GetResultViewAt(int index) {
return popup_view()->result_view_at(index);
}
LocationBarView* location_bar() {
auto* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
return browser_view->toolbar()->location_bar();
}
OmniboxViewViews* omnibox_view() { return location_bar()->omnibox_view(); }
OmniboxEditModel* edit_model() { return omnibox_view()->model(); }
OmniboxPopupContentsView* popup_view() {
return static_cast<OmniboxPopupContentsView*>(
edit_model()->get_popup_view());
}
SkColor GetSelectedColor(Browser* browser) {
return BrowserView::GetBrowserViewForBrowser(browser)
->GetColorProvider()
->GetColor(kColorOmniboxResultsBackgroundSelected);
}
SkColor GetNormalColor(Browser* browser) {
return BrowserView::GetBrowserViewForBrowser(browser)
->GetColorProvider()
->GetColor(kColorOmniboxResultsBackground);
}
void SetUseDarkColor(bool use_dark) {
BrowserView* browser_view =
BrowserView::GetBrowserViewForBrowser(browser());
browser_view->GetNativeTheme()->set_use_dark_colors(use_dark);
}
void UseDefaultTheme() {
// Some test relies on the light/dark variants of the result background to
// be different. But when using the system theme on Linux, these colors will
// be the same. Ensure we're not using the system theme, which may be
// conditionally enabled depending on the environment.
#if BUILDFLAG(IS_LINUX)
// Normally it would be sufficient to call ThemeService::UseDefaultTheme()
// which sets the kUsesSystemTheme user pref on the browser's profile.
// However BrowserThemeProvider::GetColorProviderColor() currently does not
// pass an aura::Window to LinuxUI::GetNativeTheme() - which means that the
// NativeThemeGtk instance will always be returned.
// TODO(crbug.com/1304441): Remove this once GTK passthrough is fully
// supported.
ui::LinuxUiGetter::set_instance(nullptr);
ui::NativeTheme::GetInstanceForNativeUi()->NotifyOnNativeThemeUpdated();
ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(browser()->profile());
if (!theme_service->UsingDefaultTheme()) {
ThemeChangeWaiter wait(theme_service);
theme_service->UseDefaultTheme();
}
ASSERT_TRUE(theme_service->UsingDefaultTheme());
#endif // BUILDFLAG(IS_LINUX)
}
};
views::Widget* OmniboxPopupContentsViewTest::CreatePopupForTestQuery() {
EXPECT_TRUE(edit_model()->result().empty());
EXPECT_FALSE(popup_view()->IsOpen());
EXPECT_FALSE(GetPopupWidget());
edit_model()->SetUserText(u"foo");
AutocompleteInput input(
u"foo", metrics::OmniboxEventProto::BLANK,
ChromeAutocompleteSchemeClassifier(browser()->profile()));
input.set_omit_asynchronous_matches(true);
edit_model()->autocomplete_controller()->Start(input);
EXPECT_FALSE(edit_model()->result().empty());
EXPECT_TRUE(popup_view()->IsOpen());
views::Widget* popup = GetPopupWidget();
EXPECT_TRUE(popup);
return popup;
}
// Tests widget alignment of the different popup types.
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, PopupAlignment) {
views::Widget* popup = CreatePopupForTestQuery();
#if defined(USE_AURA)
popup_view()->UpdatePopupAppearance();
#endif // defined(USE_AURA)
gfx::Rect alignment_rect = location_bar()->GetBoundsInScreen();
alignment_rect.Inset(
-RoundedOmniboxResultsFrame::GetLocationBarAlignmentInsets());
alignment_rect.Inset(-RoundedOmniboxResultsFrame::GetShadowInsets());
// Top, left and right should align. Bottom depends on the results.
gfx::Rect popup_rect = popup->GetRestoredBounds();
EXPECT_EQ(popup_rect.y(), alignment_rect.y());
EXPECT_EQ(popup_rect.x(), alignment_rect.x());
EXPECT_EQ(popup_rect.right(), alignment_rect.right());
}
// Integration test for omnibox popup theming in regular.
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, ThemeIntegration) {
ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(browser()->profile());
UseDefaultTheme();
SetUseDarkColor(true);
const SkColor selection_color_dark = GetSelectedColor(browser());
SetUseDarkColor(false);
const SkColor selection_color_light = GetSelectedColor(browser());
// Unthemed, non-incognito always has a white background. Exceptions: Inverted
// color themes on Windows and GTK (not tested here).
EXPECT_EQ(SK_ColorWHITE, GetNormalColor(browser()));
// Tests below are mainly interested just whether things change, so ensure
// that can be detected.
EXPECT_NE(selection_color_dark, selection_color_light);
EXPECT_EQ(selection_color_light, GetSelectedColor(browser()));
// Install a theme (in both browsers, since it's the same profile).
extensions::ChromeTestExtensionLoader loader(browser()->profile());
{
ThemeChangeWaiter wait(theme_service);
base::FilePath path = ui_test_utils::GetTestFilePath(
base::FilePath().AppendASCII("extensions"),
base::FilePath().AppendASCII("theme"));
loader.LoadExtension(path);
}
// Same in the non-incognito browser.
EXPECT_EQ(selection_color_light, GetSelectedColor(browser()));
// Switch to the default theme without installing a custom theme. E.g. this is
// what gets used on KDE or when switching to the "classic" theme in settings.
UseDefaultTheme();
EXPECT_EQ(selection_color_light, GetSelectedColor(browser()));
}
// Integration test for omnibox popup theming in Incognito.
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest,
ThemeIntegrationInIncognito) {
ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(browser()->profile());
UseDefaultTheme();
SetUseDarkColor(true);
const SkColor selection_color_dark = GetSelectedColor(browser());
SetUseDarkColor(false);
// Install a theme (in both browsers, since it's the same profile).
extensions::ChromeTestExtensionLoader loader(browser()->profile());
{
ThemeChangeWaiter wait(theme_service);
base::FilePath path = ui_test_utils::GetTestFilePath(
base::FilePath().AppendASCII("extensions"),
base::FilePath().AppendASCII("theme"));
loader.LoadExtension(path);
}
// Check unthemed incognito windows.
Browser* incognito_browser = CreateIncognitoBrowser();
EXPECT_EQ(selection_color_dark, GetSelectedColor(incognito_browser));
// Switch to the default theme without installing a custom theme. E.g. this is
// what gets used on KDE or when switching to the "classic" theme in settings.
UseDefaultTheme();
// Check incognito again. It should continue to use a dark theme, even on
// Linux.
EXPECT_EQ(selection_color_dark, GetSelectedColor(incognito_browser));
}
// TODO(tapted): https://crbug.com/905508 Fix and enable on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_ClickOmnibox DISABLED_ClickOmnibox
#else
#define MAYBE_ClickOmnibox ClickOmnibox
#endif
// Test that clicks over the omnibox do not hit the popup.
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest, MAYBE_ClickOmnibox) {
CreatePopupForTestQuery();
gfx::NativeWindow event_window = browser()->window()->GetNativeWindow();
#if defined(USE_AURA)
event_window = event_window->GetRootWindow();
#endif
ui::test::EventGenerator generator(event_window);
OmniboxResultView* result = GetResultViewAt(0);
ASSERT_TRUE(result);
// Sanity check: ensure the EventGenerator clicks where we think it should
// when clicking on a result (but don't dismiss the popup yet). This will fail
// if the WindowTreeHost and EventGenerator coordinate systems do not align.
{
const gfx::Point expected_point = result->GetLocalBounds().CenterPoint();
EXPECT_NE(gfx::Point(), expected_point);
ClickTrackingOverlayView overlay(result);
generator.MoveMouseTo(result->GetBoundsInScreen().CenterPoint());
generator.ClickLeftButton();
auto click = overlay.last_click();
ASSERT_TRUE(click.has_value());
ASSERT_EQ(expected_point, click.value());
}
// Select the text, so that we can test whether a click is received (which
// should deselect the text);
omnibox_view()->SelectAll(true);
views::Textfield* textfield = omnibox_view();
EXPECT_EQ(u"foo", textfield->GetSelectedText());
generator.MoveMouseTo(location_bar()->GetBoundsInScreen().CenterPoint());
generator.ClickLeftButton();
EXPECT_EQ(std::u16string(), textfield->GetSelectedText());
// Clicking the result should dismiss the popup (asynchronously).
generator.MoveMouseTo(result->GetBoundsInScreen().CenterPoint());
ASSERT_TRUE(GetPopupWidget());
EXPECT_FALSE(GetPopupWidget()->IsClosed());
generator.ClickLeftButton();
ASSERT_TRUE(GetPopupWidget());
// Instantly finish all queued animations.
GetPopupWidget()->GetLayer()->GetAnimator()->StopAnimating();
EXPECT_TRUE(GetPopupWidget()->IsClosed());
}
// Check that the location bar background (and the background of the textfield
// it contains) changes when it receives focus, and matches the popup background
// color.
// Flaky on Linux and Windows. See https://crbug.com/1120701
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
#define MAYBE_PopupMatchesLocationBarBackground \
DISABLED_PopupMatchesLocationBarBackground
#else
#define MAYBE_PopupMatchesLocationBarBackground \
PopupMatchesLocationBarBackground
#endif
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest,
MAYBE_PopupMatchesLocationBarBackground) {
// In dark mode the omnibox focused and unfocused colors are the same, which
// makes this test fail; see comments below.
BrowserView::GetBrowserViewForBrowser(browser())
->GetNativeTheme()
->set_use_dark_colors(false);
// Start with the Omnibox unfocused.
omnibox_view()->GetFocusManager()->ClearFocus();
const SkColor color_before_focus = location_bar()->background()->get_color();
EXPECT_EQ(color_before_focus, omnibox_view()->GetBackgroundColor());
// Give the Omnibox focus and get its focused color.
omnibox_view()->RequestFocus();
const SkColor color_after_focus = location_bar()->background()->get_color();
// Sanity check that the colors are different, otherwise this test will not be
// testing anything useful. It is possible that a particular theme could
// configure these colors to be the same. In that case, this test should be
// updated to detect that, or switch to a theme where they are different.
EXPECT_NE(color_before_focus, color_after_focus);
EXPECT_EQ(color_after_focus, omnibox_view()->GetBackgroundColor());
// The background is hosted in the view that contains the results area.
CreatePopupForTestQuery();
views::View* background_host = popup_view()->parent();
EXPECT_EQ(color_after_focus, background_host->background()->get_color());
// Blurring the Omnibox should restore the original colors.
omnibox_view()->GetFocusManager()->ClearFocus();
EXPECT_EQ(color_before_focus, location_bar()->background()->get_color());
EXPECT_EQ(color_before_focus, omnibox_view()->GetBackgroundColor());
}
// Flaky on Mac: https://crbug.com/1140153.
#if BUILDFLAG(IS_MAC)
#define MAYBE_EmitAccessibilityEvents DISABLED_EmitAccessibilityEvents
#else
#define MAYBE_EmitAccessibilityEvents EmitAccessibilityEvents
#endif
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest,
MAYBE_EmitAccessibilityEvents) {
// Creation and population of the popup should not result in a text/name
// change accessibility event.
TestAXEventObserver observer;
CreatePopupForTestQuery();
ACMatches matches;
AutocompleteMatch match(nullptr, 500, false,
AutocompleteMatchType::HISTORY_TITLE);
AutocompleteController* controller = edit_model()->autocomplete_controller();
match.contents = u"https://foobar.com";
match.description = u"FooBarCom";
matches.push_back(match);
match.contents = u"https://foobarbaz.com";
match.description = u"FooBarBazCom";
matches.push_back(match);
controller->result_.AppendMatches(matches);
popup_view()->UpdatePopupAppearance();
EXPECT_EQ(observer.text_changed_on_listboxoption_count(), 0);
// Changing the user text while in the input rather than the list should not
// result in a text/name change accessibility event.
edit_model()->SetUserText(u"bar");
edit_model()->StartAutocomplete(false, false);
popup_view()->UpdatePopupAppearance();
EXPECT_EQ(observer.text_changed_on_listboxoption_count(), 0);
EXPECT_EQ(observer.selected_children_changed_count(), 1);
EXPECT_EQ(observer.selection_changed_count(), 1);
EXPECT_EQ(observer.active_descendant_changed_count(), 1);
EXPECT_EQ(observer.value_changed_count(), 2);
// Each time the selection changes, we should have a text/name change event.
// This makes it possible for screen readers to have the updated match content
// when they are notified the selection changed.
edit_model()->SetPopupSelection(OmniboxPopupSelection(1));
EXPECT_EQ(observer.text_changed_on_listboxoption_count(), 1);
EXPECT_EQ(observer.selected_children_changed_count(), 2);
EXPECT_EQ(observer.selection_changed_count(), 2);
EXPECT_EQ(observer.active_descendant_changed_count(), 2);
EXPECT_EQ(observer.value_changed_count(), 3);
EXPECT_TRUE(contains(observer.omnibox_value(), "2 of 3"));
EXPECT_FALSE(contains(observer.selected_option_name(), "2 of 3"));
EXPECT_TRUE(contains(observer.selected_option_name(), "foobar.com"));
EXPECT_TRUE(contains(observer.omnibox_value(), "FooBarCom"));
EXPECT_TRUE(contains(observer.selected_option_name(), "FooBarCom"));
EXPECT_TRUE(contains(observer.omnibox_value(), "location from history"));
EXPECT_TRUE(
contains(observer.selected_option_name(), "location from history"));
edit_model()->SetPopupSelection(OmniboxPopupSelection(2));
EXPECT_EQ(observer.text_changed_on_listboxoption_count(), 2);
EXPECT_EQ(observer.selected_children_changed_count(), 3);
EXPECT_EQ(observer.selection_changed_count(), 3);
EXPECT_EQ(observer.active_descendant_changed_count(), 3);
EXPECT_EQ(observer.value_changed_count(), 4);
EXPECT_TRUE(contains(observer.omnibox_value(), "3 of 3"));
EXPECT_FALSE(contains(observer.selected_option_name(), "3 of 3"));
EXPECT_TRUE(contains(observer.selected_option_name(), "foobarbaz.com"));
EXPECT_TRUE(contains(observer.omnibox_value(), "FooBarBazCom"));
EXPECT_TRUE(contains(observer.selected_option_name(), "FooBarBazCom"));
// Check that active descendant on textbox matches the selected result view.
ui::AXNodeData ax_node_data_omnibox;
omnibox_view()->GetAccessibleNodeData(&ax_node_data_omnibox);
OmniboxResultView* selected_result_view = GetResultViewAt(2);
EXPECT_EQ(ax_node_data_omnibox.GetIntAttribute(
ax::mojom::IntAttribute::kActivedescendantId),
selected_result_view->GetViewAccessibility().GetUniqueId().Get());
}
// Flaky on Mac: https://crbug.com/1146627.
#if BUILDFLAG(IS_MAC)
#define MAYBE_EmitAccessibilityEventsOnButtonFocusHint DISABLED_EmitAccessibilityEventsOnButtonFocusHint
#else
#define MAYBE_EmitAccessibilityEventsOnButtonFocusHint EmitAccessibilityEventsOnButtonFocusHint
#endif
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest,
MAYBE_EmitAccessibilityEventsOnButtonFocusHint) {
TestAXEventObserver observer;
CreatePopupForTestQuery();
ACMatches matches;
AutocompleteMatch match(nullptr, 500, false,
AutocompleteMatchType::HISTORY_TITLE);
AutocompleteController* controller = edit_model()->autocomplete_controller();
match.contents = u"https://foobar.com";
match.description = u"The Foo Of All Bars";
match.has_tab_match = true;
matches.push_back(match);
controller->result_.AppendMatches(matches);
controller->NotifyChanged();
popup_view()->UpdatePopupAppearance();
edit_model()->SetPopupSelection(OmniboxPopupSelection(1));
EXPECT_EQ(observer.selected_children_changed_count(), 2);
EXPECT_EQ(observer.selection_changed_count(), 2);
EXPECT_EQ(observer.active_descendant_changed_count(), 2);
EXPECT_EQ(observer.value_changed_count(), 2);
EXPECT_TRUE(contains(observer.omnibox_value(), "The Foo Of All Bars"));
EXPECT_TRUE(contains(observer.selected_option_name(), "foobar.com"));
EXPECT_TRUE(contains(observer.omnibox_value(), "press Tab then Enter"));
EXPECT_TRUE(contains(observer.omnibox_value(), "2 of 2"));
EXPECT_TRUE(
contains(observer.selected_option_name(), "press Tab then Enter"));
EXPECT_FALSE(contains(observer.selected_option_name(), "2 of 2"));
edit_model()->SetPopupSelection(OmniboxPopupSelection(
1, OmniboxPopupSelection::FOCUSED_BUTTON_TAB_SWITCH));
EXPECT_TRUE(contains(observer.omnibox_value(), "The Foo Of All Bars"));
EXPECT_EQ(observer.selected_children_changed_count(), 3);
EXPECT_EQ(observer.selection_changed_count(), 3);
EXPECT_EQ(observer.active_descendant_changed_count(), 3);
EXPECT_EQ(observer.value_changed_count(), 3);
EXPECT_TRUE(contains(observer.omnibox_value(), "press Enter to switch"));
EXPECT_FALSE(contains(observer.omnibox_value(), "2 of 2"));
EXPECT_TRUE(
contains(observer.selected_option_name(), "press Enter to switch"));
EXPECT_FALSE(contains(observer.selected_option_name(), "2 of 2"));
edit_model()->SetPopupSelection(
OmniboxPopupSelection(1, OmniboxPopupSelection::NORMAL));
EXPECT_TRUE(contains(observer.omnibox_value(), "The Foo Of All Bars"));
EXPECT_TRUE(contains(observer.selected_option_name(), "foobar.com"));
EXPECT_EQ(observer.selected_children_changed_count(), 4);
EXPECT_EQ(observer.selection_changed_count(), 4);
EXPECT_EQ(observer.active_descendant_changed_count(), 4);
EXPECT_EQ(observer.value_changed_count(), 4);
EXPECT_TRUE(contains(observer.omnibox_value(), "press Tab then Enter"));
EXPECT_TRUE(contains(observer.omnibox_value(), "2 of 2"));
EXPECT_TRUE(
contains(observer.selected_option_name(), "press Tab then Enter"));
EXPECT_FALSE(contains(observer.selected_option_name(), "2 of 2"));
}
IN_PROC_BROWSER_TEST_F(OmniboxPopupContentsViewTest,
EmitSelectedChildrenChangedAccessibilityEvent) {
// Create a popup for the matches.
GetPopupWidget();
edit_model()->SetUserText(u"foo");
AutocompleteInput input(
u"foo", metrics::OmniboxEventProto::BLANK,
ChromeAutocompleteSchemeClassifier(browser()->profile()));
input.set_omit_asynchronous_matches(true);
edit_model()->autocomplete_controller()->Start(input);
// Create a match to populate the autocomplete.
std::u16string match_url = u"https://foobar.com";
AutocompleteMatch match(nullptr, 500, false,
AutocompleteMatchType::HISTORY_TITLE);
match.contents = match_url;
match.contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::URL));
match.destination_url = GURL(match_url);
match.description = u"Foobar";
match.allowed_to_be_default_match = true;
AutocompleteController* autocomplete_controller =
edit_model()->autocomplete_controller();
AutocompleteResult& results = autocomplete_controller->result_;
ACMatches matches;
matches.push_back(match);
results.AppendMatches(matches);
results.SortAndCull(input, nullptr);
autocomplete_controller->NotifyChanged();
// Check that arrowing up and down emits the event.
TestAXEventObserver observer;
EXPECT_EQ(observer.selected_children_changed_count(), 0);
EXPECT_EQ(observer.selection_changed_count(), 0);
EXPECT_EQ(observer.value_changed_count(), 0);
EXPECT_EQ(observer.active_descendant_changed_count(), 0);
// This is equivalent of the user arrowing down in the omnibox.
edit_model()->SetPopupSelection(OmniboxPopupSelection(1));
EXPECT_EQ(observer.selected_children_changed_count(), 1);
EXPECT_EQ(observer.selection_changed_count(), 1);
EXPECT_EQ(observer.value_changed_count(), 1);
EXPECT_EQ(observer.active_descendant_changed_count(), 1);
// This is equivalent of the user arrowing up in the omnibox.
edit_model()->SetPopupSelection(OmniboxPopupSelection(0));
EXPECT_EQ(observer.selected_children_changed_count(), 2);
EXPECT_EQ(observer.selection_changed_count(), 2);
EXPECT_EQ(observer.value_changed_count(), 2);
EXPECT_EQ(observer.active_descendant_changed_count(), 2);
// TODO(accessibility) Test that closing the popup fires an activedescendant
// changed event.
// Check accessibility of list box while it's open.
ui::AXNodeData popup_node_data_while_open;
popup_view()->GetAccessibleNodeData(&popup_node_data_while_open);
EXPECT_EQ(popup_node_data_while_open.role, ax::mojom::Role::kListBox);
EXPECT_TRUE(popup_node_data_while_open.HasState(ax::mojom::State::kExpanded));
EXPECT_FALSE(
popup_node_data_while_open.HasState(ax::mojom::State::kCollapsed));
EXPECT_FALSE(
popup_node_data_while_open.HasState(ax::mojom::State::kInvisible));
EXPECT_TRUE(popup_node_data_while_open.HasIntAttribute(
ax::mojom::IntAttribute::kPopupForId));
}
| {'content_hash': 'b67fbf047e48dc61aa73da6a80f4c108', 'timestamp': '', 'source': 'github', 'line_count': 612, 'max_line_length': 104, 'avg_line_length': 41.56535947712418, 'alnum_prop': 0.7270618759336426, 'repo_name': 'nwjs/chromium.src', 'id': '3101a1f6ef6367770a304e2f9c627393de06d146', 'size': '27552', 'binary': False, 'copies': '1', 'ref': 'refs/heads/nw70', 'path': 'chrome/browser/ui/views/omnibox/omnibox_popup_contents_view_browsertest.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
module MARC
# A class for writing MARC records as binary MARC (ISO 2709)
#
# == Too-long records
#
# The MARC binary format only allows records that are total 99999 bytes long,
# due to size of a length field in the record.
#
# By default, the Writer will raise a MARC::Exception when encountering
# in-memory records that are too long to be legally written out as ISO 2709
# binary.
# However, if you set `allow_oversized` to true, then the Writer will
# write these records out anyway, filling in any binary length/offset slots
# with all 0's, if they are not wide enough to hold the true value.
# While these records are illegal, they can still be read back in using
# the MARC::ForgivingReader, as well as other platform MARC readers
# in tolerant mode.
#
# If you set `allow_oversized` to false on the Writer, a MARC::Exception
# will be raised instead, if you try to write an oversized record.
#
# writer = Writer.new(some_path)
# writer.allow_oversized = true
class Writer
attr_accessor :allow_oversized
# the constructor which you must pass a file path
# or an object that responds to a write message
def initialize(file, &blk)
if file.instance_of?(String)
@fh = File.new(file, "w")
elsif file.respond_to?(:write)
@fh = file
else
raise ArgumentError, "must pass in file name or handle"
end
self.allow_oversized = false
if block_given?
blk.call(self)
self.close
end
end
# write a record to the file or handle
def write(record)
@fh.write(MARC::Writer.encode(record, allow_oversized))
end
# close underlying filehandle
def close
@fh.close
end
# a static method that accepts a MARC::Record object
# and returns the record encoded as MARC21 in transmission format
#
# Second arg allow_oversized, default false, set to true
# to raise on MARC record that can't fit into ISO 2709.
def self.encode(record, allow_oversized = false)
directory = ""
fields = ""
offset = 0
record.each do |field|
# encode the field
field_data = ""
if field.instance_of?(MARC::DataField)
warn("Warn: Missing indicator") unless field.indicator1 && field.indicator2
field_data = (field.indicator1 || " ") + (field.indicator2 || " ")
field.subfields.each do |s|
field_data += SUBFIELD_INDICATOR + s.code + s.value
end
elsif field.instance_of?(MARC::ControlField)
field_data = field.value
end
field_data += END_OF_FIELD
# calculate directory entry for the field
field_length = (field_data.respond_to?(:bytesize) ?
field_data.bytesize :
field_data.length)
directory += sprintf("%03s", field.tag) + format_byte_count(field_length, allow_oversized, 4) + format_byte_count(offset, allow_oversized)
# add field to data for other fields
fields += field_data
# update offset for next field
offset += field_length
end
# determine the base (leader + directory)
base = record.leader + directory + END_OF_FIELD
# determine complete record
marc = base + fields + END_OF_RECORD
# update leader with the byte offest to the end of the directory
bytesize = base.respond_to?(:bytesize) ? base.bytesize() : base.length
marc[12..16] = format_byte_count(bytesize, allow_oversized)
# update the record length
bytesize = marc.respond_to?(:bytesize) ? marc.bytesize() : marc.length
marc[0..4] = format_byte_count(bytesize, allow_oversized)
# store updated leader in the record that was passed in
record.leader = marc[0..LEADER_LENGTH - 1]
# return encoded marc
marc
end
# Formats numbers for insertion into marc binary slots.
# These slots only allow so many digits (and need to be left-padded
# with spaces to that number of digits). If the number
# is too big, either an exception will be raised, or
# we'll return all 0's to proper number of digits.
#
# first arg is number, second is boolean whether to allow oversized,
# third is max digits (default 5)
def self.format_byte_count(number, allow_oversized, num_digits = 5)
formatted = sprintf("%0#{num_digits}i", number)
if formatted.length > num_digits
# uh, oh, we've exceeded our max. Either zero out
# or raise, depending on settings.
if allow_oversized
formatted = sprintf("%0#{num_digits}i", 0)
else
raise MARC::Exception.new("Can't write MARC record in binary format, as a length/offset value of #{number} is too long for a #{num_digits}-byte slot.")
end
end
formatted
end
end
end
| {'content_hash': 'bd0cd8bb0c7b789f72d53d786aa038fa', 'timestamp': '', 'source': 'github', 'line_count': 138, 'max_line_length': 161, 'avg_line_length': 35.42028985507246, 'alnum_prop': 0.6403436988543372, 'repo_name': 'ruby-marc/ruby-marc', 'id': '50c942c86d01d65de16203f0cfbcab5dd7d83b8c', 'size': '4888', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'lib/marc/writer.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '1120734'}]} |
package org.projectfloodlight.openflow.protocol.ver15;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import com.google.common.collect.ImmutableList;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import com.google.common.hash.PrimitiveSink;
import com.google.common.hash.Funnel;
class OFTableFeaturePropWildcardsVer15 implements OFTableFeaturePropWildcards {
private static final Logger logger = LoggerFactory.getLogger(OFTableFeaturePropWildcardsVer15.class);
// version: 1.5
final static byte WIRE_VERSION = 6;
final static int MINIMUM_LENGTH = 4;
// maximum OF message length: 16 bit, unsigned
final static int MAXIMUM_LENGTH = 0xFFFF;
private final static List<U32> DEFAULT_OXM_IDS = ImmutableList.<U32>of();
// OF message fields
private final List<U32> oxmIds;
//
// Immutable default instance
final static OFTableFeaturePropWildcardsVer15 DEFAULT = new OFTableFeaturePropWildcardsVer15(
DEFAULT_OXM_IDS
);
// package private constructor - used by readers, builders, and factory
OFTableFeaturePropWildcardsVer15(List<U32> oxmIds) {
if(oxmIds == null) {
throw new NullPointerException("OFTableFeaturePropWildcardsVer15: property oxmIds cannot be null");
}
this.oxmIds = oxmIds;
}
// Accessors for OF message fields
@Override
public int getType() {
return 0xa;
}
@Override
public List<U32> getOxmIds() {
return oxmIds;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
public OFTableFeaturePropWildcards.Builder createBuilder() {
return new BuilderWithParent(this);
}
static class BuilderWithParent implements OFTableFeaturePropWildcards.Builder {
final OFTableFeaturePropWildcardsVer15 parentMessage;
// OF message fields
private boolean oxmIdsSet;
private List<U32> oxmIds;
BuilderWithParent(OFTableFeaturePropWildcardsVer15 parentMessage) {
this.parentMessage = parentMessage;
}
@Override
public int getType() {
return 0xa;
}
@Override
public List<U32> getOxmIds() {
return oxmIds;
}
@Override
public OFTableFeaturePropWildcards.Builder setOxmIds(List<U32> oxmIds) {
this.oxmIds = oxmIds;
this.oxmIdsSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
@Override
public OFTableFeaturePropWildcards build() {
List<U32> oxmIds = this.oxmIdsSet ? this.oxmIds : parentMessage.oxmIds;
if(oxmIds == null)
throw new NullPointerException("Property oxmIds must not be null");
//
return new OFTableFeaturePropWildcardsVer15(
oxmIds
);
}
}
static class Builder implements OFTableFeaturePropWildcards.Builder {
// OF message fields
private boolean oxmIdsSet;
private List<U32> oxmIds;
@Override
public int getType() {
return 0xa;
}
@Override
public List<U32> getOxmIds() {
return oxmIds;
}
@Override
public OFTableFeaturePropWildcards.Builder setOxmIds(List<U32> oxmIds) {
this.oxmIds = oxmIds;
this.oxmIdsSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_15;
}
//
@Override
public OFTableFeaturePropWildcards build() {
List<U32> oxmIds = this.oxmIdsSet ? this.oxmIds : DEFAULT_OXM_IDS;
if(oxmIds == null)
throw new NullPointerException("Property oxmIds must not be null");
return new OFTableFeaturePropWildcardsVer15(
oxmIds
);
}
}
final static Reader READER = new Reader();
static class Reader implements OFMessageReader<OFTableFeaturePropWildcards> {
@Override
public OFTableFeaturePropWildcards readFrom(ByteBuf bb) throws OFParseError {
int start = bb.readerIndex();
// fixed value property type == 0xa
short type = bb.readShort();
if(type != (short) 0xa)
throw new OFParseError("Wrong type: Expected=0xa(0xa), got="+type);
int length = U16.f(bb.readShort());
if(length < MINIMUM_LENGTH)
throw new OFParseError("Wrong length: Expected to be >= " + MINIMUM_LENGTH + ", was: " + length);
if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
// Buffer does not have all data yet
bb.readerIndex(start);
return null;
}
if(logger.isTraceEnabled())
logger.trace("readFrom - length={}", length);
List<U32> oxmIds = ChannelUtils.readList(bb, length - (bb.readerIndex() - start), U32.READER);
OFTableFeaturePropWildcardsVer15 tableFeaturePropWildcardsVer15 = new OFTableFeaturePropWildcardsVer15(
oxmIds
);
if(logger.isTraceEnabled())
logger.trace("readFrom - read={}", tableFeaturePropWildcardsVer15);
return tableFeaturePropWildcardsVer15;
}
}
public void putTo(PrimitiveSink sink) {
FUNNEL.funnel(this, sink);
}
final static OFTableFeaturePropWildcardsVer15Funnel FUNNEL = new OFTableFeaturePropWildcardsVer15Funnel();
static class OFTableFeaturePropWildcardsVer15Funnel implements Funnel<OFTableFeaturePropWildcardsVer15> {
private static final long serialVersionUID = 1L;
@Override
public void funnel(OFTableFeaturePropWildcardsVer15 message, PrimitiveSink sink) {
// fixed value property type = 0xa
sink.putShort((short) 0xa);
// FIXME: skip funnel of length
FunnelUtils.putList(message.oxmIds, sink);
}
}
public void writeTo(ByteBuf bb) {
WRITER.write(bb, this);
}
final static Writer WRITER = new Writer();
static class Writer implements OFMessageWriter<OFTableFeaturePropWildcardsVer15> {
@Override
public void write(ByteBuf bb, OFTableFeaturePropWildcardsVer15 message) {
int startIndex = bb.writerIndex();
// fixed value property type = 0xa
bb.writeShort((short) 0xa);
// length is length of variable message, will be updated at the end
int lengthIndex = bb.writerIndex();
bb.writeShort(U16.t(0));
ChannelUtils.writeList(bb, message.oxmIds);
// update length field
int length = bb.writerIndex() - startIndex;
if (length > MAXIMUM_LENGTH) {
throw new IllegalArgumentException("OFTableFeaturePropWildcardsVer15: message length (" + length + ") exceeds maximum (0xFFFF)");
}
bb.setShort(lengthIndex, length);
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder("OFTableFeaturePropWildcardsVer15(");
b.append("oxmIds=").append(oxmIds);
b.append(")");
return b.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OFTableFeaturePropWildcardsVer15 other = (OFTableFeaturePropWildcardsVer15) obj;
if (oxmIds == null) {
if (other.oxmIds != null)
return false;
} else if (!oxmIds.equals(other.oxmIds))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((oxmIds == null) ? 0 : oxmIds.hashCode());
return result;
}
}
| {'content_hash': 'b7d6926e1f6b531eb3e3d2446786def8', 'timestamp': '', 'source': 'github', 'line_count': 275, 'max_line_length': 145, 'avg_line_length': 32.53454545454545, 'alnum_prop': 0.6402145970716441, 'repo_name': 'floodlight/loxigen-artifacts', 'id': '5a5799a07154044991137bf6b354fae44a2a136c', 'size': '9365', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'openflowj/gen-src/main/java/org/projectfloodlight/openflow/protocol/ver15/OFTableFeaturePropWildcardsVer15.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '35578218'}, {'name': 'Java', 'bytes': '38904773'}, {'name': 'Lua', 'bytes': '4231428'}, {'name': 'Makefile', 'bytes': '478'}, {'name': 'Python', 'bytes': '12126309'}]} |
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "Globehopr Admin"
# Set the link url for the title. For example, to take
# users to your main site. Defaults to no link.
#
# config.site_title_link = "/"
# Set an optional image to be displayed for the header
# instead of a string (overrides :site_title)
#
# Note: Recommended image height is 21px to properly fit in the header
#
# config.site_title_image = "/images/logo.png"
# == Default Namespace
#
# Set the default namespace each administration resource
# will be added to.
#
# eg:
# config.default_namespace = :hello_world
#
# This will create resources in the HelloWorld module and
# will namespace routes to /hello_world/*
#
# To set no namespace by default, use:
# config.default_namespace = false
#
# Default:
# config.default_namespace = :admin
#
# You can customize the settings for each namespace by using
# a namespace block. For example, to change the site title
# within a namespace:
#
# config.namespace :admin do |admin|
# admin.site_title = "Custom Admin Title"
# end
#
# This will ONLY change the title for the admin section. Other
# namespaces will continue to use the main "site_title" configuration.
# == User Authentication
#
# Active Admin will automatically call an authentication
# method in a before filter of all controller actions to
# ensure that there is a currently logged in admin user.
#
# This setting changes the method which Active Admin calls
# within the controller.
config.authentication_method = :authenticate_admin_user!
# == Current User
#
# Active Admin will associate actions with the current
# user performing them.
#
# This setting changes the method which Active Admin calls
# to return the currently logged in user.
config.current_user_method = :current_admin_user
# == Logging Out
#
# Active Admin displays a logout link on each screen. These
# settings configure the location and method used for the link.
#
# This setting changes the path where the link points to. If it's
# a string, the strings is used as the path. If it's a Symbol, we
# will call the method to return the path.
#
# Default:
config.logout_link_path = :destroy_admin_user_session_path
# This setting changes the http method used when rendering the
# link. For example :get, :delete, :put, etc..
#
# Default:
# config.logout_link_method = :get
# == Root
#
# Set the action to call for the root path. You can set different
# roots for each namespace.
#
# Default:
# config.root_to = 'dashboard#index'
# == Admin Comments
#
# Admin comments allow you to add comments to any model for admin use.
# Admin comments are enabled by default.
#
# Default:
#config.allow_comments = false
config.comments = false
#
# You can turn them on and off for any given namespace by using a
# namespace config block.
#
# Eg:
# config.namespace :without_comments do |without_comments|
# without_comments.allow_comments = false
# end
# == Batch Actions
#
# Enable and disable Batch Actions
#
config.batch_actions = true
# == Controller Filters
#
# You can add before, after and around filters to all of your
# Active Admin resources and pages from here.
#
# config.before_filter :do_something_awesome
# == Register Stylesheets & Javascripts
#
# We recommend using the built in Active Admin layout and loading
# up your own stylesheets / javascripts to customize the look
# and feel.
#
# To load a stylesheet:
# config.register_stylesheet 'my_stylesheet.css'
# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
# config.register_stylesheet 'my_print_stylesheet.css', :media => :print
#
# To load a javascript file:
# config.register_javascript 'my_javascript.js'
# == CSV options
#
# Set the CSV builder separator (default is ",")
# config.csv_column_separator = ','
#
# Set the CSV builder options (default is {})
# config.csv_options = {}
end
| {'content_hash': 'e5d6d947f52bc69804d15dfbf2a3c1ac', 'timestamp': '', 'source': 'github', 'line_count': 154, 'max_line_length': 101, 'avg_line_length': 27.66883116883117, 'alnum_prop': 0.6859892044121099, 'repo_name': 'pebiantara/referall-app', 'id': '4e9b55ec8c130ba08f2e8392041c4d2c342e0678', 'size': '4261', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'config/initializers/active_admin.rb', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '19745'}, {'name': 'HTML', 'bytes': '48929'}, {'name': 'JavaScript', 'bytes': '2126'}, {'name': 'Ruby', 'bytes': '72534'}]} |
/**
* Created by ichetandhembre on 31/8/14.
*/
var request = require('request')
var internals = {}
internals.fetchPackage = function (package) {
return request('http://registry.npmjs.org/hapi')
}
exports.fetchPackage = internals.fetchPackage | {'content_hash': '4ade2c1aa030e20ba3695123419746c9', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 50, 'avg_line_length': 19.153846153846153, 'alnum_prop': 0.7188755020080321, 'repo_name': 'chetandhembre/npmInstant', 'id': '308475fe64b7571f99a826091462b892988f99e3', 'size': '249', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'server/npm.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6630'}, {'name': 'JavaScript', 'bytes': '5264'}]} |
package de.onyxbits.raccoon.appimporter;
import java.io.File;
import de.onyxbits.raccoon.repo.AndroidApp;
class Candidate {
public final File src;
public final AndroidApp app;
public Candidate(AndroidApp app, File src) {
this.app = app;
this.src = src;
}
public String toString() {
return app.getName() + " (" + app.getVersion() + "); "
+ src.getAbsolutePath();
}
}
| {'content_hash': '5fd557b785b06f7212542d6427b651af', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 56, 'avg_line_length': 17.681818181818183, 'alnum_prop': 0.6838046272493573, 'repo_name': 'onyxbits/raccoon4', 'id': '4e1bbf9cdaf50d8d2d2a9b37c40f7fc6a0db840a', 'size': '986', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/de/onyxbits/raccoon/appimporter/Candidate.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '541'}, {'name': 'Java', 'bytes': '746752'}]} |
require "spec_helper"
require "hotdog/application"
require "hotdog/commands"
require "hotdog/commands/search"
require "parslet"
describe "tag expression" do
let(:cmd) {
Hotdog::Commands::Search.new(Hotdog::Application.new)
}
before(:each) do
ENV["DATADOG_API_KEY"] = "DATADOG_API_KEY"
ENV["DATADOG_APPLICATION_KEY"] = "DATADOG_APPLICATION_KEY"
end
it "interprets tag with host" do
expr = Hotdog::Expression::StringHostNode.new("foo", ":")
q = [
"SELECT hosts.id AS host_id FROM hosts",
"WHERE hosts.name = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({tagname: "@host", separator: ":", tagvalue: "foo"})
end
it "interprets tag with tagname and tagvalue" do
expr = Hotdog::Expression::StringTagNode.new("foo", "bar", ":")
q = [
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
"INNER JOIN tags ON hosts_tags.tag_id = tags.id",
"WHERE tags.name = ? AND tags.value = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo", "bar"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({tagname: "foo", separator: ":", tagvalue: "bar"})
end
it "interprets tag with tagname with separator" do
expr = Hotdog::Expression::StringTagnameNode.new("foo", ":")
q = [
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
"INNER JOIN tags ON hosts_tags.tag_id = tags.id",
"WHERE tags.name = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({tagname: "foo", separator: ":"})
end
it "interprets tag with tagname without separator" do
expr = Hotdog::Expression::StringHostOrTagNode.new("foo", nil)
q = [
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
"INNER JOIN tags ON hosts_tags.tag_id = tags.id",
"WHERE hosts.name = ? OR tags.name = ? OR tags.value = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo", "foo", "foo"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({tagname: "foo"})
end
it "interprets tag with tagvalue with separator" do
expr = Hotdog::Expression::StringTagvalueNode.new("foo", ":")
q = [
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
"INNER JOIN tags ON hosts_tags.tag_id = tags.id",
"WHERE hosts.name = ? OR tags.value = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo", "foo"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({separator: ":", tagvalue: "foo"})
end
it "interprets tag with tagvalue without separator" do
expr = Hotdog::Expression::StringTagvalueNode.new("foo", nil)
q = [
"SELECT DISTINCT hosts_tags.host_id FROM hosts_tags",
"INNER JOIN hosts ON hosts_tags.host_id = hosts.id",
"INNER JOIN tags ON hosts_tags.tag_id = tags.id",
"WHERE hosts.name = ? OR tags.value = ?;",
]
allow(cmd).to receive(:execute).with(q.join(" "), ["foo", "foo"]) {
[[1], [2], [3]]
}
expect(expr.evaluate(cmd)).to eq([1, 2, 3])
expect(expr.dump).to eq({tagvalue: "foo"})
end
it "empty tag" do
expr = Hotdog::Expression::StringExpressionNode.new(nil, nil, nil)
expect {
expr.evaluate(cmd)
}.to raise_error(NotImplementedError)
expect(expr.dump).to eq({})
end
end
| {'content_hash': '0f3d68ae2e824adc128b310c19303921', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 80, 'avg_line_length': 34.518181818181816, 'alnum_prop': 0.589939425862523, 'repo_name': 'yyuu/hotdog', 'id': '5791c9f24c054befdc3ef267981a60e83b3d8bb3', 'size': '3797', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'spec/evaluator/string_expression_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '194285'}]} |
import Append from './Append';
import Call from './Call';
import Remove from './Remove';
import SelectAll from '../src/SelectAll';
import Selection from './Selection';
import Transition from './Transition';
export { Append, Call, Remove, SelectAll, Selection, Transition };
| {'content_hash': '0a4fe672bec215d5f7f4c02cc619b931', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 66, 'avg_line_length': 34.375, 'alnum_prop': 0.730909090909091, 'repo_name': 'seracio/thirdact', 'id': '2e3834eee09fb918ff3be90f09a8342bccdec76b', 'size': '275', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src_old/main.tsx', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '902'}, {'name': 'JavaScript', 'bytes': '2666'}, {'name': 'TypeScript', 'bytes': '21246'}]} |
/**
* Jake build script
*/
var jake = require('jake'),
browserify = require('browserify'),
wrench = require('wrench'),
CleanCSS = require('clean-css'),
fs = require('fs');
require('jake-utils');
// constants
var DIST = './dist';
var VIS = DIST + '/vis.js';
var VIS_CSS = DIST + '/vis.css';
var VIS_TMP = DIST + '/vis.js.tmp';
var VIS_MIN = DIST + '/vis.min.js';
var VIS_MIN_CSS = DIST + '/vis.min.css';
/**
* default task
*/
desc('Default task: build all libraries');
task('default', ['build', 'minify'], function () {
console.log('done');
});
/**
* build the visualization library vis.js
*/
desc('Build the visualization library vis.js');
task('build', {async: true}, function () {
jake.mkdirP(DIST);
jake.mkdirP(DIST + '/img');
// concatenate and stringify the css files
concat({
src: [
'./src/timeline/component/css/timeline.css',
'./src/timeline/component/css/panel.css',
'./src/timeline/component/css/labelset.css',
'./src/timeline/component/css/itemset.css',
'./src/timeline/component/css/item.css',
'./src/timeline/component/css/timeaxis.css',
'./src/timeline/component/css/currenttime.css',
'./src/timeline/component/css/customtime.css',
'./src/graph/css/graph-manipulation.css',
'./src/graph/css/graph-navigation.css'
],
dest: VIS_CSS,
separator: '\n'
});
console.log('created ' + VIS_CSS);
// concatenate the script files
concat({
dest: VIS_TMP,
src: [
'./src/module/imports.js',
'./src/shim.js',
'./src/util.js',
'./src/DataSet.js',
'./src/DataView.js',
'./src/timeline/stack.js',
'./src/timeline/TimeStep.js',
'./src/timeline/Range.js',
'./src/timeline/component/Component.js',
'./src/timeline/component/Panel.js',
'./src/timeline/component/RootPanel.js',
'./src/timeline/component/TimeAxis.js',
'./src/timeline/component/CurrentTime.js',
'./src/timeline/component/CustomTime.js',
'./src/timeline/component/ItemSet.js',
'./src/timeline/component/item/*.js',
'./src/timeline/component/Group.js',
'./src/timeline/Timeline.js',
'./src/graph/dotparser.js',
'./src/graph/shapes.js',
'./src/graph/Node.js',
'./src/graph/Edge.js',
'./src/graph/Popup.js',
'./src/graph/Groups.js',
'./src/graph/Images.js',
'./src/graph/graphMixins/physics/PhysicsMixin.js',
'./src/graph/graphMixins/physics/HierarchialRepulsion.js',
'./src/graph/graphMixins/physics/BarnesHut.js',
'./src/graph/graphMixins/physics/Repulsion.js',
'./src/graph/graphMixins/HierarchicalLayoutMixin.js',
'./src/graph/graphMixins/ManipulationMixin.js',
'./src/graph/graphMixins/SectorsMixin.js',
'./src/graph/graphMixins/ClusterMixin.js',
'./src/graph/graphMixins/SelectionMixin.js',
'./src/graph/graphMixins/NavigationMixin.js',
'./src/graph/graphMixins/MixinLoader.js',
'./src/graph/Graph.js',
'./src/module/exports.js'
],
separator: '\n'
});
// copy images
wrench.copyDirSyncRecursive('./src/graph/img', DIST + '/img/graph', {
forceDelete: true
});
wrench.copyDirSyncRecursive('./src/timeline/img', DIST + '/img/timeline', {
forceDelete: true
});
var timeStart = Date.now();
// bundle the concatenated script and dependencies into one file
var b = browserify();
b.add(VIS_TMP);
b.bundle({
standalone: 'vis'
}, function (err, code) {
if(err) {
throw err;
}
console.log("browserify",Date.now() - timeStart); timeStart = Date.now();
// add header and footer
var lib = read('./src/module/header.js') + code;
// write bundled file
write(VIS, lib);
console.log('created js' + VIS);
// remove temporary file
fs.unlinkSync(VIS_TMP);
// update version number and stuff in the javascript files
replacePlaceholders(VIS);
complete();
});
});
/**
* minify the visualization library vis.js
*/
desc('Minify the visualization library vis.js');
task('minify', {async: true}, function () {
// minify javascript
minify({
src: VIS,
dest: VIS_MIN,
header: read('./src/module/header.js')
});
// update version number and stuff in the javascript files
replacePlaceholders(VIS_MIN);
console.log('created minified ' + VIS_MIN);
var minified = new CleanCSS().minify(read(VIS_CSS));
write(VIS_MIN_CSS, minified);
console.log('created minified ' + VIS_MIN_CSS);
});
/**
* test task
*/
desc('Test the library');
task('test', function () {
// TODO: use a testing suite for testing: nodeunit, mocha, tap, ...
var filelist = new jake.FileList();
filelist.include([
'./test/**/*.js'
]);
var files = filelist.toArray();
files.forEach(function (file) {
require('./' + file);
});
console.log('Executed ' + files.length + ' test files successfully');
});
/**
* replace version, date, and name placeholders in the provided file
* @param {String} filename
*/
var replacePlaceholders = function (filename) {
replace({
replacements: [
{pattern: '@@date', replacement: today()},
{pattern: '@@version', replacement: version()}
],
src: filename
});
};
| {'content_hash': '07d8f74e4026ea45d73f908aeba08183', 'timestamp': '', 'source': 'github', 'line_count': 196, 'max_line_length': 77, 'avg_line_length': 26.785714285714285, 'alnum_prop': 0.6190476190476191, 'repo_name': 'Gillingham/vis', 'id': 'e45467091b9a6fcddc7f12c913e0542a6741e9d0', 'size': '5250', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Jakefile.js', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
"""RPCs that handle raw transaction packages."""
from decimal import Decimal
import random
from test_framework.address import ADDRESS_BCRT1_P2WSH_OP_TRUE
from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import (
BIP125_SEQUENCE_NUMBER,
COIN,
CTxInWitness,
tx_from_hex,
)
from test_framework.script import (
CScript,
OP_TRUE,
)
from test_framework.util import (
assert_equal,
)
from test_framework.wallet import (
create_child_with_parents,
create_raw_chain,
make_chain,
)
class RPCPackagesTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def assert_testres_equal(self, package_hex, testres_expected):
"""Shuffle package_hex and assert that the testmempoolaccept result matches testres_expected. This should only
be used to test packages where the order does not matter. The ordering of transactions in package_hex and
testres_expected must match.
"""
shuffled_indeces = list(range(len(package_hex)))
random.shuffle(shuffled_indeces)
shuffled_package = [package_hex[i] for i in shuffled_indeces]
shuffled_testres = [testres_expected[i] for i in shuffled_indeces]
assert_equal(shuffled_testres, self.nodes[0].testmempoolaccept(shuffled_package))
def run_test(self):
self.log.info("Generate blocks to create UTXOs")
node = self.nodes[0]
self.privkeys = [node.get_deterministic_priv_key().key]
self.address = node.get_deterministic_priv_key().address
self.coins = []
# The last 100 coinbase transactions are premature
for b in node.generatetoaddress(200, self.address)[:100]:
coinbase = node.getblock(blockhash=b, verbosity=2)["tx"][0]
self.coins.append({
"txid": coinbase["txid"],
"amount": coinbase["vout"][0]["value"],
"scriptPubKey": coinbase["vout"][0]["scriptPubKey"],
})
# Create some transactions that can be reused throughout the test. Never submit these to mempool.
self.independent_txns_hex = []
self.independent_txns_testres = []
for _ in range(3):
coin = self.coins.pop()
rawtx = node.createrawtransaction([{"txid": coin["txid"], "vout": 0}],
{self.address : coin["amount"] - Decimal("0.0001")})
signedtx = node.signrawtransactionwithkey(hexstring=rawtx, privkeys=self.privkeys)
assert signedtx["complete"]
testres = node.testmempoolaccept([signedtx["hex"]])
assert testres[0]["allowed"]
self.independent_txns_hex.append(signedtx["hex"])
# testmempoolaccept returns a list of length one, avoid creating a 2D list
self.independent_txns_testres.append(testres[0])
self.independent_txns_testres_blank = [{
"txid": res["txid"], "wtxid": res["wtxid"]} for res in self.independent_txns_testres]
self.test_independent()
self.test_chain()
self.test_multiple_children()
self.test_multiple_parents()
self.test_conflicting()
self.test_rbf()
def test_independent(self):
self.log.info("Test multiple independent transactions in a package")
node = self.nodes[0]
# For independent transactions, order doesn't matter.
self.assert_testres_equal(self.independent_txns_hex, self.independent_txns_testres)
self.log.info("Test an otherwise valid package with an extra garbage tx appended")
garbage_tx = node.createrawtransaction([{"txid": "00" * 32, "vout": 5}], {self.address: 1})
tx = tx_from_hex(garbage_tx)
# Only the txid and wtxids are returned because validation is incomplete for the independent txns.
# Package validation is atomic: if the node cannot find a UTXO for any single tx in the package,
# it terminates immediately to avoid unnecessary, expensive signature verification.
package_bad = self.independent_txns_hex + [garbage_tx]
testres_bad = self.independent_txns_testres_blank + [{"txid": tx.rehash(), "wtxid": tx.getwtxid(), "allowed": False, "reject-reason": "missing-inputs"}]
self.assert_testres_equal(package_bad, testres_bad)
self.log.info("Check testmempoolaccept tells us when some transactions completed validation successfully")
coin = self.coins.pop()
tx_bad_sig_hex = node.createrawtransaction([{"txid": coin["txid"], "vout": 0}],
{self.address : coin["amount"] - Decimal("0.0001")})
tx_bad_sig = tx_from_hex(tx_bad_sig_hex)
testres_bad_sig = node.testmempoolaccept(self.independent_txns_hex + [tx_bad_sig_hex])
# By the time the signature for the last transaction is checked, all the other transactions
# have been fully validated, which is why the node returns full validation results for all
# transactions here but empty results in other cases.
assert_equal(testres_bad_sig, self.independent_txns_testres + [{
"txid": tx_bad_sig.rehash(),
"wtxid": tx_bad_sig.getwtxid(), "allowed": False,
"reject-reason": "mandatory-script-verify-flag-failed (Operation not valid with the current stack size)"
}])
self.log.info("Check testmempoolaccept reports txns in packages that exceed max feerate")
coin = self.coins.pop()
tx_high_fee_raw = node.createrawtransaction([{"txid": coin["txid"], "vout": 0}],
{self.address : coin["amount"] - Decimal("0.999")})
tx_high_fee_signed = node.signrawtransactionwithkey(hexstring=tx_high_fee_raw, privkeys=self.privkeys)
assert tx_high_fee_signed["complete"]
tx_high_fee = tx_from_hex(tx_high_fee_signed["hex"])
testres_high_fee = node.testmempoolaccept([tx_high_fee_signed["hex"]])
assert_equal(testres_high_fee, [
{"txid": tx_high_fee.rehash(), "wtxid": tx_high_fee.getwtxid(), "allowed": False, "reject-reason": "max-fee-exceeded"}
])
package_high_fee = [tx_high_fee_signed["hex"]] + self.independent_txns_hex
testres_package_high_fee = node.testmempoolaccept(package_high_fee)
assert_equal(testres_package_high_fee, testres_high_fee + self.independent_txns_testres_blank)
def test_chain(self):
node = self.nodes[0]
first_coin = self.coins.pop()
(chain_hex, chain_txns) = create_raw_chain(node, first_coin, self.address, self.privkeys)
self.log.info("Check that testmempoolaccept requires packages to be sorted by dependency")
assert_equal(node.testmempoolaccept(rawtxs=chain_hex[::-1]),
[{"txid": tx.rehash(), "wtxid": tx.getwtxid(), "package-error": "package-not-sorted"} for tx in chain_txns[::-1]])
self.log.info("Testmempoolaccept a chain of 25 transactions")
testres_multiple = node.testmempoolaccept(rawtxs=chain_hex)
testres_single = []
# Test accept and then submit each one individually, which should be identical to package test accept
for rawtx in chain_hex:
testres = node.testmempoolaccept([rawtx])
testres_single.append(testres[0])
# Submit the transaction now so its child should have no problem validating
node.sendrawtransaction(rawtx)
assert_equal(testres_single, testres_multiple)
# Clean up by clearing the mempool
node.generate(1)
def test_multiple_children(self):
node = self.nodes[0]
self.log.info("Testmempoolaccept a package in which a transaction has two children within the package")
first_coin = self.coins.pop()
value = (first_coin["amount"] - Decimal("0.0002")) / 2 # Deduct reasonable fee and make 2 outputs
inputs = [{"txid": first_coin["txid"], "vout": 0}]
outputs = [{self.address : value}, {ADDRESS_BCRT1_P2WSH_OP_TRUE : value}]
rawtx = node.createrawtransaction(inputs, outputs)
parent_signed = node.signrawtransactionwithkey(hexstring=rawtx, privkeys=self.privkeys)
assert parent_signed["complete"]
parent_tx = tx_from_hex(parent_signed["hex"])
parent_txid = parent_tx.rehash()
assert node.testmempoolaccept([parent_signed["hex"]])[0]["allowed"]
parent_locking_script_a = parent_tx.vout[0].scriptPubKey.hex()
child_value = value - Decimal("0.0001")
# Child A
(_, tx_child_a_hex, _, _) = make_chain(node, self.address, self.privkeys, parent_txid, child_value, 0, parent_locking_script_a)
assert not node.testmempoolaccept([tx_child_a_hex])[0]["allowed"]
# Child B
rawtx_b = node.createrawtransaction([{"txid": parent_txid, "vout": 1}], {self.address : child_value})
tx_child_b = tx_from_hex(rawtx_b)
tx_child_b.wit.vtxinwit = [CTxInWitness()]
tx_child_b.wit.vtxinwit[0].scriptWitness.stack = [CScript([OP_TRUE])]
tx_child_b_hex = tx_child_b.serialize().hex()
assert not node.testmempoolaccept([tx_child_b_hex])[0]["allowed"]
self.log.info("Testmempoolaccept with entire package, should work with children in either order")
testres_multiple_ab = node.testmempoolaccept(rawtxs=[parent_signed["hex"], tx_child_a_hex, tx_child_b_hex])
testres_multiple_ba = node.testmempoolaccept(rawtxs=[parent_signed["hex"], tx_child_b_hex, tx_child_a_hex])
assert all([testres["allowed"] for testres in testres_multiple_ab + testres_multiple_ba])
testres_single = []
# Test accept and then submit each one individually, which should be identical to package testaccept
for rawtx in [parent_signed["hex"], tx_child_a_hex, tx_child_b_hex]:
testres = node.testmempoolaccept([rawtx])
testres_single.append(testres[0])
# Submit the transaction now so its child should have no problem validating
node.sendrawtransaction(rawtx)
assert_equal(testres_single, testres_multiple_ab)
def test_multiple_parents(self):
node = self.nodes[0]
self.log.info("Testmempoolaccept a package in which a transaction has multiple parents within the package")
for num_parents in [2, 10, 24]:
# Test a package with num_parents parents and 1 child transaction.
package_hex = []
parents_tx = []
values = []
parent_locking_scripts = []
for _ in range(num_parents):
parent_coin = self.coins.pop()
value = parent_coin["amount"]
(tx, txhex, value, parent_locking_script) = make_chain(node, self.address, self.privkeys, parent_coin["txid"], value)
package_hex.append(txhex)
parents_tx.append(tx)
values.append(value)
parent_locking_scripts.append(parent_locking_script)
child_hex = create_child_with_parents(node, self.address, self.privkeys, parents_tx, values, parent_locking_scripts)
# Package accept should work with the parents in any order (as long as parents come before child)
for _ in range(10):
random.shuffle(package_hex)
testres_multiple = node.testmempoolaccept(rawtxs=package_hex + [child_hex])
assert all([testres["allowed"] for testres in testres_multiple])
testres_single = []
# Test accept and then submit each one individually, which should be identical to package testaccept
for rawtx in package_hex + [child_hex]:
testres_single.append(node.testmempoolaccept([rawtx])[0])
# Submit the transaction now so its child should have no problem validating
node.sendrawtransaction(rawtx)
assert_equal(testres_single, testres_multiple)
def test_conflicting(self):
node = self.nodes[0]
prevtx = self.coins.pop()
inputs = [{"txid": prevtx["txid"], "vout": 0}]
output1 = {node.get_deterministic_priv_key().address: 50 - 0.00125}
output2 = {ADDRESS_BCRT1_P2WSH_OP_TRUE: 50 - 0.00125}
# tx1 and tx2 share the same inputs
rawtx1 = node.createrawtransaction(inputs, output1)
rawtx2 = node.createrawtransaction(inputs, output2)
signedtx1 = node.signrawtransactionwithkey(hexstring=rawtx1, privkeys=self.privkeys)
signedtx2 = node.signrawtransactionwithkey(hexstring=rawtx2, privkeys=self.privkeys)
tx1 = tx_from_hex(signedtx1["hex"])
tx2 = tx_from_hex(signedtx2["hex"])
assert signedtx1["complete"]
assert signedtx2["complete"]
# Ensure tx1 and tx2 are valid by themselves
assert node.testmempoolaccept([signedtx1["hex"]])[0]["allowed"]
assert node.testmempoolaccept([signedtx2["hex"]])[0]["allowed"]
self.log.info("Test duplicate transactions in the same package")
testres = node.testmempoolaccept([signedtx1["hex"], signedtx1["hex"]])
assert_equal(testres, [
{"txid": tx1.rehash(), "wtxid": tx1.getwtxid(), "package-error": "conflict-in-package"},
{"txid": tx1.rehash(), "wtxid": tx1.getwtxid(), "package-error": "conflict-in-package"}
])
self.log.info("Test conflicting transactions in the same package")
testres = node.testmempoolaccept([signedtx1["hex"], signedtx2["hex"]])
assert_equal(testres, [
{"txid": tx1.rehash(), "wtxid": tx1.getwtxid(), "package-error": "conflict-in-package"},
{"txid": tx2.rehash(), "wtxid": tx2.getwtxid(), "package-error": "conflict-in-package"}
])
def test_rbf(self):
node = self.nodes[0]
coin = self.coins.pop()
inputs = [{"txid": coin["txid"], "vout": 0, "sequence": BIP125_SEQUENCE_NUMBER}]
fee = Decimal('0.00125000')
output = {node.get_deterministic_priv_key().address: 50 - fee}
raw_replaceable_tx = node.createrawtransaction(inputs, output)
signed_replaceable_tx = node.signrawtransactionwithkey(hexstring=raw_replaceable_tx, privkeys=self.privkeys)
testres_replaceable = node.testmempoolaccept([signed_replaceable_tx["hex"]])
replaceable_tx = tx_from_hex(signed_replaceable_tx["hex"])
assert_equal(testres_replaceable, [
{"txid": replaceable_tx.rehash(), "wtxid": replaceable_tx.getwtxid(),
"allowed": True, "vsize": replaceable_tx.get_vsize(), "fees": { "base": fee }}
])
# Replacement transaction is identical except has double the fee
replacement_tx = tx_from_hex(signed_replaceable_tx["hex"])
replacement_tx.vout[0].nValue -= int(fee * COIN) # Doubled fee
signed_replacement_tx = node.signrawtransactionwithkey(replacement_tx.serialize().hex(), self.privkeys)
replacement_tx = tx_from_hex(signed_replacement_tx["hex"])
self.log.info("Test that transactions within a package cannot replace each other")
testres_rbf_conflicting = node.testmempoolaccept([signed_replaceable_tx["hex"], signed_replacement_tx["hex"]])
assert_equal(testres_rbf_conflicting, [
{"txid": replaceable_tx.rehash(), "wtxid": replaceable_tx.getwtxid(), "package-error": "conflict-in-package"},
{"txid": replacement_tx.rehash(), "wtxid": replacement_tx.getwtxid(), "package-error": "conflict-in-package"}
])
self.log.info("Test that packages cannot conflict with mempool transactions, even if a valid BIP125 RBF")
node.sendrawtransaction(signed_replaceable_tx["hex"])
testres_rbf_single = node.testmempoolaccept([signed_replacement_tx["hex"]])
# This transaction is a valid BIP125 replace-by-fee
assert testres_rbf_single[0]["allowed"]
testres_rbf_package = self.independent_txns_testres_blank + [{
"txid": replacement_tx.rehash(), "wtxid": replacement_tx.getwtxid(), "allowed": False,
"reject-reason": "bip125-replacement-disallowed"
}]
self.assert_testres_equal(self.independent_txns_hex + [signed_replacement_tx["hex"]], testres_rbf_package)
if __name__ == "__main__":
RPCPackagesTest().main()
| {'content_hash': '69e717c16e4ac6b4cd0c9cc2b634a856', 'timestamp': '', 'source': 'github', 'line_count': 306, 'max_line_length': 160, 'avg_line_length': 53.39542483660131, 'alnum_prop': 0.6432462206989412, 'repo_name': 'yenliangl/bitcoin', 'id': '3cb4154601f739cf8cf303597db849989ffc10fe', 'size': '16548', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/functional/rpc_packages.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '28453'}, {'name': 'C', 'bytes': '694312'}, {'name': 'C++', 'bytes': '6161382'}, {'name': 'HTML', 'bytes': '21860'}, {'name': 'Java', 'bytes': '30290'}, {'name': 'M4', 'bytes': '198099'}, {'name': 'Makefile', 'bytes': '118152'}, {'name': 'Objective-C', 'bytes': '123749'}, {'name': 'Objective-C++', 'bytes': '5382'}, {'name': 'Python', 'bytes': '1537476'}, {'name': 'QMake', 'bytes': '756'}, {'name': 'Shell', 'bytes': '90713'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
<!-- Routing forms -->
<form name="FindRoutings" type="single" target="FindRouting" title=""
header-row-style="header-row" default-table-style="table">
<field name="workEffortId" title="${uiLabelMap.ManufacturingRoutingId}">
<text-find/>
</field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingRoutingName}">
<text-find/>
</field>
<field name="submitButton" title="${uiLabelMap.CommonFind}">
<submit button-type="button"/>
</field>
</form>
<form name="ListRoutings" type="list" title="" list-name="listIt"
paginate-target="FindRouting" odd-row-style="alternate-row" default-table-style="table table-hover">
<actions>
<set field="entityName" value="WorkEffort"/>
<service service-name="performFind" result-map="result" result-map-list="listIt">
<field-map field-name="inputFields" from-field="requestParameters"/>
<field-map field-name="entityName" from-field="entityName"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
</service>
</actions>
<field name="workEffortId" widget-style="btn btn-link" title="${uiLabelMap.ManufacturingRoutingId}">
<hyperlink description="${workEffortId}" target="EditRouting">
<parameter param-name="workEffortId"/>
</hyperlink>
</field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingRoutingName}"><display/></field>
<field name="description"><display/></field>
<field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}"><display/></field>
</form>
<form name="EditRouting" type="single" target="UpdateRouting" title="" default-map-name="routing"
header-row-style="header-row" default-table-style="table">
<alt-target use-when="routing==null" target="CreateRouting"/>
<field name="workEffortTypeId" use-when="routing==null"><hidden value="ROUTING"/></field>
<field name="currentStatusId" use-when="routing==null"><hidden value="ROU_ACTIVE"/></field>
<field name="workEffortId" use-when="routing!=null"><hidden/></field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingRoutingName}"><text/></field>
<field name="description"><text/></field>
<field name="quantityToProduce" title="${uiLabelMap.ManufacturingQuantityToProduce}"><text/></field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit button-type="button"/>
</field>
</form>
<!-- Routing Task Forms -->
<form name="FindRoutingTasks" type="single" target="FindRoutingTask" title=""
header-row-style="header-row" default-table-style="table">
<field name="workEffortId" title="${uiLabelMap.ManufacturingRoutingTaskId}">
<text-find/>
</field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}">
<text-find/>
</field>
<field name="fixedAssetId">
<drop-down allow-empty="true">
<entity-options description="${fixedAssetName} [${fixedAssetId}]" entity-name="FixedAsset">
<entity-constraint name="fixedAssetTypeId" operator="equals" value="GROUP_EQUIPMENT"/>
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonFind}">
<submit button-type="button"/>
</field>
</form>
<form name="ListRoutingTasks" type="list" title="" list-name="listIt"
paginate-target="FindRoutingTask" odd-row-style="alternate-row" default-table-style="table table-hover">
<actions>
<set field="entityName" value="WorkEffort"/>
<service service-name="performFind" result-map="result" result-map-list="listIt">
<field-map field-name="inputFields" from-field="requestParameters"/>
<field-map field-name="entityName" from-field="entityName"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
</service>
</actions>
<field name="workEffortId" title="${uiLabelMap.ManufacturingTaskId}" widget-style="btn btn-link">
<hyperlink description="${workEffortId}" target="EditRoutingTask">
<parameter param-name="workEffortId"/>
</hyperlink>
</field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}"><display/></field>
<field name="description"><display/></field>
<field name="workEffortPurposeTypeId" title="${uiLabelMap.ManufacturingTaskPurpose}">
<display-entity entity-name="WorkEffortPurposeType"/>
</field>
<field name="fixedAssetId">
<display-entity entity-name="FixedAsset" description="${fixedAssetName}"/>
</field>
<field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"><display/></field>
<field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}"><display/></field>
</form>
<form name="EditRoutingTask" type="single" target="UpdateRoutingTask" title="" default-map-name="routingTask"
header-row-style="header-row" default-table-style="table">
<alt-target use-when="routingTask==null" target="CreateRoutingTask"/>
<field name="workEffortTypeId" use-when="routingTask==null"><hidden value="ROU_TASK"/></field>
<field name="currentStatusId" use-when="routingTask==null"><hidden value="ROU_ACTIVE"/></field>
<field name="workEffortId" use-when="routingTask!=null"><hidden/></field>
<field name="workEffortName" title="${uiLabelMap.ManufacturingTaskName}"><text/></field>
<field name="workEffortPurposeTypeId" title="${uiLabelMap.ManufacturingTaskPurpose}">
<drop-down allow-empty="true">
<entity-options description="${description}" entity-name="WorkEffortPurposeType">
<entity-constraint name="workEffortPurposeTypeId" operator="like" value="ROU%"/>
</entity-options>
</drop-down>
</field>
<field name="description"><text/></field>
<field name="fixedAssetId">
<drop-down allow-empty="true">
<entity-options description="${fixedAssetName} [${fixedAssetId}]" entity-name="FixedAsset">
<entity-constraint name="fixedAssetTypeId" operator="equals" value="GROUP_EQUIPMENT"/>
</entity-options>
</drop-down>
</field>
<field name="estimatedSetupMillis" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}"><text/></field>
<field name="estimatedMilliSeconds" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}"><text/></field>
<field name="estimateCalcMethod">
<drop-down allow-empty="true">
<entity-options entity-name="CustomMethod" key-field-name="customMethodId" description="${description}">
<entity-constraint name="customMethodTypeId" operator="equals" value="TASK_FORMULA"/>
</entity-options>
</drop-down>
</field>
<field name="reservPersons"><text/></field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit button-type="button"/>
</field>
</form>
<form name="ListRoutingTaskCosts" type="list" title="" list-name="allCosts"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="table table-hover">
<auto-fields-entity entity-name="WorkEffortCostCalc" default-field-type="display"/>
<field name="workEffortId"><hidden/></field>
<field name="costComponentTypeId">
<display-entity entity-name="CostComponentType"/>
</field>
<field name="costComponentCalcId">
<display-entity entity-name="CostComponentCalc"/>
</field>
<!--
<field name="costComponentCalcView" entry-name="costComponentCalcId" title=" " widget-style="btn btn-link">
<hyperlink target="viewCostComponentCalc" description="${uiLabelMap.CommonViewFormula}" also-hidden="false">
<parameter param-name="costComponentCalcId"/>
</hyperlink>
</field>
-->
<field name="calcelWorkEffortCostCalc" title=" " widget-style="btn btn-link">
<hyperlink target="removeRoutingTaskCost" description="${uiLabelMap.CommonRemove}" also-hidden="false">
<parameter param-name="costComponentCalcId"/>
<parameter param-name="costComponentTypeId"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortId"/>
</hyperlink>
</field>
</form>
<form name="AddRoutingTaskCost" type="single" target="addRoutingTaskCost" title=""
header-row-style="header-row" default-table-style="table">
<auto-fields-entity entity-name="WorkEffortCostCalc" default-field-type="edit"/>
<field name="workEffortId"><hidden/></field>
<field name="costComponentTypeId">
<drop-down allow-empty="false">
<entity-options entity-name="CostComponentType" description="${description}">
<entity-constraint name="parentTypeId" operator="equals" env-name="nullField"/>
</entity-options>
</drop-down>
</field>
<field name="costComponentCalcId">
<drop-down allow-empty="false">
<entity-options entity-name="CostComponentCalc" description="${description}">
</entity-options>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit button-type="button"/>
</field>
</form>
<form name="ListRoutingTaskRoutings" type="list" title="" list-name="allRoutings"
odd-row-style="alternate-row" default-table-style="table table-hover">
<field name="workEffortIdFrom" title="${uiLabelMap.ManufacturingRouting}">
<display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="[${workEffortId}] ${workEffortName}"/>
</field>
<field name="sequenceNum" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display/></field>
<field name="editRouting" title=" " widget-style="btn btn-link">
<hyperlink target="EditRouting" description="${uiLabelMap.ManufacturingEditRouting}" also-hidden="false">
<parameter param-name="workEffortId" from-field="workEffortIdFrom"/>
</hyperlink>
</field>
</form>
<!-- Routing Task Assoc Forms -->
<form name="ListRoutingTaskAssoc" type="list" target="EditRoutingTaskAssoc" title="" list-name="allRoutingTasks"
odd-row-style="alternate-row" default-table-style="table table-hover">
<auto-fields-service service-name="updateWorkEffortAssoc" map-name="routingTaskAssoc"/>
<field name="workEffortIdFrom"><hidden/></field>
<field name="sequenceNum" title="${uiLabelMap.CommonSequenceNum}"><display/></field>
<field name="workEffortIdTo" title="${uiLabelMap.ManufacturingTaskName}" widget-style="btn btn-link">
<hyperlink target="EditRoutingTask" description="[${workEffortIdTo}] ${workEffortToName}" also-hidden="false">
<parameter param-name="workEffortId" from-field="workEffortIdTo"/>
</hyperlink>
</field>
<field name="workEffortAssocTypeId" ><hidden/></field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}" ><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}" ><display/></field>
<field name="workEffortToSetup" title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}" ><display/></field>
<field name="workEffortToRun" title="${uiLabelMap.ManufacturingTaskEstimatedMilliSeconds}" ><display/></field>
<field name="deleteLink" title=" " widget-style="btn btn-link">
<hyperlink target="RemoveRoutingTaskAssoc" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="workEffortId" from-field="workEffortIdFrom"/>
<parameter param-name="workEffortIdFrom"/>
<parameter param-name="workEffortIdTo"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortAssocTypeId" value="ROUTING_COMPONENT"/>
</hyperlink>
</field>
<sort-order>
<sort-field name="workEffortIdFrom"/>
<sort-field name="workEffortIdTo"/>
<sort-field name="sequenceNum"/>
</sort-order>
</form>
<form name="UpdateRoutingTaskAssoc" type="single" target="UpdateRoutingTaskAssoc" title=""
header-row-style="header-row" default-table-style="table">
<auto-fields-service service-name="updateWorkEffortAssoc" map-name="routingTaskAssoc"/>
<field name="workEffortId"><hidden value="${workEffortIdFrom}"/></field>
<field name="workEffortIdFrom"><hidden/></field>
<field name="sequenceNum" title="${uiLabelMap.CommonSequenceNum}"></field>
<field name="workEffortIdTo" title="${uiLabelMap.ManufacturingRoutingTaskId}">
<display description="${routingTask.workEffortName}"/></field>
<field name="workEffortAssocTypeId" ><hidden/></field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}" ><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}" ></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
<sort-order>
<sort-field name="workEffortIdFrom"/>
<sort-field name="workEffortIdTo"/>
<sort-field name="sequenceNum"/>
</sort-order>
</form>
<!-- Routing Product Assoc -->
<form name="EditRoutingProductLink" type="single" target="UpdateRoutingProductLink" title="" default-map-name="routingProductLink"
header-row-style="header-row" default-table-style="table">
<alt-target use-when="routingProductLink==null" target="AddRoutingProductLink"/>
<auto-fields-entity entity-name="WorkEffortGoodStandard" default-field-type="edit"/>
<field name="workEffortId"><hidden/></field>
<field name="statusId"><hidden/></field>
<field name="workEffortGoodStdTypeId"><hidden value="ROU_PROD_TEMPLATE"/></field>
<field name="productId" use-when="routingProductLink!=null" ><display/></field>
<field name="productId" title="${uiLabelMap.ProductProductId}" use-when="routingProductLink==null" >
<lookup target-form-name="LookupProduct"/>
</field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}" use-when="routingProductLink!=null"><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"></field>
<field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}">
<submit button-type="button"/>
</field>
</form>
<form name="ListRoutingProductLink" type="list" target="EditRoutingProductLink" title="" list-name="allRoutingProductLinks"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="table table-hover">
<field name="productId" widget-style="btn btn-link">
<hyperlink description="${productId}" target="/catalog/control/ViewProductManufacturing" also-hidden="false" target-type="inter-app">
<parameter param-name="productId"/>
</hyperlink>
</field>
<field name="productName" entry-name="productId" title="${uiLabelMap.ProductProductName}">
<display-entity key-field-name="productId" entity-name="Product" description="${internalName}"/>
</field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display/></field>
<field name="estimatedQuantity" title="${uiLabelMap.ManufacturingQuantity}"><display/></field>
<field name="editLink" title=" " widget-style="btn btn-link" >
<hyperlink target="EditRoutingProductLink" description="${uiLabelMap.CommonEdit}" also-hidden="false">
<parameter param-name="workEffortId"/>
<parameter param-name="productId"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortGoodStdTypeId" value="ROU_PROD_TEMPLATE"/>
</hyperlink>
</field>
<field name="deleteLink" title=" " widget-style="btn btn-link">
<hyperlink target="removeRoutingProductLink" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="workEffortId"/>
<parameter param-name="productId"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortGoodStdTypeId" value="ROU_PROD_TEMPLATE"/>
</hyperlink>
</field>
</form>
<form name="ListRoutingTaskProducts" type="list" target="ListRoutingTaskProducts" title="" list-name="allProducts"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="table table-hover">
<field name="productId" title="${uiLabelMap.ProductProductName}">
<display-entity entity-name="Product" description="${productId} ${internalName}"/>
</field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display/></field>
<field name="editLink" title=" " widget-style="btn btn-link">
<hyperlink target="EditRoutingTaskProduct" description="${uiLabelMap.CommonEdit}" also-hidden="false">
<parameter param-name="workEffortId"/>
<parameter param-name="productId"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortGoodStdTypeId" value="PRUNT_PROD_DELIV"/>
</hyperlink>
</field>
<field name="deleteLink" title=" " widget-style="btn btn-link">
<hyperlink target="removeRoutingTaskProduct" description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="workEffortId"/>
<parameter param-name="productId"/>
<parameter param-name="fromDate"/>
<parameter param-name="workEffortGoodStdTypeId" value="PRUNT_PROD_DELIV"/>
</hyperlink>
</field>
</form>
<form name="EditRoutingTaskProduct" type="single" target="updateRoutingTaskProduct" title="" default-map-name="routingProductLink"
header-row-style="header-row" default-table-style="table">
<alt-target use-when="routingProductLink==null" target="addRoutingTaskProduct"/>
<auto-fields-entity entity-name="WorkEffortGoodStandard" default-field-type="edit"/>
<field name="workEffortId"><hidden/></field>
<field name="statusId"><hidden/></field>
<field name="estimatedQuantity"><hidden/></field>
<field name="estimatedCost"><hidden/></field>
<field name="workEffortGoodStdTypeId"><hidden value="PRUNT_PROD_DELIV"/></field>
<field name="productId" use-when="routingProductLink!=null" ><display/></field>
<field name="productId" title="${uiLabelMap.ProductProductId}" use-when="routingProductLink==null" >
<lookup target-form-name="LookupProduct"/>
</field>
<field name="fromDate" title="${uiLabelMap.CommonFromDate}" use-when="routingProductLink!=null"><display/></field>
<field name="thruDate" title="${uiLabelMap.CommonThruDate}"></field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}">
<submit button-type="button"/>
</field>
</form>
<!-- RoutingTask-FixedAsset association (WorkEffortFixedAssetStd) -->
<form name="ListRoutingTaskFixedAssets" type="list" title="" target="updateRoutingTaskFixedAsset" list-name="allFixedAssets"
odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="table table-hover">
<auto-fields-entity entity-name="WorkEffortFixedAssetStd"/>
<field name="workEffortId"><hidden/></field>
<field name="fixedAssetTypeId">
<display-entity entity-name="FixedAssetType"/>
</field>
<field name="submitButton" title="${uiLabelMap.CommonUpdate}">
<submit button-type="button"/>
</field>
<field name="deleteLink" title=" " widget-style="btn btn-link">
<hyperlink target="removeRoutingTaskFixedAsset" description="${uiLabelMap.CommonDelete}" also-hidden="false" >
<parameter param-name="workEffortId"/>
<parameter param-name="fixedAssetTypeId"/>
</hyperlink>
</field>
</form>
<form name="EditRoutingTaskFixedAsset" type="single" title="" target="createRoutingTaskFixedAsset"
header-row-style="header-row" default-table-style="table">
<auto-fields-entity entity-name="WorkEffortFixedAssetStd" default-field-type="edit"/>
<field name="workEffortId"><hidden /></field>
<field name="fixedAssetTypeId">
<drop-down allow-empty="false">
<entity-options entity-name="FixedAssetType" description="${description}"/>
</drop-down>
</field>
<field name="submitButton" title="${uiLabelMap.CommonAdd}">
<submit button-type="button"/>
</field>
</form>
</forms>
| {'content_hash': '37016b17a8428bfbe7a6675ffaa23df2', 'timestamp': '', 'source': 'github', 'line_count': 391, 'max_line_length': 145, 'avg_line_length': 59.672634271099746, 'alnum_prop': 0.6441796674095662, 'repo_name': 'ofbizfriends/vogue', 'id': 'b0f1abc5b6d68ee794bed04bbc1b8e46cc7a28ff', 'size': '23332', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'applications/manufacturing/widget/manufacturing/RoutingTaskForms.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '40071'}, {'name': 'CSS', 'bytes': '1136748'}, {'name': 'Groff', 'bytes': '4118'}, {'name': 'Groovy', 'bytes': '1517025'}, {'name': 'HTML', 'bytes': '24245'}, {'name': 'Java', 'bytes': '14674842'}, {'name': 'JavaScript', 'bytes': '3060483'}, {'name': 'Makefile', 'bytes': '22007'}, {'name': 'PHP', 'bytes': '150'}, {'name': 'Ruby', 'bytes': '2533'}, {'name': 'Shell', 'bytes': '67707'}, {'name': 'XSLT', 'bytes': '1712'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'e2a491f9758ff81424d2fe667cdfcf67', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.307692307692308, 'alnum_prop': 0.6940298507462687, 'repo_name': 'mdoering/backbone', 'id': 'a43c0b8a915159135ea1085e0db1bd4ebda2cc38', 'size': '185', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Sapotaceae/Faucherea/Faucherea ambrensis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
package org.locationtech.geomesa.spark.jts.util
import org.locationtech.jts.geom.{Geometry, LineString, Point, Polygon}
package object util {
case class PointContainer(geom: Point)
case class PolygonContainer(geom: Polygon)
case class LineStringContainer(geom: LineString)
case class GeometryContainer(geom: Geometry)
}
| {'content_hash': 'e1cc8b097db62290797d2b3562e2e60e', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 71, 'avg_line_length': 25.615384615384617, 'alnum_prop': 0.7927927927927928, 'repo_name': 'elahrvivaz/geomesa', 'id': '32b1b3e33b3e984db3192ec5f0a519c6ecda3d8a', 'size': '796', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'geomesa-spark/geomesa-spark-jts/src/test/scala/org/locationtech/geomesa/spark/jts/util/util.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '2900'}, {'name': 'Java', 'bytes': '301988'}, {'name': 'JavaScript', 'bytes': '140'}, {'name': 'Python', 'bytes': '12067'}, {'name': 'R', 'bytes': '2716'}, {'name': 'Scala', 'bytes': '8440279'}, {'name': 'Scheme', 'bytes': '3143'}, {'name': 'Shell', 'bytes': '154842'}]} |
<?php
namespace PHPExiftool\Driver\Tag\DICOM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class RTROIObservationsSequence extends AbstractTag
{
protected $Id = '3006,0080';
protected $Name = 'RTROIObservationsSequence';
protected $FullName = 'DICOM::Main';
protected $GroupName = 'DICOM';
protected $g0 = 'DICOM';
protected $g1 = 'DICOM';
protected $g2 = 'Image';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'RTROI Observations Sequence';
}
| {'content_hash': '26c6b1c6bec81a0fba5354f154389412', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 59, 'avg_line_length': 16.77777777777778, 'alnum_prop': 0.6771523178807947, 'repo_name': 'bburnichon/PHPExiftool', 'id': '139496a79fbc255f0cbf6713f28dc2d845a89d03', 'size': '828', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'lib/PHPExiftool/Driver/Tag/DICOM/RTROIObservationsSequence.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '22076400'}]} |
#region License
#endregion
using System;
using Spring.Dao;
using Spring.Data.Support;
namespace Spring.Dao.Support
{
/// <summary>
/// Interface implemented by Spring integrations with data access technologies
/// that throw exceptions.
/// </summary>
/// <remarks>
/// This allows consistent usage of combined exception translation functionality,
/// without forcing a single translator to understand every single possible type
/// of exception.
/// </remarks>
/// <author>Rod Johnson</author>
/// <author>Mark Pollack (.NET)</author>
public interface IPersistenceExceptionTranslator
{
/// <summary>
/// Translate the given exception thrown by a persistence framework to a
/// corresponding exception from Spring's generic DataAccessException hierarchy,
/// if possible.
/// </summary>
/// <remarks>
/// <para>
/// Do not translate exceptions that are not understand by this translator:
/// for example, if coming from another persistence framework, or resulting
/// from user code and unrelated to persistence.
/// </para>
/// <para>
/// Of particular importance is the correct translation to <see cref="DataIntegrityViolationException"/>
/// for example on constraint violation. Implementations may use Spring ADO.NET Framework's
/// sophisticated exception translation to provide further information in the event of SQLException as a root cause.
/// </para>
/// </remarks>
/// <param name="ex">The exception thrown.</param>
/// <returns>the corresponding DataAccessException (or <code>null</code> if the
/// exception could not be translated, as in this case it may result from
/// user code rather than an actual persistence problem)
/// </returns>
/// <seealso cref="DataIntegrityViolationException"/>
/// <seealso cref="ErrorCodeExceptionTranslator"/>
/// <author>Rod Johnson</author>
/// <author>Juergen Hoeller</author>
/// <author>Mark Pollack (.NET)</author>
DataAccessException TranslateExceptionIfPossible(Exception ex);
}
} | {'content_hash': 'afa98ba728c693b92901e80997933044', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 124, 'avg_line_length': 39.07017543859649, 'alnum_prop': 0.6524472384373596, 'repo_name': 'MaferYangPointJun/Spring.net', 'id': '43df770e07f7aacaa49a22301c0ccd5e07702307', 'size': '2847', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Spring/Spring.Data/Dao/Support/IPersistenceExceptionTranslator.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '129158'}, {'name': 'C#', 'bytes': '13842509'}, {'name': 'CSS', 'bytes': '181570'}, {'name': 'GAP', 'bytes': '11250'}, {'name': 'Groff', 'bytes': '2302'}, {'name': 'HTML', 'bytes': '119116'}, {'name': 'JavaScript', 'bytes': '609624'}, {'name': 'Shell', 'bytes': '944'}, {'name': 'Visual Basic', 'bytes': '1975'}, {'name': 'XSLT', 'bytes': '39412'}]} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Default Chart Colours -->
<color name="sc_chartDefaultTitleColor">#E6252525</color>
<color name="sc_axisDefaultTitleColor">#FF252525</color>
<color name="sc_axisDefaultLineColor">#00000000</color>
<color name="sc_tickDefaultLineColor">#66252525</color>
<color name="sc_tickDefaultLabelColor">#FF252525</color>
<color name="sc_gridDefaultLineColor">#66CECECE</color>
<color name="sc_defaultSelectedSeriesColor">#FF888888</color>
<color name="sc_chartDefaultBackgroundColor">#FFFBFBFB</color>
<color name="sc_plotDefaultAreaColor">#FFF0F0F0</color>
<color name="sc_plotDefaultAreaBorderColor">#B3939393</color>
<color name="sc_pieDonutLabelDefaultColor">#FFFBFBFB</color>
<color name="sc_legendDefaultTextColor">#FF252525</color>
<color name="sc_legendDefaultBorderColor">#B3939393</color>
<color name="sc_legendDefaultBackgroundColor">#FFFBFBFB</color>
<color name="sc_crosshairDefaultLineColor">#FF000000</color>
<color name="sc_crosshairTooltipDefaultTextColor">#FF000000</color>
<color name="sc_crosshairTooltipDefaultLabelBackgroundColor">#00000000</color>
<color name="sc_crosshairTooltipDefaultBackgroundColor">#99FFFFFF</color>
<color name="sc_crosshairTooltipDefaultBorderColor">#FFAAAAAA</color>
<color name="sc_defaultGridStripeColor">#267F7F7F</color>
<color name="sc_defaultAlternateGridStripeColor">#00000000</color>
<color name="sc_annotationDefaultBackgroundColor">#99FFFFFF</color>
<color name="sc_annotationDefaultTextColor">#FF000000</color>
<!-- Dark Theme Colours -->
<color name="sc_chartDarkTitleColor">#E6E4E4E4</color>
<color name="sc_axisDarkTitleColor">#FFBDBDBD</color>
<color name="sc_tickDarkLineColor">#66B0B0B0</color>
<color name="sc_tickDarkLabelColor">#FFBDBDBD</color>
<color name="sc_gridDarkLineColor">#66A5A5A5</color>
<color name="sc_chartDarkBackgroundColor">#FF2A2A2A</color>
<color name="sc_plotDarkAreaColor">#FF373737</color>
<color name="sc_plotDarkAreaBorderColor">#B3B0B0B0</color>
<color name="sc_pieDonutLabelDarkColor">#FF2A2A2A</color>
<color name="sc_legendDarkTextColor">#E6E4E4E4</color>
<color name="sc_legendDarkBorderColor">#B3ACACAC</color>
<color name="sc_legendDarkBackgroundColor">#FF2A2A2A</color>
<color name="sc_crosshairDarkLineColor">#FFCCCCCC</color>
<color name="sc_crosshairTooltipDarkTextColor">#FF000000</color>
<color name="sc_crosshairTooltipDarkLabelBackgroundColor">#00000000</color>
<color name="sc_crosshairTooltipDarkBackgroundColor">#AAFFFFFF</color>
<color name="sc_crosshairTooltipDarkBorderColor">#FFAAAAAA</color>
<color name="sc_darkGridStripeColor">#267F7F7F</color>
<color name="sc_darkAlternateGridStripeColor">#00000000</color>
<color name="sc_annotationDarkBackgroundColor">#AAFFFFFF</color>
<color name="sc_annotationDarkTextColor">#FF000000</color>
<!-- Line/Area/BarCols Colours -->
<color name="sc_purpleDark">#FF81507D</color>
<color name="sc_purpleLightFill">#FFAD63B0</color>
<color name="sc_purpleDarkFill">#FF5E335F</color>
<color name="sc_purpleDarkFillAlpha">#B35E335F</color>
<color name="sc_blueDark">#FF14656A</color>
<color name="sc_blueLightFill">#FF3BACC8</color>
<color name="sc_blueDarkFill">#FF1A60A4</color>
<color name="sc_blueDarkFillAlpha">#B31A60A4</color>
<color name="sc_orangeDark">#FFAC4721</color>
<color name="sc_orangeLightFill">#FFFB7B3A</color>
<color name="sc_orangeDarkFill">#FFB02B19</color>
<color name="sc_orangeDarkFillAlpha">#B3B02B19</color>
<color name="sc_greenDark">#FF175457</color>
<color name="sc_greenLightFill">#FF02B26D</color>
<color name="sc_greenDarkFill">#FF14582B</color>
<color name="sc_greenDarkFillAlpha">#B314582B</color>
<color name="sc_yellowDark">#FFAE8C22</color>
<color name="sc_yellowLightFill">#FFF0BD1E</color>
<color name="sc_yellowDarkFill">#FFC26A10</color>
<color name="sc_yellowDarkFillAlpha">#B3C26A10</color>
<color name="sc_pinkDark">#FFA33451</color>
<color name="sc_pinkLightFill">#FFF55D97</color>
<color name="sc_pinkDarkFill">#FFBC2E40</color>
<color name="sc_pinkDarkFillAlpha">#B3BC2E40</color>
<!-- Donut Colours -->
<color name="sc_radialPurple">#FF9B4C97</color>
<color name="sc_radialBlue">#FF2A8AB3</color>
<color name="sc_radialOrange">#FFF5652F</color>
<color name="sc_radialGreen">#FF67A942</color>
<color name="sc_radialYellow">#FFF8B83C</color>
<color name="sc_radialPink">#FFE94A72</color>
<color name="sc_crustColor">#FF000000</color>
<!-- Financial Colours -->
<color name="sc_financialGreen">#FF306811</color>
<color name="sc_financialRed">#FF781B16</color>
<color name="sc_financialBlue">#7A9EAA</color>
<color name="sc_financialBlueAlpha">#807A9EAA</color>
</resources> | {'content_hash': 'b0c5e9f5909ea2de65ce6c6929016c00', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 86, 'avg_line_length': 48.654545454545456, 'alnum_prop': 0.6696562032884903, 'repo_name': 'zoozooll/MyExercise', 'id': '36cfc94da3c6ab48ecd02de9203e14cb03ed6a39', 'size': '5352', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'bw121_android/bw121_android/shinobicharts-android-library/res/values/colors.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '1495689'}, {'name': 'C#', 'bytes': '190108'}, {'name': 'C++', 'bytes': '8719269'}, {'name': 'CMake', 'bytes': '46692'}, {'name': 'CSS', 'bytes': '149067'}, {'name': 'GLSL', 'bytes': '1069'}, {'name': 'HTML', 'bytes': '5933291'}, {'name': 'Java', 'bytes': '20935928'}, {'name': 'JavaScript', 'bytes': '420263'}, {'name': 'Kotlin', 'bytes': '13567'}, {'name': 'Makefile', 'bytes': '40498'}, {'name': 'Objective-C', 'bytes': '1149532'}, {'name': 'Objective-C++', 'bytes': '248482'}, {'name': 'Python', 'bytes': '23625'}, {'name': 'RenderScript', 'bytes': '3899'}, {'name': 'Shell', 'bytes': '18962'}, {'name': 'TSQL', 'bytes': '184481'}]} |
import logging
from django.conf import settings
log = logging.getLogger(__name__)
CDN_SERVICE = getattr(settings, 'CDN_SERVICE', None)
CDN_USERNAME = getattr(settings, 'CDN_USERNAME', None)
CDN_KEY = getattr(settings, 'CDN_KEY', None)
CDN_SECRET = getattr(settings, 'CDN_SECRET', None)
if CDN_USERNAME and CDN_KEY and CDN_SECRET and CDN_SERVICE == 'maxcdn':
from maxcdn import MaxCDN
api = MaxCDN(CDN_USERNAME, CDN_KEY, CDN_SECRET)
def purge(id, files):
return api.purge(id, files)
else:
def purge(id, files):
log.error("CDN not configured, can't purge files")
| {'content_hash': '9d2c1676c7f1caca29fcd7709983b17b', 'timestamp': '', 'source': 'github', 'line_count': 20, 'max_line_length': 71, 'avg_line_length': 29.9, 'alnum_prop': 0.6939799331103679, 'repo_name': 'SteveViss/readthedocs.org', 'id': '239aa36be96ebe5c15e3cbe7a32534ff3fcc33fd', 'size': '598', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'readthedocs/cdn/purge.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '4515'}, {'name': 'CSS', 'bytes': '52861'}, {'name': 'HTML', 'bytes': '196232'}, {'name': 'JavaScript', 'bytes': '432018'}, {'name': 'Makefile', 'bytes': '4594'}, {'name': 'Python', 'bytes': '870201'}, {'name': 'Shell', 'bytes': '367'}]} |
#include "guiutil.h"
#include "bitcoinaddressvalidator.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
#include "base58.h"
#include <QString>
#include <QDateTime>
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
#include <QUrl>
#include <QTextDocument> // For Qt::escape
#include <QAbstractItemView>
#include <QApplication>
#include <QClipboard>
#include <QFileDialog>
#include <QDesktopServices>
#include <QThread>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "shlwapi.h"
#include "shlobj.h"
#include "shellapi.h"
#endif
namespace GUIUtil {
QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::SystemLocaleShortDate) + QString(" ") + date.toString("hh:mm");
}
QString dateTimeStr(qint64 nTime)
{
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
}
QFont bitcoinAddressFont()
{
QFont font("Monospace");
font.setStyleHint(QFont::TypeWriter);
return font;
}
void setupAddressWidget(QLineEdit *widget, QWidget *parent)
{
widget->setMaxLength(BitcoinAddressValidator::MaxAddressLength);
widget->setValidator(new BitcoinAddressValidator(parent));
widget->setFont(bitcoinAddressFont());
}
void setupAmountWidget(QLineEdit *widget, QWidget *parent)
{
QDoubleValidator *amountValidator = new QDoubleValidator(parent);
amountValidator->setDecimals(8);
amountValidator->setBottom(0.0);
widget->setValidator(amountValidator);
widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
}
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
if(uri.scheme() != QString("test"))
return false;
// check if the address is valid
CBitcoinAddress addressFromUri(uri.path().toStdString());
if (!addressFromUri.IsValid())
return false;
SendCoinsRecipient rv;
rv.address = uri.path();
rv.amount = 0;
QList<QPair<QString, QString> > items = uri.queryItems();
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
{
bool fShouldReturnFalse = false;
if (i->first.startsWith("req-"))
{
i->first.remove(0, 4);
fShouldReturnFalse = true;
}
if (i->first == "label")
{
rv.label = i->second;
fShouldReturnFalse = false;
}
else if (i->first == "amount")
{
if(!i->second.isEmpty())
{
if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount))
{
return false;
}
}
fShouldReturnFalse = false;
}
if (fShouldReturnFalse)
return false;
}
if(out)
{
*out = rv;
}
return true;
}
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
{
// Convert test:// to test:
//
// Cannot handle this later, because test:// will cause Qt to see the part after // as host,
// which will lowercase it (and thus invalidate the address).
if(uri.startsWith("test://"))
{
uri.replace(0, 11, "test:");
}
QUrl uriInstance(uri);
return parseBitcoinURI(uriInstance, out);
}
QString HtmlEscape(const QString& str, bool fMultiLine)
{
QString escaped = Qt::escape(str);
if(fMultiLine)
{
escaped = escaped.replace("\n", "<br>\n");
}
return escaped;
}
QString HtmlEscape(const std::string& str, bool fMultiLine)
{
return HtmlEscape(QString::fromStdString(str), fMultiLine);
}
void copyEntryData(QAbstractItemView *view, int column, int role)
{
if(!view || !view->selectionModel())
return;
QModelIndexList selection = view->selectionModel()->selectedRows(column);
if(!selection.isEmpty())
{
// Copy first item
QApplication::clipboard()->setText(selection.at(0).data(role).toString());
}
}
QString getSaveFileName(QWidget *parent, const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedSuffixOut)
{
QString selectedFilter;
QString myDir;
if(dir.isEmpty()) // Default to user documents location
{
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
}
else
{
myDir = dir;
}
QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter);
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
QString selectedSuffix;
if(filter_re.exactMatch(selectedFilter))
{
selectedSuffix = filter_re.cap(1);
}
/* Add suffix if needed */
QFileInfo info(result);
if(!result.isEmpty())
{
if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())
{
/* No suffix specified, add selected suffix */
if(!result.endsWith("."))
result.append(".");
result.append(selectedSuffix);
}
}
/* Return selected suffix if asked to */
if(selectedSuffixOut)
{
*selectedSuffixOut = selectedSuffix;
}
return result;
}
Qt::ConnectionType blockingGUIThreadConnection()
{
if(QThread::currentThread() != QCoreApplication::instance()->thread())
{
return Qt::BlockingQueuedConnection;
}
else
{
return Qt::DirectConnection;
}
}
bool checkPoint(const QPoint &p, const QWidget *w)
{
QWidget *atW = qApp->widgetAt(w->mapToGlobal(p));
if (!atW) return false;
return atW->topLevelWidget() == w;
}
bool isObscured(QWidget *w)
{
return !(checkPoint(QPoint(0, 0), w)
&& checkPoint(QPoint(w->width() - 1, 0), w)
&& checkPoint(QPoint(0, w->height() - 1), w)
&& checkPoint(QPoint(w->width() - 1, w->height() - 1), w)
&& checkPoint(QPoint(w->width() / 2, w->height() / 2), w));
}
void openDebugLogfile()
{
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
/* Open debug.log with the associated application */
if (boost::filesystem::exists(pathDebug))
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathDebug.string())));
}
ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent) :
QObject(parent), size_threshold(size_threshold)
{
}
bool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)
{
if(evt->type() == QEvent::ToolTipChange)
{
QWidget *widget = static_cast<QWidget*>(obj);
QString tooltip = widget->toolTip();
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt/>") && !Qt::mightBeRichText(tooltip))
{
// Prefix <qt/> to make sure Qt detects this as rich text
// Escape the current message as HTML and replace \n by <br>
tooltip = "<qt/>" + HtmlEscape(tooltip, true);
widget->setToolTip(tooltip);
return true;
}
}
return QObject::eventFilter(obj, evt);
}
#ifdef WIN32
boost::filesystem::path static StartupShortcutPath()
{
return GetSpecialFolderPath(CSIDL_STARTUP) / "test.lnk";
}
bool GetStartOnSystemStartup()
{
// check for test.lnk
return boost::filesystem::exists(StartupShortcutPath());
}
bool SetStartOnSystemStartup(bool fAutoStart)
{
// If the shortcut exists already, remove it for updating
boost::filesystem::remove(StartupShortcutPath());
if (fAutoStart)
{
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
IShellLink* psl = NULL;
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER, IID_IShellLink,
reinterpret_cast<void**>(&psl));
if (SUCCEEDED(hres))
{
// Get the current executable path
TCHAR pszExePath[MAX_PATH];
GetModuleFileName(NULL, pszExePath, sizeof(pszExePath));
TCHAR pszArgs[5] = TEXT("-min");
// Set the path to the shortcut target
psl->SetPath(pszExePath);
PathRemoveFileSpec(pszExePath);
psl->SetWorkingDirectory(pszExePath);
psl->SetShowCmd(SW_SHOWMINNOACTIVE);
psl->SetArguments(pszArgs);
// Query IShellLink for the IPersistFile interface for
// saving the shortcut in persistent storage.
IPersistFile* ppf = NULL;
hres = psl->QueryInterface(IID_IPersistFile,
reinterpret_cast<void**>(&ppf));
if (SUCCEEDED(hres))
{
WCHAR pwsz[MAX_PATH];
// Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(pwsz, TRUE);
ppf->Release();
psl->Release();
CoUninitialize();
return true;
}
psl->Release();
}
CoUninitialize();
return false;
}
return true;
}
#elif defined(LINUX)
// Follow the Desktop Application Autostart Spec:
// http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
boost::filesystem::path static GetAutostartDir()
{
namespace fs = boost::filesystem;
char* pszConfigHome = getenv("XDG_CONFIG_HOME");
if (pszConfigHome) return fs::path(pszConfigHome) / "autostart";
char* pszHome = getenv("HOME");
if (pszHome) return fs::path(pszHome) / ".config" / "autostart";
return fs::path();
}
boost::filesystem::path static GetAutostartFilePath()
{
return GetAutostartDir() / "test.desktop";
}
bool GetStartOnSystemStartup()
{
boost::filesystem::ifstream optionFile(GetAutostartFilePath());
if (!optionFile.good())
return false;
// Scan through file for "Hidden=true":
std::string line;
while (!optionFile.eof())
{
getline(optionFile, line);
if (line.find("Hidden") != std::string::npos &&
line.find("true") != std::string::npos)
return false;
}
optionFile.close();
return true;
}
bool SetStartOnSystemStartup(bool fAutoStart)
{
if (!fAutoStart)
boost::filesystem::remove(GetAutostartFilePath());
else
{
char pszExePath[MAX_PATH+1];
memset(pszExePath, 0, sizeof(pszExePath));
if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
return false;
boost::filesystem::create_directories(GetAutostartDir());
boost::filesystem::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);
if (!optionFile.good())
return false;
// Write a test.desktop file to the autostart directory:
optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n";
optionFile << "Name=test\n";
optionFile << "Exec=" << pszExePath << " -min\n";
optionFile << "Terminal=false\n";
optionFile << "Hidden=false\n";
optionFile.close();
}
return true;
}
#else
// TODO: OSX startup stuff; see:
// https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/CustomLogin.html
bool GetStartOnSystemStartup() { return false; }
bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
#endif
HelpMessageBox::HelpMessageBox(QWidget *parent) :
QMessageBox(parent)
{
header = tr("test-qt") + " " + tr("version") + " " +
QString::fromStdString(FormatFullVersion()) + "\n\n" +
tr("Usage:") + "\n" +
" test-qt [" + tr("command-line options") + "] " + "\n";
coreOptions = QString::fromStdString(HelpMessage());
uiOptions = tr("UI options") + ":\n" +
" -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" +
" -min " + tr("Start minimized") + "\n" +
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
setWindowTitle(tr("test-qt"));
setTextFormat(Qt::PlainText);
// setMinimumWidth is ignored for QMessageBox so put in nonbreaking spaces to make it wider.
setText(header + QString(QChar(0x2003)).repeated(50));
setDetailedText(coreOptions + "\n" + uiOptions);
}
void HelpMessageBox::printToConsole()
{
// On other operating systems, the expected action is to print the message to the console.
QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions;
fprintf(stderr, "%s", strUsage.toStdString().c_str());
}
void HelpMessageBox::showOrPrint()
{
#if defined(WIN32)
// On windows, show a message box, as there is no stderr/stdout in windowed applications
exec();
#else
// On other operating systems, print help text to console
printToConsole();
#endif
}
} // namespace GUIUtil
| {'content_hash': 'b395b59461cf5cf37bdd1f4f9f868c31', 'timestamp': '', 'source': 'github', 'line_count': 463, 'max_line_length': 117, 'avg_line_length': 29.017278617710584, 'alnum_prop': 0.6134722739114253, 'repo_name': 'kryptobytes/test', 'id': 'b649021cb74750a28d4ff28d2066a7e6103ee008', 'size': '13435', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/qt/guiutil.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '78226'}, {'name': 'C++', 'bytes': '1371438'}, {'name': 'Objective-C++', 'bytes': '2463'}, {'name': 'Python', 'bytes': '47538'}, {'name': 'Shell', 'bytes': '1402'}, {'name': 'TypeScript', 'bytes': '3810608'}]} |
<link rel="import" href="../../packages/paper_elements/roboto.html">
<link rel="import" href="../../packages/paper_elements/paper_dropdown_menu.html">
<link rel="import" href="../../packages/paper_elements/paper_dropdown.html">
<link rel="import" href="../../packages/paper_elements/paper_item.html">
<link rel="import" href="../../packages/paper_elements/paper_icon_button.html">
<link rel="import" href="../../packages/paper_elements/paper_dialog_transition.html">
<link rel="import" href="../../packages/paper_elements/paper_action_dialog.html">
<link rel="import" href="../../packages/paper_elements/paper_dialog.html">
<link rel="import" href="../../packages/paper_elements/paper_fab.html">
<link rel="import" href="../../packages/paper_elements/paper_spinner.html">
<link rel="import" href="../../packages/core_elements/core_menu.html">
<link rel="import" href="../../packages/core_elements/core_header_panel.html">
<link rel="import" href="../../packages/core_elements/core_toolbar.html">
<link rel="import" href="../../packages/core_elements/core_drawer_panel.html">
<link rel="import" href="../../packages/core_elements/core_scaffold.html">
<link rel="import" href="../../packages/core_elements/core_item.html">
<link rel="import" href="../../packages/core_elements/core_pages.html">
<link rel="import" href="../../packages/core_elements/core_animated_pages.html">
<link rel="import" href="../../packages/core_elements/core_icons.html">
<link rel="import" href="../../packages/core_elements/core_media_query.html">
<polymer-element name="forex-app">
<template>
<style>
paper-button.colored {
color: #4285f4;
}
paper-button[raised].colored {
background: #4285f4;
color: #fff;
}
#menuheader
{
background-color: #56BA89;
}
core-header-panel
{
background: whitesmoke;
}
core-toolbar {
background-color: #03A9F4;
}
core-animated-pages {
display: block;
position: relative;
background-color: white;
padding: 20px;
width: 1000px;
height: 500px;
font-size: 1.2rem;
font-weight: 300;
}
html /deep/ .size-position {
position: fixed;
top: 16px;
right: 16px;
}
html /deep/ .scrolling::shadow #scroller {
height: 350px;
}
html /deep/ .size-position::shadow #scroller {
width: 300px;
height: 300px;
}
paper-fab.blue {
position: absolute;
bottom: 32px;
right: 16px;
background: #03A9F4;
}
paper-spinner.blue::shadow .circle {
border-color: #4285f4;
}
</style>
<core-drawer-panel id="drawerPanel">
<core-header-panel drawer>
<core-toolbar id="menuheader">
<paper-icon-button id="naviconmenu" icon="arrow-back"></paper-icon-button>
Menu
</core-toolbar>
<core-menu selected="0" selectedItem="{{item}}">
<core-item icon="assessment" label="Monitor"></core-item>
<core-item icon="trending-up" label="Predict"></core-item>
<core-item icon="sort" label="Analyse"></core-item>
<core-item icon="report-problem" label="Test"></core-item>
</core-menu>
</core-header-panel>
<core-header-panel main>
<core-toolbar id="mainheader">
<paper-icon-button id="navicon" icon="menu"></paper-icon-button>
<span flex>Manage Forex</span>
<paper-icon-button id="searchbutton" icon="search"></paper-icon-button>
</core-toolbar>
<div layout horizontal center-center fit>
<paper-dialog id="dialogChart" class="scrolling" heading="Select Currency Pair">
<!--<core-collapse id="collapse" allowOverflow="true">
<paper-dropdown-menu label="Select Currency Pair" layered="true">
<paper-dropdown class="dropdown" layered="true">-->
<paper-input id="startDate" label="Start Date" floatingLabel></paper-input>
<paper-input id="endDate" label="End Date" floatingLabel></paper-input>
<div style="overflow-y: scroll; height:100px;">
<core-menu class="menu" id="menuPair" overflow-y>
<template repeat="{{currencyPairs}}">
<paper-item>{{}}</paper-item>
</template>
</core-menu>
</div>
<!--</paper-dropdown>
</paper-dropdown-menu>
</core-collapse>
-->
<p>
<paper-button raised class="colored" id="btnCharts" affirmative>Update Chart</paper-button>
<paper-button raised class="colored" id="btnCancel" dismissive>Cancel</paper-button>
</p>
</paper-dialog>
<core-animated-pages id="pages" selected="0" layout horizontal center>
<div>
<paper-spinner id="chartSpinner" active="false"></paper-spinner>
<div id="historychart" >
</div>
<div id="historygramchart" >
</div>
<!--<paper-icon-button id="selectPair" icon="view-module"></paper-icon-button>-->
<paper-fab mini id="selectPair" class="blue" icon="view-module"></paper-fab>
</div>
<!--<section layout vertical center-center>
<div>{{item.label}}</div>
</section>
<section layout vertical center-center>
<div>page</div>
</section>-->
</core-animated-pages>
</div>
</core-header-panel>
</core-drawer-panel>
</template>
<script type="application/dart" src="forex_app.dart"></script>
</polymer-element> | {'content_hash': '32b052ba0d7c429ca6f095f4c6f0d4e3', 'timestamp': '', 'source': 'github', 'line_count': 164, 'max_line_length': 119, 'avg_line_length': 41.74390243902439, 'alnum_prop': 0.4915278995033596, 'repo_name': 'emandere/FirstPolymer', 'id': 'c9d85ea41943b16f34601ff568c3aef63682ad6d', 'size': '6846', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/forex_app.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '666'}, {'name': 'Dart', 'bytes': '30365'}, {'name': 'HTML', 'bytes': '14750'}]} |
package com.wisely.ch8_4.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import com.wisely.ch8_4.domain.Person;
public interface PersonRepository extends JpaRepository<Person, Long> {
}
| {'content_hash': '1c7406c69c708308b816b191f93608a2', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 71, 'avg_line_length': 21.1, 'alnum_prop': 0.8009478672985783, 'repo_name': 'wujiazhong/SpringFrameworkLearning', 'id': 'd5f48940958ee2d3c4fb139f86b5a96e7829cfdf', 'size': '211', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SourceCode/ch8_4/src/main/java/com/wisely/ch8_4/dao/PersonRepository.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '198'}, {'name': 'Groovy', 'bytes': '436'}, {'name': 'HTML', 'bytes': '17439'}, {'name': 'Java', 'bytes': '148941'}, {'name': 'JavaScript', 'bytes': '2515'}, {'name': 'PLSQL', 'bytes': '1128'}, {'name': 'Shell', 'bytes': '418'}]} |
class AutocompleteResult;
class PrefService;
namespace gfx {
struct VectorIcon;
}
namespace omnibox {
extern const char kGoogleGIconResourceName[];
extern const char kBookmarkIconResourceName[];
extern const char kCalculatorIconResourceName[];
extern const char kClockIconResourceName[];
extern const char kDriveDocsIconResourceName[];
extern const char kDriveFolderIconResourceName[];
extern const char kDriveFormIconResourceName[];
extern const char kDriveImageIconResourceName[];
extern const char kDriveLogoIconResourceName[];
extern const char kDrivePdfIconResourceName[];
extern const char kDriveSheetsIconResourceName[];
extern const char kDriveSlidesIconResourceName[];
extern const char kDriveVideoIconResourceName[];
extern const char kExtensionAppIconResourceName[];
extern const char kPageIconResourceName[];
extern const char kSearchIconResourceName[];
std::string AutocompleteMatchVectorIconToResourceName(
const gfx::VectorIcon& icon);
std::vector<search::mojom::AutocompleteMatchPtr> CreateAutocompleteMatches(
const AutocompleteResult& result);
search::mojom::AutocompleteResultPtr CreateAutocompleteResult(
const base::string16& input,
const AutocompleteResult& result,
PrefService* prefs);
} // namespace omnibox
#endif // CHROME_BROWSER_UI_SEARCH_OMNIBOX_MOJO_UTILS_H_
| {'content_hash': '08cbbc1fee1fa7a53ab116f82653b5d5', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 75, 'avg_line_length': 32.975, 'alnum_prop': 0.821076573161486, 'repo_name': 'endlessm/chromium-browser', 'id': '1535e21a18343a88ca3e4b5614d1d2378360169d', 'size': '1725', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'chrome/browser/ui/search/omnibox_mojo_utils.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
<li id="projectaddimageitemli<%= id %>" style="display:block;float:left;"
class="slide<%= slide %> image<%= id %> imageThumbChoice">
<input name="jqdemo" value="value1" type="checkbox" id="choice<%= id %>"/>
<label for="choice<%= id %>"><b><%= name %></b></label>
<div id="projectaddimageitempict<%= id %>" style="padding-left:20px;"></div>
<a class="checkbox-select" href="#">Select</a>
<a class="checkbox-deselect" href="#">Cancel</a>
</li> | {'content_hash': '47c534a7db97eb2e98bdca90c5626a61', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 80, 'avg_line_length': 51.888888888888886, 'alnum_prop': 0.6102783725910065, 'repo_name': 'charybdeBE/Cytomine-core', 'id': 'f69715b9aa01d769470935dc586fc6b1cd82089b', 'size': '467', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'web-app/application/templates/project/ProjectAddImageChoice.tpl.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ActionScript', 'bytes': '15982'}, {'name': 'ApacheConf', 'bytes': '741'}, {'name': 'Batchfile', 'bytes': '552'}, {'name': 'C', 'bytes': '16336'}, {'name': 'CSS', 'bytes': '502816'}, {'name': 'Go', 'bytes': '6808'}, {'name': 'Groovy', 'bytes': '3449020'}, {'name': 'HTML', 'bytes': '56651456'}, {'name': 'Java', 'bytes': '157649'}, {'name': 'JavaScript', 'bytes': '17355347'}, {'name': 'Makefile', 'bytes': '8566'}, {'name': 'PHP', 'bytes': '196680'}, {'name': 'Perl', 'bytes': '1437'}, {'name': 'Python', 'bytes': '191572'}, {'name': 'Ruby', 'bytes': '21720'}, {'name': 'Shell', 'bytes': '15195'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only" />
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy> | {'content_hash': 'b9ba72f8b10aacbf1adee6d3199c4304', 'timestamp': '', 'source': 'github', 'line_count': 5, 'max_line_length': 62, 'avg_line_length': 38.2, 'alnum_prop': 0.7068062827225131, 'repo_name': 'lulersoft/ME_NLua', 'id': '267788ab075f7fffd1ea0cb268e7a493097de30f', 'size': '191', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wwwroot/crossdomain.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '231752'}, {'name': 'Lua', 'bytes': '73330'}, {'name': 'Shell', 'bytes': '137'}]} |
using System;
namespace Orleans.ServiceBus.Providers
{
/// <summary>
/// Determines if data should be purged based off time.
/// </summary>
public class TimePurgePredicate
{
private readonly TimeSpan minTimeInCache;
private readonly TimeSpan maxRelativeMessageAge;
/// <summary>
/// Default time purge predicate never purges by time.
/// </summary>
public static readonly TimePurgePredicate Default = new TimePurgePredicate(TimeSpan.MinValue, TimeSpan.MaxValue);
/// <summary>
/// Contructor
/// </summary>
/// <param name="minTimeInCache">minimum time data should be keept in cache, unless purged due to data size.</param>
/// <param name="maxRelativeMessageAge">maximum age of data to keep in the cache</param>
public TimePurgePredicate(TimeSpan minTimeInCache, TimeSpan maxRelativeMessageAge)
{
this.minTimeInCache = minTimeInCache;
this.maxRelativeMessageAge = maxRelativeMessageAge;
}
/// <summary>
/// Checks to see if the message should be purged.
/// Message should be purged if its relative age is greater than maxRelativeMessageAge and has been in the cache longer than the minTimeInCache.
/// </summary>
/// <param name="timeInCache">amount of time message has been in this cache</param>
/// <param name="relativeAge">Age of message relative to the most recent events read</param>
/// <returns></returns>
public virtual bool ShouldPurgFromTime(TimeSpan timeInCache, TimeSpan relativeAge)
{
// if time in cache exceeds the minimum and age of data is greater than max allowed, purge
return timeInCache > minTimeInCache && relativeAge > maxRelativeMessageAge;
}
}
}
| {'content_hash': '181b718d95065a9821a152833ed02b83', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 152, 'avg_line_length': 42.883720930232556, 'alnum_prop': 0.661062906724512, 'repo_name': 'shlomiw/orleans', 'id': 'c2ea0a07613eec38e82e47a1fc10b088c1cec3df', 'size': '1846', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/OrleansServiceBus/Providers/Streams/EventHub/TimePurgePredicate.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '35175'}, {'name': 'C#', 'bytes': '8039853'}, {'name': 'F#', 'bytes': '3761'}, {'name': 'Groovy', 'bytes': '1687'}, {'name': 'HTML', 'bytes': '234868'}, {'name': 'PLpgSQL', 'bytes': '53084'}, {'name': 'PowerShell', 'bytes': '122567'}, {'name': 'Protocol Buffer', 'bytes': '1683'}, {'name': 'Smalltalk', 'bytes': '1436'}, {'name': 'Visual Basic', 'bytes': '20774'}]} |
require("../../lib/WebModule.js");
WebModule.VERIFY = true;
WebModule.VERBOSE = true;
WebModule.PUBLISH = true;
require("../wmtools.js");
require("../../lib/Cookie.js");
require("../../release/Cookie.n.min.js");
require("../testcase.js");
| {'content_hash': 'bf801c91e63a9c4cdad7034f709a6b9b', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 41, 'avg_line_length': 20.333333333333332, 'alnum_prop': 0.6434426229508197, 'repo_name': 'uupaa/Cookie.js', 'id': '1c4e34103475e2ad56d95c1c5b42b62f061ecbab', 'size': '260', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/node/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '2465'}, {'name': 'JavaScript', 'bytes': '87694'}]} |
package main
import (
"flag"
"os"
"github.com/bazelbuild/rules_webtesting/go/wtl"
"github.com/bazelbuild/rules_webtesting/go/wtl/diagnostics"
)
var (
test = flag.String("test", "", "Test to run.")
metadataFileFlag = flag.String("metadata", "", "Metadata file for the browser.")
debuggerPort = flag.Int("debugger_port", 0, "Port to start WTL debugger on.")
httpPort = flag.Int("http_port", 0, "Port to start WTL HTTP Proxy on.")
httpsPort = flag.Int("https_port", 0, "Port to start WTL HTTPS Proxy on.")
)
func main() {
flag.Parse()
d := diagnostics.NoOP()
status := wtl.Run(d, *test, *metadataFileFlag, *httpPort, *httpsPort, *debuggerPort)
d.Close()
os.Exit(status)
}
| {'content_hash': '7075d330280a266cab1f2f27c46c1788', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 85, 'avg_line_length': 25.75, 'alnum_prop': 0.6532593619972261, 'repo_name': 'DrMarcII/rules_webtesting', 'id': '0857cf17293cc498ff8dc9bf15c612a861449037', 'size': '1409', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'go/wtl/main/main.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '804'}, {'name': 'Go', 'bytes': '284765'}, {'name': 'Java', 'bytes': '7285'}, {'name': 'Python', 'bytes': '161395'}, {'name': 'Scala', 'bytes': '947'}, {'name': 'Shell', 'bytes': '10097'}]} |
class VRDemoSteamVRConfigurator : public l4Singleton<VRDemoSteamVRConfigurator>
{
public:
typedef std::map<std::string, Json::Value> PROPERTY_MAP;
VRDemoSteamVRConfigurator();
~VRDemoSteamVRConfigurator();
bool init();
bool isActive() { return m_inited; };
// it may require restarting of SteamVR to take effect,
// we'll pop a promote message box.
bool applySettings();
// it may require restarting of SteamVR to take effect,.
// but we will not pop a promote message box, try not to distube users
bool restoreSettings();
static const std::string SETTINGS_FILE_NAME;
static const std::string SETTINGS_FILE_OLD_POSTFIX;
static const std::string SETTINGS_FILE_RELATIVE_PATH;
static const std::string SETTINGS_SECTION_NAME;
static const std::string STEAM_VR_FILE_RELATIVE_PATH;
static const std::string STEAM_VR_PROCESS_NAME;
static const std::string STEAM_VR_REG_KEY;
private:
bool loadConfigurations();
void cleanObject(Json::Value &object);
void restartSteamVR(DWORD processID);
DWORD findSteamVRProcessID();
Json::Value getSettingsItemValue(Json::Value &root, const std::string path);
bool setSettingItemValue(Json::Value &root, const std::string path, const Json::Value& value);
bool saveJsonToFile(const Json::Value &root, const std::string& filePath);
bool m_inited = false;
std::string m_settingFilePath;
std::string m_steamVRFilePath;
// NOTE: to simplify, "." is used for path delimiter
// it will fail, if a key name in the path contain "."
PROPERTY_MAP m_targetSettings;
PROPERTY_MAP m_oldSettings;
};
| {'content_hash': 'c7f17e5ffdabf1450f6958c10d5258e5', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 98, 'avg_line_length': 41.125, 'alnum_prop': 0.7124620060790273, 'repo_name': 'sunzhuoshi/VRDemoHelper', 'id': '78b68c679c2220e319af9d458b4be262386959fe', 'size': '1767', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'VRDemoHelper/VRDemoSteamVRConfigurator.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '4737'}, {'name': 'C++', 'bytes': '664431'}, {'name': 'CMake', 'bytes': '7886'}]} |
const {
assertDataProperty
} = Assert;
// 15.3.4.7: writable+configurable Function.prototype[@@hasInstance] can reveal [[BoundTarget]]
// https://bugs.ecmascript.org/show_bug.cgi?id=1446
// https://bugs.ecmascript.org/show_bug.cgi?id=1873
assertDataProperty(Function.prototype, Symbol.hasInstance, {
value: Function.prototype[Symbol.hasInstance],
writable: false, enumerable: false, configurable: false
});
| {'content_hash': '302648e57d43cf94b70e3b4baaec8105', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 95, 'avg_line_length': 32.0, 'alnum_prop': 0.7548076923076923, 'repo_name': 'jugglinmike/es6draft', 'id': '353f56ac55ff971901d28a519320b4ba7eabd9e1', 'size': '589', 'binary': False, 'copies': '1', 'ref': 'refs/heads/personal', 'path': 'src/test/scripts/suite/regress/bug1446.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '2024'}, {'name': 'C++', 'bytes': '74953'}, {'name': 'Java', 'bytes': '5202424'}, {'name': 'JavaScript', 'bytes': '1556378'}, {'name': 'Shell', 'bytes': '3484'}]} |
This folder includes small scripts which are worth keeping. | {'content_hash': 'd47b6bd58ac36caf15aacc6113e97e14', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 59, 'avg_line_length': 59.0, 'alnum_prop': 0.847457627118644, 'repo_name': 'flatangle/flatlib', 'id': '85a1cf87bdaabf569c1ab79f23bef05c5ef665fd', 'size': '71', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'recipes/README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '159983'}]} |
MonitorES is a small windows utility that helps you to turnoff monitor display when you lock down your machine.Also when you lock your machine, it will pause all your running media programs & set your IM status message to "Away" / Custom message(via options) and restore it back to normal when you back.
According to [this](http://www.doit.wisc.edu/news/story.asp?filename=598) research statistics we could save lot of energy by turning off monitor display.
### Download ###
#### MonitorES 1.0.1(b) ####
**Recommended** -

[Latest MonitorES for Windows XP/Vista/7 Installer ](http://monitores.googlecode.com/files/MonitorES_1.0.1b_Installer.exe)

[Latest MonitorES for Windows XP/Vista/7 Zip ](http://monitores.googlecode.com/files/MonitorES_1.0.1b.zip)
#### MonitorES Lite ####
 [MonitorES Lite Installer](http://monitores.googlecode.com/files/MonitorES_Setup.msi)
 [MonitorES Lite Executable](http://monitores.googlecode.com/files/MonitorESLite.exe)
**Features**
* Automatically turnoff monitor.
* Automatically pause running media programs.
* Automatically IM away status message.
* Mute master sound.( XP,Vista,7).
* Custom Hotkey's for All operations.
* Keyboard PAUSE key to pause/play running media programs(Gives single key control).
* Custom away messages for IM
* Support **16**+ Media Players
* Customizable options
* Disable screensaver
* Listen to your pause status
* Very small executable file (34 KB)
* No Installation Required / Portable Software
**Supported Media Players**
* [Winamp](http://www.winamp.com/), [AIMP](http://www.aimp.ru/index.php?newsid=96) , [WMP](http://www.microsoft.com/windows/windowsmedia/player/11/default.aspx), [WMP Classic](http://www.free-codecs.com/download/Media_Player_Classic.htm) , [1BY1](http://mpesch3.de1.cc/1by1.html) , [iTunes](http://www.apple.com/itunes/download/) , [KMPlayer](http://www.filehippo.com/download_kmplayer/) ,[Media Monkey](http://www.mediamonkey.com/) , [GOM Player](http://www.gomlab.com/eng/GMP_download.html) , [AlShow](http://www.altools.com/ALTools/ALShow.aspx),[Spotify](http://www.spotify.com/) , [Foobar2000](http://www.foobar2000.org/), [BSPlayer](http://www.bsplayer.com/)
* [QuickTime](http://www.apple.com/quicktime/) , [XMPlay](http://www.un4seen.com/) Only Support with PAUSE
**Supported IM**
* [Google Talk](http://www.google.com/talk/) , [Yahoo Messenger](http://messenger.yahoo.com/), [Digsby](http://www.digsby.com/) , [Miranda IM](http://www.miranda-im.org/) with custom away message
**Details** : [Click Here](http://ukanth.in/blog/?p=249)
**MonitorES Lite** - For Administrators/corporates -> Lite Weight,highly optimized [More details](http://ukanth.in/blog/?p=254)
**MonitorES Ubuntu** - Ubuntu version of MonitorES .. [More details](http://code.google.com/p/lmonitores/)
---
**Reviews** :
404techsupport.com - "MonitorES is the perfect simple solution to saving more power so easily"
howtogeek.com - "This is a very neat utility that helps you save money and help the environment."
lifehacker.com - "Tiny, portable utility MonitorES not only turns off the monitor when you lock your PC, it also pauses almost any media player and even sets your Google and Yahoo IM status to away"
pcworld.com - "Save the environment, save your laptop battery, save some money--or if you already remember to turn your monitor off every time you leave your cubicle, at least save yourself a few button presses"
ghacks.net - "Monitor ES basically helps computer users save money (and the environment) by reducing the amount of energy their computer systems consumes"
bnet.com - "It’s free , easy to use & extend the life of expensive monitor — and save a bit on electric bill to boot"
moongify.jp - "By numerous computers, electrical energy is consumed in the from of monitors. The focus of each one, power consumption will be lower in the office. The MonitorES where they want to use."
revoblog.com - "small application used to save energy and, perhaps, even to save on electricity bills. "
saveti.kombib.rs - "Small, portable, assistant program MonitorES not only off the monitor when you lock the PC, but also paused, and almost all media player, and even set, and Google, and Yahoo IM status to away"
geekissimo.com - "monitores is certainly a good and small program, customizable, and in some cases particularly useful ... even for our electricity bill"
jetelecharge.com - Ecological, economical and convenient!
webdomination.de - handy & a very useful software
| {'content_hash': '7eb6729a2f846404b045f2f391a08860', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 665, 'avg_line_length': 59.433734939759034, 'alnum_prop': 0.7468072167038313, 'repo_name': 'ukanth/monitores', 'id': 'b8eba2985e809e718f35e663cc3cf2a9ef479999', 'size': '5103', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ProjectHome.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '13937'}, {'name': 'C++', 'bytes': '566153'}, {'name': 'Objective-C', 'bytes': '1847'}]} |
.events-example h1 {
background-color: purple
}
| {'content_hash': '97634bc4e42bc63805e1530f3868400e', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 26, 'avg_line_length': 16.666666666666668, 'alnum_prop': 0.72, 'repo_name': 'patrickkillalea/dota2news', 'id': '34e5f654231131f94ff4d24c210973793cea9f81', 'size': '50', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/custom/events/public/assets/css/events.css', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '69419'}, {'name': 'HTML', 'bytes': '52192'}, {'name': 'JavaScript', 'bytes': '489723'}]} |
package org.apache.spark.rdd
import scala.reflect.ClassTag
import org.apache.spark.{Partition, TaskContext}
/**
* An RDD that applies the provided function to every partition of the parent RDD.
*/
private[spark] class MapPartitionsRDD[U: ClassTag, T: ClassTag](
var prev: RDD[T],
f: (TaskContext, Int, Iterator[T]) => Iterator[U], // (TaskContext, partition index, iterator)
preservesPartitioning: Boolean = false)
extends RDD[U](prev) {
override val partitioner = if (preservesPartitioning) firstParent[T].partitioner else None
override def getPartitions: Array[Partition] = firstParent[T].partitions
/**
* 这里实际上是实现了RDD中的compute()
* 就是针对RDD的某个partition,执行我们给这个RDD定义的算子和函数
*
* 方法里的f就是我们定义的算子和函数,只不过spark进行了封装,还实现了其他的逻辑
* 在这里实际上就在执行RDD的partition的计算操作,并返回新RDD的partition的数据
*/
override def compute(split: Partition, context: TaskContext): Iterator[U] =
f(context, split.index, firstParent[T].iterator(split, context))
override def clearDependencies() {
super.clearDependencies()
prev = null
}
}
| {'content_hash': 'ed6da391d6ab45c1100264629baa349a', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 99, 'avg_line_length': 29.61111111111111, 'alnum_prop': 0.7307692307692307, 'repo_name': 'MrCodeYu/spark', 'id': '7b752bd0fd97c6314934077dd8a9531add321033', 'size': '2054', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'core/src/main/scala/org/apache/spark/rdd/MapPartitionsRDD.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '31336'}, {'name': 'Batchfile', 'bytes': '24063'}, {'name': 'C', 'bytes': '1493'}, {'name': 'CSS', 'bytes': '26577'}, {'name': 'HTML', 'bytes': '2924'}, {'name': 'Java', 'bytes': '2607028'}, {'name': 'JavaScript', 'bytes': '125963'}, {'name': 'Makefile', 'bytes': '7774'}, {'name': 'PLpgSQL', 'bytes': '7390'}, {'name': 'Python', 'bytes': '2023882'}, {'name': 'R', 'bytes': '750284'}, {'name': 'Roff', 'bytes': '32282'}, {'name': 'SQLPL', 'bytes': '11954'}, {'name': 'Scala', 'bytes': '19384653'}, {'name': 'Shell', 'bytes': '143008'}, {'name': 'Thrift', 'bytes': '33605'}]} |
enum
{
LINE_SPACE = 40,
kItemTagBasic = 1000,
};
struct {
const char *name;
std::function<void(Ref*)> callback;
} g_testsName[] =
{
{ "Alloc Test", [](Ref*sender){runAllocPerformanceTest(); } },
{ "NodeChildren Test", [](Ref*sender){runNodeChildrenTest();} },
{ "Particle Test",[](Ref*sender){runParticleTest();} },
{ "Sprite Perf Test",[](Ref*sender){runSpriteTest();} },
{ "Texture Perf Test",[](Ref*sender){runTextureTest();} },
{ "Touches Perf Test",[](Ref*sender){runTouchesTest();} },
{ "Label Perf Test",[](Ref*sender){runLabelTest();} },
//{ "Renderer Perf Test",[](Ref*sender){runRendererTest();} },
{ "Container Perf Test", [](Ref* sender ) { runContainerPerformanceTest(); } },
{ "EventDispatcher Perf Test", [](Ref* sender ) { runEventDispatcherPerformanceTest(); } },
{ "Scenario Perf Test", [](Ref* sender ) { runScenarioTest(); } },
{ "Callback Perf Test", [](Ref* sender ) { runCallbackPerformanceTest(); } },
};
static const int g_testMax = sizeof(g_testsName)/sizeof(g_testsName[0]);
Vec2 PerformanceMainLayer::_CurrentPos = Vec2::ZERO;
////////////////////////////////////////////////////////
//
// PerformanceMainLayer
//
////////////////////////////////////////////////////////
void PerformanceMainLayer::onEnter()
{
Layer::onEnter();
auto s = Director::getInstance()->getWinSize();
_itemMenu = Menu::create();
_itemMenu->setPosition(_CurrentPos);
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_testMax; ++i)
{
auto pItem = MenuItemFont::create(g_testsName[i].name, g_testsName[i].callback);
pItem->setPosition(Vec2(s.width / 2, s.height - (i + 1) * LINE_SPACE));
_itemMenu->addChild(pItem, kItemTagBasic + i);
}
addChild(_itemMenu);
// Register Touch Event
auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(true);
listener->onTouchBegan = CC_CALLBACK_2(PerformanceMainLayer::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(PerformanceMainLayer::onTouchMoved, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
auto mouseListener = EventListenerMouse::create();
mouseListener->onMouseScroll = CC_CALLBACK_1(PerformanceMainLayer::onMouseScroll, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);
}
bool PerformanceMainLayer::onTouchBegan(Touch* touches, Event *event)
{
_beginPos = touches->getLocation();
return true;
}
void PerformanceMainLayer::onTouchMoved(Touch* touches, Event *event)
{
auto touchLocation = touches->getLocation();
float nMoveY = touchLocation.y - _beginPos.y;
auto curPos = _itemMenu->getPosition();
auto nextPos = Vec2(curPos.x, curPos.y + nMoveY);
if (nextPos.y < 0.0f)
{
_itemMenu->setPosition(Vec2::ZERO);
return;
}
if (nextPos.y > ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))
{
_itemMenu->setPosition(Vec2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)));
return;
}
_itemMenu->setPosition(nextPos);
_beginPos = touchLocation;
_CurrentPos = nextPos;
}
void PerformanceMainLayer::onMouseScroll(Event *event)
{
auto mouseEvent = static_cast<EventMouse*>(event);
float nMoveY = mouseEvent->getScrollY() * 6;
auto curPos = _itemMenu->getPosition();
auto nextPos = Vec2(curPos.x, curPos.y + nMoveY);
if (nextPos.y < 0.0f)
{
_itemMenu->setPosition(Vec2::ZERO);
return;
}
if (nextPos.y > ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height))
{
_itemMenu->setPosition(Vec2(0, ((g_testMax + 1)* LINE_SPACE - VisibleRect::getVisibleRect().size.height)));
return;
}
_itemMenu->setPosition(nextPos);
_CurrentPos = nextPos;
}
////////////////////////////////////////////////////////
//
// PerformBasicLayer
//
////////////////////////////////////////////////////////
PerformBasicLayer::PerformBasicLayer(bool bControlMenuVisible, int nMaxCases, int nCurCase)
: _controlMenuVisible(bControlMenuVisible)
, _maxCases(nMaxCases)
, _curCase(nCurCase)
{
}
void PerformBasicLayer::onEnter()
{
Layer::onEnter();
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(PerformBasicLayer::toMainLayer, this));
pMainItem->setPosition(Vec2(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25));
auto menu = Menu::create(pMainItem, nullptr);
menu->setPosition( Vec2::ZERO );
if (_controlMenuVisible)
{
auto item1 = MenuItemImage::create(s_pathB1, s_pathB2, CC_CALLBACK_1(PerformBasicLayer::backCallback, this));
auto item2 = MenuItemImage::create(s_pathR1, s_pathR2, CC_CALLBACK_1(PerformBasicLayer::restartCallback, this));
auto item3 = MenuItemImage::create(s_pathF1, s_pathF2, CC_CALLBACK_1(PerformBasicLayer::nextCallback, this));
item1->setPosition(Vec2(VisibleRect::center().x - item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2));
item2->setPosition(Vec2(VisibleRect::center().x, VisibleRect::bottom().y+item2->getContentSize().height/2));
item3->setPosition(Vec2(VisibleRect::center().x + item2->getContentSize().width*2, VisibleRect::bottom().y+item2->getContentSize().height/2));
menu->addChild(item1, kItemTagBasic);
menu->addChild(item2, kItemTagBasic);
menu->addChild(item3, kItemTagBasic);
}
addChild(menu);
}
void PerformBasicLayer::toMainLayer(Ref* sender)
{
auto scene = new PerformanceTestScene();
scene->runThisTest();
scene->release();
}
void PerformBasicLayer::restartCallback(Ref* sender)
{
showCurrentTest();
}
void PerformBasicLayer::nextCallback(Ref* sender)
{
_curCase++;
_curCase = _curCase % _maxCases;
showCurrentTest();
}
void PerformBasicLayer::backCallback(Ref* sender)
{
_curCase--;
if( _curCase < 0 )
_curCase += _maxCases;
showCurrentTest();
}
////////////////////////////////////////////////////////
//
// PerformanceTestScene
//
////////////////////////////////////////////////////////
void PerformanceTestScene::runThisTest()
{
auto layer = new PerformanceMainLayer();
addChild(layer);
layer->release();
Director::getInstance()->replaceScene(this);
}
| {'content_hash': 'b46458faa88e8e58f3ce6b47338514b0', 'timestamp': '', 'source': 'github', 'line_count': 205, 'max_line_length': 150, 'avg_line_length': 32.08780487804878, 'alnum_prop': 0.631042870173305, 'repo_name': 'ezibyte/EziSocial-PhotoExample', 'id': 'e86037c4dd39f90d1bdc19807b31fcce6f82b2a1', 'size': '7083', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Cocos2dx-3x/PhotoExample/cocos2d/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2421'}, {'name': 'C', 'bytes': '1530706'}, {'name': 'C#', 'bytes': '65894'}, {'name': 'C++', 'bytes': '16515201'}, {'name': 'CMake', 'bytes': '54405'}, {'name': 'GLSL', 'bytes': '35006'}, {'name': 'Java', 'bytes': '552703'}, {'name': 'JavaScript', 'bytes': '6893'}, {'name': 'Lua', 'bytes': '2431404'}, {'name': 'Makefile', 'bytes': '46818'}, {'name': 'Objective-C', 'bytes': '923244'}, {'name': 'Objective-C++', 'bytes': '374997'}, {'name': 'Python', 'bytes': '619368'}, {'name': 'Shell', 'bytes': '44931'}]} |
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Twig_Extensions_' => array($vendorDir . '/twig/extensions/lib'),
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Symfony\\Bundle\\SwiftmailerBundle' => array($vendorDir . '/symfony/swiftmailer-bundle'),
'Symfony\\' => array($vendorDir . '/symfony/symfony/src'),
'SymfonyStandard' => array($baseDir . '/app'),
'Sensio\\Bundle\\GeneratorBundle' => array($vendorDir . '/sensio/generator-bundle'),
'Sensio\\Bundle\\FrameworkExtraBundle' => array($vendorDir . '/sensio/framework-extra-bundle'),
'Sensio\\Bundle\\DistributionBundle' => array($vendorDir . '/sensio/distribution-bundle'),
'SensioLabs\\Security' => array($vendorDir . '/sensiolabs/security-checker'),
'Psr\\Log\\' => array($vendorDir . '/psr/log'),
'Nelmio\\ApiDocBundle' => array($vendorDir . '/nelmio/api-doc-bundle'),
'Negotiation' => array($vendorDir . '/willdurand/negotiation/src'),
'Michelf' => array($vendorDir . '/michelf/php-markdown'),
'Less' => array($vendorDir . '/oyejorge/less.php/lib'),
'Knp\\Menu\\' => array($vendorDir . '/knplabs/knp-menu/src'),
'Knp\\Bundle\\MenuBundle' => array($vendorDir . '/knplabs/knp-menu-bundle'),
'JsonpCallbackValidator' => array($vendorDir . '/willdurand/jsonp-callback-validator/src'),
'Incenteev\\ParameterHandler' => array($vendorDir . '/incenteev/composer-parameter-handler'),
'Imagine' => array($vendorDir . '/imagine/imagine/lib'),
'FOS\\UserBundle' => array($vendorDir . '/friendsofsymfony/user-bundle'),
'FOS\\RestBundle' => array($vendorDir . '/friendsofsymfony/rest-bundle'),
'Exporter' => array($vendorDir . '/sonata-project/exporter/lib'),
'Doctrine\\ORM\\' => array($vendorDir . '/doctrine/orm/lib'),
'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'),
'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'),
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'),
'Doctrine\\Bundle\\DoctrineBundle' => array($vendorDir . '/doctrine/doctrine-bundle'),
'Avalanche\\Bundle\\ImagineBundle' => array($vendorDir . '/avalanche123/imagine-bundle'),
'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
'' => array($baseDir . '/src'),
);
| {'content_hash': '419fa86d9487c85985e648e8d4f03838', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 99, 'avg_line_length': 63.093023255813954, 'alnum_prop': 0.6594176188720973, 'repo_name': 'michiz05000/jna-symfony', 'id': '87a8ca508a5eab89393f341f7a07a768c63254ae', 'size': '2713', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/composer/autoload_namespaces.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '79382'}, {'name': 'JavaScript', 'bytes': '65568'}, {'name': 'PHP', 'bytes': '119383'}]} |
#include "test.h"
#include "memdebug.h"
int test(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;
/* http header list*/
struct curl_slist *hhl = NULL;
struct curl_slist *phl = NULL;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
return TEST_ERR_MAJOR_BAD;
}
curl = curl_easy_init();
if(!curl) {
fprintf(stderr, "curl_easy_init() failed\n");
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
hhl = curl_slist_append(hhl, "User-Agent: Http Agent");
phl = curl_slist_append(phl, "Proxy-User-Agent: Http Agent2");
if(!hhl) {
goto test_cleanup;
}
test_setopt(curl, CURLOPT_URL, URL);
test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
test_setopt(curl, CURLOPT_HTTPHEADER, hhl);
test_setopt(curl, CURLOPT_PROXYHEADER, phl);
test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
test_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl);
test_cleanup:
curl_easy_cleanup(curl);
curl_slist_free_all(hhl);
curl_slist_free_all(phl);
curl_global_cleanup();
return (int)res;
}
| {'content_hash': '9231fd04ab46734b67584ba7dab21c3c', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 64, 'avg_line_length': 23.339622641509433, 'alnum_prop': 0.6685529506871464, 'repo_name': 'chaigler/Torque3D', 'id': '3401f6580c30a1170eb381b75ac7c7ff574c9564', 'size': '2293', 'binary': False, 'copies': '2', 'ref': 'refs/heads/development', 'path': 'Engine/lib/curl/tests/libtest/lib1528.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ada', 'bytes': '89079'}, {'name': 'Assembly', 'bytes': '199191'}, {'name': 'Awk', 'bytes': '42982'}, {'name': 'Batchfile', 'bytes': '68732'}, {'name': 'C', 'bytes': '44024765'}, {'name': 'C#', 'bytes': '54021'}, {'name': 'C++', 'bytes': '59643860'}, {'name': 'CMake', 'bytes': '988394'}, {'name': 'CSS', 'bytes': '55472'}, {'name': 'D', 'bytes': '101732'}, {'name': 'DIGITAL Command Language', 'bytes': '240259'}, {'name': 'Dockerfile', 'bytes': '988'}, {'name': 'GLSL', 'bytes': '515671'}, {'name': 'HLSL', 'bytes': '501593'}, {'name': 'HTML', 'bytes': '1664814'}, {'name': 'Java', 'bytes': '192558'}, {'name': 'JavaScript', 'bytes': '73468'}, {'name': 'Lex', 'bytes': '18784'}, {'name': 'Lua', 'bytes': '1288'}, {'name': 'M4', 'bytes': '885777'}, {'name': 'Makefile', 'bytes': '4069931'}, {'name': 'Metal', 'bytes': '3691'}, {'name': 'Module Management System', 'bytes': '15326'}, {'name': 'NSIS', 'bytes': '1193756'}, {'name': 'Objective-C', 'bytes': '685452'}, {'name': 'Objective-C++', 'bytes': '119396'}, {'name': 'Pascal', 'bytes': '48918'}, {'name': 'Perl', 'bytes': '720596'}, {'name': 'PowerShell', 'bytes': '12518'}, {'name': 'Python', 'bytes': '298716'}, {'name': 'Raku', 'bytes': '7894'}, {'name': 'Rich Text Format', 'bytes': '4380'}, {'name': 'Roff', 'bytes': '2152001'}, {'name': 'SAS', 'bytes': '13756'}, {'name': 'Shell', 'bytes': '1392232'}, {'name': 'Smalltalk', 'bytes': '6201'}, {'name': 'StringTemplate', 'bytes': '4329'}, {'name': 'WebAssembly', 'bytes': '13560'}, {'name': 'Yacc', 'bytes': '19731'}]} |
/**
* @function _optionArgs
* @private
*/
'use strict'
const stringcase = require('stringcase')
const arrayreduce = require('arrayreduce')
/** @lends _optionArgs */
function _optionArgs (options) {
return Object.keys(options)
.filter((key) => {
let value = options[ key ]
let empty = (value === undefined) || (value === null) || (value === '') || (value === false)
return !empty
})
.map((key) => {
let prefix = key.length === 1 ? '-' : '--'
let prefixedKey = prefix + stringcase.spinalcase(key).replace(/^\-+/, '')
let value = options[ key ]
if (value === true) {
return [ prefixedKey ]
} else {
return [].concat(value || []).map((value) => {
return [ prefixedKey, value ]
}).reduce(arrayreduce.arrayConcat(), [])
}
}).reduce(arrayreduce.arrayConcat(), [])
}
module.exports = _optionArgs
| {'content_hash': '300cddfecff0b95d55f30e5b04eca974', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 98, 'avg_line_length': 27.303030303030305, 'alnum_prop': 0.5527192008879024, 'repo_name': 'okunishinishi/node-execcli', 'id': '04a13d0f6b12e0c5b4f5393bbfb49997cdf5e3d0', 'size': '901', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/_option_args.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '268'}, {'name': 'JavaScript', 'bytes': '10234'}]} |
// -*- c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*-
//
// Copyright (c) 2009, Whispersoft s.r.l.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Whispersoft s.r.l. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: Cosmin Tudorache & Catalin Popescu
//
//
// We have here a bunch of utilities for manipulating strings.
// Includes a specialized i18n section for utf-8 strings.
//
// IMPORTANT: use the strutil::i18n for utf-8 / correct i18n string
// manipulation
//
#ifndef __WHISPERLIB_BASE_STRUTIL_H__
#define __WHISPERLIB_BASE_STRUTIL_H__
#include <strings.h> // strncasecmp
#include <time.h>
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <string.h>
#include "whisperlib/base/types.h"
#include "whisperlib/base/hash.h"
#include WHISPER_HASH_MAP_HEADER
#include WHISPER_HASH_SET_HEADER
#include "whisperlib/base/log.h"
#include "whisperlib/base/strutil_format.h"
#include <stddef.h>
#include <wchar.h>
#if defined __CYGWIN32__ && !defined __CYGWIN__
/* For backwards compatibility with Cygwin b19 and
earlier, we define __CYGWIN__ here, so that
we can rely on checking just for that macro. */
# define __CYGWIN__ __CYGWIN32__
#endif
#if defined _WIN32 && !defined __CYGWIN__ && !defined(PATH_SEPARATOR)
/* Use Windows separators on all _WIN32 defining
environments, except Cygwin. */
# define PATH_SEPARATOR '\\'
#endif
#ifndef PATH_SEPARATOR
/* Assume that not having this is an indicator that all
are missing. */
# define PATH_SEPARATOR '/'
#endif
namespace strutil {
/**
** ASCII based functions - for UTF-8 version please look down.
**/
////////////////////////////////////////////////// String finding / searching
/** Test the equality of two strings */
bool StrEql(const char* str1, const char* str2);
bool StrEql(const char* p, const std::string& s);
bool StrEql(const std::string& s, const char* p);
bool StrEql(const std::string& str1, const std::string& str2);
/** Test the equality of two strings - ignoring case*/
bool StrIEql(const char* str1, const char* str2);
bool StrIEql(const std::string& str1, const std::string& str2);
/** Compares two strings w/o case */
bool StrCaseEqual(const std::string& s1, const std::string& s2);
/** Tests if this string str starts with the specified prefix. */
bool StrPrefix(const char* str, const char* prefix);
bool StrStartsWith(const char* str, const char* prefix);
bool StrStartsWith(const std::string& str, const std::string& prefix);
/** Tests if string str starts with the specified prefix - ignoring case. */
bool StrCasePrefix(const char* str, const char* prefix);
bool StrIStartsWith(const char* str, const char* prefix);
bool StrIStartsWith(const std::string& str, const std::string& prefix);
/** Tests if string str ends with the specified suffix */
bool StrSuffix(const char* str, const char* suffix);
bool StrSuffix(const std::string& str, const std::string& suffix);
bool StrEndsWith(const char* str, const char* suffix);
bool StrEndsWith(const std::string& str, const std::string& suffix);
/** Returns true if the string is a valid identifier (a..z A..Z 0..9 and _) */
bool IsValidIdentifier(const char* s);
////////////////////////////////////////////////// String trimming / replacing
/** Passes over the spaces (and tabs) of the given string,
* and returns a pointer to the first non-space character in str
* (uses isspace()) */
const char* StrFrontTrim(const char* str);
/** Passes over the spaces (and tabs) of the given string, and
* returns a copy of the string without those */
std::string StrFrontTrim(const std::string& str);
/** Removes the front and back spaces (and tabs) of the given string (uses isspace()) **/
std::string StrTrim(const std::string& str);
/** Removes the front and back characters of str that are found in chars_to_trim,
* and returns a string copy of str without those. */
std::string StrTrimChars(const std::string& str, const char* chars_to_trim);
/** Removes all spaces from the given string (uses isspace()) */
std::string StrTrimCompress(const std::string& str);
/** Removes all spaces from all items in str (uses isspace()) */
void StrTrimCompress(std::vector<std::string>* str);
/** Removes CR LF characters from the end of the string */
void StrTrimCRLFInPlace(std::string& str);
/** Removes CR LF characters from the end of the string and returns the resulting string*/
std::string StrTrimCRLF(const std::string& str);
/** Removes the 'comment_char' and all the character following from str */
void StrTrimCommentInPlace(std::string& str, char comment_char);
/** Removes the 'comment_char' and all the character following from str and
* returns the resulting string */
std::string StrTrimComment(const std::string& str, char comment_char);
/** Replaces all occurrences of 'find_what' with 'replace_with' in str,
* and returns the resulting string */
std::string StrReplaceAll(const std::string& str,
const std::string& find_what,
const std::string& replace_with);
/** Replaces all occurrences of 'find_what' with 'replace_with' in str
* and modifies str accordingly */
void StrReplaceAllInPlace(std::string& str,
const std::string& find_what,
const std::string& replace_with);
////////////////////////////////////////////////// String joining / splitting
/** Given an array of strings it joins them using the provided glue string */
std::string JoinStrings(const char* pieces[], size_t size, const char* glue);
/** Given an array of strings it joins them using the provided glue string */
std::string JoinStrings(const std::vector<std::string>& pieces,
size_t start, size_t limit, const char* glue);
/** Given a container of strings it joins them using the provided glue string */
std::string JoinStrings(const std::vector<std::string>& pieces, const char* glue);
std::string JoinStrings(const std::initializer_list<std::string>& pieces, const char* glue);
/** Given iterators over string containers it joins them using the provided glue string */
template <typename Iter>
std::string JoinStrings(Iter begin, Iter end, const char* glue);
/** Takes a string, a separator and splits the string in constituting components
* separated by the separator (which is in none of them). */
void SplitString(const std::string& s, const std::string& separator,
std::vector<std::string>* output);
std::vector<std::string> SplitString(const std::string& s, const std::string& separator);
/** Splits a string in a set - each string will be unique, and in a different order */
void SplitStringToSet(const std::string& s, const std::string& separator,
std::set<std::string>* output);
std::set<std::string> SplitStringToSet(const std::string& s, const std::string& separator);
/** Splits the string on any separator char in separator, optionally skipping the resulting
* empty string from output */
void SplitStringOnAny(const char* text, size_t size, const char* separators,
std::vector<std::string>* output, bool skip_empty);
/** Splits the string on any separator char in separator, optionally skipping the resulting
* empty string from output */
void SplitStringOnAny(const std::string& s, const char* separators,
std::vector<std::string>* output, bool skip_empty);
/** Splits the string on any separator char in separator and stores the result in output */
void SplitStringOnAny(const std::string& s, const char* separators,
std::vector<std::string>* output);
/** Splits a string in two - before and after the first occurrence of the
* separator (the separator will not appear in either).
* If separator is not found, it returns: pair(s,"").
*/
std::pair<std::string, std::string> SplitFirst(const char* s, char separator);
/** Splits a string in two - before and after the first occurrence of the
* separator (the separator will not appear in either).
* If separator is not found, it returns: pair(s,"").
*/
std::pair<std::string, std::string> SplitFirst(const std::string& s,
const std::string& separator);
/** Similar to SplitFirst, but splits at the last occurrence of 'separator'.
* If separator is not found, returns: pair(s,"")
*/
std::pair<std::string, std::string> SplitLast(const std::string& s,
const std::string& separator);
/** Splits a string that contains a list of pairs of elements:
* <elem1_1>sep2<elem1_2>sep1<elem2_1>sep2<elem2_2>sep1...
* ...sep1<elemN_1>sep2<elemN_2>
* If the second element in a pair is missing, the pair(s, '') is used.
*/
void SplitPairs(const std::string& s,
const std::string& elements_separator, // sep1
const std::string& pair_separator, // sep2
std::vector< std::pair<std::string, std::string> >* output);
/** Splits a string that contains a list of pairs of elements:
* <elem1_1>sep2<elem1_2>sep1<elem2_1>sep2<elem2_2>sep1...
* ...sep1<elemN_1>sep2<elemN_2>
* If the second element in a pair is missing, the pair(s, '') is used.
*/
void SplitPairs(const std::string& s,
const std::string& elements_separator, // sep1
const std::string& pair_separator, // sep2
std::map<std::string, std::string>* output);
/** Splits a string on separators outside the brackets
* e.g. SplitBracketedString("a(b, c, d(3)), d(), e(d(3))", ',', '(', ')')
* will generate: ["a(b, c, d(3))", " d()", " e(d(3))"]
* Returns false on error (misplaced brackets etc.. */
bool SplitBracketedString(const char* s, const char separator,
const char open_bracket, const char close_bracket,
std::vector<std::string>* output);
/** Removes outermost brackets from a string parsed by SplitBracketedString */
std::string RemoveOutermostBrackets(const std::string& s,
const char open_bracket,
const char close_bracket);
////////////////////////////////////////////////// String transformations.
/** To-upper character conversion operator */
struct toupper_s { int operator()(int c) { return ::toupper(c); } };
/** To-lower character conversion operator */
struct tolower_s { int operator()(int c) { return ::tolower(c); } };
/** Transforms a string to ASCII upper - in place */
void StrToUpper(std::string* s);
/** Returns a full uppercase copy of a string */
std::string StrToUpper(const std::string& s);
/** Transforms a string to ASCII lower - in place */
void StrToLower(std::string* s);
/** Returns a full lowercase copy of a string */
std::string StrToLower(const std::string& s);
////////////////////////////////////////////////// Path processing
/** Given a full-path filename it returns a pointer to the basename
* (i.e. the last path component) */
const char* Basename(const char* filename);
/** Given a full-path filename it returns the basename (i.e. the last path component) */
std::string Basename(const std::string& filename);
/** Given a full-path filename it returns the dirname
* (i.e. the path components without the last one) */
std::string Dirname(const std::string& filename);
/** Cuts the dot delimited extension from a filename */
std::string CutExtension(const std::string& filename);
/** Returns the dot-delimited extension from a filename */
std::string Extension(const std::string& filename);
/** Normalizes a file path (collapses ../, ./ // etc) but leaves
* all the prefix '/' ( with a custom path separator character ) */
std::string NormalizePath(const std::string& path, char sep);
/** Normalizes a file path (collapses ../, ./ // etc) but leaves
* all the prefix '/' */
std::string NormalizePath(const std::string& path);
/** similar with NormalizePath, but collapses the prefix '/' */
std::string NormalizeUrlPath(const std::string& path);
/** Joins system paths together, canonically.
* NOTE: The input paths should be correct, we don't abuse NormalizePath().
*/
std::string JoinPaths(const std::string& path1, const std::string& path2, char sep);
/** Joins system paths together, canonically. */
std::string JoinPaths(const std::string& path1, const std::string& path2);
/** Joins three system paths together, canonically. */
std::string JoinPaths(const std::string& path1, const std::string& path2,
const std::string& path3);
////////////////////////////////////////////////// String printing / formatting
/** Prints some components according to the formatting directives in format and the
* parameters parsed. Some sort of snprintf with string */
std::string StringPrintf(const char* format, ...);
/** Prints some components according to the formatting directives in format and the
* parameters parsed. Some sort of snprintf with string */
std::string StringPrintf(const char* format, va_list args);
/** Appends a StringPrintf(format, args) to s */
void StringAppendf(std::string* s, const char* format, va_list args);
////////////////////////////////////////////////// DEBUG-intended string printing / formatting
/** Transforms a data buffer to a printable string (a'la od) */
std::string PrintableDataBuffer(const void* buffer, size_t size);
/** Similar to PrintableDataBuffer but returns only the HEXA printing. */
std::string PrintableDataBufferHexa(const void* buffer, size_t size);
/** Prints all bytes from buffer in hexa, on a single line */
std::string PrintableDataBufferInline(const void* buffer, size_t size);
/** Prints all bytes from buffer in hexa, on a single line */
std::string PrintableDataBufferInline(const std::string& s);
/** Prints all bytes from buffer in hexa, on a single line, but using the \x format */
std::string PrintableEscapedDataBuffer(const void* buffer, size_t size);
/** Convert byte string to its hex representation */
std::string ToHex(const unsigned char* cp, size_t len);
/** Convert byte string to its hex representation */
std::string ToHex(const std::string& str);
/** Converts a numeric type to its binary representation. (e.g. 0xa3 => "10100011")
* Works with numeric types only: int8, uint8, int16, uint16, ...
*/
template <typename T> std::string ToBinary(T x);
/** StrToBool returns false for ""|"False"|"false"|"0" */
bool StrToBool(const std::string& str);
/** BoolToString returns the string representation of a boolean */
const std::string& BoolToString(bool value);
/** StrHumanBytes: returns a human readable string describing the given byte size
* e.g. 83057 -> "83KB" */
std::string StrHumanBytes(size_t bytes);
/** StrOrdinal: returns the ordinal word
* e.g. 1 -> 'first'
* 2 -> 'second'
* ...
* the maximum is 12.
* For 0 or v > 12 returns 'nth' */
std::string StrOrdinal(size_t v);
/** StrOrdinalNth: returns the compact ordinal word starting with the number
1 -> "1st"
2 -> "2nd"
23 -> "23rd"
*/
std::string StrOrdinalNth(size_t x);
template<typename A, typename B>
size_t PercentageI(A a, B b) { return b == 0 ? 100 : (a * 100LL / b); }
template<typename A, typename B>
double PercentageF(A a, B b) { return b == 0 ? 100 : (a * 100.0 / b); }
// e.g. StrPercentageI(3,4) => "3/4(75%)"
// StrPercentageI(3,2) => "3/2(150%)"
// StrPercentageI(3,0) => "3/0(100%)"
template<typename A, typename B>
std::string StrPercentage(A a, B b, bool integer) {
std::string s;
s.reserve(128);
s.append(std::to_string(a));
s.append("/");
s.append(std::to_string(b));
s.append("(");
if (integer) {
s.append(std::to_string(PercentageI(a, b)));
} else {
s.append(std::to_string(PercentageF(a, b)));
}
s.append("%)");
return s;
}
template<typename A, typename B>
std::string StrPercentageI(A a, B b) { return StrPercentage(a, b, true); }
template<typename A, typename B>
std::string StrPercentageF(A a, B b) { return StrPercentage(a, b, false); }
} // namespace strutil
////////////////////////////////////////////////// DEBUG-intended printing of structures
/** Useful for logging pairs (E.g. ToString(const std::vector< std::pair<int64, int64> >& )) */
template<typename A, typename B>
std::ostream& operator << (std::ostream& os, const std::pair<A, B>& p) {
return os << "(" << p.first << ", " << p.second << ")";
}
namespace strutil {
/** Returns a string version of the object (if it supports << streaming operator) */
template <class T> std::string StringOf(T object);
// These ToString function return a string of the content of the provided structure, in
// a format suitable for debug printing
template <typename A, typename B> std::string ToString(const std::pair<A, B>& p);
template <typename K, typename V> std::string ToString(const std::map<K, V>& m);
template <typename K, typename V> std::string ToString(const hash_map<K, V>& m);
template <typename T> std::string ToString(const std::set<T>& v,
size_t limit = std::string::npos,
bool multi_line = false);
template <typename T> std::string ToString(const hash_set<T>& v,
size_t limit = std::string::npos,
bool multi_line = false);
template <typename T> std::string ToString(const std::vector<T>& v,
size_t limit = std::string::npos,
bool multi_line = false);
template <typename T> std::string ToString(const std::list<T>& v,
size_t limit = std::string::npos,
bool multi_line = false);
template <typename K, typename V> std::string ToStringP(const std::map<K, V*>& m);
template <typename K, typename V> std::string ToStringP(const hash_map<K, V*>& m);
template <typename T> std::string ToStringP(const std::set<T*>& v);
template <typename T> std::string ToStringP(const hash_set<T*>& v);
template <typename T> std::string ToStringP(const std::vector<T*>& vec);
template <typename T> std::string ToStringP(const std::list<T*>& vec);
template <typename CT> std::string ToStringKeys(const CT& m,
size_t limit = std::string::npos);
/** Returns the '|' string representation of an integer that is an or of
* a set of flags, using a custom naming function.
*
* e.g. enum Flag { FLAG_A, FLAG_B, FLAG_C };
* const std::string& FlagName(Flag f) {..};
* uint32 v = FLAG_A | FLAG_C;
*
* LOG_INFO << StrBitFlagsName(v, &FlagName);
* // Prints: {FLAG_A, FLAG_C}
*
* @param T: must be an integer type. It holds the bit flags
* @param FLAG_TYPE: is the flags type (usually an enum).
* @param all_flags: a T value containing all the flags
* @param get_flag_name: must return the name of the given flag
*
* @return: human readable array of flag names
*/
template <typename T, typename FLAG_TYPE>
std::string StrBitFlagsName(T all_flags, T value,
const char* (*get_flag_name)(FLAG_TYPE));
////////////////////////////////////////////////// String finding
/** Return a string s such that:
* s > prefix
* and does not exists s' such that:
* s > s' > prefix
* NOTE: this is ascii only no utf-8, lexicographic order is a complicated thing that
* needs to be done with something like icu for a specific locale.
*/
std::string GetNextInLexicographicOrder(const std::string& prefix);
/** Utility for finding bounds in a map keyed by strings, givven a key prefix */
template<class C> void GetBounds(const std::string& prefix,
std::map<std::string, C>* m,
typename std::map<std::string, C>::iterator* begin,
typename std::map<std::string, C>::iterator* end);
/** Utility for finding bounds in a map keyed by strings, givven a key prefix
* - const_iterator flavor. */
template<class C> void GetBounds(const std::string& prefix,
const std::map<std::string, C>& m,
typename std::map<std::string, C>::const_iterator* begin,
typename std::map<std::string, C>::const_iterator* end);
////////////////////////////////////////////////// String escaping
/** Escapes a string for JSON encoding */
std::string JsonStrEscape(const char* text, size_t size);
/** Escapes a string for JSON encoding */
std::string JsonStrEscape(const std::string& text);
/** Unescapes a string from JSON */
std::string JsonStrUnescape(const char* text, size_t size);
/** Unescapes a string from JSON */
std::string JsonStrUnescape(const std::string& text);
/** Escape a string for XML encoding */
std::string XmlStrEscape(const std::string& text);
/** Replace characters "szCharsToEscape" in "text" with escape sequences
* marked by "escape". The escaped chars are replaced by "escape" character
* followed by their ASCII code as 2 digit text.
*
* The escape char is replace by "escape""escape".
* StrEscape("a,., b,c", '#', ",.") => "a#44#46#44 b#44c"
* StrEscape("a,.# b,c", '#', ",.") => "a#44#46## b#44c"
*/
std::string StrEscape(const char* text, char escape, const char* chars_to_escape);
std::string StrEscape(const std::string& text, char escape, const char* chars_to_escape);
std::string StrNEscape(const char* text, size_t size, char escape, const char* chars_to_escape);
/** The reverse of StrEscape. **/
std::string StrUnescape(const char* text, char escape);
/** The reverse of StrEscape. **/
std::string StrUnescape(const std::string& text, char escape);
/** Replaces named variables in the given string with corresponding one
* found in the 'vars' map, much in the vein of python formatters.
*
* E.g.
* string s("We found user ${User} who wants to \${10 access ${Resource}.")
* std::map<string, string> m;
* m["User"] = "john";
* m["Resource"] = "disk";
* cout << strutil::StrMapFormat(s, m, "${", "}", '\\') << endl;
*
* Would result in:
* We found user john who wants to ${10 access disk.
* escape_char escapes first chars in both arg_begin and arg_end.
*/
std::string StrMapFormat(const char* s,
const std::map<std::string, std::string>& m,
const char* arg_begin = "${",
const char* arg_end = "}",
char escape_char = '\\');
////////////////////////////////////////////////// i18n / UTF8
//
// General i18n rules:
// - strings that that are used to represent text, hold that text
// in utf8 encoding (string-s in protobuf are like that too).
// - for all user facing / serious text holding operations use these
// functions to manipulate text (using something like strutil::SplitString
// on a utf8 string may and will result in many non-utf8 strings, so
// use strutil::i18n::Utf8Split* functions)
// - for unicode character holding use and constant passing use
// wchar_t* / wint_t (e.g. L"abc", L'-')
// - for i18n manipulation all utf8 string need to be converted to wchar_t
// (i.e. unicode characters) and then back to utf8 string.
// - for serious i18n work (e.g. serious transliteration, user facing lexicographic
// ordering that that is not for the faint of hart) use icu library.
//
//
namespace i18n {
/** Returns the length of the given UTF-8 encoded string */
size_t Utf8Strlen(const char *s);
/** Returns the length of the given UTF-8 encoded string */
inline size_t Utf8Strlen(const std::string& s);
/** The size that needs to be allocated for a utf8 size. */
size_t WcharToUtf8Size(const wchar_t* s);
/** If the given unicode character can be considered a space (text separator */
bool IsSpace(const wint_t c);
/** If the given unicode character can be considered an alphanumeric character */
bool IsAlnum(const wint_t c);
/** Copies the current codepoint (at most 4 bytes) at s to codepoint,
* returning the next codepoint pointer */
const char* Utf8ToCodePoint(const char* start, const char* end, wint_t* codepoint);
/** Appends the utf8 encoded value of codepoint to s */
size_t CodePointToUtf8(wint_t codepoint, std::string* s);
/** Returns the utf8 encoded value */
inline std::string CodePointToUtf8(wint_t codepoint) {
std::string s;
CodePointToUtf8(codepoint, &s);
return s;
}
/** Appends the utf8 encoded value of codepoint string pointed by p
* (enough space must be available in p - up to 6 bytes).
*/
char* CodePointToUtf8Char(wint_t codepoint, char* p);
/** Converts from utf8 to wchar into a newly allocated string (of the right size). */
wchar_t* Utf8ToWchar(const char* s, size_t size_bytes);
/** Converts from utf8 to wchar into a newly allocated string (of the right size). */
wchar_t* Utf8ToWchar(const std::string& s);
/** Converts from utf8 to wchar into a newly allocated string (of the right size).
* Returns also the size of the string in wchar_t.
*/
std::pair<wchar_t*, size_t> Utf8ToWcharWithLen(const char* s, size_t size_bytes);
/** Converts from utf8 to wchar into a newly allocated string (of the right size).
* Returns also the size of the string in wchar_t.
*/
std::pair<wchar_t*, size_t> Utf8ToWcharWithLen(const std::string& s);
/** Converts from wchar_t* to a mutable string. */
void WcharToUtf8StringSet(const wchar_t* s, std::string* result);
/** Converts from wchar_t* to a mutable string, with a maximum input lenght */
void WcharToUtf8StringSetWithLen(const wchar_t* s, size_t len, std::string* result);
/** Converts from wchar_t* to a returned string. */
std::string WcharToUtf8String(const wchar_t* s);
/** Converts from wchar_t* to a mutable string, with a maximum input lenght */
std::string WcharToUtf8StringWithLen(const wchar_t* s, size_t len);
/** Returns true if a utf string is valid */
bool IsUtf8Valid(const std::string& s);
/** Converts ISO-8859-1 to Utf8 */
std::string Iso8859_1ToUtf8(const std::string& s);
/** Return the first N chars in utf8 string s */
std::string Utf8StrPrefix(const std::string& s, size_t prefix_size);
/** Trims the utf8 s by removing whitespaces at the beginning and the end */
std::string Utf8StrTrim(const std::string& s);
/** Trims the utf8 s by removing whitespaces at the beginning */
std::string Utf8StrTrimFront(const std::string& s);
/** Trims the utf8 s by removing whitespaces at the end */
std::string Utf8StrTrimBack(const std::string& s);
/** Splits and trims on whitespaces. In terms will end up only non empty substrings */
void Utf8SplitOnWhitespace(const std::string& s, std::vector<std::string>* terms);
/** Splits and trims on whitespaces. In terms will end up only non empty substrings */
void Utf8SplitString(const std::string& s, const std::string& split, std::vector<std::string>* terms);
/** Split a string on the first encouter of split */
std::pair<std::string, std::string> Utf8SplitPairs(const std::string& s, wchar_t split);
/** Splits and trims on whitespaces. In terms will end up only non empty substrings */
void Utf8SplitOnWChars(const std::string& s, const wchar_t* splits,
std::vector<std::string>* terms);
/** Compares two utf8 string w/o expanding them all, and considering umlauts / spaces
* i.e. e < é < f.
* NOTE: this may not be correct for some languages !
* lexicographic order is a complicated thing that needs to be done with something
* like icu for a specific locale, this is just a quick helper that works in most
* non user-facing cases.
*/
int Utf8Compare(const std::string& s1, const std::string& s2, bool umlaut_expand);
/** Returns the uppercase for the provided unicode character,
* keeping the same accents and such. (e.g. e=>E and é=>É) */
wint_t ToUpper(wint_t c);
/** Returns the lowercase for the provided unicode character,
* keeping the same accents and such. (e.g. É=>é and E=>e) */
wint_t ToLower(wint_t c);
/** I18n relevant uppercase transformation for a UTF8 string */
std::string ToUpperStr(const std::string& s);
/** I18n relevant lowercase transformation for a UTF8 string */
std::string ToLowerStr(const std::string& s);
/**
* This will transform a text from unicode text to equivalent
* ascii (e.g. Zürich -> Zurich).
* If they would be the same we return null, else we return
* a freshly allocated string. (dispose the returning string with delete [])
* Note that this is not standard, just a quick hack. For proper
* transliteration use icu library.
*/
wchar_t* UmlautTransform(const wchar_t* s);
/** Same as above, but accepts / returns UTF8 strings */
bool UmlautTransformUtf8(const std::string& s, std::string* result);
/** Iterates the unicode wchar charactes of a utf-8 string.
* Example for efficiently finding out if there is any unicode
* space in a string.
*
* bool HasSpace(const std::string& s) {
* strutil::i18n::Utf8ToWcharIterator it(s);
* while (it.IsValid()) {
* if (strutil::i18n::IsSpace(it->ValueAndNext())) {
* return true;
* }
* }
* return false;
* }
*/
class Utf8ToWcharIterator {
const char* p_;
const char* const end_;
public:
explicit Utf8ToWcharIterator(const std::string& s)
: p_(s.c_str()), end_(p_ + s.size()) {
}
explicit Utf8ToWcharIterator(const char* s)
: p_(s), end_(s + strlen(s)) {
}
bool IsValid() const {
return p_ < end_;
}
/** Gets the current wchar value, and advances the
* iterator (unified for efficiency);
*/
wint_t ValueAndNext() {
wint_t codepoint;
p_ = Utf8ToCodePoint(p_, end_, &codepoint);
return codepoint;
}
protected:
DISALLOW_EVIL_CONSTRUCTORS(Utf8ToWcharIterator);
};
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// Inlined functions -- Leave always a commented declarationsabove these lines --
// (even when the inline definition is bellow).
//
inline bool StrCaseEqual(const std::string& s1, const std::string& s2) {
return ( s1.size() == s2.size() &&
!strncasecmp(s1.c_str(), s2.c_str(), s1.size()) );
}
inline std::string JoinStrings(const std::vector<std::string>& pieces, const char* glue) {
return JoinStrings(pieces.begin(), pieces.end(), glue);
}
inline std::string JoinStrings(const std::initializer_list<std::string>& pieces, const char* glue) {
return JoinStrings(pieces.begin(), pieces.end(), glue);
}
template<typename Iter>
inline std::string JoinStrings(Iter begin, Iter end, const char* glue) {
std::string s;
for (Iter it = begin; it != end;) {
s += *it;
if (++it != end) { s += glue; }
}
return s;
}
inline void SplitStringOnAny(const std::string& s, const char* separators,
std::vector<std::string>* output, bool skip_empty) {
SplitStringOnAny(s.c_str(), int(s.length()), separators, output, skip_empty);
}
inline void SplitStringOnAny(const std::string& s, const char* separators,
std::vector<std::string>* output) {
SplitStringOnAny(s.c_str(), int(s.length()), separators, output, true);
}
inline std::pair<std::string, std::string> SplitFirst(const char* s, char separator) {
const char* slash_pos = strchr(s, separator);
if ( !slash_pos ) {
return make_pair(std::string(s), std::string());
}
return make_pair(std::string(s, slash_pos - s), std::string(slash_pos + 1));
}
inline std::pair<std::string, std::string> SplitFirst(const std::string& s,
const std::string& separator) {
const size_t pos_sep = s.find(separator);
if ( pos_sep != std::string::npos ) {
return make_pair(s.substr(0, pos_sep), s.substr(pos_sep + 1));
} else {
return make_pair(s, std::string());
}
}
inline std::pair<std::string, std::string> SplitLast(const std::string& s,
const std::string& separator) {
const size_t pos_sep = s.rfind(separator);
if ( pos_sep != std::string::npos ) {
return make_pair(s.substr(0, pos_sep), s.substr(pos_sep + 1));
} else {
return make_pair(s, std::string());
}
}
inline void StrTrimCompress(std::vector<std::string>* str) {
for (std::vector<std::string>::iterator it = str->begin(); it != str->end(); ++it) {
*it = StrTrimCompress(*it);
}
}
////////////////////////////////////////
inline void StrToUpper(std::string* s) {
std::transform(s->begin(), s->end(), s->begin(), toupper_s());
}
inline std::string StrToUpper(const std::string& s) {
std::string upper;
std::transform(s.begin(), s.end(),
std::insert_iterator<std::string>(
upper, upper.begin()), toupper_s());
return upper;
}
inline void StrToLower(std::string* s) {
std::transform(s->begin(), s->end(), s->begin(), tolower_s());
}
inline std::string StrToLower(const std::string& s) {
std::string lower;
std::transform(s.begin(), s.end(),
std::insert_iterator<std::string>(
lower, lower.begin()), tolower_s());
return lower;
}
////////////////////////////////////////
inline const char* Basename(const char* filename) {
const char* sep = strrchr(filename, PATH_SEPARATOR);
return sep ? sep + 1 : filename;
}
inline std::string Basename(const std::string& filename) {
return Basename(filename.c_str());
}
inline std::string Dirname(const std::string& filename) {
std::string::size_type sep = filename.rfind(PATH_SEPARATOR);
return filename.substr(0, (sep == std::string::npos) ? 0 : sep);
}
inline std::string CutExtension(const std::string& filename) {
std::string::size_type dot_pos = filename.rfind('.');
return (dot_pos == std::string::npos) ? filename : filename.substr(0, dot_pos);
}
inline std::string Extension(const std::string& filename) {
std::string::size_type dot_pos = filename.rfind('.');
return (dot_pos == std::string::npos) ? std::string("") : filename.substr(dot_pos + 1);
}
inline std::string NormalizePath(const std::string& path) {
return NormalizePath(path, PATH_SEPARATOR);
}
inline std::vector<std::string> SplitString(const std::string& s, const std::string& separator) {
std::vector<std::string> output;
SplitString(s, separator, &output);
return output;
}
inline void SplitStringToSet(const std::string& s, const std::string& separator,
std::set<std::string>* output) {
std::vector<std::string> v;
strutil::SplitString(s, separator, &v);
output->insert(v.begin(), v.end());
}
inline std::set<std::string> SplitStringToSet(const std::string& s, const std::string& separator) {
std::set<std::string> output;
SplitStringToSet(s, separator, &output);
return output;
}
inline std::string JoinPaths(const std::string& path1, const std::string& path2, char sep) {
if ( path1.empty() ) return path2;
if ( path2.empty() ) return path1;
if ( path1.size() == 1 && path1[0] == sep ) {
return path1 + path2;
}
if ( path1[path1.size()-1] == sep || path2[0] == sep ) {
return path1 + path2;
}
return path1 + sep + path2;
}
inline std::string JoinPaths(const std::string& path1, const std::string& path2) {
return JoinPaths(path1, path2, PATH_SEPARATOR);
}
inline std::string JoinPaths(const std::string& path1, const std::string& path2,
const std::string& path3) {
return JoinPaths(path1, JoinPaths(path2, path3, PATH_SEPARATOR), PATH_SEPARATOR);
}
template <class T> std::string StringOf(T object) {
std::ostringstream os; os << object; return os.str();
}
template <typename A, typename B>
std::string ToString(const std::pair<A,B>& p) {
std::ostringstream oss;
oss << "(" << p.first << ", " << p.second << ")";
return oss.str();
}
#define DEFINE_CONTAINER_TO_STRING(fname, accessor) \
template <typename Cont> \
std::string fname(const Cont& m, const char* name, \
size_t limit = std::string::npos, \
bool multi_line = false) { \
std::ostringstream oss; \
const size_t sz = m.size(); \
oss << name << " #" << sz << "{"; \
size_t ndx = 0; \
for (typename Cont::const_iterator it = m.begin(); \
it != m.end() && ndx < limit; ++ndx, ++it) { \
if (multi_line) oss << "\n - "; \
else if (it != m.begin()) oss << ", "; \
oss << (accessor); \
} \
if (ndx < sz) oss << (multi_line ? "\n - " : ", ") \
<< "... #" << (sz - ndx) << " items omitted"; \
oss << "}"; \
return oss.str(); \
}
DEFINE_CONTAINER_TO_STRING(ContainerToString, *it)
DEFINE_CONTAINER_TO_STRING(ContainerPPairToString, *(it->second))
DEFINE_CONTAINER_TO_STRING(ContainerKeysToString, (it->first))
DEFINE_CONTAINER_TO_STRING(ContainerPToString, *(*it))
#undef DEFINE_CONTAINER_TO_STRING
template <typename K, typename V> std::string ToString(const std::map<K, V>& m) {
return ContainerToString(m, "map");
}
template <typename K, typename V> std::string ToString(const std::multimap<K, V>& m) {
return ContainerToString(m, "multimap");
}
template <typename K, typename V> std::string ToString(const hash_map<K, V>& m) {
return ContainerToString(m, "hash_map");
}
template <typename T> std::string ToString(const std::set<T>& v, size_t limit, bool multi_line) {
return ContainerToString(v, "set", limit, multi_line);
}
template <typename T> std::string ToString(const hash_set<T>& v, size_t limit, bool multi_line) {
return ContainerToString(v, "hash_set", limit, multi_line);
}
template <typename T> std::string ToString(const std::vector<T>& v, size_t limit, bool multi_line) {
return ContainerToString(v, "vector", limit, multi_line);
}
template <typename T> std::string ToString(const std::list<T>& v, size_t limit, bool multi_line) {
return ContainerToString(v, "list", limit, multi_line);
}
template <typename K, typename V> std::string ToStringP(const std::map<K, V*>& m) {
return ContainerPPairToString(m, "map");
}
template <typename K, typename V> std::string ToStringP(const hash_map<K, V*>& m) {
return ContainerPPairToString(m, "hash_map");
}
template <typename T> std::string ToStringP(const std::set<T*>& v) {
return ContainerPToString(v, "set");
}
template <typename T> std::string ToStringP(const hash_set<T*>& v) {
return ContainerPToString(v, "hash_set");
}
template <typename T> std::string ToStringP(const std::vector<T*>& v) {
return ContainerPToString(v, "vector");
}
template <typename T> std::string ToStringP(const std::list<T*>& v) {
return ContainerPToString(v, "list");
}
template <typename CT> std::string ToStringKeys(const CT& m, size_t limit) {
return ContainerKeysToString(m, "map-keys", limit);
}
extern const char* const kBinDigits[16];
template <typename T>
std::string ToBinary(T x) {
T crt = x;
const size_t buf_size = sizeof(crt) * 8 + 1;
char buf[buf_size];
char* p = buf + buf_size - 1;
*p-- = '\0';
while ( p > buf ) {
const char* dig = kBinDigits[crt & 0xf] + 3;
*p-- = *dig--;
*p-- = *dig--;
*p-- = *dig--;
*p-- = *dig--;
crt >>= 4;
}
return std::string(buf, buf_size);
}
////////////////////////////////////////
template <typename T, typename FLAG_TYPE>
std::string StrBitFlagsName(T all_flags, T value, const char* (*get_flag_name)(FLAG_TYPE) ) {
if (value == all_flags) {
return "{ALL}";
}
std::ostringstream oss;
oss << "{";
bool first = true;
for (size_t i = 0; i < sizeof(value)*8; i++) {
const T flag = (T(1) << i);
if (value & flag) {
if (!first) oss << ", ";
oss << get_flag_name(FLAG_TYPE(flag));
first = false;
}
}
oss << "}";
return oss.str();
}
template<class C> void GetBounds(const std::string& prefix,
std::map<std::string, C>* m,
typename std::map<std::string, C>::iterator* begin,
typename std::map<std::string, C>::iterator* end) {
if ( prefix.empty() ) {
*begin = m->begin();
} else {
*begin = m->lower_bound(prefix);
}
const std::string upper_bound = strutil::GetNextInLexicographicOrder(prefix);
if ( upper_bound.empty() ) {
*end = m->end();
} else {
*end = m->upper_bound(upper_bound);
}
}
template<class C> void GetBounds(const std::string& prefix,
const std::map<std::string, C>& m,
typename std::map<std::string, C>::const_iterator* begin,
typename std::map<std::string, C>::const_iterator* end) {
if ( prefix.empty() ) {
*begin = m.begin();
} else {
*begin = m.lower_bound(prefix);
}
const std::string upper_bound = strutil::GetNextInLexicographicOrder(prefix);
if ( upper_bound.empty() ) {
*end = m.end();
} else {
*end = m.upper_bound(upper_bound);
}
}
////////////////////////////////////////
inline std::string JsonStrEscape(const std::string& text) {
return JsonStrEscape(text.c_str(), text.size());
}
inline std::string JsonStrUnescape(const std::string& text) {
return JsonStrUnescape(text.c_str(), text.length());
}
////////////////////////////////////////
namespace i18n {
inline std::pair<wchar_t*, size_t> Utf8ToWcharWithLen(const std::string& s) {
return Utf8ToWcharWithLen(s.c_str(), s.length());
}
inline wchar_t* Utf8ToWchar(const std::string& s) {
return Utf8ToWcharWithLen(s.c_str(), s.length()).first;
}
inline wchar_t* Utf8ToWchar(const char* s, size_t size_bytes) {
return Utf8ToWcharWithLen(s, size_bytes).first;
}
inline void WcharToUtf8StringSet(const wchar_t* s, std::string* result) {
while (*s) {
CodePointToUtf8(*s++, result);
}
}
inline void WcharToUtf8StringSetWithLen(const wchar_t* s, size_t len,
std::string* result) {
const wchar_t* p = s + len;
while (*s && (s < p)) {
CodePointToUtf8(*s++, result);
}
}
inline std::string WcharToUtf8String(const wchar_t* s) {
std::string result;
WcharToUtf8StringSet(s, &result);
return result;
}
inline std::string WcharToUtf8StringWithLen(const wchar_t* s, size_t len) {
std::string result;
WcharToUtf8StringSetWithLen(s, len, &result);
return result;
}
inline size_t Utf8Strlen(const std::string& s) {
return Utf8Strlen(s.c_str());
}
}
}
# endif // __WHISPERLIB_BASE_STRUTIL_H__
| {'content_hash': '0293e6038590ce9935a841ca529abfae', 'timestamp': '', 'source': 'github', 'line_count': 1079, 'max_line_length': 102, 'avg_line_length': 41.43651529193698, 'alnum_prop': 0.6357414448669202, 'repo_name': 'cpopescu/whisperlib', 'id': '45c0f5104ca93b21f3ba83e587a768ac2eb3d65d', 'size': '44716', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'whisperlib/base/strutil.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '62347'}, {'name': 'C++', 'bytes': '2438454'}, {'name': 'M4', 'bytes': '35306'}, {'name': 'Makefile', 'bytes': '120243'}, {'name': 'Protocol Buffer', 'bytes': '9530'}, {'name': 'Python', 'bytes': '20961'}, {'name': 'Shell', 'bytes': '68432'}]} |
PPI Distribution Module
=======================
[@php]: http://php.net/ "PHP: Hypertext Preprocessor"
[@ppi]: http://ppi.io/ "The PPI Framework - A meta-framework built using Symfony2/ZendFramework2 and Doctrine2"
The base module for [PPI][@ppi] distributions.
[](http://travis-ci.org/ppi/ppi-distribution-module)
Requirements
------------
* [PHP][@php] 5.3.3 and up
* [PPI Framework 2][@ppi] (2.1.x)
Installation (Composer)
-----------------------
### 0. Install Composer
If you don't have Composer yet, download it following the instructions on
http://getcomposer.org/ or just run the following command:
``` bash
curl -s http://getcomposer.org/installer | php
```
### 1. Add this package to your composer.json
```js
{
"require": {
"ppi/distribution-module": "dev-master"
}
}
```
Now tell composer to download the module by running the command:
``` bash
$ php composer.phar update ppi/distribution-module
```
Composer will install the module to your project's `vendor/ppi` directory.
### 2. Enable the module
Enable this module by editing `app/config/modules.yml`:
``` yml
modules:
- PPI\DistributionModule
# ...
```
License
-------
This module is licensed under the MIT License. See the [LICENSE file](https://github.com/ppi/ppi-distribution-module/blob/master/LICENSE) for details.
Authors
-------
* Paul Dragoonis - <[email protected]> ~ [twitter.com/dr4goonis](http://twitter.com/dr4goonis)
* Vítor Brandão - <[email protected]> ~ [twitter.com/noiselabs](http://twitter.com/noiselabs)
See also the list of [contributors](https://github.com/ppi/ppi-distribution-module/contributors) who participated in this project.
Submitting bugs and feature requests
------------------------------------
Bugs and feature requests are tracked on [GitHub](https://github.com/ppi/ppi-distribution-module/issues).
| {'content_hash': '08e8ca126f2e074a1c2c6815cb1cf250', 'timestamp': '', 'source': 'github', 'line_count': 73, 'max_line_length': 150, 'avg_line_length': 26.246575342465754, 'alnum_prop': 0.6831941544885177, 'repo_name': 'ppi/ppi-distribution-module', 'id': '9e7751c5b045f2e73c62f66b2614e054f782e277', 'size': '1918', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '42246'}]} |
title: Submit to Site Showcase
---
Want to submit a site to the [Site Showcase](/showcase/)? Follow these instructions.
## Steps
There are only three major steps :)
1. If this is your first contribution to the Gatsby open source repo, follow the [Contribution guidelines](/contributing/code-contributions/).
2. If there is a chance that someone else could have already submitted the site, please make sure no one else has already submitted it by searching existing PRs: https://github.com/gatsbyjs/gatsby/pulls
3. Edit the [`sites.yml`](https://github.com/gatsbyjs/gatsby/blob/master/docs/sites.yml) file by adding your submission to the bottom of the list of sites in the following format:
```yaml:title=docs/sites.yml
- title: Title of the Site
# this is the URL that is linked from the showcase
main_url: https://titleofthesite.com
# this URL is used to generate a screenshot
url: https://titleofthesite.com/portfolio
# optional: for open-source sites, this URL points to the repo that powers the site
source_url: https://github.com/{username}/{titleofthesite}
# optional: short paragraph describing the content and/or purpose of the site that will appear in the modal detail view and permalink views for your site
description: >
{titleofthesite} is a shiny new website built with Gatsby v2 that makes important contributions towards a faster web for everyone.
# You can list as many categories as you want here. Check list of Categories below in this doc!
# If you'd like to create a new category, simply list it here.
categories:
- Relevant category 1
- Relevant category 2
# Add the name (developer or company) and URL (e.g. Twitter, GitHub, portfolio) to be used for attribution
built_by: Jane Q. Developer
built_by_url: https://example.org
# leave as false, the Gatsby site review board will choose featured sites quarterly
featured: false
```
Use the following template to ensure required fields are filled:
```yaml:title=docs/sites.yml
- title: (required)
url: (required)
main_url: (required)
source_url: (optional - https://github.com/{username}/{titleofthesite})
description: >
(optional)
categories:
- (required)
built_by: (optional)
built_by_url: (optional)
featured: false
```
## Helpful information
### Categories
Categories currently include both _type of site_ (structure) and the _content of the site_. You will place all these under "categories" in your submission for now. The reason these are in two separate lists here is to show that you can have a school's marketing site (type of site would be marketing, and content would be education) or a site that delivers online learning about marketing (type of site would be education and content would be marketing).
#### Type of site
- Blog
- Directory
- Documentation
- eCommerce
- Education
- Portfolio
- Gallery
- See [`categories.yml`](https://github.com/gatsbyjs/gatsby/blob/master/docs/categories.yml) for an up to date list of valid categories.
#### Content of site:
A few notes on site content: a common question is this: "aren't all Gatsby sites technically in the "web development" category?" Well, no because this category means the _content_ of the site has to be about web development, like [ReactJS](https://reactjs.org/). Also, the difference between technology and web development is like this. [Cardiogram](https://cardiogr.am/) is technology, while [ReactJS](https://reactjs.org/) is web development.
- Agency
- Education
- Entertainment
- Finance
- Food
- Healthcare
- Government
- Marketing
- Music
- Media
- Nonprofit
- Open Source
- Photography
- Podcast
- Real Estate
- Science
- Technology
- Web Development
- See [`categories.yml`](https://github.com/gatsbyjs/gatsby/blob/master/docs/categories.yml) for an up to date list of valid categories.
#### Adding new tag
If you think that there is something missing in the tag list, you can update [`categories.yml`](https://github.com/gatsbyjs/gatsby/blob/master/docs/categories.yml) and add a new one. However, we encourage you to use existing tags.
### Note on Featured Sites
#### Review process
By default, all sites submitted to the Site Showcase will be reviewed by the Gatsby Site Review Board as a candidate for the 'Featured Sites' section of the showcase. If you do not want your site to be featured, please add 'DO NOT FEATURE' to the pull request.
Featured sites will be chosen quarterly based on the following criteria:
- Well known brands
- Use case diversity
- Visual appeal
- Visual diversity
#### How many can be featured at a time?
9, since that’s what can fit on one page of the site showcase
#### How to Set a Site as Featured
_Note: the Gatsby team will choose featured sites, leave as `featured: false` when first posting_
If your site is chosen as featured, here's what to do next:
1. Change `featured: false` to `featured: true`
2. Add `featured` as a category:
```shell
categories:
- featured
```
### Change your mind / need to edit your submission?
If you want to edit anything in your site submission later, simply edit the .yml file by submitting another PR.
| {'content_hash': '98b782cea37be9aa1e5bb80939b8aeb8', 'timestamp': '', 'source': 'github', 'line_count': 141, 'max_line_length': 454, 'avg_line_length': 36.45390070921986, 'alnum_prop': 0.7476653696498055, 'repo_name': 'ChristopherBiscardi/gatsby', 'id': '56531929dd13d6bc76c11250e2ee831650941a5e', 'size': '5146', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/contributing/site-showcase-submissions.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '73074'}, {'name': 'Dockerfile', 'bytes': '1625'}, {'name': 'HCL', 'bytes': '497'}, {'name': 'HTML', 'bytes': '64126'}, {'name': 'JavaScript', 'bytes': '3102972'}, {'name': 'Shell', 'bytes': '6155'}, {'name': 'TypeScript', 'bytes': '61058'}]} |
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': 'b81c48c1b5cc55343a587ac26c29344b', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 23, 'avg_line_length': 9.076923076923077, 'alnum_prop': 0.6779661016949152, 'repo_name': 'mdoering/backbone', 'id': '3dbe86b3474c3b73263054d49d195964e2e5a4fd', 'size': '183', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Pycnanthemum/Pycnanthemum lanceolatum/Pycnanthemum lanceolatum lanceolatum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
<?php
/**
* Created by PhpStorm.
* User: zazhu
* Date: 16/04/16
* Time: 19:33
*/
namespace AppBundle\Service;
use Doctrine\Common\Persistence\ObjectManager;
class CategoryService
{
private $om;
public function __construct(ObjectManager $objectManager)
{
$this->om = $objectManager;
}
public function getTreeCategory()
{
$categoryList = $this->om->getRepository('AppBundle:Categorie')->findBy([], ['parent' => 'ASC']);
$tree = [];
foreach ($categoryList as $categorie) {
if ($categorie->getParent() !== null) {
$tree[$categorie->getParent()->getId()]['children'][] = $categorie;
} else {
$tree[$categorie->getId()] = [$categorie, 'children' => []];
}
}
return $tree;
}
} | {'content_hash': '12aa363d3548582ebf82a40b0937a97d', 'timestamp': '', 'source': 'github', 'line_count': 38, 'max_line_length': 105, 'avg_line_length': 21.736842105263158, 'alnum_prop': 0.549636803874092, 'repo_name': 'IsabelleJaffrezic/BankManager', 'id': '0765baaaac7450309a246cf6a1112cf485519aee', 'size': '826', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/AppBundle/Service/CategoryService.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '3606'}, {'name': 'CSS', 'bytes': '62'}, {'name': 'HTML', 'bytes': '19287'}, {'name': 'PHP', 'bytes': '91353'}]} |
<?xml version="1.0" encoding="utf-8"?>
<ivy-module version="2.0"
xmlns:e="http://ant.apache.org/ivy/extra"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info
organisation="org.testfx" module="testfx-junit" revision="4.0.13-alpha"
status="release" publication="20180323000000" >
<license name="European Union Public License)"/>
<description homepage="https://github.com/TestFX/TestFX">
Simple and clean testing for JavaFX.
</description>
</info>
<configurations>
<conf name="release" description="Published artifacts."/>
<conf name="runtime" description="Runtime requirements."/>
<conf name="default" description="Default configuration." extends="runtime,release"/>
</configurations>
<publications defaultconf="release">
<artifact name="testfx-junit" type="jar" ext="jar"/>
<artifact name="testfx-junit" type="source" ext="jar" e:classifier="sources"/>
<artifact name="testfx-junit" type="javadoc" ext="jar" e:classifier="javadoc"/>
</publications>
<dependencies defaultconf="runtime" defaultconfmapping="*->default">
<dependency org="org.testfx" name="testfx-core" rev="4.0.13-alpha"/>
<dependency org="org.junit" name="junit" rev="4.12"/>
</dependencies>
</ivy-module> | {'content_hash': 'b17d598c7b7d003ecf9217a7ceaca5d8', 'timestamp': '', 'source': 'github', 'line_count': 33, 'max_line_length': 89, 'avg_line_length': 40.96969696969697, 'alnum_prop': 0.6908284023668639, 'repo_name': 'Nepherte/IvyRepo', 'id': 'c396dff685d1fa6d06b79ea7ae6d1d16f36f4711', 'size': '1352', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/repo/org.testfx/testfx-junit/4.0.13-alpha/ivy.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '2136'}]} |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gui;
import javax.swing.JLabel;
/**
*
* @author Michu
*/
public class RatingPanel extends javax.swing.JPanel {
/**
* Creates new form NewJPanel
*/
public RatingPanel() {
initComponents();
}
Stars star = new Stars();
private final int starOneID = 0;
private final int starTwoID = 1;
private final int starThreeID = 2;
private final int starFourID = 3;
private final int starFiveID = 4;
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
star1 = new javax.swing.JLabel();
star2 = new javax.swing.JLabel();
star3 = new javax.swing.JLabel();
star4 = new javax.swing.JLabel();
star5 = new javax.swing.JLabel();
setName("1"); // NOI18N
star1.setIcon(star.emptyStar()
);
star1.setMaximumSize(new java.awt.Dimension(100, 94));
star1.setName(""); // NOI18N
star1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
star1MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
star1MouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
star1MousePressed(evt);
}
});
star2.setIcon(star.emptyStar());
star2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
star2MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
star2MouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
star2MousePressed(evt);
}
});
star3.setIcon(star.emptyStar());
star3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
star3MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
star3MouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
star3MousePressed(evt);
}
});
star4.setIcon(star.emptyStar());
star4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
star4MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
star4MouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
star4MousePressed(evt);
}
});
star5.setIcon(star.emptyStar()
);
star5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
star5MouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
star5MouseExited(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
star5MousePressed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(star1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9)
.addComponent(star2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(star3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(27, 27, 27)
.addComponent(star4, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
.addGap(37, 37, 37)
.addComponent(star5, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
.addGap(74, 74, 74))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(70, 70, 70)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(star3, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(star2, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
.addComponent(star4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
.addComponent(star5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
.addComponent(star1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
.addGap(68, 68, 68))))
);
}// </editor-fold>//GEN-END:initComponents
private void star1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star1MouseEntered
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseEntered(arrayOfLabels, starOneID);
}//GEN-LAST:event_star1MouseEntered
private void star1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star1MouseExited
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseExited(arrayOfLabels);
}//GEN-LAST:event_star1MouseExited
private void star3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star3MouseEntered
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseEntered(arrayOfLabels, starThreeID);
}//GEN-LAST:event_star3MouseEntered
private void star3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star3MouseExited
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseExited(arrayOfLabels);
}//GEN-LAST:event_star3MouseExited
private void star2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star2MouseEntered
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseEntered(arrayOfLabels, starTwoID);
}//GEN-LAST:event_star2MouseEntered
private void star2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star2MouseExited
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseExited(arrayOfLabels);
}//GEN-LAST:event_star2MouseExited
private void star4MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star4MouseEntered
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseEntered(arrayOfLabels, starFourID);
}//GEN-LAST:event_star4MouseEntered
private void star4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star4MouseExited
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseExited(arrayOfLabels);
}//GEN-LAST:event_star4MouseExited
private void star5MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star5MouseEntered
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseEntered(arrayOfLabels, starFiveID);
}//GEN-LAST:event_star5MouseEntered
private void star5MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star5MouseExited
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mouseExited(arrayOfLabels);
}//GEN-LAST:event_star5MouseExited
private void star1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star1MousePressed
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mousePressed(arrayOfLabels, starOneID);
}//GEN-LAST:event_star1MousePressed
private void star2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star2MousePressed
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mousePressed(arrayOfLabels, starTwoID);
}//GEN-LAST:event_star2MousePressed
private void star3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star3MousePressed
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mousePressed(arrayOfLabels, starThreeID);
}//GEN-LAST:event_star3MousePressed
private void star4MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star4MousePressed
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mousePressed(arrayOfLabels, starFourID);
}//GEN-LAST:event_star4MousePressed
private void star5MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_star5MousePressed
JLabel[] arrayOfLabels = {star1, star2, star3, star4, star5};
star.mousePressed(arrayOfLabels, starFiveID);
}//GEN-LAST:event_star5MousePressed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel star1;
private javax.swing.JLabel star2;
private javax.swing.JLabel star3;
private javax.swing.JLabel star4;
private javax.swing.JLabel star5;
// End of variables declaration//GEN-END:variables
}
| {'content_hash': '42b9c95af4be02ba2751c678949acaa9', 'timestamp': '', 'source': 'github', 'line_count': 236, 'max_line_length': 151, 'avg_line_length': 44.99576271186441, 'alnum_prop': 0.6514737734249929, 'repo_name': 'kokorajko/RedditPlayer', 'id': '2b640faa13c0ba38bec6597cc435e76eace282f7', 'size': '10619', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/gui/RatingPanel.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '24357'}]} |
package com.googlecode.blaisemath.graph.metrics;
import com.google.common.graph.Graph;
/**
* Global metric describing the density of the graph (# edges divided by # possible).
*
* @author Elisha Peterson
*/
public class EdgeDensity extends AbstractGraphMetric<Double> {
public EdgeDensity() {
super("Edge density", "Number of edges in the graph divided by the total number possible.", true);
}
@Override
public Double apply(Graph graph) {
int n = graph.nodes().size();
return graph.isDirected() ? graph.edges().size() / (n * (n - 1))
: graph.edges().size() / (n * (n - 1) / 2.0);
}
}
| {'content_hash': '3696d18e719fc9c8edef484b59e104c4', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 106, 'avg_line_length': 27.25, 'alnum_prop': 0.6299694189602446, 'repo_name': 'triathematician/blaisemath', 'id': '5e36cb6bbba58761f8bd1c106de4e3f7c2cf0f40', 'size': '1310', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'blaise-graph-theory/src/main/java/com/googlecode/blaisemath/graph/metrics/EdgeDensity.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1445045'}]} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLogFilters">
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component>
<component name="ChangeListManager">
<list default="true" id="037c411e-ea28-4cc9-ad50-79f744030152" name="Default" comment="" />
<ignored path="TcTest.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<projects_view />
</state>
</system>
</component>
<component name="FavoritesManager">
<favorites_list name="TcTest" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="BillingFirstFragment.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/BillingFirstFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="BillingThirdFragment.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/BillingThirdFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="OrderDiscussDetailFragment.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/OrderDiscussDetailFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="RegisterFragment.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/RegisterFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SendCarListFragment.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/SendCarListFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="4" column="11" selection-start-line="4" selection-start-column="11" selection-end-line="4" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="UpdatePhoneFragment.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/UpdatePhoneFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.124223605">
<caret line="4" column="9" selection-start-line="4" selection-start-column="9" selection-end-line="4" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="GradleLocalSettings">
<option name="availableProjects">
<map>
<entry>
<key>
<ExternalProjectPojo>
<option name="name" value="TcTest" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
</key>
<value>
<list>
<ExternalProjectPojo>
<option name="name" value="TcTest" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
<ExternalProjectPojo>
<option name="name" value=":app" />
<option name="path" value="$PROJECT_DIR$/app" />
</ExternalProjectPojo>
</list>
</value>
</entry>
</map>
</option>
<option name="availableTasks">
<map>
<entry key="$PROJECT_DIR$">
<value>
<list>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="clean" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the components produced by root project 'TcTest'. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="components" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays all dependencies declared in root project 'TcTest'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="dependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the insight into a specific dependency in root project 'TcTest'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="dependencyInsight" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays a help message." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="help" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Initializes a new Gradle build. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="init" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the configuration model of root project 'TcTest'. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="model" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the sub-projects of root project 'TcTest'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="projects" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the properties of root project 'TcTest'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="properties" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the tasks runnable from root project 'TcTest' (some of the displayed tasks may belong to subprojects)." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="tasks" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Generates Gradle wrapper files. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="wrapper" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the Android dependencies of the project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="androidDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all variants of all applications and secondary packages." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assemble" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all the Test applications." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all Debug builds." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleDebugUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all Release builds." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="assembleReleaseUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="build" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project and all projects that depend on it." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="buildDependents" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project and all projects it depends on." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="buildNeeded" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all checks." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="check" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="checkDebugManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="checkReleaseManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAndroidTestAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAndroidTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAndroidTestNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAndroidTestRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugAndroidTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugUnitTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileDebugUnitTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileLint" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseUnitTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="compileReleaseUnitTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs instrumentation tests for all flavors on connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="connectedAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all device checks on currently connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="connectedCheck" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs the tests for debug on connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="connectedDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs instrumentation tests using all Device Providers." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="deviceAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all device checks using Device Providers and Test Servers." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="deviceCheck" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="dexDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="dexDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="dexRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAndroidTestAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAndroidTestBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAndroidTestResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAndroidTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateDebugSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateReleaseAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateReleaseBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateReleaseResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="generateReleaseSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="installDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs the android (on device) tests for the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="installDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="jarDebugClasses" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="jarReleaseClasses" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on all variants." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="lint" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="lintDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="lintRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on just the fatal issues in the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="lintVitalRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeDebugAndroidTestAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeDebugAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeReleaseAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mergeReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Creates a version of android.jar that's suitable for unit tests." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="mockableAndroidJar" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="packageDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="packageDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="packageRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDebugAndroidTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDebugBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDebugUnitTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDexDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDexDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preDexRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preReleaseBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="preReleaseUnitTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:animated-vector-drawable:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareComAndroidSupportAnimatedVectorDrawable2320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:appcompat-v7:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareComAndroidSupportAppcompatV72320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:support-v4:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareComAndroidSupportSupportV42320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:support-vector-drawable:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareComAndroidSupportSupportVectorDrawable2320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.flyco.tablayout:FlycoTabLayout_Lib:2.0.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareComFlycoTablayoutFlycoTabLayout_Lib200Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareDebugAndroidTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareDebugDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareDebugUnitTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare io.reactivex:rxandroid:1.1.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareIoReactivexRxandroid110Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareReleaseDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="prepareReleaseUnitTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugAndroidTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugAndroidTestManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processDebugUnitTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processReleaseJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processReleaseManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="processReleaseUnitTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the signing info for each variant." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="signingReport" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prints out all the source sets defined in this project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="sourceSets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for all variants." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="test" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for the debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="testDebugUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for the release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="testReleaseUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstall all applications." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="uninstallAll" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="uninstallDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the android (on device) tests for the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="uninstallDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="uninstallRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="validateDebugSigning" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$" />
<option name="name" value="zipalignDebug" />
</ExternalTaskPojo>
</list>
</value>
</entry>
<entry key="$PROJECT_DIR$/app">
<value>
<list>
<ExternalTaskPojo>
<option name="description" value="Displays the Android dependencies of the project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="androidDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all variants of all applications and secondary packages." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assemble" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all the Test applications." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all Debug builds." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleDebugUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles all Release builds." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="assembleReleaseUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="build" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project and all projects that depend on it." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="buildDependents" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Assembles and tests this project and all projects it depends on." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="buildNeeded" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all checks." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="check" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="checkDebugManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="checkReleaseManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Deletes the build directory." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="clean" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAndroidTestAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAndroidTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAndroidTestNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAndroidTestRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugAndroidTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugUnitTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileDebugUnitTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileLint" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseAidl" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseNdk" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseRenderscript" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseUnitTestJavaWithJavac" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="compileReleaseUnitTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the components produced by project ':app'. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="components" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs instrumentation tests for all flavors on connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="connectedAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all device checks on currently connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="connectedCheck" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs the tests for debug on connected devices." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="connectedDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays all dependencies declared in project ':app'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="dependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the insight into a specific dependency in project ':app'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="dependencyInsight" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs and runs instrumentation tests using all Device Providers." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="deviceAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs all device checks using Device Providers and Test Servers." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="deviceCheck" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="dexDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="dexDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="dexRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAndroidTestAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAndroidTestBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAndroidTestResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAndroidTestSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateDebugSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateReleaseAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateReleaseBuildConfig" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateReleaseResValues" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="generateReleaseSources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays a help message." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="help" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="installDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Installs the android (on device) tests for the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="installDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="jarDebugClasses" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="jarReleaseClasses" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on all variants." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="lint" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="lintDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="lintRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Runs lint on just the fatal issues in the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="lintVitalRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeDebugAndroidTestAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeDebugAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeReleaseAssets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mergeReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Creates a version of android.jar that's suitable for unit tests." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="mockableAndroidJar" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the configuration model of project ':app'. [incubating]" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="model" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="packageDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="packageDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="packageRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDebugAndroidTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDebugBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDebugUnitTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDexDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDexDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preDexRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preReleaseBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="preReleaseUnitTestBuild" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:animated-vector-drawable:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareComAndroidSupportAnimatedVectorDrawable2320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:appcompat-v7:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareComAndroidSupportAppcompatV72320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:support-v4:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareComAndroidSupportSupportV42320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.android.support:support-vector-drawable:23.2.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareComAndroidSupportSupportVectorDrawable2320Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare com.flyco.tablayout:FlycoTabLayout_Lib:2.0.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareComFlycoTablayoutFlycoTabLayout_Lib200Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareDebugAndroidTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareDebugDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareDebugUnitTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prepare io.reactivex:rxandroid:1.1.0" />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareIoReactivexRxandroid110Library" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareReleaseDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="prepareReleaseUnitTestDependencies" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugAndroidTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugAndroidTestManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugAndroidTestResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processDebugUnitTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processReleaseJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processReleaseManifest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processReleaseResources" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="processReleaseUnitTestJavaRes" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the sub-projects of project ':app'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="projects" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the properties of project ':app'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="properties" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the signing info for each variant." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="signingReport" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Prints out all the source sets defined in this project." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="sourceSets" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Displays the tasks runnable from project ':app'." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="tasks" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for all variants." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="test" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for the debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="testDebugUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Run unit tests for the release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="testReleaseUnitTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstall all applications." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="uninstallAll" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="uninstallDebug" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the android (on device) tests for the Debug build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="uninstallDebugAndroidTest" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="description" value="Uninstalls the Release build." />
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="uninstallRelease" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="validateDebugSigning" />
</ExternalTaskPojo>
<ExternalTaskPojo>
<option name="linkedExternalProjectPath" value="$PROJECT_DIR$/app" />
<option name="name" value="zipalignDebug" />
</ExternalTaskPojo>
</list>
</value>
</entry>
</map>
</option>
<option name="modificationStamps">
<map>
<entry key="F:\xuexue\TcTest" value="4373405255667" />
</map>
</option>
<option name="projectBuildClasspath">
<map>
<entry key="$PROJECT_DIR$">
<value>
<ExternalProjectBuildClasspathPojo>
<option name="modulesBuildClasspath">
<map>
<entry key="$PROJECT_DIR$">
<value>
<ExternalModuleBuildClasspathPojo>
<option name="entries">
<list>
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle/1.3.0/gradle-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder/1.3.0/builder-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder/1.3.0/builder-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint/24.3.0/lint-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint/24.3.0/lint-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/common/24.3.0/common-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/common/24.3.0/common-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/squareup/javawriter/2.5.0/javawriter-2.5.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdklib/24.3.0/sdklib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/guava/guava/17.0/guava-17.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/guava/guava/17.0/guava-17.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/annotations/24.3.0/annotations-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/annotations/24.3.0/annotations-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/dvlib/24.3.0/dvlib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/code/gson/gson/2.2.4/gson-2.2.4-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/intellij/annotations/12.0/annotations-12.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/intellij/annotations/12.0/annotations-12.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar" />
</list>
</option>
<option name="path" value="$PROJECT_DIR$" />
</ExternalModuleBuildClasspathPojo>
</value>
</entry>
<entry key="$PROJECT_DIR$/app">
<value>
<ExternalModuleBuildClasspathPojo>
<option name="entries">
<list>
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle/1.3.0/gradle-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle/1.3.0/gradle-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/gradle-core/1.3.0/gradle-core-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder/1.3.0/builder-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder/1.3.0/builder-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint/24.3.0/lint-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint/24.3.0/lint-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-gradle/5.2.1/proguard-gradle-5.2.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdk-common/24.3.0/sdk-common-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/common/24.3.0/common-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/common/24.3.0/common-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-model/1.3.0/builder-model-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/squareup/javawriter/2.5.0/javawriter-2.5.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/squareup/javawriter/2.5.0/javawriter-2.5.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jill/jill-api/0.9.0/jill-api-0.9.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/ddms/ddmlib/24.3.0/ddmlib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdklib/24.3.0/sdklib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/sdklib/24.3.0/sdklib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/manifest-merger/24.3.0/manifest-merger-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/jack/jack-api/0.9.0/jack-api-0.9.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/build/builder-test-api/1.3.0/builder-test-api-1.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-checks/24.3.0/lint-checks-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/proguard/proguard-base/5.2.1/proguard-base-5.2.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/guava/guava/17.0/guava-17.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/guava/guava/17.0/guava-17.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/annotations/24.3.0/annotations-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/annotations/24.3.0/annotations-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/dvlib/24.3.0/dvlib-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/dvlib/24.3.0/dvlib-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/layoutlib/layoutlib-api/24.3.0/layoutlib-api-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/code/gson/gson/2.2.4/gson-2.2.4-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/ow2/asm/asm-analysis/5.0.3/asm-analysis-5.0.3.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/lint/lint-api/24.3.0/lint-api-24.3.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/intellij/annotations/12.0/annotations-12.0-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/intellij/annotations/12.0/annotations-12.0.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3-sources.jar" />
<option value="$APPLICATION_HOME_DIR$/gradle/m2repository/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar" />
<option value="D:/eclipse/adt-bundle-windows-x86_64-20140321/sdk/extras/android/m2repository/com/android/support/appcompat-v7/23.2.0/appcompat-v7-23.2.0.aar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.nineoldandroids/library/2.4.0/e9b63380f3a242dbdbf103a2355ad7e43bad17cb/library-2.4.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.flyco.tablayout/FlycoTabLayout_Lib/2.0.0/f68ac4ad9825c7dba9d71446c6d6eed7ad08fa53/FlycoTabLayout_Lib-2.0.0.aar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/d5d13ea991eab0252e3710e5df3d6a9d4b21d461/butterknife-7.0.1.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.0.0/5c06d197fb7fa875ad452f562e3310dd9949d066/retrofit-2.0.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/converter-gson/2.0.0/49eb3ad545e7701234e4dd83db8dc1344b577f23/converter-gson-2.0.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/adapter-rxjava/2.0.0/bf61256d9868ea053e24d77669c55c80db375c15/adapter-rxjava-2.0.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.reactivex/rxandroid/1.1.0/70751512690d3c21f2a03717f9e831fc09f60117/rxandroid-1.1.0.aar" />
<option value="D:/eclipse/adt-bundle-windows-x86_64-20140321/sdk/extras/android/m2repository/com/android/support/support-v4/23.2.0/support-v4-23.2.0.aar" />
<option value="D:/eclipse/adt-bundle-windows-x86_64-20140321/sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/23.2.0/animated-vector-drawable-23.2.0.aar" />
<option value="D:/eclipse/adt-bundle-windows-x86_64-20140321/sdk/extras/android/m2repository/com/android/support/support-vector-drawable/23.2.0/support-vector-drawable-23.2.0.aar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp/3.2.0/f7873a2ebde246a45c2a8d6f3247108b4c88a879/okhttp-3.2.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.6.1/b9d63507329a7178e026fc334f87587ee5070ac5/gson-2.6.1.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.1.1/b494968f6050d494de55dc3ce005e59c7eb40012/rxjava-1.1.1.jar" />
<option value="D:/eclipse/adt-bundle-windows-x86_64-20140321/sdk/extras/android/m2repository/com/android/support/support-annotations/23.2.0/support-annotations-23.2.0.jar" />
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.6.0/98476622f10715998eacf9240d6b479f12c66143/okio-1.6.0.jar" />
<option value="$MODULE_DIR$/libs/android-viewbadger.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_base_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_cloud_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_map_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_radar_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_search_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/baidumapapi_util_v3_7_1.jar" />
<option value="$MODULE_DIR$/libs/locSDK_6.13.jar" />
</list>
</option>
<option name="path" value="$PROJECT_DIR$/app" />
</ExternalModuleBuildClasspathPojo>
</value>
</entry>
</map>
</option>
<option name="name" value="TcTest" />
<option name="projectBuildClasspath">
<list>
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/announce" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/antlr" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/base-services" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/base-services-groovy" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/build-comparison" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/build-init" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/cli" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/code-quality" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/core" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/dependency-management" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/diagnostics" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/ear" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/ide" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/ide-native" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/internal-integ-testing" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/internal-testing" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/ivy" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/jacoco" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/javascript" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/jetty" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/language-groovy" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/language-java" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/language-jvm" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/language-native" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/language-scala" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/launcher" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/maven" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/messaging" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/model-core" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/model-groovy" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/native" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/open-api" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/osgi" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/platform-base" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/platform-jvm" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/platform-native" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/platform-play" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/plugin-development" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/plugin-use" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/plugins" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/publish" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/reporting" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/resources" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/resources-http" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/resources-s3" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/resources-sftp" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/scala" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/signing" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/sonar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/testing-native" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/tooling-api" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/tooling-api-builders" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/ui" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/src/wrapper" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/ant-1.9.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/ant-launcher-1.9.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-base-services-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-base-services-groovy-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-cli-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-core-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-docs-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-launcher-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-messaging-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-model-core-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-model-groovy-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-native-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-open-api-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-resources-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-tooling-api-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-ui-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/gradle-wrapper-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/groovy-all-2.3.10.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-announce-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-antlr-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-build-comparison-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-build-init-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-code-quality-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-dependency-management-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-diagnostics-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-ear-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-ide-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-ide-native-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-ivy-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-jacoco-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-javascript-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-jetty-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-language-groovy-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-language-java-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-language-jvm-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-language-native-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-language-scala-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-maven-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-osgi-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-platform-base-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-platform-jvm-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-platform-native-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-platform-play-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-plugin-development-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-plugin-use-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-plugins-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-publish-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-reporting-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-resources-http-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-resources-s3-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-resources-sftp-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-scala-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-signing-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-sonar-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-testing-native-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/gradle-tooling-api-builders-2.4.jar" />
<option value="$USER_HOME$/.gradle/wrapper/dists/gradle-2.4-all/6r4uqcc6ovnq6ac6s0txzcpc0/gradle-2.4/lib/plugins/ivy-2.2.0.jar" />
<option value="$PROJECT_DIR$/buildSrc/src/main/java" />
<option value="$PROJECT_DIR$/buildSrc/src/main/groovy" />
</list>
</option>
</ExternalProjectBuildClasspathPojo>
</value>
</entry>
</map>
</option>
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/API/s.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/API/services.java" />
<option value="$PROJECT_DIR$/app/build.gradle" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/API/StowageService.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/apiservice/StowageService.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/GetRetrofit.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/jsonBean/JsonDriver.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/AppUtils.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/MyApplication.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/ChangePhoneNumActivity.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/MyInfoFragment.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/OrderDiscussDetailFragment.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/SendCarListFragment.java" />
<option value="$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/UpdatePhoneFragment.java" />
</list>
</option>
</component>
<component name="NamedScopeManager">
<order />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-8" />
<option name="y" value="-8" />
<option name="width" value="1292" />
<option name="height" value="936" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="AndroidView" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scope" />
<pane id="Scratches" />
<pane id="AndroidView">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TcTest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="Gradle Scripts" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidBuildScriptsGroupNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TcTest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidModuleNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TcTest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidSourceTypeNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TcTest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidSourceTypeNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="tctest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="TcTest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="java" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidSourceTypeNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="tctest" />
<option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidPsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="fragment" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="recentsLimit" value="5" />
<property name="ANDROID_EXTENDED_DEVICE_CHOOSER_SERIALS" value="127.0.0.1:6555" />
<property name="FullScreen" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../kandroid" />
</component>
<component name="RunManager" selected="Android Application.app">
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="EXTRA_OPTIONS" value="" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method>
<option name="Make" enabled="false" />
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="app" />
<option name="DEPLOY" value="true" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="USE_LAST_SELECTED_DEVICE" value="false" />
<option name="PREFERRED_AVD" value="" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Android Application.app" />
</list>
<configuration name="<template>" type="Applet" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="037c411e-ea28-4cc9-ad50-79f744030152" name="Default" comment="" />
<created>1458712388460</created>
<option name="number" value="Default" />
<updated>1458712388460</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1292" height="936" extended-state="1" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32904884" sideWeight="0.49676377" order="13" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.13496144" sideWeight="0.5194805" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.13496144" sideWeight="0.48051947" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="12" side_tool="true" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29788962" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.29048842" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/apiservice/StowageService.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/AppUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="56" column="1" selection-start-line="56" selection-start-column="1" selection-end-line="63" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/apiservice/StowageService.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/AppUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="56" column="1" selection-start-line="56" selection-start-column="1" selection-end-line="63" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="63" column="29" selection-start-line="63" selection-start-column="29" selection-end-line="63" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/jsonBean/JsonDriver.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/build.gradle">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/build.gradle">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="29" column="54" selection-start-line="29" selection-start-column="54" selection-end-line="29" selection-end-column="54" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/SingleFragmentActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.46488294">
<caret line="22" column="22" selection-start-line="22" selection-start-column="22" selection-end-line="22" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/BillingSecondFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/Fragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/LoginFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15197569">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/LoginActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.21276596">
<caret line="11" column="13" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/LogisticsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3343465">
<caret line="15" column="5" selection-start-line="15" selection-start-column="5" selection-end-line="15" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/BillingFirstActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15197569">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/Activity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15197569">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/OrderStorageFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.15197569">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/jsonBean/JsonDriver.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.27355623">
<caret line="9" column="20" selection-start-line="9" selection-start-column="20" selection-end-line="9" selection-end-column="20" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/apiservice/StowageService.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.1863354">
<caret line="9" column="3" selection-start-line="9" selection-start-column="3" selection-end-line="9" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/AppUtils.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.71428573">
<caret line="67" column="25" selection-start-line="67" selection-start-column="25" selection-end-line="67" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/until/MyApplication.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.2795031">
<caret line="11" column="0" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/BillingSecondActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.1552795">
<caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/ChangePhoneNumActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.124223605">
<caret line="4" column="2" selection-start-line="4" selection-start-column="2" selection-end-line="4" selection-end-column="2" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/MyInfoActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.2173913">
<caret line="9" column="13" selection-start-line="9" selection-start-column="13" selection-end-line="9" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/OrderActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.1863354">
<caret line="6" column="8" selection-start-line="6" selection-start-column="8" selection-end-line="6" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/OrderStorageDetailActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.1552795">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/PickupGoodsActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="61" column="21" selection-start-line="61" selection-start-column="21" selection-end-line="61" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/RegisterActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/activity/StorageAndStowageActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.1552795">
<caret line="5" column="0" selection-start-line="5" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/BillingFirstFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="2" column="13" selection-start-line="2" selection-start-column="13" selection-end-line="2" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/MyInfoFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.2173913">
<caret line="36" column="13" selection-start-line="36" selection-start-column="13" selection-end-line="36" selection-end-column="27" />
<folding>
<element signature="imports" expanded="false" />
<element signature="e#3567#3568#0" expanded="false" />
<element signature="e#3602#3603#0" expanded="false" />
<element signature="e#6300#6301#0" expanded="false" />
<element signature="e#6351#6352#0" expanded="false" />
<element signature="e#10749#10750#0" expanded="false" />
<element signature="e#10789#10790#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/BillingThirdFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/OrderDiscussDetailFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/RegisterFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/SendCarListFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="4" column="11" selection-start-line="4" selection-start-column="11" selection-end-line="4" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/src/main/java/com/example/maoyh/tctest/fragment/UpdatePhoneFragment.java">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.124223605">
<caret line="4" column="9" selection-start-line="4" selection-start-column="9" selection-end-line="4" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</component>
</project> | {'content_hash': '081d3e3804870f1d8d738ba7690b9dea', 'timestamp': '', 'source': 'github', 'line_count': 2267, 'max_line_length': 233, 'avg_line_length': 68.94530216144685, 'alnum_prop': 0.6106181101606536, 'repo_name': 'Xmaoyh/TcTest', 'id': '2ea9497b6ca84dead3276e8aa6de8cd16ec2c22a', 'size': '156299', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '.idea/workspace.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '58651'}]} |
package de.ugoe.cs.cpdp.dataselection;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
import de.ugoe.cs.cpdp.versions.SoftwareVersion;
import weka.core.Attribute;
import weka.core.DenseInstance;
import weka.core.Instances;
public class TurhanFilterTest {
@SuppressWarnings("boxing")
@Test
public void testApply() {
ArrayList<Attribute> attributes = new ArrayList<>();
attributes.add(new Attribute("attr1"));
attributes.add(new Attribute("class"));
Instances testdata = new Instances("test", attributes, 0);
testdata.setClassIndex(1);
testdata.add(new DenseInstance(1.0, new double[]{3.0, 0.0}));
testdata.add(new DenseInstance(1.0, new double[]{6.6, 0.0}));
testdata.add(new DenseInstance(1.0, new double[]{3.1, 0.0}));
Instances traindata = new Instances("train", attributes, 0);
traindata.setClassIndex(1);
traindata.add(new DenseInstance(1.0, new double[]{2.9, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{2.8, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{3.2, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{3.05, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{10.0, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{9.0, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{8.0, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{1.0, 0.0}));
traindata.add(new DenseInstance(1.0, new double[]{5.0, 0.0}));
SoftwareVersion testversion = new SoftwareVersion("foo", "bar", "2.0", testdata, null, null, null, null, null);
SoftwareVersion trainversion = new SoftwareVersion("foo", "bar", "1.0", traindata, null, null, null, null, null);
TurhanFilter filter = new TurhanFilter();
filter.setParameter("2");
SoftwareVersion selectedVersions = filter.apply(testversion, trainversion);
Instances selected = selectedVersions.getInstances();
Set<Double> selectedSet = new HashSet<>();
for( int i=0 ; i<selected.numInstances() ; i++ ) {
selectedSet.add(selected.instance(i).toDoubleArray()[0]);
}
assertTrue(selectedSet.contains(2.9));
assertTrue(selectedSet.contains(3.05));
assertTrue(selectedSet.contains(3.2));
assertTrue(selectedSet.contains(5.0));
assertTrue(selectedSet.contains(8.0));
}
}
| {'content_hash': '7b1aa807925aba7439339c085acecb1a', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 115, 'avg_line_length': 38.19047619047619, 'alnum_prop': 0.6891105569409809, 'repo_name': 'sherbold/CrossPare', 'id': '64959188a90abb08ea5b4f105671dc742e1c53d2', 'size': '2406', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CrossPare/src/test/java/de/ugoe/cs/cpdp/dataselection/TurhanFilterTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '952838'}, {'name': 'TSQL', 'bytes': '1931'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_08) on Fri Feb 16 14:46:02 PST 2007 -->
<TITLE>
org.apache.hadoop.examples (Hadoop 0.11.2 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.hadoop.examples package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../../org/apache/hadoop/examples/package-summary.html" target="classFrame">org.apache.hadoop.examples</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="ExampleDriver.html" title="class in org.apache.hadoop.examples" target="classFrame">ExampleDriver</A>
<BR>
<A HREF="Grep.html" title="class in org.apache.hadoop.examples" target="classFrame">Grep</A>
<BR>
<A HREF="PiEstimator.html" title="class in org.apache.hadoop.examples" target="classFrame">PiEstimator</A>
<BR>
<A HREF="PiEstimator.PiMapper.html" title="class in org.apache.hadoop.examples" target="classFrame">PiEstimator.PiMapper</A>
<BR>
<A HREF="PiEstimator.PiReducer.html" title="class in org.apache.hadoop.examples" target="classFrame">PiEstimator.PiReducer</A>
<BR>
<A HREF="RandomWriter.html" title="class in org.apache.hadoop.examples" target="classFrame">RandomWriter</A>
<BR>
<A HREF="RandomWriter.Map.html" title="class in org.apache.hadoop.examples" target="classFrame">RandomWriter.Map</A>
<BR>
<A HREF="Sort.html" title="class in org.apache.hadoop.examples" target="classFrame">Sort</A>
<BR>
<A HREF="WordCount.html" title="class in org.apache.hadoop.examples" target="classFrame">WordCount</A>
<BR>
<A HREF="WordCount.MapClass.html" title="class in org.apache.hadoop.examples" target="classFrame">WordCount.MapClass</A>
<BR>
<A HREF="WordCount.Reduce.html" title="class in org.apache.hadoop.examples" target="classFrame">WordCount.Reduce</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| {'content_hash': '866aba2362eab122d239ce45e34ae035', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 128, 'avg_line_length': 40.57692307692308, 'alnum_prop': 0.7227488151658767, 'repo_name': 'moreus/hadoop', 'id': '843cd24c9271ecc7ada3e1a68e9ededf9ec2ee60', 'size': '2110', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'hadoop-0.11.2/docs/api/org/apache/hadoop/examples/package-frame.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AspectJ', 'bytes': '31146'}, {'name': 'C', 'bytes': '1067911'}, {'name': 'C++', 'bytes': '521803'}, {'name': 'CSS', 'bytes': '157107'}, {'name': 'Erlang', 'bytes': '232'}, {'name': 'Java', 'bytes': '43984644'}, {'name': 'JavaScript', 'bytes': '87848'}, {'name': 'Perl', 'bytes': '18992'}, {'name': 'Python', 'bytes': '32767'}, {'name': 'Shell', 'bytes': '1369281'}, {'name': 'TeX', 'bytes': '19322'}, {'name': 'XSLT', 'bytes': '185841'}]} |
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Category: tips | Agocs]]></title>
<link href="http://agocs.org/blog/categories/tips/atom.xml" rel="self"/>
<link href="http://agocs.org/"/>
<updated>2016-10-25T11:32:09-05:00</updated>
<id>http://agocs.org/</id>
<author>
<name><![CDATA[Christopher Agocs]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[RabbitMQ best practices in Go]]></title>
<link href="http://agocs.org/blog/2014/08/19/stupid-rabbitmq-tricks/"/>
<updated>2014-08-19T12:57:26-05:00</updated>
<id>http://agocs.org/blog/2014/08/19/stupid-rabbitmq-tricks</id>
<content type="html"><![CDATA[<p>I decided to change the title of this article. Check out:</p>
<p><a href="http://agocs.org/blog/2014/08/19/rabbitmq-best-practices-in-go/">RabbitMQ Best Practices in Go</a></p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Tips for using RabbitMQ in Go]]></title>
<link href="http://agocs.org/blog/2014/08/19/rabbitmq-best-practices-in-go/"/>
<updated>2014-08-19T12:57:26-05:00</updated>
<id>http://agocs.org/blog/2014/08/19/rabbitmq-best-practices-in-go</id>
<content type="html"><![CDATA[<h3>Corrections:</h3>
<ul>
<li>4% != .004% : When I was writing the article, my brain translated 99996 into 96000. Big difference. It turns out that I’m unable to dequeue somewhere between .004% and .20% of messages in about half of test runs.</li>
</ul>
<h3>Note:</h3>
<p><strong>I’ve been chatting with some very helpful RabbitMQ-knowledgeable people, and they have some suggestions for the issues I’m seeing that I’m going to check out. I will update this article with my findings.</strong></p>
<p>I want to thank <a href="https://twitter.com/old_sound">Alvaro Videla</a> and <a href="https://twitter.com/michaelklishin">Michael Klishin</a> for reading my first attempt at this post and suggesting different avenues to explore.</p>
<h2>Introduction</h2>
<p>For the two of you who don’t know, RabbitMQ is a really neat AMQP-compliant queue broker. It exists to facilitate the passing of messages between or within systems. I’ve used it for a couple of different projects, and I’ve found it to be tremendously capable: I’ve seen a RabbitMQ instance running on a single, moderately sized, VM handle almost 3GB/s.</p>
<p>I was doing some load testing with RabbitMQ recently, and I found that, if I started attempting to publish more than around 2500 10KB messages per second, <del>about 4%</del> as much as 0.2% of those messages wouldn’t make it to the queue during some test runs. I am not sure if this is my code’s fault or if I am running into the limits of the RabbitMQ instance I was testing against (probably the former), but with the help of the RabbitMQ community, I was able to come up with some best practices that I’ve described below.</p>
<p>The examples below are all in Go, but I’ve tried my best to explain them in such a way that people who are not familiar with Go can understand them.</p>
<h2>Terminology</h2>
<p>If you’re unfamiliar with AMQP, here’s some terminology to help understand what’s possible with a queue broker and what the words mean.</p>
<ul>
<li><strong>Connection</strong>: A connection is a long-lived TCP connection between an AMQP client and a queue broker. Maintaining a connection reduces TCP overhead. A client can re-use a connection, and can share a connection among threads.</li>
<li><strong>Channel</strong>: A channel is a short-lived sub-connection between a client and a broker. The client can create and dispose of channels without incurring a lot of overhead.</li>
<li><strong>Exchange</strong>: A client writes messages to an exchange. The exchange forwards each message on to zero or more queues based on the message’s routing key.</li>
<li><strong>Queue</strong>: A queue is a first-in, first out holder of messages. A client reads messages from a queue. The client can specify a queue name (useful, for example, for a work queue where multiple clients are consuming from the same queue), or allow the queue broker to assign it a queue name (useful if you want to distribute copies of a message to multiple clients).</li>
<li><strong>Routing Key</strong>: A string (optionally) attached to each message. Depending on the exchange type, the exchange may or may not use the Routing Key to determine the queues to which it should publish the message.</li>
<li><strong>Exchange types</strong>:
<ul>
<li><strong>Direct</strong>: Delivers all messages with the same routing key to the same queue(s).</li>
<li><strong>Fanout</strong>: Ignores the routing key, delivers a copy of the message to each queue bound to it.</li>
<li><strong>Topic</strong>: Each queue subscribes to a topic, which is a regular expression. The exchange delivers the message to a queue if the queue’s subscribed topic matches the message.</li>
<li><strong>Header</strong>: Ignores the routing key and delivers the message based on the AMQP header. Useful for certain kinds of messages.</li>
</ul>
</li>
</ul>
<h2>Testing methodology</h2>
<p>Here is the load tester I wrote: <a href="https://github.com/backstop/rabbit-mq-stress-tester">https://github.com/backstop/rabbit-mq-stress-tester</a>. It uses the <a href="https://github.com/streadway/amqp">streadway/amqp library</a>. Per <a href="https://github.com/streadway/amqp/issues/93">this issue</a>, my stress tester does not share connections or channels between Goroutines — it launches a configurably-sized pool of Goroutines, each of which maintains its own connection to the RabbitMQ server.</p>
<p>To run the same tests I was running:</p>
<ul>
<li><p>Clone the repo or install using <code>go get github.com/backstop/rabbit-mq-stress-tester</code></p></li>
<li><p>Open two terminal windows. In one, run</p>
<pre><code> ./tester -s test-rmq-server -c 100000
</code></pre></li>
</ul>
<p>That will launch the in Consumer mode. It defaults to 50 Goroutines, and will consume 100,000 messages before quitting.</p>
<ul>
<li><p>In the other terminal window, run</p>
<pre><code> ./tester -s test-rmq-server -p 100000 -b 10000 -n 100 -q
</code></pre></li>
</ul>
<p>This will run the tester in Producer mode. It will (-p)roduce 100,000 messages of 10,000 (-b)ytes each. It will launch a pool of 100 Goroutines (-n), and it will work in (-q)uiet mode, only printing NACKs and final statistics to stdout.</p>
<p>What I found is that, roughly half the time I run the above steps, the consumer will only consume 99,000 and change messages (typically greater than 99,980, but occasionally as low as 99,800). I was unable to find any descriptive error messages in the <code>[email protected]</code> file.</p>
<p>I can change that, though. If I run the producer like this:</p>
<pre><code> ./tester -s test-rmq-server -p 100000 -b 10000 -n 100 -q -a
</code></pre>
<p>then each Goroutine waits for an ACK or NACK from the RabbitMQ server before publishing the next message (that’s what the -a flag does). I have never seen a missing message in this mode. The functionality of the -a flag is described in the next section.</p>
<h3>Some things that I don’t think are the culprit:</h3>
<ul>
<li>Memory-based flow control: Memory usage as reported by <code>top</code> never exceeds approximately 22%. Also, no messages in the log file.</li>
<li>Per-connection flow control: After fussing with <code>rabbitmqctl list_connections</code> for a while, I was not able to find evidence of a connection that had been blocked. I’m not sure of these results, though, so if someone would be willing to give me a hand with this, that would be awesome.</li>
</ul>
<h2>Ensuring your message got published</h2>
<p>Like I said earlier, I was doing some stress testing against a RabbitMQ instance and a small number of messages that I attempted to publish did not get dequeued. I reached out to the RabbitMQ community, and someone on their IRC channel told me to look up Confirm Select.</p>
<p>When you place a channel into Confirm Select, the AMQP broker will respond with an ACK with a for each message passed to it on that channel. Included with the ACK is an integer that increments with each ACK, similar to a TCP sequence ID. If something goes wrong, the broker will respond with a NACK. In Go, placing a channel into Confirm Select looks like this:</p>
<p>``` go Putting a channel in Confirm Select</p>
<pre><code>channel, err := connection.Channel()
if err != nil {
println(err.Error())
panic(err.Error())
}
channel.Confirm(false)
ack, nack := channel.NotifyConfirm(make(chan uint64, 1), make(chan uint64, 1))
</code></pre>
<p>```</p>
<p>The above <code>channel.Confirm(false)</code> puts the channel into Confirm mode, and the <code>false</code> puts the client out of NoWait mode such that the client waits for an ACK or NACK after each message. <code>ack</code> and <code>nack</code> are golang <code>chan</code>s that receive the integers included with the ACKs or NACKs. If you were in NoWait mode, you could use them to bulk publish a bunch of messages and then figure out which messages did not make it.</p>
<p>Listening for the ACK looks like this:</p>
<p>``` go Publish a message and wait for confirmation</p>
<pre><code> channel.Publish("", q.Name, true, false, amqp.Publishing{
Headers: amqp.Table{},
ContentType: "text/plain",
ContentEncoding: "UTF-8",
Body: messageJson,
DeliveryMode: amqp.Transient,
Priority: 0,
},
)
select {
case tag := <-ack:
log.Println("Acked ", tag)
case tag := <-nack:
log.Println("Nack alert! ", tag)
}
</code></pre>
<p>```</p>
<p>After each publish, I’m performing a read off of the <code>ack</code> and <code>nack</code> chans (that is what <code>select</code> does). That read blocks until the client gets an ACK or NACK back from the broker.</p>
<p>The above examples are in Go, but there’s an equivalent in the other libraries I’ve played with. Clojure (langohr) has <code>confirm/select</code> and <code>confirm/wait-for-confirms-or-die</code>.</p>
<h3>Can we do better?</h3>
<p>Yes. Rather than wait for an ACK after each publish, it’s better to publish a bunch of messages, listen for ACKs, and then handle failures. I didn’t, because I was already seeing performance several orders of magnitude better than I needed.</p>
<p>We can also wrap blocks of messages in a transaction if we need to ensure that all messages get published and retain order, but doing that incurs something like a 250x performance penalty.</p>
<h2>Pool your Goroutines and avoid race conditions</h2>
<p><a href="https://github.com/streadway/amqp/issues/93">This issue</a> proved interesting (if ultimately not relevant to my problem). It looks like the person who filed the issue was running into two issues:</p>
<ul>
<li>There was a race condition in the code that counted ACKs / NACKs</li>
<li>The one-Goroutine-per-publish strategy causes a condition where the 2000 goroutines waiting for network IO prevent the goroutine listening for ACKs / NACKs from receiving sufficient CPU cycles.</li>
</ul>
<p>I got around this in two ways: I have a fixed-size pool of Goroutines performing the publishing, and each goroutine handles its own Publish –> Ack lifecycle.</p>
<h2>Ensuring messages get handled correctly</h2>
<p>A message queue is of little use if messages just sit there, so it is prudent to include a consumer or two. But, what happens if your consumer crashes? Does your message get lost in the ether?</p>
<p>The answer is <strong>AutoAck</strong>. More specifically, realizing that AutoAck is dangerous and wrong.</p>
<p>When a consumer consumes a message from a queue, the queue broker waits for an ACK before discarding the message. When a consumer has AutoAck enabled, it sends the ACK (thus causing the message to be discarded) instantly upon receiving the message. It’s smarter to read the next message on the queue, handle the message properly, and then send the ACK.</p>
<p>```go Reading and acknowledging messages</p>
<pre><code>autoAck := false
msgs, err := channel.Consume(q.Name, "", autoAck, false, false, false, nil)
if err != nil {
panic(err)
}
for d := range msgs { // the d stands for Delivery
log.Printf(string(d.Body[:])) // or whatever you want to do with the message
d.Ack(false)
}
</code></pre>
<p>```</p>
<p>In the example above, <code>autoAck</code> is set to false. Every time I read a message (in the <code>for d := range msgs</code> loop), I send an ACK for that message. If I were to call <code>d.Ack(true)</code>, that would send an ACK for that message and all previous unacknowledged messages.</p>
<p>If my consumer quits without acknowledging a message, that message is repeated to the next consumer to come by.</p>
<h2>Performant results</h2>
<p>So, what kind of performance am I getting?</p>
<p>The following numbers are all time to publish and consume 100,000 messages, each with a 10KB payload. The tester was running on my Macbook, and RabbitMQ was running on a Cloudstack VM.</p>
<ul>
<li>With Confirm Select
<ul>
<li>Publishing: 24.42s</li>
<li>Consuming: 26.79s</li>
</ul>
</li>
<li>Without Confirm Select
<ul>
<li>Publishing: 16.32s</li>
<li>Consuming: 26.13s</li>
</ul>
</li>
</ul>
<p>The point is, RabbitMQ is fast and Go is fast. When we use one to stress test the other, messages get lost somewhere. If we take a little bit of time to ensure that messages get published and processed properly, we can prevent pesky data loss issues.</p>
]]></content>
</entry>
</feed>
| {'content_hash': '21bde35ba6f5e1fb69dee7d9f0bc84a5', 'timestamp': '', 'source': 'github', 'line_count': 244, 'max_line_length': 551, 'avg_line_length': 57.1844262295082, 'alnum_prop': 0.7283021572421702, 'repo_name': 'agocs/agocs.org', 'id': '3ffae3d6d2e6acdb897858e6fcd998e5777f2afa', 'size': '13953', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'public/blog/categories/tips/atom.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '237'}, {'name': 'CSS', 'bytes': '1219163'}, {'name': 'HTML', 'bytes': '2984494'}, {'name': 'JavaScript', 'bytes': '2069921'}, {'name': 'PHP', 'bytes': '9401949'}, {'name': 'Ruby', 'bytes': '97271'}, {'name': 'Smarty', 'bytes': '33'}]} |
package cct.gamess;
import java.util.HashMap;
import java.util.Map;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: ANU</p>
*
* @author Dr. V. Vasilyev
* @version 1.0
*/
public class GamessSwitch {
boolean anyValue = false;
String name;
String description;
String defaultValue = null;
Map values = new HashMap();
Object variableType = null;
public GamessSwitch(String _name, String _description) {
name = _name;
description = _description;
}
public GamessSwitch(String _name, String _description, boolean _anyValue) {
name = _name;
description = _description;
anyValue = _anyValue;
}
public void setType(Object type) {
variableType = type;
}
public void addValue(String value, String _description) {
values.put(value, _description);
}
public void addValue(String value, String _description, boolean isDefault) {
values.put(value, _description);
if (isDefault) {
defaultValue = value;
}
}
public boolean isValidValue(String value) {
// --- first, check value validity
if (variableType != null) {
try {
if (variableType instanceof Boolean) {
Boolean b = (Boolean) variableType;
b = Boolean.parseBoolean(value);
return true;
}
else if (variableType instanceof Integer) {
float num = Float.parseFloat(value);
Integer i = (Integer) variableType;
i = (int) num;
//Integer.parseInt(value);
return true;
}
else if (variableType instanceof Float) {
Float f = (Float) variableType;
f = Float.parseFloat(value);
return true;
}
else if (variableType instanceof Double) {
Double d = (Double) variableType;
d = Double.parseDouble(value);
return true;
}
else if (variableType instanceof Long) {
Long l = (Long) variableType;
l = Long.parseLong(value);
return true;
}
}
catch (Exception ex) {
return false;
}
}
// --- Check "any value"
if (anyValue) {
return true;
}
// Is it in the list
return values.containsKey( value );
}
public String getName() {
return name;
}
}
| {'content_hash': '47c1202950a28da53401e9e91bef3cbd', 'timestamp': '', 'source': 'github', 'line_count': 108, 'max_line_length': 78, 'avg_line_length': 21.75, 'alnum_prop': 0.5836526181353767, 'repo_name': 'SciGaP/seagrid-rich-client', 'id': '8f26e6734c12b4cd565df342e91e3488ba9c9eba', 'size': '4051', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/cct/gamess/GamessSwitch.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1749'}, {'name': 'HTML', 'bytes': '23412'}, {'name': 'Java', 'bytes': '9601414'}, {'name': 'Shell', 'bytes': '3612'}]} |
using System;
using System.ComponentModel;
using System.Management.Automation;
using Pscx.TerminalServices;
namespace Pscx.Commands.TerminalServices
{
[Cmdlet(VerbsLifecycle.Stop, PscxNouns.TerminalSession, ConfirmImpact = ConfirmImpact.High, SupportsShouldProcess = true)]
[Description("Logs off a specific remote desktop session on a system running Terminal Services/Remote Desktop")]
public class StopTerminalSessionCommand : TerminalSessionCommandBase
{
private SwitchParameter _force;
[Parameter]
public SwitchParameter Force
{
get { return _force; }
set { _force = value; }
}
protected override void ProcessSession(TerminalSession session)
{
if (_force.IsPresent || ShouldContinue("Logoff the session " + session.Id + "?", CmdletName))
{
session.Logoff(ShouldWait);
}
}
}
} | {'content_hash': '5177f31c3f45f3844581b052b3f0693d', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 126, 'avg_line_length': 30.483870967741936, 'alnum_prop': 0.6571428571428571, 'repo_name': 'Pscx/Pscx', 'id': 'a658ff319909d92010dad4c3ae36ffaf16a734c3', 'size': '1190', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Src/Pscx/Commands/TerminalServices/StopTerminalSessionCommand.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1278940'}, {'name': 'PowerShell', 'bytes': '223216'}, {'name': 'Roff', 'bytes': '89696'}, {'name': 'XSLT', 'bytes': '8711'}]} |
/*
var lib = require('../src/index.js')
var assert = require('assert');
describe('Array', function() {
describe('#indexOf()', function() {
it('should return -1 when the value is not present', function() {
assert.equal(-1, [1,2,3].indexOf(4));
});
});
});
*/ | {'content_hash': '86fde767f8e1ffb29f77422678241290', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 69, 'avg_line_length': 21.307692307692307, 'alnum_prop': 0.5740072202166066, 'repo_name': 'tkiraly/fc-monitor', 'id': '6b6f5f5cc33813c88b54f04bb76e0b501a5390dc', 'size': '277', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/send_mod_log_test.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '37297'}]} |
function Client_PresentConfigureUI(rootParent)
rootParentobj = rootParent;
AIDeclerationinit = Mod.Settings.AllowAIDeclaration;
if(AIDeclerationinit == nil)then
AIDeclerationinit = true;
end
SeeAllyTerritoriesinit = Mod.Settings.SeeAllyTerritories;
if(SeeAllyTerritoriesinit == nil)then
SeeAllyTerritoriesinit = true;
end
PublicAlliesinit = Mod.Settings.PublicAllies;
if(PublicAlliesinit == nil)then
PublicAlliesinit = true;
end
StartMoneyinit = Mod.Settings.StartMoney;
if(StartMoneyinit == nil)then
StartMoneyinit = 100;
end
AIsdeclearAIsinit = Mod.Settings.AIsdeclearAIs;
if(AIsdeclearAIsinit == nil)then
AIsdeclearAIsinit = true;
end
MoneyPerTurninit = Mod.Settings.MoneyPerTurn;
if(MoneyPerTurninit == nil)then
MoneyPerTurninit = 5;
end
MoneyPerKilledArmyinit = Mod.Settings.MoneyPerKilledArmy;
if(MoneyPerKilledArmyinit == nil)then
MoneyPerKilledArmyinit = 1;
end
MoneyPerCapturedTerritoryinit = Mod.Settings.MoneyPerCapturedTerritory;
if(MoneyPerCapturedTerritoryinit == nil)then
MoneyPerCapturedTerritoryinit = 5;
end
MoneyPerCapturedBonusinit = Mod.Settings.MoneyPerCapturedBonus;
if(MoneyPerCapturedBonusinit == nil)then
MoneyPerCapturedBonusinit = 10;
end
SanctionCardRequireWarinit = Mod.Settings.SanctionCardRequireWar;
if(SanctionCardRequireWarinit == nil)then
SanctionCardRequireWarinit = true;
end
SanctionCardRequirePeaceinit = Mod.Settings.SanctionCardRequirePeace;
if(SanctionCardRequirePeaceinit == nil)then
SanctionCardRequirePeaceinit = false;
end
SanctionCardRequireAllyinit = Mod.Settings.SanctionCardRequireAlly;
if(SanctionCardRequireAllyinit == nil)then
SanctionCardRequireAllyinit = false;
end
BombCardRequireWarinit = Mod.Settings.BombCardRequireWar;
if(BombCardRequireWarinit == nil)then
BombCardRequireWarinit = true;
end
BombCardRequirePeaceinit = Mod.Settings.BombCardRequirePeace;
if(BombCardRequirePeaceinit == nil)then
BombCardRequirePeaceinit = false;
end
BombCardRequireAllyinit = Mod.Settings.BombCardRequireAlly;
if(BombCardRequireAllyinit == nil)then
BombCardRequireAllyinit = false;
end
SpyCardRequireWarinit = Mod.Settings.SpyCardRequireWar;
if(SpyCardRequireWarinit == nil)then
SpyCardRequireWarinit = true;
end
SpyCardRequirePeaceinit = Mod.Settings.SpyCardRequirePeace;
if(SpyCardRequirePeaceinit == nil)then
SpyCardRequirePeaceinit = false;
end
SpyCardRequireAllyinit = Mod.Settings.SpyCardRequireAlly;
if(SpyCardRequireAllyinit == nil)then
SpyCardRequireAllyinit = false;
end
GiftCardRequireWarinit = Mod.Settings.GiftCardRequireWar;
if(GiftCardRequireWarinit == nil)then
GiftCardRequireWarinit = false;
end
GiftCardRequirePeaceinit = Mod.Settings.GiftCardRequirePeace;
if(GiftCardRequirePeaceinit == nil)then
GiftCardRequirePeaceinit = false;
end
GiftCardRequireAllyinit = Mod.Settings.GiftCardRequireAlly;
if(GiftCardRequireAllyinit == nil)then
GiftCardRequireAllyinit = true;
end
MoneyPerBoughtArmyinit = Mod.Settings.MoneyPerBoughtArmy;
if(MoneyPerBoughtArmyinit == nil)then
MoneyPerBoughtArmyinit = 2;
end
Adminaccessinit = Mod.Settings.AdminAccess;
if(Adminaccessinit == nil)then
Adminaccessinit = true;
end
Startwarsinit = Mod.Settings.StartWar;
if(Startwarsinit == nil)then
Startwarsinit = ",";
end
ShowUI();
end
function ShowUI()
hotzlist = {};
hotzlist[0] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[0]).SetText('AI Settings');
hotzlist[1] = UI.CreateHorizontalLayoutGroup(rootParentobj);
AIDeclerationcheckbox = UI.CreateCheckBox(hotzlist[1]).SetText('Allow AIs to declare war on Player').SetIsChecked(AIDeclerationinit);
hotzlist[2] = UI.CreateHorizontalLayoutGroup(rootParentobj);
AIsdeclearAIsinitcheckbox = UI.CreateCheckBox(hotzlist[2]).SetText('Allow AIs to declare war on AIs').SetIsChecked(AIsdeclearAIsinit);
hotzlist[3] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[3]).SetText(' ');
hotzlist[4] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[4]).SetText('Allianze Settings - this system will come in a later version, but that would be a bigger change, I added the settings for that already');
hotzlist[5] = UI.CreateHorizontalLayoutGroup(rootParentobj);
SeeAllyTerritoriesCheckbox = UI.CreateCheckBox(hotzlist[5]).SetText('Allow Players to see the territories of their allies').SetIsChecked(SeeAllyTerritoriesinit);
hotzlist[6] = UI.CreateHorizontalLayoutGroup(rootParentobj);
PublicAlliesCheckbox = UI.CreateCheckBox(hotzlist[6]).SetText('Allow everyone to see every ally').SetIsChecked(PublicAlliesinit);
hotzlist[7] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[7]).SetText(' ');
hotzlist[8] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[8]).SetText('Shop System');
hotzlist[9] = UI.CreateHorizontalLayoutGroup(rootParentobj);
if(StartMoneyinit == 0 and MoneyPerTurninit == 0 and MoneyPerKilledArmyinit == 0 and MoneyPerCapturedTerritoryinit == 0 and MoneyPerCapturedBonusinit == 0)then
UI.CreateButton(hotzlist[9]).SetText('Activate Shop').SetOnClick(function()
StartMoneyinit = 100;
MoneyPerTurninit = 5;
MoneyPerKilledArmyinit = 1;
MoneyPerCapturedTerritoryinit = 5;
MoneyPerCapturedBonusinit = 10;
ReloadUI();
end);
else
UI.CreateButton(hotzlist[9]).SetText('Disable Shop').SetOnClick(function()
StartMoneyinit = 0;
MoneyPerTurninit = 0;
MoneyPerKilledArmyinit = 0;
MoneyPerCapturedTerritoryinit = 0;
MoneyPerCapturedBonusinit = 0;
inputStartMoney = nil;
inputMoneyPerTurn = nil;
inputMoneyPerKilledArmy = nil;
inputMoneyPerCapturedTerritory = nil;
inputMoneyPerCapturedBonus = nil;
inputMoneyPerBoughtArmy = nil;
ReloadUI();
end);
hotzlist[11] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[11]).SetText('Starting Money');
inputStartMoney = UI.CreateNumberInputField(hotzlist[11]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(StartMoneyinit);
hotzlist[12] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[12]).SetText('Money per turn');
inputMoneyPerTurn = UI.CreateNumberInputField(hotzlist[12]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(MoneyPerTurninit);
hotzlist[13] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[13]).SetText('Money per killed army');
inputMoneyPerKilledArmy = UI.CreateNumberInputField(hotzlist[13]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(MoneyPerKilledArmyinit);
hotzlist[14] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[14]).SetText('Money per captured territory');
inputMoneyPerCapturedTerritory = UI.CreateNumberInputField(hotzlist[14]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(MoneyPerCapturedTerritoryinit);
hotzlist[15] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[15]).SetText('Money per captured bonus');
inputMoneyPerCapturedBonus = UI.CreateNumberInputField(hotzlist[15]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(MoneyPerCapturedBonusinit);
hotzlist[16] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[16]).SetText('Price per army');
inputMoneyPerBoughtArmy = UI.CreateNumberInputField(hotzlist[16]).SetSliderMinValue(0).SetSliderMaxValue(100).SetValue(MoneyPerBoughtArmyinit);
end
hotzlist[17] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[17]).SetText(' ');
hotzlist[18] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[18]).SetText('Card Settings');
hotzlist[19] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[19]).SetText('Sanction Card');
hotzlist[20] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSanctionCardRequireWar = UI.CreateCheckBox(hotzlist[20]).SetText('Sanction Cards can be played on enemy').SetIsChecked(SanctionCardRequireWarinit);
hotzlist[21] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSanctionCardRequirePeace = UI.CreateCheckBox(hotzlist[21]).SetText('Sanction Cards can be played on players you are in peace with').SetIsChecked(SanctionCardRequirePeaceinit);
hotzlist[22] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSanctionCardRequireAlly = UI.CreateCheckBox(hotzlist[22]).SetText('Sanction Cards can be played on ally').SetIsChecked(SanctionCardRequireAllyinit);
hotzlist[23] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[23]).SetText(' ');
hotzlist[24] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[24]).SetText('Bomb Card');
hotzlist[25] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputBombCardRequireWar = UI.CreateCheckBox(hotzlist[25]).SetText('Bomb Cards can be played on enemy').SetIsChecked(BombCardRequireWarinit);
hotzlist[26] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputBombCardRequirePeace = UI.CreateCheckBox(hotzlist[26]).SetText('Bomb Cards can be played on players you are in peace with').SetIsChecked(BombCardRequirePeaceinit);
hotzlist[27] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputBombCardRequireAlly = UI.CreateCheckBox(hotzlist[27]).SetText('Bomb Cards can be played on ally').SetIsChecked(BombCardRequireAllyinit);
hotzlist[28] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[28]).SetText(' ');
hotzlist[32] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[32]).SetText('Spy Card');
hotzlist[33] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSpyCardRequireWar = UI.CreateCheckBox(hotzlist[33]).SetText('Spy Cards can be played on enemy').SetIsChecked(SpyCardRequireWarinit);
hotzlist[34] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSpyCardRequirePeace = UI.CreateCheckBox(hotzlist[34]).SetText('Spy Cards can be played on players you are in peace with').SetIsChecked(SpyCardRequirePeaceinit);
hotzlist[35] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputSpyCardRequireAlly = UI.CreateCheckBox(hotzlist[35]).SetText('Spy Cards can be played on ally').SetIsChecked(SpyCardRequireAllyinit);
hotzlist[36] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[36]).SetText(' ');
hotzlist[37] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[37]).SetText('Gift Card');
hotzlist[39] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputGiftCardRequireWar = UI.CreateCheckBox(hotzlist[39]).SetText('Gift Cards can be played on enemy').SetIsChecked(GiftCardRequireWarinit);
hotzlist[40] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputGiftCardRequirePeace = UI.CreateCheckBox(hotzlist[40]).SetText('Gift Cards can be played on players you are in peace with').SetIsChecked(GiftCardRequirePeaceinit);
hotzlist[41] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputGiftCardRequireAlly = UI.CreateCheckBox(hotzlist[41]).SetText('Gift Cards can be played on ally').SetIsChecked(GiftCardRequireAllyinit);
hotzlist[42] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[42]).SetText(' ');
hotzlist[43] = UI.CreateHorizontalLayoutGroup(rootParentobj);
UI.CreateLabel(hotzlist[43]).SetText('Other Settings');
hotzlist[44] = UI.CreateHorizontalLayoutGroup(rootParentobj);
inputAdminaccess = UI.CreateCheckBox(hotzlist[44]).SetText('Allow dabo1 to access and edit all data to identify and fix bugs runtime andfor other diagnostic functions').SetIsChecked(Adminaccessinit);
end
function DeleteUI()
for _,horizont in pairs(hotzlist) do
UI.Destroy(horizont);
end
end
function ReloadUI()
Save();
DeleteUI();
ShowUI();
end
function Save()
AIDeclerationinit = AIDeclerationcheckbox.GetIsChecked();
AIsdeclearAIsinit = AIsdeclearAIsinitcheckbox.GetIsChecked();
SeeAllyTerritoriesinit = SeeAllyTerritoriesCheckbox.GetIsChecked();
PublicAlliesinit = PublicAlliesCheckbox.GetIsChecked();
if(StartMoneyinit ~= 0 or MoneyPerTurninit ~= 0 or MoneyPerKilledArmyinit ~= 0 or MoneyPerCapturedTerritoryinit ~= 0 or MoneyPerCapturedBonusinit ~= 0)then
if(inputStartMoney ~= nil)then
StartMoneyinit = inputStartMoney.GetValue();
MoneyPerTurninit = inputMoneyPerTurn.GetValue();
MoneyPerKilledArmyinit = inputMoneyPerKilledArmy.GetValue();
MoneyPerCapturedTerritoryinit = inputMoneyPerCapturedTerritory.GetValue();
MoneyPerCapturedBonusinit = inputMoneyPerCapturedBonus.GetValue();
MoneyPerBoughtArmyinit = inputMoneyPerBoughtArmy.GetValue();
end
end
SanctionCardRequireWarinit = inputSanctionCardRequireWar.GetIsChecked();
SanctionCardRequirePeaceinit = inputSanctionCardRequirePeace.GetIsChecked();
SanctionCardRequireAllyinit = inputSanctionCardRequireAlly.GetIsChecked();
BombCardRequireWarinit = inputBombCardRequireWar.GetIsChecked();
BombCardRequirePeaceinit = inputBombCardRequirePeace.GetIsChecked();
BombCardRequireAllyinit = inputBombCardRequireAlly.GetIsChecked();
SpyCardRequireWarinit = inputSpyCardRequireWar.GetIsChecked();
SpyCardRequirePeaceinit = inputSpyCardRequirePeace.GetIsChecked();
SpyCardRequireAllyinit = inputSpyCardRequireAlly.GetIsChecked();
GiftCardRequireWarinit = inputGiftCardRequireWar.GetIsChecked();
GiftCardRequirePeaceinit = inputGiftCardRequirePeace.GetIsChecked();
GiftCardRequireAllyinit = inputGiftCardRequireAlly.GetIsChecked();
Adminaccessinit = inputAdminaccess.GetIsChecked();
end
| {'content_hash': 'a04363ee0a9f4febb68d1416b17a4ef8', 'timestamp': '', 'source': 'github', 'line_count': 253, 'max_line_length': 200, 'avg_line_length': 53.88932806324111, 'alnum_prop': 0.7940443010121755, 'repo_name': 'dabo123148/WarlightMod', 'id': '94e9ec34768f0c31fa76984b1362ae9d13748ac1', 'size': '13634', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SimpleDiploMod/Client_PresentConfigureUI.lua', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Lua', 'bytes': '691963'}]} |
var EventManager = new (function()
{
var eventPile = {};
var addEventListener = function(eventId, callback)
{
if (!eventPile[eventId])
{
eventPile[eventId] = [];
}
eventPile[eventId].push(callback);
};
var emit = function(eventId, data)
{
if (eventPile[eventId])
{
for (var i = 0; i < eventPile[eventId].length; ++i)
{
(function()
{
var index = i;
setTimeout(function()
{
eventPile[eventId][index](data);
}, 0);
})();
}
}
};
this.makeEventAware = function(element)
{
if (typeof element === 'function')
{
// Class constructor
element.prototype.addEventListener = addEventListener;
element.prototype.emit = emit;
}
else
{
// Object
element.addEventListener = addEventListener;
element.emit = emit;
}
}
})();
| {'content_hash': 'df655148ff455de73f293e12576f7904', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 66, 'avg_line_length': 22.0188679245283, 'alnum_prop': 0.41730934018851756, 'repo_name': 'TriviaMarketing/EventManager', 'id': '939e539adf625fcc562261cd8e950d98df018de6', 'size': '1167', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'event-manager.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '2517'}, {'name': 'JavaScript', 'bytes': '1167'}]} |
package com.fruit.dao.management;
import com.fruit.base.DaoSupport;
import com.fruit.entity.management.Variety;
/**
*
* @author CSH
*
*/
public interface VarietyDao extends DaoSupport<Variety>{
String DAO_NAME="com.fruit.dao.impl.VarietyDaoImpl";
}
| {'content_hash': 'c181ee68bfbbb09f2a9be062492b6f0d', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 56, 'avg_line_length': 16.4375, 'alnum_prop': 0.7338403041825095, 'repo_name': 'tanliu/fruit', 'id': '922cd3142c4b524588d3b81850d1aabf8e341c51', 'size': '263', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'fruit-core/src/main/java/com/fruit/dao/management/VarietyDao.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '392896'}, {'name': 'HTML', 'bytes': '1981497'}, {'name': 'Java', 'bytes': '604413'}, {'name': 'JavaScript', 'bytes': '11560981'}, {'name': 'PowerShell', 'bytes': '468'}, {'name': 'Shell', 'bytes': '292'}]} |
<?php
namespace Skillberto\ConsoleExtendBundle;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Application;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class SkillbertoConsoleExtendBundle extends Bundle
{
public function getParent()
{
return 'FrameworkBundle';
}
public function registerCommands(Application $application)
{
parent::registerCommands($application);
//include Doctrine ORM commands if exist
if (class_exists('Doctrine\\ORM\\Version')) {
ConsoleRunner::addCommands($application);
}
}
}
| {'content_hash': '9f5ce5a1300abb0b10d60edd4cd9f411', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 62, 'avg_line_length': 24.52, 'alnum_prop': 0.7063621533442088, 'repo_name': 'skillberto/ConsoleExtendBundle', 'id': '65ec5cd963f201ccff143411396c2cb5d644589c', 'size': '613', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SkillbertoConsoleExtendBundle.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '8805'}]} |
/**
* This file tests basic authorization for different roles in stand alone and sharded
* environment. This file covers all types of operations except commands.
*/
/**
* Data structure that contains all the users that are going to be used in the tests.
* The structure is as follows:
* 1st level field name: database names.
* 2nd level field name: user names.
* 3rd level is an object that has the format:
* { pwd: <password>, roles: [<list of roles>] }
*/
var AUTH_INFO = {
admin: {
root: {pwd: 'root', roles: ['root']},
cluster: {pwd: 'cluster', roles: ['clusterAdmin']},
anone: {pwd: 'none', roles: []},
aro: {pwd: 'ro', roles: ['read']},
arw: {pwd: 'rw', roles: ['readWrite']},
aadmin: {pwd: 'admin', roles: ['dbAdmin']},
auadmin: {pwd: 'uadmin', roles: ['userAdmin']},
any_ro: {pwd: 'ro', roles: ['readAnyDatabase']},
any_rw: {pwd: 'rw', roles: ['readWriteAnyDatabase']},
any_admin: {pwd: 'admin', roles: ['dbAdminAnyDatabase']},
any_uadmin: {pwd: 'uadmin', roles: ['userAdminAnyDatabase']}
},
test: {
none: {pwd: 'none', roles: []},
ro: {pwd: 'ro', roles: ['read']},
rw: {pwd: 'rw', roles: ['readWrite']},
roadmin: {pwd: 'roadmin', roles: ['read', 'dbAdmin']},
admin: {pwd: 'admin', roles: ['dbAdmin']},
uadmin: {pwd: 'uadmin', roles: ['userAdmin']}
}
};
// Constants that lists the privileges of a given role.
var READ_PERM = {query: 1, index_r: 1, killCursor: 1};
var READ_WRITE_PERM =
{insert: 1, update: 1, remove: 1, query: 1, index_r: 1, index_w: 1, killCursor: 1};
var ADMIN_PERM = {index_r: 1, index_w: 1, profile_r: 1};
var UADMIN_PERM = {user_r: 1, user_w: 1};
var CLUSTER_PERM = {killOp: 1, currentOp: 1, fsync_unlock: 1, killCursor: 1, profile_r: 1};
/**
* Checks whether an error occurs after running an operation.
*
* @param shouldPass {Boolean} true means that the operation should succeed.
* @param opFunc {function()} a function object which contains the operation to perform.
*/
var checkErr = function(shouldPass, opFunc) {
var success = true;
var exception = null;
try {
opFunc();
} catch (x) {
exception = x;
success = false;
}
assert(success == shouldPass,
'expected shouldPass: ' + shouldPass + ', got: ' + success + ', op: ' + tojson(opFunc) +
', exception: ' + tojson(exception));
};
/**
* Runs a series of operations against the db provided.
*
* @param db {DB} the database object to use.
* @param allowedActions {Object} the lists of operations that are allowed for the
* current user. The data structure is represented as a map with the presence of
* a field name means that the operation is allowed and not allowed if it is
* not present. The list of field names are: insert, update, remove, query, killOp,
* currentOp, index_r, index_w, profile_r, profile_w, user_r, user_w, killCursor,
* fsync_unlock.
*/
var testOps = function(db, allowedActions) {
checkErr(allowedActions.hasOwnProperty('insert'), function() {
var res = db.user.insert({y: 1});
if (res.hasWriteError())
throw Error("insert failed: " + tojson(res.getRawResponse()));
});
checkErr(allowedActions.hasOwnProperty('update'), function() {
var res = db.user.update({y: 1}, {z: 3});
if (res.hasWriteError())
throw Error("update failed: " + tojson(res.getRawResponse()));
});
checkErr(allowedActions.hasOwnProperty('remove'), function() {
var res = db.user.remove({y: 1});
if (res.hasWriteError())
throw Error("remove failed: " + tojson(res.getRawResponse()));
});
checkErr(allowedActions.hasOwnProperty('query'), function() {
db.user.findOne({y: 1});
});
checkErr(allowedActions.hasOwnProperty('killOp'), function() {
var errorCodeUnauthorized = 13;
var res = db.killOp(1);
if (res.code == errorCodeUnauthorized) {
throw Error("unauthorized killOp");
}
});
checkErr(allowedActions.hasOwnProperty('currentOp'), function() {
var errorCodeUnauthorized = 13;
var res = db.currentOp();
if (res.code == errorCodeUnauthorized) {
throw Error("unauthorized currentOp");
}
});
checkErr(allowedActions.hasOwnProperty('index_r'), function() {
db.system.indexes.findOne();
});
checkErr(allowedActions.hasOwnProperty('index_w'), function() {
var res = db.user.ensureIndex({x: 1});
if (res.code == 13) { // Unauthorized
throw Error("unauthorized currentOp");
}
});
checkErr(allowedActions.hasOwnProperty('profile_r'), function() {
db.system.profile.findOne();
});
checkErr(allowedActions.hasOwnProperty('profile_w'), function() {
var res = db.system.profile.insert({x: 1});
if (res.hasWriteError()) {
throw Error("profile insert failed: " + tojson(res.getRawResponse()));
}
});
checkErr(allowedActions.hasOwnProperty('user_r'), function() {
var result = db.runCommand({usersInfo: 1});
if (!result.ok) {
throw new Error(tojson(result));
}
});
checkErr(allowedActions.hasOwnProperty('user_w'), function() {
db.createUser({user: 'a', pwd: 'a', roles: jsTest.basicUserRoles});
assert(db.dropUser('a'));
});
// Test for kill cursor
(function() {
var newConn = new Mongo(db.getMongo().host);
var dbName = db.getName();
var db2 = newConn.getDB(dbName);
if (db2 == 'admin') {
assert.eq(1, db2.auth('aro', AUTH_INFO.admin.aro.pwd));
} else {
assert.eq(1, db2.auth('ro', AUTH_INFO.test.ro.pwd));
}
var cursor = db2.kill_cursor.find().batchSize(2);
db.killCursor(cursor.id());
// Send a synchronous message to make sure that kill cursor was processed
// before proceeding.
db.runCommand({whatsmyuri: 1});
checkErr(!allowedActions.hasOwnProperty('killCursor'), function() {
while (cursor.hasNext()) {
var next = cursor.next();
// This is a failure in mongos case. Standalone case will fail
// when next() was called.
if (next.code == 16336) {
// could not find cursor in cache for id
throw next.$err;
}
}
});
}); // TODO: enable test after SERVER-5813 is fixed.
var isMongos = db.runCommand({isdbgrid: 1}).isdbgrid;
// Note: fsyncUnlock is not supported in mongos.
if (!isMongos) {
checkErr(allowedActions.hasOwnProperty('fsync_unlock'), function() {
var res = db.fsyncUnlock();
var errorCodeUnauthorized = 13;
if (res.code == errorCodeUnauthorized) {
throw Error("unauthorized unauthorized fsyncUnlock");
}
});
}
};
// List of tests to run. Has the format:
//
// {
// name: {String} description of the test
// test: {function(Mongo)} the test function to run which accepts a Mongo connection
// object.
// }
var TESTS = [
{
name: 'Test multiple user login separate connection',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('ro', AUTH_INFO.test.ro.pwd));
var conn2 = new Mongo(conn.host);
var testDB2 = conn2.getDB('test');
assert.eq(1, testDB2.auth('uadmin', AUTH_INFO.test.uadmin.pwd));
testOps(testDB, READ_PERM);
testOps(testDB2, UADMIN_PERM);
}
},
{
name: 'Test user with no role',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('none', AUTH_INFO.test.none.pwd));
testOps(testDB, {});
}
},
{
name: 'Test read only user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('ro', AUTH_INFO.test.ro.pwd));
testOps(testDB, READ_PERM);
}
},
{
name: 'Test read/write user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('rw', AUTH_INFO.test.rw.pwd));
testOps(testDB, READ_WRITE_PERM);
}
},
{
name: 'Test read + dbAdmin user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('roadmin', AUTH_INFO.test.roadmin.pwd));
var combinedPerm = Object.extend({}, READ_PERM);
combinedPerm = Object.extend(combinedPerm, ADMIN_PERM);
testOps(testDB, combinedPerm);
}
},
{
name: 'Test dbAdmin user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('admin', AUTH_INFO.test.admin.pwd));
testOps(testDB, ADMIN_PERM);
}
},
{
name: 'Test userAdmin user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('uadmin', AUTH_INFO.test.uadmin.pwd));
testOps(testDB, UADMIN_PERM);
}
},
{
name: 'Test cluster user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('cluster', AUTH_INFO.admin.cluster.pwd));
testOps(conn.getDB('test'), CLUSTER_PERM);
}
},
{
name: 'Test admin user with no role',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('anone', AUTH_INFO.admin.anone.pwd));
testOps(adminDB, {});
testOps(conn.getDB('test'), {});
}
},
{
name: 'Test read only admin user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('aro', AUTH_INFO.admin.aro.pwd));
testOps(adminDB, READ_PERM);
testOps(conn.getDB('test'), {});
}
},
{
name: 'Test read/write admin user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('arw', AUTH_INFO.admin.arw.pwd));
testOps(adminDB, READ_WRITE_PERM);
testOps(conn.getDB('test'), {});
}
},
{
name: 'Test dbAdmin admin user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('aadmin', AUTH_INFO.admin.aadmin.pwd));
testOps(adminDB, ADMIN_PERM);
testOps(conn.getDB('test'), {});
}
},
{
name: 'Test userAdmin admin user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('auadmin', AUTH_INFO.admin.auadmin.pwd));
testOps(adminDB, UADMIN_PERM);
testOps(conn.getDB('test'), {});
}
},
{
name: 'Test read only any db user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('any_ro', AUTH_INFO.admin.any_ro.pwd));
testOps(adminDB, READ_PERM);
testOps(conn.getDB('test'), READ_PERM);
}
},
{
name: 'Test read/write any db user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('any_rw', AUTH_INFO.admin.any_rw.pwd));
testOps(adminDB, READ_WRITE_PERM);
testOps(conn.getDB('test'), READ_WRITE_PERM);
}
},
{
name: 'Test dbAdmin any db user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('any_admin', AUTH_INFO.admin.any_admin.pwd));
testOps(adminDB, ADMIN_PERM);
testOps(conn.getDB('test'), ADMIN_PERM);
}
},
{
name: 'Test userAdmin any db user',
test: function(conn) {
var adminDB = conn.getDB('admin');
assert.eq(1, adminDB.auth('any_uadmin', AUTH_INFO.admin.any_uadmin.pwd));
testOps(adminDB, UADMIN_PERM);
testOps(conn.getDB('test'), UADMIN_PERM);
}
},
{
name: 'Test change role',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('rw', AUTH_INFO.test.rw.pwd));
var newConn = new Mongo(conn.host);
assert.eq(1, newConn.getDB('admin').auth('any_uadmin', AUTH_INFO.admin.any_uadmin.pwd));
newConn.getDB('test').updateUser('rw', {roles: ['read']});
var origSpec = newConn.getDB("test").getUser("rw");
// role change should affect users already authenticated.
testOps(testDB, READ_PERM);
// role change should affect active connections.
testDB.runCommand({logout: 1});
assert.eq(1, testDB.auth('rw', AUTH_INFO.test.rw.pwd));
testOps(testDB, READ_PERM);
// role change should also affect new connections.
var newConn3 = new Mongo(conn.host);
var testDB3 = newConn3.getDB('test');
assert.eq(1, testDB3.auth('rw', AUTH_INFO.test.rw.pwd));
testOps(testDB3, READ_PERM);
newConn.getDB('test').updateUser('rw', {roles: origSpec.roles});
}
},
{
name: 'Test override user',
test: function(conn) {
var testDB = conn.getDB('test');
assert.eq(1, testDB.auth('rw', AUTH_INFO.test.rw.pwd));
assert.eq(1, testDB.auth('ro', AUTH_INFO.test.ro.pwd));
testOps(testDB, READ_PERM);
testDB.runCommand({logout: 1});
testOps(testDB, {});
}
}
];
/**
* Driver method for setting up the test environment, running them, cleanup
* after every test and keeping track of test failures.
*
* @param conn {Mongo} a connection to a mongod or mongos to test.
*/
var runTests = function(conn) {
var setup = function() {
var testDB = conn.getDB('test');
var adminDB = conn.getDB('admin');
adminDB.createUser(
{user: 'root', pwd: AUTH_INFO.admin.root.pwd, roles: AUTH_INFO.admin.root.roles});
adminDB.auth('root', AUTH_INFO.admin.root.pwd);
for (var x = 0; x < 10; x++) {
testDB.kill_cursor.insert({x: x});
adminDB.kill_cursor.insert({x: x});
}
for (var dbName in AUTH_INFO) {
var dbObj = AUTH_INFO[dbName];
for (var userName in dbObj) {
if (dbName == 'admin' && userName == 'root') {
// We already registered this user.
continue;
}
var info = dbObj[userName];
conn.getDB(dbName).createUser({user: userName, pwd: info.pwd, roles: info.roles});
}
}
adminDB.runCommand({logout: 1});
};
var teardown = function() {
var adminDB = conn.getDB('admin');
adminDB.auth('root', AUTH_INFO.admin.root.pwd);
conn.getDB('test').dropDatabase();
adminDB.dropDatabase();
};
var failures = [];
setup();
TESTS.forEach(function(testFunc) {
try {
jsTest.log(testFunc.name);
var newConn = new Mongo(conn.host);
newConn.host = conn.host;
testFunc.test(newConn);
} catch (x) {
failures.push(testFunc.name);
jsTestLog(x);
}
});
teardown();
if (failures.length > 0) {
var list = '';
failures.forEach(function(test) {
list += (test + '\n');
});
throw Error('Tests failed:\n' + list);
}
};
var conn = MongoRunner.runMongod({auth: ''});
runTests(conn);
MongoRunner.stopMongod(conn.port);
jsTest.log('Test sharding');
var st = new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1'});
runTests(st.s);
st.stop();
print('SUCCESS! Completed basic_role_auth.js');
| {'content_hash': 'f2915ef51c74daf09bc3f3ccbbfc193e', 'timestamp': '', 'source': 'github', 'line_count': 501, 'max_line_length': 99, 'avg_line_length': 32.0938123752495, 'alnum_prop': 0.5601716524659494, 'repo_name': 'christkv/mongo-shell', 'id': '7188aa7e4f6d47619278aba837225c3874d76620', 'size': '16079', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/jstests/auth/basic_role_auth.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '392'}, {'name': 'JavaScript', 'bytes': '6633558'}, {'name': 'Makefile', 'bytes': '422'}]} |
<?php
namespace Zend\View\Resolver;
use SplFileInfo;
use Traversable;
use Zend\Stdlib\SplStack;
use Zend\View\Exception;
use Zend\View\Renderer\RendererInterface as Renderer;
/**
* Resolves view scripts based on a stack of paths
*/
class TemplatePathStack implements ResolverInterface {
const FAILURE_NO_PATHS = 'TemplatePathStack_Failure_No_Paths';
const FAILURE_NOT_FOUND = 'TemplatePathStack_Failure_Not_Found';
/**
* Default suffix to use
*
* Appends this suffix if the template requested does not use it.
*
* @var string
*/
protected $defaultSuffix = 'phtml';
/**
*
* @var SplStack
*/
protected $paths;
/**
* Reason for last lookup failure
*
* @var false|string
*/
protected $lastLookupFailure = false;
/**
* Flag indicating whether or not LFI protection for rendering view scripts is enabled
*
* @var bool
*/
protected $lfiProtectionOn = true;
/**
* @+
* Flags used to determine if a stream wrapper should be used for enabling short tags
*
* @var bool
*/
protected $useViewStream = false;
protected $useStreamWrapper = false;
/**
* @-
*/
/**
* Constructor
*
* @param null|array|Traversable $options
*/
public function __construct($options = null) {
$this->useViewStream = ( bool ) ini_get ( 'short_open_tag' );
if ($this->useViewStream) {
if (! in_array ( 'zend.view', stream_get_wrappers () )) {
stream_wrapper_register ( 'zend.view', 'Zend\View\Stream' );
}
}
$this->paths = new SplStack ();
if (null !== $options) {
$this->setOptions ( $options );
}
}
/**
* Configure object
*
* @param array|Traversable $options
* @return void
* @throws Exception\InvalidArgumentException
*/
public function setOptions($options) {
if (! is_array ( $options ) && ! $options instanceof Traversable) {
throw new Exception\InvalidArgumentException ( sprintf ( 'Expected array or Traversable object; received "%s"', (is_object ( $options ) ? get_class ( $options ) : gettype ( $options )) ) );
}
foreach ( $options as $key => $value ) {
switch (strtolower ( $key )) {
case 'lfi_protection' :
$this->setLfiProtection ( $value );
break;
case 'script_paths' :
$this->addPaths ( $value );
break;
case 'use_stream_wrapper' :
$this->setUseStreamWrapper ( $value );
break;
case 'default_suffix' :
$this->setDefaultSuffix ( $value );
break;
default :
break;
}
}
}
/**
* Set default file suffix
*
* @param string $defaultSuffix
* @return TemplatePathStack
*/
public function setDefaultSuffix($defaultSuffix) {
$this->defaultSuffix = ( string ) $defaultSuffix;
$this->defaultSuffix = ltrim ( $this->defaultSuffix, '.' );
return $this;
}
/**
* Get default file suffix
*
* @return string
*/
public function getDefaultSuffix() {
return $this->defaultSuffix;
}
/**
* Add many paths to the stack at once
*
* @param array $paths
* @return TemplatePathStack
*/
public function addPaths(array $paths) {
foreach ( $paths as $path ) {
$this->addPath ( $path );
}
return $this;
}
/**
* Rest the path stack to the paths provided
*
* @param SplStack|array $paths
* @return TemplatePathStack
* @throws Exception\InvalidArgumentException
*/
public function setPaths($paths) {
if ($paths instanceof SplStack) {
$this->paths = $paths;
} elseif (is_array ( $paths )) {
$this->clearPaths ();
$this->addPaths ( $paths );
} else {
throw new Exception\InvalidArgumentException ( "Invalid argument provided for \$paths, expecting either an array or SplStack object" );
}
return $this;
}
/**
* Normalize a path for insertion in the stack
*
* @param string $path
* @return string
*/
public static function normalizePath($path) {
$path = rtrim ( $path, '/' );
$path = rtrim ( $path, '\\' );
$path .= DIRECTORY_SEPARATOR;
return $path;
}
/**
* Add a single path to the stack
*
* @param string $path
* @return TemplatePathStack
* @throws Exception\InvalidArgumentException
*/
public function addPath($path) {
if (! is_string ( $path )) {
throw new Exception\InvalidArgumentException ( sprintf ( 'Invalid path provided; must be a string, received %s', gettype ( $path ) ) );
}
$this->paths [] = static::normalizePath ( $path );
return $this;
}
/**
* Clear all paths
*
* @return void
*/
public function clearPaths() {
$this->paths = new SplStack ();
}
/**
* Returns stack of paths
*
* @return SplStack
*/
public function getPaths() {
return $this->paths;
}
/**
* Set LFI protection flag
*
* @param bool $flag
* @return TemplatePathStack
*/
public function setLfiProtection($flag) {
$this->lfiProtectionOn = ( bool ) $flag;
return $this;
}
/**
* Return status of LFI protection flag
*
* @return bool
*/
public function isLfiProtectionOn() {
return $this->lfiProtectionOn;
}
/**
* Set flag indicating if stream wrapper should be used if short_open_tag is off
*
* @param bool $flag
* @return TemplatePathStack
*/
public function setUseStreamWrapper($flag) {
$this->useStreamWrapper = ( bool ) $flag;
return $this;
}
/**
* Should the stream wrapper be used if short_open_tag is off?
*
* Returns true if the use_stream_wrapper flag is set, and if short_open_tag
* is disabled.
*
* @return bool
*/
public function useStreamWrapper() {
return ($this->useViewStream && $this->useStreamWrapper);
}
/**
* Retrieve the filesystem path to a view script
*
* @param string $name
* @param null|Renderer $renderer
* @return string
* @throws Exception\DomainException
*/
public function resolve($name, Renderer $renderer = null) {
$this->lastLookupFailure = false;
if ($this->isLfiProtectionOn () && preg_match ( '#\.\.[\\\/]#', $name )) {
throw new Exception\DomainException ( 'Requested scripts may not include parent directory traversal ("../", "..\\" notation)' );
}
if (! count ( $this->paths )) {
$this->lastLookupFailure = static::FAILURE_NO_PATHS;
return false;
}
// Ensure we have the expected file extension
$defaultSuffix = $this->getDefaultSuffix ();
if (pathinfo ( $name, PATHINFO_EXTENSION ) == '') {
$name .= '.' . $defaultSuffix;
}
foreach ( $this->paths as $path ) {
$file = new SplFileInfo ( $path . $name );
if ($file->isReadable ()) {
// Found! Return it.
if (($filePath = $file->getRealPath ()) === false && substr ( $path, 0, 7 ) === 'phar://') {
// Do not try to expand phar paths (realpath + phars == fail)
$filePath = $path . $name;
if (! file_exists ( $filePath )) {
break;
}
}
if ($this->useStreamWrapper ()) {
// If using a stream wrapper, prepend the spec to the path
$filePath = 'zend.view://' . $filePath;
}
return $filePath;
}
}
$this->lastLookupFailure = static::FAILURE_NOT_FOUND;
return false;
}
/**
* Get the last lookup failure message, if any
*
* @return false|string
*/
public function getLastLookupFailure() {
return $this->lastLookupFailure;
}
}
| {'content_hash': 'e15aaccf7ede4b225e500c71b6653477', 'timestamp': '', 'source': 'github', 'line_count': 311, 'max_line_length': 192, 'avg_line_length': 24.318327974276528, 'alnum_prop': 0.5963242099695888, 'repo_name': 'ngmautri/nhungttk', 'id': '9aa7b95457755f5999e8ad7ddb60c8d54cc1b197', 'size': '7871', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'vendor/ZF2/library/Zend/View/Resolver/TemplatePathStack.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '363'}, {'name': 'CSS', 'bytes': '132055'}, {'name': 'HTML', 'bytes': '9152608'}, {'name': 'Hack', 'bytes': '15061'}, {'name': 'JavaScript', 'bytes': '1259151'}, {'name': 'Less', 'bytes': '78481'}, {'name': 'PHP', 'bytes': '18771001'}, {'name': 'SCSS', 'bytes': '79489'}]} |
package com.manolovn.trianglify.generator.point;
import com.manolovn.trianglify.domain.Point;
import java.util.Random;
import java.util.Vector;
/**
* Regular point generator
*
* @author manolovn
*/
public class RegularPointGenerator implements PointGenerator {
private final Random random = new Random();
private int bleedX = 0;
private int bleedY = 0;
public RegularPointGenerator() {
}
@Override
public void setBleedX(int bleedX) {
this.bleedX = bleedX;
}
@Override
public void setBleedY(int bleedY) {
this.bleedY = bleedY;
}
@Override
public Vector<Point> generatePoints(int width, int height, int cellSize, int variance) {
Vector<Point> points = new Vector<>();
for (int j = -bleedY; j < height + bleedY; j += cellSize) {
for (int i = -bleedX; i < width + bleedX; i += cellSize) {
int x = i + random.nextInt(variance);
int y = j + random.nextInt(variance);
points.add(new Point(x, y));
}
}
return points;
}
}
| {'content_hash': '17546144e1c49f550f6dc769123fad58', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 92, 'avg_line_length': 23.020833333333332, 'alnum_prop': 0.6018099547511312, 'repo_name': 'manolovn/trianglify', 'id': '142c6c261ed1019ef69a8f1505294cad912daa9d', 'size': '1105', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'trianglify/src/main/java/com/manolovn/trianglify/generator/point/RegularPointGenerator.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '38129'}]} |
package ru.guar7387.testingsample.ui;
import android.test.ActivityInstrumentationTestCase2;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TimePicker;
import com.robotium.solo.Condition;
import com.robotium.solo.Solo;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import ru.guar7387.testingsample.R;
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> {
private Solo solo;
public MainActivityTest() {
super(MainActivity.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
public void testOnCreate() throws Exception {
solo.assertCurrentActivity("Wrong activity", MainActivity.class);
assertTrue("failed to find text", solo.searchText("екккаа"));
}
public void testAddTask() throws Exception {
solo.clickOnView(solo.getView(R.id.fab));
solo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return solo.searchText("date");
}
}, 500);
solo.getCurrentActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
EditText name = (EditText) solo.getView(R.id.textTodo);
EditText date = (EditText) solo.getView(R.id.date);
EditText time = (EditText) solo.getView(R.id.time);
name.setText("Test");
date.setText("25.02.2015");
time.setText("18:00");
}
});
solo.clickOnView(solo.getView(R.id.fab));
assertTrue("Failed to add task", solo.searchText("Test"));
}
public void testCreationFragment() throws Exception {
solo.clickOnView(solo.getView(R.id.fab));
solo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return solo.searchText("date");
}
}, 500);
solo.clickOnView(solo.getView(R.id.date));
DatePicker datePicker = (DatePicker) solo.getView("datePicker");
assertNotNull(datePicker);
View okButton = solo.getText("ОК");
assertNotNull(okButton);
solo.clickOnView(okButton);
solo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return solo.searchText("2015");
}
}, 500);
EditText date = (EditText) solo.getView(R.id.date);
assertEquals(new SimpleDateFormat("dd.MM.yyyy", Locale.getDefault()).
format(Calendar.getInstance().getTime()), date.getText().toString());
solo.clickOnView(solo.getView(R.id.time));
TimePicker timePicker = (TimePicker) solo.getView("timePicker");
assertNotNull(timePicker);
okButton = solo.getText("ОК");
assertNotNull(okButton);
solo.clickOnView(okButton);
solo.waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
return solo.searchText(":");
}
}, 500);
EditText time = (EditText) solo.getView(R.id.time);
assertEquals(new SimpleDateFormat("hh:mm a", Locale.getDefault()).
format(Calendar.getInstance().getTime()), time.getText().toString());
}
@Override
public void tearDown() throws Exception {
solo.finishOpenedActivities();
}
}
| {'content_hash': '45dca753eb4cd165a3aa8c32129ee65b', 'timestamp': '', 'source': 'github', 'line_count': 108, 'max_line_length': 86, 'avg_line_length': 33.2037037037037, 'alnum_prop': 0.6143335192414947, 'repo_name': 'ArturVasilov/AndroidCourses', 'id': 'c3a69d255a875fd749c1b5f3d28a09e69ec32f1b', 'size': '3596', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Android Testing/RobotiumTesting/TestingSample/app/src/androidTest/java/ru/guar7387/testingsample/ui/MainActivityTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '5837467'}, {'name': 'Kotlin', 'bytes': '29850'}]} |
namespace ash {
class AppListFolderItem;
class AppListItem;
class AppListItemList;
class AppListModelObserver;
class AppListModelDelegate;
// Main model for the app list. Holds AppListItemList, which owns a list of
// AppListItems and is displayed in the grid view.
// NOTE: Currently this class observes |top_level_item_list_|. The View code may
// move entries in the item list directly (but can not add or remove them) and
// the model needs to notify its observers when this occurs.
class APP_LIST_MODEL_EXPORT AppListModel : public AppListItemListObserver {
public:
explicit AppListModel(AppListModelDelegate* app_list_model_delegate);
AppListModel(const AppListModel&) = delete;
AppListModel& operator=(const AppListModel&) = delete;
~AppListModel() override;
void AddObserver(AppListModelObserver* observer);
void RemoveObserver(AppListModelObserver* observer);
void SetStatus(AppListModelStatus status);
// Finds the item matching |id|.
AppListItem* FindItem(const std::string& id);
// Find a folder item matching |id|.
AppListFolderItem* FindFolderItem(const std::string& id);
// Creates and adds an empty folder item with the provided ID.
AppListFolderItem* CreateFolderItem(const std::string& folder_id);
// Adds |item| to the model. The model takes ownership of |item|. Returns a
// pointer to the item that is safe to use (e.g. after passing ownership).
AppListItem* AddItem(std::unique_ptr<AppListItem> item);
// Adds |item| to an existing folder or creates a new folder. If |folder_id|
// is empty, adds the item to the top level model instead. The model takes
// ownership of |item|. Returns a pointer to the item that is safe to use.
AppListItem* AddItemToFolder(std::unique_ptr<AppListItem> item,
const std::string& folder_id);
// Add a "page break" item right after the specified item in item list.
void AddPageBreakItemAfter(const AppListItem* previous_item);
// Updates an item's metadata (e.g. name, position, etc).
void SetItemMetadata(const std::string& id,
std::unique_ptr<AppListItemMetadata> data);
// Merges two items. If the target item is a folder, the source item is
// added to the end of the target folder. Otherwise a new folder is created
// in the same position as the target item with the target item as the first
// item in the new folder and the source item as the second item. Returns
// the id of the target folder, or an empty string if the merge failed. The
// source item may already be in a folder. See also the comment for
// RemoveItemFromFolder. NOTE: This should only be called by the View code
// (not the sync code); it enforces folder restrictions (e.g. the target can
// not be an OEM folder).
const std::string MergeItems(const std::string& target_item_id,
const std::string& source_item_id);
// Move |item| to the folder matching |folder_id| or to the top level if
// |folder_id| is empty. |item|->position will determine where the item
// is positioned. See also the comment for RemoveItemFromFolder.
// This method should only be called by `AppListControllerImpl`. It does the
// real job of reparenting an item. Note that `app_list_model_delegate_`
// should be used to request for reparenting an item. We should not call
// `MoveItemToFolder()` in ash directly.
// TODO(https://crbug.com/1257605): it is confusing that when reparenting an
// item, `MoveItemToFolder()` is called through an indirect way. The reason
// leading to confusion is that `AppListModel` plays two roles: (1) the class
// that sends the request for app list item change (2) the class that manages
// app list items. To fix this issue, `AppListModel` code should be splitted
// based on these two roles.
void MoveItemToFolder(AppListItem* item, const std::string& folder_id);
// Moves `item` to the top level. The item will be inserted before `position`
// or at the end of the list if `position` is invalid. Note: `position` is
// copied in case it refers to the containing folder which may get deleted.
// See also the comment for RemoveItemFromFolder. Returns true if the item was
// moved. NOTE: This should only be called by the View code (not the sync
// code); it enforces folder restrictions (e.g. the source folder can not be
// type OEM).
bool MoveItemToRootAt(AppListItem* item, syncer::StringOrdinal position);
// Sets the position of |item| either in |top_level_item_list_| or the
// folder specified by |item|->folder_id(). If |new_position| is invalid,
// move the item to the end of the list.
void SetItemPosition(AppListItem* item,
const syncer::StringOrdinal& new_position);
// Sets the name of |item| and notifies observers.
void SetItemName(AppListItem* item, const std::string& name);
// Deletes the item matching |id| from |top_level_item_list_| or from the
// appropriate folder.
void DeleteItem(const std::string& id);
AppListModelDelegate* delegate() { return delegate_; }
AppListItemList* top_level_item_list() const {
return top_level_item_list_.get();
}
AppListModelStatus status() const { return status_; }
private:
enum class ReparentItemReason {
// Reparent an item when adding the item to the model.
kAdd,
// Reparent an item when updating the item in the model.
kUpdate
};
// AppListItemListObserver
void OnListItemMoved(size_t from_index,
size_t to_index,
AppListItem* item) override;
// Adds |item_ptr| to |top_level_item_list_| and notifies observers.
AppListItem* AddItemToRootListAndNotify(std::unique_ptr<AppListItem> item_ptr,
ReparentItemReason reason);
// Adds |item_ptr| to |folder| and notifies observers.
AppListItem* AddItemToFolderListAndNotify(
AppListFolderItem* folder,
std::unique_ptr<AppListItem> item_ptr,
ReparentItemReason reason);
// Notifies observers of `item` being reparented.
void NotifyItemParentChange(AppListItem* item, ReparentItemReason reason);
// Removes `item` from the top item list.
std::unique_ptr<AppListItem> RemoveFromTopList(AppListItem* item);
// Removes `item` from its parent folder. If `destination_folder_id` is not
// set, the removed item will be deleted; otherwise, move `item` to the top
// list or a specified folder depending on `destination_folder_id`. If
// the parent folder becomes empty after removal, deletes the folder from
// `top_level_item_list_`. It is guaranteed that folder deletion is always
// after moving or deleting `item`.
void ReparentOrDeleteItemInFolder(
AppListItem* item,
absl::optional<std::string> destination_folder_id);
// Removes `item` from `folder` then returns a unique pointer to the removed
// item.
std::unique_ptr<AppListItem> RemoveItemFromFolder(AppListFolderItem* folder,
AppListItem* item);
// Deletes folder with ID `folder_id` if it's empty.
void DeleteFolderIfEmpty(const std::string& folder_id);
// Sets the position of a root item.
void SetRootItemPosition(AppListItem* item,
const syncer::StringOrdinal& new_position);
// Used to initiate updates on app list items from the ash side.
AppListModelDelegate* const delegate_;
std::unique_ptr<AppListItemList> top_level_item_list_;
AppListModelStatus status_ = AppListModelStatus::kStatusNormal;
base::ObserverList<AppListModelObserver, true> observers_;
base::ScopedMultiSourceObservation<AppListItemList, AppListItemListObserver>
item_list_scoped_observations_{this};
};
} // namespace ash
#endif // ASH_APP_LIST_MODEL_APP_LIST_MODEL_H_
| {'content_hash': 'f878a34cfdee3768b90ccae8c9d4c766', 'timestamp': '', 'source': 'github', 'line_count': 177, 'max_line_length': 80, 'avg_line_length': 44.21468926553672, 'alnum_prop': 0.7116023511372349, 'repo_name': 'nwjs/chromium.src', 'id': '41ca36639d0204124ada19eb6a2955a12f0ee1e6', 'size': '8437', 'binary': False, 'copies': '1', 'ref': 'refs/heads/nw70', 'path': 'ash/app_list/model/app_list_model.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
class Solution {
public int countElements(int[] nums) {
if (nums == null || nums.length <= 1) {
return 0;
}
int minCount = 0;
int maxCount = 0;
int minValue = Integer.MAX_VALUE;
int maxValue = Integer.MIN_VALUE;
for (int num : nums) {
if (num > maxValue) {
maxValue = num;
maxCount = 1;
} else if (num == maxValue) {
maxCount++;
}
if (num < minValue) {
minValue = num;
minCount = 1;
} else if (num == minValue) {
minCount++;
}
}
return minValue != maxValue ? nums.length - maxCount - minCount : 0;
}
} | {'content_hash': 'eeb7332f4d99e251983c048be57552c8', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 76, 'avg_line_length': 23.96875, 'alnum_prop': 0.42242503259452413, 'repo_name': 'alfred42/leetcode', 'id': '9424f49e89b2827bc801d02616fbbbef9b57cc0a', 'size': '767', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '2148. Count Elements With Strictly Smaller and Greater Elements .java', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Go', 'bytes': '274'}, {'name': 'Java', 'bytes': '232881'}]} |
<?php
declare(strict_types = 1);
namespace Innmind\TimeContinuum\Earth\Timezone\America;
use Innmind\TimeContinuum\Earth\Timezone;
/**
* @psalm-immutable
*/
final class Anguilla extends Timezone
{
public function __construct()
{
parent::__construct('America/Anguilla');
}
}
| {'content_hash': '77213d507628039a73bb306f3c877619', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 55, 'avg_line_length': 17.58823529411765, 'alnum_prop': 0.6923076923076923, 'repo_name': 'Innmind/TimeContinuum', 'id': '3e47c6b012ae849acd9a429882ab07bf6c326229', 'size': '299', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/Earth/Timezone/America/Anguilla.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '447842'}]} |
<?xml version="1.0" encoding="utf-8"?><!--
~ MIT License
~
~ Copyright (c) 2017 Jan Heinrich Reimer
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
<resources>
<style name="AppTheme" parent="AppBaseTheme" />
<style name="AppTheme3" parent="AppTheme">
<item name="colorPrimary">@color/color_primary_3</item>
<item name="colorPrimaryDark">@color/color_primary_dark_3</item>
<item name="colorAccent">@color/color_accent_3</item>
</style>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/color_primary</item>
<item name="colorPrimaryDark">@color/color_primary_dark</item>
<item name="colorAccent">@color/color_accent</item>
<item name="actionBarStyle">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
</resources> | {'content_hash': '8591797bd23ba5f51ba2d2669e450d4e', 'timestamp': '', 'source': 'github', 'line_count': 42, 'max_line_length': 87, 'avg_line_length': 45.57142857142857, 'alnum_prop': 0.7152560083594567, 'repo_name': 'HeinrichReimer/material-drawer', 'id': '076a06de5edcb9f0e1a790a40eb93ab3ccd1b0fe', 'size': '1914', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'demo/src/main/res/values/styles.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '200057'}]} |
dojo.provide("extlib.responsive.dijit.xsp.bootstrap.PickerList");
dojo.require("extlib.responsive.dijit.xsp.bootstrap.Dialog")
dojo.require("extlib.dijit.PickerList")
dojo.declare(
'extlib.responsive.dijit.xsp.bootstrap.PickerList',
[extlib.dijit.PickerList],
{
listWidth: "100%",
templateString: dojo.cache("extlib.responsive.dijit.xsp.bootstrap", "templates/PickerList.html")
}
); | {'content_hash': '12802bf2a9622e4e8a75da992957a6ac', 'timestamp': '', 'source': 'github', 'line_count': 14, 'max_line_length': 98, 'avg_line_length': 28.5, 'alnum_prop': 0.7568922305764411, 'repo_name': 'the-ntf/XPagesExtensionLibrary', 'id': '0ec9f71bbff24e10b8df0190a49945b25a5b49d6', 'size': '1000', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.theme.bootstrap/resources/web/extlib/responsive/dijit/xsp/bootstrap/PickerList.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '483681'}, {'name': 'HTML', 'bytes': '82490'}, {'name': 'Java', 'bytes': '9428409'}, {'name': 'JavaScript', 'bytes': '2300379'}, {'name': 'Smarty', 'bytes': '9289'}, {'name': 'XPages', 'bytes': '1983097'}]} |
[](http://badge.fury.io/rb/can963)
[](https://travis-ci.org/ashphy/CAN963)
[](https://codeclimate.com/github/ashphy/CAN963)
[](https://coveralls.io/r/ashphy/CAN963)
Check CAN963 out!
## Installation
Install it yourself as:
$ gem install can963
## Usage
CAN963 version follows Semantic Versioning 2.0.0 http://semver.org/
$ can963 version
Or use old command line style
$ can963 -v
$ can963 --version
## Contributing
1. Fork it ( http://github.com/<my-github-username>/can963/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
| {'content_hash': 'b8aeaa5e6b941b06239187d29d52227a', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 113, 'avg_line_length': 31.966666666666665, 'alnum_prop': 0.7194994786235662, 'repo_name': 'ashphy/CAN963', 'id': '172e50d891d83840fe0925162e2d8ddbb0e6f093', 'size': '969', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '2513'}]} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (1.8.0_112) on Sat Mar 04 23:59:41 CET 2017 -->
<title>AlphaAnimExpectation (expectanim 1.0.2 API)</title>
<meta name="date" content="2017-03-04">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AlphaAnimExpectation (expectanim 1.0.2 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../../com/github/florent37/expectanim/core/alpha/AlphaAnimExpectationValue.html" title="class in com.github.florent37.expectanim.core.alpha"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/github/florent37/expectanim/core/alpha/AlphaAnimExpectation.html" target="_top">Frames</a></li>
<li><a href="AlphaAnimExpectation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields.inherited.from.class.com.github.florent37.expectanim.core.AnimExpectation">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.github.florent37.expectanim.core.alpha</div>
<h2 title="Class AlphaAnimExpectation" class="title">Class AlphaAnimExpectation</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html" title="class in com.github.florent37.expectanim.core">com.github.florent37.expectanim.core.AnimExpectation</a></li>
<li>
<ul class="inheritance">
<li>com.github.florent37.expectanim.core.alpha.AlphaAnimExpectation</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../../com/github/florent37/expectanim/core/alpha/AlphaAnimExpectationValue.html" title="class in com.github.florent37.expectanim.core.alpha">AlphaAnimExpectationValue</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">AlphaAnimExpectation</span>
extends <a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html" title="class in com.github.florent37.expectanim.core">AnimExpectation</a></pre>
<div class="block">Created by florentchampigny on 17/02/2017.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.com.github.florent37.expectanim.core.AnimExpectation">
<!-- -->
</a>
<h3>Fields inherited from class com.github.florent37.expectanim.core.<a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html" title="class in com.github.florent37.expectanim.core">AnimExpectation</a></h3>
<code><a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html#viewCalculator">viewCalculator</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../com/github/florent37/expectanim/core/alpha/AlphaAnimExpectation.html#AlphaAnimExpectation--">AlphaAnimExpectation</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract java.lang.Float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/github/florent37/expectanim/core/alpha/AlphaAnimExpectation.html#getCalculatedAlpha-android.view.View-">getCalculatedAlpha</a></span>(android.view.View viewToMove)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.github.florent37.expectanim.core.AnimExpectation">
<!-- -->
</a>
<h3>Methods inherited from class com.github.florent37.expectanim.core.<a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html" title="class in com.github.florent37.expectanim.core">AnimExpectation</a></h3>
<code><a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html#getViewsDependencies--">getViewsDependencies</a>, <a href="../../../../../../com/github/florent37/expectanim/core/AnimExpectation.html#setViewCalculator-com.github.florent37.expectanim.ViewCalculator-">setViewCalculator</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="AlphaAnimExpectation--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AlphaAnimExpectation</h4>
<pre>public AlphaAnimExpectation()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getCalculatedAlpha-android.view.View-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getCalculatedAlpha</h4>
<pre>public abstract java.lang.Float getCalculatedAlpha(android.view.View viewToMove)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../../../../com/github/florent37/expectanim/core/alpha/AlphaAnimExpectationValue.html" title="class in com.github.florent37.expectanim.core.alpha"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/github/florent37/expectanim/core/alpha/AlphaAnimExpectation.html" target="_top">Frames</a></li>
<li><a href="AlphaAnimExpectation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields.inherited.from.class.com.github.florent37.expectanim.core.AnimExpectation">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {'content_hash': '474a8e105ad6b9378d2565bf0c750df8', 'timestamp': '', 'source': 'github', 'line_count': 301, 'max_line_length': 391, 'avg_line_length': 38.89700996677741, 'alnum_prop': 0.6522890331397335, 'repo_name': 'Julien-Mialon/ExpectAnimXamarin', 'id': 'fdcf2b5189cc36d6cbe9b96d3874e47527b44ed9', 'size': '11708', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/ExpectAnimXamarin/JavaDocs/expectanim-1.0.2-javadoc/com/github/florent37/expectanim/core/alpha/AlphaAnimExpectation.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '6399'}, {'name': 'CSS', 'bytes': '12842'}, {'name': 'HTML', 'bytes': '1243481'}, {'name': 'JavaScript', 'bytes': '827'}, {'name': 'Shell', 'bytes': '2535'}]} |
// Copyright (c) "Neo4j"
// Neo4j Sweden AB [http://neo4j.com]
//
// This file is part of Neo4j.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System.Threading.Tasks;
using Neo4j.Driver.Internal.Connector;
namespace Neo4j.Driver.Internal.Routing
{
internal interface IDiscovery
{
Task<IRoutingTable> DiscoverAsync(IConnection connection, string database, string impersonatedUser, Bookmarks bookmarks);
}
} | {'content_hash': '495f7af8e315265890e61b6f079be50e', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 130, 'avg_line_length': 35.22222222222222, 'alnum_prop': 0.7381703470031545, 'repo_name': 'neo4j/neo4j-dotnet-driver', 'id': '29a80843453b0f0bfc3979831b950c626d2473b0', 'size': '953', 'binary': False, 'copies': '1', 'ref': 'refs/heads/5.0', 'path': 'Neo4j.Driver/Neo4j.Driver/Internal/Routing/IDiscovery.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '2866660'}, {'name': 'Dockerfile', 'bytes': '748'}, {'name': 'PowerShell', 'bytes': '2076'}, {'name': 'Python', 'bytes': '4760'}]} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {'content_hash': '9f979100674959350d85eab85bd00c99', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.307692307692308, 'alnum_prop': 0.6940298507462687, 'repo_name': 'mdoering/backbone', 'id': '6bb2a06f05a4b9af46cdcd0796527f058f291169', 'size': '185', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Bromeliaceae/Neoregelia/Neoregelia richteri/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []} |
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <mach/videonode.h>
#include <media/exynos_mc.h>
#include <linux/cma.h>
#include <asm/cacheflush.h>
#include <asm/pgtable.h>
#include <linux/firmware.h>
#include <linux/dma-mapping.h>
#include <linux/scatterlist.h>
#include <linux/videodev2.h>
#include <linux/videodev2_exynos_camera.h>
#include <linux/videodev2_exynos_media.h>
#include <linux/v4l2-mediabus.h>
#include <linux/bug.h>
#include <mach/map.h>
#include <mach/regs-clock.h>
#include "fimc-is-core.h"
#include "fimc-is-err.h"
#include "fimc-is-video.h"
#include "fimc-is-framemgr.h"
#include "fimc-is-groupmgr.h"
#include "fimc-is-cmd.h"
static void fimc_is_gframe_free_head(struct fimc_is_group_framemgr *framemgr,
struct fimc_is_group_frame **item)
{
if (framemgr->frame_free_cnt)
*item = container_of(framemgr->frame_free_head.next,
struct fimc_is_group_frame, list);
else
*item = NULL;
}
static void fimc_is_gframe_s_free(struct fimc_is_group_framemgr *framemgr,
struct fimc_is_group_frame *item)
{
BUG_ON(!framemgr);
BUG_ON(!item);
list_add_tail(&item->list, &framemgr->frame_free_head);
framemgr->frame_free_cnt++;
}
static void fimc_is_gframe_group_head(struct fimc_is_group *group,
struct fimc_is_group_frame **item)
{
if (group->frame_group_cnt)
*item = container_of(group->frame_group_head.next,
struct fimc_is_group_frame, list);
else
*item = NULL;
}
static void fimc_is_gframe_s_group(struct fimc_is_group *group,
struct fimc_is_group_frame *item)
{
BUG_ON(!group);
BUG_ON(!item);
list_add_tail(&item->list, &group->frame_group_head);
group->frame_group_cnt++;
}
static int fimc_is_gframe_trans_fre_to_grp(struct fimc_is_group_framemgr *prev,
struct fimc_is_group *next,
struct fimc_is_group_frame *item)
{
int ret = 0;
BUG_ON(!prev);
BUG_ON(!next);
BUG_ON(!item);
if (!prev->frame_free_cnt) {
err("frame_free_cnt is zero");
ret = -EFAULT;
goto exit;
}
list_del(&item->list);
prev->frame_free_cnt--;
fimc_is_gframe_s_group(next, item);
exit:
return ret;
}
static int fimc_is_gframe_trans_grp_to_grp(struct fimc_is_group *prev,
struct fimc_is_group *next,
struct fimc_is_group_frame *item)
{
int ret = 0;
BUG_ON(!prev);
BUG_ON(!next);
BUG_ON(!item);
if (!prev->frame_group_cnt) {
err("frame_group_cnt is zero");
ret = -EFAULT;
goto exit;
}
list_del(&item->list);
prev->frame_group_cnt--;
fimc_is_gframe_s_group(next, item);
exit:
return ret;
}
static int fimc_is_gframe_trans_grp_to_fre(struct fimc_is_group *prev,
struct fimc_is_group_framemgr *next,
struct fimc_is_group_frame *item)
{
int ret = 0;
BUG_ON(!prev);
BUG_ON(!next);
BUG_ON(!item);
if (!prev->frame_group_cnt) {
err("frame_group_cnt is zero");
ret = -EFAULT;
goto exit;
}
list_del(&item->list);
prev->frame_group_cnt--;
fimc_is_gframe_s_free(next, item);
exit:
return ret;
}
int fimc_is_gframe_cancel(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group, u32 target_fcount)
{
int ret = -EINVAL;
struct fimc_is_group_framemgr *gframemgr;
struct fimc_is_group_frame *gframe, *temp;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
gframemgr = &groupmgr->framemgr[group->instance];
spin_lock_irq(&gframemgr->frame_slock);
list_for_each_entry_safe(gframe, temp, &group->frame_group_head, list) {
if (gframe->fcount == target_fcount) {
list_del(&gframe->list);
group->frame_group_cnt--;
mwarn("gframe%d is cancelled", group, target_fcount);
fimc_is_gframe_s_free(gframemgr, gframe);
ret = 0;
break;
}
}
spin_unlock_irq(&gframemgr->frame_slock);
return ret;
}
void * fimc_is_gframe_rewind(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group, u32 target_fcount)
{
struct fimc_is_group_framemgr *gframemgr;
struct fimc_is_group_frame *gframe, *temp;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
gframemgr = &groupmgr->framemgr[group->instance];
list_for_each_entry_safe(gframe, temp, &group->frame_group_head, list) {
if (gframe->fcount == target_fcount)
break;
if (gframe->fcount > target_fcount) {
mwarn("target fcount is invalid(%d > %d)", group,
gframe->fcount, target_fcount);
gframe = NULL;
break;
}
list_del(&gframe->list);
group->frame_group_cnt--;
mwarn("gframe%d is cancelled(count : %d)", group,
gframe->fcount, group->frame_group_cnt);
fimc_is_gframe_s_free(gframemgr, gframe);
}
if (!group->frame_group_cnt) {
merr("gframe%d can't be found", group, target_fcount);
gframe = NULL;
}
return gframe;
}
int fimc_is_gframe_flush(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group)
{
int ret = 0;
struct fimc_is_group_framemgr *gframemgr;
struct fimc_is_group_frame *gframe, *temp;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
gframemgr = &groupmgr->framemgr[group->instance];
spin_lock_irq(&gframemgr->frame_slock);
list_for_each_entry_safe(gframe, temp, &group->frame_group_head, list) {
list_del(&gframe->list);
group->frame_group_cnt--;
mwarn("gframe%d is flushed(count : %d)", group,
gframe->fcount, group->frame_group_cnt);
fimc_is_gframe_s_free(gframemgr, gframe);
}
spin_unlock_irq(&gframemgr->frame_slock);
return ret;
}
static void fimc_is_group_3a0_cancel(struct fimc_is_framemgr *ldr_framemgr,
struct fimc_is_frame *ldr_frame,
struct fimc_is_framemgr *sub_framemgr,
struct fimc_is_video_ctx *vctx,
u32 instance)
{
u32 done_state = VB2_BUF_STATE_DONE;
unsigned long flags;
struct fimc_is_queue *src_queue, *dst_queue;
struct fimc_is_frame *sub_frame;
BUG_ON(!vctx);
BUG_ON(!ldr_framemgr);
BUG_ON(!ldr_frame);
BUG_ON(!sub_framemgr);
pr_info("[3A0:D:%d] GRP0 CANCEL(%d, %d)\n", instance,
ldr_frame->fcount, ldr_frame->index);
ldr_frame->shot_ext->request_3ax = 0;
src_queue = GET_SRC_QUEUE(vctx);
dst_queue = GET_DST_QUEUE(vctx);
framemgr_e_barrier_irqs(sub_framemgr, 0, flags);
fimc_is_frame_request_head(sub_framemgr, &sub_frame);
if (sub_frame) {
sub_frame->stream->fvalid = 0;
sub_frame->stream->fcount = ldr_frame->fcount;
sub_frame->stream->rcount = ldr_frame->rcount;
fimc_is_frame_trans_req_to_com(sub_framemgr, sub_frame);
queue_done(vctx, dst_queue, sub_frame->index, done_state);
} else
warn("subframe is empty(%p, %d)", sub_frame, ldr_frame->fcount);
framemgr_x_barrier_irqr(sub_framemgr, 0, flags);
fimc_is_frame_trans_req_to_com(ldr_framemgr, ldr_frame);
queue_done(vctx, src_queue, ldr_frame->index, done_state);
}
static void fimc_is_group_3a1_cancel(struct fimc_is_framemgr *ldr_framemgr,
struct fimc_is_frame *ldr_frame,
struct fimc_is_framemgr *sub_framemgr,
struct fimc_is_video_ctx *vctx,
u32 instance)
{
u32 done_state = VB2_BUF_STATE_DONE;
unsigned long flags;
struct fimc_is_queue *src_queue, *dst_queue;
struct fimc_is_frame *sub_frame;
BUG_ON(!vctx);
BUG_ON(!ldr_framemgr);
BUG_ON(!ldr_frame);
BUG_ON(!sub_framemgr);
pr_info("[3A1:D:%d] GRP1 CANCEL(%d, %d)\n", instance,
ldr_frame->fcount, ldr_frame->index);
ldr_frame->shot_ext->request_3ax = 0;
src_queue = GET_SRC_QUEUE(vctx);
dst_queue = GET_DST_QUEUE(vctx);
framemgr_e_barrier_irqs(sub_framemgr, 0, flags);
fimc_is_frame_request_head(sub_framemgr, &sub_frame);
if (sub_frame) {
sub_frame->stream->fvalid = 0;
sub_frame->stream->fcount = ldr_frame->fcount;
sub_frame->stream->rcount = ldr_frame->rcount;
fimc_is_frame_trans_req_to_com(sub_framemgr, sub_frame);
queue_done(vctx, dst_queue, sub_frame->index, done_state);
} else
warn("subframe is empty(%p, %d)", sub_frame, ldr_frame->fcount);
framemgr_x_barrier_irqr(sub_framemgr, 0, flags);
fimc_is_frame_trans_req_to_com(ldr_framemgr, ldr_frame);
queue_done(vctx, src_queue, ldr_frame->index, done_state);
}
static void fimc_is_group_isp_cancel(struct fimc_is_framemgr *framemgr,
struct fimc_is_frame *frame,
struct fimc_is_video_ctx *vctx,
u32 instance)
{
u32 done_state = VB2_BUF_STATE_DONE;
struct fimc_is_queue *queue;
BUG_ON(!framemgr);
BUG_ON(!frame);
pr_info("[ISP:D:%d] GRP2 CANCEL(%d, %d)\n", instance,
frame->fcount, frame->index);
frame->shot_ext->request_isp = 0;
queue = GET_SRC_QUEUE(vctx);
fimc_is_frame_trans_req_to_com(framemgr, frame);
queue_done(vctx, queue, frame->index, done_state);
}
static void fimc_is_group_dis_cancel(struct fimc_is_framemgr *framemgr,
struct fimc_is_frame *frame,
struct fimc_is_video_ctx *vctx,
u32 instance)
{
u32 done_state = VB2_BUF_STATE_DONE;
struct fimc_is_queue *queue;
BUG_ON(!framemgr);
BUG_ON(!frame);
pr_info("[DIS:D:%d] GRP3 CANCEL(%d, %d)\n", instance,
frame->fcount, frame->index);
frame->shot_ext->request_dis = 0;
queue = GET_SRC_QUEUE(vctx);
fimc_is_frame_trans_req_to_com(framemgr, frame);
queue_done(vctx, queue, frame->index, done_state);
}
static void fimc_is_group_cancel(struct fimc_is_group *group,
struct fimc_is_frame *ldr_frame)
{
unsigned long flags;
struct fimc_is_video_ctx *vctx;
struct fimc_is_framemgr *ldr_framemgr, *sub_framemgr;
BUG_ON(!group);
BUG_ON(!ldr_frame);
vctx = group->leader.vctx;
if (!vctx) {
merr("vctx is NULL, critical error", group);
return;
}
ldr_framemgr = GET_SRC_FRAMEMGR(vctx);
if (!ldr_framemgr) {
merr("ldr_framemgr is NULL, critical error", group);
return;
}
framemgr_e_barrier_irqs(ldr_framemgr, 0, flags);
switch (group->id) {
case GROUP_ID_3A0:
sub_framemgr = GET_DST_FRAMEMGR(vctx);
fimc_is_group_3a0_cancel(ldr_framemgr, ldr_frame,
sub_framemgr, vctx, group->instance);
break;
case GROUP_ID_3A1:
sub_framemgr = GET_DST_FRAMEMGR(vctx);
fimc_is_group_3a1_cancel(ldr_framemgr, ldr_frame,
sub_framemgr, vctx, group->instance);
break;
case GROUP_ID_ISP:
fimc_is_group_isp_cancel(ldr_framemgr, ldr_frame,
vctx, group->instance);
break;
case GROUP_ID_DIS:
fimc_is_group_dis_cancel(ldr_framemgr, ldr_frame,
vctx, group->instance);
break;
default:
err("unresolved group id %d", group->id);
break;
}
framemgr_x_barrier_irqr(ldr_framemgr, 0, flags);
}
static void fimc_is_group_start_trigger(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_frame *frame)
{
BUG_ON(!group);
BUG_ON(!frame);
atomic_inc(&group->rcount);
queue_kthread_work(group->worker, &frame->work);
}
static void fimc_is_group_pump(struct kthread_work *work)
{
struct fimc_is_groupmgr *groupmgr;
struct fimc_is_group *group;
struct fimc_is_frame *frame;
frame = container_of(work, struct fimc_is_frame, work);
groupmgr = frame->work_data1;
group = frame->work_data2;
fimc_is_group_start(groupmgr, group, frame);
}
int fimc_is_groupmgr_probe(struct fimc_is_groupmgr *groupmgr)
{
int ret = 0;
u32 i, j;
atomic_set(&groupmgr->group_cnt, 0);
for (i = 0; i < FIMC_IS_MAX_NODES; ++i) {
spin_lock_init(&groupmgr->framemgr[i].frame_slock);
INIT_LIST_HEAD(&groupmgr->framemgr[i].frame_free_head);
groupmgr->framemgr[i].frame_free_cnt = 0;
for (j = 0; j < FIMC_IS_MAX_GFRAME; ++j) {
groupmgr->framemgr[i].frame[j].fcount = 0;
fimc_is_gframe_s_free(&groupmgr->framemgr[i],
&groupmgr->framemgr[i].frame[j]);
}
for (j = 0; j < GROUP_ID_MAX; ++j)
groupmgr->group[i][j] = NULL;
}
sema_init(&groupmgr->group_smp_res[GROUP_ID_3A0], 1);
#ifdef USE_OTF_INTERFACE
sema_init(&groupmgr->group_smp_res[GROUP_ID_3A1], MIN_OF_SHOT_RSC);
#else
sema_init(&groupmgr->group_smp_res[GROUP_ID_3A1], 1);
#endif
sema_init(&groupmgr->group_smp_res[GROUP_ID_ISP], 1);
sema_init(&groupmgr->group_smp_res[GROUP_ID_DIS], 1);
for (i = 0; i < GROUP_ID_MAX; ++i) {
clear_bit(FIMC_IS_GGROUP_STOP, &groupmgr->group_state[i]);
clear_bit(FIMC_IS_GGROUP_INIT, &groupmgr->group_state[i]);
}
return ret;
}
int fimc_is_group_open(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group, u32 id, u32 instance,
struct fimc_is_video_ctx *vctx,
struct fimc_is_device_ischain *device,
fimc_is_start_callback start_callback)
{
int ret = 0, i;
char name[30];
struct fimc_is_subdev *leader;
struct fimc_is_framemgr *framemgr;
struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(!device);
BUG_ON(!vctx);
BUG_ON(instance >= FIMC_IS_MAX_NODES);
BUG_ON(id >= GROUP_ID_MAX);
leader = &group->leader;
framemgr = GET_SRC_FRAMEMGR(vctx);
mdbgd_ischain("%s(id %d)\n", device, __func__, id);
if (test_bit(FIMC_IS_GROUP_OPEN, &group->state)) {
merr("group%d already open", device, id);
ret = -EMFILE;
goto p_err;
}
/* 1. Init Work */
if (!test_bit(FIMC_IS_GGROUP_INIT, &groupmgr->group_state[id])) {
init_kthread_worker(&groupmgr->group_worker[id]);
snprintf(name, sizeof(name), "fimc_is_group_worker%d", id);
groupmgr->group_task[id] = kthread_run(kthread_worker_fn,
&groupmgr->group_worker[id], name);
if (IS_ERR(groupmgr->group_task[id])) {
err("failed to create group_task%d\n", id);
ret = -ENOMEM;
goto p_err;
}
if (id == GROUP_ID_3A1) {
sema_init(&groupmgr->group_smp_res[id], MIN_OF_SHOT_RSC);
sched_setscheduler_nocheck(groupmgr->group_task[id],
SCHED_FIFO, ¶m);
} else {
sema_init(&groupmgr->group_smp_res[id], 1);
}
clear_bit(FIMC_IS_GGROUP_STOP, &groupmgr->group_state[id]);
set_bit(FIMC_IS_GGROUP_INIT, &groupmgr->group_state[id]);
}
group->worker = &groupmgr->group_worker[id];
for (i = 0; i < FRAMEMGR_MAX_REQUEST; ++i)
init_kthread_work(&framemgr->frame[i].work, fimc_is_group_pump);
/* 2. Init Group */
clear_bit(FIMC_IS_GROUP_REQUEST_FSTOP, &group->state);
clear_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
clear_bit(FIMC_IS_GROUP_READY, &group->state);
clear_bit(FIMC_IS_GROUP_RUN, &group->state);
group->start_callback = start_callback;
group->device = device;
group->id = id;
group->instance = instance;
group->fcount = 0;
atomic_set(&group->scount, 0);
atomic_set(&group->rcount, 0);
atomic_set(&group->backup_fcount, 0);
atomic_set(&group->sensor_fcount, 1);
sema_init(&group->smp_trigger, 0);
INIT_LIST_HEAD(&group->frame_group_head);
group->frame_group_cnt = 0;
#ifdef MEASURE_TIME
#ifdef INTERNAL_TIME
measure_init(&group->time, group->instance, group->id, 66);
#endif
#endif
/* 3. Subdev Init */
mutex_init(&leader->mutex_state);
leader->vctx = vctx;
leader->group = group;
leader->leader = NULL;
leader->input.width = 0;
leader->input.height = 0;
leader->output.width = 0;
leader->output.height = 0;
clear_bit(FIMC_IS_ISDEV_DSTART, &leader->state);
/* 4. Configure Group & Subdev List */
switch (id) {
case GROUP_ID_3A0:
sema_init(&group->smp_shot, 1);
atomic_set(&group->smp_shot_count, 1);
clear_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state);
group->async_shots = 0;
group->sync_shots = 1;
/* path configuration */
group->prev = NULL;
group->next = &device->group_isp;
group->subdev[ENTRY_SCALERC] = NULL;
group->subdev[ENTRY_DIS] = NULL;
group->subdev[ENTRY_TDNR] = NULL;
group->subdev[ENTRY_SCALERP] = NULL;
group->subdev[ENTRY_LHFD] = NULL;
set_bit(FIMC_IS_GROUP_ACTIVE, &group->state);
break;
case GROUP_ID_3A1:
#ifdef USE_OTF_INTERFACE
sema_init(&group->smp_shot, MIN_OF_SHOT_RSC);
atomic_set(&group->smp_shot_count, MIN_OF_SHOT_RSC);
set_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state);
group->async_shots = MIN_OF_ASYNC_SHOTS;
group->sync_shots = MIN_OF_SYNC_SHOTS;
#else
sema_init(&group->smp_shot, 1);
atomic_set(&group->smp_shot_count, 1);
clear_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state);
group->async_shots = 0;
group->sync_shots = 1;
#endif
/* path configuration */
group->prev = NULL;
group->next = &device->group_isp;
group->subdev[ENTRY_SCALERC] = NULL;
group->subdev[ENTRY_DIS] = NULL;
group->subdev[ENTRY_TDNR] = NULL;
group->subdev[ENTRY_SCALERP] = NULL;
group->subdev[ENTRY_LHFD] = NULL;
set_bit(FIMC_IS_GROUP_ACTIVE, &group->state);
break;
case GROUP_ID_ISP:
sema_init(&group->smp_shot, 1);
atomic_set(&group->smp_shot_count, 1);
clear_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state);
group->async_shots = 0;
group->sync_shots = 1;
/* path configuration */
group->prev = &device->group_3ax;
group->next = NULL;
group->subdev[ENTRY_SCALERC] = &device->scc;
/* dis is not included to any group initially */
group->subdev[ENTRY_DIS] = NULL;
group->subdev[ENTRY_TDNR] = &device->dnr;
group->subdev[ENTRY_SCALERP] = &device->scp;
group->subdev[ENTRY_LHFD] = &device->fd;
device->scc.leader = leader;
device->dis.leader = leader;
device->dnr.leader = leader;
device->scp.leader = leader;
device->fd.leader = leader;
device->scc.group = group;
device->dis.group = group;
device->dnr.group = group;
device->scp.group = group;
device->fd.group = group;
set_bit(FIMC_IS_GROUP_ACTIVE, &group->state);
break;
case GROUP_ID_DIS:
sema_init(&group->smp_shot, 1);
atomic_set(&group->smp_shot_count, 1);
clear_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state);
group->async_shots = 0;
group->sync_shots = 1;
/* path configuration */
group->prev = NULL;
group->next = NULL;
group->subdev[ENTRY_SCALERC] = NULL;
group->subdev[ENTRY_DIS] = NULL;
group->subdev[ENTRY_TDNR] = NULL;
group->subdev[ENTRY_SCALERP] = NULL;
group->subdev[ENTRY_LHFD] = NULL;
clear_bit(FIMC_IS_GROUP_ACTIVE, &group->state);
break;
default:
merr("group id(%d) is invalid", vctx, id);
ret = -EINVAL;
goto p_err;
}
/* 5. Update Group Manager */
groupmgr->group[instance][id] = group;
atomic_inc(&groupmgr->group_cnt);
fimc_is_clock_set(device->interface->core, GROUP_ID_MAX, true);
set_bit(FIMC_IS_GROUP_OPEN, &group->state);
p_err:
return ret;
}
int fimc_is_group_close(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_video_ctx *vctx)
{
int ret = 0;
u32 i;
struct fimc_is_group_framemgr *gframemgr;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
BUG_ON(!vctx);
BUG_ON(!vctx->video);
if (!test_bit(FIMC_IS_GROUP_OPEN, &group->state)) {
merr("group%d already close", group, group->id);
ret = -EMFILE;
goto p_err;
}
if ((atomic_read(&vctx->video->refcount) == 1) &&
test_bit(FIMC_IS_GGROUP_INIT, &groupmgr->group_state[group->id]) &&
groupmgr->group_task[group->id]) {
set_bit(FIMC_IS_GGROUP_STOP, &groupmgr->group_state[group->id]);
/* flush semaphore shot */
atomic_inc(&group->smp_shot_count);
up(&group->smp_shot);
/* flush semaphore resource */
up(&groupmgr->group_smp_res[group->id]);
/* flush semaphore trigger */
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state))
up(&group->smp_trigger);
/*
* flush kthread wait until all work is complete
* it's dangerous if all is not finished
* so it's commented currently
* flush_kthread_worker(&groupmgr->group_worker[group->id]);
*/
kthread_stop(groupmgr->group_task[group->id]);
clear_bit(FIMC_IS_GGROUP_INIT, &groupmgr->group_state[group->id]);
}
groupmgr->group[group->instance][group->id] = NULL;
atomic_dec(&groupmgr->group_cnt);
/* all group is closed */
if (!groupmgr->group[group->instance][GROUP_ID_3A0] &&
!groupmgr->group[group->instance][GROUP_ID_3A1] &&
!groupmgr->group[group->instance][GROUP_ID_ISP] &&
!groupmgr->group[group->instance][GROUP_ID_DIS]) {
gframemgr = &groupmgr->framemgr[group->instance];
if (gframemgr->frame_free_cnt != FIMC_IS_MAX_GFRAME) {
mwarn("gframemgr free count is invalid(%d)", group,
gframemgr->frame_free_cnt);
INIT_LIST_HEAD(&gframemgr->frame_free_head);
gframemgr->frame_free_cnt = 0;
for (i = 0; i < FIMC_IS_MAX_GFRAME; ++i) {
gframemgr->frame[i].fcount = 0;
fimc_is_gframe_s_free(gframemgr,
&gframemgr->frame[i]);
}
}
}
clear_bit(FIMC_IS_GROUP_OPEN, &group->state);
p_err:
return ret;
}
int fimc_is_group_change(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group_isp,
struct fimc_is_frame *frame)
{
int ret = 0;
struct fimc_is_device_ischain *device;
struct fimc_is_subdev *leader_isp, *leader_dis;
struct fimc_is_group *group_dis;
BUG_ON(!groupmgr);
BUG_ON(!group_isp);
BUG_ON(!group_isp->device);
BUG_ON(!frame);
device = group_isp->device;
group_dis = &device->group_dis;
leader_dis = &group_dis->leader;
leader_isp = &group_isp->leader;
if (frame->shot_ext->request_dis) {
if (!test_bit(FIMC_IS_GROUP_READY, &group_dis->state)) {
merr("DIS group is not ready", group_dis);
frame->shot_ext->request_dis = 0;
ret = -EINVAL;
goto p_err;
}
if (!test_bit(FIMC_IS_GROUP_ACTIVE, &group_dis->state)) {
pr_info("[GRP%d] Change On\n", group_isp->id);
/* HACK */
sema_init(&group_dis->smp_trigger, 0);
group_isp->prev = &device->group_3ax;
group_isp->next = group_dis;
group_isp->subdev[ENTRY_SCALERC] = &device->scc;
group_isp->subdev[ENTRY_DIS] = &device->dis;
group_isp->subdev[ENTRY_TDNR] = NULL;
group_isp->subdev[ENTRY_SCALERP] = NULL;
group_isp->subdev[ENTRY_LHFD] = NULL;
group_dis->next = NULL;
group_dis->prev = group_isp;
group_dis->subdev[ENTRY_SCALERC] = NULL;
group_dis->subdev[ENTRY_DIS] = NULL;
group_dis->subdev[ENTRY_TDNR] = &device->dnr;
group_dis->subdev[ENTRY_SCALERP] = &device->scp;
group_dis->subdev[ENTRY_LHFD] = &device->fd;
device->scc.leader = leader_isp;
device->dis.leader = leader_isp;
device->dnr.leader = leader_dis;
device->scp.leader = leader_dis;
device->fd.leader = leader_dis;
device->scc.group = group_isp;
device->dis.group = group_isp;
device->dnr.group = group_dis;
device->scp.group = group_dis;
device->fd.group = group_dis;
set_bit(FIMC_IS_GROUP_ACTIVE, &group_dis->state);
}
} else {
if (test_bit(FIMC_IS_GROUP_ACTIVE, &group_dis->state)) {
pr_info("[GRP%d] Change Off\n", group_isp->id);
group_isp->prev = &device->group_3ax;
group_isp->next = NULL;
group_isp->subdev[ENTRY_SCALERC] = &device->scc;
group_isp->subdev[ENTRY_DIS] = &device->dis;
group_isp->subdev[ENTRY_TDNR] = &device->dnr;
group_isp->subdev[ENTRY_SCALERP] = &device->scp;
group_isp->subdev[ENTRY_LHFD] = &device->fd;
group_dis->next = NULL;
group_dis->prev = NULL;
group_dis->subdev[ENTRY_SCALERC] = NULL;
group_dis->subdev[ENTRY_DIS] = NULL;
group_dis->subdev[ENTRY_TDNR] = NULL;
group_dis->subdev[ENTRY_SCALERP] = NULL;
group_dis->subdev[ENTRY_LHFD] = NULL;
device->scc.leader = leader_isp;
device->dis.leader = leader_isp;
device->dnr.leader = leader_isp;
device->scp.leader = leader_isp;
device->fd.leader = leader_isp;
device->scc.group = group_isp;
device->dis.group = group_isp;
device->dnr.group = group_isp;
device->scp.group = group_isp;
device->fd.group = group_isp;
clear_bit(FIMC_IS_GROUP_ACTIVE, &group_dis->state);
}
}
p_err:
return ret;
}
int fimc_is_group_process_start(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_queue *queue)
{
int ret = 0;
struct fimc_is_device_sensor *sensor = NULL;
struct fimc_is_framemgr *framemgr = NULL;
u32 shot_resource = 1;
u32 sensor_fcount;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
BUG_ON(!queue);
if (test_bit(FIMC_IS_GROUP_READY, &group->state)) {
warn("already group start");
goto p_err;
}
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) {
framemgr = &queue->framemgr;
if (!framemgr) {
err("framemgr is null\n");
ret = -EINVAL;
goto p_err;
}
sensor = group->device->sensor;
if (!sensor) {
err("sensor is null\n");
ret = -EINVAL;
goto p_err;
}
/* async & sync shots */
if (sensor->framerate > 30)
group->async_shots = max_t(int, MIN_OF_ASYNC_SHOTS,
DIV_ROUND_UP(framemgr->frame_cnt, 3));
else
group->async_shots = MIN_OF_ASYNC_SHOTS;
group->sync_shots = max_t(int, MIN_OF_SYNC_SHOTS,
framemgr->frame_cnt - group->async_shots);
/* shot resource */
shot_resource = group->async_shots + MIN_OF_SYNC_SHOTS;
sema_init(&groupmgr->group_smp_res[group->id], shot_resource);
/* frame count */
sensor_fcount = atomic_read(&sensor->flite.fcount) + 1;
atomic_set(&group->sensor_fcount, sensor_fcount);
atomic_set(&group->backup_fcount, sensor_fcount - 1);
group->fcount = sensor_fcount - 1;
pr_info("[OTF] framerate: %d, async shots: %d, shot resource: %d\n",
sensor->framerate, group->async_shots, shot_resource);
}
sema_init(&group->smp_shot, shot_resource);
atomic_set(&group->smp_shot_count, shot_resource);
atomic_set(&group->scount, 0);
atomic_set(&group->rcount, 0);
sema_init(&group->smp_trigger, 0);
set_bit(FIMC_IS_GROUP_READY, &group->state);
p_err:
return ret;
}
int fimc_is_group_process_stop(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_queue *queue)
{
int ret = 0;
int retry;
u32 rcount;
struct fimc_is_framemgr *framemgr;
struct fimc_is_device_ischain *device;
struct fimc_is_device_sensor *sensor;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
BUG_ON(!queue);
if (!test_bit(FIMC_IS_GROUP_READY, &group->state)) {
warn("already group stop");
goto p_err;
}
device = group->device;
if (!device) {
merr("device is NULL", group);
ret = -EINVAL;
goto p_err;
}
sensor = device->sensor;
framemgr = &queue->framemgr;
if (test_bit(FIMC_IS_GROUP_REQUEST_FSTOP, &group->state)) {
set_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
clear_bit(FIMC_IS_GROUP_REQUEST_FSTOP, &group->state);
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state) &&
!list_empty(&group->smp_trigger.wait_list)) {
if (!sensor) {
warn("sensor is NULL, forcely trigger");
up(&group->smp_trigger);
goto check_completion;
}
if (!test_bit(FIMC_IS_SENSOR_FRONT_START, &sensor->state)) {
warn("front sensor is stopped, forcely trigger");
up(&group->smp_trigger);
goto check_completion;
}
if (!test_bit(FIMC_IS_SENSOR_BACK_START, &sensor->state)) {
warn("back sensor is stopped, forcely trigger");
up(&group->smp_trigger);
goto check_completion;
}
if (!test_bit(FIMC_IS_SENSOR_OPEN, &sensor->state)) {
warn("sensor is closed, forcely trigger");
up(&group->smp_trigger);
goto check_completion;
}
}
}
check_completion:
retry = 150;
while (--retry && framemgr->frame_req_cnt) {
pr_info("%d frame reqs waiting...\n", framemgr->frame_req_cnt);
msleep(20);
}
if (!retry) {
merr("waiting(until request empty) is fail", group);
ret = -EINVAL;
}
if (test_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state)) {
ret = fimc_is_itf_force_stop(device, GROUP_ID(group->id));
if (ret) {
merr("fimc_is_itf_force_stop is fail", group);
ret = -EINVAL;
}
} else {
ret = fimc_is_itf_process_stop(device, GROUP_ID(group->id));
if (ret) {
merr("fimc_is_itf_process_stop is fail", group);
ret = -EINVAL;
}
}
retry = 10;
while (--retry && framemgr->frame_pro_cnt) {
pr_info("%d frame pros waiting...\n", framemgr->frame_pro_cnt);
msleep(20);
}
if (!retry) {
merr("waiting(until process empty) is fail", group);
ret = -EINVAL;
}
rcount = atomic_read(&group->rcount);
if (rcount) {
merr("rcount is not empty(%d)", group, rcount);
ret = -EINVAL;
}
fimc_is_gframe_flush(groupmgr, group);
clear_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state);
clear_bit(FIMC_IS_GROUP_READY, &group->state);
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state))
pr_info("[OTF] sensor fcount: %d, fcount: %d\n",
atomic_read(&group->sensor_fcount), group->fcount);
p_err:
return ret;
}
int fimc_is_group_buffer_queue(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_queue *queue,
u32 index)
{
int ret = 0;
unsigned long flags;
struct fimc_is_framemgr *framemgr;
struct fimc_is_frame *frame;
struct fimc_is_subdev *leader, *scc, *dis, *scp;
struct fimc_is_queue *scc_queue, *dis_queue, *scp_queue;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
BUG_ON(!queue);
BUG_ON(index >= FRAMEMGR_MAX_REQUEST);
leader = &group->leader;
scc = group->subdev[ENTRY_SCALERC];
dis = group->subdev[ENTRY_DIS];
scp = group->subdev[ENTRY_SCALERP];
scc_queue = GET_SUBDEV_QUEUE(scc);
dis_queue = GET_SUBDEV_QUEUE(dis);
scp_queue = GET_SUBDEV_QUEUE(scp);
framemgr = &queue->framemgr;
/* 1. check frame validation */
frame = &framemgr->frame[index];
if (!frame) {
err("frame is null\n");
ret = -EINVAL;
goto p_err;
}
if (frame->init == FRAME_UNI_MEM) {
err("frame %d is NOT init", index);
ret = EINVAL;
goto p_err;
}
#ifdef MEASURE_TIME
#ifdef INTERNAL_TIME
do_gettimeofday(&frame->time_queued);
#endif
#endif
/* 2. update frame manager */
framemgr_e_barrier_irqs(framemgr, index, flags);
if (frame->state == FIMC_IS_FRAME_STATE_FREE) {
if (frame->req_flag) {
err("req_flag of buffer%d is not clear(%08X)",
frame->index, (u32)frame->req_flag);
frame->req_flag = 0;
}
if (test_bit(OUT_SCC_FRAME, &frame->out_flag)) {
err("scc output is not generated");
clear_bit(OUT_SCC_FRAME, &frame->out_flag);
}
if (test_bit(OUT_DIS_FRAME, &frame->out_flag)) {
err("dis output is not generated");
clear_bit(OUT_DIS_FRAME, &frame->out_flag);
}
if (test_bit(OUT_SCP_FRAME, &frame->out_flag)) {
err("scp output is not generated");
clear_bit(OUT_SCP_FRAME, &frame->out_flag);
}
if (scc_queue && frame->shot_ext->request_scc &&
!test_bit(FIMC_IS_QUEUE_STREAM_ON, &scc_queue->state)) {
frame->shot_ext->request_scc = 0;
err("scc %d frame is drop2", frame->fcount);
}
if (dis_queue && frame->shot_ext->request_dis &&
!test_bit(FIMC_IS_QUEUE_STREAM_ON, &dis_queue->state)) {
frame->shot_ext->request_dis = 0;
err("dis %d frame is drop2", frame->fcount);
}
if (scp_queue && frame->shot_ext->request_scp &&
!test_bit(FIMC_IS_QUEUE_STREAM_ON, &scp_queue->state)) {
frame->shot_ext->request_scp = 0;
err("scp %d frame is drop2", frame->fcount);
}
frame->fcount = frame->shot->dm.request.frameCount;
frame->rcount = frame->shot->ctl.request.frameCount;
frame->work_data1 = groupmgr;
frame->work_data2 = group;
#ifdef FIXED_FPS_DEBUG
frame->shot_ext->shot.ctl.aa.aeTargetFpsRange[0] = FIXED_FPS_VALUE;
frame->shot_ext->shot.ctl.aa.aeTargetFpsRange[1] = FIXED_FPS_VALUE;
frame->shot_ext->shot.ctl.sensor.frameDuration = 1000000000/FIXED_FPS_VALUE;
#endif
#ifdef ENABLE_FAST_SHOT
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state))
memcpy(&group->fast_ctl.aa, &frame->shot->ctl.aa,
sizeof(struct camera2_aa_ctl));
memcpy(&group->fast_ctl.scaler, &frame->shot->ctl.scaler,
sizeof(struct camera2_scaler_ctl));
#endif
fimc_is_frame_trans_fre_to_req(framemgr, frame);
} else {
err("frame(%d) is invalid state(%d)\n", index, frame->state);
fimc_is_frame_print_all(framemgr);
ret = -EINVAL;
}
framemgr_x_barrier_irqr(framemgr, index, flags);
fimc_is_group_start_trigger(groupmgr, group, frame);
p_err:
return ret;
}
int fimc_is_group_buffer_finish(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group, u32 index)
{
int ret = 0;
unsigned long flags;
struct fimc_is_framemgr *framemgr;
struct fimc_is_frame *frame;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(!group->leader.vctx);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
BUG_ON(index >= FRAMEMGR_MAX_REQUEST);
framemgr = GET_GROUP_FRAMEMGR(group);
/* 2. update frame manager */
framemgr_e_barrier_irqs(framemgr, index, flags);
fimc_is_frame_complete_head(framemgr, &frame);
if (frame) {
if (frame->index == index) {
fimc_is_frame_trans_com_to_fre(framemgr, frame);
frame->shot_ext->free_cnt = framemgr->frame_fre_cnt;
frame->shot_ext->request_cnt = framemgr->frame_req_cnt;
frame->shot_ext->process_cnt = framemgr->frame_pro_cnt;
frame->shot_ext->complete_cnt = framemgr->frame_com_cnt;
} else {
merr("buffer index is NOT matched(G%d, %d != %d)",
group, group->id, index, frame->index);
fimc_is_frame_print_all(framemgr);
ret = -EINVAL;
}
} else {
merr("frame is empty from complete", group);
fimc_is_frame_print_all(framemgr);
ret = -EINVAL;
}
framemgr_x_barrier_irqr(framemgr, index, flags);
#ifdef MEASURE_TIME
#ifdef INTERNAL_TIME
do_gettimeofday(&frame->time_dequeued);
measure_internal_time(&group->time,
&frame->time_queued, &frame->time_shot,
&frame->time_shotdone, &frame->time_dequeued);
#endif
#endif
return ret;
}
int fimc_is_group_start(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group,
struct fimc_is_frame *ldr_frame)
{
int ret = 0;
struct fimc_is_device_ischain *device;
struct fimc_is_group *group_next, *group_prev;
struct fimc_is_group_framemgr *gframemgr;
struct fimc_is_group_frame *gframe;
struct timeval curtime;
int async_step = 0;
bool try_sdown = false;
bool try_rdown = false;
do_gettimeofday(&curtime);
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(!group->leader.vctx);
BUG_ON(!group->start_callback);
BUG_ON(!group->device);
BUG_ON(!group->next && !group->prev);
BUG_ON(!ldr_frame);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
atomic_dec(&group->rcount);
if (test_bit(FIMC_IS_GROUP_FORCE_STOP, &group->state)) {
mwarn("g%dframe is cancelled(force stop)", group, group->id);
ret = -EINVAL;
goto p_err;
}
if (test_bit(FIMC_IS_GGROUP_STOP, &groupmgr->group_state[group->id])) {
merr("cancel by group stop1", group);
ret = -EINVAL;
goto p_err;
}
ret = down_interruptible(&group->smp_shot);
if (ret) {
err("down is fail1(%d)", ret);
goto p_err;
}
atomic_dec(&group->smp_shot_count);
try_sdown = true;
ret = down_interruptible(&groupmgr->group_smp_res[group->id]);
if (ret) {
err("down is fail2(%d)", ret);
goto p_err;
}
try_rdown = true;
if (test_bit(FIMC_IS_GROUP_OTF_INPUT, &group->state)) {
if (atomic_read(&group->smp_shot_count) < MIN_OF_SYNC_SHOTS) {
ret = down_interruptible(&group->smp_trigger);
if (ret) {
err("down is fail3(%d)", ret);
goto p_err;
}
} else {
/*
* backup fcount can not be bigger than sensor fcount
* otherwise, duplicated shot can be generated.
* this is problem can be caused by hal qbuf timing
*/
if (atomic_read(&group->backup_fcount) >=
atomic_read(&group->sensor_fcount)) {
ret = down_interruptible(&group->smp_trigger);
if (ret) {
err("down is fail4(%d)", ret);
goto p_err;
}
} else {
/*
* this statement is execued only at initial.
* automatic increase the frame count of sensor
* for next shot without real frame start
*/
/* it's a async shot time */
async_step = 1;
}
}
ldr_frame->fcount = atomic_read(&group->sensor_fcount);
atomic_set(&group->backup_fcount, ldr_frame->fcount);
ldr_frame->shot->dm.request.frameCount = ldr_frame->fcount;
ldr_frame->shot->dm.sensor.timeStamp =
(uint64_t)curtime.tv_sec * 1000000 + curtime.tv_usec;
/* real automatic increase */
if (async_step &&
(atomic_read(&group->smp_shot_count) > MIN_OF_SYNC_SHOTS))
atomic_inc(&group->sensor_fcount);
}
if (test_bit(FIMC_IS_GGROUP_STOP, &groupmgr->group_state[group->id])) {
err("cancel by group stop2");
ret = -EINVAL;
goto p_err;
}
#ifdef ENABLE_VDIS
if (group->id == GROUP_ID_ISP)
fimc_is_group_change(groupmgr, group, ldr_frame);
/* HACK */
if ((group->id == GROUP_ID_DIS) &&
test_bit(FIMC_IS_GROUP_ACTIVE, &group->state))
down(&group->smp_trigger);
#endif
device = group->device;
group_next = group->next;
group_prev = group->prev;
gframemgr = &groupmgr->framemgr[group->instance];
if (!gframemgr) {
err("gframemgr is NULL(instance %d)", group->instance);
ret = -EINVAL;
goto p_err;
}
if (group_prev && !group_next) {
/* tailer */
spin_lock_irq(&gframemgr->frame_slock);
fimc_is_gframe_group_head(group, &gframe);
if (!gframe) {
spin_unlock_irq(&gframemgr->frame_slock);
merr("g%dframe is NULL1", group, group->id);
warn("GRP%d(res %d, rcnt %d), GRP2(res %d, rcnt %d)",
device->group_3ax.id,
groupmgr->group_smp_res[device->group_3ax.id].count,
atomic_read(&device->group_3ax.rcount),
groupmgr->group_smp_res[device->group_isp.id].count,
atomic_read(&device->group_isp.rcount));
ret = -EINVAL;
goto p_err;
}
if (ldr_frame->fcount != gframe->fcount) {
mwarn("grp%d shot mismatch(%d != %d)", group, group->id,
ldr_frame->fcount, gframe->fcount);
gframe = fimc_is_gframe_rewind(groupmgr, group,
ldr_frame->fcount);
if (!gframe) {
spin_unlock_irq(&gframemgr->frame_slock);
merr("rewinding is fail,can't recovery", group);
goto p_err;
}
}
fimc_is_gframe_trans_grp_to_fre(group, gframemgr, gframe);
spin_unlock_irq(&gframemgr->frame_slock);
} else if (!group_prev && group_next) {
/* leader */
group->fcount++;
spin_lock_irq(&gframemgr->frame_slock);
fimc_is_gframe_free_head(gframemgr, &gframe);
if (!gframe) {
spin_unlock_irq(&gframemgr->frame_slock);
merr("g%dframe is NULL2", group, group->id);
warn("GRP%d(res %d, rcnt %d), GRP2(res %d, rcnt %d)",
device->group_3ax.id,
groupmgr->group_smp_res[device->group_3ax.id].count,
atomic_read(&device->group_3ax.rcount),
groupmgr->group_smp_res[device->group_isp.id].count,
atomic_read(&device->group_isp.rcount));
ret = -EINVAL;
goto p_err;
}
if (!test_bit(FIMC_IS_ISCHAIN_REPROCESSING, &device->state) &&
(ldr_frame->fcount != group->fcount)) {
if (ldr_frame->fcount > group->fcount) {
warn("grp%d shot mismatch(%d != %d)", group->id,
ldr_frame->fcount, group->fcount);
group->fcount = ldr_frame->fcount;
} else {
spin_unlock_irq(&gframemgr->frame_slock);
err("grp%d shot mismatch(%d, %d)", group->id,
ldr_frame->fcount, group->fcount);
group->fcount--;
ret = -EINVAL;
goto p_err;
}
}
gframe->fcount = ldr_frame->fcount;
fimc_is_gframe_trans_fre_to_grp(gframemgr, group_next, gframe);
spin_unlock_irq(&gframemgr->frame_slock);
} else if (group_prev && group_next) {
spin_lock_irq(&gframemgr->frame_slock);
fimc_is_gframe_group_head(group, &gframe);
if (!gframe) {
spin_unlock_irq(&gframemgr->frame_slock);
merr("g%dframe is NULL3", group, group->id);
warn("GRP%d(res %d, rcnt %d), GRP2(res %d, rcnt %d)",
device->group_3ax.id,
groupmgr->group_smp_res[device->group_3ax.id].count,
atomic_read(&device->group_3ax.rcount),
groupmgr->group_smp_res[device->group_isp.id].count,
atomic_read(&device->group_isp.rcount));
ret = -EINVAL;
goto p_err;
}
if (ldr_frame->fcount != gframe->fcount) {
mwarn("grp%d shot mismatch(%d != %d)", group, group->id,
ldr_frame->fcount, gframe->fcount);
gframe = fimc_is_gframe_rewind(groupmgr, group,
ldr_frame->fcount);
if (!gframe) {
spin_unlock_irq(&gframemgr->frame_slock);
merr("rewinding is fail,can't recovery", group);
goto p_err;
}
}
fimc_is_gframe_trans_grp_to_grp(group, group_next, gframe);
spin_unlock_irq(&gframemgr->frame_slock);
} else {
err("X -> %d -> X", group->id);
ret = -EINVAL;
goto p_err;
}
ret = group->start_callback(group->device, ldr_frame);
if (ret) {
merr("start_callback is fail", group);
fimc_is_group_cancel(group, ldr_frame);
fimc_is_group_done(groupmgr, group);
} else {
atomic_inc(&group->scount);
}
return ret;
p_err:
fimc_is_group_cancel(group, ldr_frame);
if (try_sdown) {
atomic_inc(&group->smp_shot_count);
up(&group->smp_shot);
}
if (try_rdown)
up(&groupmgr->group_smp_res[group->id]);
return ret;
}
int fimc_is_group_done(struct fimc_is_groupmgr *groupmgr,
struct fimc_is_group *group)
{
int ret = 0;
u32 resources;
BUG_ON(!groupmgr);
BUG_ON(!group);
BUG_ON(group->instance >= FIMC_IS_MAX_NODES);
BUG_ON(group->id >= GROUP_ID_MAX);
#ifdef ENABLE_VDIS
/* current group notify to next group that shot done is arrvied */
/* HACK */
if (group->next && (group->id == GROUP_ID_ISP) &&
test_bit(FIMC_IS_GROUP_ACTIVE, &group->next->state))
up(&group->next->smp_trigger);
#endif
/* check shot & resource count validation */
resources = group->async_shots + group->sync_shots;
if (group->smp_shot.count >= resources) {
merr("G%d, shot count is invalid(%d >= %d+%d)", group,
group->id, group->smp_shot.count, group->async_shots,
group->sync_shots);
atomic_set(&group->smp_shot_count, resources - 1);
sema_init(&group->smp_shot, resources - 1);
}
if (groupmgr->group_smp_res[group->id].count >= resources) {
merr("G%d, resource count is invalid(%d >= %d+%d)", group,
group->id, groupmgr->group_smp_res[group->id].count,
group->async_shots, group->sync_shots);
sema_init(&groupmgr->group_smp_res[group->id], resources - 1);
}
clear_bit(FIMC_IS_GROUP_RUN, &group->state);
atomic_inc(&group->smp_shot_count);
up(&group->smp_shot);
up(&groupmgr->group_smp_res[group->id]);
return ret;
}
| {'content_hash': '8e5b40ec3db1f48a97c8debc380bc91f', 'timestamp': '', 'source': 'github', 'line_count': 1536, 'max_line_length': 79, 'avg_line_length': 26.80859375, 'alnum_prop': 0.6618825586478216, 'repo_name': 'wilseypa/odroidNetworking', 'id': 'f7958c2fb4fa931de2a8516f709892f631bdb8e2', 'size': '41511', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'linux/drivers/media/video/exynos/fimc-is-mc2/fimc-is-groupmgr.c', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '4528'}, {'name': 'Assembly', 'bytes': '8990744'}, {'name': 'Awk', 'bytes': '22062'}, {'name': 'C', 'bytes': '415046807'}, {'name': 'C++', 'bytes': '5249015'}, {'name': 'Erlang', 'bytes': '198341'}, {'name': 'Groovy', 'bytes': '130'}, {'name': 'JavaScript', 'bytes': '1816659'}, {'name': 'Objective-C', 'bytes': '1375494'}, {'name': 'Objective-C++', 'bytes': '10878'}, {'name': 'PHP', 'bytes': '17120'}, {'name': 'Perl', 'bytes': '6383015'}, {'name': 'Python', 'bytes': '930668'}, {'name': 'R', 'bytes': '98681'}, {'name': 'Ruby', 'bytes': '9400'}, {'name': 'Scala', 'bytes': '12158'}, {'name': 'Scilab', 'bytes': '21433'}, {'name': 'Shell', 'bytes': '2451055'}, {'name': 'TeX', 'bytes': '51371'}, {'name': 'UnrealScript', 'bytes': '20838'}, {'name': 'VimL', 'bytes': '1355'}, {'name': 'XSLT', 'bytes': '3937'}]} |
<!doctype html>
<html>
<head>
<title>KeyDown Combo jQuery Plugin</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" language="javascript" src="../jquery/jquery-1.9.1.js"></script>
<script type="text/javascript" language="javascript" src="../src/jquery.keycombo.js"></script>
<link rel="stylesheet" type="text/css" href="example.css" />
<script type="text/javascript">
$(function() {
$("#input").keyDownCombo({
keys: ["Q", "W", "E", "R"],
igrone: [17],
limitType: 3,
delayTime: 1500,
onComplete: function() { alert("success!"); },
onTimeOutError: function() { alert("timeout"); },
onKeyError: function() { alert("fail!please retry."); }
});
});
</script>
</head>
<body>
<div class="wrapper">
<div id="main">
<h2>Example</h2>
<div class="block">
<h3>Input<h3>
<h4>press these keys on input</h4>
<span class="keys">QWER</span>
<div><input id="input" type="text" value="" size="25" /></div>
<pre>
$("#input").keyDownCombo({
keys: ["Q", "W", "E", "R"],
igrone: [17],
limitType: 3,
delayTime: 1500,
onComplete: function() { alert("success!"); },
onTimeOutError: function() { alert("timeout"); },
onKeyError: function() { alert("fail!please retry."); }
});</pre>
</div>
<div class="back">
<a href="index.html">Back</a>
</div>
<div class="author">-- <a href="https://github.com/Archer8685" title="Archer Hsieh, front-end developer" target="_blank">Archer Hsieh</a></div>
</div>
</div>
</body>
</html> | {'content_hash': '0f3ef537059defbd937ede684bc3dfed', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 151, 'avg_line_length': 34.72549019607843, 'alnum_prop': 0.5347261434217956, 'repo_name': 'Archer8685/jquery-keydowncombo', 'id': 'd3bae96f445b833fa04d9069c8a2fac3fcc5545f', 'size': '1773', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'examples/input.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '965'}, {'name': 'JavaScript', 'bytes': '9924'}]} |
module Azure::Network::Mgmt::V2019_11_01
module Models
#
# Tap configuration in a Network Interface.
#
class NetworkInterfaceTapConfiguration < SubResource
include MsRestAzure
# @return [VirtualNetworkTap] The reference to the Virtual Network Tap
# resource.
attr_accessor :virtual_network_tap
# @return [ProvisioningState] The provisioning state of the network
# interface tap configuration resource. Possible values include:
# 'Succeeded', 'Updating', 'Deleting', 'Failed'
attr_accessor :provisioning_state
# @return [String] The name of the resource that is unique within a
# resource group. This name can be used to access the resource.
attr_accessor :name
# @return [String] A unique read-only string that changes whenever the
# resource is updated.
attr_accessor :etag
# @return [String] Sub Resource type.
attr_accessor :type
#
# Mapper for NetworkInterfaceTapConfiguration class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'NetworkInterfaceTapConfiguration',
type: {
name: 'Composite',
class_name: 'NetworkInterfaceTapConfiguration',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
virtual_network_tap: {
client_side_validation: true,
required: false,
serialized_name: 'properties.virtualNetworkTap',
type: {
name: 'Composite',
class_name: 'VirtualNetworkTap'
}
},
provisioning_state: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
etag: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'etag',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
| {'content_hash': 'd81328b2c5072a5755c1924f850f9ea0', 'timestamp': '', 'source': 'github', 'line_count': 102, 'max_line_length': 76, 'avg_line_length': 30.41176470588235, 'alnum_prop': 0.4858156028368794, 'repo_name': 'Azure/azure-sdk-for-ruby', 'id': '8e8971c4693060adb73f9719ecc95906487dacc7', 'size': '3266', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'management/azure_mgmt_network/lib/2019-11-01/generated/azure_mgmt_network/models/network_interface_tap_configuration.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '345216400'}, {'name': 'Shell', 'bytes': '305'}]} |
require 'open-uri'
require 'json'
require 'yaml'
require 'erb'
require 'tilt'
require 'dotenv'
Dotenv.load
module Slnky
class << self
def config
Slnky::Config.instance
end
end
class Config < Data
class << self
def configure(name, config={})
config.deep_stringify_keys!
@name = name
@environment = ENV['SLNKY_ENV'] || config['environment'] || 'development'
config['service'] = name
config['environment'] = @environment
file = ENV['SLNKY_CONFIG']||"~/.slnky/config.yaml"
config.merge!(config_file(file))
server = ENV['SLNKY_URL']||config['url']
config.merge!(config_server(server))
@config = self.new(config)
end
# def load_file(file)
# self.load(YAML.load_file(File.expand_path(file)))
# end
def instance
@config || configure('unknown')
end
def reset!
@config = nil
end
# def merge(config)
# @config.merge!(config)
# end
protected
def config_file(file)
return {} if file =~ /\~/ && !ENV['HOME']
path = File.expand_path(file)
return {} unless File.exists?(path)
template = Tilt::ERBTemplate.new(path)
output = template.render(self, {})
cfg = YAML.load(output)
cfg = cfg['slnky'] || cfg
cfg = cfg[@environment] || cfg
cfg
rescue => e
puts "failed to load file #{file}: #{e.message}"
{}
end
def config_server(server)
return {} unless server
server = "https://#{server}" unless server =~ /^http/
JSON.parse(open("#{server}/configs/#{@name}") { |f| f.read })
rescue => e
puts "failed to load server #{server}: #{e.message}"
{}
end
end
def development?
!self.environment || self.environment == 'development'
end
def production?
self.environment == 'production'
end
def test?
self.environment == 'test'
end
end
end
| {'content_hash': '16b0d2348654646614790b2243557471', 'timestamp': '', 'source': 'github', 'line_count': 86, 'max_line_length': 81, 'avg_line_length': 23.63953488372093, 'alnum_prop': 0.5514018691588785, 'repo_name': 'slnky/slnky-cli', 'id': 'c5588eb53fa5b63c8b8c5e5d9d185df13449f87a', 'size': '2033', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/slnky/config.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '7366'}, {'name': 'Ruby', 'bytes': '41652'}, {'name': 'Shell', 'bytes': '131'}]} |
package org.kuali.mobility.events.util;
import org.apache.commons.collections.Predicate;
import org.kuali.mobility.events.entity.Category;
public final class CategoryPredicate implements Predicate {
private String campus;
private String category;
public CategoryPredicate(final String campus, final String category) {
this.setCampus(campus);
this.setCategory(category);
}
@Override
public boolean evaluate(Object obj) {
boolean campusMatch = false;
boolean categoryMatch = false;
if (obj instanceof Category) {
if (getCampus() == null) {
campusMatch = true;
}
if (getCampus() != null && getCampus().equalsIgnoreCase(((Category) obj).getCampus())) {
campusMatch = true;
}
if (getCategory() == null) {
categoryMatch = true;
}
if (getCategory() != null && getCategory().equalsIgnoreCase(((Category) obj).getCategoryId())) {
categoryMatch = true;
}
}
return campusMatch && categoryMatch;
}
/**
* @return the category
*/
public String getCategory() {
return category;
}
/**
* @param category the category to set
*/
public void setCategory(String category) {
this.category = category;
}
/**
* @return the campus
*/
public String getCampus() {
return campus;
}
/**
* @param campus the campus to set
*/
public void setCampus(String campus) {
this.campus = campus;
}
}
| {'content_hash': 'd20b3d331de070d3b35fbe68aad619a4', 'timestamp': '', 'source': 'github', 'line_count': 69, 'max_line_length': 99, 'avg_line_length': 19.869565217391305, 'alnum_prop': 0.6790663749088257, 'repo_name': 'tamerman/mobile-starting-framework', 'id': 'ec2c366bbd5a73fd2585cd53be96097bd9c15d55', 'size': '2514', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'events/api/src/main/java/org/kuali/mobility/events/util/CategoryPredicate.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '182546'}, {'name': 'HTML', 'bytes': '1176'}, {'name': 'Java', 'bytes': '4428458'}, {'name': 'JavaScript', 'bytes': '1634723'}]} |
(function(){
'use strict';
angular.module('schools').controller('ClassesModalController', function ($modalInstance, school,schoolclass,$filter,$window) {
var vm = this;
vm.school=school;
vm.schoolclass = schoolclass;
vm.addSubject = function() {
vm.schoolclass.subjects.push({
});
};
vm.showSubjectName = function(c){
var result = $window._.findWhere(vm.school.subjects, {_id : c});
if(result)
return result.name;
else
return 'empty';
};
vm.saveTable = function() {
var results = [];
for (var i = vm.schoolclass.subjects.length; i--;) {
var ans = vm.schoolclass.subjects[i];
// actually delete user
if (ans.isDeleted) {
vm.schoolclass.subjects.splice(i, 1);
}
// mark as not new
if (ans.isNew) {
ans.isNew = false;
}
// send on server
//results.push($http.post('/saveUser', user));
}
//return $q.all(results);
};
// mark user as deleted
vm.deleteSubject = function(id) {
var filtered = $filter('filter')(vm.schoolclass.subjects, {id: id});
if (filtered.length) {
filtered[0].isDeleted = true;
}
};
vm.cancel = function () {
$modalInstance.dismiss('cancel');
};
vm.save = function () {
$modalInstance.close(vm.schoolclass);
};
});
})();
(function(){
'use strict';
angular.module('schools').controller('ConfirmDeleteSchoolClassesController', function ($modalInstance,school,schoolclass) {
var vm = this;
vm.school=school;
vm.schoolclass = schoolclass;
vm.ok = function () {
//$modalInstance.close(vm.selected.item);
};
vm.cancel = function () {
$modalInstance.dismiss('cancel');
};
vm.delete = function () {
$modalInstance.close(vm.schoolclass);
};
});
})();
| {'content_hash': 'dcfc6f6f826c15ea66e65cdea2b979a4', 'timestamp': '', 'source': 'github', 'line_count': 89, 'max_line_length': 130, 'avg_line_length': 22.820224719101123, 'alnum_prop': 0.5332348596750369, 'repo_name': 'georgekach/assess', 'id': '4393a7c2ce55e61869ff85084ba8bc00b0a779d0', 'size': '2031', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'modules/schools/client/controllers/classes-modal.client.controller.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '206350'}, {'name': 'CoffeeScript', 'bytes': '1656'}, {'name': 'HTML', 'bytes': '279028'}, {'name': 'JavaScript', 'bytes': '1705089'}, {'name': 'Makefile', 'bytes': '3906'}, {'name': 'PowerShell', 'bytes': '468'}, {'name': 'Shell', 'bytes': '685'}]} |
const { reIsNativeFn } = require('../../internal/patterns.js');
const fn = require('./fn.js');
/**
*
* @function
* @memberof is
* @param {any}
* @returns {Boolean}
*/
module.exports = function nativeFunction(value) {
return fn(value) && reIsNativeFn.test(value.toString());
}
| {'content_hash': '4dc0c3f36dc84db01e255b9d5902eb1c', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 63, 'avg_line_length': 21.846153846153847, 'alnum_prop': 0.6408450704225352, 'repo_name': 'adriancmiranda/describe-type', 'id': 'a164ad4f3a9040f6f212c5866cb555db4b027468', 'size': '284', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'is/fn/fn.native.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '360363'}]} |
title: TestErrorException — Eregansu Core Library Tests
package: lib-tests
packageTitle: Eregansu Core Library Tests
layout: default
className: TestErrorException
type: class
---
# TestErrorException
<code>TestErrorException</code> is a class derived from <code><a href="TestHarness">TestHarness</a></code>.
<a href="https://github.com/eregansu/lib/blob/master/t/error-exception.php">View source</a>
## Public Methods
* <code><a href="TestErrorException%3A%3Amain">TestErrorException::main</a>()</code>
| {'content_hash': 'd4e6b5c86f4346b57552303d89590446', 'timestamp': '', 'source': 'github', 'line_count': 18, 'max_line_length': 107, 'avg_line_length': 28.27777777777778, 'alnum_prop': 0.7662082514734774, 'repo_name': 'eregansu/eregansu.github.com', 'id': 'ac4a779fd4cfcad6fa2293d6beb4191a1055fd03', 'size': '515', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'TestErrorException.md', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '8049'}]} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_16.html">Class Test_AbaRouteValidator_16</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_35689_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_16.html?line=16600#src-16600" >testAbaNumberCheck_35689_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:45:10
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_35689_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=15094#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | {'content_hash': '771ee4c22241067eb9db0752205490ba', 'timestamp': '', 'source': 'github', 'line_count': 209, 'max_line_length': 297, 'avg_line_length': 43.92822966507177, 'alnum_prop': 0.5097483934211959, 'repo_name': 'dcarda/aba.route.validator', 'id': 'b1a4f9f0444ea6b27f5d4fe2b4b6f88995377fc6', 'size': '9181', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_16_testAbaNumberCheck_35689_good_bna.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '18715254'}]} |
Backstretch is a simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. The image will stretch to fit the page/element, and will automatically resize as the window/element size changes.
## Original Repository
Is here: https://github.com/srobbin/jquery-backstretch
But we haven't seen any kind of activity by the author for about 2 years already. So I've taken the PRs that were there and merged them carefully, with some improvements and cleanup. This fork is the result.
## Demo
There are a couple of examples included with this package, or feel free to check it out live [on the project page itself](http://srobbin.com/jquery-plugins/backstretch/).
## Installation
1. Download/save the JS file from GitHub.
2. Install via Bower with the following command.
```
bower install jquery-backstretch-2
```
## Setup
Include the jQuery library (version 1.7 or newer) and Backstretch plugin files in your webpage (preferably at the bottom of the page, before the closing BODY tag):
```html
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="jquery.backstretch.min.js"></script>
<script>
// To attach Backstrech as the body's background
$.backstretch("path/to/image.jpg");
// You may also attach Backstretch to a block-level element
$(".foo").backstretch("path/to/image.jpg");
// If your element defines a background image with CSS, you can omit the argement altogether
$(".foo").backstretch();
// Or, to start a slideshow, just pass in an array of images
$(".foo").backstretch([
"path/to/image.jpg",
"path/to/image2.jpg",
"path/to/image3.jpg"
], {duration: 4000});
// Or, to load from a url that can accept a resolution and provide the best image for that resolution
$(".foo").backstretch([
"path/to/image.jpg?width={width}&height={height}"
]);
// Or, to automatically choose from a set of resolutions.
// The width is the width of the image, and the algorithm chooses the best fit.
$(".foo").backstretch([
[
{ width: 1080, url: "path/to/image1_1080.jpg" },
{ width: 720, url: "path/to/image1_720.jpg" },
{ width: 320, url: "path/to/image1_320.jpg" }
],
[
{ width: 1080, url: "path/to/image2_1080.jpg" },
{ width: 720, url: "path/to/image2_720.jpg" },
{ width: 320, url: "path/to/image2_320.jpg" }
]
]);
// If we wanted to specify different images for different pixel-ratios:
$(".foo").backstretch([
[
// Will only be chosed for a @2x device
{ width: 1080, url: "path/to/[email protected]", pixelRatio: 2 },
// Will only be chosed for a @1x device
{ width: 1080, url: "path/to/image1_1080.jpg", pixelRatio: 1 },
{ width: 720, url: "path/to/[email protected]", pixelRatio: 2 },
{ width: 720, url: "path/to/image1_720.jpg", pixelRatio: 1 },
{ width: 320, url: "path/to/[email protected]", pixelRatio: 2 },
{ width: 320, url: "path/to/image1_320.jpg", pixelRatio: 1 }
]
]);
// If we wanted the browser to automatically choose from a set of resolutions,
// While considering the pixel-ratio of the device
$(".foo").backstretch([
[
// Will be chosen for a 2160 device or a 1080*2 device
{ width: 2160, url: "path/to/image1_2160.jpg", pixelRatio: "auto" },
// Will be chosen for a 1080 device or a 540*2 device
{ width: 1080, url: "path/to/image1_1080.jpg", pixelRatio: "auto" },
// Will be chosen for a 1440 device or a 720*2 device
{ width: 1440, url: "path/to/image1_1440.jpg", pixelRatio: "auto" },
{ width: 720, url: "path/to/image1_720.jpg", pixelRatio: "auto" },
{ width: 640, url: "path/to/image1_640.jpg", pixelRatio: "auto" },
{ width: 320, url: "path/to/image1_320.jpg", pixelRatio: "auto" }
]
]);
</script>
```
## Automatic resolution selection
The automatic resolution selection algorithm has multiple options to choose from.
The default behaviour is that it matches the logical width of the element against the specified image sizes. Which means that an element with a 320px width on a @2x device is still considered as 320px.
If you want 320px on a @2x device to be considered as 640px, then you can specify `pixelRatio: "auto"` on the specific image resolution.
However if you want to limit specific images to only be chosen if the device has a certain pixel ratio - you can specify that pixel ratio i.e `pixelRatio: 2.5`.
## Options
| Name | Description | Type | Default |
|------|-------------|------|---------|
| `alignX` * | This parameter controls the horizontal alignment of the image. Can be 'center'/'left'/'right' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `alignY` * | This parameter controls the vertical alignment of the image. Can be 'center'/'top'/'bottom' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `transition` * | Type of transition to use. If multiple are specified, then it will be chosed randomly | String or Array<String> | 'fade' |
| `transitionDuration` * | This is the duration at which the image will transition in. Integers in milliseconds are accepted, as well as standard jQuery speed strings (slow, normal, fast). | Integer or String | 0 |
| `transitionEasing` * | The easing function that will be used for animations. | Any supported jQuery easing value | *jQuery default* |
| `animateFirst` | If `true`, the first image will transition in like all the others. | Boolean | true |
| `fade` * | Sets `transition` to `'fade'` and `transitionDuration` to whatever value was specified. | Integer or String | |
| `fadeFirst` | Synonym for `animateFirst` | Boolean | true |
| `duration` * | The amount of time in between slides, when using Backstretch as a slideshow, expressed as the number of milliseconds. | Integer | 5000 |
| `paused` | For slideshows: Disables the change between slides | Boolean | false |
| `start` | The index of the image in the array you want to start your slideshow with. | Integer | 0 |
| `preload` | How many images to preload at once? I.e. Lazy-loading can be enabled by specifying 0. | Integer | 2 |
| `preloadSize` | How many images to preload in parallel? If we are preloading 5 images for the next slides, we might want to still limit it to only preload 2 or 3 at once, according to the expected available bandwidth. | Integer | 1 |
| `bypassCss` | Avoid adding any CSS to the IMG element. I.e if you want a dynamic IMG tag that is laid out with the content. | Boolean | false |
| `alwaysTestWindowResolution` | Always test against window's width instead of the element's width. | Boolean | false |
| `resolutionRefreshRate` | Threshold for how long to wait before the image resolution will be switched? | Integer | 2500 |
| `resolutionChangeRatioThreshold` | Threshold for how much should the different in the resolution be before switch image | Number | 0.1 (10%) |
| `centeredX` | Deprecated. Still works but please do not use it. | Boolean | true |
| `centeredY` | Deprecated. Still works but please do not use it. | Boolean | true |
* Options marked with an `*` can be specified for individual images
## Image definition
Each image in the set can be a String specifying the URL for the image, *or* an object with the following options, *or* an array of images for different resolutions to choose between.
A url can be a url to a video also.
Currently the plugin will automatically recognize a *youtube* url. If you pass urls to raw videos, you have to specify `isVideo: true`.
| Name | Description | Type | Default |
|------|-------------|------|---------|
| `url` | The url of the image or video | String | |
| `alt` | The alternative text for this image (If you want to play along with screen readers) | String | '' |
| `alignX` | This parameter controls the horizontal alignment of the image. Can be 'center'/'left'/'right' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `alignY` | This parameter controls the vertical alignment of the image. Can be 'center'/'top'/'bottom' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `transition` | Type of transition to use. If multiple are specified, then it will be chosed randomly | String or Array<String> | 'fade' |
| `transitionDuration` | This is the duration at which the image will transition in. Integers in milliseconds are accepted, as well as standard jQuery speed strings (slow, normal, fast). | Integer or String | 0 |
| `transitionEasing` | The easing function that will be used for animations. | Any supported jQuery easing value | *jQuery default* |
| `fade` | Sets `transition` to `'fade'` and `transitionDuration` to whatever value was specified. | Integer or String | |
| `duration` | The amount of time in between slides, when using Backstretch as a slideshow, expressed as the number of milliseconds. | Integer | 5000 |
| `isVideo` | Tell the plugin the this is a video (if cannot be recognized automatically) | Boolean | false |
| `loop` | Should the video be looped? If yes, then the duration will be used to determine when to stop. | Boolean | false |
| `mute` | Should the video be muted? | Boolean | true |
| `poster` | This is for specifying the `poster` attribute in standard <video> tags | String | |
## Per-resolution-image definition
If you have specified an array of resolutions for a single image, then these are the available options:
| Name | Description | Type | Default |
|------|-------------|------|---------|
| `url` | The url of the image | String | |
| `url` for `<video>` | Instead of a single `url`, an array of sources can be specified. Each source has a `src` and `type` attributes. | Array of `{ src, type }` | |
| `alt` | The alternative text for this image (If you want to play along with screen readers) | String | '' |
| `width` | The width of the image | Integer | |
| `pixelRatio` | A strict rule to only choose for the specified device pixel ratio. If set to 'auto', then the element's width will first be multiplied by the device's pixel ratio before evaluating. | Number or "auto" | undefined |
| `deviceOrientation` | Restrict image selection to specific device orientation | `'landscape'` or `'portrait'` | undefined |
| `windowOrientation` | Restrict image selection to specific window orientation (based on current window's inner width/height) | `'landscape'` / `'portrait'` / `'square'` | undefined |
| `orientation` | Restrict image selection to the element's orientation based on the element's current inner width/height) | `'landscape'` / `'portrait'` / `'square'` | undefined |
| `alignX` | This parameter controls the horizontal alignment of the image. Can be 'center'/'left'/'right' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `alignY` | This parameter controls the vertical alignment of the image. Can be 'center'/'top'/'bottom' or any number between 0.0 and 1.0. | Integer or String | 0.5 |
| `fade` | This is the speed at which the image will fade in. Integers in milliseconds are accepted, as well as standard jQuery speed strings (slow, normal, fast). | Integer or String | 0 |
| `duration` | The amount of time in between slides, when using Backstretch as a slideshow, expressed as the number of milliseconds. | Integer | 5000 |
## Transitions
* `'fade'`
* `'fade_in_out'` / `'fadeInOut'`
* `'push_left'` / `'pushLeft'`
* `'push_right'` / `'pushRight'`
* `'push_up'` / `'pushUp'`
* `'push_down'` / `'pushDown'`
* `'cover_left'` / `'coverLeft'`
* `'cover_right'` / `'coverRight'`
* `'cover_up'` / `'coverUp'`
* `'cover_down'` / `'coverDown'`
## Notes about video support:
* If the video is not in `loop` mode, then it will play until the end. You have to specify a duration for the specific video in order to limit its playing duration.
* Mobile browsers do not allow playback of videos without the users tapping a play button... So you may want to detect those and supply different media arrays for those browsers.
## Slideshow API
Once you've instantiated a Backstretch slideshow, there are many actions that you can perform it:
```javascript
// Start a slideshow
$('.foo').backstretch([
'path/to/image.jpg',
'path/to/image2.jpg',
'path/to/image3.jpg'
]);
// Slideshow with granular control
$('.foo').backstretch([
{ url: 'path/to/image.jpg', duration: 3000 }
{ url: 'path/to/image2.jpg', fade: 250 },
{ url: 'path/to/image3.jpg', alignY: 0.2 }
]);
// Pause the slideshow
$('.foo').backstretch("pause");
// Advance to the next slide
$('.foo').backstretch("next");
```
| Method | Description |
|------|-------------|
| `.backstretch("show", n)` | Jump to the slide at a given index, where n is the number of the image that you'd like to display. Slide number starts at 0. |
| `.backstretch("prev")` | Display the previous image in a slideshow. |
| `.backstretch("next")` | Advance to the next image in a slideshow. |
| `.backstretch("pause")` | Pause the slideshow. |
| `.backstretch("resume")` | Resume a paused slideshow. |
| `.backstretch("destroy", preserveBackground)` | Destroy the Backstretch instance. Optionally, you can pass in a Boolean parameter, preserveBackground, to determine whether or not you'd like to keep the current image stretched as the background image. |
| `.backstretch("resize")` | This method is called automatically when the container (window or block-level element) is resized, however you can always call this manually if needed. |
| `.backstretch("current")` | This function returns the index of the current slide |
## Public Variables
Sometimes, you'll want to access Backstretch's images after you've instantiated the plugin. For example, perhaps you'd like to be able add more images to a slideshow. Doing so is easy. You can access the images array as follows:
```javascript
$('.foo').backstretch([
'path/to/image.jpg',
'path/to/image2.jpg',
'path/to/image3.jpg'
]);
// Access the instance
var instance = $('.foo').data('backstretch');
// Then, you can manipulate the images array directly
instance.images.push('path/to/image4.jpg')
```
Additionally, the current index of a slideshow is available through the instance as well:
```javascript
$("body").data("backstretch").index;
```
## Events
### backstretch.before
Backstretch will fire a "backstretch.before" event before a new image loads, triggering a function that is passed the event, Backstretch instance, and index of the image that will be displayed. If you listen for that event, you can, for example, coordinate other changes to coincide with your slideshow.
```javascript
$(window).on("backstretch.before", function (e, instance, index) {
// If we wanted to stop the slideshow after it reached the end
if (index === instance.images.length - 1) {
instance.pause();
};
});
```
### backstretch.after
Backstretch will also fire a "backstretch.after" event after the new images has completed loading.
```javascript
$(window).on("backstretch.after", function (e, instance, index) {
// Do something
});
```
## Changelog
### Version 2.1.15
* Improvement: Not modifying `background` property, but `background-image`, to allow CSS to play with colors. (@philsbury)
### Version 2.1.14
* New: Added `'deviceOrientation'`, `'windowOrientation'` and `'orientation'` options
### Version 2.1.13
* Bugfix: Native video source tags were misspelled
* Bugfix: Youtube matching regex was not constrained to `youtube.com`/`youtu.be` domain
### Version 2.1.12
* New: Added `'fade_in_out'` transition
### Version 2.1.11
* Bugfix: Resolution detection routine failed to properly match current url - and cause an additional replace of the image. This affected video urls in a way that caused them to being played from the start.
### Version 2.1.10
* Bugfix: `pixelRatio == 'auto'` was ignored due to a missing rule.
### Version 2.1.9
* Allow overriding transition options for a single `show(...)` call
* Bugfix: Next transition can go wrong because of css leftover of previous transition
### Version 2.1.8
* Improved method calling through `.backstretch('method', ...)` to pass all arguments, and return value.
* Added `current()` function to return current slide index.
### Version 2.1.7
* Minor documentation improvements. Version release for updated docs in NPM etc.
### Version 2.1.6
* Minor fix: `background` css on the target element was sometimes cleared prematurely. (Issue #18)
### Version 2.1.5
* Minor fix: `resolutionChangeRatioTreshold` was a typo. Changed to `resolutionChangeRatioThreshold`, but keeping backwards compatibility.
### Version 2.1.4
* New: Added more transitions beside fade
* Bugfix: Youtube Iframe API's `destroy` was not being called
* Minor documentation updates
### Version 2.1.3
* New: Youtube and `<video>` support!
### Version 2.1.2
* Bugfix: Executing backstretch methods on already backstretched elements failed
### Version 2.1.1
* Published to bower under "jquery-backstretch-2"
### Version 2.1.0
* New `alwaysTestWindowResolution` option
* New `resolutionRefreshRate` option
* New `resolutionChangeRatioTreshold` option
* Minor bugfix: If there was no `fade` duration, the new image was still being removed asynchronously. Possibly causing a glitch if custom CSS is used.
### Version 2.0.9
* New `alt` image property
* New `bypassCss` option
### Version 2.0.8
* Changed multi-res feature `width`'s meaning. `width` now means the actual width of the image to match against.
* Added `pixelRatio` option for multires.
### Version 2.0.7
* More granular control over options
* 1. Now you can specify `alignX`/`alignY`/`duration`/`fade` on an image basis
* 2. Minor bugfixes
* 3. Deprecated `centeredX`/`centeredY`
### Version 2.0.6
* Minor bug fixes due to latest PRs
### Version 2.0.5
* New `fadeFirst` feature
* New `alignX` feature
* New `alignY` feature
* New `paused` feature
* New `start` feature
* New `preload` feature
* New `preloadSize` feature
* New feature: url templates
* New feature: automatic resolution selection
* Minor bug fixes
### Version 2.0
* Now accepts an array of images to create a slideshow
* Can attach Backstretch to any block-level element, not just the body
* Deprecated "speed" option in favor of "fade" for fadeIn timing
* Added "duration" option, and Slideshow API
### Version 1.2
* You can now called backstretch twice, and it will replace the existing image.
### Version 1.1
* Added 'centeredX' and 'centeredY' options.
* Removed 'hideUntilReady' option. It looks pretty bad if you don't hide the image until it's fully loaded.
* Fixed IE img onload bug.
* Now supports iPhone/iPad orientation changes.
| {'content_hash': '53424908fce688163f333ce4b4110b39', 'timestamp': '', 'source': 'github', 'line_count': 403, 'max_line_length': 303, 'avg_line_length': 46.28287841191067, 'alnum_prop': 0.7047501608406606, 'repo_name': 'danielgindi/jquery-backstretch', 'id': '62a4991f0516aa2510204fabf6f943f81d0a0c77', 'size': '18789', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4599'}, {'name': 'HTML', 'bytes': '1161'}, {'name': 'JavaScript', 'bytes': '141510'}]} |
package external
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"github.com/PuerkitoBio/goquery"
"github.com/mmmorris1975/aws-runas/credentials"
"github.com/mmmorris1975/aws-runas/identity"
"io"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"time"
)
const (
aadIdentityProvider = "AzureADIdentityProvider"
aadBadUserPassErrCode = 50126
aadInvalidMfaErrCode = 500121
aadMfaMethodNotify = "PhoneAppNotification"
aadMfaMethodOTP = "PhoneAppOTP"
aadMfaMethodSMS = "OneWaySMS"
)
var (
bodyRe = regexp.MustCompile(`\$Config=({.+?});`)
samlRe = regexp.MustCompile(`window\.location\s*=\s*'(https.+SAMLRequest=.+?)';`)
)
type aadClient struct {
*baseClient
tenantId string
appId string
}
// NewAadClient creates a new AzureAD client. The url parameter is the 'User Access URL' found in the Properties
// screen of the Azure Enterprise Application which grants access to the AWS role(s). Should look something like:
// https://myapps.microsoft.com/signin/<app name>/<app id>?tenantId=<tenant id>
// MFA is only supported for users at the organizational level; per-app conditional access policies
// requiring MFA are not supported.
func NewAadClient(url string) (*aadClient, error) {
bc, err := newBaseClient(url)
if err != nil {
return nil, err
}
c := &aadClient{baseClient: bc}
if err = c.parseTenantId(); err != nil {
return nil, err
}
if err = c.parseAppId(); err != nil {
return nil, err
}
return c, nil
}
func (c *aadClient) Authenticate() error {
return c.AuthenticateWithContext(context.Background())
}
// even speed-running through this without MFA, it takes around 6 seconds to process an aad-managed user,
// and 10 seconds to handle a federated user. With all of the behind the scenes redirects and our response
// processing at multiple parts of the flow, I don't think this will get much faster.
//
//nolint:bodyclose // response bodies closed in parseResponse
func (c *aadClient) AuthenticateWithContext(ctx context.Context) error {
req, _ := newHttpRequest(ctx, http.MethodGet, c.authUrl.String())
res, err := checkResponseError(c.httpClient.Do(req.Request))
if err != nil {
return err
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
return err
}
reader := bytes.NewReader(body)
authRes := new(aadAuthResponse)
if err = parseResponseNoClose(reader, authRes); err != nil {
// we are seeing the OIDC tokens show up here in certain cases, so if we don't see the expected
// response (triggering the error), try submitting the result before returning an error.
c.Logger.Debugf("parseResponseNoClose() err: %v, attempting to directly submit response", err)
_, _ = reader.Seek(0, io.SeekStart)
_, err = c.submitResponse(res.Request.URL, io.NopCloser(reader))
return err
}
if err = c.auth(ctx, authRes.LoginUrl(res.Request.URL), authRes); err != nil {
return err
}
// A "keep me signed in" prompt may show up before getting to the good stuff. authRes.ErrCode should
// equal 50058 too ... isn't really an error, other than signalling you've reached this KMSI prompt
if strings.HasSuffix(authRes.UrlPost, "/kmsi") {
c.Logger.Debugf("handling kmsi")
kmsiUrl := authRes.LoginUrl(res.Request.URL)
kmsiForm := url.Values{}
kmsiForm.Set(authRes.FTName, authRes.FT)
kmsiForm.Set("ctx", authRes.Ctx)
kmsiForm.Set("LoginOptions", "1")
req, _ = newHttpRequest(ctx, http.MethodPost, kmsiUrl.String())
res, err = checkResponseError(c.httpClient.Do(req.withValues(kmsiForm).Request))
if err != nil {
return err
}
}
// KMSI or not, I think we end up here. Another JS auto-submit form containing OIDC stuff.
// The OIDC ID token probably isn't sufficient for use with the IdentityToken* methods, since
// there aren't any useful claims in the token, afaict just basic profile info.
// However, this should be sufficient to say authentication is complete, if successful.
_, err = c.submitResponse(res.Request.URL, res.Body)
return err
}
func (c *aadClient) Identity() (*identity.Identity, error) {
return c.identity(aadIdentityProvider), nil
}
// Roles retrieves the available roles for the user. Attempting to call this method
// against an Oauth/OIDC client will return an error.
func (c *aadClient) Roles(...string) (*identity.Roles, error) {
if c.saml == nil || len(*c.saml) < 1 {
var err error
c.saml, err = c.SamlAssertion()
if err != nil {
return nil, err
}
}
return c.roles()
}
func (c *aadClient) IdentityToken() (*credentials.OidcIdentityToken, error) {
return c.IdentityTokenWithContext(context.Background())
}
// todo - this is unverified.
func (c *aadClient) IdentityTokenWithContext(context.Context) (*credentials.OidcIdentityToken, error) {
oauthUrlBase := fmt.Sprintf("https://login.microsoftonline.com/%s/oauth2/v2.0", c.tenantId)
pkce, err := newPkceCode()
if err != nil {
return nil, err
}
authzQS := c.pkceAuthzRequest(pkce.Challenge())
var vals url.Values
vals, err = c.oauthAuthorize(fmt.Sprintf("%s/authorize", oauthUrlBase), authzQS, false)
if err != nil {
// reauth?
return nil, err
}
if vals.Get("state") != authzQS.Get("state") {
return nil, errOauthStateMismatch
}
token, err := c.oauthToken(fmt.Sprintf("%s/token", oauthUrlBase), vals.Get("code"), pkce.Verifier())
if err != nil {
return nil, err
}
return token.IdToken, nil
}
func (c *aadClient) SamlAssertion() (*credentials.SamlAssertion, error) {
return c.SamlAssertionWithContext(context.Background())
}
func (c *aadClient) SamlAssertionWithContext(ctx context.Context) (*credentials.SamlAssertion, error) {
// using c.authUrl directly won't work, you need to fetch that URL, then process the response which
// contains the actual URL we need to submit (which is embedded in JS, because why wouldn't it be?).
req, _ := newHttpRequest(ctx, http.MethodGet, c.authUrl.String())
res, err := checkResponseError(c.httpClient.Do(req.Request))
if err != nil {
// We will see HTTP 200 even if the caller is unauthenticated, so any error here is probably something
// attempting authentication won't help, just bail out.
return nil, err
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
match := samlRe.FindSubmatch(data)
if match == nil || len(match) < 2 {
// response is probably a login page, so attempt re-auth
if err = c.AuthenticateWithContext(ctx); err != nil {
return nil, err
}
return c.SamlAssertionWithContext(ctx)
}
u, _ := url.Parse(string(match[1]))
if err = c.samlRequest(ctx, u); err != nil {
return nil, err
}
return c.saml, nil
}
func (c *aadClient) parseTenantId() error {
c.tenantId = c.authUrl.Query().Get("tenantId")
if len(c.tenantId) < 1 {
return errors.New("tenant ID not found in url")
}
return nil
}
func (c *aadClient) parseAppId() error {
parts := strings.Split(c.authUrl.Path, `/`)
c.appId = parts[len(parts)-1]
if len(parts) < 3 || len(c.appId) < 1 {
return errors.New("app ID not found in url")
}
return nil
}
func (c *aadClient) submitResponse(u *url.URL, r io.ReadCloser) (*http.Response, error) {
defer r.Close()
doc, err := goquery.NewDocumentFromReader(r)
if err != nil {
return nil, err
}
form := doc.Find("body form")
formAction, ok := form.Attr("action")
if !ok {
return nil, errors.New("missing form submit url")
}
var submitUrl *url.URL
submitUrl, err = url.Parse(formAction)
if err != nil {
return nil, err
}
if len(submitUrl.Scheme) < 1 {
submitUrl = u.ResolveReference(submitUrl)
}
vals := url.Values{}
form.Find("input").Each(func(i int, s *goquery.Selection) {
var name, val string
name, ok = s.Attr("name")
if !ok {
return
}
val, ok = s.Attr("value")
if !ok {
return
}
vals.Set(name, val)
})
req, _ := newHttpRequest(context.Background(), http.MethodPost, submitUrl.String())
return checkResponseError(c.httpClient.Do(req.withValues(vals).Request))
}
//nolint:bodyclose // response bodies closed in parseResponse
func (c *aadClient) auth(ctx context.Context, authUrl *url.URL, authRes *aadAuthResponse) error {
authForm := url.Values{}
authForm.Set(authRes.FTName, authRes.FT)
authForm.Set("ctx", authRes.Ctx)
authForm.Set("login", c.Username)
req, _ := newHttpRequest(ctx, http.MethodPost, authUrl.String())
res, err := checkResponseError(c.httpClient.Do(req.withValues(authForm).Request))
if err != nil {
return err
}
if err = parseResponse(res.Body, authRes); err != nil {
return err
}
// a bold assumption that everything down this path is not nil
if u := authRes.CredentialTypeResult.Credentials.FederationRedirectUrl; len(u) > 0 {
res, err = c.doFederatedAuth(u)
if err != nil {
return err
}
} else {
// assume anything else means we're an aad-managed account
// reset authRes.ErrCode so we capture the correct state of the authentication attempt
authRes.ErrCode = ""
if err = c.gatherCredentials(); err != nil {
return err
}
authForm.Set("passwd", c.Password)
// update existing req with new form values (password)
res, err = checkResponseError(c.httpClient.Do(req.withValues(authForm).Request))
if err != nil {
return err
}
}
// test for auth failure. Ideally auth failure for a federated user set 'err' and returned before this,
// but we'll be safe and test everything. Code 50126 is bad username/password error
if err = parseResponse(res.Body, authRes); err != nil {
return err
} else if authRes.ErrCode == strconv.Itoa(aadBadUserPassErrCode) {
return errors.New("authentication failed")
}
// it is possible to require MFA for federated/guest users
return c.checkMfa(ctx, authRes)
}
func (c *aadClient) doFederatedAuth(fedUrl string) (res *http.Response, err error) {
cfg := AuthenticationClientConfig{
CredentialInputProvider: c.CredentialInputProvider,
MfaTokenProvider: c.MfaTokenProvider,
IdentityProviderName: aadIdentityProvider,
Logger: c.Logger,
MfaType: c.MfaType,
Username: c.Username,
Password: c.Password,
}
if len(c.FederatedUsername) > 0 {
cfg.Username = c.FederatedUsername
}
// federation url must be one of the aws-runas supported external clients
sc := MustGetSamlClient("", fedUrl, cfg)
if err = sc.Authenticate(); err != nil {
return nil, err
}
req, _ := newHttpRequest(context.Background(), http.MethodGet, fedUrl)
res, err = checkResponseError(c.httpClient.Do(req.Request))
if err != nil {
return nil, err
}
return c.submitResponse(res.Request.URL, res.Body)
}
//nolint:bodyclose // response bodies closed in parseResponse
func (c *aadClient) checkMfa(ctx context.Context, authRes *aadAuthResponse) error {
var res *http.Response
var err error
if len(authRes.UrlSkipMfaRegistration) > 0 {
// We can't register an MFA device here, so skip past it
req, _ := newHttpRequest(ctx, http.MethodGet, authRes.UrlSkipMfaRegistration)
res, err = checkResponseError(c.httpClient.Do(req.Request))
if err != nil {
return err
}
return parseResponse(res.Body, authRes)
} else if len(authRes.UserProofs) > 0 {
res, err = c.handleMfa(authRes)
if err != nil {
return err
}
return parseResponse(res.Body, authRes)
}
return nil
}
func (c *aadClient) handleMfa(authRes *aadAuthResponse) (*http.Response, error) {
factor, err := c.findFactor(authRes.UserProofs)
if err != nil {
return nil, err
}
mfaReq := aadMfaRequest{
AuthMethodId: factor.AuthMethodID,
Method: "BeginAuth",
Ctx: authRes.Ctx,
FlowToken: authRes.FT,
}
mfaRes := new(aadMfaResponse)
if err = c.submitJson(authRes.UrlBeginAuth, mfaReq, mfaRes); err != nil {
return nil, err
}
if !mfaRes.Success {
return nil, errors.New("mfa failed")
}
mfaReq = aadMfaRequest{
AuthMethodId: mfaRes.AuthMethodId,
Method: "EndAuth",
Ctx: mfaRes.Ctx,
FlowToken: mfaRes.FlowToken,
SessionId: mfaRes.SessionId,
}
wait := time.Duration(authRes.PerAuthPollingInterval[factor.AuthMethodID]) * time.Second
if wait < 500*time.Millisecond {
wait = 500 * time.Millisecond
}
switch c.MfaType {
case MfaTypePush:
fmt.Print("Waiting for Push MFA ")
mfaRes, err = c.handlePushMfa(authRes.UrlEndAuth, mfaReq, wait)
case MfaTypeCode:
mfaRes, err = c.handleCodeMfa(authRes.UrlEndAuth, mfaReq, wait)
}
if err != nil {
return nil, err
}
if !mfaRes.Success {
return nil, errors.New("mfa failed")
}
vals := url.Values{}
vals.Set(authRes.FTName, mfaRes.FlowToken)
vals.Set("request", mfaRes.Ctx)
vals.Set("login", c.Username)
req, _ := newHttpRequest(context.Background(), http.MethodPost, authRes.LoginUrl(nil).String())
return checkResponseError(c.httpClient.Do(req.withValues(vals).Request))
}
//nolint:gocognit,gocyclo // won't simplify
func (c *aadClient) findFactor(mfaCfg []aadUserProof) (aadUserProof, error) {
factors := make([]aadUserProof, 0)
switch strings.ToLower(c.MfaType) {
case MfaTypeAuto:
for _, v := range mfaCfg {
switch v.AuthMethodID {
case aadMfaMethodNotify:
c.MfaType = MfaTypePush
case aadMfaMethodSMS, aadMfaMethodOTP:
c.MfaType = MfaTypeCode
}
factors = append(factors, v)
if v.IsDefault {
break
}
}
case MfaTypePush:
// MS Authenticator app push notification
for _, v := range mfaCfg {
if v.AuthMethodID == aadMfaMethodNotify {
factors = append(factors, v)
if v.IsDefault {
break
}
}
}
case MfaTypeCode:
// TOTP, SMS
for _, v := range mfaCfg {
if v.AuthMethodID == aadMfaMethodOTP || v.AuthMethodID == aadMfaMethodSMS {
factors = append(factors, v)
if v.IsDefault {
break
}
}
}
case MfaTypeNone:
return aadUserProof{}, nil
}
if len(factors) < 1 {
return aadUserProof{}, errMfaNotConfigured
}
// default factor should be last on the list, otherwise return the 1st element of the list
if f := factors[len(factors)-1]; f.IsDefault {
return f, nil
}
return factors[0], nil
}
func (c *aadClient) handleCodeMfa(mfaUrl string, mfaReq aadMfaRequest, wait time.Duration) (*aadMfaResponse, error) {
if len(c.MfaTokenCode) < 1 {
if c.MfaTokenProvider != nil {
t, err := c.MfaTokenProvider()
if err != nil {
return nil, err
}
c.MfaTokenCode = t
} else {
return nil, errMfaNotConfigured
}
}
mfaReq.AdditionalAuthData = c.MfaTokenCode
res, err := c.sendMfaReply(mfaUrl, mfaReq)
if err != nil {
return nil, err
}
if res.Retry {
c.MfaTokenCode = ""
time.Sleep(wait)
return c.handleCodeMfa(mfaUrl, mfaReq, wait)
}
return res, nil
}
func (c *aadClient) handlePushMfa(mfaUrl string, mfaReq aadMfaRequest, wait time.Duration) (*aadMfaResponse, error) {
res, err := c.sendMfaReply(mfaUrl, mfaReq)
if err != nil {
return nil, err
}
if res.Retry {
time.Sleep(wait)
fmt.Print(".")
return c.handlePushMfa(mfaUrl, mfaReq, wait)
}
return res, nil
}
func (c *aadClient) sendMfaReply(mfaUrl string, mfaReq aadMfaRequest) (*aadMfaResponse, error) {
mfaRes := new(aadMfaResponse)
if err := c.submitJson(mfaUrl, mfaReq, mfaRes); err != nil {
return nil, err
}
if mfaRes.ErrCode == aadInvalidMfaErrCode {
mfaRes.Retry = true
} else if mfaRes.ErrCode != 0 {
return nil, fmt.Errorf("mfa failure: %s [code: %d]", mfaRes.Message, mfaRes.ErrCode)
}
return mfaRes, nil
}
func (c *aadClient) submitJson(submitUrl string, inData interface{}, outData interface{}) error {
mfaJson, err := json.Marshal(inData)
if err != nil {
return err
}
req, _ := newHttpRequest(context.Background(), http.MethodPost, submitUrl)
req.withContentType(contentTypeJson).withBody(bytes.NewReader(mfaJson))
var res *http.Response
res, err = checkResponseError(c.httpClient.Do(req.Request))
if err != nil {
return err
}
defer res.Body.Close()
return json.NewDecoder(res.Body).Decode(outData)
}
func parseResponse(body io.ReadCloser, out interface{}) error {
defer body.Close()
return parseResponseNoClose(body, out)
}
func parseResponseNoClose(body io.Reader, out interface{}) error {
data, err := io.ReadAll(body)
if err != nil {
return err
}
match := bodyRe.FindSubmatch(data)
if match == nil || len(match) < 2 {
return errors.New("expected response content not found")
}
return json.Unmarshal(match[1], out)
}
type aadAuthResponse struct {
Ctx string `json:"sCtx"`
ErrCode string `json:"sErrorCode"`
ErrTxt string `json:"sErrTxt"`
FT string `json:"sFT"`
FTName string `json:"sFTName"`
UrlPost string `json:"urlPost"`
UrlBeginAuth string `json:"urlBeginAuth"`
UrlEndAuth string `json:"urlEndAuth"`
UserProofs []aadUserProof `json:"arrUserProofs"`
urlPost *url.URL
CredentialTypeResult aadGetCredTypeResults `json:"oGetCredTypeResult"`
PerAuthPollingInterval map[string]float64 `json:"oPerAuthPollingInterval"`
UrlSkipMfaRegistration string `json:"urlSkipMfaRegistration"`
}
func (r aadAuthResponse) LoginUrl(base *url.URL) *url.URL {
if r.urlPost == nil {
r.urlPost, _ = url.Parse(r.UrlPost)
}
if len(r.urlPost.Scheme) < 1 && base != nil {
// turn relative url to absolute url
return base.ResolveReference(r.urlPost)
}
return r.urlPost
}
type aadUserProof struct {
AuthMethodID string `json:"authMethodId"`
Data string `json:"data"`
Display string `json:"display"`
IsDefault bool `json:"isDefault"`
}
type aadGetCredTypeResults struct {
Credentials aadCredDetails
}
type aadCredDetails struct {
HasPassword bool
PrefCredential int
FederationRedirectUrl string
}
type aadMfaRequest struct {
AuthMethodId string
Method string
Ctx string
FlowToken string
SessionId string `json:",omitempty"`
AdditionalAuthData string `json:",omitempty"`
}
type aadMfaResponse struct {
Success bool
ResultValue string
Message interface{}
AuthMethodId string
ErrCode int
Retry bool
FlowToken string
Ctx string
SessionId string
CorrelationId string
Timestamp time.Time
}
| {'content_hash': 'd7ca37903f39875bfe8edbfe298443d7', 'timestamp': '', 'source': 'github', 'line_count': 663, 'max_line_length': 117, 'avg_line_length': 27.318250377073905, 'alnum_prop': 0.6934076855123675, 'repo_name': 'mmmorris1975/aws-runas', 'id': '1245a7cc757b457852c36f8f1d69051e5512685a', 'size': '18682', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'client/external/aad_client.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2062'}, {'name': 'Go', 'bytes': '430000'}, {'name': 'HTML', 'bytes': '10436'}, {'name': 'JavaScript', 'bytes': '11729'}, {'name': 'Makefile', 'bytes': '3978'}, {'name': 'Ruby', 'bytes': '20839'}, {'name': 'Shell', 'bytes': '7622'}]} |
using FluentAssertions;
using NUnit.Framework;
namespace RiftDotNet.Test
{
[TestFixture]
public sealed class FactoryTest
{
[Test]
public void TestCtor()
{
IFactory f = Factory.PlatformFactory;
f.Should().NotBeNull();
}
}
} | {'content_hash': '408cffb54dacd1c705c7e3acb6d06171', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 40, 'avg_line_length': 16.0625, 'alnum_prop': 0.6653696498054474, 'repo_name': 'SiS-Shadowman/RiftDotNet', 'id': '159a22084479875954b8ecd94ddfcd3e49968984', 'size': '259', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'development/RiftDotNet.Test/FactoryTest.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '80062'}, {'name': 'C++', 'bytes': '59193'}, {'name': 'Objective-C', 'bytes': '1755'}]} |
<?php
namespace SMW\Tests;
use SMW\ParserData;
use SMW\Settings;
use SMW\Factbox\Factbox;
use SMW\ApplicationFactory;
use ReflectionClass;
use ParserOutput;
use Title;
/**
* @covers \SMW\Factbox\Factbox
*
* @group SMW
* @group SMWExtension
*
* @license GNU GPL v2+
* @since 1.9
*
* @author mwjames
*/
class FactboxMagicWordsTest extends \PHPUnit_Framework_TestCase {
private $applicationFactory;
protected function setUp() {
parent::setUp();
$this->applicationFactory = ApplicationFactory::getInstance();
}
protected function tearDown() {
$this->applicationFactory->clear();
parent::tearDown();
}
/**
* @dataProvider textDataProvider
*/
public function testMagicWordsFromParserOutputExtension( $text, array $expected ) {
$title = Title::newFromText( __METHOD__ );
$parserOutput = new ParserOutput();
$settings = Settings::newFromArray( array(
'smwgNamespacesWithSemanticLinks' => array( $title->getNamespace() => true ),
'smwgLinksInValues' => false,
'smwgInlineErrors' => true,
)
);
$this->applicationFactory->registerObject( 'Settings', $settings );
$parserData = new ParserData( $title, $parserOutput );
$inTextAnnotationParser = ApplicationFactory::getInstance()->newInTextAnnotationParser( $parserData );
$inTextAnnotationParser->parse( $text );
$this->assertEquals(
$expected['magicWords'],
$this->getMagicwords( $parserOutput )
);
}
/**
* @dataProvider textDataProvider
*/
// @codingStandardsIgnoreStart phpcs, ignore --sniffs=Generic.CodeAnalysis.UnusedFunctionParameter
public function testGetMagicWords( $text, array $expected ) { // @codingStandardsIgnoreEnd
$title = Title::newFromText( __METHOD__ );
$settings = Settings::newFromArray( array(
'smwgShowFactboxEdit' => SMW_FACTBOX_HIDDEN,
'smwgShowFactbox' => SMW_FACTBOX_HIDDEN
)
);
$this->applicationFactory->registerObject( 'Settings', $settings );
$parserOutput = $this->getMockBuilder( '\ParserOutput' )
->disableOriginalConstructor()
->getMock();
$parserOutput->expects( $this->any() )
->method( 'getExtensionData' )
->will( $this->returnValue( $expected['magicWords'] ) );
// MW 1.19, 1.20
$parserOutput->mSMWMagicWords = $expected['magicWords'];
$store = $this->getMockBuilder( '\SMW\Store' )
->disableOriginalConstructor()
->getMockForAbstractClass();
$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
->disableOriginalConstructor()
->getMock();
$instance = new Factbox(
$store,
new ParserData( $title, $parserOutput ),
$messageBuilder
);
if ( isset( $expected['preview'] ) && $expected['preview'] ) {
$instance->useInPreview( true );
}
$reflector = new ReflectionClass( '\SMW\Factbox\Factbox' );
$magic = $reflector->getMethod( 'getMagicWords' );
$magic->setAccessible( true );
$result = $magic->invoke( $instance );
$this->assertInternalType( 'integer', $result );
$this->assertEquals( $expected['constants'], $result );
}
/**
* @return array
*/
public function textDataProvider() {
$provider = array();
// #0 __NOFACTBOX__, this test should not generate a factbox output
$provider[] = array(
'Lorem ipsum dolor sit amet consectetuer auctor at quis' .
' [[Foo::dictumst cursus]]. Nisl sit condimentum Quisque facilisis' .
' Suspendisse [[Bar::tincidunt semper]] facilisi dolor Aenean. Ut' .
' __NOFACTBOX__ ',
array(
'magicWords' => array( 'SMW_NOFACTBOX' ),
'constants' => SMW_FACTBOX_HIDDEN,
'textOutput' => ''
)
);
// #1 __SHOWFACTBOX__, this test should generate a factbox output
$provider[] = array(
'Lorem ipsum dolor sit amet consectetuer auctor at quis' .
' [[Foo::dictumst cursus]]. Nisl sit condimentum Quisque facilisis' .
' Suspendisse [[Bar::tincidunt semper]] facilisi dolor Aenean. Ut' .
' __SHOWFACTBOX__',
array(
'magicWords' => array( 'SMW_SHOWFACTBOX' ),
'constants' => SMW_FACTBOX_NONEMPTY,
'textOutput' => 'smwfactboxhead' // lazy check because we use assertContains
)
);
// #2 empty
$provider[] = array(
'Lorem ipsum dolor sit amet consectetuer auctor at quis' .
' [[Foo::dictumst cursus]]. Nisl sit condimentum Quisque facilisis' .
' Suspendisse [[Bar::tincidunt semper]] facilisi dolor Aenean. Ut',
array(
'magicWords' => array(),
'constants' => SMW_FACTBOX_HIDDEN,
'textOutput' => ''
)
);
// #3 empty + preview option
$provider[] = array(
'Lorem ipsum dolor sit amet consectetuer auctor at quis' .
' [[Foo::dictumst cursus]]. Nisl sit condimentum Quisque facilisis' .
' Suspendisse [[Bar::tincidunt semper]] facilisi dolor Aenean. Ut',
array(
'magicWords' => array(),
'preview' => true,
'constants' => SMW_FACTBOX_HIDDEN,
'textOutput' => ''
)
);
return $provider;
}
/**
* @return array
*/
protected function getMagicwords( $parserOutput ) {
if ( method_exists( $parserOutput, 'getExtensionData' ) ) {
return $parserOutput->getExtensionData( 'smwmagicwords' );
}
return $parserOutput->mSMWMagicWords;
}
}
| {'content_hash': 'f3a8d0943c4cd8dbd36f89ded025ab24', 'timestamp': '', 'source': 'github', 'line_count': 198, 'max_line_length': 104, 'avg_line_length': 25.818181818181817, 'alnum_prop': 0.6676447574334898, 'repo_name': 'owen-kellie-smith/mediawiki', 'id': '3bee16ec28deda6bea78bc4de706beaa3ea015d1', 'size': '5112', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'wiki/extensions/SemanticMediaWiki/tests/phpunit/includes/Factbox/FactboxMagicWordsTest.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '405'}, {'name': 'Batchfile', 'bytes': '45'}, {'name': 'CSS', 'bytes': '522322'}, {'name': 'Cucumber', 'bytes': '33293'}, {'name': 'HTML', 'bytes': '26024'}, {'name': 'JavaScript', 'bytes': '3615192'}, {'name': 'Lua', 'bytes': '478'}, {'name': 'Makefile', 'bytes': '8898'}, {'name': 'PHP', 'bytes': '21628114'}, {'name': 'PLSQL', 'bytes': '61551'}, {'name': 'PLpgSQL', 'bytes': '31212'}, {'name': 'Perl', 'bytes': '27998'}, {'name': 'Python', 'bytes': '17169'}, {'name': 'Ruby', 'bytes': '69896'}, {'name': 'SQLPL', 'bytes': '2159'}, {'name': 'Shell', 'bytes': '31740'}]} |
using gfx::BufferFormat;
namespace gl {
namespace {
GLint DataRowLength(size_t stride, gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::R_16:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
return base::checked_cast<GLint>(stride) / 2;
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::BGRA_1010102:
case gfx::BufferFormat::RGBA_1010102:
case gfx::BufferFormat::BGRA_8888:
return base::checked_cast<GLint>(stride) / 4;
case gfx::BufferFormat::RGBA_F16:
return base::checked_cast<GLint>(stride) / 8;
case gfx::BufferFormat::R_8:
return base::checked_cast<GLint>(stride);
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
case gfx::BufferFormat::P010:
NOTREACHED() << gfx::BufferFormatToString(format);
return 0;
}
NOTREACHED();
return 0;
}
template <typename F>
std::vector<uint8_t> GLES2RGBData(const gfx::Size& size,
size_t stride,
const uint8_t* data,
F const& data_to_rgb,
GLenum* data_format,
GLenum* data_type,
GLint* data_row_length) {
TRACE_EVENT2("gpu", "GLES2RGBData", "width", size.width(), "height",
size.height());
// Four-byte row alignment as specified by glPixelStorei with argument
// GL_UNPACK_ALIGNMENT set to 4.
size_t gles2_rgb_data_stride = (size.width() * 3 + 3) & ~3;
std::vector<uint8_t> gles2_rgb_data(gles2_rgb_data_stride * size.height());
for (int y = 0; y < size.height(); ++y) {
for (int x = 0; x < size.width(); ++x) {
data_to_rgb(&data[y * stride + x * 4],
&gles2_rgb_data[y * gles2_rgb_data_stride + x * 3]);
}
}
*data_format = GL_RGB;
*data_type = GL_UNSIGNED_BYTE;
*data_row_length = size.width();
return gles2_rgb_data;
}
std::vector<uint8_t> GLES2RGB565Data(const gfx::Size& size,
size_t stride,
const uint8_t* data,
GLenum* data_format,
GLenum* data_type,
GLint* data_row_length) {
TRACE_EVENT2("gpu", "GLES2RGB565Data", "width", size.width(), "height",
size.height());
// Four-byte row alignment as specified by glPixelStorei with argument
// GL_UNPACK_ALIGNMENT set to 4.
size_t gles2_rgb_data_stride = (size.width() * 2 + 3) & ~3;
std::vector<uint8_t> gles2_rgb_data(gles2_rgb_data_stride * size.height());
for (int y = 0; y < size.height(); ++y) {
for (int x = 0; x < size.width(); ++x) {
const uint16_t* src =
reinterpret_cast<const uint16_t*>(&data[y * stride + x * 2]);
uint16_t* dst = reinterpret_cast<uint16_t*>(
&gles2_rgb_data[y * gles2_rgb_data_stride + x * 2]);
*dst = (((*src & 0x1f) >> 0) << 11) | (((*src & 0x7e0) >> 5) << 5) |
(((*src & 0xf800) >> 11) << 5);
}
}
*data_format = GL_RGB;
*data_type = GL_UNSIGNED_SHORT_5_6_5;
*data_row_length = size.width();
return gles2_rgb_data;
}
base::Optional<std::vector<uint8_t>> GLES2Data(const gfx::Size& size,
gfx::BufferFormat format,
size_t stride,
const uint8_t* data,
GLenum* data_format,
GLenum* data_type,
GLint* data_row_length) {
TRACE_EVENT2("gpu", "GLES2Data", "width", size.width(), "height",
size.height());
switch (format) {
case gfx::BufferFormat::RGBX_8888:
return base::make_optional(GLES2RGBData(
size, stride, data,
[](const uint8_t* src, uint8_t* dst) {
dst[0] = src[0];
dst[1] = src[1];
dst[2] = src[2];
},
data_format, data_type, data_row_length));
case gfx::BufferFormat::BGR_565:
return base::make_optional(GLES2RGB565Data(
size, stride, data, data_format, data_type, data_row_length));
case gfx::BufferFormat::BGRX_8888:
return base::make_optional(GLES2RGBData(
size, stride, data,
[](const uint8_t* src, uint8_t* dst) {
dst[0] = src[2];
dst[1] = src[1];
dst[2] = src[0];
},
data_format, data_type, data_row_length));
case gfx::BufferFormat::RGBA_4444:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::BGRA_1010102:
case gfx::BufferFormat::RGBA_1010102:
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::RGBA_F16:
case gfx::BufferFormat::R_8:
case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88: {
size_t gles2_data_stride =
RowSizeForBufferFormat(size.width(), format, 0);
if (stride == gles2_data_stride ||
g_current_gl_driver->ext.b_GL_EXT_unpack_subimage)
return base::nullopt; // No data conversion needed
std::vector<uint8_t> gles2_data(gles2_data_stride * size.height());
for (int y = 0; y < size.height(); ++y) {
memcpy(&gles2_data[y * gles2_data_stride], &data[y * stride],
gles2_data_stride);
}
*data_row_length = size.width();
return base::make_optional(gles2_data);
}
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
case gfx::BufferFormat::P010:
NOTREACHED() << gfx::BufferFormatToString(format);
return base::nullopt;
}
NOTREACHED();
return base::nullopt;
}
void MemcpyTask(const void* src,
void* dst,
size_t bytes,
size_t task_index,
size_t n_tasks,
base::RepeatingClosure* done) {
auto checked_bytes = base::CheckedNumeric<size_t>(bytes);
size_t start = (checked_bytes * task_index / n_tasks).ValueOrDie();
size_t end = (checked_bytes * (task_index + 1) / n_tasks).ValueOrDie();
DCHECK_LE(start, bytes);
DCHECK_LE(end, bytes);
memcpy(static_cast<char*>(dst) + start, static_cast<const char*>(src) + start,
end - start);
done->Run();
}
bool SupportsPBO(GLContext* context) {
const GLVersionInfo* version = context->GetVersionInfo();
return version->IsAtLeastGL(2, 1) || version->IsAtLeastGLES(3, 0) ||
context->HasExtension("GL_ARB_pixel_buffer_object") ||
context->HasExtension("GL_EXT_pixel_buffer_object") ||
context->HasExtension("GL_NV_pixel_buffer_object");
}
bool SupportsMapBuffer(GLContext* context) {
return context->GetVersionInfo()->IsAtLeastGL(2, 0) ||
context->HasExtension("GL_OES_mapbuffer");
}
bool SupportsMapBufferRange(GLContext* context) {
return context->GetVersionInfo()->IsAtLeastGLES(3, 0) ||
context->HasExtension("GL_EXT_map_buffer_range");
}
} // namespace
GLImageMemory::GLImageMemory(const gfx::Size& size)
: size_(size),
memory_(nullptr),
format_(gfx::BufferFormat::RGBA_8888),
stride_(0) {}
GLImageMemory::~GLImageMemory() {
if (buffer_ && original_context_ && original_surface_) {
ui::ScopedMakeCurrent make_current(original_context_.get(),
original_surface_.get());
glDeleteBuffersARB(1, &buffer_);
}
}
// static
GLImageMemory* GLImageMemory::FromGLImage(GLImage* image) {
if (!image || image->GetType() != Type::MEMORY)
return nullptr;
return static_cast<GLImageMemory*>(image);
}
bool GLImageMemory::Initialize(const unsigned char* memory,
gfx::BufferFormat format,
size_t stride) {
if (!ValidFormat(format)) {
LOG(ERROR) << "Invalid format: " << gfx::BufferFormatToString(format);
return false;
}
if (stride < RowSizeForBufferFormat(size_.width(), format, 0) || stride & 3) {
LOG(ERROR) << "Invalid stride: " << stride;
return false;
}
DCHECK(memory);
DCHECK(!memory_);
memory_ = memory;
format_ = format;
stride_ = stride;
bool tex_image_from_pbo_is_slow = false;
#if defined(OS_WIN)
tex_image_from_pbo_is_slow = true;
#endif // OS_WIN
GLContext* context = GLContext::GetCurrent();
DCHECK(context);
if (!tex_image_from_pbo_is_slow && SupportsPBO(context) &&
(SupportsMapBuffer(context) || SupportsMapBufferRange(context))) {
constexpr size_t kTaskBytes = 1024 * 1024;
buffer_bytes_ = stride * size_.height();
memcpy_tasks_ = std::min<size_t>(buffer_bytes_ / kTaskBytes,
base::SysInfo::NumberOfProcessors());
if (memcpy_tasks_ > 1) {
glGenBuffersARB(1, &buffer_);
ScopedBufferBinder binder(GL_PIXEL_UNPACK_BUFFER, buffer_);
glBufferData(GL_PIXEL_UNPACK_BUFFER, buffer_bytes_, nullptr,
GL_DYNAMIC_DRAW);
original_context_ = context->AsWeakPtr();
GLSurface* surface = GLSurface::GetCurrent();
DCHECK(surface);
original_surface_ = surface->AsWeakPtr();
}
}
return true;
}
gfx::Size GLImageMemory::GetSize() {
return size_;
}
unsigned GLImageMemory::GetInternalFormat() {
return gl::BufferFormatToGLInternalFormat(format_);
}
unsigned GLImageMemory::GetDataFormat() {
switch (format_) {
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::RGBA_1010102:
return GL_RGBA;
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::BGRA_1010102:
return GL_BGRA_EXT;
default:
break;
}
return GLImage::GetDataFormat();
}
unsigned GLImageMemory::GetDataType() {
switch (format_) {
case gfx::BufferFormat::BGR_565:
return GL_UNSIGNED_SHORT_5_6_5_REV;
default:
break;
}
return gl::BufferFormatToGLDataType(format_);
}
GLImage::BindOrCopy GLImageMemory::ShouldBindOrCopy() {
return COPY;
}
bool GLImageMemory::BindTexImage(unsigned target) {
NOTREACHED();
return false;
}
bool GLImageMemory::CopyTexImage(unsigned target) {
TRACE_EVENT2("gpu", "GLImageMemory::CopyTexImage", "width", size_.width(),
"height", size_.height());
if (target == GL_TEXTURE_EXTERNAL_OES)
return false;
GLenum data_format = GetDataFormat();
GLenum data_type = GetDataType();
GLint data_row_length = DataRowLength(stride_, format_);
base::Optional<std::vector<uint8_t>> gles2_data;
GLContext* context = GLContext::GetCurrent();
DCHECK(context);
if (context->GetVersionInfo()->is_es) {
gles2_data = GLES2Data(size_, format_, stride_, memory_, &data_format,
&data_type, &data_row_length);
}
if (data_row_length != size_.width())
glPixelStorei(GL_UNPACK_ROW_LENGTH, data_row_length);
const void* src;
size_t size;
if (gles2_data) {
src = gles2_data->data();
size = gles2_data->size();
} else {
src = memory_;
size = buffer_bytes_;
}
bool uploaded = false;
if (buffer_ && original_context_.get() == context) {
glTexImage2D(target, 0, GetInternalFormat(), size_.width(), size_.height(),
0, data_format, data_type, nullptr);
ScopedBufferBinder binder(GL_PIXEL_UNPACK_BUFFER, buffer_);
void* dst = nullptr;
if (SupportsMapBuffer(context)) {
dst = glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
} else {
DCHECK(SupportsMapBufferRange(context));
dst = glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, size, GL_MAP_WRITE_BIT);
}
if (dst) {
base::WaitableEvent event;
base::RepeatingClosure barrier = base::BarrierClosure(
memcpy_tasks_, base::BindOnce(&base::WaitableEvent::Signal,
base::Unretained(&event)));
for (int i = 1; i < memcpy_tasks_; ++i) {
base::PostTask(FROM_HERE, base::BindOnce(&MemcpyTask, src, dst, size, i,
memcpy_tasks_, &barrier));
}
MemcpyTask(src, dst, size, 0, memcpy_tasks_, &barrier);
event.Wait();
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
glTexSubImage2D(target, 0, 0, 0, size_.width(), size_.height(),
data_format, data_type, 0);
uploaded = true;
} else {
glDeleteBuffersARB(1, &buffer_);
buffer_ = 0;
}
}
if (!uploaded) {
glTexImage2D(target, 0, GetInternalFormat(), size_.width(), size_.height(),
0, data_format, data_type, src);
}
if (data_row_length != size_.width())
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
return true;
}
bool GLImageMemory::CopyTexSubImage(unsigned target,
const gfx::Point& offset,
const gfx::Rect& rect) {
TRACE_EVENT2("gpu", "GLImageMemory::CopyTexSubImage", "width", rect.width(),
"height", rect.height());
// GL_TEXTURE_EXTERNAL_OES is not a supported target.
if (target == GL_TEXTURE_EXTERNAL_OES)
return false;
// Sub width is not supported.
if (rect.width() != size_.width())
return false;
const uint8_t* data = memory_ + rect.y() * stride_;
GLenum data_format = GetDataFormat();
GLenum data_type = GetDataType();
GLint data_row_length = DataRowLength(stride_, format_);
base::Optional<std::vector<uint8_t>> gles2_data;
if (GLContext::GetCurrent()->GetVersionInfo()->is_es) {
gles2_data = GLES2Data(rect.size(), format_, stride_, data, &data_format,
&data_type, &data_row_length);
}
if (data_row_length != rect.width())
glPixelStorei(GL_UNPACK_ROW_LENGTH, data_row_length);
glTexSubImage2D(target, 0, offset.x(), offset.y(), rect.width(),
rect.height(), data_format, data_type,
gles2_data ? gles2_data->data() : data);
if (data_row_length != rect.width())
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
return true;
}
bool GLImageMemory::ScheduleOverlayPlane(
gfx::AcceleratedWidget widget,
int z_order,
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect,
bool enable_blend,
std::unique_ptr<gfx::GpuFence> gpu_fence) {
return false;
}
GLImageMemory::Type GLImageMemory::GetType() const {
return Type::MEMORY;
}
// static
bool GLImageMemory::ValidFormat(gfx::BufferFormat format) {
switch (format) {
case gfx::BufferFormat::R_8:
case gfx::BufferFormat::R_16:
case gfx::BufferFormat::RG_88:
case gfx::BufferFormat::BGR_565:
case gfx::BufferFormat::RGBA_4444:
case gfx::BufferFormat::RGBX_8888:
case gfx::BufferFormat::RGBA_8888:
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::BGRA_1010102:
case gfx::BufferFormat::RGBA_1010102:
case gfx::BufferFormat::BGRA_8888:
case gfx::BufferFormat::RGBA_F16:
return true;
case gfx::BufferFormat::YVU_420:
case gfx::BufferFormat::YUV_420_BIPLANAR:
case gfx::BufferFormat::P010:
return false;
}
NOTREACHED();
return false;
}
} // namespace gl
| {'content_hash': 'ff98b5f0079ef2d8a60aaffed65dca3b', 'timestamp': '', 'source': 'github', 'line_count': 465, 'max_line_length': 80, 'avg_line_length': 32.883870967741935, 'alnum_prop': 0.5921130076515597, 'repo_name': 'endlessm/chromium-browser', 'id': '433dae32f13a87ed1485bed276fe1e3c561dc668', 'size': '16184', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'ui/gl/gl_image_memory.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskRequest;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.tasks.TaskId;
import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestGetTaskAction extends BaseRestHandler {
public RestGetTaskAction(RestController controller) {
controller.registerHandler(GET, "/_tasks/{task_id}", this);
}
@Override
public String getName() {
return "get_task_action";
}
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
TaskId taskId = new TaskId(request.param("task_id"));
boolean waitForCompletion = request.paramAsBoolean("wait_for_completion", false);
TimeValue timeout = request.paramAsTime("timeout", null);
GetTaskRequest getTaskRequest = new GetTaskRequest();
getTaskRequest.setTaskId(taskId);
getTaskRequest.setWaitForCompletion(waitForCompletion);
getTaskRequest.setTimeout(timeout);
return channel -> client.admin().cluster().getTask(getTaskRequest, new RestToXContentListener<>(channel));
}
}
| {'content_hash': '9f4352337c39342945da788716584dd6', 'timestamp': '', 'source': 'github', 'line_count': 41, 'max_line_length': 118, 'avg_line_length': 37.09756097560975, 'alnum_prop': 0.7619986850756082, 'repo_name': 'coding0011/elasticsearch', 'id': 'f0ca02f43bc3528deec6c55c4a921caa714cadaf', 'size': '2309', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetTaskAction.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '11081'}, {'name': 'Batchfile', 'bytes': '18064'}, {'name': 'Emacs Lisp', 'bytes': '3341'}, {'name': 'FreeMarker', 'bytes': '45'}, {'name': 'Groovy', 'bytes': '312193'}, {'name': 'HTML', 'bytes': '5519'}, {'name': 'Java', 'bytes': '41505710'}, {'name': 'Perl', 'bytes': '7271'}, {'name': 'Python', 'bytes': '55163'}, {'name': 'Shell', 'bytes': '119286'}]} |
<?php theme_include('header'); ?>
<h1 class="wrap">You searched for “<?php echo search_term(); ?>”.</h1>
<?php if(has_search_results()): ?>
<ul class="items">
<?php $i = 0; while(posts()): $i++; ?>
<li style="background: hsl(215,28%,<?php echo round((($i / posts_per_page()) * 20) + 20); ?>%);">
<article class="wrap">
<h2>
<a href="<?php echo article_url(); ?>" title="<?php echo article_title(); ?>"><?php echo article_title(); ?></a>
</h2>
</article>
</li>
<?php endwhile; ?>
</ul>
<?php if(has_pagination()): ?>
<nav class="pagination">
<div class="wrap">
<?php echo search_prev(); ?>
<?php echo search_next(); ?>
</div>
</nav>
<?php endif; ?>
<?php else: ?>
<p class="wrap">Unfortunately, there's no results for “<?php echo search_term(); ?>”. Did you spell everything correctly?</p>
<?php endif; ?>
<?php theme_include('footer'); ?> | {'content_hash': '5b70f436eb48fec4d4e787a23a10c5e9', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 138, 'avg_line_length': 29.387096774193548, 'alnum_prop': 0.5675082327113062, 'repo_name': 'r8dhex/tiantianhotpot', 'id': '480050bcf64c383fc42e18a3d78d4ef86bb15a85', 'size': '911', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'www/themes/zleek/search.php', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '66501'}, {'name': 'JavaScript', 'bytes': '11608'}, {'name': 'PHP', 'bytes': '386832'}, {'name': 'Ruby', 'bytes': '2563'}, {'name': 'Shell', 'bytes': '881'}]} |
"""
Django settings for aijianli project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!14&1)rc(ur2b+r3!9x&e=9b+qhl)_*qx_d8--5aw$9c1%g$yo'
# SECURITY WARNING: don't run with debug turned on in production!
if sys.platform == 'win32':
DEBUG = True
else:
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1']
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'matrix',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)
ROOT_URLCONF = 'aijianli.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'matrix/templates'),
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.request",
)
WSGI_APPLICATION = 'aijianli.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'matrix/static'),
)
STATIC_ROOT = 'static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = 'media/'
| {'content_hash': '34eafd9bed7160e5bbaade0a437a0b5f', 'timestamp': '', 'source': 'github', 'line_count': 122, 'max_line_length': 71, 'avg_line_length': 24.860655737704917, 'alnum_prop': 0.6848005275304978, 'repo_name': 'xsank/aijianli', 'id': 'ef00b615d98c6e529c7736d6d31bd9d9311f33b9', 'size': '3033', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'aijianli/settings.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '31051'}, {'name': 'HTML', 'bytes': '15212'}, {'name': 'JavaScript', 'bytes': '308614'}, {'name': 'Python', 'bytes': '12554'}]} |
import React, {Component} from "react";
import PropTypes from "subschema-prop-types";
export class FormTemplate extends Component {
static displayName = 'FormTemplate';
static propTypes = {
style : PropTypes.style,
onSubmit : PropTypes.submit,
onReset : PropTypes.event,
accept : PropTypes.string,
acceptCharset : PropTypes.string,
action : PropTypes.string,
autocapitalize: PropTypes.oneOf(
['on', 'off', 'words', 'sentences', 'charecters', 'none']),
autoComplete : PropTypes.oneOf(['on', 'off']),
autocomplete : PropTypes.deprecated('Please use autoComplete instead'),
encType : PropTypes.oneOf(
['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain']),
method : PropTypes.oneOf(['get', 'post']),
name : PropTypes.string,
target : PropTypes.string,
fieldAttrs : PropTypes.any,
charSet : PropTypes.string,
disabled : PropTypes.bool,
noValidate : PropTypes.bool,
novalidate : PropTypes.deprecated('Please use noValidate instead')
};
static defaultProps = {
className: '',
method : 'post'
};
render() {
const {children, style, fieldAttrs, autocomplete, formClass, className, ...props} = this.props;
if (autocomplete && !props.autoComplete) {
props.autoComplete = autocomplete;
}
return (
<form {...props} className={className || formClass} {...fieldAttrs}>
{children}
</form>);
}
}
export default ({
template: {
FormTemplate
}
})
| {'content_hash': '06ff593a49b0b01857ce67b87529bcaa', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 103, 'avg_line_length': 33.24528301886792, 'alnum_prop': 0.5624290578887627, 'repo_name': 'jspears/subschema-devel', 'id': '12f3def5084be5839d5b2578709a644b94c9d6ef', 'size': '1762', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'plugins/subschema-plugin-template-form/src/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7753'}, {'name': 'Java', 'bytes': '1350'}, {'name': 'JavaScript', 'bytes': '13461200'}, {'name': 'Objective-C', 'bytes': '4444'}, {'name': 'Python', 'bytes': '1748'}, {'name': 'Shell', 'bytes': '1345'}]} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>semantics: 1 m 17 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.2 / semantics - 8.14.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
semantics
<small>
8.14.0
<span class="label label-success">1 m 17 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-03 06:26:54 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-03 06:26:54 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
authors: [
"Yves Bertot"
]
maintainer: "[email protected]"
homepage: "https://github.com/coq-community/semantics"
dev-repo: "git+https://github.com/coq-community/semantics.git"
bug-reports: "https://github.com/coq-community/semantics/issues"
license: "MIT"
synopsis: "A survey of semantics styles, from natural semantics through structural operational, axiomatic, and denotational semantics, to abstract interpretation"
description: """
This is a survey of programming language semantics styles
for a miniature example of a programming language, with their encoding
in Coq, the proofs of equivalence of different styles, and the proof
of soundess of tools obtained from axiomatic semantics or abstract
interpretation. The tools can be run inside Coq, thus making them
available for proof by reflection, and the code can also be extracted
and connected to a yacc-based parser, thanks to the use of a functor
parameterized by a module type of strings. A hand-written parser is
also provided in Coq, but there are no proofs associated.
"""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10"}
"num"
"ocamlbuild" {build}
]
tags: [
"category:Computer Science/Semantics and Compilation/Semantics"
"keyword:natural semantics"
"keyword:denotational semantics"
"keyword:axiomatic semantics"
"keyword:Hoare logic"
"keyword:Dijkstra weakest pre-condition calculus"
"keyword:abstract interpretation"
"keyword:intervals"
"logpath:Semantics"
]
url {
src: "https://github.com/coq-community/semantics/archive/v8.14.0.tar.gz"
checksum: [
"md5=1e402d1d24cca934d301ce7be4d2453d"
"sha512=480629d301612143a9e9c4c546d48e9b2da0961176093301f1e37be060fa09949b24674727a041deba595b4b08efa180b60d96288eff7835edcb47cb48a99c3a"
]
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-semantics.8.14.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-semantics.8.14.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>31 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-semantics.8.14.0 coq.8.13.2</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 m 17 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 3 M</p>
<ul>
<li>427 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/intervals.vo</code></li>
<li>387 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/abstract_i.vo</code></li>
<li>307 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/abstract_i.glob</code></li>
<li>256 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/intervals.glob</code></li>
<li>226 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/parser.vo</code></li>
<li>175 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little_w_string.vo</code></li>
<li>150 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/asm.vo</code></li>
<li>123 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little.vo</code></li>
<li>120 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/axiom.vo</code></li>
<li>104 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/asm.glob</code></li>
<li>82 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/parser.glob</code></li>
<li>72 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/function_cpo.glob</code></li>
<li>69 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/abstract_i.v</code></li>
<li>66 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/denot.vo</code></li>
<li>65 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/function_cpo.vo</code></li>
<li>60 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little.glob</code></li>
<li>48 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/axiom.glob</code></li>
<li>40 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/syntax.vo</code></li>
<li>39 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/intervals.v</code></li>
<li>30 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example2.vo</code></li>
<li>29 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example.vo</code></li>
<li>27 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/constructs.vo</code></li>
<li>21 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/ex_i.vo</code></li>
<li>21 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little_w_string.glob</code></li>
<li>20 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/extract_interpret.vo</code></li>
<li>20 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/context_sqrt.vo</code></li>
<li>18 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/parser.v</code></li>
<li>17 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/denot.glob</code></li>
<li>16 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/asm.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/function_cpo.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/axiom.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/syntax.glob</code></li>
<li>10 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example.glob</code></li>
<li>8 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/constructs.glob</code></li>
<li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example2.glob</code></li>
<li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/little_w_string.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/denot.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/ex_i.glob</code></li>
<li>2 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/constructs.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/syntax.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/context_sqrt.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/example2.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/ex_i.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/extract_interpret.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/extract_interpret.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Semantics/context_sqrt.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-semantics.8.14.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {'content_hash': '9085a5a81ecdc5560a15c9b8a8527fd9', 'timestamp': '', 'source': 'github', 'line_count': 230, 'max_line_length': 172, 'avg_line_length': 57.78695652173913, 'alnum_prop': 0.5979234068166428, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'ae6f462862208ed367fda5a5489ab72041a93234', 'size': '13316', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.12.1-2.0.8/released/8.13.2/semantics/8.14.0.html', 'mode': '33188', 'license': 'mit', 'language': []} |
package org.rabix.bindings.protocol.draft2.helper;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.rabix.bindings.model.FileValue;
import org.rabix.common.helper.ChecksumHelper;
import org.rabix.common.helper.ChecksumHelper.HashAlgorithm;
public class Draft2FileValueHelper extends Draft2BeanHelper {
private static final String KEY_NAME = "name";
private static final String KEY_PATH = "path";
private static final String KEY_SIZE = "size";
private static final String KEY_CHECKSUM = "checksum";
private static final String KEY_METADATA = "metadata";
private static final String KEY_CONTENTS = "contents";
private static final String KEY_ORIGINAL_PATH = "originalPath";
private static final String KEY_SECONDARY_FILES = "secondaryFiles";
private static final int CONTENTS_NUMBER_OF_BYTES = 65536;
public static void setFileType(Object raw) {
setValue(Draft2SchemaHelper.KEY_JOB_TYPE, Draft2SchemaHelper.TYPE_JOB_FILE, raw);
}
public static String getName(Object raw) {
return getValue(KEY_NAME, raw);
}
public static void setName(String name, Object raw) {
setValue(KEY_NAME, name, raw);
}
public static void setSize(long size, Object raw) {
setValue(KEY_SIZE, size, raw);
}
public static Long getSize(Object raw) {
Object number = getValue(KEY_SIZE, raw);
if (number == null) {
return null;
}
if (number instanceof Integer) {
return new Long(number.toString());
}
return (Long) number;
}
public static void setChecksum(File file, Object raw, HashAlgorithm hashAlgorithm) {
if (!file.exists()) {
throw new RuntimeException("Missing file " + file);
}
String checksum = ChecksumHelper.checksum(file, hashAlgorithm);
if (checksum != null) {
setValue(KEY_CHECKSUM, checksum, raw);
}
}
public static void setContents(Object raw) throws IOException {
String contents = loadContents(raw);
setValue(KEY_CONTENTS, contents, raw);
}
public static String getContents(Object raw) {
return getValue(KEY_CONTENTS, raw);
}
public static String getChecksum(Object raw) {
return getValue(KEY_CHECKSUM, raw);
}
public static String getPath(Object raw) {
return getValue(KEY_PATH, raw);
}
public static void setPath(String path, Object raw) {
setValue(KEY_PATH, path, raw);
}
public static void setOriginalPath(String path, Object raw) {
setValue(KEY_ORIGINAL_PATH, path, raw);
}
public static String getOriginalPath(Object raw) {
return getValue(KEY_ORIGINAL_PATH, raw);
}
public static void setMetadata(Object metadata, Object raw) {
setValue(KEY_METADATA, metadata, raw);
}
public static Map<String, Object> getMetadata(Object raw) {
return getValue(KEY_METADATA, raw);
}
public static void setSecondaryFiles(List<?> secondaryFiles, Object raw) {
setValue(KEY_SECONDARY_FILES, secondaryFiles, raw);
}
public static List<Map<String, Object>> getSecondaryFiles(Object raw) {
return getValue(KEY_SECONDARY_FILES, raw);
}
/**
* Extract paths from unknown data
*/
public static Set<String> flattenPaths(Object value) {
Set<String> paths = new HashSet<>();
if (value == null) {
return paths;
} else if (Draft2SchemaHelper.isFileFromValue(value)) {
paths.add(getPath(value));
List<Map<String, Object>> secondaryFiles = getSecondaryFiles(value);
if (secondaryFiles != null) {
paths.addAll(flattenPaths(secondaryFiles));
}
return paths;
} else if (value instanceof List<?>) {
for (Object subvalue : ((List<?>) value)) {
paths.addAll(flattenPaths(subvalue));
}
return paths;
} else if (value instanceof Map<?, ?>) {
for (Object subvalue : ((Map<?, ?>) value).values()) {
paths.addAll(flattenPaths(subvalue));
}
}
return paths;
}
/**
* Load first CONTENTS_NUMBER_OF_BYTES bytes from file
*/
private static String loadContents(Object fileData) throws IOException {
String path = Draft2FileValueHelper.getPath(fileData);
InputStream is = null;
try {
File file = new File(path);
is = new FileInputStream(file);
byte[] buffer = new byte[Math.min(CONTENTS_NUMBER_OF_BYTES, (int) file.length())];
is.read(buffer);
return new String(buffer, "UTF-8");
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
// do nothing
}
}
}
}
public static FileValue createFileValue(Object value) {
String path = Draft2FileValueHelper.getPath(value);
String checksum = Draft2FileValueHelper.getChecksum(value);
Long size = Draft2FileValueHelper.getSize(value);
Map<String, Object> properties = new HashMap<>();
properties.put(Draft2BindingHelper.KEY_SBG_METADATA, Draft2FileValueHelper.getMetadata(value));
List<FileValue> secondaryFiles = new ArrayList<>();
List<Map<String, Object>> secondaryFileValues = Draft2FileValueHelper.getSecondaryFiles(value);
if (secondaryFileValues != null) {
for (Map<String, Object> secondaryFileValue : secondaryFileValues) {
secondaryFiles.add(createFileValue(secondaryFileValue));
}
}
return new FileValue(size, path, checksum, secondaryFiles, properties);
}
}
| {'content_hash': '53aee43e05cb9707d86f4127b34e03af', 'timestamp': '', 'source': 'github', 'line_count': 182, 'max_line_length': 99, 'avg_line_length': 30.532967032967033, 'alnum_prop': 0.6852618319236998, 'repo_name': 'markosbg/markoBunny', 'id': 'd8b37fcc75cea419df984552fe5050a88c2dd1cc', 'size': '5557', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'rabix-bindings/src/main/java/org/rabix/bindings/protocol/draft2/helper/Draft2FileValueHelper.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '297'}, {'name': 'HTML', 'bytes': '2451'}, {'name': 'Java', 'bytes': '852053'}, {'name': 'JavaScript', 'bytes': '4011'}, {'name': 'Shell', 'bytes': '1829'}]} |
import React, { PropTypes } from 'react'
import { View, StyleSheet, Text, Image, Dimensions } from 'react-native'
import { LoginButton } from 'react-native-fbsdk'
import { colors, fontSizes } from '~/styles'
const { height } = Dimensions.get('window')
Splash.propTypes = {
onLoginFinished: PropTypes.func.isRequired,
}
export default function Splash (props) {
return (
<View style={styles.container}>
<View>
<Image style={styles.image} source={require('../../images/logo.png')} />
<Text style={styles.slogan}>ReactModoro</Text>
</View>
<View style={styles.loginContainer}>
<LoginButton
style={{
height: 30,
width: 180,
marginBottom: 15,
}}
onLoginFinished={props.onLoginFinished}/>
<Text style={styles.assuranceText}>
Don't worry. We don't post anything to Facebook.
</Text>
</View>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: colors.white,
justifyContent: 'space-between',
alignItems: 'center',
paddingTop: 50,
paddingBottom: 40,
},
slogan: {
color: colors.blue,
fontSize: 40,
margin: 20,
textAlign: 'center',
},
image: {
resizeMode: 'contain',
height: height * .4 > 300 ? 300 : height * .4
},
loginContainer: {
paddingLeft: 30,
paddingRight: 30,
alignItems: 'center',
},
assuranceText: {
color: colors.secondary,
fontSize: fontSizes.secondary,
textAlign: 'center',
},
})
| {'content_hash': '52c69605bc18306eb433ec821f1fe696', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 80, 'avg_line_length': 24.825396825396826, 'alnum_prop': 0.6029411764705882, 'repo_name': 'tylermcginnis/react-native', 'id': '8d13d942ac06495a37d7cd67751a1304451327a6', 'size': '1564', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/components/Splash/Splash.js', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'AppleScript', 'bytes': '1174'}, {'name': 'C', 'bytes': '34676'}, {'name': 'CSS', 'bytes': '16112'}, {'name': 'HTML', 'bytes': '4771'}, {'name': 'JavaScript', 'bytes': '961003'}, {'name': 'Objective-C', 'bytes': '656409'}, {'name': 'Ruby', 'bytes': '4833'}, {'name': 'Shell', 'bytes': '2801'}]} |
package ru.job4j.factorial;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
*Class FactorialTest checking
*method int calcFactorial(int value).
*@author Dinis Saetgareev ([email protected])
*@version 1.0
*@since 27.02.2017
*/
public class FactorialTest {
/**
*method whenValueThenFactorial().
*/
@Test
public void whenValueThenFactorial() {
Factorial factor = new Factorial();
assertThat(factor.calcFactorial(3), is(6));
}
} | {'content_hash': '5e59a7300be34df0c3d2d5f770cdc9d4', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 45, 'avg_line_length': 20.75, 'alnum_prop': 0.7429718875502008, 'repo_name': 'dsaetgareev/junior', 'id': '313b4391bc79b566cbb4abbd6ae46ba82a54a3b2', 'size': '498', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'chapter_001/src/test/java/ru/job4j/factorial/FactorialTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '357950'}]} |
package api
import (
"bytes"
"encoding/json"
"fmt"
"net/url"
"strings"
"code.cloudfoundry.org/cli/cf/api/resources"
"code.cloudfoundry.org/cli/cf/configuration/coreconfig"
"code.cloudfoundry.org/cli/cf/errors"
"code.cloudfoundry.org/cli/cf/models"
"code.cloudfoundry.org/cli/cf/net"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . ServiceBrokerRepository
type ServiceBrokerRepository interface {
ListServiceBrokers(callback func(models.ServiceBroker) bool) error
FindByName(name string) (serviceBroker models.ServiceBroker, apiErr error)
FindByGUID(guid string) (serviceBroker models.ServiceBroker, apiErr error)
Create(name, url, username, password, spaceGUID string) (apiErr error)
Update(serviceBroker models.ServiceBroker) (apiErr error)
Rename(guid, name string) (apiErr error)
Delete(guid string) (apiErr error)
}
type CloudControllerServiceBrokerRepository struct {
config coreconfig.Reader
gateway net.Gateway
}
func NewCloudControllerServiceBrokerRepository(config coreconfig.Reader, gateway net.Gateway) (repo CloudControllerServiceBrokerRepository) {
repo.config = config
repo.gateway = gateway
return
}
func (repo CloudControllerServiceBrokerRepository) ListServiceBrokers(callback func(models.ServiceBroker) bool) error {
return repo.gateway.ListPaginatedResources(
repo.config.APIEndpoint(),
"/v2/service_brokers",
resources.ServiceBrokerResource{},
func(resource interface{}) bool {
callback(resource.(resources.ServiceBrokerResource).ToFields())
return true
})
}
func (repo CloudControllerServiceBrokerRepository) FindByName(name string) (serviceBroker models.ServiceBroker, apiErr error) {
foundBroker := false
apiErr = repo.gateway.ListPaginatedResources(
repo.config.APIEndpoint(),
fmt.Sprintf("/v2/service_brokers?q=%s", url.QueryEscape("name:"+name)),
resources.ServiceBrokerResource{},
func(resource interface{}) bool {
serviceBroker = resource.(resources.ServiceBrokerResource).ToFields()
foundBroker = true
return false
})
if !foundBroker && (apiErr == nil) {
apiErr = errors.NewModelNotFoundError("Service Broker", name)
}
return
}
func (repo CloudControllerServiceBrokerRepository) FindByGUID(guid string) (serviceBroker models.ServiceBroker, apiErr error) {
broker := new(resources.ServiceBrokerResource)
apiErr = repo.gateway.GetResource(repo.config.APIEndpoint()+fmt.Sprintf("/v2/service_brokers/%s", guid), broker)
serviceBroker = broker.ToFields()
return
}
func (repo CloudControllerServiceBrokerRepository) Create(name, url, username, password, spaceGUID string) error {
path := "/v2/service_brokers"
args := struct {
Name string `json:"name"`
URL string `json:"broker_url"`
Username string `json:"auth_username"`
Password string `json:"auth_password"`
SpaceGUID string `json:"space_guid,omitempty"`
}{
name,
url,
username,
password,
spaceGUID,
}
bs, err := json.Marshal(args)
if err != nil {
return err
}
return repo.gateway.CreateResource(repo.config.APIEndpoint(), path, bytes.NewReader(bs))
}
func (repo CloudControllerServiceBrokerRepository) Update(serviceBroker models.ServiceBroker) (apiErr error) {
path := fmt.Sprintf("/v2/service_brokers/%s", serviceBroker.GUID)
body := fmt.Sprintf(
`{"broker_url":"%s","auth_username":"%s","auth_password":"%s"}`,
serviceBroker.URL, serviceBroker.Username, serviceBroker.Password,
)
return repo.gateway.UpdateResource(repo.config.APIEndpoint(), path, strings.NewReader(body))
}
func (repo CloudControllerServiceBrokerRepository) Rename(guid, name string) (apiErr error) {
path := fmt.Sprintf("/v2/service_brokers/%s", guid)
body := fmt.Sprintf(`{"name":"%s"}`, name)
return repo.gateway.UpdateResource(repo.config.APIEndpoint(), path, strings.NewReader(body))
}
func (repo CloudControllerServiceBrokerRepository) Delete(guid string) (apiErr error) {
path := fmt.Sprintf("/v2/service_brokers/%s", guid)
return repo.gateway.DeleteResource(repo.config.APIEndpoint(), path)
}
| {'content_hash': 'b943a6022af6865798fb78ebc9f31117', 'timestamp': '', 'source': 'github', 'line_count': 116, 'max_line_length': 141, 'avg_line_length': 34.55172413793103, 'alnum_prop': 0.7614770459081837, 'repo_name': 'cloudfoundry/cli', 'id': 'df0080320fde83da9fe96d2a2cff85908abc3d69', 'size': '4008', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'cf/api/service_brokers.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '11084107'}, {'name': 'Makefile', 'bytes': '10262'}, {'name': 'Procfile', 'bytes': '83'}, {'name': 'Ruby', 'bytes': '210'}, {'name': 'Shell', 'bytes': '8601'}]} |
#region License
// Copyright(c) Workshell Ltd
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Workshell.PE.Extensions;
namespace Workshell.PE.Content
{
public sealed class CLRMetaDataStream : ISupportsLocation, ISupportsBytes
{
private readonly PortableExecutableImage _image;
internal CLRMetaDataStream(PortableExecutableImage image, Location mdLocation, ulong imageBase, CLRMetaDataStreamTableEntry tableEntry)
{
_image = image;
var calc = image.GetCalculator();
var offset = mdLocation.FileOffset + tableEntry.Offset;
var rva = calc.OffsetToRVA(offset);
var va = imageBase + rva;
Location = new Location(image, offset, rva, va, tableEntry.Size, tableEntry.Size);
TableEntry = tableEntry;
Name = tableEntry.Name;
}
#region Methods
public override string ToString()
{
return Name;
}
public byte[] GetBytes()
{
return GetBytesAsync().GetAwaiter().GetResult();
}
public async Task<byte[]> GetBytesAsync()
{
var stream = _image.GetStream();
var buffer = await stream.ReadBytesAsync(Location).ConfigureAwait(false);
return buffer;
}
public Stream GetStream()
{
var buffer = GetBytes();
return new MemoryStream(buffer);
}
public async Task<Stream> GetStreamAsync()
{
var buffer = await GetBytesAsync().ConfigureAwait(false);
return new MemoryStream(buffer);
}
public long CopyTo(Stream stream, int bufferSize = 4096)
{
return CopyToAsync(stream, bufferSize).GetAwaiter().GetResult();
}
public async Task<long> CopyToAsync(Stream stream, int bufferSize = 4096)
{
using (var mem = await GetStreamAsync().ConfigureAwait(false))
{
return await Utils.CopyStreamAsync(mem, stream, bufferSize).ConfigureAwait(false);
}
}
#endregion
#region Properties
public Location Location { get; }
public CLRMetaDataStreamTableEntry TableEntry { get; }
public string Name { get; }
#endregion
}
}
| {'content_hash': '284c068f7c6d0718f3ed17b1be556083', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 143, 'avg_line_length': 33.36697247706422, 'alnum_prop': 0.6315644762166621, 'repo_name': 'Workshell/pe', 'id': '70c843233b719549b8d3b9258e7e968b4022ee81', 'size': '3639', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Workshell.PE/Content/CLR/CLRMetaDataStream.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '755869'}]} |
//
// This code was auto-generated by AFNOR StoredProcedureSystem, version 1.0
//
using System.Runtime.Serialization;
using System;
namespace AnnuaireCertifies.Domaine
{
public partial class TypeRenduBlocDto
{
[DataMember]
public long ID { get; set; }
[DataMember]
public string Description { get; set; }
[DataMember]
public string Code { get; set; }
[DataMember]
public string CodeEchange { get; set; }
[DataMember]
public string CodeLectureContenu { get; set; }
[DataMember]
public long TypeBlocID { get; set; }
[DataMember]
public bool Archive { get; set; }
}
}
| {'content_hash': '114e4a5f0bd33b6cf93b2fa7885aa1f0', 'timestamp': '', 'source': 'github', 'line_count': 35, 'max_line_length': 75, 'avg_line_length': 21.02857142857143, 'alnum_prop': 0.5747282608695652, 'repo_name': 'apo-j/Projects_Working', 'id': '2cc737fb650e1ed2e9d19bb4d7789fe62baa1401', 'size': '1101', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'AC/AnnuaireCertifies/AC.Common/AnnuaireCertifies.Domaine/Dto/Generated/TypeRenduBlocDto.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '16118'}, {'name': 'Batchfile', 'bytes': '1096'}, {'name': 'C#', 'bytes': '27262375'}, {'name': 'CSS', 'bytes': '8474090'}, {'name': 'Groff', 'bytes': '2101703'}, {'name': 'HTML', 'bytes': '4910101'}, {'name': 'JavaScript', 'bytes': '20716565'}, {'name': 'PHP', 'bytes': '9283'}, {'name': 'XSLT', 'bytes': '930531'}]} |
<div class="weui_cells_title">weui 按钮</div>
<div class="weui_cells">
<a href="javascript:;" class="weui_btn weui_btn_primary">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_primary">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_warn">确认</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_warn">确认</a>
<a href="javascript:;" class="weui_btn weui_btn_default">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_disabled weui_btn_default">按钮</a>
<div class="button_sp_area">
<a href="javascript:;" class="weui_btn weui_btn_plain_default">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_plain_primary">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">按钮</a>
<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">按钮</a>
</div>
</div>
| {'content_hash': '5f26b69980ab884b1ad84ba657675a0c', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 85, 'avg_line_length': 53.294117647058826, 'alnum_prop': 0.6456953642384106, 'repo_name': 'vfasky/mcore-weui', 'id': 'aed11d402a2c3e47a66468366018515d4ba3fccf', 'size': '950', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'example/tpl/button.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '50'}, {'name': 'CoffeeScript', 'bytes': '14786'}, {'name': 'HTML', 'bytes': '9454'}, {'name': 'JavaScript', 'bytes': '157570'}, {'name': 'Shell', 'bytes': '61'}]} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>statsmodels.genmod.generalized_estimating_equations.GEE.exog_names — statsmodels v0.10.1 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="../_static/statsmodels_hybi_favico.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="stylesheet" href="../_static/examples.css" type="text/css" />
<link rel="stylesheet" href="../_static/facebox.css" type="text/css" />
<script type="text/javascript" src="../_static/scripts.js">
</script>
<script type="text/javascript" src="../_static/facebox.js">
</script>
<script type="text/javascript">
$.facebox.settings.closeImage = "../_static/closelabel.png"
$.facebox.settings.loadingImage = "../_static/loading.gif"
</script>
<script>
$(document).ready(function() {
$.getJSON("../../versions.json", function(versions) {
var dropdown = document.createElement("div");
dropdown.className = "dropdown";
var button = document.createElement("button");
button.className = "dropbtn";
button.innerHTML = "Other Versions";
var content = document.createElement("div");
content.className = "dropdown-content";
dropdown.appendChild(button);
dropdown.appendChild(content);
$(".header").prepend(dropdown);
for (var i = 0; i < versions.length; i++) {
if (versions[i].substring(0, 1) == "v") {
versions[i] = [versions[i], versions[i].substring(1)];
} else {
versions[i] = [versions[i], versions[i]];
};
};
for (var i = 0; i < versions.length; i++) {
var a = document.createElement("a");
a.innerHTML = versions[i][1];
a.href = "../../" + versions[i][0] + "/index.html";
a.title = versions[i][1];
$(".dropdown-content").append(a);
};
});
});
</script>
</head><body>
<div class="headerwrap">
<div class = "header">
<a href = "../index.html">
<img src="../_static/statsmodels_hybi_banner.png" alt="Logo"
style="padding-left: 15px"/></a>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href ="../install.html">Install</a></li> |
<li><a href="https://groups.google.com/forum/?hl=en#!forum/pystatsmodels">Support</a></li> |
<li><a href="https://github.com/statsmodels/statsmodels/issues">Bugs</a></li> |
<li><a href="../dev/index.html">Develop</a></li> |
<li><a href="../examples/index.html">Examples</a></li> |
<li><a href="../faq.html">FAQ</a></li> |
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="statsmodels-genmod-generalized-estimating-equations-gee-exog-names">
<h1>statsmodels.genmod.generalized_estimating_equations.GEE.exog_names<a class="headerlink" href="#statsmodels-genmod-generalized-estimating-equations-gee-exog-names" title="Permalink to this headline">¶</a></h1>
<dl class="method">
<dt id="statsmodels.genmod.generalized_estimating_equations.GEE.exog_names">
<em class="property">property </em><code class="sig-prename descclassname">GEE.</code><code class="sig-name descname">exog_names</code><a class="headerlink" href="#statsmodels.genmod.generalized_estimating_equations.GEE.exog_names" title="Permalink to this definition">¶</a></dt>
<dd><p>Names of exogenous variables</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/generated/statsmodels.genmod.generalized_estimating_equations.GEE.exog_names.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2009-2018, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.1.2.
</div>
</body>
</html> | {'content_hash': '7fd530bfaeb07a013c583043abf5145a', 'timestamp': '', 'source': 'github', 'line_count': 147, 'max_line_length': 279, 'avg_line_length': 40.82312925170068, 'alnum_prop': 0.6328945175804033, 'repo_name': 'statsmodels/statsmodels.github.io', 'id': 'b9bec8a9f081c12720af006914184dc004c11649', 'size': '6005', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'v0.10.1/generated/statsmodels.genmod.generalized_estimating_equations.GEE.exog_names.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []} |
@interface G1SubtractScene : SKScene
@end
| {'content_hash': '25b04cc634c3d1c2bb5efeaf28272de1', 'timestamp': '', 'source': 'github', 'line_count': 3, 'max_line_length': 36, 'avg_line_length': 14.333333333333334, 'alnum_prop': 0.7906976744186046, 'repo_name': 'SpectacularFigo/Crazy-Math', 'id': 'bd5affbb65cf7e863fe4a60cff146304b0eb668c', 'size': '225', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CrazyMath/G1SubtractScene.h', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Objective-C', 'bytes': '321349'}]} |
import * as React from "react";
import { MaybeAccount, RootState } from "../../types";
import { connect } from "react-redux";
import DisconectedAccount from "./DisconnectedAccount";
import ConnectedAccountLayout from "./ConnectedAccountLayout";
import { connectAccountRequest } from "../../actions/connectAccount";
import { TabIndex } from "constants/enums";
interface Props {
readonly selectedTabIndex: number;
readonly account: MaybeAccount;
}
interface Handlers {
readonly onConnect: () => void;
}
class Account extends React.PureComponent<Props & Handlers, never> {
componentDidUpdate(nextProps: Props & Handlers) {
const { selectedTabIndex, account, onConnect } = this.props;
if (
selectedTabIndex !== nextProps.selectedTabIndex &&
account &&
selectedTabIndex === TabIndex.ACCOUNT
) {
onConnect();
}
}
public render() {
return this.props.account ? (
<ConnectedAccountLayout />
) : (
<DisconectedAccount />
);
}
}
const mapState = (state: RootState): Props => ({
selectedTabIndex: state.tab,
account: state.account
});
const mapDispatch: Handlers = {
onConnect: connectAccountRequest
};
export default connect(
mapState,
mapDispatch
)(Account);
| {'content_hash': '2f84e154f075217c87284928bd027699', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 69, 'avg_line_length': 25.392156862745097, 'alnum_prop': 0.6633204633204633, 'repo_name': 'Anveio/mturk-engine', 'id': '23a9c7b84cf66e411ec1e4eb6214e248283ccb5b', 'size': '1295', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/Account/Account.tsx', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '1119'}, {'name': 'JavaScript', 'bytes': '1787'}, {'name': 'TypeScript', 'bytes': '470225'}]} |
This vim bundle adds syntax highlighting for FANUC's KAREL programming language.
## Installing and Using
- Install [pathogen](http://www.vim.org/scripts/script.php?script_id=2332) into `~/.vim/autoload/` and add the
following line to your `~/.vimrc`:
call pathogen#infect()
- Make a clone of the `vim-karel` repository:
$ mkdir -p ~/.vim/bundle
$ cd ~/.vim/bundle
$ git clone https://github.com/onerobotics/vim-karel
- OR use [vundle](https://github.com/gmarik/vundle), adding this line to your `~/.vimrc`:
Bundle 'onerobotics/vim-karel'
- OR use git submodules:
$ git submodule add https://github.com/onerobotics/vim-karel.git bundle/vim-karel
$ git submodule init
## License ##
MIT
| {'content_hash': 'dd77a575cb1a2a0e778c56b977976934', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 110, 'avg_line_length': 27.925925925925927, 'alnum_prop': 0.6684350132625995, 'repo_name': 'onerobotics/vim-karel', 'id': '914f74bef2e612405fdcb1a6b9b43d16e14bd370', 'size': '767', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Vim script', 'bytes': '6451'}]} |
import Midi
main = write_music "test6.mid" 1 2 music
music :: Music Note
music = Sequence [ Parallel [C,E,G], Parallel [E,G,B], Parallel [G,C,E], C ]
| {'content_hash': '2aadbe757dd6852d24f14dfa8243a02c', 'timestamp': '', 'source': 'github', 'line_count': 6, 'max_line_length': 77, 'avg_line_length': 25.5, 'alnum_prop': 0.6535947712418301, 'repo_name': 'beni55/Midi', 'id': '0b5bc01bc25626b3edebf59edc68ff29f4fad132', 'size': '153', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'test/test6.hs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Haskell', 'bytes': '14915'}]} |
//--------------------------------------------------------------------------------------
// PlayFabAuthService.cs
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//--------------------------------------------------------------------------------------
using UnityEngine;
using PlayFab;
using PlayFab.ClientModels;
using LoginResult = PlayFab.ClientModels.LoginResult;
using System;
//#if UNITY_ANDROID && !UNITY_EDITOR
//using GooglePlayGames;
//using GooglePlayGames.BasicApi;
//#endif
/// <summary>
/// Supported Authentication types
/// See - https://api.playfab.com/documentation/client#Authentication
/// </summary>
public enum Authtypes
{
None,
Silent,
UsernameAndPassword,
EmailAndPassword,
RegisterPlayFabAccount,
GoogleAccount
}
public class PlayFabAuthService
{
// Events to subscribe to for this service
public delegate void DisplayAuthenticationEvent();
public static event DisplayAuthenticationEvent OnDisplayAuthentication;
public delegate void LoginSuccessEvent(LoginResult success);
public static event LoginSuccessEvent OnLoginSuccess;
public delegate void PlayFabErrorEvent(PlayFabError error);
public static event PlayFabErrorEvent OnPlayFabError;
// These are fields that we set when we are using the service.
public string Email;
public string Username;
public string Password;
public string AuthTicket;
public GetPlayerCombinedInfoRequestParams InfoRequestParams;
// This is a force link flag for custom ids for demoing
public bool ForceLink = false;
// Accessbility for PlayFab ID & Session Tickets
public static string PlayFabId { get { return _playFabId; } }
private static string _playFabId;
public static string SessionTicket { get { return _sessionTicket; } }
private static string _sessionTicket;
private const string _LoginRememberKey = "PlayFabLoginRemember";
private const string _PlayFabRememberMeIdKey = "PlayFabIdPassGuid";
private const string _PlayFabAuthTypeKey = "PlayFabAuthType";
public static PlayFabAuthService Instance
{
get
{
if(_instance == null)
{
_instance = new PlayFabAuthService();
}
return _instance;
}
}
private static PlayFabAuthService _instance;
public PlayFabAuthService()
{
_instance = this;
}
/// <summary>
/// Remember the user next time they log in
/// This is used for Auto-Login purpose.
/// </summary>
public bool RememberMe
{
get
{
return PlayerPrefs.GetInt(_LoginRememberKey, 0) == 0 ? false : true;
}
set
{
PlayerPrefs.SetInt(_LoginRememberKey, value ? 1 : 0);
}
}
/// <summary>
/// Remember the type of authenticate for the user
/// </summary>
public Authtypes AuthType
{
get
{
return (Authtypes)PlayerPrefs.GetInt(_PlayFabAuthTypeKey, 0);
}
set
{
PlayerPrefs.SetInt(_PlayFabAuthTypeKey, (int) value);
}
}
/// <summary>
/// Generated Remember Me ID
/// Pass Null for a value to have one auto-generated.
/// </summary>
private string RememberMeId
{
get
{
return PlayerPrefs.GetString(_PlayFabRememberMeIdKey, "");
}
set
{
var guid = value ?? Guid.NewGuid().ToString();
PlayerPrefs.SetString(_PlayFabRememberMeIdKey, guid);
}
}
public string AuthCode { get; set; }
public void ClearRememberMe()
{
PlayerPrefs.DeleteKey(_LoginRememberKey);
PlayerPrefs.DeleteKey(_PlayFabRememberMeIdKey);
PlayerPrefs.DeleteKey(_PlayFabAuthTypeKey);
}
/// <summary>
/// Kick off the authentication process by specific authtype.
/// </summary>
/// <param name="authType"></param>
public void Authenticate(Authtypes authType)
{
AuthType = authType;
Authenticate();
}
/// <summary>
/// Authenticate the user by the Auth Type that was defined.
/// </summary>
public void Authenticate()
{
switch (AuthType)
{
case Authtypes.None:
if (OnDisplayAuthentication != null)
{
OnDisplayAuthentication.Invoke();
}
break;
case Authtypes.Silent:
SilentlyAuthenticate();
break;
case Authtypes.EmailAndPassword:
AuthenticateEmailPassword();
break;
case Authtypes.RegisterPlayFabAccount:
AddAccountAndPassword();
break;
case Authtypes.GoogleAccount:
AddGoogleAccount();
break;
}
}
/// <summary>
/// Authenticate a user in PlayFab using an Email & Password combo
/// </summary>
private void AuthenticateEmailPassword()
{
//Check if the users has opted to be remembered.
if (RememberMe && !string.IsNullOrEmpty(RememberMeId))
{
// If the user is being remembered, then log them in with a customid that was
// generated by the RememberMeId property
PlayFabClientAPI.LoginWithCustomID(
new LoginWithCustomIDRequest()
{
TitleId = PlayFabSettings.TitleId,
CustomId = RememberMeId,
CreateAccount = true,
InfoRequestParameters = InfoRequestParams
},
// Success
(LoginResult result) =>
{
//Store identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
if (OnLoginSuccess != null)
{
//report login result back to subscriber
OnLoginSuccess.Invoke(result);
}
},
// Failure
(PlayFabError error) =>
{
if (OnPlayFabError != null)
{
//report error back to subscriber
OnPlayFabError.Invoke(error);
}
});
return;
}
// If username & password is empty, then do not continue, and Call back to Authentication UI Display
if (string.IsNullOrEmpty(Email) && string.IsNullOrEmpty(Password))
{
OnDisplayAuthentication.Invoke();
return;
}
// We have not opted for remember me in a previous session, so now we have to login the user with email & password.
PlayFabClientAPI.LoginWithEmailAddress(
new LoginWithEmailAddressRequest()
{
TitleId = PlayFabSettings.TitleId,
Email = Email,
Password = Password,
InfoRequestParameters = InfoRequestParams
},
// Success
(LoginResult result) =>
{
// Store identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
// Note: At this point, they already have an account with PlayFab using a Username (email) & Password
// If RememberMe is checked, then generate a new Guid for Login with CustomId.
if (RememberMe)
{
RememberMeId = Guid.NewGuid().ToString();
AuthType = Authtypes.EmailAndPassword;
// Fire and forget, but link a custom ID to this PlayFab Account.
PlayFabClientAPI.LinkCustomID(
new LinkCustomIDRequest
{
CustomId = RememberMeId,
ForceLink = ForceLink
},
null, // Success callback
null // Failure callback
);
}
if (OnLoginSuccess != null)
{
//report login result back to subscriber
OnLoginSuccess.Invoke(result);
}
},
// Failure
(PlayFabError error) =>
{
if (OnPlayFabError != null)
{
//Report error back to subscriber
OnPlayFabError.Invoke(error);
}
});
}
/// <summary>
/// Register a user with an Email & Password
/// Note: We are not using the RegisterPlayFab API
/// </summary>
private void AddAccountAndPassword()
{
// Any time we attempt to register a player, first silently authenticate the player.
// This will retain the players True Origination (Android, iOS, Desktop)
SilentlyAuthenticate(
(LoginResult result) =>
{
if(result == null)
{
//something went wrong with Silent Authentication, Check the debug console.
OnPlayFabError.Invoke(new PlayFabError()
{
Error = PlayFabErrorCode.UnknownError,
ErrorMessage = "Silent Authentication by Device failed"
});
}
// Note: If silent auth is success, which is should always be and the following
// below code fails because of some error returned by the server ( like invalid email or bad password )
// this is okay, because the next attempt will still use the same silent account that was already created.
// Now add our username & password.
PlayFabClientAPI.AddUsernamePassword(
new AddUsernamePasswordRequest()
{
Username = Username ?? result.PlayFabId, // Because it is required & Unique and not supplied by User.
Email = Email,
Password = Password,
},
// Success
(AddUsernamePasswordResult addResult) =>
{
if (OnLoginSuccess != null)
{
// Store identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
// If they opted to be remembered on next login.
if (RememberMe)
{
// Generate a new Guid
RememberMeId = Guid.NewGuid().ToString();
// Fire and forget, but link the custom ID to this PlayFab Account.
PlayFabClientAPI.LinkCustomID(
new LinkCustomIDRequest()
{
CustomId = RememberMeId,
ForceLink = ForceLink
},
null,
null
);
}
// Override the auth type to ensure next login is using this auth type.
AuthType = Authtypes.EmailAndPassword;
// Report login result back to subscriber.
OnLoginSuccess.Invoke(result);
}
},
// Failure
(PlayFabError error) =>
{
if (OnPlayFabError != null)
{
//Report error result back to subscriber
OnPlayFabError.Invoke(error);
}
});
});
}
private void SilentlyAuthenticate(System.Action<LoginResult> callback = null)
{
#if UNITY_ANDROID && !UNITY_EDITOR
//Get the device id from native android
AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = up.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject contentResolver = currentActivity.Call<AndroidJavaObject>("getContentResolver");
AndroidJavaClass secure = new AndroidJavaClass("android.provider.Settings$Secure");
string deviceId = secure.CallStatic<string>("getString", contentResolver, "android_id");
//Login with the android device ID
PlayFabClientAPI.LoginWithAndroidDeviceID(new LoginWithAndroidDeviceIDRequest() {
TitleId = PlayFabSettings.TitleId,
AndroidDevice = SystemInfo.deviceModel,
OS = SystemInfo.operatingSystem,
AndroidDeviceId = deviceId,
CreateAccount = true,
InfoRequestParameters = InfoRequestParams
}, (result) => {
//Store Identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
//check if we want to get this callback directly or send to event subscribers.
if (callback == null && OnLoginSuccess != null)
{
//report login result back to the subscriber
OnLoginSuccess.Invoke(result);
}else if (callback != null)
{
//report login result back to the caller
callback.Invoke(result);
}
}, (error) => {
//report errro back to the subscriber
if(callback == null && OnPlayFabError != null){
OnPlayFabError.Invoke(error);
}else{
//make sure the loop completes, callback with null
callback.Invoke(null);
//Output what went wrong to the console.
Debug.LogError(error.GenerateErrorReport());
}
});
#elif UNITY_IPHONE || UNITY_IOS && !UNITY_EDITOR
PlayFabClientAPI.LoginWithIOSDeviceID(new LoginWithIOSDeviceIDRequest() {
TitleId = PlayFabSettings.TitleId,
DeviceModel = SystemInfo.deviceModel,
OS = SystemInfo.operatingSystem,
DeviceId = SystemInfo.deviceUniqueIdentifier,
CreateAccount = true,
InfoRequestParameters = InfoRequestParams
}, (result) => {
//Store Identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
//check if we want to get this callback directly or send to event subscribers.
if (callback == null && OnLoginSuccess != null)
{
//report login result back to the subscriber
OnLoginSuccess.Invoke(result);
}else if (callback != null)
{
//report login result back to the caller
callback.Invoke(result);
}
}, (error) => {
//report errro back to the subscriber
if(callback == null && OnPlayFabError != null){
OnPlayFabError.Invoke(error);
}else{
//make sure the loop completes, callback with null
callback.Invoke(null);
//Output what went wrong to the console.
Debug.LogError(error.GenerateErrorReport());
}
});
#else
PlayFabClientAPI.LoginWithCustomID(new LoginWithCustomIDRequest()
{
TitleId = PlayFabSettings.TitleId,
CustomId = SystemInfo.deviceUniqueIdentifier,
CreateAccount = true,
InfoRequestParameters = InfoRequestParams
}, (result) => {
//Store Identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
//check if we want to get this callback directly or send to event subscribers.
if (callback == null && OnLoginSuccess != null)
{
//report login result back to the subscriber
OnLoginSuccess.Invoke(result);
}
else if (callback != null)
{
//report login result back to the caller
callback.Invoke(result);
}
}, (error) => {
//report errro back to the subscriber
if (callback == null && OnPlayFabError != null)
{
OnPlayFabError.Invoke(error);
}
else
{
//make sure the loop completes, callback with null
callback.Invoke(null);
//Output what went wrong to the console.
Debug.LogError(error.GenerateErrorReport());
}
Debug.LogError(error.GenerateErrorReport());
});
#endif
}
private void AddGoogleAccount(System.Action<LoginResult> callback = null)
{
#if UNITY_ANDROID && !UNITY_EDITOR
Debug.Log("Server Auth Code: " + AuthCode);
PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
{
TitleId = PlayFabSettings.TitleId,
ServerAuthCode = AuthCode,
CreateAccount = true
}, (result) =>
{
//Store Identity and session
_playFabId = result.PlayFabId;
_sessionTicket = result.SessionTicket;
//check if we want to get this callback directly or send to event subscribers.
if (callback == null && OnLoginSuccess != null)
{
//report login result back to the subscriber
OnLoginSuccess.Invoke(result);
}
else if (callback != null)
{
//report login result back to the caller
callback.Invoke(result);
}
}, error =>
{
//report errro back to the subscriber
if (callback == null && OnPlayFabError != null)
{
OnPlayFabError.Invoke(error);
}
else
{
//make sure the loop completes, callback with null
callback.Invoke(null);
//Output what went wrong to the console.
Debug.LogError(error.GenerateErrorReport());
}
});
#endif
}
public void UnlinkSilentAuth()
{
SilentlyAuthenticate((result) =>
{
#if UNITY_ANDROID && !UNITY_EDITOR
//Get the device id from native android
AndroidJavaClass up = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentActivity = up.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject contentResolver = currentActivity.Call<AndroidJavaObject>("getContentResolver");
AndroidJavaClass secure = new AndroidJavaClass("android.provider.Settings$Secure");
string deviceId = secure.CallStatic<string>("getString", contentResolver, "android_id");
//Fire and forget, unlink this android device.
PlayFabClientAPI.UnlinkAndroidDeviceID(new UnlinkAndroidDeviceIDRequest() {
AndroidDeviceId = deviceId
}, null, null);
#elif UNITY_IPHONE || UNITY_IOS && !UNITY_EDITOR
PlayFabClientAPI.UnlinkIOSDeviceID(new UnlinkIOSDeviceIDRequest()
{
DeviceId = SystemInfo.deviceUniqueIdentifier
}, null, null);
#else
PlayFabClientAPI.UnlinkCustomID(new UnlinkCustomIDRequest()
{
CustomId = SystemInfo.deviceUniqueIdentifier
}, null, null);
#endif
});
}
}
| {'content_hash': 'ee8be2ced48d00ec8a65c53f08103f6a', 'timestamp': '', 'source': 'github', 'line_count': 577, 'max_line_length': 125, 'avg_line_length': 35.24956672443674, 'alnum_prop': 0.5305570578691184, 'repo_name': 'PlayFab/PlayFab-Samples', 'id': 'cbd25d2bad94a49188a614f5d3bbe92e6c056156', 'size': '20341', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Samples/Unity/PlayFabCommerce/Assets/Scripts/PlayFab/PlayFabAuthService.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '18539962'}, {'name': 'CSS', 'bytes': '7618'}, {'name': 'HTML', 'bytes': '8483'}, {'name': 'JavaScript', 'bytes': '36171'}, {'name': 'Objective-C', 'bytes': '281669'}, {'name': 'Objective-C++', 'bytes': '40571'}, {'name': 'Python', 'bytes': '34120'}, {'name': 'Shell', 'bytes': '508'}]} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.