text:
//------------------------------------------------------------------------------
// <copyright file="MapLocalIIS.cs" company="Radacode">
//     Copyright (c) Company.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

using System;
using System.ComponentModel.Design;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.AccessControl;
using System.Text;
using System.Text.RegularExpressions;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.Web.Administration;
using PowerArm.Extension.Helpers;
using PowerArm.Extension.Managers;
using radacode.net.logger;
//using radacode.net.logger;
using Configuration = EnvDTE.Configuration;

namespace PowerArm.Extension.Commands
{
    /// <summary>
    /// Command handler
    /// </summary>
    internal sealed class MapLocalIIS
    {
        /// <summary>
        /// Command ID.
        /// </summary>
        public const int CommandId = 0x0300;

        /// <summary>
        /// Command menu group (command set GUID).
        /// </summary>
        public static readonly Guid CommandSet = Guids.PowerArmGroupGuid;

        /// <summary>
        /// VS Package that provides this command, not null.
        /// </summary>
        private readonly Package package;

        private readonly DTE dte;
        private IVsStatusbar statusbar;

        private string _mapLog;

        private bool _unloadedPresent;
        private string _unloadedProject;
        private string _poolAddingProjectTarget;
        private uint _poolAddingProjectMoniker;

        private ILogger _logger;

        /// <summary>
        /// Initializes a new instance of the <see cref="MapLocalIIS"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private MapLocalIIS(Package package, ILogger logger)
        {
            _logger = logger;

            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;

            dte = Package.GetGlobalService(typeof(SDTE)) as DTE;

            statusbar = Package.GetGlobalService(typeof(SVsStatusbar)) as IVsStatusbar;

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            if (commandService != null)
            {
                var menuCommandId = new CommandID(CommandSet, CommandId);
                var menuItem = new OleMenuCommand(this.MenuItemCallback, menuCommandId);
                menuItem.BeforeQueryStatus += MenuItemOnBeforeQueryStatus;

                commandService.AddCommand(menuItem);
            }

            _unloadedProject = String.Empty;
        }

        /// <summary>
        /// Gets the instance of the command.
        /// </summary>
        public static MapLocalIIS Instance
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets the service provider from the owner package.
        /// </summary>
        private IServiceProvider ServiceProvider
        {
            get
            {
                return this.package;
            }
        }

        /// <summary>
        /// Initializes the singleton instance of the command.
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        public static void Initialize(Package package, ILogger logger)
        {
            Instance = new MapLocalIIS(package, logger);
        }

        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            _logger?.Log($"MenuItemCallback in {this.ToString()} started.");

            this.CheckIfUnloadedFilesPresent();

            string message = _unloadedPresent
                ? "Unloaded projects are present."
                : "No unloaded project are in the solution. Nothing to map.";

            //_logger?.Log(message);

            string title = "Map Local IIS";

            if (!_unloadedPresent)
            {
                VsShellUtilities.ShowMessageBox(
                    this.ServiceProvider,
                    message,
                    title,
                    OLEMSGICON.OLEMSGICON_INFO,
                    OLEMSGBUTTON.OLEMSGBUTTON_OK,
                    OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
            }

            _mapLog = string.Empty;

            Window win = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
            OutputWindow ow = win.Object as OutputWindow;

            OutputWindowPane owP = null;

            if (ow.OutputWindowPanes != null)
            {
                for (uint i = 1; i <= ow.OutputWindowPanes.Count; i++)
                {
                    if (ow.OutputWindowPanes.Item(i).Name.Equals("Solution", StringComparison.CurrentCultureIgnoreCase))
                    {
                        owP = ow.OutputWindowPanes.Item(i);
                    }
                }
            }

            if (owP == null && string.IsNullOrEmpty(_unloadedProject)) return;
            if (owP == null && !string.IsNullOrEmpty(_unloadedProject))
            {
                this.ReloadProject(_unloadedProject);

                this.MenuItemCallback(sender, e);
                return;
            }

            var p = owP.TextDocument.StartPoint.CreateEditPoint();
            string s = p.GetText(owP.TextDocument.EndPoint);

            try
            {
                this.ProcessErrorMessage(s);
            }
            catch (Exception ex)
            {
                var preamble =
                    $"MenuItemCallback in {this.ToString()} encountered an error. The logic logged the following before failing: /n {_mapLog}";

                _logger?.Log(preamble);
                _logger?.Error($"The error is the following: {ex.Message}", ex.StackTrace);
            }

            _logger?.Log($"MenuItemCallback in {this.ToString()} finished.");
        }

        private void ProcessErrorMessage(string errorMessage)
        {
            //Trying to parse each line.
            var result = Regex.Split(errorMessage, "\r\n|\r|\n");

            foreach (var error in result)
            {
                try
                {
                    this.ProcessErrorEntry(error);
                }
                catch (Exception ex)
                {
                    VsShellUtilities.ShowMessageBox(
                        this.ServiceProvider,
                        "Log: " + Environment.NewLine + _mapLog
                        + Environment.NewLine +
                        "Error: " + Environment.NewLine + ex.Message,
                        "Error during mapping of the site",
                        OLEMSGICON.OLEMSGICON_INFO,
                        OLEMSGBUTTON.OLEMSGBUTTON_OK,
                        OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
                }
            }
        }

        private void ProcessErrorEntry(string error)
        {
            if (!error.Contains("is configured to use IIS.  "))
                return;

            string re1 = "([a-z]:\\\\(?:[-\\w\\.\\d]+\\\\)*(?:[-\\w\\.\\d]+)?)";    // Windows Path 1
            string re2 = ".*?"; // Non-greedy match on filler
            string re3 = "((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s\"]*))";    // HTTP URL 1

            Regex r = new Regex(re1 + re2 + re3, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            Match m = r.Match(error);
            if (m.Success)
            {
                String pathToProject = m.Groups[1].ToString();
                String url = m.Groups[2].ToString();

                Regex regexObj = new Regex(@"The Web Application Project (.+?) is configured to use IIS.");
                String projectName = regexObj.Match(error).Groups[1].Value;

                _mapLog = $"Parsed error successfully, parameters are {pathToProject}, {url}, {projectName}";

                this.MapInIIS(pathToProject, url, projectName);
            }
        }

        private void MapInIIS(string pathToProject, string url, string projectName)
        {
            if (url.EndsWith("'"))
                url = url.TrimEnd('\'');

            var uri = new Uri(url);

            var projectDir = Path.GetDirectoryName(pathToProject);

            using (ServerManager iisManager = new ServerManager())
            {
                if (!iisManager.ApplicationPools.Any(p => p.Name == projectName))
                {
                    ApplicationPool newPool = iisManager.ApplicationPools.Add(projectName);
                    newPool.ManagedRuntimeVersion = "v4.0";
                    iisManager.CommitChanges();
                }

                var site = iisManager.Sites.Add(projectName, uri.Scheme, $"*:{uri.Port}:{uri.DnsSafeHost}", projectDir);
                site.ApplicationDefaults.ApplicationPoolName = projectName;

                foreach (var item in site.Applications)
                {
                    item.ApplicationPoolName = projectName;
                }

                var config = iisManager.GetApplicationHostConfiguration();
                var anonymousAuthenticationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", projectName);
                anonymousAuthenticationSection["enabled"] = true;
                //use app pool user
                anonymousAuthenticationSection["userName"] = "";
                anonymousAuthenticationSection["password"] = "";

                iisManager.CommitChanges();

                var count = 0;

                while (!iisManager.Sites.Any(s => s.Name == projectName) && count < 20)
                {
                    System.Threading.Thread.Sleep(100);
                    count++;
                }

                _mapLog += Environment.NewLine + "Site added successfully.";

                try
                {
                    site.Start();
                    _mapLog += Environment.NewLine + "Site started";
                }
                catch (Exception ex)
                {
                    _mapLog += Environment.NewLine + "Site could not be started; Try starting it manually.";
                }
            }

            var hostsEntryExists = false;

            using(var reader = new StringReader(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/hosts")))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    if (line.Contains(" " + uri.DnsSafeHost))
                    {
                        hostsEntryExists = true;
                        break;
                    }
                }
            }

            if (!hostsEntryExists)
            {
                using (
                    StreamWriter w =
                        File.AppendText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
                            "drivers/etc/hosts")))
                {
                    w.WriteLine($"{w.NewLine}127.0.0.1 {uri.DnsSafeHost}");
                }
            }

            _mapLog += Environment.NewLine + "hosts written.";

            this.ReloadProject(projectName);

            foreach (EnvDTE.Project project in dte.Solution.Projects)
            {
                if (project.Name == projectName)
                {
                    _poolAddingProjectMoniker = (uint) project.Properties.Item("TargetFramework").Value;
                    _poolAddingProjectTarget = (string) project.Properties.Item("TargetFrameworkMoniker").Value;
                }
            }

            var shouldChangeAppPoolResult = VsShellUtilities.ShowMessageBox(
                this.ServiceProvider,
                $"Site {projectName} mapped in IIS. {Environment.NewLine}Would you like to change the created ApplicationPool's identitiy to NetworkService user and assign it read rights for the project folder?",
                "Change ApplicationPool Identitiy",
                OLEMSGICON.OLEMSGICON_QUERY,
                OLEMSGBUTTON.OLEMSGBUTTON_YESNO,
                OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);

            if (shouldChangeAppPoolResult == 6)
            {
                using (ServerManager iisManager = new ServerManager())
                {
                    var currentPool = iisManager.ApplicationPools.First(p => p.Name == projectName);
                    currentPool.ProcessModel.IdentityType = ProcessModelIdentityType.NetworkService;

                    //if (!_poolAddingProjectTarget.Contains(".NETFramework,"))
                    //{
                    //    currentPool.ManagedRuntimeVersion = "";
                    //}

                    iisManager.CommitChanges();
                }

                DirectorySecurity dir_security = Directory.GetAccessControl(projectDir);

                FileSystemAccessRule full_access_rule = new FileSystemAccessRule("NetworkService",
                    FileSystemRights.FullControl, InheritanceFlags.ContainerInherit |
                                                  InheritanceFlags.ObjectInherit, PropagationFlags.None,
                    AccessControlType.Allow);

                dir_security.AddAccessRule(full_access_rule);

                Directory.SetAccessControl(projectDir, dir_security);

                var command = new StringBuilder().Append("icacls").Append(" \"").Append(projectDir).Append("\\*\"")
                    .Append(" /q /c /t /reset").ToString();
                System.Diagnostics.Process process = new System.Diagnostics.Process();
                System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                startInfo.FileName = "cmd.exe";
                startInfo.Arguments = command;
                process.StartInfo = startInfo;
                process.Start();
            }

        }

        private void ReloadProject(string projectName)
        {
            string solutionName = Path.GetFileNameWithoutExtension(dte.Solution.FullName);

            dte.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer).Activate();
            ((DTE2)dte).ToolWindows.SolutionExplorer.GetItem(solutionName + @"\" + projectName).Select(vsUISelectionType.vsUISelectionTypeSelect);

            _mapLog += Environment.NewLine + "About to run reload";

            dte.ExecuteCommand("Project.ReloadProject");

            _mapLog += Environment.NewLine + "Poject reloaded";
        }

        private void CheckIfUnloadedFilesPresent()
        {
            foreach (EnvDTE.Project project in dte.Solution.Projects)
            {
                _unloadedPresent = false;

                if (
                    string.Compare(EnvDTE.Constants.vsProjectKindUnmodeled, project.Kind,
                        StringComparison.OrdinalIgnoreCase) == 0)
                {
                    _unloadedPresent = true;
                    _unloadedProject = project.Name;

                    break;
                }
            }
        }

        private void MenuItemOnBeforeQueryStatus(object sender, EventArgs eventArgs)
        {
            this.CheckIfUnloadedFilesPresent();

            var isAdmin = false;

            var menuCommand = sender as OleMenuCommand;

            if (ElevationChecker.CanCheckElevation)
            {
                isAdmin = ElevationChecker.IsElevated(System.Diagnostics.Process.GetCurrentProcess().Handle);
            }

            menuCommand.Enabled = _unloadedPresent && isAdmin && LocalIISChecker.LocalIISIsInstalled();
        }
    }
}


text:
package com.amazonaws.services.pinpoint.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteUserEndpointsResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    private EndpointsResponse endpointsResponse;

    /**
     * @param endpointsResponse
     */

    public void setEndpointsResponse(EndpointsResponse endpointsResponse) {
        this.endpointsResponse = endpointsResponse;
    }

    /**
     * @return
     */

    public EndpointsResponse getEndpointsResponse() {
        return this.endpointsResponse;
    }

    /**
     * @param endpointsResponse
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DeleteUserEndpointsResult withEndpointsResponse(EndpointsResponse endpointsResponse) {
        setEndpointsResponse(endpointsResponse);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getEndpointsResponse() != null)
            sb.append("EndpointsResponse: ").append(getEndpointsResponse());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DeleteUserEndpointsResult == false)
            return false;
        DeleteUserEndpointsResult other = (DeleteUserEndpointsResult) obj;
        if (other.getEndpointsResponse() == null ^ this.getEndpointsResponse() == null)
            return false;
        if (other.getEndpointsResponse() != null && other.getEndpointsResponse().equals(this.getEndpointsResponse()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getEndpointsResponse() == null) ? 0 : getEndpointsResponse().hashCode());
        return hashCode;
    }

    @Override
    public DeleteUserEndpointsResult clone() {
        try {
            return (DeleteUserEndpointsResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package cz.zcu.kiv.jop.context;

/**
 * This interface serves as abstraction of graph of dependencies between populated objects (between
 * each other). Each object can be related (dependent) on any number of dependencies but it cannot
 * create cycle (example: A -> B -> A). Because of that this graph can be also called as tree.
 * <p>
 * This dependency graph may be part of {@link PopulatingContext} for which stores relations between
 * classes (dependencies) and prevents loops between classes. The populated objects has to create
 * tree (graph without loops).
 *
 * @author Mr.FrAnTA
 * @since 1.0.0
 */
public interface DependencyGraph {

  /*
   * Note that this interface has no methods. It's caused by insufficient
   * idea of final form of dependency graph. The methods of this interface will
   * be added during implementation of this API.
   */

  // TODO Fill this interface by methods according the needs from implementation

}


text:
/**
 * @fileoverview A content-aware textarea control that grows and shrinks
 * automatically. This implementation extends {@link goog.ui.Control}.
 * This code is inspired by Dojo Dijit's Textarea implementation with
 * modifications to support native (when available) textarea resizing and
 * minHeight and maxHeight enforcement.
 *
 * @see ../demos/textarea.html
 */

goog.provide('goog.ui.Textarea');
goog.provide('goog.ui.Textarea.EventType');

goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.classlist');
goog.require('goog.events.EventType');
goog.require('goog.style');
goog.require('goog.ui.Control');
goog.require('goog.ui.TextareaRenderer');
goog.require('goog.userAgent');
goog.requireType('goog.events.BrowserEvent');
goog.requireType('goog.events.Event');
goog.requireType('goog.math.Box');

/**
 * A textarea control to handle growing/shrinking with textarea.value.
 *
 * @param {string} content Text to set as the textarea's value.
 * @param {goog.ui.TextareaRenderer=} opt_renderer Renderer used to render or
 *     decorate the textarea. Defaults to {@link goog.ui.TextareaRenderer}.
 * @param {goog.dom.DomHelper=} opt_domHelper Optional DOM helper, used for
 *     document interaction.
 * @constructor
 * @extends {goog.ui.Control}
 */
goog.ui.Textarea = function(content, opt_renderer, opt_domHelper) {
  'use strict';
  goog.ui.Control.call(
      this, content, opt_renderer || goog.ui.TextareaRenderer.getInstance(),
      opt_domHelper);

  this.setHandleMouseEvents(false);
  this.setAllowTextSelection(true);
  this.hasUserInput_ = (content != '');
  if (!content) {
    this.setContentInternal('');
  }
};
goog.inherits(goog.ui.Textarea, goog.ui.Control);

/**
 * Some UAs will shrink the textarea automatically, some won't.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.NEEDS_HELP_SHRINKING_ =
    !(goog.userAgent.IE && !goog.userAgent.isDocumentModeOrHigher(11));

/**
 * True if the resizing function is executing, false otherwise.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.isResizing_ = false;

/**
 * Represents if we have focus on the textarea element, used only
 * to render the placeholder if we don't have native placeholder
 * support.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.hasFocusForPlaceholder_ = false;

/**
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.hasUserInput_ = false;

/**
 * The height of the textarea as last measured.
 * @type {number}
 * @private
 */
goog.ui.Textarea.prototype.height_ = 0;

/**
 * A maximum height for the textarea. When set to 0, the default, there is no
 * enforcement of this value during resize.
 * @type {number}
 * @private
 */
goog.ui.Textarea.prototype.maxHeight_ = 0;

/**
 * A minimum height for the textarea. When set to 0, the default, there is no
 * enforcement of this value during resize.
 * @type {number}
 * @private
 */
goog.ui.Textarea.prototype.minHeight_ = 0;

/**
 * Whether or not textarea rendering characteristics have been discovered.
 * Specifically we determine, at runtime:
 *    If the padding and border box is included in offsetHeight.
 *    @see {goog.ui.Textarea.prototype.needsPaddingBorderFix_}
 *    If the padding and border box is included in scrollHeight.
 *    @see {goog.ui.Textarea.prototype.scrollHeightIncludesPadding_} and
 *    @see {goog.ui.Textarea.prototype.scrollHeightIncludesBorder_}
 * TODO(user): See if we can determine goog.ui.Textarea.NEEDS_HELP_SHRINKING_.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.hasDiscoveredTextareaCharacteristics_ = false;

/**
 * If a user agent doesn't correctly support the box-sizing:border-box CSS
 * value then we'll need to adjust our height calculations.
 * @see {goog.ui.Textarea.prototype.discoverTextareaCharacteristics_}
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.needsPaddingBorderFix_ = false;

/**
 * Whether or not scrollHeight of a textarea includes the padding box.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.scrollHeightIncludesPadding_ = false;

/**
 * Whether or not scrollHeight of a textarea includes the border box.
 * @type {boolean}
 * @private
 */
goog.ui.Textarea.prototype.scrollHeightIncludesBorder_ = false;

/**
 * For storing the padding box size during enterDocument, to prevent possible
 * measurement differences that can happen after text zooming.
 * Note: runtime padding changes will cause problems with this.
 * @type {goog.math.Box}
 * @private
 */
goog.ui.Textarea.prototype.paddingBox_;

/**
 * For storing the border box size during enterDocument, to prevent possible
 * measurement differences that can happen after text zooming.
 * Note: runtime border width changes will cause problems with this.
 * @type {goog.math.Box}
 * @private
 */
goog.ui.Textarea.prototype.borderBox_;

/**
 * Default text content for the textarea when it is unchanged and unfocussed.
 * We use the placeholder attribute for all browsers that have support for
 * it (new in HTML5 for the following browsers:
 *
 *   Internet Explorer 10.0
 *   Firefox 4.0
 *   Opera 11.6
 *   Chrome 4.0
 *   Safari 5.0
 *
 * For older browsers, we save the placeholderText_ and set it as the element's
 * value and add the TEXTAREA_PLACEHOLDER_CLASS to indicate that it's a
 * placeholder string.
 * @type {string}
 * @private
 */
goog.ui.Textarea.prototype.placeholderText_ = '';

/**
 * Constants for event names.
 * @enum {string}
 */
goog.ui.Textarea.EventType = {
  RESIZE: 'resize'
};

/**
 * Sets the default text for the textarea.
 * @param {string} text The default text for the textarea.
 */
goog.ui.Textarea.prototype.setPlaceholder = function(text) {
  'use strict';
  this.placeholderText_ = text;
  if (this.getElement()) {
    this.restorePlaceholder_();
  }
};

/**
 * @return {number} The padding plus the border box height.
 * @private
 */
goog.ui.Textarea.prototype.getPaddingBorderBoxHeight_ = function() {
  'use strict';
  var paddingBorderBoxHeight = this.paddingBox_.top + this.paddingBox_.bottom +
      this.borderBox_.top + this.borderBox_.bottom;
  return paddingBorderBoxHeight;
};

/**
 * @return {number} The minHeight value.
 */
goog.ui.Textarea.prototype.getMinHeight = function() {
  'use strict';
  return this.minHeight_;
};

/**
 * @return {number} The minHeight value with a potential padding fix.
 * @private
 */
goog.ui.Textarea.prototype.getMinHeight_ = function() {
  'use strict';
  var minHeight = this.minHeight_;
  var textarea = this.getElement();
  if (minHeight && textarea && this.needsPaddingBorderFix_) {
    minHeight -= this.getPaddingBorderBoxHeight_();
  }
  return minHeight;
};

/**
 * Sets a minimum height for the textarea, and calls resize if rendered.
 * @param {number} height New minHeight value.
 */
goog.ui.Textarea.prototype.setMinHeight = function(height) {
  'use strict';
  this.minHeight_ = height;
  this.resize();
};

/**
 * @return {number} The maxHeight value.
 */
goog.ui.Textarea.prototype.getMaxHeight = function() {
  'use strict';
  return this.maxHeight_;
};

/**
 * @return {number} The maxHeight value with a potential padding fix.
 * @private
 */
goog.ui.Textarea.prototype.getMaxHeight_ = function() {
  'use strict';
  var maxHeight = this.maxHeight_;
  var textarea = this.getElement();
  if (maxHeight && textarea && this.needsPaddingBorderFix_) {
    maxHeight -= this.getPaddingBorderBoxHeight_();
  }
  return maxHeight;
};

/**
 * Sets a maximum height for the textarea, and calls resize if rendered.
 * @param {number} height New maxHeight value.
 */
goog.ui.Textarea.prototype.setMaxHeight = function(height) {
  'use strict';
  this.maxHeight_ = height;
  this.resize();
};

/**
 * Sets the textarea's value.
 * @param {*} value The value property for the textarea, will be cast to a
 *     string by the browser when setting textarea.value.
 */
goog.ui.Textarea.prototype.setValue = function(value) {
  'use strict';
  this.setContent(String(value));
};

/**
 * Gets the textarea's value.
 * @return {string} value The value of the textarea.
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.getValue = function() {
  'use strict';
  // We potentially have the placeholder stored in the value.
  // If a client of this class sets this.getElement().value directly
  // we don't set the this.hasUserInput_ boolean. Thus, we need to
  // explicitly check if the value != the placeholder text. This has
  // the unfortunate edge case of:
  //   If the client sets this.getElement().value to the placeholder
  //   text, we'll return the empty string.
  // The normal use case shouldn't be an issue, however, since the
  // default placeholderText is the empty string. Also, if the end user
  // inputs text, then this.hasUserInput_ will always be true.
  if (this.getElement().value != this.placeholderText_ ||
      this.supportsNativePlaceholder_() || this.hasUserInput_) {
    // We don't do anything fancy here.
    return this.getElement().value;
  }
  return '';
};

/** @override */
goog.ui.Textarea.prototype.setContent = function(content) {
  'use strict';
  goog.ui.Textarea.superClass_.setContent.call(this, content);
  this.hasUserInput_ = (content != '');
  this.resize();
};

/**
 * @override *
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.setEnabled = function(enable) {
  'use strict';
  goog.ui.Textarea.superClass_.setEnabled.call(this, enable);
  this.getElement().disabled = !enable;
};

/**
 * Resizes the textarea vertically.
 */
goog.ui.Textarea.prototype.resize = function() {
  'use strict';
  if (this.getElement()) {
    this.grow_();
  }
};

/**
 * @return {boolean} True if the element supports the placeholder attribute.
 * @private
 */
goog.ui.Textarea.prototype.supportsNativePlaceholder_ = function() {
  'use strict';
  goog.asserts.assert(this.getElement());
  return 'placeholder' in this.getElement();
};

/**
 * Sets the value of the textarea element to the default text.
 * @private
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.restorePlaceholder_ = function() {
  'use strict';
  if (!this.placeholderText_) {
    // Return early if there is no placeholder to mess with.
    return;
  }
  // Check again in case something changed since this was scheduled.
  // We check that the element is still there since this is called by a timer
  // and the dispose method may have been called prior to this.
  if (this.supportsNativePlaceholder_()) {
    this.getElement().placeholder = this.placeholderText_;
  } else if (
      this.getElement() && !this.hasUserInput_ &&
      !this.hasFocusForPlaceholder_) {
    // We only want to set the value + placeholder CSS if we actually have
    // some placeholder text to show.
    goog.dom.classlist.add(
        goog.asserts.assert(this.getElement()),
        goog.ui.Textarea.TEXTAREA_PLACEHOLDER_CLASS);
    this.getElement().value = this.placeholderText_;
  }
};

/** @override **/
goog.ui.Textarea.prototype.enterDocument = function() {
  'use strict';
  goog.ui.Textarea.base(this, 'enterDocument');
  var textarea = this.getElement();

  // Eliminates the vertical scrollbar and changes the box-sizing mode for the
  // textarea to the border-box (aka quirksmode) paradigm.
  goog.style.setStyle(textarea, {
    'overflowY': 'hidden',
    'overflowX': 'auto',
    'boxSizing': 'border-box',
    'MsBoxSizing': 'border-box',
    'WebkitBoxSizing': 'border-box',
    'MozBoxSizing': 'border-box'
  });

  this.paddingBox_ = goog.style.getPaddingBox(textarea);
  this.borderBox_ = goog.style.getBorderBox(textarea);

  this.getHandler()
      .listen(textarea, goog.events.EventType.SCROLL, this.grow_)
      .listen(textarea, goog.events.EventType.FOCUS, this.grow_)
      .listen(textarea, goog.events.EventType.KEYUP, this.grow_)
      .listen(textarea, goog.events.EventType.MOUSEUP, this.mouseUpListener_)
      .listen(textarea, goog.events.EventType.BLUR, this.blur_);

  this.restorePlaceholder_();
  this.resize();
};

/**
 * Gets the textarea's content height + padding height + border height.
 * This is done by getting the scrollHeight and adjusting from there.
 * In the end this result is what we want the new offsetHeight to equal.
 * @return {number} The height of the textarea.
 * @private
 */
goog.ui.Textarea.prototype.getHeight_ = function() {
  'use strict';
  this.discoverTextareaCharacteristics_();
  var textarea = this.getElement();
  // Because enterDocument can be called even when the component is rendered
  // without being in a document, we may not have cached the correct paddingBox
  // data on render(). We try to make up for this here.
  if (isNaN(this.paddingBox_.top)) {
    this.paddingBox_ = goog.style.getPaddingBox(textarea);
    this.borderBox_ = goog.style.getBorderBox(textarea);
  }
  // Accounts for a possible (though unlikely) horizontal scrollbar.
  var height =
      this.getElement().scrollHeight + this.getHorizontalScrollBarHeight_();
  if (this.needsPaddingBorderFix_) {
    height -= this.getPaddingBorderBoxHeight_();
  } else {
    if (!this.scrollHeightIncludesPadding_) {
      var paddingBox = this.paddingBox_;
      var paddingBoxHeight = paddingBox.top + paddingBox.bottom;
      height += paddingBoxHeight;
    }
    if (!this.scrollHeightIncludesBorder_) {
      var borderBox = goog.style.getBorderBox(textarea);
      var borderBoxHeight = borderBox.top + borderBox.bottom;
      height += borderBoxHeight;
    }
  }
  return height;
};

/**
 * Sets the textarea's height.
 * @param {number} height The height to set.
 * @private
 */
goog.ui.Textarea.prototype.setHeight_ = function(height) {
  'use strict';
  if (this.height_ != height) {
    this.height_ = height;
    this.getElement().style.height = height + 'px';
  }
};

/**
 * Sets the textarea's rows attribute to be the number of newlines + 1.
 * This is necessary when the textarea is hidden, in which case scrollHeight
 * is not available.
 * @private
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.setHeightToEstimate_ = function() {
  'use strict';
  var textarea = this.getElement();
  textarea.style.height = 'auto';
  var newlines = textarea.value.match(/\n/g) || [];
  textarea.rows = newlines.length + 1;
  this.height_ = 0;
};

/**
 * Gets the height of (possibly present) horizontal scrollbar.
 * @return {number} The height of the horizontal scrollbar.
 * @private
 */
goog.ui.Textarea.prototype.getHorizontalScrollBarHeight_ = function() {
  'use strict';
  var textarea = /** @type {!HTMLElement} */ (this.getElement());
  var height = textarea.offsetHeight - textarea.clientHeight;
  if (!this.scrollHeightIncludesPadding_) {
    var paddingBox = this.paddingBox_;
    var paddingBoxHeight = paddingBox.top + paddingBox.bottom;
    height -= paddingBoxHeight;
  }
  if (!this.scrollHeightIncludesBorder_) {
    var borderBox = goog.style.getBorderBox(textarea);
    var borderBoxHeight = borderBox.top + borderBox.bottom;
    height -= borderBoxHeight;
  }
  // Prevent negative number results, which sometimes show up.
  return height > 0 ? height : 0;
};

/**
 * In order to assess the correct height for a textarea, we need to know
 * whether the scrollHeight (the full height of the text) property includes
 * the values for padding and borders. We can also test whether the
 * box-sizing: border-box setting is working and then tweak accordingly.
 * Instead of hardcoding a list of currently known behaviors and testing
 * for quirksmode, we do a runtime check out of the flow. The performance
 * impact should be very small.
 * @private
 */
goog.ui.Textarea.prototype.discoverTextareaCharacteristics_ = function() {
  'use strict';
  if (!this.hasDiscoveredTextareaCharacteristics_) {
    var textarea =
        /** @type {!HTMLElement} */ (this.getElement().cloneNode(false));
    // We need to overwrite/write box model specific styles that might
    // affect height.
    goog.style.setStyle(textarea, {
      'position': 'absolute',
      'height': 'auto',
      'top': '-9999px',
      'margin': '0',
      'padding': '1px',
      'border': '1px solid #000',
      'overflow': 'hidden'
    });
    goog.dom.appendChild(this.getDomHelper().getDocument().body, textarea);
    var initialScrollHeight = textarea.scrollHeight;

    textarea.style.padding = '10px';
    var paddingScrollHeight = textarea.scrollHeight;
    this.scrollHeightIncludesPadding_ =
        paddingScrollHeight > initialScrollHeight;

    initialScrollHeight = paddingScrollHeight;
    textarea.style.borderWidth = '10px';
    var borderScrollHeight = textarea.scrollHeight;
    this.scrollHeightIncludesBorder_ = borderScrollHeight > initialScrollHeight;

    // Tests if border-box sizing is working or not.
    textarea.style.height = '100px';
    var offsetHeightAtHeight100 = textarea.offsetHeight;
    if (offsetHeightAtHeight100 != 100) {
      this.needsPaddingBorderFix_ = true;
    }

    goog.dom.removeNode(textarea);
    this.hasDiscoveredTextareaCharacteristics_ = true;
  }
};

/**
 * The CSS class name to add to the input when the user has not entered a
 * value.
 */
goog.ui.Textarea.TEXTAREA_PLACEHOLDER_CLASS =
    goog.getCssName('textarea-placeholder-input');

/**
 * Called when the element goes out of focus.
 * @param {goog.events.Event=} opt_e The browser event.
 * @private
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.blur_ = function(opt_e) {
  'use strict';
  if (!this.supportsNativePlaceholder_()) {
    this.hasFocusForPlaceholder_ = false;
    if (this.getElement().value == '') {
      // Only transition to the default text if we have
      // no user input.
      this.hasUserInput_ = false;
      this.restorePlaceholder_();
    }
  }
};

/**
 * Resizes the textarea to grow/shrink to match its contents.
 * @param {goog.events.Event=} opt_e The browser event.
 * @private
 * @suppress {strictMissingProperties} Part of the go/strict_warnings_migration
 */
goog.ui.Textarea.prototype.grow_ = function(opt_e) {
  'use strict';
  if (this.isResizing_) {
    return;
  }
  var textarea = /** @type {!HTMLElement} */ (this.getElement());
  // If the element is getting focus and we don't support placeholders
  // natively, then remove the placeholder class.
  if (!this.supportsNativePlaceholder_() && opt_e &&
      opt_e.type == goog.events.EventType.FOCUS) {
    // We must have a textarea element, since we're growing it.
    // Remove the placeholder CSS + set the value to empty if we're currently
    // showing the placeholderText_ value if this is the first time we're
    // getting focus.
    if (textarea.value == this.placeholderText_ && this.placeholderText_ &&
        !this.hasFocusForPlaceholder_) {
      goog.dom.classlist.remove(
          textarea, goog.ui.Textarea.TEXTAREA_PLACEHOLDER_CLASS);
      textarea.value = '';
    }
    this.hasFocusForPlaceholder_ = true;
    this.hasUserInput_ = (textarea.value != '');
  }
  var shouldCallShrink = false;
  this.isResizing_ = true;
  var oldHeight = this.height_;
  if (textarea.scrollHeight) {
    var setMinHeight = false;
    var setMaxHeight = false;
    var newHeight = this.getHeight_();
    var currentHeight = textarea.offsetHeight;
    var minHeight = this.getMinHeight_();
    var maxHeight = this.getMaxHeight_();
    if (minHeight && newHeight < minHeight) {
      this.setHeight_(minHeight);
      setMinHeight = true;
    } else if (maxHeight && newHeight > maxHeight) {
      this.setHeight_(maxHeight);
      // If the content is greater than the height, we'll want the vertical
      // scrollbar back.
      textarea.style.overflowY = '';
      setMaxHeight = true;
    } else if (currentHeight != newHeight) {
      this.setHeight_(newHeight);
      // Makes sure that height_ is at least set.
    } else if (!this.height_) {
      this.height_ = newHeight;
    }
    if (!setMinHeight && !setMaxHeight &&
        goog.ui.Textarea.NEEDS_HELP_SHRINKING_) {
      shouldCallShrink = true;
    }
  } else {
    this.setHeightToEstimate_();
  }
  this.isResizing_ = false;

  if (shouldCallShrink) {
    this.shrink_();
  }
  if (oldHeight != this.height_) {
    this.dispatchEvent(goog.ui.Textarea.EventType.RESIZE);
  }
};

/**
 * Resizes the textarea to shrink to fit its contents. The way this works is
 * by increasing the padding of the textarea by 1px (it's important here that
 * we're in box-sizing: border-box mode). If the size of the textarea grows,
 * then the box is filled up to the padding box with text.
 * If it doesn't change, then we can shrink.
 * @private
 */
goog.ui.Textarea.prototype.shrink_ = function() {
  'use strict';
  var textarea = this.getElement();
  if (!this.isResizing_) {
    this.isResizing_ = true;
    var scrollHeight = textarea.scrollHeight;
    if (!scrollHeight) {
      this.setHeightToEstimate_();
    } else {
      var currentHeight = this.getHeight_();
      var minHeight = this.getMinHeight_();
      if (!(minHeight && currentHeight <= minHeight)) {
        // Nudge the padding by 1px.
        var paddingBox = this.paddingBox_;
        textarea.style.paddingTop = paddingBox.top + 1 + 'px';
        var heightAfterNudge = this.getHeight_();
        // If the one px of padding had no effect, then we can shrink.
        if (heightAfterNudge == currentHeight) {
          textarea.style.paddingTop = paddingBox.top + scrollHeight + 'px';
          textarea.scrollTop = 0;
          var shrinkToHeight = this.getHeight_() - scrollHeight;
          if (shrinkToHeight >= minHeight) {
            this.setHeight_(shrinkToHeight);
          } else {
            this.setHeight_(minHeight);
          }
        }
        textarea.style.paddingTop = paddingBox.top + 'px';
      }
    }
    this.isResizing_ = false;
  }
};

/**
 * We use this listener to check if the textarea has been natively resized
 * and if so we reset minHeight so that we don't ever shrink smaller than
 * the user's manually set height. Note that we cannot check size on mousedown
 * and then just compare here because we cannot capture mousedown on
 * the textarea resizer, while mouseup fires reliably.
 * @param {goog.events.BrowserEvent} e The mousedown event.
 * @private
 */
goog.ui.Textarea.prototype.mouseUpListener_ = function(e) {
  'use strict';
  var textarea = /** @type {!HTMLElement} */ (this.getElement());
  var height = textarea.offsetHeight;

  // This solves for when the MSIE DropShadow filter is enabled,
  // as it affects the offsetHeight value, even with MsBoxSizing:border-box.
  if (textarea['filters'] && textarea['filters'].length) {
    var dropShadow =
        textarea['filters']['item']('DXImageTransform.Microsoft.DropShadow');
    if (dropShadow) {
      height -= dropShadow['offX'];
    }
  }

  if (height != this.height_) {
    this.minHeight_ = height;
    this.height_ = height;
  }
};


text:
"use strict";

var _ = require('underscore');

function Namespace(client, url) {
    this.client = client;
    if (url) {
        this.baseUrl = url;
    }
}
Namespace.prototype.baseUrl = 'http://api.worksnaps.com/api';
Namespace.prototype.apiUrl = null;
Namespace.prototype.rootTag = null;

Namespace.prototype.getFullUrl = function (url) {
    return this.baseUrl + this.apiUrl + (url ? '/' + url : '');
};

Namespace.prototype.get = function (url, query, data) {
    var that = this;
    url = this.getFullUrl(url);
    return this.client.get(url, query, data).then(function (result) {
        return result[that.rootTag];
    });
};

Namespace.prototype.post = function (url, query, data) {
    return this.client.post(this.getFullUrl(url), query, data);
};

Namespace.prototype.put = function (url, query, data) {
    return this.client.put(this.getFullUrl(url), query, data);
};

Namespace.prototype.remove = function (url, query, data) {
    return this.client.remove(this.getFullUrl(url), query, data);
};

module.exports = Namespace;


text:
'use strict';

angular.module('yeoMeanApp')
    .directive('markdown', function ($http, $timeout) {
        var converter = new Showdown.converter();
        return {
            restrict: 'A',
            scope: { link: '@' },
            link: function (scope, element, attrs) {
                $timeout(function() {
                    attrs.$observe('link', function (link) {
                        $http.get('/assets/' + link).success(function (response) {
                            var htmlText = converter.makeHtml(response);
                            element.html(htmlText);
                        });
                    });
                });
            }
        };
    });


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Rysslands, Finlands och den Skandinaviska Halföns. Hattsvampar 445 (1879)

#### Original name
Tubaria paludosa f. paludosa

### Remarks
null


text:
from flask import Flask
from flask import render_template, jsonify, request, g, abort, redirect, url_for

import json

#from xinui.rest import Rest
from rest import Rest

app = Flask(__name__)

global_flow_table = {}

# Summary page
@app.route("/")
def summary():
    sw_desc = Rest.get_switch_desc()
    if sw_desc is False:
        abort(404)
    return render_template("summary.html", sw_desc=sw_desc)

# Policy page
@app.route("/policy/")
def policy():
    sw_dpid_list = Rest.get_switch_list()

    if sw_dpid_list is False:
        abort(404)

    return render_template("policy.html", sw_dpid_list=sw_dpid_list)

@app.route("/policy/<dpid>")
def dpid_policy(dpid):
    sw_dpid_list = Rest.get_switch_list()

    if sw_dpid_list is False or int(dpid) not in sw_dpid_list:
        abort(404)

    flow_table = None
    flow_table = Rest.get_flow_table(dpid)
    global global_flow_table
    global_flow_table = flow_table
    port = Rest.get_switch_port(dpid)

    return render_template("policy.html", sw_dpid_list=sw_dpid_list, dpid=dpid, port=port, flow_table=flow_table)

# Topology page
@app.route("/topology")
def topology():
    topo = Rest.get_topology()
    return render_template("topology.html", topo=topo)

@app.route("/_query_flow/")
def query_flow(dpid):
    #dpid = request.args.get("dpid")
    flow_table = Rest.get_flow_table(dpid)

    #print flow_table

    return render_template("policy.html", flow_table=flow_table)
    #return jsonify(flow_table)

@app.route("/_query_port")
def query_port():
    dpid = request.args.get("dpid")
    port = Rest.get_switch_port(dpid)

    return jsonify(port)

@app.route("/_add_flow", methods=["POST"])
def add_flow():
    req = json.loads(request.form["flow_cmd"])

    flow_cmd = {}
    match_dict = {}
    action_list = []

    flow_cmd["dpid"] = req["common"]["dpid"]
    flow_cmd["priority"] = req["common"]["priority"]
    flow_cmd["idle_timeout"] = req["common"]["idle"]
    flow_cmd["hard_timeout"] = req["common"]["hard"]

    if req["match"]["input"] != "Any":
        match_dict["in_port"] = int(req["match"]["input"])

    if req["match"]["dl_saddr"] != "None":
        match_dict["dl_src"] = req["match"]["dl_saddr"]

    if req["match"]["dl_daddr"] != "None":
        match_dict["dl_dst"] = req["match"]["dl_daddr"]

    if req["match"]["nw_saddr"] != "None":
        match_dict["nw_src"] = req["match"]["nw_saddr"]

    if req["match"]["nw_daddr"] != "None":
        match_dict["nw_dst"] = req["match"]["nw_daddr"]

    if req["match"]["nw_saddr"] != "None" or req["match"]["nw_daddr"] != "None" or req["match"]["l4_proto"]:
        match_dict["dl_type"] = 2048

    if req["match"]["l4_proto"] != "None":
        if req["match"]["l4_proto"] == "TCP":
            match_dict["nw_proto"] = 6
        elif req["match"]["l4_proto"] == "UDP":
            match_dict["nw_proto"] = 17

    if req["match"]["sport"] != "None":
        match_dict["tp_src"] = int(req["match"]["sport"])

    if req["match"]["dport"] != "None":
        match_dict["tp_dst"] = int(req["match"]["dport"])

    if req["match"]["vlan_id"] != "None":
        match_dict["dl_vlan"] = int(req["match"]["vlan_id"])

    if req["action"]["output"] != "Drop":
        for value in req["action"]["output"].split(" "):
            action_dict = {}
            action_dict["port"] = int(value)
            action_dict["type"] = "OUTPUT"
            action_list.append(action_dict)

    if req["action"]["vlan_action"] != "None":
        if "Strip" in req["action"]["vlan_action"]:
            action_dict = {}
            action_dict["type"] = "POP_VLAN"
            action_list.append(action_dict)
        elif "Swap" in req["action"]["vlan_action"]:
            action_dict = {}
            action_dict["field"] = "vlan_vid"
            action_dict["value"] = req["action"]["vlan_action"].split(" ")[-1]
            action_dict["type"] = "SET_FIELD"
            action_list.append(action_dict)
        elif "New" in req["action"]["vlan_action"]:
            push_vlan_dict = {}
            push_vlan_dict["ethertype"] = 33024
            push_vlan_dict["type"] = "PUSH_VLAN"
            action_list.append(push_vlan_dict)

            action_dict = {}
            action_dict["field"] = "vlan_vid"
            action_dict["value"] = req["action"]["vlan_action"].split(" ")[-1]
            action_dict["type"] = "SET_FIELD"
            action_list.append(action_dict)

    flow_cmd["match"] = match_dict
    flow_cmd["actions"] = action_list

    #print json.dumps(flow_cmd)
    Rest.add_flow(json.dumps(flow_cmd))

    return "foo"

@app.route("/_del_flow", methods=["POST"])
def del_flow():
    index = request.form["index"]

    flow_cmd = {}
    match_dict = {}

    for key, list in global_flow_table.iteritems():
        flow_cmd["dpid"] = key
        match_dict = list[int(index)]["match"]

    flow_cmd["match"] = match_dict
    #print json.dumps(flow_cmd)

    Rest.del_flow(json.dumps(flow_cmd))
    return "foo"

@app.errorhandler(404)
def page_not_found(error):
    return render_template("page_not_found.html"), 404

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5566, debug=False)


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <base data-ice="baseUrl" href="">
  <title data-ice="title">Source | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">

  Home

  Reference
  Source
  Test
  Repository

    <input class="search-input">

CGitHubConnector

CGithubConnectorHooks

Fpoll

EOAuth2ConnectorBase

views
CEditForm

Source 4/24

      File
      Identifier
      Document
      Size
      Lines
      Updated

      src/connector.js
      GitHubConnector
      28 %2/7
      2591 byte
      84
      2016-04-06 03:07:00 (UTC)

      src/hooks.js
      GithubConnectorHooks
      40 %2/5
      611 byte
      31
      2016-04-06 07:51:23 (UTC)

      src/poll.js
      poll
      0 %0/1
      3056 byte
      89
      2016-03-05 20:15:15 (UTC)

      src/views/edit.js
      EditForm
      0 %0/11
      3383 byte
      99
      2016-04-02 09:11:19 (UTC)

  Generated by ESDoc(0.4.6)


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sokoban.FredTethMerge;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;

import sokoban.BoardPosition;
import sokoban.NodeType;
import sokoban.Direction;

/**
 *
 * @author figgefred
 */
public class LiveAnalyser {

	private PathFinder pathfinder;
        private Map<BoardState, List<CorralArea>> CachedAreas;
        private Map<BoardState, Map<BoardPosition, Integer>> HeuristicCache;
        private Map<BoardState, Map<BoardPosition, Boolean>> DeadlockCache;
        private static boolean VERBOSE = Player.VERBOSE;

	public LiveAnalyser(PathFinder finder)
	{
		this.pathfinder = finder;
                if(Player.DO_CORRAL_CACHING)
                    CachedAreas = new HashMap<>();
                if(Player.DO_HEURISTIC_CACHING)
                {
                    HeuristicCache = new HashMap<>();
                }
	}

	private boolean is4x4BlockTopLeftCorner(BoardState board, BoardPosition pos) {
		if(!board.isBlockingNode(pos))
			return false;

		NodeType nodes[] = new NodeType[] {
			board.get(pos.Row, pos.Column),
			board.get(pos.Row, pos.Column+1),
			board.get(pos.Row+1, pos.Column),
			board.get(pos.Row+1, pos.Column+1)
		};

		boolean atLeastOneIsBlock = false;
		for(NodeType node : nodes)
		{
			if(!board.isBlockingNode(node))
				return false;
			atLeastOneIsBlock = atLeastOneIsBlock || node == NodeType.BLOCK;
		}

		return (atLeastOneIsBlock);
	}

	public boolean is4x4Block(BoardState board, BoardPosition block) {
		BoardPosition leftDown = new BoardPosition(block.Row-1, block.Column-1);
		BoardPosition leftTop = new BoardPosition(block.Row, block.Column-1);
		BoardPosition rightDown = new BoardPosition(block.Row-1, block.Column);
		return is4x4BlockTopLeftCorner(board, block)
				|| is4x4BlockTopLeftCorner(board, leftDown)
				|| is4x4BlockTopLeftCorner(board, rightDown)
				|| is4x4BlockTopLeftCorner(board, leftTop);
	}

        public boolean setHeuristic(BoardState state, BoardPosition blockPushed, int val)
        {
            if(Player.DO_HEURISTIC_CACHING)
            {
                Map<BoardPosition, Integer> map = HeuristicCache.get(state);
                if(map == null)
                {
                    map = new HashMap<>();
                    HeuristicCache.put(state, map);
                }
                return (map.put(blockPushed, val)!= null);
            }
            return false;
        }

        public Integer getHeuristicCacheVal(BoardState state, BoardPosition blockPushed)
        {
            if(Player.DO_HEURISTIC_CACHING)
            {
                Map<BoardPosition, Integer> map = HeuristicCache.get(state);
                if(map == null)
                    return null;
                else
                    return map.get(blockPushed);
            }
            else
                return null;
        }

    private boolean isBlockType(NodeType type)
    {
        return type == NodeType.BLOCK || type == NodeType.BLOCK_ON_GOAL;
    }

    private boolean isBlockingType(NodeType type)
    {
        return isBlockType(type) || type == NodeType.WALL;
    }

    private List<CorralArea> getCachedArea(BoardState state)
    {
        if(CachedAreas == null)
            return null;
        return CachedAreas.get(state);
    }

    /**
     * Returns a list of corral areas and (or only) the area of where the
     * player is.
     *
     * A corral area is an area which a player cannot reach except by pushing
     * a block.
     *
     * CorralArea's will hold a field pointing to a list of blocks that are acting
     * as fences (creating the corrol fence). These should be prioritized so that
     * a corral area can be solved as fast as possible. This is so called 'corrol pruning'.
     *
     * @param board
     * @return
     */
    public List<CorralArea> getAreas(BoardState board)
    {
        List<CorralArea> list = null;
        if(Player.DO_CORRAL_CACHING)
        {
            list = getCachedArea(board);
            if(list != null)
            {
                return list;
            }
        }
        // A list containing all the nodes "visited"
        Set<BoardPosition> visited = new HashSet<>();
        list = new ArrayList<>();

        int areaCounter = 1;

        //**************************//
        // Iterpret areas from map //
        //*********************** //

        for(int r = 0; r < board.getRowsCount(); r++)
        {
            for(int c = 0; c < board.getColumnsCount(); c++)
            {
                BoardPosition p = new BoardPosition(r,c);
                NodeType nodeType = board.get(p);

                if( !visited.contains(p) && nodeType.isSpaceNode() )
                {
                    CorralArea area = new CorralArea(areaCounter++, board);
                    setCorralArea(board, area, p, visited);
                    list.add(area);
                }
            }
        }

        // If there is only a play area there is no point to continue
        if(list.size() <= 1)
            return list;

        //**************************//
        // Find the corral fences  //
        //*********************** //

        // !!!!!!!!!!!!!!
        // The following code segments can probably be implemented in a better way.
        // !!!!!!!!!!!!!!

        // A list of block nodes that are fence candidates for the corral areas
        Map<BoardPosition, CorralFenceCandidate> fenceCandidates = new HashMap<>();

        // This part is crucial, we must find out which blocks are 'touched'
        // by more then 1 area
        for(CorralArea a: list)
        {
            //for(BoardPosition p: board.getBlockNodes())
            for(BoardPosition p: a.getAreaPositions())
            {
                if(board.get(p).isBlockNode())
                {
                    // For every a try to match every block
                    CorralFenceCandidate c = fenceCandidates.get(p);
                    if(c == null)
                    {
                        c = new CorralFenceCandidate(p);
                        fenceCandidates.put(p, c);
                    }
                    c.addCorralArea(a);
                }
            }
        }

        //******************************//
        // Add the fences to the area **//
        //******************************//

        // Naive merge
        for(CorralFenceCandidate f : fenceCandidates.values())
        {
            for(CorralArea a: list)
            {
                if(f.isNodeOf(a))
                {
                    if(f.isPartOfCorralAreaFence())
                    {
                        a.addAsFenceNode(f.getBoardPosition(), board.get(f.getBoardPosition()));
                    }
                    else
                    {
                        a.add(f.getBoardPosition(), board.get(f.getBoardPosition()));
                    }
                }
            }
        }
        if(Player.DO_CORRAL_CACHING)
            CachedAreas.put(board, list);

        return list;
    }

    private void setCorralArea(BoardState board, CorralArea area, BoardPosition spaceNode, Set<BoardPosition> visited)
    {
        NodeType nodeType = board.get(spaceNode);
        area.add(spaceNode, nodeType);
        visited.add(spaceNode);

        for(BoardPosition neighbour: board.getNeighbours(spaceNode))
        {
            NodeType neighbourType = board.get(neighbour);
            if( !visited.contains(neighbour) && ( neighbourType.isSpaceNode()) )
            {
                // If unvisited expand!
                setCorralArea(board, area, neighbour, visited);
            }
            else if(neighbourType.isBlockNode())
            {
                //area.add(neighbour, neighbourType);
                visitNeighbouringBlocks(board, area, neighbour, new HashSet<BoardPosition>());
            }
        }
    }

    private void visitNeighbouringBlocks(BoardState board, CorralArea area, BoardPosition blockNode, Set<BoardPosition> visited)
    {
        NodeType nodeType = board.get(blockNode);
        area.add(blockNode, nodeType);
        visited.add(blockNode);
        for(BoardPosition blockNeighbour: board.getNeighbours(blockNode))
        {
            NodeType neighbourType = board.get(blockNeighbour);
            if( !visited.contains(blockNeighbour) && ( neighbourType.isBlockNode()) )
            {
                // If unvisited expand!
                visitNeighbouringBlocks(board, area, blockNeighbour, visited);
            }
        }
    }

	public static void main(String[] args) throws IOException, InterruptedException {
//		BoardState board = BoardState.getBoardFromFile("testing/simpleplaytest4");

		Vector<String> b = new Vector<String>();

		BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in));

		String line;
                line = br.readLine();
		while(line != null) {
                    if(line.equals(""))
                        break;
                    b.add(line);
                    line = br.readLine();
		} // End while

                Player.DO_BIPARTITE_MATCHING = true;
                Player.DO_CORRAL_LIVE_DETECTION = true;
                Player.DO_DEADLOCKS_CONSTANTCHECK = true;
                Player.DO_DEADLOCKS_4x4 = true;
                Player.DO_GOAL_SORTING = false;

		//System.out.println(board);
		BoardState board = new BoardState(b, true);
                PathFinder pFinder = new PathFinder();
                LiveAnalyser liveAnalyser = new LiveAnalyser(pFinder);

                List<CorralArea> areas = liveAnalyser.getAreas(board);
                for(CorralArea a: areas)
                {
                    System.out.println(a);
                }

	//	Player noob = new Player(board);
		//System.out.println(noob.play());
	}

    public boolean isBadState(BoardState state, BoardPosition block)
    {
        return
            is4x4Block(state, block)
            ||
            isFrozenDeadlockState(state, new HashSet<BoardPosition>(),block)
            ;
    }

    public boolean isBadState(BoardState board)
    {
    	for(BoardPosition block : board.getBlockNodes())
    		if(board.get(block) == NodeType.BLOCK && isBadState(board, block)) {
    			return true;
    		}

    	return false;
    }

    public boolean isFrozenDeadlockState(BoardState state, Set<BoardPosition> tmpBlock, BoardPosition block)
    {
        if(DeadlockCache == null)
            DeadlockCache = new HashMap<>();
        Map<BoardPosition, Boolean> map = DeadlockCache.get(state);
        if(map != null)
        {
            Boolean b = map.get(state);
            if(b != null)
                return b.booleanValue();
        }

        int r = block.Row;
        int c = block.Column;

        BoardPosition left = new BoardPosition(r, c-1);
        BoardPosition right = new BoardPosition(r, c+1);
        BoardPosition up = new BoardPosition(r-1, c);
        BoardPosition down = new BoardPosition(r+1, c);

        //***************//
        // WALL BLOCKING //
        //***************//

        // Check if there are any walls blocking horizontally
        // Or of course if there is any block already checked that is blocking
        boolean horizontalWallBlocking = (left.Column >= 0 && state.get(left) == NodeType.WALL)
			|| (right.Column < state.getColumnsCount() && state.get(right) == NodeType.WALL);

        horizontalWallBlocking = horizontalWallBlocking ||
        		((left.Column >= 0 ) &&
        				(right.Column < state.getColumnsCount()));

        // Check same as above just vertical
        boolean verticalWallBlocking = (up.Row >= 0 && state.get(up) == NodeType.WALL)
                || (down.Row < state.getRowsCount() && state.get(down) == NodeType.WALL)
                || ((up.Row >= 0 )
                && (down.Row < state.getRowsCount() ));

        // Can block be moved?
        // Note we have to iterate over all blocks to check one of them
        // is not a goal, since it could otherwise have been a good win state
        if(horizontalWallBlocking && verticalWallBlocking)
        {
            tmpBlock.add(block);
            for(BoardPosition pos: tmpBlock)
            {
                if(state.get(pos)==NodeType.BLOCK)
                    return true;
            }
            return false;
        }

        //*****************//
        // BLOCKS DEADLOCK //
        //**************** //

        // If blocking is both horizontal and vertical, well then the block is supposedly frozen
        // But is it deadlocked?

        // Mark this block as checked - avoid stackoverflow
        tmpBlock.add(block);
        boolean deadlockState =
            (
                (verticalWallBlocking)
                ||
                (up.Row >= 0 && isBlockType(state.get(up)) && (tmpBlock.contains(up) || isFrozenDeadlockState(state, tmpBlock, up)))
                ||
                (down.Row < state.getRowsCount() && isBlockType(state.get(down)) && (tmpBlock.contains(down) || isFrozenDeadlockState(state, tmpBlock, down)))
            )
            &&
            (
                (horizontalWallBlocking)
                ||
                (left.Column >= 0 && isBlockType(state.get(left)) && (tmpBlock.contains(left) || isFrozenDeadlockState(state, tmpBlock, left)))
                ||
                (right.Column < state.getColumnsCount() && isBlockType(state.get(right)) && (tmpBlock.contains(right) || isFrozenDeadlockState(state, tmpBlock, right)))
            );

        map = DeadlockCache.get(state);
        if(map == null)
        {
            map = new HashMap<>();
            DeadlockCache.put(state, map);
        }
        map.put(block, deadlockState);
        return deadlockState;
    }

}


text:
#include <dmlc/logging.h>
#include <gtest/gtest.h>
#include <tvm/te/operation.h>
#include <tvm/tir/analysis.h>
#include <tvm/tir/builtin.h>

TEST(SimplePasses, SideEffect) {
  using namespace tvm;
  auto A = tir::Var("A", DataType::Handle());
  auto i = tir::Var("i", DataType::Int(32));
  ICHECK(tir::SideEffect(tir::Load(DataType::Float(32), A, i, tir::const_true(1))) ==
         tir::CallEffectKind::kReadState);
  ICHECK(tir::SideEffect(exp(tir::Cast(DataType::Float(32), i + 1))) == tir::CallEffectKind::kPure);
  ICHECK(tir::SideEffect(tir::Call(DataType::Handle(), tir::builtin::tvm_storage_sync(), {})) ==
         tir::CallEffectKind::kUpdateState);
}


text:
Samples for the [PubSub API Node.js Client][client] have moved to
[github.com/googleapis/nodejs-pubsub/tree/master/samples/][samples].

[client]: https://github.com/googleapis/nodejs-pubsub
[samples]: https://github.com/googleapis/nodejs-pubsub/tree/master/samples


text:
package com.microsoft.azure.management.netapp.v2019_10_01;

import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
 * Defines values for EndpointType.
 */
public final class EndpointType extends ExpandableStringEnum<EndpointType> {
    /** Static value src for EndpointType. */
    public static final EndpointType SRC = fromString("src");

    /** Static value dst for EndpointType. */
    public static final EndpointType DST = fromString("dst");

    /**
     * Creates or finds a EndpointType from its string representation.
     * @param name a name to look for
     * @return the corresponding EndpointType
     */
    @JsonCreator
    public static EndpointType fromString(String name) {
        return fromString(name, EndpointType.class);
    }

    /**
     * @return known EndpointType values
     */
    public static Collection<EndpointType> values() {
        return values(EndpointType.class);
    }
}


text:
layout: post
date: 2016-07-08
title: "The Dessy Group Dessy - Alfred Sung Style D706 Sleeveless Floor-Length Aline/Princess High Low"
category: The Dessy Group
tags: [The Dessy Group,Aline/Princess ,High Low,Bateau,Floor-Length,Sleeveless]
---
### The Dessy Group Dessy - Alfred Sung Style D706
Just **$249.99**
###   Sleeveless Floor-Length Aline/Princess  High Low

BRANDS	The Dessy Group

Silhouette	Aline/Princess

Trend	High Low

Neckline	Bateau

Hemline/Train	Floor-Length

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/the-dessy-group/12782-the-dessy-group-alfred-sung-style-d706.html](https://www.readybrides.com/en/the-dessy-group/12782-the-dessy-group-alfred-sung-style-d706.html)


text:
package org.jivesoftware.openfire.auth;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;

import org.jivesoftware.openfire.lockout.LockOutManager;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.util.Blowfish;
import org.jivesoftware.util.ClassUtils;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener;
import org.jivesoftware.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Pluggable authentication service. Users of Openfire that wish to change the AuthProvider
 * implementation used to authenticate users can set the AuthProvider.className
 * system property. For example, if you have configured Openfire to use LDAP for user information,
 * you'd want to send a custom implementation of AuthFactory to make LDAP auth queries.
 * After changing the AuthProvider.className system property, you must restart your
 * application server.
 *
 * @author Matt Tucker
 */
public class AuthFactory {

	private static final Logger Log = LoggerFactory.getLogger(AuthFactory.class);

    private static AuthProvider authProvider = null;
    private static MessageDigest digest;
    private static final Object DIGEST_LOCK = new Object();
    private static Blowfish cipher = null;

    static {
        // Create a message digest instance.
        try {
            digest = MessageDigest.getInstance("SHA");
        }
        catch (NoSuchAlgorithmException e) {
            Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
        }
        // Load an auth provider.
        initProvider();

        // Detect when a new auth provider class is set
        PropertyEventListener propListener = new PropertyEventListener() {
            public void propertySet(String property, Map params) {
                if ("provider.auth.className".equals(property)) {
                    initProvider();
                }
            }

            public void propertyDeleted(String property, Map params) {
                //Ignore
            }

            public void xmlPropertySet(String property, Map params) {
                //Ignore
            }

            public void xmlPropertyDeleted(String property, Map params) {
                //Ignore
            }
        };
        PropertyEventDispatcher.addListener(propListener);
    }

    private static void initProvider() {
        // Convert XML based provider setup to Database based
        JiveGlobals.migrateProperty("provider.auth.className");

        String className = JiveGlobals.getProperty("provider.auth.className",
                "org.jivesoftware.openfire.auth.DefaultAuthProvider");
        // Check if we need to reset the auth provider class
        if (authProvider == null || !className.equals(authProvider.getClass().getName())) {
            try {
                Class c = ClassUtils.forName(className);
                authProvider = (AuthProvider)c.newInstance();
            }
            catch (Exception e) {
                Log.error("Error loading auth provider: " + className, e);
                authProvider = new DefaultAuthProvider();
            }
        }
    }

    /**
     * Returns the currently-installed AuthProvider. Warning: in virtually all
     * cases the auth provider should not be used directly. Instead, the appropriate
     * methods in AuthFactory should be called. Direct access to the auth provider is
     * only provided for special-case logic.
     *
     * @return the current UserProvider.
     */
    public static AuthProvider getAuthProvider() {
        return authProvider;
    }

    /**
     * Returns true if the currently installed {@link AuthProvider} supports authentication
     * using plain-text passwords according to JEP-0078. Plain-text authentication is
     * not secure and should generally only be used over a TLS/SSL connection.
     *
     * @return true if plain text password authentication is supported.
     */
    public static boolean isPlainSupported() {
        return authProvider.isPlainSupported();
    }

    /**
     * Returns true if the currently installed {@link AuthProvider} supports
     * digest authentication according to JEP-0078.
     *
     * @return true if digest authentication is supported.
     */
    public static boolean isDigestSupported() {
        return authProvider.isDigestSupported();
    }

    /**
     * Returns the user's password. This method will throw an UnsupportedOperationException
     * if this operation is not supported by the backend user store.
     *
     * @param username the username of the user.
     * @return the user's password.
     * @throws UserNotFoundException if the given user could not be found.
     * @throws UnsupportedOperationException if the provider does not
     *      support the operation (this is an optional operation).
     */
    public static String getPassword(String username) throws UserNotFoundException,
            UnsupportedOperationException {
        return authProvider.getPassword(username.toLowerCase());
    }

    /**
     * Authenticates a user with a username and plain text password and returns and
     * AuthToken. If the username and password do not match the record of
     * any user in the system, this method throws an UnauthorizedException.
     *
     * @param username the username.
     * @param password the password.
     * @return an AuthToken token if the username and password are correct.
     * @throws UnauthorizedException if the username and password do not match any existing user
     *      or the account is locked out.
     */
    public static AuthToken authenticate(String username, String password)
            throws UnauthorizedException, ConnectionException, InternalUnauthenticatedException {
        if (LockOutManager.getInstance().isAccountDisabled(username)) {
            LockOutManager.getInstance().recordFailedLogin(username);
            throw new UnauthorizedException();
        }
        authProvider.authenticate(username, password);
        return new AuthToken(username);
    }

    /**
     * Authenticates a user with a username, token, and digest and returns an AuthToken.
     * The digest should be generated using the {@link #createDigest(String, String)} method.
     * If the username and digest do not match the record of any user in the system, the
     * method throws an UnauthorizedException.
     *
     * @param username the username.
     * @param token the token that was used with plain-text password to generate the digest.
     * @param digest the digest generated from plain-text password and unique token.
     * @return an AuthToken token if the username and digest are correct for the user's
     *      password and given token.
     * @throws UnauthorizedException if the username and password do not match any
     *      existing user or the account is locked out.
     */
    public static AuthToken authenticate(String username, String token, String digest)
            throws UnauthorizedException, ConnectionException, InternalUnauthenticatedException {
        if (LockOutManager.getInstance().isAccountDisabled(username)) {
            LockOutManager.getInstance().recordFailedLogin(username);
            throw new UnauthorizedException();
        }
        authProvider.authenticate(username, token, digest);
        return new AuthToken(username);
    }

    /**
     * Returns a digest given a token and password, according to JEP-0078.
     *
     * @param token the token used in the digest.
     * @param password the plain-text password to be digested.
     * @return the digested result as a hex string.
     */
    public static String createDigest(String token, String password) {
        synchronized (DIGEST_LOCK) {
            digest.update(token.getBytes());
            return StringUtils.encodeHex(digest.digest(password.getBytes()));
        }
    }

    /**
     * Returns an encrypted version of the plain-text password. Encryption is performed
     * using the Blowfish algorithm. The encryption key is stored as the Jive property
     * "passwordKey". If the key is not present, it will be automatically generated.
     *
     * @param password the plain-text password.
     * @return the encrypted password.
     * @throws UnsupportedOperationException if encryption/decryption is not possible;
     *      for example, during setup mode.
     */
    public static String encryptPassword(String password) {
        if (password == null) {
            return null;
        }
        Blowfish cipher = getCipher();
        if (cipher == null) {
            throw new UnsupportedOperationException();
        }
        return cipher.encryptString(password);
    }

    /**
     * Returns a decrypted version of the encrypted password. Encryption is performed
     * using the Blowfish algorithm. The encryption key is stored as the Jive property
     * "passwordKey". If the key is not present, it will be automatically generated.
     *
     * @param encryptedPassword the encrypted password.
     * @return the encrypted password.
     * @throws UnsupportedOperationException if encryption/decryption is not possible;
     *      for example, during setup mode.
     */
    public static String decryptPassword(String encryptedPassword) {
        if (encryptedPassword == null) {
            return null;
        }
        Blowfish cipher = getCipher();
        if (cipher == null) {
            throw new UnsupportedOperationException();
        }
        return cipher.decryptString(encryptedPassword);
    }

    /**
     * Returns a Blowfish cipher that can be used for encrypting and decrypting passwords.
     * The encryption key is stored as the Jive property "passwordKey". If it's not present,
     * it will be automatically generated.
     *
     * @return the Blowfish cipher, or <tt>null</tt> if Openfire is not able to create a Cipher;
     *      for example, during setup mode.
     */
    private static synchronized Blowfish getCipher() {
        if (cipher != null) {
            return cipher;
        }
        // Get the password key, stored as a database property. Obviously,
        // protecting your database is critical for making the
        // encryption fully secure.
        String keyString;
        try {
            keyString = JiveGlobals.getProperty("passwordKey");
            if (keyString == null) {
                keyString = StringUtils.randomString(15);
                JiveGlobals.setProperty("passwordKey", keyString);
                // Check to make sure that setting the property worked. It won't work,
                // for example, when in setup mode.
                if (!keyString.equals(JiveGlobals.getProperty("passwordKey"))) {
                    return null;
                }
            }
            cipher = new Blowfish(keyString);
        }
        catch (Exception e) {
            Log.error(e.getMessage(), e);
        }
        return cipher;
    }
}


text:
<?php

namespace protecno\escuelaBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class academicaType extends AbstractType
{

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'protecno\escuelaBundle\Entity\academica'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'escuela_bundle_academica';
    }
}


text:
package kami_test

import (
	"io"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/zenazn/goji/web/mutil"
	"golang.org/x/net/context"

	"github.com/guregu/kami"
)

func TestKami(t *testing.T) {
	kami.Reset()
	kami.Use("/", func(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context {
		return context.WithValue(ctx, "test1", "1")
	})
	kami.Use("/v2/", func(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context {
		return context.WithValue(ctx, "test2", "2")
	})
	kami.Get("/v2/papers/:page", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		page := kami.Param(ctx, "page")
		if page == "" {
			panic("blank page")
		}
		io.WriteString(w, page)

		test1 := ctx.Value("test1").(string)
		test2 := ctx.Value("test2").(string)

		if test1 != "1" || test2 != "2" {
			t.Error("unexpected ctx value:", test1, test2)
		}
	})

	resp := httptest.NewRecorder()
	req, err := http.NewRequest("GET", "/v2/papers/3", nil)
	if err != nil {
		t.Fatal(err)
	}

	kami.Handler().ServeHTTP(resp, req)
	if resp.Code != http.StatusOK {
		t.Error("should return HTTP OK", resp.Code, "≠", http.StatusOK)
	}

	data, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}

	if string(data) != "3" {
		t.Error("expected page 3, got", string(data))
	}
}

func TestLoggerAndPanic(t *testing.T) {
	kami.Reset()
	// test logger with panic
	status := 0
	kami.LogHandler = func(ctx context.Context, w mutil.WriterProxy, r *http.Request) {
		status = w.Status()
	}
	kami.PanicHandler = kami.HandlerFunc(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		err := kami.Exception(ctx)
		if err != "test panic" {
			t.Error("unexpected exception:", err)
		}
		w.WriteHeader(http.StatusServiceUnavailable)
	})
	kami.Post("/test", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		panic("test panic")
	})
	kami.Put("/ok", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
	})

	expectResponseCode(t, "POST", "/test", http.StatusServiceUnavailable)
	if status != http.StatusServiceUnavailable {
		t.Error("log handler received wrong status code", status, "≠", http.StatusServiceUnavailable)
	}

	// test loggers without panics
	expectResponseCode(t, "PUT", "/ok", http.StatusOK)
	if status != http.StatusOK {
		t.Error("log handler received wrong status code", status, "≠", http.StatusOK)
	}
}

func TestPanickingLogger(t *testing.T) {
	kami.Reset()
	kami.LogHandler = func(ctx context.Context, w mutil.WriterProxy, r *http.Request) {
		t.Log("log handler")
		panic("test panic")
	}
	kami.PanicHandler = kami.HandlerFunc(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		t.Log("panic handler")
		err := kami.Exception(ctx)
		if err != "test panic" {
			t.Error("unexpected exception:", err)
		}
		w.WriteHeader(http.StatusServiceUnavailable)
		w.Write([]byte("error 503"))
	})
	kami.Post("/test", noop)

	expectResponseCode(t, "POST", "/test", http.StatusServiceUnavailable)
}

func TestNotFound(t *testing.T) {
	kami.Reset()
	kami.Use("/missing/", func(ctx context.Context, w http.ResponseWriter, r *http.Request) context.Context {
		return context.WithValue(ctx, "ok", true)
	})
	kami.NotFound(func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
		ok, _ := ctx.Value("ok").(bool)
		if !ok {
			w.WriteHeader(http.StatusInternalServerError)
			return
		}
		w.WriteHeader(http.StatusTeapot)
	})

	expectResponseCode(t, "GET", "/missing/hello", http.StatusTeapot)
}

func TestNotFoundDefault(t *testing.T) {
	kami.Reset()

	expectResponseCode(t, "GET", "/missing/hello", http.StatusNotFound)
}

func noop(ctx context.Context, w http.ResponseWriter, r *http.Request) {}

func expectResponseCode(t *testing.T, method, path string, expected int) {
	resp := httptest.NewRecorder()
	req, err := http.NewRequest(method, path, nil)
	if err != nil {
		t.Fatal(err)
	}

	kami.Handler().ServeHTTP(resp, req)

	if resp.Code != expected {
		t.Error("should return HTTP", http.StatusText(expected)+":", resp.Code, "≠", expected)
	}
}


text:
package ca.sapon.jici.evaluator.type;

import java.util.Collections;
import java.util.Set;

import ca.sapon.jici.evaluator.Substitutions;
import ca.sapon.jici.evaluator.value.ValueKind;

/**
 * A wildcard type, such as {@code <?>}, {@code <? extends String>} or {@code <? super Integer>}.
 */
public class WildcardType implements TypeArgument, BoundedType {
    public static final WildcardType THE_UNBOUNDED = of(Collections.<SingleReferenceType>emptySet(), Collections.<SingleReferenceType>emptySet());
    private final IntersectionType lowerBound;
    private final IntersectionType upperBound;

    private WildcardType(IntersectionType lowerBound, IntersectionType upperBound) {
        this.lowerBound = lowerBound;
        this.upperBound = upperBound;
    }

    @Override
    public IntersectionType getLowerBound() {
        return lowerBound;
    }

    @Override
    public IntersectionType getUpperBound() {
        return upperBound;
    }

    public boolean isUnbounded() {
        return lowerBound.equals(IntersectionType.EVERYTHING) && upperBound.equals(IntersectionType.NOTHING);
    }

    @Override
    public String getName() {
        String name = "?";
        if (!lowerBound.equals(IntersectionType.EVERYTHING)) {
            name += " super " + lowerBound;
        }
        if (!upperBound.equals(IntersectionType.NOTHING)) {
            name += " extends " + upperBound;
        }
        return name;
    }

    @Override
    public ValueKind getKind() {
        return ValueKind.OBJECT;
    }

    @Override
    public boolean isVoid() {
        return false;
    }

    @Override
    public boolean isNull() {
        return false;
    }

    @Override
    public boolean isPrimitive() {
        return false;
    }

    @Override
    public boolean isNumeric() {
        return false;
    }

    @Override
    public boolean isIntegral() {
        return false;
    }

    @Override
    public boolean isBoolean() {
        return false;
    }

    @Override
    public boolean isArray() {
        return upperBound.isArray();
    }

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

    @Override
    public boolean isReifiable() {
        return isUnbounded();
    }

    @Override
    public boolean convertibleTo(Type to) {
        throw new UnsupportedOperationException("Wildcard type needs to be capture converted for this operation");
    }

    @Override
    public WildcardType capture() {
        return this;
    }

    @Override
    public TypeArgument asArray(int dimensions) {
        IntersectionType arrayLowerBound = lowerBound;
        if (!arrayLowerBound.equals(IntersectionType.EVERYTHING)) {
            arrayLowerBound = arrayLowerBound.asArray(dimensions);
        }
        return new WildcardType(arrayLowerBound, upperBound.asArray(dimensions));
    }

    @Override
    public WildcardType substituteTypeVariables(Substitutions substitution) {
        // Apply recursively on lower and upper bounds
        return new WildcardType(lowerBound.substituteTypeVariables(substitution), upperBound.substituteTypeVariables(substitution));
    }

    @Override
    public Set<TypeVariable> getTypeVariables() {
        final Set<TypeVariable> typeVariables = lowerBound.getTypeVariables();
        typeVariables.addAll(upperBound.getTypeVariables());
        return typeVariables;
    }

    @Override
    public boolean contains(TypeArgument other) {
        if (other instanceof WildcardType) {
            final WildcardType otherWildcard = (WildcardType) other;
            return otherWildcard.upperBound.convertibleTo(upperBound) && lowerBound.convertibleTo(otherWildcard.lowerBound);
        }
        return other.convertibleTo(upperBound) && lowerBound.convertibleTo(other);
    }

    @Override
    public String toString() {
        return getName();
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof WildcardType)) {
            return false;
        }
        final WildcardType that = (WildcardType) other;
        return this.lowerBound.equals(that.lowerBound) && this.upperBound.equals(that.upperBound);
    }

    @Override
    public int hashCode() {
        int result = lowerBound.hashCode();
        result = 31 * result + upperBound.hashCode();
        return result;
    }

    public static WildcardType of(Set<SingleReferenceType> lowerBound, Set<SingleReferenceType> upperBound) {
        final IntersectionType lower = lowerBound.isEmpty() ? IntersectionType.EVERYTHING : IntersectionType.of(lowerBound);
        final IntersectionType upper = upperBound.isEmpty() ? IntersectionType.NOTHING : IntersectionType.of(upperBound);
        return of(lower, upper);
    }

    public static WildcardType of(IntersectionType lowerBound, IntersectionType upperBound) {
        upperBound.checkIfValidUpperBound();
        return new WildcardType(lowerBound, upperBound);
    }
}


text:
.section.second .section-content-container {
  padding-top: 0px;
}

.tree-container {
  overflow-y: auto;
  max-height: 600px;
}

.tree-header {
  height: 25px;
}

.tree-node {
  cursor: pointer;
}

.tree-node.selected {
  background-color: #D690A0;
}

.tree-fresh-button {
  margin: 10px auto;
  display: block;
  position:relative;
  text-align:center;
}

.screen-scale {
  width: 25px;
}


text:
package com.domeke.app.shiro;

import java.util.concurrent.ConcurrentMap;

/**
 * ShiroKit. (Singleton, ThreadSafe)
 *
 * @author dafei
 */
public class ShiroKit {

	/**
	 * 用来记录那个action或者actionpath中是否有shiro认证注解。
	 */
	private static ConcurrentMap<String, AuthzHandler> authzMaps = null;

	/**
	 * 禁止初始化
	 */
	private ShiroKit() {
	}

	static void init(ConcurrentMap<String, AuthzHandler> maps) {
		authzMaps = maps;
	}

	static AuthzHandler getAuthzHandler(String actionKey) {
		/*
		if(authzMaps.containsKey(controllerClassName)){
			return true;
		}*/
		return authzMaps.get(actionKey);
	}
}


text:
<?php
//require(__DIR__ . '../../../backend/models/Establishment.php');
require(__DIR__ . '../../../backend/models/LogEstablishment.php');
require(__DIR__ . '../../../backend/modules/api/controllers/EstablishmentController.php');

use backend\models\Establishment;
use backend\models\LogEstablishment;
use backend\modules\api\controllers\EstablishmentController;

class EstablishmentTest extends \PHPUnit_Framework_TestCase
{
    public $arrayDatosTest;

    public function setUp()
    {
        $this->arrayDatosTest = [
            "upz" => "8752",
            "lastname_owner" => "b",
            "lastname_legal_representative" => "c",
            "ciiu1" => "123",
            "ciiu2" => "456",
            "ciiu3" => "789",
            "address_commercial" => "a",
            "address_standard" => "a",
            "address_notification" => "a",
            "date_end_commercial_registration" => "a",
            "date_commercial_registration" => "a2",
            "formal" => "a",
            "digit_verification_establishment" => "a",
            "digit_verification_owner" => "a",
            "digit_verification_legal_representative" => "a",
            "locality" => "a",
            "email" => "a",
            "commercial_registration" => "112322",
            "commercial_registration_owner" => "a",
            "number_identification_establishment" => "a",
            "number_identification_owner" => "a",
            "number_identificacion_legal_representative" => "a",
            "name_commercial" => "a",
            "name_owner" => "a",
            "observation" => "a",
            "observation_history" => "a",
            "page_web" => "a",
            "business_name" => "fsadfxtttt",
            "phone" => "a",
            "type_history" => "a",
            "type_identification_establishment" => "a",
            "type_identification_owner" => "a",
            "type_identification_legal_representative" => "a",
            "neighborhood_code" => "16067BD"
        ];
    }

    public function testSaveEstablishment(){
        $establishmentController = new EstablishmentController($id='', $module='');
        $this->assertEquals($establishmentController->setSaveEstablishment($this->arrayDatosTest), 1);
    }

    public function testRegisterLogIfNotSaveEstablishment() {
        $establishment = new Establishment();
        $establishment->load($this->arrayDatosTest,'');
        if($establishment->save() != 1){
            $establishmentController = new EstablishmentController($id='', $module='');
            $resultSave = $establishmentController->setSaveLogEstablishment($this->arrayDatosTest,$establishment->getErrors());
            $this->assertEquals($resultSave->save(), 1);
        }
    }
}


text:
.class Landroid/media/Tokenizer;
.super Ljava/lang/Object;
.source "WebVttRenderer.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/media/Tokenizer$OnTokenListener;,
        Landroid/media/Tokenizer$TagTokenizer;,
        Landroid/media/Tokenizer$DataTokenizer;,
        Landroid/media/Tokenizer$TokenizerPhase;
    }
.end annotation

# static fields
.field private static final TAG:Ljava/lang/String; = "Tokenizer"

# instance fields
.field private mDataTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

.field private mHandledLen:I

.field private mLine:Ljava/lang/String;

.field private mListener:Landroid/media/Tokenizer$OnTokenListener;

.field private mPhase:Landroid/media/Tokenizer$TokenizerPhase;

.field private mTagTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

# direct methods
.method constructor <init>(Landroid/media/Tokenizer$OnTokenListener;)V
    .locals 1
    .param p1, "listener"    # Landroid/media/Tokenizer$OnTokenListener;

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

    .line 307
    new-instance v0, Landroid/media/Tokenizer$DataTokenizer;

    invoke-direct {v0, p0}, Landroid/media/Tokenizer$DataTokenizer;-><init>(Landroid/media/Tokenizer;)V

    iput-object v0, p0, Landroid/media/Tokenizer;->mDataTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

    .line 308
    new-instance v0, Landroid/media/Tokenizer$TagTokenizer;

    invoke-direct {v0, p0}, Landroid/media/Tokenizer$TagTokenizer;-><init>(Landroid/media/Tokenizer;)V

    iput-object v0, p0, Landroid/media/Tokenizer;->mTagTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

    .line 309
    invoke-virtual {p0}, Landroid/media/Tokenizer;->reset()V

    .line 310
    iput-object p1, p0, Landroid/media/Tokenizer;->mListener:Landroid/media/Tokenizer$OnTokenListener;

    .line 311
    return-void
.end method

.method static synthetic access$000(Landroid/media/Tokenizer;)Ljava/lang/String;
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget-object v0, p0, Landroid/media/Tokenizer;->mLine:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$100(Landroid/media/Tokenizer;)I
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    return v0
.end method

.method static synthetic access$102(Landroid/media/Tokenizer;I)I
    .locals 0
    .param p0, "x0"    # Landroid/media/Tokenizer;
    .param p1, "x1"    # I

    .prologue
    .line 168
    iput p1, p0, Landroid/media/Tokenizer;->mHandledLen:I

    return p1
.end method

.method static synthetic access$108(Landroid/media/Tokenizer;)I
    .locals 2
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    add-int/lit8 v1, v0, 0x1

    iput v1, p0, Landroid/media/Tokenizer;->mHandledLen:I

    return v0
.end method

.method static synthetic access$112(Landroid/media/Tokenizer;I)I
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;
    .param p1, "x1"    # I

    .prologue
    .line 168
    iget v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    add-int/2addr v0, p1

    iput v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    return v0
.end method

.method static synthetic access$202(Landroid/media/Tokenizer;Landroid/media/Tokenizer$TokenizerPhase;)Landroid/media/Tokenizer$TokenizerPhase;
    .locals 0
    .param p0, "x0"    # Landroid/media/Tokenizer;
    .param p1, "x1"    # Landroid/media/Tokenizer$TokenizerPhase;

    .prologue
    .line 168
    iput-object p1, p0, Landroid/media/Tokenizer;->mPhase:Landroid/media/Tokenizer$TokenizerPhase;

    return-object p1
.end method

.method static synthetic access$300(Landroid/media/Tokenizer;)Landroid/media/Tokenizer$TokenizerPhase;
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget-object v0, p0, Landroid/media/Tokenizer;->mTagTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

    return-object v0
.end method

.method static synthetic access$400(Landroid/media/Tokenizer;)Landroid/media/Tokenizer$OnTokenListener;
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget-object v0, p0, Landroid/media/Tokenizer;->mListener:Landroid/media/Tokenizer$OnTokenListener;

    return-object v0
.end method

.method static synthetic access$500(Landroid/media/Tokenizer;)Landroid/media/Tokenizer$TokenizerPhase;
    .locals 1
    .param p0, "x0"    # Landroid/media/Tokenizer;

    .prologue
    .line 168
    iget-object v0, p0, Landroid/media/Tokenizer;->mDataTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

    return-object v0
.end method

# virtual methods
.method reset()V
    .locals 1

    .prologue
    .line 314
    iget-object v0, p0, Landroid/media/Tokenizer;->mDataTokenizer:Landroid/media/Tokenizer$TokenizerPhase;

    invoke-interface {v0}, Landroid/media/Tokenizer$TokenizerPhase;->start()Landroid/media/Tokenizer$TokenizerPhase;

    move-result-object v0

    iput-object v0, p0, Landroid/media/Tokenizer;->mPhase:Landroid/media/Tokenizer$TokenizerPhase;

    .line 315
    return-void
.end method

.method tokenize(Ljava/lang/String;)V
    .locals 2
    .param p1, "s"    # Ljava/lang/String;

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

    iput v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    .line 319
    iput-object p1, p0, Landroid/media/Tokenizer;->mLine:Ljava/lang/String;

    .line 320
    :goto_0
    iget v0, p0, Landroid/media/Tokenizer;->mHandledLen:I

    iget-object v1, p0, Landroid/media/Tokenizer;->mLine:Ljava/lang/String;

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 321
    iget-object v0, p0, Landroid/media/Tokenizer;->mPhase:Landroid/media/Tokenizer$TokenizerPhase;

    invoke-interface {v0}, Landroid/media/Tokenizer$TokenizerPhase;->tokenize()V

    goto :goto_0

    .line 324
    :cond_0
    iget-object v0, p0, Landroid/media/Tokenizer;->mPhase:Landroid/media/Tokenizer$TokenizerPhase;

    instance-of v0, v0, Landroid/media/Tokenizer$TagTokenizer;

    if-nez v0, :cond_1

    .line 326
    iget-object v0, p0, Landroid/media/Tokenizer;->mListener:Landroid/media/Tokenizer$OnTokenListener;

    invoke-interface {v0}, Landroid/media/Tokenizer$OnTokenListener;->onLineEnd()V

    .line 328
    :cond_1
    return-void
.end method