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

package org.chromium.chrome.browser.offlinepages;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import static org.chromium.chrome.browser.tab.TabSelectionType.FROM_NEW;

import android.app.Activity;
import android.content.Context;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.multidex.ShadowMultiDex;

import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabHidingType;
import org.chromium.chrome.browser.tab.TabSelectionType;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.url.GURL;
import org.chromium.url.JUnitTestGURLs;

import java.lang.ref.WeakReference;

/**
 * Unit tests for OfflinePageUtils.
 */
@RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE, shadows = {ShadowMultiDex.class})
public class OfflinePageTabObserverTest {
    // Using a null tab, as it cannot be mocked. TabHelper will help return proper mocked responses.
    private static final int TAB_ID = 77;
    private static final GURL TAB_URL = JUnitTestGURLs.getGURL(JUnitTestGURLs.EXAMPLE_URL);
    @Mock
    private ChromeActivity mActivity;
    @Mock
    private TabModelSelector mTabModelSelector;
    @Mock private SnackbarManager mSnackbarManager;
    @Mock private SnackbarController mSnackbarController;
    @Mock
    private Tab mTab;
    @Mock
    private OfflinePageUtils.Internal mOfflinePageUtils;
    @Mock
    private WindowAndroid mWindowAndroid;
    private WeakReference<Activity> mActivityRef;

    private OfflinePageTabObserver createObserver() {
        OfflinePageTabObserver observer = spy(new OfflinePageTabObserver(
                mTabModelSelector, mSnackbarManager, mSnackbarController));
        // Mocking out all of the calls that touch on NetworkChangeNotifier, which we cannot
        // directly mock out.
        doNothing().when(observer).startObservingNetworkChanges();
        doNothing().when(observer).stopObservingNetworkChanges();

        // Assert tab model observer was created.
        assertTrue(observer.getTabModelObserver() != null);
        return observer;
    }

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);

        mActivityRef = new WeakReference<>(mActivity);

        // Setting up a mock tab. These are the values common to most tests, but individual
        // tests might easily overwrite them.
        doReturn(TAB_ID).when(mTab).getId();
        doReturn(TAB_URL).when(mTab).getUrl();
        doReturn(false).when(mTab).isFrozen();
        doReturn(false).when(mTab).isHidden();
        doReturn(mWindowAndroid).when(mTab).getWindowAndroid();
        doReturn(mActivityRef).when(mWindowAndroid).getActivity();

        // Setting up mock snackbar manager.
        doNothing().when(mSnackbarManager).dismissSnackbars(eq(mSnackbarController));

        // Setting up offline page utils.
        OfflinePageUtils.setInstanceForTesting(mOfflinePageUtils);
        doReturn(false).when(mOfflinePageUtils).isConnected();
        doReturn(false).when(mOfflinePageUtils).isShowingOfflinePreview(any(Tab.class));
        doReturn(true).when(mOfflinePageUtils).isOfflinePage(any(Tab.class));
        doNothing()
                .when(mOfflinePageUtils)
                .showReloadSnackbar(any(Context.class), any(SnackbarManager.class),
                        any(SnackbarController.class), anyInt());
    }

    private void showTab(OfflinePageTabObserver observer) {
        doReturn(false).when(mTab).isHidden();
        if (observer != null) {
            observer.onShown(mTab, FROM_NEW);
        }
    }

    private void hideTab(OfflinePageTabObserver observer) {
        doReturn(true).when(mTab).isHidden();
        if (observer != null) {
            observer.onHidden(mTab, TabHidingType.CHANGED_TABS);
        }
    }

    private void removeTab(OfflinePageTabObserver observer) {
        if (observer != null && observer.getTabModelObserver() != null) {
            observer.getTabModelObserver().tabRemoved(mTab);
        }
    }

    private void connect(OfflinePageTabObserver observer, boolean notify) {
        doReturn(true).when(mOfflinePageUtils).isConnected();
        if (notify) {
            observer.onConnectionTypeChanged(0);
        }
    }

    private void disconnect(OfflinePageTabObserver observer, boolean notify) {
        doReturn(false).when(mOfflinePageUtils).isConnected();
        if (notify) {
            observer.onConnectionTypeChanged(0);
        }
    }

    @Test
    @Feature({"OfflinePages"})
    public void testBasicState() {
        OfflinePageTabObserver observer = createObserver();
        assertFalse(observer.isObservingNetworkChanges());
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testStartObservingTab() {
        OfflinePageTabObserver observer = createObserver();

        doReturn(false).when(mOfflinePageUtils).isOfflinePage(any(Tab.class));
        observer.startObservingTab(mTab);

        assertFalse(observer.isObservingNetworkChanges());
        assertFalse(observer.isObservingTab(mTab));
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));

        doReturn(true).when(mOfflinePageUtils).isOfflinePage(any(Tab.class));
        observer.startObservingTab(mTab);

        assertTrue(observer.isObservingNetworkChanges());
        assertTrue(observer.isObservingTab(mTab));
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testStopObservingTab() {
        OfflinePageTabObserver observer = createObserver();

        observer.startObservingTab(mTab);

        // Try to stop observing a tab that is not observed.
        doReturn(42).when(mTab).getId();
        observer.stopObservingTab(mTab);

        assertFalse(observer.isObservingTab(mTab));
        doReturn(TAB_ID).when(mTab).getId();

        observer.stopObservingTab(mTab);
        assertFalse(observer.isObservingNetworkChanges());
        assertFalse(observer.isObservingTab(mTab));
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnPageLoadFinished() {
        OfflinePageTabObserver observer = createObserver();

        observer.startObservingTab(mTab);
        doReturn(true).when(mOfflinePageUtils).isConnected();
        observer.onPageLoadFinished(mTab, TAB_URL);

        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testShowSnackbar_onPageLoadFinished() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);

        observer.startObservingTab(mTab);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertFalse(observer.wasSnackbarSeen(mTab));
        observer.onPageLoadFinished(mTab, TAB_URL);

        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertTrue(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnPageLoadFinished_notConnected() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);

        observer.startObservingTab(mTab);
        assertTrue(observer.isLoadedTab(mTab));

        observer.onUrlUpdated(mTab);
        assertFalse(observer.isLoadedTab(mTab));

        observer.onPageLoadFinished(mTab, TAB_URL);
        assertTrue(observer.isLoadedTab(mTab));

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnPageLoadFinished_hidden() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        hideTab(null);

        observer.startObservingTab(mTab);
        assertTrue(observer.isLoadedTab(mTab));

        observer.onUrlUpdated(mTab);
        assertFalse(observer.isLoadedTab(mTab));

        observer.onPageLoadFinished(mTab, TAB_URL);
        assertTrue(observer.isLoadedTab(mTab));

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testShowSnackbar_onShown() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        hideTab(null);

        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertFalse(observer.wasSnackbarSeen(mTab));
        showTab(observer);

        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertTrue(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testDontShowPreviewSnackbar_onShown() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        hideTab(null);

        observer.startObservingTab(mTab);
        doReturn(true).when(mOfflinePageUtils).isShowingOfflinePreview(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertFalse(observer.wasSnackbarSeen(mTab));
        showTab(observer);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnShown_notConnected() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        hideTab(null);

        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        observer.onShown(mTab, FROM_NEW);
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnShown_pageNotLoaded() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        hideTab(null);

        observer.startObservingTab(mTab);

        observer.onShown(mTab, FROM_NEW);
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnHidden_afterSnackbarShown() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        // Snackbar is showing over here.
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertTrue(observer.wasSnackbarSeen(mTab));

        hideTab(observer);

        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertTrue(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnHidden_beforeSnackbarShown() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);

        // Snackbar is not showing over here.
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));

        hideTab(observer);

        // Snackbars if any where dismissed regardless.
        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnDestroyed() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);

        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        // Snackbar was shown, so all other conditions are met.
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));

        observer.onDestroyed(mTab);

        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));
        verify(observer, times(1)).stopObservingTab(any(Tab.class));
        verify(mTab, times(1)).removeObserver(eq(observer));
        assertFalse(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnUrlUpdated_whenNotShowingSnackbar() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);

        // URL updated, but tab still shows offline page.
        observer.onUrlUpdated(mTab);

        assertTrue(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
        verify(observer, times(0)).stopObservingTab(any(Tab.class));
        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));

        // URL updated and tab no longer shows offline page.
        doReturn(false).when(mOfflinePageUtils).isOfflinePage(any(Tab.class));
        observer.onUrlUpdated(mTab);

        assertFalse(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
        verify(observer, times(1)).stopObservingTab(any(Tab.class));
        verify(mSnackbarManager, times(2)).dismissSnackbars(eq(mSnackbarController));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnUrlUpdated_whenSnackbarShown() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        // URL updated, but tab still shows offline page.
        observer.onUrlUpdated(mTab);

        assertTrue(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
        verify(observer, times(0)).stopObservingTab(any(Tab.class));
        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));

        observer.onPageLoadFinished(mTab, TAB_URL);

        // URL updated and tab no longer shows offline page.
        doReturn(false).when(mOfflinePageUtils).isOfflinePage(any(Tab.class));
        observer.onUrlUpdated(mTab);

        assertFalse(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
        verify(observer, times(1)).stopObservingTab(any(Tab.class));
        verify(mSnackbarManager, times(2)).dismissSnackbars(eq(mSnackbarController));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testAddObserverForTab() {
        OfflinePageTabObserver observer = createObserver();
        OfflinePageTabObserver.setObserverForTesting(mActivity, observer);

        disconnect(observer, false);
        showTab(null);

        // Method under test.
        OfflinePageTabObserver.addObserverForTab(mTab);

        verify(mTab, times(1)).addObserver(eq(observer));
        verify(observer, times(1)).startObservingTab(any(Tab.class));
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testAddObserverForTab_whenConnected() {
        OfflinePageTabObserver observer = createObserver();
        OfflinePageTabObserver.setObserverForTesting(mActivity, observer);

        connect(observer, false);
        showTab(null);

        // Method under test.
        OfflinePageTabObserver.addObserverForTab(mTab);

        verify(mTab, times(1)).addObserver(eq(observer));
        verify(observer, times(1)).startObservingTab(any(Tab.class));
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testShowSnackbar_onConnectionTypeChanged() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        assertTrue(observer.isObservingNetworkChanges());

        connect(observer, true);
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingNetworkChanges());
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnConnectionTypeChanged_notConnected() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        assertTrue(observer.isObservingNetworkChanges());

        // Notification comes, but we are still disconnected.
        observer.onConnectionTypeChanged(0);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingNetworkChanges());
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnConnectionTypeChanged_tabNotShowing() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        hideTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        assertTrue(observer.isObservingNetworkChanges());
        connect(observer, true);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingNetworkChanges());
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnConnectionTypeChanged_pageNotLoaded() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        // That resets the page to not loaded.
        observer.onUrlUpdated(mTab);

        assertTrue(observer.isObservingNetworkChanges());
        connect(observer, true);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingNetworkChanges());
    }

    @Test
    @Feature({"OfflinePages"})
    public void testOnConnectionTypeChanged_noCurrentTab() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        hideTab(observer);
        // That resets the page to not loaded.
        observer.onUrlUpdated(mTab);

        assertTrue(observer.isObservingNetworkChanges());
        connect(observer, true);

        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingNetworkChanges());
    }

    @Test
    @Feature({"OfflinePages"})
    public void testShowSnackbar_ignoreEventsAfterShownOnce() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));

        // Event ignored, snackbar not shown again.
        observer.onPageLoadFinished(mTab, TAB_URL);
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));

        // Event ignored, snackbar not shown again.
        observer.onShown(mTab, TabSelectionType.FROM_NEW);
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));

        // Event triggers snackbar again.
        observer.onConnectionTypeChanged(0);
        verify(observer, times(2)).showReloadSnackbar(any(Tab.class));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testTabRemoved_whenNotShowingSnackbar() {
        OfflinePageTabObserver observer = createObserver();

        disconnect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);

        // Snackbar is not showing over here.
        verify(observer, times(0)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));

        removeTab(observer);

        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));
        // Cannot verify using observer, because of implementation using nested class.
        verify(mTab, times(1)).removeObserver(any(OfflinePageTabObserver.class));
        assertFalse(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
    }

    @Test
    @Feature({"OfflinePages"})
    public void testTabRemoved_whenShowingSnackbar() {
        OfflinePageTabObserver observer = createObserver();

        connect(observer, false);
        showTab(null);
        observer.startObservingTab(mTab);
        observer.onPageLoadFinished(mTab, TAB_URL);

        // Snackbar is showing over here.
        verify(observer, times(1)).showReloadSnackbar(any(Tab.class));
        assertTrue(observer.isObservingTab(mTab));
        assertTrue(observer.isLoadedTab(mTab));
        assertTrue(observer.wasSnackbarSeen(mTab));

        removeTab(observer);

        verify(mSnackbarManager, times(1)).dismissSnackbars(eq(mSnackbarController));
        // Cannot verify using observer, because of implementation using nested class.
        verify(mTab, times(1)).removeObserver(any(OfflinePageTabObserver.class));
        assertFalse(observer.isObservingTab(mTab));
        assertFalse(observer.isLoadedTab(mTab));
        assertFalse(observer.wasSnackbarSeen(mTab));
    }
}


text:
<?php
return array (
  'id' => 'mobileexplorer_ver1_subamstradgamma',
  'fallback' => 'mobileexplorer_ver3',
  'capabilities' =>
  array (
  ),
);

redpajama_set_name: RedPajamaGithub


text:
git clone -q git://github.com/scipy/scipy.git
cp /tmp/scipy-site.cfg scipy/site.cfg

for PYTHONVER in 2 3 ; do
  PYTHON="python$PYTHONVER"
  PIP="pip$PYTHONVER"
  $PIP install --upgrade pip
  $PIP install --upgrade cython
  # remove old scipy
  $PIP uninstall --yes scipy

  (cd scipy && $PYTHON setup.py install)
  $PIP install nose
  $PIP install six
  $PIP install --no-deps git+https://github.com/SheffieldML/GPy.git
  $PIP install --no-deps git+https://github.com/SheffieldML/GPyOpt.git
done

# Reduce the image size
apt-get autoremove -y
apt-get clean -y

cd /
rm -rf /tmp/build


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp"
    >
    <ImageButton
        android:id="@+id/rli_arrow_icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:src="@drawable/nsdk_drawable_rg_ic_turn_start_s"
        android:scaleType="centerInside"
        android:background="#00000000"/>
    <LinearLayout
        android:id="@+id/rli_item_text_box"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:orientation="horizontal"
        >
        <View
            android:layout_width="10dp"
            android:layout_height="wrap_content"
            android:background="@color/base_blue"
            android:layout_marginLeft="19dp"
            />
        <TextView
            android:id="@+id/rli_item_text"
            android:layout_marginLeft="19dp"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1.0"
            android:gravity="center_vertical"
            android:textColor="@color/new_text_color_first"
            android:textSize="@dimen/bigger"
            android:text="无名路,行驶58米"
            android:singleLine="true"
            />
    </LinearLayout>
</LinearLayout>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<title>FRSUSERFUNC</title>
<meta http-equiv="Content-Type" Content="text/html; charset=Windows-1251">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">

FRSUSERFUNC

main |
types and definitions

The <dfn>FRSUSERFUNC</dfn> type describes a callback function for the
FSF.FarRecursiveSearch function
that is called for each found file.

typedef int  (WINAPI *FRSUSERFUNC)(
  const WIN32_FIND_DATA *FData,
  const char *FullName,
  void *Param
);

Parameters

FData

Points to the
    WIN32_FIND_DATA structure
    of the found file.

FullName

Full path to the found file.

Param

Points to user data (the <var>Param</var> parameter of the
  FSF.FarRecursiveSearch function).

Return value

The function should return TRUE to continue searching the file system,
or FALSE for the search process to be interrupted.

Remarks

<var>FData</var> and <var>FullName</var> are defined only in the context of this function, the
plugin should not save those pointers. To save the data, the plugin must copy those values to
internal structures.
<var>Param</var> - the data that was passed to the
FSF.FarRecursiveSearch function.

See also:

FSF.FarRecursiveSearch


text:
$("#offCanvasLeft").css("display", "block");
$(document).foundation();


text:
<!DOCTYPE html>

    <meta charset='UTF-8'/>
    <meta name='description'
          content='ExtentReports (by Anshoo Arora) is a reporting library for automation testing for .NET and Java. It creates detailed and beautiful HTML reports for modern browsers. ExtentReports shows test and step summary along with dashboards, system and environment details for quick analysis of your tests.'/>
    <meta name='robots' content='noodp, noydir'/>
    <meta name='viewport' content='width=device-width, initial-scale=1'/>
    <meta name='extentx' id='extentx' content=''/>

    <title>
        ExtentReports 2.0
    </title>

    <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css'>
    <link href='https://cdn.rawgit.com/anshooarora/extentreports/6032d73243ba4fe4fb8769eb9c315d4fdf16fe68/cdn/extent.css'
          type='text/css' rel='stylesheet'/>

            ExtentReports

Test Details

            Analysis

    Automation Report

            2017-03-11 16:29:06

            v2.41.1

                    Total Tests

                    Total Steps

                    Total Time Taken (Current Run)
                    0h 0m 14s+511ms

                    Total Time Taken (Overall)
                    0h 0m 14s+511ms

                    Start
                    2017-03-11 16:28:51

                    End
                    2017-03-11 16:29:06

                        Tests View

                        <canvas class='text-centered' id='test-analysis'></canvas>

                         test(s) passed

                         test(s) failed,  others

                        Steps View

                        <canvas class='text-centered' id='step-analysis'></canvas>

                         step(s) passed

                         step(s) failed,  others

                    Pass Percentage

                    Environment

                            Param
                            Value

                            User Name
                            Linty

                            OS
                            Windows 10

                            Java Version
                            1.8.0_66

                            Host Name
                            LSLAPTOP

Tests

Pass

Fail

Skip

Clear Filters

                            <input id='searchTests' type='text' class='validate' placeholder='Search Tests...'>

                                    testAddMember
                                    fail

                                        2017-03-11 16:28:51
                                        2017-03-11 16:29:03
                                        0h 0m 12s+75ms

RanzhiAdvancedTests.testAddMember

                                                Status
                                                Timestamp
                                                Details

                                                16:29:03
                                                Cannot locate option with index: 8
                                                    For documentation on this error, please visit:
                                                    http://seleniumhq.org/exceptions/no_such_element.html
                                                    Build info: version: '2.53.1', revision:
                                                    'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30
                                                    19:26:09'
                                                    System info: host: 'LSLAPTOP', ip: '192.168.102.1', os.name:
                                                    'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version:
                                                    '1.8.0_66'
                                                    Driver info: driver.version: BoxDriver

Configure Tests Count Setting

        <input name='test-count-setting' type='radio' id='parentWithoutNodes' class='with-gap'>
        Parent Tests Only (Does not include child nodes in counts)

        <input name='test-count-setting' type='radio' id='parentWithoutNodesAndNodes' class='with-gap'>
        Parent Tests Without Child Tests + Child Tests

        <input name='test-count-setting' type='radio' id='childNodes' class='with-gap'>
        Child Tests Only

        Save

Select status

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-pass'>
        Pass

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-fail'>
        Fail

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-fatal'>
        Fatal

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-error'>
        Error

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-warning'>
        Warning

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-skip'>
        Skipped

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-info'>
        Info

        <input checked class='filled-in' type='checkbox' id='step-dashboard-filter-unknown'>
        Unknown

        Save


text:
package org.uribeacon.example.beacon;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.ParcelUuid;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.bluetooth.le.*;
import android.widget.Toast;

import java.util.ArrayList;

/**
 * Advertise a URI Beacon with Android L
 * See http://physical-web.org for more info
 *
 * @author Don Coleman
 */
public class UriBeaconAdvertiserActivity extends Activity {

    private static final String TAG = "UriBeaconAdvertiserActivity";
    private static final int ENABLE_BLUETOOTH_REQUEST = 17;
    // Really 0xFED8, but Android seems to prefer the expanded 128-bit UUID version
    private static final ParcelUuid URI_BEACON_UUID = ParcelUuid.fromString("0000FED8-0000-1000-8000-00805F9B34FB");

    private BluetoothAdapter bluetoothAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_uri_beacon);

        setupBluetooth();
    }

    private void advertiseUriBeacon() {

        BluetoothLeAdvertiser bluetoothLeAdvertiser = bluetoothAdapter.getBluetoothLeAdvertiser();

        AdvertiseData advertisementData = getAdvertisementData();
        AdvertiseSettings advertiseSettings = getAdvertiseSettings();

        bluetoothLeAdvertiser.startAdvertising(advertiseSettings, advertisementData, advertiseCallback);
    }

    private AdvertiseData getAdvertisementData() {
        AdvertiseData.Builder builder = new AdvertiseData.Builder();
        builder.setIncludeTxPowerLevel(false); // reserve advertising space for URI

        byte[] beaconData = new byte[9];
        beaconData[0] = (byte) 0xD8; // URI Beacon ID 0xFED8
        beaconData[1] = (byte) 0xFE; // URI Beacon ID 0xFED8
        beaconData[2] = 0x00; // flags
        beaconData[3] = 0x20; // transmit power
        beaconData[4] = 0x00; // http://www.
        beaconData[5] = 0x65; // e
        beaconData[6] = 0x66; // f
        beaconData[7] = 0x66; // f
        beaconData[8] = 0x08; // .org

        builder.addServiceData(URI_BEACON_UUID, beaconData);

        // Adding 0xFED8 to the "Service Complete List UUID 16" (0x3) for iOS compatibility
        builder.addServiceUuid(URI_BEACON_UUID);

        return builder.build();
    }

    private AdvertiseSettings getAdvertiseSettings() {
        AdvertiseSettings.Builder builder = new AdvertiseSettings.Builder();
        builder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_BALANCED);
        builder.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);
        builder.setConnectable(false);

        return builder.build();
    }

    private void setupBluetooth() {

        BluetoothManager bluetoothManager = (BluetoothManager) this.getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE);
        bluetoothAdapter = bluetoothManager.getAdapter();

        if (bluetoothAdapter == null) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle(R.string.bluetooth_error);
            builder.setMessage(R.string.no_bluetooth).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    finish();
                }
            });
            builder.show();

        } else if (!bluetoothAdapter.isEnabled()) {

            Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            this.startActivityForResult(enableBtIntent, ENABLE_BLUETOOTH_REQUEST);

        } else if (!bluetoothAdapter.isMultipleAdvertisementSupported()) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle(R.string.bluetooth_error);
            builder.setMessage(R.string.no_bluetooth_advertise)
            .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    finish();
                }
            });
            builder.show();

        } else {
            advertiseUriBeacon();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.uri_beacon, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == ENABLE_BLUETOOTH_REQUEST) {
            if (resultCode == RESULT_OK) {
                advertiseUriBeacon();
            } else {
                finish();
            }
        }
    }

    private final AdvertiseCallback advertiseCallback = new AdvertiseCallback() {
        @SuppressLint("Override")
        @Override
        public void onStartSuccess(AdvertiseSettings advertiseSettings) {
            final String message = "Advertisement successful";
            Log.d(TAG, message);
            UriBeaconAdvertiserActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(UriBeaconAdvertiserActivity.this, message, Toast.LENGTH_LONG).show();
                }
            });
        }

        @SuppressLint("Override")
        @Override
        public void onStartFailure(int i) {
            final String message = "Advertisement failed error code: " + i;
            Log.e(TAG, message);
            UriBeaconAdvertiserActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(UriBeaconAdvertiserActivity.this, message, Toast.LENGTH_LONG).show();
                }
            });
        }

    };

}


text:
package kr.debop4j.data.ogm.model;

import com.google.common.base.Objects;
import kr.debop4j.core.tools.HashTool;
import kr.debop4j.data.model.AnnotatedEntityBase;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.search.annotations.DocumentId;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * 엔티티의 Identifier의 수형이 UUID 인 엔티티입니다.
 * <b>MongoDB를 저장소로 사용하는 경우에는 이 엔티티를 상속받아야 합니다.</b>
 *
 * @author 배성혁 ( sunghyouk.bae@gmail.com )
 * @since 13. 3. 31. 오전 2:19
 */
@MappedSuperclass
@Getter
@Setter
public abstract class UuidEntityBase extends AnnotatedEntityBase {

    @Id
    @DocumentId
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    private String id;

    @Override
    public int hashCode() {
        return HashTool.compute(id);
    }

    @Override
    protected Objects.ToStringHelper buildStringHelper() {
        return super.buildStringHelper()
                .add("id", id);
    }

    private static final long serialVersionUID = 7507710661157374715L;
}


text:
#ifndef WebFontRendering_h
#define WebFontRendering_h

#include "../../platform/WebCommon.h"
#include "../../platform/WebString.h"
#include <SkFontMgr.h>
#include <SkPaint.h>

namespace blink {

class WebFontRendering {
 public:
  // Set global font renderering preferences.

  BLINK_EXPORT static void setSkiaFontManager(sk_sp<SkFontMgr>);
  BLINK_EXPORT static void setHinting(SkPaint::Hinting);
  BLINK_EXPORT static void setAutoHint(bool);
  BLINK_EXPORT static void setUseBitmaps(bool);
  BLINK_EXPORT static void setAntiAlias(bool);
  BLINK_EXPORT static void setSubpixelRendering(bool);
  BLINK_EXPORT static void setSubpixelPositioning(bool);
  BLINK_EXPORT static void setDefaultFontSize(int);
  BLINK_EXPORT static void setSystemFontFamily(const WebString&);
};

}  // namespace blink

#endif


text:
package com.mojojojodevlabs.artme.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.mojojojodevlabs.artme.R;
import com.mojojojodevlabs.artme.adapters.HomePagerAdapter;

public class HomeFragment extends Fragment {

    TabLayout tabLayout;
    HomePagerAdapter adapter;
    ViewPager viewPager;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_home, container, false);

        viewPager = (ViewPager) v.findViewById(R.id.pager);
        tabLayout = (TabLayout) v.findViewById(R.id.tl);

        adapter = new HomePagerAdapter(getContext(), getActivity().getSupportFragmentManager()) ;
        viewPager.setAdapter(adapter);

        tabLayout.setupWithViewPager(viewPager);
        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);

        return v;
    }
}


text:
namespace local_discovery {

PrivetHTTPAsynchronousFactoryMac::PrivetHTTPAsynchronousFactoryMac(
    net::URLRequestContextGetter* request_context)
    : request_context_(request_context) {}

PrivetHTTPAsynchronousFactoryMac::~PrivetHTTPAsynchronousFactoryMac() {}

scoped_ptr<PrivetHTTPResolution>
PrivetHTTPAsynchronousFactoryMac::CreatePrivetHTTP(
    const std::string& name,
    const net::HostPortPair& address,
    const ResultCallback& callback) {
  return scoped_ptr<PrivetHTTPResolution>(
      new ResolutionMac(request_context_, name, address, callback));
}

PrivetHTTPAsynchronousFactoryMac::ResolutionMac::ResolutionMac(
    net::URLRequestContextGetter* request_context,
    const std::string& name,
    const net::HostPortPair& host_port,
    const ResultCallback& callback)
    : request_context_(request_context),
      name_(name),
      host_port_(host_port),
      callback_(callback) {}

PrivetHTTPAsynchronousFactoryMac::ResolutionMac::~ResolutionMac() {}

void PrivetHTTPAsynchronousFactoryMac::ResolutionMac::Start() {
  callback_.Run(scoped_ptr<PrivetHTTPClient>(
      new PrivetHTTPClientImpl(name_, host_port_, request_context_)));
}

const std::string& PrivetHTTPAsynchronousFactoryMac::ResolutionMac::GetName() {
  return name_;
}

}  // namespace local_discovery


text:
/**
 * Simple settings object
 * @param {Object} values Object that stores the key/val settings
 */
function Settings(values) {
	var instance;

	var get = function(key, default_val) {
		var val = values[key];
		return (val === null || val === undefined) ?
			default_val :
			val;
	};

	var set = function(key, val) {
		var old_val = values[key];
		values[key] = val;
		if (typeof instance.onChange === 'function') {
			instance.onChange(key, val, old_val, values);
		}
	};

	// Support:
	// instance(getter)
	// instance.get(getter)
	// instance.set(setter)

	instance = get;
	instance.get = get;
	instance.set = set;
	instance.values = values;

	// This .onChange as a property is bad mmkay. Add it as an event listener or something
	instance.onChange = null;

	return instance;
}

export default Settings;


text:
/**
  @module ember-ui-components
*/
import Helper from '@ember/component/helper';
import { inject as service } from '@ember/service';

/**
  ## OpenContextMenu

  The `{{open-context-menu}}` helper can be used to open a context-menu from within templates.

  ### MenuId

  Pass the `id` of the menu to open as the first argument.

  ```
  {{open-context-menu "menu-id"}}
  ```

  The `{{open-context-menu}}` helper returns a function that can be used in actions:

  ```
  <div oncontextmenu={{open-context-menu "menu-id"}}>
    // ...
  </div>
  ```

  ```
  <div {{action (open-context-menu "menu-id") on="contextMenu"}}>
    // ...
  </div>
  ```

  in a component:

  ```
  {{my-component contextMenu=(open-context-menu "menu-id")}}
  ```

  ### Model

  Optionally, you can pass in a model or object as the second argument.  This
  object will be available as the `contextMenuParams.model` property within the
  `context-menu` component.

  ```
  <div oncontextmenu={{open-context-menu "menu-id" model}}>
    // ...
  </div>

  {{#uic-context-menu as |params|}}
    // model is available at params.model
  {{/uic-context-menu}}
  ```

  In the example above, the `model` property passed as the second argument to
  the `{{open-context-menu}}` helper is available in the `{{uic-context-menu}}`
  component as the `params.model` property.

  @class OpenContextMenuHelper
  @namespace Helpers
*/
export default Helper.extend({

  /**
    @property contextMenuService
    @type {Object}
    @private
  */
  contextMenuService: service('context-menu'),

  /**
    @method compute
    @param {Array} params
    @private
    @return {Function}
  */
  compute([menuId, model]/*, hash*/) {
    let contextMenuService = this.get('contextMenuService');
    return function (event) {
      return contextMenuService.open(menuId, event, model);
    };
  }
});


text:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Comments for page "Lil' Ro"</title>
		<link>http://bvs.wikidot.com/forum/t-41188/lil-ro</link>
		<description>Posts in the discussion thread "Lil' Ro"</description>
				<copyright></copyright>
		<lastBuildDate>Sun, 10 Jul 2022 03:33:15 +0000</lastBuildDate>

				</channel>
</rss>


text:
require(['backbone', 'erfgeoviewer.common', 'communicator', 'underscore', 'jquery', 'leaflet', 'config', 'q', 'share.button',
    'views/map', 'views/layout/header.layout', 'views/detail', 'views/detail-navigation', 'views/legend', 'views/layout/detail.layout',
    'views/search/search', 'views/new', 'views/open', 'plugins/routeyou/routeyou', 'erfgeoviewer.search',
    'models/layers', 'models/state', 'models/sidenav', 'models/navbar'],

  function( Backbone, App, Communicator, _, $, L, Config, Q, ShareButton,
            MapView, HeaderView, DetailView, DetailNavigationView, LegendView, DetailLayout,
            SearchView, NewMapView, OpenMapView, RouteyouModule, SearchModule,
            LayerCollection, State, SideNav, NavBar ) {

    console.log('Erfgeoviewer: reader mode.');

    if (Config.controls.newMap || false) {
      SideNav.addItem('new_map', {
        fragment: 'new',
        icon: 'map',
        label: 'Nieuwe kaart'
      });
    }

    if (Config.controls.openMap || false) {
      SideNav.addItem('open_map', {
        fragment: 'open',
        icon: 'folder-open-empty',
        label: 'Open'
      });
    }

    var init = function() {

      /**
       * Event handlers.
       */
      Communicator.reqres.setHandler("app:get", function() {
        return App;
      });
      Communicator.reqres.setHandler("router:get", function() {
        return App.router;
      });
      Communicator.mediator.on('map:ready', function( map ) {

        /**
         * Legend
         */
        if (State.getPlugin('map_settings').model.get('showLegend') && State.getPlugin('map_settings').model.get('legend')) {
          var legend = L.control({position: 'bottomleft'});

          legend.onAdd = function( map ) {
            // Render legend
            var legendView = new LegendView({legend: State.getPlugin('map_settings').model.get('legend')});
            return legendView.render().$el[0];
          };

          legend.addTo(map);
        }

        /**
         * Share
         */
        if (State.getPlugin('map_settings').model.get('showShare')) {
          var share = L.control({position: 'bottomleft'});

          share.onAdd = function( map ) {
            return document.createElement('share-button');
          };

          share.addTo(map);

          new ShareButton({
            title: State.getPlugin('map_settings').model.get('title'),
            description: State.getPlugin('map_settings').model.get('title') + ' #kaart #erfgoed',
            ui: {
              flyout: 'top right',
              buttonText: 'Delen'
            },
            networks: {
              linkedin: {
                enabled: false
              },
              pinterest: {
                enabled: false
              },
              reddit: {
                enabled: false
              },
              email: {
                description: "Ik wil graag een kaart met je delen:\n\n" + window.location.href
              }
            }
          });
        }
      });
      Communicator.mediator.on("marker:click", function( m ) {
        var detailLayout = new DetailLayout();

        App.flyouts.getRegion('detail').show(detailLayout);

        detailLayout.getRegion('container').show(new DetailView({model: m}));
        detailLayout.getRegion('footer').show(new DetailNavigationView({model: m}));
      });
      Communicator.mediator.on("all", function( e, a ) {
        // Debugging:
        console.log("event: " + e, a);
      });

      /**
       * Router.
       */
      var routes = {
        "": function() {
          App.flyouts.getRegion('bottom').hideFlyout();
          App.flyouts.getRegion('right').hideFlyout();
        },
      };

      if (State.getPlugin('map_settings').model.get('showSearchFilter')) {
        NavBar.addItem('add', {
          fragment: 'search',
          label: 'Zoek',
          weight: 1000
        });

        routes = _.extend(routes, {
          "search": function() {
            var searchModule = new SearchModule({
              markers_collection: State.getPlugin('geojson_features').collection
            });

            var markerView = new SearchView({
              searchModule: searchModule
            });

            App.flyouts.getRegion('bottom').hideFlyout();
            App.flyouts.getRegion('right').show(markerView);
          }
        });
      }

      if (Config.controls.newMap || false) {
        routes = _.extend(routes, {
          "new": function() {
            App.flyouts.getRegion('bottom').hideFlyout();
            App.layout.getRegion('modal').show(new NewMapView());
          }
        });
      }

      if (Config.controls.openMap || false) {
        routes = _.extend(routes, {
          "open": function() {
            App.flyouts.getRegion('bottom').hideFlyout();
            App.layout.getRegion('modal').show(new OpenMapView());
          }
        });
      }

      var Router = Marionette.AppRouter.extend({
        routes: routes
      });
      App.router = new Router();

      Communicator.reqres.setHandler("router:get", function() {
        return App.router;
      });

      /**
       * Init.
       */
      App.mode = "reader";
      App.container.$el.addClass("mode-" + App.mode);
      App.map_view = new MapView({
        layout: App.layout
      });

      App.layout.getRegion('content').show(App.map_view);
      App.layout.getRegion('header').show(new HeaderView());

      App.start();

    };

    State.pluginsInitialized.promise
      .then(function() {
        var d = Q.defer();

        if (typeof window.erfgeoviewer !== "undefined" && _.isObject(window.erfgeoviewer)) {

          if (window.erfgeoviewer.dataFile) {
            // Load a JSON file.
            $.ajax(erfgeoviewer.dataFile).done(function( data ) {
              State.set(State.parse(data));
              d.resolve();
            });
          } else if (window.erfgeoviewer.data) {
            // Digest a JSON object
            State.set(State.parse(window.erfgeoviewer.data));
            d.resolve();
          }

        }
        else {
          State.fetch({
            success: d.resolve,
            error: d.resolve // Also resolve on error to prevent unhandled exceptions on empty state
          });
        }

        return d.promise;
      })
      .then(Config.makiCollection.getPromise)
      .done(init);

  });


text:
"""
Remote connection and communication.
"""

def pick_unused_port():
    """
    Use socket to find out a unused (inet) port.
    """
    import socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.bind(('localhost', 0))
    addr, port = s.getsockname()
    s.close()
    return port

def guess_address(family, localhost=True):
    """
    Guess a unused address according to given family.

    @param family: AF_INET, AF_UNIX, AF_PIPE.
    @type family: str
    @keyword localhost: use 'localhost' as hostname or not.
    @type localhost: bool
    """
    from socket import gethostname
    from random import sample
    string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    strlen = 8
    port = pick_unused_port()
    if family == 'AF_INET':
        if localhost:
            hostname = 'localhost'
        else:
            hostname = gethostname()
        address = (hostname, port)
    elif family == 'AF_UNIX':
        strpart = ''.join(sample(string, strlen))
        address = '/tmp/srpc%s%d' % (strpart, port)
    elif family == 'AF_PIPE':
        strpart = ''.join(sample(string, strlen))
        address = r'\\.\pipe\srpc' + "%s%d"%(strpart, port)
    else:
        raise ValueError("family can't be %s" % family)
    return address

def guess_family(address):
    """
    Determine the family of address.
    """
    if type(address) == tuple:
        return 'AF_INET'
    elif type(address) is str and address.startswith('\\\\'):
        raise ValueError('Windows pipe is not supported')
        #return 'AF_PIPE'
    elif type(address) is str:
        return 'AF_UNIX'
    else:
        raise ValueError('address type of %r unrecognized' % address)

class Credential(object):
    """
    Authenticating information to be exchanged between two ends of a
    connection.
    """
    MSGCAP = 256
    MSGLEN = 20
    CHALLENGE = b'#CHALLENGE#'
    SUCCESS = b'#SUCCESS#'
    FAILURE = b'#FAILURE#'
    def __init__(self, conn, authkey):
        """
        @param conn: the communicating connection.
        @type conn: solvcon.connection.Connection
        @param authkey: authenticating key.
        @type authkey: str
        """
        assert isinstance(authkey, bytes)
        self.conn = conn
        self.authkey = authkey
    def question(self):
        import os, hmac, hashlib
        conn = self.conn
        msg = os.urandom(self.MSGLEN)
        conn.send_bytes(self.CHALLENGE+msg)
        digest = hmac.new(self.authkey, msg, hashlib.md5).digest()
        res = conn.recv_bytes(self.MSGCAP)
        if res == digest:
            conn.send_bytes(self.SUCCESS)
        else:
            conn.send_bytes(self.FAILURE)
            raise IOError('digest received was wrong')
    def answer(self):
        import hmac, hashlib
        conn = self.conn
        msg = conn.recv_bytes(self.MSGCAP)
        assert msg[:len(self.CHALLENGE)] == self.CHALLENGE, 'msg = %r'%msg
        msg = msg[len(self.CHALLENGE):]
        digest = hmac.new(self.authkey, msg, hashlib.md5).digest()
        conn.send_bytes(digest)
        res = conn.recv_bytes(self.MSGCAP)
        if res != self.SUCCESS:
            raise IOError('digest sent was rejected')

class SocketConnection(object):
    def __init__(self, *args, **kw):
        try: # py3k compat.
            from _multiprocessing import Connection
        except ImportError:
            from multiprocessing.connection import Connection
        self.conn = Connection(*args, **kw)
    def send_bytes(self, *args, **kw):
        return self.conn.send_bytes(*args, **kw)
    def recv_bytes(self, *args, **kw):
        return self.conn.recv_bytes(*args, **kw)
    def send(self, *args, **kw):
        return self.conn.send(*args, **kw)
    def recv(self, *args, **kw):
        return self.conn.recv(*args, **kw)
    def close(self, *args, **kw):
        return self.conn.close(*args, **kw)
    def sendarr(self, arr):
        self.send(arr)
    def recvarr(self, arr):
        arr[:] = self.recv()[:]

class MPIConnection(object):
    TAG = 1
    def __init__(self, src, dst):
        self.src = src
        self.dst = dst
    def send(self, dat):
        from .conf import env
        env.mpi.send(dat, self.dst, self.TAG)
    def recv(self):
        from .conf import env
        return env.mpi.recv(self.dst, self.TAG)
    def sendarr(self, arr):
        from .conf import env
        env.mpi.sendarr(arr, self.dst, self.TAG)
    def recvarr(self, arr):
        from .conf import env
        env.mpi.recvarr(arr, self.dst, self.TAG)

CLIENT_TIMEOUT = 20.
def Client(address, family=None, authkey=None):
    """
    Establish a connection to a Listener.

    @param address: The address of a Unix or TCP/IP socket.
    @type address: str or tuple
    @keyword family: The family of address.
    @type family: str
    @keyword authkey: Authenticating key.
    @type authkey: str
    """
    import os, time, errno, socket
    timeout = time.time() + CLIENT_TIMEOUT
    family = family or guess_family(address)
    # create socket.
    while True:
        skt = socket.socket(getattr(socket, family))
        try:
            skt.connect(address)
        except socket.error as e:
            skt.close()
            if e.args[0] != errno.ECONNREFUSED or time.time() > timeout:
                raise
            time.sleep(0.01)
        else:
            break
    # create connection.
    conn = SocketConnection(os.dup(skt.fileno()))
    skt.close()
    # authenticate.
    if authkey is not None:
        if not isinstance(authkey, bytes):
            raise TypeError('authkey must be a byte string')
        credit = Credential(conn, authkey)
        credit.answer()
        credit.question()
    return conn

class Listener(object):
    """
    Socket listener for connection.
    """
    def __init__(self, address, family=None, authkey=None):
        """
        @param address: The address of a Unix or TCP/IP socket.
        @type address: str or tuple
        @keyword family: The family of address.
        @type family: str
        @keyword authkey: Authenticating key.
        @type authkey: str
        """
        import socket
        family = family or (address and guess_family(address))
        # create socket.
        self._socket = socket.socket(getattr(socket, family))
        self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        self._socket.bind(address)
        self._socket.listen(1)
        # store extra information.
        self.address = self._socket.getsockname()
        self._last_accepted = None
        self._authkey = authkey
    def accept(self):
        import os
        # accepting connection.
        skt, self._last_accepted = self._socket.accept()
        # establish connection.
        conn = SocketConnection(os.dup(skt.fileno()))
        skt.close()
        # authenticate.
        if self._authkey:
            credit = Credential(conn, self._authkey)
            credit.question()
            credit.answer()
        return conn
    def close(self):
        self._socket.close()

class SpanningTreeNode(dict):
    def __init__(self, *args, **kw):
        self.val = kw.pop('val')
        self.level = kw.pop('level')
        super(SpanningTreeNode, self).__init__(*args, **kw)
    def traverse(self, graph, visited):
        if self.val not in visited:
            visited[self.val] = True
            for it in graph[self.val]:
                nd = SpanningTreeNode(val=it, level=self.level+1)
                if nd.traverse(graph, visited) == True:
                    self[it] = nd
            return True
        else:
            return False


text:
"use strict";
/**
 *
 * Tooltip object that consits of tooltips for various of
 * features
 *
 * @returns {Object} An Object that consists of tooltip methods to be invoked
 */

module.exports = {
	uglify: _ => {
		return `/*
 * We've enabled UglifyJSPlugin for you! This minifies your app
 * in order to load faster and run less javascript.
 *
 * https://github.com/webpack-contrib/uglifyjs-webpack-plugin
 *
 */`;
	},
	commonsChunk: _ => {
		return `/*
 * We've enabled commonsChunkPlugin for you. This allows your app to
 * load faster and it splits the modules you provided as entries across
 * different bundles!
 *
 * https://webpack.js.org/plugins/commons-chunk-plugin/
 *
 */`;
	},
	cssPlugin: _ => {
		return `/*
 * We've enabled ExtractTextPlugin for you. This allows your app to
 * use css modules that will be moved into a separate CSS file instead of inside
 * one of your module entries!
 *
 * https://github.com/webpack-contrib/extract-text-webpack-plugin
 *
 */`;
	},
	postcss: _ => {
		return `/*
 * We've enabled Postcss, autoprefixer and precss for you. This allows your app
 * to lint  CSS, support variables and mixins, transpile future CSS syntax,
 * inline images, and more!
 *
 * To enable SASS or LESS, add the respective loaders to module.rules
 *
 * https://github.com/postcss/postcss
 *
 * https://github.com/postcss/autoprefixer
 *
 * https://github.com/jonathantneal/precss
 *
 */`;
	}
};


text:
<?php

namespace Amazon\Pay\Helper;

use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\Exception\FileSystemException;
use Magento\Framework\Exception\ValidatorException;
use Zxing\ReaderException;

class Data extends AbstractHelper
{
    /**
     * @var \Amazon\Pay\Model\AmazonConfig
     */
    private $amazonConfig;

    /**
     * @var \Magento\Checkout\Helper\Data
     */
    private $helperCheckout;

    /**
     * @var \Magento\Framework\Module\ModuleListInterface
     */
    private $moduleList;

    /**
     * @var \Magento\Catalog\Model\ResourceModel\Category
     */
    private $categoryResourceModel;

    /**
     * @var \Magento\Framework\EntityManager\MetadataPool
     */
    private $metadataPool;

    /**
     * @var mixed
     */
    private $restrictedCategoryIds;

    /**
     * @var \Magento\Framework\Component\ComponentRegistrarInterface
     */
    protected $componentRegistrar;

    /**
     * @var \Magento\Framework\Filesystem\Directory\ReadFactory
     */
    protected $readFactory;

    public function __construct(
        \Amazon\Pay\Model\AmazonConfig $amazonConfig,
        \Magento\Checkout\Helper\Data $helperCheckout,
        \Magento\Framework\Module\ModuleListInterface $moduleList,
        \Magento\Catalog\Model\ResourceModel\Category $categoryResourceModel,
        \Magento\Framework\EntityManager\MetadataPool $metadataPool,
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\Component\ComponentRegistrarInterface $componentRegistrar,
        \Magento\Framework\Filesystem\Directory\ReadFactory $readFactory
    ) {
        $this->amazonConfig = $amazonConfig;
        $this->helperCheckout = $helperCheckout;
        $this->moduleList = $moduleList;
        $this->categoryResourceModel = $categoryResourceModel;
        $this->metadataPool = $metadataPool;
        $this->componentRegistrar = $componentRegistrar;
        $this->readFactory = $readFactory;
        parent::__construct($context);
    }

    /**
     * Inspired by \Magento\Catalog\Model\ResourceModel\Product\Collection::getChildrenCategories
     *
     * @param int $restrictedCategoryId
     * @return array
     */
    protected function fetchRestrictedCategoryIds($restrictedCategoryId)
    {
        $result[] = $restrictedCategoryId;
        $categories = $this->categoryResourceModel->getCategoryWithChildren($restrictedCategoryId);
        if (!empty($categories)) {
            $firstCategory = array_shift($categories);
            if ($firstCategory['is_anchor'] == 1) {
                $linkfield = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
                $anchorCategories[] = $firstCategory[$linkfield];
                foreach ($categories as $category) {
                    if (in_array($category['parent_id'], $result) &&
                        in_array($category['parent_id'], $anchorCategories)) {
                        $result[] = $category[$linkfield];
                        if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategories)) {
                            $anchorCategories[] = $category[$linkfield];
                        }
                    }
                }
            }
        }
        return $result;
    }

    /**
     * @return array
     */
    protected function getRestrictedCategoryIds()
    {
        if ($this->restrictedCategoryIds === null) {
            $restrictedCategoryIds = [];
            foreach ($this->amazonConfig->getRestrictedCategoryIds() as $restrictedCategoryId) {
                if (!in_array($restrictedCategoryId, $restrictedCategoryIds)) {
                    // phpcs:ignore Magento2.Performance.ForeachArrayMerge
                    $restrictedCategoryIds = array_merge(
                        $restrictedCategoryIds,
                        $this->fetchRestrictedCategoryIds($restrictedCategoryId)
                    );
                }
            }
            $this->restrictedCategoryIds = $restrictedCategoryIds;
        }
        return $this->restrictedCategoryIds;
    }

    /**
     * @param \Magento\Quote\Model\Quote $quote
     * @return bool
     */
    public function isPayOnly($quote = null)
    {
        if ($quote === null) {
            $quote = $this->helperCheckout->getQuote();
        }
        return $quote->hasItems() ? $quote->isVirtual() : true;
    }

    /**
     * @param \Magento\Quote\Model\Quote $quote
     * @return bool
     */
    public function hasRestrictedProducts($quote = null)
    {
        if ($quote === null) {
            $quote = $this->helperCheckout->getQuote();
        }
        $result = false;
        foreach ($quote->getAllItems() as $item) {
            /** @var \Magento\Quote\Model\Quote\Item $item */
            if ($this->isProductRestricted($item->getProduct())) {
                $result = true;
                break;
            }
        }
        return $result;
    }

    /**
     * @param \Magento\Catalog\Model\Product $product
     * @return bool
     */
    public function isProductRestricted($product)
    {
        $productCategoryIds = $product->getCategoryIds();
        $restrictedCategoryIds = $this->getRestrictedCategoryIds();
        return !empty(array_intersect($productCategoryIds, $restrictedCategoryIds));
    }

    /**
     * @return string
     */
    public function getVersion()
    {
        $module = $this->moduleList->getOne('Amazon_Pay');
        return $module['setup_version'] ?? __('--');
    }

    /**
     * Get module composer version
     *
     * @param string $moduleName
     * @return string
     */
    public function getModuleVersion($moduleName = 'Amazon_Pay')
    {
        $path = $this->componentRegistrar->getPath(
            \Magento\Framework\Component\ComponentRegistrar::MODULE,
            $moduleName
        );
        $directoryRead = $this->readFactory->create($path);

        try {
            $composerJsonData = $directoryRead->readFile('composer.json');
        } catch (FileSystemException $e) {
            return '--';
        } catch (ValidatorException $e) {
            return '--';
        }

        $data = json_decode($composerJsonData);

        return !empty($data->version) ? $data->version : __('Read error!');
    }
}


text:
extend(Configuration, {
  title: 'Debug Panel',
  metric: false,
  rootView: `${appPath}/stories/debug/views/index.html`,
});


text:
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

using System.Linq;
using System.Threading.Tasks;
using AspNetCoreSpa.Server.Entities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;

namespace AspNetCoreSpa.Server.Controllers
{
    public class HomeController : Controller
    {
        private readonly UserManager<ApplicationUser> _userManager;

        public HomeController(UserManager<ApplicationUser> userManager)
        {
            _userManager = userManager;
        }

        public async Task<IActionResult> Index()
        {
            if (Request.Query.ContainsKey("emailConfirmCode") &&
                Request.Query.ContainsKey("userId"))
            {
                var userId = Request.Query["userId"].ToString();
                var code = Request.Query["emailConfirmCode"].ToString();
                code = code.Replace(" ", "+");

                var applicationUser = await _userManager.FindByIdAsync(userId);
                if (applicationUser != null && !applicationUser.EmailConfirmed)
                {
                    var valid = await _userManager.ConfirmEmailAsync(applicationUser, code);
                    if (valid.Succeeded)
                    {
                        ViewBag.emailConfirmed = true;
                    }
                }
            }
            else if (User.Identity != null && !string.IsNullOrEmpty(User.Identity.Name))
            {
                var user = await _userManager.FindByNameAsync(User.Identity.Name);
                var roles = await _userManager.GetRolesAsync(user);
                var userResult = new { User = new { DisplayName = user.UserName, Roles = roles.ToList() } };
                ViewBag.user = userResult;
            }

            return View();
        }

    }
}


text:
<!--
Description: Upsilon
Expect:      bozo and feed['title'] == u'testing \u03a5 entity'
-->
<rss>
<channel>
<title>testing Υ entity</title>
</channel>
</rss>


text:
        <title> Tests </title>
        <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />


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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/bau_logo"
        android:label="@string/app_name"
        android:theme="@style/MyTheme" >
        <activity
            android:name=".SplashScreen"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".LoginScreen"
            android:label="@string/app_name" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".UserMain"
            android:label="@string/app_name" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".CourseProgram"
            android:label="@string/title_activity_course_program" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".UserInfo"
            android:label="@string/title_activity_user_info" >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Messages"
            android:label="@string/title_activity_messages" />
        <activity
            android:name=".LoginWebView"
            android:label="@string/title_activity_login_web_view" >
        </activity>
    </application>

</manifest>


text:
#ifndef GRPC_SUPPORT_AVL_H
#define GRPC_SUPPORT_AVL_H

#include <grpc/support/sync.h>

/** internal node of an AVL tree */
typedef struct gpr_avl_node {
  gpr_refcount refs;
  void *key;
  void *value;
  struct gpr_avl_node *left;
  struct gpr_avl_node *right;
  long height;
} gpr_avl_node;

/** vtable for the AVL tree
 * The optional user_data is propagated from the top level gpr_avl_XXX API.
 * From the same API call, multiple vtable functions may be called multiple
 * times.
 */
typedef struct gpr_avl_vtable {
  /** destroy a key */
  void (*destroy_key)(void *key, void *user_data);
  /** copy a key, returning new value */
  void *(*copy_key)(void *key, void *user_data);
  /** compare key1, key2; return <0 if key1 < key2,
      >0 if key1 > key2, 0 if key1 == key2 */
  long (*compare_keys)(void *key1, void *key2, void *user_data);
  /** destroy a value */
  void (*destroy_value)(void *value, void *user_data);
  /** copy a value */
  void *(*copy_value)(void *value, void *user_data);
} gpr_avl_vtable;

/** "pointer" to an AVL tree - this is a reference
    counted object - use gpr_avl_ref to add a reference,
    gpr_avl_unref when done with a reference */
typedef struct gpr_avl {
  const gpr_avl_vtable *vtable;
  gpr_avl_node *root;
} gpr_avl;

/** Create an immutable AVL tree. */
GPRAPI gpr_avl gpr_avl_create(const gpr_avl_vtable *vtable);
/** Add a reference to an existing tree - returns
    the tree as a convenience. The optional user_data will be passed to vtable
    functions. */
GPRAPI gpr_avl gpr_avl_ref(gpr_avl avl, void *user_data);
/** Remove a reference to a tree - destroying it if there
    are no references left. The optional user_data will be passed to vtable
    functions. */
GPRAPI void gpr_avl_unref(gpr_avl avl, void *user_data);
/** Return a new tree with (key, value) added to avl.
    implicitly unrefs avl to allow easy chaining.
    if key exists in avl, the new tree's key entry updated
    (i.e. a duplicate is not created). The optional user_data will be passed to
    vtable functions. */
GPRAPI gpr_avl gpr_avl_add(gpr_avl avl, void *key, void *value,
                           void *user_data);
/** Return a new tree with key deleted
    implicitly unrefs avl to allow easy chaining. The optional user_data will be
    passed to vtable functions. */
GPRAPI gpr_avl gpr_avl_remove(gpr_avl avl, void *key, void *user_data);
/** Lookup key, and return the associated value.
    Does not mutate avl.
    Returns NULL if key is not found. The optional user_data will be passed to
    vtable functions.*/
GPRAPI void *gpr_avl_get(gpr_avl avl, void *key, void *user_data);
/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
    its value. THe optional user_data will be passed to vtable functions. */
GPRAPI int gpr_avl_maybe_get(gpr_avl avl, void *key, void **value,
                             void *user_data);
/** Return 1 if avl is empty, 0 otherwise */
GPRAPI int gpr_avl_is_empty(gpr_avl avl);

#endif /* GRPC_SUPPORT_AVL_H */


text:
namespace content {

SaveFileCreateInfo::SaveFileCreateInfo(const base::FilePath& path,
                                       const GURL& url,
                                       SaveFileSource save_source,
                                       int32 save_id)
    : path(path),
      url(url),
      save_id(save_id),
      save_package_id(-1),
      render_process_id(-1),
      render_frame_routing_id(-1),
      request_id(-1),
      total_bytes(0),
      save_source(save_source) {}

SaveFileCreateInfo::SaveFileCreateInfo()
    : save_id(-1),
      save_package_id(-1),
      render_process_id(-1),
      render_frame_routing_id(-1),
      request_id(-1),
      total_bytes(0),
      save_source(SAVE_FILE_FROM_UNKNOWN) {}

SaveFileCreateInfo::~SaveFileCreateInfo() {}

}  // namespace content


text:
<!DOCTYPE html>

        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

TODO write content

        <form>
        Your Name: <input type="text" name="name" required>

        Email Address: <input type="email" name="email" required placeholder="Enter a valid email address">

        Website: <input type="url" name="website" required>

        Website2: <input type="url" name="website2" required pattern="https?://.+">

        Age: <input type="number" size="6" name="age" min="18" max="99" value="21">

        Satisfaction: <input type="range" size="2" name="satisfaction" min="1" max="5" value="3">

        </form>


text:
import { StringMapWrapper } from '../facade/collection';
import { isPresent } from '../facade/lang';
import { FILL_STYLE_FLAG } from './animation_constants';
import { AUTO_STYLE } from './metadata';
export function prepareFinalAnimationStyles(previousStyles, newStyles, nullValue) {
    if (nullValue === void 0) { nullValue = null; }
    var finalStyles = {};
    Object.keys(newStyles).forEach(function (prop) {
        var value = newStyles[prop];
        finalStyles[prop] = value == AUTO_STYLE ? nullValue : value.toString();
    });
    Object.keys(previousStyles).forEach(function (prop) {
        if (!isPresent(finalStyles[prop])) {
            finalStyles[prop] = nullValue;
        }
    });
    return finalStyles;
}
export function balanceAnimationKeyframes(collectedStyles, finalStateStyles, keyframes) {
    var limit = keyframes.length - 1;
    var firstKeyframe = keyframes[0];
    // phase 1: copy all the styles from the first keyframe into the lookup map
    var flatenedFirstKeyframeStyles = flattenStyles(firstKeyframe.styles.styles);
    var extraFirstKeyframeStyles = {};
    var hasExtraFirstStyles = false;
    Object.keys(collectedStyles).forEach(function (prop) {
        var value = collectedStyles[prop];
        // if the style is already defined in the first keyframe then
        // we do not replace it.
        if (!flatenedFirstKeyframeStyles[prop]) {
            flatenedFirstKeyframeStyles[prop] = value;
            extraFirstKeyframeStyles[prop] = value;
            hasExtraFirstStyles = true;
        }
    });
    var keyframeCollectedStyles = StringMapWrapper.merge({}, flatenedFirstKeyframeStyles);
    // phase 2: normalize the final keyframe
    var finalKeyframe = keyframes[limit];
    finalKeyframe.styles.styles.unshift(finalStateStyles);
    var flatenedFinalKeyframeStyles = flattenStyles(finalKeyframe.styles.styles);
    var extraFinalKeyframeStyles = {};
    var hasExtraFinalStyles = false;
    Object.keys(keyframeCollectedStyles).forEach(function (prop) {
        if (!isPresent(flatenedFinalKeyframeStyles[prop])) {
            extraFinalKeyframeStyles[prop] = AUTO_STYLE;
            hasExtraFinalStyles = true;
        }
    });
    if (hasExtraFinalStyles) {
        finalKeyframe.styles.styles.push(extraFinalKeyframeStyles);
    }
    Object.keys(flatenedFinalKeyframeStyles).forEach(function (prop) {
        if (!isPresent(flatenedFirstKeyframeStyles[prop])) {
            extraFirstKeyframeStyles[prop] = AUTO_STYLE;
            hasExtraFirstStyles = true;
        }
    });
    if (hasExtraFirstStyles) {
        firstKeyframe.styles.styles.push(extraFirstKeyframeStyles);
    }
    return keyframes;
}
export function clearStyles(styles) {
    var finalStyles = {};
    Object.keys(styles).forEach(function (key) { finalStyles[key] = null; });
    return finalStyles;
}
export function collectAndResolveStyles(collection, styles) {
    return styles.map(function (entry) {
        var stylesObj = {};
        Object.keys(entry).forEach(function (prop) {
            var value = entry[prop];
            if (value == FILL_STYLE_FLAG) {
                value = collection[prop];
                if (!isPresent(value)) {
                    value = AUTO_STYLE;
                }
            }
            collection[prop] = value;
            stylesObj[prop] = value;
        });
        return stylesObj;
    });
}
export function renderStyles(element, renderer, styles) {
    Object.keys(styles).forEach(function (prop) { renderer.setElementStyle(element, prop, styles[prop]); });
}
export function flattenStyles(styles) {
    var finalStyles = {};
    styles.forEach(function (entry) {
        Object.keys(entry).forEach(function (prop) { finalStyles[prop] = entry[prop]; });
    });
    return finalStyles;
}
//# sourceMappingURL=animation_style_util.js.map


text:
function foo() {
  const a = console.log;
  a();
  const b = console.error.bind(console);
  b("asdf");
  blah();
}


text:
:- multifile term_expansion/2.

%:- print('Loaded Sicstus Term Expansion\n').
%% this file defines the term expansions for Sicstus

%term_expansion(FOO, _) :- portray_clause(te(FOO)), fail.
%term_expansion((:- use_package(PACK)) , ( :- print('Ignoring CIAO Package::'), print(PACK), nl)).
term_expansion((:- use_package(_PACK)) , ( :- true)).
term_expansion((sicstus(CALL) :- BODY), (CALL :- BODY)).
term_expansion((sicstus(FACT)), FACT).
term_expansion((sicstus((:-Decl))), (:-Decl)).
term_expansion((ciao(_) :- _), (:- true)).
term_expansion((ciao(_)), (:- true)).
term_expansion((:-comment(_,_)), (:- true)).
%term_expansion((:-ensure_loaded('sicstus_term.pl')), (:- true)).


text:
The `fabric8.yml` file is an optional YAML file that the **Microservices Platform** tools use to store project configuration inside the source code of a project.

Its a place you can store things like

* the path of the [Jenkins Workflow script](https://github.com/jenkinsci/workflow-plugin) from the [Jenkins Workflow Library](jenkinsWorkflowLibrary.html)
* the name of the chat room and issue tracker
* web links to all the different services for a project (git repository, jenkins build, chat room, issue tracker, staging and production environments etc)

Usually the file is lazily created when there is some custom configuration for a project to be stored.

### Editing the `fabric8.yml` file

There are a few ways you can edit the contents:

* the `project settings` button in the [console](console.html)
* the `fabric8.yml` file directly using a text editor in source control
* using the [Microservices Platform Forge commands from the CLI or in your IDE](forge.html)


text:
namespace ash {
namespace shimless_rma {

class ShimlessRmaDelegate;

class ShimlessRmaService : public mojom::ShimlessRmaService,
                           public chromeos::RmadClient::Observer {
 public:
  ShimlessRmaService(
      std::unique_ptr<ShimlessRmaDelegate> shimless_rma_delegate);
  ShimlessRmaService(const ShimlessRmaService&) = delete;
  ShimlessRmaService& operator=(const ShimlessRmaService&) = delete;

  ~ShimlessRmaService() override;

  void GetCurrentState(GetCurrentStateCallback callback) override;
  void TransitionPreviousState(
      TransitionPreviousStateCallback callback) override;

  void AbortRma(AbortRmaCallback callback) override;

  void BeginFinalization(BeginFinalizationCallback callback) override;

  void NetworkSelectionComplete(
      NetworkSelectionCompleteCallback callback) override;

  void GetCurrentOsVersion(GetCurrentOsVersionCallback callback) override;
  void CheckForOsUpdates(CheckForOsUpdatesCallback callback) override;
  void UpdateOs(UpdateOsCallback callback) override;
  void UpdateOsSkipped(UpdateOsSkippedCallback callback) override;

  void SetSameOwner(SetSameOwnerCallback callback) override;
  void SetDifferentOwner(SetDifferentOwnerCallback callback) override;

  void SetWipeDevice(bool wipe_device, SetWipeDeviceCallback) override;

  void ChooseManuallyDisableWriteProtect(
      ChooseManuallyDisableWriteProtectCallback callback) override;
  void ChooseRsuDisableWriteProtect(
      ChooseRsuDisableWriteProtectCallback callback) override;
  void GetRsuDisableWriteProtectChallenge(
      GetRsuDisableWriteProtectChallengeCallback callback) override;
  void GetRsuDisableWriteProtectHwid(
      GetRsuDisableWriteProtectHwidCallback callback) override;
  void GetRsuDisableWriteProtectChallengeQrCode(
      GetRsuDisableWriteProtectChallengeQrCodeCallback callback) override;
  void SetRsuDisableWriteProtectCode(
      const std::string& code,
      SetRsuDisableWriteProtectCodeCallback callback) override;

  void WriteProtectManuallyDisabled(
      WriteProtectManuallyDisabledCallback callback) override;
  void GetWriteProtectManuallyDisabledInstructions(
      GetWriteProtectManuallyDisabledInstructionsCallback callback) override;

  void GetWriteProtectDisableCompleteAction(
      GetWriteProtectDisableCompleteActionCallback callback) override;
  void ConfirmManualWpDisableComplete(
      ConfirmManualWpDisableCompleteCallback callback) override;

  void GetComponentList(GetComponentListCallback callback) override;
  void SetComponentList(
      const std::vector<::rmad::ComponentsRepairState_ComponentRepairStatus>&
          component_list,
      SetComponentListCallback callback) override;
  void ReworkMainboard(ReworkMainboardCallback callback) override;

  void RoFirmwareUpdateComplete(
      RoFirmwareUpdateCompleteCallback callback) override;

  void ShutdownForRestock(ShutdownForRestockCallback callback) override;
  void ContinueFinalizationAfterRestock(
      ContinueFinalizationAfterRestockCallback callback) override;

  void GetRegionList(GetRegionListCallback callback) override;
  void GetSkuList(GetSkuListCallback callback) override;
  void GetWhiteLabelList(GetWhiteLabelListCallback callback) override;
  void GetOriginalSerialNumber(
      GetOriginalSerialNumberCallback callback) override;
  void GetOriginalRegion(GetOriginalRegionCallback callback) override;
  void GetOriginalSku(GetOriginalSkuCallback callback) override;
  void GetOriginalWhiteLabel(GetOriginalWhiteLabelCallback callback) override;
  void GetOriginalDramPartNumber(
      GetOriginalDramPartNumberCallback callback) override;
  void SetDeviceInformation(const std::string& serial_number,
                            int32_t region_index,
                            int32_t sku_index,
                            int32_t white_label_index,
                            const std::string& dram_part_number,
                            SetDeviceInformationCallback callback) override;

  void GetCalibrationComponentList(
      GetCalibrationComponentListCallback callback) override;
  void GetCalibrationSetupInstructions(
      GetCalibrationSetupInstructionsCallback callback) override;
  void StartCalibration(
      const std::vector<::rmad::CalibrationComponentStatus>& components,
      StartCalibrationCallback callback) override;
  void RunCalibrationStep(RunCalibrationStepCallback callback) override;
  void ContinueCalibration(ContinueCalibrationCallback callback) override;
  void CalibrationComplete(CalibrationCompleteCallback callback) override;

  void RetryProvisioning(RetryProvisioningCallback callback) override;
  void ProvisioningComplete(ProvisioningCompleteCallback callback) override;

  void RetryFinalization(RetryFinalizationCallback callback) override;
  void FinalizationComplete(FinalizationCompleteCallback callback) override;

  void WriteProtectManuallyEnabled(
      WriteProtectManuallyEnabledCallback callback) override;

  void GetLog(GetLogCallback callback) override;
  void LaunchDiagnostics() override;
  void EndRmaAndReboot(EndRmaAndRebootCallback callback) override;
  void EndRmaAndShutdown(EndRmaAndShutdownCallback callback) override;
  void EndRmaAndCutoffBattery(EndRmaAndCutoffBatteryCallback callback) override;

  void CriticalErrorExitToLogin(
      CriticalErrorExitToLoginCallback callback) override;
  void CriticalErrorReboot(CriticalErrorRebootCallback callback) override;

  void ObserveError(
      ::mojo::PendingRemote<mojom::ErrorObserver> observer) override;
  void ObserveOsUpdateProgress(
      ::mojo::PendingRemote<mojom::OsUpdateObserver> observer) override;
  void ObserveCalibrationProgress(
      ::mojo::PendingRemote<mojom::CalibrationObserver> observer) override;
  void ObserveProvisioningProgress(
      ::mojo::PendingRemote<mojom::ProvisioningObserver> observer) override;
  void ObserveHardwareWriteProtectionState(
      ::mojo::PendingRemote<mojom::HardwareWriteProtectionStateObserver>
          observer) override;
  void ObservePowerCableState(
      ::mojo::PendingRemote<mojom::PowerCableStateObserver> observer) override;
  void ObserveHardwareVerificationStatus(
      ::mojo::PendingRemote<mojom::HardwareVerificationStatusObserver> observer)
      override;
  void ObserveFinalizationStatus(
      ::mojo::PendingRemote<mojom::FinalizationObserver> observer) override;
  void ObserveRoFirmwareUpdateProgress(
      ::mojo::PendingRemote<mojom::UpdateRoFirmwareObserver> observer) override;

  void BindInterface(
      mojo::PendingReceiver<mojom::ShimlessRmaService> pending_receiver);

  // RmadClient::Observer interface.
  void Error(rmad::RmadErrorCode error) override;
  void CalibrationProgress(
      const rmad::CalibrationComponentStatus& component_status) override;
  void CalibrationOverallProgress(
      rmad::CalibrationOverallStatus status) override;
  void ProvisioningProgress(const rmad::ProvisionStatus& status) override;
  void HardwareWriteProtectionState(bool enabled) override;
  void PowerCableState(bool plugged_in) override;
  void HardwareVerificationResult(
      const rmad::HardwareVerificationResult& result) override;
  void FinalizationProgress(const rmad::FinalizeStatus& status) override;
  void RoFirmwareUpdateProgress(rmad::UpdateRoFirmwareStatus status) override;

  void OsUpdateProgress(update_engine::Operation operation,
                        double progress,
                        update_engine::ErrorCode error_code);

 private:
  using TransitionStateCallback =
      base::OnceCallback<void(mojom::State, bool, bool, rmad::RmadErrorCode)>;

  template <class Callback>
  void TransitionNextStateGeneric(Callback callback);
  template <class Callback>
  void OnGetStateResponse(Callback callback,
                          absl::optional<rmad::GetStateReply> response);
  void OnAbortRmaResponse(AbortRmaCallback callback,
                          bool reboot,
                          absl::optional<rmad::AbortRmaReply> response);
  void OnGetLog(GetLogCallback callback,
                absl::optional<rmad::GetLogReply> response);

  void OnOsUpdateStatusCallback(update_engine::Operation operation,
                                double progress,
                                bool rollback,
                                bool powerwash,
                                const std::string& version,
                                int64_t update_size,
                                update_engine::ErrorCode error_code);

  void OsUpdateOrNextRmadStateCallback(TransitionStateCallback callback,
                                       const std::string& version);

  rmad::RmadState state_proto_;
  bool can_abort_ = false;
  bool can_go_back_ = false;
  // Used to validate mojo only states such as kConfigureNetwork
  mojom::State mojo_state_;

  absl::optional<rmad::CalibrationComponentStatus> last_calibration_progress_;
  absl::optional<rmad::CalibrationOverallStatus>
      last_calibration_overall_progress_;
  absl::optional<rmad::ProvisionStatus> last_provisioning_progress_;
  absl::optional<bool> last_hardware_protection_state_;
  absl::optional<bool> last_power_cable_state_;
  absl::optional<rmad::HardwareVerificationResult>
      last_hardware_verification_result_;
  absl::optional<rmad::FinalizeStatus> last_finalization_progress_;
  absl::optional<rmad::UpdateRoFirmwareStatus>
      last_update_ro_firmware_progress_;

  mojo::Remote<mojom::ErrorObserver> error_observer_;
  mojo::Remote<mojom::OsUpdateObserver> os_update_observer_;
  mojo::Remote<mojom::CalibrationObserver> calibration_observer_;
  mojo::Remote<mojom::ProvisioningObserver> provisioning_observer_;
  mojo::Remote<mojom::HardwareWriteProtectionStateObserver>
      hwwp_state_observer_;
  mojo::Remote<mojom::PowerCableStateObserver> power_cable_observer_;
  // HardwareVerificationStatusObserver is used by landing and OS update pages.
  mojo::RemoteSet<mojom::HardwareVerificationStatusObserver>
      hardware_verification_observers_;
  mojo::Remote<mojom::FinalizationObserver> finalization_observer_;
  mojo::Remote<mojom::UpdateRoFirmwareObserver> update_ro_firmware_observer_;
  mojo::Receiver<mojom::ShimlessRmaService> receiver_{this};

  VersionUpdater version_updater_;
  base::OnceCallback<void(const std::string& version)> check_os_callback_;

  // Provides browser functionality from //chrome to the Shimless RMA UI.
  std::unique_ptr<ShimlessRmaDelegate> shimless_rma_delegate_;

  // When a critical error occurs this is set to true and never clears.
  // It is used to allow abort requests to reboot or exit to login, even if the
  // request fails.
  bool critical_error_occurred_ = false;

  // Note: This should remain the last member so it'll be destroyed and
  // invalidate its weak pointers before any other members are destroyed.
  base::WeakPtrFactory<ShimlessRmaService> weak_ptr_factory_{this};
};
}  // namespace shimless_rma
}  // namespace ash

#endif  // ASH_WEBUI_SHIMLESS_RMA_BACKEND_SHIMLESS_RMA_SERVICE_H_


text:
'use strict'

var MIN = 49152
var MAX = 65535

module.exports = function uniqPort( string ) {

    if ( typeof string === 'number' ) {
        string += ''
    } else if ( typeof string !== 'string' ) {
        throw new TypeError( '`name` must be a string or a number' )
    }

    for ( var i = 0, offset = 0; i < string.length; i++ ) {
        offset += string.charCodeAt( i )
    }

    return MIN + Math.pow( offset, 16 ) % ( MAX - MIN )
}