text:
require 'spec_helper'

describe Everything::Blog::Remote::BinaryFile do
  include_context 'with fake output media'
  include_context 'with mock fog'

  let(:binary_file) do
    described_class.new(given_output_file)
  end
  let(:given_output_file) do
    fake_output_media
  end

  describe '#initialize' do
    it 'sets the output_file to the given output file' do
      expect(binary_file.output_file).to eq(given_output_file)
    end
  end

  describe '#content' do
    before do
      allow(given_output_file)
        .to receive(:content)
        .and_return("This content's completely fake and should not be trusted.")
    end

    it "is the output file's content" do
      expect(binary_file.content).to eq(given_output_file.content)
    end
  end

  describe '#content_hash' do
    subject { binary_file.content_hash }

    let(:md5_double) { instance_double(Digest::MD5) }

    before do
      allow(Digest::MD5)
        .to receive(:new)
        .and_return(md5_double)
      allow(md5_double)
        .to receive(:hexdigest)
    end

    it 'uses the md5 library to do a hexdigest' do
      subject

      expect(md5_double)
        .to have_received(:hexdigest)
        .with(binary_file.content)
    end

    it 'returns the md5 hash' do
      fake_hash = 'defn0tah4sh'

      allow(md5_double)
        .to receive(:hexdigest)
        .and_return(fake_hash)
      expect(subject).to eq(fake_hash)
    end
  end

  describe '#content_type' do
    it "is equal to the output file's content_type" do
      expect(binary_file.content_type).to eq(given_output_file.content_type)
    end
  end

  describe '#local_file_is_different?' do
    subject { binary_file.local_file_is_different? }

    context 'when the bucket does not exist' do
      include_context 'with fake aws env vars'

      it 'returns true' do
        expect(subject).to eq(true)
      end
    end

    context 'when the bucket does exist' do
      include_context 'with mock bucket in s3'

      context 'when remote file does not exist' do
        it 'is true' do
          expect(subject).to eq(true)
        end
      end

      context 'when remote file does exist' do
        include_context 'with fake binary file in s3'

        context 'and has a different hash than the current content' do
          before do
            allow(binary_file)
              .to receive(:content_hash)
              .and_return(mock_binary_file.etag.reverse)
          end

          it 'is true' do
            expect(subject).to eq(true)
          end
        end

        context 'and has the same hash as the current content' do
          before do
            allow(binary_file)
              .to receive(:content_hash)
              .and_return(mock_binary_file.etag)
          end

          it 'is false' do
            expect(subject).to eq(false)
          end
        end
      end
    end
  end

  describe '#send' do
    subject { binary_file.send }

    context 'when the bucket does not exist' do
      include_context 'with fake aws env vars'

      it 'returns nil' do
        expect(subject).to be_nil
      end
    end

    context 'when the bucket does exist' do
      include_context 'with mock bucket in s3'

      let(:s3_bucket) { Everything::Blog::S3Bucket.new }
      let(:actual_file) do
        s3_bucket
          .files
          .get(binary_file.remote_key)
      end

      context 'when the remote file does not exist' do
        # Note: Files from the list don't return all info that getting a
        # particular file will, as noted here:
        # https://stackoverflow.com/questions/17579118/set-content-type-of-fog-storage-files-on-s3#comment25803126_17657441
        # If we want to check the file's content_type, then we need to get that
        # file individually.
        let(:first_file) { s3_bucket.files.first }

        after do
          actual_file.destroy
        end

        it 'creates a file in the s3 bucket' do
          expect(s3_bucket.files).to be_empty
          subject
          expect(s3_bucket.files.reload).not_to be_empty
        end

        it 'creates the file with the right body' do
          subject

          expect(actual_file.body).to eq(binary_file.content)
        end

        it 'creates the file with the right content_type' do
          subject

          expect(actual_file.content_type).to eq(binary_file.content_type)
        end
      end

      context 'when the remote file does exist' do
        let(:midnight_utc) { Time.parse("2019-03-24 00:00:00 UTC") }
        let(:noon_utc) { Time.parse("2019-03-24 12:00:00 UTC") }
        before do
          Timecop.freeze(midnight_utc)

          mock_binary_file
        end

        # Note: Include the fake file after faking the time.
        include_context 'with fake binary file in s3'

        after do
          Timecop.return
        end

        context 'when the local file is the same' do
          before do
            allow(binary_file)
              .to receive(:content)
              .and_return(mock_binary_data)

            Timecop.freeze(noon_utc)
          end

          it "does not change the remote file's last modified time" do
            expect(actual_file.last_modified).to eq(midnight_utc)

            subject

            expect(actual_file.reload.last_modified).to eq(midnight_utc)
          end
        end

        context 'when the local file is different' do
          let(:updated_content) { mock_binary_data.reverse }
          let(:modified_file) do
            s3_bucket
              .files
              .reload
              .get(binary_file.remote_key)
          end

          before do
            allow(binary_file)
              .to receive(:content)
              .and_return(updated_content)
            allow(binary_file)
              .to receive(:local_file_is_different?)
              .and_return(true)

            Timecop.freeze(noon_utc)
          end

          it "changes the remote file's last modified time" do
            expect(actual_file.last_modified).to eq(midnight_utc)

            subject

            expect(modified_file.last_modified).to eq(noon_utc)
          end

          it "changes the remote file's body" do
            expect(actual_file.body).to eq(mock_binary_data)

            subject

            expect(modified_file.body).to eq(updated_content)
          end
        end
      end
    end
  end

  describe '#remote_file' do
    include_context 'stub out everything path'

    subject { binary_file.remote_file }

    context 'when the bucket does not exist' do
      include_context 'with fake aws env vars'

      it 'is nil' do
        expect(subject).to be_nil
      end
    end

    context 'when the bucket does exist' do
      include_context 'with mock bucket in s3'

      context 'when the remote file does not exist' do
        it 'is nil' do
          expect(subject).to be_nil
        end
      end

      context 'when the remote file exists' do
        include_context 'with fake binary file in s3'

        it 'returns an AWS file' do
          expect(subject).to be_a(Fog::AWS::Storage::File)
        end

        it 'returns a file with matching remote_key' do
          expect(subject.key).to eq(binary_file.remote_key)
        end

        it 'calls head to get the file' do
          bucket_double = instance_double(Everything::Blog::S3Bucket)
          allow(binary_file)
            .to receive(:s3_bucket)
            .and_return(bucket_double)
          files_double = instance_double(Fog::AWS::Storage::Files)
          allow(bucket_double)
            .to receive(:files)
            .and_return(files_double)
          allow(files_double)
            .to receive(:head)
          subject
          expect(files_double)
            .to have_received(:head)
            .with(binary_file.remote_key)
        end
      end
    end
  end

  describe '#remote_file_does_not_exist?' do
    subject { binary_file.remote_file_does_not_exist? }

    context 'when remote_file is nil' do
      before do
        allow(binary_file)
          .to receive(:remote_file)
          .and_return(nil)
      end

      it 'is true' do
        expect(subject).to eq(true)
      end
    end

    context 'when remote_file is not nil' do
      include_context 'with fake binary file in s3'

      before do
        allow(binary_file)
          .to receive(:remote_file)
          .and_return(mock_binary_file)
      end

      it 'is false' do
        expect(subject).to eq(false)
      end
    end
  end

  describe '#remote_key' do
    subject { binary_file.remote_key }

    before do
      @initial_remote_key = subject.dup
      binary_file.remote_key
      binary_file.remote_key
      binary_file.remote_key
    end

    it "is the output file's path with a leading slash" do
      expected_file_key = given_output_file.path.to_s
      expect(subject).to eq(expected_file_key)
    end

    it 'returns the same result when called multiple times' do
      expect(binary_file.remote_key).to eq(@initial_remote_key)
    end

    it 'memoizes the result' do
      expect(subject.object_id).to eq(binary_file.remote_key.object_id)
    end
  end
end


text:
package quickfix.field;
import quickfix.StringField;

public class AffectedOrderID extends StringField
{
  static final long serialVersionUID = 20050617;

  public static final int FIELD = 535;

  public AffectedOrderID()
  {
    super(535);
  }

  public AffectedOrderID(String data)
  {
     super(535, data);
  }

}

redpajama_set_name: RedPajamaGithub


text:
namespace content {

namespace {

static const char* const download_type_names[] = {
  "NEW_DOWNLOAD",
  "HISTORY_IMPORT",
  "SAVE_PAGE_AS"
};
static const char* const download_danger_names[] = {
  "NOT_DANGEROUS",
  "DANGEROUS_FILE",
  "DANGEROUS_URL",
  "DANGEROUS_CONTENT",
  "MAYBE_DANGEROUS_CONTENT",
  "UNCOMMON_CONTENT",
  "USER_VALIDATED",
  "DANGEROUS_HOST",
  "POTENTIALLY_UNWANTED"
};

static_assert(arraysize(download_type_names) == SRC_SAVE_PAGE_AS + 1,
              "download type enum has changed");
static_assert(arraysize(download_danger_names) == DOWNLOAD_DANGER_TYPE_MAX,
              "download danger enum has changed");

}  // namespace

std::unique_ptr<base::Value> ItemActivatedNetLogCallback(
    const DownloadItem* download_item,
    DownloadType download_type,
    const std::string* file_name,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("type", download_type_names[download_type]);
  dict->SetString("id", base::UintToString(download_item->GetId()));
  dict->SetString("original_url", download_item->GetOriginalUrl().spec());
  dict->SetString("final_url", download_item->GetURL().spec());
  dict->SetString("file_name", *file_name);
  dict->SetString("danger_type",
                  download_danger_names[download_item->GetDangerType()]);
  dict->SetString("start_offset",
                  base::Int64ToString(download_item->GetReceivedBytes()));
  dict->SetBoolean("has_user_gesture", download_item->HasUserGesture());

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemCheckedNetLogCallback(
    DownloadDangerType danger_type,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("danger_type", download_danger_names[danger_type]);

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemRenamedNetLogCallback(
    const base::FilePath* old_filename,
    const base::FilePath* new_filename,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("old_filename", old_filename->AsUTF8Unsafe());
  dict->SetString("new_filename", new_filename->AsUTF8Unsafe());

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemInterruptedNetLogCallback(
    DownloadInterruptReason reason,
    int64_t bytes_so_far,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("interrupt_reason", DownloadInterruptReasonToString(reason));
  dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far));

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemResumingNetLogCallback(
    bool user_initiated,
    DownloadInterruptReason reason,
    int64_t bytes_so_far,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("user_initiated", user_initiated ? "true" : "false");
  dict->SetString("interrupt_reason", DownloadInterruptReasonToString(reason));
  dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far));

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemCompletingNetLogCallback(
    int64_t bytes_so_far,
    const std::string* final_hash,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far));
  dict->SetString("final_hash",
                  base::HexEncode(final_hash->data(), final_hash->size()));

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemFinishedNetLogCallback(
    bool auto_opened,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("auto_opened", auto_opened ? "yes" : "no");

  return std::move(dict);
}

std::unique_ptr<base::Value> ItemCanceledNetLogCallback(
    int64_t bytes_so_far,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("bytes_so_far", base::Int64ToString(bytes_so_far));

  return std::move(dict);
}

std::unique_ptr<base::Value> FileOpenedNetLogCallback(
    const base::FilePath* file_name,
    int64_t start_offset,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("file_name", file_name->AsUTF8Unsafe());
  dict->SetString("start_offset", base::Int64ToString(start_offset));

  return std::move(dict);
}

std::unique_ptr<base::Value> FileStreamDrainedNetLogCallback(
    size_t stream_size,
    size_t num_buffers,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetInteger("stream_size", static_cast<int>(stream_size));
  dict->SetInteger("num_buffers", static_cast<int>(num_buffers));

  return std::move(dict);
}

std::unique_ptr<base::Value> FileRenamedNetLogCallback(
    const base::FilePath* old_filename,
    const base::FilePath* new_filename,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("old_filename", old_filename->AsUTF8Unsafe());
  dict->SetString("new_filename", new_filename->AsUTF8Unsafe());

  return std::move(dict);
}

std::unique_ptr<base::Value> FileErrorNetLogCallback(
    const char* operation,
    net::Error net_error,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("operation", operation);
  dict->SetInteger("net_error", net_error);

  return std::move(dict);
}

std::unique_ptr<base::Value> FileInterruptedNetLogCallback(
    const char* operation,
    int os_error,
    DownloadInterruptReason reason,
    net::NetLogCaptureMode capture_mode) {
  std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());

  dict->SetString("operation", operation);
  if (os_error != 0)
    dict->SetInteger("os_error", os_error);
  dict->SetString("interrupt_reason", DownloadInterruptReasonToString(reason));

  return std::move(dict);
}

}  // namespace content


text:
package de.zh32.teleportsigns.utility;

import lombok.Getter;
import lombok.Setter;

import java.util.Map;

/**
 * @author zh32
 */
public class MessageHelper {

	@Getter
	@Setter
	private static Map<String, String> messages;

	public static String getMessage(String messageCode, Object... args) {
		String template;
		if (messages == null || (template = messages.get(messageCode)) == null) {
			return messageCode;
		}
		return String.format(template, args);
	}

}


text:
package org.deidentifier.arx;

import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

import org.deidentifier.arx.clustering.GeneralizationManager;
import org.deidentifier.arx.criteria.KAnonymity;
import org.deidentifier.arx.criteria.LDiversity;
import org.deidentifier.arx.criteria.TCloseness;
import org.deidentifier.arx.framework.check.distribution.DistributionAggregateFunction;
import org.deidentifier.arx.framework.data.DataManager;
import org.deidentifier.arx.framework.data.Dictionary;
import org.deidentifier.arx.framework.data.GeneralizationHierarchy;
import org.deidentifier.arx.metric.v2.DomainShareMaterialized;

// TODO: Auto-generated Javadoc
/**
 * This class provides a rudimentary interface to the internal ARX data structures.
 *
 * @author Fabian Prasser
 */
public class ARXInterface {

    /**  The data manager. */
    private final DataManager      manager;

    /**  The buffer. */
    private final int[][]          buffer;

    /**  The config. */
    private final ARXConfiguration config;

    /** The generalization manager. */
    private final GeneralizationManager generalizationManager;

    /** The number of events between each logging tick. */
    private int logSteps = 10000;

    /** Domain share*/
    private DomainShareMaterialized[]               shares;

    /**
     * Creates a new interface to the internal ARX data structures.
     *
     * @param data the data
     * @param config the config
     * @throws IOException Signals that an I/O exception has occurred.
     */
    public ARXInterface(final Data data, ARXConfiguration config) throws IOException {

        // Check simplifying assumptions
        if (config.getMaxOutliers() > 0d) {
            throw new UnsupportedOperationException("Outliers are not supported");
        }

        if (config.getCriteria().size() != 1) {
            throw new UnsupportedOperationException("Only exactly one criterion is supported");
        }

        if (!(config.getCriteria().iterator().next() instanceof KAnonymity)) {
            throw new UnsupportedOperationException("Only the k-anonymity criterion is supported");
        }

        if (((DataHandleInput) data.getHandle()).isLocked()) {
            throw new RuntimeException("This data handle is locked. Please release it first");
        }

        // Encode data
        DataHandle handle = data.getHandle();
        handle.getDefinition().materializeHierarchies(handle);
        checkBeforeEncoding(handle, config);
        handle.getRegistry().reset();
        handle.getRegistry().createInputSubset(config);

        String[] header = ((DataHandleInput) handle).header;
        int[][] dataArray = ((DataHandleInput) handle).data;
        Dictionary dictionary = ((DataHandleInput) handle).dictionary;
        manager = new DataManager(header, dataArray, dictionary, handle.getDefinition(), config.getCriteria(), new HashMap<String, DistributionAggregateFunction>());

        // Initialize
        this.config = config;
        config.initialize(manager);

        // Check
        checkAfterEncoding(config, manager);

        // Build buffer
        int[][] array = getDataQI();
        buffer = new int[array.length][];
        for (int i = 0; i < array.length; i++) {
            buffer[i] = new int[array[0].length];
        }

        shares = new DomainShareMaterialized[array[0].length];
        for (int i = 0; i < shares.length; i++) {
            shares[i] = new DomainShareMaterialized(handle.getDefinition().getHierarchy(header[i]),
                                                    manager.getDataGeneralized().getDictionary().getMapping()[i],
                                                    manager.getHierarchies()[i].getArray());
        }

        // Create generalization manager
        generalizationManager = new GeneralizationManager(this);
    }

    /**
     * Domain shares
     * @return
     */
    public DomainShareMaterialized[] getDomainShares() {
        return shares;
    }

    /**
     * Returns the name of the attribute at the given index.
     *
     * @param index the index
     * @return the attribute
     */
    public String getAttribute(int index) {
        return manager.getDataGeneralized().getHeader()[index];
    }

    /**
     * Returns the output buffer.
     *
     * @return the buffer
     */
    public int[][] getBuffer() {
        return buffer;
    }

    /**
     * Gets the data manager for the current data set.
     *
     * @return the data manager
     */
    public DataManager getDataManager()
    {
    	return this.manager;
    }

    /**
     * Returns the input data array (quasi-identifiers).
     *
     * @return the data qi
     */
    public int[][] getDataQI() {
        return manager.getDataGeneralized().getArray();
    }

    public GeneralizationManager getGeneralizationManager() {
		return generalizationManager;
	}

    /**
     * Returns the hierarchy for the attribute at the given index.
     *
     * @param index the index
     * @return the hierarchy
     */
    public int[][] getHierarchy(int index) {
        return manager.getHierarchies()[index].getArray();
    }

    /**
     * Returns the parameter 'k', as in k-anonymity.
     *
     * @return the k
     */
    public int getK() {
        return config.getMinimalGroupSize();
    }

    /**
     * Returns the logging step
     */
    public int getLoggingStep() {
        return logSteps;
    }

    /**
     * Returns the number of quasi-identifying attributes.
     *
     * @return the num attributes
     */
    public int getNumAttributes() {
        return buffer[0].length;
    }

    /**
     * Returns the output as generalized strings
     *
     * @return the generalized output
     */
    public String[][] getOutputGeneralized() {
    	throw new UnsupportedOperationException();
    }

    /**
     * Performs some sanity checks.
     *
     * @param config the config
     * @param manager the manager
     */
    private void checkAfterEncoding(final ARXConfiguration config, final DataManager manager) {

        if (config.containsCriterion(KAnonymity.class)) {
            KAnonymity c = config.getCriterion(KAnonymity.class);
            if ((c.getK() > manager.getDataGeneralized().getDataLength()) || (c.getK() < 1)) {
                throw new IllegalArgumentException("Parameter k (" + c.getK() + ") musst be positive and less or equal than the number of rows (" + manager.getDataGeneralized().getDataLength() + ")");
            }
        }
        if (config.containsCriterion(LDiversity.class)) {
            for (LDiversity c : config.getCriteria(LDiversity.class)) {
                if ((c.getL() > manager.getDataGeneralized().getDataLength()) || (c.getL() < 1)) {
                    throw new IllegalArgumentException("Parameter l (" + c.getL() + ") musst be positive and less or equal than the number of rows (" + manager.getDataGeneralized().getDataLength() + ")");
                }
            }
        }

        // Check whether all hierarchies are monotonic
        for (final GeneralizationHierarchy hierarchy : manager.getHierarchies()) {
            hierarchy.checkMonotonicity(manager);
        }

        // check min and max sizes
        final int[] hierarchyHeights = manager.getHierachiesHeights();
        final int[] minLevels = manager.getHierarchiesMinLevels();
        final int[] maxLevels = manager.getHierarchiesMaxLevels();

        for (int i = 0; i < hierarchyHeights.length; i++) {
            if (minLevels[i] > (hierarchyHeights[i] - 1)) {
                throw new IllegalArgumentException("Invalid minimum generalization for attribute '" + manager.getHierarchies()[i].getName() + "': " +
                                                   minLevels[i] + " > " + (hierarchyHeights[i] - 1));
            }
            if (minLevels[i] < 0) {
                throw new IllegalArgumentException("The minimum generalization for attribute '" + manager.getHierarchies()[i].getName() + "' has to be positive!");
            }
            if (maxLevels[i] > (hierarchyHeights[i] - 1)) {
                throw new IllegalArgumentException("Invalid maximum generalization for attribute '" + manager.getHierarchies()[i].getName() + "': " +
                                                   maxLevels[i] + " > " + (hierarchyHeights[i] - 1));
            }
            if (maxLevels[i] < minLevels[i]) {
                throw new IllegalArgumentException("The minimum generalization for attribute '" + manager.getHierarchies()[i].getName() +
                                                   "' has to be lower than or requal to the defined maximum!");
            }
        }
    }

    /**
     * Performs some sanity checks.
     *
     * @param handle
     *            the data handle
     * @param config
     *            the configuration
     */
    private void checkBeforeEncoding(final DataHandle handle, final ARXConfiguration config) {

        // Lots of checks
        if (handle == null) {
            throw new NullPointerException("Data must not be null!");
        }
        if (config.containsCriterion(LDiversity.class) ||
            config.containsCriterion(TCloseness.class)) {
            if (handle.getDefinition().getSensitiveAttributes().size() == 0) {
                throw new IllegalArgumentException("You need to specify a sensitive attribute!");
            }
        }
        for (String attr : handle.getDefinition().getSensitiveAttributes()) {
            boolean found = false;
            for (LDiversity c : config.getCriteria(LDiversity.class)) {
                if (c.getAttribute().equals(attr)) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                for (TCloseness c : config.getCriteria(TCloseness.class)) {
                    if (c.getAttribute().equals(attr)) {
                        found = true;
                        break;
                    }
                }
            }
            if (!found) {
                throw new IllegalArgumentException("No criterion defined for sensitive attribute: '" + attr + "'!");
            }
        }
        for (LDiversity c : config.getCriteria(LDiversity.class)) {
            if (handle.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
                throw new RuntimeException("L-Diversity criterion defined for non-sensitive attribute '" + c.getAttribute() + "'!");
            }
        }
        for (TCloseness c : config.getCriteria(TCloseness.class)) {
            if (handle.getDefinition().getAttributeType(c.getAttribute()) != AttributeType.SENSITIVE_ATTRIBUTE) {
                throw new RuntimeException("T-Closeness criterion defined for non-sensitive attribute '" + c.getAttribute() + "'!");
            }
        }

        // Check handle
        if (!(handle instanceof DataHandleInput)) {
            throw new IllegalArgumentException("Invalid data handle provided!");
        }

        // Check if all defines are correct
        DataDefinition definition = handle.getDefinition();
        Set<String> attributes = new HashSet<String>();
        for (int i = 0; i < handle.getNumColumns(); i++) {
            attributes.add(handle.getAttributeName(i));
        }
        for (String attribute : handle.getDefinition().getSensitiveAttributes()) {
            if (!attributes.contains(attribute)) {
                throw new IllegalArgumentException("Sensitive attribute '" + attribute + "' is not contained in the dataset");
            }
        }
        for (String attribute : handle.getDefinition().getInsensitiveAttributes()) {
            if (!attributes.contains(attribute)) {
                throw new IllegalArgumentException("Insensitive attribute '" + attribute + "' is not contained in the dataset");
            }
        }
        for (String attribute : handle.getDefinition().getIdentifyingAttributes()) {
            if (!attributes.contains(attribute)) {
                throw new IllegalArgumentException("Identifying attribute '" + attribute + "' is not contained in the dataset");
            }
        }
        for (String attribute : handle.getDefinition().getQuasiIdentifyingAttributes()) {
            if (!attributes.contains(attribute)) {
                throw new IllegalArgumentException("Quasi-identifying attribute '" + attribute + "' is not contained in the dataset");
            }
        }

        // Perform sanity checks
        Set<String> qis = definition.getQuasiIdentifyingAttributes();
        if ((config.getMaxOutliers() < 0d) || (config.getMaxOutliers() > 1d)) {
            throw new IllegalArgumentException("Suppression rate " + config.getMaxOutliers() + "must be in [0, 1]");
        }
        if (qis.size() == 0) {
            throw new IllegalArgumentException("You need to specify at least one quasi-identifier");
        }
    }
}


text:
adapterManagerRegisterAdapter((function() {

    window.ybotq = window.ybotq || [];

    var adapterID = 'yieldbot',
        constConfigPSN = 'psn',
        constConfigSlot = 'slot',
        adapterConfigMandatoryParams = [constConfigPSN, constConfigKeyGeneratigPattern, constConfigKeyLookupMap],
        slotConfigMandatoryParams = [constConfigSlot],
        psn = '',
        internalMap = {},

        adapterScriptPath = '//cdn.yldbt.com/js/yieldbot.intent.js',

        fetchBids = function(configObject, activeSlots){
            utilLog(adapterID+constCommonMessage01);

            var adapterConfig = utilLoadGlobalConfigForAdapter(configObject, adapterID, adapterConfigMandatoryParams);
            if(!adapterConfig){
                return;
            }

            var keyGenerationPattern = adapterConfig[constConfigKeyGeneratigPattern];
            var keyLookupMap = adapterConfig[constConfigKeyLookupMap];
            psn = adapterConfig[constConfigPSN];
            var definedSlots = [];

            utilForEachGeneratedKey(
                adapterID,
                slotConfigMandatoryParams,
                activeSlots,
                keyGenerationPattern,
                keyLookupMap,
                function(generatedKey, kgpConsistsWidthAndHeight, currentSlot, keyConfig, currentWidth, currentHeight){

                    if(psn && keyConfig[constConfigSlot]){
                        var callbackId = utilGetUniqueIdentifierStr();
                        internalMap[callbackId] = {};
                        internalMap[callbackId][constCommonConfig] = {
                            'params': keyConfig,
                            'divID': currentSlot[constCommonDivID],
                            'sizes': currentSlot[constAdSlotSizes]
                        };
                        internalMap[callbackId][constCommonKeyGenerationPatternValue] = generatedKey;
                        definedSlots.push(callbackId);
                    }
                }
            );

            if(definedSlots.length){
                ybotq.push(function(){
                    var yieldbot = window.yieldbot;
                    utilEach(definedSlots, function(callbackId) {
                        if(utilHasOwnProperty(internalMap, callbackId)){
                            var bid = internalMap[callbackId][constCommonConfig];
                            yieldbot.pub(psn);
                            yieldbot.defineSlot(bid[constCommonParams].slot, {sizes: bid[constCommonSizes] || []});
                        }
                    });
                    yieldbot.enableAsync();
                    yieldbot.go();
                });

                ybotq.push(function () {
                    handleUpdateState();
                });

                utilLoadScript(adapterScriptPath);
            }else{
                utilLog(adapterID+': definedSlots are empty.');
            }
        },

        handleUpdateState = function(){
            var yieldbot = window.yieldbot;

            for(var v in internalMap){

                var adapterConfig
                ;
                if(utilHasOwnProperty(internalMap, v) && internalMap[v].exp != true){
                    internalMap[v].exp = true;
                    adapterConfig = internalMap[v][constCommonConfig] || {};
                    var criteria = yieldbot.getSlotCriteria(adapterConfig[constCommonParams].slot || '');
                    var bid = buildBid(criteria, internalMap[v][constCommonKeyGenerationPatternValue]);
                    bidManagerSetBidFromBidder(adapterConfig[constCommonDivID], adapterID, bid);
                }
            }
        },

        buildBid = function(slotCriteria, kgpv){
            var bidObject = {};

            if (slotCriteria && slotCriteria.ybot_ad && slotCriteria.ybot_ad !== 'n') {

                var szArr = slotCriteria.ybot_size ? slotCriteria.ybot_size.split('x') : [0,0],
                    slot = slotCriteria.ybot_slot || '',
                    sizeStr = slotCriteria.ybot_size || ''; // Creative template needs the dimensions string

                bidObject = bidManagerCreateBidObject(
                    parseInt(slotCriteria.ybot_cpm) / 100.0 || 0,
                    bidManagerCreateDealObject(),
                    "",
                    buildCreative(slot, sizeStr),
                    "",
                    szArr[0] || 0,
                    szArr[1] || 0,
                    kgpv
                );

            } else {

                bidObject = bidManagerCreateBidObject(
                    0,
                    bidManagerCreateDealObject(),
                    "",
                    "",
                    "",
                    0,
                    0,
                    kgpv
                );
            }

            return bidObject;
        },

        buildCreative = function(slot, size){
            return '<script type="text/javascript" src="'+adapterScriptPath+'"></script>' +
                '<script type="text/javascript">var ybotq = ybotq || [];' +
                'ybotq.push(function () {yieldbot.renderAd(\'' + slot.toLowerCase() + ':' + size + '\');});</script>';
        }
    ;

    return {
        fB: fetchBids,
        dC: utilDisplayCreative,
        ID: function(){
            return adapterID;
        }
    };
})());


text:
title: 'MexApi featured @getgrav'
date: 11-10-2016 01:39
taxonomy:
    category: Citações
    tag: [grav, mexapi, featured, twitter]
type: status
body_classes: single single-post
---

Today I was looking at MexApi's analytics when a spike in the figures immediately came to my attention. I went down to the traffic sources to investigate it further and to discover that most of the visitors were coming from twitter. A search for 'mexapi' there quickly led me to this:

A nice blog created in Grav - https://t.co/kl1iw302Li - Took 2 days to convert to Grav from previous platform. Great job!
— Grav (@getgrav) 7 de outubro de 2016

Wow! Thank you [@getgrav](https://twitter.com/getgrav) folks for this lovely mention.

===

I wrote this in English so people at @getgrav could read it if they ever found this as my twitter account is private.


text:
package graphene.augment.snlp.services;

import graphene.augment.snlp.model.NERResult;

import java.util.List;

public interface NERService {

	public abstract List<NERResult> getResults(String text);

}


text:
module QunitForRails
  def include_qunit(options = { :autohide => false })
    # write to the head of application.html.erb
    # include the js and css files required, if RAILS_ENV = development
    str = "
      <script language=\"JavaScript\">
          $list = \"#{list_tests}\";
          $list = $list.split(\",\");
          $collection = \"#{collect_tests}\";
          $autohide = \"#{options[:autohide]}\";
      </script>
      <script type=\"text/javascript\" src=\"/javascripts/qunit.js\"></script>
      <script type=\"text/javascript\" src=\"/javascripts/qunit_for_rails.js\"></script>
      <link href=\"/stylesheets/qunit_for_rails.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\"/>
    "
  end

  def collect_tests
    response = "<select id='qunit-test-select'><option></option><option>all</option>"
    Dir.foreach(File.dirname(__FILE__) + "/../../../../public/javascripts/tests") do |f|
      response << "<option id='#{f}'>#{f}</option>" if f.to_s.size > 4
    end
    response << "</select>"
  end

  def list_tests
    files = Dir.entries(File.dirname(__FILE__) + "/../../../../public/javascripts/tests")
    files.delete(".")
    files.delete("..")
    files.join(",").to_s
  end

end


text:
using System.Runtime.InteropServices;
using System.Text;

namespace Ab3d.OculusWrap
{
    public struct ExternalCamera
    {
        /// <summary>
        /// Byte array for camera Name string
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
        public byte[] NameBytes;

        /// <summary>
        /// Camera Name
        /// </summary>
        public string Name
        {
            get
            {
                return OvrWrap.GetAsciiString(NameBytes);
            }
        }

        public CameraIntrinsics Intrinsics;
        public CameraExtrinsics Extrinsics;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bot. Jb. 30: 42 (1901)

#### Original name
Lachnocladium zenkeri Henn.

### Remarks
null


text:
require 'fake_ec2/serializable'
require 'set'

module FakeEc2
  class IdGenerator
    include Serializable
    serializable :generated_ids

    def initialize
      @mutex = Mutex.new
      clear
    end

    def clear
      @generated_ids = {}
    end

    def generate_8hex(prefix)
      generate_uniquely(prefix.to_s) do
        "#{prefix}-%08x" % rand(16**8)
      end
    end

    def generate_request_id
      generate_uniquely('request_id') do
        "%08x-%04x-%04x-%04x-%012x" % (
          [8, 4, 4, 4, 12].map {|i| rand(16**i) }
        )
      end
    end

    private
      def generate_uniquely(key)
        @mutex.synchronize do
          @generated_ids[key] ||= ::Set.new
          begin
            id = yield
          end while @generated_ids[key].include?(id)
          @generated_ids[key] = id
        end
      end
  end
end


text:
#ifndef OSMIUM_IO_OPL_INPUT_HPP
#define OSMIUM_IO_OPL_INPUT_HPP

/**
 * @file
 *
 * Include this file if you want to read OSM OPL files.
 *
 */

#include <osmium/io/detail/opl_input_format.hpp> // IWYU pragma: export
#include <osmium/io/reader.hpp> // IWYU pragma: export

#endif // OSMIUM_IO_OPL_INPUT_HPP


text:
import Ember from 'ember';
import EuiSelectdate from 'emberui/components/eui-selectdate';

export default EuiSelectdate;


text:
from setuptools import setup, find_packages

setup(
    name='bitfinex_api',
    version='0.0.1',
    description='package containing the API endpoints of Bitfinex',
    url='https://github.com/NeillHerbst/bitfinex-python.git',
    author='Neill Herbst',
    author_email='n.herbst6@gmail.com',
    license='MIT',
    packages=find_packages(),
    install_requires = [
        'requests==2.14.2',
        'websocket-client==0.44.0'
    ]
)


text:
<!-- describes all known measurable properties and metrics -->
<measurementsDescriptor>
	<!-- descriptions of measurable properties -->
	<!-- important: once published, the uri's and their corresponding scales
		must not be changed -->
	<!-- important: names and descriptions may change! (do not use them as indices) -->
	<measurableProperties>
		<property>
			<category>outcome:object</category>
			<propertyId>format/correct/wellformed</propertyId>
			<name>format well-formed</name>
			<description>Tells if the format of the object is well formed</description>
			<booleanScale>
				<unit>well formed</unit>
			</booleanScale>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>format/correct/valid</propertyId>
			<name>format valid</name>
			<description>Tells if the format of the object is valid</description>
			<booleanScale>
				<unit>valid</unit>
			</booleanScale>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>format/correct/conforms</propertyId>
			<name>format conforms</name>
			<description>Tells if the format of the result conforms to the
				specified output format of the tool.</description>
			<booleanScale>
				<unit>conforms</unit>
			</booleanScale>
		</property>

		<property>
			<category>outcome:object</category>
			<propertyId>compression/scheme</propertyId>
			<name>compression scheme</name>
			<description>Compression scheme of the result.</description>
			<freeStringScale />
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>compression/lossless</propertyId>
			<name>lossless compression </name>
			<description>Tells if lossless compression is used.</description>
			<booleanScale>
				<unit>lossless compression</unit>
			</booleanScale>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>compression/lossy</propertyId>
			<name>lossy compression </name>
			<description>Tells if lossy compression is used.</description>
			<booleanScale>
				<unit>lossy compression</unit>
			</booleanScale>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/dimension/width</propertyId>
			<name>image width</name>
			<description>Width of an image. Corresponds to the x-axis.</description>
			<positiveIntegerScale>
				<unit>pixel</unit>
			</positiveIntegerScale>
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/dimension/height</propertyId>
			<name>image height</name>
			<description>Height of an image. Corresponds to the y-axis.</description>
			<positiveIntegerScale>
				<unit>pixel</unit>
			</positiveIntegerScale>
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/dimension/aspectRatio</propertyId>
			<name>aspect ratio</name>
			<description>aspect ratio of image, calculated as height/width.</description>
			<positiveFloatScale>
				<unit>aspect ratio(h/w)</unit>
			</positiveFloatScale>
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/colorEncoding/bitsPerSample</propertyId>
			<name>bits per sample</name>
			<description>Number of bits per sample component, e.g. "8 8 8", one
				byte for each r,g,b value</description>
			<!-- at the moment bitsPerSample is only available as derived measurement,
				therefore no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/colorEncoding/samplesPerPixel</propertyId>
			<name>samples per pixel</name>
			<description>number of samples per pixel. corresponds to bits per
				sample representation.</description>
			<!-- at the moment samplesPerPixel is only available as derived measurement,
				therefore no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/photometricInterpretation/colorSpace</propertyId>
			<name>color space</name>
			<description>color space name</description>
			<!-- at the moment colorSpace is only available as derived measurement,
				therefore no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/photometricInterpretation/colorProfile/iccProfile</propertyId>
			<name>icc color profile</name>
			<description></description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/spatialMetrics/samplingFrequencyUnit</propertyId>
			<name>sampling frequency unit</name>
			<description>The unit of measurement for XSamplingFrequency and
				YSamplingFrequency. (See ANSI/NISO Z39.87-2006, "Data Dictionary –
				Technical Metadata for Digital Still Images")</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>

		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/spatialMetrics/xSamplingFrequency</propertyId>
			<name>x sampling frequency</name>
			<description>Data element that specifies the number of pixels per
				Definition samplingFrequencyUnit in the image width. (See ANSI/NISO
				Z39.87-2006, "Data Dictionary – Technical Metadata for Digital Still
				Images")</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/spatialMetrics/ySamplingFrequency</propertyId>
			<name>y sampling frequency</name>
			<description>Data element that specifies the number of pixels per
				Definition samplingFrequencyUnit in the image height. (See ANSI/NISO
				Z39.87-2006, "Data Dictionary – Technical Metadata for Digital Still
				Images")</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>

		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata</propertyId>
			<name>image metadata</name>
			<description>additional metadata stored in images (EXIF, ...)</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="preserved" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/software</propertyId>
			<name>image metadata: software</name>
			<description>textual information about software used to create this
				object</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/producer</propertyId>
			<name>image metadata: producer</name>
			<description>textual information about producer</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/creationDate</propertyId>
			<name>image metadata: creationDate</name>
			<description>creation date</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>
		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/lastModified</propertyId>
			<name>image metadata: lastModified</name>
			<description>last modified at</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>

		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/description</propertyId>
			<name>image metadata: description</name>
			<description>textual description of the object</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>

		<property>
			<category>outcome:object</category>
			<propertyId>image/metadata/orientation</propertyId>
			<name>image metadata: orientation</name>
			<description>orientation of the object</description>
			<!-- at the moment this is only available as derived measurement, therefore
				no information about scale and unit is available -->
			<possibleMetrics>
				<metric metricId="equal" />
			</possibleMetrics>
		</property>

		<property>
			<category>outcome:object</category>
			<propertyId>relativeFileSize</propertyId>
			<name>relative file size</name>
			<description>relative file size, calculated as: (size of source /
				size of result)
			</description>
			<positiveFloatScale>
				<unit>ratio</unit>
			</positiveFloatScale>
		</property>

	</measurableProperties>
	<metrics>
		<metric>
			<metricId>equal</metricId>
			<name>equal</name>
			<description>Simple comparison of two values (A, B) of any type on
				equality.</description>
			<booleanScale>
				<unit>equality</unit>
			</booleanScale>
		</metric>
		<metric>
			<metricId>preserved</metricId>
			<name>preserved</name>
			<description>Indicator if all values in source measurement do exist
				in result measurement</description>
			<booleanScale>
				<unit>preserved</unit>
			</booleanScale>
		</metric>

	</metrics>
</measurementsDescriptor>


text:
package info.gameplus.util.stream;

import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.BiFunction;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class MergeJoinHelperTest {
	@Test
	public void test_mergeJoin_1() {
		List<X> xs = Arrays.asList(
				new X(10, "apple"),
				new X(20, "lemon")
		);
		List<Y> ys = Arrays.asList(
				new Y(5, "ORANGE"),
				new Y(10, "APPLE")
		);

		List<Z> zs = MergeJoinHelper.mergeJoin(
				xs.stream(), ys.stream(), XY_COMPARATOR, Z_MAPPER
		).collect(Collectors.toList());

		assertThat(zs, is(Arrays.asList(
				new Z(10, "apple", "APPLE")
		)));
	}

	@Test
	public void test_mergeJoin_zipAll() {
		List<X> xs = Arrays.asList(
				new X(10, "apple"),
				new X(20, "lemon")
		);
		List<Y> ys = Arrays.asList(
				new Y(10, "APPLE"),
				new Y(20, "LEMON")
		);

		List<Z> zs = MergeJoinHelper.mergeJoin(
				xs.stream(), ys.stream(), XY_COMPARATOR, Z_MAPPER
		).collect(Collectors.toList());

		assertThat(zs, is(Arrays.asList(
				new Z(10, "apple", "APPLE"),
				new Z(20, "lemon", "LEMON")
		)));
	}

	@Test
	public void test_mergeJoin_withEmptyArray() {
		List<X> xs = Arrays.asList(
				new X(10, "apple"),
				new X(20, "lemon")
		);
		List<Y> ys = Collections.emptyList();

		List<Z> zs = MergeJoinHelper.mergeJoin(
				xs.stream(), ys.stream(), XY_COMPARATOR, Z_MAPPER
		).collect(Collectors.toList());

		assertThat(zs, is(Collections.emptyList()));
	}

	@Test
	public void test_mergeJoin_bothAreEmpty() {
		List<X> xs = Collections.emptyList();
		List<Y> ys = Collections.emptyList();

		List<Z> zs = MergeJoinHelper.mergeJoin(
				xs.stream(), ys.stream(), XY_COMPARATOR, Z_MAPPER
		).collect(Collectors.toList());

		assertThat(zs, is(Collections.emptyList()));
	}

	static class X {
		private final int key;
		private final String value;

		X(int key, String value) {
			this.key = key;
			this.value = value;
		}

		public int getKey() {
			return key;
		}

		public String getValue() {
			return value;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || getClass() != o.getClass()) return false;

			X x = (X) o;

			if (key != x.key) return false;
			if (!value.equals(x.value)) return false;

			return true;
		}

		@Override
		public int hashCode() {
			int result = key;
			result = 31 * result + value.hashCode();
			return result;
		}
	}

	static class Y {
		private final int key;
		private final String value;

		Y(int key, String value) {
			this.key = key;
			this.value = value;
		}

		public int getKey() {
			return key;
		}

		public String getValue() {
			return value;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || getClass() != o.getClass()) return false;

			Y y = (Y) o;

			if (key != y.key) return false;
			if (!value.equals(y.value)) return false;

			return true;
		}

		@Override
		public int hashCode() {
			int result = key;
			result = 31 * result + value.hashCode();
			return result;
		}
	}

	static class Z {
		private final int key;
		private final String valueX;
		private final String valueY;

		Z(int key, String valueX, String valueY) {
			this.key = key;
			this.valueX = valueX;
			this.valueY = valueY;
		}

		public int getKey() {
			return key;
		}

		public String getValueX() {
			return valueX;
		}

		public String getValueY() {
			return valueY;
		}

		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || getClass() != o.getClass()) return false;

			Z z = (Z) o;

			if (key != z.key) return false;
			if (!valueX.equals(z.valueX)) return false;
			if (!valueY.equals(z.valueY)) return false;

			return true;
		}

		@Override
		public int hashCode() {
			int result = key;
			result = 31 * result + valueX.hashCode();
			result = 31 * result + valueY.hashCode();
			return result;
		}
	}

	static final MergeJoinComparator<X, Y> XY_COMPARATOR
			= (x, y) -> x.getKey() - y.getKey();
	static final BiFunction<X, Y, Z> Z_MAPPER
			= (x, y) -> new Z(x.getKey(), x.getValue(), y.getValue());
}


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

namespace HtmlAgilityPack
{
    internal partial class Trace
    {
        internal static Trace _current;
        internal static Trace Current
    {
        get
        {
            if(_current == null)
                _current = new Trace();
            return _current;
        }
    }
        partial void WriteLineIntern(string message,string category);
        public static void WriteLine(string message,string category)
        {
            Current.WriteLineIntern(message,category);
        }
    }
}


text:
export const MONTHS = [
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
];


text:
<?xml version='1.0' encoding='UTF-8'?>
<Document>
  <Header>
    <SchemaName>Location</SchemaName>
    <Identifier>location_geonames_2758282</Identifier>
    <DocumentState>public</DocumentState>
    <TimeStamp>1390753462028</TimeStamp>
    <SummaryFields>
      <Title>NL > North Brabant > Gemeente Bladel en Netersel > Broekenseind</Title>
    </SummaryFields>
  </Header>
  <Body>
    <Location>
      <GeopoliticalHierarchy>NL,North Brabant,Gemeente Bladel en Netersel,Broekenseind</GeopoliticalHierarchy>
      <LocationName>
        <Appelation>Broekenseind</Appelation>
        <LocationNameType>populated place</LocationNameType>
        <Comments></Comments>
      </LocationName>
      <Coordinates>
        <Longitude>5.3</Longitude>
        <Latitude>51.39583</Latitude>
      </Coordinates>
      <GeonamesURI>http://www.geonames.org/2758282</GeonamesURI>
      <WikipediaLink/>
      <DbpediaLink/>
    </Location>
  </Body>
</Document>


text:
'use strict';

module.exports = {
  root: true,
  parserOptions: {
    ecmaVersion: 6,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
    },
  },
  env: {
    browser: true,
    mocha: true,
    node: true,
    es6: true,
  },
  extends: ['eslint:recommended'],
  rules: {
    // Other rules
    'no-console': 'off',
    'valid-jsdoc': ['error', {requireReturn: false}],
    eqeqeq: 'error',
    // The following rules can be used in some cases. See the README for more
    // information. (These are marked with `0` instead of `"off"` so that a
    // script can distinguish them.)
    curly: 0,
    'max-len': 0,
    'no-mixed-operators': 0,
    quotes: 0,
    // The rest are rules that you never need to enable when using Prettier.
    'array-bracket-spacing': 'off',
    'arrow-parens': 'off',
    'arrow-spacing': 'off',
    'block-spacing': 'off',
    'brace-style': 'off',
    'comma-dangle': 'off',
    'comma-spacing': 'off',
    'comma-style': 'off',
    'computed-property-spacing': 'off',
    'dot-location': 'off',
    'eol-last': 'off',
    'func-call-spacing': 'off',
    'generator-star': 'off',
    'generator-star-spacing': 'off',
    indent: 'off',
    'jsx-quotes': 'off',
    'key-spacing': 'off',
    'keyword-spacing': 'off',
    'multiline-ternary': 'off',
    'newline-per-chained-call': 'off',
    'new-parens': 'off',
    'no-arrow-condition': 'off',
    'no-comma-dangle': 'off',
    'no-confusing-arrow': 'off',
    'no-extra-parens': 'off',
    'no-extra-semi': 'off',
    'no-mixed-spaces-and-tabs': 'off',
    'no-multi-spaces': 'off',
    'no-multiple-empty-lines': 'off',
    'no-reserved-keys': 'off',
    'no-space-before-semi': 'off',
    'no-spaced-func': 'off',
    'no-trailing-spaces': 'off',
    'no-whitespace-before-property': 'off',
    'no-wrap-func': 'off',
    'nonblock-statement-body-position': 'off',
    'object-curly-newline': 'off',
    'object-curly-spacing': 'off',
    'object-property-newline': 'off',
    'one-var-declaration-per-line': 'off',
    'operator-linebreak': 'off',
    'padded-blocks': 'off',
    'quote-props': 'off',
    'rest-spread-spacing': 'off',
    semi: 'off',
    'semi-spacing': 'off',
    'space-after-function-name': 'off',
    'space-after-keywords': 'off',
    'space-before-blocks': 'off',
    'space-before-function-paren': 'off',
    'space-before-function-parentheses': 'off',
    'space-before-keywords': 'off',
    'space-in-brackets': 'off',
    'space-in-parens': 'off',
    'space-infix-ops': 'off',
    'space-return-throw-case': 'off',
    'space-unary-ops': 'off',
    'space-unary-word-ops': 'off',
    'template-curly-spacing': 'off',
    'template-tag-spacing': 'off',
    'unicode-bom': 'off',
    'wrap-iife': 'off',
    'wrap-regex': 'off',
    'yield-star-spacing': 'off',
  },
};


text:
/*	This file is part of the software similarity tester SIM.
	Written by Dick Grune, Vrije Universiteit, Amsterdam.
	$Id: add_run.h,v 1.3 2012-06-05 09:58:52 Gebruiker Exp $
*/

/*	Interface between front-end and back-end: all information about
	runs passes through add_run().  Its parameters are the two chunks,
	each identified by their struct text and the position of the common
	segment in Token_Array[], and the number of tokens in the common
	segment.
*/

extern void add_run(
	struct text *txt0,		/* text of first chunk */
	size_t i0,			/* chunk position in Token_Array[] */
	struct text *txt1,		/* text of second chunk */
	size_t i1,			/* chunk position in Token_Array[] */
	size_t size			/* number of tokens in the chunk */
);


text:
layout: tag
title: redux
tag: redux
---


text:
package org.apache.phoenix.util;

import static org.apache.phoenix.util.SchemaUtil.getVarChars;

import java.io.IOException;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.client.HConnection;
import org.apache.hadoop.hbase.client.HConnectionManager;
import org.apache.hadoop.hbase.client.Mutation;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.protobuf.RequestConverter;
import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService;
import org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetRegionInfoRequest;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.phoenix.coprocessor.MetaDataProtocol;
import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
import org.apache.phoenix.hbase.index.util.KeyValueBuilder;
import org.apache.phoenix.hbase.index.util.VersionUtil;
import org.apache.phoenix.jdbc.PhoenixConnection;
import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
import org.apache.phoenix.query.QueryConstants;
import org.apache.phoenix.schema.types.PBoolean;
import org.apache.phoenix.schema.types.PDataType;
import org.apache.phoenix.schema.types.PLong;
import org.apache.phoenix.schema.PName;
import org.apache.phoenix.schema.types.PSmallint;
import org.apache.phoenix.schema.PTable;
import org.apache.phoenix.schema.PTableType;
import org.apache.phoenix.schema.SequenceKey;
import org.apache.phoenix.schema.SortOrder;
import org.apache.phoenix.schema.TableNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.protobuf.ServiceException;

public class MetaDataUtil {
    private static final Logger logger = LoggerFactory.getLogger(MetaDataUtil.class);

    public static final String VIEW_INDEX_TABLE_PREFIX = "_IDX_";
    public static final byte[] VIEW_INDEX_TABLE_PREFIX_BYTES = Bytes.toBytes(VIEW_INDEX_TABLE_PREFIX);
    public static final String LOCAL_INDEX_TABLE_PREFIX = "_LOCAL_IDX_";
    public static final byte[] LOCAL_INDEX_TABLE_PREFIX_BYTES = Bytes.toBytes(LOCAL_INDEX_TABLE_PREFIX);
    public static final String VIEW_INDEX_SEQUENCE_PREFIX = "_SEQ_";
    public static final String VIEW_INDEX_SEQUENCE_NAME_PREFIX = "_ID_";
    public static final byte[] VIEW_INDEX_SEQUENCE_PREFIX_BYTES = Bytes.toBytes(VIEW_INDEX_SEQUENCE_PREFIX);
    public static final String VIEW_INDEX_ID_COLUMN_NAME = "_INDEX_ID";
    public static final String PARENT_TABLE_KEY = "PARENT_TABLE";
    public static final byte[] PARENT_TABLE_KEY_BYTES = Bytes.toBytes("PARENT_TABLE");

    public static boolean areClientAndServerCompatible(long version) {
        // As of 3.0, we allow a client and server to differ for the minor version.
        // Care has to be taken to upgrade the server before the client, as otherwise
        // the client may call expressions that don't yet exist on the server.
        // Differing by the patch version has always been allowed.
        // Only differing by the major version is not allowed.
        return areClientAndServerCompatible(MetaDataUtil.decodePhoenixVersion(version), MetaDataProtocol.PHOENIX_MAJOR_VERSION);
    }

    // Default scope for testing
    static boolean areClientAndServerCompatible(int version, int pMajor) {
        // A server and client with the same major and minor version number must be compatible.
        // So it's important that we roll the PHOENIX_MAJOR_VERSION or PHOENIX_MINOR_VERSION
        // when we make an incompatible change.
        return VersionUtil.encodeMaxMinorVersion(pMajor) >= version && VersionUtil.encodeMinMinorVersion(pMajor) <= version;
    }

    // Given the encoded integer representing the phoenix version in the encoded version value.
    // The second byte in int would be the major version, 3rd byte minor version, and 4th byte
    // patch version.
    public static int decodePhoenixVersion(long version) {
        return (int) ((version << Byte.SIZE * 3) >>> Byte.SIZE * 4);
    }

    // TODO: generalize this to use two bytes to return a SQL error code instead
    public static long encodeMutableIndexConfiguredProperly(long version, boolean isValid) {
        if (!isValid) {
            return version | 1;
        }
        return version;
    }

    public static boolean decodeMutableIndexConfiguredProperly(long version) {
        return (version & 0xF) == 0;
    }

    // Given the encoded integer representing the client hbase version in the encoded version value.
    // The second byte in int would be the major version, 3rd byte minor version, and 4th byte
    // patch version.
    public static int decodeHBaseVersion(long version) {
        return (int) (version >>> Byte.SIZE * 5);
    }

    public static String decodeHBaseVersionAsString(int version) {
        int major = (version >>> Byte.SIZE  * 2) & 0xFF;
        int minor = (version >>> Byte.SIZE  * 1) & 0xFF;
        int patch = version & 0xFF;
        return major + "." + minor + "." + patch;
    }

    public static long encodeHBaseAndPhoenixVersions(String hbaseVersion) {
        return (((long) VersionUtil.encodeVersion(hbaseVersion)) << (Byte.SIZE * 5)) |
                (((long) VersionUtil.encodeVersion(MetaDataProtocol.PHOENIX_MAJOR_VERSION, MetaDataProtocol.PHOENIX_MINOR_VERSION,
                        MetaDataProtocol.PHOENIX_PATCH_NUMBER)) << (Byte.SIZE * 1));
    }

    public static void getTenantIdAndSchemaAndTableName(List<Mutation> tableMetadata, byte[][] rowKeyMetaData) {
        Mutation m = getTableHeaderRow(tableMetadata);
        getVarChars(m.getRow(), 3, rowKeyMetaData);
    }

    public static byte[] getParentTableName(List<Mutation> tableMetadata) {
        if (tableMetadata.size() == 1) {
            return null;
        }
        byte[][] rowKeyMetaData = new byte[3][];
        getTenantIdAndSchemaAndTableName(tableMetadata, rowKeyMetaData);
        byte[] schemaName = rowKeyMetaData[PhoenixDatabaseMetaData.SCHEMA_NAME_INDEX];
        byte[] tableName = rowKeyMetaData[PhoenixDatabaseMetaData.TABLE_NAME_INDEX];
        Mutation m = getParentTableHeaderRow(tableMetadata);
        getVarChars(m.getRow(), 3, rowKeyMetaData);
        if (   Bytes.compareTo(schemaName, rowKeyMetaData[PhoenixDatabaseMetaData.SCHEMA_NAME_INDEX]) == 0
            && Bytes.compareTo(tableName, rowKeyMetaData[PhoenixDatabaseMetaData.TABLE_NAME_INDEX]) == 0) {
            return null;
        }
        return rowKeyMetaData[PhoenixDatabaseMetaData.TABLE_NAME_INDEX];
    }

    public static long getSequenceNumber(Mutation tableMutation) {
        List<Cell> kvs = tableMutation.getFamilyCellMap().get(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES);
        if (kvs != null) {
            for (Cell kv : kvs) { // list is not ordered, so search. TODO: we could potentially assume the position
                if (Bytes.compareTo(kv.getQualifierArray(), kv.getQualifierOffset(), kv.getQualifierLength(), PhoenixDatabaseMetaData.TABLE_SEQ_NUM_BYTES, 0, PhoenixDatabaseMetaData.TABLE_SEQ_NUM_BYTES.length) == 0) {
                    return PLong.INSTANCE.getCodec().decodeLong(kv.getValueArray(), kv.getValueOffset(), SortOrder.getDefault());
                }
            }
        }
        throw new IllegalStateException();
    }

    public static long getSequenceNumber(List<Mutation> tableMetaData) {
        return getSequenceNumber(getTableHeaderRow(tableMetaData));
    }

    public static PTableType getTableType(List<Mutation> tableMetaData, KeyValueBuilder builder,
      ImmutableBytesPtr value) {
        if (getMutationValue(getPutOnlyTableHeaderRow(tableMetaData),
            PhoenixDatabaseMetaData.TABLE_TYPE_BYTES, builder, value)) {
            return PTableType.fromSerializedValue(value.get()[value.getOffset()]);
        }
        return null;
    }

    public static long getParentSequenceNumber(List<Mutation> tableMetaData) {
        return getSequenceNumber(getParentTableHeaderRow(tableMetaData));
    }

    public static Mutation getTableHeaderRow(List<Mutation> tableMetaData) {
        return tableMetaData.get(0);
    }

  /**
   * Get the mutation who's qualifier matches the passed key
   *

   * We need to pass in an {@link ImmutableBytesPtr} to pass the result back to make life easier
   * when dealing with a regular {@link KeyValue} vs. a custom KeyValue as the latter may not
   * support things like {@link KeyValue#getBuffer()}
   * @param headerRow mutation to check
   * @param key to check
   * @param builder that created the {@link KeyValue KeyValues} in the {@link Mutation}
   * @param ptr to point to the KeyValue's value if found
   * @return true if the KeyValue was found and false otherwise
   */
  public static boolean getMutationValue(Mutation headerRow, byte[] key,
      KeyValueBuilder builder, ImmutableBytesWritable ptr) {
        List<Cell> kvs = headerRow.getFamilyCellMap().get(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES);
        if (kvs != null) {
            for (Cell cell : kvs) {
                KeyValue kv = org.apache.hadoop.hbase.KeyValueUtil.ensureKeyValue(cell);
                if (builder.compareQualifier(kv, key, 0, key.length) ==0) {
                    builder.getValueAsPtr(kv, ptr);
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * Returns the first Put element in tableMetaData. There could be leading Delete elements before the
     * table header row
     */
    public static Mutation getPutOnlyTableHeaderRow(List<Mutation> tableMetaData) {
        for (Mutation m : tableMetaData) {
            if (m instanceof Put) { return m; }
        }
        throw new IllegalStateException("No table header row found in table meatadata");
    }

    public static Mutation getParentTableHeaderRow(List<Mutation> tableMetaData) {
        return tableMetaData.get(tableMetaData.size()-1);
    }

    public static long getClientTimeStamp(List<Mutation> tableMetadata) {
        Mutation m = tableMetadata.get(0);
        return getClientTimeStamp(m);
    }

    public static long getClientTimeStamp(Mutation m) {
        Collection<List<Cell>> kvs = m.getFamilyCellMap().values();
        // Empty if Mutation is a Delete
        // TODO: confirm that Delete timestamp is reset like Put
        return kvs.isEmpty() ? m.getTimeStamp() : kvs.iterator().next().get(0).getTimestamp();
    }

    public static byte[] getParentLinkKey(String tenantId, String schemaName, String tableName, String indexName) {
        return ByteUtil.concat(tenantId == null ? ByteUtil.EMPTY_BYTE_ARRAY : Bytes.toBytes(tenantId), QueryConstants.SEPARATOR_BYTE_ARRAY, schemaName == null ? ByteUtil.EMPTY_BYTE_ARRAY : Bytes.toBytes(schemaName), QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(tableName), QueryConstants.SEPARATOR_BYTE_ARRAY, QueryConstants.SEPARATOR_BYTE_ARRAY, Bytes.toBytes(indexName));
    }

    public static byte[] getParentLinkKey(byte[] tenantId, byte[] schemaName, byte[] tableName, byte[] indexName) {
        return ByteUtil.concat(tenantId == null ? ByteUtil.EMPTY_BYTE_ARRAY : tenantId, QueryConstants.SEPARATOR_BYTE_ARRAY, schemaName == null ? ByteUtil.EMPTY_BYTE_ARRAY : schemaName, QueryConstants.SEPARATOR_BYTE_ARRAY, tableName, QueryConstants.SEPARATOR_BYTE_ARRAY, QueryConstants.SEPARATOR_BYTE_ARRAY, indexName);
    }

    public static boolean isMultiTenant(Mutation m, KeyValueBuilder builder, ImmutableBytesWritable ptr) {
        if (getMutationValue(m, PhoenixDatabaseMetaData.MULTI_TENANT_BYTES, builder, ptr)) {
            return Boolean.TRUE.equals(PBoolean.INSTANCE.toObject(ptr));
        }
        return false;
    }

    public static boolean isSalted(Mutation m, KeyValueBuilder builder, ImmutableBytesWritable ptr) {
        return MetaDataUtil.getMutationValue(m, PhoenixDatabaseMetaData.SALT_BUCKETS_BYTES, builder, ptr);
    }

    public static byte[] getViewIndexPhysicalName(byte[] physicalTableName) {
        return ByteUtil.concat(VIEW_INDEX_TABLE_PREFIX_BYTES, physicalTableName);
    }

    public static String getViewIndexTableName(String tableName) {
        return VIEW_INDEX_TABLE_PREFIX + tableName;
    }

    public static String getViewIndexSchemaName(String schemaName) {
        return schemaName;
    }

    public static byte[] getLocalIndexPhysicalName(byte[] physicalTableName) {
        return ByteUtil.concat(LOCAL_INDEX_TABLE_PREFIX_BYTES, physicalTableName);
    }

    public static String getLocalIndexTableName(String tableName) {
        return LOCAL_INDEX_TABLE_PREFIX + tableName;
    }

    public static String getLocalIndexSchemaName(String schemaName) {
        return schemaName;
    }

    public static String getUserTableName(String localIndexTableName) {
        String schemaName = SchemaUtil.getSchemaNameFromFullName(localIndexTableName);
        if(!schemaName.isEmpty()) schemaName = schemaName.substring(LOCAL_INDEX_TABLE_PREFIX.length());
        String tableName = localIndexTableName.substring((schemaName.isEmpty() ? 0 : (schemaName.length() + QueryConstants.NAME_SEPARATOR.length()))
            + LOCAL_INDEX_TABLE_PREFIX.length());
        return SchemaUtil.getTableName(schemaName, tableName);
    }

    public static String getViewIndexSchemaName(PName physicalName) {
        return VIEW_INDEX_SEQUENCE_PREFIX + physicalName.getString();
    }

    public static SequenceKey getViewIndexSequenceKey(String tenantId, PName physicalName, int nSaltBuckets) {
        // Create global sequence of the form: <prefixed base table name><tenant id>
        // rather than tenant-specific sequence, as it makes it much easier
        // to cleanup when the physical table is dropped, as we can delete
        // all global sequences leading with <prefix> + physical name.
        String schemaName = getViewIndexSchemaName(physicalName);
        String tableName = VIEW_INDEX_SEQUENCE_NAME_PREFIX + (tenantId == null ? "" : tenantId);
        return new SequenceKey(null, schemaName, tableName, nSaltBuckets);
    }

    public static PDataType getViewIndexIdDataType() {
        return PSmallint.INSTANCE;
    }

    public static String getViewIndexIdColumnName() {
        return VIEW_INDEX_ID_COLUMN_NAME;
    }

    public static boolean hasViewIndexTable(PhoenixConnection connection, PName name) throws SQLException {
        return hasViewIndexTable(connection, name.getBytes());
    }

    public static boolean hasViewIndexTable(PhoenixConnection connection, String schemaName, String tableName) throws SQLException {
        return hasViewIndexTable(connection, SchemaUtil.getTableNameAsBytes(schemaName, tableName));
    }

    public static boolean hasViewIndexTable(PhoenixConnection connection, byte[] physicalTableName) throws SQLException {
        byte[] physicalIndexName = MetaDataUtil.getViewIndexPhysicalName(physicalTableName);
        try {
            HTableDescriptor desc = connection.getQueryServices().getTableDescriptor(physicalIndexName);
            return desc != null && Boolean.TRUE.equals(PBoolean.INSTANCE.toObject(desc.getValue(IS_VIEW_INDEX_TABLE_PROP_BYTES)));
        } catch (TableNotFoundException e) {
            return false;
        }
    }

    public static boolean hasLocalIndexTable(PhoenixConnection connection, PName name) throws SQLException {
        return hasLocalIndexTable(connection, name.getBytes());
    }

    public static boolean hasLocalIndexTable(PhoenixConnection connection, String schemaName, String tableName) throws SQLException {
        return hasLocalIndexTable(connection, SchemaUtil.getTableNameAsBytes(schemaName, tableName));
    }

    public static boolean hasLocalIndexTable(PhoenixConnection connection, byte[] physicalTableName) throws SQLException {
        byte[] physicalIndexName = MetaDataUtil.getLocalIndexPhysicalName(physicalTableName);
        try {
            HTableDescriptor desc = connection.getQueryServices().getTableDescriptor(physicalIndexName);
            return desc != null && Boolean.TRUE.equals(PBoolean.INSTANCE.toObject(desc.getValue(IS_LOCAL_INDEX_TABLE_PROP_BYTES)));
        } catch (TableNotFoundException e) {
            return false;
        }
    }

    public static void deleteViewIndexSequences(PhoenixConnection connection, PName name) throws SQLException {
        String schemaName = getViewIndexSchemaName(name);
        connection.createStatement().executeUpdate("DELETE FROM " + PhoenixDatabaseMetaData.SEQUENCE_FULLNAME_ESCAPED +
                " WHERE " + PhoenixDatabaseMetaData.TENANT_ID + " IS NULL AND " +
                PhoenixDatabaseMetaData.SEQUENCE_SCHEMA + " = '" + schemaName + "'");

    }

    /**
     * This function checks if all regions of a table is online
     * @param table
     * @return true when all regions of a table are online
     * @throws IOException
     * @throws
     */
    public static boolean tableRegionsOnline(Configuration conf, PTable table) {
        HConnection hcon = null;

        try {
            hcon = HConnectionManager.getConnection(conf);
            List<HRegionLocation> locations = hcon.locateRegions(
                org.apache.hadoop.hbase.TableName.valueOf(table.getTableName().getBytes()));

            for (HRegionLocation loc : locations) {
                try {
                    ServerName sn = loc.getServerName();
                    if (sn == null) continue;

                    AdminService.BlockingInterface admin = hcon.getAdmin(sn);
                    GetRegionInfoRequest request = RequestConverter.buildGetRegionInfoRequest(
                        loc.getRegionInfo().getRegionName());

                    admin.getRegionInfo(null, request);
                } catch (ServiceException e) {
                    IOException ie = ProtobufUtil.getRemoteException(e);
                    logger.debug("Region " + loc.getRegionInfo().getEncodedName() + " isn't online due to:" + ie);
                    return false;
                } catch (RemoteException e) {
                    logger.debug("Cannot get region " + loc.getRegionInfo().getEncodedName() + " info due to error:" + e);
                    return false;
                }
            }
        } catch (IOException ex) {
            logger.warn("tableRegionsOnline failed due to:" + ex);
            return false;
        } finally {
            if (hcon != null) {
                try {
                    hcon.close();
                } catch (IOException ignored) {
                }
            }
        }

        return true;
    }

    public static final String IS_VIEW_INDEX_TABLE_PROP_NAME = "IS_VIEW_INDEX_TABLE";
    public static final byte[] IS_VIEW_INDEX_TABLE_PROP_BYTES = Bytes.toBytes(IS_VIEW_INDEX_TABLE_PROP_NAME);

    public static final String IS_LOCAL_INDEX_TABLE_PROP_NAME = "IS_LOCAL_INDEX_TABLE";
    public static final byte[] IS_LOCAL_INDEX_TABLE_PROP_BYTES = Bytes.toBytes(IS_LOCAL_INDEX_TABLE_PROP_NAME);

    public static Scan newTableRowsScan(byte[] key, long startTimeStamp, long stopTimeStamp)
            throws IOException {
        Scan scan = new Scan();
        scan.setTimeRange(startTimeStamp, stopTimeStamp);
        scan.setStartRow(key);
        byte[] stopKey = ByteUtil.concat(key, QueryConstants.SEPARATOR_BYTE_ARRAY);
        ByteUtil.nextKey(stopKey, stopKey.length);
        scan.setStopRow(stopKey);
        return scan;
    }
}


text:
package com.stanleyidesis.quotograph.api.network;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

import com.stanleyidesis.quotograph.LWQApplication;
import com.stanleyidesis.quotograph.api.event.NetworkConnectivityEvent;

import org.greenrobot.eventbus.EventBus;

public class NetworkConnectionListener {

    private static String TAG = NetworkConnectionListener.class.getSimpleName();
    private static NetworkConnectionListener sNetworkConnectionListener;

    public static NetworkConnectionListener get() {
        if (sNetworkConnectionListener != null) {
            return sNetworkConnectionListener;
        }
        sNetworkConnectionListener = new NetworkConnectionListener();
        return get();
    }

    public enum ConnectionType {
        CONNECTION_NO_NETWORK,
        CONNECTION_UNKNOWN,
        CONNECTION_WIFI,
        CONNECTION_MOBILE_DATA;

        public boolean isConnected() {
            return this != CONNECTION_NO_NETWORK;
        }

    }

    private BroadcastReceiver connectionReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
//            Log.d(TAG, "Network connectivity change");
            if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
                notifyConnectionUpdate();
            }
        }
    };

    private NetworkConnectionListener() {
        initialize(LWQApplication.get());
    }

    private void initialize(Context context) {
        context.registerReceiver(connectionReceiver,
                new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
    }

    public ConnectionType getConnectionType() {
        ConnectivityManager connectivityManager =
                (ConnectivityManager) LWQApplication.get().getSystemService(
                        Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo();

        if (netInfo != null) {
            Log.d(TAG, netInfo.toString());
        }
        if (netInfo == null || !netInfo.isAvailable() || !netInfo.isConnected()) {
            return ConnectionType.CONNECTION_NO_NETWORK;
        } else if ((netInfo.getType() == ConnectivityManager.TYPE_WIFI)
                    || (netInfo.getType() == ConnectivityManager.TYPE_WIMAX)) {
                return ConnectionType.CONNECTION_WIFI;
        } else if ((netInfo.getType() == ConnectivityManager.TYPE_MOBILE)
                    || (netInfo.getType() == ConnectivityManager.TYPE_MOBILE_DUN)) {
                return ConnectionType.CONNECTION_MOBILE_DATA;
        } else {
            return ConnectionType.CONNECTION_UNKNOWN;
        }
    }

    private void notifyConnectionUpdate() {
        EventBus.getDefault().post(new NetworkConnectivityEvent(getConnectionType()));
    }

    @Override
    protected void finalize() throws Throwable {
        try {
            LWQApplication.get().unregisterReceiver(connectionReceiver);
        } catch (Exception e) {
            e.printStackTrace();
        }
        super.finalize();
    }
}


text:
pub use self::piano_roll::PianoRoll;
pub use self::ruler::Ruler;
use conrod_core as conrod;
use time_calc as time;

pub mod automation;
pub mod piano_roll;
pub mod ruler;

/// The default height used for tracks if none was specified by the user.
pub const DEFAULT_HEIGHT: conrod::Scalar = 70.0;

/// Widgets that may be set as the `Timeline`'s `Track`s.
pub trait Widget: conrod::Widget {
    /// Build the widget with the given playhead position and delta in ticks.
    ///
    /// If this method is not overridden, the playhead will be ignored.
    fn playhead(self, (time::Ticks, time::Ticks)) -> Self {
        self
    }
}


text:
package com.sdk.put.request;

public class PinRequest {
    final boolean pinned;

    public PinRequest(boolean pin) {
        pinned = pin;
    }
}


text:
package pack;

public class Bidon {
    private int volumeMax;

    private int volume;

    public Bidon(int vmax) {
        pack.Bidon.this.volumeMax = vmax;
    }

    public int getVolume() {
        return volume;
    }

    public void setVolume(int mVol) {
        pack.Bidon.this.volume = mVol;
    }

    public int getVolumeMax() {
        return volumeMax;
    }

    public void vider() {
        setVolume(0);
    }

    public void remplir() {
        setVolume(volumeMax);
    }

    public int transvaser(pack.Bidon dest) {
        int vdeplace;
        int sum = (pack.Bidon.this.getVolume()) + (dest.getVolume());
        if (sum > (dest.getVolumeMax())) {
            vdeplace = (dest.getVolumeMax()) - (dest.getVolume());
            dest.setVolume(dest.getVolumeMax());
            pack.Bidon.this.setVolume(((pack.Bidon.this.getVolume()) - vdeplace));
        } else {
            vdeplace = pack.Bidon.this.getVolume();
            dest.setVolume(sum);
            pack.Bidon.this.vider();
        }
        return vdeplace;
    }
}


text:
package org.chocosolver.util.objects.setDataStructures.swapList;

import gnu.trove.list.array.TIntArrayList;
import org.chocosolver.util.objects.setDataStructures.ISet;
import org.chocosolver.util.objects.setDataStructures.ISetIterator;
import org.chocosolver.util.objects.setDataStructures.SetType;

/**
 * Set of integers based on BipartiteSet implementation for small sets (arraylist inside)
 * BEWARE : CANNOT BOTH ADD AND REMOVE ELEMENTS DURING SEARCH
 *
 * @author : Charles Prud'homme, Jean-Guillaume FAGES
 */
public class Set_Swap2 implements ISet {

	//***********************************************************************************
	// VARIABLES
	//***********************************************************************************

    protected int size;
    protected TIntArrayList values;
    private ISetIterator iter = newIterator();

    //***********************************************************************************
	// CONSTRUCTOR
	//***********************************************************************************

	/**
	 * Creates an empty bipartite set
	 */
	public Set_Swap2(){
		size = 0;
        values = new TIntArrayList(4);
	}

	//***********************************************************************************
	// METHODS
	//***********************************************************************************

    @Override
    public boolean add(int element) {
        if(!contains(element)){
            values.insert(size, element);
			size++;
            return true;
        }
        return false;
    }

    @Override
    public boolean remove(int element) {
        int pos = values.indexOf(element);
        int s = size();
		if(pos > -1 && pos < s){
            iter.notifyRemoving(element);
            s--;
			int t = values.get(s);
			values.set(pos, t);
			values.set(s, element);
            size--;
            return true;
        }else return false;
    }

    @Override
    public boolean contains(int element) {
        int pos = values.indexOf(element);
        return pos > -1 && pos < size();
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public void clear() {
        size = 0;
    }

    @Override
    public int min() {
        if(isEmpty()) throw new IllegalStateException("cannot find minimum of an empty set");
        int min = values.get(0);
        for(int i = 1; i< size(); i++){
            if(min > values.get(i)){
                min = values.get(i);
            }
        }
        return min;
    }

    @Override
    public int max() {
        if(isEmpty()) throw new IllegalStateException("cannot find maximum of an empty set");
        int max = values.get(0);
        for(int i = 1; i< size(); i++){
            if(max < values.get(i)){
                max = values.get(i);
            }
        }
        return max;
    }

    @Override
    public SetType getSetType() {
        return SetType.SMALLBIPARTITESET;
    }

	@Override
	public String toString() {
		StringBuilder st = new StringBuilder("{");
		ISetIterator iter = newIterator();
		while (iter.hasNext()) {
			st.append(iter.nextInt()).append(", ");
		}
		st.append("}");
		return st.toString().replace(", }","}");
	}

    @Override
    public ISetIterator iterator(){
        iter.reset();
        return iter;
    }

    @Override
    public ISetIterator newIterator(){
        return new ISetIterator() {
            private int idx;
            @Override
            public void reset() {
                idx = 0;
            }
            @Override
            public void notifyRemoving(int item) {
                if(idx>0 && item == values.get(idx-1)){
                    idx--;
                }
            }
            @Override
            public boolean hasNext() {
                return idx < size();
            }
            @Override
            public int nextInt() {
                idx ++;
                return values.get(idx-1);
            }
        };
    }
}


text:
#pragma once

#include <pangolin/log/packetstream_reader.h>
#include <pangolin/log/playback_session.h>
#include <pangolin/video/stream_encoder_factory.h>
#include <pangolin/video/video.h>

namespace pangolin
{

class PANGOLIN_EXPORT PangoVideo
    : public VideoInterface, public VideoPropertiesInterface, public VideoPlaybackInterface
{
public:
    PangoVideo(const std::string& filename, std::shared_ptr<PlaybackSession> playback_session);
    ~PangoVideo();

    // Implement VideoInterface

    size_t SizeBytes() const override;

    const std::vector<StreamInfo>& Streams() const override;

    void Start() override;

    void Stop() override;

    bool GrabNext( unsigned char* image, bool wait = true ) override;

    bool GrabNewest( unsigned char* image, bool wait = true ) override;

    // Implement VideoPropertiesInterface
    const picojson::value& DeviceProperties() const override {
        if (-1 == _src_id) throw std::runtime_error("Not initialised");
        return _device_properties;
    }

    const picojson::value& FrameProperties() const override {
        return _frame_properties;
    }

    // Implement VideoPlaybackInterface

    size_t GetCurrentFrameId() const override;

    size_t GetTotalFrames() const override;

    size_t Seek(size_t frameid) override;

    std::string GetSourceUri();

private:
    void HandlePipeClosed();

protected:
    int FindPacketStreamSource();
    void SetupStreams(const PacketStreamSource& src);

    const std::string _filename;
    std::shared_ptr<PlaybackSession> _playback_session;
    std::shared_ptr<PacketStreamReader> _reader;
    SyncTimeEventPromise _event_promise;
    int _src_id;
    const PacketStreamSource* _source;

    size_t _size_bytes;
    bool _fixed_size;
    std::vector<StreamInfo> _streams;
    std::vector<ImageDecoderFunc> stream_decoder;
    picojson::value _device_properties;
    picojson::value _frame_properties;
    std::string _source_uri;

    Registration<size_t> session_seek;
};

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Botanisches Centralblatt, Beihefte 35(1): 530 (1918)

#### Original name
Peronospora thlaspeos-alpestris Gäum.

### Remarks
null


text:
cask 'radio-silence' do
  version '2.3'
  sha256 '0127f722cb15768392437b917d2beed2cbcab35eeccee2d77c61ac2a5997ebd1'

  url "https://radiosilenceapp.com/downloads/Radio_Silence_#{version}.pkg"
  appcast 'https://radiosilenceapp.com/update',
          checkpoint: 'd3f64a45603b0db6cb97cf04e833f399018d8397203d31c5144c40a470aacbf2'
  name 'Radio Silence'
  homepage 'https://radiosilenceapp.com/'

  pkg "Radio_Silence_#{version}.pkg"

  # We intentionally unload the kext twice as a workaround
  # See https://github.com/Homebrew/homebrew-cask/pull/1802#issuecomment-34171151

  uninstall early_script: {
                            executable:   '/sbin/kextunload',
                            args:         ['-b', 'com.radiosilenceapp.nke.filter'],
                            must_succeed: false,
                          },
            quit:         'com.radiosilenceapp.client',
            kext:         'com.radiosilenceapp.nke.filter',
            pkgutil:      'com.radiosilenceapp.*',
            launchctl:    [
                            'com.radiosilenceapp.trial',
                            'com.radiosilenceapp.agent',
                            'com.radiosilenceapp.nke',
                          ]

  zap trash: '~/Library/Application Support/Radio Silence'
end


text:
using System.Collections.Generic;
using Contracts.Infrastructure;
using iQuarc.AppBoot;

namespace ConsoleHost
{
    [Service(typeof(IModulesHostContainer), Lifetime.Application)]
    class ModulesHostContainer : IModulesHostContainer
    {
        private readonly List<string> modules =new List<string>();

        public void RegisterModule(string moduleName)
        {
            modules.Add(moduleName);
        }

        public IEnumerable<string> GetModules()
        {
            return modules;
        }
    }
}