text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.OLE.Interop;
using Microsoft.VisualStudio.Shell;
//#define ConfigTrace
using Microsoft.VisualStudio.Shell.Interop;
using MSBuildConstruction = Microsoft.Build.Construction;
using MSBuildExecution = Microsoft.Build.Execution;

namespace Microsoft.VisualStudioTools.Project {
    [ComVisible(true)]
    internal abstract class ProjectConfig :
        IVsCfg,
        IVsProjectCfg,
        IVsProjectCfg2,
        IVsProjectFlavorCfg,
        IVsDebuggableProjectCfg,
        ISpecifyPropertyPages,
        IVsSpecifyProjectDesignerPages,
        IVsCfgBrowseObject {
        internal const string Debug = "Debug";
        internal const string AnyCPU = "AnyCPU";

        private ProjectNode project;
        private string configName;
        private MSBuildExecution.ProjectInstance currentConfig;
        private IVsProjectFlavorCfg flavoredCfg;
        private List<OutputGroup> outputGroups;
        private BuildableProjectConfig buildableCfg;
        private string platformName;

        #region properties

        public string PlatformName {
            get {
                return platformName;
            }
            set {
                platformName = value;
            }
        }

        internal ProjectNode ProjectMgr {
            get {
                return this.project;
            }
        }

        public string ConfigName {
            get {
                return this.configName;
            }
            set {
                this.configName = value;
            }
        }

        internal IList<OutputGroup> OutputGroups {
            get {
                if (null == this.outputGroups) {
                    // Initialize output groups
                    this.outputGroups = new List<OutputGroup>();

                    // If the project is not buildable (no CoreCompile target)
                    // then don't bother getting the output groups.
                    if (this.project.BuildProject != null && this.project.BuildProject.Targets.ContainsKey("CoreCompile")) {
                        // Get the list of group names from the project.
                        // The main reason we get it from the project is to make it easier for someone to modify
                        // it by simply overriding that method and providing the correct MSBuild target(s).
                        IList<KeyValuePair<string, string>> groupNames = project.GetOutputGroupNames();

                        if (groupNames != null) {
                            // Populate the output array
                            foreach (KeyValuePair<string, string> group in groupNames) {
                                OutputGroup outputGroup = CreateOutputGroup(project, group);
                                this.outputGroups.Add(outputGroup);
                            }
                        }
                    }
                }
                return this.outputGroups;
            }
        }

        #endregion

        #region ctors
        internal ProjectConfig(ProjectNode project, string configuration) {
            this.project = project;
            if (configuration.Contains("|")) { // If configuration is in the form "<Configuration>|<Platform>"

                string[] configStrArray = configuration.Split('|');
                if (2 == configStrArray.Length) {
                    this.configName = configStrArray[0];
                    this.platformName = configStrArray[1];
                }
                else {
                    throw new Exception(string.Format(CultureInfo.InvariantCulture, "Invalid configuration format: {0}", configuration));
                }
            }
            else { // If configuration is in the form "<Configuration>"
                this.configName = configuration;
            }

            var flavoredCfgProvider = ProjectMgr.GetOuterInterface<IVsProjectFlavorCfgProvider>();
            Utilities.ArgumentNotNull("flavoredCfgProvider", flavoredCfgProvider);
            ErrorHandler.ThrowOnFailure(flavoredCfgProvider.CreateProjectFlavorCfg(this, out flavoredCfg));
            Utilities.ArgumentNotNull("flavoredCfg", flavoredCfg);

            // if the flavored object support XML fragment, initialize it
            IPersistXMLFragment persistXML = flavoredCfg as IPersistXMLFragment;
            if (null != persistXML) {
                this.project.LoadXmlFragment(persistXML, configName, platformName);
            }
        }
        #endregion

        #region methods

        internal virtual OutputGroup CreateOutputGroup(ProjectNode project, KeyValuePair<string, string> group) {
            OutputGroup outputGroup = new OutputGroup(group.Key, group.Value, project, this);
            return outputGroup;
        }

        public void PrepareBuild(bool clean) {
            project.PrepareBuild(this.configName, clean);
        }

        public virtual string GetConfigurationProperty(string propertyName, bool resetCache) {
            MSBuildExecution.ProjectPropertyInstance property = GetMsBuildProperty(propertyName, resetCache);
            if (property == null)
                return null;

            return property.EvaluatedValue;
        }

        public virtual void SetConfigurationProperty(string propertyName, string propertyValue) {
            if (!this.project.QueryEditProjectFile(false)) {
                throw Marshal.GetExceptionForHR(VSConstants.OLE_E_PROMPTSAVECANCELLED);
            }

            string condition = String.Format(CultureInfo.InvariantCulture, ConfigProvider.configString, this.ConfigName);

            SetPropertyUnderCondition(propertyName, propertyValue, condition);

            // property cache will need to be updated
            this.currentConfig = null;

            return;
        }

        /// <summary>
        /// Emulates the behavior of SetProperty(name, value, condition) on the old MSBuild object model.
        /// This finds a property group with the specified condition (or creates one if necessary) then sets the property in there.
        /// </summary>
        private void SetPropertyUnderCondition(string propertyName, string propertyValue, string condition) {
            string conditionTrimmed = (condition == null) ? String.Empty : condition.Trim();

            if (conditionTrimmed.Length == 0) {
                this.project.BuildProject.SetProperty(propertyName, propertyValue);
                return;
            }

            // New OM doesn't have a convenient equivalent for setting a property with a particular property group condition.
            // So do it ourselves.
            MSBuildConstruction.ProjectPropertyGroupElement newGroup = null;

            foreach (MSBuildConstruction.ProjectPropertyGroupElement group in this.project.BuildProject.Xml.PropertyGroups) {
                if (String.Equals(group.Condition.Trim(), conditionTrimmed, StringComparison.OrdinalIgnoreCase)) {
                    newGroup = group;
                    break;
                }
            }

            if (newGroup == null) {
                newGroup = this.project.BuildProject.Xml.AddPropertyGroup(); // Adds after last existing PG, else at start of project
                newGroup.Condition = condition;
            }

            foreach (MSBuildConstruction.ProjectPropertyElement property in newGroup.PropertiesReversed) // If there's dupes, pick the last one so we win
            {
                if (String.Equals(property.Name, propertyName, StringComparison.OrdinalIgnoreCase) && property.Condition.Length == 0) {
                    property.Value = propertyValue;
                    return;
                }
            }

            newGroup.AddProperty(propertyName, propertyValue);
        }

        /// <summary>
        /// If flavored, and if the flavor config can be dirty, ask it if it is dirty
        /// </summary>
        /// <param name="storageType">Project file or user file</param>
        /// <returns>0 = not dirty</returns>
        internal int IsFlavorDirty(_PersistStorageType storageType) {
            int isDirty = 0;
            if (this.flavoredCfg != null && this.flavoredCfg is IPersistXMLFragment) {
                ErrorHandler.ThrowOnFailure(((IPersistXMLFragment)this.flavoredCfg).IsFragmentDirty((uint)storageType, out isDirty));
            }
            return isDirty;
        }

        /// <summary>
        /// If flavored, ask the flavor if it wants to provide an XML fragment
        /// </summary>
        /// <param name="flavor">Guid of the flavor</param>
        /// <param name="storageType">Project file or user file</param>
        /// <param name="fragment">Fragment that the flavor wants to save</param>
        /// <returns>HRESULT</returns>
        internal int GetXmlFragment(Guid flavor, _PersistStorageType storageType, out string fragment) {
            fragment = null;
            int hr = VSConstants.S_OK;
            if (this.flavoredCfg != null && this.flavoredCfg is IPersistXMLFragment) {
                Guid flavorGuid = flavor;
                hr = ((IPersistXMLFragment)this.flavoredCfg).Save(ref flavorGuid, (uint)storageType, out fragment, 1);
            }
            return hr;
        }
        #endregion

        #region IVsSpecifyPropertyPages
        public void GetPages(CAUUID[] pages) {
            this.GetCfgPropertyPages(pages);
        }
        #endregion

        #region IVsSpecifyProjectDesignerPages
        /// <summary>
        /// Implementation of the IVsSpecifyProjectDesignerPages. It will retun the pages that are configuration dependent.
        /// </summary>
        /// <param name="pages">The pages to return.</param>
        /// <returns>VSConstants.S_OK</returns>
        public virtual int GetProjectDesignerPages(CAUUID[] pages) {
            this.GetCfgPropertyPages(pages);
            return VSConstants.S_OK;
        }
        #endregion

        #region IVsCfg methods
        /// <summary>
        /// The display name is a two part item
        /// first part is the config name, 2nd part is the platform name
        /// </summary>
        public virtual int get_DisplayName(out string name) {
            if (!string.IsNullOrEmpty(PlatformName)) {
                name = ConfigName + "|" + PlatformName;

            } else {
                name = DisplayName;
            }
            return VSConstants.S_OK;
        }

        private string DisplayName {
            get {
                string name;
                string[] platform = new string[1];
                uint[] actual = new uint[1];
                name = this.configName;
                // currently, we only support one platform, so just add it..
                IVsCfgProvider provider;
                ErrorHandler.ThrowOnFailure(project.GetCfgProvider(out provider));
                ErrorHandler.ThrowOnFailure(((IVsCfgProvider2)provider).GetPlatformNames(1, platform, actual));
                if (!string.IsNullOrEmpty(platform[0])) {
                    name += "|" + platform[0];
                }
                return name;
            }
        }
        public virtual int get_IsDebugOnly(out int fDebug) {
            fDebug = 0;
            if (this.configName == "Debug") {
                fDebug = 1;
            }
            return VSConstants.S_OK;
        }
        public virtual int get_IsReleaseOnly(out int fRelease) {
            fRelease = 0;
            if (this.configName == "Release") {
                fRelease = 1;
            }
            return VSConstants.S_OK;
        }
        #endregion

        #region IVsProjectCfg methods
        public virtual int EnumOutputs(out IVsEnumOutputs eo) {
            eo = null;
            return VSConstants.E_NOTIMPL;
        }

        public virtual int get_BuildableProjectCfg(out IVsBuildableProjectCfg pb) {
            if (project.BuildProject == null || !project.BuildProject.Targets.ContainsKey("CoreCompile")) {
                // The project is not buildable, so don't return a config. This
                // will hide the 'Build' commands from the VS UI.
                pb = null;
                return VSConstants.E_NOTIMPL;
            }
            if (buildableCfg == null) {
                buildableCfg = new BuildableProjectConfig(this);
            }
            pb = buildableCfg;
            return VSConstants.S_OK;
        }

        public virtual int get_CanonicalName(out string name) {
            name = configName;
            return VSConstants.S_OK;
        }

        public virtual int get_IsPackaged(out int pkgd) {
            pkgd = 0;
            return VSConstants.S_OK;
        }

        public virtual int get_IsSpecifyingOutputSupported(out int f) {
            f = 1;
            return VSConstants.S_OK;
        }

        public virtual int get_Platform(out Guid platform) {
            platform = Guid.Empty;
            return VSConstants.E_NOTIMPL;
        }

        public virtual int get_ProjectCfgProvider(out IVsProjectCfgProvider p) {
            p = null;
            IVsCfgProvider cfgProvider = null;
            this.project.GetCfgProvider(out cfgProvider);
            if (cfgProvider != null) {
                p = cfgProvider as IVsProjectCfgProvider;
            }

            return (null == p) ? VSConstants.E_NOTIMPL : VSConstants.S_OK;
        }

        public virtual int get_RootURL(out string root) {
            root = null;
            return VSConstants.S_OK;
        }

        public virtual int get_TargetCodePage(out uint target) {
            target = (uint)System.Text.Encoding.Default.CodePage;
            return VSConstants.S_OK;
        }

        public virtual int get_UpdateSequenceNumber(ULARGE_INTEGER[] li) {
            Utilities.ArgumentNotNull("li", li);

            li[0] = new ULARGE_INTEGER();
            li[0].QuadPart = 0;
            return VSConstants.S_OK;
        }

        public virtual int OpenOutput(string name, out IVsOutput output) {
            output = null;
            return VSConstants.E_NOTIMPL;
        }
        #endregion

        #region IVsProjectCfg2 Members

        public virtual int OpenOutputGroup(string szCanonicalName, out IVsOutputGroup ppIVsOutputGroup) {
            ppIVsOutputGroup = null;
            // Search through our list of groups to find the one they are looking forgroupName
            foreach (OutputGroup group in OutputGroups) {
                string groupName;
                group.get_CanonicalName(out groupName);
                if (String.Compare(groupName, szCanonicalName, StringComparison.OrdinalIgnoreCase) == 0) {
                    ppIVsOutputGroup = group;
                    break;
                }
            }
            return (ppIVsOutputGroup != null) ? VSConstants.S_OK : VSConstants.E_FAIL;
        }

        public virtual int OutputsRequireAppRoot(out int pfRequiresAppRoot) {
            pfRequiresAppRoot = 0;
            return VSConstants.E_NOTIMPL;
        }

        public virtual int get_CfgType(ref Guid iidCfg, out IntPtr ppCfg) {
            // Delegate to the flavored configuration (to enable a flavor to take control)
            // Since we can be asked for Configuration we don't support, avoid throwing and return the HRESULT directly
            int hr = flavoredCfg.get_CfgType(ref iidCfg, out ppCfg);

            return hr;
        }

        public virtual int get_IsPrivate(out int pfPrivate) {
            pfPrivate = 0;
            return VSConstants.S_OK;
        }

        public virtual int get_OutputGroups(uint celt, IVsOutputGroup[] rgpcfg, uint[] pcActual) {
            // Are they only asking for the number of groups?
            if (celt == 0) {
                if ((null == pcActual) || (0 == pcActual.Length)) {
                    throw new ArgumentNullException("pcActual");
                }
                pcActual[0] = (uint)OutputGroups.Count;
                return VSConstants.S_OK;
            }

            // Check that the array of output groups is not null
            if ((null == rgpcfg) || (rgpcfg.Length == 0)) {
                throw new ArgumentNullException("rgpcfg");
            }

            // Fill the array with our output groups
            uint count = 0;
            foreach (OutputGroup group in OutputGroups) {
                if (rgpcfg.Length > count && celt > count && group != null) {
                    rgpcfg[count] = group;
                    ++count;
                }
            }

            if (pcActual != null && pcActual.Length > 0)
                pcActual[0] = count;

            // If the number asked for does not match the number returned, return S_FALSE
            return (count == celt) ? VSConstants.S_OK : VSConstants.S_FALSE;
        }

        public virtual int get_VirtualRoot(out string pbstrVRoot) {
            pbstrVRoot = null;
            return VSConstants.E_NOTIMPL;
        }

        #endregion

        #region IVsDebuggableProjectCfg methods

        /// <summary>
        /// Called by the vs shell to start debugging (managed or unmanaged).
        /// Override this method to support other debug engines.
        /// </summary>
        /// <param name="grfLaunch">A flag that determines the conditions under which to start the debugger. For valid grfLaunch values, see __VSDBGLAUNCHFLAGS</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code</returns>
        public abstract int DebugLaunch(uint grfLaunch);

        /// <summary>
        /// Determines whether the debugger can be launched, given the state of the launch flags.
        /// </summary>
        /// <param name="flags">Flags that determine the conditions under which to launch the debugger.
        /// For valid grfLaunch values, see __VSDBGLAUNCHFLAGS or __VSDBGLAUNCHFLAGS2.</param>
        /// <param name="fCanLaunch">true if the debugger can be launched, otherwise false</param>
        /// <returns>S_OK if the method succeeds, otherwise an error code</returns>
        public virtual int QueryDebugLaunch(uint flags, out int fCanLaunch) {
            string assembly = this.project.GetAssemblyName(this.ConfigName);
            fCanLaunch = (assembly != null && assembly.ToUpperInvariant().EndsWith(".exe", StringComparison.OrdinalIgnoreCase)) ? 1 : 0;
            if (fCanLaunch == 0) {
                string property = GetConfigurationProperty("StartProgram", true);
                fCanLaunch = (property != null && property.Length > 0) ? 1 : 0;
            }
            return VSConstants.S_OK;
        }

        #endregion

        #region IVsCfgBrowseObject

        /// <summary>
        /// Maps back to the configuration corresponding to the browse object.
        /// </summary>
        /// <param name="cfg">The IVsCfg object represented by the browse object</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code. </returns>
        public virtual int GetCfg(out IVsCfg cfg) {
            cfg = this;
            return VSConstants.S_OK;
        }

        /// <summary>
        /// Maps back to the hierarchy or project item object corresponding to the browse object.
        /// </summary>
        /// <param name="hier">Reference to the hierarchy object.</param>
        /// <param name="itemid">Reference to the project item.</param>
        /// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code. </returns>
        public virtual int GetProjectItem(out IVsHierarchy hier, out uint itemid) {
            Utilities.CheckNotNull(this.project);
            Utilities.CheckNotNull(this.project.NodeProperties);

            return this.project.NodeProperties.GetProjectItem(out hier, out itemid);
        }

        #endregion

        #region helper methods

        private MSBuildExecution.ProjectInstance GetCurrentConfig(bool resetCache = false) {
            if (resetCache || currentConfig == null) {
                // Get properties for current configuration from project file and cache it
                project.SetConfiguration(ConfigName);
                project.BuildProject.ReevaluateIfNecessary();
                // Create a snapshot of the evaluated project in its current state
                currentConfig = project.BuildProject.CreateProjectInstance();

                // Restore configuration
                project.SetCurrentConfiguration();
            }
            return currentConfig;
        }

        private MSBuildExecution.ProjectPropertyInstance GetMsBuildProperty(string propertyName, bool resetCache) {
            var current = GetCurrentConfig(resetCache);

            if (current == null)
                throw new Exception("Failed to retrieve properties");

            // return property asked for
            return current.GetProperty(propertyName);
        }

        /// <summary>
        /// Retrieves the configuration dependent property pages.
        /// </summary>
        /// <param name="pages">The pages to return.</param>
        private void GetCfgPropertyPages(CAUUID[] pages) {
            // We do not check whether the supportsProjectDesigner is set to true on the ProjectNode.
            // We rely that the caller knows what to call on us.
            Utilities.ArgumentNotNull("pages", pages);

            if (pages.Length == 0) {
                throw new ArgumentException(SR.GetString(SR.InvalidParameter), "pages");
            }

            // Retrive the list of guids from hierarchy properties.
            // Because a flavor could modify that list we must make sure we are calling the outer most implementation of IVsHierarchy
            string guidsList = String.Empty;
            IVsHierarchy hierarchy = project.GetOuterInterface<IVsHierarchy>();
            object variant = null;
            ErrorHandler.ThrowOnFailure(hierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID2.VSHPROPID_CfgPropertyPagesCLSIDList, out variant), new int[] { VSConstants.DISP_E_MEMBERNOTFOUND, VSConstants.E_NOTIMPL });
            guidsList = (string)variant;

            Guid[] guids = Utilities.GuidsArrayFromSemicolonDelimitedStringOfGuids(guidsList);
            if (guids == null || guids.Length == 0) {
                pages[0] = new CAUUID();
                pages[0].cElems = 0;
            } else {
                pages[0] = PackageUtilities.CreateCAUUIDFromGuidArray(guids);
            }
        }

        internal virtual bool IsInputGroup(string groupName) {
            return groupName == "SourceFiles";
        }

        private static DateTime? TryGetLastWriteTimeUtc(string path, Redirector output = null) {
            try {
                return File.GetLastWriteTimeUtc(path);
            } catch (UnauthorizedAccessException ex) {
                if (output != null) {
                    output.WriteErrorLine(string.Format("Failed to access {0}: {1}", path, ex.Message));
#if DEBUG
                    output.WriteErrorLine(ex.ToString());
#endif
                }
            } catch (ArgumentException ex) {
                if (output != null) {
                    output.WriteErrorLine(string.Format("Failed to access {0}: {1}", path, ex.Message));
#if DEBUG
                    output.WriteErrorLine(ex.ToString());
#endif
                }
            } catch (PathTooLongException ex) {
                if (output != null) {
                    output.WriteErrorLine(string.Format("Failed to access {0}: {1}", path, ex.Message));
#if DEBUG
                    output.WriteErrorLine(ex.ToString());
#endif
                }
            } catch (NotSupportedException ex) {
                if (output != null) {
                    output.WriteErrorLine(string.Format("Failed to access {0}: {1}", path, ex.Message));
#if DEBUG
                    output.WriteErrorLine(ex.ToString());
#endif
                }
            }
            return null;
        }

        internal virtual bool IsUpToDate() {
            var outputWindow = OutputWindowRedirector.GetGeneral(ProjectMgr.Site);
#if DEBUG
            outputWindow.WriteLine(string.Format("Checking whether {0} needs to be rebuilt:", ProjectMgr.Caption));
#endif

            var latestInput = DateTime.MinValue;
            var earliestOutput = DateTime.MaxValue;
            bool mustRebuild = false;

            var allInputs = new HashSet<string>(OutputGroups
                .Where(g => IsInputGroup(g.Name))
                .SelectMany(x => x.EnumerateOutputs())
                .Select(input => input.CanonicalName),
                StringComparer.OrdinalIgnoreCase
            );
            foreach (var group in OutputGroups.Where(g => !IsInputGroup(g.Name))) {
                foreach (var output in group.EnumerateOutputs()) {
                    var path = output.CanonicalName;
#if DEBUG
                    var dt = TryGetLastWriteTimeUtc(path);
                    outputWindow.WriteLine(string.Format(
                        "  Out: {0}: {1} [{2}]",
                        group.Name,
                        path,
                        dt.HasValue ? dt.Value.ToString("s") : "err"
                    ));
#endif
                    DateTime? modifiedTime;

                    if (!File.Exists(path) ||
                        !(modifiedTime = TryGetLastWriteTimeUtc(path, outputWindow)).HasValue) {
                        mustRebuild = true;
                        break;
                    }

                    string inputPath;
                    if (File.Exists(inputPath = output.GetMetadata("SourceFile"))) {
                        var inputModifiedTime = TryGetLastWriteTimeUtc(inputPath, outputWindow);
                        if (inputModifiedTime.HasValue && inputModifiedTime.Value > modifiedTime.Value) {
                            mustRebuild = true;
                            break;
                        } else {
                            continue;
                        }
                    }

                    // output is an input, ignore it...
                    if (allInputs.Contains(path)) {
                        continue;
                    }

                    if (modifiedTime.Value < earliestOutput) {
                        earliestOutput = modifiedTime.Value;
                    }
                }

                if (mustRebuild) {
                    // Early exit if we know we're going to have to rebuild
                    break;
                }
            }

            if (mustRebuild) {
#if DEBUG
                outputWindow.WriteLine(string.Format(
                    "Rebuilding {0} because mustRebuild is true",
                    ProjectMgr.Caption
                ));
#endif
                return false;
            }

            foreach (var group in OutputGroups.Where(g => IsInputGroup(g.Name))) {
                foreach (var input in group.EnumerateOutputs()) {
                    var path = input.CanonicalName;
#if DEBUG
                    var dt = TryGetLastWriteTimeUtc(path);
                    outputWindow.WriteLine(string.Format(
                        "  In:  {0}: {1} [{2}]",
                        group.Name,
                        path,
                        dt.HasValue ? dt.Value.ToString("s") : "err"
                    ));
#endif
                    if (!File.Exists(path)) {
                        continue;
                    }

                    var modifiedTime = TryGetLastWriteTimeUtc(path, outputWindow);
                    if (modifiedTime.HasValue && modifiedTime.Value > latestInput) {
                        latestInput = modifiedTime.Value;
                        if (earliestOutput < latestInput) {
                            break;
                        }
                    }
                }

                if (earliestOutput < latestInput) {
                    // Early exit if we know we're going to have to rebuild
                    break;
                }
            }

            if (earliestOutput < latestInput) {
#if DEBUG
                outputWindow.WriteLine(string.Format(
                    "Rebuilding {0} because {1:s} < {2:s}",
                    ProjectMgr.Caption,
                    earliestOutput,
                    latestInput
                ));
#endif
                return false;
            } else {
#if DEBUG
                outputWindow.WriteLine(string.Format(
                    "Not rebuilding {0} because {1:s} >= {2:s}",
                    ProjectMgr.Caption,
                    earliestOutput,
                    latestInput
                ));
#endif
                return true;
            }
        }

        #endregion

        #region IVsProjectFlavorCfg Members
        /// <summary>
        /// This is called to let the flavored config let go
        /// of any reference it may still be holding to the base config
        /// </summary>
        /// <returns></returns>
        int IVsProjectFlavorCfg.Close() {
            // This is used to release the reference the flavored config is holding
            // on the base config, but in our scenario these 2 are the same object
            // so we have nothing to do here.
            return VSConstants.S_OK;
        }

        /// <summary>
        /// Actual implementation of get_CfgType.
        /// When not flavored or when the flavor delegate to use
        /// we end up creating the requested config if we support it.
        /// </summary>
        /// <param name="iidCfg">IID representing the type of config object we should create</param>
        /// <param name="ppCfg">Config object that the method created</param>
        /// <returns>HRESULT</returns>
        int IVsProjectFlavorCfg.get_CfgType(ref Guid iidCfg, out IntPtr ppCfg) {
            ppCfg = IntPtr.Zero;

            // See if this is an interface we support
            if (iidCfg == typeof(IVsDebuggableProjectCfg).GUID) {
                ppCfg = Marshal.GetComInterfaceForObject(this, typeof(IVsDebuggableProjectCfg));
            } else if (iidCfg == typeof(IVsBuildableProjectCfg).GUID) {
                IVsBuildableProjectCfg buildableConfig;
                this.get_BuildableProjectCfg(out buildableConfig);
                //
                //In some cases we've intentionally shutdown the build options
                //  If buildableConfig is null then don't try to get the BuildableProjectCfg interface
                //
                if (null != buildableConfig) {
                    ppCfg = Marshal.GetComInterfaceForObject(buildableConfig, typeof(IVsBuildableProjectCfg));
                }
            }

            // If not supported
            if (ppCfg == IntPtr.Zero)
                return VSConstants.E_NOINTERFACE;

            return VSConstants.S_OK;
        }

        #endregion
    }

    [ComVisible(true)]
    internal class BuildableProjectConfig : IVsBuildableProjectCfg {
        #region fields
        ProjectConfig config = null;
        EventSinkCollection callbacks = new EventSinkCollection();
        #endregion

        #region ctors
        public BuildableProjectConfig(ProjectConfig config) {
            this.config = config;
        }
        #endregion

        #region IVsBuildableProjectCfg methods

        public virtual int AdviseBuildStatusCallback(IVsBuildStatusCallback callback, out uint cookie) {
            cookie = callbacks.Add(callback);
            return VSConstants.S_OK;
        }

        public virtual int get_ProjectCfg(out IVsProjectCfg p) {
            p = config;
            return VSConstants.S_OK;
        }

        public virtual int QueryStartBuild(uint options, int[] supported, int[] ready) {
            if (supported != null && supported.Length > 0)
                supported[0] = 1;
            if (ready != null && ready.Length > 0)
                ready[0] = (this.config.ProjectMgr.BuildInProgress) ? 0 : 1;
            return VSConstants.S_OK;
        }

        public virtual int QueryStartClean(uint options, int[] supported, int[] ready) {
            if (supported != null && supported.Length > 0)
                supported[0] = 1;
            if (ready != null && ready.Length > 0)
                ready[0] = (this.config.ProjectMgr.BuildInProgress) ? 0 : 1;
            return VSConstants.S_OK;
        }

        public virtual int QueryStartUpToDateCheck(uint options, int[] supported, int[] ready) {
            if (supported != null && supported.Length > 0)
                supported[0] = 1;
            if (ready != null && ready.Length > 0)
                ready[0] = (this.config.ProjectMgr.BuildInProgress) ? 0 : 1;
            return VSConstants.S_OK;
        }

        public virtual int QueryStatus(out int done) {
            done = (this.config.ProjectMgr.BuildInProgress) ? 0 : 1;
            return VSConstants.S_OK;
        }

        public virtual int StartBuild(IVsOutputWindowPane pane, uint options) {
            config.PrepareBuild(false);

            // Current version of MSBuild wish to be called in an STA
            uint flags = VSConstants.VS_BUILDABLEPROJECTCFGOPTS_REBUILD;

            // If we are not asked for a rebuild, then we build the default target (by passing null)
            this.Build(options, pane, ((options & flags) != 0) ? MsBuildTarget.Rebuild : null);

            return VSConstants.S_OK;
        }

        public virtual int StartClean(IVsOutputWindowPane pane, uint options) {
            config.PrepareBuild(true);
            // Current version of MSBuild wish to be called in an STA
            this.Build(options, pane, MsBuildTarget.Clean);
            return VSConstants.S_OK;
        }

        public virtual int StartUpToDateCheck(IVsOutputWindowPane pane, uint options) {
            return config.IsUpToDate() ?
                VSConstants.S_OK :
                VSConstants.E_FAIL;
        }

        public virtual int Stop(int fsync) {
            return VSConstants.S_OK;
        }

        public virtual int UnadviseBuildStatusCallback(uint cookie) {
            callbacks.RemoveAt(cookie);
            return VSConstants.S_OK;
        }

        public virtual int Wait(uint ms, int fTickWhenMessageQNotEmpty) {
            return VSConstants.E_NOTIMPL;
        }
        #endregion

        #region helpers

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        private bool NotifyBuildBegin() {
            int shouldContinue = 1;
            foreach (IVsBuildStatusCallback cb in callbacks) {
                try {
                    ErrorHandler.ThrowOnFailure(cb.BuildBegin(ref shouldContinue));
                    if (shouldContinue == 0) {
                        return false;
                    }
                } catch (Exception e) {
                    // If those who ask for status have bugs in their code it should not prevent the build/notification from happening
                    Debug.Fail(SR.GetString(SR.BuildEventError, e.Message));
                }
            }

            return true;
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
        private void NotifyBuildEnd(MSBuildResult result, string buildTarget) {
            int success = ((result == MSBuildResult.Successful) ? 1 : 0);

            foreach (IVsBuildStatusCallback cb in callbacks) {
                try {
                    ErrorHandler.ThrowOnFailure(cb.BuildEnd(success));
                } catch (Exception e) {
                    // If those who ask for status have bugs in their code it should not prevent the build/notification from happening
                    Debug.Fail(SR.GetString(SR.BuildEventError, e.Message));
                } finally {
                    // We want to refresh the references if we are building with the Build or Rebuild target or if the project was opened for browsing only.
                    bool shouldRepaintReferences = (buildTarget == null || buildTarget == MsBuildTarget.Build || buildTarget == MsBuildTarget.Rebuild);

                    // Now repaint references if that is needed.
                    // We hardly rely here on the fact the ResolveAssemblyReferences target has been run as part of the build.
                    // One scenario to think at is when an assembly reference is renamed on disk thus becomming unresolvable,
                    // but msbuild can actually resolve it.
                    // Another one if the project was opened only for browsing and now the user chooses to build or rebuild.
                    if (shouldRepaintReferences && (result == MSBuildResult.Successful)) {
                        this.RefreshReferences();
                    }
                }
            }
        }

        private void Build(uint options, IVsOutputWindowPane output, string target) {
            if (!this.NotifyBuildBegin()) {
                return;
            }

            try {
                config.ProjectMgr.BuildAsync(options, this.config.ConfigName, output, target, (result, buildTarget) => this.NotifyBuildEnd(result, buildTarget));
            } catch (Exception e) {
                if (e.IsCriticalException()) {
                    throw;
                }
                Trace.WriteLine("Exception : " + e.Message);
                ErrorHandler.ThrowOnFailure(output.OutputStringThreadSafe("Unhandled Exception:" + e.Message + "\n"));
                this.NotifyBuildEnd(MSBuildResult.Failed, target);
                throw;
            } finally {
                ErrorHandler.ThrowOnFailure(output.FlushToTaskList());
            }
        }

        /// <summary>
        /// Refreshes references and redraws them correctly.
        /// </summary>
        private void RefreshReferences() {
            // Refresh the reference container node for assemblies that could be resolved.
            IReferenceContainer referenceContainer = this.config.ProjectMgr.GetReferenceContainer();
            if (referenceContainer != null) {
                foreach (ReferenceNode referenceNode in referenceContainer.EnumReferences()) {
                    referenceNode.RefreshReference();
                }
            }
        }
        #endregion
    }

}


text:
package org.apache.activemq.bugs;

import javax.jms.BytesMessage;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerRegistry;
import org.apache.activemq.broker.BrokerService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class AMQ5136Test {

    BrokerService brokerService;
    @Before
    public void startBroker() throws Exception {
        brokerService = new BrokerService();
        brokerService.setPersistent(false);
        brokerService.setUseJmx(false);
        brokerService.start();
    }

    @After
    public void stopBroker() throws Exception {
        brokerService.stop();
    }

    @Test
    public void memoryUsageOnCommit() throws Exception {
        sendMessagesAndAssertMemoryUsage(new TransactionHandler() {
            @Override
            public void finishTransaction(Session session) throws JMSException {
                session.commit();
            }
        });
    }

    @Test
    public void memoryUsageOnRollback() throws Exception {
        sendMessagesAndAssertMemoryUsage(new TransactionHandler() {
            @Override
            public void finishTransaction(Session session) throws JMSException {
                session.rollback();
            }
        });
    }

    private void sendMessagesAndAssertMemoryUsage(TransactionHandler transactionHandler) throws Exception {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        Topic destination = session.createTopic("ActiveMQBug");
        MessageProducer producer = session.createProducer(destination);
        for (int i = 0; i < 100; i++) {
            BytesMessage message = session.createBytesMessage();
            message.writeBytes(generateBytes());
            producer.send(message);
            transactionHandler.finishTransaction(session);
        }
        connection.close();
        org.junit.Assert.assertEquals(0, BrokerRegistry.getInstance().findFirst().getSystemUsage().getMemoryUsage().getPercentUsage());
    }

    private byte[] generateBytes() {
        byte[] bytes = new byte[100000];
        for (int i = 0; i < 100000; i++) {
            bytes[i] = (byte) i;
        }
        return bytes;
    }

    private static interface TransactionHandler {
        void finishTransaction(Session session) throws JMSException;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.camel.component.milo.testing;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public final class Application2Client {

    private Application2Client() {
    }

    public static void main(final String[] args) throws Exception {

        // camel conext

        final CamelContext context = new DefaultCamelContext();

        // add paho

        // no need to register, gets auto detected
        // context.addComponent("paho", new PahoComponent());

        // add OPC UA

        // add routes

        context.addRoutes(new RouteBuilder() {

            @Override
            public void configure() throws Exception {
                from("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem&namespaceUri=urn:org:apache:camel").log("From OPC UA: ${body}")
                    .to("milo-client:tcp://foo:bar@localhost:12685?nodeId=items-MyItem2&namespaceUri=urn:org:apache:camel");
            }
        });

        // start

        context.start();

        // sleep

        while (true) {
            Thread.sleep(Long.MAX_VALUE);
        }
    }
}


text:
<!doctype html>

	{% block head %}
	<meta charset="UTF-8">
	<title>{% block title %} BoughtSpot {% endblock %}</title>
	<link href='http://fonts.googleapis.com/css?family=Lato|Open+Sans:400,700' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/boughtspot.css') }}" media="screen">
	<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/font-awesome.css') }}" media="screen">
	{% endblock %}

BoughtSpot

About Us

Clients

Contact Us

	{% block body %}

Brand Identity, Web Development & Online Advertising

At BoughtSpot, we help you define your brand, build your web presence and increase engagement with customers. Simply, we design logos, brochures, websites while advertising your business online on social networks, blogs, etc.

		Work With Us

They have enjoyed working with us. You can too.

Website Design, Consulting and Development

		Joselyn Canfor-Dumas Foundation
		Chris Attoh
		Leaders and Mentors
		Mach IV Aviation

Online Marketing

		Sparrow Station
		Nim Street
		Blu Telecommunications

		Get in touch.
		<form action="">
			<input type="Name" placeholder="Your Name">
			<textarea name="" id="" cols="30" rows="10" placeholder="Your message"></textarea>
			Talk to us
		</form>

	{% endblock body %}

	{% block footer %}

© 2014, BoughtSpot

About Us

Clients

Contact Us

Phone: +233205479685

Email: work@boughtspot.com

	Google+
	{% endblock footer %}


text:
'''
Tests related to pychecker.CodeChecks
'''

import unittest
import common

from pychecker import CodeChecks

class DispatchTestCase(common.TestCase):
    '''
    Test that we have all opcodes in the DISPATCH array.
    '''
    def testDispatch(self):
        if not common.canImport('dis'):
            # FIXME: no skip support
            return

        res = []
        import dis
        for key, value in dis.opmap.items():
            if not CodeChecks.DISPATCH[value]:
                res.append("opcode %d: %s not in CodeChecks.DISPATCH" % (
                    value, key))
        self.failIf(res, "\n".join(res))


text:
<?php

namespace Cpliakas\DynamoDb\ODM\Event;

use Symfony\Component\EventDispatcher\Event;

class SearchRequestEvent extends Event
{
    /**
     * @var string
     */
    protected $entityClass;

    /**
     * @param string $entityClass
     */
    public function __construct($entityClass)
    {
        $this->entityClass = $entityClass;
    }

    /**
     * @return string
     */
    public function getEntityClass()
    {
        return $this->entityClass;
    }
}


text:
import { CliTrackerController } from 'azk/cli/cli_tracker_controller.js';
import { Helpers } from 'azk/cli/helpers';
import { _, log, config, utils } from 'azk';
import { async } from 'azk/utils/promises';

export default class Docker extends CliTrackerController {
  index(opts) {
    return async(this, function* () {
      if (!config('agent:requires_vm')) {
        var args = _.map(opts['docker-args'], (arg) => arg.replace(/(["\\`])/g, "\\$1"));
        let cmd  = `/bin/sh -c 'docker "${args.join('" "')}"'`;
        log.debug("docker direct options: %s", cmd, {});
        return this.ui.execSh(cmd);
      } else {
        // Require agent is started
        yield Helpers.requireAgent(this.ui);

        // cmd
        let cmd = ["vm", "ssh"];

        // If is interactive mode force ssh tty
        if (this.ui.isInteractive()) {
          cmd.push("-t");
        }

        // init command
        cmd.push('--');

        // Move to current folder
        var point = config('agent:vm:mount_point');
        cmd.push("cd");
        cmd.push(utils.docker.resolvePath(this.cwd || '', point));
        cmd.push(" ;");

        // Adding escape arguments and mount docker command
        cmd.push("docker");
        cmd = [...cmd, ...opts['docker-args']];

        log.debug("docker vm options: %j", cmd, {});
        return this.runShellInternally(cmd);
      }
    });
  }
}


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GridCellScript : MonoBehaviour {

    GameManager gameManager;

	void Start () {
        gameManager = GameObject.FindWithTag("GameManager").GetComponent<GameManager>();
	}

	// Update is called once per frame
	void Update () {

	}

    public void mButtonClick()
    {
        GetComponentInChildren<Text>().text = gameManager.whoseTurn;
        gameManager.ChangeTurn();
    }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.execution;

import com.google.common.base.Predicate;

public enum QueryState
{
    /**
     * Query has been accepted and is awaiting execution.
     */
    QUEUED(false),
    /**
     * Query is being planned.
     */
    PLANNING(false),
    /**
     * Query execution is being started.
     */
    STARTING(false),
    /**
     * Query has at least one task in the output stage.
     */
    RUNNING(false),
    /**
     * Query has finished executing and all output has been consumed.
     */
    FINISHED(true),
    /**
     * Query was canceled by a user.
     */
    CANCELED(true),
    /**
     * Query execution failed.
     */
    FAILED(true);

    private final boolean doneState;

    private QueryState(boolean doneState)
    {
        this.doneState = doneState;
    }

    /**
     * Is this a terminal state.
     */
    public boolean isDone()
    {
        return doneState;
    }

    public static Predicate<QueryState> inDoneState()
    {
        return new Predicate<QueryState>()
        {
            @Override
            public boolean apply(QueryState state)
            {
                return state.isDone();
            }
        };
    }
}


text:
namespace Logging {

LoggerMessage::LoggerMessage(ILogger& logger, const std::string& category, Level level, const std::string& color)
  : std::ostream(this)
  , std::streambuf()
  , logger(logger)
  , category(category)
  , logLevel(level)
  , message(color)
  , timestamp(boost::posix_time::microsec_clock::local_time())
  , gotText(false) {
}

LoggerMessage::~LoggerMessage() {
  if (gotText) {
    (*this) << std::endl;
  }
}

#ifndef __linux__
LoggerMessage::LoggerMessage(LoggerMessage&& other)
  : std::ostream(std::move(other))
  , std::streambuf(std::move(other))
  , category(other.category)
  , logLevel(other.logLevel)
  , logger(other.logger)
  , message(other.message)
  , timestamp(boost::posix_time::microsec_clock::local_time())
  , gotText(false) {
  this->set_rdbuf(this);
}
#else
LoggerMessage::LoggerMessage(LoggerMessage&& other)
  : std::ostream(nullptr)
  , std::streambuf()
  , category(other.category)
  , logLevel(other.logLevel)
  , logger(other.logger)
  , message(other.message)
  , timestamp(boost::posix_time::microsec_clock::local_time())
  , gotText(false) {
  if (this != &other) {
    _M_tie = nullptr;
    _M_streambuf = nullptr;

    //ios_base swap
    std::swap(_M_streambuf_state, other._M_streambuf_state);
    std::swap(_M_exception, other._M_exception);
    std::swap(_M_flags, other._M_flags);
    std::swap(_M_precision, other._M_precision);
    std::swap(_M_width, other._M_width);

    std::swap(_M_callbacks, other._M_callbacks);
    std::swap(_M_ios_locale, other._M_ios_locale);
    //ios_base swap

    //streambuf swap
    char *_Pfirst = pbase();
    char *_Pnext = pptr();
    char *_Pend = epptr();
    char *_Gfirst = eback();
    char *_Gnext = gptr();
    char *_Gend = egptr();

    setp(other.pbase(), other.epptr());
    other.setp(_Pfirst, _Pend);

    setg(other.eback(), other.gptr(), other.egptr());
    other.setg(_Gfirst, _Gnext, _Gend);

    std::swap(_M_buf_locale, other._M_buf_locale);
    //streambuf swap

    std::swap(_M_fill, other._M_fill);
    std::swap(_M_tie, other._M_tie);
  }
  _M_streambuf = this;
}
#endif

int LoggerMessage::sync() {
  logger(category, logLevel, timestamp, message);
  gotText = false;
  message = DEFAULT;
  return 0;
}

int LoggerMessage::overflow(int c) {
  gotText = true;
  message += static_cast<char>(c);
  return 0;
}

}


text:
import Vue from 'vue';

const EventsService = {
  // cancel booking
  loadApplications(eventId) {
    return Vue.http.get(`${Vue.config.apiServer}/api/2.0/user/events/${eventId}/applications`);
  },
  // cancel booking
  manageTickets(applications) {
    applications.forEach((application) => {
      /* eslint-disable no-param-reassign */
      application.emailSubject = {
        received: 'Your ticket request for %1$s has been received',
        approved: 'Your ticket request for %1$s has been approved',
        cancelled: 'Your ticket request for %1$s has been cancelled',
      };
      /* eslint-enable no-param-reassign */
    });
    return Vue.http.post(`${Vue.config.apiServer}/api/2.0/events/bulk-apply-applications`, { applications });
  },
  // Dojo Stats, blame me but that's the fastest of the existing endpoint
  searchApplicationsByDojo(dojoId, params) {
    return Vue.http.post(`${Vue.config.apiServer}/api/2.0/events/applications/search`, { query: { dojoId, ...params } });
  },
  v3: {
    get(dojoId, options) {
      return Vue.http.get(`${Vue.config.apiServer}/api/3.0/dojos/${dojoId}/events`, options);
    },
    createOrder(eventId, applications) {
      return Vue.http.post(`${Vue.config.apiServer}/api/3.0/events/${eventId}/orders`, { applications });
    },
    updateOrder(orderId, userId, applications) {
      return Vue.http.put(`${Vue.config.apiServer}/api/3.0/users/${userId}/orders/${orderId}`, { applications });
    },
    getOrder(userId, options) {
      return Vue.http.get(`${Vue.config.apiServer}/api/3.0/users/${userId}/orders`, options);
    },
    create(event) {
      return Vue.http.post(`${Vue.config.apiServer}/api/3.0/events`, event);
    },
    load(eventId, options) {
      return Vue.http.get(`${Vue.config.apiServer}/api/3.0/events/${eventId}`, options);
    },
    update(event) {
      return Vue.http.put(`${Vue.config.apiServer}/api/3.0/events/${event.id}`, event);
    },
  },
};

export default EventsService;


text:
package com.nmj.apis.nmj;

import android.content.Context;
import android.preference.PreferenceManager;

import com.nmj.abstractclasses.NMJApiService;
import com.nmj.db.DbAdapterMovies;
import com.nmj.functions.NMJLib;
import com.nmj.functions.Video;
import com.nmj.nmjmanager.R;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;

import static com.nmj.functions.PreferenceKeys.MOVIE_RATINGS_SOURCE;

public class NMJMovieService extends NMJApiService {

    private static NMJMovieService mService;

    private final String mTmdbApiKey;
    private final String mTmdbApiURL;
    private final Context mContext;

    private NMJMovieService(Context context) {
        mContext = context;
        mTmdbApiKey = NMJLib.getTmdbApiKey(mContext);
        mTmdbApiURL = NMJLib.getTmdbApiURL(mContext);
    }

    public static NMJMovieService getInstance(Context context) {
        if (mService == null)
            mService = new NMJMovieService(context);
        return mService;
    }

    public String getRatingsProvider() {
        return PreferenceManager.getDefaultSharedPreferences(mContext).getString(MOVIE_RATINGS_SOURCE, mContext.getString(R.string.ratings_option_1));
    }

    @Override
    public List<Movie> search(String query, String language) {
        language = getLanguage(language);

        String serviceUrl = "";

        try {
            serviceUrl = mTmdbApiURL + "search/movie?query=" + URLEncoder.encode(query, "utf-8") + "&language=" + language + "&api_key=" + mTmdbApiKey;
        } catch (UnsupportedEncodingException e) {
        }

        return getListFromUrl(serviceUrl);
    }

    @Override
    public List<Movie> search(String query, String year, String language) {
        language = getLanguage(language);

        String serviceUrl = "";

        try {
            serviceUrl = mTmdbApiURL + "search/movie?query=" + URLEncoder.encode(query, "utf-8") + "&language=" + language + "&year=" + year + "&api_key=" + mTmdbApiKey;
        } catch (UnsupportedEncodingException e) {
        }

        return getListFromUrl(serviceUrl);
    }

    @Override
    public List<Movie> searchByImdbId(String imdbId, String language) {
        language = getLanguage(language);

        ArrayList<Movie> results = new ArrayList<>();

        try {
            JSONObject jObject = NMJLib.getJSONObject(mContext, mTmdbApiURL + "find/" + imdbId + "?language=" + language + "&external_source=imdb_id&api_key=" + mTmdbApiKey);

            JSONArray array = jObject.getJSONArray("movie_results");

            String baseUrl = NMJLib.getTmdbImageBaseUrl(mContext);
            String imageSizeUrl = NMJLib.getImageUrlSize(mContext);

            for (int i = 0; i < array.length(); i++) {
                Movie movie = new Movie();
                movie.setTitle(array.getJSONObject(i).getString("title"));
                movie.setOriginalTitle(array.getJSONObject(i).getString("original_title"));
                movie.setReleasedate(array.getJSONObject(i).getString("release_date"));
                movie.setPlot(""); // TMDb doesn't support descriptions in search results
                movie.setRating(String.valueOf(array.getJSONObject(i).getDouble("vote_average")));
                movie.setTmdbId(String.valueOf(array.getJSONObject(i).getInt("id")));
                movie.setPoster(baseUrl + imageSizeUrl + array.getJSONObject(i).getString("poster_path"));
                results.add(movie);
            }
        } catch (JSONException e) {
        }

        return results;
    }

    @Override
    public Movie get(String id, String language) {
        return getCompleteNMJMovie(id, language);
    }

    public Movie getCompleteNMJMovie(String id, String language) {
        Movie movie = new Movie();
        movie.setShowId(id);
        String nmjImgURL = NMJLib.getNMJImageURL();

        if (id.equals(DbAdapterMovies.UNIDENTIFIED_ID))
            return movie;

        try {
            // Get the base URL from the preferences
            String baseUrl = NMJLib.getTmdbImageBaseUrl(mContext);

            JSONObject jObject;
            File f = new File(NMJLib.getDrivePath());
            String CacheId = f.getName() + "_nmj_" + id;

            if (NMJLib.getTMDbCache(CacheId).equals("")) {
                System.out.println("Putting Cache in " + CacheId);
                jObject = NMJLib.getJSONObject(mContext, NMJLib.getNMJServerPHPURL() +
                        "&action=getVideoDetails&showid=" + id + "&title_type=1");
                NMJLib.setTMDbCache(CacheId, jObject.toString());
            }
            System.out.println("Getting Cache from " + CacheId);
            jObject = new JSONObject(NMJLib.getTMDbCache(CacheId));

            movie.setTitle(NMJLib.getStringFromJSONObject(jObject, "TITLE", ""));
            movie.setCertification(NMJLib.getStringFromJSONObject(jObject, "PARENTAL_CONTROL", ""));
            movie.setPlot(NMJLib.getStringFromJSONObject(jObject, "CONTENT", ""));
            movie.setImdbId(NMJLib.getStringFromJSONObject(jObject, "TTID", ""));
            movie.setTmdbId(NMJLib.getStringFromJSONObject(jObject, "CONTENT_TTID", ""));
            movie.setRating(NMJLib.getStringFromJSONObject(jObject, "RATING", "0.0"));
            movie.setReleasedate(NMJLib.getStringFromJSONObject(jObject, "RELEASE_DATE", ""));
            movie.setRuntime(NMJLib.getStringFromJSONObject(jObject, "RUNTIME", "0"));
            movie.setFavourite(NMJLib.getStringFromJSONObject(jObject, "FAVOURITE", "0"));
            movie.setToWatch(NMJLib.getStringFromJSONObject(jObject, "WATCHLIST", "0"));
            System.out.println("To Watch: " + movie.toWatch());
            try {
                movie.setPoster(nmjImgURL + jObject.getString("POSTER"));
            } catch (Exception e) {
            }

            try {
                JSONArray genre = jObject.getJSONArray("GENRE");
                String genres = "";
                for (int i = 0; i < genre.length(); i++)
                    genres = genres + genre.get(i) + ", ";
                movie.setGenres(genres.substring(0, genres.length() - 2));
            } catch (Exception e) {
            }

            try {
                ArrayList<Video> videoDetails = new ArrayList<>();
                JSONArray video = jObject.getJSONArray("VIDEO");

                for (int i = 0; i < video.length(); i++) {
                    videoDetails.add(new Video(jObject.getString("SHOW_ID"),
                            video.getJSONObject(i).getString("VIDEO_ID"),
                            video.getJSONObject(i).getString("SIZE"),
                            video.getJSONObject(i).getString("PATH")
                    ));
                    videoDetails.get(i).setPlayCount(video.getJSONObject(i).getString("PLAY_COUNT"));
                    movie.setHasWatched(videoDetails.get(i).getPlayCount());
                    videoDetails.get(i).setWidth(video.getJSONObject(i).getString("WIDTH"));
                    videoDetails.get(i).setHeight(video.getJSONObject(i).getString("HEIGHT"));
                    videoDetails.get(i).setResolution();
                    videoDetails.get(i).setRuntime(video.getJSONObject(i).getString("RUNTIME"));
                    videoDetails.get(i).setAspectRatio(video.getJSONObject(i).getString("ASPECT_RATIO"));
                    videoDetails.get(i).setFPS(video.getJSONObject(i).getString("FPS"));
                    videoDetails.get(i).setSystem(video.getJSONObject(i).getString("SYSTEM"));
                    videoDetails.get(i).setVideoCodec(video.getJSONObject(i).getString("VIDEO_CODEC"));
                    videoDetails.get(i).setThreeD(video.getJSONObject(i).getString("THREE_D"));
                }
                movie.setVideo(videoDetails);
            } catch (Exception e) {
            }
            //System.out.println("Debug: Video Output: " + movie.getVideo().get(0).getPlayCount());
            CacheId = "movie_" + movie.getTmdbId().replace("tmdb", "");

            if (NMJLib.getTMDbCache(CacheId).equals("")) {
                System.out.println("Putting Cache in " + CacheId);
                NMJLib.setTMDbCache(CacheId, NMJLib.getJSONObject(mContext, mTmdbApiURL + "movie/" + movie.getId() + "?api_key=" + mTmdbApiKey + "&language=" + language + "&append_to_response=recommendations,releases,trailers,credits,images,similar&include_image_language=en,null").toString());
            }
            System.out.println("Getting Cache from " + CacheId);
            jObject = new JSONObject(NMJLib.getTMDbCache(CacheId));
            movie.setTagline(NMJLib.getStringFromJSONObject(jObject, "tagline", ""));

        } catch (Exception e) {
            System.out.println("Exception Occurred in getCompleteMovie : " + e.toString());
            // If something goes wrong here, i.e. API error, we won't get any details
            // about the movie - in other words, it's unidentified
            movie.setTmdbId(DbAdapterMovies.UNIDENTIFIED_ID);
        }

        return movie;
    }

    @Override
    public List<String> getCovers(String id) {
        ArrayList<String> covers = new ArrayList<>();
        String baseUrl = NMJLib.getTmdbImageBaseUrl(mContext);

        try {
            JSONObject jObject = NMJLib.getJSONObject(mContext, mTmdbApiURL + "movie/" + id + "/images" + "?api_key=" + mTmdbApiKey);
            JSONArray jArray = jObject.getJSONArray("posters");
            for (int i = 0; i < jArray.length(); i++) {
                covers.add(baseUrl + NMJLib.getImageUrlSize(mContext) + NMJLib.getStringFromJSONObject(jArray.getJSONObject(i), "file_path", ""));
            }
        } catch (JSONException e) {
        }

        return covers;
    }

    @Override
    public List<String> getBackdrops(String id) {
        ArrayList<String> covers = new ArrayList<>();
        String baseUrl = NMJLib.getTmdbImageBaseUrl(mContext);

        try {
            JSONObject jObject = NMJLib.getJSONObject(mContext, mTmdbApiURL + "movie/" + id + "/images" + "?api_key=" + mTmdbApiKey);
            JSONArray jArray = jObject.getJSONArray("backdrops");
            for (int i = 0; i < jArray.length(); i++) {
                covers.add(baseUrl + NMJLib.getBackdropThumbUrlSize(mContext) + NMJLib.getStringFromJSONObject(jArray.getJSONObject(i), "file_path", ""));
            }
        } catch (JSONException e) {
        }

        return covers;
    }

    private ArrayList<Movie> getListFromUrl(String serviceUrl) {
        ArrayList<Movie> results = new ArrayList<>();

        try {
            JSONObject jObject = NMJLib.getJSONObject(mContext, serviceUrl);
            JSONArray array = jObject.getJSONArray("results");

            String baseUrl = NMJLib.getTmdbImageBaseUrl(mContext);
            String imageSizeUrl = NMJLib.getImageUrlSize(mContext);

            for (int i = 0; i < array.length(); i++) {
                Movie movie = new Movie();
                movie.setTitle(array.getJSONObject(i).getString("title"));
                movie.setOriginalTitle(array.getJSONObject(i).getString("original_title"));
                movie.setReleasedate(array.getJSONObject(i).getString("release_date"));
                movie.setPlot(""); // TMDb doesn't support descriptions in search results
                movie.setRating(String.valueOf(array.getJSONObject(i).getDouble("vote_average")));
                movie.setTmdbId(String.valueOf(array.getJSONObject(i).getInt("id")));
                movie.setPoster(baseUrl + imageSizeUrl + array.getJSONObject(i).getString("poster_path"));
                results.add(movie);
            }
        } catch (JSONException e) {
        }

        return results;
    }

    @Override
    public List<Movie> searchNgram(String query, String language) {
        language = getLanguage(language);

        String serviceUrl = "";

        try {
            serviceUrl = mTmdbApiURL + "search/movie?query=" + URLEncoder.encode(query, "utf-8") + "&language=" + language + "&search_type=ngram&api_key=" + mTmdbApiKey;
        } catch (UnsupportedEncodingException e) {
        }

        return getListFromUrl(serviceUrl);
    }
}


text:
package org.apache.tinkerpop.gremlin.orientdb;

import org.apache.tinkerpop.gremlin.structure.util.TransactionException;

public class OrientNoTransaction extends OrientTransaction {

  public OrientNoTransaction(OrientGraph g) {
    super(g);
  }

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

  @Override
  protected void doOpen() {
    // do nothing, no transaction
  }

  @Override
  protected void doCommit() throws TransactionException {
    // do nothing, no transaction
  }

  @Override
  protected void doRollback() throws TransactionException {
    // do nothing, no transaction
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
              xmlns:mafp="http://myfaces.apache.org/maven-trinidad-plugin"
              xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <faces-config-extension>
    <mfp:event>
      <mfp:description>The selection event is delivered when the table selection
                       changes.</mfp:description>
      <mfp:event-type>org.apache.myfaces.trinidad.Selection</mfp:event-type>
      <mfp:event-class>org.apache.myfaces.trinidad.event.SelectionEvent</mfp:event-class>
      <mfp:event-listener-class>org.apache.myfaces.trinidad.event.SelectionListener</mfp:event-listener-class>
    </mfp:event>
  </faces-config-extension>
</faces-config>


text:
/* eslint-disable */
;(function(root, factory) {
  if (typeof define === 'function' && define.amd) { // AMD
    define([], factory);
  } else if (typeof exports === 'object') { // Node.js
    module.exports = factory();
  } else { // Browser
    var messages = factory();
    for (var key in messages) {
      root.Blockly.Msg[key] = messages[key];
    }
  }
}(this, function() {
// This file was automatically generated.  Do not modify.

'use strict';

const messages = Object.create(null);

messages["ADD_COMMENT"] = "Pridať komentár";
messages["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Nie je možné zmazať premennú "%1", pretože je súčasťou definície funkcie "%2"";
messages["CHANGE_VALUE_TITLE"] = "Zmeniť hodnotu:";
messages["CLEAN_UP"] = "Narovnať bloky";
messages["COLLAPSED_WARNINGS_WARNING"] = "Zrútené bloky obsahujú varovanie.";
messages["COLLAPSE_ALL"] = "Zvinúť bloky";
messages["COLLAPSE_BLOCK"] = "Zvinúť blok";
messages["COLOUR_BLEND_COLOUR1"] = "farba 1";
messages["COLOUR_BLEND_COLOUR2"] = "farba 2";
messages["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp";  // untranslated
messages["COLOUR_BLEND_RATIO"] = "pomer";
messages["COLOUR_BLEND_TITLE"] = "zmiešať";
messages["COLOUR_BLEND_TOOLTIP"] = "Zmieša dve farby v danom pomere (0.0 - 1.0).";
messages["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color";
messages["COLOUR_PICKER_TOOLTIP"] = "Zvoľte farbu z palety.";
messages["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com";  // untranslated
messages["COLOUR_RANDOM_TITLE"] = "náhodná farba";
messages["COLOUR_RANDOM_TOOLTIP"] = "Zvoliť farbu náhodne.";
messages["COLOUR_RGB_BLUE"] = "modrá";
messages["COLOUR_RGB_GREEN"] = "zelená";
messages["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html";  // untranslated
messages["COLOUR_RGB_RED"] = "červená";
messages["COLOUR_RGB_TITLE"] = "ofarbiť s";
messages["COLOUR_RGB_TOOLTIP"] = "Vytvoriť farbu pomocou zadaného množstva červenej, zelenej a modrej. Množstvo musí byť medzi 0 a 100.";
messages["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";  // untranslated
messages["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "opustiť slučku";
messages["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "prejdi na nasledujúce opakovanie slučky";
messages["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Opustiť túto slučku.";
messages["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Vynechať zvyšok tejto slučky a pokračovať ďalším opakovaním.";
messages["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Upozornenie: Tento blok sa môže používať len v rámci slučky.";
messages["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each";  // untranslated
messages["CONTROLS_FOREACH_TITLE"] = "pre každý prvok %1 v zozname %2";
messages["CONTROLS_FOREACH_TOOLTIP"] = "Pre každý prvok v zozname priraď jeho hodnotu do premenej '%1' a vykonaj príkazy.";
messages["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with";  // untranslated
messages["CONTROLS_FOR_TITLE"] = "počítať s %1 od %2 do %3 o %4";
messages["CONTROLS_FOR_TOOLTIP"] = "Nechá premennú '%1' nadobúdať hodnoty od začiatočného čísla po konečné s daným medzikrokom a vykoná zadané bloky.";
messages["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Pridať podmienku k \"ak\" bloku.";
messages["CONTROLS_IF_ELSE_TOOLTIP"] = "Pridať poslednú záchytnú podmienku k \"ak\" bloku.";
messages["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse";  // untranslated
messages["CONTROLS_IF_IF_TOOLTIP"] = "Pridať, odstrániť alebo zmeniť poradie oddielov tohto \"ak\" bloku.";
messages["CONTROLS_IF_MSG_ELSE"] = "inak";
messages["CONTROLS_IF_MSG_ELSEIF"] = "inak ak";
messages["CONTROLS_IF_MSG_IF"] = "ak";
messages["CONTROLS_IF_TOOLTIP_1"] = "Ak je hodnota pravda, vykonaj príkazy.";
messages["CONTROLS_IF_TOOLTIP_2"] = "Ak je hodnota pravda, vykonaj príkazy v prvom bloku. Inak vykonaj príkazy v druhom bloku.";
messages["CONTROLS_IF_TOOLTIP_3"] = "Ak je prvá hodnota pravda, vykonaj príkazy v prvom bloku. Inak, ak je druhá hodnota pravda, vykonaj príkazy v druhom bloku.";
messages["CONTROLS_IF_TOOLTIP_4"] = "Ak je prvá hodnota pravda, vykonaj príkazy v prvom bloku. Inak, ak je druhá hodnota pravda, vykonaj príkazy v druhom bloku. Ak ani jedna hodnota nie je pravda, vykonaj príkazy v poslednom bloku.";
messages["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop";
messages["CONTROLS_REPEAT_INPUT_DO"] = "rob";
messages["CONTROLS_REPEAT_TITLE"] = "opakuj %1 krát";
messages["CONTROLS_REPEAT_TOOLTIP"] = "Opakuj určité príkazy viackrát.";
messages["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat";  // untranslated
messages["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "opakuj kým nebude";
messages["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "opakuj kým";
messages["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "Kým je hodnota nepravdivá, vykonávaj príkazy.";
messages["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "Kým je hodnota pravdivá, vykonávaj príkazy.";
messages["DELETE_ALL_BLOCKS"] = "Zmazať všetkých %1 dielcov?";
messages["DELETE_BLOCK"] = "Odstrániť blok";
messages["DELETE_VARIABLE"] = "Odstrániť premennú '%1'";
messages["DELETE_VARIABLE_CONFIRMATION"] = "Odstrániť %1 použití premennej '%2'?";
messages["DELETE_X_BLOCKS"] = "Odstrániť %1 blokov";
messages["DIALOG_CANCEL"] = "Zrušiť";
messages["DIALOG_OK"] = "OK";
messages["DISABLE_BLOCK"] = "Vypnúť blok";
messages["DUPLICATE_BLOCK"] = "Duplikovať";
messages["DUPLICATE_COMMENT"] = "Duplicitný komentár";
messages["ENABLE_BLOCK"] = "Povoliť blok";
messages["EXPAND_ALL"] = "Rozvinúť bloky";
messages["EXPAND_BLOCK"] = "Rozvinúť blok";
messages["EXTERNAL_INPUTS"] = "Vonkajšie vstupy";
messages["HELP"] = "Pomoc";
messages["INLINE_INPUTS"] = "Riadkové vstupy";
messages["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";  // untranslated
messages["LISTS_CREATE_EMPTY_TITLE"] = "prázdny zoznam";
messages["LISTS_CREATE_EMPTY_TOOLTIP"] = "Vráti zoznam nulovej dĺžky, ktorý neobsahuje žiadne prvky.";
messages["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "zoznam";
messages["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Pridaj, odstráň alebo zmeň poradie v tomto zoznamovom bloku.";
messages["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
messages["LISTS_CREATE_WITH_INPUT_WITH"] = "vytvor zoznam s";
messages["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Pridaj prvok do zoznamu.";
messages["LISTS_CREATE_WITH_TOOLTIP"] = "Vytvor zoznam s ľubovoľným počtom prvkov.";
messages["LISTS_GET_INDEX_FIRST"] = "prvý";
messages["LISTS_GET_INDEX_FROM_END"] = "# od konca";
messages["LISTS_GET_INDEX_FROM_START"] = "#";  // untranslated
messages["LISTS_GET_INDEX_GET"] = "zisti";
messages["LISTS_GET_INDEX_GET_REMOVE"] = "zisti a odstráň";
messages["LISTS_GET_INDEX_LAST"] = "posledný";
messages["LISTS_GET_INDEX_RANDOM"] = "náhodný";
messages["LISTS_GET_INDEX_REMOVE"] = "odstráň";
messages["LISTS_GET_INDEX_TAIL"] = "";  // untranslated
messages["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Vráti počiatočný prvok zoznamu.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Vráti prvok na určenej pozícii v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Vráti posledný prvok zoznamu.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Vráti náhodný prvok zoznamu.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Odstráni a vráti prvý prvok v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Odstráni a vráti prvok z určenej pozície v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Odstráni a vráti posledný prvok v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Odstráni a vráti náhodný prvok v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Odstráni prvý prvok v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Odstráni prvok na určenej pozícii v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Odstráni posledný prvok v zozname.";
messages["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Odstráni náhodný prvok v zozname.";
messages["LISTS_GET_SUBLIST_END_FROM_END"] = "po # od konca";
messages["LISTS_GET_SUBLIST_END_FROM_START"] = "po #";
messages["LISTS_GET_SUBLIST_END_LAST"] = "po koniec";
messages["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist";  // untranslated
messages["LISTS_GET_SUBLIST_START_FIRST"] = "Získať podzoznam od začiatku";
messages["LISTS_GET_SUBLIST_START_FROM_END"] = "Získať podzoznam od # od konca";
messages["LISTS_GET_SUBLIST_START_FROM_START"] = "získať podzoznam od #";
messages["LISTS_GET_SUBLIST_TAIL"] = "";  // untranslated
messages["LISTS_GET_SUBLIST_TOOLTIP"] = "Skopíruje určený úsek zoznamu.";
messages["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 je posledný prvok.";
messages["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 je počiatočný prvok.";
messages["LISTS_INDEX_OF_FIRST"] = "nájdi prvý výskyt prvku";
messages["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";  // untranslated
messages["LISTS_INDEX_OF_LAST"] = "nájdi posledný výskyt prvku";
messages["LISTS_INDEX_OF_TOOLTIP"] = "Vráti index prvého/posledného výskytu prvku v zozname. Ak sa nič nenašlo, vráti %1.";
messages["LISTS_INLIST"] = "v zozname";
messages["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty";  // untranslated
messages["LISTS_ISEMPTY_TITLE"] = "%1 je prázdny";
messages["LISTS_ISEMPTY_TOOLTIP"] = "Vráti pravda, ak je zoznam prázdny.";
messages["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of";  // untranslated
messages["LISTS_LENGTH_TITLE"] = "dĺžka %1";
messages["LISTS_LENGTH_TOOLTIP"] = "Vráti dĺžku zoznamu";
messages["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";  // untranslated
messages["LISTS_REPEAT_TITLE"] = "vytvor zoznam s prvkom %1 opakovaným %2 krát";
messages["LISTS_REPEAT_TOOLTIP"] = "Vytvorí zoznam s niekoľkými rovnakými prvkami s danou hodnotou.";
messages["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list";  // untranslated
messages["LISTS_REVERSE_MESSAGE0"] = "obrátiť %1";
messages["LISTS_REVERSE_TOOLTIP"] = "Obrátiť kópiu zoznamu.";
messages["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set";  // untranslated
messages["LISTS_SET_INDEX_INPUT_TO"] = "ako";
messages["LISTS_SET_INDEX_INSERT"] = "vložiť na";
messages["LISTS_SET_INDEX_SET"] = "nastaviť";
messages["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Vsunie prvok na začiatok zoznamu.";
messages["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Vsunie prvok na určenú pozíciu v zozname.";
messages["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Pripojí prvok na koniec zoznamu.";
messages["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Vsunie prvok na náhodné miesto v zozname.";
messages["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Nastaví prvý prvok v zozname.";
messages["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Nastaví prvok na určenej pozícii v zozname.";
messages["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Nastaví posledný prvok v zozname.";
messages["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Nastaví posledný prvok v zozname.";
messages["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
messages["LISTS_SORT_ORDER_ASCENDING"] = "Vzostupne";
messages["LISTS_SORT_ORDER_DESCENDING"] = "Zostupne";
messages["LISTS_SORT_TITLE"] = "zoradiť %1 %2 %3";
messages["LISTS_SORT_TOOLTIP"] = "Zoradiť kópiu zoznamu.";
messages["LISTS_SORT_TYPE_IGNORECASE"] = "abecedne, ignorovať veľkosť písmen";
messages["LISTS_SORT_TYPE_NUMERIC"] = "numericky";
messages["LISTS_SORT_TYPE_TEXT"] = "abecedne";
messages["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";  // untranslated
messages["LISTS_SPLIT_LIST_FROM_TEXT"] = "vytvoriť zoznam z textu";
messages["LISTS_SPLIT_TEXT_FROM_LIST"] = "vytvoriť text zo zoznamu";
messages["LISTS_SPLIT_TOOLTIP_JOIN"] = "Spojiť zoznam textov do jedného textu s oddeľovačmi.";
messages["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Rozdelenie textu do zoznamu textov, lámanie na oddeľovačoch.";
messages["LISTS_SPLIT_WITH_DELIMITER"] = "s oddeľovačom";
messages["LOGIC_BOOLEAN_FALSE"] = "nepravda";
messages["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values";  // untranslated
messages["LOGIC_BOOLEAN_TOOLTIP"] = "Vráť buď hodnotu pravda alebo nepravda.";
messages["LOGIC_BOOLEAN_TRUE"] = "pravda";
messages["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
messages["LOGIC_COMPARE_TOOLTIP_EQ"] = "Vráť hodnotu pravda, ak sú vstupy rovnaké.";
messages["LOGIC_COMPARE_TOOLTIP_GT"] = "Vráť hodnotu pravda ak prvý vstup je väčší než druhý.";
messages["LOGIC_COMPARE_TOOLTIP_GTE"] = "Vráť hodnotu pravda ak prvý vstup je väčší alebo rovný druhému.";
messages["LOGIC_COMPARE_TOOLTIP_LT"] = "Vráť hodnotu pravda, ak prvý vstup je menší než druhý.";
messages["LOGIC_COMPARE_TOOLTIP_LTE"] = "Vráť hodnotu pravda ak prvý vstup je menší alebo rovný druhému.";
messages["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Vráť hodnotu pravda, ak vstupy nie sú rovnaké.";
messages["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not";  // untranslated
messages["LOGIC_NEGATE_TITLE"] = "nie je %1";
messages["LOGIC_NEGATE_TOOLTIP"] = "Vráti hodnotu pravda, ak je vstup nepravda. Vráti hodnotu nepravda ak je vstup pravda.";
messages["LOGIC_NULL"] = "nič";
messages["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type";  // untranslated
messages["LOGIC_NULL_TOOLTIP"] = "Vráti hodnotu nula.";
messages["LOGIC_OPERATION_AND"] = "a";
messages["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations";  // untranslated
messages["LOGIC_OPERATION_OR"] = "alebo";
messages["LOGIC_OPERATION_TOOLTIP_AND"] = "Vráť hodnotu pravda, ak sú vstupy pravdivé.";
messages["LOGIC_OPERATION_TOOLTIP_OR"] = "Vráť hodnotu pravda, ak je aspoň jeden vstup pravda.";
messages["LOGIC_TERNARY_CONDITION"] = "test";
messages["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:";  // untranslated
messages["LOGIC_TERNARY_IF_FALSE"] = "ak nepravda";
messages["LOGIC_TERNARY_IF_TRUE"] = "ak pravda";
messages["LOGIC_TERNARY_TOOLTIP"] = "Skontroluj podmienku testom. Ak je podmienka pravda, vráť hodnotu \"ak pravda\", inak vráť hodnotu \"ak nepravda\".";
messages["MATH_ADDITION_SYMBOL"] = "+";  // untranslated
messages["MATH_ARITHMETIC_HELPURL"] = "https://en.wikipedia.org/wiki/Arithmetic";
messages["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Vráť súčet dvoch čísel.";
messages["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Vráť podiel dvoch čísel.";
messages["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Vráť rozdiel dvoch čísel.";
messages["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Vráť súčin dvoch čísel.";
messages["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Vráť prvé číslo umocnené druhým.";
messages["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2";
messages["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2";
messages["MATH_ATAN2_TOOLTIP"] = "Vráťte arktangent bodu (X, Y) v stupňoch od -180 do 180.";
messages["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
messages["MATH_CHANGE_TITLE"] = "zmeniť %1 o %2";
messages["MATH_CHANGE_TOOLTIP"] = "Pridaj číslo do premennej \"%1\".";
messages["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant";
messages["MATH_CONSTANT_TOOLTIP"] = "Vráť jednu zo zvyčajných konštánt: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), alebo ∞ (nekonečno).";
messages["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)";  // untranslated
messages["MATH_CONSTRAIN_TITLE"] = "obmedz %1 od %2 do %3";
messages["MATH_CONSTRAIN_TOOLTIP"] = "Obmedzí číslo do zadaných hraníc (vrátane).";
messages["MATH_DIVISION_SYMBOL"] = "÷";  // untranslated
messages["MATH_IS_DIVISIBLE_BY"] = "je deliteľné";
messages["MATH_IS_EVEN"] = "je párne";
messages["MATH_IS_NEGATIVE"] = "je záporné";
messages["MATH_IS_ODD"] = "je nepárne";
messages["MATH_IS_POSITIVE"] = "je kladné";
messages["MATH_IS_PRIME"] = "je prvočíslo";
messages["MATH_IS_TOOLTIP"] = "Skontroluj či je číslo párne, nepárne, celé, kladné, záporné alebo deliteľné určitým číslom. Vráť hodnotu pravda alebo nepravda.";
messages["MATH_IS_WHOLE"] = "je celé číslo";
messages["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation";
messages["MATH_MODULO_TITLE"] = "zvyšok po delení %1 + %2";
messages["MATH_MODULO_TOOLTIP"] = "Vráť zvyšok po delení jedného čísla druhým.";
messages["MATH_MULTIPLICATION_SYMBOL"] = "×";  // untranslated
messages["MATH_NUMBER_HELPURL"] = "https://en.wikipedia.org/wiki/Number";
messages["MATH_NUMBER_TOOLTIP"] = "Číslo.";
messages["MATH_ONLIST_HELPURL"] = "";  // untranslated
messages["MATH_ONLIST_OPERATOR_AVERAGE"] = "priemer zoznamu";
messages["MATH_ONLIST_OPERATOR_MAX"] = "najväčšie v zozname";
messages["MATH_ONLIST_OPERATOR_MEDIAN"] = "medián zoznamu";
messages["MATH_ONLIST_OPERATOR_MIN"] = "najmenšie v zozname";
messages["MATH_ONLIST_OPERATOR_MODE"] = "najčastejšie v zozname";
messages["MATH_ONLIST_OPERATOR_RANDOM"] = "náhodný prvok zoznamu";
messages["MATH_ONLIST_OPERATOR_STD_DEV"] = "smerodajná odchýlka zoznamu";
messages["MATH_ONLIST_OPERATOR_SUM"] = "súčet zoznamu";
messages["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Vráť aritmetický priemer čísel v zozname.";
messages["MATH_ONLIST_TOOLTIP_MAX"] = "Vrátiť najväčšie číslo v zozname.";
messages["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Vráť medián čísel v zozname.";
messages["MATH_ONLIST_TOOLTIP_MIN"] = "Vrátiť najmenšie číslo v zozname.";
messages["MATH_ONLIST_TOOLTIP_MODE"] = "Vrátiť najčastejší prvok v zozname.";
messages["MATH_ONLIST_TOOLTIP_RANDOM"] = "Vráť náhodne zvolený prvok zoznamu.";
messages["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Vráť smeroddajnú odchýlku zoznamu.";
messages["MATH_ONLIST_TOOLTIP_SUM"] = "Vráť súčet všetkých čísel v zozname.";
messages["MATH_POWER_SYMBOL"] = "^";  // untranslated
messages["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
messages["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "náhodné číslo od 0 do 1";
messages["MATH_RANDOM_FLOAT_TOOLTIP"] = "Vráť náhodné číslo z intervalu 0.0 (vrátane) až 1.0.";
messages["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
messages["MATH_RANDOM_INT_TITLE"] = "náhodné celé číslo od %1 do %2";
messages["MATH_RANDOM_INT_TOOLTIP"] = "Vráť náhodné celé číslo z určeného intervalu (vrátane).";
messages["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding";
messages["MATH_ROUND_OPERATOR_ROUND"] = "zaokrúhli";
messages["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "zaokrúhli nadol";
messages["MATH_ROUND_OPERATOR_ROUNDUP"] = "zaokrúhli nahor";
messages["MATH_ROUND_TOOLTIP"] = "Zaokrúhli číslo nahor alebo nadol.";
messages["MATH_SINGLE_HELPURL"] = "https://en.wikipedia.org/wiki/Square_root";
messages["MATH_SINGLE_OP_ABSOLUTE"] = "absolútna hodnota";
messages["MATH_SINGLE_OP_ROOT"] = "druhá odmocnina";
messages["MATH_SINGLE_TOOLTIP_ABS"] = "Vráť absolútnu hodnotu čísla.";
messages["MATH_SINGLE_TOOLTIP_EXP"] = "Vráť e umocnené číslom.";
messages["MATH_SINGLE_TOOLTIP_LN"] = "Vráť prirodzený logaritmus čísla.";
messages["MATH_SINGLE_TOOLTIP_LOG10"] = "Vráť logaritmus čísla so základom 10.";
messages["MATH_SINGLE_TOOLTIP_NEG"] = "Vráť opačné číslo.";
messages["MATH_SINGLE_TOOLTIP_POW10"] = "Vráť 10 umocnené číslom.";
messages["MATH_SINGLE_TOOLTIP_ROOT"] = "Vráť druhú odmocninu čísla.";
messages["MATH_SUBTRACTION_SYMBOL"] = "-";  // untranslated
messages["MATH_TRIG_ACOS"] = "arccos";
messages["MATH_TRIG_ASIN"] = "arcsin";
messages["MATH_TRIG_ATAN"] = "arctan";
messages["MATH_TRIG_COS"] = "cos";  // untranslated
messages["MATH_TRIG_HELPURL"] = "https://en.wikipedia.org/wiki/Trigonometric_functions";
messages["MATH_TRIG_SIN"] = "sin";  // untranslated
messages["MATH_TRIG_TAN"] = "tan";  // untranslated
messages["MATH_TRIG_TOOLTIP_ACOS"] = "Vráť arkus kosínus čísla.";
messages["MATH_TRIG_TOOLTIP_ASIN"] = "Vráť arkus sínus čísla.";
messages["MATH_TRIG_TOOLTIP_ATAN"] = "Vráť arkus tangens čísla.";
messages["MATH_TRIG_TOOLTIP_COS"] = "Vráť kosínus uhla (v stupňoch).";
messages["MATH_TRIG_TOOLTIP_SIN"] = "Vráť sínus uhla (v stupňoch).";
messages["MATH_TRIG_TOOLTIP_TAN"] = "Vráť tangens uhla (v stupňoch).";
messages["NEW_COLOUR_VARIABLE"] = "vytvoriť farbu premennej";
messages["NEW_NUMBER_VARIABLE"] = "Vytvoriť číselnú premennú...";
messages["NEW_STRING_VARIABLE"] = "Vytvoriť reťazovú premennú...";
messages["NEW_VARIABLE"] = "Vytvoriť premennú...";
messages["NEW_VARIABLE_TITLE"] = "Názov novej premennej:";
messages["NEW_VARIABLE_TYPE_TITLE"] = "nový typ premennej";
messages["ORDINAL_NUMBER_SUFFIX"] = "";  // untranslated
messages["PROCEDURES_ALLOW_STATEMENTS"] = "povoliť príkazy";
messages["PROCEDURES_BEFORE_PARAMS"] = "s:";
messages["PROCEDURES_CALLNORETURN_HELPURL"] = "https://sk.wikipedia.org/wiki/Podprogram";
messages["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Spustí používateľom definovanú funkciu '%1'.";
messages["PROCEDURES_CALLRETURN_HELPURL"] = "https://sk.wikipedia.org/wiki/Podprogram";
messages["PROCEDURES_CALLRETURN_TOOLTIP"] = "Spustí používateľom definovanú funkciu '%1' a použije jej výstup.";
messages["PROCEDURES_CALL_BEFORE_PARAMS"] = "s:";
messages["PROCEDURES_CREATE_DO"] = "Vytvoriť '%1'";
messages["PROCEDURES_DEFNORETURN_COMMENT"] = "Doplň, čo robí táto funkcia...";
messages["PROCEDURES_DEFNORETURN_DO"] = "";  // untranslated
messages["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";  // untranslated
messages["PROCEDURES_DEFNORETURN_PROCEDURE"] = "urob niečo";
messages["PROCEDURES_DEFNORETURN_TITLE"] = "na";
messages["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Vytvorí funciu bez výstupu.";
messages["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine";  // untranslated
messages["PROCEDURES_DEFRETURN_RETURN"] = "vrátiť";
messages["PROCEDURES_DEFRETURN_TOOLTIP"] = "Vytvorí funkciu s výstupom.";
messages["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Upozornenie: Táto funkcia má duplicitné parametre.";
messages["PROCEDURES_HIGHLIGHT_DEF"] = "Zvýrazniť definíciu funkcie";
messages["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause";  // untranslated
messages["PROCEDURES_IFRETURN_TOOLTIP"] = "Ak je hodnota pravda, tak vráti druhú hodnotu.";
messages["PROCEDURES_IFRETURN_WARNING"] = "Upozornenie: Tento blok môže byť len vo vnútri funkcie.";
messages["PROCEDURES_MUTATORARG_TITLE"] = "názov vstupu:";
messages["PROCEDURES_MUTATORARG_TOOLTIP"] = "Pridať vstup do funkcie.";
messages["PROCEDURES_MUTATORCONTAINER_TITLE"] = "vstupy";
messages["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Pridať, odstrániť alebo zmeniť poradie vstupov tejto funkcie.";
messages["REDO"] = "Znova";
messages["REMOVE_COMMENT"] = "Odstrániť komentár";
messages["RENAME_VARIABLE"] = "Premenovať premennú...";
messages["RENAME_VARIABLE_TITLE"] = "Premenovať všetky premenné '%1' na:";
messages["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";  // untranslated
messages["TEXT_APPEND_TITLE"] = "do %1 pridaj text %2";
messages["TEXT_APPEND_TOOLTIP"] = "Pridaj určitý text do premennej '%1'.";
messages["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case";  // untranslated
messages["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "na malé písmená";
messages["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "na Veľké Začiatočné Písmená";
messages["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "na VEĽKÉ PÍSMENÁ";
messages["TEXT_CHANGECASE_TOOLTIP"] = "Vráť kópiu textu s inou veľkosťou písmen.";
messages["TEXT_CHARAT_FIRST"] = "zisti prvé písmeno";
messages["TEXT_CHARAT_FROM_END"] = "zisti # písmeno od konca";
messages["TEXT_CHARAT_FROM_START"] = "zisti písmeno #";
messages["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text";  // untranslated
messages["TEXT_CHARAT_LAST"] = "zisti posledné písmeno";
messages["TEXT_CHARAT_RANDOM"] = "vyber náhodné písmeno";
messages["TEXT_CHARAT_TAIL"] = "";  // untranslated
messages["TEXT_CHARAT_TITLE"] = "v texte %1 %2";
messages["TEXT_CHARAT_TOOLTIP"] = "Vráti písmeno na určenej pozícii.";
messages["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings";  // untranslated
messages["TEXT_COUNT_MESSAGE0"] = "počet výskytov %1 v %2";
messages["TEXT_COUNT_TOOLTIP"] = "Počet výskytov textu nachádzajúcom sa v inom texte.";
messages["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Pridaj prvok do textu.";
messages["TEXT_CREATE_JOIN_TITLE_JOIN"] = "spoj";
messages["TEXT_CREATE_JOIN_TOOLTIP"] = "Pridaj, odstráň alebo zmeň poradie oddielov v tomto textovom bloku.";
messages["TEXT_GET_SUBSTRING_END_FROM_END"] = "po # písmeno od konca";
messages["TEXT_GET_SUBSTRING_END_FROM_START"] = "po písmeno #";
messages["TEXT_GET_SUBSTRING_END_LAST"] = "po koniec";
messages["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";  // untranslated
messages["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "v texte";
messages["TEXT_GET_SUBSTRING_START_FIRST"] = "vyber podreťazec od začiatku";
messages["TEXT_GET_SUBSTRING_START_FROM_END"] = "vyber podreťazec od # písmena od konca";
messages["TEXT_GET_SUBSTRING_START_FROM_START"] = "vyber podreťazec od písmena #";
messages["TEXT_GET_SUBSTRING_TAIL"] = "";  // untranslated
messages["TEXT_GET_SUBSTRING_TOOLTIP"] = "Vráti určenú časť textu.";
messages["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text";  // untranslated
messages["TEXT_INDEXOF_OPERATOR_FIRST"] = "nájdi prvý výskyt textu";
messages["TEXT_INDEXOF_OPERATOR_LAST"] = "nájdi posledný výskyt textu";
messages["TEXT_INDEXOF_TITLE"] = "v texte %1 %2 %3";
messages["TEXT_INDEXOF_TOOLTIP"] = "Vráti index prvého/posledného výskytu prvého textu v druhom texte. Ak nenájde, vráti %1.";
messages["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text";  // untranslated
messages["TEXT_ISEMPTY_TITLE"] = "%1 je prázdny";
messages["TEXT_ISEMPTY_TOOLTIP"] = "Vráti hodnotu pravda, ak zadaný text je prázdny.";
messages["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation";  // untranslated
messages["TEXT_JOIN_TITLE_CREATEWITH"] = "vytvor text z";
messages["TEXT_JOIN_TOOLTIP"] = "Vytvor text spojením určitého počtu prvkov.";
messages["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";  // untranslated
messages["TEXT_LENGTH_TITLE"] = "dĺžka %1";
messages["TEXT_LENGTH_TOOLTIP"] = "Vráti počet písmen (s medzerami) v zadanom texte.";
messages["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text";  // untranslated
messages["TEXT_PRINT_TITLE"] = "píš %1";
messages["TEXT_PRINT_TOOLTIP"] = "Napíš zadaný text, číslo alebo hodnotu.";
messages["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";  // untranslated
messages["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Výzva pre používateľa na zadanie čísla.";
messages["TEXT_PROMPT_TOOLTIP_TEXT"] = "Výzva pre používateľa na zadanie textu.";
messages["TEXT_PROMPT_TYPE_NUMBER"] = "výzva na zadanie čísla so správou";
messages["TEXT_PROMPT_TYPE_TEXT"] = "výzva za zadanie textu so správou";
messages["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings";  // untranslated
messages["TEXT_REPLACE_MESSAGE0"] = "zameniť %1 za %2 v reťazci %3";
messages["TEXT_REPLACE_TOOLTIP"] = "Zameniť všetky výskyty textu za iný text.";
messages["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text";  // untranslated
messages["TEXT_REVERSE_MESSAGE0"] = "text odzadu %1";
messages["TEXT_REVERSE_TOOLTIP"] = "Obrátiť poradie písmen v texte.";
messages["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)";
messages["TEXT_TEXT_TOOLTIP"] = "Písmeno, slovo alebo riadok textu.";
messages["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";  // untranslated
messages["TEXT_TRIM_OPERATOR_BOTH"] = "odstráň medzery z oboch strán";
messages["TEXT_TRIM_OPERATOR_LEFT"] = "odstráň medzery z ľavej strany";
messages["TEXT_TRIM_OPERATOR_RIGHT"] = "odstráň medzery z pravej strany";
messages["TEXT_TRIM_TOOLTIP"] = "Vráť kópiu textu bez medzier na jednom alebo oboch koncoch.";
messages["TODAY"] = "Dnes";
messages["UNDO"] = "Späť";
messages["UNNAMED_KEY"] = "nepomenované";
messages["VARIABLES_DEFAULT_NAME"] = "prvok";
messages["VARIABLES_GET_CREATE_SET"] = "Vytvoriť \"nastaviť %1\"";
messages["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get";  // untranslated
messages["VARIABLES_GET_TOOLTIP"] = "Vráti hodnotu tejto premennej.";
messages["VARIABLES_SET"] = "nastaviť %1 na %2";
messages["VARIABLES_SET_CREATE_GET"] = "Vytvoriť \"získať %1\"";
messages["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set";  // untranslated
messages["VARIABLES_SET_TOOLTIP"] = "Nastaví túto premennú, aby sa rovnala vstupu.";
messages["VARIABLE_ALREADY_EXISTS"] = "Premenná s názvom %1 už existuje.";
messages["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "Premenná s názvom '%1' už existuje pre inú premennú typu '%2'.";
messages["WORKSPACE_ARIA_LABEL"] = "Pracovisko Bloskly";
messages["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Povedz niečo...";
messages["CONTROLS_FOREACH_INPUT_DO"] = messages["CONTROLS_REPEAT_INPUT_DO"];
messages["CONTROLS_FOR_INPUT_DO"] = messages["CONTROLS_REPEAT_INPUT_DO"];
messages["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = messages["CONTROLS_IF_MSG_ELSEIF"];
messages["CONTROLS_IF_ELSE_TITLE_ELSE"] = messages["CONTROLS_IF_MSG_ELSE"];
messages["CONTROLS_IF_IF_TITLE_IF"] = messages["CONTROLS_IF_MSG_IF"];
messages["CONTROLS_IF_MSG_THEN"] = messages["CONTROLS_REPEAT_INPUT_DO"];
messages["CONTROLS_WHILEUNTIL_INPUT_DO"] = messages["CONTROLS_REPEAT_INPUT_DO"];
messages["LISTS_CREATE_WITH_ITEM_TITLE"] = messages["VARIABLES_DEFAULT_NAME"];
messages["LISTS_GET_INDEX_HELPURL"] = messages["LISTS_INDEX_OF_HELPURL"];
messages["LISTS_GET_INDEX_INPUT_IN_LIST"] = messages["LISTS_INLIST"];
messages["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = messages["LISTS_INLIST"];
messages["LISTS_INDEX_OF_INPUT_IN_LIST"] = messages["LISTS_INLIST"];
messages["LISTS_SET_INDEX_INPUT_IN_LIST"] = messages["LISTS_INLIST"];
messages["MATH_CHANGE_TITLE_ITEM"] = messages["VARIABLES_DEFAULT_NAME"];
messages["PROCEDURES_DEFRETURN_COMMENT"] = messages["PROCEDURES_DEFNORETURN_COMMENT"];
messages["PROCEDURES_DEFRETURN_DO"] = messages["PROCEDURES_DEFNORETURN_DO"];
messages["PROCEDURES_DEFRETURN_PROCEDURE"] = messages["PROCEDURES_DEFNORETURN_PROCEDURE"];
messages["PROCEDURES_DEFRETURN_TITLE"] = messages["PROCEDURES_DEFNORETURN_TITLE"];
messages["TEXT_APPEND_VARIABLE"] = messages["VARIABLES_DEFAULT_NAME"];
messages["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = messages["VARIABLES_DEFAULT_NAME"];

messages["MATH_HUE"] = "230";
messages["LOOPS_HUE"] = "120";
messages["LISTS_HUE"] = "260";
messages["LOGIC_HUE"] = "210";
messages["VARIABLES_HUE"] = "330";
messages["TEXTS_HUE"] = "160";
messages["PROCEDURES_HUE"] = "290";
messages["COLOUR_HUE"] = "20";
messages["VARIABLES_DYNAMIC_HUE"] = "310";
return messages;
}));