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

/**
 * @fileoverview Handles braille input keys when the user is typing or editing
 * text in an input field.  This class cooperates with the Braille IME
 * that is built into Chrome OS to do the actual text editing.
 */

goog.provide('cvox.BrailleInputHandler');

goog.require('StringUtil');
goog.require('cvox.BrailleKeyCommand');
goog.require('cvox.BrailleKeyEvent');
goog.require('cvox.ExpandingBrailleTranslator');

/**
 * @param {!cvox.BrailleTranslatorManager} translatorManager Keeps track of
 *     the current braille translator(s).
 * @constructor
 */
cvox.BrailleInputHandler = function(translatorManager) {
  /**
   * Port of the connected IME if any.
   * @type {Port}
   * @private
   */
  this.imePort_ = null;
  /**
   * {code true} when the Braille IME is connected and has signaled that it is
   * active.
   * @type {boolean}
   * @private
   */
  this.imeActive_ = false;
  /**
   * The input context of the current input field, as reported by the IME.
   * {@code null} if no input field has focus.
   * @type {{contextID: number, type: string}?}
   * @private
   */
  this.inputContext_ = null;
  /**
   * @type {!cvox.BrailleTranslatorManager}
   * @private
   */
  this.translatorManager_ = translatorManager;
  /**
   * Text that currently precedes the first selection end-point.
   * @type {string}
   * @private
   */
  this.currentTextBefore_ = '';
  /**
   * Text that currently follows the last selection end-point.
   * @type {string}
   * @private
   */
  this.currentTextAfter_ = '';
  /**
   * Cells that were entered while the IME wasn't active.  These will be
   * submitted once the IME becomes active and reports the current input field.
   * This is necessary because the IME is activated on the first braille
   * dots command, but we'll receive the command in parallel.  To work around
   * the race, we store the cell entered until we can submit it to the IME.
   * @type {!Array<number>}
   * @private
   */
  this.pendingCells_ = [];
  /**
   * @type {cvox.BrailleInputHandler.EntryState_}
   * @private
   */
  this.entryState_ = null;

  this.translatorManager_.addChangeListener(
      this.clearEntryState_.bind(this));
};

/**
 * The ID of the Braille IME extension built into Chrome OS.
 * @const {string}
 * @private
 */
cvox.BrailleInputHandler.IME_EXTENSION_ID_ =
    'jddehjeebkoimngcbdkaahpobgicbffp';

/**
 * Name of the port to use for communicating with the Braille IME.
 * @const {string}
 * @private
 */
cvox.BrailleInputHandler.IME_PORT_NAME_ = 'cvox.BrailleIme.Port';

/**
 * Regular expression that matches a string that starts with at least one
 * non-whitespace character.
 * @const {RegExp}
 * @private
 */
cvox.BrailleInputHandler.STARTS_WITH_NON_WHITESPACE_RE_ = /^\S/;

/**
 * Regular expression that matches a string that ends with at least one
 * non-whitespace character.
 * @const {RegExp}
 * @private
 */
cvox.BrailleInputHandler.ENDS_WITH_NON_WHITESPACE_RE_ = /\S$/;

cvox.BrailleInputHandler.prototype = {
  /**
   * Starts to listen for connections from the Chrome OS braille IME.
   */
  init: function() {
    chrome.runtime.onConnectExternal.addListener(this.onImeConnect_.bind(this));
  },

  /**
   * Called when the content on the braille display is updated.  Modifies the
   * input state according to the new content.
   * @param {cvox.Spannable} text Text, optionally with value and selection
   *     spans.
   */
  onDisplayContentChanged: function(text) {
    var valueSpan = text.getSpanInstanceOf(cvox.ValueSpan);
    var selectionSpan = text.getSpanInstanceOf(cvox.ValueSelectionSpan);
    if (!(valueSpan && selectionSpan))
      return;
    // The type casts are ok because the spans are known to exist.
    var valueStart = /** @type {number} */ (text.getSpanStart(valueSpan));
    var valueEnd = /** @type {number} */ (text.getSpanEnd(valueSpan));
    var selectionStart =
        /** @type {number} */ (text.getSpanStart(selectionSpan));
    var selectionEnd = /** @type {number} */ (text.getSpanEnd(selectionSpan));
    if (selectionStart < valueStart || selectionEnd > valueEnd) {
      console.error('Selection outside of value in braille content');
      this.clearEntryState_();
      return;
    }
    var newTextBefore = text.toString().substring(valueStart, selectionStart);
    if (this.currentTextBefore_ !== newTextBefore && this.entryState_)
      this.entryState_.onTextBeforeChanged(newTextBefore);
    this.currentTextBefore_ = newTextBefore;
    this.currentTextAfter_ = text.toString().substring(selectionEnd, valueEnd);
  },

  /**
   * Handles braille key events used for input by editing the current input
   * field appropriately.
   * @param {!cvox.BrailleKeyEvent} event The key event.
   * @return {boolean} {@code true} if the event was handled, {@code false}
   *     if it should propagate further.
   */
  onBrailleKeyEvent: function(event) {
    if (event.command === cvox.BrailleKeyCommand.DOTS)
      return this.onBrailleDots_(/** @type {number} */(event.brailleDots));
    // Any other braille command cancels the pending cells.
    this.pendingCells_.length = 0;
    if (event.command === cvox.BrailleKeyCommand.STANDARD_KEY) {
      if (event.standardKeyCode === 'Backspace' &&
          !event.altKey && !event.ctrlKey && !event.shiftKey &&
          this.onBackspace_()) {
        return true;
      } else {
        this.clearEntryState_();
        this.sendKeyEventPair_(event);
        return true;
      }
    }
    return false;
  },

  /**
   * Returns how the value of the currently displayed content should be
   * expanded given the current input state.
   * @return {cvox.ExpandingBrailleTranslator.ExpansionType}
   *     The current expansion type.
   */
  getExpansionType: function() {
    if (this.inAlwaysUncontractedContext_())
      return cvox.ExpandingBrailleTranslator.ExpansionType.ALL;
    if (this.entryState_ &&
        this.entryState_.translator ===
        this.translatorManager_.getDefaultTranslator()) {
      return cvox.ExpandingBrailleTranslator.ExpansionType.NONE;
    }
    return cvox.ExpandingBrailleTranslator.ExpansionType.SELECTION;
  },

  /**
   * @return {boolean} {@code true} if we have an input context and
   *     uncontracted braille should always be used for that context.
   * @private
   */
  inAlwaysUncontractedContext_: function() {
    var inputType = this.inputContext_ ? this.inputContext_.type : '';
    return inputType === 'url' || inputType === 'email';
  },

  /**
   * Called when a user typed a braille cell.
   * @param {number} dots The dot pattern of the cell.
   * @return {boolean} Whether the event was handled or should be allowed to
   *    propagate further.
   * @private
   */
  onBrailleDots_: function(dots) {
    if (!this.imeActive_) {
      this.pendingCells_.push(dots);
      return true;
    }
    if (!this.inputContext_)
      return false;
    // Avoid accumulating cells forever when typing without moving the cursor
    // by flushing the input when we see a blank cell.
    // Note that this might switch to contracted if appropriate.
    if (this.entryState_ && this.entryState_.lastCellIsBlank())
      this.clearEntryState_();
    if (!this.entryState_) {
      this.entryState_ = this.createEntryState_();
      if (!this.entryState_)
        return false;
    }
    this.entryState_.appendCell(dots);
    return true;
  },

  /**
   * Handles the backspace key by deleting the last typed cell if possible.
   * @return {boolean} {@code true} if the event was handled, {@code false}
   *     if it wasn't and should propagate further.
   * @private
   */
  onBackspace_: function() {
    if (this.imeActive_ && this.entryState_) {
      this.entryState_.deleteLastCell();
      return true;
    }
    return false;
  },

  /**
   * Creates a new empty {@code EntryState_} based on the current input context
   * and surrounding text.
   * @return {cvox.BrailleInputHandler.EntryState_} The newly created state
   *     object, or null if it couldn't be created (e.g. if there's no braille
   *     translator available yet).
   * @private
   */
  createEntryState_: function() {
    var translator = this.translatorManager_.getDefaultTranslator();
    if (!translator)
      return null;
    var uncontractedTranslator =
        this.translatorManager_.getUncontractedTranslator();
    if (uncontractedTranslator) {
      var textBefore = this.currentTextBefore_;
      var textAfter = this.currentTextAfter_;
      if (this.inAlwaysUncontractedContext_() ||
          (cvox.BrailleInputHandler.ENDS_WITH_NON_WHITESPACE_RE_.test(
              textBefore)) ||
          (cvox.BrailleInputHandler.STARTS_WITH_NON_WHITESPACE_RE_.test(
              textAfter))) {
        translator = uncontractedTranslator;
      }
    }

    return new cvox.BrailleInputHandler.EditsEntryState_(this, translator);
  },

  /**
   * Clears the current entry state without committing it.
   * @private
   */
  clearEntryState_: function() {
    if (this.entryState_) {
      this.entryState_.inputHandler_ = null;
      this.entryState_ = null;
    }
  },

  /**
   * Called when another extension connects to this extension.  Accepts
   * connections from the ChromeOS builtin Braille IME and ignores connections
   * from other extensions.
   * @param {Port} port The port used to communicate with the other extension.
   * @private
   */
  onImeConnect_: function(port) {
    if (port.name !== cvox.BrailleInputHandler.IME_PORT_NAME_ ||
        port.sender.id !== cvox.BrailleInputHandler.IME_EXTENSION_ID_) {
      return;
    }
    if (this.imePort_)
      this.imePort_.disconnect();
    port.onDisconnect.addListener(this.onImeDisconnect_.bind(this, port));
    port.onMessage.addListener(this.onImeMessage_.bind(this));
    this.imePort_ = port;
  },

  /**
   * Called when a message is received from the IME.
   * @param {*} message The message.
   * @private
   */
  onImeMessage_: function(message) {
    if (!goog.isObject(message)) {
      console.error('Unexpected message from Braille IME: ',
                    JSON.stringify(message));
    }
    switch (message.type) {
      case 'activeState':
        this.imeActive_ = message.active;
        break;
      case 'inputContext':
        this.inputContext_ = message.context;
        this.clearEntryState_();
        if (this.imeActive_ && this.inputContext_)
          this.pendingCells_.forEach(this.onBrailleDots_, this);
        this.pendingCells_.length = 0;
        break;
      case 'brailleDots':
        this.onBrailleDots_(message['dots']);
        break;
      case 'backspace':
        // Note that we can't send the backspace key through the
        // virtualKeyboardPrivate API in this case because it would then be
        // processed by the IME again, leading to an infinite loop.
        this.postImeMessage_(
            {type: 'keyEventHandled', requestId: message['requestId'],
             result: this.onBackspace_()});
        break;
      case 'reset':
        this.clearEntryState_();
        break;
      default:
        console.error('Unexpected message from Braille IME: ',
                      JSON.stringify(message));
      break;
    }
  },

  /**
   * Called when the IME port is disconnected.
   * @param {Port} port The port that was disconnected.
   * @private
   */
  onImeDisconnect_: function(port) {
    this.imePort_ = null;
    this.clearEntryState_();
    this.imeActive_ = false;
    this.inputContext_ = null;
  },

  /**
   * Posts a message to the IME.
   * @param {Object} message The message.
   * @return {boolean} {@code true} if the message was sent, {@code false} if
   *     there was no connection open to the IME.
   * @private
   */
  postImeMessage_: function(message) {
    if (this.imePort_) {
      this.imePort_.postMessage(message);
      return true;
    }
    return false;
  },

  /**
   * Sends a {@code keydown} key event followed by a {@code keyup} event
   * corresponding to an event generated by the braille display.
   * @param {!cvox.BrailleKeyEvent} event The braille key event to base the
   *     key events on.
   * @private
   */
  sendKeyEventPair_: function(event) {
    // Use the virtual keyboard API instead of the IME key event API
    // so that these keys work even if the Braille IME is not active.
    var keyName = /** @type {string} */ (event.standardKeyCode);
    var numericCode = cvox.BrailleKeyEvent.keyCodeToLegacyCode(keyName);
    if (!goog.isDef(numericCode))
      throw Error('Unknown key code in event: ' + JSON.stringify(event));
    var keyEvent = {
      type: 'keydown',
      keyCode: numericCode,
      keyName: keyName,
      charValue: cvox.BrailleKeyEvent.keyCodeToCharValue(keyName),
      // See chrome/common/extensions/api/virtual_keyboard_private.json for
      // these constants.
      modifiers: (event.shiftKey ? 2 : 0) |
          (event.ctrlKey ? 4 : 0) |
          (event.altKey ? 8 : 0)
    };
    chrome.virtualKeyboardPrivate.sendKeyEvent(keyEvent);
    keyEvent.type = 'keyup';
    chrome.virtualKeyboardPrivate.sendKeyEvent(keyEvent);
  }
};

/**
 * The entry state is the state related to entering a series of braille cells
 * without 'interruption', where interruption can be things like non braille
 * keyboard input or unexpected changes to the text surrounding the cursor.
 * @param {!cvox.BrailleInputHandler} inputHandler
 * @param {!cvox.LibLouis.Translator} translator
 * @constructor
 * @private
 */
cvox.BrailleInputHandler.EntryState_ = function(inputHandler, translator) {
  /**
   * @type {cvox.BrailleInputHandler}
   * @private
   */
  this.inputHandler_ = inputHandler;
  /**
   * The translator currently used for typing, if
   * {@code this.cells_.length > 0}.
   * @type {!cvox.LibLouis.Translator}
   * @private
   */
  this.translator_ = translator;
  /**
   * Braille cells that have been typed by the user so far.
   * @type {!Array<number>}
   * @private
   */
  this.cells_ = [];
  /**
   * Text resulting from translating {@code this.cells_}.
   * @type {string}
   * @private
   */
  this.text_ = '';
  /**
   * List of strings that we expect to be set as preceding text of the
   * selection.  This is populated when we send text changes to the IME so that
   * our own changes don't reset the pending cells.
   * @type {!Array<string>}
   * @private
   */
  this.pendingTextsBefore_ = [];
};

cvox.BrailleInputHandler.EntryState_.prototype = {
  /**
   * @return {!cvox.LibLouis.Translator} The translator used by this entry
   *     state.  This doesn't change for a given object.
   */
  get translator() {
    return this.translator_;
  },

  /**
   * Appends a braille cell to the current input and updates the text if
   * necessary.
   * @param {number} cell The braille cell to append.
   */
  appendCell: function(cell) {
    this.cells_.push(cell);
    this.updateText_();
  },

  /**
   * Deletes the last cell of the input and updates the text if neccary.
   * If there's no more input in this object afterwards, clears the entry state
   * of the input handler.
   */
  deleteLastCell: function() {
    if (--this.cells_.length <= 0) {
      this.sendTextChange_('');
      this.inputHandler_.clearEntryState_();
      return;
    }
    this.updateText_();
  },

  /**
   * Called when the text before the cursor changes giving this object a
   * chance to clear the entry state of the input handler if the change
   * wasn't expected.
   * @param {string} newText New text before the cursor.
   */
  onTextBeforeChanged: function(newText) {
    // See if we are expecting this change as a result of one of our own edits.
    // Allow changes to be coalesced by the input system in an attempt to not
    // be too brittle.
    for (var i = 0; i < this.pendingTextsBefore_.length; ++i) {
      if (newText === this.pendingTextsBefore_[i]) {
        // Delete all previous expected changes and ignore this one.
        this.pendingTextsBefore_.splice(0, i + 1);
        return;
      }
    }
    // There was an actual text change (or cursor movement) that we hadn't
    // caused ourselves, reset any pending input.
    this.inputHandler_.clearEntryState_();
  },

  /** @return {boolean} */
  lastCellIsBlank: function() {
    return this.cells_[this.cells_.length - 1] === 0;
  },

  /**
   * Updates the translated text based on the current cells and sends the
   * delta to the IME.
   * @private
   */
  updateText_: function() {
    var cellsBuffer = new Uint8Array(this.cells_).buffer;
    this.translator_.backTranslate(cellsBuffer, function(result) {
      if (result === null) {
        console.error('Error when backtranslating braille cells');
        return;
      }
      if (!this.inputHandler_)
        return;
      this.sendTextChange_(result);
      this.text_ = result;
    }.bind(this));
  },

  /**
   * Sends new text to the IME.  This dhould be overriden by subclasses.
   * The old text is still available in the {@code text_} property.
   * @param {string} newText Text to send.
   * @private
   */
  sendTextChange_: function(newText) {
  }
};

/**
 * Entry state that uses {@code deleteSurroundingText} and {@code commitText}
 * calls to the IME to update the currently enetered text.
 * @param {!cvox.BrailleInputHandler} inputHandler
 * @param {!cvox.LibLouis.Translator} translator
 * @constructor
 * @extends {cvox.BrailleInputHandler.EntryState_}
 * @private
 */
cvox.BrailleInputHandler.EditsEntryState_ = function(
    inputHandler, translator) {
  cvox.BrailleInputHandler.EntryState_.call(this, inputHandler, translator);
};

cvox.BrailleInputHandler.EditsEntryState_.prototype = {
  __proto__: cvox.BrailleInputHandler.EntryState_.prototype,

  /** @override */
  sendTextChange_: function(newText) {
    var oldText = this.text_;
    // Find the common prefix of the old and new text.
    var commonPrefixLength = StringUtil.longestCommonPrefixLength(
        oldText, newText);
    // How many characters we need to delete from the existing text to replace
    // them with characters from the new text.
    var deleteLength = oldText.length - commonPrefixLength;
    // New text, if any, to insert after deleting the deleteLength characters
    // before the cursor.
    var toInsert = newText.substring(commonPrefixLength);
    if (deleteLength > 0 || toInsert.length > 0) {
      // After deleting, we expect this text to be present before the cursor.
      var textBeforeAfterDelete =
          this.inputHandler_.currentTextBefore_.substring(
              0, this.inputHandler_.currentTextBefore_.length - deleteLength);
      if (deleteLength > 0) {
        // Queue this text up to be ignored when the change comes in.
        this.pendingTextsBefore_.push(textBeforeAfterDelete);
      }
      if (toInsert.length > 0) {
        // Likewise, queue up what we expect to be before the cursor after
        // the replacement text is inserted.
        this.pendingTextsBefore_.push(textBeforeAfterDelete + toInsert);
      }
      // Send the replace operation to be performed asynchronously by the IME.
      this.inputHandler_.postImeMessage_(
          {type: 'replaceText',
           contextID: this.inputHandler_.inputContext_.contextID,
           deleteBefore: deleteLength,
           newText: toInsert});
    }
  }
};


text:
.class interface abstract Landroid/telecom/Logging/SessionManager$ISessionCleanupTimeoutMs;
.super Ljava/lang/Object;
.source "SessionManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/telecom/Logging/SessionManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x60a
    name = "ISessionCleanupTimeoutMs"
.end annotation

# virtual methods
.method public abstract get()J
.end method

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals
import frappe
import frappe.utils
from frappe.utils.oauth import get_oauth2_authorize_url, get_oauth_keys, login_via_oauth2, login_oauth_user as _login_oauth_user, redirect_post_login
import json
from frappe import _
from frappe.auth import LoginManager
from frappe.integrations.doctype.ldap_settings.ldap_settings import get_ldap_settings

no_cache = True

def get_context(context):
	if frappe.session.user != "Guest" and frappe.session.data.user_type=="System User":
		frappe.local.flags.redirect_location = "/desk"
		raise frappe.Redirect

	# get settings from site config
	context.no_header = True
	context.for_test = 'login.html'
	context["title"] = "Login"
	context["disable_signup"] = frappe.utils.cint(frappe.db.get_value("Website Settings", "Website Settings", "disable_signup"))

	for provider in ("google", "github", "facebook"):
		if get_oauth_keys(provider):
			context["{provider}_login".format(provider=provider)] = get_oauth2_authorize_url(provider)
			context["social_login"] = True

	ldap_settings = get_ldap_settings()
	context["ldap_settings"] = ldap_settings

	return context

@frappe.whitelist(allow_guest=True)
def login_via_google(code, state):
	login_via_oauth2("google", code, state, decoder=json.loads)

@frappe.whitelist(allow_guest=True)
def login_via_github(code, state):
	login_via_oauth2("github", code, state)

@frappe.whitelist(allow_guest=True)
def login_via_facebook(code, state):
	login_via_oauth2("facebook", code, state)

@frappe.whitelist(allow_guest=True)
def login_oauth_user(data=None, provider=None, state=None, email_id=None, key=None, generate_login_token=False):
	if not ((data and provider and state) or (email_id and key)):
		frappe.respond_as_web_page(_("Invalid Request"), _("Missing parameters for login"), http_status_code=417)
		return

	_login_oauth_user(data, provider, state, email_id, key, generate_login_token)

@frappe.whitelist(allow_guest=True)
def login_via_token(login_token):
	sid = frappe.cache().get_value("login_token:{0}".format(login_token), expires=True)
	if not sid:
		frappe.respond_as_web_page(_("Invalid Request"), _("Invalid Login Token"), http_status_code=417)
		return

	frappe.local.form_dict.sid = sid
	frappe.local.login_manager = LoginManager()

	redirect_post_login(desk_user = frappe.db.get_value("User", frappe.session.user, "user_type")=="System User")


text:
package com.nosleep.githubclient.datalayer.services;

import android.util.Base64;
import android.util.Log;

import com.android.volley.Request;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;

import com.google.gson.Gson;
import com.nosleep.githubclient.datalayer.services.authorization.Authorizations;
import com.nosleep.githubclient.datalayer.services.authorization.LoginBody;
import com.nosleep.githubclient.datalayer.services.authorization.LoginSvcInterface;
import com.nosleep.githubclient.utils.EndPoints;
import com.nosleep.githubclient.utils.ServiceListener;
import com.nosleep.githubclient.utils.VolleyDelegate;

/**
 * Created by Sanjeev on 03/01/16.
 */
class LoginSvcImpl implements LoginSvcInterface {

    private static final String TAG = "LoginSvcImpl";
    private VolleyDelegate delegate;

    private String str = "{\"scopes\": [\"repo\", \"user\"], \"note\": \"test\"}";

    LoginSvcImpl(VolleyDelegate delegate) {
        this.delegate = delegate;
    }

    @Override
    public void login(String username, String password, ServiceListener callback) {
        VolleyDelegate.VolleyRequestBuilder<Authorizations> builder = new VolleyDelegate.VolleyRequestBuilder<>();
        HashMap<String, String> headers = new HashMap<>();
        String authorization = "Basic " + Base64.encodeToString((username + ":" + password).getBytes(), Base64.DEFAULT);
        String accept = "application/vnd.github.v3+json";
        Log.d("GithubServicesAPI", authorization);
        headers.put("Authorization", authorization);
        headers.put("Content-Type", "application/json");
        headers.put("Accept", accept);

        LoginBody body = new LoginBody();
        List<String> scope = new ArrayList<>();
        scope.add("public_repo");
        scope.add("repo");
        scope.add("user");
        body.setScopes(scope);
        body.setNote(Calendar.getInstance().getTime().toString());
        Gson gson = new Gson();
        String str = gson.toJson(body, LoginBody.class);
        Log.d(TAG, str);

        Request<Authorizations> request = builder.method(Request.Method.POST)
                .url(EndPoints.getEndpoint().constructURL(PATH_AUTHORIZATION))
                .headers(headers).requestBody(str)
                .listener(callback)
                .errorListener(callback)
                .gsonClass(Authorizations.class)
                .build();
        delegate.addToRequestQueue(request);
    }

}


text:
enum {
    NSURLErrorUnknown = -1,
    NSURLErrorCancelled = -999,
    NSURLErrorBadURL = -1000,
    NSURLErrorTimedOut = -1001,
    NSURLErrorUnsupportedURL = -1002,
    NSURLErrorCannotFindHost = -1003,
    NSURLErrorCannotConnectToHost = -1004,
    NSURLErrorDataLengthExceedsMaximum = -1103,
    NSURLErrorNetworkConnectionLost = -1005,
    NSURLErrorDNSLookupFailed = -1006,
    NSURLErrorHTTPTooManyRedirects = -1007,
    NSURLErrorResourceUnavailable = -1008,
    NSURLErrorNotConnectedToInternet = -1009,
    NSURLErrorRedirectToNonExistentLocation = -1010,
    NSURLErrorBadServerResponse = -1011,
    NSURLErrorUserCancelledAuthentication = -1012,
    NSURLErrorUserAuthenticationRequired = -1013,
    NSURLErrorZeroByteResource = -1014,
    NSURLErrorCannotDecodeRawData = -1015,
    NSURLErrorCannotDecodeContentData = -1016,
    NSURLErrorCannotParseResponse = -1017,
    NSURLErrorInternationalRoamingOff = -1018,
    NSURLErrorCallIsActive = -1019,
    NSURLErrorDataNotAllowed = -1020,
    NSURLErrorRequestBodyStreamExhausted = -1021,
    NSURLErrorAppTransportSecurityRequiresSecureConnection = -1022,
    NSURLErrorFileDoesNotExist = -1100,
    NSURLErrorFileIsDirectory = -1101,
    NSURLErrorNoPermissionsToReadFile = -1102,
    NSURLErrorSecureConnectionFailed = -1200,
    NSURLErrorServerCertificateHasBadDate = -1201,
    NSURLErrorServerCertificateUntrusted = -1202,
    NSURLErrorServerCertificateHasUnknownRoot = -1203,
    NSURLErrorServerCertificateNotYetValid = -1204,
    NSURLErrorClientCertificateRejected = -1205,
    NSURLErrorClientCertificateRequired = -1206,
    NSURLErrorCannotLoadFromNetwork = -2000,
    NSURLErrorCannotCreateFile = -3000,
    NSURLErrorCannotOpenFile = -3001,
    NSURLErrorCannotCloseFile = -3002,
    NSURLErrorCannotWriteToFile = -3003,
    NSURLErrorCannotRemoveFile = -3004,
    NSURLErrorCannotMoveFile = -3005,
    NSURLErrorDownloadDecodingFailedMidStream = -3006,
    NSURLErrorDownloadDecodingFailedToComplete = -3007,
};

FOUNDATION_EXPORT NSString* const NSURLErrorDomain;
FOUNDATION_EXPORT NSString* const NSURLErrorFailingURLStringErrorKey;
FOUNDATION_EXPORT NSString* const NSURLErrorKey;
FOUNDATION_EXPORT NSString* const NSURLErrorFailingURLErrorKey;
FOUNDATION_EXPORT NSString* const NSURLErrorFailingURLPeerTrustErrorKey;


text:
' Licensed to the .NET Foundation under one or more agreements.
' The .NET Foundation licenses this file to you under the MIT license.
' See the LICENSE file in the project root for more information.

Imports System.Composition
Imports Microsoft.CodeAnalysis.CodeRefactorings
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports Microsoft.CodeAnalysis.Host.Mef
Imports Microsoft.CodeAnalysis.LanguageServices

Namespace Microsoft.CodeAnalysis.VisualBasic.CodeRefactorings
    <ExportLanguageService(GetType(IRefactoringHelpersService), LanguageNames.VisualBasic), [Shared]>
    Friend Class VisualBasicRefactoringHelpersService
        Inherits AbstractRefactoringHelpersService(Of ExpressionSyntax, ArgumentSyntax, ExpressionStatementSyntax)

        <ImportingConstructor>
        <Obsolete(MefConstruction.ImportingConstructorMessage, True)>
        Public Sub New()
        End Sub

        Protected Overrides Iterator Function ExtractNodesSimple(node As SyntaxNode, syntaxFacts As ISyntaxFactsService) As IEnumerable(Of SyntaxNode)
            For Each baseExtraction In MyBase.ExtractNodesSimple(node, syntaxFacts)
                Yield baseExtraction
            Next

            ' VB's arguments can have identifiers nested in ModifiedArgument -> we want
            ' identifiers to represent parent node -> need to extract.
            If IsIdentifierOfParameter(node) Then
                Yield node.Parent
            End If

            ' In VB Statement both for/foreach are split into Statement (header) and the rest
            ' selecting the header should still count for the whole blockSyntax
            If TypeOf node Is ForEachStatementSyntax And TypeOf node.Parent Is ForEachBlockSyntax Then
                Dim foreachStatement = CType(node, ForEachStatementSyntax)
                Yield foreachStatement.Parent
            End If

            If TypeOf node Is ForStatementSyntax And TypeOf node.Parent Is ForBlockSyntax Then
                Dim forStatement = CType(node, ForStatementSyntax)
                Yield forStatement.Parent
            End If

            If TypeOf node Is VariableDeclaratorSyntax Then
                Dim declarator = CType(node, VariableDeclaratorSyntax)
                If TypeOf declarator.Parent Is LocalDeclarationStatementSyntax Then
                    Dim localDeclarationStatement = CType(declarator.Parent, LocalDeclarationStatementSyntax)
                    ' Only return the whole localDeclarationStatement if there's just one declarator with just one name
                    If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
                        Yield localDeclarationStatement
                    End If
                End If
            End If

        End Function

        Public Shared Function IsIdentifierOfParameter(node As SyntaxNode) As Boolean
            Return (TypeOf node Is ModifiedIdentifierSyntax) AndAlso (TypeOf node.Parent Is ParameterSyntax) AndAlso (CType(node.Parent, ParameterSyntax).Identifier Is node)
        End Function
    End Class
End Namespace


text:
A node selection dialog that uses web component technologies.

# Synopsis
The project implements a node selection dialog. It is used to enable the user to select one or more nodes in the html document as part of some larger process that an application is performing.

# Code Example
```javascript
  NodePick.setPaths({css:'http://www.example.com/nodepick/css'});

  var picker = new NodePick();

  picker.body.addEventListener('nodepick@submit', function(event)
  {
    for(var i = 0; i < event.elements.length; i++)
      console.log(event.elements[i].innerText);
  });

  picker.body.addEventListener('nodepick@cancel', function()
  {
    console.log("<The operation was cancelled>");
  });

  picker.show();
```
# Installation
The example contains a simple demonstration of the project.

# Browser Support
The code works on Chrome and Opera. Firefox (54) and IE (11) do not seem to support shadow dom. These are the only browsers that I've tested the code on so it might work on Safari and Edge as well.

# Tools
The stylesheet is coded in [less](http://lesscss.org/). Documentation can be generated from comments using [yuidoc](http://yui.github.io/yuidoc/).

# License
The project is licensed under the MIT license.


text:
Primary button
Primary disabled button


text:
import { SequenceMultiplicity, SequenceType, ValueType } from '../expressions/dataTypes/Value';
import astHelper, { IAST } from '../parsing/astHelper';

/**
 * Concatenates two strings to each other, hence it always returns a string.
 * @param ast the AST to be annotated.
 * @param context
 * @returns a SequenceType with type XSSTRING and multiplicity EXACTLY_ONE.
 */
export function annotateStringConcatenateOperator(ast: IAST): SequenceType {
	const seqType = {
		type: ValueType.XSSTRING,
		mult: SequenceMultiplicity.EXACTLY_ONE,
	};

	astHelper.insertAttribute(ast, 'type', seqType);
	return seqType;
}


text:
package com.taoswork.tallybook.general.dataservice.management;

/**
 * Created by Gao Yuan on 2015/6/13.
 */
public class DataServiceManagementRoot {
}


text:
(function($) {

    window.Tokens = window.Tokens || {};

    // Kick everything off:
    Tokens.Controller.route();

    // Update token sizes on delayed resize
    $(window).on('delayed-resize tokens-refresh', function (event) {
        $('.col-square').parent().each(function() {
            var $parent = $(this),
                $squares = $parent.find('.col-square'),
                maxWidth = 0;

            $squares.each(function() {
                var width = Math.ceil($(this).outerWidth());
                if (width > maxWidth) {
                    maxWidth = width;
                }
            });
            $squares.css({'height': maxWidth + 'px'});
        });
    });

    // prevent jankiness during resize
    $(window).on('resize', function() {
        if(this.resizeTO) clearTimeout(this.resizeTO);
        this.resizeTO = setTimeout(function() {
            $(this).trigger('delayed-resize');
        }, 200);
    });

    // Bootstrap copy button
    $('body').on('click', '.js-copy', function (event) {
        event.preventDefault();

        var $this = $(this),
            $input = $this.closest('.input-group').find('input');

        if ($input.length == 1) {
            $input.select();
            document.execCommand('copy');
        }
    });

})(jQuery);


text:
  <title>Thiago Silva -- Desenvolvimento web</title>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name=X-UA-Compatible content="IE=edge">
  <meta name=robots content=index,follow />
  <meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name=title content="Thiago Silva - Desenvolvimento web">
  <meta name=description content="Desenvolvimento front-end com foco em UX e UI">
  <meta name=keywords content="front-end, ui, ux, desenvolvimento, desenvolvimento web, usabilidade">

  <link rel="stylesheet" href="assets/css/main/negativeone.min.css">
  <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="bower_components/wow/css/libs/animate.css">

thiago silva|

{desenvolvimeto web}

 // Um pouco sobre mim //

        Desenvolvedor web com cerca de 2 anos de experiência, apaixonado por programação, gosto de desenvolver sistemas de alto desempenho e focados no UX, sempre dentro das melhores práticas apresentadas pelas ferramentas que utilizo.

        Apesar da pouca experiência, possuo bons conhecimentos em js (puro) e jquery, php, modelagem e implementação de bancos de dados em sql e mysql e frameworks como laravel, yii e angularjs.

 // O que eu faço //

Front-End

Um front-end bem construído reflete diretamente no desempenho do seu site, aumentando acessos e diminundo tempo de manutençao ou implementação de novas funcionalidades

Ux

Entender como as pessoas interagem com o seu site, é um passo importante para o crescimento do seu negócio, uma simpes mudança de fluxo ou um campo a menos no formulário pode fazer uma grande diferença.

SEO

De nada adianta pra uma empresa, um site bonito, rápido e funcional que não é listado os mecanismos de busca, antes dos seus clientes usarem o seu site lindo e rapido, eles precisam te achar!

Back End

O back-end é o cérebro do seu site, é ele que vai definir grande parte das funcionalidades do seu sistema. Um back-end bem construído, melhora a rapidez, segurança e estabilidade do seu site

Banco de Dados

Se o back-end é o cérebro do sistema, o banco de dados é coração, por isso é extremamente necessário que a confidencialidade, confiabilidade e integridade sejam levados em consideração desde a modelagem do banco

Documentação

Também não adianta ter um sistema bem construído e um banco de dados seguro se isso tudo não for devidamente documentado. A documentação do sistema ajuda a entender o que ele faz, como faz e como ele foi construido.

// O que eu já fiz //

laser-caf-hpv.com.br

Responsável por todo o sistema, desde a documentação e modelagem de banco de dados até sua implantação

#php, #js, #codeigniter, #mysql

seguro.zonaveg.com.br

Responsável por todo o sistema, desde a documentação e modelagem de banco de dados até sua implantação
 (em desenvolvimento)

#php, #js, #angularjs, #laravel, #mysql

bestberry.com.br

Responsável pela manutenção, melhorias e reestruturação do fluxo de checkout

#php, #js, #laravel, #mysql

mleve.com.br

Responsável por todo o sistema, desde a documentação e modelagem de banco de dados até sua implantação

#php, #js, #angularjs, #laravel, #mysql

seuprojeto.com.br

Ficou interessado?
Entre em contato pra falarmos sobre seu novo projeto!

#rapido, #funcional, #bonito

// Como me encontrar //

facebook.com/thiagodweb

thiago.dweb@gmail.com

Thiago Silva

(11) 96178-3663

© 20015 • 2016 - thiago silva


text:
document.write(
    '
' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '' +
        '
Kiosk
' +
        '
Ladies riding
' +
        '
Hmm...
' +
        '
Severed head
' +
        '
Smoking
' +
        '' +
        '' +
        '' +
    '
'
);

function random (min, max) {
  if (max == null) {
    max = min;
    min = 0;
  }
  return min + Math.floor(Math.random() * (max - min + 1));
}

function setStyle ($el, style) {
  var el = $el[0];
  if (el.styleSheet) {
    el.styleSheet.cssText = style;
  } else {
    $el.html(style);
  }
}

describe('Thumbs', function () {
  var $fotorama, fotorama, data, $thumb, $style, max;

  beforeEach(function () {
    $fotorama = $fotorama || $('#fotorama');
    fotorama = fotorama || $fotorama.data('fotorama');
    data = data || fotorama.data;
    $thumb = $thumb || $('.fotorama__nav__frame--thumb');
    $style = $style || $('').insertAfter($fotorama);
    max = fotorama.size - 1;

  });

  it('thumbs height is correct', function () {
    expect($thumb.eq(random(max)).height()).toBe(48);
  });

  it('even with global `* { box-sizing: border-box; }`', function () {
    setStyle($style, '* { box-sizing: border-box; }');
    expect($thumb.eq(random(max)).height()).toBe(48);
  });

  it('thumbs dimenstions are read correctly', function () {
    expect(data[0].thumbratio).toBe(500 / 335);
    expect(data[1].thumbratio).toBeUndefined();
    expect(data[2].thumbratio).toBe(450 / 591);
    expect(data[3].thumbratio).toBe(55 / 34);
    expect(data[4].thumbratio).toBeUndefined();
    expect(data[5].thumbratio).toBe(50 / 36);
    expect(data[6].thumbratio).toBe(500 / 383);
    expect(data[7].thumbratio).toBe(50 / 49);
    expect(data[8].thumbratio).toBeUndefined();
    expect(data[9].thumbratio).toBe(443 / 525);
    expect(data[10].thumbratio).toBeUndefined();
    expect(data[11].thumbratio).toBe(34/75);
    expect(data[12].thumbratio).toBe(443/525); //
    expect(data[13].thumbratio).toBe(undefined);
    expect(data[14].thumbratio).toBe(70/47);
    expect(data[15].thumbratio).toBe(1.5);
    expect(data[16].thumbratio).toBe(500/394);
  });

  it('positions are good', function () {
    $thumb.each(function () {
      var $this = $(this);

      expect(Math.round($this.position().left)).toBe($this.data('l'));
    });
  });

  it('hidden thumbs are not loaded', function () {
    $thumb.each(function () {
      var $this = $(this);

      if ($this.position().left < $('.fotorama__wrap', $fotorama).width()) {
        waitsFor(function () {
          return $('.fotorama__img', $this)[0];
        }, 'Here must be an image...', 100);
      } else {
        expect($('.fotorama__img', $this)[0]).toBeFalsy();
      }
    });
  });

});


text:
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.htmlunit;

import static java.nio.charset.StandardCharsets.ISO_8859_1;
import static java.nio.charset.StandardCharsets.UTF_8;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.MockWebConnection;

/**
 * Common superclass for HtmlUnit tests.
 *
 * @author Mike Bowler
 * @author David D. Kilzer
 * @author Marc Guillemot
 * @author Chris Erskine
 * @author Michael Ottati
 * @author Daniel Gredler
 * @author Ahmed Ashour
 * @author Ronald Brill
 */
public abstract class WebTestCase {

    /** Logging support. */
    private static final Log LOG = LogFactory.getLog(WebTestCase.class);

    /** save the environment */
    private static final Locale SAVE_LOCALE = Locale.getDefault();

    /** The listener port for the web server. */
    public static final int PORT = Integer.parseInt(System.getProperty("htmlunit.test.port", "12345"));

    /** The second listener port for the web server, used for cross-origin tests. */
    public static final int PORT2 = Integer.parseInt(System.getProperty("htmlunit.test.port2", "12346"));

    /** The second listener port for the web server, used for cross-origin tests. */
    public static final int PORT3 = Integer.parseInt(System.getProperty("htmlunit.test.port3", "12347"));

    /** The SOCKS proxy host to use for SOCKS proxy tests. */
    public static final String SOCKS_PROXY_HOST = System.getProperty("htmlunit.test.socksproxy.host", "localhost");

    /** The SOCKS proxy port to use for SOCKS proxy tests. */
    public static final int SOCKS_PROXY_PORT = Integer
            .parseInt(System.getProperty("htmlunit.test.socksproxy.port", "55555"));

    /** Succeeds the SOCKS proxy tests (for windows) . */
    public static final boolean GEOLOCATION_IGNORE = Boolean
            .valueOf(System.getProperty("htmlunit.test.geolocation.ignore", "false"));

    /** Property to use nashorn. */
    protected static final String NASHRON = "htmlunit.nashorn";

    /** The default time used to wait for the expected alerts. */
    protected static final long DEFAULT_WAIT_TIME = 1000;

    /** Constant for the URL which is used in the tests. */
    public static final URL URL_FIRST;

    /** Constant for the URL which is used in the tests. */
    public static final URL URL_SECOND;

    /**
     * Constant for the URL which is used in the tests. This URL doesn't use the
     * same host name as {@link #URL_FIRST} and {@link #URL_SECOND}.
     */
    public static final URL URL_THIRD;

    /**
     * Constant for a URL used in tests that responds with
     * Access-Control-Allow-Origin.
     */
    public static final URL URL_CROSS_ORIGIN;

    /**
     * To get an origin header with two things in it, there needs to be a chain of
     * two cross-origin referers. So we need a second extra origin.
     */
    public static final URL URL_CROSS_ORIGIN2;

    /**
     * Constant for the base URL for cross-origin tests.
     */
    public static final URL URL_CROSS_ORIGIN_BASE;

    /**
     * The content type for JavaScript.
     */
    public static final String JAVASCRIPT_MIME_TYPE = "application/javascript";

    /**
     * The name of the system property used to determine if files should be
     * generated or not in
     * {@link #createTestPageForRealBrowserIfNeeded(String,List)}.
     */
    public static final String PROPERTY_GENERATE_TESTPAGES =
            "com.gargoylesoftware.htmlunit.WebTestCase.GenerateTestpages";

    private BrowserVersion browserVersion_;

    private String[] expectedAlerts_;
    private MockWebConnection mockWebConnection_;

    /** To be documented. */
    protected static final BrowserVersion FLAG_ALL_BROWSERS = new BrowserVersion.BrowserVersionBuilder(
            BrowserVersion.BEST_SUPPORTED).setApplicationName("FLAG_ALL_BROWSERS").build();

    /** To be documented. */
    protected static final ThreadLocal<BrowserVersion> generateTest_browserVersion_ = new ThreadLocal<>();
    private String generateTest_content_;
    private List<String> generateTest_expectedAlerts_;
    private boolean generateTest_notYetImplemented_;
    private String generateTest_testName_;

    static {
        try {
            URL_FIRST = new URL("http://localhost:" + PORT + "/");
            URL_SECOND = new URL("http://localhost:" + PORT + "/second/");
            URL_THIRD = new URL("http://127.0.0.1:" + PORT + "/third/");
            URL_CROSS_ORIGIN = new URL("http://127.0.0.1:" + PORT2 + "/corsAllowAll");
            URL_CROSS_ORIGIN2 = new URL("http://localhost:" + PORT3 + "/");
            URL_CROSS_ORIGIN_BASE = new URL("http://localhost:" + PORT2 + "/");
        }
        catch (final MalformedURLException e) {
            // This is theoretically impossible.
            throw new IllegalStateException("Unable to create URL constants");
        }
    }

    /**
     * Constructor.
     */
    protected WebTestCase() {
        generateTest_browserVersion_.remove();
    }

    /**
     * Assert that the specified object is null.
     *
     * @param object the object to check
     */
    public static void assertNull(final Object object) {
        Assert.assertNull("Expected null but found [" + object + "]", object);
    }

    /**
     * Assert that the specified object is null.
     *
     * @param message the message
     * @param object  the object to check
     */
    public static void assertNull(final String message, final Object object) {
        Assert.assertNull(message, object);
    }

    /**
     * Assert that the specified object is not null.
     *
     * @param object the object to check
     */
    public static void assertNotNull(final Object object) {
        Assert.assertNotNull(object);
    }

    /**
     * Assert that the specified object is not null.
     *
     * @param message the message
     * @param object  the object to check
     */
    public static void assertNotNull(final String message, final Object object) {
        Assert.assertNotNull(message, object);
    }

    /**
     * Asserts that two objects refer to the same object.
     *
     * @param expected the expected object
     * @param actual   the actual object
     */
    public static void assertSame(final Object expected, final Object actual) {
        Assert.assertSame(expected, actual);
    }

    /**
     * Asserts that two objects refer to the same object.
     *
     * @param message  the message
     * @param expected the expected object
     * @param actual   the actual object
     */
    public static void assertSame(final String message, final Object expected, final Object actual) {
        Assert.assertSame(message, expected, actual);
    }

    /**
     * Asserts that two objects do not refer to the same object.
     *
     * @param expected the expected object
     * @param actual   the actual object
     */
    public static void assertNotSame(final Object expected, final Object actual) {
        Assert.assertNotSame(expected, actual);
    }

    /**
     * Asserts that two objects do not refer to the same object.
     *
     * @param message  the message
     * @param expected the expected object
     * @param actual   the actual object
     */
    public static void assertNotSame(final String message, final Object expected, final Object actual) {
        Assert.assertNotSame(message, expected, actual);
    }

    /**
     * Facility to test external form of urls. Comparing external form of URLs is
     * really faster than URL.equals() as the host doesn't need to be resolved.
     *
     * @param expectedUrl the expected URL
     * @param actualUrl   the URL to test
     */
    protected static void assertEquals(final URL expectedUrl, final URL actualUrl) {
        Assert.assertEquals(expectedUrl.toExternalForm(), actualUrl.toExternalForm());
    }

    /**
     * Asserts the two objects are equal.
     *
     * @param expected the expected object
     * @param actual   the object to test
     */
    protected static void assertEquals(final Object expected, final Object actual) {
        Assert.assertEquals(expected, actual);
    }

    /**
     * Asserts the two objects are equal.
     *
     * @param message  the message
     * @param expected the expected object
     * @param actual   the object to test
     */
    protected static void assertEquals(final String message, final Object expected, final Object actual) {
        Assert.assertEquals(message, expected, actual);
    }

    /**
     * Asserts the two ints are equal.
     *
     * @param expected the expected int
     * @param actual   the int to test
     */
    protected static void assertEquals(final int expected, final int actual) {
        Assert.assertEquals(expected, actual);
    }

    /**
     * Asserts the two boolean are equal.
     *
     * @param expected the expected boolean
     * @param actual   the boolean to test
     */
    protected void assertEquals(final boolean expected, final boolean actual) {
        Assert.assertEquals(Boolean.valueOf(expected), Boolean.valueOf(actual));
    }

    /**
     * Facility to test external form of urls. Comparing external form of URLs is
     * really faster than URL.equals() as the host doesn't need to be resolved.
     *
     * @param message     the message to display if assertion fails
     * @param expectedUrl the string representation of the expected URL
     * @param actualUrl   the URL to test
     */
    protected void assertEquals(final String message, final URL expectedUrl, final URL actualUrl) {
        Assert.assertEquals(message, expectedUrl.toExternalForm(), actualUrl.toExternalForm());
    }

    /**
     * Facility to test external form of a URL.
     *
     * @param expectedUrl the string representation of the expected URL
     * @param actualUrl   the URL to test
     */
    protected void assertEquals(final String expectedUrl, final URL actualUrl) {
        Assert.assertEquals(expectedUrl, actualUrl.toExternalForm());
    }

    /**
     * Facility method to avoid having to create explicitly a list from a String[]
     * (for example when testing received alerts). Transforms the String[] to a List
     * before calling
     * {@link org.junit.Assert#assertEquals(java.lang.Object, java.lang.Object)}.
     *
     * @param expected the expected strings
     * @param actual   the collection of strings to test
     */
    protected void assertEquals(final String[] expected, final List<String> actual) {
        assertEquals(null, expected, actual);
    }

    /**
     * Facility method to avoid having to create explicitly a list from a String[]
     * (for example when testing received alerts). Transforms the String[] to a List
     * before calling
     * {@link org.junit.Assert#assertEquals(java.lang.String, java.lang.Object, java.lang.Object)}.
     *
     * @param message  the message to display if assertion fails
     * @param expected the expected strings
     * @param actual   the collection of strings to test
     */
    protected void assertEquals(final String message, final String[] expected, final List<String> actual) {
        Assert.assertEquals(message, Arrays.asList(expected).toString(), actual.toString());
    }

    /**
     * Facility to test external form of a URL.
     *
     * @param message     the message to display if assertion fails
     * @param expectedUrl the string representation of the expected URL
     * @param actualUrl   the URL to test
     */
    protected void assertEquals(final String message, final String expectedUrl, final URL actualUrl) {
        Assert.assertEquals(message, expectedUrl, actualUrl.toExternalForm());
    }

    /**
     * Assert the specified condition is true.
     *
     * @param condition condition to test
     */
    protected void assertTrue(final boolean condition) {
        Assert.assertTrue(condition);
    }

    /**
     * Assert the specified condition is true.
     *
     * @param message   message to show
     * @param condition condition to test
     */
    protected void assertTrue(final String message, final boolean condition) {
        Assert.assertTrue(message, condition);
    }

    /**
     * Assert the specified condition is false.
     *
     * @param condition condition to test
     */
    protected void assertFalse(final boolean condition) {
        Assert.assertFalse(condition);
    }

    /**
     * Assert the specified condition is false.
     *
     * @param message   message to show
     * @param condition condition to test
     */
    protected void assertFalse(final String message, final boolean condition) {
        Assert.assertFalse(message, condition);
    }

    /**
     * Returns an input stream for the specified file name. Refer to
     * {@link #getFileObject(String)} for details on how the file is located.
     *
     * @param fileName the base file name
     * @return the input stream
     * @throws FileNotFoundException if the file cannot be found
     */
    public static InputStream getFileAsStream(final String fileName) throws FileNotFoundException {
        return new BufferedInputStream(new FileInputStream(getFileObject(fileName)));
    }

    /**
     * Returns a File object for the specified file name. This is different from
     * just new File(fileName) because it will adjust the location of
     * the file depending on how the code is being executed.
     *
     * @param fileName the base filename
     * @return the new File object
     * @throws FileNotFoundException if the file doesn't exist
     */
    public static File getFileObject(final String fileName) throws FileNotFoundException {
        final String localizedName = fileName.replace('/', File.separatorChar);

        File file = new File(localizedName);
        if (!file.exists()) {
            file = new File("../../" + localizedName);
        }

        if (!file.exists()) {
            try {
                System.out.println("currentDir=" + new File(".").getCanonicalPath());
            }
            catch (final IOException e) {
                e.printStackTrace();
            }
            throw new FileNotFoundException(localizedName);
        }
        return file;
    }

    /**
     * Facility method transforming expectedAlerts to a list and calling
     * {@link #createTestPageForRealBrowserIfNeeded(String, List)}.
     *
     * @param content        the content of the HTML page
     * @param expectedAlerts the expected alerts
     * @throws IOException if writing file fails
     */
    protected void createTestPageForRealBrowserIfNeeded(final String content, final String[] expectedAlerts)
            throws IOException {
        createTestPageForRealBrowserIfNeeded(content, Arrays.asList(expectedAlerts));
    }

    /**
     * Generates an instrumented HTML file in the temporary dir to easily make a
     * manual test in a real browser. The file is generated only if the system
     * property {@link #PROPERTY_GENERATE_TESTPAGES} is set.
     *
     * @param content        the content of the HTML page
     * @param expectedAlerts the expected alerts
     * @throws IOException if writing file fails
     */
    protected void createTestPageForRealBrowserIfNeeded(final String content, final List<String> expectedAlerts)
            throws IOException {

        // save the information to create a test for WebDriver
        generateTest_content_ = content;
        generateTest_expectedAlerts_ = expectedAlerts;
        final Method testMethod = findRunningJUnitTestMethod();
        generateTest_testName_ = testMethod.getDeclaringClass().getSimpleName() + "_" + testMethod.getName() + ".html";

        if (System.getProperty(PROPERTY_GENERATE_TESTPAGES) != null) {
            // should be optimized....

            // calls to alert() should be replaced by call to custom function
            String newContent = StringUtils.replace(content, "alert(", "htmlunitReserved_caughtAlert(");

            final String instrumentationJS = createInstrumentationScript(expectedAlerts);

            // first version, we assume that there is a  and a  or a
            // </frameset>
            if (newContent.indexOf("") > -1) {
                newContent = StringUtils.replaceOnce(newContent, "", "" + instrumentationJS);
            }
            else {
                newContent = StringUtils.replaceOnce(newContent, "",
                        "\n\n" + instrumentationJS + "\n\n");
            }
            final String endScript = "\n\n";
            if (newContent.contains("")) {
                newContent = StringUtils.replaceOnce(newContent, "", endScript + "");
            }
            else {
                LOG.info("No test generated: currently only content with a  and a  is supported");
            }

            final File f = File.createTempFile("TEST" + '_', ".html");
            FileUtils.writeStringToFile(f, newContent, "ISO-8859-1");
            LOG.info("Test file written: " + f.getAbsolutePath());
        }
        else {
            if (LOG.isDebugEnabled()) {
                LOG.debug("System property \"" + PROPERTY_GENERATE_TESTPAGES
                        + "\" not set, don't generate test HTML page for real browser");
            }
        }
    }

    /**
     * @param expectedAlerts the list of the expected alerts
     * @return the script to be included at the beginning of the generated HTML file
     * @throws IOException in case of problem
     */
    private String createInstrumentationScript(final List<String> expectedAlerts) throws IOException {
        // generate the js code
        final String baseJS = getFileContent("alertVerifier.js");

        final StringBuilder sb = new StringBuilder();
        sb.append("\n\n");
        return sb.toString();
    }

    /**
     * Finds from the call stack the active running JUnit test case
     *
     * @return the test case method
     * @throws RuntimeException if no method could be found
     */
    private Method findRunningJUnitTestMethod() {
        final Class<?> cl = getClass();
        final Class<?>[] args = new Class[] {};

        // search the initial junit test
        final Throwable t = new Exception();
        for (int i = t.getStackTrace().length - 1; i >= 0; i--) {
            final StackTraceElement element = t.getStackTrace()[i];
            if (element.getClassName().equals(cl.getName())) {
                try {
                    final Method m = cl.getMethod(element.getMethodName(), args);
                    if (isPublicTestMethod(m)) {
                        return m;
                    }
                }
                catch (final Exception e) {
                    // can't access, ignore it
                }
            }
        }
        throw new RuntimeException("No JUnit test case method found in call stack");
    }

    /**
     * From Junit. Test if the method is a junit test.
     *
     * @param method the method
     * @return {@code true} if this is a junit test
     */
    private static boolean isPublicTestMethod(final Method method) {
        return method.getParameterTypes().length == 0
                && (method.getName().startsWith("test") || method.getAnnotation(Test.class) != null)
                && method.getReturnType() == Void.TYPE && Modifier.isPublic(method.getModifiers());
    }

    /**
     * Sets the browser version.
     *
     * @param browserVersion the browser version
     */
    public void setBrowserVersion(final BrowserVersion browserVersion) {
        browserVersion_ = browserVersion;
    }

    /**
     * Returns the current {@link BrowserVersion}.
     *
     * @return current {@link BrowserVersion}
     */
    protected final BrowserVersion getBrowserVersion() {
        if (browserVersion_ == null) {
            throw new IllegalStateException("You must annotate the test class with '@RunWith(BrowserRunner.class)'");
        }
        return browserVersion_;
    }

    /**
     * Sets the expected alerts.
     *
     * @param expectedAlerts the expected alerts
     */
    public void setExpectedAlerts(final String... expectedAlerts) {
        expectedAlerts_ = expectedAlerts;
    }

    /**
     * Returns the expected alerts.
     *
     * @return the expected alerts
     */
    protected String[] getExpectedAlerts() {
        return expectedAlerts_;
    }

    /**
     * Expand "§§URL§§" to the provided URL in the expected alerts.
     *
     * @param url the URL to expand
     */
    protected void expandExpectedAlertsVariables(final URL url) {
        if (expectedAlerts_ == null) {
            throw new IllegalStateException("You must annotate the test class with '@RunWith(BrowserRunner.class)'");
        }
        for (int i = 0; i < expectedAlerts_.length; i++) {
            expectedAlerts_[i] = expectedAlerts_[i].replaceAll("§§URL§§", url.toExternalForm());
        }
    }

    /**
     * A generics-friendly version of
     * {@link SerializationUtils#clone(Serializable)}.
     *
     * @param <T>    the type of the object being cloned
     * @param object the object being cloned
     * @return a clone of the specified object
     */
    protected <T extends Serializable> T clone(final T object) {
        return SerializationUtils.clone(object);
    }

    /**
     * Prepare the environment. Rhino has localized error message... for instance
     * for French
     */
    @BeforeClass
    public static void beforeClass() {
        Locale.setDefault(Locale.US);
    }

    /**
     * Restore the environment.
     */
    @AfterClass
    public static void afterClass() {
        Locale.setDefault(SAVE_LOCALE);
    }

    /**
     * Generates an HTML file that can be loaded and understood as a test.
     *
     * @throws IOException in case of problem
     */
    @After
    public void generateTestForWebDriver() throws IOException {
        if (generateTest_content_ != null && !generateTest_notYetImplemented_) {
            final File targetDir = new File("target/generated_tests");
            targetDir.mkdirs();

            final File outFile = new File(targetDir, generateTest_testName_);

            FileUtils.writeStringToFile(outFile, generateTest_content_, ISO_8859_1);

            // write the expected alerts
            final String suffix;
            BrowserVersion browser = generateTest_browserVersion_.get();
            if (browser == null) {
                browser = getBrowserVersion();
            }
            if (browser == FLAG_ALL_BROWSERS) {
                suffix = ".expected";
            }
            else {
                suffix = "." + browser.getNickname() + ".expected";
            }

            final File expectedLog = new File(outFile.getParentFile(), outFile.getName() + suffix);

            try (FileOutputStream fos = new FileOutputStream(expectedLog)) {
                try (ObjectOutputStream oos = new ObjectOutputStream(fos)) {
                    oos.writeObject(generateTest_expectedAlerts_);
                }
            }
        }
    }

    /**
     * To be documented.
     *
     * @param status the status
     */
    protected void setGenerateTest_notYetImplemented(final boolean status) {
        generateTest_notYetImplemented_ = status;
    }

    /**
     * Returns the mock WebConnection instance for the current test.
     *
     * @return the mock WebConnection instance for the current test
     */
    protected MockWebConnection getMockWebConnection() {
        if (mockWebConnection_ == null) {
            mockWebConnection_ = new MockWebConnection();
        }
        return mockWebConnection_;
    }

    /**
     * Sets the mock WebConnection instance for the current test.
     *
     * @param connection the connection to use
     */
    protected void setMockWebConnection(final MockWebConnection connection) {
        mockWebConnection_ = connection;
    }

    /**
     * Cleanup after a test.
     */
    @After
    public void releaseResources() {
        mockWebConnection_ = null;
    }

    /**
     * Loads an expectation file for the specified browser search first for a
     * browser specific resource and falling back in a general resource.
     *
     * @param resourcePrefix the start of the resource name
     * @param resourceSuffix the end of the resource name
     * @return the content of the file
     * @throws Exception in case of error
     */
    protected String loadExpectation(final String resourcePrefix, final String resourceSuffix) throws Exception {
        final URL url = getExpectationsResource(getClass(), getBrowserVersion(), resourcePrefix, resourceSuffix);
        assertNotNull(url);
        final File file = new File(url.toURI());

        String content = FileUtils.readFileToString(file, UTF_8);
        content = StringUtils.replace(content, "\r\n", "\n");
        return content;
    }

    private static URL getExpectationsResource(final Class<?> referenceClass, final BrowserVersion browserVersion,
            final String resourcePrefix, final String resourceSuffix) {
        final String browserSpecificResource = resourcePrefix + "." + browserVersion.getNickname() + resourceSuffix;

        URL url = referenceClass.getResource(browserSpecificResource);
        if (url != null) {
            return url;
        }

        final String browserFamily = browserVersion.getNickname().replaceAll("[\\d\\.]", "");
        final String browserFamilyResource = resourcePrefix + "." + browserFamily + resourceSuffix;

        url = referenceClass.getResource(browserFamilyResource);
        if (url != null) {
            return url;
        }

        // fall back: expectations for all browsers
        final String resource = resourcePrefix + resourceSuffix;
        return referenceClass.getResource(resource);
    }

    /**
     * Gets the active JavaScript threads.
     *
     * @return the threads
     */
    protected List<Thread> getJavaScriptThreads() {
        final Thread[] threads = new Thread[Thread.activeCount() + 10];
        Thread.enumerate(threads);
        final List<Thread> jsThreads = new ArrayList<>();
        for (final Thread t : threads) {
            if (t != null && t.getName().startsWith("JS executor for")) {
                jsThreads.add(t);
            }
        }

        return jsThreads;
    }

    /**
     * Read the content of the given file using our classloader.
     *
     * @param fileName the file name
     * @return the content as string
     * @throws IOException in case of error
     */
    protected String getFileContent(final String fileName) throws IOException {
        final InputStream stream = getClass().getClassLoader().getResourceAsStream(fileName);
        assertNotNull(fileName, stream);
        return IOUtils.toString(stream, ISO_8859_1);
    }

}


text:
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using VkNet.Model;
using VkNet.Model.Attachments;
using VkNet.Model.RequestParams.Stories;
using VkNet.Utils;

namespace VkNet.Categories;

/// <inheritdoc/>
public partial class StoriesCategory
{
	/// <inheritdoc/>
	public Task<bool> BanOwnerAsync(IEnumerable<long> ownersIds) => TypeHelper.TryInvokeMethodAsync(() => BanOwner(ownersIds));

	/// <inheritdoc/>
	public Task<bool> DeleteAsync(long ownerId, ulong storyId) => TypeHelper.TryInvokeMethodAsync(() => Delete(ownerId, storyId));

	/// <inheritdoc/>
	public Task<StoryResult<IEnumerable<Story>>> GetAsync(long? ownerId = null, bool? extended = null) =>
		TypeHelper.TryInvokeMethodAsync(() => Get(ownerId, extended));

	/// <inheritdoc/>
	public Task<StoryResult<long>> GetBannedAsync(IEnumerable<string> fields = null, bool? extended = null) =>
		TypeHelper.TryInvokeMethodAsync(() => GetBanned(extended, fields));

	/// <inheritdoc/>
	public Task<StoryResult<Story>> GetByIdAsync(IEnumerable<string> stories, bool? extended = null, IEnumerable<string> fields = null) =>
		TypeHelper.TryInvokeMethodAsync(() => GetById(stories, extended, fields));

	/// <inheritdoc/>
	public Task<StoryServerUrl> GetPhotoUploadServerAsync(GetPhotoUploadServerParams @params) =>
		TypeHelper.TryInvokeMethodAsync(() => GetPhotoUploadServer(@params));

	/// <inheritdoc/>
	public Task<StoryResult<IEnumerable<Story>>> GetRepliesAsync(long ownerId, ulong storyId, string accessKey = null,
																bool? extended = null, IEnumerable<string> fields = null) =>
		TypeHelper.TryInvokeMethodAsync(() => GetReplies(ownerId, storyId, accessKey, extended, fields));

	/// <inheritdoc/>
	public Task<StoryStatsResult> GetStatsAsync(long ownerId, ulong storyId) =>
		TypeHelper.TryInvokeMethodAsync(() => GetStats(ownerId, storyId));

	/// <inheritdoc/>
	public Task<StoryServerUrl> GetVideoUploadServerAsync(GetVideoUploadServerParams @params) =>
		TypeHelper.TryInvokeMethodAsync(() => GetVideoUploadServer(@params));

	/// <inheritdoc/>
	public Task<VkCollection<long>> GetViewersAsync(long ownerId, ulong storyId, ulong? count = null, ulong? offset = null) =>
		TypeHelper.TryInvokeMethodAsync(() => GetViewers(ownerId, storyId, count, offset));

	/// <inheritdoc />
	public Task<VkCollection<User>> GetViewersExtendedAsync(long ownerId, ulong storyId, ulong? count = null, ulong? offset = null) =>
		TypeHelper.TryInvokeMethodAsync(() => GetViewersExtended(ownerId, storyId, count, offset));

	/// <inheritdoc/>
	public Task<bool> HideAllRepliesAsync(long ownerId) => TypeHelper.TryInvokeMethodAsync(() => HideAllReplies(ownerId));

	/// <inheritdoc/>
	public Task<bool> HideReplyAsync(long ownerId, ulong storyId, string accessKey = null) =>
		TypeHelper.TryInvokeMethodAsync(() => HideReply(ownerId, storyId, accessKey));

	/// <inheritdoc/>
	public Task<bool> UnbanOwnerAsync(IEnumerable<long> ownersIds) => TypeHelper.TryInvokeMethodAsync(() => UnbanOwner(ownersIds));

	/// <inheritdoc />
	public Task<VkCollection<Story>> SaveAsync(StoryServerUrl uploadResults, bool extended, IEnumerable<string> fields,
												CancellationToken token) =>
		TypeHelper.TryInvokeMethodAsync(() => Save(uploadResults, extended, fields));

	/// <inheritdoc />
	public Task<StoryResult<Story>> SearchAsync(StoriesSearchParams searchParams, CancellationToken token) =>
		TypeHelper.TryInvokeMethodAsync(() => Search(searchParams));

	/// <inheritdoc />
	public Task<bool> SendInteractionAsync(string accessKey, string message, bool? isBroadcast = null, bool? isAnonymous = null,
											bool? unseenMarker = null,
											CancellationToken token = default) => TypeHelper.TryInvokeMethodAsync(() =>
		SendInteraction(accessKey, message, isBroadcast, isAnonymous, unseenMarker));
}


text:
package com.cloud.resource;

import com.cloud.configuration.Config;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.dc.dao.DataCenterDao;
import com.cloud.framework.config.dao.ConfigurationDao;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.network.NetworkModel;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.net.UrlUtil;

import javax.inject.Inject;
import javax.naming.ConfigurationException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class DiscovererBase extends AdapterBase implements Discoverer {
    private static final Logger s_logger = LoggerFactory.getLogger(DiscovererBase.class);
    protected Map<String, String> _params;
    @Inject
    protected ClusterDao _clusterDao;
    @Inject
    protected ConfigurationDao _configDao;
    @Inject
    protected NetworkModel _networkMgr;
    @Inject
    protected HostDao _hostDao;
    @Inject
    protected ResourceManager _resourceMgr;
    @Inject
    protected DataCenterDao _dcDao;

    @Override
    public boolean configure(final String name, final Map<String, Object> params) throws ConfigurationException {
        _params = _configDao.getConfiguration(params);

        return true;
    }

    @Override
    public boolean start() {
        return true;
    }

    @Override
    public boolean stop() {
        return true;
    }

    protected Map<String, String> resolveInputParameters(final URL url) {
        final Map<String, String> params = UrlUtil.parseQueryParameters(url);

        return null;
    }

    @Override
    public void putParam(final Map<String, String> params) {
        if (_params == null) {
            _params = new HashMap<>();
        }
        _params.putAll(params);
    }

    @Override
    public ServerResource reloadResource(final HostVO host) {
        final String resourceName = host.getResource();
        final ServerResource resource = getResource(resourceName);

        if (resource != null) {
            _hostDao.loadDetails(host);
            updateNetworkLabels(host);

            final HashMap<String, Object> params = buildConfigParams(host);
            try {
                resource.configure(host.getName(), params);
            } catch (final ConfigurationException e) {
                s_logger.warn("Unable to configure resource due to " + e.getMessage());
                return null;
            }
            if (!resource.start()) {
                s_logger.warn("Unable to start the resource");
                return null;
            }
        }
        return resource;
    }

    protected ServerResource getResource(final String resourceName) {
        ServerResource resource = null;
        try {
            final Class<?> clazz = Class.forName(resourceName);
            final Constructor constructor = clazz.getConstructor();
            resource = (ServerResource) constructor.newInstance();
        } catch (final ClassNotFoundException e) {
            s_logger.warn("Unable to find class " + resourceName, e);
        } catch (final InstantiationException e) {
            s_logger.warn("Unablet to instantiate class " + resourceName, e);
        } catch (final IllegalAccessException e) {
            s_logger.warn("Illegal access " + resourceName, e);
        } catch (final SecurityException e) {
            s_logger.warn("Security error on " + resourceName, e);
        } catch (final NoSuchMethodException e) {
            s_logger.warn("NoSuchMethodException error on " + resourceName, e);
        } catch (final IllegalArgumentException e) {
            s_logger.warn("IllegalArgumentException error on " + resourceName, e);
        } catch (final InvocationTargetException e) {
            s_logger.warn("InvocationTargetException error on " + resourceName, e);
        }

        return resource;
    }

    private void updateNetworkLabels(final HostVO host) {
        //check if networkLabels need to be updated in details
        //we send only private and storage network label to the resource.
        final String privateNetworkLabel = _networkMgr.getDefaultManagementTrafficLabel(host.getDataCenterId(), host.getHypervisorType());
        final String storageNetworkLabel = _networkMgr.getDefaultStorageTrafficLabel(host.getDataCenterId(), host.getHypervisorType());

        final String privateDevice = host.getDetail("private.network.device");
        final String storageDevice = host.getDetail("storage.network.device1");

        boolean update = false;

        if (privateNetworkLabel != null && !privateNetworkLabel.equalsIgnoreCase(privateDevice)) {
            host.setDetail("private.network.device", privateNetworkLabel);
            update = true;
        }
        if (storageNetworkLabel != null && !storageNetworkLabel.equalsIgnoreCase(storageDevice)) {
            host.setDetail("storage.network.device1", storageNetworkLabel);
            update = true;
        }
        if (update) {
            _hostDao.saveDetails(host);
        }
    }

    protected HashMap<String, Object> buildConfigParams(final HostVO host) {
        final HashMap<String, Object> params = new HashMap<>(host.getDetails().size() + 5);
        params.putAll(host.getDetails());

        params.put("guid", host.getGuid());
        params.put("zone", Long.toString(host.getDataCenterId()));
        if (host.getPodId() != null) {
            params.put("pod", Long.toString(host.getPodId()));
        }
        if (host.getClusterId() != null) {
            params.put("cluster", Long.toString(host.getClusterId()));
            String guid = null;
            final ClusterVO cluster = _clusterDao.findById(host.getClusterId());
            if (cluster.getGuid() == null) {
                guid = host.getDetail("pool");
            } else {
                guid = cluster.getGuid();
            }
            if (guid != null && !guid.isEmpty()) {
                params.put("pool", guid);
            }
        }

        params.put("ipaddress", host.getPrivateIpAddress());
        params.put("secondary.storage.vm", "false");
        params.put("max.template.iso.size", _configDao.getValue(Config.MaxTemplateAndIsoSize.toString()));
        params.put("migratewait", _configDao.getValue(Config.MigrateWait.toString()));
        params.put(Config.XenServerMaxNics.toString().toLowerCase(), _configDao.getValue(Config.XenServerMaxNics.toString()));
        params.put(Config.XenServerHeartBeatInterval.toString().toLowerCase(), _configDao.getValue(Config.XenServerHeartBeatInterval.toString()));
        params.put(Config.XenServerHeartBeatTimeout.toString().toLowerCase(), _configDao.getValue(Config.XenServerHeartBeatTimeout.toString()));
        params.put("router.aggregation.command.each.timeout", _configDao.getValue(Config.RouterAggregationCommandEachTimeout.toString()));

        return params;
    }
}


text:
#pragma once
#include <aws/batch/Batch_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace Batch
{
namespace Model
{

  /**
   *
Specifies the configuration of a Kubernetes emptyDir volume. An
   * emptyDir volume is first created when a pod is assigned to a node.
   * It exists as long as that pod is running on that node. The emptyDir
   * volume is initially empty. All containers in the pod can read and write the
   * files in the emptyDir volume. However, the emptyDir
   * volume can be mounted at the same or different paths in each container. When a
   * pod is removed from a node for any reason, the data in the emptyDir
   * is deleted permanently. For more information, see emptyDir
   * in the Kubernetes documentation.

See Also:
   AWS
   * API Reference

   */
  class AWS_BATCH_API EksEmptyDir
  {
  public:
    EksEmptyDir();
    EksEmptyDir(Aws::Utils::Json::JsonView jsonValue);
    EksEmptyDir& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline const Aws::String& GetMedium() const{ return m_medium; }

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline bool MediumHasBeenSet() const { return m_mediumHasBeenSet; }

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline void SetMedium(const Aws::String& value) { m_mediumHasBeenSet = true; m_medium = value; }

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline void SetMedium(Aws::String&& value) { m_mediumHasBeenSet = true; m_medium = std::move(value); }

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline void SetMedium(const char* value) { m_mediumHasBeenSet = true; m_medium.assign(value); }

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline EksEmptyDir& WithMedium(const Aws::String& value) { SetMedium(value); return *this;}

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline EksEmptyDir& WithMedium(Aws::String&& value) { SetMedium(std::move(value)); return *this;}

    /**
     *
The medium to store the volume. The default value is an empty string, which
     * uses the storage of the node.

""

 (Default) Use
     * the disk storage of the node.

"Memory"

Use the
     * tmpfs volume that's backed by the RAM of the node. Contents of the
     * volume are lost when the node reboots, and any storage on the volume counts
     * against the container's memory limit.

     */
    inline EksEmptyDir& WithMedium(const char* value) { SetMedium(value); return *this;}

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline const Aws::String& GetSizeLimit() const{ return m_sizeLimit; }

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline bool SizeLimitHasBeenSet() const { return m_sizeLimitHasBeenSet; }

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline void SetSizeLimit(const Aws::String& value) { m_sizeLimitHasBeenSet = true; m_sizeLimit = value; }

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline void SetSizeLimit(Aws::String&& value) { m_sizeLimitHasBeenSet = true; m_sizeLimit = std::move(value); }

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline void SetSizeLimit(const char* value) { m_sizeLimitHasBeenSet = true; m_sizeLimit.assign(value); }

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline EksEmptyDir& WithSizeLimit(const Aws::String& value) { SetSizeLimit(value); return *this;}

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline EksEmptyDir& WithSizeLimit(Aws::String&& value) { SetSizeLimit(std::move(value)); return *this;}

    /**
     *
The maximum size of the volume. By default, there's no maximum size
     * defined.

     */
    inline EksEmptyDir& WithSizeLimit(const char* value) { SetSizeLimit(value); return *this;}

  private:

    Aws::String m_medium;
    bool m_mediumHasBeenSet = false;

    Aws::String m_sizeLimit;
    bool m_sizeLimitHasBeenSet = false;
  };

} // namespace Model
} // namespace Batch
} // namespace Aws


text:
namespace content {
class BrowserContext;
}
struct CacheParamsEfl;

class WebCacheManagerEfl : public content::NotificationObserver {
 public:
  explicit WebCacheManagerEfl(content::BrowserContext* browser_context);
  virtual ~WebCacheManagerEfl();

  // content::NotificationObserver implementation:
  virtual void Observe(int type,
                       const content::NotificationSource& source,
                       const content::NotificationDetails& details) override;
  void ClearCache();
  void SetCacheModel(tizen_webview::Cache_Model model);
  tizen_webview::Cache_Model GetCacheModel() const { return cache_model_; }
  void SetBrowserContext(content::BrowserContext* browser_context);

 private:
  static void CalculateCacheSizes(tizen_webview::Cache_Model cache_model, int64 memory_size, int64 disk_free_size,
      int64* cache_total_capacity, int64* cache_min_dead_capacity,
      int64* cache_max_dead_capacity, double* dead_decoded_data_deletion_interval,
      int64* page_cache_capacity, int64* url_cache_memory_capacity,
      int64* url_cache_disk_capacity);

  CacheParamsEfl GetCacheParamsFromModel(tizen_webview::Cache_Model);
  void SetRenderProcessCacheModel(tizen_webview::Cache_Model model, int render_process_id);

  content::NotificationRegistrar registrar_;
  std::set<int> renderers_;
  content::BrowserContext* browser_context_;
  tizen_webview::Cache_Model cache_model_;
  DISALLOW_COPY_AND_ASSIGN(WebCacheManagerEfl);
};

#endif