text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Sharpmake
{
    public static class ExtensionMethods
    {
        public static bool IsPC(this Platform platform)
        {
            return platform == Platform.win32 || platform == Platform.win64;
        }

        public static bool IsMicrosoft(this Platform platform)
        {
            return PlatformRegistry.Get<IPlatformDescriptor>(platform).IsMicrosoftPlatform;
        }

        public static bool IsUsingClang(this Platform platform)
        {
            return PlatformRegistry.Get<IPlatformDescriptor>(platform).IsUsingClang;
        }

        public static string ToVersionString(this DotNetFramework framework)
        {
            switch (framework)
            {
                case DotNetFramework.v3_5:
                    return "3.5";
                case DotNetFramework.v3_5clientprofile:
                    return "3.5";
                case DotNetFramework.v4_0:
                    return "4.0";
                case DotNetFramework.v4_5:
                    return "4.5";
                case DotNetFramework.v4_5_1:
                    return "4.5.1";
                case DotNetFramework.v4_5_2:
                    return "4.5.2";
                case DotNetFramework.v4_5clientprofile:
                    return "4.5";
                case DotNetFramework.v4_6:
                    return "4.6";
                case DotNetFramework.v4_6_1:
                    return "4.6.1";
                case DotNetFramework.v4_6_2:
                    return "4.6.2";
                case DotNetFramework.v4_7:
                    return "4.7";
                case DotNetFramework.v4_7_1:
                    return "4.7.1";
                case DotNetFramework.v4_7_2:
                    return "4.7.2";
                case DotNetFramework.v4_8:
                    return "4.8";
                case DotNetFramework.netcore1_0:
                    return "netcoreapp1.0";
                case DotNetFramework.netcore1_1:
                    return "netcoreapp1.1";
                case DotNetFramework.netcore2_0:
                    return "netcoreapp2.0";
                case DotNetFramework.netcore2_1:
                    return "netcoreapp2.1";
                case DotNetFramework.netcore2_2:
                    return "netcoreapp2.2";
                case DotNetFramework.netcore3_0:
                    return "netcoreapp3.0";
                case DotNetFramework.netcore3_1:
                    return "netcoreapp3.1";
                case DotNetFramework.netstandard1_0:
                    return "netstandard1.0";
                case DotNetFramework.netstandard1_1:
                    return "netstandard1.1";
                case DotNetFramework.netstandard1_2:
                    return "netstandard1.2";
                case DotNetFramework.netstandard1_3:
                    return "netstandard1.3";
                case DotNetFramework.netstandard1_4:
                    return "netstandard1.4";
                case DotNetFramework.netstandard1_5:
                    return "netstandard1.5";
                case DotNetFramework.netstandard1_6:
                    return "netstandard1.6";
                case DotNetFramework.netstandard2_0:
                    return "netstandard2.0";
                case DotNetFramework.netstandard2_1:
                    return "netstandard2.1";
                case DotNetFramework.net5_0:
                    return "net5.0";
                case DotNetFramework.all_netframework:
                case DotNetFramework.all_netcore:
                case DotNetFramework.all_netstandard:
                default:
                    throw new ArgumentOutOfRangeException(nameof(framework));
            }
        }

        public static string ToFolderName(this DotNetFramework framework)
        {
            //https://docs.microsoft.com/en-us/dotnet/standard/frameworks
            switch (framework)
            {
                case DotNetFramework.v3_5:
                    return "net35";
                case DotNetFramework.v4_0:
                    return "net40";
                case DotNetFramework.v4_5:
                    return "net45";
                case DotNetFramework.v4_5_1:
                    return "net451";
                case DotNetFramework.v4_5_2:
                    return "net452";
                case DotNetFramework.v4_6:
                    return "net46";
                case DotNetFramework.v4_6_1:
                    return "net461";
                case DotNetFramework.v4_6_2:
                    return "net462";
                case DotNetFramework.v4_7:
                    return "net47";
                case DotNetFramework.v4_7_1:
                    return "net471";
                case DotNetFramework.v4_7_2:
                    return "net472";
                case DotNetFramework.v4_8:
                    return "net48";
                case DotNetFramework.netcore1_0:
                    return "netcoreapp1.0";
                case DotNetFramework.netcore1_1:
                    return "netcoreapp1.1";
                case DotNetFramework.netcore2_0:
                    return "netcoreapp2.0";
                case DotNetFramework.netcore2_1:
                    return "netcoreapp2.1";
                case DotNetFramework.netcore2_2:
                    return "netcoreapp2.2";
                case DotNetFramework.netcore3_0:
                    return "netcoreapp3.0";
                case DotNetFramework.netcore3_1:
                    return "netcoreapp3.1";
                case DotNetFramework.net5_0:
                    return "net5.0";
                case DotNetFramework.netstandard1_0:
                    return "netstandard1.0";
                case DotNetFramework.netstandard1_1:
                    return "netstandard1.1";
                case DotNetFramework.netstandard1_2:
                    return "netstandard1.2";
                case DotNetFramework.netstandard1_3:
                    return "netstandard1.3";
                case DotNetFramework.netstandard1_4:
                    return "netstandard1.4";
                case DotNetFramework.netstandard1_5:
                    return "netstandard1.5";
                case DotNetFramework.netstandard1_6:
                    return "netstandard1.6";
                case DotNetFramework.netstandard2_0:
                    return "netstandard2.0";
                case DotNetFramework.netstandard2_1:
                    return "netstandard2.1";
                default:
                    throw new ArgumentOutOfRangeException(nameof(framework), framework, nameof(DotNetFramework) + " cannot be converted to a folder name.");
            }
        }

        public static bool IsDotNetFramework(this DotNetFramework framework)
        {
            return (0 != (framework & DotNetFramework.all_netframework));
        }

        public static bool IsDotNetCore(this DotNetFramework framework)
        {
            return (0 != (framework & DotNetFramework.all_netcore));
        }

        public static bool IsDotNetStandard(this DotNetFramework framework)
        {
            return (0 != (framework & DotNetFramework.all_netstandard));
        }

        public static string GetVisualProjectToolsVersionString(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    return "14.0";
                case DevEnv.vs2017:
                    return "15.0";
                case DevEnv.vs2019:
                    return "16.0";
                case DevEnv.vs2022:
                    return "17.0";
                default:
                    throw new Error("DevEnv " + visualVersion + " not recognized!");
            }
        }

        public static int GetVisualMajorVersion(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    return 14;
                case DevEnv.vs2017:
                    return 15;
                case DevEnv.vs2019:
                    return 16;
                case DevEnv.vs2022:
                    return 17;
                default:
                    throw new NotImplementedException("DevEnv " + visualVersion + " not recognized!");
            }
        }

        public static string GetVisualVersionString(this DevEnv visualVersion)
        {
            return string.Format("{0}.0", visualVersion.GetVisualMajorVersion());
        }

        public static string GetDefaultPlatformToolset(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    return "v140";
                case DevEnv.vs2017:
                    return "v141";
                case DevEnv.vs2019:
                    return "v142";
                case DevEnv.vs2022:
                    return "v143";
                default:
                    throw new Error("DevEnv " + visualVersion + " not recognized!");
            }
        }

        public static string GetVSYear(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    return "2015";
                case DevEnv.vs2017:
                    return "2017";
                case DevEnv.vs2019:
                    return "2019";
                case DevEnv.vs2022:
                    return "2022";
                default:
                    throw new Error("DevEnv " + visualVersion + " not recognized!");
            }
        }

        internal static void ClearVisualStudioDirCaches()
        {
            s_visualStudioDirectories.Clear();
            s_visualStudioVCRootPathCache.Clear();
        }

        private static readonly ConcurrentDictionary<DevEnv, string> s_visualStudioDirOverrides = new ConcurrentDictionary<DevEnv, string>();
        public static void SetVisualStudioDirOverride(this DevEnv visualVersion, string path)
        {
            bool result = s_visualStudioDirOverrides.TryAdd(visualVersion, path);
            if (!result)
                throw new Error("Can't override a specific Visual Studio version directory more than once. Version: " + visualVersion);
        }

        public static bool OverridenVisualStudioDir(this DevEnv visualVersion)
        {
            return s_visualStudioDirOverrides.ContainsKey(visualVersion);
        }

        private static readonly ConcurrentDictionary<Tuple<DevEnv, bool>, string> s_visualStudioDirectories = new ConcurrentDictionary<Tuple<DevEnv, bool>, string>();
        public static string GetVisualStudioDir(this DevEnv visualVersion, bool ignoreVisualStudioPathOverride = false)
        {
            if (!visualVersion.IsVisualStudio())
                throw new Error($"{visualVersion} is not a visual studio version!");

            // TODO: Replace Tuple with ValueTuple once we support C# 8 because ValueTuple is
            //       allocated on the stack. That should be faster here.
            string visualStudioDirectory = s_visualStudioDirectories.GetOrAdd(Tuple.Create(visualVersion, ignoreVisualStudioPathOverride), devEnv =>
            {
                if (!ignoreVisualStudioPathOverride)
                {
                    // First check if the visual studio path is overridden from default value.
                    string pathOverride;
                    if (s_visualStudioDirOverrides.TryGetValue(visualVersion, out pathOverride))
                        return pathOverride;
                }

                string installDir = Util.GetVisualStudioInstallPathFromQuery(visualVersion);
                if (string.IsNullOrEmpty(installDir))
                {
                    // try again but this time including previews
                    installDir = Util.GetVisualStudioInstallPathFromQuery(visualVersion, allowPrereleaseVersions: true);
                    if (string.IsNullOrEmpty(installDir)) // arbitrary fallback
                    {
                        if (visualVersion > DevEnv.vs2015)
                        {
                            installDir = @"Microsoft Visual Studio\" + GetVSYear(visualVersion) + @"\Professional";
                        }
                        else
                        {
                            installDir = string.Format(@"Microsoft Visual Studio {0}", visualVersion.GetVisualVersionString());
                        }
                        string rootDir = Environment.GetFolderPath(visualVersion < DevEnv.vs2022 ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles);
                        installDir = Path.Combine(rootDir, installDir);
                    }
                }
                return Util.SimplifyPath(installDir);
            });

            return visualStudioDirectory;
        }

        private static string GetDefaultCompilerVersion(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2017:
                    return "14.10.25017";
                case DevEnv.vs2019:
                    return "14.20.27404";
                case DevEnv.vs2022:
                    return "14.30.30423"; // from Preview3
                default:
                    throw new Error("DevEnv " + visualVersion + " not recognized for default compiler version");
            }
        }

        private static readonly ConcurrentDictionary<DevEnv, string> s_visualStudioVCRootPathCache = new ConcurrentDictionary<DevEnv, string>();
        public static string GetVisualStudioVCRootPath(this DevEnv visualVersion)
        {
            if (!visualVersion.IsVisualStudio())
                throw new Error($"{visualVersion} is not a visual studio version!");

            string visualStudioVCRootPath = s_visualStudioVCRootPathCache.GetOrAdd(visualVersion, devEnv =>
            {
                string vsDir = visualVersion.GetVisualStudioDir();
                if (visualVersion > DevEnv.vs2015)
                {
                    return Path.Combine(vsDir, @"VC\Tools\MSVC", visualVersion.GetVisualStudioVCToolsVersion().ToString());
                }
                else
                {
                    return Path.Combine(vsDir, "VC");
                }
            });

            return visualStudioVCRootPath;
        }

        private static readonly ConcurrentDictionary<DevEnv, Version> s_visualStudioVCToolsVersionCache = new ConcurrentDictionary<DevEnv, Version>();
        public static Version GetVisualStudioVCToolsVersion(this DevEnv visualVersion)
        {
            if (!visualVersion.IsVisualStudio())
                throw new Error($"{visualVersion} is not a visual studio version!");

            Version version = s_visualStudioVCToolsVersionCache.GetOrAdd(visualVersion, devEnv =>
            {
                string versionString = visualVersion.GetDefaultCompilerVersion(); // default fallback
                try
                {
                    string toolchainFile = Path.Combine(visualVersion.GetVisualStudioDir(), "VC", "Auxiliary", "Build", "Microsoft.VCToolsVersion.default.txt");
                    if (File.Exists(toolchainFile))
                    {
                        using (StreamReader file = new StreamReader(toolchainFile))
                            versionString = file.ReadLine().Trim();
                    }
                }
                catch { }

                return new Version(versionString);
            });

            return version;
        }

        /// <summary>
        /// Will return the name of the root directory in MSBuild under Microsoft/VC for a particular devenv,
        /// since it uses yet another versioning pattern than the toolchain
        /// </summary>
        /// <param name="visualVersion">The visual studio version to convert</param>
        /// <returns>The name of the directory for that version</returns>
        public static string GetMSBuildVCDirVersion(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2017:
                    return "v150";
                case DevEnv.vs2019:
                    return "v160";
                case DevEnv.vs2022:
                    return "v170";
                default:
                    throw new Error("DevEnv " + visualVersion + " not supported!");
            }
        }

        public static string GetVCTargetsPath(this DevEnv visualVersion)
        {
            if (!visualVersion.IsVisualStudio())
                return null;

            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    string versionSubfolder = visualVersion.GetDefaultPlatformToolset().ToUpperInvariant(); // this is enough for now but we could make a specific method to retrieve this value
                    return Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"MSBuild\Microsoft.Cpp\v4.0", versionSubfolder));
                case DevEnv.vs2017:
                    return Path.Combine(visualVersion.GetVisualStudioDir(), @"Common7\IDE\VC\VCTargets");
                case DevEnv.vs2019:
                case DevEnv.vs2022:
                    return Path.Combine(visualVersion.GetVisualStudioDir(), @"MSBuild\Microsoft\VC\", visualVersion.GetMSBuildVCDirVersion());
                default:
                    throw new ArgumentOutOfRangeException(nameof(visualVersion), visualVersion, null);
            }
        }

        private static string GetDefaultRedistVersion(this DevEnv visualVersion)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2017:
                    return "14.16.27012";
                case DevEnv.vs2019:
                    return "14.24.28127";
                case DevEnv.vs2022:
                    return "14.30.30423"; // from Preview3
                default:
                    throw new Error("DevEnv " + visualVersion + " not recognized for default compiler version");
            }
        }

        private static readonly ConcurrentDictionary<DevEnv, Version> s_visualStudioVCRedistVersionCache = new ConcurrentDictionary<DevEnv, Version>();
        public static Version GetVisualStudioVCRedistVersion(this DevEnv visualVersion)
        {
            Version version = s_visualStudioVCRedistVersionCache.GetOrAdd(visualVersion, devEnv =>
            {
                string vsDir = visualVersion.GetVisualStudioDir();
                string versionString = visualVersion.GetDefaultRedistVersion(); // default fallback
                try
                {
                    string toolchainFile = Path.Combine(vsDir, "VC", "Auxiliary", "Build", "Microsoft.VCRedistVersion.default.txt");
                    if (File.Exists(toolchainFile))
                    {
                        using (StreamReader file = new StreamReader(toolchainFile))
                            versionString = file.ReadLine().Trim();
                    }
                }
                catch { }

                return new Version(versionString);
            });

            return version;
        }

        public static string GetVisualStudioBinPath(this DevEnv visualVersion, Platform platform)
        {
            switch (visualVersion)
            {
                case DevEnv.vs2015:
                    {
                        string targetPlatform = (platform == Platform.win64) ? "amd64" : "";
                        return Path.Combine(visualVersion.GetVisualStudioVCRootPath(), "bin", targetPlatform);
                    }
                case DevEnv.vs2017:
                case DevEnv.vs2019:
                case DevEnv.vs2022:
                    {
                        string targetPlatform = (platform == Platform.win64) ? "x64" : "x86";
                        string compilerHost = Environment.Is64BitOperatingSystem ? "HostX64" : "HostX86";
                        return Path.Combine(visualVersion.GetVisualStudioVCRootPath(), "bin", compilerHost, targetPlatform);
                    }
            }
            throw new ArgumentOutOfRangeException("VS version not recognized " + visualVersion);
        }

        public static bool OverridenWindowsPath(this DevEnv visualVersion)
        {
            return !KitsRootPaths.IsDefaultKitRootPath(visualVersion);
        }

        public static string GetWindowsExecutablePath(this DevEnv visualVersion, Platform platform)
        {
            KitsRootEnum kitsRoot = KitsRootPaths.GetUseKitsRootForDevEnv(visualVersion);

            string targetPlatform = (platform == Platform.win64) ? "x64" : "x86";

            var paths = new Strings();
            paths.Add(visualVersion.GetVisualStudioBinPath(platform));

            switch (kitsRoot)
            {
                case KitsRootEnum.KitsRoot:
                    paths.Add(Path.Combine(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot), "bin", targetPlatform));
                    break;
                case KitsRootEnum.KitsRoot81:
                    paths.Add(Path.Combine(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81), "bin", targetPlatform));
                    break;
                case KitsRootEnum.KitsRoot10:
                    {
                        Options.Vc.General.WindowsTargetPlatformVersion windowsTargetPlatformVersion = KitsRootPaths.GetWindowsTargetPlatformVersionForDevEnv(visualVersion);

                        string kitsRoot10Path = KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot10);
                        string platformVersion = windowsTargetPlatformVersion.ToVersionString();

                        if (windowsTargetPlatformVersion >= Options.Vc.General.WindowsTargetPlatformVersion.v10_0_15063_0)
                            paths.Add(Path.Combine(kitsRoot10Path, "bin", platformVersion, targetPlatform));
                        else
                            paths.Add(Path.Combine(kitsRoot10Path, "bin", targetPlatform));

                        if (windowsTargetPlatformVersion <= Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10240_0)
                            paths.Add(Path.Combine(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81), "bin", targetPlatform));
                    }
                    break;
                default:
                    throw new NotImplementedException("No GetWindowsExecutablePath associated with " + kitsRoot);
            }

            paths.Add("$(PATH)");
            return string.Join(";", paths);
        }

        public static string GetWindowsResourceCompiler(this DevEnv visualVersion, Platform platform)
        {
            KitsRootEnum kitsRoot = KitsRootPaths.GetUseKitsRootForDevEnv(visualVersion);

            string targetPlatform = (platform == Platform.win64) ? "x64" : "x86";

            switch (kitsRoot)
            {
                case KitsRootEnum.KitsRoot:
                    return Path.Combine(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot), "bin", targetPlatform, "rc.exe");
                case KitsRootEnum.KitsRoot81:
                    return Path.Combine(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81), "bin", targetPlatform, "rc.exe");
                case KitsRootEnum.KitsRoot10:
                    {
                        Options.Vc.General.WindowsTargetPlatformVersion windowsTargetPlatformVersion = KitsRootPaths.GetWindowsTargetPlatformVersionForDevEnv(visualVersion);
                        if (windowsTargetPlatformVersion <= Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10240_0)
                        {
                            string kitsRoot81Path = KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81);
                            return Path.Combine(kitsRoot81Path, "bin", targetPlatform, "rc.exe");
                        }

                        string kitsRoot10Path = KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot10);
                        string platformVersion = windowsTargetPlatformVersion.ToVersionString();

                        // First, try WindowsSdkVerBinPath
                        string candidateWindowsSdkVerBinPath = Path.Combine(kitsRoot10Path, "bin", platformVersion, targetPlatform, "rc.exe");
                        if (File.Exists(candidateWindowsSdkVerBinPath))
                            return candidateWindowsSdkVerBinPath;

                        // If it didn't contain rc.exe, fallback to WindowsSdkBinPath
                        return Path.Combine(kitsRoot10Path, "bin", targetPlatform, "rc.exe");
                    }
                default:
                    throw new NotImplementedException("No WindowsResourceCompiler associated with " + kitsRoot);
            }
        }

        public static string GetWindowsIncludePath(this DevEnv visualVersion)
        {
            string visualStudioDir = Util.EnsureTrailingSeparator(visualVersion.GetVisualStudioVCRootPath());
            string visualStudioInclude = string.Format(@"{0}include;{0}atlmfc\include", visualStudioDir);

            KitsRootEnum useKitsRoot = KitsRootPaths.GetUseKitsRootForDevEnv(visualVersion);

            switch (useKitsRoot)
            {
                case KitsRootEnum.KitsRoot:
                    {
                        string kitsRoot = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot));
                        return string.Format(@"{0};{1}Include\shared;{1}Include\um;{1}Include\WinRT;", visualStudioInclude, kitsRoot);
                    }
                case KitsRootEnum.KitsRoot81:
                    {
                        string kitsRoot = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81));
                        return string.Format(@"{0};{1}Include\shared;{1}Include\um;{1}Include\WinRT;", visualStudioInclude, kitsRoot);
                    }
                case KitsRootEnum.KitsRoot10:
                    {
                        string kitsRoot10 = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot10));
                        Options.Vc.General.WindowsTargetPlatformVersion windowsTargetPlatformVersion = KitsRootPaths.GetWindowsTargetPlatformVersionForDevEnv(visualVersion);
                        string platformVersion = windowsTargetPlatformVersion.ToVersionString();
                        var paths = new List<string> {
                            $@"{visualStudioInclude}",
                            $@"{kitsRoot10}Include\{platformVersion}\um",     // $(UM_IncludePath)
                            $@"{kitsRoot10}Include\{platformVersion}\shared", // $(KIT_SHARED_IncludePath)
                            $@"{kitsRoot10}Include\{platformVersion}\winrt",  // $(WinRT_IncludePath)
                            $@"{kitsRoot10}Include\{platformVersion}\ucrt",   // $(UniversalCRT_IncludePath)
                        };

                        if (windowsTargetPlatformVersion <= Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10240_0)
                        {
                            //
                            // Version 10.0.10240.0 and below only contain the UCRT libraries
                            // and headers, not the usual Win32 stuff. So if we are using
                            // version 10240 or older, also include the Windows 8.1 paths so we
                            // have a complete Win32 support.
                            //

                            string kitsRoot81 = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81));
                            paths.AddRange(new[]
                            {
                                $@"{kitsRoot81}Include\um",
                                $@"{kitsRoot81}Include\shared"
                            });
                        }

                        return string.Join(";", paths);
                    }
                default:
                    throw new NotImplementedException("No WindowsResourceCompiler associated with " + visualVersion);
            }
        }

        public static string GetWindowsLibraryPath(this DevEnv visualVersion, Platform platform, DotNetFramework? dotNetFramework = null)
        {
            string visualStudioVCDir = Util.EnsureTrailingSeparator(visualVersion.GetVisualStudioVCRootPath());
            string subDir = platform == Platform.win64 ? @"\amd64" : "";
            if (visualVersion.IsVisualStudio() && visualVersion >= DevEnv.vs2017)
                subDir = platform == Platform.win64 ? @"\x64" : @"\x86";

            string visualStudioLib = string.Format(@"{0}lib{1};{0}atlmfc\lib{1};", visualStudioVCDir, subDir);

            KitsRootEnum useKitsRoot = KitsRootPaths.GetUseKitsRootForDevEnv(visualVersion);
            string targetPlatform = platform == Platform.win64 ? "x64" : "x86";

            switch (useKitsRoot)
            {
                case KitsRootEnum.KitsRoot:
                    {
                        string kitsRoot = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot));
                        return string.Format(@"{0};{1}lib\win8\um\{2};{1}References\CommonConfiguration\Neutral;", visualStudioLib, kitsRoot, targetPlatform);
                    }
                case KitsRootEnum.KitsRoot81:
                    {
                        string kitsRoot = Util.EnsureTrailingSeparator(KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81));
                        return string.Format(@"{0};{1}lib\winv6.3\um\{2};{1}References\CommonConfiguration\Neutral;", visualStudioLib, kitsRoot, targetPlatform);
                    }
                case KitsRootEnum.KitsRoot10:
                    {
                        string netFxPath = string.Empty;
                        if (dotNetFramework.HasValue && visualVersion >= DevEnv.vs2015)
                        {
                            string netFXKitsDir = Util.EnsureTrailingSeparator(KitsRootPaths.GetNETFXKitsDir(dotNetFramework.Value < DotNetFramework.v4_6 ? DotNetFramework.v4_6 : dotNetFramework.Value));
                            netFxPath = Path.Combine(netFXKitsDir, "Lib", "um", targetPlatform);
                        }

                        string kitsRoot10 = KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot10);
                        Options.Vc.General.WindowsTargetPlatformVersion windowsTargetPlatformVersion = KitsRootPaths.GetWindowsTargetPlatformVersionForDevEnv(visualVersion);
                        string platformVersion = windowsTargetPlatformVersion.ToVersionString();
                        var paths = new[]
                        {
                            visualStudioLib,
                            Path.Combine(kitsRoot10, "Lib", platformVersion, "ucrt", targetPlatform),   // $(UniversalCRT_LibraryPath_x86) or $(UniversalCRT_LibraryPath_x64)
                            Path.Combine(kitsRoot10, "Lib", platformVersion, "um", targetPlatform),     // $(WindowsSDK_LibraryPath_x86) or $(WindowsSDK_LibraryPath_x64)
                            netFxPath
                        }.ToList();

                        if (windowsTargetPlatformVersion <= Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10240_0)
                        {
                            string kitsRoot81 = KitsRootPaths.GetRoot(KitsRootEnum.KitsRoot81);
                            paths.AddRange(new[] {
                                Path.Combine(kitsRoot81, "lib", "winv6.3", "um", targetPlatform),
                                Path.Combine(kitsRoot81, "References", "CommonConfiguration", "Neutral")
                            });
                        }

                        return string.Join(";", paths);
                    }
                default:
                    throw new NotImplementedException("No WindowsResourceCompiler associated with " + visualVersion);
            }
        }

        public static string GetWindowsAdditionalDependencies(this DevEnv visualVersion)
        {
            return @"kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib";
        }

        public static string GetCommonToolsPath(this DevEnv visualVersion)
        {
            return visualVersion.GetCommonToolsPath(ignoreVisualStudioPathOverride: false);
        }

        public static string GetCommonToolsPath(this DevEnv visualVersion, bool ignoreVisualStudioPathOverride)
        {
            return Path.Combine(GetVisualStudioDir(visualVersion, ignoreVisualStudioPathOverride), "Common7\\Tools");
        }

        public static string ToVersionString(this Options.Vc.General.WindowsTargetPlatformVersion windowsTargetPlatformVersion)
        {
            switch (windowsTargetPlatformVersion)
            {
                case Options.Vc.General.WindowsTargetPlatformVersion.v8_1:
                    return "8.1";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10240_0:
                    return "10.0.10240.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10586_0:
                    return "10.0.10586.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_14393_0:
                    return "10.0.14393.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_15063_0:
                    return "10.0.15063.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_16299_0:
                    return "10.0.16299.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_17134_0:
                    return "10.0.17134.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_17763_0:
                    return "10.0.17763.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_18362_0:
                    return "10.0.18362.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_19041_0:
                    return "10.0.19041.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_20348_0:
                    return "10.0.20348.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.v10_0_22000_0:
                    return "10.0.22000.0";
                case Options.Vc.General.WindowsTargetPlatformVersion.Latest:
                    return "$(LatestTargetPlatformVersion)";
                default:
                    throw new ArgumentOutOfRangeException(windowsTargetPlatformVersion.ToString());
            }
        }

        public static bool IsDefaultToolsetForDevEnv(this Options.Vc.General.PlatformToolset platformToolset, DevEnv visualVersion)
        {
            switch (platformToolset)
            {
                case Options.Vc.General.PlatformToolset.v140:
                    return visualVersion == DevEnv.vs2015;
                case Options.Vc.General.PlatformToolset.v141:
                    return visualVersion == DevEnv.vs2017;
                case Options.Vc.General.PlatformToolset.v142:
                    return visualVersion == DevEnv.vs2019;
                case Options.Vc.General.PlatformToolset.v143:
                    return visualVersion == DevEnv.vs2022;
                case Options.Vc.General.PlatformToolset.v140_xp:
                case Options.Vc.General.PlatformToolset.v141_xp:
                case Options.Vc.General.PlatformToolset.LLVM:
                case Options.Vc.General.PlatformToolset.ClangCL:
                case Options.Vc.General.PlatformToolset.Default:
                    return false;
                default:
                    throw new ArgumentOutOfRangeException(nameof(platformToolset), platformToolset, null);
            }
        }

        public static DevEnv? GetDefaultDevEnvForToolset(this Options.Vc.General.PlatformToolset platformToolset)
        {
            switch (platformToolset)
            {
                case Options.Vc.General.PlatformToolset.Default:
                    return null;
                case Options.Vc.General.PlatformToolset.v140:
                case Options.Vc.General.PlatformToolset.v140_xp:
                    return DevEnv.vs2015;
                case Options.Vc.General.PlatformToolset.v141:
                case Options.Vc.General.PlatformToolset.v141_xp:
                    return DevEnv.vs2017;
                case Options.Vc.General.PlatformToolset.v142:
                    return DevEnv.vs2019;
                case Options.Vc.General.PlatformToolset.v143:
                    return DevEnv.vs2022;
                case Options.Vc.General.PlatformToolset.LLVM:
                case Options.Vc.General.PlatformToolset.ClangCL:
                    return null;
                default:
                    throw new ArgumentOutOfRangeException(nameof(platformToolset), platformToolset, null);
            }
        }

        public static void GetVcPathKeysFromDevEnv(this DevEnv devEnv, out string vcTargetsPathKey, out string vcRootPathKey)
        {
            switch (devEnv)
            {
                case DevEnv.vs2015:
                    vcTargetsPathKey = "VCTargetsPath14";
                    vcRootPathKey = "VCInstallDir_140";
                    break;
                case DevEnv.vs2017:
                    vcTargetsPathKey = "VCTargetsPath15";
                    vcRootPathKey = "VCInstallDir_150";
                    break;
                case DevEnv.vs2019:
                    vcTargetsPathKey = "VCTargetsPath16";
                    vcRootPathKey = "VCInstallDir_160";
                    break;
                case DevEnv.vs2022:
                    vcTargetsPathKey = "VCTargetsPath17";
                    vcRootPathKey = "VCInstallDir_160"; // LCTODO: Preview3 still uses 160!!!
                    break;
                default:
                    throw new NotImplementedException("Please implement redirection of toolchain for " + devEnv);
            }
        }

        public static bool IsLLVMToolchain(this Options.Vc.General.PlatformToolset platformToolset)
        {
            switch (platformToolset)
            {
                case Options.Vc.General.PlatformToolset.LLVM:
                case Options.Vc.General.PlatformToolset.ClangCL:
                    return true;
            }
            return false;
        }

        /// <summary>
        /// Gets whether a <see cref="DevEnv"/> is a Visual Studio version.
        /// </summary>
        /// <param name="devEnv">The <see cref="DevEnv"/> to check.</param>
        /// <returns>`true` if <paramref name="devEnv"/> is a Visual Studio version, `false` otherwise.</returns>
        public static bool IsVisualStudio(this DevEnv devEnv)
        {
            return (0 != (devEnv & DevEnv.VisualStudio));
        }

        private static bool IsAbiCompatibleWithVS2015(this DevEnv devEnv)
        {
            switch (devEnv)
            {
                case DevEnv.vs2015:
                case DevEnv.vs2017:
                case DevEnv.vs2019:
                case DevEnv.vs2022:
                    return true;
                default:
                    return false;
            }
        }

        /// <summary>
        /// Gets whether two <see cref="DevEnv"/> values generate ABI-compatible binaries with
        /// their respective C++ compiler.
        /// </summary>
        /// <param name="devEnv">The <see cref="DevEnv"/> to check for ABI-compatibility.</param>
        /// <param name="other">The other <see cref="DevEnv"/> to check for ABI-compatibility with.</param>
        /// <returns>`true` if ABI-compatible, `false` otherwise.</returns>
        /// <exception cref="ArgumentException"><paramref name="devEnv"/> is not a Visual Studio version.</exception>
        /// <remarks>
        /// Only works for Visual Studio versions because other DevEnvs (such as Eclipse) are not
        /// shipped with a compiler version.
        /// </remarks>
        public static bool IsAbiCompatibleWith(this DevEnv devEnv, DevEnv other)
        {
            if (!devEnv.IsVisualStudio())
                throw new ArgumentException($"{devEnv} is not a Visual Studio DevEnv.");

            // a VS version is obviously compatible with itself (identity check)
            if (devEnv == other)
                return true;

            // VS2017/VS2019/VS2022 are guaranteed by Microsoft to be ABI-compatible with VS2015 for C++.
            if (devEnv.IsAbiCompatibleWithVS2015() && other.IsAbiCompatibleWithVS2015())
                return true;

            return false;
        }

        public static int IndexOf<T>(this T[] source, T value)
        {
            return IndexOf<T>(source, value, StringComparison.InvariantCultureIgnoreCase);
        }

        public static int IndexOf<T>(this T[] source, T value, StringComparison stringComparison)
        {
            if (typeof(T) == typeof(string))
                return Array.FindIndex(source, m => m.ToString().Equals(value.ToString(), stringComparison));
            else
                return Array.IndexOf(source, value);
        }
    }
}


text:
import React from 'react';
import axios from 'axios';
import Alert from 'react-s-alert';
import { sha256 } from 'js-sha256';
import {ModalContainer, ModalDialog} from 'react-modal-dialog';

import 'react-s-alert/dist/s-alert-default.css';
import 'react-s-alert/dist/s-alert-css-effects/jelly.css';

class Login extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
        site_title : '',
        email: '',
        password: '',
      }

    this.handleClick = this.handleClick.bind(this);
    this.handleClickLogin = this.handleClickLogin.bind(this);
    this.handleCloseLogin = this.handleCloseLogin.bind(this);
  }

  componentDidMount()
  {
      this.setState(
          {
              site_title: document.title
          }
      );
  }

  handleClick(u,p) {
    if (!u && !p)
    {
        Alert.error("Podaj login i hasło!", {
            position: 'top-right',
            effect: 'jelly'
        });
    }
    else if (!u)
    {
        Alert.error("Podaj login!", {
            position: 'top-right',
            effect: 'jelly'
        });
    }
    else if (!p)
    {
        Alert.error("Podaj hasło!", {
            position: 'top-right',
            effect: 'jelly'
        });
    }
    else
    {
        axios.post('login/login',{
            username: u ,
            password: sha256(p)
            })
          .then(res => {
            const posts = res.data;
            if (res.data === "true")
            {
                Alert.success("Zalogowano się!", {
                    position: 'top-right',
                    effect: 'jelly'
                });
                window.location.reload();
            }
            else if (res.data === "false")
            {
                Alert.error("Błędne hasło lub login", {
                    position: 'top-right',
                    effect: 'jelly'
                });
            }
            else
            {
                Alert.error("Nieznany błąd!", {
                    position: 'top-right',
                    effect: 'jelly'
                });
            }
          });
      }
  }

    handleKeyPress(e)
    {
        if (e.key === "Enter")
            this.handleClick(this.state.email,this.state.password);
    }

  handleClickLogin()
  {
      document.title = this.state.site_title.split(" ", 1) + " - Logowanie";
      this.setState({isShowingModal: true})
  }
  handleCloseLogin()
  {
     document.title = this.state.site_title;
     this.setState({isShowingModal: false})
  }

  render() {
   return (

        Zaloguj sie
        {
        this.state.isShowingModal &&
        <ModalContainer onClose={this.handleCloseLogin}>
          <ModalDialog width="50%" style={{background: "transparent"}} onClose={this.handleCloseLogin}>

LOGOWANIE

            <form className="login__from">

                    Nazwa uzytkownika:
                    <input onKeyPress={(e) => this.handleKeyPress(e)} onChange={(e) => { this.setState({ email: e.target.value }); }} className="form_input__login form-control" required type="text" name="username" value={this.state.email} />

                    Haslo:
                    <input onKeyPress={(e) => this.handleKeyPress(e)} onChange={(e) => { this.setState({ password: e.target.value }); }} className="form_input__login form-control" required type="password" name="password" value={this.state.password} />

                                <input className="form-check-input" type="checkbox" id="inlineCheckbox3" value="option3" />
                                Zapamiętaj mnie

                        Przypomnij hasło

                <input onClick={() => { this.handleClick(this.state.email,this.state.password)} } className="btn btn-primary btn-lg form-control offset-lg-4 col-lg-4" value="Zaloguj się" />
                <input onClick={() => { this.handleClick(this.state.email,this.state.password)} } className="btn btn-success btn-lg form-control offset-lg-4 col-lg-4 my-2" value="Zaloguj się przy pomocy..." />

           </form>

Zalogowanie oznacza akceptację Regulaminu serwisu HYPEWEAR.PL w aktualnym brzmieniu. Jeśli nie akceptujesz warunków zmienionego Regulaminu serwisu HYPEWEAR.PL, wyślij oświadczenie o rozwiązaniu Umowy w trybie przewidzianym w Regulaminie.*

          </ModalDialog>
        </ModalContainer>

        }

   );
 }
}

export default Login;

redpajama_set_name: RedPajamaGithub


text:
HG's Tips For a Fine Parisian Spring
March 31st, 2013 § 0 comments § permalink
Advice from HG if a "Springtime In Paris" is contemplated. Bring a good raincoat and walking shoes. Paris is a great walking city and nice surprises lurk around every corner. Rent an apartment. Cheaper than a hotel and you can feast in your own kitchen on all the great cheese, bread, charcuterie and wine that is easily available. Wine is much cheaper in Paris than in the United States, so indulge without guilt. A restaurant lunch is a much better value than dinner, so make that your meal of the day. Always nice to have some oysters (and bulots) in a brasserie in the early evening and then purchase a good roast chicken for dinner in your apartment (The places that sell roast chickens usually have tasty little roast potatoes as an accompaniment). Paris has the world's best chocolates. Buy some and have them with red wine for dessert. A fresh baguette with French salted butter and cafe au lait should be your daily breakfast. Paris is a movie town and scores of American films are usually on view. Just check to see if the movie is "v.o."–In English with French subtitles. Be disciplined about museums. Yes, the Louvre, Gare d'Orsay, Pompidou. Musee Picasso, Musee Rodin are great. But, be selective about what you want to see. HG and BSk rarely spend more than two hours at a museum or special exhibit. Beyond that eyes get glazed, feet get heavy and artistic insights diminish. Though New York is really a better and more cosmopolitan food town, the ambiance, sparkle — and affordability — of Paris restaurants remain unique. Your best online dining guides are: Alexander Lobrano's "Hungry For Paris"; John Talbott's Paris and the blog Paris Update. If you log into Paris Update you will not only get the latest on dining, shopping, etc., but you can access David Jaggard's "C'est Ironique," a witty and perceptive chronicle of life in Paris. Jaggard is a journalist, translator and composer. He's lived in Paris since the 80's and is one of the funniest writers around. Don't miss him. Bon appetit!!
Speaking About the Unspeakable
March 30th, 2013 § 0 comments § permalink
Natural functions being what they are, the bathroom (also known as the sanitary facility, the toilette, the Head, the W.C or the stately "Gentlemen's Lounge") is a necessary adjunct to dining, movie going and other pleasurable activity. In HG's experience, the vilest bathrooms can be found in New York's Chinatown. The smallest are in coffee bars in Italy. The most inconvenient are in Paris bistros where they are often tucked away in a subterranean alcove. The most luxurious can be found in the best London hotels like the Connaught, Savoy and Dorchester. The Oak Room of the Plaza Hotel in New York had a splendid bathroom supervised by a deft and distinguished attendant (The Plaza has undergone vast changes and HG hasn't visited the Oak Room for decades so this may no longer be true). HG had a memorable experience in that bathroom. The super debonair actor Cary Grant (a frequent Oak Room diner) entered the bathroom with HG. Unlike HG, he did not remove his jacket. Instead, Grant unbuttoned the buttons on the jacket's sleeves, did a quick fold and washed his hands. HG was dazzled, having long believed that sleeve buttons were merely decorative. From that time on, HG went to the extra expense of having his suit jackets tailored with operable buttons. The most architecturally distinguished bathroom HG ever encountered was the art deco masterpiece in New York's Radio City Music Hall. In HG's recollection, its walls had a mural extolling smoking and tobacco cultivation. It was also the first bathroom with a warm air blower for drying hands. Little HG found this innovation as exciting as any movie and spent far too much time drying and re-drying his hands. Bathroom attendants were usually anonymous personalities, obsequious gents who trolled for tips while handing out towels — but not the old guy at the Polo Grounds, the rickety old uptown New York stadium that once housed the baseball and football NY Giants. He regaled his customers with this bit of doggerel: "No matter how you shake and dance, the last drop always falls in your pants." And he was not shy about promoting tips, singing out "After you've had your little pee, don't forget to remember me — old Sam."
Mustard — Make Mine Maille!
Maille, the French Dijon style mustard, which has been produced for 266 years, has an essential place in HG and BSK's pantry. Although it is far better than the Made-in-the-USA Grey Poupon, the Maille mustard available in the better American groceries is not as pungent and flavorful as the Maille HG buys in Paris. It has been toned down for American tastes. To be walloped by the real Maille taste you have to go the Boutique Maille in Paris (it's very close to the Madeleine church on the Right Bank, the church that resembles a Greek temple). At the Boutique you can buy mustard the way Paris foodies do — straight from a tap and consumed before time can steal any mustard power away. You can taste some interesting mustard flavors like chablis, honey and grape juice; white wine, apricot, blue cheese, walnut and rose. The obliging clerks provide little pretzels for tasting purposes. The basic Maille mustards (not all are exported): Dijon Originale (the smooth mustard one usually associates with Dijon); Whole Grain Old Style (great with cold cuts); Honey Dijon (nice with liver sausages); Mustard with Horseradish (try it with a choucroute); Rich Country With Cinnamon and Ginger (HG likes it with grilled Tandoori-style chicken). Americans usually think of mustard as a condiment to be squeezed or spread onto hot dogs or ham-and-cheese sandwiches. The French, however, use mustard in scores of sauces and dishes — including desserts. None of the Maille products works with Chinese food. For Chinese purposes, HG mixes Keen's English Mustard Powder (been around since 1742) with vinegar or water. And, when HG is in the USA and powerful French Maille isn't available, HG uses Russian or Polish mustard. These say "Hot and Spicy" or "Extra Hot" on the labels, It's truth in advertising. These mustards stand up to the most garlic and pepper laden sausages.
Giddyap! And Pass The Salt
Lots of turmoil in Europe about adding horse meat to hamburger (and not telling consumers about it until they whinny, of course). HG presumes the French are amused. They have been eating horse meat for years and there are loads of horse butchers in Paris. Horseflesh fanciers claim the meat is healthier (less fatty) than beef and has a pleasant flavor. HG has had horse meat carpaccio (lean raw slices with a bit of olive oil and shavings of Parmesan) in Italy and found it very tasty. HG has never said neigh to seconds of this delicacy. HG has also had donkey stew in Italy (long simmered in wine and served with polenta). HG does not share the American anxiety and antipathy concerning the consumption of horse, donkey, rabbit, frog, snail, animal (and bird) innards and heads. HG has had opossum and squirrel in some southern stews (burgoo and brunswick). Gamy and good. There is a line that HG will not cross — HG will not eat anything that barks or purrs. So there will be no noshing on the dogs and cats that are considered delicacies in some parts of China. And while we are at it…No to rats and snakes. HG is just too much of a wuss.
Paddy Redux
Bob C., journalist, publisher, senatorial press secretary, horseman, befriender of burros and a fellow resident of northern New Mexico came to dinner bearing a bottle of Bushmills Irish Whiskey. BSK decided to honor the noble beverage by doing a belated Paddy Day feast. Corned beef. Potatoes. Cabbage. The ingredients got that special BSK twist. The corned beef got some good peppercorn spicing and simmered happily for about three hours. The cabbage was not boiled but stir fried in a manner derived from a James Beard recipe. The potatoes were smashed with chicken stock, olive oil and chopped green onions. The corned beef was accompanied by a parsley sauce that BSK sourced from the remarkable Colman Andrews. This was a puree of parsley, butter, milk, onions, broth from the cooked corned beef and a bit of flour for thickening. (You can find the recipe for the corned beef and the parsley sauce in The Brisket Book: A Love Story With Recipes by Stephanie Pierson, a wise and funny book by a wise and funny writer). HG provided the table with dill pickles, hot mustard, Guinness Stout and Belgian ale. Lots of laughs helped along by after dinner Bushmills indulgence. (If you enjoy penetrating writing and sharp wit, log into Bob C.'s Blog: An Old Gringo's Gazette.
They Tried To Kill Us. They Failed. So, Let's Eat A Lot And Get Drunk.
March 23rd, 2013 § 2 comments § permalink
Passover is here. Matzos sit next to Easter Bunnies on supermarket shelves across America. It's that time of year. Boisterous eating and drinking dominated HG's family Passover celebration, the Seder, when some 76 years ago much of HG's family was centered in the Flatbush section of Brooklyn. Though a very young lad then, aged HG still remembers all the details of the raucous family feast. First, a small glass of wine and a tiny plate of food was placed on the table for the prophet Elijah (in the unlikely event that he would manifest himself in Brooklyn). The table was set with the symbolic dishes (these were not eaten) of the Hebrew captivity in Egypt. There was the reading of the Hagaddah, the tale of Passover (In those long ago days, the Hagaddahs were published by the Maxwell House Coffee Company. They were distributed, free of charge, at Jewish "appetizing" stores and kosher butchers. A canny PR move by the coffee merchants). A matzo (the traditional unleavened bread obligatory during Passover) was folded into a napkin and "hidden." This was called the afikomen and when found by the young members of the family each got a monetary award — a shiny half-dollar. (Many years later, HG learned that when the lucky children of one of HG's real estate mogul public relations clients found the "afikomen" each were rewarded with a $10,000 check). The big moment for little HG was when he was called upon to ask "the four questions" — the inquiry as to why this celebratory Passover night was different from any other night of the year. The small boy relished the spotlight and asked the questions — spoken in English and chanted in Hebrew — with many bravura, theatrical flourishes. "A regular Thomashefsky!!," HG's uncle exclaimed, approvingly. (Boris Thomashefsky was a flamboyant star of the Yiddish stage. The conductor Michael Tilson-Thomas — who shortened the name — is his direct descendant). The serious eating began with copious portions of gefilte fish (a very robust version of the French "quenelle") with heaps of fiery, freshly grated horseradish. Followed by brisket, copious gravy, roasted carrots and onions plus knaidels — matzo meal dumplings which had a sponge like capacity for soaking up gravy. All of this was accompanied by many glasses of kosher-for-passover Schapiro's sweet Malaga grape wine (purchased at the Schapiro lower east side winery – now closed). The wine carried a kick so the Seder became louder and more irreverent as the evening progressed. Dessert was a compote of stewed fruit plus special Passover pastries like coconut macaroons. Bottles of Vishniak (cherry brandy) and Slivovitz (plum brandy) appeared and were drunk in abundance. A Seder song, Chad Gadya, a song about the survival of a symbolic kid, was sung and shouted — loudly. More songs. Some secular and even naughty. More brandy drinking. At one memorable Seder, the group was singing: "We love Jesus, yes we do. We love Jesus, yes we do. Hooray for Jesus. Hooray for Jesus. Damn good Jew!!" Two very Irish looking cops appeared at the door. Asked the family to tone things down. Neighbors were complaining. Invited the cops to have a drink They agreed. Big glasses of Slivovitz. HG's cousin proposed a toast: "To Ireland, a great land." More Slivovitz and the cops joined in the next toast, shouting with the family, "Next year in Jerusalem."
Super Congee
HG prepared the ultimate comfort food — congee — upon the arrival in New Mexico of Beautiful Granddaughter Sofia. A note to the uninitiated: Congee — also known as "jook" — is Chinese rice porridge, a warming hug of a dish. HG and BSK were converted to congee during their long residence in Vancouver. A few hundred yards from their loft was Congee Noodle House where scores of Asians ate — you guessed it — congee and noodles. Some of the Asian customers added black "hundred year" eggs to their congee. Others accompanied it with fried Chinese crullers. HG and BSK usually added chopped oysters, scallops, prawns or mushrooms to their steaming bowls. When making congee at home, HG uses Ottogi Vegetable Rice Porridge Mix (available online from Hmart). Very savory, much simpler and less time consuming than making congee from scratch. For the Welcome Dinner, HG gave the recipe a twist: In place of plain water, HG substituted good chicken broth (HG likes Trader Joe's Free Range broth) and shitake infused water (the dried shitakes were sourced from Sante Fe's Talin International Food Market). Chopped mushrooms were added to the congee and –a few minutes before serving — a pound of shucked oysters and their juices were plunked into the pot. The servings got a topping of chopped scallions. A happy and soothing feast.
Cheap New York & The Surrealists
The younger generation is disbelieving when HG mentions how cheap New York living used to be. In the 1950's a quite liveable one room apartment in Greenwich Village or Chelsea rented for $35-45 a month. In the 40's, a pastrami sandwich was 15 cents (later raised to 17 cents as wartime inflation took hold). The subway was a nickel and there were ferocious protests when the fare was raised to a dime. (Yes..everything is comparable and salaries were low then and inflation has risen…but still…New York was then an affordable, working and middle class city; now it is a city built for the rich with everyone else struggling to stay afloat). During the 1940's HG's beloved late sister Beulah Naomi would take young HG to lunch at Larre's, a French restaurant on W.56th Street in order to give the young man a taste of European civilization. French was spoken at almost every table as wartime immigrants and high school French teachers paid homage to Francophone culture. This what you got for 50 cents: All the French bread you could eat, of course, plus a small, gratis salad. An hors d'oeuvre cart passed through carrying modest treats like lentils, shaved carrots, string beans. Soup (onion or consomme). A long simmered stew with a fancy French name (either beef or mature fowl). Dessert (usually custard described as "Creme Caramel"). Coffee. No, it was not Henri Soule caliber French food but it was okay. Beulah Naomi and HG didn't know that during World War Two, Larre's was the favorite restaurant of a group of artists. Robert Motherwell (then interested in surrealism) and other avant-garde visionaries would lunch at Larre's twice a week with famed French surrealists displaced by the war — among them Marcel Duchamp and Andre Breton. After lunch, the group would stroll to Third Avenue, then filled with antique and second-hand furniture shops. They would browse these shops trying to determine which objects were "surrealistic." Duchamp (who gave the world the first "ready-made" piece of art i.e. a hanging urinal) was the final arbiter.
Rhody Rapture
The 10-cent Nedick's hot dog (Nedick's, now shuttered, was a New York City based fast food chain predating Mickey Dee). The Sabrett's hot water dog with its odd tomato and onion sauce. The Chicago hot dog replete with "sport" peppers, celery salt, pickles and other greenery. The Bronx kosher deli dog with hot mustard and sauerkraut. The estimable doggie sold in the Costco food court. All of these have provided HG with varying degrees of pleasure. But, HG's favorite canine can only be found in the small state of Rhode Island. Yes, Rhody is of modest size but it specializes in big, highly idiosyncratic flavors. And, for sheer oddity (as well as a strange, hard-to-pin-down savoriness) the "New York System Hot Wiener" (accompanied by a cold Coffee Milk) stands out and makes HG bark with delight. Permit HG to do a scholarly exegesis on the proletarian pup: The wiener used in a NY System is either the skinless product, the Little Rhody or the Saugy which has a natural English sheep casing (giving it a characteristic snap). Alone, or in a roll, these small sized dogs are certainly good but nothing to write an HG posting about. But, then comes the sauce. Ah, the sauce. The French say cheese is milk's leap into immortality (When the French get things right, they get them really right). And, the spicy meat sauce that smothers the Hot Wiener makes the tube steak leap into nosh immortality. Created by Greek immigrants in the early 1920s (or somewhere around there) the meat sauce is truly the flavor of the old world (Europe, Middle East) meeting (or meating!) the new. There are hints of Italian Ragu and Greek Mousaka. Bits of Texas chili. Smidgens of Middle Eastern kefta (possibly due to tiny infusions of cinnamon, cumin and possibly all spice). The faintest evocation of Portuguese stews. But, why try to analyze it. Like a kiss from a beautiful woman, just enjoy it and don't intellectualize. One would think that the sauce could stand alone, No. Rhode Islanders further enhance the Hot Wiener with mustard, chopped onion and celery salt. So, what do you drink with his extravaganza? Just as HG believes the only appropriate drink to guzzle with a New York hot pastrami sandwich is the "Jewish Champagne" that is Dr. Brown's Cel-Ray Tonic, Rhodys opt for Coffee Milk. This beverage is made with two tablespoons of locally made Autocrat Coffee Syrup mixed with icy milk. Stirred well. Simple. Perfect. HG believes the Rhode Island fondness for coffee milk is somehow linked to the Rhode Island fondness for coffee and donuts at Dunkin' Donuts. Rhodys are the nation's largest per capita consumers of donuts (the Providence sports and entertainment center is the Dunkin' Donuts Arena known to all followers of Providence and Rhode Island University basketball teams as "the Dunk).
Given all of this yummy history, HG's heart picked up a beat today when he opened a package from the Family R.: Gifted Daughter Lesley, Profesore/Dottore Massimo, Glorious Granddaughters Arianna and Sofia. The little bundle contained a package of Olneyville N.Y. System, R.I.'s Best Hot Wieners, Hot Wiener Sauce Spice Mix (since 1946) plus a bottle of Autocrat, enough to make many glasses of Coffee Milk "The Official State Drink of Rhode Island." The enclosed card read: "A taste of Rhode Island for Hungry Gerald." HG has a kind and thoughtful family. HG will sample these good RI things while listening to Blossom Dearie sing: "Rhode Island Is Famous For You."
Dr. Brown's Cel-Ray Tonic – The Big Exception
HG loathes all of the popular, incessantly advertised, heavily sugared, artificially sweetened and chemically infused carbonated beverages. Coke, Pepsi, Sprite, Dr. Pepper, etc. To HG they seem to be part of a health destroying plot against the American people. Principals in the plot are the evil profiteers who stock the supermarket shelves with these nasty drinks and their collaborators, the "snack" manufacturers. (Recently they have been joined by the brewers of the "energy" drinks — a la Red Bull). HG looks with dismay as women, accompanied by children, wheel their supermarket carts laden with these vile objects. Do they hate their kids? Have they been brainwashed by television hucksters? In the interests of full disclosure and intellectual honesty, HG must admit to a twice-a-year fall from grace. That's when HG eats a traditional overstuffed Jewish pastrami sandwich in New York (at Katz's or Carnegie Deli). What Sauterne is to foie gras and Burgandy is to steak — that's what Dr. Brown's Cel-Ray Tonic is to pastrami. The companion made in heaven. Of course, Cel-Ray reeks of fraud. It's flavored with some kind of celery seed extract — not nice, fresh, healthy celery. It certainly isn't a tonic. (Okay, okay. At some point the FDA made the manufacturers stop calling it a tonic and label it as "Soda.") And, HG suspects Dr. Brown's medical school credentials. Nevertheless, when eating pastrami the drink seems to be just what the doctor ordered — the pungent, almost peppery flavor is the perfect foil for the juicy fat of perfect pastrami. It is a very Jewish beverage and only found where Jews abound — New York and South Florida. You can also find it in such Los Angeles heartburn heavens as Langer's, Canter's and Nate and Al's. Cel-Ray had its birth in Brooklyn in 1868 and for generations was known as "Jewish Champagne." Pass the pickles and sour tomatoes, please.
You are currently viewing the archives for March, 2013 at HUNGRY GERALD.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Visual C# Windows form Application dont know how to complete this question When squirrels get together for a party they like to eat acorns. A squirrel party is
successful when the number of acorns is between 40 and 60, inclusive unless it is
the weekend, in which case there is no upper limit on the number of acorns. Write
a program which will find out when the party is and how many acorns there are.
Return "Good Party" if the party is within the rules or "Terrible Party" if they have
the wrong number of acorns.
I have done the part of the number of acorns but struggling in the weekend part also I am new to this
This is my code
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int acorns = int.Parse(textBox1.Text);
            if (acorns >= 40 && acorns  <= 60)
            {

                MessageBox.Show("Good Party");
            }
            else
            {
                MessageBox.Show("Terrible Party");
            }
        }
    }

A: just check the dayofweek on the date which you are working. Here i use system date
private void button1_Click(object sender, EventArgs e)
        {
            int acorns = int.Parse(textBox1.Text);
            if (acorns >= 40 && (System.DateTime.Today.DayOfWeek == DayOfWeek.Saturday || System.DateTime.Today.DayOfWeek == DayOfWeek.Sunday || acorns  <= 60))
            {

                MessageBox.Show("Good Party");
            }
            else
            {
                MessageBox.Show("Terrible Party");
            }
        }

A: To find the day of the week use DateTime.DayOfWeek

redpajama_set_name: RedPajamaStackExchange


Airport limousine services offer a great deal of services other than airport pick offs and drop offs. This makes them more versatile and helps them remain relevant. Here are a number of ways in which you can use airport limo service when in Toronto.
Your wedding is an event in life that should be enjoyed to the uttermost .Depending on your needs whether it's getting to the church or the reception in style or a drive to the airport while heading for your honeymoon, limousine services ensures that the experience is a memorable one. The limos are clean, comfortable, and the chauffeurs are prompt to serve and attend to your needs. The services are designed to accommodate your every request with professionalism thus making your wedding the life changing event it should be. Taking into consideration your preferences for instance, the more classic couple who prefer vintages or the more modern couple who prefer stretches, anything to suit your big day demands will be put in action. Most of the airport limousine service providers offer wedding packages and thus you have the chance to choose which package works for you.
When it comes to the business world, it is important to make the right impression. Then why not have your client experience a luxury travel by having them arrive at your door in style. You can also give yourself the same treat by enlisting to the services of limo companies when you need to travel for corporate events. One stop arrangements are always ideal when traveling on business across different countries. Thus finding a limo service that can serve you even while in another country is a great way.
Understanding client's needs is a very important business aspect that helps you stay on top of the game. There is a lot of stress associated with visiting rehabilitation centers, assessment centers and medical appointments. You can book rides for passengers under the insurance docket and this ensures that the clients travel in comfort and are handled by professionals thus easing their burden while traveling.
Special events such as anniversaries, bar mitzvahs, birthdays, concerts, sports events or simple diners— all need that touch of glam. Most airport limousine service providers offer packages for these occasions. With a diverse fleet of cars to choose from, pocket-friendly prices with discounts and professional chauffeurs to drive you and your guests around, it could not get any better. Life altering events like bringing a newborn baby home deserve the best choice of executive vehicles and the service providers will help make sure you get the best.
Whether it is just a simple night out, make it more memorable with a limo ride together with your friends and be assured that after a great night's stay, a limo chauffeur will be waiting to take you home. Most of these airport limo service providers offer special packages to go hand in hand with the special occasion making the offer more lucrative.
Rest assured that all services rendered are quality and designed to suite your needs. The limo services pride themselves of offering that appeal to a large audience and services that are incredible. It is safe to say that you are bound to enjoy your time stress-free.
Airport transportation is our specialty! Our friendly drivers, newer model vehicles and low rates take the trouble out of getting to and from Pearson airport.
On-time quality service, with safety and comfort.
All Major Credit Cards Accepted for Above Services.
Toronto Airport Limos is the the fastest, easiest way to plan your travel.
Ajax, Aurora, Bolton, Burlington, Concord, Georgetown, King City, Kleinberg, Maple, Maple, Markham, Milton, Newmarket, Nobleton, Oakville, Oshawa, Pickering, Richmond Hill, Stouffville, Thornhill, Whitby, Woodbridge, and the GTA.


Stars are the most important objects in the Universe. Even though they make up less than 3% of the matter they make up 100% of the visible matter. They are a major apparatus for studying the universe and its evolution. This includes the remnants left from their deaths and the discarded material from stellar winds during their life. The evolution of a star is qualitatively understood. It begins on the main sequence, burning hydrogen to helium. There it spends the largest fraction of its lifetime. Once a helium core has formed, hydrogen continues to burn in a shell around the core and the stellar radius swells and the star becomes a red giant or supergiant. In the centre of the core helium burning then ignites forming a carbon and oxygen.
Stars with initial masses less than about 8 times the mass of the sun eventually form a carbon-oxygen core is and become asymptotic-giant branch stars. No further nuclear reactions occur in the centre of the star but the two burning shells of hydrogen and helium continue to burn by a series of thermal pulses in which a large amount of nucleosynthesis of heavy elements occurs. Eventually these stars lose their hydrogen envelopes by stellar winds and the carbon-oxygen core is exposed and becomes a white dwarf.
For stars with initial masses greater than 8 times the mass of the sun later burning stages occur. After the formation of a carbon-oxygen core progressively heavier elements burn preventing stellar collapse until an iron core is formed. With no further energy source to prevent the core from collapsing, a neutron star or a black hole is formed and the star explodes as a supernova or long gamma-ray burst. These events, and the strong stellar winds these stars have, make them the an important source of energy and nucleosynthesis products in the interstellar medium. Thus massive stars are important to understand to understand the structure and evolution of galaxies.
In addition the evolution of any star can be strongly affected if it is in a binary system. The evolution of a binary only differs from that of single stars if the size of the stars is similar to that of the orbit. If this occurs stars can lose mass, possibly transferring some to a companion. Mass-transfer can have dramatic consequences for both stars.
The research into stellar evolution at the IoA encompasses all aspects of stellar evolution but the main themes currently are binary stars, magnetic fields, stellar winds, supernova progenitors, progenitors of gamma-ray bursts, spectral synthesis of resolved and unresolved stellar populations and asymptotic-giant branch stars. The research is primarily theoretical in nature. Our main code is the novel and versatile Cambridge STARS code to produce stellar models to study the above phenomena. In addition we also have strong links with observational groups around the world for which we provide theoretical input.


In order to keep this display in production over the long term, we are revising it to the CFAF240400A0-030T for customers who use the 8-bit interface or CFAF240400B0-030T for customers who use the 16-bit interface. Any backorders placed now will be fulfilled with the new part when it becomes available. Please contact sales with any questions.
This 3.0" diagonal, 240x400 pixel, full RGB color graphic TFT display module boasts a 38.88mm x 64.80mm active area.
Four parallel interface modes are available: 8-bit, 9-bit, 16-bit or 18-bit.
The integrated Orise OTM4001A 720-channel 6-bit source driver or compatible controller, allows a single 3.3v supply for both power supply and logic.
Measuring 45.03 x 77.00 millimeters overall with the FPC folded, you can mount this display in portrait or landscape orientation.
In portrait orientation, the narrow width of this TFT works well with portable, handheld, or embedded systems.
In landscape orientation, the low profile of this TFT may be used for the user interface of 2U+ rack mount devices or in benchtop laboratory equipment such as power supplies, meters, and signal generators.
For mass production, the display's tab makes fast and easy connection possible using a hot bar soldering machine.
Temperature operation is from -20°C to +70°C.
Questions? Contact our Technical Support Team for help.
As an option, you can order this TFT pre-assembled onto a breakout/carrier board. The board allows easy prototyping through its 0.1" headers. You can also include the carrier board in your end product to simplify construction and assembly. The carrier board contains a constant-current switching LED driver. The PCB is sized to fit neatly within the outline of the display.
This kit is available with or without standoffs in the four mounting holes. The standoffs allows the carrier board to be mounted using any 2-56 style screw. The standoffs are 3mm deep to ensure sturdy mounting points.
Reason: The Orise controller chip used on the CFAF240400D-030T has been discontinued by the manufacturer.
Impact: The CFAF240400D-030T is not available. All stock has been depleted.
Recommendation: Two replacements are available for the CFAF240400D-030T.
The CFAF240400A0-030T is available for customers using an 8-bit parallel interface.
The CFAF240400B0-030T is available for customers using a 16-bit parallel interface.
Replacements for the CFAF240400D-030T-CB and CFAF240400D-030T-CB1 kits will be available at a later date.
Reason: The Orise Tech OTM4001A Controller chip has been discontinued by the manufacturer. No direct replacement is available.
Impact: This product will no longer be available when current stock is depleted. A last-time buy is not available.
Recommendation: Replacement parts will be available by the first quarter of 2019. Information regarding the replacement parts will be posted on our website and in our newsletter as it becomes available.
Availability: Contact Sales for more information on the availability of the CFAF240400D-030T. Availability of replacement parts is to be determined.
Description: On the 2BM-10005, the pin that enabled and disabled the backlight (Pin 29) was left floating with the expectation that the host system would drive that line.
On the CFA-10075, that pin is tied to GND using a 1M Ohm resistor.
Reason: Customer feedback has shown that this pin is not always being driven in every situation and the cut over between the 2BM-10005 and the CFA-10075 has caused compatibility issues.
Impact: Customers not specifically enabling this pin, by driving it high, will find that the backlight does not illuminate.
Recommendation: It is important to ensure that when using this carrier board, the BL pin should be driven by the host system. Preferably using a GPO in order to actively toggle the backlight.
Reason: As part of our continuous improvement, the design and manufacture of carrier board has been brought under in-house control.
Recommendation: The CFA-10075 has been designed and tested to be Fit, Form, and Functional compatible with the 2BM-10005. Testing in systems is encouraged, as with any product update.
Price Change: None at this time.
Description: We are changing our TFT part numbers to have them better describe the parts being ordered. The change should be complete for all TFT modules shipping within the next six months.
Reason: There are many TFT modules with the same logical dimensions (resolution) with considerably different sizes. In order to help ease any confusion, we have decided to add the diagonal dimension to the part number.
Impact: The part number is all that is changing, there are no other changes to the parts, so there should be no significant impact.
Availability: The transition period should be about six months from the date of this bulletin.
This module is engineered for high volume production. It uses a "TAB" (tape automated bonding) or "COF" (chip on flex) style flex tail. The TAB connector is soldered directly to corresponding pads on your PCB using a hot-bar soldering machine. High volume contract manufacturers will be familiar with this type of construction and its assembly methods. Hot-bar soldering machines designed for prototype, rework or repair of TAB connections are available from equipment suppliers at reasonable cost. The TAB style connection requires no separate connector, so the cost is very low, and the ultra thin profile of the display is maintained.


text:
Home / News / Business Birmingham named top regional investment agency by leading locations magazine Site Selection
Business Birmingham named top regional investment agency by leading locations magazine Site Selection
Business Birmingham has been named Top Regional Investment Promotion Agency (IPA) in Western Europe, by leading specialist locations magazine, Site Selection.
The global publication's annual Best to Invest Top IPA awards, has now recognised Business Birmingham as the UK's leading IPA for two consecutive years. The organisation is ranked alongside Germany's Berlin Partner (Germany) for its performance and success in economic growth activity and job creation.
Site Selection surveyed 1,000 experts around the world, including corporate decision-makers and site consultants, in order to determine a shortlist of finalists. IPAs to receive the awards, were those that accumulate the most points based on the following criteria:
Most professionally responsive to inquiries
Offering access to user-friendly databases of sites and incentives (general and sector-specific)
Readily available information on timing expectations of permitting and other processes
Staff possessing the best knowledge and language diversity
Access to recent investors in the region who can vouch for the area and agency
Best reputation for protecting investor confidentiality
Reputation for after-care services
Website – based on breadth of data and efficiency
In recent years, Greater Birmingham has attracted record numbers foreign investment projects in advanced engineering, automotive and more recently, financial services. Key investors include global German-owned manufacturer Guhring, which unveiled its new UK headquarters in Birmingham; Chinese automotive giant Changan and US hydraulic supplier HydraForce.
The region's growing reputation as a global hub for Business, Professional and Financial Services firms, has been reinforced by major investments from global companies such as HSBC, which made the decision to relocate the headquarters of its ringfenced commercial banking arm from London to Birmingham.


Today I'm taking part in the Girls Just Wanna Have Fun Blog Hop, hosted by Jaycee DeLorenzo and Victoria Smith.
Interview a heroine of your manuscript, novel, or WIP by a fellow female counterpart also from one of your written works. Your featured heroine can be interviewed by her best friend, a heroine from another one of your written works, a sister, the opportunities are endless!
Have your heroine answer at least 3 of the questions recommended below or make up your own!
Post a picture of your heroine, the interviewer, or both!
Post a song for the theme of the interview or a song that reflects your featured heroine's personality.
Follow Victoria and me on our blogs.
Post your entries on June 22, 2012 and hop around the other blogs through the linky!
For this hop, the interview will have more of a "girls chatting" type feel because after all, Girls Just Wanna Have Fun! So feel free to write it like a short scene in a book!
"So? How was your date with Dan?" Petra was too excited to know how the date had gone to wait until they were seated but Karen took her time replying, first sitting neatly in her chair, ensuring her handbag was tucked away and then taking a long sip of her drink.
"It wasn't a date. I keep telling you, we're just friends."
"And I keep not believing you." Petra smiled at her friend to show she was only kidding. "Where did you go?"
"Just to the White Deer. Like I said, it wasn't a date, just two friends getting together for a couple of drinks at the pub."
"Yeah, yeah. Not a date. I get it." Petra gave a wave of her hand. "But did you kiss him?"
"No!" Honestly, why couldn't Petra get it? She and Dan were just friends and besides, Karen had only been single for five minutes. The last thing she needed was another man to break her heart.
"But would you? If you were dating, would you kiss him - or anybody else for that matter - on a first date?"
Karen took another sip of her drink, allowing herself to mull over the question. It had been a long time since she'd had to ask herself such questions. "No, I think I'd rather play hard to get. Perhaps on the second date?"
"And what would a man have to do to earn himself a second date with you?" Petra would be sure to pass the information on to Dan. Karen may have been in denial about their friendship status but she was sure Dan knew where he stood.
"Good manners are a must. And clean fingernails."
Dan always appeared freshly showered and he had impeccable manners. "And what would turn you off?"
Karen wrinkled her nose. "I wouldn't want to be bored during a date. I was once taken to a poker game on a date, only I wasn't allowed to play. I just had to sit there all night while he lost money."
Fantastic! Dan was a very healthy non-smoker. "And what was your best date?"
Karen thought hard about this. She had been on many fabulous dates so it was difficult to pick out the best. "I suppose it would have to be the time Rick surprised me with a weekend in Paris. We went to the most gorgeous, romantic restaurant with soft music and candlelight and they served..."
Petra nodded along as Karen's eyes glazed over, lost in a wondrous day in the past. She wondered whether Dan had a valid passport and a stomach for snails and frog's legs.
"... and at the end of the evening, Rick took me out onto the candlelit terrace and we danced and danced until the restaurant closed." Karen gave a little sigh before blinking her way out of her daydream. "I'm sorry. I went on a bit too much there, didn't I?"
A bit? Petra had jotted down a few notes on the back of a receipt out of her handbag, ready to pass on to Dan. She hid the pen in her lap under the table.
"Should he wear boxers or briefs?"
Karen gave a shrug. "It doesn't matter what he's wearing. It's what's inside that counts."
Grinning, Petra lifted her glass and clinked it against Karen's. She'd drink to that.
Ooh, an ulterior motive! I like!
Thanks for hosting :-D It's been fun taking part.
Hah! That last line killed me. :D Too fun!
Very very nice and clean fingers are very important ;) I loved your girls!
What a fun excerpt! Great job with dialogue!
Oooo! Paris? What a dream date that would be. I love how she thought it didn't matter about what kind of underwear he wore. So true - what's on the inside is much more important:) I'll *clink* to that, too!
i like these girls. what a cruddy date to sit around & watch a poker game!
Great excerpt! And I agree re: the clean fingernails.
If a man hasn't at least washed his hands, what else hasn't he washed?
And I'll drink to that last answer too.


text:
New 'Pirates of the Carribbean: On Stranger Tides' Details
New Pirates of the Carribbean: On Stranger Tides Details
— October 7th, 2009
We reported last month that the next film adventure with Jack Sparrow would be entitled Pirates of the Caribbean: On Stranger Tides, and it was noted the similarities between a 1987 book dubbed On Stranger Tides by Tim Powers. It turns out that wasn't a coincidence. The Los Angeles Times' Hero Complex blog recently spoke with Powers who revealed that his novel was indeed optioned almost three years ago and will serve as a basis for Pirates of the Caribbean: On Stranger Tides. Here's an excerpt from the article about how his book will translate to film.
I've watched all the movies several times, of course, and I think the clear thing they would use is the trip to the Fountain of Youth," Powers said. "My main character doesn't overlap with Jack Sparrow at all [in personality or circumstance]; they're totally different characters. I suppose they might overlap the Geoffrey Rush character Barbossa and Blackbeard. The only thing I feel certain they will hold on to is the Fountain of Youth since they telegraphed that at the end of the last movie."
CLICK HERE for the rest of the article. Meanwhile, Empire caught up with Pirates of the Caribbean: On Stranger Tides screenwriter Terry Rossio, who co-wrote the previous three installments, and spoke about the similarities between the book and the film.
Related: Johnny Depp Probably Won't Return as Jack Sparrow in Pirates of the Caribbean Reboot
"We wanted to do a story about Blackbeard and the Fountain of Youth, and Tim Powers wrote a book about Blackbeard and the Fountain of Youth... it just turns out that to do that story you would need that book. It's a brilliant and Tim Powers is an amazing writer - and it's a great title. It allows us to draw material from that universe and his expertise."
The question remains, was it based on it or not?
"I don't know if its proper to say it's based on it but there are enough common elements to think that the book had to be optioned to us to reasonably proceed along that story line."
Pirates of the Caribbean: On Stranger Tides will set sail in theaters in July 2011.
Topics: Pirates Of The Caribbean
Jack Sparrow Fans Launch Pirates Petition to Bring Back Johnny Depp
Original Pirates of the Caribbean Writer Returns for Reboot?
Pirates Reboot Loses Deadpool Writers, Is It Falling Apart?
Johnny Depp's Jack Sparrow Won't Return in New Pirates of the Caribbean Movie
Johnny Depp's Jack Sparrow to Be Replaced by Female Lead in Pirates Reboot?
Disney's Pirates of the Caribbean Ride Is Losing Its Wench Auction