text:
package org.apache.directory.api.ldap.extras.controls.syncrepl_impl;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.nio.ByteBuffer;

import org.apache.directory.api.asn1.DecoderException;
import org.apache.directory.api.asn1.EncoderException;
import org.apache.directory.api.ldap.extras.AbstractCodecServiceTest;
import org.apache.directory.api.ldap.extras.controls.syncrepl.syncInfoValue.SyncInfoValue;
import org.apache.directory.api.ldap.extras.controls.syncrepl.syncInfoValue.SynchronizationInfoEnum;
import org.apache.directory.api.ldap.extras.controls.syncrepl_impl.SyncInfoValueDecorator;
import org.apache.directory.api.util.Strings;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.mycila.junit.concurrent.Concurrency;
import com.mycila.junit.concurrent.ConcurrentJunitRunner;

/**
 * Test the SyncInfoControlValue codec
 *
 * @author Apache Directory Project
 */
@RunWith(ConcurrentJunitRunner.class)
@Concurrency()
public class SyncInfoValueControlTest extends AbstractCodecServiceTest
{
    //--------------------------------------------------------------------------------
    // NewCookie choice tests
    //--------------------------------------------------------------------------------

    /**
     * Test the decoding of a SyncInfoValue control, newCookie choice
     */
    @Test
    public void testDecodeSyncInfoValueControlNewCookie() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x05 );
        bb.put( new byte[]
            {
                ( byte ) 0x80, 0x03, // syncInfoValue ::= CHOICE {
                'a',
                'b',
                'c' //     newCookie [0] syncCookie
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );
        decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.NEW_COOKIE, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, empty newCookie choice
     */
    @Test
    public void testDecodeSyncInfoValueControlEmptyNewCookie() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x02 );
        bb.put( new byte[]
            {
                ( byte ) 0x80, 0x00, // syncInfoValue ::= CHOICE {
                                     //     newCookie [0] syncCookie
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );
        decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.NEW_COOKIE, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    //--------------------------------------------------------------------------------
    // RefreshDelete choice tests
    //--------------------------------------------------------------------------------
    /**
     * Test the decoding of a SyncInfoValue control, refreshDelete choice,
     * refreshDone = true
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshDelete() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0A );
        bb.put( new byte[]
            {
                ( byte ) 0xA1, 0x08, // syncInfoValue ::= CHOICE {
                                     //     refreshDelete [1] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie       syncCookie OPTIONAL,
                0x01,
                0x01,
                ( byte ) 0xFF //         refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x07 );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA1, 0x05, // syncInfoValue ::= CHOICE {
                                         //     refreshDelete [1] SEQUENCE {
                    0x04,
                    0x03,
                    'a',
                    'b',
                    'c' //         cookie       syncCookie OPTIONAL,
            } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshDelete choice,
     * refreshDone = false
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshDeleteRefreshDoneFalse() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0A );
        bb.put( new byte[]
            {
                ( byte ) 0xA1, 0x08, // syncInfoValue ::= CHOICE {
                                     //     refreshDelete [1] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie       syncCookie OPTIONAL,
                0x01,
                0x01,
                ( byte ) 0x00 //         refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshDelete choice,
     * no refreshDone
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshDeleteNoRefreshDone() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x07 );
        bb.put( new byte[]
            {
                ( byte ) 0xA1, 0x05, // syncInfoValue ::= CHOICE {
                                     //     refreshDelete [1] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c' //         cookie       syncCookie OPTIONAL,
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshDelete choice,
     * no cookie
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshDeleteNoCookie() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x05 );
        bb.put( new byte[]
            {
                ( byte ) 0xA1, 0x03, // syncInfoValue ::= CHOICE {
                                     //     refreshDelete [1] SEQUENCE {
                0x01,
                0x01,
                0x00 //        refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshDelete choice,
     * no cookie, no refreshDone
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshDeleteNoCookieNoRefreshDone() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x02 );
        bb.put( new byte[]
            {
                ( byte ) 0xA1, 0x00 // syncInfoValue ::= CHOICE {
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    //--------------------------------------------------------------------------------
    // RefreshPresent choice tests
    //--------------------------------------------------------------------------------
    /**
     * Test the decoding of a SyncInfoValue control, refreshPresent choice,
     * refreshDone = true
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshPresent() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0A );
        bb.put( new byte[]
            {
                ( byte ) 0xA2, 0x08, // syncInfoValue ::= CHOICE {
                                     //     refreshPresent [2] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie       syncCookie OPTIONAL,
                0x01,
                0x01,
                ( byte ) 0xFF //         refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x07 );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA2, 0x05, // syncInfoValue ::= CHOICE {
                                         //     refreshPresent [2] SEQUENCE {
                    0x04,
                    0x03,
                    'a',
                    'b',
                    'c' //         cookie       syncCookie OPTIONAL,
            } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshPresent choice,
     * refreshDone = false
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshPresentRefreshDoneFalse() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0A );
        bb.put( new byte[]
            {
                ( byte ) 0xA2, 0x08, // syncInfoValue ::= CHOICE {
                                     //     refreshPresent [2] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie       syncCookie OPTIONAL,
                0x01,
                0x01,
                ( byte ) 0x00 //         refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshPresent choice,
     * no refreshDone
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshPresentNoRefreshDone() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x07 );
        bb.put( new byte[]
            {
                ( byte ) 0xA2, 0x05, // syncInfoValue ::= CHOICE {
                                     //     refreshPresent [2] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c' //         cookie       syncCookie OPTIONAL,
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshPresent choice,
     * no cookie
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshPresentNoCookie() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x05 );
        bb.put( new byte[]
            {
                ( byte ) 0xA2, 0x03, // syncInfoValue ::= CHOICE {
                                     //     refreshPresent [2] SEQUENCE {
                0x01,
                0x01,
                0x00 //        refreshDone  BOOLEAN DEFAULT TRUE
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, refreshPresent choice,
     * no cookie, no refreshDone
     */
    @Test
    public void testDecodeSyncInfoValueControlRefreshPresentNoCookieNoRefreshDone() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x02 );
        bb.put( new byte[]
            {
                ( byte ) 0xA2, 0x00 // syncInfoValue ::= CHOICE {
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDone() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    //--------------------------------------------------------------------------------
    // syncIdSet choice tests
    //--------------------------------------------------------------------------------
    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, empty
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetEmpty()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x02 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x00, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not get there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, cookie
     * but no UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieNoSet()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x07 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x05, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie       syncCookie OPTIONAL,
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not get there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, no cookie
     * a refreshDeletes flag, but no UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetNoCookieRefreshDeletesNoSet()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x05 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x03, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x01,
                0x01,
                0x00, //         refreshDeletes BOOLEAN DEFAULT FALSE,
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not get there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, a cookie
     * a refreshDeletes flag, but no UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieRefreshDeletesNoSet()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0A );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x08, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x01,
                0x01,
                0x00, //         refreshDeletes BOOLEAN DEFAULT FALSE,
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not get there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, no cookie
     * no refreshDeletes flag, an empty UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetNoCookieNoRefreshDeletesEmptySet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x04 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x02, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, no cookie
     * no refreshDeletes flag, a UUID set with some values
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetNoCookieNoRefreshDeletesUUIDsSet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x3A );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x38, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x31,
                0x36, //         syncUUIDs SET OF syncUUID
                0x04,
                0x10, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x04,
                0x10, // syncUUID
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x04,
                0x10, // syncUUID
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
        }

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, A cookie
     * no refreshDeletes flag, an empty UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieNoRefreshDeletesEmptySet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x09 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x07, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, a cookie
     * no refreshDeletes flag, a UUID set with some values
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieNoRefreshDeletesUUIDsSet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x3F );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x3D, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x31,
                0x36, //         syncUUIDs SET OF syncUUID
                0x04,
                0x10, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x04,
                0x10, // syncUUID
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x04,
                0x10, // syncUUID
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertFalse( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
        }

        // Check the encoding
        try
        {
            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, no cookie
     * a refreshDeletes flag, an empty UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetNoCookieRefreshDeletesEmptySet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x07 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x05, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x07 );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA3, 0x05, // syncInfoValue ::= CHOICE {
                                         //     syncIdSet [3] SEQUENCE {
                    0x01,
                    0x01,
                    ( byte ) 0xFF, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                    0x31,
                    0x00, //         syncUUIDs SET OF syncUUID
                } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, a cookie
     * no refreshDeletes flag, a UUID set with some values
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetNoCookieRefreshDeletesUUIDsSet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x3D );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x3B, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x36, //         syncUUIDs SET OF syncUUID
                0x04,
                0x10, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x04,
                0x10, // syncUUID
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x04,
                0x10, // syncUUID
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
        }

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x3D );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA3, 0x3B, // syncInfoValue ::= CHOICE {
                                         //     syncIdSet [3] SEQUENCE {
                    0x01,
                    0x01,
                    ( byte ) 0xFF, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                    0x31,
                    0x36, //         syncUUIDs SET OF syncUUID
                    0x04,
                    0x10, // syncUUID
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x04,
                    0x10, // syncUUID
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x04,
                    0x10, // syncUUID
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03
            } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, a cookie
     * a refreshDeletes flag, an empty UUID set
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieRefreshDeletesEmptySet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x0C );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x0A, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x00, //         syncUUIDs SET OF syncUUID
            } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x0C );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA3, 0x0A, // syncInfoValue ::= CHOICE {
                                         //     syncIdSet [3] SEQUENCE {
                    0x04,
                    0x03,
                    'a',
                    'b',
                    'c', //         cookie         syncCookie OPTIONAL,
                    0x01,
                    0x01,
                    ( byte ) 0xFF, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                    0x31,
                    0x00, //         syncUUIDs SET OF syncUUID
                } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, a cookie
     * a refreshDeletes flag, a UUID set with some values
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetCookieRefreshDeletesUUIDsSet() throws Exception
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x42 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x40, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x36, //         syncUUIDs SET OF syncUUID
                0x04,
                0x10, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x04,
                0x10, // syncUUID
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x02,
                0x04,
                0x10, // syncUUID
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03,
                0x03
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        SyncInfoValue syncInfoValue = ( SyncInfoValue ) ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );

        assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
        assertEquals( "abc", Strings.utf8ToString( syncInfoValue.getCookie() ) );
        assertTrue( syncInfoValue.isRefreshDeletes() );
        assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );

        for ( int i = 0; i < 3; i++ )
        {
            byte[] uuid = syncInfoValue.getSyncUUIDs().get( i );

            for ( int j = 0; j < 16; j++ )
            {
                assertEquals( i + 1, uuid[j] );
            }
        }

        // Check the encoding
        try
        {
            ByteBuffer buffer = ByteBuffer.allocate( 0x42 );
            buffer.put( new byte[]
                {
                    ( byte ) 0xA3, 0x40, // syncInfoValue ::= CHOICE {
                                         //     syncIdSet [3] SEQUENCE {
                    0x04,
                    0x03,
                    'a',
                    'b',
                    'c', //         cookie         syncCookie OPTIONAL,
                    0x01,
                    0x01,
                    ( byte ) 0xFF, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                    0x31,
                    0x36, //         syncUUIDs SET OF syncUUID
                    0x04,
                    0x10, // syncUUID
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x01,
                    0x04,
                    0x10, // syncUUID
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x02,
                    0x04,
                    0x10, // syncUUID
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03,
                    0x03
            } );
            buffer.flip();

            ByteBuffer encoded = ( ( SyncInfoValueDecorator ) syncInfoValue ).encode( ByteBuffer
                .allocate( ( ( SyncInfoValueDecorator ) syncInfoValue ).computeLength() ) );
            assertEquals( Strings.dumpBytes( buffer.array() ), Strings.dumpBytes( encoded.array() ) );
        }
        catch ( EncoderException ee )
        {
            fail();
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, with some
     * invalid UUID
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetTooSmallUUID()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x1D );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x1B, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x11, //         syncUUIDs SET OF syncUUID
                0x04,
                0x0F, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );

        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not be there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }

    /**
     * Test the decoding of a SyncInfoValue control, syncIdSet choice, with some
     * invalid UUID
     */
    @Test
    public void testDecodeSyncInfoValueControlSyncIdSetTooLongUUID()
    {
        ByteBuffer bb = ByteBuffer.allocate( 0x20 );
        bb.put( new byte[]
            {
                ( byte ) 0xA3, 0x1E, // syncInfoValue ::= CHOICE {
                                     //     syncIdSet [3] SEQUENCE {
                0x04,
                0x03,
                'a',
                'b',
                'c', //         cookie         syncCookie OPTIONAL,
                0x01,
                0x01,
                0x10, //         refreshDeletes BOOLEAN DEFAULT FALSE,
                0x31,
                0x13, //         syncUUIDs SET OF syncUUID
                0x04,
                0x11, // syncUUID
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01,
                0x01
        } );
        bb.flip();

        SyncInfoValue decorator = new SyncInfoValueDecorator( codec );
        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );

        try
        {
            ( ( SyncInfoValueDecorator ) decorator ).decode( bb.array() );
            fail( "Should not be there" );
        }
        catch ( DecoderException de )
        {
            assertTrue( true );
        }
    }
}

redpajama_set_name: RedPajamaGithub


Police are supposed to keep our cities and states safe by taking dangerous drivers and criminals out of the public eye. While police are devoted to reducing accidents by eliminating the amount of drunk drivers and reckless motorists on the road, a recent crash caused law enforcement to re-think whether or not their own driving practices are safe. This past week, a police chase involving a stolen car ended in an awful collision. The police car, as well as the pursued individual's automobile both crashed into an in unsuspecting bus. The car's driver and a passenger in the stolen vehicle were taken to the hospital with serious injuries. The driver also had a two-year old son in the back of the car, who was hurt significantly.
The transit bus that was hit was damaged badly. After smashing into the bus, the driver plowed into a home, wrecking the construction and causing unspeakable damage. Currently, there aren't a lot of rules when it comes to police chases in Florida. The officers need to notify local police when a pursuit enters their jurisdiction, but there are no guidelines for safe driving. In this Gulfport crash, the police were in pursuit of a stolen vehicle for 14 minutes before the dangerous collision.
Police Chief Robert Vincent is currently examining portions of the policy related to pursuing vehicles in nearby cities to see if any changes need to happen. If the code is updated, it will mean that suspects that are chased in a non-approved manner may be able to use this to help their case in court. Talk to a Tampa lawyer who knows the constantly changing laws and statutes to make sure that your case is in the hands of someone professional and hard-working.


Dameware is a program that, put as simple as possible, allows a computer's outputs and inputs to be shared. In practice this technology is often used both for support based needs, such as end-user support or internal system support and repair, as well as for use in configuration and maintenance. Its one of the most (if not the most) versatile RMM software suites on the market as of 2019.
On the one side it's quite a lot easier to show a user or co-worker a solution, or simply take control of the system and perform the fix necessary yourself rather than have to explain to them how to do it, step by step!
On the other side being able to sit at one system while remotely configuring and setting up a dozen others massively increases productivity. Not having to walk all over a large office or campus can save a great deal of time!
Remote control software, often just called remote software, is incredibly common and heavily used in today's computing environment. In a technological world built online it only makes sense to be able to share access and control in order to facilitate a range of both support and non-support needs.
The program holds a suite of functionality for remote support, management, and general oversight of a network environment configured to work with it. The entire suite is known as the "Dameware Remote Support" suite, or DRS.
DRS has two basic methods for functionality. It can work directly from a direct client-to-server setup but it also has the ability to function over a centralized-server which allows for a remarkable level of ease in managing a huge range of computers, while also offering expanded functionality in managing and monitoring those systems!
When installing Dameware in a centralized fashion there are three particular portions to bear in mind which need to be installed and configured, depending on the particular needs of the environment.
The "Central Server" is, as the name implies, the basic server component for the entire DRS software. The "Central Server" is absolutely necessary in any centralized environment. This component gives administrators access to setting up and configuring Dameware users, provides license management and inventory, host listing, current sessions, and so forth. The second component, the "Internet Proxy", is generally only necessary when there will be remote support provided outside your firewall and internal network environment. It is recommended to install the Internet Proxy on a separate system from the Central Server and to setup this other system as a DMZ – which means, of course, that other precautions must be taken when setting up and configuring this particular system! Lastly, a third component is required for performing any sort of remote support with mobile devices, which intuitively enough requires the "Mobile Gateway" to be installed and configured.
The stand-alone mode lacks some of the centralized functionality but is quite easy to install – DRS needs simply be installed on each of the user workstations to be supported. This does prevent centralized management of users, sharing of host lists, and loses the functionality of the Internet Proxy for making external connections easier.
DRS has several modes for initiating remote and each one has its benefits and situational usefulness. The screenshot on the left shows the basic remote initiation screen, with all of its various options.
The MRC Viewer is the most common and ideal option – it provides all the full functionality of the DRS with a wide swathe of tools and added features. However, due to compatibility or systems specifics some of the other modes may be necessary to use.
The RDP Mode is the basic Windows RDP and, as such, sacrifices many of the advanced and expanded features of DRS. Even so it can be a perfectly fine option for providing basic support or making simple adjustments, or simply installing/setting up the DRS software so as to be able to start a proper remote!
The VNC Viewer remote is unique in that it can connect to both Linux and Mac based environments to provide remote support. Most of the DRS functionality exists in this form.
Finally, the Intel AMT KVM is a unique feature that allows a remote to be initiated to a system which is in a sleep, hibernating, or powered-off state, thus granting a wonderful extra tool for not being left out in the cold if a user turned off a system or in the event of power loss or other uncontrollable circumstances. It can even initiate systems which have experienced a crash at times, thus allowing for recovery even when you can't physically reach the machine in question! It's worth emphasizing that this even allows access to BIOS and boot menus remotely, which can be extremely valuable at times.
This same window even allows you to customize encryption and security options, which also has full support for smart-card based authentication! Images and simple file transfers can also have encryption enabled, providing a greater level of peace of mind when dealing with systems which may have sensitive information on them.
Making a connection via an "Internet Session" can be a little trickier than internal. It usually requires some sort of user-action to initiate the remote and, further, depends on a proper configuration of the Internet Proxy as above. Thankfully, there are several features of the Internet Session in DRS that simplify this. The connection details can be copied via clipboard and sent via internal messaging or other digital communication but, quite often, e-mail is easiest! It will draft and prepare a simple email with a direct link to the necessary page for the user system to initiate remote.
As far as system compatibility goes, Dameware covers most of the major environments. The Server portion must be installed in a Windows environment, but functions in both server and non-server versions. Windows Vista, 7, 8, 8.1, and 10 are fully supported while Windows Server 2008 and 2012, including R2, are fully supported on the Windows Server side.
The systems which can be connected to are extremely broad – any Windows system from XP SP2 and up can be remoted into, as well as Mac and Linux systems via the VNC Viewer for compatible systems. Additionally, support is also offered for iOS 6.x and 7.x, including tablets and other Apple devices running the proper OS, and Android 4.1-4.4!
With screen share, even lacking remote control, the ability to provide support and feedback grows exponentially. Users don't have to rely on spoken directions to find what they need to find, and technicians don't need to rely on often-inaccurate descriptions by users who aren't sure of exactly what they are looking for.
Once a remote is initiated Dameware has a large toolbar along the top which offers an immense range of functionality, the basics of which will be discussed just below! The most basic functionality of any remote software is, of course, screen sharing.
DRS supports, with encryption options, file transfers to and from systems over remote session. This can facilitate easily transferring patches, installers, utilities, or other useful files while, at the same time, making it easy to snag files from the remote system such as logs, crash dumps, or other helpful data.
Instant messaging via remote is an especially useful feature when working a remote session without a user on the phone, or simply when it will take quite a while and there's no need to stay on the phone. Being able to simply drop a message and have it waiting (or for the user to do the same) can be a very convenient way to communicate while performing tasks via remote.
As mentioned above DRS provides Smart Card support which provides an immense benefit – technicians can reap the wonderful time-saving perks of remotes without having to compromise security in the slightest.
DRS can connect to both servers and workstations alike, meaning that support and management need not be limited to end-user. Servers at other offices or other important infrastructure can just as easily be managed remotely – and duet o the Intel AMT KVM you need not worry about having to perform a restart or reboot and losing remote, as it can be re-initiated through the console!
DRS also provides Active Directory functionality in compatible versions of Windows – it can unlock user accounts, reset passwords, as well as create and edit users, security groups, and organizational units.
Group policies can be edited and changed and DRS can even perform a broad export of AD settings into several formats, facilitating the easy mirroring of numerous complex settings.
Sessions can be recorded, providing peace of mind for user and technician alike, while also offering excellent opportunities as far as oversight and further education and training goes.
Settings exist to configure alerts and enact monitoring via DRS, expanding functionality further beyond just support and management.
Many of the other buttons on the toolbar provide a great deal of other functionality as well – printing, screenshots, annotation, screen/keyboard/mouse lock, and more.
Utilizing the centralized server for management provides a great deal of power from a single system with access to as many others as are configured for it. AD can be managed from this location, monitoring and alerts can be setup, and a great deal of functionality for automating daily tasks or scripts is also built in! There's an immense amount of power in DRS when setup to provide support and ease management to an environment, which is by no means limited to just Windows desktop computers. Thanks to the Mobile Gateway and VNC Viewer compatibility, even non-Windows systems are fully covered and available for remote support.
Overall Dameware is a powerful utility with a great deal of functionality that can help any environment not only resolve issues and problems more quickly but also to run more smoothly the entire time, as well! Too often tools are singular in their purpose, when a little added functionality goes a long way. There is such a thing as too many cooks, of course, but DRS strikes an excellent balance between depth and breadth of features.
Grab a Free Trial of DameWare and get it installed to test its Functionality!


B-25, also called Mitchell, U.S. medium bomber used during World War II. The B-25 was designed by North American Aviation, Inc., in response to a prewar requirement and was first flown in 1940. A high-wing monoplane with a twin tail and tricycle landing gear, it was powered by two 1,700-horsepower Wright radial engines, had a wingspan of 67 feet 7 inches (20.6 metres), was 53 feet 6 inches (16.3 metres) long, and carried a crew of four to six. The B-25 had a range of 1,350 miles (2,175 km), a maximum speed of about 300 miles (480 km) per hour, and a ceiling of 24,000 feet (7,300 metres). It could carry 3,000 pounds (1,360 kg) of bombs internally in the bomb bay and more externally on underwing racks.
The B-25 was built in a number of versions with wide variations in offensive and defensive armament. The B-25B, the first version to see widespread combat, had turrets mounting twin 0.50-inch (12.7-mm) machine guns in the upper fuselage, belly, and tail. The upper fuselage and belly turrets were powered; in addition, the belly turret was retractable and was fired remotely by a gunner inside the fuselage. Though the B-25 was intended primarily for short-range daylight bombing missions, a considerable number had the Plexiglas nose for bomb aiming replaced with a "solid" nose mounting heavy forward-firing armament for ground strafing and for flak suppression during attacks on enemy shipping. In these cases the most common forward-firing armament was the 0.50-inch machine guns, eight being the typical number; however, the B-25H and G versions were armed with a 3-inch (75-mm) cannon plus four forward-firing machine guns. The final production version, the B-25J, had a larger internal bomb bay and no belly turret, but it had flexible manually operated single 0.50-inch guns in waist positions and four fixed forward-firing guns in external "package" mounts on the sides of the forward fuselage. The B-25J was built both with a transparent nose for bombing and with a solid nose mounting eight machine guns for strafing.
About 9,800 B-25s were produced during the war. They saw service in all theatres, though in larger numbers and to greater effect in the Mediterranean and Pacific. They were used by the British Royal Air Force and the Soviet Red Air Force as well as the U.S. Army Air Forces. The B-25's most spectacular exploit was its use in the April 18, 1942, bombing raid on Tokyo led by Lieutenant Colonel (later Lieutenant General) James Doolittle. These planes were launched from the aircraft carrier USS Hornet, an unprecedented feat for medium bombers. The B-25's most important contribution to Allied victory was in the Southwest Pacific area, where the 5th Air Force used it with devastating effect in skip-bombing attacks on Japanese shipping and to drop fragmentation bombs by parachute on Japanese airfields. The B-25 was a pleasant aircraft to fly and was easy to maintain under primitive field conditions, a significant factor in the Southwest Pacific. It was used by the Air Force as a liaison aircraft and as light transport into the mid-1950s.


text:
Q: How to select row with the highest values in Laravel I am trying to select 3 rows that have the 3 highest values in Laravel. How can I do this?
$data = DB::table('election')->select('election_id')->take(3)->max('votes');

This is not working

A: I was able to solve this issue by using the following code;
$data =  DB::table('election')
                ->select('election_id', DB::raw("(select max('votes') from election)"))
                ->take(3)->get();

redpajama_set_name: RedPajamaStackExchange


text:
It's Official: Martin Scorsese to Direct the Adaptation of 'The Snowman'
by Ethan Anderton
Source: THR
Towards the end of October, there were rumblings that director Martin Scorsese would follow his foray into children's material with the adaptation of Hugo by taking on a project that would bring him back to dark crime drama in the form of an adaptation of Jo Nesbo's Norwegian thriller The Snowman. Now THR has word that Scorsese is indeed confirmed to be at the helm of the film after the author himself gave approval and revealed the news to an unnamed Swedish newspaper. The seventh novel in a series featuring Nesbo's recurring detective Harry Hole sees the investigator looking into gruesome killings in Oslo, Norway.
Specifically, the case concerns a missing woman whose pink scarf is found wrapped around an ominous-looking snowman, and just might be the work of a serial killer. Writer Matthew Michael Carnahan (State of Play, World War Z) is behind the adaptation which could very well serve as a jumping off point for a new crime thriller franchise not unlike The Girl with the Dragon Tattoo. As of now, it's not clear whether this will be Scorsese's next project, but since he's been circling it for awhile, that would probably be a safe bet. Interestingly enough, Nesbo also says he's not dedicated to forcing the film's story to stay located in Oslo, so perhaps Scorsese will move it to a location somewhere in the United States? We'll have to wait and see.
Find more posts: Development, Movie News
Thank God. This seems exciting....Hugo looks horrid!
Moon on Nov 21, 2011
Another movie that Marty will never direct. He just turned 69 and he is attached to direct 11 movies.
Rovena on Nov 21, 2011

redpajama_set_name: RedPajamaCommonCrawl


text:
La EC 1.15 è una sottoclasse della classificazione EC relativa agli enzimi. Si tratta di una sottoclasse delle ossidoreduttasi che include enzimi che utilizzano superossido come accettore di elettroni.

Sotto-sottoclassi
Esiste un'unica sotto-sottoclasse, la EC 1.15.1.

Note

redpajama_set_name: RedPajamaWikipedia


Connect with awesome new people in the newest playground of musicians and various other type of artists. Find new talents or meet your favourites.
Keep track of all events near you and see what events your friends are attending. You can easily buy tickets online and reserve your spot at your favourite events.
Extremely secure, you are always the one who decides what you do with your data, you can completely delete your account at any point, without any restrictions.


It's always the same! If you don't want to go into the venue with the masses and wait a little longer, you'll miss the first songs of the opener! The Swedish Dark Tranquillity were well chosen to open the night. Full power from the moment they entered the stage! The quintet presented a mixture of songs from their black metal era and newer stuff which is more speed / power metal like. Perhaps it's caused by the new line-up or it might be just a progression... Anyway, the progressive rock touch the new material has, made the sound more interesting! The song mix pleased the audience and it seems that the new album will bring them more attention.... We'll see when they'll come on tour in fall!
Next another Scandinavian act and label mates from Dark Tranquillity... The Finnish Sentenced! The band of singer Ville Laihiala played some of their classics as well as new stuff from their latest release Crimson. Like Dark Tranquillity their past was more black metal like and has developed into power metal. Everyone who saw them before knew that they are talented and play live is fun for them. So they rocked the house and the fans sang along. No. 3 of tonight were Anathema. The British played a decent set, but the audience kinda cooled down. After two power metal acts the music of the English was not powerful enough to keep the fans hot. Their sound was a little boring after the powerful Scandinavian acts, but the ballads were emotional and gave me goose-bumps.
With a big bang (thanks to the pyro-technician) Demons & Wizards entered the stage. The expectations the fans had were huge and Jon Schaffer (Iced Earth) and Hansi Kürsch (Blind Guardian) gave their best to satisfy the fans. Due to Hansi's unique voice and the partly Blind Guardian influenced riffing a more BG-kinda sound. Probably also through the bass player Oliver who played on the last BG tour, too. The band played their 2nd show and due to the fact that they hadn't enough time to rehearse the songs to choose from were limited. They played the whole album and as encore AC/DC's Hells Bells and Alice Cooper's School's Out. Especially the AC/DC cover profit from the powerful drumming of Richard Christy (Iced Earth, Death, Control Denied).
Last, but not least the German prog power metaller of Vanden Plas entered the stage. Unfortunately many left after Demons & Wizards and missed a good show! The band from Kaiserslautern were clever enough to kick the ballads off the setlist and played more powerful tracks like Rainmaker and Far Off Grace. Vanden Plas gave every band member the possibility to show their talent in soli. Again the band of singer Andi Kuntz offered a great show and they are still underrated.
Conclusion of the event: The crew of Pratteln's Z7 did a great job and got together a pretty good billing! Thanks!
For most fans it was a surprise to see Angel Dust opening the warm-up show of Demons & Wizards. Quiet a few fans waited patiently in front of the Kulturfabrik, fans also came from Holland and Belgium to witness the premier show of the German-American collaboration.
The Dortmund based band just released their 3rd after their comeback which is called Enlighten The Darkness. During the show singer Dirk Thurisch and his mates almost presented new material to see how it works live. And it worked out fine! Nothing more to say!
After a break the premier show of Demons & Wizards started with a big bang. Due to the fact that the band had just one day to rehearse the show wasn't perfect, but quite good. The band of Blind Guardian's Hansi Kürsch (just doing vocals) and Iced Earth's Jon Schaffer presented all songs from the debut album live and got a helping hand from Richard Christy (Death, Control Denied) on drums, a guitarist I don't know (sorry, but I can't know everybody!) and on bass Oliver, a German guy. Visually the band got supported by a decent light show, pyros and back drops to pose in front of. The time between the songs was a little longer as usual, but Hansi talked to the fans and made jokes, so the people didn't really recognize the little breaks. After the main part which shows the album tracks, the quintet played during the encore 3 cover versions of classical metal tracks. The guys offered Alice Cooper's School's Out, Iron Maiden's The Trooper and at least AC/DC's Hells Bells.


text:
Carlo Crotti (born September 9, 1900) was an Italian professional football player.

His older brother Enrico Crotti also played football professionally. To distinguish them, Enrico was known as Crotti I and Carlo as Crotti II.

Honours
 Serie A champion: 1930/31.

1900 births
Year of death missing
Italian footballers
Serie A players
Novara F.C. players
Juventus F.C. players
A.S.D. HSL Derthona players
Association football forwards


Planning a Walt Disney World vacation is serious business! It is amazing to learn about the different things that guests will do to in order to get a leg up on booking dining, FastPass+ and more. We have learned one of the tricks that some guests were doing that Disney is going to put a stop to. There are guests that would book a resort package at Walt Disney World in order to use the 60 day window to make their FastPass+ selections. The policy is that resort guests get to make selections at 60 days and all other guests get to make their selections at 30 days in advance. These guests would book their resort package, make their FastPass+ selections and then cancel the resort reservation. This would allow them to keep their FastPass+ selections but then stay somewhere off property. There was previously nothing in place to cancel these selections or stop this from happening.
We have learned that Disney will be fixing this in February. Now Disney will automatically be cancelling FastPass+ reservations when resort stays are cancelled. Guests would have to re-book their FastPass+ selections in their appropriate 30 day window since the selections they made would be cancelled. Apparently this abuse of the resort booking for FastPass+ was happening more frequently than we might think, causing Disney to take action. This action is being put in place to help preserve this bonus perk for guests who actually intend to stay at Walt Disney World and enjoy the many perks that are offered for doing so.
What do you think of this new policy change?


text:
The Solomon R. Guggenheim Foundation : Temporary Helpdesk Analyst
The Solomon R. Guggenheim Museum is seeking a temporary Help Desk Analyst (3-4 months' duration) to provide support of the organization's Mac and Windows-based desktop hardware and software environment. The position is responsible for Tier 1 Help Desk support and other technical requirements, as assigned.
Founded in 1937, the Solomon R. Guggenheim Foundation is dedicated to promoting the understanding and appreciation of art, primarily of the modern and contemporary periods, through exhibitions, education programs, research initiatives, and publications. The Guggenheim network that began in the 1970s when the Solomon R. Guggenheim Museum, New York, was joined by the Peggy Guggenheim Collection, Venice, has since expanded to include the Guggenheim Museum Bilbao (opened 1997) and the Guggenheim Abu Dhabi (currently in development). Looking to the future, the Guggenheim Foundation continues to forge international collaborations that take contemporary art, architecture, and design beyond the walls of the museum. More information about the foundation can be found at guggenheim.org.
Level 1 support of the foundation's desktop hardware/software (Windows 10, and Mac) environment, printers, other infrastructure components and business applications.
Support of the organization's desktop hardware/software environment (OSX; Windows 10. Windows Server 2008 – 2012; Ubuntu Linux, Office 2016, other applications), printers (desktop and Multi-function), additional infrastructure components and business applications. This includes installations, moves, adds, changes, remote user support and technical problem resolution.
Desktop-related projects, such as software standardization, image creation and anti-virus management.
Desktop software distribution, patch management and upgrades.
Maintain desktop inventory and develop a replacement schedule based on established refresh cycle.
Provide iPad support.
Stay abreast of emerging technologies and provide recommendations pertaining to the continual evolution of the organization's technology infrastructure.
Develop and update documentation for supported systems.
Participation in the department's after hour "on call" support rotation.
Other activities, as assigned by the Chief Information Officer and Help Desk Manager.
Minimum 3 years' experience in providing desktop support services, with applicable technologies/platforms. This should include a very strong background with Mac OS and iOS platforms, as well as solid working familiarity supporting Windows 10 and Microsoft Office.
A strong customer service-orientation.
Excellent communication skills, both verbal and written.
Knowledge of networking concepts and technologies.
Vendor coordination and service level management experience.
Background in remote access support.
Understanding of best practices, with respect to security and compliance.
Experience authoring and updating technical documentation.
Flexibility, including effective handling of multiple, concurrent priorities.
Practical project management experience, desirable.
The Guggenheim offers a competitive salary and access to a variety of cultural institutions, discounts to museum stores, and a stimulating and collegial work environment.
The Solomon R. Guggenheim Foundation is an equal opportunity employer.
To apply, visit: https://www.paycomonline.net/v4/ats/web.php/jobs/ViewJobDetails?job=4090&clientkey=FA4C03DD948FB8D8FDD4D8BEABC35BDD


text:
Flight Literacy
Flight Training Educational Materials
Basic Flight Training
Basic Aircraft Flight
Airplane Ownership – General Aviation Information
Advanced Flight Training
Instrument Flight Rules
Instrument Procedures
Flight Navigation
Aircraft Weight and Balance
Advanced Avionics
Aviation Instructor Training
Glider Flying
Weight-Shift Control Aircraft Flight
Helicopter Flight Training
Advisory Circulars
You are here: Home / Instrument Flight Rules / IFR Flight / Instrument Weather Flying (Part Two)
Instrument Weather Flying (Part Two)
Filed Under: IFR Flight
Volcanic eruptions create volcanic ash clouds containing an abrasive dust that poses a serious safety threat to flight operations. Adding to the danger is the fact that these ash clouds are not easily discernible from ordinary clouds when encountered at some distance from the volcanic eruption.
When an aircraft enters a volcanic ash cloud, dust particles and smoke may become evident in the cabin, often along with the odor of an electrical fire. Inside the volcanic ash cloud, the aircraft may also experience lightning and St. Elmo's fire on the windscreen. The abrasive nature of the volcanic ash can pit the windscreens, thus reducing or eliminating forward visibility. The pitot-static system may become clogged, causing instrument failure. Severe engine damage is probable in both piston and jet-powered aircraft.
Every effort must be made to avoid volcanic ash. Since volcanic ash clouds are carried by the wind, pilots should plan their flights to remain upwind of the ash-producing volcano. Visual detection and airborne radar are not considered a reliable means of avoiding volcanic ash clouds. Pilots witnessing volcanic eruptions or encountering volcanic ash should immediately pass this information along in the form of a pilot report. The National Weather Service (NWS) monitors volcanic eruptions and estimates ash trajectories. This information is passed along to pilots in the form of SIGMETs.
As for many other hazards to flight, the best source of volcanic information comes from PIREPs. Pilots who witness a volcanic eruption or encounter volcanic ash in flight should immediately inform the nearest agency. Volcanic Ash Forecast Transport and Dispersion (VAFTAD) charts are also available; these depict volcanic ash cloud locations in the atmosphere following an eruption and also forecast dispersion of the ash concentrations over 6- and 12-hour time intervals. See AC 00-45, Aviation Weather Services.
A thunderstorm packs just about every weather hazard known to aviation into one vicious bundle. Turbulence, hail, rain, snow, lightning, sustained updrafts and downdrafts, and icing conditions are all present in thunderstorms. Do not take off in the face of an approaching thunderstorm or fly an aircraft that is not equipped with thunderstorm detection in clouds or at night in areas of suspected thunderstorm activity. [Figure 10-16]
Figure 10-16. A thunderstorm packs just about every weather hazard known to aviation into one vicious bundle.
There is no useful correlation between the external visual appearance of thunderstorms and the severity or amount of turbulence or hail within them. All thunderstorms should be considered hazardous, and thunderstorms with tops above 35,000 feet should be considered extremely hazardous.
Weather radar, airborne or ground based, normally reflects the areas of moderate to heavy precipitation (radar does not detect turbulence). The frequency and severity of turbulence generally increases with the radar reflectivity closely associated with the areas of highest liquid water content of the storm. A flightpath through an area of strong or very strong radar echoes separated by 20 to 30 miles or less may not be considered free of severe turbulence.
The probability of lightning strikes occurring to aircraft is greatest when operating at altitudes where temperatures are between –5 ° C and +5 ° C. In addition, an aircraft flying in the clear air near a thunderstorm is also susceptible to lightning strikes. Thunderstorm avoidance is always the best policy.
Flight Literacy Recommends
Rod Machado's Secrets of Instrument Approaches and Departures – If you're an active IFR pilot or preparing for an IPC or even your ATP or IFR rating, then this interactive course is for you. The IFR pilot's weakest link is approach and departure knowledge as it relates to instrument charts.
Wind shear can be defined as a change in wind speed and/or wind direction in a short distance. It can exist in a horizontal or vertical direction and occasionally in both. Wind shear can occur at all levels of the atmosphere but is of greatest concern during takeoffs and landings. It is typically associated with thunderstorms and low-level temperature inversions; however, the jet stream and weather fronts are also sources of wind shear.
As Figure 10-17 illustrates, while an aircraft is on an instrument approach, a shear from a tailwind to a headwind causes the airspeed to increase and the nose to pitch up with a corresponding balloon above the glidepath. A shear from a headwind to a tailwind has the opposite effect, and the aircraft will sink below the glidepath.
Figure 10-17. Glideslope deviations due to wind shear encounter. [click image to enlarge]
A headwind shear followed by a tailwind/downdraft shear is particularly dangerous because the pilot has reduced power and lowered the nose in response to the headwind shear. This leaves the aircraft in a nose-low, power-low configuration when the tailwind shear occurs, which makes recovery more difficult, particularly near the ground. This type of wind shear scenario is likely while making an approach in the face of an oncoming thunderstorm. Pilots should be alert for indications of wind shear early in the approach phase and be ready to initiate a missed approach at the first indication. It may be impossible to recover from a wind shear encounter at low altitude.
To inform pilots of hazardous wind shear activity, some airports have installed a Low-Level Wind Shear Alert System (LLWAS) consisting of a centerfield wind indicator and several surrounding boundary-wind indicators. With this system, controllers are alerted of wind discrepancies (an indicator of wind shear possibility) and provide this information to pilots. A typical wind shear alert issued to a pilot would be:
"Runway 27 arrival, wind shear alert, 20 knot loss 3 mile final, threshold wind 200 at 15"
In plain language, the controller is advising aircraft arriving on runway 27 that at about 3 miles out they can expect a wind shear condition that will decrease their airspeed by 20 knots and possibly encounter turbulence. Additionally, the airport surface winds for landing runway 27 are reported as 200° at 15 knots.
Pilots encountering wind shear are encouraged to pass along pilot reports. Refer to AIM for additional information on wind shear PIREPs.
VFR-On-Top
Pilots on IFR flight plans operating in VFR weather conditions may request VFR-on-top in lieu of an assigned altitude. This permits them to select an altitude or flight level of their choice (subject to any ATC restrictions).
Pilots desiring to climb through a cloud, haze, smoke, or other meteorological formation and then either cancel their IFR flight plan or operate VFR-on-top may request a climb to VFR-on-top. The ATC authorization contains a top report (or a statement that no top report is available) and a request to report upon reaching VFR-on-top. Additionally, the ATC authorization may contain a clearance limit, routing, and an alternative clearance if VFR-on-top is not reached by a specified altitude.
A pilot on an IFR flight plan, operating in VFR conditions, may request to climb/descend in VFR conditions. When operating in VFR conditions with an ATC authorization to "maintain VFR-on-top/maintain VFR conditions," pilots on IFR flight plans must:
Fly at the appropriate VFR altitude as prescribed in 14 CFR part 91.
Comply with the VFR visibility and distance-fromcloud criteria in 14 CFR part 91.
Comply with IFR applicable to this flight (minimum IFR altitudes, position reporting, radio communications, course to be flown, adherence to ATC clearance, etc.).
Pilots operating on a VFR-on-top clearance should advise ATC before any altitude change to ensure the exchange of accurate traffic information.
ATC authorization to "maintain VFR-on-top" is not intended to restrict pilots to operating only above an obscuring meteorological formation (layer). Rather, it permits operation above, below, between layers, or in areas where there is no meteorological obstruction. It is imperative pilots understand, however, that clearance to operate "VFR-on-top/VFR conditions" does not imply cancellation of the IFR flight plan.
Pilots operating VFR-on-top/VFR conditions may receive traffic information from ATC on other pertinent IFR or VFR aircraft. However, when operating in VFR weather conditions, it is the pilot's responsibility to be vigilant to see and avoid other aircraft.
This clearance must be requested by the pilot on an IFR flight plan. VFR-on-top is not permitted in certain areas, such as Class A airspace. Consequently, IFR flights operating VFRon- top must avoid such airspace.
VFR Over-The-Top
VFR over-the-top must not be confused with VFR-ontop. VFR-on-top is an IFR clearance that allows the pilot to fly VFR altitudes. VFR over-the-top is strictly a VFR operation in which the pilot maintains VFR cloud clearance requirements while operating on top of an undercast layer. This situation might occur when the departure airport and the destination airport are reporting clear conditions, but a low overcast layer is present in between. The pilot could conduct a VFR departure, fly over the top of the undercast in VFR conditions, then complete a VFR descent and landing at the destination. VFR cloud clearance requirements would be maintained at all times, and an IFR clearance would not be required for any part of the flight.
Rod Machado's Instrument Pilot's Handbook -Flight Literacy recommends Rod Machado's products because he takes what is normally dry and tedious and transforms it with his characteristic humor, helping to keep you engaged and to retain the information longer. (see all of Rod Machado's Products).
SEARCH FLIGHT LITERACY
Airplane Ownership - General Aviation
Weight-Shift-Control Aircraft
Aircraft Mechanic (flight-mechanic.com)
Easy Campfire Recipes | Recipe Workbook
Copyright © 2021 FlightLiteracy.com


Seed Ranch's hot sauces are not just for adding to food...they are the base for delicious recipes. From avocado toasts, to pasta sauce, to roasted potatoes, and marinades, we have an inspirational flavor for your next kitchen adventure. Our sauces are for dousing, grilling, sauteing, dressing, marinating, and (so we've been told) even drinking.
This four-pack is special because it contains Seed Ranch's Umami Reserve Hot Sauce. This specialty sauce is one-of-a-kind and is made with Chocolate Habanero Peppers; providing an incredible kick to go along with its' rich flavor!
Smoked Jalepeno Hot Sauce- featuring chipotle peppers, dates, and carrots - no sugar added. GF, Vegan, Paleo Friendly, and non-gmo & organic ingredients. The daily best sauce.
Thai Green Hot Sauce- featuring lemongrass, Thai ginger, cilantro, and basil. GF, V, Paleo Friendly, and non-gmo & organic ingredients. This crowd-pleaser is wonderfully different and delicious.
Umami Hot Sauce- featuring porcini mushrooms, capers, and kelp fronds. GF, Vegan, Paleo Friendly, and non-gmo & organic ingredients. An incredible sauce for your kitchen.
Umami Reserve Hot Sauce- featuring a rich, earthy, decadent profile with a dark kick from pounds of organic, 500,000+ Scoville-rated Chocolate Habanero Pepper. GF, plant-based, and non-gmo & organic ingredients.


Volkswagen, Audi Repair Service San Diego Car Sales|Autoexcel, Inc.
VW – Audi Repair, Service & Sales At Its Best In San Diego!
Welcome to Autoexcel where we make your satisfaction our top priority!
Autoexcel is an automotive service and sales center conveniently located in the Miramar area of San Diego.
Providing customers with quality automotive services since 2006.
Independently owned and operated automotive store along with hand-picked pre-owned vehicles at great prices.
We are proud to be a certified "ASE Blue Seal of Excellence" repair center and "MACS" recognized business.
Having more than 25 years VW / Audi brand experience and over 35 years in the automotive industry, we understand the importance and value of having high quality service and competitive prices. Our business has grown through the referrals of our many satisfied customers. We are your logical alternative to the dealership for all scheduled maintenance and repair of your vehicle. Bring in your auto with complete confidence that your vehicle will be serviced correctly while maintaining manufacturer's warranty.
We are qualified to service all makes and models.
We'd like to thank you for visiting our website, and look forward to assisting you.
Experience the advantages that our independently owned service and sales can offer.


text:
Q: How to sum sequence of floors numbers? How can I sum the following sequence:
⌊n∕2⌋ + ⌊n+1∕2⌋ + ⌊n+2∕2⌋ + ...... + (n-1)

What I think is discard the floor and sum what inside each floor !!
This is just a guess.
Give me any hint or general formula that helps me to sum them
Thanks

A: Since you're asking on a programming Q&A site, I must assume you want a computational answer. Here goes...
int sum = 0;
for (int j=0; j<n-1; ++j) {
    sum += (n+j)/2;
}

The int will automatically truncate to the floor.
The less smart ass answer is this. Let n = 2k. Then the sum becomes
k + k + k+1 + k+1 + ... + 2k-1 + 2k-1 = 2(k + k+1 + ... + 2k-1)

and you can use the formula
1 + 2 + ... + a = a(a+1)/2

with a bit of algebra to finish it off.

A: Assuming n is even, then floor(n/2) == floor((n+1)/2).  And floor((n+2)/2) == floor(n/2) + 1.
The other piece in the puzzle is the expression for the sum of an arithmetic sequence, which can be found here.

A: for the arbitrary range 1..20 you could do:
sum = (1..20).inject{|sum, n| sum + (n/2.0).floor}

and of course you could use any range. This example is in Ruby, but you could do something similar in many languages - the algorithm is the same.

A: As long as you're not asking for a clever algorithm or optimizations, the simplest approach I can think of is good old trusty looping. In C#, one way to do that would look something like this:
namespace Practice
{
    using System;

    public class SequenceAggregator
    {
        public double FirstElement
        {
            get;
            set;
        }

        public int Length
        {
            get;
            set;
        }

        public double Calculate()
        {
            double sum = 0;

            for (var i = FirstElement; i < FirstElement + Length; i++)
            {
                sum += Math.Floor(i / 2);
                Console.WriteLine("i={0}, floor(i/2)={1}, sum={1}",
                                  i, Math.Floor(i/2), sum);
            }

            return sum;
        }
    }
}

And you can use this class in the following way:
namespace Practice
{
    using System;

    class Program
    {
        static void Main(string[] args)
        {
            SequenceAggregator a = new SequenceAggregator();
            a.FirstElement = 1;
            a.Length = 3;
            Console.WriteLine("Sum:{0}", a.Calculate());
        }
    }
}


A sweet vintage teacup and saucer! So bright and cheerful with buttercups and bluebells. Green trim.
This vintage teacup is marked, "Royal Albert, Bone China, England." Very good condition, but the pedestal base of the teacup has light crazing. Does not appear to be anywhere else.


You are here: Home » Welcome to the official website of the Project CEBDER! » Welcome to the official website of the Project CEBDER! » Welcome to the official website of the Project CEBDER!
Welcome to the official website of the Project CEBDER!
The Institute of Biodiversity and Ecosystem Research (IBER - BAS) is the organisational affiliation of this project funded by the National Science Fund at the Ministry of Education, Youth and Science of the Republic of Bulgaria, Program "Development of Research Infrastructure" (2008).
The project is carried out by a consortium created by four institutes of the Bulgarian Academy of Sciences and three universities. The total duration of the project is funded by the National Science Fund with 1 450 000 Bulgarian Leva. The participants provide 20% co-funding for purchasing equipment and creation of infrastructural facilities.