text:
$script:DSCModuleName      = 'xHyper-V'
$script:DSCResourceName    = 'MSFT_xVMDvdDrive'

#region HEADER
# Unit Test Template Version: 1.1.0
[String] $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
$TestEnvironment = Initialize-TestEnvironment `
    -DSCModuleName $script:DSCModuleName `
    -DSCResourceName $script:DSCResourceName `
    -TestType Unit
#endregion HEADER

# Begin Testing
try
{
    #region Pester Tests
    InModuleScope $script:DSCResourceName {
        # Function to create a exception object for testing output exceptions
        function Get-InvalidArgumentError
        {
            [CmdletBinding()]
            param
            (
                [Parameter(Mandatory)]
                [ValidateNotNullOrEmpty()]
                [System.String]
                $ErrorId,

                [Parameter(Mandatory)]
                [ValidateNotNullOrEmpty()]
                [System.String]
                $ErrorMessage
            )

            $exception = New-Object -TypeName System.ArgumentException `
                -ArgumentList $ErrorMessage
            $errorCategory = [System.Management.Automation.ErrorCategory]::InvalidArgument
            $errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord `
                -ArgumentList $exception, $ErrorId, $errorCategory, $null
            return $errorRecord
        } # end function Get-InvalidArgumentError

        #region Pester Test Initialization

        $script:VMName = 'HyperVUnitTestsVM'
        $script:TestISOPath = 'd:\test\test.iso'

        $script:splatGetDvdDrive = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Verbose            = $True
        }
        $script:splatAddDvdDriveNoPath = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Path               = ''
            Ensure             = 'Present'
            Verbose            = $True
        }
        $script:splatAddDvdDrive = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Path               = $script:TestISOPath
            Ensure             = 'Present'
            Verbose            = $True
        }
        $script:splatRemoveDvdDrive = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Ensure             = 'Absent'
            Verbose            = $True
        }
        $script:mockGetModule = [pscustomobject] @{
            Name               = 'Hyper-V'
        }
        $script:mockGetVM = [pscustomobject] @{
            Name               = $VMName
        }
        $script:mockGetVMScsiController = [pscustomobject] @{
            VMName             = $VMName
        }
        $script:mockGetVMHardDiskDrive = [pscustomobject] @{
            VMName             = $VMName
        }
        $script:mockNoDvdDrive = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Ensure             = 'Absent'
        }
        $script:mockDvdDriveWithPath = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Path               = $script:TestISOPath
            Ensure             = 'Present'
        }
        $script:mockDvdDriveWithDiffPath = @{
            VMName             = $script:VMName
            ControllerNumber   = 0
            ControllerLocation = 1
            Path               = 'd:\diff\diff.iso'
            Ensure             = 'Present'
        }
        #endregion

        #region Function Get-TargetResource
        Describe 'MSFT_xVMDvdDrive\Get-TargetResource' {
            #region VM Functions
            function Get-VM {
                Param
                (
                    [String]
                    $Name
                )
            }

            function Get-VMScsiController {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber
                )
            }

            function Get-VMIdeController {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber
                )
            }

            function Get-VMHardDiskDrive {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber,

                    [Uint32]
                    $ControllerLocation
                )
            }

            function Get-VMDvdDrive {
                Param
                (
                    [String]
                    $VMName
                )
            }
            #endregion

            Context 'DVD Drive does not exist' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Test-ParameterValid `
                    -Verifiable

                Mock `
                    -CommandName Get-VMDvdDrive `
                    -MockWith {} `
                    -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName } `
                    -Verifiable

                It 'should not throw exception' {
                    {
                        $script:resource = Get-TargetResource @script:splatGetDvdDrive
                    } | Should Not Throw
                }

                It 'should return expected values' {
                    $script:resource.VMName             | Should Be $script:splatGetDvdDrive.VMName
                    $script:resource.ControllerNumber   | Should Be $script:splatGetDvdDrive.ControllerNumber
                    $script:resource.ControllerLocation | Should Be $script:splatGetDvdDrive.ControllerLocation
                    $script:resource.Path               | Should BeNullOrEmpty
                    $script:resource.Ensure             | Should Be 'Absent'
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Test-ParameterValid -Exactly 1
                    Assert-MockCalled -CommandName Get-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName }
                }
            }

            Context 'DVD Drive exists, but has empty path' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Test-ParameterValid `
                    -Verifiable

                Mock `
                    -CommandName Get-VMDvdDrive `
                    -MockWith { $script:splatAddDvdDriveNoPath } `
                    -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName } `
                    -Verifiable

                It 'should not throw exception' {
                    {
                        $script:resource = Get-TargetResource @script:splatGetDvdDrive
                    } | Should Not Throw
                }

                It 'should return expected values' {
                    $script:resource.VMName             | Should Be $script:splatGetDvdDrive.VMName
                    $script:resource.ControllerNumber   | Should Be $script:splatGetDvdDrive.ControllerNumber
                    $script:resource.ControllerLocation | Should Be $script:splatGetDvdDrive.ControllerLocation
                    $script:resource.Path               | Should BeNullOrEmpty
                    $script:resource.Ensure             | Should Be 'Present'
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Test-ParameterValid -Exactly 1
                    Assert-MockCalled -CommandName Get-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName }
                }
            }

            Context 'DVD Drive exists, and has a test ISO path' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Test-ParameterValid `
                    -Verifiable

                Mock `
                    -CommandName Get-VMDvdDrive `
                    -MockWith { $script:splatAddDvdDrive } `
                    -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName } `
                    -Verifiable

                It 'should not throw exception' {
                    {
                        $script:resource = Get-TargetResource @script:splatGetDvdDrive
                    } | Should Not Throw
                }

                It 'should return expected values' {
                    $script:resource.VMName             | Should Be $script:splatGetDvdDrive.VMName
                    $script:resource.ControllerNumber   | Should Be $script:splatGetDvdDrive.ControllerNumber
                    $script:resource.ControllerLocation | Should Be $script:splatGetDvdDrive.ControllerLocation
                    $script:resource.Path               | Should Be $script:TestISOPath
                    $script:resource.Ensure             | Should Be 'Present'
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Test-ParameterValid -Exactly 1
                    Assert-MockCalled -CommandName Get-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatGetDvdDrive.VMName }
                }
            }
        }
        #endregion

        #region Function Set-TargetResource
        Describe 'MSFT_xVMDvdDrive\Set-TargetResource' {
            #region VM Functions
            function Add-VMDvdDrive {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber,

                    [Uint32]
                    $ControllerLocation,

                    [String]
                    $Path
                )
            }

            function Set-VMDvdDrive {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber,

                    [Uint32]
                    $ControllerLocation,

                    [String]
                    $Path
                )
            }

            function Remove-VMDvdDrive {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber,

                    [Uint32]
                    $ControllerLocation
                )
            }
            #endregion

            Context 'DVD Drive does not exist but should' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockNoDvdDrive } `
                    -Verifiable

                Mock `
                    -CommandName Add-VMDvdDrive `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Set-VMDvdDrive
                Mock -CommandName Remove-VMDvdDrive

                It 'should not throw exception' {
                    { Set-TargetResource @script:splatAddDvdDriveNoPath } | Should Not Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                    Assert-MockCalled -CommandName Add-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                    Assert-MockCalled -CommandName Set-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Remove-VMDvdDrive -Exactly 0
                }
            }

            Context 'DVD Drive does exist and should, path matches' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithPath } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Add-VMDvdDrive
                Mock -CommandName Set-VMDvdDrive
                Mock -CommandName Remove-VMDvdDrive

                It 'should not throw exception' {
                    { Set-TargetResource @script:splatAddDvdDrive } | Should Not Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                    Assert-MockCalled -CommandName Add-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Set-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Remove-VMDvdDrive -Exactly 0
                }
            }

            Context 'DVD Drive does exist and should, path does not match' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithDiffPath } `
                    -Verifiable

                Mock `
                    -CommandName Set-VMDvdDrive `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Add-VMDvdDrive
                Mock -CommandName Remove-VMDvdDrive

                It 'should not throw exception' {
                    { Set-TargetResource @script:splatAddDvdDrive } | Should Not Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                    Assert-MockCalled -CommandName Add-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Set-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Remove-VMDvdDrive -Exactly 0
                }
            }

            Context 'DVD Drive exists and should not' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithPath } `
                    -Verifiable

                Mock `
                    -CommandName Remove-VMDvdDrive `
                    -ParameterFilter { $VMName -eq $script:splatRemoveDvdDrive.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Add-VMDvdDrive
                Mock -CommandName Set-VMDvdDrive

                It 'should not throw exception' {
                    { Set-TargetResource @script:splatRemoveDvdDrive } | Should Not Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                    Assert-MockCalled -CommandName Add-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Set-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Remove-VMDvdDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatRemoveDvdDrive.VMName }
                }
            }

            Context 'DVD Drive does not exist and should not' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockNoDvdDrive } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Add-VMDvdDrive
                Mock -CommandName Set-VMDvdDrive
                Mock -CommandName Remove-VMDvdDrive

                It 'should not throw exception' {
                    { Set-TargetResource @script:splatRemoveDvdDrive } | Should Not Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                    Assert-MockCalled -CommandName Add-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Set-VMDvdDrive -Exactly 0
                    Assert-MockCalled -CommandName Remove-VMDvdDrive -Exactly 0
                }
            }
        }
        #endregion

        #region Function Test-TargetResource
        Describe 'MSFT_xVMDvdDrive\Test-TargetResource' {
            Context 'DVD Drive does not exist but should' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockNoDvdDrive } `
                    -Verifiable

                It 'should return false' {
                    Test-TargetResource @script:splatAddDvdDriveNoPath | Should Be $False
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                }
            }

            Context 'DVD Drive does exist and should, path matches' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithPath } `
                    -Verifiable

                It 'should return true' {
                    Test-TargetResource @script:splatAddDvdDrive | Should Be $True
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                }
            }

            Context 'DVD Drive does exist and should, path does not match' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithDiffPath } `
                    -Verifiable

                It 'should return false' {
                    Test-TargetResource @script:splatAddDvdDrive | Should Be $False
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                }
            }

            Context 'DVD Drive exists and should not' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockDvdDriveWithPath } `
                    -Verifiable

                It 'should return false' {
                    Test-TargetResource @script:splatRemoveDvdDrive | Should Be $False
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                }
            }

            Context 'DVD Drive does not exist and should not' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-TargetResource `
                    -MockWith { $script:mockNoDvdDrive } `
                    -Verifiable

                It 'should return true' {
                    Test-TargetResource @script:splatRemoveDvdDrive | Should Be $True
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-TargetResource -Exactly 1
                }
            }
        }
        #endregion

        #region Function Test-ParameterValid
        Describe 'MSFT_xVMDvdDrive\Test-ParameterValid' {
            #region VM Functions
            function Get-VM {
                Param
                (
                    [String]
                    $Name
                )
            }

            function Get-VMScsiController {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber
                )
            }

            function Get-VMIdeController {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber
                )
            }

            function Get-VMHardDiskDrive {
                Param
                (
                    [String]
                    $VMName,

                    [Uint32]
                    $ControllerNumber,

                    [Uint32]
                    $ControllerLocation
                )
            }

            function Get-VMDvdDrive {
                Param
                (
                    [String]
                    $VMName
                )
            }
            #endregion

            Context 'Hyper-V Module is not available' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VM
                Mock -CommandName Get-VMScsiController
                Mock -CommandName Get-VMIdeController
                Mock -CommandName Get-VMHardDiskDrive

                It 'should throw exception' {
                    $errorRecord = Get-InvalidArgumentError `
                        -ErrorId 'RoleMissingError' `
                        -ErrorMessage ($LocalizedData.RoleMissingError -f `
                            'Hyper-V')

                    { Test-ParameterValid @script:splatAddDvdDriveNoPath } | Should Throw $errorRecord
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                }
            }

            Context 'VM does not exist' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -MockWith { $script:mockGetModule } `
                    -Verifiable

                Mock `
                    -CommandName Get-VM `
                    -MockWith { Throw } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VMScsiController
                Mock -CommandName Get-VMIdeController
                Mock -CommandName Get-VMHardDiskDrive

                It 'should throw exception' {
                    { Test-ParameterValid @script:splatAddDvdDriveNoPath } | Should Throw
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                    Assert-MockCalled -CommandName Get-VM -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                }
            }

            Context 'VM exists, controller does not exist' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -MockWith { $script:mockGetModule } `
                    -Verifiable

                Mock `
                    -CommandName Get-VM `
                    -MockWith { $script:mockGetVM } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMScsiController `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMIdeController `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VMHardDiskDrive

                It 'should throw exception' {
                    $errorRecord = Get-InvalidArgumentError `
                        -ErrorId 'VMControllerDoesNotExistError' `
                        -ErrorMessage ($LocalizedData.VMControllerDoesNotExistError -f `
                            $script:VMName,0)

                    { Test-ParameterValid @script:splatAddDvdDriveNoPath } | Should Throw $errorRecord
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                    Assert-MockCalled -CommandName Get-VM -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                    Assert-MockCalled -CommandName Get-VMScsiController -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                    Assert-MockCalled -CommandName Get-VMIdeController -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                }
            }

            Context 'VM exists, SCSI contrller exists, HD assigned' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -MockWith { $script:mockGetModule } `
                    -Verifiable

                Mock `
                    -CommandName Get-VM `
                    -MockWith { $script:mockGetVM } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMScsiController `
                    -MockWith { $script:mockGetVMScsiController } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMHardDiskDrive `
                    -MockWith { $script:mockGetVMHardDiskDrive } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VMIdeController

                It 'should throw exception' {
                    $errorRecord = Get-InvalidArgumentError `
                        -ErrorId 'ControllerConflictError' `
                        -ErrorMessage ($LocalizedData.ControllerConflictError -f `
                            $script:VMName,0,1)

                    { Test-ParameterValid @script:splatAddDvdDriveNoPath } | Should Throw $errorRecord
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                    Assert-MockCalled -CommandName Get-VM -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                    Assert-MockCalled -CommandName Get-VMScsiController -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                    Assert-MockCalled -CommandName Get-VMHardDiskDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDriveNoPath.VMName }
                }
            }

            Context 'VM exists, SCSI contrller exists, HD not assigned, Path invalid' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -MockWith { $script:mockGetModule } `
                    -Verifiable

                Mock `
                    -CommandName Get-VM `
                    -MockWith { $script:mockGetVM } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMScsiController `
                    -MockWith { $script:mockGetVMScsiController } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMHardDiskDrive `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Test-Path `
                    -MockWith { $False } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VMIdeController

                It 'should throw exception' {
                    $errorRecord = Get-InvalidArgumentError `
                        -ErrorId 'PathDoesNotExistError' `
                        -ErrorMessage ($LocalizedData.PathDoesNotExistError -f `
                            $script:TestISOPath)

                    { Test-ParameterValid @script:splatAddDvdDrive } | Should Throw $errorRecord
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                    Assert-MockCalled -CommandName Get-VM -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Get-VMScsiController -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Get-VMHardDiskDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Test-Path -Exactly 1
                }
            }

            Context 'VM exists, SCSI contrller exists, HD not assigned, Path Valid' {
                # Verifiable (should be called) mocks
                Mock `
                    -CommandName Get-Module `
                    -MockWith { $script:mockGetModule } `
                    -Verifiable

                Mock `
                    -CommandName Get-VM `
                    -MockWith { $script:mockGetVM } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMScsiController `
                    -MockWith { $script:mockGetVMScsiController } `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Get-VMHardDiskDrive `
                    -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName } `
                    -Verifiable

                Mock `
                    -CommandName Test-Path `
                    -MockWith { $True } `
                    -Verifiable

                # Mocks that should not be called
                Mock -CommandName Get-VMIdeController

                It 'should not throw exception' {
                    Test-ParameterValid @script:splatAddDvdDrive | Should Be $True
                }

                It 'all the get mocks should be called' {
                    Assert-VerifiableMocks
                    Assert-MockCalled -CommandName Get-Module -Exactly 1
                    Assert-MockCalled -CommandName Get-VM -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Get-VMScsiController -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Get-VMHardDiskDrive -Exactly 1 `
                        -ParameterFilter { $VMName -eq $script:splatAddDvdDrive.VMName }
                    Assert-MockCalled -CommandName Test-Path -Exactly 1
                }
            }
        }
        #endregion
    }
}
finally
{
    #region FOOTER
    Restore-TestEnvironment -TestEnvironment $TestEnvironment
    #endregion
}


text:
using Microsoft.EntityFrameworkCore.Migrations;

namespace Sandbox_EFCore5Net5_Test.Migrations
{
    public partial class Initial : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.EnsureSchema(
                name: "dbo");

            migrationBuilder.CreateTable(
                name: "Entity1",
                schema: "dbo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Entity1", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Entity2",
                schema: "dbo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Property1 = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Entity1Id = table.Column<long>(type: "bigint", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Entity2", x => x.Id);
                    table.ForeignKey(
                        name: "FK_Entity2_Entity1_Entity1Id",
                        column: x => x.Entity1Id,
                        principalSchema: "dbo",
                        principalTable: "Entity1",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_Entity2_Entity1Id",
                schema: "dbo",
                table: "Entity2",
                column: "Entity1Id");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Entity2",
                schema: "dbo");

            migrationBuilder.DropTable(
                name: "Entity1",
                schema: "dbo");
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
#import "NSObject.h"

@class NSMutableDictionary;

@interface TIKeyboardLayoutFactory : NSObject
{
    void *_layoutsLibraryHandle;
    NSMutableDictionary *_internalCache;
}

+ (id)layoutsFileName;
+ (id)sharedKeyboardFactory;
@property(retain) NSMutableDictionary *internalCache; // @synthesize internalCache=_internalCache;
@property(readonly, nonatomic) void *layoutsLibraryHandle; // @synthesize layoutsLibraryHandle=_layoutsLibraryHandle;
- (id)keyboardWithName:(id)arg1 inCache:(id)arg2;
- (id)init;
- (void)dealloc;

@end


text:
package com.playfab;

import java.util.HashMap;
import java.util.Date;

public class GetUserStatisticsResult
{

	/// <summary>
	/// user statistics for the active title
	/// </summary>

	public HashMap<String,Integer> UserStatistics;
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Saccopetalum brahei F. Muell.

### Remarks
null


text:
package org.elasticsearch.xpack.sql.querydsl.query;

import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.xpack.sql.tree.Location;

import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;

public class MatchAll extends LeafQuery {
    public MatchAll(Location location) {
        super(location);
    }

    @Override
    public QueryBuilder asBuilder() {
        return matchAllQuery();
    }

    @Override
    protected String innerToString() {
        return "";
    }
}


text:
layout: post
title: Reality Kings - Ally is wide open
titleinfo: pornvd
desc: Watch Reality Kings - Ally is wide open. Pornhub is the ultimate xxx porn and sex site.
---

Reality Kings - Ally is wide open

Watch Reality Kings - Ally is wide open. Pornhub is the ultimate xxx porn and sex site.


text:
<?php
// Include configuration settings
include_once("config.php");

// Add TextKey PHP REST Library
include_once("textkey_rest.php");

// Add TextKey Session Handler
require_once("textkeysite.php");

// Code to handle the login for the specific site
function user_password_login($name, $password) {
	$userid = "";

	//
	// NOTE: This is where you would hook into your own internal authentication handler and return back the user id to
	// handle assigning a TextKey
	//
	return $name;
}

// Validate the user login and get the TextKey dialog to display in the browser
function login_user() {
	global $textkeysite;

	// Setup
	$error_msg = '';

	// Create the textkey object
	$tk = new textKey(TK_API);

	// Get the passed in info.
	$name = isset($_POST["name"]) ? $_POST["name"] : "";
	$password = isset($_POST["password"]) ? $_POST["password"] : "";

	// HANDLE THE USER/LOGIN AUTHENTICATION HERE
    // NOTE: The $textkey_userid value should be the user id that was used to register the specific user in the
    // TextKey Database (i.e. via the TextKey Administration Application or via the  registerTextKeyUser API Call
	// or registerTextKeyUserCSA API Call).
	$textkey_userid = user_password_login($name, $password);

    // If the username/password combination is validated then continue
	if ($textkey_userid != "") {

		// Handle setting the sesssion info.
		$textkeysite->setPassedLoginCheck($name, $textkey_userid);

		// Handle getting a valid TextKey using the user id
		$textkey_result = $tk->perform_IssueTextKeyFromUserId($textkey_userid, TK_ISHASHED);
		if ($textkey_result->errorDescr == "") {
			// No error so setup the return payload
			$reply_msg = '({"error":"", "textkey":' . json_encode($textkey_result->textKey) . ', "textkeyVC":' . json_encode($textkey_result->validationCode) . ', "shortcode":' . json_encode('81888') . '})';

			// Handle setting the textkey sesssion info.
			$textkeysite->setTextKeyInfo($textkey_userid, $textkey_result->textKey,  $textkey_result->validationCode, '81888');

			// Return the valid info.
			return $reply_msg;
		}
		else {
			$error_msg = $textkey_result->errorDescr;
		}
	}
	else {
		$error_msg = "The name or password did not match. Please try again...";
	};

	// Handle clearing the sesssion info.
	$textkeysite->endSession();

	// Return the error
	$error_msg = '({"error":' . json_encode($error_msg) . '})';
	return $error_msg;
}

// Create the session handling object
$textkeysite = new textkeysite();

// Init the session values
$textkeysite->initSessionInfo();

// Login the user
$login_payload = login_user();

// Return the resulting payload
echo $login_payload;

exit;

?>


text:
export const testingForImportedModule123456789 = true;
export const testingForImportedModule987654321 = true;


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
  <title>Portal Educação</title>

  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link href="styles/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link href="styles/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link rel="icon" href="imgs/logo.png" >

Página Inicial

Modelo de Provas/Trabalhos

Fórum

Download/Upload Aplicativos

Correção Provas e Trabalhos

Mural

Chat

Repositório de Fotos

Banco de Questões

Calendário

          <button data-activates="slide-out" class="waves-effect waves-light btn-flat button-collapse white-text light-blue darken-4">Menu</button>

<button class="waves-effect waves-light btn-flat white-text light-blue darken-4">Entrar</button>

Colaboradores

Pessoas que tornaram esse projeto viável

Professores

            José Wilson

            William Sallum

Gerência

            Adalberto Barbosa

            João Pedro Rosa

            Paula Ribeiro

            Vitor Rodarte

Modelo de Provas/Trabalhos

            Victor César

            Gabriel Victor

            Isabela Carolina

            João Pedro dos Santos

Fórum

            Victor Gabriel

            Luana Pinheiro

            Matheus Morato

            Rafael Gontijo

Download/Upload Aplicativos

            Pedro Octávio

            André Mateus

            Bruno Ferreira

Correção Provas e Trabalhos

            Luiz Augusto

            Felipe Linhares

            Lucas Henrique

Mural

            Gabriel Haddad

            Breno Mariz

            Bryann Bueno

Chat

            Carlos Eduardo

            Ana Luísa Menezes

            Ester Atman

Repositório de Fotos

            Marcelo Augusto

            Maria Carolina Resende

            Thales Alan Araújo

            Gabriel Garcia

Banco de Questões

            João Vitor de Carvalho

            Breno Paiva

            Thales Gabriel Nunes

            Alice Costa

Calendário

            Pedro Henrique Almeida

            Gabriel Vinícius

            Amaury Vianna

Patrocinadores

            Pai do Thales Nunes

Desenvolvedores

            Somos a turma de Informática 2A do ano de 2016 do CEFET-MG (Centro Federal de Educação Tecnológica de Minas Gerais) desenvolvendo o trabalho final multidisciplinar de Linguagem de Programação 1 e Aplicações para WEB.

Clique aqui para saber mais

Sobre a Instituição

            Centro Federal de Educação Tecnológica de Minas Gerais

Av. Amazonas 5253 - Nova Suiça - Belo Horizonte - MG - Brasil

Telefone: +55 (31) 3319-7000 - Fax: +55 (31) 3319-7001

Recursos

Github

CEFET-MG

      Made by Materialize


text:
.btn-primary {
  color: white;
  background-color: #a8a8a8;
  border-color: #a8a8a8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
  color: white;
  background-color: #8f8f8f;
  border-color: #898989;
}
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
  background-image: none;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
  background-color: #a8a8a8;
  border-color: #a8a8a8;
}
.btn-primary .badge {
  color: #a8a8a8;
  background-color: white;
}
.btn-xl {
  color: white;
  background-color: #a8a8a8;
  border-color: #a8a8a8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 3px;
  font-size: 18px;
  padding: 20px 40px;
}
.btn-xl:hover,
.btn-xl:focus,
.btn-xl:active,
.btn-xl.active,
.open .dropdown-toggle.btn-xl {
  color: white;
  background-color: #8f8f8f;
  border-color: #898989;
}
.btn-xl:active,
.btn-xl.active,
.open .dropdown-toggle.btn-xl {
  background-image: none;
}
.btn-xl.disabled,
.btn-xl[disabled],
fieldset[disabled] .btn-xl,
.btn-xl.disabled:hover,
.btn-xl[disabled]:hover,
fieldset[disabled] .btn-xl:hover,
.btn-xl.disabled:focus,
.btn-xl[disabled]:focus,
fieldset[disabled] .btn-xl:focus,
.btn-xl.disabled:active,
.btn-xl[disabled]:active,
fieldset[disabled] .btn-xl:active,
.btn-xl.disabled.active,
.btn-xl[disabled].active,
fieldset[disabled] .btn-xl.active {
  background-color: #a8a8a8;
  border-color: #a8a8a8;
}
.btn-xl .badge {
  color: #a8a8a8;
  background-color: white;
}
ul.social-buttons {
  margin-bottom: 0;
}
ul.social-buttons li a {
  display: block;
  background-color: #222222;
  height: 40px;
  width: 40px;
  border-radius: 100%;
  font-size: 20px;
  line-height: 40px;
  color: white;
  outline: none;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  transition: all 0.3s;
}
ul.social-buttons li a:hover,
ul.social-buttons li a:focus,
ul.social-buttons li a:active {
  background-color: #a8a8a8;
}
.btn:focus,
.btn:active,
.btn.active,
.btn:active:focus {
  outline: none;
}
.navbar-custom {
  background-color: #555555;
  border-color: transparent;
}
.navbar-custom .navbar-brand {
  color: #fff;
  font-family: "Kaushan Script", "Helvetica Neue", Helvetica, Arial, cursive;
}
.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:active,
.navbar-custom .navbar-brand.active {
  color: #8f8f8f;
}
.navbar-custom .navbar-brand:focus {
  color: #fff;
}
.navbar-custom .navbar-collapse {
  border-color: rgba(255, 255, 255, 0.02);
  margin-top: 25px;
}
.navbar-custom .navbar-toggle {
  background-color: #a8a8a8;
  border-color: #a8a8a8;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  color: white;
  font-size: 12px;
}
.navbar-custom .navbar-toggle:hover,
.navbar-custom .navbar-toggle:focus {
  background-color: #a8a8a8;
}
.navbar-custom .nav li a {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 1px;
  color: white;
}
.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
  color: #a8a8a8;
  outline: none;
}
.navbar-custom .navbar-nav > .active > a {
  border-radius: 0;
  color: white;
  background-color: #a8a8a8;
}
.navbar-custom .navbar-nav > .active > a:hover,
.navbar-custom .navbar-nav > .active > a:focus {
  color: white;
  background-color: #8f8f8f;
}
.lastname {
  margin: 0 0 0 10px;
}
.navbar-custom.affix {
  background: linear-gradient(#555555, #777777);
  padding: 10px 0;
}
.navbar-custom.affix .navbar-brand {
  font-size: 3em;
  position: static;
  transform: rotate(0deg);
  display: inline-flex;
}
.navbar-custom.affix .navbar-collapse {
  margin-top: 0;
}
.navbar-custom.affix .lastname {
  margin: 0 0 0 10px;
}
@media (min-width: 320px) and (max-width: 767px) {
  .navbar-brand {
    font-size: 2em;
    display: inline-flex;
  }
  .navbar-custom.affix {
    padding: 0;
  }
  .navbar-custom.affix .navbar-brand {
    font-size: 2em;
  }
  .separator {
    margin-bottom: 10px;
    border-bottom: 1px solid black;
  }
}
@media (min-width: 768px) and (max-width: 965px) {
  .navbar-custom {
    background-color: transparent;
    padding: 25px 0;
    -webkit-transition: padding 0.3s;
    -moz-transition: padding 0.3s;
    transition: padding 0.3s;
    border: none;
  }
  .navbar-custom .navbar-brand {
    font-size: 2.3em;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    transition: all 0.3s;
    display: inline-flex;
  }
  .navbar-custom .navbar-nav > .active > a {
    border-radius: 3px;
  }
  .navbar-custom.affix .navbar-brand {
    font-size: 2em;
  }
}
@media (min-width: 966px) {
  .navbar-custom {
    background-color: transparent;
  }
  .navbar-custom .navbar-brand {
    position: absolute;
    font-size: 3em;
    top: 30px;
    left: 95px;
    transform: rotate(-20deg);
  }
  .navbar-custom .lastname {
    margin: 27px 0 0 70px;
  }
}
@media (min-width: 1200px) {
  .navbar-custom {
    background-color: transparent;
  }
  .navbar-custom .navbar-brand {
    position: absolute;
    font-size: 5em;
    top: 60px;
    left: 190px;
    transform: rotate(-20deg);
  }
  .navbar-custom .lastname {
    margin: 55px 0 0 117px;
  }
}
header {
  background-image: url('../img/header-bg.jpg');
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-position: center center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
  -o-background-size: cover;
  text-align: center;
  color: white;
}
header .intro-text {
  padding-top: 100px;
  padding-bottom: 50px;
}
header .intro-text .intro-lead-in {
  font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: italic;
  font-size: 22px;
  line-height: 22px;
  margin-bottom: 25px;
}
header .intro-text .intro-heading {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 50px;
  line-height: 50px;
  margin-bottom: 25px;
}
@media (min-width: 768px) {
  header .intro-text {
    padding-top: 300px;
    padding-bottom: 200px;
  }
  header .intro-text .intro-lead-in {
    font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-style: italic;
    font-size: 40px;
    line-height: 40px;
    margin-bottom: 25px;
  }
  header .intro-text .intro-heading {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 75px;
    line-height: 75px;
    margin-bottom: 50px;
  }
}
section {
  padding: 100px 0;
}
section h2.section-heading {
  font-size: 40px;
  margin-top: 0;
  margin-bottom: 15px;
}
section h3.section-subheading {
  font-size: 16px;
  font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: none;
  font-style: italic;
  font-weight: 400;
  margin-bottom: 40px;
}
.service-heading {
  margin: 15px 0;
  text-transform: none;
}
@media (min-width: 320px) and (max-width: 767px) {
  section {
    font-size: xx-small;
    padding-top: 32px;
  }
  section h2.section-heading {
    font-size: 20px;
    margin-bottom: 0;
  }
  section h3.section-subheading {
    font-size: 12px;
    margin-bottom: 0;
  }
  section p {
    font-size: small;
  }
  section .portfolio-hover-content {
    display: inline-flex;
  }
  section .cv-company {
    margin: 3px 0 0 45px;
    color: #222222;
  }
}
@media (min-width: 767px) {
  #portfolio .portfolio-item {
    margin: 0 0 30px;
  }
}
.timeline {
  list-style: none;
  padding: 0;
  position: relative;
}
.timeline:before {
  top: 0;
  bottom: 0;
  position: absolute;
  content: "";
  width: 2px;
  background-color: #777777;
  left: 40px;
  margin-left: -1.5px;
}
.timeline > li {
  margin-bottom: 50px;
  position: relative;
  min-height: 50px;
}
.timeline > li:before,
.timeline > li:after {
  content: " ";
  display: table;
}
.timeline > li:after {
  clear: both;
}
.timeline > li .timeline-panel {
  width: 100%;
  float: right;
  padding: 0 20px 0 100px;
  position: relative;
  text-align: left;
}
.timeline > li .timeline-panel:before {
  border-left-width: 0;
  border-right-width: 15px;
  left: -15px;
  right: auto;
}
.timeline > li .timeline-panel:after {
  border-left-width: 0;
  border-right-width: 14px;
  left: -14px;
  right: auto;
}
.timeline > li .timeline-image {
  left: 0;
  margin-left: 0;
  width: 80px;
  height: 80px;
  position: absolute;
  z-index: 100;
  background-color: #a8a8a8;
  color: white;
  border-radius: 100%;
  border: 7px solid #f1f1f1;
  text-align: center;
}
.timeline > li .timeline-image h4 {
  font-size: 10px;
  margin-top: 12px;
  line-height: 14px;
}
.timeline > li.timeline-inverted > .timeline-panel {
  float: right;
  text-align: left;
  padding: 0 20px 0 100px;
}
.timeline > li.timeline-inverted > .timeline-panel:before {
  border-left-width: 0;
  border-right-width: 15px;
  left: -15px;
  right: auto;
}
.timeline > li.timeline-inverted > .timeline-panel:after {
  border-left-width: 0;
  border-right-width: 14px;
  left: -14px;
  right: auto;
}
.timeline > li:last-child {
  margin-bottom: 0;
}
.timeline .timeline-heading h4 {
  margin-top: 0;
  color: inherit;
}
.timeline .timeline-heading h4.subheading {
  text-transform: none;
}
.timeline .timeline-body > p,
.timeline .timeline-body > ul {
  margin-bottom: 0;
}
@media (min-width: 320px) {
  .timeline > li .timeline-image h4 {
    font-size: 9px;
    margin-top: 20%;
    line-height: 10px;
  }
}
@media (min-width: 768px) {
  .timeline:before {
    left: 50%;
  }
  .timeline > li {
    margin-bottom: 100px;
    min-height: 100px;
  }
  .timeline > li .timeline-panel {
    width: 41%;
    float: left;
    padding: 0 20px 20px 30px;
    text-align: right;
  }
  .timeline > li .timeline-image {
    width: 100px;
    height: 100px;
    left: 50%;
    margin-left: -50px;
  }
  .timeline > li .timeline-image h4 {
    font-size: 10px;
    margin-top: 30%;
    line-height: 13px;
  }
  .timeline > li.timeline-inverted > .timeline-panel {
    float: right;
    text-align: left;
    padding: 0 30px 20px 20px;
  }
}
@media (min-width: 992px) {
  .timeline > li {
    min-height: 150px;
  }
  .timeline > li .timeline-panel {
    padding: 0 20px 20px;
  }
  .timeline > li .timeline-image {
    width: 150px;
    height: 150px;
    margin-left: -75px;
  }
  .timeline > li .timeline-image h4 {
    font-size: 16px;
    margin-top: 32%;
    line-height: 18px;
  }
  .timeline > li.timeline-inverted > .timeline-panel {
    padding: 0 20px 20px;
  }
}
@media (min-width: 1200px) {
  .timeline > li {
    min-height: 170px;
  }
  .timeline > li .timeline-panel {
    padding: 0 20px 20px 100px;
  }
  .timeline > li .timeline-image {
    width: 170px;
    height: 170px;
    margin-left: -85px;
  }
  .timeline > li .timeline-image h4 {
    margin-top: 30%;
  }
  .timeline > li.timeline-inverted > .timeline-panel {
    padding: 0 100px 20px 20px;
  }
}
section#contact {
  background-color: #222222;
  background-image: url('../img/map-image.png');
  background-position: center;
  background-repeat: no-repeat;
}
section#contact .section-heading {
  color: white;
}
section#contact .form-group {
  margin-bottom: 25px;
}
section#contact .form-group input,
section#contact .form-group textarea {
  padding: 20px;
}
section#contact .form-group input.form-control {
  height: auto;
}
section#contact .form-group textarea.form-control {
  height: 236px;
}
section#contact .form-control:focus {
  border-color: #a8a8a8;
  box-shadow: none;
}
section#contact ::-webkit-input-placeholder {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  color: #d1d1d1;
}
section#contact :-moz-placeholder {
  /* Firefox 18- */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  color: #d1d1d1;
}
section#contact ::-moz-placeholder {
  /* Firefox 19+ */
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  color: #d1d1d1;
}
section#contact :-ms-input-placeholder {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  color: #d1d1d1;
}
section#contact .text-danger {
  color: #e74c3c;
}
footer {
  padding: 25px 0;
  text-align: center;
}
footer span.copyright {
  line-height: 40px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  text-transform: none;
}
footer ul.quicklinks {
  margin-bottom: 0;
  line-height: 40px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  text-transform: none;
}
#portfolio .portfolio-item {
  margin: 0 0 15px;
  right: 0;
}
#portfolio .portfolio-item .portfolio-link {
  display: block;
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover {
  background: rgba(168, 168, 168, 0.9);
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all ease 0.5s;
  -webkit-transition: all ease 0.5s;
  -moz-transition: all ease 0.5s;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover:hover {
  opacity: 1;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content {
  position: absolute;
  width: 100%;
  height: 20px;
  font-size: 20px;
  text-align: center;
  top: 50%;
  margin-top: -12px;
  color: white;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content i {
  margin-top: -12px;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h3,
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h4 {
  margin: 0;
}
#portfolio .portfolio-item .portfolio-caption {
  max-width: 400px;
  margin: 0 auto;
  background-color: white;
  text-align: center;
  padding: 25px;
}
#portfolio .portfolio-item .portfolio-caption h4 {
  text-transform: none;
  margin: 0;
}
#portfolio .portfolio-item .portfolio-caption p {
  font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: italic;
  font-size: 16px;
  margin: 0;
}
#portfolio * {
  z-index: 2;
}
.portfolio-modal .modal-dialog {
  margin: 0;
  height: 100%;
  width: auto;
}
.portfolio-modal .modal-content {
  border-radius: 0;
  background-clip: border-box;
  -webkit-box-shadow: none;
  box-shadow: none;
  border: none;
  min-height: 100%;
  padding: 50px 0;
  text-align: center;
}
.portfolio-modal .modal-content h2 {
  margin-bottom: 15px;
  font-size: 3em;
}
.portfolio-modal .modal-content h4 {
  margin-bottom: 30px;
}
.portfolio-modal .modal-content p.item-intro {
  margin: 20px 0 30px;
  font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: italic;
  font-size: 16px;
}
.portfolio-modal .modal-content ul.list-inline {
  margin-bottom: 30px;
  margin-top: 0;
}
.portfolio-modal .modal-content img {
  margin-bottom: 30px;
}
.portfolio-modal .close-modal {
  position: absolute;
  width: 75px;
  height: 75px;
  background-color: transparent;
  top: 25px;
  right: 15%;
  cursor: pointer;
}
.portfolio-modal .close-modal:hover {
  opacity: 0.3;
}
.portfolio-modal .modal-backdrop {
  opacity: 0;
  display: none;
}
.techno ul {
  display: inline-flex;
  list-style-type: none;
  margin-top: 25px;
}
.techno li {
  color: #ffffff;
  background-color: #9c9c9c;
  font-size: small;
  padding: 5px;
  margin: 0 5px;
}
.no-bullet {
  list-style-type: none;
}
.technos {
  display: inline-flex;
  flex-wrap: wrap;
}
.technos-item {
  background-color: #9c9c9c;
  color: white;
  padding: 5px;
  margin: 5px;
  font-size: 0.95em;
}
.img-company {
  height: 81px;
  width: 250px;
}
.fa-size {
  font-size: 3em;
}
@media (min-width: 320px) and (max-width: 767px) {
  .portfolio-modal .modal-content {
    padding: 50px 0;
  }
  .portfolio-modal .modal-content img {
    margin-bottom: 0;
  }
  .modal-body {
    padding: 5px;
  }
  .portfolio-modal .close-modal {
    width: 70%;
  }
  .duration {
    float: left;
    font-size: 1.2em;
  }
  .img-company {
    margin-left: 20%;
    margin-top: 10px;
    width: 150px;
    height: 48px;
  }
  .img-modal {
    width: 217px;
    height: 70px;
    margin-left: 20%;
  }
  .fa-close {
    float: right;
  }
  .fa-size {
    font-size: 1.5em;
  }
  .modal-open .modal {
    margin-left: -50px;
  }
  h3 {
    font-size: 1.2em;
  }
}
@media (max-width: 1000px) {
  .close-modal {
    position: absolute;
    width: 75px;
    height: 75px;
    background-color: transparent;
    top: 10px;
    right: 10px;
    cursor: pointer;
  }
  .close-modal:hover {
    opacity: 0.3;
  }
}
body {
  overflow-x: hidden;
  font-family: "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
p {
  font-size: 14px;
  line-height: 1.75;
}
p.large {
  font-size: 16px;
}
a,
a:hover,
a:focus,
a:active,
a.active {
  outline: none;
}
a {
  color: #a8a8a8;
}
a:hover,
a:focus,
a:active,
a.active {
  color: #8f8f8f;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 700;
}
.viewport-full-height {
  min-height: 100vh;
}
.bg-light-gray {
  background-color: #eeeeee;
}
.bg-darkest-gray {
  background-color: #222222;
}
.text-muted {
  color: #777777;
  margin-left: 10px;
}
.text-primary {
  color: #a8a8a8;
}
.img-centered {
  margin: 0 auto;
}
::-moz-selection {
  text-shadow: none;
  background: #a8a8a8;
}
::selection {
  text-shadow: none;
  background: #a8a8a8;
}
img::selection {
  background: transparent;
}
img::-moz-selection {
  background: transparent;
}
.margin-bottom-30 {
  margin-bottom: 30px;
}
.sub-separator {
  width: 80%;
}


text:
require 'stringio'

module Clamp

  module Help

    def usage(usage)
      @declared_usage_descriptions ||= []
      @declared_usage_descriptions << usage
    end

    attr_reader :declared_usage_descriptions

    def description=(description)
      @description = description.dup
      if @description =~ /^\A\n*( +)/
        indent = $1
        @description.gsub!(/^#{indent}/, '')
      end
      @description.strip!
    end

    def banner(description)
      self.description = description
    end

    attr_reader :description

    def derived_usage_description
      parts = ["[OPTIONS]"]
      parts += parameters.map { |a| a.name }
      parts.join(" ")
    end

    def usage_descriptions
      declared_usage_descriptions || [derived_usage_description]
    end

    def help(invocation_path, builder = Builder.new)
      help = builder
      help.add_usage(invocation_path, usage_descriptions)
      help.add_description(description)
      if has_parameters?
        help.add_list("Parameters", parameters)
      end
      if has_subcommands?
        help.add_list("Subcommands", recognised_subcommands)
      end
      help.add_list("Options", recognised_options)
      help.string
    end

    class Builder

      def initialize
        @out = StringIO.new
      end

      def string
        @out.string
      end

      def add_usage(invocation_path, usage_descriptions)
        puts "Usage:"
        usage_descriptions.each do |usage|
          puts "    #{invocation_path} #{usage}".rstrip
        end
      end

      def add_description(description)
        if description
          puts ""
          puts description.gsub(/^/, "  ")
        end
      end

      DETAIL_FORMAT = "    %-29s %s"

      def add_list(heading, items)
        puts "\n#{heading}:"
        items.each do |item|
          label, description = item.help
          description.each_line do |line|
            puts DETAIL_FORMAT % [label, line]
            label = ''
          end
        end
      end

      private

      def puts(*args)
        @out.puts(*args)
      end

    end

  end

end


text:
package com.github.zk1931.zabbenchmark;

/**
 * Main.
 */
public class Main {

  protected Main() {}

  public static void main(String[] args) throws Exception {
    Benchmark bm = new Benchmark();
    bm.start();
  }
}


text:
    !defined(SWIFT_RUNTIME_MACHO_NO_DYLD)

#include "ImageInspection.h"
#include "ImageInspectionCommon.h"
#include "swift/Runtime/Config.h"
#include <mach-o/dyld.h>
#include <mach-o/getsect.h>
#include <objc/runtime.h>
#include <assert.h>
#include <dlfcn.h>

using namespace swift;

namespace {

constexpr const char ProtocolsSection[] = MachOProtocolsSection;
constexpr const char ProtocolConformancesSection[] =
    MachOProtocolConformancesSection;
constexpr const char TypeMetadataRecordSection[] =
    MachOTypeMetadataRecordSection;
constexpr const char DynamicReplacementSection[] =
    MachODynamicReplacementSection;
constexpr const char DynamicReplacementSomeSection[] =
    MachODynamicReplacementSomeSection;
constexpr const char TextSegment[] = MachOTextSegment;

#if __POINTER_WIDTH__ == 64
using mach_header_platform = mach_header_64;
#else
using mach_header_platform = mach_header;
#endif

extern "C" void *_NSGetMachExecuteHeader();

template <const char *SEGMENT_NAME, const char *SECTION_NAME,
         void CONSUME_BLOCK(const void *start, uintptr_t size)>
void addImageCallback(const mach_header *mh) {
#if __POINTER_WIDTH__ == 64
  assert(mh->magic == MH_MAGIC_64 && "loaded non-64-bit image?!");
#endif

  // Look for a __swift5_proto section.
  unsigned long size;
  const uint8_t *section =
  getsectiondata(reinterpret_cast<const mach_header_platform *>(mh),
                 SEGMENT_NAME, SECTION_NAME,
                 &size);

  if (!section)
    return;

  CONSUME_BLOCK(section, size);
}
template <const char *SEGMENT_NAME, const char *SECTION_NAME,
         void CONSUME_BLOCK(const void *start, uintptr_t size)>
void addImageCallback(const mach_header *mh, intptr_t vmaddr_slide) {
  addImageCallback<SEGMENT_NAME, SECTION_NAME, CONSUME_BLOCK>(mh);
}

template <const char *SEGMENT_NAME, const char *SECTION_NAME,
          const char *SEGMENT_NAME2, const char *SECTION_NAME2,
          void CONSUME_BLOCK(const void *start, uintptr_t size,
                             const void *start2, uintptr_t size2)>
void addImageCallback2Sections(const mach_header *mh) {
#if __POINTER_WIDTH__ == 64
  assert(mh->magic == MH_MAGIC_64 && "loaded non-64-bit image?!");
#endif

  // Look for a section.
  unsigned long size;
  const uint8_t *section =
  getsectiondata(reinterpret_cast<const mach_header_platform *>(mh),
                 SEGMENT_NAME, SECTION_NAME,
                 &size);

  if (!section)
    return;

  // Look for another section.
  unsigned long size2;
  const uint8_t *section2 =
  getsectiondata(reinterpret_cast<const mach_header_platform *>(mh),
                 SEGMENT_NAME2, SECTION_NAME2,
                 &size2);
  if (!section2)
    size2 = 0;

  CONSUME_BLOCK(section, size, section2, size2);
}
template <const char *SEGMENT_NAME, const char *SECTION_NAME,
          const char *SEGMENT_NAME2, const char *SECTION_NAME2,
          void CONSUME_BLOCK(const void *start, uintptr_t size,
                             const void *start2, uintptr_t size2)>
void addImageCallback2Sections(const mach_header *mh, intptr_t vmaddr_slide) {
  addImageCallback2Sections<SEGMENT_NAME, SECTION_NAME,
                            SEGMENT_NAME2, SECTION_NAME2,
                            CONSUME_BLOCK>(mh);
}

} // end anonymous namespace

#if OBJC_ADDLOADIMAGEFUNC_DEFINED && SWIFT_OBJC_INTEROP
#define REGISTER_FUNC(...)                                               \
  if (__builtin_available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)) { \
    objc_addLoadImageFunc(__VA_ARGS__);                                  \
  } else {                                                               \
    _dyld_register_func_for_add_image(__VA_ARGS__);                      \
  }
#else
#define REGISTER_FUNC(...) _dyld_register_func_for_add_image(__VA_ARGS__)
#endif

void swift::initializeProtocolLookup() {
  REGISTER_FUNC(addImageCallback<TextSegment, ProtocolsSection,
                                 addImageProtocolsBlockCallbackUnsafe>);
}

void swift::initializeProtocolConformanceLookup() {
  REGISTER_FUNC(
      addImageCallback<TextSegment, ProtocolConformancesSection,
                       addImageProtocolConformanceBlockCallbackUnsafe>);
}
void swift::initializeTypeMetadataRecordLookup() {
  REGISTER_FUNC(
      addImageCallback<TextSegment, TypeMetadataRecordSection,
                       addImageTypeMetadataRecordBlockCallbackUnsafe>);
}

void swift::initializeDynamicReplacementLookup() {
  REGISTER_FUNC(
      addImageCallback2Sections<TextSegment, DynamicReplacementSection,
                                TextSegment, DynamicReplacementSomeSection,
                                addImageDynamicReplacementBlockCallback>);
}

int swift::lookupSymbol(const void *address, SymbolInfo *info) {
  Dl_info dlinfo;
  if (dladdr(address, &dlinfo) == 0) {
    return 0;
  }

  info->fileName = dlinfo.dli_fname;
  info->baseAddress = dlinfo.dli_fbase;
  info->symbolName.reset(dlinfo.dli_sname);
  info->symbolAddress = dlinfo.dli_saddr;
  return 1;
}

#ifndef SWIFT_RUNTIME_NO_COMPATIBILITY_OVERRIDES

void *swift::lookupSection(const char *segment, const char *section, size_t *outSize) {
  unsigned long size;
  auto *executableHeader = static_cast<mach_header_platform *>(_NSGetMachExecuteHeader());
  uint8_t *data = getsectiondata(executableHeader, segment, section, &size);
  if (outSize != nullptr && data != nullptr)
    *outSize = size;
  return static_cast<void *>(data);
}

#endif // #ifndef SWIFT_RUNTIME_NO_COMPATIBILITY_OVERRIDES

#endif // defined(__APPLE__) && defined(__MACH__) &&
       // !defined(SWIFT_RUNTIME_MACHO_NO_DYLD)


text:
set -e # halt script on error

echo 'Testing travis...'
bundle exec jekyll build
bundle exec htmlproof ./_site


text:
package softuni.services.api;

import softuni.entities.Accessory;

public interface AccessoryService {
    void addAccessory(Accessory accessory);
}


text:
A debug panel for Symphony.
It is part of the Symphony core download package.

- Version: 1.1
- Date: 2011-01-29
- Requirements: Symphony 2.0.4 or later
- Author: Rowan Lewis, me@rowanlewis.com
- GitHub Repository: <http://github.com/rowan-lewis/debugdevkit>

## Usage

Append `?debug` to your front-end pages when logged in to initialise this Devkit.

## Change Log

**Version 1.0.6**

- Added localisation files for Dutch, German, Portuguese (Brazil) and Russian

**Version 1.0**

- Initial release


text:
(function ( globals ) {
  var Module = (function() {

    return {

      // given a param, return the default_value if param is undefined
      // alternatively, if the param is a function and call_function is truthy, call the function.
      // the latter use-case is good if the default value is an expensive operation.
      // when using the function form, the caller should take care to bind() if needed
      default_param: function( param, default_value, call_function ) {
        if ( typeof param === 'undefined' ) {
          if ( typeof default_value === 'function' && call_function ) {
            return default_value();
          }

          return default_value;
        }

        return param;
      },

      // Math extensions:
      'Math': {
        // TAU (2π)
        'TAU': Math.PI * 2,

        // convert degrees to radians
        deg2rad: function( deg ) {
          return deg * ( Math.PI / 180 );
        },

        // convert radians to degrees
        rad2deg: function ( rad ) {
          return rad * ( 180 / Math.PI );
        }
      }

    }

  })();

  globals.U = Module;

})( window );


text:
import { bindActionCreators } from "redux";
import { connect }            from "react-redux";
import * as CalendarActions  from "../../actions/calendar";
import Calendar              from "../../components/Calendar/Calendar";

let mapStateToProps = state => ({
  calendar: state.calendar,
  calendars: state.calendars,
  email: state.email,
  ui: state.ui
})

let mapDispatchToProps = dispatch => bindActionCreators(CalendarActions, dispatch)

export default connect(mapStateToProps, mapDispatchToProps)(Calendar);


text:
namespace renderer  { class ITextureFactory; }
namespace renderer  { class Plugin; }
namespace renderer  { class Texture; }

namespace renderer
{

//
// An array of texture factories.
//

APPLESEED_DECLARE_APIARRAY(TextureFactoryArray, ITextureFactory*);

//
// Texture factory registrar.
//

class APPLESEED_DLLSYMBOL TextureFactoryRegistrar
{
  public:
    typedef Texture EntityType;
    typedef ITextureFactory FactoryType;
    typedef TextureFactoryArray FactoryArrayType;

    // Constructor.
    explicit TextureFactoryRegistrar(
        const foundation::SearchPaths& search_paths = foundation::SearchPaths());

    // Destructor.
    ~TextureFactoryRegistrar();

    // Register a factory defined in a plugin.
    void register_factory_plugin(Plugin* plugin, void* plugin_entry_point);

    // Retrieve the registered factories.
    FactoryArrayType get_factories() const;

    // Lookup a factory by name.
    const FactoryType* lookup(const char* name) const;

  private:
    struct Impl;
    Impl* impl;
};

}   // namespace renderer


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [#filter: resource\serialization\binary #]
***/

#pragma once

#include "resourceBinaryFileTables.h"
#include "base/serialization/include/resourcePath.h"
#include "base/serialization/include/serializationMapper.h"
#include "base/serialization/include/serializationSaver.h"
#include "base/serialization/include/dataMapping.h"
#include "base/containers/include/hashMap.h"

namespace base
{
    namespace res
    {
        namespace binary
        {
            /// Structure mapper for binary serialization
            class StructureMapper : public stream::IDataMapper
            {
            public:
                struct ImportInfo
                {
                    ResourcePath            m_path;   //!< Path of the resource
                    const rtti::IClassType* m_class;  //!< Class of the resource to load
                    Bool                    m_soft;   //!< Soft import

                    FORCEINLINE ImportInfo(const Bool soft, const ResourcePath& path, const rtti::IClassType* resourceClass)
                    {
                        m_soft = soft;
                        m_class = resourceClass;
                        m_path = path;
                    }

                    FORCEINLINE const Uint64 getCRC() const
                    {
                        if (m_path.empty())
                            return 0;

                        base::CRC64 crc;
                        crc << m_path.c_str();
                        crc << m_class->getName().c_str();
                        crc << m_soft;
                        return crc.getCRC();
                    }
                };

                struct BufferInfo
                {
                    BufferPtr   m_handle;   //!< Buffer's data
                    Uint64      m_crc;;     //!< CRC of buffer's data (serves as the "Key")
                    Uint32      m_size;     //!< Buffer's size

                    FORCEINLINE BufferInfo()
                        : m_crc(0)
                        , m_size(0)
                    {}
                };

                typedef Array< obj::ObjectHandle > TExportTable;
                typedef Array< ImportInfo > TImportTable;
                typedef Array< StringID > TNameTable;
                typedef Array< const rtti::Property* > TPropertyTable;
                typedef Array< BufferInfo > TBufferTable;

                typedef THashMap< const void*, stream::MappedObjectIndex > TPointerMap;
                typedef THashMap< Uint64, stream::MappedPathIndex > TImportMap;
                typedef THashMap< StringID, stream::MappedNameIndex > TNameMap;
                typedef THashMap< Uint64, stream::MappedBufferIndex > TBufferMap;
                typedef THashMap< const rtti::Property*, stream::MappedPropertyIndex > TPropertyMap;

                const stream::SavingContext* m_context;     // Settings

                TExportTable    m_exports;              // List of contained object
                TImportTable    m_imports;              // List of used external resources
                TNameTable      m_names;                // List of used names
                TPropertyTable  m_properties;           // List of used properties
                TBufferTable    m_buffers;              // List of used buffers

                TPointerMap     m_objectIndices;        // Object remapping indices
                TNameMap        m_nameIndices;          // Name remapping indices
                TBufferMap      m_bufferIndices;        // Buffer remapping indices
                TPropertyMap    m_propertyIndices;      // Property remapping indices
                TImportMap      m_importIndices;        // Import mapping table

                TExportTable    m_tempExports;          // Unsorted list of contained object
                TPointerMap     m_tempObjectIndices;    // Unsorted remapping indices

                StructureMapper();

                /// Map objects from saving set
                void mapObjects(const stream::SavingContext& context);

            private:
                /// Mapping interface - implemented
                virtual void mapName(const StringID& name, stream::MappedNameIndex& outIndex) override final;
                virtual void mapType(const rtti::IType* rttiType, stream::MappedTypeIndex& outIndex) override final;
                virtual void mapProperty(const rtti::Property* rttiProperty, stream::MappedPropertyIndex& outIndex) override final;
                virtual void mapPointer(const obj::ObjectHandle& object, stream::MappedObjectIndex& outIndex) override final;
                virtual void mapResourceReference(const ResourcePath& path, const rtti::IClassType* resourceClass, const Bool async, stream::MappedPathIndex& outIndex) override final;
                virtual void mapBuffer(const BufferPtr& bufferData, stream::MappedBufferIndex& outIndex) override final;

                // Reset tables
                void reset();

                enum class ObjectClassification
                {
                    Ignore,
                    Import,
                    Export,
                };

                // Determine if we should map given object at all and if so should we export it or import it
                const Bool shouldExport(const obj::ObjectHandle& object) const;

                // Map final object, creates sorted export table from unsorted one
                void mapFinalObject(const obj::ObjectHandle& object);

                // Follow object - explore the properties to create the full object graph
                void followObject(const obj::ObjectHandle& object);
            };

        } // binary
    } // res
} // base


text:
<?php

namespace PHPWarrior;

/**
 * Class Level
 *
 * @package PHPWarrior
 */
class Level
{
    public $profile;
    public $number;

    public $description;
    public $tip;
    public $clue;
    public $warrior;
    public $floor;
    public $time_bonus;
    public $ace_score;

    /**
     * @param  $percent
     * @return string
     */
    public static function grade_letter($percent)
    {
        if ($percent >= 1.0) {
            return 'S';
        } elseif ($percent >= 0.9) {
            return 'A';
        } elseif ($percent >= 0.8) {
            return 'B';
        } elseif ($percent >= 0.7) {
            return 'C';
        } elseif ($percent >= 0.6) {
            return 'D';
        } else {
            return 'F';
        }
    }

    /**
     * Level constructor.
     *
     * @param $profile
     * @param $number
     */
    public function __construct($profile, $number)
    {
        $this->profile = $profile;
        $this->number = $number;
    }

    public function player_path()
    {
        return $this->profile->player_path();
    }

    public function load_path()
    {
        return $this->profile->tower_path . '/level_' . sprintf("%03d", $this->number) . '.php';
    }

    public function load_level()
    {
        $level_loader = new LevelLoader($this, $this->load_path());
    }

    public function load_player()
    {
        include_once $this->player_path() . '/player.php';
    }

    public function generate_player_files()
    {
        $this->load_level();
        $player_generator = new PlayerGenerator($this);
        return $player_generator->generate();
    }

    public function play($turns = 1000)
    {
        $this->load_level();
        foreach (range(0, $turns) as $n) {
            if ($this->is_passed() || $this->is_failed()) {
                return;
            }
            $num = $n + 1;
            UI::puts(sprintf(__("- turn %s -"), $num));
            UI::put($this->floor->character());
            foreach ($this->floor->units() as $unit) {
                $unit->prepare_turn();
            }
            foreach ($this->floor->units() as $unit) {
                $unit->perform_turn();
            }
            if ($this->time_bonus > 0) {
                $this->time_bonus -= 1;
            }
        }
    }

    public function tally_points()
    {
        $score = 0;

        UI::puts(sprintf(
            __("Level Score: %s"),
            $this->warrior->score
        ));
        $score += $this->warrior->score;

        UI::puts(sprintf(
            __("Time Bonus: %s"),
            $this->time_bonus
        ));
        $score += $this->time_bonus;

        if (count($this->floor->other_units()) == 0) {
            UI::puts(sprintf(
                __("Clear Bonus: %s"),
                $this->clear_bonus()
            ));
            $score += $this->clear_bonus();
        }

        if ($this->profile->is_epic()) {
            if ($this->grade_for($score)) {
                UI::puts(sprintf(
                    __("Level Grade: %s"),
                    $this->grade_for($score)
                ));
            }
            UI::puts(sprintf(
                __("Total Score: %s"),
                $this->score_calculation($this->profile->current_epic_score, $score)
            ));
            if ($this->ace_score) {
                $this->profile->current_epic_grades[$this->number] = ($score / $this->ace_score);
            }
            $this->profile->current_epic_score += $score;
        } else {
            UI::puts(sprintf(
                __("Total Score: %s"),
                $this->score_calculation($this->profile->score, $score)
            ));
            $this->profile->score += $score;
            $this->profile->abilities = array_keys($this->warrior->abilities);
        }
    }

    /**
     * @param  $score
     * @return string
     */
    public function grade_for($score)
    {
        if ($this->ace_score) {
            return self::grade_letter($score / $this->ace_score);
        }
    }

    public function clear_bonus()
    {
        return round(($this->warrior->score + $this->time_bonus) * 0.2);
    }

    /**
     * @param  $current_score
     * @param  $addition
     * @return string
     */
    public function score_calculation($current_score, $addition)
    {
        if (empty($current_score)) {
            return $addition;
        } else {
            $total = $current_score + $addition;
            return "{$current_score} + {$addition} = {$total}";
        }
    }

    public function is_passed()
    {
        return $this->floor->stairs_space()->is_warrior();
    }

    public function is_failed()
    {
        return (array_search(
                $this->warrior,
                $this->floor->units()
            ) === false);
    }

    public function is_exists()
    {
        return file_exists($this->load_path());
    }

    /**
     * @param  $warrior
     * @return mixed
     */
    public function setup_warrior($warrior)
    {
        $this->warrior = $warrior;
        $this->warrior->add_abilities($this->profile->abilities);
        $this->warrior->name = $this->profile->warrior_name;
        return $warrior;
    }

}


text:
- [coinbase](#coinbase)
     - [#balance](#coinbase-balance)
     - [#receiveAddress](#coinbase-receiveaddress)
     - [#generateReceiveAddress](#coinbase-generatereceiveaddress)
     - [#button](#coinbase-button)
     - [#buys](#coinbase-buys)
     - [#contacts](#coinbase-contacts)
     - [currencies](#coinbase-currencies)
       - [#list](#coinbase-currencies-list)
       - [#exchangeRates](#coinbase-currencies-exchangerates)
     - [orders](#coinbase-orders)
       - [#list](#coinbase-orders-list)
       - [#get](#coinbase-orders-get)
     - [prices](#coinbase-prices)
       - [#buy](#coinbase-prices-buy)
       - [#sell](#coinbase-prices-sell)
     - [transactions](#coinbase-transactions)
       - [#list](#coinbase-transactions-list)
       - [#get](#coinbase-transactions-get)
     - [transfers](#coinbase-transfers)
       - [#list](#coinbase-transfers-list)

# coinbase

## #balance
should return account balance.

```js
coinbase.account.balance(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('amount');
  data.should.have.property('currency', 'BTC');
  done();
});
```

## #receiveAddress
should return the user's current bitcoin receive address.

```js
coinbase.account.receiveAddress(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('success', true);
  data.should.have.property('address');
  data.should.have.property('callback_url');
  done();
});
```

## #generateReceiveAddress
should generate a new receive address.

```js
coinbase.account.generateReceiveAddress(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('success', true);
  data.should.have.property('address');
  data.should.have.property('callback_url');
  done();
});
```

should generate a new receive address with callback.

```js
coinbase.account.generateReceiveAddress('https://www.example.com/callback', function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('success', true);
  data.should.have.property('address');
  data.should.have.property('callback_url'); // TODO: enforce callback value ***api is currently not passing this back. may be a bug in the api
  done();
});
```

## #button
should generate a new button.

```js
var param = {
              "button": {
                "name": 'test',
                "price_string": '1.23',
                "price_currency_iso": 'USD',
                "custom": 'Order123',
                "description": 'Sample description',
                "type": 'buy_now',
                "style": 'custom_large'
              }
            };
coinbase.buttons.create(param, function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('success', true);
  data.should.have.property('button');
  data.button.should.have.property('code');
  data.button.should.have.property('type');
  data.button.should.have.property('style');
  data.button.should.have.property('text');
  data.button.should.have.property('name');
  data.button.should.have.property('description');
  data.button.should.have.property('custom');
  data.button.should.have.property('price');
  done();
});
```

## #buys

## #contacts

## currencies

### #list
should return list of supported currencies.

```js
coinbase.currencies.list(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.length.should.be.above(0);
  done();
});
```

### #exchangeRates
should return current currency exchange rates.

```js
coinbase.currencies.exchangeRates(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('btc_to_usd');
  data.should.have.property('usd_to_btc');
  done();
});
```

## orders

### #list
should return list of supported orders.

```js
coinbase.orders.list(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('orders');
  data.should.have.property('total_count');
  data.should.have.property('num_pages');
  data.should.have.property('current_page');
  done();
});
```

### #get

## prices

### #buy
should return the total buy price for some bitcoin amount.

```js
coinbase.prices.buy(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('amount');
  data.should.have.property('currency');
  done();
});
```

### #sell
should return the total sell price for some bitcoin amount.

```js
coinbase.prices.sell(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('amount');
  data.should.have.property('currency');
  done();
});
```

## transactions

### #list
should return the user's most recent transactions.

```js
coinbase.transactions.list(function (err, data) {
  if (err) throw err;
  log('data: ' + util.inspect(data));
  data.should.have.property('current_user');
  data.should.have.property('balance');
  data.should.have.property('total_count');
  data.should.have.property('transactions');
  done();
});
```

### #get

## transfers

### #list


text:
import threading
import urllib
# import urllib2

from .RemoteTypograf import RemoteTypograf

class Typograph(threading.Thread):

    def __init__(self, sel, original, entity_type, add_br_tags, wrap_in_paragraph, maximum_nobr):
        self.sel = sel
        self.original = original
        self.result = None
        self.error = None

        self.entity_type = entity_type
        self.add_br_tags = add_br_tags
        self.wrap_in_paragraph = wrap_in_paragraph
        self.maximum_nobr = maximum_nobr
        threading.Thread.__init__(self)

    def exec_request(self):
        rt = RemoteTypograf('windows-1251')  # UTF-8

        entity_type = self.entity_type
        if entity_type == "html":
            rt.htmlEntities()
        elif entity_type == "xml":
            rt.xmlEntities()
        elif entity_type == "no":
            rt.noEntities()
        elif entity_type == "mixed":
            rt.mixedEntities()

        rt.br(self.add_br_tags)
        rt.p(self.wrap_in_paragraph)
        rt.nobr(self.maximum_nobr)

        processed_text = rt.processText(str(self.original, 'utf-8')).strip(' \n\r')
        if len(processed_text) > 0:
            return processed_text
        else:
            return None

    def run(self):
        try:
            self.result = self.exec_request()
        except (OSError):
            self.error = True
            self.result = 'Some OSError'
        except (urllib.error.HTTPError):  # as (e):
        # except (urllib2.HTTPError):  # as (e):
            self.error = True
            self.result = 'HTTP error %s contacting API'  # % (str(e.code))
        except (urllib.error.URLError):  # as (e):
        # except (urllib2.URLError):  # as (e):
            self.error = True
            self.result = 'Error: '  # + str(e.reason)


text:
{{ title }}

{{ error }}

	<form role="form">

			Day
			<select class="form-control" id="day" ng-model="day.day">
				<option>Monday</option>
				<option>Tuesday</option>
				<option>Wednesday</option>
				<option>Thursday</option>
				<option>Friday</option>
				<option>Saturday</option>
				<option>Sunday</option>
			</select>

			Diets

{{ diet.time | date: 'HH:mm' }}

							<button class="btn btn-sm btn-danger pull-right" ng-click="removeDiet($index)"></button>

							Ingredients

									{{ ingredient }}
									<button class="btn btn-danger" ng-click="removeIngredient($index, diet)"></button>

							<input type="text" ng-model="ingredient[$index]" />
							<button class="btn btn-default" ng-click="addIngredient(ingredient[$index], $index, diet)"></button>

			<timepicker ng-model="dietTime" hour-step="1" minute-step="15" show-meridian="false"></timepicker>
			<button class="btn btn-default" ng-click="addDiet(dietTime)"></button>

			Medications

{{ medication.time | date: 'HH:mm' }}

							<button class="btn btn-sm btn-danger pull-right" ng-click="removeMedication($index)"></button>

							Items

									{{ item }}
									<button class="btn btn-danger" ng-click="removeItem($index, medication)"></button>

							<input type="text" ng-model="item[$index]" />
							<button class="btn btn-default" ng-click="addItem(item[$index], $index, medication)"></button>

			<timepicker ng-model="medicationTime" hour-step="1" minute-step="15" show-meridian="false"></timepicker>
			<button class="btn btn-default" ng-click="addMedication(medicationTime)"></button>

		<button type="submit" class="btn btn-success" ng-click="update()" ng-hide="create">Update</button>
		<button type="submit" class="btn btn-success" ng-click="save()" ng-show="create">Save</button>
		<button ng-click="close()" class="btn btn-danger">Close</button>
	</form>


text:
from openerp.osv import fields, osv
from openerp.tools.translate import _

JOURNAL_TYPE_MAP = {
    ('outgoing', 'customer'): ['sale'],
    ('outgoing', 'supplier'): ['purchase_refund'],
    ('outgoing', 'transit'): ['sale', 'purchase_refund'],
    ('incoming', 'supplier'): ['purchase'],
    ('incoming', 'customer'): ['sale_refund'],
    ('incoming', 'transit'): ['purchase', 'sale_refund'],
}

class stock_invoice_onshipping(osv.osv_memory):
    def _get_journal(self, cr, uid, context=None):
        journal_obj = self.pool.get('account.journal')
        journal_type = self._get_journal_type(cr, uid, context=context)
        journals = journal_obj.search(cr, uid, [('type', '=', journal_type)])
        return journals and journals[0] or False

    def _get_journal_type(self, cr, uid, context=None):
        if context is None:
            context = {}
        res_ids = context and context.get('active_ids', [])
        pick_obj = self.pool.get('stock.picking')
        pickings = pick_obj.browse(cr, uid, res_ids, context=context)
        pick = pickings and pickings[0]
        if not pick or not pick.move_lines:
            return 'sale'
        type = pick.picking_type_id.code
        usage = pick.move_lines[0].location_id.usage if type == 'incoming' else pick.move_lines[0].location_dest_id.usage

        return JOURNAL_TYPE_MAP.get((type, usage), ['sale'])[0]

    _name = "stock.invoice.onshipping"
    _description = "Stock Invoice Onshipping"
    _columns = {
        'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True),
        'journal_type': fields.selection([('purchase_refund', 'Refund Purchase'), ('purchase', 'Create Supplier Invoice'),
                                          ('sale_refund', 'Refund Sale'), ('sale', 'Create Customer Invoice')], 'Journal Type', readonly=True),
        'group': fields.boolean("Group by partner"),
        'invoice_date': fields.date('Invoice Date'),
    }
    _defaults = {
        'journal_type': _get_journal_type,
        'journal_id' : _get_journal,
    }

    def onchange_journal_id(self, cr, uid, ids, journal_id, context=None):
        if context is None:
            context = {}
        domain = {}
        value = {}
        active_id = context.get('active_id')
        if active_id:
            picking = self.pool['stock.picking'].browse(cr, uid, active_id, context=context)
            type = picking.picking_type_id.code
            usage = picking.move_lines[0].location_id.usage if type == 'incoming' else picking.move_lines[0].location_dest_id.usage
            journal_types = JOURNAL_TYPE_MAP.get((type, usage), ['sale', 'purchase', 'sale_refund', 'purchase_refund'])
            domain['journal_id'] = [('type', 'in', journal_types)]
        if journal_id:
            journal = self.pool['account.journal'].browse(cr, uid, journal_id, context=context)
            value['journal_type'] = journal.type
        return {'value': value, 'domain': domain}

    def view_init(self, cr, uid, fields_list, context=None):
        if context is None:
            context = {}
        res = super(stock_invoice_onshipping, self).view_init(cr, uid, fields_list, context=context)
        pick_obj = self.pool.get('stock.picking')
        count = 0
        active_ids = context.get('active_ids',[])
        for pick in pick_obj.browse(cr, uid, active_ids, context=context):
            if pick.invoice_state != '2binvoiced':
                count += 1
        if len(active_ids) == count:
            raise osv.except_osv(_('Warning!'), _('None of these picking lists require invoicing.'))
        return res

    def open_invoice(self, cr, uid, ids, context=None):
        if context is None:
            context = {}

        invoice_ids = self.create_invoice(cr, uid, ids, context=context)
        if not invoice_ids:
            raise osv.except_osv(_('Error!'), _('No invoice created!'))

        data = self.browse(cr, uid, ids[0], context=context)

        action_model = False
        action = {}

        journal2type = {'sale':'out_invoice', 'purchase':'in_invoice' , 'sale_refund':'out_refund', 'purchase_refund':'in_refund'}
        inv_type = journal2type.get(data.journal_type) or 'out_invoice'
        data_pool = self.pool.get('ir.model.data')
        if inv_type == "out_invoice":
            action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree1')
        elif inv_type == "in_invoice":
            action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree2')
        elif inv_type == "out_refund":
            action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree3')
        elif inv_type == "in_refund":
            action_id = data_pool.xmlid_to_res_id(cr, uid, 'account.action_invoice_tree4')

        if action_id:
            action_pool = self.pool['ir.actions.act_window']
            action = action_pool.read(cr, uid, action_id, context=context)
            action['domain'] = "[('id','in', ["+','.join(map(str,invoice_ids))+"])]"
            return action
        return True

    def create_invoice(self, cr, uid, ids, context=None):
        context = dict(context or {})
        picking_pool = self.pool.get('stock.picking')
        data = self.browse(cr, uid, ids[0], context=context)
        journal2type = {'sale':'out_invoice', 'purchase':'in_invoice', 'sale_refund':'out_refund', 'purchase_refund':'in_refund'}
        context['date_inv'] = data.invoice_date
        acc_journal = self.pool.get("account.journal")
        inv_type = journal2type.get(data.journal_type) or 'out_invoice'
        context['inv_type'] = inv_type

        active_ids = context.get('active_ids', [])
        res = picking_pool.action_invoice_create(cr, uid, active_ids,
              journal_id = data.journal_id.id,
              group = data.group,
              type = inv_type,
              context=context)
        return res