text:
'use strict';

describe('CSSProperty', () => {
  var CSSProperty;

  beforeEach(() => {
    jest.resetModules();
    CSSProperty = require('CSSProperty');
  });

  it('should generate browser prefixes for its `isUnitlessNumber`', () => {
    expect(CSSProperty.isUnitlessNumber.lineClamp).toBeTruthy();
    expect(CSSProperty.isUnitlessNumber.WebkitLineClamp).toBeTruthy();
    expect(CSSProperty.isUnitlessNumber.msFlexGrow).toBeTruthy();
    expect(CSSProperty.isUnitlessNumber.MozFlexGrow).toBeTruthy();
    expect(CSSProperty.isUnitlessNumber.msGridRow).toBeTruthy();
    expect(CSSProperty.isUnitlessNumber.msGridColumn).toBeTruthy();
  });
});

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by PhpStorm.
 * User: davis
 * Date: 7/23/17
 * Time: 3:12 AM
 */

namespace DavisPeixoto\BlogCore\Service;

use DavisPeixoto\BlogCore\Repository\AbstractTrailRepository;
use Psr\Log\LoggerInterface;

/**
 * Class GetTrail
 * @package DavisPeixoto\BlogCore\Service
 */
class GetTrail extends AbstractGetService
{
    /**
     * GetTrail constructor.
     * @param AbstractTrailRepository $repository
     * @param string $uuid
     * @param LoggerInterface $logger
     */
    public function __construct(AbstractTrailRepository $repository, string $uuid, LoggerInterface $logger)
    {
        parent::__construct($repository, $uuid, $logger);
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WFTanks.Properties {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WFTanks.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap bitmap {
            get {
                object obj = ResourceManager.GetObject("bitmap", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap brickimage {
            get {
                object obj = ResourceManager.GetObject("brickimage", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap BulletDown {
            get {
                object obj = ResourceManager.GetObject("BulletDown", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap BulletLeft {
            get {
                object obj = ResourceManager.GetObject("BulletLeft", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap BulletRight {
            get {
                object obj = ResourceManager.GetObject("BulletRight", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap BulletUp {
            get {
                object obj = ResourceManager.GetObject("BulletUp", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap down1 {
            get {
                object obj = ResourceManager.GetObject("down1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Down2 {
            get {
                object obj = ResourceManager.GetObject("Down2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Down3 {
            get {
                object obj = ResourceManager.GetObject("Down3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Down4 {
            get {
                object obj = ResourceManager.GetObject("Down4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
        /// </summary>
        internal static System.IO.UnmanagedMemoryStream Drive {
            get {
                return ResourceManager.GetStream("Drive", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap eagle {
            get {
                object obj = ResourceManager.GetObject("eagle", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyDown1 {
            get {
                object obj = ResourceManager.GetObject("EnemyDown1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyDown2 {
            get {
                object obj = ResourceManager.GetObject("EnemyDown2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyDown3 {
            get {
                object obj = ResourceManager.GetObject("EnemyDown3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyDown4 {
            get {
                object obj = ResourceManager.GetObject("EnemyDown4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyLeft1 {
            get {
                object obj = ResourceManager.GetObject("EnemyLeft1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyLeft2 {
            get {
                object obj = ResourceManager.GetObject("EnemyLeft2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyLeft3 {
            get {
                object obj = ResourceManager.GetObject("EnemyLeft3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyLeft4 {
            get {
                object obj = ResourceManager.GetObject("EnemyLeft4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyRight1 {
            get {
                object obj = ResourceManager.GetObject("EnemyRight1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyRight2 {
            get {
                object obj = ResourceManager.GetObject("EnemyRight2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyRight3 {
            get {
                object obj = ResourceManager.GetObject("EnemyRight3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyRight4 {
            get {
                object obj = ResourceManager.GetObject("EnemyRight4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyUp1 {
            get {
                object obj = ResourceManager.GetObject("EnemyUp1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyUp2 {
            get {
                object obj = ResourceManager.GetObject("EnemyUp2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyUp3 {
            get {
                object obj = ResourceManager.GetObject("EnemyUp3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap EnemyUp4 {
            get {
                object obj = ResourceManager.GetObject("EnemyUp4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap explo1 {
            get {
                object obj = ResourceManager.GetObject("explo1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap explo2 {
            get {
                object obj = ResourceManager.GetObject("explo2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap explo3 {
            get {
                object obj = ResourceManager.GetObject("explo3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap explo4 {
            get {
                object obj = ResourceManager.GetObject("explo4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap explo5 {
            get {
                object obj = ResourceManager.GetObject("explo5", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap halfdestroyed {
            get {
                object obj = ResourceManager.GetObject("halfdestroyed", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Left1 {
            get {
                object obj = ResourceManager.GetObject("Left1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Left2 {
            get {
                object obj = ResourceManager.GetObject("Left2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Left3 {
            get {
                object obj = ResourceManager.GetObject("Left3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Left4 {
            get {
                object obj = ResourceManager.GetObject("Left4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
        /// </summary>
        internal static System.IO.UnmanagedMemoryStream newshot {
            get {
                return ResourceManager.GetStream("newshot", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Right1 {
            get {
                object obj = ResourceManager.GetObject("Right1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Right2 {
            get {
                object obj = ResourceManager.GetObject("Right2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Right3 {
            get {
                object obj = ResourceManager.GetObject("Right3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Right4 {
            get {
                object obj = ResourceManager.GetObject("Right4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
        /// </summary>
        internal static System.IO.UnmanagedMemoryStream Shot {
            get {
                return ResourceManager.GetStream("Shot", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Up1 {
            get {
                object obj = ResourceManager.GetObject("Up1", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Up2 {
            get {
                object obj = ResourceManager.GetObject("Up2", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Up3 {
            get {
                object obj = ResourceManager.GetObject("Up3", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Up4 {
            get {
                object obj = ResourceManager.GetObject("Up4", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
    }
}


text:
sudo apt-get install python-qt4

# Apt-Get

sudo apt-get update
sudo apt-get upgrade

# Wget

# Wget SQLite3 v3.8.4.1
cd ~/tmp
wget https://sqlite.org/2014/sqlite-autoconf-3080401.tar.gz
7z x sqlite-autoconf-3080401.tar.gz
7z x sqlite-autoconf-3080401.tar
cd sqlite-autoconf-3080401
chmod +x configure
./configure
make
sudo make install
# Pip modules

    fixme-python-sqlite3()
    {
    # Need SQLite >= 3.7.11
    #https://www.sqlite.org/download.html
    sudo pip install db-sqlite3

    sudo pip install --upgrade --force-reinstall --install-option="build_static" pysqlite

    echo "SQLite3 version should be >= 3.7.11"
    python -c "import sqlite3; print(sqlite3.sqlite_version)"

    python -c "from pysqlite2 import dbapi2 as sqlite3; print(sqlite3.sqlite_version)"

    # Try and build everything from source
    sudo pip uninstall pysqlite

    cd ~/tmp
    wget https://pypi.python.org/packages/source/p/pysqlite/pysqlite-2.6.3.tar.gz#md5=7ff1cedee74646b50117acff87aa1cfa

    tar xzvf pysqlite-2.6.3.tar.gz
    cd pysqlite3

    ed setup.cfg <<EOF
    /SQLITE_OMIT_LOAD_EXTENSION/s/define=/#define=/
    w
    q
    EOF

    wget https://www.sqlite.org/2014/sqlite-amalgamation-3080401.zip
    7z x sqlite-amalgamation-3080401.zip
    mv sqlite-amalgamation-3080401/*.[hc] .

    sudo python setup.py build_static
    sudo python setup.py install

    python <<EOF
    from pysqlite2 import test
    test.test()
    EOF

    python <<EOF
    from pysqlite2 import dbapi2 as sqlite3
    con = sqlite3.connect(":memory:")
    res = con.execute("create virtual table recipe using fts3(name, ingredients)")
    print(res)
    EOF
    }

# SIP
# need newer version to use setdestroyonexit
#sudo pip install --upgrade --allow-external sip --allow-unverified sip sip}


text: [openedx]: http://code.edx.org


text:
REINDEX TABLE pg_class; -- mapped, non-shared, critical
REINDEX TABLE pg_index; -- non-mapped, non-shared, critical
REINDEX TABLE pg_operator; -- non-mapped, non-shared, critical
REINDEX TABLE pg_database; -- mapped, shared, critical
REINDEX TABLE pg_shdescription; -- mapped, shared non-critical

-- Check that individual system indexes can be reindexed. That's a bit
-- different from the entire-table case because reindex_relation
-- treats e.g. pg_class special.
REINDEX INDEX pg_class_oid_index; -- mapped, non-shared, critical
REINDEX INDEX pg_class_relname_nsp_index; -- mapped, non-shared, non-critical
REINDEX INDEX pg_index_indexrelid_index; -- non-mapped, non-shared, critical
REINDEX INDEX pg_index_indrelid_index; -- non-mapped, non-shared, non-critical
REINDEX INDEX pg_database_oid_index; -- mapped, shared, critical
REINDEX INDEX pg_shdescription_o_c_index; -- mapped, shared, non-critical


text:
"""Manager utility implementations of cataloging managers."""
# pylint: disable=no-init
#     Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods
#     Number of methods are defined in specification
# pylint: disable=too-many-ancestors
#     Inheritance defined in specification

from ..osid import managers as osid_managers
from ..osid.osid_errors import NullArgument
from ..osid.osid_errors import Unimplemented
from ..type.objects import TypeList
from dlkit.abstract_osid.cataloging import managers as abc_cataloging_managers

class CatalogingProfile(abc_cataloging_managers.CatalogingProfile, osid_managers.OsidProfile):
    """The cataloging profile describes the interoperability among cataloging services."""

    def supports_visible_federation(self):
        """Tests if any billing federation is exposed.

        Federation is exposed when a specific catalog may be identified,
        selected and used to create a lookup or admin session.
        Federation is not exposed when a set of catalogs appears as a
        single catalog.

        return: (boolean) - ``true`` if visible federation is supported,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog(self):
        """Tests for the availability of a cataloging service retrieving ``Id`` to ``Catalog`` mappings.

        return: (boolean) - ``true`` if cataloging is available,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_assignment(self):
        """Tests for the availability of a cataloging service for mapping ``Ids`` to ``Catalogs``.

        return: (boolean) - ``true`` if catalog assignment is available,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_entry_notification(self):
        """Tests for the availability of a cataloging notification service for mapping ``Ids`` to ``Catalogs``.

        return: (boolean) - ``true`` if catalog entry notification is
                available, ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_lookup(self):
        """Tests for the availability of a catalog lookup service.

        return: (boolean) - ``true`` if catalog lookup is available,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_query(self):
        """Tests for the availability of a catalog query service that defines more comprehensive queries.

        return: (boolean) - ``true`` if catalog query is available,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_search(self):
        """Tests for the availability of a catalog search service that defines more comprehensive queries.

        return: (boolean) - ``true`` if catalog search is available,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_admin(self):
        """Tests for the availability of a catalog administration service for the addition and deletion of catalogs.

        return: (boolean) - ``true`` if catalog administration is
                available, ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_notification(self):
        """Tests for the availability of a catalog notification service.

        return: (boolean) - ``true`` if catalog notification is
                available, ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_hierarchy(self):
        """Tests for the availability of a catalog hierarchy traversal service.

        return: (boolean) - ``true`` if catalog hierarchy traversal is
                available, ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def supports_catalog_hierarchy_design(self):
        """Tests for the availability of a catalog hierarchy design service.

        return: (boolean) - ``true`` if catalog hierarchy design is
                available, ``false`` otherwise
        *compliance: mandatory -- This method must be implemented in all
        providers.*

        """
        return False

    def supports_cataloging_rules(self):
        """Tests if the cataloging rules sub services is supported.

        return: (boolean) - ``true`` if cataloging rules is supported,
                ``false`` otherwise
        *compliance: mandatory -- This method must be implemented.*

        """
        return False

    def get_catalog_record_types(self):
        """Gets the supported ``Catalog`` record types.

        return: (osid.type.TypeList) - a list containing the supported
                ``Catalog`` record types
        *compliance: mandatory -- This method must be implemented.*

        """
        return TypeList([])

    catalog_record_types = property(fget=get_catalog_record_types)

    def supports_catalog_record_type(self, catalog_record_type=None):
        """Tests if the given ``Catalog`` record type is supported.

        arg:    catalog_record_type (osid.type.Type): a ``Type``
                indicating a ``Catalog`` record type
        return: (boolean) - ``true`` if the given ``Type`` is supported,
                ``false`` otherwise
        raise:  NullArgument - ``catalog_record_type`` is ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        if catalog_record_type is None:
            raise NullArgument()
        return False

    def get_catalog_search_record_types(self):
        """Gets the supported catalog search reciord types.

        return: (osid.type.TypeList) - a list containing the supported
                search record types
        *compliance: mandatory -- This method must be implemented.*

        """
        return TypeList([])

    catalog_search_record_types = property(fget=get_catalog_search_record_types)

    def supports_catalog_search_record_type(self, catalog_search_record_type=None):
        """Tests if the given catalog search record type is supported.

        arg:    catalog_search_record_type (osid.type.Type): a ``Type``
                indicating a catalog search record type
        return: (boolean) - ``true`` if the given ``Type`` is supported,
                ``false`` otherwise
        raise:  NullArgument - ``catalog_search_record_type`` is
                ``null``
        *compliance: mandatory -- This method must be implemented.*

        """
        if catalog_search_record_type is None:
            raise NullArgument()
        return False

class CatalogingManager(abc_cataloging_managers.CatalogingManager, osid_managers.OsidManager, CatalogingProfile):
    """The cataloging manager provides access to cataloging sessions and provides interoperability tests for various aspects of this service.

    The sessions included in this manager are:

      * ``CatalogSession:`` a session to lookup mappings to catalogs
      * ``CatalogAssignmentSession:`` a session to manage Id to Catalog
        mappings
      * ``CatalogEntryNotificationSession:`` a session to receive
        notification of changed mappings
      * ``CatalogLookupSession:`` a session to retrieve catalogs
      * ``CatalogQuerySession:`` a session to query catalogs
      * ``CatalogSearchSession:`` a session to search for catalogs
      * ``CatalogAdminSession:`` a session to create, update and delete
        catalogs
      * ``CatalogNotificationSession:`` a session to receive
        notifications for changes in catalogs
      * ``CatalogHierarchyTraversalSession:`` a session to traverse
        hierarchies of catalogs
      * ``CatalogHierarchyDesignSession:`` a session to manage
        hierarchues of catalogs

    The cataloging manager also provides a profile for determing the
    supported search types supported by this service.

    """

    def get_catalog_session(self):
        """Gets the cataloging session for retrieving mappings to catalogs.

        return: (osid.cataloging.CatalogSession) - a ``CatalogSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_session = property(fget=get_catalog_session)

    def get_catalog_assignment_session(self):
        """Gets the cataloging session for adding and removing mappings to catalogs.

        return: (osid.cataloging.CatalogAssignmentSession) - a
                ``CatalogAssignmentSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_assignment()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_assignment()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_assignment_session = property(fget=get_catalog_assignment_session)

    def get_catalog_entry_notification_session(self, catalog_entry_receiver=None):
        """Gets the notification session for subscribing to changes to catalogs.

        arg:    catalog_entry_receiver
                (osid.cataloging.CatalogEntryReceiver): the notification
                callback
        return: (osid.cataloging.CatalogEntryNotificationSession) - a
                ``CatalogEntryNotificationSession``
        raise:  NullArgument - ``catalog_entry_receiver`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented -
                ``supports_catalog_entry_notification()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_entry_notification()`` is ``true``.*

        """
        raise Unimplemented()

    def get_catalog_entry_notification_session_for_catalog(self, catalog_entry_receiver=None, catalog_id=None):
        """Gets the notification session for subscribing to changes to catalogs for the given catalog.

        arg:    catalog_entry_receiver
                (osid.cataloging.CatalogEntryReceiver): the notification
                callback
        arg:    catalog_id (osid.id.Id): the ``Id`` of the ``Catalog``
        return: (osid.cataloging.CatalogEntryNotificationSession) - a
                ``CatalogEntryNotificationSession``
        raise:  NullArgument - ``catalog_entry_receiver`` or
                ``catalog_id`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented -
                ``supports_catalog_entry_notification()`` or
                ``supports_visible_federation()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_entry_notification()`` and
        ``supports_visible_federation()`` are ``true``*

        """
        if catalog_entry_receiver is None:
            raise NullArgument
        if catalog_id is None:
            raise NullArgument
        raise Unimplemented()

    def get_catalog_lookup_session(self):
        """Gets the catalog lookup session.

        return: (osid.cataloging.CatalogLookupSession) - a
                ``CatalogLookupSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_lookup()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_lookup()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_lookup_session = property(fget=get_catalog_lookup_session)

    def get_catalog_query_session(self):
        """Gets the catalog query session.

        return: (osid.cataloging.CatalogQuerySession) - a
                ``CatalogQuerySession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_query()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_query()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_query_session = property(fget=get_catalog_query_session)

    def get_catalog_search_session(self):
        """Gets the catalog search session.

        return: (osid.cataloging.CatalogSearchSession) - a
                ``CatalogSearchSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_search()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_search()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_search_session = property(fget=get_catalog_search_session)

    def get_catalog_admin_session(self):
        """Gets the catalog administrative session for creating, updating and deleting catalogs.

        return: (osid.cataloging.CatalogAdminSession) - a
                ``CatalogAdminSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_admin()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_admin()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_admin_session = property(fget=get_catalog_admin_session)

    def get_catalog_notification_session(self, catalog_receiver=None):
        """Gets the notification session for subscribing to changes to catalogs.

        arg:    catalog_receiver (osid.cataloging.CatalogReceiver): the
                notification callback
        return: (osid.cataloging.CatalogNotificationSession) - a
                ``CatalogNotificationSession``
        raise:  NullArgument - ``catalog_receiver`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_notification()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_notification()`` is ``true``.*

        """
        raise Unimplemented()

    def get_catalog_hierarchy_session(self):
        """Gets the catalog hierarchy traversal session.

        return: (osid.cataloging.CatalogHierarchySession) - a
                ``CatalogHierarchySession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_hierarchy()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_hierarchy()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_hierarchy_session = property(fget=get_catalog_hierarchy_session)

    def get_catalog_hierarchy_design_session(self):
        """Gets the catalog hierarchy design session.

        return: (osid.cataloging.CatalogHierarchyDesignSession) - a
                ``CatalogHierarchyDesignSession``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_hierarchy_design()``
                is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_hierarchy_design()`` is ``true``.*

        """
        raise Unimplemented()

    catalog_hierarchy_design_session = property(fget=get_catalog_hierarchy_design_session)

    def get_cataloging_rules_manager(self):
        """Gets the cataloging rules manager.

        return: (osid.cataloging.rules.CatalogingRulesManager) - a
                ``CatalogingRulesManager``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_cataloging_rules()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_cataloging_rules()`` is ``true``.*

        """
        raise Unimplemented()

    cataloging_rules_manager = property(fget=get_cataloging_rules_manager)

class CatalogingProxyManager(abc_cataloging_managers.CatalogingProxyManager, osid_managers.OsidProxyManager, CatalogingProfile):
    """The cataloging manager provides access to cataloging sessions and provides interoperability tests for various aspects of this service.

    Methods in this manager support the passing of a ``Proxy`` for the
    purposes of passing information from server environments.

      * ``CatalogSession:`` a session to lookup mappings to catalogs
      * ``CatalogAssignmentSession:`` a session to manage Id to Catalog
        mappings
      * ``CatalogEntryNotificationSession:`` a session to receive
        notification of changed mappings
      * ``CatalogLookupSession:`` a session to retrieve catalogs
      * ``CatalogQuerySession:`` a session to query catalogs
      * ``CatalogSearchSession:`` a session to search for catalogs
      * ``CatalogAdminSession:`` a session to create, update and delete
        catalogs
      * ``CatalogNotificationSession:`` a session to receive
        notifications for changes in catalogs
      * ``CatalogHierarchyTraversalSession:`` a session to traverse
        hierarchies of catalogs
      * ``CatalogHierarchyDesignSession:`` a session to manage
        hierarchues of catalogs

    The cataloging manager also provides a profile for determing the
    supported search types supported by this service.

    """

    def get_catalog_session(self, proxy=None):
        """Gets the catalog session for retrieving ``Id`` to ``Catalog`` mappings.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogSession) - a ``CatalogSession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_assignment_session(self, proxy=None):
        """Gets the catalog session for mapping ``Ids`` to ``Catalogs``.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogAssignmentSession) - a
                ``CatalogAssignmentSession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_assignment()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_assignment()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_entry_notification_session(self, catalog_entry_receiver=None, proxy=None):
        """Gets the catalog session for mapping ``Ids`` to ``Catalogs``.

        arg:    catalog_entry_receiver
                (osid.cataloging.CatalogEntryReceiver): the notification
                callback
        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogEntryNotificationSession) - a
                ``CatalogEntryNotificationSession``
        raise:  NullArgument - ``catalog_entry_receiver`` or ``proxy``
                is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented -
                ``supports_catalog_entryt_notification()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_entry_notification()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_entry_notification_session_for_catalog(self, catalog_entry_receiver=None, catalog_id=None, proxy=None):
        """Gets the notification session for subscribing to changes to catalogs for the given catalog.

        arg:    catalog_entry_receiver
                (osid.cataloging.CatalogEntryReceiver): the notification
                callback
        arg:    catalog_id (osid.id.Id): the ``Id`` of the ``Catalog``
        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogEntryNotificationSession) - a
                ``CatalogEntryNotificationSession``
        raise:  NullArgument - ``catalog_entry_receiver, catalog_id,``
                or ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented -
                ``supports_catalog_entry_notification()`` or
                ``supports_visible_federation()`` is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_entry_notification()`` and
        ``supports_visible_federation()`` are ``true``*

        """
        if catalog_entry_receiver is None or proxy is None:
            raise NullArgument
        raise Unimplemented()

    def get_catalog_lookup_session(self, proxy=None):
        """Gets the catalog lookup session.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogLookupSession) - a
                ``CatalogLookupSession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_lookup()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_lookup()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_query_session(self, proxy=None):
        """Gets the catalog query session.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogQuerySession) - a
                ``CatalogQuerySession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_query()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_query()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_search_session(self, proxy=None):
        """Gets the catalog search session.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogSearchSession) - a
                ``CatalogSearchSession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_search()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_search()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_admin_session(self, proxy=None):
        """Gets the catalog administrative session for creating, updating and deleting catalogs.

        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogAdminSession) - a
                ``CatalogAdminSession``
        raise:  NullArgument - ``proxy`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_admin()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_admin()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_notification_session(self, catalog_receiver=None, proxy=None):
        """Gets the notification session for subscribing to changes to catalogs.

        arg:    catalog_receiver (osid.cataloging.CatalogReceiver): the
                notification callback
        arg:    proxy (osid.proxy.Proxy): a proxy
        return: (osid.cataloging.CatalogNotificationSession) - a
                ``CatalogNotificationSession``
        raise:  NullArgument - ``catalog_receiver`` or ``proxy`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_notification()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_notification()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_hierarchy_session(self, proxy=None):
        """Gets the catalog hierarchy traversal session.

        arg:    proxy (osid.proxy.Proxy): proxy
        return: (osid.cataloging.CatalogHierarchySession) - a
                ``CatalogHierarchySession``
        raise:  NullArgument - ``proxy`` is null
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_hierarchy()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_hierarchy()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_catalog_hierarchy_design_session(self, proxy=None):
        """Gets the catalog hierarchy design session.

        arg:    proxy (osid.proxy.Proxy): proxy
        return: (osid.cataloging.CatalogHierarchyDesignSession) - a
                ``CatalogHierarchyDesignSession``
        raise:  NullArgument - ``proxy`` is null
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_catalog_hierarchy_design()``
                is ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_catalog_hierarchy_design()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    def get_cataloging_rules_proxy_manager(self):
        """Gets the cataloging rules proxy manager.

        return: (osid.cataloging.rules.CatalogingRulesProxyManager) - a
                ``CatalogingRulesManager``
        raise:  OperationFailed - unable to complete request
        raise:  Unimplemented - ``supports_cataloging_rules()`` is
                ``false``
        *compliance: optional -- This method must be implemented if
        ``supports_cataloging_rules()`` is ``true``.*

        """
        if proxy is None:
            raise NullArgument()
        raise Unimplemented()

    cataloging_rules_proxy_manager = property(fget=get_cataloging_rules_proxy_manager)


text:
package org.apache.hadoop.hbase.mapreduce;

import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.util.Arrays;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.mapreduce.SyncTable.SyncMapper.Counter;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.mapreduce.Counters;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.hbase.thirdparty.com.google.common.base.Throwables;

/**
 * Basic test for the SyncTable M/R tool
 */
@Category(LargeTests.class)
public class TestSyncTable {

  @ClassRule
  public static final HBaseClassTestRule CLASS_RULE =
      HBaseClassTestRule.forClass(TestSyncTable.class);

  private static final Logger LOG = LoggerFactory.getLogger(TestSyncTable.class);

  private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();

  @Rule
  public TestName name = new TestName();

  @BeforeClass
  public static void beforeClass() throws Exception {
    TEST_UTIL.startMiniCluster(3);
  }

  @AfterClass
  public static void afterClass() throws Exception {
    TEST_UTIL.cleanupDataTestDirOnTestFS();
    TEST_UTIL.shutdownMiniCluster();
  }

  private static byte[][] generateSplits(int numRows, int numRegions) {
    byte[][] splitRows = new byte[numRegions-1][];
    for (int i = 1; i < numRegions; i++) {
      splitRows[i-1] = Bytes.toBytes(numRows * i / numRegions);
    }
    return splitRows;
  }

  @Test
  public void testSyncTable() throws Exception {
    final TableName sourceTableName = TableName.valueOf(name.getMethodName() + "_source");
    final TableName targetTableName = TableName.valueOf(name.getMethodName() + "_target");
    Path testDir = TEST_UTIL.getDataTestDirOnTestFS("testSyncTable");

    writeTestData(sourceTableName, targetTableName);
    hashSourceTable(sourceTableName, testDir);
    Counters syncCounters = syncTables(sourceTableName, targetTableName, testDir);
    assertEqualTables(90, sourceTableName, targetTableName);

    assertEquals(60, syncCounters.findCounter(Counter.ROWSWITHDIFFS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.SOURCEMISSINGROWS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.TARGETMISSINGROWS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.SOURCEMISSINGCELLS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.TARGETMISSINGCELLS).getValue());
    assertEquals(20, syncCounters.findCounter(Counter.DIFFERENTCELLVALUES).getValue());

    TEST_UTIL.deleteTable(sourceTableName);
    TEST_UTIL.deleteTable(targetTableName);
  }

  @Test
  public void testSyncTableDoDeletesFalse() throws Exception {
    final TableName sourceTableName = TableName.valueOf(name.getMethodName() + "_source");
    final TableName targetTableName = TableName.valueOf(name.getMethodName() + "_target");
    Path testDir = TEST_UTIL.getDataTestDirOnTestFS("testSyncTableDoDeletesFalse");

    writeTestData(sourceTableName, targetTableName);
    hashSourceTable(sourceTableName, testDir);
    Counters syncCounters = syncTables(sourceTableName, targetTableName,
        testDir, "--doDeletes=false");
    assertTargetDoDeletesFalse(100, sourceTableName, targetTableName);

    assertEquals(60, syncCounters.findCounter(Counter.ROWSWITHDIFFS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.SOURCEMISSINGROWS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.TARGETMISSINGROWS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.SOURCEMISSINGCELLS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.TARGETMISSINGCELLS).getValue());
    assertEquals(20, syncCounters.findCounter(Counter.DIFFERENTCELLVALUES).getValue());

    TEST_UTIL.deleteTable(sourceTableName);
    TEST_UTIL.deleteTable(targetTableName);
  }

  @Test
  public void testSyncTableDoPutsFalse() throws Exception {
    final TableName sourceTableName = TableName.valueOf(name.getMethodName() + "_source");
    final TableName targetTableName = TableName.valueOf(name.getMethodName() + "_target");
    Path testDir = TEST_UTIL.getDataTestDirOnTestFS("testSyncTableDoPutsFalse");

    writeTestData(sourceTableName, targetTableName);
    hashSourceTable(sourceTableName, testDir);
    Counters syncCounters = syncTables(sourceTableName, targetTableName,
        testDir, "--doPuts=false");
    assertTargetDoPutsFalse(70, sourceTableName, targetTableName);

    assertEquals(60, syncCounters.findCounter(Counter.ROWSWITHDIFFS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.SOURCEMISSINGROWS).getValue());
    assertEquals(10, syncCounters.findCounter(Counter.TARGETMISSINGROWS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.SOURCEMISSINGCELLS).getValue());
    assertEquals(50, syncCounters.findCounter(Counter.TARGETMISSINGCELLS).getValue());
    assertEquals(20, syncCounters.findCounter(Counter.DIFFERENTCELLVALUES).getValue());

    TEST_UTIL.deleteTable(sourceTableName);
    TEST_UTIL.deleteTable(targetTableName);
  }

  private void assertEqualTables(int expectedRows, TableName sourceTableName,
      TableName targetTableName) throws Exception {
    Table sourceTable = TEST_UTIL.getConnection().getTable(sourceTableName);
    Table targetTable = TEST_UTIL.getConnection().getTable(targetTableName);

    ResultScanner sourceScanner = sourceTable.getScanner(new Scan());
    ResultScanner targetScanner = targetTable.getScanner(new Scan());

    for (int i = 0; i < expectedRows; i++) {
      Result sourceRow = sourceScanner.next();
      Result targetRow = targetScanner.next();

      LOG.debug("SOURCE row: " + (sourceRow == null ? "null" : Bytes.toInt(sourceRow.getRow()))
          + " cells:" + sourceRow);
      LOG.debug("TARGET row: " + (targetRow == null ? "null" : Bytes.toInt(targetRow.getRow()))
          + " cells:" + targetRow);

      if (sourceRow == null) {
        Assert.fail("Expected " + expectedRows
            + " source rows but only found " + i);
      }
      if (targetRow == null) {
        Assert.fail("Expected " + expectedRows
            + " target rows but only found " + i);
      }
      Cell[] sourceCells = sourceRow.rawCells();
      Cell[] targetCells = targetRow.rawCells();
      if (sourceCells.length != targetCells.length) {
        LOG.debug("Source cells: " + Arrays.toString(sourceCells));
        LOG.debug("Target cells: " + Arrays.toString(targetCells));
        Assert.fail("Row " + Bytes.toInt(sourceRow.getRow())
            + " has " + sourceCells.length
            + " cells in source table but " + targetCells.length
            + " cells in target table");
      }
      for (int j = 0; j < sourceCells.length; j++) {
        Cell sourceCell = sourceCells[j];
        Cell targetCell = targetCells[j];
        try {
          if (!CellUtil.matchingRows(sourceCell, targetCell)) {
            Assert.fail("Rows don't match");
          }
          if (!CellUtil.matchingFamily(sourceCell, targetCell)) {
            Assert.fail("Families don't match");
          }
          if (!CellUtil.matchingQualifier(sourceCell, targetCell)) {
            Assert.fail("Qualifiers don't match");
          }
          if (!CellUtil.matchingTimestamp(sourceCell, targetCell)) {
            Assert.fail("Timestamps don't match");
          }
          if (!CellUtil.matchingValue(sourceCell, targetCell)) {
            Assert.fail("Values don't match");
          }
        } catch (Throwable t) {
          LOG.debug("Source cell: " + sourceCell + " target cell: " + targetCell);
          Throwables.propagate(t);
        }
      }
    }
    Result sourceRow = sourceScanner.next();
    if (sourceRow != null) {
      Assert.fail("Source table has more than " + expectedRows
          + " rows.  Next row: " + Bytes.toInt(sourceRow.getRow()));
    }
    Result targetRow = targetScanner.next();
    if (targetRow != null) {
      Assert.fail("Target table has more than " + expectedRows
          + " rows.  Next row: " + Bytes.toInt(targetRow.getRow()));
    }
    sourceScanner.close();
    targetScanner.close();
    sourceTable.close();
    targetTable.close();
  }

  private void assertTargetDoDeletesFalse(int expectedRows, TableName
      sourceTableName,
      TableName targetTableName)
      throws Exception {
    Table sourceTable = TEST_UTIL.getConnection().getTable(sourceTableName);
    Table targetTable = TEST_UTIL.getConnection().getTable(targetTableName);

    ResultScanner sourceScanner = sourceTable.getScanner(new Scan());
    ResultScanner targetScanner = targetTable.getScanner(new Scan());
    Result targetRow = targetScanner.next();
    Result sourceRow = sourceScanner.next();
    int rowsCount = 0;
    while (targetRow!=null) {
      rowsCount++;
      //only compares values for existing rows, skipping rows existing on
      //target only that were not deleted given --doDeletes=false
      if (Bytes.toInt(sourceRow.getRow()) != Bytes.toInt(targetRow.getRow())) {
        targetRow = targetScanner.next();
        continue;
      }

      LOG.debug("SOURCE row: " + (sourceRow == null ? "null"
          : Bytes.toInt(sourceRow.getRow()))
          + " cells:" + sourceRow);
      LOG.debug("TARGET row: " + (targetRow == null ? "null"
          : Bytes.toInt(targetRow.getRow()))
          + " cells:" + targetRow);

      Cell[] sourceCells = sourceRow.rawCells();
      Cell[] targetCells = targetRow.rawCells();
      int targetRowKey = Bytes.toInt(targetRow.getRow());
      if (targetRowKey >= 70 && targetRowKey < 80) {
        if (sourceCells.length == targetCells.length) {
          LOG.debug("Source cells: " + Arrays.toString(sourceCells));
          LOG.debug("Target cells: " + Arrays.toString(targetCells));
          Assert.fail("Row " + targetRowKey + " should have more cells in "
              + "target than in source");
        }

      } else {
        if (sourceCells.length != targetCells.length) {
          LOG.debug("Source cells: " + Arrays.toString(sourceCells));
          LOG.debug("Target cells: " + Arrays.toString(targetCells));
          Assert.fail("Row " + Bytes.toInt(sourceRow.getRow())
              + " has " + sourceCells.length
              + " cells in source table but " + targetCells.length
              + " cells in target table");
        }
      }
      for (int j = 0; j < sourceCells.length; j++) {
        Cell sourceCell = sourceCells[j];
        Cell targetCell = targetCells[j];
        try {
          if (!CellUtil.matchingRow(sourceCell, targetCell)) {
            Assert.fail("Rows don't match");
          }
          if (!CellUtil.matchingFamily(sourceCell, targetCell)) {
            Assert.fail("Families don't match");
          }
          if (!CellUtil.matchingQualifier(sourceCell, targetCell)) {
            Assert.fail("Qualifiers don't match");
          }
          if(targetRowKey < 80 && targetRowKey >= 90){
            if (!CellUtil.matchingTimestamp(sourceCell, targetCell)) {
              Assert.fail("Timestamps don't match");
            }
          }
          if (!CellUtil.matchingValue(sourceCell, targetCell)) {
            Assert.fail("Values don't match");
          }
        } catch (Throwable t) {
          LOG.debug("Source cell: " + sourceCell + " target cell: "
              + targetCell);
          Throwables.propagate(t);
        }
      }
      targetRow = targetScanner.next();
      sourceRow = sourceScanner.next();
    }
    assertEquals("Target expected rows does not match.",expectedRows,
        rowsCount);
    sourceScanner.close();
    targetScanner.close();
    sourceTable.close();
    targetTable.close();
  }

  private void assertTargetDoPutsFalse(int expectedRows, TableName
      sourceTableName,
      TableName targetTableName)
      throws Exception {
    Table sourceTable = TEST_UTIL.getConnection().getTable(sourceTableName);
    Table targetTable = TEST_UTIL.getConnection().getTable(targetTableName);

    ResultScanner sourceScanner = sourceTable.getScanner(new Scan());
    ResultScanner targetScanner = targetTable.getScanner(new Scan());
    Result targetRow = targetScanner.next();
    Result sourceRow = sourceScanner.next();
    int rowsCount = 0;

    while (targetRow!=null) {
      //only compares values for existing rows, skipping rows existing on
      //source only that were not added to target given --doPuts=false
      if (Bytes.toInt(sourceRow.getRow()) != Bytes.toInt(targetRow.getRow())) {
        sourceRow = sourceScanner.next();
        continue;
      }

      LOG.debug("SOURCE row: " + (sourceRow == null ?
          "null" :
          Bytes.toInt(sourceRow.getRow()))
          + " cells:" + sourceRow);
      LOG.debug("TARGET row: " + (targetRow == null ?
          "null" :
          Bytes.toInt(targetRow.getRow()))
          + " cells:" + targetRow);

      LOG.debug("rowsCount: " + rowsCount);

      Cell[] sourceCells = sourceRow.rawCells();
      Cell[] targetCells = targetRow.rawCells();
      int targetRowKey = Bytes.toInt(targetRow.getRow());
      if (targetRowKey >= 40 && targetRowKey < 60) {
        LOG.debug("Source cells: " + Arrays.toString(sourceCells));
        LOG.debug("Target cells: " + Arrays.toString(targetCells));
        Assert.fail("There shouldn't exist any rows between 40 and 60, since "
            + "Puts are disabled and Deletes are enabled.");
      } else if (targetRowKey >= 60 && targetRowKey < 70) {
        if (sourceCells.length == targetCells.length) {
          LOG.debug("Source cells: " + Arrays.toString(sourceCells));
          LOG.debug("Target cells: " + Arrays.toString(targetCells));
          Assert.fail("Row " + Bytes.toInt(sourceRow.getRow())
              + " shouldn't have same number of cells.");
        }
      } else if (targetRowKey >= 80 && targetRowKey < 90) {
        LOG.debug("Source cells: " + Arrays.toString(sourceCells));
        LOG.debug("Target cells: " + Arrays.toString(targetCells));
        Assert.fail("There should be no rows between 80 and 90 on target, as "
            + "these had different timestamps and should had been deleted.");
      } else if (targetRowKey >= 90 && targetRowKey < 100) {
        for (int j = 0; j < sourceCells.length; j++) {
          Cell sourceCell = sourceCells[j];
          Cell targetCell = targetCells[j];
          if (CellUtil.matchingValue(sourceCell, targetCell)) {
            Assert.fail("Cells values should not match for rows between "
                + "90 and 100. Target row id: " + (Bytes.toInt(targetRow
                .getRow())));
          }
        }
      } else {
        for (int j = 0; j < sourceCells.length; j++) {
          Cell sourceCell = sourceCells[j];
          Cell targetCell = targetCells[j];
          try {
            if (!CellUtil.matchingRow(sourceCell, targetCell)) {
              Assert.fail("Rows don't match");
            }
            if (!CellUtil.matchingFamily(sourceCell, targetCell)) {
              Assert.fail("Families don't match");
            }
            if (!CellUtil.matchingQualifier(sourceCell, targetCell)) {
              Assert.fail("Qualifiers don't match");
            }
            if (!CellUtil.matchingTimestamp(sourceCell, targetCell)) {
              Assert.fail("Timestamps don't match");
            }
            if (!CellUtil.matchingValue(sourceCell, targetCell)) {
              Assert.fail("Values don't match");
            }
          } catch (Throwable t) {
            LOG.debug(
                "Source cell: " + sourceCell + " target cell: " + targetCell);
            Throwables.propagate(t);
          }
        }
      }
      rowsCount++;
      targetRow = targetScanner.next();
      sourceRow = sourceScanner.next();
    }
    assertEquals("Target expected rows does not match.",expectedRows,
        rowsCount);
    sourceScanner.close();
    targetScanner.close();
    sourceTable.close();
    targetTable.close();
  }

  private Counters syncTables(TableName sourceTableName, TableName targetTableName,
      Path testDir, String... options) throws Exception {
    SyncTable syncTable = new SyncTable(TEST_UTIL.getConfiguration());
    String[] args = Arrays.copyOf(options, options.length+3);
    args[options.length] = testDir.toString();
    args[options.length+1] = sourceTableName.getNameAsString();
    args[options.length+2] = targetTableName.getNameAsString();
    int code = syncTable.run(args);
    assertEquals("sync table job failed", 0, code);

    LOG.info("Sync tables completed");
    return syncTable.counters;
  }

  private void hashSourceTable(TableName sourceTableName, Path testDir)
      throws Exception, IOException {
    int numHashFiles = 3;
    long batchSize = 100;  // should be 2 batches per region
    int scanBatch = 1;
    HashTable hashTable = new HashTable(TEST_UTIL.getConfiguration());
    int code = hashTable.run(new String[] {
        "--batchsize=" + batchSize,
        "--numhashfiles=" + numHashFiles,
        "--scanbatch=" + scanBatch,
        sourceTableName.getNameAsString(),
        testDir.toString()});
    assertEquals("hash table job failed", 0, code);

    FileSystem fs = TEST_UTIL.getTestFileSystem();

    HashTable.TableHash tableHash = HashTable.TableHash.read(fs.getConf(), testDir);
    assertEquals(sourceTableName.getNameAsString(), tableHash.tableName);
    assertEquals(batchSize, tableHash.batchSize);
    assertEquals(numHashFiles, tableHash.numHashFiles);
    assertEquals(numHashFiles - 1, tableHash.partitions.size());

    LOG.info("Hash table completed");
  }

  private void writeTestData(TableName sourceTableName, TableName targetTableName)
      throws Exception {
    final byte[] family = Bytes.toBytes("family");
    final byte[] column1 = Bytes.toBytes("c1");
    final byte[] column2 = Bytes.toBytes("c2");
    final byte[] value1 = Bytes.toBytes("val1");
    final byte[] value2 = Bytes.toBytes("val2");
    final byte[] value3 = Bytes.toBytes("val3");

    int numRows = 100;
    int sourceRegions = 10;
    int targetRegions = 6;

    Table sourceTable = TEST_UTIL.createTable(sourceTableName,
        family, generateSplits(numRows, sourceRegions));

    Table targetTable = TEST_UTIL.createTable(targetTableName,
        family, generateSplits(numRows, targetRegions));

    long timestamp = 1430764183454L;

    int rowIndex = 0;
    // a bunch of identical rows
    for (; rowIndex < 40; rowIndex++) {
      Put sourcePut = new Put(Bytes.toBytes(rowIndex));
      sourcePut.addColumn(family, column1, timestamp, value1);
      sourcePut.addColumn(family, column2, timestamp, value2);
      sourceTable.put(sourcePut);

      Put targetPut = new Put(Bytes.toBytes(rowIndex));
      targetPut.addColumn(family, column1, timestamp, value1);
      targetPut.addColumn(family, column2, timestamp, value2);
      targetTable.put(targetPut);
    }
    // some rows only in the source table
    // ROWSWITHDIFFS: 10
    // TARGETMISSINGROWS: 10
    // TARGETMISSINGCELLS: 20
    for (; rowIndex < 50; rowIndex++) {
      Put put = new Put(Bytes.toBytes(rowIndex));
      put.addColumn(family, column1, timestamp, value1);
      put.addColumn(family, column2, timestamp, value2);
      sourceTable.put(put);
    }
    // some rows only in the target table
    // ROWSWITHDIFFS: 10
    // SOURCEMISSINGROWS: 10
    // SOURCEMISSINGCELLS: 20
    for (; rowIndex < 60; rowIndex++) {
      Put put = new Put(Bytes.toBytes(rowIndex));
      put.addColumn(family, column1, timestamp, value1);
      put.addColumn(family, column2, timestamp, value2);
      targetTable.put(put);
    }
    // some rows with 1 missing cell in target table
    // ROWSWITHDIFFS: 10
    // TARGETMISSINGCELLS: 10
    for (; rowIndex < 70; rowIndex++) {
      Put sourcePut = new Put(Bytes.toBytes(rowIndex));
      sourcePut.addColumn(family, column1, timestamp, value1);
      sourcePut.addColumn(family, column2, timestamp, value2);
      sourceTable.put(sourcePut);

      Put targetPut = new Put(Bytes.toBytes(rowIndex));
      targetPut.addColumn(family, column1, timestamp, value1);
      targetTable.put(targetPut);
    }
    // some rows with 1 missing cell in source table
    // ROWSWITHDIFFS: 10
    // SOURCEMISSINGCELLS: 10
    for (; rowIndex < 80; rowIndex++) {
      Put sourcePut = new Put(Bytes.toBytes(rowIndex));
      sourcePut.addColumn(family, column1, timestamp, value1);
      sourceTable.put(sourcePut);

      Put targetPut = new Put(Bytes.toBytes(rowIndex));
      targetPut.addColumn(family, column1, timestamp, value1);
      targetPut.addColumn(family, column2, timestamp, value2);
      targetTable.put(targetPut);
    }
    // some rows differing only in timestamp
    // ROWSWITHDIFFS: 10
    // SOURCEMISSINGCELLS: 20
    // TARGETMISSINGCELLS: 20
    for (; rowIndex < 90; rowIndex++) {
      Put sourcePut = new Put(Bytes.toBytes(rowIndex));
      sourcePut.addColumn(family, column1, timestamp, column1);
      sourcePut.addColumn(family, column2, timestamp, value2);
      sourceTable.put(sourcePut);

      Put targetPut = new Put(Bytes.toBytes(rowIndex));
      targetPut.addColumn(family, column1, timestamp+1, column1);
      targetPut.addColumn(family, column2, timestamp-1, value2);
      targetTable.put(targetPut);
    }
    // some rows with different values
    // ROWSWITHDIFFS: 10
    // DIFFERENTCELLVALUES: 20
    for (; rowIndex < numRows; rowIndex++) {
      Put sourcePut = new Put(Bytes.toBytes(rowIndex));
      sourcePut.addColumn(family, column1, timestamp, value1);
      sourcePut.addColumn(family, column2, timestamp, value2);
      sourceTable.put(sourcePut);

      Put targetPut = new Put(Bytes.toBytes(rowIndex));
      targetPut.addColumn(family, column1, timestamp, value3);
      targetPut.addColumn(family, column2, timestamp, value3);
      targetTable.put(targetPut);
    }

    sourceTable.close();
    targetTable.close();
  }

}


text:
import React from 'react'

export default class PreferencesPage extends React.Component {
  render () {
    return (

Sentinel

                    Kontooversigt

                    Skift password

                    Forældrekontrol

                    Ændr betalingsmåde

                    Håndter pakken

                    Købshistorik

                    Ændr personoplysninger

Viaplay til Viasat-kunder

Kontooversigt

Informationer til login

marcussa2000@gmail.com

******

                      Skift password

Forældrekontrol

Blokér køb og uegnet indhold med en kode.

                      Opret kode

Facebook

                          Sammenkobl med Facebook, så du lettere kan logge dig ind.

                          Kobl til Facebook

    )
  }
}


text:
package io.opencensus.contrib.resource.util;

import static com.google.common.truth.Truth.assertThat;

import io.opencensus.resource.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Unit tests for {@link K8sResource}. */
@RunWith(JUnit4.class)
public class K8sResourceTest {
  private static final String K8S_CLUSTER_NAME = "cluster";
  private static final String K8S_NAMESPACE_NAME = "namespace";
  private static final String K8S_POD_NAME = "pod-id";

  @Test
  public void create_K8sContainerResourceTest() {
    Resource resource = K8sResource.create(K8S_CLUSTER_NAME, K8S_NAMESPACE_NAME, K8S_POD_NAME);
    assertThat(resource.getType()).isEqualTo(K8sResource.TYPE);
    assertThat(resource.getLabels())
        .containsExactly(
            K8sResource.CLUSTER_NAME_KEY,
            K8S_CLUSTER_NAME,
            K8sResource.NAMESPACE_NAME_KEY,
            K8S_NAMESPACE_NAME,
            K8sResource.POD_NAME_KEY,
            K8S_POD_NAME);
  }
}


text:
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Collections.Generic;

namespace Tests
{
    namespace Helpers
    {
        // A small UDP server that can be used for testing.
        // Stores a list of the last messages that were received by the server
        // until they are accessed using GetAndClearLastMessages().

        // By design received messages can only be read once. This
        // allows one instance of the listener to be used across
        // multiple tests without risk of the results of previous tests
        // affecting the current one.

        // Intended use:
        // udpListener = new UdpListener(serverName, serverPort);
        // listenThread = new Thread(new ParameterizedThreadStart(udpListener.Listen));
        // listenThread.Start(n);
        // { send n messages to the listener }
        // while(listenThread.IsAlive); // wait for listen thread to receive message or time out
        // List<string> receivedMessage = udpListener.GetAndClearLastMessages()
        // { make sure that the received messages are what was expected }
        public class UdpListener : IDisposable
        {
            List<string> lastReceivedMessages;
            IPEndPoint localIpEndPoint;
            IPEndPoint senderIpEndPoint;
            UdpClient socket;

            public UdpListener(string hostname, int port)
            {
                lastReceivedMessages = new List<string>();
                localIpEndPoint = new IPEndPoint(IPAddress.Parse(hostname), port);
                socket = new UdpClient(localIpEndPoint);
                socket.Client.ReceiveTimeout = 2000;
                senderIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
            }

            // Receive messages until it receives count of them or times out.
            // This call is blocking; you may want to run it in a
            // thread while you send the message.
            public void Listen(object count = null)
            {
                try
                {
                    if (count == null)
                        count = 1;
                    for (int i = 0; i < (int)count; i++)
                    {
                        byte[] lastReceivedBytes = socket.Receive(ref senderIpEndPoint);
                        lastReceivedMessages.Add(Encoding.ASCII.GetString(lastReceivedBytes, 0,
                                                                          lastReceivedBytes.Length));
                    }
                }
                catch (SocketException ex)
                {
                    // If we timeout, stop listening.
                    // If we get another error, propagate it upwards.
                    if (ex.ErrorCode == 10060) // WSAETIMEDOUT; Timeout error
                        return;
                    else
                        throw ex;
                }
            }

            // Clear and return the message list. Clearing the list allows us to use the
            // same UdpListener instance for several tests; we never have to worry about a
            // message received from a previous test giving us a false positive.
            public List<string> GetAndClearLastMessages()
            {
                List<string> messagesToReturn = lastReceivedMessages;
                lastReceivedMessages = new List<string>();
                return messagesToReturn;
            }

            public void Dispose()
            {
                socket.Close();
            }
        }
    }
}


text:
package govppmux

import (
	govppapi "git.fd.io/govpp.git/api"
	"github.com/ligato/vpp-agent/plugins/govppmux/vppcalls"
)

// StatsAPI is extended API with ability to get VPP stats data
type StatsAPI interface {
	API

	govppapi.StatsProvider
}

// API for other plugins to get connectivity to VPP.
type API interface {
	// VPPInfo returns VPP information which is retrieved immediatelly after connecting to VPP.
	VPPInfo() (VPPInfo, error)

	govppapi.ChannelProvider
}

// VPPInfo defines retrieved information about the connected VPP instance.
type VPPInfo struct {
	Connected bool
	vppcalls.VersionInfo
	vppcalls.VpeInfo
}

// GetReleaseVersion returns VPP release version (XX.YY), which is normalized from VersionInfo.
func (vpp VPPInfo) GetReleaseVersion() string {
	if len(vpp.Version) < 5 {
		return ""
	}
	return vpp.Version[:5]
}


text:
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Windows.Storage;
using Windows.Foundation;
using Windows.Media.Editing;
using Windows.Media.Core;
using SDKTemplate;

namespace MediaEditingSample
{
    public sealed partial class Scenario4_AddOverlays : Page
    {
        private MainPage rootPage;
        private MediaComposition composition;
        private StorageFile baseVideoFile;
        private StorageFile overlayVideoFile;
        private MediaStreamSource mediaStreamSource;

        public Scenario4_AddOverlays()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            mediaElement.Source = null;
            mediaStreamSource = null;
            base.OnNavigatedFrom(e);
        }

        private async void ChooseBaseVideo_Click(object sender, RoutedEventArgs e)
        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            baseVideoFile = await picker.PickSingleFileAsync();
            if (baseVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            mediaElement.SetSource(await baseVideoFile.OpenReadAsync(), baseVideoFile.ContentType);
            chooseOverlayVideo.IsEnabled = true;
        }

        private async void ChooseOverlayVideo_Click(object sender, RoutedEventArgs e)
        {
            var picker = new Windows.Storage.Pickers.FileOpenPicker();
            picker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.VideosLibrary;
            picker.FileTypeFilter.Add(".mp4");
            overlayVideoFile = await picker.PickSingleFileAsync();
            if (overlayVideoFile == null)
            {
                rootPage.NotifyUser("File picking cancelled", NotifyType.ErrorMessage);
                return;
            }

            CreateOverlays();
            rootPage.NotifyUser("Overlay video chosen", NotifyType.StatusMessage);
        }

        private async void CreateOverlays()
        {
            var baseVideoClip = await MediaClip.CreateFromFileAsync(baseVideoFile);
            composition = new MediaComposition();
            composition.Clips.Add(baseVideoClip);

            var overlayVideoClip = await MediaClip.CreateFromFileAsync(overlayVideoFile);

            // Overlay video in upper left corner, retain its native aspect ratio
            Rect videoOverlayPosition;
            var encodingProperties = overlayVideoClip.GetVideoEncodingProperties();
            videoOverlayPosition.Height = mediaElement.ActualHeight / 3;
            videoOverlayPosition.Width = (double)encodingProperties.Width / (double)encodingProperties.Height * videoOverlayPosition.Height;
            videoOverlayPosition.X = 0;
            videoOverlayPosition.Y = 0;

            var videoOverlay = new MediaOverlay(overlayVideoClip);
            videoOverlay.Position = videoOverlayPosition;
            videoOverlay.Opacity = 0.75;

            var overlayLayer = new MediaOverlayLayer();
            overlayLayer.Overlays.Add(videoOverlay);
            composition.OverlayLayers.Add(overlayLayer);

            // Render to MediaElement
            mediaElement.Position = TimeSpan.Zero;
            mediaStreamSource = composition.GeneratePreviewMediaStreamSource((int)mediaElement.ActualWidth, (int)mediaElement.ActualHeight);
            mediaElement.SetMediaStreamSource(mediaStreamSource);
            rootPage.NotifyUser("Overlays created", NotifyType.StatusMessage);
        }
    }
}


text:
package com.facebook.react.uimanager;

import android.graphics.Rect;
import android.view.View;
import android.view.ViewParent;
import javax.annotation.concurrent.NotThreadSafe;

/**
 * Provides implementation of common tasks for view and it's view manager supporting property {@code
 * removeClippedSubviews}.
 */
@NotThreadSafe
public class ReactClippingViewGroupHelper {

  public static final String PROP_REMOVE_CLIPPED_SUBVIEWS = "removeClippedSubviews";

  private static final Rect sHelperRect = new Rect();

  /**
   * Can be used by view that support {@code removeClippedSubviews} property to calculate area that
   * given {@param view} should be clipped to based on the clipping rectangle of it's parent in case
   * when parent is also set to clip it's children.
   *
   * @param view view that we want to calculate clipping rect for
   * @param outputRect where the calculated rectangle will be written
   */
  public static void calculateClippingRect(View view, Rect outputRect) {
    ViewParent parent = view.getParent();
    if (parent == null) {
      outputRect.setEmpty();
      return;
    } else if (parent instanceof ReactClippingViewGroup) {
      ReactClippingViewGroup clippingViewGroup = (ReactClippingViewGroup) parent;
      if (clippingViewGroup.getRemoveClippedSubviews()) {
        clippingViewGroup.getClippingRect(sHelperRect);
        // Intersect the view with the parent's rectangle
        // This will result in the overlap with coordinates in the parent space
        if (!sHelperRect.intersect(
            view.getLeft(),
            view.getTop() + (int) view.getTranslationY(),
            view.getRight(),
            view.getBottom() + (int) view.getTranslationY())) {
          outputRect.setEmpty();
          return;
        }
        // Now we move the coordinates to the View's coordinate space
        sHelperRect.offset(-view.getLeft(), -view.getTop());
        sHelperRect.offset(-(int) view.getTranslationX(), -(int) view.getTranslationY());
        sHelperRect.offset(view.getScrollX(), view.getScrollY());
        outputRect.set(sHelperRect);
        return;
      }
    }
    view.getDrawingRect(outputRect);
  }
}


text:
oh hi guys

This site uses npm, Webpack, React, Sass, and Babel in addition to stuff like Materialize CSS, Material Icons and Google Fonts.

You might say this is overkill for a simple portfolio site, and I would agree with you.
Part of the reason I'm building this is to get experience building in this kind of environment as opposed to Codepen, though, so here we are.


text:
package org.pentaho.di.imp.rule;

import java.util.List;

import junit.framework.TestCase;

import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.plugins.ImportRulePluginType;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.imp.rules.JobHasNoDisabledHopsImportRule;
import org.pentaho.di.job.JobHopMeta;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.job.entries.special.JobEntrySpecial;
import org.pentaho.di.job.entry.JobEntryCopy;

public class JobHasNoDisabledHopsImportRuleIT extends TestCase {

  @Override
  protected void setUp() throws Exception {
    KettleEnvironment.init();
  }

  public void testRule() throws Exception {

    // Create a job to test.
    //
    JobMeta jobMeta = new JobMeta();

    // Add 3 dummy steps connected with hops.
    //
    JobEntryCopy lastCopy = null;
    for ( int i = 0; i < 3; i++ ) {
      JobEntrySpecial dummy = new JobEntrySpecial();
      dummy.setDummy( true );
      dummy.setName( "dummy" + ( i + 1 ) );

      JobEntryCopy copy = new JobEntryCopy( dummy );
      copy.setLocation( 50 + i * 50, 50 );
      copy.setDrawn();
      jobMeta.addJobEntry( copy );

      if ( lastCopy != null ) {
        JobHopMeta hop = new JobHopMeta( lastCopy, copy );
        jobMeta.addJobHop( hop );
      }
      lastCopy = copy;
    }

    // Load the plugin to test from the registry.
    //
    PluginRegistry registry = PluginRegistry.getInstance();
    PluginInterface plugin = registry.findPluginWithId( ImportRulePluginType.class, "JobHasNoDisabledHops" );
    assertNotNull( "The 'job has no disabled hops' rule could not be found in the plugin registry!", plugin );

    JobHasNoDisabledHopsImportRule rule = (JobHasNoDisabledHopsImportRule) registry.loadClass( plugin );
    assertNotNull( "The 'job has no disabled hops' class could not be loaded by the plugin registry!", plugin );

    rule.setEnabled( true );

    List<ImportValidationFeedback> feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
    assertTrue(
      "An approval ruling was expected",
      feedback.get( 0 ).getResultType() == ImportValidationResultType.APPROVAL );

    jobMeta.getJobHop( 0 ).setEnabled( false );

    feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
    assertTrue(
      "An error ruling was expected", feedback.get( 0 ).getResultType() == ImportValidationResultType.ERROR );

    rule.setEnabled( false );

    feedback = rule.verifyRule( jobMeta );
    assertTrue( "We didn't expect any feedback from the 'job has no disabled hops' while disabled", feedback
      .isEmpty() );
  }
}


text:
#define CONFIG_FLOAT 1
#include "mpegaudiodec.c"

#if CONFIG_MP1FLOAT_DECODER
AVCodec ff_mp1float_decoder =
{
    "mp1float",
    AVMEDIA_TYPE_AUDIO,
    CODEC_ID_MP1,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    .close = NULL,
    decode_frame,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
    .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
};
#endif
#if CONFIG_MP2FLOAT_DECODER
AVCodec ff_mp2float_decoder =
{
    "mp2float",
    AVMEDIA_TYPE_AUDIO,
    CODEC_ID_MP2,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    .close = NULL,
    decode_frame,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
    .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
};
#endif
#if CONFIG_MP3FLOAT_DECODER
AVCodec ff_mp3float_decoder =
{
    "mp3float",
    AVMEDIA_TYPE_AUDIO,
    CODEC_ID_MP3,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    .close = NULL,
    decode_frame,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
    .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
};
#endif
#if CONFIG_MP3ADUFLOAT_DECODER
AVCodec ff_mp3adufloat_decoder =
{
    "mp3adufloat",
    AVMEDIA_TYPE_AUDIO,
    CODEC_ID_MP3ADU,
    sizeof(MPADecodeContext),
    decode_init,
    NULL,
    .close = NULL,
    decode_frame_adu,
    CODEC_CAP_PARSE_ONLY,
    .flush= flush,
    .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
};
#endif
#if CONFIG_MP3ON4FLOAT_DECODER
AVCodec ff_mp3on4float_decoder =
{
    "mp3on4float",
    AVMEDIA_TYPE_AUDIO,
    CODEC_ID_MP3ON4,
    sizeof(MP3On4DecodeContext),
    decode_init_mp3on4,
    NULL,
    decode_close_mp3on4,
    decode_frame_mp3on4,
    .flush= flush,
    .long_name= NULL_IF_CONFIG_SMALL("MP3onMP4"),
};
#endif


text:
id: bad87fee1348bd9aedc08826
title: Individuare elementi per classe usando jQuery
challengeType: 6
forumTopicId: 18316
required:
  -
    link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css'
dashedName: target-elements-by-class-using-jquery
---

# --description--

Vedi come abbiamo fatto rimbalzare tutti gli elementi del tuo `button`? Li abbiamo selezionati con `$("button")`, poi abbiamo aggiunto alcune classi CSS con `.addClass("animated bounce");`.

Hai appena usato la funzione `.addClass()` di jQuery, che ti permette di aggiungere classi agli elementi.

Innanzitutto, individuiamo gli elementi `div` con la classe `well` utilizzando il selettore `$(".well")`.

Nota che, proprio come con le dichiarazioni CSS, devi digitare un `.` prima del nome della classe.

Quindi usa la funzione `.addClass()` di jQuery per aggiungere le classi `animated` e `shake`.

Ad esempio, potresti scuotere tutti gli elementi di classe `text-primary` aggiungendo quanto segue alla tua `document ready function`:

```js
$(".text-primary").addClass("animated shake");
```

# --hints--

Dovresti usare la funzione jQuery `addClass()` per dare le classi `animated` e `shake` a tutti i tuoi elementi di classe `well`.

```js
assert($('.well').hasClass('animated') && $('.well').hasClass('shake'));
```

Dovresti usare solo jQuery per aggiungere queste classi all'elemento.

```js
assert(!code.match(/class\.\*animated/g));
```

# --seed--

## --seed-contents--

```html
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>

<!-- Only change code above this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
```

# --solutions--

```html
<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
    $(".well").addClass("animated shake");
  });
</script>

<!-- Only change code above this line -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>
```


text:
<?php

namespace Sylius\Component\Shipping\Model;

use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Model\CodeAwareInterface;
use Sylius\Component\Resource\Model\TimestampableInterface;

/**
 * @author Paweł Jędrzejewski <pawel@sylius.org>
 */
interface ShippingCategoryInterface extends CodeAwareInterface, TimestampableInterface, ResourceInterface
{
    /**
     * @return mixed
     */
    public function getId();

    /**
     * @return string
     */
    public function getName();

    /**
     * @param string $name
     */
    public function setName($name);

    /**
     * @return string
     */
    public function getDescription();

    /**
     * @param string $description
     */
    public function setDescription($description);
}


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

import static com.google.common.base.Preconditions.checkNotNull;

public class Failure
        extends RuntimeException
{
    private final String type;

    Failure(String type, String message, Failure cause)
    {
        super(message, cause, true, true);
        this.type = checkNotNull(type, "type is null");
    }

    public String getType()
    {
        return type;
    }

    @Override
    public String toString()
    {
        String message = getMessage();
        if (message != null) {
            return type + ": " + message;
        }
        return type;
    }
}


text:
package com.example.lhy.cons;

/**
 * Created by 刘焕宇 on 16/7/16.
 * QQ:310719413
 * Email:freshmboy@126.com
 */
public class IntentValues {

    public static final String VR_PREVIEW = "vr_preview";
    public static final String VR_IMAGE_URL = "vr_image_url";

    public static final String VR_TYPE = "vr_type";
}


text:
'use strict';

var base = require('../_base');

module.exports = function(warp){
	return base.defineModel(warp, 'ReqSeries', [
		base.column_varchar_50('name')
		], {
			table: 'req_series',
			no_column_version:true
		});
};


text:
using System.Web.Mvc;

namespace RealtyInvest.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult RealtyView(int? id)
        {
            return View();
        }
        public ActionResult About()
        {
            return View();
        }
        public ActionResult Realty()
        {
            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}


text:
import cgi, cgitb
form = cgi.FieldStorage()
if form.getvalue('textcontent'):
   text_content = form.getvalue('textcontent')
else:
   text_content = "Not entered"
print("Content-type:text/html\r\n\r\n")
print("")
print("")
print("<title>Text Area for CGI Program</title>")
print("")
print("")
print("
 Entered Text Content is %s
" % text_content)
print("")
print("")


text:
var logger = require('mino-logger');

module.exports = function(browser_server){

	return function(req, res){
		res.json(browser_server.info());
	}
}