text:
// Copyright 2019 The Chromium Authors
// 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.app.tab_activity_glue;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Rect;
import android.media.AudioManager;
import android.view.KeyEvent;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.collection.ArrayMap;

import org.chromium.base.ActivityState;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.base.supplier.Supplier;
import org.chromium.blink.mojom.DisplayMode;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.AppHooks;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.SwipeRefreshHandler;
import org.chromium.chrome.browser.browser_controls.BrowserControlsStateProvider;
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
import org.chromium.chrome.browser.contextmenu.ContextMenuUtils;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.fullscreen.FullscreenManager;
import org.chromium.chrome.browser.fullscreen.FullscreenOptions;
import org.chromium.chrome.browser.init.ChromeActivityNativeDelegate;
import org.chromium.chrome.browser.media.PictureInPicture;
import org.chromium.chrome.browser.night_mode.WebContentsDarkModeController;
import org.chromium.chrome.browser.notifications.WebPlatformNotificationMetrics;
import org.chromium.chrome.browser.policy.PolicyAuditor;
import org.chromium.chrome.browser.policy.PolicyAuditor.AuditEvent;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabLaunchType;
import org.chromium.chrome.browser.tab.TabWebContentsDelegateAndroid;
import org.chromium.chrome.browser.tabmodel.TabCreator;
import org.chromium.chrome.browser.tabmodel.TabCreatorManager;
import org.chromium.chrome.browser.tabmodel.TabModel;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModelUtils;
import org.chromium.chrome.browser.tasks.tab_management.TabUiFeatureUtilities;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.ResourceRequestBody;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.modaldialog.DialogDismissalCause;
import org.chromium.ui.modaldialog.ModalDialogManager;
import org.chromium.ui.modaldialog.ModalDialogProperties;
import org.chromium.ui.modaldialog.SimpleModalDialogController;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.mojom.WindowOpenDisposition;
import org.chromium.ui.util.ColorUtils;
import org.chromium.url.GURL;

/**
 * {@link WebContentsDelegateAndroid} that interacts with {@link Activity} and those
 * of the lifetime of the activity to process requests from underlying {@link WebContents}
 * for a given {@link Tab}.
 */
public class ActivityTabWebContentsDelegateAndroid extends TabWebContentsDelegateAndroid {
    private static final String TAG = "ActivityTabWCDA";

    private final ArrayMap<WebContents, GURL> mWebContentsUrlMapping = new ArrayMap<>();

    private final Tab mTab;

    @Nullable
    private Activity mActivity;
    private final ChromeActivityNativeDelegate mChromeActivityNativeDelegate;
    private final boolean mIsCustomTab;
    private final BrowserControlsStateProvider mBrowserControlsStateProvider;
    private final FullscreenManager mFullscreenManager;
    private final TabCreatorManager mTabCreatorManager;
    private final Supplier<TabModelSelector> mTabModelSelectorSupplier;
    private final Supplier<CompositorViewHolder> mCompositorViewHolderSupplier;
    private final Supplier<ModalDialogManager> mModalDialogManagerSupplier;

    public ActivityTabWebContentsDelegateAndroid(Tab tab, Activity activity,
            ChromeActivityNativeDelegate chromeActivityNativeDelegate, boolean isCustomTab,
            BrowserControlsStateProvider browserControlsStateProvider,
            FullscreenManager fullscreenManager, TabCreatorManager tabCreatorManager,
            @NonNull Supplier<TabModelSelector> tabModelSelectorSupplier,
            @NonNull Supplier<CompositorViewHolder> compositorViewHolderSupplier,
            @NonNull Supplier<ModalDialogManager> modalDialogManagerSupplier) {
        mTab = tab;
        mActivity = activity;
        mChromeActivityNativeDelegate = chromeActivityNativeDelegate;
        mIsCustomTab = isCustomTab;
        mBrowserControlsStateProvider = browserControlsStateProvider;
        mFullscreenManager = fullscreenManager;
        mTabCreatorManager = tabCreatorManager;
        mTabModelSelectorSupplier = tabModelSelectorSupplier;
        mCompositorViewHolderSupplier = compositorViewHolderSupplier;
        mModalDialogManagerSupplier = modalDialogManagerSupplier;

        tab.addObserver(new EmptyTabObserver() {
            @Override
            public void onActivityAttachmentChanged(Tab tab, @Nullable WindowAndroid window) {
                if (window == null) mActivity = null;
            }

            @Override
            public void onDestroyed(Tab tab) {
                tab.removeObserver(this);
            }
        });
    }

    @Override
    public void openNewTab(GURL url, String extraHeaders, ResourceRequestBody postData,
            int disposition, boolean isRendererInitiated) {
        // New tabs are handled by the tab model (see
        // TabWebContentsDelegateAndroid::OpenURLFromTab().
        assert false;
    }

    @Override
    public int getDisplayMode() {
        return DisplayMode.BROWSER;
    }

    @Override
    public void showRepostFormWarningDialog() {
        // When the dialog is visible, keeping the refresh animation active
        // in the background is distracting and unnecessary (and likely to
        // jank when the dialog is shown).
        SwipeRefreshHandler handler = SwipeRefreshHandler.get(mTab);
        if (handler != null) handler.reset();

        showRepostFormWarningTabModalDialog();
    }

    @Override
    public void webContentsCreated(WebContents sourceWebContents, long openerRenderProcessId,
            long openerRenderFrameId, String frameName, GURL targetUrl,
            WebContents newWebContents) {
        // The URL can't be taken from the WebContents if it's paused.  Save it for later.
        assert !mWebContentsUrlMapping.containsKey(newWebContents);
        mWebContentsUrlMapping.put(newWebContents, targetUrl);
    }

    @Override
    public boolean isFullscreenForTabOrPending() {
        return mFullscreenManager != null ? mFullscreenManager.getPersistentFullscreenMode()
                                          : false;
    }

    @Override
    protected boolean shouldResumeRequestsForCreatedWindow() {
        // Pause the WebContents if an Activity has to be created for it first.
        TabCreator tabCreator = mTabCreatorManager.getTabCreator(mTab.isIncognito());
        assert tabCreator != null;
        return !tabCreator.createsTabsAsynchronously();
    }

    @Override
    protected boolean addNewContents(WebContents sourceWebContents, WebContents webContents,
            int disposition, Rect initialPosition, boolean userGesture) {
        assert mWebContentsUrlMapping.containsKey(webContents);

        TabCreator tabCreator = mTabCreatorManager.getTabCreator(mTab.isIncognito());
        assert tabCreator != null;

        // Grab the URL, which might not be available via the Tab.
        GURL url = mWebContentsUrlMapping.remove(webContents);

        // Skip opening a new Tab if it doesn't make sense.
        if (mTab.isClosing()) return false;

        // Creating new Tabs asynchronously requires starting a new Activity to create the Tab,
        // so the Tab returned will always be null.  There's no way to know synchronously
        // whether the Tab is created, so assume it's always successful.
        boolean createdSuccessfully = tabCreator.createTabWithWebContents(
                mTab, webContents, TabLaunchType.FROM_LONGPRESS_FOREGROUND, url);
        boolean success = tabCreator.createsTabsAsynchronously() || createdSuccessfully;

        if (success) {
            if (disposition == WindowOpenDisposition.NEW_FOREGROUND_TAB) {
                if (TabUiFeatureUtilities.ENABLE_TAB_GROUP_AUTO_CREATION.getValue()
                        && mTabModelSelectorSupplier.hasValue()
                        && mTabModelSelectorSupplier.get()
                                        .getTabModelFilterProvider()
                                        .getCurrentTabModelFilter()
                                        .getRelatedTabList(mTab.getId())
                                        .size()
                                == 2) {
                    RecordUserAction.record("TabGroup.Created.DeveloperRequestedNewTab");
                }
                RecordUserAction.record("LinkNavigationOpenedInForegroundTab");
            } else if (disposition == WindowOpenDisposition.NEW_POPUP) {
                PolicyAuditor auditor = AppHooks.get().getPolicyAuditor();
                if (auditor != null) {
                    auditor.notifyAuditEvent(ContextUtils.getApplicationContext(),
                            AuditEvent.OPEN_POPUP_URL_SUCCESS, url.getSpec(), "");
                }
            }
        }

        return success;
    }

    @Override
    public void activateContents() {
        if (mActivity == null) {
            Log.e(TAG, "Activity not set activateContents().  Bailing out.");
            return;
        }

        if (mChromeActivityNativeDelegate.isActivityFinishingOrDestroyed()) {
            Log.e(TAG, "Activity destroyed before calling activateContents().  Bailing out.");
            return;
        }
        if (!mTab.isInitialized()) {
            Log.e(TAG, "Tab not initialized before calling activateContents().  Bailing out.");
            return;
        }

        WebPlatformNotificationMetrics.getInstance().onTabFocused();

        // Do nothing if the tab can currently be interacted with by the user.
        if (mTab.isUserInteractable()) return;

        TabModel model = mTabModelSelectorSupplier.get().getModel(mTab.isIncognito());
        int index = model.indexOf(mTab);
        if (index == TabModel.INVALID_TAB_INDEX) return;
        TabModelUtils.setIndex(model, index, false);

        // Do nothing if the mActivity is visible (STOPPED is the only valid invisible state as we
        // explicitly check isActivityFinishingOrDestroyed above).
        if (ApplicationStatus.getStateForActivity(mActivity) == ActivityState.STOPPED) {
            bringActivityToForeground();
        }
    }

    /**
     * Brings chrome's Activity to foreground, if it is not so.
     */
    protected void bringActivityToForeground() {
        // This intent is sent in order to get the activity back to the foreground if it was
        // not already. The previous call will activate the right tab in the context of the
        // TabModel but will only show the tab to the user if Chrome was already in the
        // foreground.
        // The intent is getting the tabId mostly because it does not cost much to do so.
        // When receiving the intent, the tab associated with the tabId should already be
        // active.
        // Note that calling only the intent in order to activate the tab is slightly slower
        // because it will change the tab when the intent is handled, which happens after
        // Chrome gets back to the foreground.
        Intent newIntent = IntentHandler.createTrustedBringTabToFrontIntent(
                mTab.getId(), IntentHandler.BringToFrontSource.ACTIVATE_TAB);
        if (newIntent != null) {
            newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            ContextUtils.getApplicationContext().startActivity(newIntent);
        }
    }

    @Override
    public boolean takeFocus(boolean reverse) {
        if (mActivity == null) return false;
        if (reverse) {
            View menuButton = mActivity.findViewById(R.id.menu_button);
            if (menuButton != null && menuButton.isShown()) {
                return menuButton.requestFocus();
            }

            View tabSwitcherButton = mActivity.findViewById(R.id.tab_switcher_button);
            if (tabSwitcherButton != null && tabSwitcherButton.isShown()) {
                return tabSwitcherButton.requestFocus();
            }
        } else {
            View urlBar = mActivity.findViewById(R.id.url_bar);
            if (urlBar != null) return urlBar.requestFocus();
        }
        return false;
    }

    @Override
    public void handleKeyboardEvent(KeyEvent event) {
        if (event.getAction() == KeyEvent.ACTION_DOWN && mActivity != null) {
            if (mActivity.onKeyDown(event.getKeyCode(), event)) return;

            // Handle the Escape key here (instead of in KeyboardShortcuts.java), so it doesn't
            // interfere with other parts of the activity (e.g. the URL bar).
            if (event.getKeyCode() == KeyEvent.KEYCODE_ESCAPE && event.hasNoModifiers()) {
                WebContents wc = mTab.getWebContents();
                if (wc != null) wc.stop();
                return;
            }
        }
        handleMediaKey(event);
    }

    /**
     * Redispatches unhandled media keys. This allows bluetooth headphones with play/pause or
     * other buttons to function correctly.
     */
    private void handleMediaKey(KeyEvent e) {
        switch (e.getKeyCode()) {
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
            case KeyEvent.KEYCODE_MEDIA_CLOSE:
            case KeyEvent.KEYCODE_MEDIA_EJECT:
            case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK:
                AudioManager am =
                        (AudioManager) ContextUtils.getApplicationContext().getSystemService(
                                Context.AUDIO_SERVICE);
                am.dispatchMediaKeyEvent(e);
                break;
            default:
                break;
        }
    }

    @Override
    protected void setOverlayMode(boolean useOverlayMode) {
        if (mCompositorViewHolderSupplier.hasValue()) {
            mCompositorViewHolderSupplier.get().setOverlayMode(useOverlayMode);
        }
    }

    @Override
    public int getTopControlsHeight() {
        return mBrowserControlsStateProvider != null
                ? mBrowserControlsStateProvider.getTopControlsHeight()
                : 0;
    }

    @Override
    public int getTopControlsMinHeight() {
        return mBrowserControlsStateProvider != null
                ? mBrowserControlsStateProvider.getTopControlsMinHeight()
                : 0;
    }

    @Override
    public int getBottomControlsHeight() {
        return mBrowserControlsStateProvider != null
                ? mBrowserControlsStateProvider.getBottomControlsHeight()
                : 0;
    }

    @Override
    public int getBottomControlsMinHeight() {
        return mBrowserControlsStateProvider != null
                ? mBrowserControlsStateProvider.getBottomControlsMinHeight()
                : 0;
    }

    @Override
    public boolean shouldAnimateBrowserControlsHeightChanges() {
        return mBrowserControlsStateProvider != null
                && mBrowserControlsStateProvider.shouldAnimateBrowserControlsHeightChanges();
    }

    @Override
    public boolean controlsResizeView() {
        return mCompositorViewHolderSupplier.hasValue()
                && mCompositorViewHolderSupplier.get().controlsResizeView();
    }

    @Override
    public void enterFullscreenModeForTab(boolean prefersNavigationBar, boolean prefersStatusBar) {
        if (mFullscreenManager != null) {
            mFullscreenManager.onEnterFullscreen(
                    mTab, new FullscreenOptions(prefersNavigationBar, prefersStatusBar));
        }
    }

    @Override
    public void fullscreenStateChangedForTab(
            boolean prefersNavigationBar, boolean prefersStatusBar) {
        // State-only changes are useful for recursive fullscreen activation. Early out if
        // fullscreen mode is not on.
        if (mFullscreenManager == null || !mFullscreenManager.getPersistentFullscreenMode()) return;
        mFullscreenManager.onEnterFullscreen(
                mTab, new FullscreenOptions(prefersNavigationBar, prefersStatusBar));
    }

    @Override
    public void exitFullscreenModeForTab() {
        if (mFullscreenManager != null) mFullscreenManager.onExitFullscreen(mTab);
    }

    @Override
    protected boolean isPictureInPictureEnabled() {
        return mActivity != null ? PictureInPicture.isEnabled(mActivity.getApplicationContext())
                                 : false;
    }

    @Override
    protected boolean isNightModeEnabled() {
        return mActivity != null ? ColorUtils.inNightMode(mActivity) : false;
    }

    @Override
    protected boolean isForceDarkWebContentEnabled() {
        if (ChromeFeatureList.isEnabled(ChromeFeatureList.FORCE_WEB_CONTENTS_DARK_MODE)) {
            return true;
        }
        if (!ChromeFeatureList.isEnabled(
                    ChromeFeatureList.DARKEN_WEBSITES_CHECKBOX_IN_THEMES_SETTING)) {
            return false;
        }
        WebContents webContents = mTab.getWebContents();
        if (webContents == null) {
            return false;
        }
        Profile profile = Profile.fromWebContents(mTab.getWebContents());
        if (profile == null) {
            return false;
        }
        return isNightModeEnabled()
                && WebContentsDarkModeController.isEnabledForUrl(
                        profile, webContents.getVisibleUrl());
    }

    @Override
    protected boolean isCustomTab() {
        return mIsCustomTab;
    }

    private void showRepostFormWarningTabModalDialog() {
        // As a rule, showRepostFormWarningDialog should only be called on active tabs, as it's
        // called right after WebContents::Activate. But in various corner cases, that
        // activation may fail.
        if (mActivity == null || !mTab.isUserInteractable()) {
            mTab.getWebContents().getNavigationController().cancelPendingReload();
            return;
        }

        ModalDialogManager modalDialogManager = mModalDialogManagerSupplier.get();
        ModalDialogProperties.Controller dialogController =
                new SimpleModalDialogController(modalDialogManager, (Integer dismissalCause) -> {
                    if (!mTab.isInitialized()) return;
                    switch (dismissalCause) {
                        case DialogDismissalCause.POSITIVE_BUTTON_CLICKED:
                            mTab.getWebContents().getNavigationController().continuePendingReload();
                            break;
                        case DialogDismissalCause.ACTIVITY_DESTROYED:
                        case DialogDismissalCause.TAB_DESTROYED:
                            // Intentionally ignored as the tab object is gone.
                            break;
                        default:
                            mTab.getWebContents().getNavigationController().cancelPendingReload();
                            break;
                    }
                });

        Resources resources = mActivity.getResources();
        PropertyModel dialogModel =
                new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
                        .with(ModalDialogProperties.CONTROLLER, dialogController)
                        .with(ModalDialogProperties.TITLE, resources,
                                R.string.http_post_warning_title)
                        .with(ModalDialogProperties.MESSAGE_PARAGRAPH_1,
                                resources.getString(R.string.http_post_warning))
                        .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, resources,
                                R.string.http_post_warning_resend)
                        .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
                                R.string.cancel)
                        .with(ModalDialogProperties.CANCEL_ON_TOUCH_OUTSIDE, true)
                        .build();

        modalDialogManager.showDialog(dialogModel, ModalDialogManager.ModalDialogType.TAB, true);
    }

    @Override
    protected boolean isModalContextMenu() {
        return !ContextMenuUtils.usePopupContextMenuForContext(mActivity);
    }
}


text:
                Master Scoring Beasiswa
                <button class="btn-floating waves-effect waves-light primary-color z-depth-0" onclick="add_data()" title="Tambah Data"></button>

                    #
                    Jenis Scoring
                    (Bobot) Opsi Scoring
                    Aksi

                  1
                  Rekening Listrik

(2) >100.000

(3) 81.000-100.000

(4) 51.000-80.0000

(5) <50.000

                    mode_edit
                    delete

                  2
                  Pekerjaan Ayah

(2) Almarhum

(3) Tidak Bekerja

(4) Nelayan/Buruh

(5) Petani/Pedagang/Wiraswasta

(6) Pegawai Swasta

(7) Pegawai Negeri/TNI/Polri

                    mode_edit
                    delete

                  3
                  Pekerjaan Ibu

(2) Almarhum

(3) Tidak Bekerja

(4) Nelayan/Buruh

(5) Petani/Pedagang/Wiraswasta

(6) Pegawai Swasta

(7) Pegawai Negeri/TNI/Polri

                    mode_edit
                    delete

Master Scoring Beasiswa

    <form action="#" id="formInput">

        <input type="hidden" id="idJenisScoring" name="idJenisScoring">
        <input id="jenisScoring" type="text" name="jenisScoring" class="validate">
        Jenis Scoring

              SCORING

    </form>

      <button class="btn-floating waves-effect waves-light" title="Tambah Scoring" onclick="add_score_input()">add</button>
      Tambahkan scoring beasiswa.

**Untuk menhapus, biarkan kosong pada isian scoring.

    <button class=" modal-action modal-close waves-effect waves-green btn-flat" onclick="save()">Simpan</button>

redpajama_set_name: RedPajamaGithub


text:
package com.collective.modelmatrix

import java.time.ZoneId
import java.time.format.{FormatStyle, DateTimeFormatter}
import java.util.Locale

import com.bethecoder.ascii_table.{ASCIITableHeader, ASCIITable}
import com.collective.modelmatrix.transform.{Index, Top, Identity, Transform}

import scala.language.implicitConversions

package object cli {

  val timeFormatter =
    DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT)
      .withLocale(Locale.US)
      .withZone(ZoneId.systemDefault())

  implicit def stringToASCIITableHeader(s: String): ASCIITableHeader =
    new ASCIITableHeader(s)

  implicit class StringOps(val s: String) extends AnyVal {
    def dataLeftAligned: ASCIITableHeader = new ASCIITableHeader(s, -1)
  }

  import scalaz.stream._
  import scalaz.concurrent.Task

  implicit class ConcurrentProcess[O](val process: Process[Task, O]) {
    def concurrently[O2](concurrencyLevel: Int)
        (f: Channel[Task, O, O2]): Process[Task, O2] = {
      val actions =
        process.
          zipWith(f)((data, f) => f(data))

      val nestedActions =
        actions.map(Process.eval)

      merge.mergeN(concurrencyLevel)(nestedActions)
    }
  }

}


text:
layout:     post
title:      "Leetcode (43, 49, 67, 539) String Series II"
category:   Leetcode
tags:		Leetcode Math
---

* content
{:toc}

Leetcode String Series II

## Leetcode 43. Multiply Strings

* [Leetcode 43. Multiply Strings](https://leetcode.com/problems/valid-sudoku/#/description)

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2.

Note:

1. The length of both num1 and num2 is < 110.

2. Both num1 and num2 contains only digits 0-9.

3. Both num1 and num2 does not contain any leading zero.

4. You must not use any built-in BigInteger library or convert the inputs to integer directly.

```cpp
class Solution {
public:
    string multiply(string num1, string num2) {
        const int m = num1.size();
        const int n = num2.size();
        string res(m+n+1, '0');
        for (int i=m-1; i>=0; i--)
            for (int j=n-1; j>=0; j--) {
                int temp = (num1[i]-'0')*(num2[j]-'0') + (res[i+j+2]-'0');
                res[i+j+2] = '0'+temp%10;
                res[i+j+1] += temp/10;
            }
        size_t begin = res.find_first_not_of('0');
        if(begin == string::npos) return "0";
        return res.substr(begin);
    }
};
```

## Leetcode 49. Group Anagrams

* [Leetcode 49. Group Anagrams](https://leetcode.com/problems/anagrams/#/description)

Given an array of strings, group anagrams together.

For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],

Return:

`
[
  ["ate", "eat","tea"],
  ["nat","tan"],
  ["bat"]
]
`

Note: All inputs will be in lower-case.

```cpp
class Solution {
public:
    vector<vector<string>> groupAnagrams(vector<string>& strs) {
        vector<vector<string>> res;
        if (strs.empty())   return res;
        unordered_map<string, vector<string>> table;
        for (string str: strs) {
            string key = str;
            sort(key.begin(), key.end());
            table[key].push_back(str);
        }
        for (auto i=table.begin(); i!=table.end(); i++)
            res.push_back(i->second);
        return res;
    }
};
```

## Leetcode 67. Add Binary

* [Leetcode 67. Add Binary](https://leetcode.com/problems/add-binary/#/description)

Given two binary strings, return their sum (also a binary string).

For example,

a = "11"

b = "1"

Return "100".

```cpp
class Solution {
public:
    string addBinary(string a, string b) {
        if (a.empty())  return b;
        if (b.empty())  return a;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        int i = 0, j = 0, carry = 0;
        string res = "";
        while (i<a.size() || j<b.size()) {
            if (i<a.size())
                carry += a[i++]-'0';
            if (j<b.size())
                carry += b[j++]-'0';
            res += (char)(carry%2+'0');
            carry /= 2;
        }
        if (carry)  res += '1';
        reverse(res.begin(), res.end());
        return res;
    }
};
```

## Leetcode 539. Minimum Time Difference

* [Leetcode 539. Minimum Time Difference](https://leetcode.com/problems/add-binary/#/description)

Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list.

Example 1:

```
Input: ["23:59","00:00"]
Output: 1
```

Note:

* The number of time points in the given list is at least 2 and won't exceed 20000.

* The input time is legal and ranges from 00:00 to 23:59.

```cpp
class Solution {
public:
    int findMinDifference(vector<string>& timePoints) {
        if (timePoints.empty()) return 0;
        sort(timePoints.begin(), timePoints.end());
        int res = INT_MAX;
        const int n = timePoints.size();
        int val[n] = {0};
        int val2[n] = {0};
        for (int i = 0; i<timePoints.size(); i++) {
            val[i] = stoi(timePoints[i].substr(0,2));
            val2[i] = stoi(timePoints[i].substr(3,2));
        }
        for (int i = 1; i<timePoints.size(); i++) {
            res = min(res, (val[i]-val[i-1])*60+val2[i]-val2[i-1]);
            res = min(res, (val[i-1]+24-val[i])*60+val2[i-1]-val2[i]);
        }
        res = min(res, (val[0]+24-val[n-1])*60+val2[0]-val2[n-1]);
        return res;
    }
};
```


text:
import inspect
import typing
import warnings

import exekall.engine as engine

# Re-export all _utils here
from exekall._utils import *

def get_callable_set(module_set, verbose=False):
    """
    Get the set of callables defined in all modules of ``module_set``.

    :param module_set: Set of modules to scan.
    :type module_set: set(types.ModuleType)
    """

    package_set = set(map(get_package, module_set))
    callable_set = set()
    visited_obj_set = set()
    visited_module_set = set()

    def get(module_set):
        new_module_set = set()
        callable_set = set()
        for module in get_recursive_module_set(module_set, package_set, visited_module_set):
            visited_module_set.add(module)

            callable_set_ = _get_callable_set(
                module,
                visited_obj_set,
                verbose=verbose,
            )

            def is_class_attr(obj):
                try:
                    name = obj.__qualname__
                except AttributeError:
                    return False
                else:
                    return '.' in name and '<locals>' not in name

            class_attr = {
                callable_
                for callable_ in callable_set_
                if is_class_attr(callable_)
            }

            # We might have included callables that are defined in another
            # module via inherited methods, so recurse in these modules too
            new_module_set.update(
                map(inspect.getmodule, class_attr)
            )
            callable_set.update(callable_set_)

        new_module_set.discard(None)
        new_module_set -= visited_module_set
        return (callable_set, new_module_set)

    while module_set:
        callable_set_, module_set = get(module_set)
        callable_set.update(callable_set_)

    return callable_set

def _get_members(*args, **kwargs):
    """
    Same as :func:`inspect.getmembers` except that it will silence warnings,
    which avoids triggering deprecation warnings just because we are scanning a
    class
    """
    with warnings.catch_warnings():
        warnings.simplefilter(action='ignore')
        return inspect.getmembers(*args, **kwargs)

def _get_callable_set(namespace, visited_obj_set, verbose):
    """
    :param namespace: Module or class
    """
    log_f = info if verbose else debug
    callable_pool = set()

    if id(namespace) in visited_obj_set:
        return callable_pool
    else:
        visited_obj_set.add(id(namespace))

    attributes = [
        callable_
        for name, callable_ in _get_members(
            namespace,
            predicate=callable
        )
    ]
    if isinstance(namespace, type):
        attributes.append(namespace)

    attributes = [
        attr
        for attr in attributes
        if (
            id(attr) not in visited_obj_set and
            # skip internal classes that may end up being exposed as a global
            inspect.getmodule(attr) is not engine
        )
    ]
    visited_obj_set.update(attributes)

    for callable_ in attributes:
        # Explore the class attributes as well for nested types
        if (
            isinstance(callable_, type) and
            # Do not recurse into the "_type" class attribute of namedtuple, as
            # it has broken globals Python 3.6. The crazy checks are a
            # workaround the fact that there is no direct way to detect if a
            # class is a namedtuple.
            not (
                isinstance(namespace, type) and
                callable_.__name__ == '_type' and
                issubclass(callable_, tuple) and
                hasattr(callable_, '_make') and
                hasattr(callable_, '_asdict') and
                hasattr(callable_, '_replace')
            )
        ):
            callable_pool.update(
                _get_callable_set(callable_, visited_obj_set, verbose)
            )

        # Functions defined in a class are methods, and have to be wrapped so
        # engine.Operator() can correctly resolve annotations using the class
        # attributes as a context in which the function was defined.
        #
        # Note that we also wrap things like classmethod, as they have the same
        # needs
        if (
            isinstance(namespace, type) and
            isinstance(
                callable_,
                (
                    # Instance and static methods
                    types.FunctionType,
                    # Class methods
                    types.MethodType,
                )
            )
        ):
            callable_ = engine.UnboundMethod(callable_, namespace)

        try:
            op = engine.Operator(callable_)
            # Trigger exceptions if they have to be raised
            op.prototype
        # If the callable is partially annotated, warn about it since it is
        # likely to be a mistake.
        except engine.PartialAnnotationError as e:
            log_f('Partially-annotated callable "{callable}" will not be used: {e}'.format(
                callable=get_name(callable_),
                e=e,
            ))
            continue
        # If some annotations fail to resolve
        except NameError as e:
            log_f('callable "{callable}" with unresolvable annotations will not be used: {e}'.format(
                callable=get_name(callable_),
                e=e,
            ))
            continue
        # If something goes wrong, that means it is not properly annotated
        # so we just ignore it
        except (SyntaxError, AttributeError, ValueError, KeyError, engine.AnnotationError):
            continue

        def has_typevar(op):
            return any(
                isinstance(x, typing.TypeVar)
                for x in {op.value_type, *op.prototype[0].values()}
            )

        def check_typevar_name(cls, name, var):
            if name != var.__name__:
                log_f('__name__ of {cls}.{var.__name__} typing.TypeVar differs from the name it is bound to "{name}", which will prevent using it for polymorphic parameters or return annotation'.format(
                    cls=get_name(cls, full_qual=True),
                    var=var,
                    name=name,
                ))
            return name

        type_vars = sorted(
            check_typevar_name(op.value_type, name, attr)
            for name, attr in _get_members(
                op.value_type,
                lambda x: isinstance(x, typing.TypeVar)
            )
        )

        # Also make sure we don't accidentally get callables that will
        # return a abstract base class instance, since that would not work
        # anyway.
        if inspect.isabstract(op.value_type):
            log_f('Instances of {} will not be created since it has non-implemented abstract methods'.format(
                get_name(op.value_type, full_qual=True)
            ))
        elif type_vars:
            log_f('Instances of {} will not be created since it has non-overridden TypeVar class attributes: {}'.format(
                get_name(op.value_type, full_qual=True),
                ', '.join(type_vars)
            ))
        elif has_typevar(op):
            log_f('callable "{callable}" with non-resolved associated TypeVar annotations will not be used'.format(
                callable=get_name(callable_),
            ))
        else:
            callable_pool.add(callable_)

    return callable_pool

def sweep_param(callable_, param, start, stop, step=1):
    """
    Used to generate a stream of numbers or strings to feed to a callable.

    :param callable_: Callable the numbers will be used by.
    :type callable_: collections.abc.Callable

    :param param: Name of the parameter of the callable the numbers will be
        providing values for.
    :type param: str

    :param start: Starting value.
    :type start: str

    :param stop: End value (inclusive)
    :type stop: str

    :param step: Increment step.
    :type step: str

    If ``start == stop``, only that value will be yielded, and it can be of any
    type.

    The type used will either be one that is annotated on the callable, or the
    one from the default value if no annotation is available, or float if no
    default value is found. The value will then be built by passing the string
    to the type as only parameter.
    """

    op = engine.Operator(callable_)
    annot = op.prototype[0]
    try:
        type_ = annot[param]
    except KeyError:
        sig = op.signature
        default = sig.parameters[param].default
        if default is not inspect.Parameter.default and default is not None:
            type_ = type(default)
        else:
            type_ = str

    if start == stop:
        yield type_(start)
    else:
        i = type_(start)
        step = type_(step)
        stop = type_(stop)
        while i <= stop:
            yield type_(i)
            i += step

def get_method_class(function):
    """
    Get the class in which a ``function`` is defined.
    """
    # Unbound instance methods
    if isinstance(function, engine.UnboundMethod):
        return function.cls

    try:
        obj = function.__self__
    except AttributeError:
        cls_name = function.__qualname__.rsplit('.', 1)[0]
        if '<locals>' in cls_name:
            return None
        else:
            return eval(cls_name, function.__globals__)
    else:
        # bound class methods
        if isinstance(obj, type):
            return obj
        # bound instance method
        else:
            return type(obj)


text:
package execution

import (
	"code.google.com/p/go.crypto/ssh"
	"github.com/dancannon/gorethink"
	"github.com/gorilla/websocket"
	"github.com/martini-contrib/render"
	"mussh/resources/command"
	"mussh/resources/server"
	"net/http"
	"sync"
)

type Execution struct {
	Id        string      `gorethink:"id,omitempty" json:"id"`
	Username  string      `json:"username" binding:"required"`
	Password  string      `json:"password" binding:"required"`
	GroupId   string      `json:"groupId" binding:"required"`
	CommandId string      `json:"commandId" binding:"required"`
	Results   []SshResult `json:"results"`
}

type SshResult struct {
	Server  server.Server `json:"server"`
	Output  string        `json:"output"`
	Success bool          `json:"success"`
}

var upgrader = websocket.Upgrader{
	ReadBufferSize:  4096,
	WriteBufferSize: 4096,
	CheckOrigin: func(r *http.Request) bool {
		return true
	},
}

func Get(rw http.ResponseWriter, rq *http.Request, session *gorethink.Session, r render.Render) {
	ws, err := upgrader.Upgrade(rw, rq, nil)
	if err != nil {
		r.Status(http.StatusBadRequest)
	}
	defer ws.Close()

	var exe Execution
	if err = ws.ReadJSON(&exe); err != nil {
		r.Status(http.StatusBadRequest)
	}

	handleRequest(session, exe, ws)
}

func handleRequest(session *gorethink.Session, exe Execution, ws *websocket.Conn) {
	servers := getServers(session, exe.GroupId)
	cmd := getCommand(session, exe.CommandId)
	config := getConfig(exe)

	done := make(chan struct{})
	go func() {
		defer close(done)
		ws.ReadMessage()
	}()

	sshResultChans := make([]<-chan SshResult, len(servers))
	for i, svr := range servers {
		sshResultChans[i] = runCommand(svr, cmd, config, done)
	}

	output := merge(sshResultChans...)
	for sshResult := range output {
		err := ws.WriteJSON(sshResult)
		if err != nil {
			return
		}
	}
}

func merge(chans ...<-chan SshResult) <-chan SshResult {
	var wg sync.WaitGroup
	out := make(chan SshResult)
	wg.Add(len(chans))

	for _, c := range chans {
		go func(c <-chan SshResult) {
			for n := range c {
				out <- n
			}
			wg.Done()
		}(c)
	}

	go func() {
		defer close(out)
		wg.Wait()
	}()

	return out
}

func getServers(session *gorethink.Session, groupId string) []server.Server {
	rows, _ := gorethink.Table("server").Filter(
		func(serverTerm gorethink.Term) gorethink.Term {
			return serverTerm.Field("GroupIds").Contains(groupId)
		}).Run(session)
	var servers []server.Server
	rows.All(&servers)
	return servers
}

func getCommand(session *gorethink.Session, commandId string) command.Command {
	row, _ := gorethink.Table("command").Get(commandId).Run(session)
	var command command.Command
	row.One(&command)
	return command
}

func getConfig(exe Execution) *ssh.ClientConfig {
	return &ssh.ClientConfig{
		User: exe.Username,
		Auth: []ssh.AuthMethod{
			ssh.Password(exe.Password),
		},
	}
}


text:
<?php

namespace Reform\Form\Renderer;

use Reform\Form\Row\AbstractRow;
use Reform\Helper\Html;

/**
 * BootstrapRenderer
 *
 * @author Glynn Forrest <me@glynnforrest.com>
 **/
class BootstrapRenderer implements RendererInterface
{
    public function row(AbstractRow $row, $use_label = true)
    {
        $html = $row->input($this);

        if ($use_label) {
            $html = Html::label($row->getName(), $row->getLabel()).$html;
        }

        $error = $row->getError($this);
        if ($error) {
            $html .= sprintf('
%s
', $error);

            return Html::tag('div', $html, array('class' => 'form-group has-error'));
        }

        return Html::tag('div', $html, array('class' => 'form-group'));
    }

    public function input($type, $name, $value = null, array $attributes = array())
    {
        if ($type === 'submit') {
            //check for a btn (or button-type for compat with others?)
            //attribute, apply if it's set (primary, success, danger)
            //and unset from attributes
            $attributes = Html::addToAttributeArray($attributes, 'class', 'btn btn-primary');
        } else {
            $attributes = Html::addToAttributeArray($attributes, 'class', 'form-control');
        }

        return Html::input($type, $name, $value, $attributes);
    }

    public function select($name, array $values, $selected = null, $multiple = false, array $attributes = array())
    {
        $attributes = Html::addToAttributeArray($attributes, 'class', 'form-control');

        return Html::select($name, $values, $selected, $multiple, $attributes);
    }
}


text: The partials go here


text:
#ifndef MYCONNPY_EXCEPTIONS_H
#define MYCONNPY_EXCEPTIONS_H

#include <Python.h>

void raise_with_session(MYSQL *conn, PyObject *exc_type);
void raise_with_string(PyObject *error_msg, PyObject *exc_type);
void raise_with_stmt(MYSQL_STMT *stmt, PyObject *exc_type);

#endif /* MYCONNPY_EXCEPTIONS_H */


text:
<DOCTYPE html>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <title>3digiprints - About Us.</title>

    <link href="/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
    <link href="/css/anime.css" type="text/css" rel="stylesheet" media="screen,projection"/>

      <div class = "mar20 brand-logo center"

Home

3d printers

3d materials

Services

Support

Company

Blog

Contact Us

The 3digiprints Story

  Our story will be seen here.
  Our story will be seen here.
  Our story will be seen here.
  Our story will be seen here.
  Our story will be seen here.

This is our big Tagline!

Here's our small slogan.

Left Aligned Caption

Here's our small slogan.

Right Aligned Caption

Here's our small slogan.

This is our big Tagline!

Here's our small slogan.

Meet The Team

        Card Title

I am a very simple card. I am good at containing small bits of information.

        This is a link
        This is a link

        Card Title

I am a very simple card. I am good at containing small bits of information
.

        This is a link
        This is a link

        Card Title

I am a very simple card. I am good at containing small bits of information.

        This is a link
        This is a link

Contact Us For Your 3d Printing project.

You can use rows and columns here to organize your footer content.

Home

3D Printers

3D Materials

Services

Support

Company

Blog

Contact Us

          © 2015 Copyright 3digiprints


text:
param(
[string]$resourcegroup,
[string]$subscriptionname
)

$cred = Get-AutomationPSCredential -Name "AzureAutomation"
Login-AzureRmAccount -Credential $cred -SubscriptionName $subscriptionname -TenantId 72f988bf-86f1-41af-91ab-2d7cd011db47

function get-priorityvms
{
param($resourcegroup,
$a)

   get-azurermvm -ResourceGroupName $resourcegroup | select Name,ResourceGroupName,Tags | ForEach-Object {
        if ($_.tags.Keys -contains "Priority" -and $_.tags.Values -eq $a) {
            Write-Output $_
            }
        }
}

function Stop-Vms
{
param ($vms,
$resourcegroup)

    $stopoutput = stop-azurermvm -Name $vms.Name -ResourceGroupName $resourcegroup -Force
    Write-Output "Stopping VM : $vm.Name"

}

$vms = get-priorityvms $resourcegroup "9"
foreach ($vm in $vms) { Stop-VMs $vm $resourcegroup }
$vms = get-priorityvms $resourcegroup "2"
foreach ($vm in $vms) { Stop-VMs $vm $resourcegroup }
$vms = get-priorityvms $resourcegroup "1"
foreach ($vm in $vms) { Stop-VMs $vm $resourcegroup }
$vms = get-priorityvms $resourcegroup "0"
foreach ($vm in $vms) { Stop-VMs $vm $resourcegroup }


text:
#include "directoryvalue.hpp"

#include <kdbhelper.h>

using std::exception;
using std::range_error;

using elektra::DirectoryValueDelegate;

using CppKey = kdb::Key;
using CppKeySet = kdb::KeySet;

namespace
{

/**
 * @brief This function returns a key set containing the plugin contract.
 *
 * @return A key set specifying the capabilities of the plugin
 */
CppKeySet getContract ()
{
	return CppKeySet{ 30,
			  keyNew ("system/elektra/modules/directoryvalue", KEY_VALUE, "directoryvalue plugin waits for your orders",
				  KEY_END),
			  keyNew ("system/elektra/modules/directoryvalue/exports", KEY_END),
			  keyNew ("system/elektra/modules/directoryvalue/exports/open", KEY_FUNC, elektraDirectoryValueOpen, KEY_END),
			  keyNew ("system/elektra/modules/directoryvalue/exports/close", KEY_FUNC, elektraDirectoryValueClose, KEY_END),
			  keyNew ("system/elektra/modules/directoryvalue/exports/get", KEY_FUNC, elektraDirectoryValueGet, KEY_END),
			  keyNew ("system/elektra/modules/directoryvalue/exports/set", KEY_FUNC, elektraDirectoryValueSet, KEY_END),
#include ELEKTRA_README (directoryvalue)
			  keyNew ("system/elektra/modules/directoryvalue/infos/version", KEY_VALUE, PLUGINVERSION, KEY_END),
			  KS_END };
}

} // end namespace

extern "C" {

typedef Delegator<DirectoryValueDelegate> delegator;

/** @see elektraDocOpen */
int elektraDirectoryValueOpen (Plugin * handle, Key * key)
{
	return delegator::open (handle, key);
}

/** @see elektraDocClose */
int elektraDirectoryValueClose (Plugin * handle, Key * key)
{
	return delegator::close (handle, key);
}

/** @see elektraDocGet */
int elektraDirectoryValueGet (Plugin * handle, KeySet * returned, Key * parentKey)
{
	CppKeySet keys{ returned };
	CppKey parent{ parentKey };

	if (parent.getName () == "system/elektra/modules/directoryvalue")
	{
		keys.append (getContract ());
		parent.release ();
		keys.release ();
		return ELEKTRA_PLUGIN_STATUS_SUCCESS;
	}

	int status = ELEKTRA_PLUGIN_STATUS_ERROR;
	try
	{
		status = delegator::get (handle)->convertToDirectories (keys);
	}
	catch (range_error const & error)
	{
		ELEKTRA_SET_ERROR (ELEKTRA_ERROR_DIRECTORY_VALUE_ARRAY, *parent, error.what ());
	}
	catch (exception const & error)
	{
		ELEKTRA_SET_ERROR (ELEKTRA_ERROR_UNCAUGHT_EXCEPTION, *parent, error.what ());
	}

#ifdef HAVE_LOGGER
	for (auto key : keys)
	{
		ELEKTRA_LOG_DEBUG ("\t"%s": "%s"", key.getName ().c_str (),
				   key.getBinarySize () == 0 ? "NULL" : key.isBinary () ? "binary value!" : key.getString ().c_str ());
	}
#endif

	parent.release ();
	keys.release ();
	return status;
}

/** @see elektraDocSet */
int elektraDirectoryValueSet (Plugin * handle, KeySet * returned, Key * parentKey)
{
	CppKeySet keys{ returned };
	CppKey parent{ parentKey };

	int status = ELEKTRA_PLUGIN_STATUS_ERROR;
	try
	{
		status = delegator::get (handle)->convertToLeaves (keys);
	}
	catch (range_error const & error)
	{
		ELEKTRA_SET_ERROR (ELEKTRA_ERROR_DIRECTORY_VALUE_ARRAY, *parent, error.what ());
	}
	catch (exception const & error)
	{
		ELEKTRA_SET_ERROR (ELEKTRA_ERROR_UNCAUGHT_EXCEPTION, *parent, error.what ());
	}

	parent.release ();
	keys.release ();
	return status;
}

Plugin * ELEKTRA_PLUGIN_EXPORT (directoryvalue)
{
	// clang-format off
	return elektraPluginExport ("directoryvalue",
		ELEKTRA_PLUGIN_OPEN,	&elektraDirectoryValueOpen,
		ELEKTRA_PLUGIN_CLOSE,	&elektraDirectoryValueClose,
		ELEKTRA_PLUGIN_GET,	&elektraDirectoryValueGet,
		ELEKTRA_PLUGIN_SET,	&elektraDirectoryValueSet,
		ELEKTRA_PLUGIN_END);
}

} // end extern "C"


text:
<?php

namespace lukisongroup\email\controllers;

use Yii;
use yii\web\Controller;

class MailComposerController extends Controller
{
	/**
     * Before Action Index
     */
	public function beforeAction(){
			if (Yii::$app->user->isGuest)  {
				 Yii::$app->user->logout();
                   $this->redirect(array('/site/login'));  //
			}
            // Check only when the user is logged in
            if (!Yii::$app->user->isGuest)  {
               if (Yii::$app->session['userSessionTimeout']< time() ) {
                   // timeout
                   Yii::$app->user->logout();
                   $this->redirect(array('/site/login'));  //
               } else {
                   //Yii::$app->user->setState('userSessionTimeout', time() + Yii::app()->params['sessionTimeoutSeconds']) ;
				   Yii::$app->session->set('userSessionTimeout', time() + Yii::$app->params['sessionTimeoutSeconds']);
                   return true;
               }
            } else {
                return true;
            }
    }

    public function actionIndex()
    {
        return $this->render('index');
    }
}


text:
import {AdditiveBlending, Color, FrontSide, ShaderMaterial} from "three";

const atmosphereShader = require('../glsl/atmosphere.shader');

const AtmosphereMaterial = () => {
    // create custom material from the shader code above
    //   that is within specially labeled script tags
    return new ShaderMaterial({
        uniforms: {
            coeficient	: {
                type	: "f",
                value	: 0.5
            },
            power		: {
                type	: "f",
                value	: 2
            },
            glowColor	: {
                type	: "c",
                value	: new Color('red')
            },
        },
        vertexShader	: atmosphereShader.vertex,
        fragmentShader	: atmosphereShader.fragment,
        side		: FrontSide,
        blending	: AdditiveBlending,
        transparent	: true,
        depthWrite	: false,
        overdraw: true
    });
};

export default AtmosphereMaterial;


text:
package com.sequenceiq.cloudbreak.template.views;

import com.sequenceiq.cloudbreak.template.model.HdfConfigs;

public class HdfConfigView {

    private final String nodeEntities;

    private final String registryNodeEntities;

    private final String nodeUserEntities;

    private final String proxyHosts;

    public HdfConfigView(HdfConfigs hdfConfigs) {
        nodeEntities = hdfConfigs.getNodeEntities();
        proxyHosts = hdfConfigs.getProxyHosts().orElse(null);
        registryNodeEntities = hdfConfigs.getRegistryNodeEntities();
        nodeUserEntities = hdfConfigs.getNodeUserEntities();
    }

    public String getNodeEntities() {
        return nodeEntities;
    }

    public String getRegistryNodeEntities() {
        return registryNodeEntities;
    }

    public String getNodeUserEntities() {
        return nodeUserEntities;
    }

    public String getProxyHosts() {
        return proxyHosts;
    }
}


text:
- [Config option `focus_on` didn't filter match list](https://github.com/fewieden/MMM-NFL/issues/55)

### Removed

- TravisCI integration

## 1.3.0

MagicMirror² version >= 2.15.0 required.

### Added

* Nunjuck templates
* Remote team logos
* Readded live game fetching
* More statistic types
* Integrated MagicMirror logger on server side
* Integrated [MMM-Modal](https://github.com/fewieden/MMM-Modal)
* Implemented suspend, resume and stop behavior
* Added instructions for global config options
* Github actions: `changelog` and `build`
* Github config files

### Changed

* Data structure
* Dimmed bye week
* Project config files
* Dependency updates
* Preview pictures

### Removed

* API provider: NFL XML API
* Local team logos
* Config option: `helmets`

## [1.2.1]

### Added

* Ball possession support for API provider ESPN
* Redzone support for API provider ESPN

### Fixed

* Ball possession team if config option `reverseTeams` is set to `false`

## [1.2.0]

### Added

* New API provider: ESPN

## [1.1.1]

### Fixed

* Bye week translation https://github.com/fewieden/MMM-NFL/issues/37

## [1.1.0]

### Fixed

* Data source
* Installation instructions

### Added

* Config option `tableSize` to specify font size of table.
* Config option `reverseTeams` to invert the display order of home and away team.
* Display of week in header.
* package-lock.json
* Pro bowl mode

### Changed

* Updated icons
* Start in regular mode

### Removed

* team renaming

## [1.0.0]

Initial version


text:
package org.eclipse.tm4e.core.internal.css;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.tm4e.core.theme.IStyle;
import org.eclipse.tm4e.core.theme.RGB;
import org.eclipse.tm4e.core.theme.css.CSSStyle;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.DocumentHandler;
import org.w3c.css.sac.InputSource;
import org.w3c.css.sac.LexicalUnit;
import org.w3c.css.sac.SACMediaList;
import org.w3c.css.sac.SelectorList;
import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.RGBColor;

public class CSSDocumentHandler implements DocumentHandler {

	private final List<IStyle> list;
	private CSSStyle currentStyle;

	public CSSDocumentHandler() {
		list = new ArrayList<>();
	}

	@Override
	public void comment(String arg0) throws CSSException {

	}

	@Override
	public void endDocument(InputSource arg0) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void endFontFace() throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void endMedia(SACMediaList arg0) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void endPage(String arg0, String arg1) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void endSelector(SelectorList selector) throws CSSException {
		currentStyle = null;
	}

	@Override
	public void ignorableAtRule(String arg0) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void importStyle(String arg0, SACMediaList arg1, String arg2) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void namespaceDeclaration(String arg0, String arg1) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void property(String name, LexicalUnit value, boolean arg2) throws CSSException {
		if (currentStyle != null) {
			if ("color".equals(name)) {
				currentStyle.setColor(createRGB(value));
			} else if ("background-color".equals(name)) {
				currentStyle.setBackgroundColor(createRGB(value));
			} else if ("font-weight".equals(name)) {
				currentStyle.setBold(value.getStringValue().toUpperCase().contains("BOLD"));
			} else if ("font-style".equals(name)) {
				currentStyle.setItalic(value.getStringValue().toUpperCase().contains("ITALIC"));
			}
			if ("text-decoration".equals(name)) {
				String decoration = value.getStringValue().toUpperCase();
				if (decoration.contains("UNDERLINE")) {
					currentStyle.setUnderline(true);
				}
				if (decoration.contains("LINE-THROUGH")) {
					currentStyle.setStrikeThrough(true);
				}
			}
		}
	}

	private RGB createRGB(LexicalUnit value) {
		RGBColor rgbColor = new RGBColorImpl(value);
		int green = ((int) rgbColor.getGreen().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
		int red = ((int) rgbColor.getRed().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
		int blue = ((int) rgbColor.getBlue().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
		return new RGB(red, green, blue);
	}

	@Override
	public void startDocument(InputSource arg0) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void startFontFace() throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void startMedia(SACMediaList arg0) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void startPage(String arg0, String arg1) throws CSSException {
		// TODO Auto-generated method stub

	}

	@Override
	public void startSelector(SelectorList selector) throws CSSException {
		currentStyle = new CSSStyle(selector);
		list.add(currentStyle);
	}

	public List<IStyle> getList() {
		return list;
	}
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: POGOProtos/Networking/Responses/UseItemCaptureResponse.proto

package POGOProtos.Networking.Responses;

public final class UseItemCaptureResponseOuterClass {
  private UseItemCaptureResponseOuterClass() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface UseItemCaptureResponseOrBuilder extends
      // @@protoc_insertion_point(interface_extends:POGOProtos.Networking.Responses.UseItemCaptureResponse)
      com.google.protobuf.MessageOrBuilder {

    /**
     * optional bool success = 1;
     */
    boolean getSuccess();

    /**
     * optional double item_capture_mult = 2;
     */
    double getItemCaptureMult();

    /**
     * optional double item_flee_mult = 3;
     */
    double getItemFleeMult();

    /**
     * optional bool stop_movement = 4;
     */
    boolean getStopMovement();

    /**
     * optional bool stop_attack = 5;
     */
    boolean getStopAttack();

    /**
     * optional bool target_max = 6;
     */
    boolean getTargetMax();

    /**
     * optional bool target_slow = 7;
     */
    boolean getTargetSlow();
  }
  /**
   * Protobuf type {@code POGOProtos.Networking.Responses.UseItemCaptureResponse}
   */
  public  static final class UseItemCaptureResponse extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:POGOProtos.Networking.Responses.UseItemCaptureResponse)
      UseItemCaptureResponseOrBuilder {
    // Use UseItemCaptureResponse.newBuilder() to construct.
    private UseItemCaptureResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private UseItemCaptureResponse() {
      success_ = false;
      itemCaptureMult_ = 0D;
      itemFleeMult_ = 0D;
      stopMovement_ = false;
      stopAttack_ = false;
      targetMax_ = false;
      targetSlow_ = false;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private UseItemCaptureResponse(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              success_ = input.readBool();
              break;
            }
            case 17: {

              itemCaptureMult_ = input.readDouble();
              break;
            }
            case 25: {

              itemFleeMult_ = input.readDouble();
              break;
            }
            case 32: {

              stopMovement_ = input.readBool();
              break;
            }
            case 40: {

              stopAttack_ = input.readBool();
              break;
            }
            case 48: {

              targetMax_ = input.readBool();
              break;
            }
            case 56: {

              targetSlow_ = input.readBool();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.class, POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.Builder.class);
    }

    public static final int SUCCESS_FIELD_NUMBER = 1;
    private boolean success_;
    /**
     * optional bool success = 1;
     */
    public boolean getSuccess() {
      return success_;
    }

    public static final int ITEM_CAPTURE_MULT_FIELD_NUMBER = 2;
    private double itemCaptureMult_;
    /**
     * optional double item_capture_mult = 2;
     */
    public double getItemCaptureMult() {
      return itemCaptureMult_;
    }

    public static final int ITEM_FLEE_MULT_FIELD_NUMBER = 3;
    private double itemFleeMult_;
    /**
     * optional double item_flee_mult = 3;
     */
    public double getItemFleeMult() {
      return itemFleeMult_;
    }

    public static final int STOP_MOVEMENT_FIELD_NUMBER = 4;
    private boolean stopMovement_;
    /**
     * optional bool stop_movement = 4;
     */
    public boolean getStopMovement() {
      return stopMovement_;
    }

    public static final int STOP_ATTACK_FIELD_NUMBER = 5;
    private boolean stopAttack_;
    /**
     * optional bool stop_attack = 5;
     */
    public boolean getStopAttack() {
      return stopAttack_;
    }

    public static final int TARGET_MAX_FIELD_NUMBER = 6;
    private boolean targetMax_;
    /**
     * optional bool target_max = 6;
     */
    public boolean getTargetMax() {
      return targetMax_;
    }

    public static final int TARGET_SLOW_FIELD_NUMBER = 7;
    private boolean targetSlow_;
    /**
     * optional bool target_slow = 7;
     */
    public boolean getTargetSlow() {
      return targetSlow_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (success_ != false) {
        output.writeBool(1, success_);
      }
      if (itemCaptureMult_ != 0D) {
        output.writeDouble(2, itemCaptureMult_);
      }
      if (itemFleeMult_ != 0D) {
        output.writeDouble(3, itemFleeMult_);
      }
      if (stopMovement_ != false) {
        output.writeBool(4, stopMovement_);
      }
      if (stopAttack_ != false) {
        output.writeBool(5, stopAttack_);
      }
      if (targetMax_ != false) {
        output.writeBool(6, targetMax_);
      }
      if (targetSlow_ != false) {
        output.writeBool(7, targetSlow_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (success_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(1, success_);
      }
      if (itemCaptureMult_ != 0D) {
        size += com.google.protobuf.CodedOutputStream
          .computeDoubleSize(2, itemCaptureMult_);
      }
      if (itemFleeMult_ != 0D) {
        size += com.google.protobuf.CodedOutputStream
          .computeDoubleSize(3, itemFleeMult_);
      }
      if (stopMovement_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(4, stopMovement_);
      }
      if (stopAttack_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(5, stopAttack_);
      }
      if (targetMax_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(6, targetMax_);
      }
      if (targetSlow_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(7, targetSlow_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse)) {
        return super.equals(obj);
      }
      POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse other = (POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse) obj;

      boolean result = true;
      result = result && (getSuccess()
          == other.getSuccess());
      result = result && (
          java.lang.Double.doubleToLongBits(getItemCaptureMult())
          == java.lang.Double.doubleToLongBits(
              other.getItemCaptureMult()));
      result = result && (
          java.lang.Double.doubleToLongBits(getItemFleeMult())
          == java.lang.Double.doubleToLongBits(
              other.getItemFleeMult()));
      result = result && (getStopMovement()
          == other.getStopMovement());
      result = result && (getStopAttack()
          == other.getStopAttack());
      result = result && (getTargetMax()
          == other.getTargetMax());
      result = result && (getTargetSlow()
          == other.getTargetSlow());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptorForType().hashCode();
      hash = (37 * hash) + SUCCESS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getSuccess());
      hash = (37 * hash) + ITEM_CAPTURE_MULT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          java.lang.Double.doubleToLongBits(getItemCaptureMult()));
      hash = (37 * hash) + ITEM_FLEE_MULT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          java.lang.Double.doubleToLongBits(getItemFleeMult()));
      hash = (37 * hash) + STOP_MOVEMENT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getStopMovement());
      hash = (37 * hash) + STOP_ATTACK_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getStopAttack());
      hash = (37 * hash) + TARGET_MAX_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getTargetMax());
      hash = (37 * hash) + TARGET_SLOW_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getTargetSlow());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code POGOProtos.Networking.Responses.UseItemCaptureResponse}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:POGOProtos.Networking.Responses.UseItemCaptureResponse)
        POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponseOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.class, POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.Builder.class);
      }

      // Construct using POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        success_ = false;

        itemCaptureMult_ = 0D;

        itemFleeMult_ = 0D;

        stopMovement_ = false;

        stopAttack_ = false;

        targetMax_ = false;

        targetSlow_ = false;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor;
      }

      public POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse getDefaultInstanceForType() {
        return POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.getDefaultInstance();
      }

      public POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse build() {
        POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse buildPartial() {
        POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse result = new POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse(this);
        result.success_ = success_;
        result.itemCaptureMult_ = itemCaptureMult_;
        result.itemFleeMult_ = itemFleeMult_;
        result.stopMovement_ = stopMovement_;
        result.stopAttack_ = stopAttack_;
        result.targetMax_ = targetMax_;
        result.targetSlow_ = targetSlow_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse) {
          return mergeFrom((POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse other) {
        if (other == POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse.getDefaultInstance()) return this;
        if (other.getSuccess() != false) {
          setSuccess(other.getSuccess());
        }
        if (other.getItemCaptureMult() != 0D) {
          setItemCaptureMult(other.getItemCaptureMult());
        }
        if (other.getItemFleeMult() != 0D) {
          setItemFleeMult(other.getItemFleeMult());
        }
        if (other.getStopMovement() != false) {
          setStopMovement(other.getStopMovement());
        }
        if (other.getStopAttack() != false) {
          setStopAttack(other.getStopAttack());
        }
        if (other.getTargetMax() != false) {
          setTargetMax(other.getTargetMax());
        }
        if (other.getTargetSlow() != false) {
          setTargetSlow(other.getTargetSlow());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private boolean success_ ;
      /**
       * optional bool success = 1;
       */
      public boolean getSuccess() {
        return success_;
      }
      /**
       * optional bool success = 1;
       */
      public Builder setSuccess(boolean value) {

        success_ = value;
        onChanged();
        return this;
      }
      /**
       * optional bool success = 1;
       */
      public Builder clearSuccess() {

        success_ = false;
        onChanged();
        return this;
      }

      private double itemCaptureMult_ ;
      /**
       * optional double item_capture_mult = 2;
       */
      public double getItemCaptureMult() {
        return itemCaptureMult_;
      }
      /**
       * optional double item_capture_mult = 2;
       */
      public Builder setItemCaptureMult(double value) {

        itemCaptureMult_ = value;
        onChanged();
        return this;
      }
      /**
       * optional double item_capture_mult = 2;
       */
      public Builder clearItemCaptureMult() {

        itemCaptureMult_ = 0D;
        onChanged();
        return this;
      }

      private double itemFleeMult_ ;
      /**
       * optional double item_flee_mult = 3;
       */
      public double getItemFleeMult() {
        return itemFleeMult_;
      }
      /**
       * optional double item_flee_mult = 3;
       */
      public Builder setItemFleeMult(double value) {

        itemFleeMult_ = value;
        onChanged();
        return this;
      }
      /**
       * optional double item_flee_mult = 3;
       */
      public Builder clearItemFleeMult() {

        itemFleeMult_ = 0D;
        onChanged();
        return this;
      }

      private boolean stopMovement_ ;
      /**
       * optional bool stop_movement = 4;
       */
      public boolean getStopMovement() {
        return stopMovement_;
      }
      /**
       * optional bool stop_movement = 4;
       */
      public Builder setStopMovement(boolean value) {

        stopMovement_ = value;
        onChanged();
        return this;
      }
      /**
       * optional bool stop_movement = 4;
       */
      public Builder clearStopMovement() {

        stopMovement_ = false;
        onChanged();
        return this;
      }

      private boolean stopAttack_ ;
      /**
       * optional bool stop_attack = 5;
       */
      public boolean getStopAttack() {
        return stopAttack_;
      }
      /**
       * optional bool stop_attack = 5;
       */
      public Builder setStopAttack(boolean value) {

        stopAttack_ = value;
        onChanged();
        return this;
      }
      /**
       * optional bool stop_attack = 5;
       */
      public Builder clearStopAttack() {

        stopAttack_ = false;
        onChanged();
        return this;
      }

      private boolean targetMax_ ;
      /**
       * optional bool target_max = 6;
       */
      public boolean getTargetMax() {
        return targetMax_;
      }
      /**
       * optional bool target_max = 6;
       */
      public Builder setTargetMax(boolean value) {

        targetMax_ = value;
        onChanged();
        return this;
      }
      /**
       * optional bool target_max = 6;
       */
      public Builder clearTargetMax() {

        targetMax_ = false;
        onChanged();
        return this;
      }

      private boolean targetSlow_ ;
      /**
       * optional bool target_slow = 7;
       */
      public boolean getTargetSlow() {
        return targetSlow_;
      }
      /**
       * optional bool target_slow = 7;
       */
      public Builder setTargetSlow(boolean value) {

        targetSlow_ = value;
        onChanged();
        return this;
      }
      /**
       * optional bool target_slow = 7;
       */
      public Builder clearTargetSlow() {

        targetSlow_ = false;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      // @@protoc_insertion_point(builder_scope:POGOProtos.Networking.Responses.UseItemCaptureResponse)
    }

    // @@protoc_insertion_point(class_scope:POGOProtos.Networking.Responses.UseItemCaptureResponse)
    private static final POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse();
    }

    public static POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<UseItemCaptureResponse>
        PARSER = new com.google.protobuf.AbstractParser<UseItemCaptureResponse>() {
      public UseItemCaptureResponse parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new UseItemCaptureResponse(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<UseItemCaptureResponse> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<UseItemCaptureResponse> getParserForType() {
      return PARSER;
    }

    public POGOProtos.Networking.Responses.UseItemCaptureResponseOuterClass.UseItemCaptureResponse getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor;
  private static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n<POGOProtos/Networking/Responses/UseIte" +
      "mCaptureResponse.proto\022\037POGOProtos.Netwo" +
      "rking.Responses\"\261\001\n\026UseItemCaptureRespon" +
      "se\022\017\n\007success\030\001 \001(\010\022\031\n\021item_capture_mult" +
      "\030\002 \001(\001\022\026\n\016item_flee_mult\030\003 \001(\001\022\025\n\rstop_m" +
      "ovement\030\004 \001(\010\022\023\n\013stop_attack\030\005 \001(\010\022\022\n\nta" +
      "rget_max\030\006 \001(\010\022\023\n\013target_slow\030\007 \001(\010b\006pro" +
      "to3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
    internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_POGOProtos_Networking_Responses_UseItemCaptureResponse_descriptor,
        new java.lang.String[] { "Success", "ItemCaptureMult", "ItemFleeMult", "StopMovement", "StopAttack", "TargetMax", "TargetSlow", });
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
(function(angular){
    'use strict';

    angular
        .module('mllApp.upload')
        .factory('musicUploadService', musicUploadService);

    musicUploadService.$inject = ['$http', 'musicUrl'];

    function musicUploadService($http, musicUrl) {
        return {
            submitCloud: submitCloud,
            submitDirect: submitDirect
        };

        function submitCloud (data) {
            return $http.post(musicUrl.direct, data);
        }

        function submitDirect(data, fileProp) {
            let fd = new FormData();

            Object.keys(data).forEach((key) =>
                fd.append(key, (key === fileProp) ? data[key] : JSON.stringify(data[key])));

            return $http.post(musicUrl.cloud, fd, {
                transformRequest: angular.identity,
                headers: {
                    'Content-Type': undefined
                }
            });
        }
    }

})(window.angular);


text:
namespace CRE
{
    Entity::Entity(std::string ID, unsigned int order) :
        sf::Drawable(),
        sf::Transformable(),
        _properties(),
        _entityID(ID),
        _order(order)
    {}

    std::string Entity::get_ID() const
    {
        return _entityID;
    }

    void Entity::update(){}

    unsigned int Entity::get_order() const
    {
        return _order;
    }

    void Entity::draw(sf::RenderTarget & target, sf::RenderStates states) const
    {
        states.transform *= getTransform();
    }
}


text:
package com.dataintuitive.luciuscore.api

package object v4 {

  val endpoints = List(
    AnnotatedIds,
    BinnedCorrelation,
    CheckSignature,
    Compounds,
    Correlation,
    Filters,
    Statistics,
    Targets,
    TargetToCompounds,
    TopTable,
    TreatmentToPerturbations
  )
}


text:
package com.jtool.http.exception;

import java.io.IOException;

public class HttpRequestException extends RuntimeException {

	private static final long serialVersionUID = -4167584468866273521L;

	private String url;
	private IOException ioException;

	public HttpRequestException(String url, IOException e) {
		this.url = url;
		this.ioException = e;
	}

	public String getUrl() {
		return url;
	}

	public IOException getIoException() {
		return ioException;
	}

}


text:
@section('content')

Edit @{{ record.name }}

{{ HTML::ul($errors->all()) }}

{{ Form::model($record, array('route' => array('comments.update', $record->sid), 'method' => 'PUT', 'class' => 'form-horizontal')) }}

		{{ Lang::get('comment.uuid') }}

		    <input class="form-control" name="uuid" type="text" value="@{{ record.uuid }}" id="uuid">

		{{ Lang::get('comment.domain_sid') }}

		    <input class="form-control" name="domain_sid" type="text" value="@{{ record.domain_sid }}" id="domain_sid">

		{{ Lang::get('comment.domain_id') }}

		    <input class="form-control" name="domain_id" type="text" value="@{{ record.domain_id }}" id="domain_id">

		{{ Lang::get('comment.created_by') }}

		    <input class="form-control" name="created_by" type="text" value="@{{ record.created_by }}" id="created_by">

		{{ Lang::get('comment.created_dt') }}

		    <input class="form-control" name="created_dt" type="text" value="@{{ record.created_dt }}" id="created_dt">

		{{ Lang::get('comment.updated_by') }}

		    <input class="form-control" name="updated_by" type="text" value="@{{ record.updated_by }}" id="updated_by">

		{{ Lang::get('comment.updated_dt') }}

		    <input class="form-control" name="updated_dt" type="text" value="@{{ record.updated_dt }}" id="updated_dt">

		{{ Lang::get('comment.update_counter') }}

		    <input class="form-control" name="update_counter" type="text" value="@{{ record.update_counter }}" id="update_counter">

		{{ Lang::get('comment.lang') }}

		    <input class="form-control" name="lang" type="text" value="@{{ record.lang }}" id="lang">

		{{ Lang::get('comment.object_type') }}

		    <input class="form-control" name="object_type" type="text" value="@{{ record.object_type }}" id="object_type">

		{{ Lang::get('comment.object_sid') }}

		    <input class="form-control" name="object_sid" type="text" value="@{{ record.object_sid }}" id="object_sid">

		{{ Lang::get('comment.title') }}

		    <input class="form-control" name="title" type="text" value="@{{ record.title }}" id="title">

		{{ Lang::get('comment.content') }}

		    <input class="form-control" name="content" type="text" value="@{{ record.content }}" id="content">

		{{ Lang::get('comment.attachments') }}

		    <input class="form-control" name="attachments" type="text" value="@{{ record.attachments }}" id="attachments">

		{{ Lang::get('comment.privacy_level') }}

		    <input class="form-control" name="privacy_level" type="text" value="@{{ record.privacy_level }}" id="privacy_level">

		{{ Lang::get('comment.params_text') }}

		    <input class="form-control" name="params_text" type="text" value="@{{ record.params_text }}" id="params_text">

	{{ Form::submit('Update', array('class' => 'btn btn-primary')) }}

{{ Form::close() }}

@show


text:
import json
import bcrypt

from flask import Blueprint, request, Response
from flask import jsonify
from flask import request

from ..model import user as user_module
from ..model import host as host_module

module = Blueprint('local', __name__, url_prefix='/local')

mimetypeJson = 'application/json'

@module.route('/')
def index():

	data = [{'nombre': 'nombre {}'.format(i) } for i in range(10)]

	return json.dumps(data)

@module.route('/users/')
def users():

	data = user_module.User.query.all()

	clean_result = [{'user':item.user,'password':item.password,'id':item.id,'created':item.created} for item in data]

	return jsonify(result=clean_result)

@module.route('/users/add/',methods=['POST'])
def user_add():

	values = request.get_json()

	if 'login' not in values or 'password' not in values:
		payload = json.dumps({'error':True,'message':'User and Password are required'})

		res = Response(payload,status=406,mimetype=mimetypeJson)

		return res

	passwordHashed = bcrypt.hashpw(values['password'], bcrypt.gensalt(10))

	user = user_module.User(values['login'],passwordHashed)

	user_module.db.session.add(user)

	try:

		user_module.db.session.commit()

		return json.dumps({'error':False,'message':'success'})
	except Exception, e:
		payload =  json.dumps({'error':True,'message':e.message})

		res = Response(payload,status=501,mimetype=mimetypeJson)

		return res

@module.route('/users/delete/<int:id>/')
def user_delete(id):

	user = user_module.User.query.get(id)

	if user == None:
		payload = json.dumps({'error':True,'message':'User not found {}'.format(id)})
		res = Response(payload,status=404,mimetype='application/json')

		return res

	user_module.db.session.delete(user)

	user_module.db.session.commit()

	return json.dumps({'error':False,'message':'success'})

@module.route('/hosts/')
def hosts():

	data = host_module.Host.query.all()

	clean_result = [{'target':item.target,'port': item.port,'user':item.user,'id':item.id,'created':item.created} for item in data]

	# data = [{'usuario': 'nombre {}'.format(i) } for i in range(10)]

	return jsonify(result=clean_result)

@module.route('/hosts/add/',methods=['POST'])
def host_add():

	values = request.get_json()

	print values

	if 'target' not in values or 'user' not in values or 'password' not in values or 'port' not in values:
		payload = json.dumps({'error':True,'message':'User and target and Host Password are required'})

		res = Response(payload,status=501,mimetype=mimetypeJson)

		return res

	host = host_module.Host(values['target'],values['port'],values['user'],values['password'])

	host_module.db.session.add(host)
	host_module.db.session.commit()

	payload = json.dumps({'error':False,'message':'sucess'})

	return Response(payload,status=200,mimetype=mimetypeJson)

@module.route('/hosts/delete/<int:id>/')
def host_delete(id):

	host = host_module.Host.query.get(id)

	if host == None:
		payload = json.dumps({'error':True,'message':'Host not found {}'.format(id)})
		res = Response(payload,status=404,mimetype=mimetypeJson)

		return res

	host_module.db.session.delete(host)
	host_module.db.session.commit()

	return json.dumps({'error':False,'message':'success'})

@module.route('/stast')
def stats():

	hosts = host_module.Host.query.count()
	users = user_module.User.query.count()

	result = {
		'servers':hosts,
		'users':users
	}

	return json.dumps(result)