text:
using Lucene.Net.Attributes;
using Lucene.Net.Documents;
using Lucene.Net.Randomized.Generators;
using Lucene.Net.Support;
using Lucene.Net.Support.Threading;
using Lucene.Net.Util;
using NUnit.Framework;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using Console = Lucene.Net.Support.SystemConsole;

namespace Lucene.Net.Index
{

    using BytesRef = Lucene.Net.Util.BytesRef;
    using Codec = Lucene.Net.Codecs.Codec;
    using Directory = Lucene.Net.Store.Directory;
    using DocIdSetIterator = Lucene.Net.Search.DocIdSetIterator;
    using Document = Documents.Document;
    using FakeIOException = Lucene.Net.Store.MockDirectoryWrapper.FakeIOException;
    using Field = Field;
    using IndexSearcher = Lucene.Net.Search.IndexSearcher;
    using InfoStream = Lucene.Net.Util.InfoStream;
    using LuceneTestCase = Lucene.Net.Util.LuceneTestCase;

    using MockAnalyzer = Lucene.Net.Analysis.MockAnalyzer;
    using MockDirectoryWrapper = Lucene.Net.Store.MockDirectoryWrapper;
    using Query = Lucene.Net.Search.Query;
    using RAMDirectory = Lucene.Net.Store.RAMDirectory;
    using TermQuery = Lucene.Net.Search.TermQuery;
    using TestUtil = Lucene.Net.Util.TestUtil;
    using TextField = TextField;
    using TopDocs = Lucene.Net.Search.TopDocs;

    [TestFixture]
    public class TestIndexWriterReader : LuceneTestCase
    {
        private readonly int NumThreads = TEST_NIGHTLY ? 5 : 3;

        public static int Count(Term t, IndexReader r)
        {
            int count = 0;
            DocsEnum td = TestUtil.Docs(Random(), r, t.Field, new BytesRef(t.Text()), MultiFields.GetLiveDocs(r), null, 0);

            if (td != null)
            {
                while (td.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)
                {
                    var _ = td.DocID;
                    count++;
                }
            }
            return count;
        }

        [Test]
        public virtual void TestAddCloseOpen()
        {
            // Can't use assertNoDeletes: this test pulls a non-NRT
            // reader in the end:
            Directory dir1 = NewDirectory();
            IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));

            IndexWriter writer = new IndexWriter(dir1, iwc);
            for (int i = 0; i < 97; i++)
            {
                DirectoryReader reader = writer.GetReader();
                if (i == 0)
                {
                    writer.AddDocument(DocHelper.CreateDocument(i, "x", 1 + Random().Next(5)));
                }
                else
                {
                    int previous = Random().Next(i);
                    // a check if the reader is current here could fail since there might be
                    // merges going on.
                    switch (Random().Next(5))
                    {
                        case 0:
                        case 1:
                        case 2:
                            writer.AddDocument(DocHelper.CreateDocument(i, "x", 1 + Random().Next(5)));
                            break;

                        case 3:
                            writer.UpdateDocument(new Term("id", "" + previous), DocHelper.CreateDocument(previous, "x", 1 + Random().Next(5)));
                            break;

                        case 4:
                            writer.DeleteDocuments(new Term("id", "" + previous));
                            break;
                    }
                }
                Assert.IsFalse(reader.IsCurrent());
                reader.Dispose();
            }
            writer.ForceMerge(1); // make sure all merging is done etc.
            DirectoryReader dirReader = writer.GetReader();
            writer.Commit(); // no changes that are not visible to the reader
            Assert.IsTrue(dirReader.IsCurrent());
            writer.Dispose();
            Assert.IsTrue(dirReader.IsCurrent()); // all changes are visible to the reader
            iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            writer = new IndexWriter(dir1, iwc);
            Assert.IsTrue(dirReader.IsCurrent());
            writer.AddDocument(DocHelper.CreateDocument(1, "x", 1 + Random().Next(5)));
            Assert.IsTrue(dirReader.IsCurrent()); // segments in ram but IW is different to the readers one
            writer.Dispose();
            Assert.IsFalse(dirReader.IsCurrent()); // segments written
            dirReader.Dispose();
            dir1.Dispose();
        }

        [Test]
        public virtual void TestUpdateDocument()
        {
            bool doFullMerge = true;

            Directory dir1 = NewDirectory();
            IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            if (iwc.MaxBufferedDocs < 20)
            {
                iwc.SetMaxBufferedDocs(20);
            }
            // no merging
            if (Random().NextBoolean())
            {
                iwc.SetMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
            }
            else
            {
                iwc.SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
            }
            if (VERBOSE)
            {
                Console.WriteLine("TEST: make index");
            }
            IndexWriter writer = new IndexWriter(dir1, iwc);

            // create the index
            CreateIndexNoClose(!doFullMerge, "index1", writer);

            // writer.Flush(false, true, true);

            // get a reader
            DirectoryReader r1 = writer.GetReader();
            Assert.IsTrue(r1.IsCurrent());

            string id10 = r1.Document(10).GetField("id").GetStringValue();

            Document newDoc = r1.Document(10);
            newDoc.RemoveField("id");
            newDoc.Add(NewStringField("id", Convert.ToString(8000), Field.Store.YES));
            writer.UpdateDocument(new Term("id", id10), newDoc);
            Assert.IsFalse(r1.IsCurrent());

            DirectoryReader r2 = writer.GetReader();
            Assert.IsTrue(r2.IsCurrent());
            Assert.AreEqual(0, Count(new Term("id", id10), r2));
            if (VERBOSE)
            {
                Console.WriteLine("TEST: verify id");
            }
            Assert.AreEqual(1, Count(new Term("id", Convert.ToString(8000)), r2));

            r1.Dispose();
            Assert.IsTrue(r2.IsCurrent());
            writer.Dispose();
            Assert.IsTrue(r2.IsCurrent());

            DirectoryReader r3 = DirectoryReader.Open(dir1);
            Assert.IsTrue(r3.IsCurrent());
            Assert.IsTrue(r2.IsCurrent());
            Assert.AreEqual(0, Count(new Term("id", id10), r3));
            Assert.AreEqual(1, Count(new Term("id", Convert.ToString(8000)), r3));

            writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            Document doc = new Document();
            doc.Add(NewTextField("field", "a b c", Field.Store.NO));
            writer.AddDocument(doc);
            Assert.IsTrue(r2.IsCurrent());
            Assert.IsTrue(r3.IsCurrent());

            writer.Dispose();

            Assert.IsFalse(r2.IsCurrent());
            Assert.IsTrue(!r3.IsCurrent());

            r2.Dispose();
            r3.Dispose();

            dir1.Dispose();
        }

        [Test]
        public virtual void TestIsCurrent()
        {
            Directory dir = NewDirectory();
            IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));

            IndexWriter writer = new IndexWriter(dir, iwc);
            Document doc = new Document();
            doc.Add(NewTextField("field", "a b c", Field.Store.NO));
            writer.AddDocument(doc);
            writer.Dispose();

            iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            writer = new IndexWriter(dir, iwc);
            doc = new Document();
            doc.Add(NewTextField("field", "a b c", Field.Store.NO));
            DirectoryReader nrtReader = writer.GetReader();
            Assert.IsTrue(nrtReader.IsCurrent());
            writer.AddDocument(doc);
            Assert.IsFalse(nrtReader.IsCurrent()); // should see the changes
            writer.ForceMerge(1); // make sure we don't have a merge going on
            Assert.IsFalse(nrtReader.IsCurrent());
            nrtReader.Dispose();

            DirectoryReader dirReader = DirectoryReader.Open(dir);
            nrtReader = writer.GetReader();

            Assert.IsTrue(dirReader.IsCurrent());
            Assert.IsTrue(nrtReader.IsCurrent()); // nothing was committed yet so we are still current
            Assert.AreEqual(2, nrtReader.MaxDoc); // sees the actual document added
            Assert.AreEqual(1, dirReader.MaxDoc);
            writer.Dispose(); // close is actually a commit both should see the changes
            Assert.IsTrue(nrtReader.IsCurrent());
            Assert.IsFalse(dirReader.IsCurrent()); // this reader has been opened before the writer was closed / committed

            dirReader.Dispose();
            nrtReader.Dispose();
            dir.Dispose();
        }

        /// <summary>
        /// Test using IW.addIndexes
        /// </summary>
        [Test]
        public virtual void TestAddIndexes()
        {
            bool doFullMerge = false;

            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            if (iwc.MaxBufferedDocs < 20)
            {
                iwc.SetMaxBufferedDocs(20);
            }
            // no merging
            if (Random().NextBoolean())
            {
                iwc.SetMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
            }
            else
            {
                iwc.SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
            }
            IndexWriter writer = new IndexWriter(dir1, iwc);

            // create the index
            CreateIndexNoClose(!doFullMerge, "index1", writer);
            writer.Flush(false, true);

            // create a 2nd index
            Directory dir2 = NewDirectory();
            IndexWriter writer2 = new IndexWriter(dir2, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            CreateIndexNoClose(!doFullMerge, "index2", writer2);
            writer2.Dispose();

            DirectoryReader r0 = writer.GetReader();
            Assert.IsTrue(r0.IsCurrent());
            writer.AddIndexes(dir2);
            Assert.IsFalse(r0.IsCurrent());
            r0.Dispose();

            DirectoryReader r1 = writer.GetReader();
            Assert.IsTrue(r1.IsCurrent());

            writer.Commit();
            Assert.IsTrue(r1.IsCurrent()); // we have seen all changes - no change after opening the NRT reader

            Assert.AreEqual(200, r1.MaxDoc);

            int index2df = r1.DocFreq(new Term("indexname", "index2"));

            Assert.AreEqual(100, index2df);

            // verify the docs are from different indexes
            Document doc5 = r1.Document(5);
            Assert.AreEqual("index1", doc5.Get("indexname"));
            Document doc150 = r1.Document(150);
            Assert.AreEqual("index2", doc150.Get("indexname"));
            r1.Dispose();
            writer.Dispose();
            dir1.Dispose();
            dir2.Dispose();
        }

        [Test]
        public virtual void ExposeCompTermVR()
        {
            bool doFullMerge = false;
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriterConfig iwc = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            if (iwc.MaxBufferedDocs < 20)
            {
                iwc.SetMaxBufferedDocs(20);
            }
            // no merging
            if (Random().NextBoolean())
            {
                iwc.SetMergePolicy(NoMergePolicy.NO_COMPOUND_FILES);
            }
            else
            {
                iwc.SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
            }
            IndexWriter writer = new IndexWriter(dir1, iwc);
            CreateIndexNoClose(!doFullMerge, "index1", writer);
            writer.Dispose();
            dir1.Dispose();
        }

        [Test]
        public virtual void TestAddIndexes2()
        {
            bool doFullMerge = false;

            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));

            // create a 2nd index
            Directory dir2 = NewDirectory();
            IndexWriter writer2 = new IndexWriter(dir2, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            CreateIndexNoClose(!doFullMerge, "index2", writer2);
            writer2.Dispose();

            writer.AddIndexes(dir2);
            writer.AddIndexes(dir2);
            writer.AddIndexes(dir2);
            writer.AddIndexes(dir2);
            writer.AddIndexes(dir2);

            IndexReader r1 = writer.GetReader();
            Assert.AreEqual(500, r1.MaxDoc);

            r1.Dispose();
            writer.Dispose();
            dir1.Dispose();
            dir2.Dispose();
        }

        /// <summary>
        /// Deletes using IW.deleteDocuments
        /// </summary>
        [Test]
        public virtual void TestDeleteFromIndexWriter()
        {
            bool doFullMerge = true;

            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter writer = new IndexWriter(dir1, (IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetReaderTermsIndexDivisor(2));
            // create the index
            CreateIndexNoClose(!doFullMerge, "index1", writer);
            writer.Flush(false, true);
            // get a reader
            IndexReader r1 = writer.GetReader();

            string id10 = r1.Document(10).GetField("id").GetStringValue();

            // deleted IW docs should not show up in the next getReader
            writer.DeleteDocuments(new Term("id", id10));
            IndexReader r2 = writer.GetReader();
            Assert.AreEqual(1, Count(new Term("id", id10), r1));
            Assert.AreEqual(0, Count(new Term("id", id10), r2));

            string id50 = r1.Document(50).GetField("id").GetStringValue();
            Assert.AreEqual(1, Count(new Term("id", id50), r1));

            writer.DeleteDocuments(new Term("id", id50));

            IndexReader r3 = writer.GetReader();
            Assert.AreEqual(0, Count(new Term("id", id10), r3));
            Assert.AreEqual(0, Count(new Term("id", id50), r3));

            string id75 = r1.Document(75).GetField("id").GetStringValue();
            writer.DeleteDocuments(new TermQuery(new Term("id", id75)));
            IndexReader r4 = writer.GetReader();
            Assert.AreEqual(1, Count(new Term("id", id75), r3));
            Assert.AreEqual(0, Count(new Term("id", id75), r4));

            r1.Dispose();
            r2.Dispose();
            r3.Dispose();
            r4.Dispose();
            writer.Dispose();

            // reopen the writer to verify the delete made it to the directory
            writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            IndexReader w2r1 = writer.GetReader();
            Assert.AreEqual(0, Count(new Term("id", id10), w2r1));
            w2r1.Dispose();
            writer.Dispose();
            dir1.Dispose();
        }

        [Test, LongRunningTest]
        public virtual void TestAddIndexesAndDoDeletesThreads()
        {
            const int numIter = 2;
            int numDirs = 3;

            Directory mainDir = GetAssertNoDeletesDirectory(NewDirectory());

            IndexWriter mainWriter = new IndexWriter(mainDir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy()));
            TestUtil.ReduceOpenFiles(mainWriter);

            AddDirectoriesThreads addDirThreads = new AddDirectoriesThreads(this, numIter, mainWriter);
            addDirThreads.LaunchThreads(numDirs);
            addDirThreads.JoinThreads();

            //Assert.AreEqual(100 + numDirs * (3 * numIter / 4) * addDirThreads.numThreads
            //    * addDirThreads.NUM_INIT_DOCS, addDirThreads.mainWriter.NumDocs);
            Assert.AreEqual(addDirThreads.Count.Get(), addDirThreads.MainWriter.NumDocs);

            addDirThreads.Close(true);

            Assert.IsTrue(addDirThreads.Failures.Count == 0);

            TestUtil.CheckIndex(mainDir);

            IndexReader reader = DirectoryReader.Open(mainDir);
            Assert.AreEqual(addDirThreads.Count.Get(), reader.NumDocs);
            //Assert.AreEqual(100 + numDirs * (3 * numIter / 4) * addDirThreads.numThreads
            //    * addDirThreads.NUM_INIT_DOCS, reader.NumDocs);
            reader.Dispose();

            addDirThreads.CloseDir();
            mainDir.Dispose();
        }

        private class AddDirectoriesThreads
        {
            internal virtual void InitializeInstanceFields()
            {
                Threads = new ThreadClass[OuterInstance.NumThreads];
            }

            private readonly TestIndexWriterReader OuterInstance;

            internal Directory AddDir;
            internal const int NUM_INIT_DOCS = 100;
            internal int NumDirs;
            internal ThreadClass[] Threads;
            internal IndexWriter MainWriter;
            internal readonly IList<Exception> Failures = new List<Exception>();
            internal IndexReader[] Readers;
            internal bool DidClose = false;
            internal AtomicInt32 Count = new AtomicInt32(0);
            internal AtomicInt32 NumaddIndexes = new AtomicInt32(0);

            public AddDirectoriesThreads(TestIndexWriterReader outerInstance, int numDirs, IndexWriter mainWriter)
            {
                this.OuterInstance = outerInstance;

                InitializeInstanceFields();
                this.NumDirs = numDirs;
                this.MainWriter = mainWriter;
                AddDir = NewDirectory();
                IndexWriter writer = new IndexWriter(AddDir, OuterInstance.NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMaxBufferedDocs(2));
                TestUtil.ReduceOpenFiles(writer);
                for (int i = 0; i < NUM_INIT_DOCS; i++)
                {
                    Document doc = DocHelper.CreateDocument(i, "addindex", 4);
                    writer.AddDocument(doc);
                }

                writer.Dispose();

                Readers = new IndexReader[numDirs];
                for (int i = 0; i < numDirs; i++)
                {
                    Readers[i] = DirectoryReader.Open(AddDir);
                }
            }

            internal virtual void JoinThreads()
            {
                for (int i = 0; i < OuterInstance.NumThreads; i++)
                {
//#if !NETSTANDARD1_6
//                    try
//                    {
//#endif
                    Threads[i].Join();
//#if !NETSTANDARD1_6
//                    }
//                    catch (ThreadInterruptedException ie) // LUCENENET NOTE: Senseless to catch and rethrow the same exception type
//                    {
//                        throw new ThreadInterruptedException("Thread Interrupted Exception", ie);
//                    }
//#endif
                }
            }

            internal virtual void Close(bool doWait)
            {
                DidClose = true;
                if (doWait)
                {
                    MainWriter.WaitForMerges();
                }
                MainWriter.Dispose(doWait);
            }

            internal virtual void CloseDir()
            {
                for (int i = 0; i < NumDirs; i++)
                {
                    Readers[i].Dispose();
                }
                AddDir.Dispose();
            }

            internal virtual void Handle(Exception t)
            {
                Console.WriteLine(t.StackTrace);
                lock (Failures)
                {
                    Failures.Add(t);
                }
            }

            internal virtual void LaunchThreads(int numIter)
            {
                for (int i = 0; i < OuterInstance.NumThreads; i++)
                {
                    Threads[i] = new ThreadAnonymousInnerClassHelper(this, numIter);
                }
                for (int i = 0; i < OuterInstance.NumThreads; i++)
                {
                    Threads[i].Start();
                }
            }

            private class ThreadAnonymousInnerClassHelper : ThreadClass
            {
                private readonly AddDirectoriesThreads OuterInstance;

                private int NumIter;

                public ThreadAnonymousInnerClassHelper(AddDirectoriesThreads outerInstance, int numIter)
                {
                    this.OuterInstance = outerInstance;
                    this.NumIter = numIter;
                }

                public override void Run()
                {
                    try
                    {
                        Directory[] dirs = new Directory[OuterInstance.NumDirs];
                        for (int k = 0; k < OuterInstance.NumDirs; k++)
                        {
                            dirs[k] = new MockDirectoryWrapper(Random(), new RAMDirectory(OuterInstance.AddDir, NewIOContext(Random())));
                        }
                        //int j = 0;
                        //while (true) {
                        // System.out.println(Thread.currentThread().getName() + ": iter
                        // j=" + j);
                        for (int x = 0; x < NumIter; x++)
                        {
                            // only do addIndexes
                            OuterInstance.DoBody(x, dirs);
                        }
                        //if (numIter > 0 && j == numIter)
                        //  break;
                        //doBody(j++, dirs);
                        //doBody(5, dirs);
                        //}
                    }
                    catch (Exception t)
                    {
                        OuterInstance.Handle(t);
                    }
                }
            }

            internal virtual void DoBody(int j, Directory[] dirs)
            {
                switch (j % 4)
                {
                    case 0:
                        MainWriter.AddIndexes(dirs);
                        MainWriter.ForceMerge(1);
                        break;

                    case 1:
                        MainWriter.AddIndexes(dirs);
                        NumaddIndexes.IncrementAndGet();
                        break;

                    case 2:
                        MainWriter.AddIndexes(Readers);
                        break;

                    case 3:
                        MainWriter.Commit();
                        break;
                }
                Count.AddAndGet(dirs.Length * NUM_INIT_DOCS);
            }
        }

        [Test]
        public virtual void TestIndexWriterReopenSegmentFullMerge()
        {
            DoTestIndexWriterReopenSegment(true);
        }

        [Test]
        public virtual void TestIndexWriterReopenSegment()
        {
            DoTestIndexWriterReopenSegment(false);
        }

        /// <summary>
        /// Tests creating a segment, then check to insure the segment can be seen via
        /// IW.getReader
        /// </summary>
        public virtual void DoTestIndexWriterReopenSegment(bool doFullMerge)
        {
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            IndexReader r1 = writer.GetReader();
            Assert.AreEqual(0, r1.MaxDoc);
            CreateIndexNoClose(false, "index1", writer);
            writer.Flush(!doFullMerge, true);

            IndexReader iwr1 = writer.GetReader();
            Assert.AreEqual(100, iwr1.MaxDoc);

            IndexReader r2 = writer.GetReader();
            Assert.AreEqual(r2.MaxDoc, 100);
            // add 100 documents
            for (int x = 10000; x < 10000 + 100; x++)
            {
                Document d = DocHelper.CreateDocument(x, "index1", 5);
                writer.AddDocument(d);
            }
            writer.Flush(false, true);
            // verify the reader was reopened internally
            IndexReader iwr2 = writer.GetReader();
            Assert.IsTrue(iwr2 != r1);
            Assert.AreEqual(200, iwr2.MaxDoc);
            // should have flushed out a segment
            IndexReader r3 = writer.GetReader();
            Assert.IsTrue(r2 != r3);
            Assert.AreEqual(200, r3.MaxDoc);

            // dec ref the readers rather than close them because
            // closing flushes changes to the writer
            r1.Dispose();
            iwr1.Dispose();
            r2.Dispose();
            r3.Dispose();
            iwr2.Dispose();
            writer.Dispose();

            // test whether the changes made it to the directory
            writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            IndexReader w2r1 = writer.GetReader();
            // insure the deletes were actually flushed to the directory
            Assert.AreEqual(200, w2r1.MaxDoc);
            w2r1.Dispose();
            writer.Dispose();

            dir1.Dispose();
        }

        /*
         * Delete a document by term and return the doc id
         *
         * public static int deleteDocument(Term term, IndexWriter writer) throws
         * IOException { IndexReader reader = writer.GetReader(); TermDocs td =
         * reader.termDocs(term); int doc = -1; //if (td.Next()) { // doc = td.Doc();
         * //} //writer.DeleteDocuments(term); td.Dispose(); return doc; }
         */

        public void CreateIndex(Random random, Directory dir1, string indexName, bool multiSegment)
        {
            IndexWriter w = new IndexWriter(dir1, NewIndexWriterConfig(random, TEST_VERSION_CURRENT, new MockAnalyzer(random)).SetMergePolicy(new LogDocMergePolicy()));
            for (int i = 0; i < 100; i++)
            {
                w.AddDocument(DocHelper.CreateDocument(i, indexName, 4));
            }
            if (!multiSegment)
            {
                w.ForceMerge(1);
            }
            w.Dispose();
        }

        public static void CreateIndexNoClose(bool multiSegment, string indexName, IndexWriter w)
        {
            for (int i = 0; i < 100; i++)
            {
                w.AddDocument(DocHelper.CreateDocument(i, indexName, 4));
            }
            if (!multiSegment)
            {
                w.ForceMerge(1);
            }
        }

        private class MyWarmer : IndexWriter.IndexReaderWarmer
        {
            internal int WarmCount;

            public override void Warm(AtomicReader reader)
            {
                WarmCount++;
            }
        }

        [Test, LongRunningTest]
        public virtual void TestMergeWarmer([ValueSource(typeof(ConcurrentMergeSchedulerFactories), "Values")]Func<IConcurrentMergeScheduler> newScheduler)
        {
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            // Enroll warmer
            MyWarmer warmer = new MyWarmer();
            var config = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))
                            .SetMaxBufferedDocs(2)
                            .SetMergedSegmentWarmer(warmer)
                            .SetMergeScheduler(newScheduler())
                            .SetMergePolicy(NewLogMergePolicy());
            IndexWriter writer = new IndexWriter(dir1, config);

            // create the index
            CreateIndexNoClose(false, "test", writer);

            // get a reader to put writer into near real-time mode
            IndexReader r1 = writer.GetReader();

            ((LogMergePolicy)writer.Config.MergePolicy).MergeFactor = 2;

            //int num = AtLeast(100);
            int num = 101;
            for (int i = 0; i < num; i++)
            {
                writer.AddDocument(DocHelper.CreateDocument(i, "test", 4));
            }
            ((IConcurrentMergeScheduler)writer.Config.MergeScheduler).Sync();

            Assert.IsTrue(warmer.WarmCount > 0);
            Console.WriteLine("Count {0}", warmer.WarmCount);
            int count = warmer.WarmCount;

            var newDocument = DocHelper.CreateDocument(17, "test", 4);
            writer.AddDocument(newDocument);
            writer.ForceMerge(1);
            Assert.IsTrue(warmer.WarmCount > count);

            writer.Dispose();
            r1.Dispose();
            dir1.Dispose();
        }

        [Test]
        public virtual void TestAfterCommit([ValueSource(typeof(ConcurrentMergeSchedulerFactories), "Values")]Func<IConcurrentMergeScheduler> newScheduler)
        {
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            var config = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergeScheduler(newScheduler());
            IndexWriter writer = new IndexWriter(dir1, config);
            writer.Commit();

            // create the index
            CreateIndexNoClose(false, "test", writer);

            // get a reader to put writer into near real-time mode
            DirectoryReader r1 = writer.GetReader();
            TestUtil.CheckIndex(dir1);
            writer.Commit();
            TestUtil.CheckIndex(dir1);
            Assert.AreEqual(100, r1.NumDocs);

            for (int i = 0; i < 10; i++)
            {
                writer.AddDocument(DocHelper.CreateDocument(i, "test", 4));
            }
            ((IConcurrentMergeScheduler)writer.Config.MergeScheduler).Sync();

            DirectoryReader r2 = DirectoryReader.OpenIfChanged(r1);
            if (r2 != null)
            {
                r1.Dispose();
                r1 = r2;
            }
            Assert.AreEqual(110, r1.NumDocs);
            writer.Dispose();
            r1.Dispose();
            dir1.Dispose();
        }

        // Make sure reader remains usable even if IndexWriter closes
        [Test]
        public virtual void TestAfterClose()
        {
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));

            // create the index
            CreateIndexNoClose(false, "test", writer);

            DirectoryReader r = writer.GetReader();
            writer.Dispose();

            TestUtil.CheckIndex(dir1);

            // reader should remain usable even after IndexWriter is closed:
            Assert.AreEqual(100, r.NumDocs);
            Query q = new TermQuery(new Term("indexname", "test"));
            IndexSearcher searcher = NewSearcher(r);
            Assert.AreEqual(100, searcher.Search(q, 10).TotalHits);
            try
            {
                DirectoryReader.OpenIfChanged(r);
                Assert.Fail("failed to hit ObjectDisposedException");
            }
#pragma warning disable 168
            catch (ObjectDisposedException ace)
#pragma warning restore 168
            {
                // expected
            }
            r.Dispose();
            dir1.Dispose();
        }

        // Stress test reopen during addIndexes
        [Test, LongRunningTest] // LUCENENET TODO: Can this test be optimized to run faster on .NET Core 1.0?
        public virtual void TestDuringAddIndexes()
        {
            Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter writer = new IndexWriter(
                dir1,
                NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))
                    .SetMergePolicy(NewLogMergePolicy(2)));

            // create the index
            CreateIndexNoClose(false, "test", writer);
            writer.Commit();

            Directory[] dirs = new Directory[10];
            for (int i = 0; i < 10; i++)
            {
                dirs[i] = new MockDirectoryWrapper(Random(), new RAMDirectory(dir1, NewIOContext(Random())));
            }

            DirectoryReader r = writer.GetReader();

            const float SECONDS = 0.5f;

            long endTime = (long)(Environment.TickCount + 1000.0 * SECONDS);
            ConcurrentHashSet<Exception> excs = new ConcurrentHashSet<Exception>();

            // Only one thread can addIndexes at a time, because
            // IndexWriter acquires a write lock in each directory:
            var threads = new ThreadClass[1];
            for (int i = 0; i < threads.Length; i++)
            {
                threads[i] = new ThreadAnonymousInnerClassHelper(writer, dirs, endTime, excs);
                threads[i].SetDaemon(true);
                threads[i].Start();
            }

            int lastCount = 0;
            while (Environment.TickCount < endTime)
            {
                DirectoryReader r2 = DirectoryReader.OpenIfChanged(r);
                if (r2 != null)
                {
                    r.Dispose();
                    r = r2;
                }
                Query q = new TermQuery(new Term("indexname", "test"));
                IndexSearcher searcher = NewSearcher(r);
                int count = searcher.Search(q, 10).TotalHits;
                Assert.IsTrue(count >= lastCount);
                lastCount = count;
            }

            for (int i = 0; i < threads.Length; i++)
            {
                threads[i].Join();
            }
            // final check
            DirectoryReader dr2 = DirectoryReader.OpenIfChanged(r);
            if (dr2 != null)
            {
                r.Dispose();
                r = dr2;
            }
            Query q2 = new TermQuery(new Term("indexname", "test"));
            IndexSearcher searcher_ = NewSearcher(r);
            int count_ = searcher_.Search(q2, 10).TotalHits;
            Assert.IsTrue(count_ >= lastCount);

            Assert.AreEqual(0, excs.Count);
            r.Dispose();
            if (dir1 is MockDirectoryWrapper)
            {
                ICollection<string> openDeletedFiles = ((MockDirectoryWrapper)dir1).OpenDeletedFiles;
                Assert.AreEqual(0, openDeletedFiles.Count, "openDeleted=" + openDeletedFiles);
            }

            writer.Dispose();

            dir1.Dispose();
        }

        private class ThreadAnonymousInnerClassHelper : ThreadClass
        {
            private IndexWriter Writer;
            private Directory[] Dirs;
            private long EndTime;
            private ISet<Exception> Excs;

            public ThreadAnonymousInnerClassHelper(IndexWriter writer, Directory[] dirs, long endTime, ISet<Exception> excs)
            {
                this.Writer = writer;
                this.Dirs = dirs;
                this.EndTime = endTime;
                this.Excs = excs;
            }

            public override void Run()
            {
                do
                {
                    try
                    {
                        Writer.AddIndexes(Dirs);
                        Writer.MaybeMerge();
                    }
                    catch (Exception t)
                    {
                        Excs.Add(t);
                        throw new Exception(t.Message, t);
                    }
                } while (Environment.TickCount < EndTime);
            }
        }

        private Directory GetAssertNoDeletesDirectory(Directory directory)
        {
            if (directory is MockDirectoryWrapper)
            {
                ((MockDirectoryWrapper)directory).AssertNoDeleteOpenFile = true;
            }
            return directory;
        }

        // Stress test reopen during add/delete
        [Test]
        public virtual void TestDuringAddDelete()
        {
            Directory dir1 = NewDirectory();
            var writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy(2)));

            // create the index
            CreateIndexNoClose(false, "test", writer);
            writer.Commit();

            DirectoryReader r = writer.GetReader();

            const float SECONDS = 0.5f;

            long endTime = (long)(Environment.TickCount + 1000.0 * SECONDS);
            ConcurrentQueue<Exception> excs = new ConcurrentQueue<Exception>();

            var threads = new ThreadClass[NumThreads];
            for (int i = 0; i < NumThreads; i++)
            {
                threads[i] = new ThreadAnonymousInnerClassHelper2(writer, r, endTime, excs);
                threads[i].SetDaemon(true);
                threads[i].Start();
            }

            int sum = 0;
            while (Environment.TickCount < endTime)
            {
                DirectoryReader r2 = DirectoryReader.OpenIfChanged(r);
                if (r2 != null)
                {
                    r.Dispose();
                    r = r2;
                }
                Query q = new TermQuery(new Term("indexname", "test"));
                IndexSearcher searcher = NewSearcher(r);
                sum += searcher.Search(q, 10).TotalHits;
            }

            for (int i = 0; i < NumThreads; i++)
            {
                threads[i].Join();
            }
            // at least search once
            DirectoryReader dr2 = DirectoryReader.OpenIfChanged(r);
            if (dr2 != null)
            {
                r.Dispose();
                r = dr2;
            }
            Query q2 = new TermQuery(new Term("indexname", "test"));
            IndexSearcher indSearcher = NewSearcher(r);
            sum += indSearcher.Search(q2, 10).TotalHits;
            Assert.IsTrue(sum > 0, "no documents found at all");

            Assert.AreEqual(0, excs.Count);
            writer.Dispose();

            r.Dispose();
            dir1.Dispose();
        }

        private class ThreadAnonymousInnerClassHelper2 : ThreadClass
        {
            private IndexWriter Writer;
            private DirectoryReader r;
            private long EndTime;
            private ConcurrentQueue<Exception> Excs;

            public ThreadAnonymousInnerClassHelper2(IndexWriter writer, DirectoryReader r, long endTime, ConcurrentQueue<Exception> excs)
            {
                this.Writer = writer;
                this.r = r;
                this.EndTime = endTime;
                this.Excs = excs;
                rand = new Random(Random().Next());
            }

            internal readonly Random rand;

            public override void Run()
            {
                int count = 0;
                do
                {
                    try
                    {
                        for (int docUpto = 0; docUpto < 10; docUpto++)
                        {
                            Writer.AddDocument(DocHelper.CreateDocument(10 * count + docUpto, "test", 4));
                        }
                        count++;
                        int limit = count * 10;
                        for (int delUpto = 0; delUpto < 5; delUpto++)
                        {
                            int x = rand.Next(limit);
                            Writer.DeleteDocuments(new Term("field3", "b" + x));
                        }
                    }
                    catch (Exception t)
                    {
                        Excs.Enqueue(t);
                        throw new Exception(t.Message, t);
                    }
                } while (Environment.TickCount < EndTime);
            }
        }

        [Test]
        public virtual void TestForceMergeDeletes()
        {
            Directory dir = NewDirectory();
            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy()));
            Document doc = new Document();
            doc.Add(NewTextField("field", "a b c", Field.Store.NO));
            Field id = NewStringField("id", "", Field.Store.NO);
            doc.Add(id);
            id.SetStringValue("0");
            w.AddDocument(doc);
            id.SetStringValue("1");
            w.AddDocument(doc);
            w.DeleteDocuments(new Term("id", "0"));

            IndexReader r = w.GetReader();
            w.ForceMergeDeletes();
            w.Dispose();
            r.Dispose();
            r = DirectoryReader.Open(dir);
            Assert.AreEqual(1, r.NumDocs);
            Assert.IsFalse(r.HasDeletions);
            r.Dispose();
            dir.Dispose();
        }

        [Test]
        public virtual void TestDeletesNumDocs()
        {
            Directory dir = NewDirectory();
            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            Document doc = new Document();
            doc.Add(NewTextField("field", "a b c", Field.Store.NO));
            Field id = NewStringField("id", "", Field.Store.NO);
            doc.Add(id);
            id.SetStringValue("0");
            w.AddDocument(doc);
            id.SetStringValue("1");
            w.AddDocument(doc);
            IndexReader r = w.GetReader();
            Assert.AreEqual(2, r.NumDocs);
            r.Dispose();

            w.DeleteDocuments(new Term("id", "0"));
            r = w.GetReader();
            Assert.AreEqual(1, r.NumDocs);
            r.Dispose();

            w.DeleteDocuments(new Term("id", "1"));
            r = w.GetReader();
            Assert.AreEqual(0, r.NumDocs);
            r.Dispose();

            w.Dispose();
            dir.Dispose();
        }

        [Test]
        public virtual void TestEmptyIndex()
        {
            // Ensures that getReader works on an empty index, which hasn't been committed yet.
            Directory dir = NewDirectory();
            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
            IndexReader r = w.GetReader();
            Assert.AreEqual(0, r.NumDocs);
            r.Dispose();
            w.Dispose();
            dir.Dispose();
        }

        [Test]
        public virtual void TestSegmentWarmer()
        {
            Directory dir = NewDirectory();
            AtomicBoolean didWarm = new AtomicBoolean();
            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMaxBufferedDocs(2).SetReaderPooling(true).SetMergedSegmentWarmer(new IndexReaderWarmerAnonymousInnerClassHelper(this, didWarm)).
                    SetMergePolicy(NewLogMergePolicy(10)));

            Document doc = new Document();
            doc.Add(NewStringField("foo", "bar", Field.Store.NO));
            for (int i = 0; i < 20; i++)
            {
                w.AddDocument(doc);
            }
            w.WaitForMerges();
            w.Dispose();
            dir.Dispose();
            Assert.IsTrue(didWarm.Get());
        }

        private class IndexReaderWarmerAnonymousInnerClassHelper : IndexWriter.IndexReaderWarmer
        {
            private readonly TestIndexWriterReader OuterInstance;

            private AtomicBoolean DidWarm;

            public IndexReaderWarmerAnonymousInnerClassHelper(TestIndexWriterReader outerInstance, AtomicBoolean didWarm)
            {
                this.OuterInstance = outerInstance;
                this.DidWarm = didWarm;
            }

            public override void Warm(AtomicReader r)
            {
                IndexSearcher s = OuterInstance.NewSearcher(r);
                TopDocs hits = s.Search(new TermQuery(new Term("foo", "bar")), 10);
                Assert.AreEqual(20, hits.TotalHits);
                DidWarm.Set(true);
            }
        }

        [Test]
        public virtual void TestSimpleMergedSegmentWramer()
        {
            Directory dir = NewDirectory();
            AtomicBoolean didWarm = new AtomicBoolean();
            InfoStream infoStream = new InfoStreamAnonymousInnerClassHelper(this, didWarm);
            IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMaxBufferedDocs(2).SetReaderPooling(true).SetInfoStream(infoStream).SetMergedSegmentWarmer(new SimpleMergedSegmentWarmer(infoStream)).SetMergePolicy(NewLogMergePolicy(10)));

            Document doc = new Document();
            doc.Add(NewStringField("foo", "bar", Field.Store.NO));
            for (int i = 0; i < 20; i++)
            {
                w.AddDocument(doc);
            }
            w.WaitForMerges();
            w.Dispose();
            dir.Dispose();
            Assert.IsTrue(didWarm.Get());
        }

        private class InfoStreamAnonymousInnerClassHelper : InfoStream
        {
            private readonly TestIndexWriterReader OuterInstance;

            private AtomicBoolean DidWarm;

            public InfoStreamAnonymousInnerClassHelper(TestIndexWriterReader outerInstance, AtomicBoolean didWarm)
            {
                this.OuterInstance = outerInstance;
                this.DidWarm = didWarm;
            }

            protected override void Dispose(bool disposing)
            {
            }

            public override void Message(string component, string message)
            {
                if ("SMSW".Equals(component))
                {
                    DidWarm.Set(true);
                }
            }

            public override bool IsEnabled(string component)
            {
                return true;
            }
        }

        [Test]
        public virtual void TestNoTermsIndex()
        {
            // Some Codecs don't honor the ReaderTermsIndexDivisor, so skip the test if
            // they're picked.
            AssumeFalse("PreFlex codec does not support ReaderTermsIndexDivisor!", "Lucene3x".Equals(Codec.Default.Name));

            IndexWriterConfig conf = (IndexWriterConfig)NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetReaderTermsIndexDivisor(-1);

            // Don't proceed if picked Codec is in the list of illegal ones.
            string format = TestUtil.GetPostingsFormat("f");
            AssumeFalse("Format: " + format + " does not support ReaderTermsIndexDivisor!", (format.Equals("FSTPulsing41") || format.Equals("FSTOrdPulsing41") || format.Equals("FST41") || format.Equals("FSTOrd41") || format.Equals("SimpleText") || format.Equals("Memory") || format.Equals("MockRandom") || format.Equals("Direct")));

            Directory dir = NewDirectory();
            IndexWriter w = new IndexWriter(dir, conf);
            Document doc = new Document();
            doc.Add(new TextField("f", "val", Field.Store.NO));
            w.AddDocument(doc);
            SegmentReader r = GetOnlySegmentReader(DirectoryReader.Open(w, true));
            try
            {
                TestUtil.Docs(Random(), r, "f", new BytesRef("val"), null, null, DocsFlags.NONE);
                Assert.Fail("should have failed to seek since terms index was not loaded.");
            }
#pragma warning disable 168
            catch (InvalidOperationException e)
#pragma warning restore 168
            {
                // expected - we didn't load the term index
            }
            finally
            {
                r.Dispose();
                w.Dispose();
                dir.Dispose();
            }
        }

        [Test]
        public virtual void TestReopenAfterNoRealChange()
        {
            Directory d = GetAssertNoDeletesDirectory(NewDirectory());
            IndexWriter w = new IndexWriter(d, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));

            DirectoryReader r = w.GetReader(); // start pooling readers

            DirectoryReader r2 = DirectoryReader.OpenIfChanged(r);
            Assert.IsNull(r2);

            w.AddDocument(new Document());
            DirectoryReader r3 = DirectoryReader.OpenIfChanged(r);
            Assert.IsNotNull(r3);
            Assert.IsTrue(r3.Version != r.Version);
            Assert.IsTrue(r3.IsCurrent());

            // Deletes nothing in reality...:
            w.DeleteDocuments(new Term("foo", "bar"));

            // ... but IW marks this as not current:
            Assert.IsFalse(r3.IsCurrent());
            DirectoryReader r4 = DirectoryReader.OpenIfChanged(r3);
            Assert.IsNull(r4);

            // Deletes nothing in reality...:
            w.DeleteDocuments(new Term("foo", "bar"));
            DirectoryReader r5 = DirectoryReader.OpenIfChanged(r3, w, true);
            Assert.IsNull(r5);

            r3.Dispose();

            w.Dispose();
            d.Dispose();
        }

        [Test]
        public virtual void TestNRTOpenExceptions()
        {
            // LUCENE-5262: test that several failed attempts to obtain an NRT reader
            // don't leak file handles.
            MockDirectoryWrapper dir = (MockDirectoryWrapper)GetAssertNoDeletesDirectory(NewMockDirectory());
            AtomicBoolean shouldFail = new AtomicBoolean();
            dir.FailOn(new FailureAnonymousInnerClassHelper(shouldFail));

            IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            conf.SetMergePolicy(NoMergePolicy.COMPOUND_FILES); // prevent merges from getting in the way
            IndexWriter writer = new IndexWriter(dir, conf);

            // create a segment and open an NRT reader
            writer.AddDocument(new Document());
            writer.GetReader().Dispose();

            // add a new document so a new NRT reader is required
            writer.AddDocument(new Document());

            // try to obtain an NRT reader twice: first time it fails and closes all the
            // other NRT readers. second time it fails, but also fails to close the
            // other NRT reader, since it is already marked closed!
            for (int i = 0; i < 2; i++)
            {
                shouldFail.Set(true);
                try
                {
                    writer.GetReader().Dispose();
                }
#pragma warning disable 168
                catch (FakeIOException e)
#pragma warning restore 168
                {
                    // expected
                    if (VERBOSE)
                    {
                        Console.WriteLine("hit expected fake IOE");
                    }
                }
            }

            writer.Dispose();
            dir.Dispose();
        }

        private class FailureAnonymousInnerClassHelper : MockDirectoryWrapper.Failure
        {
            private readonly AtomicBoolean ShouldFail;

            public FailureAnonymousInnerClassHelper(AtomicBoolean shouldFail)
            {
                this.ShouldFail = shouldFail;
            }

            public override void Eval(MockDirectoryWrapper dir)
            {
                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                if (ShouldFail.Get() && StackTraceHelper.DoesStackTraceContainMethod("GetReadOnlyClone"))
                {
                    if (VERBOSE)
                    {
                        Console.WriteLine("TEST: now fail; exc:");
                        Console.WriteLine((new Exception()).StackTrace);
                    }
                    ShouldFail.Set(false);
                    throw new FakeIOException();
                }
            }
        }

        /// <summary>
        /// Make sure if all we do is open NRT reader against
        ///  writer, we don't see merge starvation.
        /// </summary>
        [Test, LongRunningTest]
        public virtual void TestTooManySegments()
        {
            Directory dir = GetAssertNoDeletesDirectory(NewDirectory());
            // Don't use newIndexWriterConfig, because we need a
            // "sane" mergePolicy:
            IndexWriterConfig iwc = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()));
            IndexWriter w = new IndexWriter(dir, iwc);
            // Create 500 segments:
            for (int i = 0; i < 500; i++)
            {
                Document doc = new Document();
                doc.Add(NewStringField("id", "" + i, Field.Store.NO));
                w.AddDocument(doc);
                IndexReader r = DirectoryReader.Open(w, true);
                // Make sure segment count never exceeds 100:
                Assert.IsTrue(r.Leaves.Count < 100);
                r.Dispose();
            }
            w.Dispose();
            dir.Dispose();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
OCC November 2021 Total Volume Up 40.2 Percent Compared to November 2020
Highest total volume month on record for U.S. listed options
Chicago -
OCC, the world's largest equity derivatives clearing organization, announced today that November 2021 total cleared contract volume was 949,396,907 contracts, the highest volume month on record and up 40.2 percent compared to November 2020. Year-to-date average daily cleared contract volume through November 2021 was 39,469,816 contracts, up 34.7 percent compared to November 2020.
Options: Total exchange-listed options cleared contract volume was 944,355,975, up 40.2 percent compared to November 2020. Equity options cleared contract volume was 898,166,403 contracts, up 40.3 percent compared to November 2020. This includes ETF options cleared contract volume of 244,472,686, a 31.6 percent increase compared to November 2020. Index options volume was 46,189,572, up 37.9 percent compared to November 2020. OCC's year-to-date average daily cleared options volume is 39,238,247 contracts.
Futures: Total futures cleared contract volume was 5,040,932, a 42.8 percent increase compared to November 2020. OCC's year-to-date average daily cleared futures volume is 231,569 contracts.
Securities Lending: The average daily loan value at OCC in November 2021 was $138,359,299,679, a 59.9 percent increase compared to November 2020. Securities lending CCP activity increased by 64.6 percent in new loans compared to November 2020 with 173,472 transactions last month.
For 2021 monthly exchange market share information, click here.
November 2021 Total Contract Volume
November 2021 Total Contract % Change vs 2020
YTD Avg Daily Contract 2021
November 2021 % Change vs 2020
Equity Options
Index Options
Total Options
OCC Public Relations
About OCC
The Options Clearing Corporation (OCC) is the world's largest equity derivatives clearing organization. Founded in 1973, OCC is dedicated to promoting stability and market integrity by delivering clearing and settlement services for options, futures and securities lending transactions. As a Systemically Important Financial Market Utility (SIFMU), OCC operates under the jurisdiction of the U.S. Securities and Exchange Commission (SEC), the U.S. Commodity Futures Trading Commission (CFTC), and the Board of Governors of the Federal Reserve System. OCC has more than 100 clearing members and provides central counterparty (CCP) clearing and settlement services to 19 exchanges and trading platforms. More information about OCC is available at www.theocc.com.

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: javascript import into another javascript inside a function I would like to keep a part of a script server sided so we can do the update for clients ourselves here. But reading on the internet did not make clear what would be the best way. Simply put the script looks like this:
$(function () {

  var id_user = XXXX; // this is what the client needs to connect

  // Obfuscated Code, this section i would like to load from the server
  var _$_2cfd=["\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x61\x70\x70\x65\x6E\x64","\x23\x73\x68\x6F\x77\x74\x61\x67\x65\x6E\x61\x62\x6C\x65\x64","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x54\x61\x67\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x43\x65\x6C\x65\x62\x72\x69\x74\x79\x44\x65\x74\x61\x69\x6C\x73\x22\x3E\x3C\x2F\x64\x69\x76\x3E","\x3C\x64\x69\x76\x20\x69\x64\x3D\x22\x50\x72\x6F\x64\x75\x63\x74\x43\x6F\x6E\x74\x61\x69\x6E\x65\x72\x22\x3E\x3C\x2F\x64\x69\x76\x3E"];var

})

and what i would like to archieve is that i can place the code block of obfuscated code in my azure storage and that it's loaded (imported) into the rest of the javascript file. This way i could make changes for the client remotely, add features etc. What would be the best way of doing this?
I looked into stackoverflow: How do I include a JavaScript file in another JavaScript file? but that is now 9 years old and perhaps better new way exist now.
would this be possible?
$(function () {

  var id_user = XXXX; // this is what the client needs to connect

  $.getScript("http://myweb.azurestorage.net/Obfuscated_Code.js", function());

})

where on the storage the Obfuscated Code is hosted, i know this is jquery what is fine to use as well

redpajama_set_name: RedPajamaStackExchange


I remember clearly my first day of middle school! Walking in the halls wondering what to expect from each of my classes, would I fit in, does everybody wear this type of outfit in middle school now!? First of all you need to sign your kids up for the top classes, it will really help them in college for their resumes, if it doesn't work out the first two weeks of school just switch them over to the regular classes quick you don't need a very bad grade switching over with them.
After you sign up for their classes, you will receive class items needed for each class they have. Walmart has very cute fashion school supplies but they can become slightly expensive at times. I would recommend Office Max for notebooks and pencils they have a sale at the beginning of school and sale notebooks and pencils for like 1 cent. Middle school is a time in life when everyone looks at you and judges you about your outfit , they look too see if it's stylish. They don't look at labels they look at designs.
What really helped me with middle school was not wearing the top leading brands actually. I wore pants from like Academy, Walmart, and Old Navy, and shirts from random stores with clearance racks, everybody looked at me and said where did you get those pants, and that shirt its cute! Make sure you get your kids mentally ready for school, like grade wise.
Going into middle school my parents gave me the boyfriend and girlfriend talk, although I have never had a boyfriend, that was great advice, so I then knew what to stay away from, and to never let boys get the main priority over school. Something my mom did everyday from the time I were in pre-k was to go through our backpacks when we came home from school. It really wasn't an invasion of privacy because you get to see the kinds of grades your kids are making and you might need to email a teacher about a subject that you have questions about.
Some other advice for parents helping their children in making the transition to Middle School, is to create friendly and encouraging incentives. I made all A's going through middle school because my parents had goals for me like I could get the perfume I wanted if I got straight A's or they would give me $100.That gave me something to look forward too, and made my transition just a little easier. Sending your child to Middle School for the first time can be a scary experience for parents and students alike, but if you work together with your child, the transition to the big Middle School will happen alot smoother.


text:
Pinoy International Film Festival
Nash Ang
International Partnerships Manager
Tina Pacres
Festival Consultant
Edwin Maestro
Flickers' Rhode Island International Film Festival
Pinoy International Film Festival 2021: A Look Into the "New Normal" of Asian Cinema
Coronavirus had a significant impact on the film industry in 2020 and has affected all arts sectors. Movie theaters have been shut down, festivities have been canceled, and film releases have been postponed indefinitely, along with the planned PIFF 2020.
Pinoy International Film Festival 2021 looks into the future of Asian Cinema by developing "ASEAN Contents Market", a digital content distribution platform to support Southeast Asian filmmakers and production companies to showcase their work to content buyers even there is still no actual film festival being organized. The physical event will still proceed as the pandemic dust subsides in the 4th quarter of 2021 to be held in California, USA.
The film festival focuses not only on overseas Filipinos but to its Asian neighbors as well. "Pinoy" is a word from the Philippines meaning "Filipino People", an ethnic minority which accounts for 5 percent of America's migrant population or the 2nd largest Asian-American population. As we normally see in film and television, Asians remain largely unseen in the States. PIFF 2020 is an initiative to insert real people of color into the cultural landscape of the mainstream entertainment industry.
The background of the new logo is an interpretation of a Philippine flag infused with cosmic energy. "The three colors that create the symbol are realities of the energy that the festival carries within. It is a consciousness that would guide "Pinoys" to achieve social inclusion through cultural awareness." said Edwin Maestro, the Festival Consultant of PIFF 2021. "Positive energies are within us, just believe to enhance those energies within the given cosmos." He added.
A time of crisis brought by COVID-19 is also an opportunity for OBRA Incorporated and PS Media Enterprise to look into the future, helping the TV and Film industry adjust to impending threat and building their capacity to be prepared.
Call for Submissions for Pinoy International Film Festival 2021
Official call for submissions of PIFF 2021 is on June 12, 2021. You can submit film entries online though FilmFreeway. Official rules will be announced also on the official date. For the mean time, here is our contact email for questions about film submission.
Submission Inquiries:
festival@asean.cm
FilmFreeway Film Submission Portal:
https://filmfreeway.com/pinoyfestival
How to Submit Movies & Series in ASEAN Contents Market?
Are you a Southeast Asian filmmaker? Submit your Movie or TV series and showcase your work to content buyers worldwide though ASEAN Contents Market. We want to give Asian Filmmakers an opportunity to earn money from their talents.
Submitting your content is not rocket science. Follow the steps below to start uploading information about your film in three steps:
1. Register in https://asean.cm/register and verify your email address.
2. Email us though festival@asean.cm with your intent to be a "Content Editor". We will upgrade your account for FREE.
3. After upgrading, you will be able to add your movies and TV series on the platform.
Submission is also the pre-selection to the Pinoy International Film Festival, which will be held in California, USA on the 4th quarter of 2021 so don't miss this all in one opportunity!


In advance of the release of Disney's new movie, The Finest Hours, you might wish to read this book by Michael J. Tougias and Casey Sherman.
The Finest Hours: The True Story of the U.S. Coast Guard's Most Daring Sea Rescue is readily available on Amazon in all formats from hardcover to paperback to Kindle and audio.
Definitely in advance but even after the movie release, this book would make a great movie-themed birthday or Christmas present.
Add it to your reading list now so that you can do the right thing and read the book before you see what looks like an amazing movie in January of 2016.
Buy The Finest Hours on Amazon.
Discover a list of natural disaster movies.
I agree, Trish. Thanks for visiting!


Design that is meant to unite cultures.
With the state of current affairs, the designers of the collective ISTANBUL?DAN wanted to oppose hostility and xenophobia through artistic ways. They banded together to create products that are more than just products? they are also stories. Headed to the historic Sishane and Galata neighborhoods of Istanbul, the designers worked together with local artisans and makers to interpret the history of the city through design. They work in a tightly woven group to create objects, not letting any cultural or linguistic barriers stop them. Together, they act as messengers between opposing cultures to pay homage to Istanbul.
Designer Jonathan Radetz created AYNA, which is a set of atypical mirrors. Rather than accurately reflecting what's in front of them, they distort or multiply the object, reminding us that it's important to consciously widen your perspective and have multiple points of views.
SEPET, by Florian Saul, is a delicate bowl-like object that combined the art of lamp making and the topic of fishing which is essential to the Bosphorus region. It's shape is reminiscent of a flexible fishing net, and molds to fit whatever is put in it.
CALYX is a table lamp by Dorothee Mainka, which was inspired by old school oil lamps. It has a translucent metal mesh that forms the shade, which creates unique shadows when the lamp is on.


5009845 V A- A1 1947 People's Army SG #478 28q light blue & dark blue, Cat £10.50, BRC fold, touch of toning.
5009844 Ω A B1 1964 Animals SG #810-16 set to 7L with extra 5L, Cat £14, 2l has a couple of tone spots.
5009832 Ω A- A1 1917 Shqipèrié Vetqeveritare Mi #4 2c red-brown & green, Cat €22, small tone spot at TRC.
5009833 Ω A- B1 1917 Shqipèrié Vetqeveritare Mi #5 3c grey & green, Cat €22, couple of small tone spots.
5009836 Ω A- B1 1917 Shqipèrié Vetqeveritare Mi #8 25c blue & black, Cat €20, couple of small tone spots.
5009838 * A B1 1917 Shqipèrié Vetqeveritare Mi #10 1f brown & black, Cat €20.
5009840 * A- B1 1917 Republika Shqipétare Mi #17 1f red-brown & black, Cat €25, some very light, small tone spots on gum.


text:
in Technology, World
WASHINGTON: Microsoft said Monday it was buying the professional social network LinkedIn for $26.2 billion in cash, a move that helps refocus the US tech giant around cloud computing and services.
With its biggest-ever acquisition and one of the largest in the tech sector, Microsoft takes a big step into the world of social networking and adds a new tool for its efforts to boost services for business.
"This deal brings together the world´s leading professional cloud with the world´s leading professional network," Microsoft chief executive Satya Nadella said in a statement.
"It´s clear to me that the LinkedIn team has grown a fantastic business and an impressive network of more than 433 million professionals."
According to a statement from the two firms, LinkedIn "will retain its distinct brand, culture and independence," with Jeff Weiner remaining at CEO of LinkedIn.
"Just as we have changed the way the world connects to opportunity, this relationship with Microsoft, and the combination of their cloud and LinkedIn´s network, now gives us a chance to also change the way the world works," Weiner said.
The two firms said they had reached a "definitive" agreement that would close later this year, with the support of LinkedIn chairman and controlling shareholder Reid Hoffman.
The move comes with Microsoft moving away from being a pure software firm, and LinkedIn seeking ways to boost growth.
LinkedIn, which enables members to connect with similar-minded professionals and facilitates recruiting and job hunting, has carved out a social network with a distinct identity.
But LinkedIn in the past quarter reported a loss of $46 million and a $166 million loss for 2015, which let its shares at multiyear lows early this year.
Nadella, in an email to staff, said the deal reflects Microsoft´s new focus on the enterprise and cloud.
"We are in pursuit of a common mission centered on empowering people and organizations," he said.
He added that the deal "is key to our bold ambition to reinvent productivity and business processes. Think about it: How people find jobs, build skills, sell, market and get work done and ultimately find success requires a connected professional world."
LinkedIn, which calls itself "the world´s largest and most valuable professional network," has been seeking to expand its offerings with more messaging, mobile applications and revamped its "newsfeed" to help boost engagement.
"Today is a re-founding moment for LinkedIn," Hoffman said in the statement. "I see incredible opportunity for our members and customers and look forward to supporting this new and combined business." Microsoft said it would finance the deal mostly by issuing new debt.
Clever, or too late?
Benedict Evans, a member of the Andreessen Horowitz venture capital firm who blogs on technology, said in a tweet that deal appear to be future-looking.
"Very clever and oblique MSFT thinking — how will we communicate, share & connect in a decade? Not docs + email. Social graph is key," Evans said in a Tweeted referencing the company´s Wall Street trading symbol.
But Roger Kay, analyst and consultant with Endpoint Technologies Associates, said it was doubtful that Microsoft can use the deal to compete in the world of social networking dominated by Facebook.
"It doesn´t help at all competing with Facebook," Kay told AFP. "LinkedIn is not in the same league as Facebook." Kay said Microsoft, paying a premium of some 50 percent for LinkedIn, is likely to end up writing down much of the investment. "It seems extraordinarily expensive," he said.
"I´m going to make the prediction they will write this down. There is no way they can extract $26 billion from LinkedIn."
Source AFP
MMX Canvas 6 pro Rom for Infinix Zero 3
Amjad Sabri Shot Dead in Karachi - Disturbing Video !


"Hi Diana the book will always be posted on Twitter, Facebook, instagram and gets changed on the web page. This will happen a day or two after the evening book club as we get customer to pick the book out of tea pot. You can always pop down and ask…"
"Good morning thank you for the interest in our book club, every month you can find the book under the events pages on our website. www.leafybeancompany.com & it also get put on twitter and Instagram & we make sure that we put up…"


text:
Sawant's recall election divides Seattle's Central and Capitol Hill neighborhoods
By Janean A. Forbes	 Last updated Dec 5, 2021
Supporters of council member Kshama Sawant and organizers of the recall campaign against her spoke to potential voters on Saturday.
SEATTLE – Tuesday will mark a rare recall election in Washington state, as voters in Seattle City Council District 3 will decide whether they wish to remove council member Kshama Sawant.
It took years for the recall effort to reach voters – and the issue divided many in the community.
"We are getting the vote in the biggest way Seattle has ever seen," said Kshama Solidarity campaign manager Bryan Koulouris. Sawant and other speakers gathered supporters to remind people to vote at a launch event on Saturday morning.
RELATED: Interest in Kshama Sawant's Recall Election High, Early Poll Results Show
Volunteers roamed Capitol Hill and the Central District all day Saturday.
Those on the other side of the issue were also chatting with potential voters. There are strong feelings on both sides.
"We have to come together and work together," said Henry Bridger II.
Bridger is leading the campaign for Recall Sawant but says he supports it.
>> Download KING 5's Roku and Amazon Fire apps to watch live TV news and on-demand videos
"I'm not a politician, I'm just a normal guy who wants to get our city back on track," he explained. Bridger says the election got so heated that it cost him friends.
Sawant's supporters believe these are outside influences trying to influence Seattle politics.
"It's the most important election in the country right now. There has been a right-wing backlash against the right to protest against the Black Lives Matter movement and against the right to vote across the country, "Koulouris said.
Koulouris believes the timing of the election is hurting them as well.
Both groups flooded the streets, sometimes at opposite corners, appealing to their neighbors. They hope Tuesday's vote writes another chapter, hopefully, that involves more unity for everyone.
"We need a better day, a new day for Seattle and that's one way to start to move in that direction," said Bridger.
Ballots are due Tuesday for the election. If Sawant is recalled, other members of Seattle City Council will appoint a replacement.
RELATED: Efforts to Recall Seattle Council Member Sawant Sparks Interest Outside of City
COVID-19 cases, hospitalizations continue to increase in the central district health zone | Local news from the Big Island
US Senate Confirms Gregory Harris as US Attorney for Central District


text:
Maria Romagosa i Romagosa (Terrassa, Vallès Occidental, 7 de setembre del 1985) és una exjugadora d'hoquei sobre herba en la posició de davantera.

Formada al Júnior Futbol Club, va debutar amb el primer equip la temporada 2002-03. Amb el club, va guanyar un Campionat de Catalunya i un d'Espanya d'hoquei sala. En hoquei sobre herba, va aconseguir tres subcampionats de la Divisió d'Honor (2004-05, 2007-08 i 2008-09) i dos de Copa de la Reina (2005-06 i 2009-10). A nivell individual, va ser la màxima golejadora de la Lliga espanyola el 2012-13 i 2013-14. Internacional amb la selecció espanyola des del 2000, va participar als Jocs olímpics de Pequín de 2008, aconseguint el setè lloc, i va aconseguir una quarta posició al Campionat del Món de 2006. També va proclamar-se subcampiona del món d'hoquei sala. Al final de la temporada 2013-14 va retirar-se de la competició, després de 21 anys de carrera amb el club santcugatenc.

Palmarès
 Clubs

 1 Campionat de Catalunya d'hoquei sala
 1 Campionat d'Espanya d'hoquei sala

 Selecció espanyola

 1 medalla d'argent al Campionat del món d'hoquei sala: 2007

 Individual

 Màxima golejadora de la Lliga espanyola d'hoquei sobre herba femenina: 2012-13 i 2013-14

Referències

Bibliografia
 Fitxa de Maria Romagosa Romagosa - FIH

Jugadores d'hoquei sobre herba terrassenques
Jugadores d'hoquei sobre herba del Júnior Futbol Club
Esportistes catalanes del sud als Jocs Olímpics d'estiu de 2008

redpajama_set_name: RedPajamaWikipedia


Helia 48 Smoker. Electric food smokers with multifunction. For restaurant, fast food, for smoking food directly in your restaurant business. The HELIA SMOKER makes your meat cook precisely and safely by low temperature and gives it your favorite smoke taste at the same time. Places to be for a. Helia Smoker, Find Complete Details about Helia Smoker,Electrical Smoker Oven from Other Machinery & Industry Equipment Supplier or Manufacturer- OSSA.
HOME add your business sign up Login. After only 15 to 20 minutes you can enjoy your smoked trout! The field is wrongly filled. This keeps your own juice. It does not require a chimney connection and can be used hela an optional extractor hood where desired.
We created a Personal Account for you to make the process of buying faster and easier in the future. Obligatory field is not filled. Soker then it can start: Grilling Set with spatula, tongs and meat fork. Additional Information Weight [kg] 25 Manufacturer No.
We are happy to help! All you need to do is connect it to the power supply and off you go!
To Compare the Products. A way to find products, brochures, specifications and save them into collections on the platform. According to this principle, a "powdered pork" can be prepared, which is really helai and currently trendy.
My account Contact us Payments Shipping. Because one has only once discovered, how fast and uncomplicated the device is in the application and cleaning, one does not want to give it any more. Grates for grill and BBQ.
Stainless steel – Dimensions cm 45x85x35h – Weight 45,00 kg. You can unsubscribe at any time.
It strongly slows down work of kitchen and, as a result, the discontent of guests grows in the hall. This has the advantage that by the long cooking of the meat at low temperature, a dissolution of the collagen present in the connective tissue takes place. The Helia Smoker is the top state-of-the-art electric smoking device, can be used wherever you want.
A place to find the best restaurant suppliersmanufacturers and services. Then take a look at our smokehouse onlineshop heliasmoker. You will receive updates and special offers from our stores.
The constant uniform temperature and the optimal distribution of smoke result in an optimal cooking and a golden brown coloring smokrr the smoked meat.


text:
Jane The Virgin Season 3: Jane and Rafael, can the couple get back together?
Jane and Rafael are always getting closer and closer. Is their love story really over in Season 3 of Jane the Virgin or can they get back together?
Will Jane soon have a new boyfriend? In episode 15 of season 3 of Jane The Virgin , the young woman was finally ready to meet love again. After sending Alex on the roses, having caught a big wind and accepting a date (missed) with Dennis, Jane did not give up. The young woman has completely flashed on the new co-star of his father's series, Fabian. The young actor has all the assets to seduce Jane. However, their love story may very soon be compromised by Rogelio in season 3 of Jane The Virgin . Moreover, there is another man in the life of Jane whose Mother of Mateo is always very close and very accomplice, Rafael. The latter has always been there for her and it seems that since some episodes the writers begin to prepare the ground for possible reunion between Jane and Rafael in season 3 of Jane The Virgin . Will Mateo's parents really get together?
For now, Jane will be under the charm of the famous Fabian but if the latter is very sexy and surely very nice, he is not as charismatic as Rafael and does not seem frankly interesting in season 3 of Jane The Virgin . The young woman is likely to get tired of him very quickly! As for Rafael, it seems that his feelings for Petra resurface while the pretty blonde is in love with Chuck. That should bring some drama! However, the writers give us each episode clues to put us on the way of a return of flame between Rafael and Jane. However, let us not forget that the series is a telenovela and that it was renewed for a season 4. It is thought that the couple could reform or be about to reform in the Season Finale. But is Rafael really Jane's true love? The narrator revealed that a third man would count a lot for the young woman. Who is he ? It will be necessary to wait until April 24 next to find a new episode of the series and therefore to know more about the possible romance of Jane and Rafael. Meanwhile, find out if Petra could go to jail in season 3 of Jane The Virgin. And do you think Jane and Rafael will finally get back together in season 3 of Jane The Virgin? Who is he ? It will be necessary to wait until April 24 next to find a new episode of the series and therefore to know more about the possible romance of Jane and Rafael. Meanwhile, find out if Petra could go to jail in season 3 of Jane The Virgin. And do you think Jane and Rafael will finally get back together in season 3 of Jane The Virgin? Who is he ? It will be necessary to wait until April 24 next to find a new episode of the series and therefore to know more about the possible romance of Jane and Rafael. Meanwhile, find out if Petra could go to jail in season 3 of Jane The Virgin. And do you think Jane and Rafael will finally get back together in season 3 of Jane The Virgin?


text:
List of Herbs
Focus On Flowers
Biologically speaking, flower parts are all about reproduction. A flower's showy, colorful petals are designed to attract pollinators such as insects, birds, and even bats. The grouping of petals together is called the corolla. Around the outside of the corolla are sepals, leaflike structures that enclose the flower before it opens. Sepals are often green, but they can also be so colorful that they are mistaken for petals. The grouping of sepals together is called the calyx.
Most flowers include both "male" (staminate) and "female" (pistillate) parts. The stamen, or male flower part, consists of a thin stalk called a filament, topped by an anther, the pollen-bearing structure of the flower. The pistil, or female flower part, is an upright structure in the center of the flower that consists of one or more styles, which are tubelike stalks. The style supports the stigma, the part of the pistil that receives the pollen. Once pollen is deposited on the stigma, it travels down the style to the ovary at the bottom of the pistil. The ovary contains a number of ovules that, when fertilized by pollen, develop into seeds.
Examples Of Inflorescence Types
A plant's flowering structure can take many forms. Recognizing them is essential for proper plant identification.
Although most flowers have both male and female parts, single-sex plants are not uncommon. Technically known as dioecious plants, these bear male and female flower parts on separate plants, which means that both male and female plants must be present for pollination to occur. Dioecious herbs include ginkgo (Ginkgo biloba) and nettle (Urtica dioica). Single-sex flowers are called imperfect flowers; flowers that have both male and female parts are called perfect flowers.
In terms of plant identification, flowers are the most important part of a plant. When identifying a plant, begin by determining how many petals and sepals the flower has. Depending on the flower, this can be straightforward or tricky. Petals can be fused (joined together) or free. Flowers can be regular (symmetrical, with all petals the same size and shape, such as a mustard or rose family flower) or irregular (with some petals different from the others, as in a mint or pea flower). The color of the flower can provide some help, but flower color can be highly variable within a single species, making it an undependable characteristic for identification.
Inside a Composite Flower
Plants in the daisy family (Asteraceae), including purple coneflower, have composite flowers; each is composed of hundreds of tiny flowers.
The aster family (Asteraceae) is one of the two largest flowering plant families. (The other is the orchid family, Orchidaceae.) The aster family's daisylike flowers—called composite flowers—are unique in the plant world. Learning to recognize the basic characteristics of this kind of flower makes it easy to quickly rule out other possibilities when trying to identify a plant.
The sunflower, which is a typical composite flower, is not a single big flower but instead is made up of hundreds of tiny flowers; this is called a composite flower head. A typical composite flower head is composed of numerous ray and disk flowers. Ray flowers are longer, strap-shaped flowers that circle the edge of a flower head. Disk flowers are short, bristly flowers in the center of a flower head.
Learning the kinds of leaf complexity can help you identify the plant.
Sunflower plants have both ray and disk flowers, as do feverfew and echinacea plants. Some composite flower heads, however, are composed solely of either ray or disk flowers. For example, dandelion and chicory flower heads are made up of ray flowers only. Pineapple weed (Matricaria matricarioides), a close relative of German chamomile (M. recutita), has only disk flowers. The arrangement of flowers on a plant's stem determines its type of inflorescence (flower cluster). This is another important identification feature.
cash quick
Important Herbs Of Asia
Essential oils: What are Essential Oils?
Herb-Drug Interactions
Herbs Tips Copyright © 2021


text:
For reservation contact us: +381 (0) 280 385 041, +381 (0) 280 385 001
+377 (0) 44 935 935, +377 (0) 45 935 935, Tel/Fax: +381 (0) 280 385 355
- About Hotel
Period Iliro-Dardane
During the Middle Ages
The center has a capsule of 350 beds for patients, two and three bed rooms, a restaurant with 350 seats, a conference room with 350 chairs with the possibility of organizing gatherings, scientific conferences, cultural events.
History of Banja e Kllokotit
The Socially Owned Enterprise "Banja e Kllokotit" in Klokot / Kllokot was founded in February 1953.
The Anamorava region for the construction of the relief belongs to the geological changes caused by tectonic movements. The Morava e Eperme, according to the relief picture, is distinguished by rolling and tectonic lignees that are rich in minerals.
Exactly in the Moraven of Eperme and the tops of mountains and hills, it is noticed that the volcanoes once operated and after their extinction there were only round domes left. Those volcanoes have extracted many minerals from the earth's crust from the groundwater, which make the absorption of minerals and they blend into the Upper Moravian valley.
It is rarely the one in which on such a small surface has more resources of healing waters, thermal and mineral such as Anamorava...
Magma is closer to the surface of the earth which releases fever and warms the water.
The mineral waters in the Banjë of Kllokot at the exit to the surface of the earth range from 31 to 37 celsius degrees. Banja e Kllokotit has a good geographical position where Upper Morava stretches from the upper part of the Morava River to Uglari.
This vendan is today located between two large centers of Kosovo such as Gjilan and Ferizaj in the distance almost equal to 20 Km. The geo-morphological composition and other physical-geographic features of this locality, namely by relief, we see different forms of relief, flattened areas that are surrounded by mountains. The altitude of this locality is 479 meters and dominates the continental continental climate.
Klokot was an old settlement. This site belongs to the Pharaonic phase of the 12th-9th century BC before our era. In Klokot / Klokot since the high times there was an explosion of thermo- mineral water with a weaker intensity. In the vicinity of this source, an early settlement with all the features of organized civilization has been established, with an infrastructure development called Urban. Exactly between Klokot and Tërpezes today. Here are some sculpture exhibits that show and argue the antiquity and the economic and cultural development of this area. Also in this area is found a stele that represents "Lady Dardan."
This made it clear that the first inhabitants of this area were the Dardans, and the place where the baths lay were swampy, where they grazed the animals and drank salty water, which contributed to their improvement and thickening.
Klokot has been mentioned since the Middle Ages.
"In the written documents, on the Knez Lazarus card issued in 1381 the Ravanica Monastery is mentioned in the same name"
, which has nothing to do with its former residence before the Paradardan era. In addition, Kllokot is also mentioned in the Cadastral Registry of Vilajet Vëllik of 1455 on the Austrian map of 1689, in the Salaamnet of the Vilayet of Kosovo of 1893, 1896, and 1900. With the arrival of Serbian military forces and the deployment of Serbian power, all the properties, houses, property of former properties were also confiscated by the source of the thermal-mineral water of the dwelling.
The Serbs during the first world war had abandoned the use of mineral bath water, leaving completely neglected, while Albanians were not allowed to approach to exploit it. Serbian invaders did not have time to deal with this resource as they ran after the usurpation of Albanian lands. Then resume Ban's work where it is assumed that Klokot / Kllokot settlement has taken this name based on the movement of water in the interior of the ground (kllokko - kllok) for any eventual explosion. Passing through this, some residents of the village have noticed that after the rains some gasses appeared in the empty river bed, in some small whales, where they were the sources of thermal water. Later it is the opening of agricultural cooperatives in Klokot / Kllokot, where significant importance was paid to the cultivation of grain. Since the soil was very fertile, vegetables were also cultivated. In the second five year plan, green color is given, d.m.th. allowing the construction of a bath building, as a healing and climatic site. After the fifties, mineral bath water was used for healing. The composition of mineral water began to be used also as healing water, which influenced the gradual increase of visitors, especially those who needed treatment. However, the extremely difficult conditions, the absence of a place of residence, meant that most were forced to travel. For this purpose, there was a need for more efficient treatment, especially for the food and shelter of the patients (visitors) and hence, some wooden houses (baraka) and later hotels
© 2017 Banja e Kllokotit, Developed by: Puzzle Media CA


text:
Formerly the Waterfront and Tarpon Hotel, The Innlet on the Waterfront is the property of choice for fishermen and families alike on the Boca Grande Bayou. We are the gateway to the Southwest Florida's Intracostal waterways and surrounding barrier islands.
Located at the midway point on Gasparilla Island, The Innlet attracts fishermen and other visitors who want to escape the modern-day milieu and submerse themselves in Gasparilla Island's "Old-World" charm.
Quiet solitude is easy to find here, whether you are traipsing the land or navigating the water. No high-rise buildings, no traffic lights can be found. What you will find are plenty of opportunities for fishing, boating, beaching, shelling, shopping, dining, and…relaxing.
The Inn Marina
Owned and operated by The Gasparilla Inn & Club, this full-service marina is open to the public and located three short blocks from The Innlet. It also can be accessed via the Intracostal Waterway from the south at channel marker #2 or from the north by heading between markers #4 and #5.
A premier Mercury Service Dealer, The Inn Marina has fully certified Mercury technicians on site Monday through Saturday for boat repairs, detailing and other services. Fuel, live bait and miscellaneous boating supplies, snacks, ice cream treats, etc. are offered in the new ships' store. The Marina offers both wet and dry boat storage. Overnight docking is always available for those arriving by boat to Gasparilla Island.
Daily hours of operation are from 8:00 a.m. to 5:00 p.m.
For information on the Marina and its services, please call 855.643.7557.
Gasparilla Island has a vibrant history that began more than 2,000 years ago when the Calusa Indians first inhabited the tiny island and made Charlotte Harbor the center of their empire. By the mid 1700s, the tribe had all but disappeared due to clashes with European explorers.
In 1885, phosphate rock was discovered east of Gasparilla Island across Charlotte Harbor along the Peace River. This discovery turned the south end of the island into a major deep water port and eventually led to the development of Boca Grande. Phosphate, a valuable mineral for fertilizers and other products, was shipped worldwide from Port Boca Grande until the 1970s when the line was abandoned.
In 1907, Charlotte Harbor was completed, as was the Northern Railroad, which linked Gasparilla Island to the mainland. The railroad brought wealthy visitors and, just three years later, Boca Grande Pass had established itself as a world-class tarpon fishing destination. Soon, the village of Boca Grande was developed, and winter residences were built for upper class families from the northern states.
When the Boca Grande Causeway was opened in 1958, the railroad was closed and its old bed was turned into Boca Grande's popular bike path. Gasparilla flourishes today as a prized retreat for tourists and fishermen who appreciate the island's "Old World" Florida charm.
Driving Directions/UPS/ FedEx – 1251 12th St E, Boca Grande, FL 33921
USPS Mail – PO Box 248, Boca Grande, FL 33921
CONTACT US DIRECTIONS PROPERTY MAP RESERVE NOW ACCESSIBILITY


text:
Mokoia – wyspa położona na jeziorze Rotorua w Nowej Zelandii. Powierzchnia wyspy to 1,35 km². Wyspa stanowi ryolitową kopułę wulkaniczną wznoszącą się 180 m powyżej powierzchni jeziora.

Wyspy Nowej Zelandii
Bay of Plenty (region)


A police full-time national serviceman (NSF) accessed a computer at the operations room of the Special Operations Command (SOC), took a photo of the screen and sent it to a colleague.
The image, which contained confidential information on police operations, was later forwarded to a drug abuser who messaged his friends, saying: "Stop everything tonite (sic) full ops."
Separately, Muhammad Alif Muhammad Jamil also ran a blog inviting netizens to submit obscene videos which he would then upload online.
Alif, 21, who has since completed his national service and is now a student, was sentenced to probation for a year and three months yesterday.
The former police special constable corporal pleaded guilty in October last year to an offence under the Official Secrets Act and five counts of transmitting obscene videos.
As part of his probation, he must perform 150 hours of community service and his mother was bonded for $5,000 to ensure his good behaviour.
The court heard that on April 17, 2016, a 26-year-old man forwarded an obscene video of his former girlfriend to Alif, asking him to make it go viral.
Alif uploaded it onto his blog and the 24-year-old woman confronted her former boyfriend when she found out about it three days later.
The older man told Alif to delete the video and he complied on April 21, 2016.
The woman also lodged a police report that day.
Deputy Public Prosecutor Lee Zu Zhao said that during investigations, officers found that Alif had also transmitted four more obscene videos that other netizens had sent to him.
The court also heard that Alif was working as an operator at the SOC on Oct 4, 2016, when a colleague, Muhd Firdaus Abdullah, 21, sent him a text message, asking him to check on police operations.
Alif then snapped a picture of the computer display showing confidential information before forwarding it to Firdaus, who was then working as a sentry at the SOC.
DPP Lee said that Alif did as he was told even though he did not know why Firdaus wanted the information.
Firdaus, who has already been dealt with in court, forwarded the picture to his sister's boyfriend, who in turn sent it to the drug abuser.
Alif's offence came to light the next day when the Central Narcotics Bureau arrested a 32-year-old woman and one of its officers found the picture on her mobile phone.


text:
The new Sergeant Major Of The Marine Corps says...The Corps exists for "a singular purpose" the round hitting the target. The Corps is about warfighting."
Meet the 19th @USMCSgtMaj, Sgt. Maj. Troy E. Black. pic.twitter.com/sYOeQ5wbrB
— U.S. Marines (@USMC) July 27, 2019
via Marines Times.com
There's a new sergeant major of the Marine Corps in town as of Friday, but don't expect a whirlwind of changes anytime soon.
If the mantra of Sgt. Maj. Troy Black, the 19th sergeant major of the Marine Corps, could be summed up, it's in the popular 1970s Marine Corps recruiting ad: "We don't promise you a rose garden."
Black told Marine Corps Times in an exclusive interview that Marines shouldn't expect significant changes to tattoo policies, grooming standards, uniform regulations or re-enlistment incentives: What he's focused on is the foundation of the Corps and its Marines.
The Corps exists for "a singular purpose" Black said. "The round hitting the target. The Corps is about warfighting."
And there are certain non-negotiables that make up the identity of the Corps. He said he's focused on reinforcing those.
Hmm. Were you paying attention this week? We got a news alert that a SEAL Team had been kicked out of theater and that same day we saw some Marines arrested (in MASS) out at Pendleton for gross stupidity.
News of the SEAL alleged misconduct vanished in a flash. The idea of that elite outfit being involved in behavior so gross....the fact that they refused to cooperate in the investigation, didn't spark any additional questions. Didn't send defense journalist into a frenzy to see what was actually behind all that.
It simply disappeared.
Not the same with the story on Marines out at Pendleton. That story has legs.
Because despite all the publicity. Despite what I consider the obscenity of actually chasing the spotlight, the SEALs still don't have the imagination and love and interest that the Marine Corps has with the American people.
We have problems. We have issues. But we're still America's Praetorian Guard.
It's refreshing, damn near hardon producing to see the new Sergeant Major Of The Marine Corps walking in talking this way.
Hopefully he climbs out of the fighting hole this office has had for the past few years and gets out and about, pushing the views expressed in this article.
This new Commandant and SMMC could possibly lead to a much needed revival and a refocusing on Marine Corps principles. We can hope can't we???