text:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Orleans;
using Orleans.Runtime;
using Orleans.Runtime.Configuration;
using Orleans.TestingHost;
using UnitTests.GrainInterfaces;
using Xunit;
using System.Linq;
using UnitTests.TimerTests;

// ReSharper disable InconsistentNaming
// ReSharper disable UnusedVariable

namespace Tester.AzureUtils.TimerTests
{
    [TestCategory("Reminders"), TestCategory("Azure")]
    public class ReminderTests_AzureTable : ReminderTests_Base, IClassFixture<ReminderTests_AzureTable.Fixture>
    {
        public class Fixture : BaseAzureTestClusterFixture
        {
            protected override void ConfigureTestCluster(TestClusterBuilder builder)
            {
                Guid serviceId = Guid.NewGuid();
                builder.ConfigureLegacyConfiguration(legacy =>
                {
                    legacy.ClusterConfiguration.Globals.ServiceId = serviceId;
                    legacy.ClusterConfiguration.Globals.ReminderServiceType = GlobalConfiguration.ReminderServiceProviderType.AzureTable;
                });
            }
        }

        public ReminderTests_AzureTable(Fixture fixture) : base(fixture)
        {
            fixture.EnsurePreconditionsMet();
        }

        // Basic tests

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Basic_StopByRef()
        {
            await Test_Reminders_Basic_StopByRef();
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Basic_ListOps()
        {
            await Test_Reminders_Basic_ListOps();
        }

        // Single join tests ... multi grain, multi reminders

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_1J_MultiGrainMultiReminders()
        {
            await Test_Reminders_1J_MultiGrainMultiReminders();
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_ReminderNotFound()
        {
            await Test_Reminders_ReminderNotFound();
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Basic()
        {
            // start up a test grain and get the period that it's programmed to use.
            IReminderTestGrain2 grain = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            TimeSpan period = await grain.GetReminderPeriod(DR);
            // start up the 'DR' reminder and wait for two ticks to pass.
            await grain.StartReminder(DR);
            Thread.Sleep(period.Multiply(2) + LEEWAY); // giving some leeway
            // retrieve the value of the counter-- it should match the sequence number which is the number of periods
            // we've waited.
            long last = await grain.GetCounter(DR);
            Assert.Equal(2, last);
            // stop the timer and wait for a whole period.
            await grain.StopReminder(DR);
            Thread.Sleep(period.Multiply(1) + LEEWAY); // giving some leeway
            // the counter should not have changed.
            long curr = await grain.GetCounter(DR);
            Assert.Equal(last, curr);
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Basic_Restart()
        {
            IReminderTestGrain2 grain = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            TimeSpan period = await grain.GetReminderPeriod(DR);
            await grain.StartReminder(DR);
            Thread.Sleep(period.Multiply(2) + LEEWAY); // giving some leeway
            long last = await grain.GetCounter(DR);
            Assert.Equal(2, last);

            await grain.StopReminder(DR);
            TimeSpan sleepFor = period.Multiply(1) + LEEWAY;
            Thread.Sleep(sleepFor); // giving some leeway
            long curr = await grain.GetCounter(DR);
            Assert.Equal(last, curr);
            AssertIsInRange(curr, last, last + 1, grain, DR, sleepFor);

            // start the same reminder again
            await grain.StartReminder(DR);
            sleepFor = period.Multiply(2) + LEEWAY;
            Thread.Sleep(sleepFor); // giving some leeway
            curr = await grain.GetCounter(DR);
            AssertIsInRange(curr, 2, 3, grain, DR, sleepFor);
            await grain.StopReminder(DR); // cleanup
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_MultipleReminders()
        {
            IReminderTestGrain2 grain = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            await PerGrainMultiReminderTest(grain);
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_2J_MultiGrainMultiReminders()
        {
            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g2 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g3 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g4 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g5 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());

            TimeSpan period = await g1.GetReminderPeriod(DR);

            Task<bool>[] tasks =
            {
                Task.Run(() => PerGrainMultiReminderTestChurn(g1)),
                Task.Run(() => PerGrainMultiReminderTestChurn(g2)),
                Task.Run(() => PerGrainMultiReminderTestChurn(g3)),
                Task.Run(() => PerGrainMultiReminderTestChurn(g4)),
                Task.Run(() => PerGrainMultiReminderTestChurn(g5)),
            };

            await Task.Delay(period.Multiply(5));

            // start two extra silos ... although it will take it a while before they stabilize
            log.Info("Starting 2 extra silos");

            await this.HostedCluster.StartAdditionalSilos(2, true);
            await this.HostedCluster.WaitForLivenessToStabilizeAsync();

            //Block until all tasks complete.
            await Task.WhenAll(tasks).WithTimeout(ENDWAIT);
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_MultiGrainMultiReminders()
        {
            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g2 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g3 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g4 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g5 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());

            Task<bool>[] tasks =
            {
                Task.Run(() => PerGrainMultiReminderTest(g1)),
                Task.Run(() => PerGrainMultiReminderTest(g2)),
                Task.Run(() => PerGrainMultiReminderTest(g3)),
                Task.Run(() => PerGrainMultiReminderTest(g4)),
                Task.Run(() => PerGrainMultiReminderTest(g5)),
            };

            //Block until all tasks complete.
            await Task.WhenAll(tasks).WithTimeout(ENDWAIT);
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_1F_Basic()
        {
            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());

            TimeSpan period = await g1.GetReminderPeriod(DR);

            Task<bool> test = Task.Run(async () => { await PerGrainFailureTest(g1); return true; });

            Thread.Sleep(period.Multiply(failAfter));
            // stop the secondary silo
            log.Info("Stopping secondary silo");
            this.HostedCluster.StopSilo(this.HostedCluster.SecondarySilos.First());

            await test; // Block until test completes.
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_2F_MultiGrain()
        {
            List<SiloHandle> silos = await this.HostedCluster.StartAdditionalSilos(2,true);

            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g2 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g3 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g4 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g5 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());

            TimeSpan period = await g1.GetReminderPeriod(DR);

            Task[] tasks =
            {
                Task.Run(() => PerGrainFailureTest(g1)),
                Task.Run(() => PerGrainFailureTest(g2)),
                Task.Run(() => PerGrainFailureTest(g3)),
                Task.Run(() => PerGrainFailureTest(g4)),
                Task.Run(() => PerGrainFailureTest(g5)),
            };

            Thread.Sleep(period.Multiply(failAfter));

            // stop a couple of silos
            log.Info("Stopping 2 silos");
            int i = random.Next(silos.Count);
            this.HostedCluster.StopSilo(silos[i]);
            silos.RemoveAt(i);
            this.HostedCluster.StopSilo(silos[random.Next(silos.Count)]);

            await Task.WhenAll(tasks).WithTimeout(ENDWAIT); // Block until all tasks complete.
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_1F1J_MultiGrain()
        {
            List<SiloHandle> silos = await this.HostedCluster.StartAdditionalSilos(1);
            await this.HostedCluster.WaitForLivenessToStabilizeAsync();

            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g2 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g3 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g4 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g5 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());

            TimeSpan period = await g1.GetReminderPeriod(DR);

            Task[] tasks =
            {
                Task.Run(() => PerGrainFailureTest(g1)),
                Task.Run(() => PerGrainFailureTest(g2)),
                Task.Run(() => PerGrainFailureTest(g3)),
                Task.Run(() => PerGrainFailureTest(g4)),
                Task.Run(() => PerGrainFailureTest(g5)),
            };

            Thread.Sleep(period.Multiply(failAfter));

            var siloToKill = silos[random.Next(silos.Count)];
            // stop a silo and join a new one in parallel
            log.Info("Stopping a silo and joining a silo");
            Task<bool> t1 = Task.Factory.StartNew(() =>
            {

                this.HostedCluster.StopSilo(siloToKill);
                return true;
            });
            Task<bool> t2 = this.HostedCluster.StartAdditionalSilos(1, true).ContinueWith(t =>
            {
                t.GetAwaiter().GetResult();
                return true;
            });
            await Task.WhenAll(new[] { t1, t2 }).WithTimeout(ENDWAIT);

            await Task.WhenAll(tasks).WithTimeout(ENDWAIT); // Block until all tasks complete.
            log.Info("\n\n\nReminderTest_1F1J_MultiGrain passed OK.\n\n\n");
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_RegisterSameReminderTwice()
        {
            IReminderTestGrain2 grain = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            Task<IGrainReminder> promise1 = grain.StartReminder(DR);
            Task<IGrainReminder> promise2 = grain.StartReminder(DR);
            Task<IGrainReminder>[] tasks = { promise1, promise2 };
            await Task.WhenAll(tasks).WithTimeout(TimeSpan.FromSeconds(15));
            //Assert.NotEqual(promise1.Result, promise2.Result);
            // TODO: write tests where period of a reminder is changed
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_GT_Basic()
        {
            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestCopyGrain g2 = this.GrainFactory.GetGrain<IReminderTestCopyGrain>(Guid.NewGuid());
            TimeSpan period = await g1.GetReminderPeriod(DR); // using same period

            await g1.StartReminder(DR);
            Thread.Sleep(period.Multiply(2) + LEEWAY); // giving some leeway
            await g2.StartReminder(DR);
            Thread.Sleep(period.Multiply(2) + LEEWAY); // giving some leeway
            long last1 = await g1.GetCounter(DR);
            Assert.Equal(4, last1);
            long last2 = await g2.GetCounter(DR);
            Assert.Equal(2, last2); // CopyGrain fault

            await g1.StopReminder(DR);
            Thread.Sleep(period.Multiply(2) + LEEWAY); // giving some leeway
            await g2.StopReminder(DR);
            long curr1 = await g1.GetCounter(DR);
            Assert.Equal(last1, curr1);
            long curr2 = await g2.GetCounter(DR);
            Assert.Equal(4, curr2); // CopyGrain fault
        }

        [SkippableFact(Skip = "https://github.com/dotnet/orleans/issues/4319"), TestCategory("Functional")]
        public async Task Rem_Azure_GT_1F1J_MultiGrain()
        {
            List<SiloHandle> silos = await this.HostedCluster.StartAdditionalSilos(1);
            await this.HostedCluster.WaitForLivenessToStabilizeAsync();

            IReminderTestGrain2 g1 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestGrain2 g2 = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            IReminderTestCopyGrain g3 = this.GrainFactory.GetGrain<IReminderTestCopyGrain>(Guid.NewGuid());
            IReminderTestCopyGrain g4 = this.GrainFactory.GetGrain<IReminderTestCopyGrain>(Guid.NewGuid());

            TimeSpan period = await g1.GetReminderPeriod(DR);

            Task[] tasks =
            {
                Task.Run(() => PerGrainFailureTest(g1)),
                Task.Run(() => PerGrainFailureTest(g2)),
                Task.Run(() => PerCopyGrainFailureTest(g3)),
                Task.Run(() => PerCopyGrainFailureTest(g4)),
            };

            Thread.Sleep(period.Multiply(failAfter));

            var siloToKill = silos[random.Next(silos.Count)];
            // stop a silo and join a new one in parallel
            log.Info("Stopping a silo and joining a silo");
            Task<bool> t1 = Task.Run(() =>
            {
                this.HostedCluster.StopSilo(siloToKill);
                return true;
            });
            Task<bool> t2 = Task.Run(async () =>
            {
                await this.HostedCluster.StartAdditionalSilos(1);
                return true;
            });
            await Task.WhenAll(new[] { t1, t2 }).WithTimeout(ENDWAIT);

            await Task.WhenAll(tasks).WithTimeout(ENDWAIT); // Block until all tasks complete.
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Wrong_LowerThanAllowedPeriod()
        {
            IReminderTestGrain2 grain = this.GrainFactory.GetGrain<IReminderTestGrain2>(Guid.NewGuid());
            await Assert.ThrowsAsync<ArgumentException>(() =>
                grain.StartReminder(DR, TimeSpan.FromMilliseconds(3000), true));
        }

        [SkippableFact, TestCategory("Functional")]
        public async Task Rem_Azure_Wrong_Grain()
        {
            IReminderGrainWrong grain = this.GrainFactory.GetGrain<IReminderGrainWrong>(0);

            await Assert.ThrowsAsync<InvalidOperationException>(() =>
                grain.StartReminder(DR));
        }
    }

}
// ReSharper restore InconsistentNaming
// ReSharper restore UnusedVariable


text:
package org.phoenixframework.channels;

public interface ISocketOpenCallback {
    public void onOpen();
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.hadoop.hbase;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.NavigableMap;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.client.Durability;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.log.HBaseMarkers;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.Region;
import org.apache.hadoop.hbase.regionserver.RegionAsTable;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.CommonFSUtils;
import org.apache.hadoop.hbase.util.FSTableDescriptors;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Abstract HBase test class. Initializes a few things that can come in handly like an
 * HBaseConfiguration and filesystem.
 * @deprecated since 2.0.0 and will be removed in 3.0.0. Write junit4 unit tests using
 *             {@link HBaseTestingUtility}.
 * @see HBaseTestingUtility
 * @see HBASE-11912
 */
@Deprecated
public abstract class HBaseTestCase extends junit.framework.TestCase {
  private static final Logger LOG = LoggerFactory.getLogger(HBaseTestCase.class);

  protected final static byte[] fam1 = Bytes.toBytes("colfamily11");
  protected final static byte[] fam2 = Bytes.toBytes("colfamily21");
  protected final static byte[] fam3 = Bytes.toBytes("colfamily31");

  protected static final byte[][] COLUMNS = { fam1, fam2, fam3 };

  private boolean localfs = false;
  protected static Path testDir = null;
  protected FileSystem fs = null;
  protected HRegion meta = null;
  protected static final char FIRST_CHAR = 'a';
  protected static final char LAST_CHAR = 'z';
  protected static final String PUNCTUATION = "~`@#$%^&*()-_+=:;',.<>/?[]{}|";
  protected static final byte[] START_KEY_BYTES = { FIRST_CHAR, FIRST_CHAR, FIRST_CHAR };
  protected String START_KEY = new String(START_KEY_BYTES, HConstants.UTF8_CHARSET);
  protected static final int MAXVERSIONS = 3;

  protected final HBaseTestingUtility testUtil = new HBaseTestingUtility();

  public volatile Configuration conf = testUtil.getConfiguration();
  public final FSTableDescriptors fsTableDescriptors;
  {
    try {
      fsTableDescriptors = new FSTableDescriptors(conf);
    } catch (IOException e) {
      throw new RuntimeException("Failed to init descriptors", e);
    }
  }

  /** constructor */
  public HBaseTestCase() {
    super();
  }

  /**
   * n
   */
  public HBaseTestCase(String name) {
    super(name);
  }

  /**
   * Note that this method must be called after the mini hdfs cluster has started or we end up with
   * a local file system.
   */
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    localfs = (conf.get("fs.defaultFS", "file:///").compareTo("file:///") == 0);

    if (fs == null) {
      this.fs = FileSystem.get(conf);
    }
    try {
      if (localfs) {
        testDir = getUnitTestdir(getName());
        if (fs.exists(testDir)) {
          fs.delete(testDir, true);
        }
      } else {
        testDir = CommonFSUtils.getRootDir(conf);
      }
    } catch (Exception e) {
      LOG.error(HBaseMarkers.FATAL, "error during setup", e);
      throw e;
    }
  }

  @Override
  protected void tearDown() throws Exception {
    try {
      if (localfs) {
        if (this.fs.exists(testDir)) {
          this.fs.delete(testDir, true);
        }
      }
    } catch (Exception e) {
      LOG.error(HBaseMarkers.FATAL, "error during tear down", e);
    }
    super.tearDown();
  }

  /**
   * @see HBaseTestingUtility#getBaseTestDir n * @return directory to use for this test
   */
  protected Path getUnitTestdir(String testName) {
    return testUtil.getDataTestDir(testName);
  }

  /**
   * You must call close on the returned region and then close on the log file it created. Do
   * {@link HBaseTestingUtility#closeRegionAndWAL(HRegion)} to close both the region and the WAL.
   * nnn * @return An {@link HRegion} n
   */
  public HRegion createNewHRegion(HTableDescriptor desc, byte[] startKey, byte[] endKey)
    throws IOException {
    return createNewHRegion(desc, startKey, endKey, this.conf);
  }

  public HRegion createNewHRegion(HTableDescriptor desc, byte[] startKey, byte[] endKey,
    Configuration conf) throws IOException {
    HRegionInfo hri = new HRegionInfo(desc.getTableName(), startKey, endKey);
    return HBaseTestingUtility.createRegionAndWAL(hri, testDir, conf, desc);
  }

  protected HRegion openClosedRegion(final HRegion closedRegion) throws IOException {
    return HRegion.openHRegion(closedRegion, null);
  }

  /**
   * Create a table of name {@code name} with {@link #COLUMNS} for families.
   * @param name Name to give table.
   * @return Column descriptor.
   */
  protected HTableDescriptor createTableDescriptor(final String name) {
    return createTableDescriptor(name, MAXVERSIONS);
  }

  /**
   * Create a table of name {@code name} with {@link #COLUMNS} for families.
   * @param name     Name to give table.
   * @param versions How many versions to allow per column.
   * @return Column descriptor.
   */
  protected HTableDescriptor createTableDescriptor(final String name, final int versions) {
    return createTableDescriptor(name, HColumnDescriptor.DEFAULT_MIN_VERSIONS, versions,
      HConstants.FOREVER, HColumnDescriptor.DEFAULT_KEEP_DELETED);
  }

  /**
   * Create a table of name {@code name} with {@link #COLUMNS} for families.
   * @param name     Name to give table.
   * @param versions How many versions to allow per column.
   * @return Column descriptor.
   */
  protected HTableDescriptor createTableDescriptor(final String name, final int minVersions,
    final int versions, final int ttl, KeepDeletedCells keepDeleted) {
    HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name));
    for (byte[] cfName : new byte[][] { fam1, fam2, fam3 }) {
      htd.addFamily(
        new HColumnDescriptor(cfName).setMinVersions(minVersions).setMaxVersions(versions)
          .setKeepDeletedCells(keepDeleted).setBlockCacheEnabled(false).setTimeToLive(ttl));
    }
    return htd;
  }

  /**
   * Add content to region r on the passed column column. Adds data of the
   * from 'aaa', 'aab', etc where key and value are the same. nnnn * @return count of what we added.
   */
  public static long addContent(final Region r, final byte[] columnFamily, final byte[] column)
    throws IOException {
    byte[] startKey = r.getRegionInfo().getStartKey();
    byte[] endKey = r.getRegionInfo().getEndKey();
    byte[] startKeyBytes = startKey;
    if (startKeyBytes == null || startKeyBytes.length == 0) {
      startKeyBytes = START_KEY_BYTES;
    }
    return addContent(new RegionAsTable(r), Bytes.toString(columnFamily), Bytes.toString(column),
      startKeyBytes, endKey, -1);
  }

  public static long addContent(final Region r, final byte[] columnFamily) throws IOException {
    return addContent(r, columnFamily, null);
  }

  /**
   * Add content to region r on the passed column column. Adds data of the
   * from 'aaa', 'aab', etc where key and value are the same. n * @return count of what we added.
   */
  public static long addContent(final Table updater, final String columnFamily) throws IOException {
    return addContent(updater, columnFamily, START_KEY_BYTES, null);
  }

  public static long addContent(final Table updater, final String family, final String column)
    throws IOException {
    return addContent(updater, family, column, START_KEY_BYTES, null);
  }

  /**
   * Add content to region r on the passed column column. Adds data of the
   * from 'aaa', 'aab', etc where key and value are the same.
   * @return count of what we added. n
   */
  public static long addContent(final Table updater, final String columnFamily,
    final byte[] startKeyBytes, final byte[] endKey) throws IOException {
    return addContent(updater, columnFamily, null, startKeyBytes, endKey, -1);
  }

  public static long addContent(final Table updater, final String family, String column,
    final byte[] startKeyBytes, final byte[] endKey) throws IOException {
    return addContent(updater, family, column, startKeyBytes, endKey, -1);
  }

  /**
   * Add content to region r on the passed column column. Adds data of the
   * from 'aaa', 'aab', etc where key and value are the same.
   * @return count of what we added. n
   */
  public static long addContent(final Table updater, final String columnFamily, final String column,
    final byte[] startKeyBytes, final byte[] endKey, final long ts) throws IOException {
    long count = 0;
    // Add rows of three characters. The first character starts with the
    // 'a' character and runs up to 'z'. Per first character, we run the
    // second character over same range. And same for the third so rows
    // (and values) look like this: 'aaa', 'aab', 'aac', etc.
    char secondCharStart = (char) startKeyBytes[1];
    char thirdCharStart = (char) startKeyBytes[2];
    EXIT: for (char c = (char) startKeyBytes[0]; c <= LAST_CHAR; c++) {
      for (char d = secondCharStart; d <= LAST_CHAR; d++) {
        for (char e = thirdCharStart; e <= LAST_CHAR; e++) {
          byte[] t = new byte[] { (byte) c, (byte) d, (byte) e };
          if (endKey != null && endKey.length > 0 && Bytes.compareTo(endKey, t) <= 0) {
            break EXIT;
          }
          try {
            Put put;
            if (ts != -1) {
              put = new Put(t, ts);
            } else {
              put = new Put(t);
            }
            try {
              StringBuilder sb = new StringBuilder();
              if (column != null && column.contains(":")) {
                sb.append(column);
              } else {
                if (columnFamily != null) {
                  sb.append(columnFamily);
                  if (!columnFamily.endsWith(":")) {
                    sb.append(":");
                  }
                  if (column != null) {
                    sb.append(column);
                  }
                }
              }
              byte[][] split = CellUtil.parseColumn(Bytes.toBytes(sb.toString()));
              if (split.length == 1) {
                byte[] qualifier = new byte[0];
                put.addColumn(split[0], qualifier, t);
              } else {
                put.addColumn(split[0], split[1], t);
              }
              put.setDurability(Durability.SKIP_WAL);
              updater.put(put);
              count++;
            } catch (RuntimeException ex) {
              ex.printStackTrace();
              throw ex;
            } catch (IOException ex) {
              ex.printStackTrace();
              throw ex;
            }
          } catch (RuntimeException ex) {
            ex.printStackTrace();
            throw ex;
          } catch (IOException ex) {
            ex.printStackTrace();
            throw ex;
          }
        }
        // Set start character back to FIRST_CHAR after we've done first loop.
        thirdCharStart = FIRST_CHAR;
      }
      secondCharStart = FIRST_CHAR;
    }
    return count;
  }

  protected void assertResultEquals(final HRegion region, final byte[] row, final byte[] family,
    final byte[] qualifier, final long timestamp, final byte[] value) throws IOException {
    Get get = new Get(row);
    get.setTimestamp(timestamp);
    Result res = region.get(get);
    NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = res.getMap();
    byte[] res_value = map.get(family).get(qualifier).get(timestamp);

    if (value == null) {
      assertEquals(
        Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp,
        null, res_value);
    } else {
      if (res_value == null) {
        fail(Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp
          + "\" was expected to be \"" + Bytes.toStringBinary(value) + " but was null");
      }
      if (res_value != null) {
        assertEquals(
          Bytes.toString(family) + " " + Bytes.toString(qualifier) + " at timestamp " + timestamp,
          value, new String(res_value, StandardCharsets.UTF_8));
      }
    }
  }

  /**
   * Common method to close down a MiniDFSCluster and the associated file system n
   */
  public static void shutdownDfs(MiniDFSCluster cluster) {
    if (cluster != null) {
      LOG.info("Shutting down Mini DFS ");
      try {
        cluster.shutdown();
      } catch (Exception e) {
        /// Can get a java.lang.reflect.UndeclaredThrowableException thrown
        // here because of an InterruptedException. Don't let exceptions in
        // here be cause of test failure.
      }
      try {
        FileSystem fs = cluster.getFileSystem();
        if (fs != null) {
          LOG.info("Shutting down FileSystem");
          fs.close();
        }
        FileSystem.closeAll();
      } catch (IOException e) {
        LOG.error("error closing file system", e);
      }
    }
  }

  /**
   * You must call {@link #closeRootAndMeta()} when done after calling this method. It does cleanup.
   * n
   */
  protected void createMetaRegion() throws IOException {
    FSTableDescriptors fsTableDescriptors = new FSTableDescriptors(conf);
    meta = HBaseTestingUtility.createRegionAndWAL(HRegionInfo.FIRST_META_REGIONINFO, testDir, conf,
      fsTableDescriptors.get(TableName.META_TABLE_NAME));
  }

  protected void closeRootAndMeta() throws IOException {
    HBaseTestingUtility.closeRegionAndWAL(meta);
  }

  public static void assertByteEquals(byte[] expected, byte[] actual) {
    if (Bytes.compareTo(expected, actual) != 0) {
      throw new junit.framework.AssertionFailedError(
        "expected:<" + Bytes.toString(expected) + "> but was:<" + Bytes.toString(actual) + ">");
    }
  }

  public static void assertEquals(byte[] expected, byte[] actual) {
    if (Bytes.compareTo(expected, actual) != 0) {
      throw new junit.framework.AssertionFailedError("expected:<" + Bytes.toStringBinary(expected)
        + "> but was:<" + Bytes.toStringBinary(actual) + ">");
    }
  }
}


text:
require 'spec_helper'

describe imap_server('localhost') do
  it { should connect }
  it { should authenticate 'wobble', 'w0bbl3_p4ss' }
  it { should_not authenticate 'wobble', 'bad_pass' }
end


text:
<?php
/**
 * Single Product Image
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.0.14
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $post, $woocommerce, $product;

?>

	<?php
		if ( has_post_thumbnail() ) {

			$image_title 		= esc_attr( get_the_title( get_post_thumbnail_id() ) );
			$image_link  		= wp_get_attachment_url( get_post_thumbnail_id() );
			$image       		= get_the_post_thumbnail( $post->ID, 'recent-news', array(
				'title' => $image_title
				) );
			$attachment_count   = count( $product->get_gallery_attachment_ids() );

			if ( $attachment_count > 0 ) {
				$gallery = '[product-gallery]';
			} else {
				$gallery = '';
			}

			echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image_link, $image_title, $image ), $post->ID );

		} else {

			echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '', woocommerce_placeholder_img_src() ), $post->ID );

		}
	?>

		<?php do_action( 'woocommerce_product_thumbnails' ); ?>


text: Polymer('flow-app-logs');


text:
package com.android.coolweather.db;

import org.litepal.crud.DataSupport;

/**
 * Created by duchunwei on 2017/2/15.
 * 省份
 */

public class Province extends DataSupport {
    /**
     * 记录字段
     */
    private int id;
    /**
     * 省份名
     */
    private String provinceName;
    /**
     * 省份代号
     */
    private int provinceCode;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public int getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(int provinceCode) {
        this.provinceCode = provinceCode;
    }
}


text:
struct OpusEncoder;

namespace media {
class AudioBus;
class MultiChannelResampler;
}  // namespace media

namespace remoting {

class AudioPacket;

class AudioEncoderOpus : public AudioEncoder {
 public:
  AudioEncoderOpus();
  virtual ~AudioEncoderOpus();

  // AudioEncoder interface.
  virtual scoped_ptr<AudioPacket> Encode(
      scoped_ptr<AudioPacket> packet) OVERRIDE;

 private:
  void InitEncoder();
  void DestroyEncoder();
  bool ResetForPacket(AudioPacket* packet);

  void FetchBytesToResample(int resampler_frame_delay,
                            media::AudioBus* audio_bus);

  int sampling_rate_;
  AudioPacket::Channels channels_;
  OpusEncoder* encoder_;

  int frame_size_;
  scoped_ptr<media::MultiChannelResampler> resampler_;
  scoped_ptr<char[]> resample_buffer_;
  scoped_ptr<media::AudioBus> resampler_bus_;

  // Used to pass packet to the FetchBytesToResampler() callback.
  const char* resampling_data_;
  int resampling_data_size_;
  int resampling_data_pos_;

  // Left-over unencoded samples from the previous AudioPacket.
  scoped_ptr<int16[]> leftover_buffer_;
  int leftover_buffer_size_;
  int leftover_samples_;

  DISALLOW_COPY_AND_ASSIGN(AudioEncoderOpus);
};

}  // namespace remoting

#endif  // REMOTING_CODEC_AUDIO_ENCODER_OPUS_H_


text:
import {Injectable} from '@angular/core';
import {Jsonp, URLSearchParams} from '@angular/http';
@Injectable()
export class PlaceInfoService {
    constructor(private jsonp: Jsonp) { }
    getInfo(place: string) {
        let serviceUrl = 'https://oe.oregonexplorer.info/rural/crt_rest_api/places';
        var params = new URLSearchParams();
        params.set('place', place); // the user's search value
        params.set('f', 'json');
        params.set('callback', 'JSONP_CALLBACK');
        return this.jsonp
            .get(serviceUrl, { search: params })
            .map((request: any) => <string[]>request.json());
    }
}


text:
'''
try:
    from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote
    from urllib.request import parse_http_list
    from http import cookiejar as cookielib
    from http.cookies import Morsel

except ImportError:
    from urllib import quote, unquote, urlencode
    from urlparse import urlparse, urlunparse, urljoin, urlsplit
    from urllib2 import parse_http_list
    import cookielib
    from Cookie import Morsel
'''

from marrow.util.compat import unicode
from marrow.util.object import NoDefault

class ReaderWriter(object):
    default = NoDefault
    rw = True

    def __init__(self, header, default=NoDefault, rw=NoDefault, rfc=None):
        self.header = header

        if default is not NoDefault:
            self.default = default

        if rw is not NoDefault:
            self.rw = rw

        self.rfc = rfc

    def __repr__(self):
        return '{0}("{1}")'.format(self.__class__.__name__, self.header)

    def __get__(self, obj, cls):
        if obj is None:
            return self

        try:
            return obj[self.header]

        except KeyError:
            pass

        if self.default is not NoDefault:
            if hasattr(self.default, '__call__'):
                return self.default(obj)

            return self.default

        raise AttributeError('WSGI environment does not contain %s key.' % (self.header, ))

    def __set__(self, obj, value):
        if not self.rw or getattr(obj, 'final', False):
            raise AttributeError('%s is a read-only value.' % (self.header, ))

        if value is None:
            del obj[self.header]
            return

        obj[self.header] = value

    def __delete__(self, obj):
        if not self.rw or getattr(obj, 'final', False):
            raise AttributeError('%s is a read-only value.' % (self.header, ))

        del obj[self.header]

class Int(ReaderWriter):
    def __get__(self, obj, cls):
        if obj is None:
            return self

        try:
            return int(super(Int, self).__get__(obj, cls))
        except AttributeError:
            return None
        except ValueError:
            return None

    def __set__(self, obj, value):
        super(Int, self).__set__(obj, unicode(value).encode('ascii'))

'''
class List(ReaderWriter):
    """Parse list headers according to RFC 2068 section 2."""

    def __get__(self, obj, cls):
        if obj is None:
            return self

        result = []
        source = super(List, self).__get__(obj, cls)

        if not source:
            return result

        for item in parse_http_list(source):
            if item[:1] == item[-1:] == '"':
                item = item[1:-1].replace('\\\\', '\\').replace('\\"', '"')
            result.append(item)

        return result

    def __set__(self, obj, value):
        parts = []

        for part in value:
            if ' ' in part:
                parts.append('"' + part.replace('\\', '\\\\').replace('"', '\\"'))

class Dict(ReaderWriter):
    """Parse dictionary headers according to RFC 2068 section 2."""

    def __get__(self, obj, cls):
        if obj is None:
            return self

        result = {}
        source = super(Dict, self).__get__(obj, cls)

        for item in parse_http_list(source):
            if '=' not in item:
                result[item] = None
                continue

            name, _, value = item.partition('=')

            if value[:1] == value[-1:] == '"':
                value = value[1:-1].replace('\\\\', '\\').replace('\\"', '"')

            result[name] = value

        return result

    def __set__(self, obj, value):
        pass
'''

class Host(ReaderWriter):
    """Host name provided in HTTP_HOST, if present, SERVER_NAME otherwise."""

    def default(self, obj):
        return (obj[self.header] if self.header in obj else None) or (obj.server + ':' + obj.port)


text:
import Route from '@ember/routing/route';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import { inject as service } from '@ember/service';
import { merge, values, isEmpty } from 'lodash';

export default Route.extend(ApplicationRouteMixin, {
  session: service(),
  title(tokens) {
    if (!tokens) {
      tokens = [];
    }

    tokens.reverse().push(this.get('settings.appName'));
    return tokens.join(' | ');
  },

  async beforeModel(transition) {
    this._super(...arguments);
    await this.get('authManager').initialize();
    await this.get('settings').initialize();
    if (!transition.intent.url.includes('login') && !transition.intent.url.includes('reset-password')) {
      this.set('session.previousRouteName', transition.intent.url);
    } else {
      this.set('session.previousRouteName', null);
    }
  },

  async model() {
    let notifications = [];
    if (this.get('session.isAuthenticated')) {
      notifications = await this.get('authManager.currentUser').query('notifications', {
        filter: [
          {
            name : 'is-read',
            op   : 'eq',
            val  : false
          }
        ],
        sort: '-received-at'
      });
    }

    return {
      notifications,
      pages: await this.get('store').query('page', {
        sort: 'index'
      }),
      cookiePolicy     : this.get('settings.cookiePolicy'),
      cookiePolicyLink : this.get('settings.cookiePolicyLink'),
      socialLinks      : await this.get('store').queryRecord('setting', {}),
      eventTypes       : await this.get('store').findAll('event-type'),
      eventLocations   : await this.get('store').findAll('event-location')
    };
  },

  sessionInvalidated() {
    if (!this.get('session.skipRedirectOnInvalidation')) {
      this._super(...arguments);
    }
    this.set('session.skipRedirectOnInvalidation', false);
  },

  sessionAuthenticated() {
    if (this.get('session.previousRouteName')) {
      this.transitionTo(this.get('session.previousRouteName'));
    } else {
      this._super(...arguments);
    }
  },

  /**
   * Merge all params into one param.
   *
   * @param params
   * @return {*}
   * @private
   */
  _mergeParams(params) {
    return merge({}, ...values(params));
  },

  actions: {
    willTransition(transition) {
      transition.then(() => {
        let params = this._mergeParams(transition.params);
        let url;
        // generate doesn't like empty params.
        if (isEmpty(params)) {
          url = transition.router.generate(transition.targetName);
        } else {
          url = transition.router.generate(transition.targetName, params);
        }
        // Do not save the url of the transition to login route.
        if (!url.includes('login') && !url.includes('reset-password')) {
          this.set('session.previousRouteName', url);
        } else {
          this.set('session.previousRouteName', null);
        }
      });
    }
  }
});


text:
ssh-keygen
ssh-copy-id root@minion1
ssh-copy-id root@minion2
ssh-copy-id root@minion3

# ssh minion1/minion2/minion3


text:
<?php

$DEFAULT_SECTION = 'toolbox';


text:
package com.amazonaws.services.pinpoint.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.pinpoint.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * SegmentDimensions JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SegmentDimensionsJsonUnmarshaller implements Unmarshaller<SegmentDimensions, JsonUnmarshallerContext> {

    public SegmentDimensions unmarshall(JsonUnmarshallerContext context) throws Exception {
        SegmentDimensions segmentDimensions = new SegmentDimensions();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("Attributes", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setAttributes(new MapUnmarshaller<String, AttributeDimension>(context.getUnmarshaller(String.class),
                            AttributeDimensionJsonUnmarshaller.getInstance()).unmarshall(context));
                }
                if (context.testExpression("Behavior", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setBehavior(SegmentBehaviorsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("Demographic", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setDemographic(SegmentDemographicsJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("Location", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setLocation(SegmentLocationJsonUnmarshaller.getInstance().unmarshall(context));
                }
                if (context.testExpression("Metrics", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setMetrics(new MapUnmarshaller<String, MetricDimension>(context.getUnmarshaller(String.class),
                            MetricDimensionJsonUnmarshaller.getInstance()).unmarshall(context));
                }
                if (context.testExpression("UserAttributes", targetDepth)) {
                    context.nextToken();
                    segmentDimensions.setUserAttributes(new MapUnmarshaller<String, AttributeDimension>(context.getUnmarshaller(String.class),
                            AttributeDimensionJsonUnmarshaller.getInstance()).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return segmentDimensions;
    }

    private static SegmentDimensionsJsonUnmarshaller instance;

    public static SegmentDimensionsJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new SegmentDimensionsJsonUnmarshaller();
        return instance;
    }
}


text:
namespace Microsoft.Azure.Batch.Protocol.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Specifies a file upload destination within an Azure blob storage
    /// container.
    /// </summary>
    public partial class OutputFileBlobContainerDestination
    {
        /// <summary>
        /// Initializes a new instance of the
        /// OutputFileBlobContainerDestination class.
        /// </summary>
        public OutputFileBlobContainerDestination()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// OutputFileBlobContainerDestination class.
        /// </summary>
        /// <param name="containerUrl">The URL of the container within Azure
        /// Blob Storage to which to upload the file(s).</param>
        /// <param name="path">The destination blob or virtual directory within
        /// the Azure Storage container.</param>
        /// <param name="identityReference">The reference to the user assigned
        /// identity to use to access Azure Blob Storage specified by
        /// containerUrl</param>
        public OutputFileBlobContainerDestination(string containerUrl, string path = default(string), ComputeNodeIdentityReference identityReference = default(ComputeNodeIdentityReference))
        {
            Path = path;
            ContainerUrl = containerUrl;
            IdentityReference = identityReference;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the destination blob or virtual directory within the
        /// Azure Storage container.
        /// </summary>
        /// <remarks>
        /// If filePattern refers to a specific file (i.e. contains no
        /// wildcards), then path is the name of the blob to which to upload
        /// that file. If filePattern contains one or more wildcards (and
        /// therefore may match multiple files), then path is the name of the
        /// blob virtual directory (which is prepended to each blob name) to
        /// which to upload the file(s). If omitted, file(s) are uploaded to
        /// the root of the container with a blob name matching their file
        /// name.
        /// </remarks>
        [JsonProperty(PropertyName = "path")]
        public string Path { get; set; }

        /// <summary>
        /// Gets or sets the URL of the container within Azure Blob Storage to
        /// which to upload the file(s).
        /// </summary>
        /// <remarks>
        /// If not using a managed identity, the URL must include a Shared
        /// Access Signature (SAS) granting write permissions to the container.
        /// </remarks>
        [JsonProperty(PropertyName = "containerUrl")]
        public string ContainerUrl { get; set; }

        /// <summary>
        /// Gets or sets the reference to the user assigned identity to use to
        /// access Azure Blob Storage specified by containerUrl
        /// </summary>
        /// <remarks>
        /// The identity must have write access to the Azure Blob Storage
        /// container
        /// </remarks>
        [JsonProperty(PropertyName = "identityReference")]
        public ComputeNodeIdentityReference IdentityReference { get; set; }

    }
}


text:
package app.controller.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/socio")
public class TestController {

    @Autowired
    TestService service;

    @RequestMapping(method = RequestMethod.GET)
    public String index(Model model) {
        model.addAttribute("servicios",service.allServicio());
        model.addAttribute("mensaje", "METODO INDEX");
        return "test";
    }

    @RequestMapping("ejemplo")
    public String ejemplo(Model model) {

        model.addAttribute("mensaje", "METODO EJEMPLO");
        return "test";
    }

    @RequestMapping(value = "ejemplopost", method = RequestMethod.POST)
    public String ejemploPost(Model model) {

        model.addAttribute("mensaje", "METODO POST");
        return "test";
    }

    @RequestMapping(value = {"actualizar/{id}", "actualizar"})
    public String parametroUrl(Model model, @PathVariable("id") String id) {

        model.addAttribute("mensaje", "PARAMETRO EN URL " + id);
        return "test";
    }

    @RequestMapping("guardar")
    public String guardarParamether(Model model,
            @RequestParam String nombres, @RequestParam String apellidos) {

        model.addAttribute("mensaje", nombres + " " + apellidos);
        return "test";
    }

    @RequestMapping("guardarDos")
    public String guardarAttribute(@ModelAttribute PersonaTest persona, Model model) {

        model.addAttribute("mensaje", persona.getNombres() + " " + persona.getApellidos());
        return "test";
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:id="@+id/loader"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.v7.widget.CardView
                android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="5dp"
        app:cardCornerRadius="4dp"
        app:cardElevation="3dp">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.elyeproj.loaderviewlibrary.LoaderImageView
        android:id="@+id/image_icon"
        android:layout_width="match_parent"
        android:layout_height="150dp"

        app:use_gradient="true" />

            <com.elyeproj.loaderviewlibrary.LoaderTextView
                 android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15sp"
                android:layout_margin="16dp"
                app:use_gradient="true"
                 />

            <com.elyeproj.loaderviewlibrary.LoaderTextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15sp"
                android:layout_margin="16dp"
                app:use_gradient="true"
                />
            <com.elyeproj.loaderviewlibrary.LoaderTextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15sp"
                android:layout_margin="16dp"
                app:use_gradient="true"
                />
            <com.elyeproj.loaderviewlibrary.LoaderTextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15sp"
                android:layout_margin="16dp"
                app:use_gradient="true"
                />
            <com.elyeproj.loaderviewlibrary.LoaderTextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="15sp"
                android:layout_margin="16dp"
                app:use_gradient="true"
                />

        </LinearLayout>
    </android.support.v7.widget.CardView>
</LinearLayout>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Collections.Specialized;
using System.Reflection;
using System.Configuration;
using System.Globalization;
using System.Data;
using System.Data.OleDb;

namespace SemanticInsight.Weave
{
    public class BimlScript
    {
        public string ConnectionString { get; set; }

        public BimlScript()
        {
            ConnectionString = ReadConnectionString("SemanticWeaveConnection");
        }

        public BimlScript(string connectionString)
        {
            ConnectionString = connectionString;
        }

        #region GetTableDefinition
        public string GetTableDefinitionBiml(string rootComponentApplicationName, string connectionName, string databaseName, bool withSourceObject)
        {
            return GetTableDefinitionBiml(rootComponentApplicationName, connectionName, databaseName, null, null, null, withSourceObject);
        }

        public string GetTableDefinitionBiml(string rootComponentApplicationName, string connectionName, string databaseName, string schemaName, bool withSourceObject)
        {
            return GetTableDefinitionBiml(rootComponentApplicationName, connectionName, databaseName, schemaName, null, null, withSourceObject);
        }

        public string GetTableDefinitionBiml(string rootComponentApplicationName, string connectionName, string databaseName)
        {
            return GetTableDefinitionBiml(rootComponentApplicationName, connectionName, databaseName, null, null, null, false);
        }

        public string GetTableDefinitionBiml(string rootComponentApplicationName, string connectionName, string databaseName, string schemaName)
        {
            return GetTableDefinitionBiml(rootComponentApplicationName, connectionName, databaseName, schemaName, null, null, false);
        }

        private string GetTableDefinitionBiml(string rootComponentApplicationName, string connectionName, string databaseName, string schemaName, string sourceSchemaName, string sourceDatabaseName, bool withSourceObject)
        {
            SqlConnection con = new SqlConnection(this.ConnectionString);
            SqlCommand cmd = new SqlCommand();
            string returnValue;
            try
            {
                cmd.CommandText = "[semanticinsight].[get_table_definition_biml]";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = con;

                cmd.Parameters.AddWithValue("@@root_component_application_name", rootComponentApplicationName);
                cmd.Parameters.AddWithValue("@@connection_name", connectionName);
                cmd.Parameters.AddWithValue("@@database_name", databaseName);
                if (schemaName != null)
                {
                    cmd.Parameters.AddWithValue("@@schema_name", schemaName);
                }
                if (sourceSchemaName != null)
                {
                    cmd.Parameters.AddWithValue("@@source_schema_name", sourceSchemaName);
                }
                if (sourceDatabaseName != null)
                {
                    cmd.Parameters.AddWithValue("@@source_database_name", sourceDatabaseName);
                }
                cmd.Parameters.AddWithValue("@@as_varchar", true);
                cmd.Parameters.AddWithValue("@@with_framework_attribute", !withSourceObject);
                cmd.Parameters.AddWithValue("@@with_source_object", withSourceObject);
                con.Open();

                returnValue = cmd.ExecuteScalar().ToString();

                con.Close();
            }
            catch (Exception ex)
            {
                throw new Exception("GetTableDefinitionBiml("
                    + "string rootComponentApplicationName=" + rootComponentApplicationName
                    + ", string connectionName=" + connectionName
                    + ", string databaseName=" + databaseName
                    + ", string schemaName =" + (schemaName == null ? "null" : schemaName)
                    + ", string schemaName =" + (sourceSchemaName == null ? "null" : sourceSchemaName)
                    + ", string schemaName =" + (sourceDatabaseName == null ? "null" : sourceDatabaseName)
                    + "): Error Occured ",
                    ex.InnerException);
            }
            finally
            {
                con.Dispose();
                cmd.Dispose();
            }
            return returnValue;
        }
        #endregion GetTableDefinition

        #region GetColunmList
        public string GetColumnList(string rootComponentApplicationName, string schemaName, string dataObjectName, string bimlColumnList)
        {
            string ret = bimlColumnList;
            List<Tuple<string, string>> conversions = GetDefaultAttributesConversions(rootComponentApplicationName, schemaName, dataObjectName);
            foreach (var i in conversions)
            {
                string name = "[" + i.Item1 + "]";
                string conv = i.Item2;
                ret = ret.Replace(name, conv);
            }
            return ret;
        }
        #endregion GetColumnList

        private List<Tuple<string, string>> GetDefaultAttributesConversions(string rootComponentApplicationName, string schemaName, string dataObjectName)
        {
            SqlConnection con = new SqlConnection(this.ConnectionString);
            SqlCommand cmd = new SqlCommand();
            List<Tuple<string, string>> result = null;
            try
            {
                cmd.CommandText = "[semanticinsight].[get_default_attribute_conversions]";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = con;

                cmd.Parameters.AddWithValue("@@root_component_application_name", rootComponentApplicationName);
                cmd.Parameters.AddWithValue("@@schema_name", schemaName);
                cmd.Parameters.AddWithValue("@@data_object_name", dataObjectName);

                result = new List<Tuple<string, string>>();
                using (con)
                {
                    con.Open();
                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            Tuple<string, string> r = new Tuple<string, string>(Convert.ToString(reader["data_attribute_name"]), Convert.ToString(reader["data_attribute_conversion"]));
                            result.Add(r);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("GetDefaultAttributesConversions("
                    + "string rootComponentApplicationName=" + rootComponentApplicationName
                    + ", string schemaName=" + schemaName
                    + ", string dataObjectName=" + dataObjectName
                    + "): Error Occured ",
                    ex.InnerException);
            }
            finally
            {
                con.Dispose();
                cmd.Dispose();
            }
            return result;
        }

        private bool HasDefaultAttributeConversion(string rootComponentApplicationName, string schemaName, string dataObjectName)
        {
            SqlConnection con = new SqlConnection(this.ConnectionString);
            SqlCommand cmd = new SqlCommand();
            bool returnValue;
            try
            {
                cmd.CommandText = "[semanticinsight].[has_default_attribute_conversion]";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = con;

                cmd.Parameters.AddWithValue("@@root_component_application_name", rootComponentApplicationName);
                cmd.Parameters.AddWithValue("@@schema_name", schemaName);
                cmd.Parameters.AddWithValue("@@data_object_name", dataObjectName);

                con.Open();

                returnValue = (bool)cmd.ExecuteScalar();

                con.Close();
            }
            catch (Exception ex)
            {
                throw new Exception("HasDefaultAttributeConversion("
                    + "string rootComponentApplicationName=" + rootComponentApplicationName
                    + ", string schemaName=" + schemaName
                    + ", string dataObjectName=" + dataObjectName
                    + "): Error Occured ",
                    ex.InnerException);
            }
            finally
            {
                con.Dispose();
                cmd.Dispose();
            }
            return returnValue;
        }

        public void MapDataAttributes(
            string rootComponentApplicationName,
            string sourceComponentApplicationName,
            string destinationComponentApplicationName,
            string sourceDataSchemaName,
            string destinationDataSchemaName,
            string sourceDataObjectName,
            string destinationDataObjectName,
            bool mapAttributesOnName)
        {
            SqlConnection con = new SqlConnection(this.ConnectionString);
            SqlCommand cmd = new SqlCommand();

            try
            {
                cmd.CommandText = "[semanticinsight].[map_data_attributes]";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = con;

                cmd.Parameters.AddWithValue("@@root_component_application_name", rootComponentApplicationName);
                cmd.Parameters.AddWithValue("@@source_component_application_name", sourceComponentApplicationName);
                cmd.Parameters.AddWithValue("@@destination_component_application_name", destinationComponentApplicationName);
                cmd.Parameters.AddWithValue("@@source_data_schema_name", sourceDataSchemaName);
                cmd.Parameters.AddWithValue("@@destination_data_schema_name", destinationDataSchemaName);
                cmd.Parameters.AddWithValue("@@source_data_object_name", sourceDataObjectName);
                cmd.Parameters.AddWithValue("@@destination_data_object_name", destinationDataObjectName);
                cmd.Parameters.AddWithValue("@@map_attributes_on_name", mapAttributesOnName);
                cmd.Parameters.AddWithValue("@@return_id", false);

                con.Open();

                cmd.ExecuteNonQuery();

                con.Close();
            }
            catch (Exception ex)
            {
                throw new Exception("MapDataAttributes("
                    + "string rootComponentApplicationName=" + rootComponentApplicationName
                    + ", string sourceComponentApplicationName=" + sourceComponentApplicationName
                    + ", string destinationComponentApplicationName=" + destinationComponentApplicationName
                    + ", string sourceDataSchemaName=" + sourceDataSchemaName
                    + ", string destinationDataSchemaName=" + destinationDataSchemaName
                    + ", string sourceDataObjectName=" + sourceDataObjectName
                    + ", string destinationDataObjectName=" + destinationDataObjectName
                    + ", bool mapAttributesOnName=" + mapAttributesOnName.ToString()
                    + "): Error Occured ",
                    ex.InnerException);
            }
            finally
            {
                con.Dispose();
                cmd.Dispose();
            }
        }

        private string ReadConnectionString(string key)
        {
            //Open the configuration file using the dll location
            string l = this.GetType().Assembly.Location;
            System.Configuration.Configuration myDllConfig = ConfigurationManager.OpenExeConfiguration(l);
            AppSettingsSection myDllConfigAppSettings = (AppSettingsSection)myDllConfig.GetSection("appSettings");
            // return the desired field
            return myDllConfigAppSettings.Settings[key].Value;

        }
    }
}


text:
#pragma once
#include <aws/iam/IAM_EXPORTS.h>
#include <aws/core/utils/Array.h>
#include <aws/iam/model/ReportFormatType.h>
#include <aws/core/utils/DateTime.h>
#include <aws/iam/model/ResponseMetadata.h>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Xml
{
  class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace IAM
{
namespace Model
{
  /**
   *
Contains the response to a successful GetCredentialReport request.
   *

   */
  class AWS_IAM_API GetCredentialReportResult
  {
  public:
    GetCredentialReportResult();
    GetCredentialReportResult(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
    GetCredentialReportResult& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);

    /**
     *
Contains the credential report. The report is Base64-encoded.

     */
    inline const Aws::Utils::ByteBuffer& GetContent() const{ return m_content; }

    /**
     *
Contains the credential report. The report is Base64-encoded.

     */
    inline void SetContent(const Aws::Utils::ByteBuffer& value) { m_content = value; }

    /**
     *
Contains the credential report. The report is Base64-encoded.

     */
    inline void SetContent(Aws::Utils::ByteBuffer&& value) { m_content = value; }

    /**
     *
Contains the credential report. The report is Base64-encoded.

     */
    inline GetCredentialReportResult& WithContent(const Aws::Utils::ByteBuffer& value) { SetContent(value); return *this;}

    /**
     *
Contains the credential report. The report is Base64-encoded.

     */
    inline GetCredentialReportResult& WithContent(Aws::Utils::ByteBuffer&& value) { SetContent(value); return *this;}

    /**
     *
The format (MIME type) of the credential report.

     */
    inline const ReportFormatType& GetReportFormat() const{ return m_reportFormat; }

    /**
     *
The format (MIME type) of the credential report.

     */
    inline void SetReportFormat(const ReportFormatType& value) { m_reportFormat = value; }

    /**
     *
The format (MIME type) of the credential report.

     */
    inline void SetReportFormat(ReportFormatType&& value) { m_reportFormat = value; }

    /**
     *
The format (MIME type) of the credential report.

     */
    inline GetCredentialReportResult& WithReportFormat(const ReportFormatType& value) { SetReportFormat(value); return *this;}

    /**
     *
The format (MIME type) of the credential report.

     */
    inline GetCredentialReportResult& WithReportFormat(ReportFormatType&& value) { SetReportFormat(value); return *this;}

    /**
     *
 The date and time when the credential report was created, in ISO 8601 date-time format.

     */
    inline const Aws::Utils::DateTime& GetGeneratedTime() const{ return m_generatedTime; }

    /**
     *
 The date and time when the credential report was created, in ISO 8601 date-time format.

     */
    inline void SetGeneratedTime(const Aws::Utils::DateTime& value) { m_generatedTime = value; }

    /**
     *
 The date and time when the credential report was created, in ISO 8601 date-time format.

     */
    inline void SetGeneratedTime(Aws::Utils::DateTime&& value) { m_generatedTime = value; }

    /**
     *
 The date and time when the credential report was created, in ISO 8601 date-time format.

     */
    inline GetCredentialReportResult& WithGeneratedTime(const Aws::Utils::DateTime& value) { SetGeneratedTime(value); return *this;}

    /**
     *
 The date and time when the credential report was created, in ISO 8601 date-time format.

     */
    inline GetCredentialReportResult& WithGeneratedTime(Aws::Utils::DateTime&& value) { SetGeneratedTime(value); return *this;}

    inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }

    inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; }

    inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = value; }

    inline GetCredentialReportResult& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}

    inline GetCredentialReportResult& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(value); return *this;}

  private:
    Aws::Utils::ByteBuffer m_content;
    ReportFormatType m_reportFormat;
    Aws::Utils::DateTime m_generatedTime;
    ResponseMetadata m_responseMetadata;
  };

} // namespace Model
} // namespace IAM
} // namespace Aws


text:
package com.brewerydb.api.model;

public class Hop {

    private Integer id;
    private String name;
    private String description;
    private String countryOfOrigin;
    private String alphaAcidMin;
    private Double alphaAcidMax;
    private Double betaAcidMin;
    private Double betaAcidMax;
    private Double humuleneMin;
    private Double humuleneMax;
    private Double caryophylleneMin;
    private Double caryophylleneMax;
    private Double cohumuloneMin;
    private Double cohumuloneMax;
    private Double myrceneMin;
    private Double myrceneMax;
    private Double farneseneMin;
    private Double farneseneMax;
    private Boolean isNoble;
    private Boolean forBittering;
    private Boolean forFlavor;
    private Boolean forAroma;
    private String category;
    private String categoryDisplay;
    private Country country;

    /**
     * The unique id of the hop.
     */
    public Integer getId() {
        return id;
    }

    /**
     * The name of the hop.
     */
    public String getName() {
        return name;
    }

    /**
     * The description of the hop.
     */
    public String getDescription() {
        return description;
    }

    /**
     * The two-letter ISO country code. For the complete country name and information, see the country field.
     */
    public String getCountryOfOrigin() {
        return countryOfOrigin;
    }

    /**
     * The minimum value for the typical range of alpha acids in the hop.
     */
    public String getAlphaAcidMin() {
        return alphaAcidMin;
    }

    /**
     * The maximum value for the typical range of alpha acids in the hop.
     */
    public Double getAlphaAcidMax() {
        return alphaAcidMax;
    }

    /**
     * The minimum value for the typical range of beta acids in the hop.
     */
    public Double getBetaAcidMin() {
        return betaAcidMin;
    }

    /**
     * The maxiumum value for the typical range of beta acids in the hop.
     */
    public Double getBetaAcidMax() {
        return betaAcidMax;
    }

    /**
     * The minimum value for the typical range of humulene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getHumuleneMin() {
        return humuleneMin;
    }

    /**
     * The maximum value for the typical range of humulene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getHumuleneMax() {
        return humuleneMax;
    }

    /**
     * The minimum value for the typical range of caryophyllene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getCaryophylleneMin() {
        return caryophylleneMin;
    }

    /**
     * The maximum value for the typical range of caryophyllene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getCaryophylleneMax() {
        return caryophylleneMax;
    }

    /**
     * The minimum value for the typical range of cohumulone in the hop. Expressed as a percentage of the alpha acids.
     */
    public Double getCohumuloneMin() {
        return cohumuloneMin;
    }

    /**
     * The maximum value for the typical range of cohumulone in the hop. Expressed as a percentage of the alpha acids.
     */
    public Double getCohumuloneMax() {
        return cohumuloneMax;
    }

    /**
     * The minimum value for the typical range of myrcene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getMyrceneMin() {
        return myrceneMin;
    }

    /**
     * The maximum value for the typical range of myrcene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getMyrceneMax() {
        return myrceneMax;
    }

    /**
     * The minimum value for the typical range of farnesene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getFarneseneMin() {
        return farneseneMin;
    }

    /**
     * The maximum value for the typical range of farnesene in the hop. Expressed as a percentage of the total oils.
     */
    public Double getFarneseneMax() {
        return farneseneMax;
    }

    /**
     * This is set to Y if the hop is a noble hop.
     */
    public Boolean getNoble() {
        return isNoble;
    }

    /**
     * Set to Y if the hop is typically used for bittering.
     */
    public Boolean getForBittering() {
        return forBittering;
    }

    /**
     * Set to Y if the hop is typically used for its flavor.
     */
    public Boolean getForFlavor() {
        return forFlavor;
    }

    /**
     * Set to Y if the hop is typically used for its aroma.
     */
    public Boolean getForAroma() {
        return forAroma;
    }

    /**
     * This value will always be set to "hop".
     */
    public String getCategory() {
        return category;
    }

    /**
     * This value will always be set to "Hops".
     */
    public String getCategoryDisplay() {
        return categoryDisplay;
    }

    /**
     * This is an object that provides more information about the country matching the hop's countryOfOrigin value.
     */
    public Country getCountry() {
        return country;
    }
}


text:
import { dispatch, dispatchAsync } from '../dispatcher/ActorAppDispatcher';
import ActorClient from '../utils/ActorClient';
import history from '../utils/history';
import PeerUtils from '../utils/PeerUtils';

import { ActionTypes } from '../constants/ActorAppConstants';
import ComposeActionCreators from '../actions/ComposeActionCreators';

import loading from '../utils/DataLoading';

const CreateGroupActionCreators = {
  open() {
    dispatch(ActionTypes.GROUP_CREATE_MODAL_SHOW);
    ComposeActionCreators.toggleAutoFocus(false);
  },

  close() {
    dispatch(ActionTypes.GROUP_CREATE_MODAL_HIDE);
    ComposeActionCreators.toggleAutoFocus(true);
  },

  openInDialog() {
    dispatch(ActionTypes.GROUP_CREATE_MODAL_SHOW);
    dispatch(ActionTypes.GROUP_CREATE_OPEN_IN_DIALOG);
    ComposeActionCreators.toggleAutoFocus(false);
  },

  setGroupName(name) {
    dispatch(ActionTypes.GROUP_CREATE_SET_NAME, { name });
  },

  setGroupSearch(search) {
    dispatch(ActionTypes.GROUP_CREATE_SET_SEARCH, { search });
  },

  setSelectedUserIds(selectedUserIds) {
    dispatch(ActionTypes.GROUP_CREATE_SET_MEMBERS, { selectedUserIds });
  },

  createGroup(title, avatar, memberIds) {
    loading('show');
    const createGroup = () => dispatchAsync(ActorClient.createGroup(title, avatar, memberIds), {
      request: ActionTypes.GROUP_CREATE,
      success: ActionTypes.GROUP_CREATE_SUCCESS,
      failure: ActionTypes.GROUP_CREATE_ERROR
    }, { title, avatar, memberIds });

    const openCreatedGroup = (peer) => history.push(`/im/${PeerUtils.peerToString(peer)}`);

    createGroup()
      .then(openCreatedGroup)
      .then(() => {this.close(); loading('hide');})
  }
};

export default CreateGroupActionCreators;


text:
OUTPUTFILE=$1
INPUTFILE=$2

if [ -z "$INPUTFILE" -o -z "$OUTPUTFILE" ]; then
   echo "Usage: $0 <outputfilename> <inputfilename>"
   exit 1
fi

OUTPUTDIR=`dirname "$OUTPUTFILE"`

if [ -d $OUTPUTDIR ]; then
   filebase=`basename "$INPUTFILE"`
   extension=${filebase##*.}
   lowerextension=`echo "$extension"|tr A-Z a-z`

   # Determine what the file type/extension/converter to use is
   case "$lowerextension" in
      doc|docx|dotm|odt|rtf|wpd)
         converter='/usr/bin/lowriter'
         ;;
      xls|xlsx|xlsm|ods|tsv|csv)
         converter='/usr/bin/localc'
         ;;
      ppt|pptx|pptm|pps|ppsx|odp)
         converter='/usr/bin/loimpress'
         ;;
      vsd)
         converter='/usr/bin/lodraw'
         ;;
      xps|opxs) converter='/usr/bin/xpstopdf'
         extension=xps
         ;;
      md|markdown) converter='/usr/local/bin/markdown2pdf.sh'
         extension=markdown
         ;;
      *) converter='/usr/local/bin/image2pdf.sh'
         extension=other
         ;;
   esac

   if [ "x$extension" = "xother" ]; then
      $converter "$OUTPUTFILE" "$INPUTFILE"
   elif [ "x$extension" = "xmarkdown" ]; then
      $converter "$OUTPUTFILE" "$INPUTFILE"
   elif [ "x$extension" = "xxps" ]; then
      $converter "$INPUTFILE" "$OUTPUTFILE"
   else
      CONVERTED_FILE=$OUTPUTDIR/`basename "$INPUTFILE" .$extension`.pdf

      echo "Converting '$INPUTFILE' to '$OUTPUTFILE' using $converter"

      $converter --headless --convert-to pdf:writer_pdf_Export --outdir "$OUTPUTDIR" "$INPUTFILE"

      # LibreOffice can be wierd
      if [ -s "$CONVERTED_FILE" -a "x$CONVERTED_FILE" != "x$OUTPUTFILE" ]; then
         cp "$CONVERTED_FILE" "$OUTPUTFILE"
      fi

      rm -f "$CONVERTED_FILE"
   fi

   if [ ! -s "$OUTPUTFILE" ]; then
      echo "Conversion of '$INPUTFILE' to '$OUTPUTFILE' failed!"
      exit 1
   fi
else
   echo "Unable to create temporary directory, giving up!"
   exit 1
fi

exit 0


text:
namespace inet {

Register_Class(IPv4Route);
Register_Class(IPv4MulticastRoute);

IPv4Route::~IPv4Route()
{
}

std::string IPv4Route::info() const
{
    std::stringstream out;

    out << "dest:";
    if (dest.isUnspecified())
        out << "*  ";
    else
        out << dest << "  ";
    out << "gw:";
    if (gateway.isUnspecified())
        out << "*  ";
    else
        out << gateway << "  ";
    out << "mask:";
    if (netmask.isUnspecified())
        out << "*  ";
    else
        out << netmask << "  ";
    out << "metric:" << metric << " ";
    out << "if:";
    if (!interfacePtr)
        out << "*";
    else
        out << interfacePtr->getName();
    if (interfacePtr && interfacePtr->ipv4Data())
        out << "(" << interfacePtr->ipv4Data()->getIPAddress() << ")";
    out << "  ";
    out << (gateway.isUnspecified() ? "DIRECT" : "REMOTE");
    out << " " << IRoute::sourceTypeName(sourceType);

#ifdef WITH_AODV
    if (dynamic_cast<AODVRouteData *>(protocolData)) {
        AODVRouteData *data = (AODVRouteData *)protocolData;
        out << data;
    }
#endif // ifdef WITH_AODV
    return out.str();
}

std::string IPv4Route::detailedInfo() const
{
    return std::string();
}

bool IPv4Route::equals(const IPv4Route& route) const
{
    return rt == route.rt && dest == route.dest && netmask == route.netmask && gateway == route.gateway &&
           interfacePtr == route.interfacePtr && sourceType == route.sourceType && metric == route.metric;
}

const char *IPv4Route::getInterfaceName() const
{
    return interfacePtr ? interfacePtr->getName() : "";
}

void IPv4Route::changed(int fieldCode)
{
    if (rt)
        rt->routeChanged(this, fieldCode);
}

IRoutingTable *IPv4Route::getRoutingTableAsGeneric() const
{
    return getRoutingTable();
}

IPv4MulticastRoute::~IPv4MulticastRoute()
{
    delete inInterface;
    for (OutInterfaceVector::iterator it = outInterfaces.begin(); it != outInterfaces.end(); ++it)
        delete *it;
    outInterfaces.clear();
}

std::string IPv4MulticastRoute::info() const
{
    std::stringstream out;

    out << "origin:";
    if (origin.isUnspecified())
        out << "*  ";
    else
        out << origin << "  ";
    out << "mask:";
    if (originNetmask.isUnspecified())
        out << "*  ";
    else
        out << originNetmask << "  ";
    out << "group:";
    if (group.isUnspecified())
        out << "*  ";
    else
        out << group << "  ";
    out << "metric:" << metric << " ";
    out << "in:";
    if (!inInterface)
        out << "*  ";
    else
        out << inInterface->getInterface()->getName() << "  ";
    out << "out:";
    bool first = true;
    for (unsigned int i = 0; i < outInterfaces.size(); ++i) {
        if (!first)
            out << ",";
        if (outInterfaces[i]->isEnabled()) {
            out << outInterfaces[i]->getInterface()->getName();
            first = false;
        }
    }

    out << " " << IMulticastRoute::sourceTypeName(sourceType);

    return out.str();
}

std::string IPv4MulticastRoute::detailedInfo() const
{
    return info();
}

void IPv4MulticastRoute::setInInterface(InInterface *_inInterface)
{
    if (inInterface != _inInterface) {
        delete inInterface;
        inInterface = _inInterface;
        changed(F_IN);
    }
}

void IPv4MulticastRoute::clearOutInterfaces()
{
    if (!outInterfaces.empty()) {
        for (OutInterfaceVector::iterator it = outInterfaces.begin(); it != outInterfaces.end(); ++it)
            delete *it;
        outInterfaces.clear();
        changed(F_OUT);
    }
}

IRoutingTable *IPv4MulticastRoute::getRoutingTableAsGeneric() const
{
    return getRoutingTable();
}

void IPv4MulticastRoute::addOutInterface(OutInterface *outInterface)
{
    ASSERT(outInterface);

    OutInterfaceVector::iterator it;
    for (it = outInterfaces.begin(); it != outInterfaces.end(); ++it) {
        if ((*it)->getInterface() == outInterface->getInterface())
            break;
    }

    if (it != outInterfaces.end()) {
        delete *it;
        *it = outInterface;
        changed(F_OUT);
    }
    else {
        outInterfaces.push_back(outInterface);
        changed(F_OUT);
    }
}

bool IPv4MulticastRoute::removeOutInterface(const InterfaceEntry *ie)
{
    for (OutInterfaceVector::iterator it = outInterfaces.begin(); it != outInterfaces.end(); ++it) {
        if ((*it)->getInterface() == ie) {
            delete *it;
            outInterfaces.erase(it);
            changed(F_OUT);
            return true;
        }
    }
    return false;
}

void IPv4MulticastRoute::removeOutInterface(unsigned int i)
{
    OutInterface *outInterface = outInterfaces.at(i);
    delete outInterface;
    outInterfaces.erase(outInterfaces.begin() + i);
    changed(F_OUT);
}

void IPv4MulticastRoute::changed(int fieldCode)
{
    if (rt)
        rt->multicastRouteChanged(this, fieldCode);
}

} // namespace inet


text:
import itertools

def groupper(iterable, n, fillvalue=None):
    args = [iter(iterable)] * n
    return itertools.zip_longest(fillvalue=None, *args)

def gen():
    for ii in range(10, 32):
        yield ii

for n in groupper(gen(), 5):
    print(list(n))


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example.cmis</groupId>
    <artifactId>server</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <opencmis.version>1.1.0</opencmis.version>
    </properties>

    <name>Your OpenCMIS Server</name>

    <build>
        <plugins>
            <plugin>
                <inherited>true</inherited>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <target>1.7</target>
                    <source>1.7</source>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <overlays>
                        <overlay></overlay>
                        <overlay>
                            <groupId>org.apache.chemistry.opencmis</groupId>
                            <artifactId>chemistry-opencmis-server-bindings-war</artifactId>
                            <excludes>
                                <!-- exclude everything you don't need -->
                                <exclude>index.html</exclude> <!-- default index page -->
                                <exclude>css/**</exclude> <!-- CSS for the default index page -->
                                <exclude>images/**</exclude> <!-- images for the default index page -->
                                <exclude>web/**</exclude> <!-- sample JavaScript application -->
                                <exclude>WEB-INF/classes/sample-repository.properties</exclude> <!-- sample server properties file -->
                                <exclude>WEB-INF/token/**</exclude> <!-- sample Browser Binding token implementation -->
                            </excludes>
                            <includes>
                                <include>**</include>
                                <include>META-INF/THIRD-PARTY-LICENSES</include>
                            </includes>
                        </overlay>
                    </overlays>
                    <archive>
                        <manifestEntries>
                            <DisableIBMJAXWSEngine>true</DisableIBMJAXWSEngine>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.chemistry.opencmis</groupId>
            <artifactId>chemistry-opencmis-server-bindings-war</artifactId>
            <version>${opencmis.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.apache.chemistry.opencmis</groupId>
            <artifactId>chemistry-opencmis-server-support</artifactId>
            <version>${opencmis.version}</version>
        </dependency>
        <!-- Uncomment for CORS support
        <dependency>
            <groupId>com.thetransactioncompany</groupId>
            <artifactId>cors-filter</artifactId>
            <version>2.1.2</version>
        </dependency>
        -->
        <dependency><!-- for development only -->
            <groupId>org.apache.chemistry.opencmis</groupId>
            <artifactId>chemistry-opencmis-server-bindings</artifactId>
            <version>${opencmis.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency><!-- for development only -->
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency><!-- enables OpenCMIS frame logging to log4j -->
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.21</version>
        </dependency>
        <dependency>
  			<groupId>org.apache.pdfbox</groupId>
  			<artifactId>pdfbox</artifactId>
  			<version>1.8.6</version>
		</dependency>
    </dependencies>

</project>


text:
using blink::WebDocumentLoader;
using blink::WebInputElement;
using blink::WebFormControlElement;
using blink::WebFormElement;

namespace autofill {

using mojom::SubmissionSource;

FormTracker::FormTracker(content::RenderFrame* render_frame)
    : content::RenderFrameObserver(render_frame) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
}

FormTracker::~FormTracker() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  ResetLastInteractedElements();
}

void FormTracker::AddObserver(Observer* observer) {
  DCHECK(observer);
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  observers_.AddObserver(observer);
}

void FormTracker::RemoveObserver(Observer* observer) {
  DCHECK(observer);
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  observers_.RemoveObserver(observer);
}

void FormTracker::AjaxSucceeded() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  FireSubmissionIfFormDisappear(SubmissionSource::XHR_SUCCEEDED);
}

void FormTracker::TextFieldDidChange(const WebFormControlElement& element) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  DCHECK(ToWebInputElement(&element) || form_util::IsTextAreaElement(element));

  if (ignore_control_changes_)
    return;

  // If the element isn't focused then the changes don't matter. This check is
  // required to properly handle IME interactions.
  if (!element.Focused())
    return;

  const WebInputElement* input_element = ToWebInputElement(&element);
  if (!input_element)
    return;

  // Disregard text changes that aren't caused by user gestures or pastes. Note
  // that pastes aren't necessarily user gestures because Blink's conception of
  // user gestures is centered around creating new windows/tabs.
  if (user_gesture_required_ &&
      !render_frame()->GetWebFrame()->HasTransientUserActivation() &&
      !render_frame()->IsPasting())
    return;

  // We post a task for doing the Autofill as the caret position is not set
  // properly at this point (http://bugs.webkit.org/show_bug.cgi?id=16976) and
  // it is needed to trigger autofill.
  weak_ptr_factory_.InvalidateWeakPtrs();
  render_frame()
      ->GetWebFrame()
      ->GetTaskRunner(blink::TaskType::kInternalUserInteraction)
      ->PostTask(FROM_HERE,
                 base::BindRepeating(
                     &FormTracker::FormControlDidChangeImpl,
                     weak_ptr_factory_.GetWeakPtr(), element,
                     Observer::ElementChangeSource::TEXTFIELD_CHANGED));
}

void FormTracker::SelectControlDidChange(const WebFormControlElement& element) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);

  if (ignore_control_changes_)
    return;

  // Post a task to avoid processing select control change while it is changing.
  weak_ptr_factory_.InvalidateWeakPtrs();
  render_frame()
      ->GetWebFrame()
      ->GetTaskRunner(blink::TaskType::kInternalUserInteraction)
      ->PostTask(FROM_HERE, base::BindRepeating(
                                &FormTracker::FormControlDidChangeImpl,
                                weak_ptr_factory_.GetWeakPtr(), element,
                                Observer::ElementChangeSource::SELECT_CHANGED));
}

void FormTracker::FireProbablyFormSubmittedForTesting() {
  FireProbablyFormSubmitted();
}

void FormTracker::FormControlDidChangeImpl(
    const WebFormControlElement& element,
    Observer::ElementChangeSource change_source) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  // Render frame could be gone as this is the post task.
  if (!render_frame()) return;

  if (element.Form().IsNull()) {
    last_interacted_formless_element_ = element;
  } else {
    last_interacted_form_ = element.Form();
  }

  for (auto& observer : observers_) {
    observer.OnProvisionallySaveForm(element.Form(), element, change_source);
  }
}

void FormTracker::DidCommitProvisionalLoad(bool is_same_document_navigation,
                                           ui::PageTransition transition) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  if (!is_same_document_navigation) {
    ResetLastInteractedElements();
    return;
  }

  FireSubmissionIfFormDisappear(SubmissionSource::SAME_DOCUMENT_NAVIGATION);
}

void FormTracker::DidStartNavigation(
    const GURL& url,
    base::Optional<blink::WebNavigationType> navigation_type) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame();
  // Ony handle main frame.
  if (navigated_frame->Parent())
    return;

  // Bug fix for crbug.com/368690. isProcessingUserGesture() is false when
  // the user is performing actions outside the page (e.g. typed url,
  // history navigation). We don't want to trigger saving in these cases.

  // We are interested only in content-initiated navigations. Explicit browser
  // initiated navigations (e.g. via omnibox) don't have a navigation type
  // and are discarded here.
  if (navigation_type.has_value() &&
      navigation_type.value() != blink::kWebNavigationTypeLinkClicked) {
    FireProbablyFormSubmitted();
  }
}

void FormTracker::FrameDetached() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  FireInferredFormSubmission(SubmissionSource::FRAME_DETACHED);
}

void FormTracker::WillSendSubmitEvent(const WebFormElement& form) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  last_interacted_form_ = form;
  for (auto& observer : observers_) {
    observer.OnProvisionallySaveForm(
        form, blink::WebFormControlElement(),
        Observer::ElementChangeSource::WILL_SEND_SUBMIT_EVENT);
  }
}

void FormTracker::WillSubmitForm(const WebFormElement& form) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  FireFormSubmitted(form);
}

void FormTracker::OnDestruct() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  ResetLastInteractedElements();
}

void FormTracker::FireFormSubmitted(const blink::WebFormElement& form) {
  for (auto& observer : observers_)
    observer.OnFormSubmitted(form);
  ResetLastInteractedElements();
}

void FormTracker::FireProbablyFormSubmitted() {
  for (auto& observer : observers_)
    observer.OnProbablyFormSubmitted();
  ResetLastInteractedElements();
}

void FormTracker::FireInferredFormSubmission(SubmissionSource source) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
  for (auto& observer : observers_)
    observer.OnInferredFormSubmission(source);
  ResetLastInteractedElements();
}

void FormTracker::FireSubmissionIfFormDisappear(SubmissionSource source) {
  if (CanInferFormSubmitted()) {
    FireInferredFormSubmission(source);
    return;
  }
  TrackElement();
}

bool FormTracker::CanInferFormSubmitted() {
  // If last interacted form is available, assume form submission only if the
  // form is now gone, either invisible or removed from the DOM.
  // Otherwise (i.e., there is no form tag), we check if the last element the
  // user has interacted with are gone, to decide if submission has occurred.
  if (!last_interacted_form_.IsNull())
    return !form_util::AreFormContentsVisible(last_interacted_form_);
  else if (!last_interacted_formless_element_.IsNull())
    return !form_util::IsWebElementVisible(last_interacted_formless_element_);

  return false;
}

void FormTracker::TrackElement() {
  // Already has observer for last interacted element.
  if (form_element_observer_)
    return;
  auto callback = base::BindOnce(&FormTracker::ElementWasHiddenOrRemoved,
                                 base::Unretained(this));

  if (!last_interacted_form_.IsNull()) {
    form_element_observer_ = blink::WebFormElementObserver::Create(
        last_interacted_form_, std::move(callback));
  } else if (!last_interacted_formless_element_.IsNull()) {
    form_element_observer_ = blink::WebFormElementObserver::Create(
        last_interacted_formless_element_, std::move(callback));
  }
}

void FormTracker::ResetLastInteractedElements() {
  last_interacted_form_.Reset();
  last_interacted_formless_element_.Reset();
  if (form_element_observer_) {
    form_element_observer_->Disconnect();
    form_element_observer_ = nullptr;
  }
}

void FormTracker::ElementWasHiddenOrRemoved() {
  FireInferredFormSubmission(SubmissionSource::DOM_MUTATION_AFTER_XHR);
}

}  // namespace autofill