text:
$script:DSCModuleName = 'xWebAdministration'
$script:DSCResourceName = 'MSFT_xIisLogging'

# Unit Test Template Version: 1.1.0
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
     (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
{
    & git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\'))
}

Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force

Import-Module (Join-Path -Path $script:moduleRoot -ChildPath 'Tests\MockWebAdministrationWindowsFeature.psm1')

$TestEnvironment = Initialize-TestEnvironment `
    -DSCModuleName $script:DSCModuleName `
    -DSCResourceName $script:DSCResourceName `
    -TestType Unit
#endregion HEADER

# Begin Testing
try
{
    #region Pester Tests

    InModuleScope $script:DSCResourceName {

        $MockLogParameters =
            @{
                LogPath              = 'C:\MockLogLocation'
                LogFlags             = 'Date','Time','ClientIP','UserName','ServerIP'
                LogPeriod            = 'Hourly'
                LogTruncateSize      = '2097152'
                LoglocalTimeRollover = $true
                LogFormat            = 'W3C'

            }

        $MockLogOutput =
            @{
                directory         = '%SystemDrive%\inetpub\logs\LogFiles'
                logExtFileFlags   = 'Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus'
                logFormat         = 'W3C'
                period            = 'Daily'
                truncateSize      = '1048576'
                localTimeRollover = 'False'
            }

        Describe "$script:DSCResourceName\Assert-Module" {

            Context 'WebAdminstration module is not installed' {
                Mock -ModuleName Helper -CommandName Get-Module -MockWith {
                    return $null
                }

                It 'Should throw an error' {
                    { Assert-Module } |
                    Should Throw

                }

            }

        }

        Describe "$script:DSCResourceName\Get-TargetResource" {

            Context 'Correct hashtable is returned' {

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Assert-Module -MockWith {}

                $result = Get-TargetResource -LogPath $MockLogParameters.LogPath

                It 'Should call Get-WebConfiguration once' {
                    Assert-MockCalled -CommandName Get-WebConfiguration -Exactly 1
                }

                It 'Should return LogPath' {
                    $result.LogPath | Should Be $MockLogOutput.directory
                }

                It 'Should return LogFlags' {
                    $result.LogFlags | Should Be $MockLogOutput.logExtFileFlags
                }

                It 'Should return LogPeriod' {
                    $result.LogPeriod | Should Be $MockLogOutput.period
                }

                It 'Should return LogTruncateSize' {
                    $result.LogTruncateSize | Should Be $MockLogOutput.truncateSize
                }

                It 'Should return LoglocalTimeRollover' {
                    $result.LoglocalTimeRollover | Should Be $MockLogOutput.localTimeRollover
                }

                It 'Should return LogFormat' {
                    $result.LogFormat | Should Be $MockLogOutput.logFormat
                }

            }

        }

        Describe "$script:DSCResourceName\Test-TargetResource" {

            Mock -CommandName Assert-Module -MockWith {}

            Context 'All settings are correct'{

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return true' {
                    $result | Should be $true
                }

            }

            Context 'All Settings are incorrect' {

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogPath should return false' {

                $MockLogOutput =
                    @{
                        directory         = '%SystemDrive%\inetpub\logs\LogFiles'
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogFlags should return false' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = 'Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus'
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogPeriod should return false' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = 'Daily'
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogTruncateSize should return false' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = '1048576'
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogTruncateSize too large for string validation' {
                $MockLogParameters = @{
                    LogPath              = $MockLogParameters.LogPath
                    LogFlags             = $MockLogParameters.LogFlags
                    LogPeriod            = $MockLogParameters.LogPeriod
                    LogTruncateSize      = '536870912'
                    LoglocalTimeRollover = $MockLogParameters.LoglocalTimeRollover
                    LogFormat            = $MockLogParameters.LogFormat
                }

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = '636870912'
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LoglocalTimeRollover should return false' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = 'False'
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Check LogFormat should return false' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = 'IIS'
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Test-TargetResource @MockLogParameters

                It 'Should return false' {
                    $result | Should be $false
                }

            }

        }

        Describe "$script:DSCResourceName\Set-TargetResource" {

            Mock -CommandName Assert-Module -MockWith {}

            Context 'All Settings are incorrect' {

                $MockLogOutput =
                    @{
                        directory         = '%SystemDrive%\inetpub\logs\LogFiles'
                        logExtFileFlags   = 'Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus'
                        logFormat         = 'IIS'
                        period            = 'Daily'
                        truncateSize      = '1048576'
                        localTimeRollover = 'False'
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 8
                }

            }

            Context 'LogPath is incorrect' {

                $MockLogOutput =
                    @{
                        directory         = '%SystemDrive%\inetpub\logs\LogFiles'
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 1
                }

            }

            Context 'LogFlags are incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = 'Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus'
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 2
                }

            }

            Context 'LogPeriod is incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = 'Daily'
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 1
                }

            }

            Context 'LogTruncateSize is incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = '1048576'
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 2
                }

            }

            Context 'LogTruncateSize is too large for string comparison' -Verbose {

                $MockLogParameters = @{
                    LogPath              = $MockLogParameters.LogPath
                    LogFlags             = $MockLogParameters.LogFlags
                    LogPeriod            = $MockLogParameters.LogPeriod
                    LogTruncateSize      = '536870912'
                    LoglocalTimeRollover = $MockLogParameters.LoglocalTimeRollover
                    LogFormat            = $MockLogParameters.LogFormat
                }
                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = '1048576'
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 2
                }

                It 'Should have the correct LogTruncateSize' {
                    $result.truncateSize | Should Be $MockLogParameter.LogTruncateSize
                }

            }

            Context 'LoglocalTimeRollover is incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = 'False'
                        logFormat         = $MockLogParameters.LogFormat
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 1
                }

            }

            Context 'LogFormat is incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                        logFormat         = 'IIS'
                    }

                Mock -CommandName Test-Path -MockWith { return $true }

                Mock -CommandName Get-WebConfiguration `
                    -MockWith { return $MockLogOutput }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                Mock -CommandName Set-WebConfigurationProperty

                Set-TargetResource @MockLogParameters

                It 'Should call all the mocks' {
                     Assert-MockCalled -CommandName Set-WebConfigurationProperty -Exactly 1
                }

            }

        }

        Describe "$script:DSCResourceName\Compare-LogFlags" {

            Context 'Returns false when LogFlags are incorrect' {

                $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = @('Date','Time','ClientIP','UserName','ServerIP','Method','UriStem','UriQuery','HttpStatus','Win32Status','TimeTaken','ServerPort','UserAgent','Referer','HttpSubStatus')
                        logFormat         = 'W3C'
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                    }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Compare-LogFlags $MockLogParameters.LogFlags

                It 'Should return false' {
                    $result | Should be $false
                }

            }

            Context 'Returns true when LogFlags are correct' {

               $MockLogOutput =
                    @{
                        directory         = $MockLogParameters.LogPath
                        logExtFileFlags   = $MockLogParameters.LogFlags
                        logFormat         = 'W3C'
                        period            = $MockLogParameters.LogPeriod
                        truncateSize      = $MockLogParameters.LogTruncateSize
                        localTimeRollover = $MockLogParameters.LoglocalTimeRollover
                    }

                Mock -CommandName Get-WebConfigurationProperty `
                    -MockWith { return $MockLogOutput.logExtFileFlags }

                $result = Compare-LogFlags $MockLogParameters.LogFlags

                It 'Should return true' {
                    $result | Should be $true
                }
            }

         }
     }

    #endregion
}

finally
{
    Restore-TestEnvironment -TestEnvironment $TestEnvironment
}

redpajama_set_name: RedPajamaGithub


text:
After Leverkusen Voller to enter 'world-class club' on Havertz advises
Rudi Voller, managing director of Bayer Leverkusen, believes that Kai Havertz can continue to play for one of the world's elite clubs-but he hopes he can count on his services for some time.
Havertz, 20, proved a surprise this season for Leverkusen as they seek a Champions League spot.
The playmaker has scored 11 goals in 26 appearances in the Bundesliga, most recently scoring the winner in a crucial 1-0 win over Freiburg that keeps Leverkusen at points with fourth-placed Borussia Monchengladbach, and also contributed five assists as well as three Europa League strikes as the club remains in the continental honor.
Such a sparkling impact in Europe has not gone unnoticed elsewhere, with Liverpool, Manchester United and Bayern Munich all reportedly interested in the services of the youngster.
However, Voller maintains that Leverkusen will attempt to keep its gem.
"I'm honest, I always have such a small hope that we can and will keep him here for another year," explained Sky Sports Wednesday the former Germany international and 1990 World Cup winner when asked about Havertz's future at the club.
skysports.com
If Havertz ultimately chooses to leave, Voller is in no doubt that it will be at a European heavyweight-and that his £90 million ($113 m) value will not be affected, despite the coronavirus pandemic.
Leverkusen coach Peter Bosz also thinks very much about his charge, telling TalkSport that in his play he sees shades of Real Madrid 's great Zinedine Zidane.
on Saturday, Havertz and Leverkusen are back in action and will try to derail the title challenge from Bayern Munich as the Bundesliga leaders visit the BayArena.

redpajama_set_name: RedPajamaCommonCrawl


Aspire are pleased to offer this one bedroom top floor flat in the popular location of Bitterne. The property benefits from having a open plan lounge and kitchen and bathroom which contains a three piece suite and overhead power shower The property has a security entry phone, UPVC double glazing and off road parking.
AVAILABLE NOW An early viewing is highly recommended to avoid later disappointment.[use Contact Agent Button].
Property reference ASP1000147. The information displayed about this property comprises a property advertisement. OnTheMarket.com makes no warranty as to the accuracy or completeness of the advertisement or any linked or associated information, and OnTheMarket.com has no control over the content. This property advertisement does not constitute property particulars. The information is provided and maintained by Aspire Estate Agents - Shirley. Please contact the selling agent directly to obtain any information which may be available under the terms of The Energy Performance of Buildings (Certificates and Inspections) (England and Wales) Regulations 2007 or the Home Report if in relation to a residential property in Scotland.


Make uni life the best it can be by choosing Western Sydney University Village as your new home away from home! Located right on the Penrith campus, our modern, affordable student apartments are just minutes from classrooms and uni facilities. This is how you live student life to the fullest.
At Western Sydney University Village, we provide more than a bed. Right from the time you check in, there will be great opportunities to meet new people and experience all that uni has to offer.


text:
//
//     Kerbal Engineer Redux
//
//     Copyright (C) 2014 CYBUTEK
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as published by
//     the Free Software Foundation, either version 3 of the License, or
//     (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
//
//     You should have received a copy of the GNU General Public License
//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

namespace KerbalEngineer.Extensions
{
    using System;
    using System.Collections.Generic;
    using CompoundParts;

    public static class PartExtensions
    {
        //private static Part cachePart;
        //private static PartModule cachePartModule;
        //private static PartResource cachePartResource;

        /// <summary>
        ///     Gets whether the part contains a specific resource.
        /// </summary>
        public static bool ContainsResource(this Part part, int resourceId)
        {
            return part.Resources.Contains(resourceId);
        }

        /// <summary>
        ///     Gets whether the part contains resources.
        /// </summary>
        public static bool ContainsResources(this Part part)
        {
            for (int i = 0; i < part.Resources.list.Count; ++i)
            {
                if (part.Resources.list[i].amount > 0.0)
                {
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        ///     Gets whether the part has fuel.
        /// </summary>
        public static bool EngineHasFuel(this Part part)
        {
            PartModule cachePartModule = GetModule<ModuleEngines>(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEngines).getFlameoutState;
            }

            cachePartModule = GetModuleMultiModeEngine(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEnginesFX).getFlameoutState;
            }

            return false;
        }

        /// <summary>
        ///     Gets the cost of the part excluding resources.
        /// </summary>
        public static double GetCostDry(this Part part)
        {
            return part.partInfo.cost - GetResourceCostMax(part) + part.GetModuleCosts(0.0f);
        }

        /// <summary>
        ///     Gets the cost of the part including maximum resources.
        /// </summary>
        public static double GetCostMax(this Part part)
        {
            return part.partInfo.cost + part.GetModuleCosts(0.0f);
        }

        /// <summary>
        ///     Gets the cost of the part modules
        ///     Same as stock but without mem allocation
        /// </summary>
        public static double GetModuleCostsNoAlloc(this Part part, float defaultCost)
        {
            float cost = 0f;
            for (int i = 0; i < part.Modules.Count; i++)
            {
                PartModule pm = part.Modules[i];
                if (pm is IPartCostModifier)
                    cost += (pm as IPartCostModifier).GetModuleCost(defaultCost, ModifierStagingSituation.CURRENT);
            }
            return cost;
        }

        /// <summary>
        ///     Gets the cost of the part including resources.
        /// </summary>
        public static double GetCostWet(this Part part)
        {
            return part.partInfo.cost - GetResourceCostInverted(part) + part.GetModuleCostsNoAlloc(0.0f); // part.GetModuleCosts allocate 44B per call.
        }

        /// <summary>
        ///     Gets the dry mass of the part.
        /// </summary>
        public static double GetDryMass(this Part part)
        {
            return (part.physicalSignificance == Part.PhysicalSignificance.FULL) ? part.mass : 0d;
        }

        /// <summary>
        ///     Gets the maximum thrust of the part if it's an engine.
        /// </summary>
        public static double GetMaxThrust(this Part part)
        {
            PartModule cachePartModule = GetModule<ModuleEngines>(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEngines).maxThrust;
            }

            cachePartModule = GetModuleMultiModeEngine(part) ?? GetModule<ModuleEnginesFX>(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEnginesFX).maxThrust;
            }

            return 0.0;
        }

        /// <summary>
        ///     Gets the first typed PartModule in the part's module list.
        /// </summary>
        public static T GetModule<T>(this Part part) where T : PartModule
        {
            for (int i = 0; i < part.Modules.Count; i++)
            {
                PartModule pm = part.Modules[i];
                if (pm is T)
                    return (T)pm;
            }
            return null;
        }

        /// <summary>
        ///     Gets a typed PartModule.
        /// </summary>
        public static T GetModule<T>(this Part part, string className) where T : PartModule
        {
            return part.Modules[className] as T;
        }

        /// <summary>
        ///     Gets a typed PartModule.
        /// </summary>
        public static T GetModule<T>(this Part part, int classId) where T : PartModule
        {
            return part.Modules[classId] as T;
        }

        /// <summary>
        ///     Gets a ModuleAlternator typed PartModule.
        /// </summary>
        public static ModuleAlternator GetModuleAlternator(this Part part)
        {
            return GetModule<ModuleAlternator>(part);
        }

        /// <summary>
        ///     Gets a ModuleDeployableSolarPanel typed PartModule.
        /// </summary>
        public static ModuleDeployableSolarPanel GetModuleDeployableSolarPanel(this Part part)
        {
            return GetModule<ModuleDeployableSolarPanel>(part);
        }

        /// <summary>
        ///     Gets a ModuleEngines typed PartModule.
        /// </summary>
        public static ModuleEngines GetModuleEngines(this Part part)
        {
            return GetModule<ModuleEngines>(part);
        }

        public static ModuleEnginesFX GetModuleEnginesFx(this Part part)
        {
            return GetModule<ModuleEnginesFX>(part);
        }

        /// <summary>
        ///     Gets a ModuleGenerator typed PartModule.
        /// </summary>
        public static ModuleGenerator GetModuleGenerator(this Part part)
        {
            return GetModule<ModuleGenerator>(part);
        }

        /// <summary>
        ///     Gets a ModuleGimbal typed PartModule.
        /// </summary>
        public static ModuleGimbal GetModuleGimbal(this Part part)
        {
            return GetModule<ModuleGimbal>(part);
        }

        /// <summary>
        ///     Gets the current selected ModuleEnginesFX.
        /// </summary>
        public static ModuleEnginesFX GetModuleMultiModeEngine(this Part part)
        {
            ModuleEnginesFX moduleEngineFx;
            string mode = GetModule<MultiModeEngine>(part).mode;
            for (int i = 0; i < part.Modules.Count; ++i)
            {
                moduleEngineFx = part.Modules[i] as ModuleEnginesFX;
                if (moduleEngineFx != null && moduleEngineFx.engineID == mode)
                {
                    return moduleEngineFx;
                }
            }
            return null;
        }

        /// <summary>
        ///     Gets a ModuleParachute typed PartModule.
        /// </summary>
        public static ModuleParachute GetModuleParachute(this Part part)
        {
            return GetModule<ModuleParachute>(part);
        }

        public static ModuleRCS GetModuleRcs(this Part part)
        {
            return GetModule<ModuleRCS>(part);
        }

        /// <summary>
        ///     Gets a typed list of PartModules.
        /// </summary>
        public static List<T> GetModules<T>(this Part part) where T : PartModule
        {
            List<T> list = new List<T>();
            for (int i = 0; i < part.Modules.Count; ++i)
            {
                T module = part.Modules[i] as T;
                if (module != null)
                {
                    list.Add(module);
                }
            }
            return list;
        }

        public static ProtoModuleDecoupler GetProtoModuleDecoupler(this Part part)
        {
            PartModule cachePartModule = GetModule<ModuleDecouple>(part);
            if (cachePartModule == null)
            {
                cachePartModule = GetModule<ModuleAnchoredDecoupler>(part);
            }
            if (cachePartModule != null)
            {
                return new ProtoModuleDecoupler(cachePartModule);
            }

            return null;
        }

        /// <summary>
        ///     Gets a generic proto engine for the current engine module attached to the part.
        /// </summary>
        public static ProtoModuleEngine GetProtoModuleEngine(this Part part)
        {
            PartModule cachePartModule = GetModule<ModuleEngines>(part);
            if (cachePartModule != null)
            {
                return new ProtoModuleEngine(cachePartModule);
            }

            cachePartModule = GetModuleMultiModeEngine(part) ?? GetModule<ModuleEnginesFX>(part);
            if (cachePartModule != null)
            {
                return new ProtoModuleEngine(cachePartModule);
            }

            return null;
        }

        /// <summary>
        ///     Gets the cost of the part's contained resources.
        /// </summary>
        public static double GetResourceCost(this Part part)
        {
            double cost = 0.0;
            for (int i = 0; i < part.Resources.list.Count; ++i)
            {
                PartResource cachePartResource = part.Resources.list[i];
                cost = cost + (cachePartResource.amount * cachePartResource.info.unitCost);
            }
            return cost;
        }

        /// <summary>
        ///     Gets the cost of the part's contained resources, inverted.
        /// </summary>
        public static double GetResourceCostInverted(this Part part)
        {
            double sum = 0;
            for (int i = 0; i < part.Resources.list.Count; i++)
            {
                PartResource r = part.Resources.list[i];
                sum += (r.maxAmount - r.amount) * r.info.unitCost;
            }
            return sum;
        }

        /// <summary>
        ///     Gets the cost of the part's maximum contained resources.
        /// </summary>
        public static double GetResourceCostMax(this Part part)
        {
            double cost = 0.0;
            for (int i = 0; i < part.Resources.list.Count; ++i)
            {
                PartResource cachePartResource = part.Resources.list[i];
                cost = cost + (cachePartResource.maxAmount * cachePartResource.info.unitCost);
            }
            return cost;
        }

        /// <summary>
        ///     Gets the current specific impulse for the engine.
        /// </summary>
        public static double GetSpecificImpulse(this Part part, float atmosphere)
        {
            PartModule cachePartModule = GetModule<ModuleEngines>(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEngines).atmosphereCurve.Evaluate(atmosphere);
            }

            cachePartModule = GetModuleMultiModeEngine(part) ?? GetModule<ModuleEnginesFX>(part);
            if (cachePartModule != null)
            {
                return (cachePartModule as ModuleEnginesFX).atmosphereCurve.Evaluate(atmosphere);
            }

            return 0.0;
        }

        /// <summary>
        ///     Gets the total mass of the part including resources.
        /// </summary>
        public static double GetWetMass(this Part part)
        {
            return (part.physicalSignificance == Part.PhysicalSignificance.FULL) ? part.mass + part.GetResourceMass() : part.GetResourceMass();
        }

        /// <summary>
        ///     Gets whether the part contains a PartModule.
        /// </summary>
        public static bool HasModule<T>(this Part part) where T : PartModule
        {
            for (int i = 0; i < part.Modules.Count; i++)
            {
                if (part.Modules[i] is T)
                    return true;
            }
            return false;
        }

        /// <summary>
        ///     Gets whether the part contains a PartModule conforming to the supplied predicate.
        /// </summary>
        public static bool HasModule<T>(this Part part, Func<T, bool> predicate) where T : PartModule
        {
            for (int i = 0; i < part.Modules.Count; i++)
            {
                PartModule pm = part.Modules[i];
                if (pm is T && predicate(pm as T))
                    return true;
            }
            return false;
        }

        /// <summary>
        ///     Gets whether the part contains a PartModule.
        /// </summary>
        public static bool HasModule(this Part part, string className)
        {
            return part.Modules.Contains(className);
        }

        /// <summary>
        ///     Gets whether the part contains a PartModule.
        /// </summary>
        public static bool HasModule(this Part part, int moduleId)
        {
            return part.Modules.Contains(moduleId);
        }

        /// <summary>
        ///     Gets whether the part has a one shot animation.
        /// </summary>
        public static bool HasOneShotAnimation(this Part part)
        {
            PartModule cachePartModule = GetModule<ModuleAnimateGeneric>(part);
            return cachePartModule != null && (cachePartModule as ModuleAnimateGeneric).isOneShot;
        }

        /// <summary>
        ///     Gets whether the part is a command module.
        /// </summary>
        public static bool IsCommandModule(this Part part)
        {
            return HasModule<ModuleCommand>(part);
        }

        /// <summary>
        ///     Gets whether the part is decoupled in a specified stage.
        /// </summary>
        public static bool IsDecoupledInStage(this Part part, int stage)
        {
            if ((IsDecoupler(part) || IsLaunchClamp(part)) && part.inverseStage == stage)
            {
                return true;
            }
            if (part.parent == null)
            {
                return false;
            }
            return IsDecoupledInStage(part.parent, stage);
        }

        /// <summary>
        ///     Gets whether the part is a decoupler.
        /// </summary>
        public static bool IsDecoupler(this Part part)
        {
            return HasModule<ModuleDecouple>(part) || HasModule<ModuleAnchoredDecoupler>(part);
        }

        /// <summary>
        ///     Gets whether the part is an active engine.
        /// </summary>
        public static bool IsEngine(this Part part)
        {
            return HasModule<ModuleEngines>(part) || HasModule<ModuleEnginesFX>(part);
        }

        /// <summary>
        ///     Gets whether the part is a fuel line.
        /// </summary>
        public static bool IsFuelLine(this Part part)
        {
            return HasModule<CModuleFuelLine>(part);
        }

        /// <summary>
        ///     Gets whether the part is a generator.
        /// </summary>
        public static bool IsGenerator(this Part part)
        {
            return HasModule<ModuleGenerator>(part);
        }

        /// <summary>
        ///     Gets whether the part is a launch clamp.
        /// </summary>
        public static bool IsLaunchClamp(this Part part)
        {
            return HasModule<LaunchClamp>(part);
        }

        /// <summary>
        ///     Gets whether the part is a parachute.
        /// </summary>
        public static bool IsParachute(this Part part)
        {
            return HasModule<ModuleParachute>(part);
        }

        /// <summary>
        ///     Gets whether the part is considered a primary part on the vessel.
        /// </summary>
        public static bool IsPrimary(this Part part, List<Part> partsList, PartModule module)
        {
            for (int i = 0; i < partsList.Count; i++)
            {
                var vesselPart = partsList[i];
                if (!vesselPart.HasModule(module.ClassID))
                {
                    continue;
                }
                if (vesselPart == part)
                {
                    return true;
                }
                break;
            }

            return false;
        }

        public static bool IsRcsModule(this Part part)
        {
            return HasModule<ModuleRCS>(part);
        }

        /// <summary>
        ///     Gets whether the part is a sepratron.
        /// </summary>
        public static bool IsSepratron(this Part part)
        {
            return IsSolidRocket(part) && part.ActivatesEvenIfDisconnected && IsDecoupledInStage(part, part.inverseStage);
        }

        /// <summary>
        ///     Gets whether the part is a deployable solar panel.
        /// </summary>
        public static bool IsSolarPanel(this Part part)
        {
            return HasModule<ModuleDeployableSolarPanel>(part);
        }

        /// <summary>
        ///     Gets whether the part is a solid rocket motor.
        /// </summary>
        public static bool IsSolidRocket(this Part part)
        {
            return (part.HasModule<ModuleEngines>() && part.GetModuleEngines().throttleLocked) || (part.HasModule<ModuleEnginesFX>() && part.GetModuleEnginesFx().throttleLocked);
        }

        public class ProtoModuleDecoupler
        {
            private readonly PartModule module;

            public ProtoModuleDecoupler(PartModule module)
            {
                this.module = module;

                if (this.module is ModuleDecouple)
                {
                    SetModuleDecouple();
                }
                else if (this.module is ModuleAnchoredDecoupler)
                {
                    SetModuleAnchoredDecoupler();
                }
            }

            public double EjectionForce { get; private set; }
            public bool IsOmniDecoupler { get; private set; }

            private void SetModuleAnchoredDecoupler()
            {
                ModuleAnchoredDecoupler decoupler = module as ModuleAnchoredDecoupler;
                if (decoupler == null)
                {
                    return;
                }

                EjectionForce = decoupler.ejectionForce;
            }

            private void SetModuleDecouple()
            {
                ModuleDecouple decoupler = module as ModuleDecouple;
                if (decoupler == null)
                {
                    return;
                }

                EjectionForce = decoupler.ejectionForce;
                IsOmniDecoupler = decoupler.isOmniDecoupler;
            }
        }

        public class ProtoModuleEngine
        {
            private readonly PartModule module;

            public ProtoModuleEngine(PartModule module)
            {
                this.module = module;

                if (module is ModuleEngines)
                {
                    SetModuleEngines();
                }
            }

            public double MaximumThrust { get; private set; }
            public double MinimumThrust { get; private set; }
            public List<Propellant> Propellants { get; private set; }

            public float GetSpecificImpulse(float atmosphere)
            {
                if (module is ModuleEngines)
                {
                    return (module as ModuleEngines).atmosphereCurve.Evaluate(atmosphere);
                }
                return 0.0f;
            }

            private void SetModuleEngines()
            {
                ModuleEngines engine = module as ModuleEngines;
                if (engine == null)
                {
                    return;
                }

                MaximumThrust = engine.maxThrust * (engine.thrustPercentage * 0.01);
                MinimumThrust = engine.minThrust;
                Propellants = engine.propellants;
            }

            private void SetModuleEnginesFx()
            {
                ModuleEnginesFX engine = module as ModuleEnginesFX;
                if (engine == null)
                {
                    return;
                }

                MaximumThrust = engine.maxThrust * (engine.thrustPercentage * 0.01);
                MinimumThrust = engine.minThrust;
                Propellants = engine.propellants;
            }
        }
    }
}


See www.diariobitcoin.com for complete listings from this source.
Browse www.longhash.com for more from this source.
Check out micky.com.au for complete listings from this source.
You may want to visit taklimakan.network for more from this source.
Have a look at bitcoinist.com for complete listings from this source.
See ambcrypto.com for more similar content.
Browse cryptostar.money for complete listings from this source.
You may want to visit ambcrypto.com to find more similar content.
April 15, 2019 6:06 PM Cointube.cash is a live streaming platform akin to Youtube or Twitch that enables you to live stream your thoughts and experiences and earn Bitcoin Cash in donations without fearing censorship or deplatforming no matter how "controversial" or "politically incorrect" your opinions are. You can earn and spend Bitcoin Cash by receiving donations from your fans and spend it on your favorite streamers and support them. We allow all content as long as it complies with US law and we will never deplatform you for "controversial" or "extreme" opinions. Our platform uses the powerful Red5 streaming solution with load balancers to maximize outreach and offer the smoothest experience.
Browse cointube.cash for more from this source.
April 15, 2019 5:45 PM We?re invested in the long-term health of the crypto ecosystem and are mindful to support cryptocurrencies that are reliable, safe, and convenient. Since January we?ve offered limited support for Bitcoin Cash SV (BSV) and have been closely monitoring activity of the BSV network since the hard fork in November. After careful consideration, we have determined to end all support of BSV within the Blockchain Wallet by May 15, 2019. If you have BSV, we recommend simply swapping it for another crypto in the Blockchain Wallet or sending your tokens to another service. To access your BSV tokens, log into your wallet through any web browser and select the Settings option on the bottom left, then Wallets & Addresses. On mobile? You can log into your Web Wallet by logging into the Blockchain app and clicking 'Log in to Web Wallet' in the side navigation.
See blog.blockchain.com for more similar content.
April 15, 2019 3:28 PM We?re invested in the long-term health of the crypto ecosystem and are mindful to support cryptocurrencies that are reliable, safe, and convenient. Since January we?ve offered limited support for Bitcoin Cash SV (BSV) and have been closely monitoring activity of the BSV network since the hard fork in November. After careful consideration, we have determined to end all support of BSV within the Blockchain Wallet by May 15, 2019. If you have BSV, we recommend simply swapping it for another crypto in the Blockchain Wallet or sending your tokens to another service. To access your BSV tokens, log into your wallet through any web browser and select the Settings option on the bottom left, then Wallets & Addresses. On mobile? You can log into your Web Wallet by logging into the Blockchain app and clicking 'Log in to Web Wallet' in the side navigation.
April 15, 2019 3:05 PM Gemini, the US bitcoin exchange headqaurtered in New York, confirmed today that it has introduced support for Segregated Witness (SegWit) addresses and transaction batching. Current clients and customers have already noticed SegWit addresses ? which begin with bc1 ? can now be used for bitcoin deposits and withdrawals. Both of these improvements required end-to-end integration through Gemini?s online and offline signing systems. Updates to Gemini?s wallet infrastructure that handles bitcoin transactions was performed last month. The upgrades deliver major improvements to customers. This launch of the new wallet infrstructure was the conclusion of a year-long effort to support new cryptocurrencies, improve customer experience, and adopt best practices for network usage.
Visit www.cryptoninjas.net for more similar content.
April 15, 2019 2:17 PM Visit Twitter for Tweet content.
April 15, 2019 1:58 PM Visit Twitter for Tweet content.


text:
Nucleus Life calls itself the "Anywhere Intercom" and from the web site and some information supplied by the company, it looks impressive. The tablet also looks to be the first product made by a third party that includes the Amazon Alexa voice control language.
Aimed to be almost an almost no effort, single touch communications and information retrieval device that works room to room, it actually works "room to any room" anywhere, as a room can be down the street, across town, the country or even around the world. Nucleus life reminds me of the Jetson's videophone or a desktop version of the Dick Tracy wristwatch as it allows simple and easy communications with a lot of other functionality that's as simple as a touch of a button.
What's more, apps for iOS and Android devices exist to. This means simple and easy direct to home communications to any "room's" Nucleus Life tablet. With a technical potential limit of 128 Nucleus devices connected, the company told me that Nucleus is designed to accommodate 20 comfortably.
The Nucleus uses Alexa, Amazon's cloud-based voice service, to play music, get the news & weather, control smart devices and more. It also connects Amazon Prime Music, iHeartRadio and TuneIn via Alexa, and with Alexa it can control dozens of compatible smart home products through the Alexa app. Currently though, Nucleus does not support Spotify, Pandora (because of licensing issues), nor does it manage the Belkin WeMo and Philips Hue but since it supports Alexa, and Alexa supports IFTTT the latter two can likely be worked around.
The Nucleus requires that it's connected to the Internet either via Wi-Fi or an Ethernet cable. You can even connect to the 'net using a mobile device that's become a personal hotspot as long as it's producing a strong signal. This means families partially on vacation, a working parent on the road, or with kids away at camp can stay connected the same way they are used to talking at home.
While I have not yet had the opportunity to test the Nucleus, I am impressed with the concept, simplicity, approach and it's capabilities. Given I had this same feeling about the Echo, and became a first round beta tester, I'm as excited at what the Nucleus Life can be.


... the complete lack of multi-monitor support in the Modern UI!
Simply put, there can only be one full-screen Modern UI app displayed at a time. So if I open, say, Mail on one screen and attempt to open Maps on another screen, the screen showing Mail will go back to the desktop. To make matters worse, the Start Screen counts as a Modern UI app in this regard. If I have Mail open on one screen and try to open the Start Screen on another screen to launch an application, the screen showing Mail goes back to the desktop and I have to alt+tab back to it. Talk about a disruption in my workflow!
Did I mention my main desktop is triple-head? It comes in handy for coding. All of the Windows 8 reviews I read talk about the pros and cons of the new Modern UI, but I rarely see any reference to the complete lack of multi-monitor support in it. I'm not sure if this is just a feature oversight, or a more fundamental limitation in the model used for WinRT apps. Is there a fundamental technical limitation in the operating system that prevents multiple Modern UI apps to be visible at the same time? If the Modern UI is the future, I sure hope they get this fixed ASAP! For now, it's easy enough to just avoid Modern UI apps altogether, but what happens in the future when I find an app I want to keep open on one of my screens?
Perhaps more disturbing, this is becoming a trend in mainstream operating systems. While Windows 8 has this limitation for Modern UI apps, full-screen apps in Mac OS X are not really any better. If I full-screen an application in a multi-monitor configuration, I get that app on one monitor and a pretty background on all others. I would much rather have the ability to put multiple apps in full-screen mode side-by-side, or perhaps have the option to have a full-screen app next to a desktop workspace on another monitor. At least I can have multiple workspaces, though.
Unfortunately, this does not seem to work for defaultproperties blocks. If you place the brace on the same line, the compiler will not give you any warnings or errors, but the entire defaultproperties block is just ignored!
I was banging my head on the wall for at least an hour figuring this one out!
I hope this can help prevent someone else from repeating my mistake.
I've converted my old Space Hogs game project to XNA 4.0 (it was originally written in XNA 1.0). There were enough API changes to make it a pain, but I think I have everything working now.
This game was developed by myself, Jason Kim, Joseph Ahn, Vjekoslav Kovacevic, and Daniel Guinn for a computer animation class during Winter Quarter 2007.
You can find a zip file here. This requires XNA 4.0 and the February 2010 DX packages to be installed on your machine. For convenience, I've included both of the redistributable packages in the zip file.
The source can be found on BitBucket.
When it comes to GUI frameworks for C++, it's very hard to beat Qt. It's modular, easy to use, and available on practically any desktop system (and even a few mobile systems). The MOC'ing can get a bit annoying, but IDE and command-line support is very mature at this point. However, only OpenGL is supported currently for real-time 3D rendering. If you want to render to a Qt widget from a Direct3D 11 device, you end up having to do a lot of setup yourself.
Unfortunately, there is not a lot of information out on the internet about setting up Direct3D to play nice with Qt. Most of the information is either out-dated, or only applies to Direct3D 9. Lately, I've been playing around with this and I want to share my method for combining Direct3D 11 and Qt.
First, we tell Qt that we do not want it to do any draw buffering for us. Second, we require a native window handle for our widget. Otherwise, Qt may re-use the same native handle for multiple widgets and cause problems for our Direct3D rendering. You may have also noticed the createDevice() method call; this will be explained in a bit.
Here, render() is just some arbitrary method that uses the Direct3D 11 device to render something to the primary swap chain.
We start by releasing all of the buffers we had allocated (vertex buffers, index buffers, shaders, textures, etc.). We then issue a resize request to the swap chain, resize our rendering viewport, and then recreate all of our needed buffers. In this snippet, releaseBuffers() will call Release() on all buffers, and createBuffers() will create all of the needed resources (again).
It would probably be easier to just allow the swap chain to grow and just adjust the viewport if the widget shrinks, but this method shows how to keep the swap chain the exact same size as the widget.
At this point, you should have a functional Direct3D 11 rendering context for a Qt widget. For brevity, I have omitted most of the Direct3D initialization code (this can be found in many places on the web).
If you want to check out the complete sample program, it is located on my BitBucket account. To build it, you need a relatively recent Qt release, the DirectX SDK, and the Qt Visual Studio Add-in.
Built using Pelican, a custom theme based on relapse, and Bootstrap.


text:
What is the closest and best Windows programming language to use that is closest to iPhone development?
I am interested in learning how to program for the iPhone. What would be the Windows language that most closely resembles the iPhone programming language. I would like to write for both Windows machines and iPhones without having to re-learn an entire programming language.
Categorized as iPhone Development Tagged best, closest, Development, iPhone, language, Programming, Windows
pditty3333 says:
You can download the iPhone SDK from Apple. That will allow you to program for iPhone.
I'm not much of a programmer, so I can't say what is closest, but once you know one language, a lot of it will translate to any other language… just a matter of learning the syntax.
llaffer says:
There really ins't anything that will let you do both.
iPhone app programing uses a specialized version of C nicknamed CoCo, which is similar to C++ in that it's an object oriented language, but it's a different off-shoot of C, so C++ rules doens't always apply.
It's used a lot in Mac programming, but not as much in Widnows.
C will be the closest for most of your logic to be shared between the two, but there's enough difference between coding the UI ends to both OSs that they really cannot be shared.
Oracle 11g database creation
Microsoft Office Home and Student 2007


This se rvice is incorporated into every transaction we do, although ongoing investment counseling provides regular evaluation of an investor's portfolio. Part of the counseling scope includes personal estate building and acting as a buyer's agent for commercial property.
It is no secret the world is dynamic. Lifestyles evolve over the years as children grow up and careers mature. Meken Equity Management evaluates a client's portfolio against his or her changing lifestyle to determine whether the investment is maximizing net worth and meeting the client's goals.


It has been a long, long time since I have posted anything here.
After an injury in April 2015, surgery, and a break from photography in general, I find myself at the precipice of what to do in the future.
So I am currently downsizing and have gear for sale.
If you are interested in any of it, you can reach me here, email rvh34@hotmail.com, or text: 203-540-8821.
All prices are negotiable, shipping is extra.
36×48 Super Soft White Interior Softbox with Bowens Quick Ring speeding for Bowens. A new speedring insert for your light: Alien Bee, Profoto, Elinchrom, etc., is available for about $20 online.
My wife would kill me if I brought home any more lighting equipment, but I wanted to reply to wish you well. I learned a great deal from your sessions at B&H. You are a fine teacher, and I miss attending your classes.


EFS Facilities Services is now recognised as one of the leading facilities management service providers in the Middle East and is capable of designing and delivering large scale total FM solutions to clients across the region. The firm indirectly manages over 8,000 staff and prides itself on having a comprehensive local knowledge, enabling it to provide a tailored solution that considers the cultural and economic sensitivities of each region it serves.
EFS aims to be the established supplier of choice within the region, and so is always looking at ways of enhancing service delivery. EFS recently became a BICSc Accredited Training Organisation (ATO), and here, the company tells us why it made the decision to become accredited.
We believe in providing quality services to our clients and benchmarking EFS standards against the best in the world, and so becoming a BICSc ATO was a natural progression as we grow and increase our presence in the Integrated Facilities Management market.
How did you find the ATO Setup Process?
The ATO Set-up Process was clearly defined, and we were given support from BICSc whenever clarifications were required. It was straight forward, and we didn't have any issues setting it up.
Some of our Fortune 500 clients and government agencies are specifically demanding BICSc based cleaning and hygiene standards. With the help of this accreditation, we will standardise our cleaning and sustainability processes to enhance service delivery in our contracts. We will now have evidence that our cleaning operatives train to an internationally accredited standard, and this is vital for our company as we move forward.
The staff have told us they appreciate the standardisation of cleaning processes. The focus on health and safety in the cleaning processes has also been acknowledged by them.
With some high-profile clients now demanding BICSc accreditation, EFS Facilities Services took the decision to become an ATO and have not looked back.
If you want to find out more about becoming a BICSc Accredited Training Organisation (ATO), please contact BBS at +44 (0) 1604 678 712 or email via [email protected].


It's easy to think of stock as just another recipe. "Add this, this, and this to the pot, simmer for this long and you're done." And it's certainly possible to prepare a decent stock using this approach.
But given that stock is the basis for so many dishes, from sauces to soups and stews, it's important to understand the purpose of each ingredient and the properties each one brings to the stock. Some ingredients increase the body of the stock, while others help to clarify it. Some additions create more intense flavor, others add color.
Stocks are divided into two categories: White stocks are used as the base for velouté sauce and various derivative sauces like allemande and suprême sauces. Brown stocks are used for making demi-glace and its derivatives, such as bordelaise and sauce Robert.
Note that beef or veal bones can be used for either white or brown stocks: When making white stock, the bones are blanched first, or quickly boiled, then drained and rinsed, before simmering.
For brown stock, the bones are roasted before simmering, and some sort of tomato product is usually added. The roasting and tomato product give the brown stock its darker color.
Bones contain collagen, which when simmered forms gelatin. The more gelatin there is in the stock, the more body it will have. When chilled, a good stock should actually solidify.
Certain proteins, most notably albumin, will only dissolve in cold water—and albumin helps clarify a stock. Therefore, starting a stock with cold water helps release the albumin, producing a clearer stock.
Because much of the process of making stock comes down to removing impurities, it is best to use filtered water whenever possible. If you don't have a home water filtration system, an activated charcoal pitcher is fine.
Tomato: Brown stocks use some sort of tomato product, usually tomato paste, which also adds color and flavor to the stock.
Wine: White stock and chicken stock sometimes use white wine, and fish stock almost always does.
One thing to remember is that acid reacts with aluminum cookware, so use a stainless steel stockpot for making stock.
Sachet d'epices: A small cheesecloth sack of dried and fresh herbs and spices.
Bouquet garni: A bundle of herbs and aromatics tied with cooking twine.
Both the sachet and the bouquet garni are tied to a length of cooking twine and added to the stockpot to simmer; the other end of the twine can be tied to the handle of the stockpot, making the sachet or bouquet garni easy to retrieve.
Because stock is often further reduced — like when making demi-glace, for instance — salting the stock would make the resulting demi-glace much too salty. It's better to make a habit of seasoning your sauces just before serving rather than salting your stock.
Plastic zip-top bags: Fill the bags and lay them flat so you can stack them and save space in the freezer. These bags are also handy for labeling.
Wide-mouthed glass jars or containers: Glass eliminates the worry about toxins in plastic, and you can thaw the stock right in the glass jar, loosely covered, in the microwave.
Ice cube trays: These are useful when you need just a small portion of stock, such as for deglazing.


The Pinnacle Collection offers 3 single-story home designs featuring large great rooms, covered patios, and designer appointments. Ample flex spaces allow for personalization to suit your lifestyle.
The Pinnacle Collection features three single-story home designs ranging from 2,235 sq. ft. to 2,659 sq. ft.
Jason and Dave are beyond excellent- Enrique also very good.
The Toll sales team was absolutely terrific—Shasta, Ernie, Colleen—all fabulous; very friendly and very nice.
Worked with Jason and he is excellent.
Everyone on the construction management team was nice. They kept me well-informed as to the building process progress.


text:
Home CRWWD Plans District Office Expansion
September 9, 2019 October 6, 2019
After more than 20 years at its current location, the Board of Commissioners of Clark Regional Wastewater District (District) is preparing to expand facilities on its campus to house its growing operations for the next 20 years.
After a review of alternatives, the District Board has supported a plan to invest more than $13 Million to expand and improve its operations center. Once complete, in 2022, the improvements will provide the District with the facilities necessary to continue to meet the increasing demand for District services and improve the resiliency of District operations. "The demand for District services has and will continue to grow. Every new customer represents more wastewater and more pipes and pumps that must be managed. Re-investing in the current campus is the most cost-effective solution for the near term, which supports the District's mission to provide the community with affordable and reliable service," said Norm Harker, Board President.
The District currently provides service to more than 125,000 people, protecting public and environmental health by safely collecting, conveying and treating approximately eight to twelve million gallons per day of wastewater. Its customer base has doubled in size over the last 20 years and, based on future growth estimates, is expected to double again over the next 20 years. Although much of the growth will occur to the north of its current location, along the I-5 corridor near the Fairgrounds and in Ridgefield, the potential capital cost savings associated with investing in the current location outweighed the operating cost savings that could have been gained from relocating to a more central location. The proposed improvements will provide adequate space for vehicles, equipment, staff and materials and it will improve the resiliency of District operations. The main feature of the plan is to construct a new building for the field operations team. Existing structures will also be remodeled and updated. A copy of the proposed plans can be viewed online at www.crwwd.com/projects/campus.html.
"Reinvesting in the current location will allow the District to maximize the value of the ratepayers' original investment and use the existing facilities throughout the remainder of their useful life," said Harker. The planned improvements on the District campus are scheduled to be constructed over the next three years. The project will be funded from a mix of connection charge revenue, which is collected from new development, and rate revenue, paid by customers in their monthly sewer bills. The campus improvements have been factored into the District's long-range financial plan and the rate and charge structures already adopted by the Board.
For more information, contact Shawn Moore, Assistant Manager/Business Services Manager, at (360) 993-8849 or smoore@crwwd.com
September 2019 HDSCBA NewsletterNow in its Second Generation, Hampton Auto Glass Celebrates 30 Years


The following settings are available in the IGES Export Options dialog that appears when OPTIONS is selected from the File Save window.
Author - Enter the author's name to list in the start and global section of the resulting IGES file.
Organization - Enter the company's name to list in the start and global section of the resulting IGES file.
Contract Number - Displays the contract number listed in the start section of the IGES file. To enter a contract number, click the check box and type the number in the field.
IGES Surfaces (Choose IGES Type 144 or IGES Type 143 see below)- This option is recommended for compatibility with all IGES translators. Solids and sheet bodies are exploded into surfaces and the topology information is lost. The individual surfaces themselves may either be exported as IGES Type 144 Parametric Trimmed Surfaces or IGES Type 143 Bounded Surface Entities.
Use this option when the receiving application requires surfaces to be B-spline surface definitions.
When checked these edge curves will convert to type 126, and are actually converted to NURBS splines.
When selected (the default), periodic surfaces are split in two prior to export to IGES. (A periodic surface is a closed surface that joins itself smoothly. For example, a spherical surface is periodic in both the U and V directions. A cylinder is periodic in the U direction.) We recommend selecting this check box for better compatibility when exporting to systems such as Mastercam® and CATIA®. Also, this matches the behavior of the IGES Geometry translator in KeyCreator 4.x.
Clearing this check box ensures that periodic surfaces are not split. This matches the behavior of the IGES geometry translator in KeyCreator 5.x. We recommend clearing this check box for round-trip translations and when exporting files to receiving systems that prefer periodic surfaces.
Use this option when the receiving application does not support solid/sheet body entity types or if simple geometry is requested.
When checked these wireframe entities are converted to parametric splines.
If selected, you are prompted to select the origin for the entities to be exported. If cleared, the default origin (0, 0, 0) is used.
If selected, the entities are transformed so they are relative to the active construction plane.


text:
Why (and How) is There Snow on Mount Everest?
There's always snow on Mount Everest, even though it lies on the border between two countries that are either partly tropical jungle (Nepal) or arid desert (Tibet). Most high mountains, even some on the equator, have snow on their tops. Meanwhile, the plains around them are hot and dry. Why is that?
Mount Everest is covered with snow because it's cold, and it's cold because it's high. Temperature in the Earth's atmosphere falls with altitude and that's called the Lapse Rate. The cloud cover on Everest varies, but there's almost always snow.
If you travel from the Nepali border to the summit of Mount Everest you will go from hot, steamy tropical jungle to snowy arctic wastes. That's due to the temperature difference between the Terai at an altitude of 220 ft (67 m) and the snow-covered summit at 29,031.7 ft ( 8,848.86 m). But where does the snow come from?
How Come There's Snow on Everest?
"Everest is supposed to be above the clouds – and snow comes from the clouds", some might say. But this is wrong, Everest is often shrouded with clouds, particularly during the monsoon season, between spring and fall (autumn). The snowiest day on the mountain is 1 July (source: snowforecast).
During the monsoon summer there is heavy snowfall in the freezing temperatures and if you climb on the mountain afterwards you'll encounter deep, heavy snowdrifts. Everest also experiences high winds often, so snow can (and will) move and drift frequently.
In 2010 Eric Larsen and five Nepali guides summited Everest in this post-monsoon autumn for the first time in ten years, and I summited post-monsoon in 1993. We all encountered heavy snow.
A huge avalanche came down the Lhotse Face in 1993 and swept away our Camp 3 with all its tents, food and oxygen, so I can personally attest that a lot of unstable new snow falls on Everest during that season.
Advanced base camp, North side. With heavy snow.
How Much Snow is Usually on Mount Everest?
Mount Everest is almost entirely covered with snow, except for the vertical rock faces. A Chinese team measured a snow and ice depth of 11 feet (3.5 m) on the summit of Everest, which is in line with the net elevation of 8,848 m (29,029 ft).
Is There Always Snow on Everest? Is it Year-Round?
There is always snow on Mount Everest. Down at Base Camp on the north, Tibetan side snow will fall on poor weather days but swiftly melts away in the sun. At Base Camp on the more popular Nepali side the tents are pitched on the ice, and the snow tends to last longer.
How Old Is Everest's Snow? Does it Ever Melt?
Everest is around 60 million years old (source: Scholastic). But the snow is being constantly replenished and flows down the slopes to form glaciers. So it is unlikely that there is any snow much older than 100 years. But then water itself is 3.8 billion years old…
Everest Base Camp, South side.
What Would Mt Everest be Like Without Snow?
If Mount Everest had no snow it would be far safer to climb. The most common way of being killed is by being hit by avalanche or falling ice (see Top 10 Ways People Die on Everest (The Dangers). The second is by falling, which is often caused by slipping on snow or ice.
The standard route would become a fairly straightforward rocky mountain scramble, but a lack of snow would also open up the largely unclimbed Kangshung, or East Face of Everest, which with constant avalanches is considered too dangerous to attempt – for now.
It would still get colder as you climbed higher, even if there were no snow. The rate of temperature decrease with altitude increase is 9.8 °C/km (5.4 °F per 1,000 ft) (source: Wikipedia). Climbers find it useful to allow for a 3.0 °C drop in temperature for every 1,000 ft they climb.
George Mallory wrote in his diary about the snow-covered Kangshung Face "Other men, less wise, might attempt this way if they would, but, emphatically, it was not for us." (source: Wikipedia).
Without snow on it he could he might have climbed Everest more easily and returned alive (see Where is George Mallory Buried? His Body's Location on Everest).
Categories Facts and Stats, History and Geography Post navigation
How Many Sherpas Have Climbed Mount Everest?
Everest is truly a mountain of extremes. Not only does it get very cold, it gets really hot,…
Before Everest, What Was the Highest Mountain?
Before Mount Everest was "discovered", there were many mountains in the past presumed to be the highest in…
Has a Dog Really Climbed Everest? First Dog Records
In 2013 news headlines barked "Meet Rupee, the First Dog to ever Climb Mt. Everest!", "Rescue dog climbs…


Another festival has come and gone, and here I am experiencing severe withdrawals. Happens every. single. time. I am so, so extremely grateful to LuLu*s for giving me and my partner in crime, Kathleen, the opportunity to cover Outside Lands and do a weekend takeover of their IG. You know I love my Instagram, so it was awesome to be able to share that passion with another community of fashion lovers! It was even more awesome to have so many cutie pie festival-goers find us throughout the weekend and come up to us.


We try to share as much good information about home improvement and related topics as we can. We know that it can be hard to find good quality information on the internet, especially with the sheer volume of things available to you at a single click. You can trust us to provide helpful and accurate information. We hate to see anyone suffer or be frustrated with their home, so we're here to help! House renovations can get expensive VERY quickly, we might be able to help you save a penny or two. For instance, did you know that bathtub refinishing is a fraction of the price of replacement, and will take far less time to complete. Read on, and feel free to read all of our blog posts for any relevant information that can help you.
We can install any type of flooring you may want in your new or existing home! This includes removing or replacing existing flooring. If you're don't want to get rid of your existing flooring, we also offer cleaning and floor refinishing services. When building your dream house, one important factor that you need to consider is your flooring. If you're going to walk on and look at it ever day, you need to be sure that you'll be a fan of your floors. We can not only ensure what you want, but high quality workmanship.
Our team is made up of certified flooring installers, trained and skilled enough to deliver results quickly and with the best results. We can come in before hand for an evaluation, take a look around at your current flooring situation. Our goal is to provide you with the best flooring installation service. Our service includes removal of existing floors, disposal of debris and installation of your new flooring. We can help you enjoy the flooring that you WANT. Read more about our flooring services here.
If you've never been introduced to bathtub refinishing, today is your lucky day. The value is unbeatable! Replacement is not something you want to get into unless you really and truly have to. From chips and cracks, to just hating the color, refinishing can fix it all. Refinishing will cost you WAY less and last you for many years to come! The benefits are so numerous and great, how can you NOT want refinishing? If you want to learn more, read about bathtub refinishing here.
Do you need full service moving? We can get you totally moved in and out of anywhere! All you need to do is provide us with starting dates & times, we can plan out every single other step for you, from packing to transporting – and even moving those super heavy and awkward furniture pieces. Stairs are nothing but a small obstacle to us! We've got strong experienced movers. If it can fit it through the door, it's going to make it onto our truck and to your new dwelling. You can read more about our house moving services here.


text:
The Lee Navigation – Rammey Marsh to Kings Weir
Canalised river Lee Navigation River
The 1835 iron bridge at Rammey Marsh Lock. It was closed recently due to structural faults
Rammey Marsh is the second of two partially mechanised locks on the navigation. The first was that at Enfield. From here to Hertford the locks are entirely manual. As soon as one passes under the M25 above Rammey Marsh, they are at Waltham Abbey. Its not a brilliant stretch of waterway but its likeable, and there is a pub by the main road bridge and useful shops in the nearby town. A visit to the abbey itself is recommended – one must simply see the signs of the zodiac painted so intricately onto the abbey's ceiling, its a wonderful sight. The Royal Gunpowder Mills are a short walk away and it is worth a visit – you may even get to see one of the Armoury's own private canals.
The entrance to Hazlemere Marina. There is a water point and a sanitary station accessible from the towpath. It might be difficult to believe but at one time this location was the intersection of four different waterway routes!
On the opposite side of the Lee Navigation lies the Horsemill Stream relief channel which changed the face of the waterways around here and truncated yet more of the connections between the Lee Navigation and the River Lea. This view looks across the Horsemill Stream to the former Waltham Abbey arm. This arm split into two further branches, one serving the town and the other the Royal Gunpowder Mills. There was a whole host of wharves serving different industries along the River Lea itself as well and there is no trace left. For boaters on the Lee Navigation there is just no way onto the river anymore.
The new River Lea (Horsemill Stream) and Lee Navigation at Waltham Abbey
The Lee Navigation once connected into the actual River Lea for a short distance from a point just above the M25 at Rammey Marsh as far as the Hazlemere marina footbridge. From here one could reach Waltham Abbey along a branch of the River Lea as well as boat upriver towards some wharves to the north of Waltham Bridge. None of this exists at all now. The new replacement flood relief channel for the River Lea replaced the original river channel – the only trace that such an arrangement ever existed is the remains of a weir that can be seen to the south of Hazlemere marina, where the Lee Navigation and the River Lea merged for about a quarter of a mile.
From Tottenham to Kings Weir it is now over eleven miles of solid canal cruising. Originally the canal sections were split into approximately a mile to the south (that is to the brief intersection with the River Lea below Rammey Marsh) and then six & quarter miles thence to Tottenham (this sections on the Rammey Marsh – Tottenham section were shorter still when other connections to the River Lea remained. To the north of Waltham there was three & half miles to Kings Weir. Between the two Waltham locks, there was a connection to the River Lea, known as the Powdermill Cut. It led to a lock that accessed the River Lea. It enabled access to yet a further set of locks leading onto the private canal system within the Royal Gunpowder Mills complex. Powdermill lock was demolished to make way for the new River Lea (Horsemill Stream)
The picture above shows the new River Lea channel by Waltham Bridge. This new channel has cut all the former connections between navigation and river. If any water borne connections were to be restored allowing boats into Waltham itself, the only possibility would be to re-use the original river course from Rammey Marsh (which indeed provided an alternative route to that of the Lee Navigation until the inter-war years) and then along part of the Horsemill Stream in order to attain the original Waltham Abbey cut. Weir levels would have to be altered and several bridges raised so there's certainly no possibility of any restoration of any kind occuring around here. Of the Lea Navigation itself (and Hazlemere Marina bridge) these can be seen on the far right in the picture above.
The two Waltham locks, Town and Common lift the Lee Navigation up to Cheshunt, a useful mooring spot for its close-by railway station and local shops. There are plenty of walks in the area. including ones along the River Lea flood relief channel, and along the remnants of the Powdermill Cut. The picture shows Waltham Town Lock. This is the second lock built here, the original Lee Navigation lock of the 1770's was actually by Hazlemere marina. The old lock dropped straight down into the River Lea itself. The old lock keepers house still stands, whilst part of the lock walls still exist, easily offering identification as to the location of the old lock.
The modern footbridge at Waltham Common
The section between the two Waltham locks has a large flock of geese. This view is of the straight below Waltham Common Lock
By the tail of Waltham Common lock is the entrance to the Powdermill Cut – that once linked to the River Lea (Barge River) and the Gunpowder Mills
Waltham Common lock in the autumn
After the stretch through Cheshunt where good moorings are available, the lock of the same name follows almost immediately, and the River Lea runs close to the lock. Cheshunt lock has some really heavy gates so be prepared for a bit of extra effort here.
A view of the waterway below Aqueduct Lock
The Aqueduct
The Lee Navigation has threaded its way through countryside since Waltham, and it is a little more pleasing to cruise, despite still being predominantly straight with those ugly pylons for company. The next lock is known as Aqueduct. Just above the top of the lock the Lee Navigation crosses what is know as the small River Lea on an aqueduct. Here is a good reminder that the Lee Navigation is a canal, not a river as some would have you believe. It of course continues straight as an arrow, but when one passes the next bridge there is a surprise. This is Kings Weir, where the Lee Navigation and the River Lea are united for a short, but pleasant stretch into Broxbourne. For the last eleven miles both canal and river have been separate, so it makes a great difference to cruise on a real bit of river! In my view once you get past Aqueduct Lock the really nice bits begin – and one's expectations of what the Lee Navigation has to offer improves most considerably.
Kings Weir, near Broxbourne.
NEXT: Kings Weir to Rye House Junction
The Lee Navigation – Kings Weir to Rye House
Previous post:Lee Navigation – the old order at Waltham
Next post:The Lee Navigation – Kings Weir to Rye House