text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using BepuUtilities.Memory;
using System.Runtime.CompilerServices;

namespace BepuUtilities.Collections
{
    /// <summary>
    /// Container supporting constant time adds and removes while preserving fast iteration times.
    /// Offers very direct access to information at the cost of safety.
    /// </summary>
    /// <remarks>
    /// <para>
    /// Be very careful when using this type. It has sacrificed a lot upon the altar of performance; a few notable issues include:
    /// it is a value type and copying it around will break things without extreme care,
    /// it cannot be validly default-constructed,
    /// it exposes internal structures to user modification,
    /// it rarely checks input for errors,
    /// the enumerator doesn't check for mid-enumeration modification,
    /// it allows unsafe addition that can break if the user doesn't manage the capacity,
    /// it works on top of an abstracted memory blob which might internally be a pointer that could be rugpulled,
    /// it does not (and is incapable of) checking that provided memory gets returned to the same pool that it came from.
    /// </para>
    /// <para>Note that the implementation is extremely simple. It uses single-step linear probing under the assumption of very low collision rates.
    /// A generous table capacity is recommended; this trades some memory for simplicity and runtime performance.</para></remarks>
    /// <typeparam name="T">Type of element held by the container.</typeparam>
    /// <typeparam name="TEqualityComparer">Type of the equality tester and hash calculator used.</typeparam>
    public struct QuickSet<T, TEqualityComparer> where TEqualityComparer : IEqualityComparerRef<T> where T : unmanaged
    {
        /// <summary>
        /// Gets the number of elements in the set.
        /// </summary>
        public int Count;
        /// <summary>
        /// Mask for use in performing fast modulo operations for hashes. Requires that the table span is a power of 2.
        /// </summary>
        public int TableMask;
        /// <summary>
        /// Desired size of the table relative to the size of the key/value spans in terms of a power of 2. Table capacity target will be elementCapacityTarget * 2^TablePowerOffset.
        /// </summary>
        public int TablePowerOffset;

        /// <summary>
        /// Backing memory of the set's table. Values are distributed according to the EqualityComparer's hash function.
        /// Slots containing 0 are unused and point to nothing. Slots containing higher values are equal to one plus the index of an element in the Span.
        /// </summary>
        public Buffer<int> Table;

        /// <summary>
        /// Backing memory containing the elements of the set.
        /// Indices from 0 to Count-1 hold actual data. All other data is undefined.
        /// </summary>
        public Buffer<T> Span;

        /// <summary>
        /// Equality comparer used to compare and hash elements.
        /// </summary>
        public TEqualityComparer EqualityComparer;

        /// <summary>
        /// Gets or sets an element at the given index in the list representation of the set.
        /// </summary>
        /// <param name="index">Index to grab an element from.</param>
        /// <returns>Element at the given index in the set.</returns>
        public ref T this[int index]
        {
            //TODO: Check inlining
            [MethodImpl(MethodImplOptions.AggressiveInlining)]
            get
            {
                Debug.Assert(index >= 0 && index < Count, "Index should be within the set's size.");
                return ref Span[index];
            }
        }

        /// <summary>
        /// Creates a new set.
        /// </summary>
        /// <param name="initialSpan">Span to use as backing memory of the set elements.</param>
        /// <param name="initialTableSpan">Span to use as backing memory of the table. Must be zeroed out.</param>
        /// <param name="comparer">Comparer to use for the set.</param>
        /// <param name="tablePowerOffset">Target size of the table relative to the number of stored elements.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public QuickSet(ref Buffer<T> initialSpan, ref Buffer<int> initialTableSpan, TEqualityComparer comparer, int tablePowerOffset = 2)
        {
            ValidateSpanCapacity(ref initialSpan, ref initialTableSpan);
            Span = initialSpan;
            Table = initialTableSpan;
            Count = 0;
            TableMask = Table.Length - 1;
            TablePowerOffset = tablePowerOffset;
            EqualityComparer = comparer;
            Debug.Assert(EqualityComparer != null);
            ValidateTableIsCleared(ref initialTableSpan);
        }

        /// <summary>
        /// Creates a new set using a default constructed equality comparer.
        /// </summary>
        /// <param name="initialSpan">Span to use as backing memory of the set elements.</param>
        /// <param name="initialTableSpan">Span to use as backing memory of the table. Must be zeroed.</param>
        /// <param name="tablePowerOffset">Target size of the table relative to the number of stored elements.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public QuickSet(ref Buffer<T> initialSpan, ref Buffer<int> initialTableSpan, int tablePowerOffset = 2)
            : this(ref initialSpan, ref initialTableSpan, default, tablePowerOffset)
        {
        }

        /// <summary>
        /// Creates a new set.
        /// </summary>
        /// <param name="pool">Pool to pull spans from.</param>
        /// <param name="initialCapacity">Initial target size of the key and value spans. The size of the initial buffer will be at least as large as the initialCapacity.</param>
        /// <param name="tableSizePower">Target capacity relative to the initial capacity in terms of a power of 2. The size of the initial table buffer will be at least 2^tableSizePower times larger than the initial capacity.</param>
        /// <param name="comparer">Comparer to use in the set.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public QuickSet(int initialCapacity, int tableSizePower, IUnmanagedMemoryPool pool, TEqualityComparer comparer)
        {
            pool.TakeAtLeast<T>(initialCapacity, out var span);
            pool.TakeAtLeast<int>(span.Length << tableSizePower, out var tableSpan);
            //No guarantee that the table is clean; clear it.
            tableSpan.Clear(0, tableSpan.Length);
            this = new QuickSet<T, TEqualityComparer>(ref span, ref tableSpan, comparer, tableSizePower);
        }

        /// <summary>
        /// Creates a new set with a default constructed comparer.
        /// </summary>
        /// <param name="pool">Pool to pull spans from.</param>
        /// <param name="initialCapacity">Initial target size of the key and value spans. The size of the initial buffer will be at least as large as the initialCapacity.</param>
        /// <param name="tableSizePower">Target capacity relative to the initial capacity in terms of a power of 2. The size of the initial table buffer will be at least 2^tableSizePower times larger than the initial capacity.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public QuickSet(int initialCapacity, int tableSizePower, IUnmanagedMemoryPool pool)
            : this(initialCapacity, tableSizePower, pool, default)
        {
        }

        /// <summary>
        /// Creates a new set with a default constructed comparer.
        /// </summary>
        /// <param name="pool">Pool to pull spans from.</param>
        /// <param name="initialCapacity">Initial target size of the key and value spans. The size of the initial buffer will be at least as large as the initialCapacity.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public QuickSet(int initialCapacity, IUnmanagedMemoryPool pool)
            : this(initialCapacity, 2, pool, default)
        {
        }

        /// <summary>
        /// Swaps out the set's backing memory span for a new span.
        /// If the new span is smaller, the set's count is truncated and the extra elements are dropped.
        /// The old span is not cleared or returned to any pool; if it needs to be pooled or cleared, the user must handle it.
        /// </summary>
        /// <param name="newSpan">New span to use for elements.</param>
        /// <param name="newTableSpan">New span to use for the table. Must be zeroed.</param>
        /// <param name="oldSpan">Previous span used for elements.</param>
        /// <param name="oldTableSpan">Previous span used for the table.</param>
        public void Resize(ref Buffer<T> newSpan, ref Buffer<int> newTableSpan, out Buffer<T> oldSpan, out Buffer<int> oldTableSpan)
        {
            ValidateSpanCapacity(ref newSpan, ref newTableSpan);
            ValidateTableIsCleared(ref newTableSpan);
            var oldSet = this;
            Span = newSpan;
            Table = newTableSpan;
            Count = 0;
            TableMask = newTableSpan.Length - 1;
            var newCount = oldSet.Count > newSpan.Length ? newSpan.Length : oldSet.Count;

            //Unfortunately we can't really do a straight copy; the backing table relies on modulo operations.
            //Technically, we could copy the regular set and then rely on a partial add to take care of the rest, but bleh!
            //Should really attempt to avoid resizes on sets and dictionaries whenever possible anyway. It ain't fast.
            for (int i = 0; i < newCount; ++i)
            {
                //We assume that ref adds will get inlined reasonably here. That's not actually guaranteed, but we'll bite the bullet.
                //(You could technically branch on the Unsafe.SizeOf<T>, which should result in a compile time specialized zero overhead implementation... but meh!)
                AddUnsafely(ref oldSet.Span[i]);
            }
            oldSpan = oldSet.Span;
            oldTableSpan = oldSet.Table;

        }

        /// <summary>
        /// Resizes the set's backing array for the given size.
        /// If the new span is smaller, the set's count is truncated and the extra elements are dropped.
        /// </summary>
        /// <param name="newSize">Minimum size of the new object memory block. Actual size may be larger.</param>
        /// <param name="pool">Pool to take spans from.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Resize(int newSize, IUnmanagedMemoryPool pool)
        {
            var targetCapacity = pool.GetCapacityForCount<T>(newSize);
            if (targetCapacity != Span.Length)
            {
                var oldSet = this;
                pool.TakeAtLeast<T>(newSize, out var newSpan);
                pool.TakeAtLeast<int>(newSpan.Length << TablePowerOffset, out var newTableSpan);
                //There is no guarantee that the table retrieved from the pool is clean. Clear it!
                newTableSpan.Clear(0, newTableSpan.Length);
                Resize(ref newSpan, ref newTableSpan, out var oldSpan, out var oldTableSpan);
                oldSet.Dispose(pool);
            }
        }

        /// <summary>
        /// Returns the resources associated with the set to pools. Any managed references still contained within the set are cleared (and some unmanaged resources may also be cleared).
        /// </summary>
        /// <param name="pool">Pool used for element spans.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Dispose(IUnmanagedMemoryPool pool)
        {
            pool.Return(ref Span);
            pool.Return(ref Table);
        }

        /// <summary>
        /// Ensures that the set has enough room to hold the specified number of elements.
        /// </summary>
        /// <param name="pool">Pool used for spans.</param>
        /// <param name="count">Number of elements to hold.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void EnsureCapacity(int count, IUnmanagedMemoryPool pool)
        {
            if (count > Span.Length)
            {
                Resize(count, pool);
            }
        }

        /// <summary>
        /// Shrinks the internal buffers to the smallest acceptable size and releases the old buffers to the pools.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <param name="pool">Pool used for spans.</param>
        public void Compact(IUnmanagedMemoryPool pool)
        {
            Validate();
            var targetCapacity = pool.GetCapacityForCount<T>(Count);
            if (targetCapacity < Span.Length)
                Resize(Count, pool);
        }

        /// <summary>
        /// Gets the index of the element in the table.
        /// </summary>
        /// <param name="element">Element to look up.</param>
        /// <param name="tableIndex">Index of the element in the redirect table, or if it is not present, the index of where it would be added.</param>
        /// <param name="elementIndex">The index of the element in the elements array, if it exists; -1 otherwise.</param>
        /// <returns>True if the element is present in the set, false if it is not.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool GetTableIndices(ref T element, out int tableIndex, out int elementIndex)
        {
            Validate();
            //The table lengths are guaranteed to be a power of 2, so the modulo is a simple binary operation.
            tableIndex = HashHelper.Rehash(EqualityComparer.Hash(ref element)) & TableMask;
            //0 in the table means 'not taken'; all other values are offset by 1 upward. That is, 1 is actually index 0, 2 is actually index 1, and so on.
            //This is preferred over using a negative number for flagging since clean buffers will contain all 0's.
            while ((elementIndex = Table[tableIndex]) > 0)
            {
                //This table index is taken. Is this the specified element?
                //Remember to decode the object index.
                if (EqualityComparer.Equals(ref Span[--elementIndex], ref element))
                {
                    return true;
                }
                tableIndex = (tableIndex + 1) & TableMask;
            }
            elementIndex = -1;
            return false;
        }

        /// <summary>
        /// Gets the index of the element in the set if it exists.
        /// </summary>
        /// <param name="element">Element to get the index of.</param>
        /// <returns>The index of the element if the element exists in the set, -1 otherwise.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public int IndexOf(T element)
        {
            GetTableIndices(ref element, out int tableIndex, out int objectIndex);
            return objectIndex;
        }

        /// <summary>
        /// Gets the index of the element in the set if it exists.
        /// </summary>
        /// <param name="element">Element to get the index of.</param>
        /// <returns>The index of the element if the element exists in the set, -1 otherwise.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public int IndexOf(ref T element)
        {
            GetTableIndices(ref element, out int tableIndex, out int objectIndex);
            return objectIndex;
        }

        /// <summary>
        /// Checks if a given element already belongs to the set.
        /// </summary>
        /// <param name="element">Element to test for.</param>
        /// <returns>True if the element already belongs to the set, false otherwise.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Contains(T element)
        {
            return GetTableIndices(ref element, out int tableIndex, out int objectIndex);
        }

        /// <summary>
        /// Checks if a given element already belongs to the set.
        /// </summary>
        /// <param name="element">Element to test for.</param>
        /// <returns>True if the element already belongs to the set, false otherwise.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Contains(ref T element)
        {
            return GetTableIndices(ref element, out int tableIndex, out int objectIndex);
        }

        /// <summary>
        /// Adds an element to the set. If a version of the element (same hash code, 'equal' by comparer) is already present,
        /// it is replaced by the given version.
        /// Does not resize in the event that the capacity is exceeded.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <returns>True if the element was added to the set, false if the element was already present and was instead replaced.</returns>
        //[MethodImpl(MethodImplOptions.AggressiveInlining)] //TODO: Test performance of full chain inline.
        public bool AddAndReplaceUnsafely(ref T element)
        {
            Validate();
            if (GetTableIndices(ref element, out int tableIndex, out int elementIndex))
            {
                //Already present!
                Span[elementIndex] = element;
                return false;
            }

            //It wasn't in the set. Add it!
            ValidateUnsafeAdd();
            Span[Count] = element;
            //Use the encoding- all indices are offset by 1 since 0 represents 'empty'.
            Table[tableIndex] = ++Count;
            return true;
        }

        /// <summary>
        /// Adds an element to the set. If a version of the element (same hash code, 'equal' by comparer) is already present,
        /// it is replaced by the given version.
        /// Does not resize in the event that the capacity is exceeded.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <returns>True if the element was added to the set, false if the element was already present and was instead replaced.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool AddAndReplaceUnsafely(T element)
        {
            return AddAndReplaceUnsafely(ref element);
        }

        /// <summary>
        /// Adds an element to the set if it is not already present.
        /// Does not resize in the event that the capacity is exceeded.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <returns>True if the element was added to the set, false if the element was already present.</returns>
        //[MethodImpl(MethodImplOptions.AggressiveInlining)] //TODO: Test performance of full chain inline.
        public bool AddUnsafely(ref T element)
        {
            Validate();
            if (GetTableIndices(ref element, out int tableIndex, out int elementIndex))
            {
                //Already present!
                return false;
            }

            //It wasn't in the set. Add it!
            ValidateUnsafeAdd();
            Span[Count] = element;
            //Use the encoding- all indices are offset by 1 since 0 represents 'empty'.
            Table[tableIndex] = ++Count;
            return true;
        }

        /// <summary>
        /// Adds an element to the set if it is not already present.
        /// Does not resize in the event that the capacity is exceeded.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <returns>True if the element was added to the set, false if the element was already present.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool AddUnsafely(T element)
        {
            return AddUnsafely(ref element);
        }

        /// <summary>
        /// Adds an element to the set. If a version of the element (same hash code, 'equal' by comparer) is already present,
        /// it is replaced by the given version.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <param name="pool">Pool used for spans.</param>
        /// <returns>True if the element was added to the set, false if the element was already present and was instead replaced.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool AddAndReplace(ref T element, IUnmanagedMemoryPool pool)
        {
            if (Count == Span.Length)
            {
                //There's no room left; resize.
                Resize(Count * 2, pool);

                //Note that this is tested before any indices are found.
                //If we resized only after determining that it was going to be added,
                //the potential resize would invalidate the computed indices.
            }
            return AddAndReplaceUnsafely(ref element);
        }

        /// <summary>
        /// Adds an element to the set if it is not already present.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <param name="pool">Pool used for spans.</param>
        /// <returns>True if the element was added to the set, false if the element was already present.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Add(ref T element, IUnmanagedMemoryPool pool)
        {
            if (Count == Span.Length)
            {
                //There's no room left; resize.
                Resize(Count * 2, pool);

                //Note that this is tested before any indices are found.
                //If we resized only after determining that it was going to be added,
                //the potential resize would invalidate the computed indices.
            }
            return AddUnsafely(ref element);
        }

        /// <summary>
        /// Adds an element to the set. If a version of the element (same hash code, 'equal' by comparer) is already present,
        /// it is replaced by the given version.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <param name="pool">Pool used for spans.</param>
        /// <returns>True if the element was added to the set, false if the element was already present and was instead replaced.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool AddAndReplace(T element, IUnmanagedMemoryPool pool)
        {
            return AddAndReplaceUnsafely(ref element);
        }

        /// <summary>
        /// Adds an element to the set if it is not already present.
        /// </summary>
        /// <param name="element">Element to add.</param>
        /// <param name="pool">Pool used for spans.</param>
        /// <returns>True if the element was added to the set, false if the element was already present.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Add(T element, IUnmanagedMemoryPool pool)
        {
            return Add(ref element, pool);
        }

        //Note: the reason this is named "FastRemove" instead of just "Remove" despite it being the only remove present is that
        //there may later exist an order preserving "Remove". That would be a very sneaky breaking change.

        /// <summary>
        /// Removes an element from the dictionary according to its table and element index. Can only be used if the table and element index are valid.
        /// </summary>
        /// <param name="tableIndex">Index of the table entry associated with the existing element to remove.</param>
        /// <param name="elementIndex">Index of the existing element to remove in the contiguous element array.</param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void FastRemove(int tableIndex, int elementIndex)
        {
            Debug.Assert(GetTableIndices(ref Span[elementIndex], out var debugTableIndex, out var debugElementIndex) && debugTableIndex == tableIndex && debugElementIndex == elementIndex,
                 "The table index and element index used to directly remove must match an actual element.");

            //Add and remove must both maintain a property:
            //All items are either at their desired index (as defined by the hash), or they are contained in a contiguous block clockwise from the desired index.
            //Removals seek to fill the gap they create by searching clockwise to find items which can be moved backward.
            //Search clockwise for an item to fill this slot. The search must continue until a gap is found.
            int moveCandidateIndex;
            int gapIndex = tableIndex;
            //Search clockwise.
            while ((moveCandidateIndex = Table[tableIndex = (tableIndex + 1) & TableMask]) > 0)
            {
                //This slot contains something. What is its actual index?
                --moveCandidateIndex;
                int desiredIndex = HashHelper.Rehash(EqualityComparer.Hash(ref Span[moveCandidateIndex])) & TableMask;

                //Would this element be closer to its actual index if it was moved to the gap?
                //To find out, compute the clockwise distance from the gap and the clockwise distance from the ideal location.

                var distanceFromGap = (tableIndex - gapIndex) & TableMask;
                var distanceFromIdeal = (tableIndex - desiredIndex) & TableMask;
                if (distanceFromGap <= distanceFromIdeal)
                {
                    //The distance to the gap is less than or equal the distance to the ideal location, so just move to the gap.
                    Table[gapIndex] = Table[tableIndex];
                    gapIndex = tableIndex;
                }

            }
            //Clear the table gap left by the removal.
            Table[gapIndex] = 0;
            //Swap the final element into the removed object's element array index, if the removed object wasn't the last object.
            --Count;
            if (elementIndex < Count)
            {
                Span[elementIndex] = Span[Count];
                //Locate the swapped object in the table and update its index.
                GetTableIndices(ref Span[elementIndex], out tableIndex, out int oldElementIndex);
                Table[tableIndex] = elementIndex + 1; //Remember the encoding! all indices offset by 1.
            }
            //Clear the final slot in the elements set.
            Span[Count] = default;
        }

        /// <summary>
        /// Removes an element from the set if belongs to the set.
        /// Does not preserve the order of elements in the set.
        /// </summary>
        /// <param name="element">Element to remove.</param>
        /// <returns>True if the element was found and removed, false otherwise.</returns>
        public bool FastRemove(ref T element)
        {
            Validate();
            //Find it.
            if (GetTableIndices(ref element, out int tableIndex, out int elementIndex))
            {
                //We found the object!
                FastRemove(tableIndex, elementIndex);
                return true;
            }
            return false;
        }

        /// <summary>
        /// Removes an element from the set if belongs to the set.
        /// Does not preserve the order of elements in the set.
        /// </summary>
        /// <param name="element">Element to remove.</param>
        /// <returns>True if the element was found and removed, false otherwise.</returns>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool FastRemove(T element)
        {
            return FastRemove(ref element);
        }

        /// <summary>
        /// Removes all elements from the set.
        /// </summary>
        public void Clear()
        {
            //While it may be appealing to remove individual elements from the set when the set is sparse,
            //using a brute force clear over the entire table is almost always faster. And it's a lot simpler!
            Table.Clear(0, Table.Length);
            Span.Clear(0, Count);
            Count = 0;
        }

        /// <summary>
        /// Removes all elements from the set without modifying the contents of the elements array.
        /// </summary>
        public void FastClear()
        {
            Table.Clear(0, Table.Length);
            Count = 0;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public unsafe static implicit operator Span<T>(in QuickSet<T, TEqualityComparer> set)
        {
            return new Span<T>(set.Span.Memory, set.Count);
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public unsafe static implicit operator ReadOnlySpan<T>(in QuickSet<T, TEqualityComparer> set)
        {
            return new ReadOnlySpan<T>(set.Span.Memory, set.Count);
        }

        public Enumerator GetEnumerator()
        {
            Validate();
            return new Enumerator(ref Span, Count);
        }

        public struct Enumerator : IEnumerator<T>
        {
            private readonly Buffer<T> backingArray;
            private readonly int count;
            private int index;

            public Enumerator(ref Buffer<T> backingArray, int count)
            {
                this.backingArray = backingArray;
                this.count = count;

                index = -1;
            }

            public T Current
            {
                get { return backingArray[index]; }
            }

            public void Dispose()
            {
            }

            object System.Collections.IEnumerator.Current
            {
                get { return Current; }
            }

            public bool MoveNext()
            {
                return ++index < count;
            }

            public void Reset()
            {
                index = -1;
            }
        }
        [Conditional("DEBUG")]
        static void ValidateSpanCapacity(ref Buffer<T> span, ref Buffer<int> tableSpan)
        {
            Debug.Assert(tableSpan.Length >= span.Length, "The table span must be at least as large as the element span.");
            Debug.Assert((tableSpan.Length & (tableSpan.Length - 1)) == 0, "QuickSets depend upon power of 2 backing table span sizes for efficient modulo operations.");
        }

        [Conditional("DEBUG")]
        private void Validate()
        {
            Debug.Assert(Span.Length != 0 && Table.Length != 0, "The QuickSet must have its internal buffers and pools available; default-constructed or disposed sets should not be used.");
            ValidateSpanCapacity(ref Span, ref Table);
        }

        [Conditional("DEBUG")]
        void ValidateUnsafeAdd()
        {
            Debug.Assert(Count < Span.Length, "Unsafe adders can only be used if the capacity is guaranteed to hold the new size.");
        }

        [Conditional("DEBUG")]
        void ValidateTableIsCleared(ref Buffer<int> span)
        {
            for (int i = 0; i < span.Length; ++i)
            {
                Debug.Assert(span[i] == 0, "The table provided to the set must be cleared.");
            }
        }

    }
}


text:
Iran likely to hold off on retaliation over scientist's killing - U.S. envoy
By Humeyra Pamuk and Matt Spetalnick WASHINGTON (Reuters) - Iran is unlikely to retaliate over the assassination of a prominent nuclear scientist before the inauguration of Joe Biden in case it jeopardizes any future sanctions relief, the top U.S. envoy on Iran told Reuters on Thursday. Mohsen Fakhrizadeh, who had little public profile in Iran but had been named by Israel as a prime player in what it says is Iran's nuclear weapons quest, was killed on Friday when he was ambushed on a highway near Tehran and his car sprayed with bullets.
By Humeyra Pamuk and Matt Spetalnick
WASHINGTON (Reuters) - Iran is unlikely to retaliate over the assassination of a prominent nuclear scientist before the inauguration of Joe Biden in case it jeopardizes any future sanctions relief, the top U.S. envoy on Iran told Reuters on Thursday.
Mohsen Fakhrizadeh, who had little public profile in Iran but had been named by Israel as a prime player in what it says is Iran's nuclear weapons quest, was killed on Friday when he was ambushed on a highway near Tehran and his car sprayed with bullets.
Elliott Abrams, Washington's special representative on Iran and Venezuela, said in an interview that Tehran was "desperately" in need of sanctions relief from the United States and that would be a key calculation in their decision-making as President-elect Biden takes over from President Donald Trump on Jan. 20.
"If they want sanctions relief, they know that they're going to need to enter some kind of negotiation after January 20, and it's got to be in their minds that they don't want to... undertake any activities between now and Jan 20 that make sanctions relief harder to get," he said.
Iran's clerical and military rulers have blamed Israel for Fakhrizadeh's killing, which has raised the prospect of a new standoff between Tehran and its longtime enemy. Prime Minister Benjamin Netanyahu's office has declined to comment on the killing.
Tensions between Washington and Tehran have risen since 2018, when Trump abandoned Obama's 2015 nuclear deal, and restored harsh economic sanctions to pressure Tehran to negotiate stricter curbs on its nuclear program, ballistic missile development and support for regional proxy forces.
In retaliation, Tehran gradually breached the deal's restrictions on its nuclear program. Biden has said he will return the United States to the deal if Iran resumes compliance.
Tehran has always denied seeking nuclear weapons.
Last week, Abrams said the Trump administration was planning to tighten sanctions on Tehran during its final weeks in power but also urged Biden to press for a deal that reduces the regional and nuclear threats posed by the Islamic Republic.
He added that he expected a negotiation to take place with Iran next year and that he believes a deal will be struck under the Biden administration.
Iran's clerical rulers have ruled out negotiations over its missile program or changing its regional policy. Instead it wants a change in U.S. policy, including the lifting of sanctions.
(Reporting by Humeyra Pamuk and Matt Spetalnick; Editing by Mary Milliken and Toby Chopra)

redpajama_set_name: RedPajamaCommonCrawl


text:
Why I'm Attending A Porn Conference?
Why the AVNs? ( A big porn conference in Vegas). I have always been fascinated by the porn world, the industry that is. Over the years, starting off in my early career working at Sexpo, I have the privilege of getting to know some of the industry's biggest names. But I was pleasantly surprised by what I got to see. I remember writing my first piece on porn stars and it was titled, "porn stars are people too." I think we all have this idea and stereotype of what a porn star should be. But with the exception of a few, mostly they are normal average people who are in touch with their sexuality. (Please note, I hate using the world normal in sentences like this as what is normal anyway? But for the purpose of trying to prove my point in regards to porn stars and how many people think they are not normal, I felt it was the better word to use).
I remember first getting close to a famous and back then controversial star. I found her down at Darling Harbour during one Sexpo wearing a hoodie to try and disguise her identity eating alone at a restaurant. I joined her and as we talked about everything from family and of course sex, I immediately forgot what she did for a living and just got to see her as this great personal I was having such a wonderful chat with.
The next day a friend confessed to me he was a fan and I offered to introduce him. He later called me after inviting him to the after party and said, "I'm going to fuck her." It was vulgar and as though she didn't have a choice in the matter. This is one of the biggest myths. Just because someone has sex on screen does not mean they just have sex with anything that moves. It's a business. Do you go giving your products or services for free? I got so mad at him because what he didn't know was that she was on holidays in Australia with her husband and child. Porn stars are people too with real lives just like you.
On making some great friendships, I was able to attend the AVN's two years ago. It was fascinating, eye opening but once again I was able to see that this industry is really just a big lucrative business and one that cashes in on a natural desire to watch and see sex. Think about it, the business is here because of the demand for it and do you ever hear about it suffering? It might be changing but not becoming any less popular.
What amazes me is how there are so many people out there that blame porn for everything, say how bad it is, won't cover it in the main stream and feel any association with it is harmful. But how many people do you think watch porn? How many of these people do you think watch porn (cough, hypocrite).
So many people fear porn and blame it for relationships issue because they don't understand it. They point the figure at porn for role modelling negative behaviours towards teens but do teens copy porn because porn tells them to or because we don't have enough adequate sex education to tell them the difference between porn sex and real sex? Do they fulfil their thirst for knowledge on this subject with porn because we don't teach them enough? What's the real problem? That porn exists or that we don't have enough sex education and have enough real conversations about sex? Is porn the real problem?
I can't say that the industry is perfect, but no industry is. But I also believe that we shouldn't be blaming it for all the things that we do. After all, it is just sex. I have more concerns with people watching, violence, murder and car crash scenes in movies (often with no consequences or regard for human life) than two or three or four consensual adults engaging in sexual fantasies.
Porn is not perfect, but there are so many myths and misunderstandings about it that make it feel and sound worse. Over the next week I hope to bust some more myths and stereotypes about the industry so you can better understand how it all works.
And if there is something you want to know, a question you want asked or a person you want me to go and find, head to my facebook page Dr Nikki Goldstein and send me a direct message with what that is.
Happy AVN week!
International Kissing Day
How To Ask Someone Out In Real Life


text:
Biografia
Critico, saggista, organizzatore culturale, ha fondato e diretto la rivista Cinema e Film. Ha curato libri su André Bazin, Jean-Luc Godard, Raffaello Matarazzo, Andy Warhol, Straub e Huillet, Alessandro Blasetti, Pietro Germi, Roberto Rossellini.

Ha diretto il Salso Film & TV Festival dal 1977 al 1989; dal 1990 al 1998 la Mostra internazionale del Nuovo Cinema di Pesaro, dal 1998 al 2002 la Cineteca Nazionale.

Regista del lungometraggio Olimpia agli amici (1970) e del documentario Rossellini visto da Rossellini (1992), è stato anche attore in film di Bernardo Bertolucci (Amore e rabbia, episodio Agonia) e Marco Ferreri (Dillinger è morto e Il seme dell'uomo), Straub e Huillet (Othon) e Francesca Archibugi (Questione di cuore).

È stato professore di Storia del cinema italiano all'Università di Roma Tor Vergata dal 2002 al 2008.

Nel settembre 2014 ha inaugurato un sito ufficiale che raccoglie una collezione ragionata dei suoi scritti sul cinema.

Filmografia

Regista
1970 - Olimpia agli amici
1992 - Rossellini visto da Rossellini

Attore
1968 - Amore e rabbia - di Bernardo Bertolucci
1968 - Dillinger è morto - di Marco Ferreri
1969 - Umano, non umano - di Mario Schifano
1969 - Othon - di Jean-Marie Straub e Danièle Huillet
1970 - Il seme dell'uomo - di Marco Ferreri
2000 - Ferreri, I Love You - di Fiorella Infascelli
2009 - Pietro Germi: il bravo, il bello, il cattivo - di Claudio Bondì
2010 - La balena di Rossellini - di Claudio Bondì
2015 - Filmstudio Mon Amour - di Toni D'Angelo
2016 - L'età d'oro - di Emanuela Piovano

Sceneggiatura
1988 - La maschera - sceneggiatura; soggetto

Altri progetti

Collegamenti esterni

Professori dell'Università degli Studi di Roma Tor Vergata

redpajama_set_name: RedPajamaWikipedia


text:
Consular assistance in Russia
Russia is currently at war in Ukraine. Are you in Russia and need consular assistance? Find your country's embassy in Russia on EmbassyPages.
Moving to Russia
Living in Russia
Home News Polish pilot errors main cause of Kaczynski crash: report
Polish pilot errors main cause of Kaczynski crash: report
The pilots of Poland's presidential jet were flying too low and too fast and were poorly prepared, a Polish report into the 2010 crash that killed then head of state Lech Kaczynski said Friday.
The crash report admitted most of the blame for the disaster in which all 96 people on board were killed lay with Poland, but it also listed a number of shortcomings by Russia where the plane went down.
"The flight crew of the airplane in question was not sufficiently prepared for the task at hand given the complexity of the situation the crew encountered during their last flight," the 328-page report said.
"The aircraft commander, co-pilot, and navigator had been trained hastily, haphazardly, and in violation of the respective training regulations," it added.
The report describes at length how the flight, in which Kaczynski's wife and many other high-profile Poles died, was badly prepared.
The doomed flight's military crew had not received appropriate training, the navigator's Russian was weak, and the meteorological information was incomplete, the report said.
The report mentions the "crew's improper preparation for the flight… presence of third parties in the cockpit, lack of the crew's effective cooperation, accepting too many responsibilities by the aircraft commander, insufficient level of the crew's training."
In its own crash report released in January, Russia had put the blame squarely on the Poles for the crash, arguing that the pilots brought about the tragedy by insisting on landing in fog.
But the Polish report found some shortcomings on the Russian side too, emphasising that the lighting at Smolensk North airport was inadequate as were instructions given by Russian air traffic controllers.
"The condition of the lighting system was incompatible with the specifications required of visual navaids," the report said.
The inquiry commission's findings also said that the terrain immediately ahead of the runway "was overgrown with trees which were taller than the permissible height of terrain obstacles in that area."
The Russian report had led to blame-trading between Warsaw and Moscow, with Polish Prime Minister Donald Tusk faulting the Russian findings.
A Polish government report on the crash is due to be released later this week.
Poland's conservative Law and Justice party — led by Jaroslaw Kaczynski the late president's twin brother — has accused Tusk's centre-right government of failing to take Russia to task.
A Law and Justice-run parliamentary commission is also probing the crash.
Last month, the commission's leader Antoni Macierewicz blamed Russia squarely, claiming it had forged the testimony of Smolensk's air traffic controllers, who he alleged had misled the pilots.
Adding an extra layer of sensitivity to the wrangling is the fact that the delegation had been bound for a memorial ceremony in nearby Katyn for thousands of Polish captives slain by the Soviet secret police in 1940, a massacre denied by the Kremlin until 1990.
Expatica Launches Expansion to Italy
New deadly strike hits Ukraine city after Crimean bridge blast
Germany probes rail 'sabotage' amid Russia tensions
Learn from history over nuclear threats, says pope


text:
Q: Problems with skype on ubuntu 16.04.4 on AMD ryzen I have an issue with skype. I have installed it months ago, and I did have no problem on using it (I don't remember if it was on this machine or the old one).
I have ubuntu 16.04.4, and I am using an AMD ryzen 7 processor (I don't know if that is relevant at all).
However, when I log in, skype closes the sesion, and logsin automatically again, and loops into this process until it crashes and closes.
I have tried by removing skype using purge, and installing it again, but nothing changes.

A: try (re)moving the folder  ~/.config/skypeforlinux. If you don't care about your saved conversations maybe just delete and it will probably work

redpajama_set_name: RedPajamaStackExchange


text:
Q: Insert FontFamily value into SelectedItem The project I'm working on has ChooseFont window. I add all the FontFamily objects from "Fonts.SystemFontFamilies" to ListBox (fontFamilyList) alphabetically. I need to highlight saved font from settings (it's saved as a string).
I've the following constructor:
public ChooseFontWindow()
{
    InitializeComponent();

    var fonts =
        from font in Fonts.SystemFontFamilies
        orderby font.Source
        select font;

    foreach (FontFamily f in fonts)
    {
        fontFamilyList.Items.Add(f);
    }

    fontFamilyList.SelectedItem = Properties.Settings.Default.FontFamily;
}

A: Here is a possible answer. I don't know if it will fix the problem without more information.
public ChooseFontWindow()
{
    InitializeComponent();

    var fonts =
        from font in Fonts.SystemFontFamilies
        orderby font.Source
        select font;

    foreach (FontFamily f in fonts)
    {
        fontFamilyList.Items.Add(f);
    }

    fontFamilyList.SelectedIndex = fonts.ToList().IndexOf(Properties.Settings.Default.FontFamily);
}

If that doesn't work, try this:
public ChooseFontWindow()
{
    InitializeComponent();

    var fonts =
        from font in Fonts.SystemFontFamilies
        orderby font.Source
        select font;

    foreach (FontFamily f in fonts)
    {
        fontFamilyList.Items.Add(f);
    }

    fontFamilyList.SelectedItem = fonts.FirstOrDefault(ff => ff.Name == Properties.Settings.Default.FontFamily.Name);
}


Energy and economic development significantly affect one another. Exactly how they do so, though, is far from straightforward and depends on a dizzying web of interrelated complex systems. As such, this post will not provide the reader with a definitive relationship between the two, but rather will provide an overview of topics regarding the relationship.
Energy is a crucial input for economic development, since nearly every single good and service that contributes to a country's gross domestic product (GDP) requires some form of energy. Roadside food vendors in India use propane to make flavorful dishes, the rail for Ethiopia's high-speed train connecting Addis Ababa to Djibouti's port is constructed out of steel that was made in China using coal coke and shipped across the ocean using residual fuel oil, and Google powers its massive server farms in the USA with electricity that it has purchased from companies harnessing wind and solar energy.
It is well-documented that over time, the rate at which societies consume energy increases as they achieve higher levels of development, since the total amount of economic activity increases. A graph of global energy consumption over the very long run exhibits a similar shape as that of global GDP per capita over time — near-zero growth for millennia, followed by comparatively astounding growth for two centuries — and one could essentially rephrase the second of the New Kaldor Facts in terms of energy consumption. There is a clear general trend of higher energy consumption being associated with higher incomes, as well as lower shares of population in extreme poverty, demonstrated by the graphs below.
An important distinction must be made between energy consumption and energy access. Much international attention gets directed towards expanding energy access, often in the form of solar panels for rural homes and small businesses. Even venture capital-backed companies have joined aid organizations in the fight against rural energy poverty, but these systems usually replace more primitive alternatives without enabling higher levels of consumption. Even if it were possible to provide universal access to modern energy technology, that alone is unlikely to dramatically improve well-being, since gaining access to distributed energy sources can generate some productivity gains, but the effect tends to be small.
As such, it turns out that energy consumption is more closely correlated with higher levels of well-being than energy access. Residential applications can greatly expand capability sets — lighting allows children to study after dark without worrying about accidentally spilling kerosene and getting burned, and using electric stoves instead of open fires for cooking reduces cases of lung and heart disease in women. However, large-scale, productive enterprises like agricultural processing facilities and manufacturing factories create an electrical load large enough to necessitate cost-effective power generation and distribution, while simultaneously creating incomes large enough to raise energy consumption.
Note that it is not clear whether the arrow of causality necessarily points from increased energy consumption towards economic growth. Energy consumption is endogenous to a given economy — that is, it is constantly changing in response to the prevailing economic conditions. As such, economic growth also enables increased energy consumption. If the incomes of a large portion of a country's population increase due to sustained economic growth, the population can afford to spend more money on energy.
In addition to increasing energy consumption, another pattern observed with higher levels of development is a transition towards primary energy sources with higher energy contents per volume of fuel. Prior to 1800, the vast majority of energy consumed was "traditional biomass" — wood, animal dung, and other organic matter. By 1900, coal made up about half of all energy consumed, petroleum products took off as a transportation and heating source around the same time, and nuclear energy saw a rapid expansion in the 1960s. Today's shift from fossil fuels to renewable energy is an interesting departure from the pattern of increasing energy density in energy sources. This overall transition, seen below, has occurred over centuries, but the same pattern can be seen today in many developing countries, often at a much more rapid pace than experienced by Europe and North America.
Finally, fossil fuel combustion results in both local ambient air pollution and global ambient air pollution. Since energy consumption increases with economic growth, and that energy tends to be fossil fuels at first, countries typically see rapid increases in air pollution as they strive to meet the energy demands of their economy. This dynamic can lead to a tension between those arguing for developing countries' right to pursue economic growth and those arguing for developing countries to adopt environmental policies as stringent as those adopted by developed countries. Gradually, local ambient air pollution tends to decline due to the combined effects of efficiency-boosting technological improvements driven by fear of decreasing energy supply and environmental regulations aimed at reducing pollution, as well as the natural tendency of economies to shift away from industry towards services which leads to a decrease in energy intensity of the economy (the number of energy units consumed per unit of GDP). Global ambient air pollution is much more difficult to mitigate, however, and the pattern of declining emissions is almost nonexistent along the path of transitioning energy sources. Below are plots of total SO2 (a local pollutant) over time and a plot of total CO2 (a global pollutant) over time.
Posted on July 17, 2018 March 19, 2019 by Ryan McGuinePosted in Air Pollution, Energy Transition, Growth, Technological ProgressTagged ambient air pollution, biomass, capability sets, economic development, economic growth, Energy, energy access, energy consumption, energy poverty, Energy Transition, fossil fuel, industry, Kaldor Facts, mitigation, modern energy, petroleum, productivity, renewable energy, renewables, services, structural change.
Great question, thanks for asking. SOx is primarily the result of "dirty" fuels — petroleum that has not had the sulfur removed and coal, mostly. When countries are at lower levels of development, there is usually a push to consume as much energy as possible for as low a cost as possible. A large portion of SOx emissions can be avoided, but doing so costs money, so we usually see countries push to reduce emissions only after they have had some time to grow. Around that time there was a strong environmental movement in the West (in the US, the EPA's Clean Air Act was passed in 1963, then amended in 1970, 77, and 90), while China was opening up to trade and really taking off economically, soon to be followed by other Asian countries.


The asking price for the Williams-Addison House is $16.8 million.
But here's the good news. That unpopular owner gave up and sold the house to a developer, who put it on the market on Tuesday. Now called the Williams-Addison House—a nod to its 19th century roots—the house just hit the market for $16.8 million.
The home has been remade to accommodate 21st century tastes — a grand master suite that's the size of many apartments, an entertainment space big enough to be a ballroom, a media room, wine cellar, health club-sized gym and sauna, plus a broad center hallway that leads to a library, drawing room, dining room, and den. The upstairs has an additional five bedrooms. There are fireplaces throughout. Add to that a guest cottage, garage, and ambitious landscaping plans. Yellow paint was removed to reveal the handsome red brick underneath.
We were given a tour by Victor Valentine of Capital City Real Estate, who is proud of his company's work with Georgetown architect Dale Overmyer, who got the project underway in 2006 with the previous owner, Marc Teren, a former Washington Post executive who curbed.com described as "notoriously unpopular." The problems for Teren came when he proposed subdividing the property. There was talk of building a second home on the property, and underground garages. Neighbors balked. Appearances before the Advisory Neighborhood Commission became volatile. There were work stoppages. The Georgetown Metropolitan speculated that "Teren simply ran out of money" and that's why he sold to Valentine's group in 2011.
Valentine says he paid about $7 million for the house, which he described as "basically a shell." The asking price for the finished, 10,000 square foot home, which sits on three-quarters of an acre, is $16.8 million. "You don't have to worry about development across the street," he said, noting that the tall front windows look out on Tudor Place mansion and gardens, a National Historic Landmark.
Prospective buyers can tour the house and get a sense of what it would look like furnished as some of the rooms have been staged by Kelly Proxmire, a member of the Washington Design Center Hall of Fame.


Depending on the severity of the damage, the process of returning to normal may take some time, due to rebuilding of infrastruture, and resuming water and power services.
Ensure that animals continue to have access to adequate shelter, food and water, and that they are not exposed to any hazards.
Locate and capture stranded/strayed animals.
Verify if animals have injuries or exposure to chemicals that require veterinary assistance.
Monitor the behaviour of animals to identify any issues as a result of the emergency such as smoke inhalation, food or water poisoning.
Seek veterinary advice or evaluation if you have concerns about animals being exposed to diseases as a result of the emergency.
In case of deaths after an emergency, post-mortems may be required to identify potential threats to other animals.
If animals are in new surroundings, ensure they are calm before leaving them. Frightened animals can become aggressive and may harm themselves or injure another animals.
Rebuild infrastructure to house animals, even if temporary.
Particular attention should be given to repairs to fencing and quarantine areas.
Areas exposed to chemicals need to be cleaned.
Electricity and water supply should be re-established as soon as possible, particularly in buildings housing large numbers of animals and/or during extreme weather conditions.
Food sources and distribution should be secured.
Removal and disposal of carcasses is important to prevent diseases and contamination of water sources.
Revegetation should occur to provide shelter to farm animals and wildlife.
If required, identify new areas to move livestock to.
Verify new living areas are sanitised, disinfected and free of contaminants.
Make sure accommodation is undamaged, clean and free of debris.
Animals that have been affected by a natural disaster may be traumatised and easily frightened.
Animals should be moved once property repairs have been completed.
Animals returning to properties must have adequate shade to shelter from the weather.


Have you seen the TV commercials: two people climbing up a rock cliff, one grabs a rock which causes a huge boulder to break loose. The boulder then falls, as the climbers watch, directly on top of their truck sitting below the cliff. Or a guy is sitting in a coffee shop working on his laptop when a tube of lip stick rolls to his foot. He picks it up and hands it to the woman sitting at the table next to him, only to turn around to realize his laptop was stolen. Each commercial ends with "Now What" and then NowWhat.com.
Any idea what these commercials are for? I didn't either; so after a year or so of seeing those commercials, I finally decided to check it out. Visit www.nowwhat.com. Great site! And great advertising! Although it took me some time to respond, I'm not the audience. For college students and young professionals, I have to believe this resonated. It's an ad campaign for insurance giant, State Farm. But, very subtly advertised.
This is a great example of an integrated marketing campaign. TV commercials (I believe I've seen outdoor billboards, too) drive traffic to the web site. The web site allows you to play games, sign up for free music, watch videos about (what else) insurance, and they're even hosting a live steaming music concert with well-known artists in just a few weeks.
It gets your attention. Funny commercials, with a teasing message.
It connects with the audience. The clear audience is 18-25 year olds, beacuse of the use of graphics, music connection and gaming options. I don't know much about the insurance industry, but I would guess that establishing a relationship early on has to be their goal. I've been with my insurance company since I got out of college (it just so happens to be State Farm).
I don't know how well the campaign has worked. But, I have to believe it's doing okay, because it's still in effect at least 12-18 months after I first saw my first NowWhat.com commercial in 2007.
If you have kids (especially girls) between the age of 4 and 14, you probably know what Camp Rock is. For those of you living on an island somewhere without any sense of connection to the media world, it's the latest marketing success by Disney Channel. Following the hugely successful (twice) High School Musical phenomenon, Disney, once again, hit it big with Camp Rock.
I was completely blown away when I became aware of the first High School Musical a few years ago. I happened to be in the presence of about 35 girls from kindergarteners to seniors in high school when a HSM song came on the radio. EVERY SINGLE GIRL IN THE PLACE started singing this song – so I had to know what it was.
The merchandise – WOW, the merchandise…sold everywhere!
Then, they did it all over again with HSM2 last year. My then-turning-9-year-old daughter scheduled her August birthday party around the movie and invited several friends over to watch the premier. My wife had burned copies of the soundtrack – which was conveniently made available about 2-3 days prior to the premier – to hand out to all the girls after the party. And, we weren't the only ones having a party. Just about everyone we know with kids in that age category were either having a party or attending one that night to watch!
SO, that brings me to Camp Rock. The premier was this past Friday night. And, again, people's schedules were planned around the show. My neices were coming to visit their grandparents, but had to be back home in time for the movie. My own kids were showered and ready to go (without complaining) by the 8:00 start time. Our neighbors were going to a friend's house to watch. And, do you know what else? My daughter and her friend watched it again the next day (we DVR-ed it of course)!
You can think of Disney whatever you want. But, what you can't argue with is their extreme sense of marketing success. The best part about it, in my opinion – well there's actually two things…1) the movies are not bad – meaning they are decent to watch as an adult (I can't tell you how many times I sat and watched HSM1 with my kids…sadly, I probably know all the words, too!); and 2) the kids enjoy it and are sucked in to the marketing trap that we so boldly create for our own clients on a daily basis. And, I mean "trap" in the nicest way possible. Disney (and The Impact Group) effectively grabs the attention of its audience and creates a response in them. Impressive!
Now, I have to get home to watch Camp Rock again!


text:
We're shaking our heads at the news.
Kristie Ceruti • August 3, 2016
Here at thedailyfloss.com we're in disbelief at the lack of love for our namesake in the latest recommendations for daily health as prescribed in the Dietary Guidelines for Americans.
A report from NPR.org yesterday allowed experts on both sides of the discussion to weigh in on the fact that flossing is not mentioned in said guidelines, which are presented every five years by the U.S. departments of Health and Human Services and Agriculture.
Even one expert who cites the evidence in support of flossing as "fairly weak" notes the challenge of tracking its long-term benefits to oral health.
According to NPR.org:
"In large epidemiological studies, the evidence for flossing turns out to be fairly weak," says Tim Iafolla, a dentist with the National Institute of Dental and Craniofacial Research, which is part of the National Institutes of Health.
Iafolla wasn't involved in drafting the dietary guidelines, but he's well aware of some of the problems with flossing research. Still, he points out, tracking the long-term benefits of flossing isn't cheap or easy.
"The condition we're trying to prevent, which is gum disease, is something that takes years to develop, and most of the studies only last for a few weeks or months," he says. "So the evidence that we gather from these studies is fairly indirect. We can look at bleeding gums, we can look at inflammation, but we have to extrapolate from that evidence to gum disease."
With new connection of mouth health to overall health discovered every day, do you really want to give yourself a pass on floss?
Of course you don't.
One periodontist with the American Academy of Periodontology shares observations from her 32 years of practice in the NPR.org interview, including the proof that "flossing does help get rid of films of bacteria that gunk up the space between teeth, causing infections and, potentially, contributing to bigger health problems."
After all, isn't it human nature to question authority? Why stop now.
The new guidelines don't stress flossing. Since when did you listen to guidelines? (According to the story, a survey by the academy found that almost 15 percent of adults would rather clean a toilet than floss their teeth.)
Trust your gut, people.
Deep down, flossing makes you feel better — just like the endorphin rush after a workout, the sigh of relief after filing taxes, the satisfied feeling after cleaning your house.
What are you waiting for? Get flossing.
Read the full report at: https://www.npr.org/sections/health-shots/2016/08/02/488378699/does-flossing-help-or-not-the-evidence-is-mixed-at-best?utm_source=npr_newsletter&utm_medium=email&utm_content=20160802&utm_campaign=npr_email_a_friend&utm_term=storyshare
Elevating #hashtag to a whole new level.
Patients tell a dental success story in Garden City, Michigan.
Sacramento-based dentist bridges gap between work and play #ie40under40
If you're not Flossin, what are you waiting for?
ProSites Achieves Recognition on Inc. 5000 List for the Fifth Time


We're your friends. We're your neighbors. We're your local Wintrust Community Bank. As part of the larger Wintrust Community Bank family, we were built in this area, for this area. We work hard to be an asset to the people and communities we serve: to get to know you and your needs in order to offer the best banking products and even better service. As a Wintrust Community Bank, we're proud to invest in and give back to our local area.
Looking for more reasons to bank with us? Click here.
We're dedicated to providing the solutions and services of a larger institution with the personal touch of a small community bank. Our customers and community come first: when you bank with us, you're more than just an account number. You're worth more than the content of your accounts. We believe in solid customer service and we prove it with every interaction.
Wintrust began over a card table, a few cold beers, and the idea to be the alternative to the big banks. In 1991, armed with a briefcase, a folding table, and a cell phone the size of a shoebox, Wintrust's current CEO and one of the company's founders, Ed Wehmer, set up shop in his hometown, a northern Chicago suburb. More than twenty-five years and more than 150 locations later, we've stayed true to that original mission. We believe there's still a need, and desire, for a true community bank: where tellers know their customers by name; bankers care about local businesses because they frequent them; and the bank invests in the neighborhood because it's actually part of the neighborhood.


text:
Unit Sizes and Rates
Mechanical Requirements
Electronic Advertising
e-Messenger
GE Revolution Ascend
Enovacom EPC
CAMH deploys e-referral software from Novari
TORONTO – Canada's largest mental health hospital, The Centre for Addiction and Mental Health (CAMH), has gone live with an implementation of Novari Health's electronic referral management, central intake, and workflow management solution. The software as a service (SaaS) technology is being provided as an electronic means to ensure that all inbound referrals to CAMH are received, triaged, processed, and electronically routed to the appropriate CAMH clinical resources.
Novari's extensive experience in working and integrating with Cerner technology is being leveraged throughout this project. The Novari technology provides front line staff and management with accurate and real-time data on the volume of requisitions, the status of every patient's referral, and bottlenecks in the system.
The Ontario Ministry of Health, Ontario Health, and hospitals across the province have been working to mitigate the impact of the COVID-19 pandemic on patients. Having a modern electronic referral management and workflow system complements these efforts for all patients including those waiting for mental health and addictions services.
Novari Health's innovative and unique access to care technologies are live and being implemented at dozens of hospitals and regional health authorities across Canada.
"The importance of CAMH, its mission, and the impact it has on so many individuals and families cannot easily be overstated. The Novari team is proud to provide referral intake and management technologies that are helping the administrative and clinical teams at CAMH provide timely care," said John Sinclair (pictured), president, Novari Health.
About The Centre for Addiction and Mental Health (CAMH)
CAMH is Canada's largest mental health and addiction teaching hospital and a world leading research centre in this field. CAMH combines clinical care, research, education, policy development and health promotion to help transform the lives of people affected by mental illness and addiction. CAMH is fully affiliated with the University of Toronto and is a Pan American Health Organization/World Health Organization Collaborating Centre. For more information, please visit camh.ca or follow @CAMHnews on Twitter.
About Novari Health
Novari Health designs, builds, and implements award-winning enterprise scale SaaS solutions that improve access to care, coordination of care, and the delivery of healthcare services. Based in Kingston Ontario and with offices in Vancouver, Australia, and New Zealand, Novari has become one of the largest and fastest growing Canadian based digital health solution providers. ISO 27001 certified, Novari Health is a Microsoft Gold Partner, with software solutions hosted on Microsoft Azure Canadian and Australian cloud data centres. For more information, visit novarihealth.com.
SteraMist (Feb)
Eastern Ontario hospitals up-and-running on Epic system
Osler's iHuddle app facilitates team communication, collaboration
DI: How will radiology change five years from now?
Hospitals and imaging centres are grappling with DI backlogs
RACE streamlines patient journey
More from the Print Edition
Free of charge to Canadian hospital managers and executives in nursing homes and home-care organizations. Learn More
Nihi Data [Winter 2023]
Sectra One Cloud
Change Healthcare [2]
Infoway [Feb2023]
CHT print-200×400
Canadian Healthcare Technology
1118 Centre Street, Suite 207
Thornhill, Ontario, Canada L4J 7R9
info2@canhealth.com
Administrative Solutions
© 2023 Canadian Healthcare Technology
The content of Canadian Healthcare Technology is subject to copyright. Reproduction in whole or in part without prior written permission is strictly prohibited. Send all requests for permission to Jerry Zeidenberg, Publisher.


While a student at Laremont School in Gages Lake, Cameron Olson went on a trip in January 2014 to Artist at Heart in Libertyville. Olson graduated from Laremont in October 2017, and his family hopes to find him a day program where he thrives the way he did at Laremont.
Cameron Olson lasted a single day at one day program. He lasted three days at another.
Intellectually disabled, the 23-year-old Round Lake man doesn't have a lot of choices about where he spends his days since he graduated in October 2017 from Laremont School, the Special Education District of Lake County facility for students with severe or multiple disabilities in Gages Lake.
The choices that do exist have long waiting lists and often reject potential clients who have behavioral issues or too many needs, said Liz Pumala, an adapted physical education teacher at Laremont.
That's why Pumala wants to open a new center, called Matthias Academy, a "day program on a community college-like campus" in Bristol, Wis., that would serve adults with disabilities, regardless of severity.
She's created the concept and organized a board of directors. They've drawn up bylaws and a business plan. They've hired an architect and begun looking at properties. They started fundraising in December and held the first parents' informational meeting last month.
Cameron Olson on a walk with his family in Wilmot, Wis. Walks are a common activity for Olson's family, who is always trying to keep him busy.
Just over $146,000 has been raised as of Monday, according to the nonprofit's website. Nearly 70 families have set up fundraising pages, including one for Olson.
Pumala's background at Laremont is a large part of why Olson's mother, Liz, said they got involved in the project.
Liz Olson said after Cameron turned 22 and graduated from Laremont, he became "super depressed." She said they subsequently "dug in deep" to make sure he's engaged during the day, with his siblings taking him to a movie or him accompanying her to the store.
Pumala envisions a system where students under the age of 30 take two classes a day and also work each day. After they turn 30, they'd become "graduate students" with one class a day and work. At 65, they can choose to semi-retire, can take a class if they want to but will have more leisure time.
She added that the work portion is what will help keep the campus running — helping with custodial operations, working in the bakery and running a campus bookstore. The academy would also facilitate employment opportunities in the community.
The businesslike operations will provide some income, which would help supplement fundraising and the tuition families would pay, she said.
Pumala said she knows the operations will be expensive, but the quality of the staffing and programming is really important to her.
The tuition cost will likely range from $18,000 to $28,000 per year, plus an optional summer program at $2,000 to $3,000, depending on the student's staff-to-student ratio, according to the website.
Pumala said she hopes to have Matthias Academy operational by 2020, but that depends on the funding and whether they go with a new building versus rehabbing an existing structure.


text:
Log-in FAQ
Chronicle Archives
UnTacked Archives
Stallion and Breeder Guide
Report A Missing Issue
Meet the Chronicle Staff
UnTacked
Horse Sports
ChronicleTV
2018 World Equestrian Games
Amateur Showcase
Amateurs Like Us
Behind The Stall Door
Groom Spotlight
Junior Spotlight
Pony Paddock
Ringside Chat
Winner Of The Week
Chronicle Forums
Clinic Reports
Hunt Reports
Classified Rates
Coupons/Sales
Tack & Other
Sport Horse Spotlight
Real Estate Spotlight
Sale Spotlight
Mark Todd And Charisma Put New Zealand On The Eventing Map In The 1980s (Views: 3233)
By: Martha Drum
For 21st century fans accustomed to regarding seven-time Olympian Mark Todd as an elder statesman, it might be hard to believe that no New Zealand rider had finished in the top 20 at any Olympic Games before Todd and the small but mighty Charisma won individual gold in 1984. Their repeat performance four years later secured their place in history and brought hard-earned recognition to the island nation's equestrian team.
Current fans marvel at La Biosthetique-Sam FBW's back-to-back individual gold medals with Michael Jung in 2012 and 2016, but it was the odd couple of 6'3" Todd and barely 15.3-hand Charisma who got it done back in the long-format days, in the scorching temperatures of Los Angeles and Seoul, South Korea.
There was little expectation of a historic finish when the duo arrived in Los Angeles for the 1984 Games. A former dairy farmer, Todd had paired up with Charisma (Tira Mink—Planet, Kiritea) just a year earlier when his top horse was sidelined. "Podge," as Charisma was known in the barn, had been an agreeable, athletic jack-of-all-trades: He'd previously competed as a show jumper, evented through the equivalent of intermediate level and shown at Prix St. Georges.
With Todd on board, though, Charisma began a remarkable career that dominated the 1980s eventing scene. Mostly Thoroughbred with 1/32nd Percheron blood, he and Todd won their first horse trials together and went on to secure the one-day and three-day New Zealand national championships in 1983, both on their dressage score. That season earned them a trip to Great Britain to train with the Kiwi team.
By the time Charisma and Todd placed second at the Badminton Horse Trials (England) in the spring of 1984, they were attracting attention for their consistent finishes. They displayed that form again in Los Angeles, standing fourth after dressage and going clear in both jumping phases.
Mark Todd's long legs stretched below Charisma's barrel, but the pair was a perfect match on course in Los Angeles. John Strassburger Photos
"Podge pulled like anything," wrote Todd in his autobiography "Second Chance." "He would tuck his head in like a bull and charge, and there was little one could do except pray he wouldn't make a mistake. Unsurprisingly, he had the fastest cross-country round of the day and, despite the boiling temperatures, finished easily inside the time."
The top of the podium wasn't guaranteed, though, until the final moments of show jumping. Unfortunately for the American home team, leaders Ben Arthur and Karen Stives dropped a rail at the next-to-last fence to give Charisma and Todd the individual gold and New Zealand's first equestrian medal.
"I thought there was no way [Ben Arthur and Stives] would have a fence down," wrote Todd in his autobiography. "While she was in the ring someone gave me a cigarette, so I was puffing away, standing on my own, unable to watch. Karen's round seemed to be going on forever, so I walked up the chute to have a look and, as I did so, she came into that last combination and had part of it down. I just put my hands to my face and gasped. It was very hard to take in, the fact that I'd won an Olympic gold medal, and even now, sometimes I have to remind myself that it actually happened."
Click to watch highlights from Mark Todd's gold-medal-winning ride on Charisma in the 1984 Los Angeles Olympics.
After this triumph in Los Angeles, owner Fran Clark tried to sell the horse. British rider Lizzie Purbrick knew Todd wanted to keep the ride, so she helped broker a secret deal where Todd's sponsor Woolrest transferred money into her account, and she then sent the money to Clark so Todd could continue his partnership with Podge.
The acquisition paid off as the pair finished second again at Badminton in 1985 and won at Luhmuhlen (Germany) the following year. Another shot at the Olympic team came into focus after Charisma placed second at the Burghley Horse Trials (England) and won the British open championship in 1987.
Despite these impressive performances, some doubters still wondered whether Charisma, at 16, would be able to medal again in South Korea. No horse had earned back-to-back individual gold medals in eventing since the Netherlands' Marcroix with Lt. Charles F. Pahud de Mortanges in 1928 and 1932. Commentators questioned the suitability of a small gelding to carry the very tall Todd, who reportedly joked he had to shorten his stirrups to be sure his own feet wouldn't hit the jumps.
Todd arrived in Seoul determined to prove that his previous win hadn't been beginner's luck. Despite the sweltering heat, he guided Charisma to a first-placed dressage test, one of just four scored below 50%.
Endurance day, however, promised to be challenging. The formidable course wound over sandy, tiring footing in the Demilitarized Zone near the North Korean border. The ground jury ordered some fences lowered and removed a bounce element near the finish, but many combinations were overfaced. U.S. riders had a total of five falls, and even with remounting to continue allowed at the time, they failed to finish a team.
Charisma and Todd made the course look easy. They not only finished without jumping penalties (the only other clear trip being fellow Kiwis Tinks Pottinger and Volunteer), but also came home 19 seconds under the time.
Charisma's smooth galloping and efficient jumping helped him finish 19 seconds under the time over a tough, hilly Olympic course in 1988 in South Korea.
That performance carried them into the final day with three rails in hand ahead of Great Britain's Ian Stark and Sir Wattie. Known for rubbing poles, Charisma pulled one early rail, but as he headed for the final in-and-out with no additional faults, the crowd cheered his imminent repeat victory.
"Groom Helen Gifford, who's been with Charisma since he left New Zealand for England in 1984, held him lovingly as tears streamed down her face," wrote John Strassburger in his Chronicle coverage from Oct. 14, 1988. "A crowd gathered to admire and photograph the 16-year-old superstar, and at intervals someone would come along to pat Charisma or hug Gifford.
"The remarkable thing was that no one was talking, and no one was leaving," Strassburger continued. "Everyone was taking a last long look at Charisma. It was a happy moment because of his enthusiastic victory, but it was also a sad moment because it was his last."
An outstanding dressage test and a double clear cross-country round gave Charisma and Mark Todd all the breathing room they needed to win their second individual Olympic gold medal in 1988 in Seoul, South Korea.
"I came here knowing the horse was in very good form," Todd told the Chronicle at the time. "But he hadn't done a three-day event in nearly a year, and at his age, I wasn't sure how well he would cope. But he just rose to the occasion and was fantastic right throughout. He's a wonderful little horse, and he deserved it."
The win also helped New Zealand take bronze, its first Olympic equestrian team medal. Todd became an international celebrity and even received a congratulatory letter from the widow of the Dutch rider who had won back-to-back gold medals more than 50 years earlier.
With nothing left to prove, Charisma was retired from competition, but he toured New Zealand for months as a national hero. In 2003, he was euthanized following a pasture accident at age 30.
After winning a second individual Olympic gold medal, Mark Todd retired Charisma.
Todd returned to the podium in Barcelona (Spain) in 1992 as part of New Zealand's silver medal-winning eventing team. At the 1988 and 1992 Olympic Games, he also competed as a member of the show jumping squad. He won an individual bronze in eventing in 2000 and a team bronze in 2012.
After retiring from eventing for eight years to pursue training race horses, Todd returned to the saddle in 2008 before announcing his final retirement last year. By that time, he had already been named the FEI's Horseman of the Century, an honor Charisma, more than any other mount, helped him achieve.
The 2020 Olympic Games were supposed to begin on July 24 in Tokyo, but they've been postponed a full year due to the novel coronavirus pandemic. The Chronicle is highlighting memorable Olympic equestrian moments this week.
Category: Eventing
Tags: 1984 Olympic Games, 1988 Olympic Games, Charisma, Mark Todd, Olympic Games, Sir Mark Todd
latest Eventing
Lindsay Berreth
Blogger Megan Kepferle
Ellms-Millet Found Her Best Friend In A...
USEA Announces Grant And Special Award...
USET Foundation Awards Will Faudree...
Edited Press Release
Jan 8, 2021 - 9:59 AM
A Day In The Life With: Sara Kozumplik...
Sara Kozumplik Murphy
Jan 5, 2021 - 11:26 AM
Behind The Stall Door With: Pfun
Tori Repole
Jan 4, 2021 - 3:00 PM
Groom Spotlight: Sarah Charnley Filled...
Christina Keim
Boyd Martin's Olympic Mount...
A Day In The Life With: Shannon Brinkman
Shannon Brinkman
Dec 22, 2020 - 7:58 AM
Optimism Runs High At USEA Annual...
USEF Announces Athletes Invited To 2021...
Safety Concerns Drive Rails-Down Limit...
Halliday-Sharp Becomes First Female To...
Dec 9, 2020 - 2:28 PM
Back From The Brink: Dubai Storm...
Kimberly Loushin
Dec 8, 2020 - 12:57 PM
Behind The Stall Door With: Leamore...
Dec 8, 2020 - 8:02 AM
That Time An Olympic Eventer Pulled Into WEC And Won The $20,000 Hunter Derby
Mollie Bailey / Jan 13, 2021 - 7:58 AM
Tracy C. Gold / Jan 19, 2021 - 3:00 PM
Ann Glavan / Jan 15, 2021 - 7:58 AM
Lindsay Berreth / Jan 13, 2021 - 2:59 PM
Edited Press Release / Jan 18, 2021 - 3:01 PM
From Untacked: A Closer Look At GallopNYC
Copyright © 2021 All rights reserved · The Chronicle of the Horse . Middleburg
The Chronicle of the Horse Login
You may also use your Chronicle of the Horse Forum Login.


text:
Home/Fellfoot Forward/Fellfoot Forward Community Arts Programme
Fellfoot Forward Community Arts Programme
Fundamental to the living and working landscape of the Fellfoot Forward scheme area, are the many stories of its people and places. These stories give us a strong sense of place and community and reflect the rich history and culture of this landscape, its past residents, current communities, hidden places and unearthed artefacts. A community arts programme, delivered over the life of the scheme, will draw together Fellfoot people across village and parish boundaries inspired by the rich natural and cultural heritage of the landscape.
Following the consultation for our community arts programme, led by Simon Whalley and associates, we are excited to outline our plans for art and creative activities for people to be involved with, in the scheme area.
More than 50 people responded to the online survey and from this ten, one to one, conversations were held around the main survey questions, including individuals' vision for community arts in the scheme area and personal and local knowledge to help form the strategy. Thank you to everyone who contributed.
Our strategy has come from consultation in the development period, the results of the survey, and conversations through this first year of delivery. You can read the strategy document included on this page. We welcome feedback – you can email Fiona Knox or Samantha Tranter with your comments.
Fellfoot Fables was the first community arts project to be delivered in 2020. A virtual creative writing series recording young people's connection to the landscape during the COVID-19 pandemic lockdown and restrictions, through poetry and prose. The year one workshops and performances will act as a consultation for a community arts programme spanning years two to three. The nature of that programme will be determined by the audiences we target, attract and work with allowing for everything from theatre and song to puppetry and more.
Six, artist-led, community arts pilot projects have been commissioned for 2021, working with local community audiences, including families, farmers, young people, the women's institute, walking groups, local historians, and people from across wide age groups, to deliver their activity.
An artist coordinator has also been appointed for the duration of the Fellfoot Forward LPS to co-ordinate the arts projects taking place, make connections with local and regional artists and arts centres, and to encourage the Fellfoot Forward community to be an audience for their local and regional arts and crafts.
The North Pennines AONB Partnership has previously worked with a number of artists to create landscape inspired artworks, including: 'Hush', a temporary art installation by environmental artist Steve Messam, situated within the former lead mining site of Bales Hush in Upper Teesdale. Inspired by geology, mining and landscape in the North Pennines AONB and UNESCO Global Geopark, it was designed to have minimal impact on the site and wildlife.
'Natural Creation', created by artist Rob Mullholland was inspired by the landscape surrounding Low Force, Teesdale. The temporary sculptural installation, made up of a series of highly polished stainless steel geometrical sculptures, aimed to bring to life a 320 million year old geological story.
Photo credits: Hush by Steve Messam in Upper Teesdale © Steve Messam 2019 & North Pennines AONB Partnership / Natural Creation at Low Force, Teesdale by Rob Mulholland © Lee Dobson & North Pennines AONB Partnership
Fellfoot Fables
Community Arts Projects
Links to wildlife resources
Links to resources about wildlife in the North Pennines and beyond
Community arts project start in the Fellfoot Forward area
Pennine PeatLIFE
Peatland restoration project with Yorkshire Wildlife Trust & Forest of Bowland AONB
Whitesike and Bentyfield mines
Two mine sites located between the South Tyne and Nent valleys


text:
Q: What metrics can be used to evaluate each cluster in clustering I am clustering a dataset, where the binary ground truth (positive/negative samples) is known.
I am looking for specific clusters that show high homogeneity/purity. I know that there are many metrics that can be used to evaluate the complete clustering (homogeneity_score, completeness_score ...).
But what metrics could be used or calculated to evaluate each cluster?
For example in this case:
cluster   0   1    2   3   4   5  6
target
0         4   0  128   0   0  68  0
1        62  23   74  10  12  18  1

It is clear, that clusters 1,3, and 4 a homogenous. And cluster 1 would be the one that has the highest significance for me since it contains the most unique labels.
What metrics could be used to compute this property?
I have the feeling a basic statistic test such as the chi-square test of homogeneity or Fischer exact test could be used here, but I need scores for each cluster and I am not sure how to apply the correct test.


text:
La frontera entre Austria y la República Checa es la frontera internacional que se extiende de oeste a este y separa el noroeste de Austria (länder de Alta Austria y Baja Austria) del sudeste de la República Checa (regiones de Bohemia Meridional, Moravia Meridional y Vysočina), ambos miembros de la Unión Europea, y signatarios de los acuerdos de Schengen. Se extiende desde el trifinio Austria-República Checa-Alemania (Baviera), pasando por el río Eno, entre los pueblos de Neureichenau (Alemania), Nová Pec (República Checa) y Schwarzenberg am Böhmerwald (Austria); hacia el este, al trifinio de los dos estados con Eslovaquia, pasando por el río Morava entre los pueblos de Hohenau an der March (Austria) y Borský Svatý Jur (Eslovaquia).

Historia

La historia de esta frontera empieza al final de la Primera Guerra Mundial en 1918, cuando se independizó la república de Checoslovaquia (que unía entonces la República Checa y Eslovaquia), ambas antiguas posesiones del Imperio austrohúngaro. La mayor parte de la frontera coincidía con los límites del antiguo reino de Bohemia y Moravia, y en tres lugares se realizaron pequeños ajustamientos a favor de Checoslovaquia, motivados principalmente por argumentos económicos (Valticko, Vitorazsko, Dyjský trojúhelník). Sin embargo, la frontera étnica real iba más al norte, puesto que al sur de Bohemia y Moravia vivía una gran comunidad alemana (Sudetenland), que contra su voluntad fueron incluidos en Checoslovaquia. Entre 1938 y 1939 tanto Austria como la República Checa fueron anexionadas al Tercer Reich, mientras que Eslovaquia se trasformó en un estado satélite independiente.

Después de la Segunda Guerra Mundial se restableció la antigua frontera entre Austria y la República Socialista de Checoslovaquia, entonces miembro del Pacto de Varsovia y aliada de la Unión Soviética. Después de la revolución de Terciopelo de 1990 y la separación de las repúblicas checa y eslovaca el 1993, la frontera actual solo lo es de la República Checa.

Véase también
 Fronteras de Austria
 Fronteras de la República Checa

Referencias

Frontera Austria-República Checa