text:
import sys

import mock

from profimp import tracer
from tests.unit import test

if sys.version_info[0] == 3:
    import builtins
else:
    import __builtin__ as builtins

class TracePointTestCase(test.TestCase):

    def test_init(self):
        pt = tracer.TracePoint("some_import_line", level=10)
        self.assertEqual(0, pt.started_at)
        self.assertEqual(0, pt.finished_at)
        self.assertEqual("some_import_line", pt.import_line)
        self.assertEqual(10, pt.level)
        self.assertEqual([], pt.children)

    @mock.patch("time.time", side_effect=[1, 2])
    def test_context(self, mock_time):
        with tracer.TracePoint("some_import_line") as pt:
            self.assertEqual(1, pt.started_at)

        self.assertEqual(2, pt.finished_at)

    @mock.patch("time.time", side_effect=[1, 2, 3, 4])
    def test_to_dict(self, mock_time):
        pt = tracer.TracePoint("import_line", module="main",
                               filepath="main.py", level=2)
        pt_child = tracer.TracePoint("import_child")
        pt.add_child(pt_child)
        pt.start()
        pt_child.start()
        pt_child.stop()
        pt.stop()

        expected_pt_child_dict = {
            "started_at": 2,
            "finished_at": 3,
            "duration": 1000,
            "import_line": "import_child",
            "module": None,
            "filepath": None,
            "level": 3,
            "children": []
        }

        exepected_pt_dict = {
            "started_at": 1,
            "finished_at": 4,
            "duration": 3000,
            "import_line": "import_line",
            "module": "main",
            "filepath": "main.py",
            "level": 2,
            "children": [expected_pt_child_dict]
        }

        self.assertEqual(expected_pt_child_dict, pt_child.to_dict())
        self.assertEqual(exepected_pt_dict, pt.to_dict())

    @mock.patch("time.time", side_effect=[10])
    def test_start(self, mock_time):
        pt = tracer.TracePoint("import_line")
        pt.start()
        self.assertEqual(10, pt.started_at)

    @mock.patch("time.time", side_effect=[10])
    def test_stop(self, mock_time):
        pt = tracer.TracePoint("import_line")
        pt.stop()
        self.assertEqual(10, pt.finished_at)

    def test_add_child(self):
        pt = tracer.TracePoint("import_line")
        pt_child1 = tracer.TracePoint("import_line")
        pt_child11 = tracer.TracePoint("import_line")
        pt_child12 = tracer.TracePoint("import_line")
        pt_child2 = tracer.TracePoint("import_line")

        pt.add_child(pt_child1)
        pt_child1.add_child(pt_child11)
        pt_child1.add_child(pt_child12)
        pt.add_child(pt_child2)

        self.assertEqual([pt_child11, pt_child12], pt_child1.children)
        self.assertEqual([pt_child1, pt_child2], pt.children)

        self.assertEqual(0, pt.level)
        self.assertEqual(1, pt_child1.level)
        self.assertEqual(1, pt_child2.level)
        self.assertEqual(2, pt_child11.level)
        self.assertEqual(2, pt_child12.level)

class TraceModuleTestCase(test.TestCase):

    @mock.patch("profimp.tracer.TracePoint")
    def test_init_stack(self, mock_trace_pt):
        trace_pt = tracer.init_stack()
        mock_trace_pt.assert_called_once_with("root", 0)
        self.assertEqual(mock_trace_pt.return_value, trace_pt)
        self.assertEqual([mock_trace_pt.return_value], tracer.TRACE_STACK)

    @mock.patch("profimp.tracer._traceit")
    def test_patch_import(self, mock_traceit):
        normal_import = builtins.__import__

        with tracer.patch_import():
            self.assertEqual(mock_traceit.return_value, builtins.__import__)
            self.assertNotEqual(normal_import, builtins.__import__)

        self.assertEqual(normal_import, builtins.__import__)

    def test__traceit(self):
        tr_pt = tracer.init_stack()
        with tracer.patch_import():
            exec("import re")

        self.assertEqual(1, len(tr_pt.children))
        self.assertEqual("import re", tr_pt.children[0].import_line)
        self.assertIsNotNone(tr_pt.children[0].filepath)

    def test__traceit_from_import(self):
        tr_pt = tracer.init_stack()
        with tracer.patch_import():
            exec("from os import sys")

        self.assertEqual(1, len(tr_pt.children))
        self.assertEqual("from os import sys", tr_pt.children[0].import_line)


text:
Current file types supported: **PDF, PNG, JPEG, GIF, BMP, WEBP, SVG**

Calipers was built to provide a method of determining the dimensions of an image or PDF much faster and less resource-intensive than shelling-out to ImageMagick. At [Lob](https://lob.com) we must validate image and PDF sizes during the lifecyle of an API request. The simplest way to do this is to shell-out to ImageMagick to identify the type and size of a file. For high-traffic servers, this becomes a major bottleneck due to the inefficiency of shelling-out.

Calipers remains performant because it avoids spawning child processes and it doesn't read entire files into memory. Instead, it intelligently reads only parts of the files that are necessary to determine the type and the dimensions of the file.

# Installation

Calipers uses a plugin architecture to allow users to include support for only the specific file types they need to measure. This helps avoid wasting CPU cycles measuring file types that an application doesn't support, and ensures users must only install dependencies that are absolutely needed (e.g. Poppler for PDF support).

To use Calipers, you must install the core library and at least one plugin. For example, for PNG support:

```
npm install --save calipers calipers-png
```

### Official Plugins

Here is a list of officially supported plugins:

File Type | Plugin
--------- | ------
PNG       | [calipers-png](https://github.com/calipersjs/calipers-png)
JPEG      | [calipers-jpeg](https://github.com/calipersjs/calipers-jpeg)
PDF †    | [calipers-pdf](https://github.com/calipersjs/calipers-pdf)
GIF       | [calipers-gif](https://github.com/calipersjs/calipers-gif)
BMP       | [calipers-bmp](https://github.com/calipersjs/calipers-bmp)
WEBP      | [calipers-webp](https://github.com/calipersjs/calipers-webp)
SVG       | [calipers-svg](https://github.com/calipersjs/calipers-svg)

##### † PDF Support

The [Poppler](http://poppler.freedesktop.org/) library C++ interface is required for PDF support. You must install Poppler before running `npm install calipers-pdf`.

To install Poppler on Mac OS X using Homebrew:

```
brew install poppler
```

To install Poppler on Ubuntu:

```
apt-get install pkg-config
apt-get install libpoppler-cpp-dev
```

# Usage

Calipers must be initialized by calling the required function with supported file types passed in. Use the plugin name's suffix (everything after the first "-") as an argument.

```javascript
// Initializes Calipers with support for calipers-png, calipers-jpeg, calipers-pdf.
var Calipers = require('calipers')('png', 'jpeg', 'pdf');
```

Calipers exposes a single function, `measure`, once initialized.

### `measure(filePath, [callback])`

Measures the file at the given path.
- `filePath` - The path of the file.
- `callback` - called when the file has been measured
  - `err` - An Error is thrown for unsupported file types or corrupt files.
  - `result` - Contains keys `type` and `pages`, where `type` is a string representing the file type (e.g. `'png'`), and `pages` is an array of objects with keys `width` and `height`. For image files, `pages` always has 1 element and `width` and `height` are the integer pixel dimensions. For PDF `width` and `height` are floating-point PostScript Point dimensions.

# Examples

```js
var Calipers = require('calipers')('png', 'pdf');

// You can use a callback:
Calipers.measure('/path/to/document.pdf', function (err, result) {
  // result:
  // {
  //   type: 'pdf',
  //   pages: [
  //     {
  //       width: 450,
  //       height: 670
  //     },
  //     {
  //       width: 450,
  //       height: 670
  //     }
  //   ]
  // }
});

// Or you can use promises:
Calipers.measure('/path/to/file.png')
.then(function (result) {
  // result:
  // {
  //   type: 'png',
  //   pages: [
  //     {
  //       width: 450,
  //       height: 670
  //     }
  //   ]
  // }
});
```

# Custom Plugins

Calipers also allows custom plugins for file types that are not officially supported or application-specific measuring. A Calipers plugin is simply an object with two functions, `detect` and `measure`.

##### `detect(buffer)`

```
@param {Buffer} buffer - a Node buffer containing the first 16 bytes of the file
@returns {Boolean} true if the given buffer is a file type supported by the plugin
```

##### `measure(path, fd)`

```
@param {String} path - the file to measure
@param {Integer} fd - an opened, read-only file descriptor of the file; do not close,
  Calipers will close file descriptors automatically
@returns {Promise<Object> | Object} an object or promise resolving an object
  containing 'type' and 'pages' fields. 'pages' is an array of objects, each with
  a 'width' and 'height'
```

The simple (and useless) example below illustrates how to create and use a custom plugin.

```javascript
var fakePlugin = {
  detect: function (buffer) {
    // Return true if the file starts with 'fake'.
    return buffer.toString('ascii', 0, 4) === 'fake';
  },
  measure: function (path, fd) {
    // Return an arbitrary measurement.
    return {
      type: 'fake',
      pages: [{
        width: 0,
        height: 0
      }]
    };
  }
};

var Calipers = require('calipers')('png', 'jpeg', fakePlugin);

Calipers.measure('path/to/file/that/starts/with/fake')
.then(function (result) {
  // result:
  // {
  //   type: 'fake',
  //   pages: [{
  //     width: 0,
  //     height: 0
  //   }]
  // }
});
```

# Benchmarks

As with all benchmarks, take these with a grain of salt. You can run the benchmarks on your own hardware by cloning the benchmark repository: https://github.com/calipersjs/benchmark.

These benchmarks show the time taken to measure 500 iterations of each file type and each method with a concurrency of 50. They were run on a Mid-2014 13" MacBook Pro with a 2.6 GHz Intel Core i5.

File Type | Shell Out Time (ms) | Calipers Time (ms)
--------- | ------------------: | -----------------:
PDF  | 2001 † | 92
PNG  | 1814 †† | 34
JPEG | 1819 †† | 56
GIF  | 2411 †† | 36
BMP  | 1788 †† | 35

† Measured by spawning a child process which runs Poppler's `pdfinfo` command.

†† Measured by spawning a child process which runs ImageMagicks's `identify` command.

# Contribute

### Bug Reporting

The easiest and most helpful way to contribute is to find a file that Calipers incorrectly measures, and submit an issue or PR with the file.

### New Plugins

If there is a file type you'd like to see supported, create an issue for it and we'll do our best to support it. Also, if you've created a custom plugin that you've found useful, please consider offering it as an official plugin.

##### Inspiration

Inspired by netroy's image-size library: https://github.com/netroy/image-size

redpajama_set_name: RedPajamaGithub


text:
+++
title = "Developer Call: Sovereign smart home"
starts = "2022-09-15T09:00:00"
ends = "2022-09-15T10:30:00"
timezone = "America/Los_Angeles"
location = "Online Event"
image = "https://storage.googleapis.com/media.urbit.org/site/events/%202022-09-15-Developer-Call.jpg"
registration_url = "https://www.meetup.com/urbit-sf/events/288072398"
description = ""
dark = true
darken_image = "true"
youtube = "TKfcdF43cak"

[[hosts]]
name = "Neal Davis"
patp = "~lagrev-nocfep"

[[guests]]
patp = "~pilwyc-fastec"

+++

Join us on September 15th to talk to ~pilwyc-fastec about Communal Computing and the Internet of Things (IoT). ~pilwyc-fastec has been studying how Urbit and Internet of Things (IoT) devices can complement each other securely. Connected devices open up new frontiers of integration and automation, but have tradeoffs in security and control worth considering as users and developers.

~pilwyc-fastec is an IoT hobbyist, smart home enthusiast, Alexa skill builder, and most recently was product manager for the identity platform, biometric recognition machine learning, and voice assistant integration for Facebook's Portal. He recently published [a blog post on Communal Computing](https://urbit.org/blog/smart-home-of-the-future).

We'll discuss how Urbit and Communal Computing ideas complement each other, and where work remains to be done. The smartest home is one you still control yourself.


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

import static org.apache.hadoop.hbase.HConstants.REPLICATION_CLUSTER_ID;
import static org.apache.hadoop.hbase.HConstants.REPLICATION_CONF_DIR;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellBuilder;
import org.apache.hadoop.hbase.CellBuilderFactory;
import org.apache.hadoop.hbase.CellBuilderType;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtil;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessor;
import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.RegionObserver;
import org.apache.hadoop.hbase.io.hfile.HFile;
import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
import org.apache.hadoop.hbase.replication.ReplicationPeerConfig;
import org.apache.hadoop.hbase.replication.TestReplicationBase;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.ReplicationTests;
import org.apache.hadoop.hbase.tool.BulkLoadHFilesTool;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TemporaryFolder;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Integration test for bulk load replication. Defines three clusters, with the following
 * replication topology: "1 <-> 2 <-> 3" (active-active between 1 and 2, and active-active between 2
 * and 3). For each of defined test clusters, it performs a bulk load, asserting values on bulk
 * loaded file gets replicated to other two peers. Since we are doing 3 bulk loads, with the given
 * replication topology all these bulk loads should get replicated only once on each peer. To assert
 * this, this test defines a preBulkLoad coprocessor and adds it to all test table regions, on each
 * of the clusters. This CP counts the amount of times bulk load actually gets invoked, certifying
 * we are not entering the infinite loop condition addressed by HBASE-22380.
 */
@Category({ ReplicationTests.class, MediumTests.class })
public class TestBulkLoadReplication extends TestReplicationBase {

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

  protected static final Logger LOG = LoggerFactory.getLogger(TestBulkLoadReplication.class);

  private static final String PEER1_CLUSTER_ID = "peer1";
  private static final String PEER2_CLUSTER_ID = "peer2";
  private static final String PEER3_CLUSTER_ID = "peer3";

  private static final String PEER_ID1 = "1";
  private static final String PEER_ID3 = "3";

  private static AtomicInteger BULK_LOADS_COUNT;
  private static CountDownLatch BULK_LOAD_LATCH;

  protected static final HBaseTestingUtil UTIL3 = new HBaseTestingUtil();
  protected static final Configuration CONF3 = UTIL3.getConfiguration();

  private static final Path BULK_LOAD_BASE_DIR = new Path("/bulk_dir");

  private static Table htable3;

  @Rule
  public TestName name = new TestName();

  @ClassRule
  public static TemporaryFolder testFolder = new TemporaryFolder();

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    setupBulkLoadConfigsForCluster(CONF1, PEER1_CLUSTER_ID);
    setupBulkLoadConfigsForCluster(CONF2, PEER2_CLUSTER_ID);
    setupBulkLoadConfigsForCluster(CONF3, PEER3_CLUSTER_ID);
    setupConfig(UTIL3, "/3");
    TestReplicationBase.setUpBeforeClass();
    startThirdCluster();
  }

  private static void startThirdCluster() throws Exception {
    LOG.info("Setup Zk to same one from UTIL1 and UTIL2");
    UTIL3.setZkCluster(UTIL1.getZkCluster());
    UTIL3.startMiniCluster(NUM_SLAVES1);

    TableDescriptor table = TableDescriptorBuilder.newBuilder(tableName)
      .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(famName).setMobEnabled(true)
        .setMobThreshold(4000).setScope(HConstants.REPLICATION_SCOPE_GLOBAL).build())
      .setColumnFamily(ColumnFamilyDescriptorBuilder.of(noRepfamName)).build();

    Connection connection3 = ConnectionFactory.createConnection(CONF3);
    try (Admin admin3 = connection3.getAdmin()) {
      admin3.createTable(table, HBaseTestingUtil.KEYS_FOR_HBA_CREATE_TABLE);
    }
    UTIL3.waitUntilAllRegionsAssigned(tableName);
    htable3 = connection3.getTable(tableName);
  }

  @Before
  @Override
  public void setUpBase() throws Exception {
    // "super.setUpBase()" already sets replication from 1->2,
    // then on the subsequent lines, sets 2->1, 2->3 and 3->2.
    // So we have following topology: "1 <-> 2 <->3"
    super.setUpBase();
    ReplicationPeerConfig peer1Config = getPeerConfigForCluster(UTIL1);
    ReplicationPeerConfig peer2Config = getPeerConfigForCluster(UTIL2);
    ReplicationPeerConfig peer3Config = getPeerConfigForCluster(UTIL3);
    // adds cluster1 as a remote peer on cluster2
    UTIL2.getAdmin().addReplicationPeer(PEER_ID1, peer1Config);
    // adds cluster3 as a remote peer on cluster2
    UTIL2.getAdmin().addReplicationPeer(PEER_ID3, peer3Config);
    // adds cluster2 as a remote peer on cluster3
    UTIL3.getAdmin().addReplicationPeer(PEER_ID2, peer2Config);
    setupCoprocessor(UTIL1);
    setupCoprocessor(UTIL2);
    setupCoprocessor(UTIL3);
    BULK_LOADS_COUNT = new AtomicInteger(0);
  }

  private ReplicationPeerConfig getPeerConfigForCluster(HBaseTestingUtil util) {
    return ReplicationPeerConfig.newBuilder().setClusterKey(util.getClusterKey())
      .setSerial(isSerialPeer()).build();
  }

  private void setupCoprocessor(HBaseTestingUtil cluster) {
    cluster.getHBaseCluster().getRegions(tableName).forEach(r -> {
      try {
        TestBulkLoadReplication.BulkReplicationTestObserver cp = r.getCoprocessorHost()
          .findCoprocessor(TestBulkLoadReplication.BulkReplicationTestObserver.class);
        if (cp == null) {
          r.getCoprocessorHost().load(TestBulkLoadReplication.BulkReplicationTestObserver.class, 0,
            cluster.getConfiguration());
          cp = r.getCoprocessorHost()
            .findCoprocessor(TestBulkLoadReplication.BulkReplicationTestObserver.class);
          cp.clusterName = cluster.getClusterKey();
        }
      } catch (Exception e) {
        LOG.error(e.getMessage(), e);
      }
    });
  }

  @After
  @Override
  public void tearDownBase() throws Exception {
    super.tearDownBase();
    UTIL2.getAdmin().removeReplicationPeer(PEER_ID1);
    UTIL2.getAdmin().removeReplicationPeer(PEER_ID3);
    UTIL3.getAdmin().removeReplicationPeer(PEER_ID2);
  }

  protected static void setupBulkLoadConfigsForCluster(Configuration config,
    String clusterReplicationId) throws Exception {
    config.setBoolean(HConstants.REPLICATION_BULKLOAD_ENABLE_KEY, true);
    config.set(REPLICATION_CLUSTER_ID, clusterReplicationId);
    File sourceConfigFolder = testFolder.newFolder(clusterReplicationId);
    File sourceConfigFile = new File(sourceConfigFolder.getAbsolutePath() + "/hbase-site.xml");
    config.writeXml(new FileOutputStream(sourceConfigFile));
    config.set(REPLICATION_CONF_DIR, testFolder.getRoot().getAbsolutePath());
  }

  @Test
  public void testBulkLoadReplicationActiveActive() throws Exception {
    Table peer1TestTable = UTIL1.getConnection().getTable(TestReplicationBase.tableName);
    Table peer2TestTable = UTIL2.getConnection().getTable(TestReplicationBase.tableName);
    Table peer3TestTable = UTIL3.getConnection().getTable(TestReplicationBase.tableName);
    byte[] row = Bytes.toBytes("001");
    byte[] value = Bytes.toBytes("v1");
    assertBulkLoadConditions(tableName, row, value, UTIL1, peer1TestTable, peer2TestTable,
      peer3TestTable);
    row = Bytes.toBytes("002");
    value = Bytes.toBytes("v2");
    assertBulkLoadConditions(tableName, row, value, UTIL2, peer1TestTable, peer2TestTable,
      peer3TestTable);
    row = Bytes.toBytes("003");
    value = Bytes.toBytes("v3");
    assertBulkLoadConditions(tableName, row, value, UTIL3, peer1TestTable, peer2TestTable,
      peer3TestTable);
    // Additional wait to make sure no extra bulk load happens
    Thread.sleep(400);
    // We have 3 bulk load events (1 initiated on each cluster).
    // Each event gets 3 counts (the originator cluster, plus the two peers),
    // so BULK_LOADS_COUNT expected value is 3 * 3 = 9.
    assertEquals(9, BULK_LOADS_COUNT.get());
  }

  protected void assertBulkLoadConditions(TableName tableName, byte[] row, byte[] value,
    HBaseTestingUtil utility, Table... tables) throws Exception {
    BULK_LOAD_LATCH = new CountDownLatch(3);
    bulkLoadOnCluster(tableName, row, value, utility);
    assertTrue(BULK_LOAD_LATCH.await(1, TimeUnit.MINUTES));
    assertTableHasValue(tables[0], row, value);
    assertTableHasValue(tables[1], row, value);
    assertTableHasValue(tables[2], row, value);
  }

  protected void bulkLoadOnCluster(TableName tableName, byte[] row, byte[] value,
    HBaseTestingUtil cluster) throws Exception {
    String bulkLoadFilePath = createHFileForFamilies(row, value, cluster.getConfiguration());
    copyToHdfs(bulkLoadFilePath, cluster.getDFSCluster());
    BulkLoadHFilesTool bulkLoadHFilesTool = new BulkLoadHFilesTool(cluster.getConfiguration());
    bulkLoadHFilesTool.bulkLoad(tableName, BULK_LOAD_BASE_DIR);
  }

  private void copyToHdfs(String bulkLoadFilePath, MiniDFSCluster cluster) throws Exception {
    Path bulkLoadDir = new Path(BULK_LOAD_BASE_DIR, "f");
    cluster.getFileSystem().mkdirs(bulkLoadDir);
    cluster.getFileSystem().copyFromLocalFile(new Path(bulkLoadFilePath), bulkLoadDir);
  }

  protected void assertTableHasValue(Table table, byte[] row, byte[] value) throws Exception {
    Get get = new Get(row);
    Result result = table.get(get);
    assertTrue(result.advance());
    assertEquals(Bytes.toString(value), Bytes.toString(result.value()));
  }

  protected void assertTableNoValue(Table table, byte[] row, byte[] value) throws Exception {
    Get get = new Get(row);
    Result result = table.get(get);
    assertTrue(result.isEmpty());
  }

  private String createHFileForFamilies(byte[] row, byte[] value, Configuration clusterConfig)
    throws IOException {
    CellBuilder cellBuilder = CellBuilderFactory.create(CellBuilderType.DEEP_COPY);
    cellBuilder.setRow(row).setFamily(TestReplicationBase.famName).setQualifier(Bytes.toBytes("1"))
      .setValue(value).setType(Cell.Type.Put);

    HFile.WriterFactory hFileFactory = HFile.getWriterFactoryNoCache(clusterConfig);
    // TODO We need a way to do this without creating files
    File hFileLocation = testFolder.newFile();
    FSDataOutputStream out = new FSDataOutputStream(new FileOutputStream(hFileLocation), null);
    try {
      hFileFactory.withOutputStream(out);
      hFileFactory.withFileContext(new HFileContextBuilder().build());
      HFile.Writer writer = hFileFactory.create();
      try {
        writer.append(new KeyValue(cellBuilder.build()));
      } finally {
        writer.close();
      }
    } finally {
      out.close();
    }
    return hFileLocation.getAbsoluteFile().getAbsolutePath();
  }

  public static class BulkReplicationTestObserver implements RegionCoprocessor {

    String clusterName;
    AtomicInteger bulkLoadCounts = new AtomicInteger();

    @Override
    public Optional<RegionObserver> getRegionObserver() {
      return Optional.of(new RegionObserver() {

        @Override
        public void postBulkLoadHFile(ObserverContext<RegionCoprocessorEnvironment> ctx,
          List<Pair<byte[], String>> stagingFamilyPaths, Map<byte[], List<Path>> finalPaths)
          throws IOException {
          BULK_LOAD_LATCH.countDown();
          BULK_LOADS_COUNT.incrementAndGet();
          LOG.debug("Another file bulk loaded. Total for {}: {}", clusterName,
            bulkLoadCounts.addAndGet(1));
        }
      });
    }
  }
}


text:
if test `head -1 "$1" | wc -L` -gt 50; then
  echo "Too long commit summary (leave an empty line after the first if it is not part of the summary)" >&2
  exit 1
elif test `head -2 | tail -n +2 "$1" | wc -L` != 0; then
  echo "Commit does not have an empty second line" >&2
  exit 1
elif test `wc -L < "$1"` -gt 72; then
  echo "Commit has too long commit lines (max 72 characters per line)" >&2
  exit 1
fi


text:
from blob_server.app import create_app

app = create_app()
application = app


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>portal</display-name>
    <description>port</description>

    <!-- the tool listener is to register portlets -->
    <listener>
		<listener-class>org.sakaiproject.portal.charon.velocity.PortalRenderEngineContextListener</listener-class>
	</listener>

</web-app>


text:
import React from 'react';
import { shallow } from 'enzyme';
import { ErrorRenderer } from './ErrorRenderer';

it('renderer should render error message', () => {
	const error = { toString: () => 'error' };
	const info = { componentStack: 'info' };
	const actual = shallow(<ErrorRenderer classes={{}} error={error} info={info} />);

	expect(actual).toMatchSnapshot();
});


text:
// <copyright file="PolygonPointTester.Designer.cs" company="Shkyrockett" >
//     Copyright © 2016 - 2020 Shkyrockett. All rights reserved.
// </copyright>
// <author id="shkyrockett">Shkyrockett</author>
// <license>
//     Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </license>
// <summary></summary>
// <remarks></remarks>

namespace MethodSpeedTester
{
    partial class PolygonPointTester
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components is not null))
            {
                components.Dispose();
            }

            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.pictureBox2 = new System.Windows.Forms.PictureBox();
            this.pictureBox3 = new System.Windows.Forms.PictureBox();
            this.pictureBox4 = new System.Windows.Forms.PictureBox();
            this.pictureBox5 = new System.Windows.Forms.PictureBox();
            this.pictureBox6 = new System.Windows.Forms.PictureBox();
            this.pictureBox7 = new System.Windows.Forms.PictureBox();
            this.pictureBox8 = new System.Windows.Forms.PictureBox();
            this.pictureBox9 = new System.Windows.Forms.PictureBox();
            this.pictureBox10 = new System.Windows.Forms.PictureBox();
            this.pictureBox11 = new System.Windows.Forms.PictureBox();
            this.pictureBox12 = new System.Windows.Forms.PictureBox();
            this.pictureBox13 = new System.Windows.Forms.PictureBox();
            this.pictureBox14 = new System.Windows.Forms.PictureBox();
            this.pictureBox15 = new System.Windows.Forms.PictureBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.pictureBox20 = new System.Windows.Forms.PictureBox();
            this.pictureBox19 = new System.Windows.Forms.PictureBox();
            this.pictureBox18 = new System.Windows.Forms.PictureBox();
            this.pictureBox17 = new System.Windows.Forms.PictureBox();
            this.pictureBox16 = new System.Windows.Forms.PictureBox();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox13)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox14)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox15)).BeginInit();
            this.tableLayoutPanel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox20)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox19)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox18)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox17)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox16)).BeginInit();
            this.SuspendLayout();
            //
            // pictureBox1
            //
            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox1.Location = new System.Drawing.Point(3, 3);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(143, 117);
            this.pictureBox1.TabIndex = 0;
            this.pictureBox1.TabStop = false;
            this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox1_Paint);
            //
            // pictureBox2
            //
            this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox2.Location = new System.Drawing.Point(152, 3);
            this.pictureBox2.Name = "pictureBox2";
            this.pictureBox2.Size = new System.Drawing.Size(143, 117);
            this.pictureBox2.TabIndex = 1;
            this.pictureBox2.TabStop = false;
            this.pictureBox2.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox2_Paint);
            //
            // pictureBox3
            //
            this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox3.Location = new System.Drawing.Point(301, 3);
            this.pictureBox3.Name = "pictureBox3";
            this.pictureBox3.Size = new System.Drawing.Size(143, 117);
            this.pictureBox3.TabIndex = 2;
            this.pictureBox3.TabStop = false;
            this.pictureBox3.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox3_Paint);
            //
            // pictureBox4
            //
            this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox4.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox4.Location = new System.Drawing.Point(450, 3);
            this.pictureBox4.Name = "pictureBox4";
            this.pictureBox4.Size = new System.Drawing.Size(143, 117);
            this.pictureBox4.TabIndex = 3;
            this.pictureBox4.TabStop = false;
            this.pictureBox4.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox4_Paint);
            //
            // pictureBox5
            //
            this.pictureBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox5.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox5.Location = new System.Drawing.Point(599, 3);
            this.pictureBox5.Name = "pictureBox5";
            this.pictureBox5.Size = new System.Drawing.Size(143, 117);
            this.pictureBox5.TabIndex = 4;
            this.pictureBox5.TabStop = false;
            this.pictureBox5.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox5_Paint);
            //
            // pictureBox6
            //
            this.pictureBox6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox6.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox6.Location = new System.Drawing.Point(3, 126);
            this.pictureBox6.Name = "pictureBox6";
            this.pictureBox6.Size = new System.Drawing.Size(143, 117);
            this.pictureBox6.TabIndex = 5;
            this.pictureBox6.TabStop = false;
            this.pictureBox6.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox6_Paint);
            //
            // pictureBox7
            //
            this.pictureBox7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox7.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox7.Location = new System.Drawing.Point(152, 126);
            this.pictureBox7.Name = "pictureBox7";
            this.pictureBox7.Size = new System.Drawing.Size(143, 117);
            this.pictureBox7.TabIndex = 6;
            this.pictureBox7.TabStop = false;
            this.pictureBox7.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox7_Paint);
            //
            // pictureBox8
            //
            this.pictureBox8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox8.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox8.Location = new System.Drawing.Point(301, 126);
            this.pictureBox8.Name = "pictureBox8";
            this.pictureBox8.Size = new System.Drawing.Size(143, 117);
            this.pictureBox8.TabIndex = 7;
            this.pictureBox8.TabStop = false;
            this.pictureBox8.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox8_Paint);
            //
            // pictureBox9
            //
            this.pictureBox9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox9.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox9.Location = new System.Drawing.Point(450, 126);
            this.pictureBox9.Name = "pictureBox9";
            this.pictureBox9.Size = new System.Drawing.Size(143, 117);
            this.pictureBox9.TabIndex = 8;
            this.pictureBox9.TabStop = false;
            this.pictureBox9.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox9_Paint);
            //
            // pictureBox10
            //
            this.pictureBox10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox10.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox10.Location = new System.Drawing.Point(599, 126);
            this.pictureBox10.Name = "pictureBox10";
            this.pictureBox10.Size = new System.Drawing.Size(143, 117);
            this.pictureBox10.TabIndex = 9;
            this.pictureBox10.TabStop = false;
            this.pictureBox10.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox10_Paint);
            //
            // pictureBox11
            //
            this.pictureBox11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox11.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox11.Location = new System.Drawing.Point(152, 249);
            this.pictureBox11.Name = "pictureBox11";
            this.pictureBox11.Size = new System.Drawing.Size(143, 117);
            this.pictureBox11.TabIndex = 10;
            this.pictureBox11.TabStop = false;
            this.pictureBox11.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox11_Paint);
            //
            // pictureBox12
            //
            this.pictureBox12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox12.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox12.Location = new System.Drawing.Point(3, 249);
            this.pictureBox12.Name = "pictureBox12";
            this.pictureBox12.Size = new System.Drawing.Size(143, 117);
            this.pictureBox12.TabIndex = 11;
            this.pictureBox12.TabStop = false;
            this.pictureBox12.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox12_Paint);
            //
            // pictureBox13
            //
            this.pictureBox13.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox13.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox13.Location = new System.Drawing.Point(301, 249);
            this.pictureBox13.Name = "pictureBox13";
            this.pictureBox13.Size = new System.Drawing.Size(143, 117);
            this.pictureBox13.TabIndex = 12;
            this.pictureBox13.TabStop = false;
            this.pictureBox13.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox13_Paint);
            //
            // pictureBox14
            //
            this.pictureBox14.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox14.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox14.Location = new System.Drawing.Point(450, 249);
            this.pictureBox14.Name = "pictureBox14";
            this.pictureBox14.Size = new System.Drawing.Size(143, 117);
            this.pictureBox14.TabIndex = 13;
            this.pictureBox14.TabStop = false;
            this.pictureBox14.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox14_Paint);
            //
            // pictureBox15
            //
            this.pictureBox15.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox15.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox15.Location = new System.Drawing.Point(599, 249);
            this.pictureBox15.Name = "pictureBox15";
            this.pictureBox15.Size = new System.Drawing.Size(143, 117);
            this.pictureBox15.TabIndex = 14;
            this.pictureBox15.TabStop = false;
            this.pictureBox15.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox15_Paint);
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 5;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
            this.tableLayoutPanel1.Controls.Add(this.pictureBox20, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox19, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox18, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox17, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox16, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox15, 4, 2);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox2, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox3, 2, 0);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox4, 3, 0);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox5, 4, 0);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox6, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox7, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox8, 2, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox9, 3, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox10, 4, 1);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox12, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox13, 2, 2);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox11, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.pictureBox14, 3, 2);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 21);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 4;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(745, 493);
            this.tableLayoutPanel1.TabIndex = 15;
            //
            // pictureBox20
            //
            this.pictureBox20.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox20.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox20.Location = new System.Drawing.Point(152, 372);
            this.pictureBox20.Name = "pictureBox20";
            this.pictureBox20.Size = new System.Drawing.Size(143, 118);
            this.pictureBox20.TabIndex = 19;
            this.pictureBox20.TabStop = false;
            this.pictureBox20.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox20_Paint);
            //
            // pictureBox19
            //
            this.pictureBox19.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox19.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox19.Location = new System.Drawing.Point(3, 372);
            this.pictureBox19.Name = "pictureBox19";
            this.pictureBox19.Size = new System.Drawing.Size(143, 118);
            this.pictureBox19.TabIndex = 18;
            this.pictureBox19.TabStop = false;
            this.pictureBox19.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox19_Paint);
            //
            // pictureBox18
            //
            this.pictureBox18.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox18.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox18.Location = new System.Drawing.Point(301, 372);
            this.pictureBox18.Name = "pictureBox18";
            this.pictureBox18.Size = new System.Drawing.Size(143, 118);
            this.pictureBox18.TabIndex = 17;
            this.pictureBox18.TabStop = false;
            this.pictureBox18.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox18_Paint);
            //
            // pictureBox17
            //
            this.pictureBox17.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox17.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox17.Location = new System.Drawing.Point(599, 372);
            this.pictureBox17.Name = "pictureBox17";
            this.pictureBox17.Size = new System.Drawing.Size(143, 118);
            this.pictureBox17.TabIndex = 16;
            this.pictureBox17.TabStop = false;
            this.pictureBox17.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox17_Paint);
            //
            // pictureBox16
            //
            this.pictureBox16.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.pictureBox16.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox16.Location = new System.Drawing.Point(450, 372);
            this.pictureBox16.Name = "pictureBox16";
            this.pictureBox16.Size = new System.Drawing.Size(143, 118);
            this.pictureBox16.TabIndex = 15;
            this.pictureBox16.TabStop = false;
            this.pictureBox16.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox16_Paint);
            //
            // comboBox1
            //
            this.comboBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new System.Drawing.Point(0, 0);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(745, 21);
            this.comboBox1.TabIndex = 16;
            this.comboBox1.SelectionChangeCommitted += new System.EventHandler(this.ComboBox1_SelectionChangeCommitted);
            //
            // PolygonPointTester
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(745, 514);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Controls.Add(this.comboBox1);
            this.Name = "PolygonPointTester";
            this.Text = "PolygonPointTester";
            this.Load += new System.EventHandler(this.PolygonPointTester_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox12)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox13)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox14)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox15)).EndInit();
            this.tableLayoutPanel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox20)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox19)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox18)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox17)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox16)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.PictureBox pictureBox2;
        private System.Windows.Forms.PictureBox pictureBox3;
        private System.Windows.Forms.PictureBox pictureBox4;
        private System.Windows.Forms.PictureBox pictureBox5;
        private System.Windows.Forms.PictureBox pictureBox6;
        private System.Windows.Forms.PictureBox pictureBox7;
        private System.Windows.Forms.PictureBox pictureBox8;
        private System.Windows.Forms.PictureBox pictureBox9;
        private System.Windows.Forms.PictureBox pictureBox10;
        private System.Windows.Forms.PictureBox pictureBox11;
        private System.Windows.Forms.PictureBox pictureBox12;
        private System.Windows.Forms.PictureBox pictureBox13;
        private System.Windows.Forms.PictureBox pictureBox14;
        private System.Windows.Forms.PictureBox pictureBox15;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.PictureBox pictureBox20;
        private System.Windows.Forms.PictureBox pictureBox19;
        private System.Windows.Forms.PictureBox pictureBox18;
        private System.Windows.Forms.PictureBox pictureBox17;
        private System.Windows.Forms.PictureBox pictureBox16;
        private System.Windows.Forms.ComboBox comboBox1;
    }
}


text:
package edu.berkeley.velox.exceptions

class UnsuccessfulOperationException(msg: String) extends RuntimeException(msg)

class QueryException(msg: String) extends RuntimeException(msg)


text:
<BroadcastMonitor>
  <updated>2015-08-04T08:02:58</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime>2015-08-04T08:02:57</startTime>
    <itemId>1000080518:1241046</itemId>
    <titleId>216041169</titleId>
    <itemCode>SJ397</itemCode>
    <itemReference></itemReference>
    <titleName>Alright</titleName>
    <artistName>Jamiroquai</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>218</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-04T08:06:30</startTime>
    <itemId>1000080518:0</itemId>
    <titleId>216124150</titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName>*** MAAR EERST 09 SEC (Trein)</titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode>756</CategoryCode>
    <CategoryName>EERST JAAP</CategoryName>
    <itemDuration>10</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>


text:
  Montalet-le-Bois est
       un village
       situé dans le département des Yvelines en Île-de-France. Elle totalisait 322 habitants en 2008.

À coté de Montalet-le-Bois sont situées les villes de
Seraincourt située à 3 km, 1 381 habitants,
Brueil-en-Vexin située à 1 km, 640 habitants,
Guitrancourt située à 5 km, 622 habitants,
Aincourt localisée à 4 km, 885 habitants,
Avernes localisée à 5 km, 810 habitants,
Gargenville située à 5 km, 6 725 habitants,
 entre autres. De plus, Montalet-le-Bois est située à seulement 15 km de Cergy.

Si vous envisagez de venir habiter à Montalet-le-Bois, vous pourrez aisément trouver une maison à acheter.

Le parc de logements, à Montalet-le-Bois, se décomposait en 2011 en six appartements et 125 maisons soit
 un marché plutôt équilibré.


text:
#import <Foundation/Foundation.h>

@interface V2Helper : NSObject

/**
 *  Time & date
 */
+ (NSArray *)localDateStringWithUTCString:(NSString *)dateString;

+ (NSArray *)localDateStringWithUTCString:(NSString *)dateString Separation:(NSString *)separation;

+ (NSTimeInterval)timeIntervalWithUTCString:(NSString *)dateString;

+ (NSString *)timeRemainDescriptionWithTimeInterval:(NSTimeInterval)interval;

+ (NSString *)timeRemainDescriptionWithUTCString:(NSString *)dateString;

+ (NSString *)timeRemainDescriptionWithDateSP:(NSNumber *)dateSP;

+ (CGFloat)getTextWidthWithText:(NSString *)text Font:(UIFont *)font;

+ (CGFloat)getTextHeightWithText:(NSString *)text Font:(UIFont *)font Width:(CGFloat)width;

/**
 *  Other
 */

+ (NSString *)encodeUrlString:(NSString *)urlString;

+ (UIImage *)getImageFromView:(UIView *)view;

+ (UIImage *)getImageWithColor:(UIColor *)color;

+ (UIImage *)getImageWithColor:(UIColor *)color size:(CGSize)size;

/**
 *  Setting
 */

+ (UIImage *)getUserAvatarDefaultFromGender:(NSInteger)gender;

@end


text:
ParlayX
=======

ParlayX SMS Transport
^^^^^^^^^^^^^^^^^^^^^

.. automodule:: vumi.transports.parlayx.parlayx
   :members:
   :show-inheritance:


text:
package org.apache.syncope.client.console.wizards.any;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.cxf.common.util.StringUtils;
import org.apache.syncope.client.console.rest.AnyTypeClassRestClient;
import org.apache.syncope.client.console.rest.GroupRestClient;
import org.apache.syncope.client.console.rest.SchemaRestClient;
import org.apache.syncope.common.lib.EntityTOUtils;
import org.apache.syncope.common.lib.to.AbstractSchemaTO;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.AnyTypeClassTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.MembershipTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.core.util.lang.PropertyResolver;
import org.apache.wicket.extensions.wizard.WizardModel.ICondition;
import org.apache.wicket.extensions.wizard.WizardStep;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.util.ListModel;

public abstract class AbstractAttrs<S extends AbstractSchemaTO> extends WizardStep implements ICondition {

    private static final long serialVersionUID = -5387344116983102292L;

    private final SchemaRestClient schemaRestClient = new SchemaRestClient();

    private final AnyTypeClassRestClient anyTypeClassRestClient = new AnyTypeClassRestClient();

    private final GroupRestClient groupRestClient = new GroupRestClient();

    protected final AnyTO anyTO;

    private final List<String> whichAttrs;

    protected final Map<String, S> schemas = new LinkedHashMap<>();

    protected final Map<String, Map<String, S>> membershipSchemas = new LinkedHashMap<>();

    protected final IModel<List<AttrTO>> attrTOs;

    protected final IModel<List<MembershipTO>> membershipTOs;

    private final List<String> anyTypeClasses;

    public AbstractAttrs(final AnyTO anyTO, final List<String> anyTypeClasses, final List<String> whichAttrs) {
        super();
        this.anyTypeClasses = anyTypeClasses;
        this.attrTOs = new ListModel<>(Collections.<AttrTO>emptyList());
        this.membershipTOs = new ListModel<>(Collections.<MembershipTO>emptyList());

        this.setOutputMarkupId(true);

        this.anyTO = anyTO;
        this.whichAttrs = whichAttrs;
    }

    private List<AttrTO> loadAttrTOs() {
        setSchemas(CollectionUtils.collect(anyTypeClassRestClient.list(anyTO.getAuxClasses()),
                EntityTOUtils.<AnyTypeClassTO>keyTransformer(), new ArrayList<>(anyTypeClasses)));
        setAttrs();
        return AbstractAttrs.this.getAttrsFromTO();
    }

    @SuppressWarnings("unchecked")
    private List<MembershipTO> loadMembershipAttrTOs() {
        List<MembershipTO> memberships = new ArrayList<>();
        try {
            membershipSchemas.clear();

            for (MembershipTO membership : (List<MembershipTO>) PropertyResolver.getPropertyField(
                    "memberships", anyTO).get(anyTO)) {
                setSchemas(membership.getGroupKey(), CollectionUtils.collect(
                        anyTypeClassRestClient.list(getMembershipAuxClasses(membership, anyTO.getType())),
                        EntityTOUtils.<AnyTypeClassTO>keyTransformer(),
                        new ArrayList<String>()));
                setAttrs(membership);

                if (AbstractAttrs.this instanceof PlainAttrs && !membership.getPlainAttrs().isEmpty()) {
                    memberships.add(membership);
                } else if (AbstractAttrs.this instanceof DerAttrs && !membership.getDerAttrs().isEmpty()) {
                    memberships.add(membership);
                } else if (AbstractAttrs.this instanceof VirAttrs && !membership.getVirAttrs().isEmpty()) {
                    memberships.add(membership);
                }
            }
        } catch (WicketRuntimeException | IllegalArgumentException | IllegalAccessException ex) {
            // ignore
        }

        return memberships;
    }

    protected boolean reoderSchemas() {
        return !whichAttrs.isEmpty();
    }

    protected abstract SchemaType getSchemaType();

    private void setSchemas(final String membership, final List<String> anyTypeClasses) {
        final Map<String, S> mscs;

        if (membershipSchemas.containsKey(membership)) {
            mscs = membershipSchemas.get(membership);
        } else {
            mscs = new LinkedHashMap<>();
            membershipSchemas.put(membership, mscs);
        }
        setSchemas(anyTypeClasses, mscs);
    }

    private void setSchemas(final List<String> anyTypeClasses) {
        setSchemas(anyTypeClasses, schemas);
    }

    private void setSchemas(final List<String> anyTypeClasses, final Map<String, S> scs) {
        final List<S> allSchemas;
        if (anyTypeClasses.isEmpty()) {
            allSchemas = Collections.emptyList();
        } else {
            allSchemas = schemaRestClient.getSchemas(getSchemaType(), anyTypeClasses.toArray(new String[] {}));
        }

        scs.clear();

        if (reoderSchemas()) {
            // 1. remove attributes not selected for display
            CollectionUtils.filter(allSchemas, new Predicate<S>() {

                @Override
                public boolean evaluate(final S schemaTO) {
                    return whichAttrs.contains(schemaTO.getKey());
                }
            });

            // 2. sort remainig attributes according to configuration, e.g. attrLayout
            final Map<String, Integer> attrLayoutMap = new HashMap<>(whichAttrs.size());
            for (int i = 0; i < whichAttrs.size(); i++) {
                attrLayoutMap.put(whichAttrs.get(i), i);
            }
            Collections.sort(allSchemas, new Comparator<S>() {

                @Override
                public int compare(final S schema1, final S schema2) {
                    int value = 0;

                    if (attrLayoutMap.get(schema1.getKey()) > attrLayoutMap.get(schema2.getKey())) {
                        value = 1;
                    } else if (attrLayoutMap.get(schema1.getKey()) < attrLayoutMap.get(schema2.getKey())) {
                        value = -1;
                    }

                    return value;
                }
            });
        }
        for (S schemaTO : allSchemas) {
            scs.put(schemaTO.getKey(), schemaTO);
        }
    }

    @Override
    public void renderHead(final IHeaderResponse response) {
        super.renderHead(response);
        if (org.apache.cxf.common.util.CollectionUtils.isEmpty(attrTOs.getObject())
                && org.apache.cxf.common.util.CollectionUtils.isEmpty(membershipTOs.getObject())) {
            response.render(OnDomReadyHeaderItem.forScript(
                    String.format("$('#emptyPlaceholder').append(\"%s\"); $('#attributes').hide();",
                    getString("attribute.empty.list"))));
        }
    }

    protected abstract void setAttrs();

    protected abstract void setAttrs(final MembershipTO membershipTO);

    protected abstract List<AttrTO> getAttrsFromTO();

    protected abstract List<AttrTO> getAttrsFromTO(final MembershipTO membershipTO);

    protected List<String> getMembershipAuxClasses(final MembershipTO membershipTO, final String anyType) {
        try {
            final GroupTO groupTO = groupRestClient.read(membershipTO.getRightKey());
            return groupTO.getTypeExtension(anyType).getAuxClasses();
        } catch (Exception e) {
            return Collections.emptyList();
        }
    }

    @Override
    public boolean evaluate() {
        this.attrTOs.setObject(loadAttrTOs());
        this.membershipTOs.setObject(loadMembershipAttrTOs());
        return CollectionUtils.isNotEmpty(attrTOs.getObject()) || CollectionUtils.isNotEmpty(membershipTOs.getObject());
    }

    protected static class AttrComparator implements Comparator<AttrTO> {

        @Override
        public int compare(final AttrTO left, final AttrTO right) {
            if (left == null || StringUtils.isEmpty(left.getSchema())) {
                return -1;
            }
            if (right == null || StringUtils.isEmpty(right.getSchema())) {
                return 1;
            } else {
                return left.getSchema().compareTo(right.getSchema());
            }
        }
    }

    public class Schemas extends Panel {

        private static final long serialVersionUID = -2447602429647965090L;

        public Schemas(final String id) {
            super(id);
        }
    }
}


text:
#ifndef _CLINK_MEDIA_MYTHTV_RECORDEDITEMNODELIST_H_
#define _CLINK_MEDIA_MYTHTV_RECORDEDITEMNODELIST_H_

#include <cybergarage/util/Vector.h>
#include <cybergarage/upnp/media/server/object/item/mythtv/MythRecordedItemNode.h>

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#ifdef SUPPORT_MYTHTV

namespace CyberLink {

class MythRecordedItemNodeList : public CyberUtil::Vector
{
	bool delElemFlag;

	////////////////////////////////////////////////
	//	Constructor
	////////////////////////////////////////////////

public:

	MythRecordedItemNodeList(bool delElemFlag = true)
	{
		this->delElemFlag = delElemFlag;
	}

	~MythRecordedItemNodeList()
	{
		clear();
	}

	////////////////////////////////////////////////
	//	Methods
	////////////////////////////////////////////////

public:

	MythRecordedItemNode *getRecordedItemNode(int n)
	{
		return (MythRecordedItemNode *)Vector::get(n);
	}

	////////////////////////////////////////////////
	//	clear
	////////////////////////////////////////////////

public:

	void clear();
};

}

#endif

#endif


text:
package xyz.grand.grandeur;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.text.Spanned;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import xyz.grand.grandeur.adapter.PrefManager;

public class WelcomeActivity extends AppCompatActivity
{
    private ViewPager viewPager;
    private MyViewPagerAdapter myViewPagerAdapter;
    private LinearLayout dotsLayout;
    private TextView[] dots;
    private int[] layouts;
    private Button btnSkip, btnNext;
    private PrefManager prefManager;
    private Spanned html;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        // Checking for first time launch - before calling setContentView()
        prefManager = new PrefManager(this);
        if (!prefManager.isFirstTimeLaunch())
        {
            launchHomeScreen();
            finish();
        }

        // Making notification bar transparent
        if (Build.VERSION.SDK_INT >= 21)
        {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }

        setContentView(R.layout.activity_welcome);

        viewPager = (ViewPager) findViewById(R.id.view_pager);
        dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
        btnSkip = (Button) findViewById(R.id.btn_skip);
        btnNext = (Button) findViewById(R.id.btn_next);

        // layouts of all welcome sliders
        // add few more layouts if you want
        layouts = new int[]{
                R.layout.welcome_slide1,
                R.layout.welcome_slide2,
                R.layout.welcome_slide3,
                R.layout.welcome_slide4};

        // adding bottom dots
        addBottomDots(0);

        // making notification bar transparent
        changeStatusBarColor();

        myViewPagerAdapter = new MyViewPagerAdapter();
        viewPager.setAdapter(myViewPagerAdapter);
        viewPager.addOnPageChangeListener(viewPagerPageChangeListener);

        btnSkip.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                launchHomeScreen();
            }
        });

        btnNext.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                // checking for last page
                // if last page home screen will be launched
                int current = getItem(+1);
                if (current < layouts.length)
                {
                    // move to next screen
                    viewPager.setCurrentItem(current);
                }
                else launchHomeScreen();
            }
        });
    }

    private void addBottomDots(int currentPage)
    {
        dots = new TextView[layouts.length];

        int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);
        int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);

        dotsLayout.removeAllViews();
        for (int i = 0; i < dots.length; i++)
        {
            dots[i] = new TextView(this);
            if (Build.VERSION.SDK_INT >= 24) {
                html = Html.fromHtml("•", i); // for 24 api and more
            } else {
                html = Html.fromHtml("•"); // or for older api
            }
            dots[i].setText(html);
            dots[i].setTextSize(35);
            dots[i].setTextColor(colorsInactive[currentPage]);
            dotsLayout.addView(dots[i]);
        }

        if (dots.length > 0)
            dots[currentPage].setTextColor(colorsActive[currentPage]);
    }

    private int getItem(int i) {
        return viewPager.getCurrentItem() + i;
    }

    private void launchHomeScreen()
    {
        prefManager.setFirstTimeLaunch(false);
        startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
        finish();
    }

    //  viewpager change listener
    ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener()
    {

        @Override
        public void onPageSelected(int position)
        {
            addBottomDots(position);

            // changing the next button text 'NEXT' / 'GOT IT'
            if (position == layouts.length - 1)
            {
                // last page. make button text to GOT IT
                btnNext.setText(getString(R.string.start));
                btnSkip.setVisibility(View.GONE);
            }
            else
            {
                // still pages are left
                btnNext.setText(getString(R.string.next));
                btnSkip.setVisibility(View.VISIBLE);
            }
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {}

        @Override
        public void onPageScrollStateChanged(int arg0) {}
    };

    /**
     * Making notification bar transparent
     */
    private void changeStatusBarColor()
    {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
        {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
        }
    }

    /**
     * View pager adapter
     */
    public class MyViewPagerAdapter extends PagerAdapter
    {
        private LayoutInflater layoutInflater;

        public MyViewPagerAdapter() {}

        @Override
        public Object instantiateItem(ViewGroup container, int position)
        {
            layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View view = layoutInflater.inflate(layouts[position], container, false);
            container.addView(view);

            return view;
        }

        @Override
        public int getCount() {
            return layouts.length;
        }

        @Override
        public boolean isViewFromObject(View view, Object obj) {
            return view == obj;
        }

        @Override
        public void destroyItem(ViewGroup container, int position, Object object)
        {
            View view = (View) object;
            container.removeView(view);
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.hadoop.hbase.rest.protobuf.generated.StorageClusterStatusMessage.StorageClusterStatus.Region.Builder (HBase 0.94.8 API)
</TITLE>

<META NAME="date" CONTENT="2013-05-22">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.hadoop.hbase.rest.protobuf.generated.StorageClusterStatusMessage.StorageClusterStatus.Region.Builder

Packages that use StorageClusterStatusMessage.StorageClusterStatus.Region.Builder

org.apache.hadoop.hbase.rest.protobuf.generated

Uses of StorageClusterStatusMessage.StorageClusterStatus.Region.Builder in org.apache.hadoop.hbase.rest.protobuf.generated

Methods in org.apache.hadoop.hbase.rest.protobuf.generated that return StorageClusterStatusMessage.StorageClusterStatus.Region.Builder

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.addRegionsBuilder()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.addRegionsBuilder(int index)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clear()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearCurrentCompactedKVs()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearMemstoreSizeMB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearName()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearReadRequestsCount()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearRootIndexSizeKB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearStorefileIndexSizeMB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearStorefiles()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearStorefileSizeMB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearStores()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearTotalCompactingKVs()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearTotalStaticBloomSizeKB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearTotalStaticIndexSizeKB()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clearWriteRequestsCount()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.clone()

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.getRegionsBuilder(int index)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.mergeFrom(com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.mergeFrom(com.google.protobuf.Message other)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.mergeFrom(StorageClusterStatusMessage.StorageClusterStatus.Region other)

static StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.newBuilder()

static StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.newBuilder(StorageClusterStatusMessage.StorageClusterStatus.Region prototype)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.newBuilderForType()

protected  StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setCurrentCompactedKVs(long value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setMemstoreSizeMB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setName(com.google.protobuf.ByteString value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setReadRequestsCount(long value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setRootIndexSizeKB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setStorefileIndexSizeMB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setStorefiles(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setStorefileSizeMB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setStores(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setTotalCompactingKVs(long value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setTotalStaticBloomSizeKB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setTotalStaticIndexSizeKB(int value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.Builder.setWriteRequestsCount(long value)

 StorageClusterStatusMessage.StorageClusterStatus.Region.Builder
StorageClusterStatusMessage.StorageClusterStatus.Region.toBuilder()

Methods in org.apache.hadoop.hbase.rest.protobuf.generated that return types with arguments of type StorageClusterStatusMessage.StorageClusterStatus.Region.Builder

 List<StorageClusterStatusMessage.StorageClusterStatus.Region.Builder>
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.getRegionsBuilderList()

Methods in org.apache.hadoop.hbase.rest.protobuf.generated with parameters of type StorageClusterStatusMessage.StorageClusterStatus.Region.Builder

 StorageClusterStatusMessage.StorageClusterStatus.Node.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.addRegions(int index,
           StorageClusterStatusMessage.StorageClusterStatus.Region.Builder builderForValue)

 StorageClusterStatusMessage.StorageClusterStatus.Node.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.addRegions(StorageClusterStatusMessage.StorageClusterStatus.Region.Builder builderForValue)

 StorageClusterStatusMessage.StorageClusterStatus.Node.Builder
StorageClusterStatusMessage.StorageClusterStatus.Node.Builder.setRegions(int index,
           StorageClusterStatusMessage.StorageClusterStatus.Region.Builder builderForValue)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2013 The Apache Software Foundation. All Rights Reserved.


text:
<component name="ProjectDictionaryState">
  <dictionary name="devmini" />
</component>


text:
from heron.api.src.python import Grouping

from integration_test.src.python.integration_test.core import TestTopologyBuilder
from integration_test.src.python.integration_test.common.bolt import CountAggregatorBolt
from integration_test.src.python.integration_test.common.bolt import WordCountBolt
from integration_test.src.python.integration_test.common.spout import ABSpout

def fields_grouping_builder(topology_name, http_server_url):
  builder = TestTopologyBuilder(topology_name, http_server_url)
  ab_spout = builder.add_spout("ab-spout", ABSpout, 1, max_executions=400)

  count_bolt = builder.add_bolt("count-bolt", WordCountBolt,
                                inputs={ab_spout: Grouping.fields('word')}, par=2)

  builder.add_bolt("sum-bolt", CountAggregatorBolt,
                   inputs={count_bolt: Grouping.NONE}, par=1)

  return builder.create_topology()


text:
import { TerraIcon } from '../config';

class ReactIcon {
  constructor(name, component) {
    this.name = name;
    this.file = `${TerraIcon.iconDir}${name}.jsx`;
    this.component = component;
  }
}

export default ReactIcon;


text:
UUID v4 generator and validator (RFC4122 compliant)

Name	uuid

Version	0.1.1

Size	1 KB / >1 KB (gzipped)

Environment	Browser, Node.js

## Installation

Via [npm](https://npmjs.org)
```bash
npm install lil-uuid
```

Via [Bower](http://bower.io)
```bash
bower install lil-uuid
```
Via [Component](https://github.com/componentjs/component)
```bash
component install lil-js/uuid
```

Or loading the script remotely
```html
<script src="//cdn.rawgit.com/lil-js/uuid/0.1.0/uuid.js"></script>
```

### Environments

- Node.js
- Chrome >= 5
- Firefox >= 3
- Safari >= 5
- Opera >= 10
- IE >= 9

### Usage

You could fetch de module via `require()` if it's available.
Otherwise, global fallback will be used, exposed via `lil.uuid`

##### Generate an UUID v4 schema
```js
lil.uuid()
// -> f47ac10b-58cc-4372-a567-0e02b2c3d479
```

##### Validate an UUID schema (it support multiple versions)
```js
lil.isUUID('f47ac10b-58cc-4372-a567-0e02b2c3d479')
// -> true
```

## API

#### uuid()
Return: `string`

Generate a random UUID

#### isUUID(str, [version])
Return: `boolean`

Check if a given `string` has a valid UUID format.
It supports multiple version (3, 4 and 5)

#### uuid.VERSION

## Contributing

Wanna help? Cool! It will be appreciated :)

You must add new test cases for any new feature or refactor you do,
always following the same design/code patterns that already exist

### Development

Only [node.js](http://nodejs.org) is required for development

Clone the repository
```bash
$ git clone https://github.com/lil-js/uuid.git && cd uuid
```

Install dependencies
```bash
$ npm install
```

Generate browser bundle source
```bash
$ make browser
```

Run tests
```bash
$ make test
```

## License

[MIT](http://opensource.org/licenses/MIT) © Tomas Aparicio

[travis]: http://travis-ci.org/lil-js/uuid


text:
package problems.medium;

import java.util.*;

/**
 * Created by sherxon on 1/4/17.
 */
public class TopKFrequentElements {
    public List<Integer> topKFrequent(int[] a, int k) {
        Map<Integer,Integer> map= new HashMap<>();
        for(int i:a){
            if (!map.containsKey(i)) map.put(i, 1);
            else map.put(i, map.get(i)+1);
        }
        TreeMap<Integer, Set<Integer>> tr= new TreeMap<>((c, b)->b.compareTo(c));
        for(Integer ii:map.keySet()){
            Integer val=map.get(ii);
            if(!tr.containsKey(val))
                tr.put(val, new HashSet<>());
            tr.get(val).add(ii);
        }

        int i=0;
        List<Integer> list= new ArrayList<>();
        for (Integer integer : tr.keySet()) {
            if(i>=k)break;
            for(Integer num:tr.get(integer)){
                if(i>=k)break;
                list.add(num);
                i++;
            }

        }
        return list;

    }
}


text:
#region Copyright and License
// Copyright 2010..2014 Alexander Reinert
//
// This file is part of the ARSoft.Tools.Net - C# DNS client/server and SPF Library (http://arsofttoolsnet.codeplex.com/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ARSoft.Tools.Net.Dns
{
	/// <summary>
	///   Unknown EDNS option
	/// </summary>
	public class UnknownOption : EDnsOptionBase
	{
		/// <summary>
		///   Binary data of the option
		/// </summary>
		public byte[] Data { get; private set; }

		internal UnknownOption(EDnsOptionType type)
			: base(type) {}

		/// <summary>
		///   Creates a new instance of the UnknownOption class
		/// </summary>
		/// <param name="type"> Type of the option </param>
		/// <param name="data"></param>
		public UnknownOption(EDnsOptionType type, byte[] data)
			: this(type)
		{
			Data = data;
		}

		internal override void ParseData(byte[] resultData, int startPosition, int length)
		{
			Data = DnsMessageBase.ParseByteData(resultData, ref startPosition, length);
		}

		internal override ushort DataLength
		{
			get { return (ushort) ((Data == null) ? 0 : Data.Length); }
		}

		internal override void EncodeData(byte[] messageData, ref int currentPosition)
		{
			DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Data);
		}
	}
}


text: ![restvolley_struct](images/restvolley_struct.png)


text:
package stdlib

import (
	"crypto/tls"
	"go/constant"
	"go/token"
	"reflect"
)

func init() {
	Symbols["crypto/tls"] = map[string]reflect.Value{
		// function, constant and variable definitions
		"CipherSuiteName":                         reflect.ValueOf(tls.CipherSuiteName),
		"CipherSuites":                            reflect.ValueOf(tls.CipherSuites),
		"Client":                                  reflect.ValueOf(tls.Client),
		"CurveP256":                               reflect.ValueOf(tls.CurveP256),
		"CurveP384":                               reflect.ValueOf(tls.CurveP384),
		"CurveP521":                               reflect.ValueOf(tls.CurveP521),
		"Dial":                                    reflect.ValueOf(tls.Dial),
		"DialWithDialer":                          reflect.ValueOf(tls.DialWithDialer),
		"ECDSAWithP256AndSHA256":                  reflect.ValueOf(tls.ECDSAWithP256AndSHA256),
		"ECDSAWithP384AndSHA384":                  reflect.ValueOf(tls.ECDSAWithP384AndSHA384),
		"ECDSAWithP521AndSHA512":                  reflect.ValueOf(tls.ECDSAWithP521AndSHA512),
		"ECDSAWithSHA1":                           reflect.ValueOf(tls.ECDSAWithSHA1),
		"Ed25519":                                 reflect.ValueOf(tls.Ed25519),
		"InsecureCipherSuites":                    reflect.ValueOf(tls.InsecureCipherSuites),
		"Listen":                                  reflect.ValueOf(tls.Listen),
		"LoadX509KeyPair":                         reflect.ValueOf(tls.LoadX509KeyPair),
		"NewLRUClientSessionCache":                reflect.ValueOf(tls.NewLRUClientSessionCache),
		"NewListener":                             reflect.ValueOf(tls.NewListener),
		"NoClientCert":                            reflect.ValueOf(tls.NoClientCert),
		"PKCS1WithSHA1":                           reflect.ValueOf(tls.PKCS1WithSHA1),
		"PKCS1WithSHA256":                         reflect.ValueOf(tls.PKCS1WithSHA256),
		"PKCS1WithSHA384":                         reflect.ValueOf(tls.PKCS1WithSHA384),
		"PKCS1WithSHA512":                         reflect.ValueOf(tls.PKCS1WithSHA512),
		"PSSWithSHA256":                           reflect.ValueOf(tls.PSSWithSHA256),
		"PSSWithSHA384":                           reflect.ValueOf(tls.PSSWithSHA384),
		"PSSWithSHA512":                           reflect.ValueOf(tls.PSSWithSHA512),
		"RenegotiateFreelyAsClient":               reflect.ValueOf(tls.RenegotiateFreelyAsClient),
		"RenegotiateNever":                        reflect.ValueOf(tls.RenegotiateNever),
		"RenegotiateOnceAsClient":                 reflect.ValueOf(tls.RenegotiateOnceAsClient),
		"RequestClientCert":                       reflect.ValueOf(tls.RequestClientCert),
		"RequireAndVerifyClientCert":              reflect.ValueOf(tls.RequireAndVerifyClientCert),
		"RequireAnyClientCert":                    reflect.ValueOf(tls.RequireAnyClientCert),
		"Server":                                  reflect.ValueOf(tls.Server),
		"TLS_AES_128_GCM_SHA256":                  reflect.ValueOf(tls.TLS_AES_128_GCM_SHA256),
		"TLS_AES_256_GCM_SHA384":                  reflect.ValueOf(tls.TLS_AES_256_GCM_SHA384),
		"TLS_CHACHA20_POLY1305_SHA256":            reflect.ValueOf(tls.TLS_CHACHA20_POLY1305_SHA256),
		"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA":    reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA),
		"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256),
		"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256),
		"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA":    reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA),
		"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384),
		"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305":  reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305),
		"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256": reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256),
		"TLS_ECDHE_ECDSA_WITH_RC4_128_SHA":              reflect.ValueOf(tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA),
		"TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA":           reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA),
		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA":            reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA),
		"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256),
		"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256),
		"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA":            reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA),
		"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384":         reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384),
		"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305":          reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305),
		"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256":   reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256),
		"TLS_ECDHE_RSA_WITH_RC4_128_SHA":                reflect.ValueOf(tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA),
		"TLS_FALLBACK_SCSV":                             reflect.ValueOf(tls.TLS_FALLBACK_SCSV),
		"TLS_RSA_WITH_3DES_EDE_CBC_SHA":                 reflect.ValueOf(tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA),
		"TLS_RSA_WITH_AES_128_CBC_SHA":                  reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_CBC_SHA),
		"TLS_RSA_WITH_AES_128_CBC_SHA256":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_CBC_SHA256),
		"TLS_RSA_WITH_AES_128_GCM_SHA256":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_128_GCM_SHA256),
		"TLS_RSA_WITH_AES_256_CBC_SHA":                  reflect.ValueOf(tls.TLS_RSA_WITH_AES_256_CBC_SHA),
		"TLS_RSA_WITH_AES_256_GCM_SHA384":               reflect.ValueOf(tls.TLS_RSA_WITH_AES_256_GCM_SHA384),
		"TLS_RSA_WITH_RC4_128_SHA":                      reflect.ValueOf(tls.TLS_RSA_WITH_RC4_128_SHA),
		"VerifyClientCertIfGiven":                       reflect.ValueOf(tls.VerifyClientCertIfGiven),
		"VersionSSL30":                                  reflect.ValueOf(constant.MakeFromLiteral("768", token.INT, 0)),
		"VersionTLS10":                                  reflect.ValueOf(constant.MakeFromLiteral("769", token.INT, 0)),
		"VersionTLS11":                                  reflect.ValueOf(constant.MakeFromLiteral("770", token.INT, 0)),
		"VersionTLS12":                                  reflect.ValueOf(constant.MakeFromLiteral("771", token.INT, 0)),
		"VersionTLS13":                                  reflect.ValueOf(constant.MakeFromLiteral("772", token.INT, 0)),
		"X25519":                                        reflect.ValueOf(tls.X25519),
		"X509KeyPair":                                   reflect.ValueOf(tls.X509KeyPair),

		// type definitions
		"Certificate":            reflect.ValueOf((*tls.Certificate)(nil)),
		"CertificateRequestInfo": reflect.ValueOf((*tls.CertificateRequestInfo)(nil)),
		"CipherSuite":            reflect.ValueOf((*tls.CipherSuite)(nil)),
		"ClientAuthType":         reflect.ValueOf((*tls.ClientAuthType)(nil)),
		"ClientHelloInfo":        reflect.ValueOf((*tls.ClientHelloInfo)(nil)),
		"ClientSessionCache":     reflect.ValueOf((*tls.ClientSessionCache)(nil)),
		"ClientSessionState":     reflect.ValueOf((*tls.ClientSessionState)(nil)),
		"Config":                 reflect.ValueOf((*tls.Config)(nil)),
		"Conn":                   reflect.ValueOf((*tls.Conn)(nil)),
		"ConnectionState":        reflect.ValueOf((*tls.ConnectionState)(nil)),
		"CurveID":                reflect.ValueOf((*tls.CurveID)(nil)),
		"RecordHeaderError":      reflect.ValueOf((*tls.RecordHeaderError)(nil)),
		"RenegotiationSupport":   reflect.ValueOf((*tls.RenegotiationSupport)(nil)),
		"SignatureScheme":        reflect.ValueOf((*tls.SignatureScheme)(nil)),

		// interface wrapper definitions
		"_ClientSessionCache": reflect.ValueOf((*_crypto_tls_ClientSessionCache)(nil)),
	}
}

// _crypto_tls_ClientSessionCache is an interface wrapper for ClientSessionCache type
type _crypto_tls_ClientSessionCache struct {
	WGet func(sessionKey string) (session *tls.ClientSessionState, ok bool)
	WPut func(sessionKey string, cs *tls.ClientSessionState)
}

func (W _crypto_tls_ClientSessionCache) Get(sessionKey string) (session *tls.ClientSessionState, ok bool) {
	return W.WGet(sessionKey)
}
func (W _crypto_tls_ClientSessionCache) Put(sessionKey string, cs *tls.ClientSessionState) {
	W.WPut(sessionKey, cs)
}


text:
package test.pholser;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author Paul Holser
 * @version $Id: Captor.java,v 1.1 2004/10/26 23:29:47 the_mindstorm Exp $
 */
public class Captor {
  private static Captor instance = null;
  private List captives;

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

  public static void reset() {
//    System.out.println("@@PHOLSER RESETTING CAPTOR");
    instance().captives = new ArrayList();
  }

  public void capture( String aString ) {
//    System.out.println("@@PHOLSER CAPTURING " + aString);
    captives.add( aString );
  }

  public List captives() {
    return Collections.unmodifiableList( captives );
  }
}


text:
#include <ctime>
#include <iostream>
#include <cassert>

#include "keystate/keystate_rollover_cmd.h"
#include "keystate/keystate_rollover_task.h"
#include "shared/duration.h"
#include "shared/file.h"
#include "shared/str.h"
#include "daemon/engine.h"
#include "enforcer/enforce_task.h"

#include "keystate/keystate.pb.h"

#include <algorithm>

static const char *module_str = "keystate_rollover_cmd";

void help_keystate_rollover_cmd(int sockfd)
{
    ods_printf(sockfd,
               "key rollover           Perform a manual key rollover.\n"
               "      --zone <zone>              (aka -z)  zone.\n"
               "      [--keytype <keytype>]      (aka -t)  KSK or ZSK (default all).\n"
        );
}

int handled_keystate_rollover_cmd(int sockfd, engine_type* engine, const char *cmd,
                              ssize_t n)
{
    char buf[ODS_SE_MAXLINE];
    const char *argv[8];
    const int NARGV = sizeof(argv)/sizeof(char*);
    int argc;
    const char *scmd = "key rollover";

    cmd = ods_check_command(cmd,n,scmd);
    if (!cmd)
        return 0; // not handled

    ods_log_debug("[%s] %s command", module_str, scmd);

    // Use buf as an intermediate buffer for the command.
    strncpy(buf,cmd,sizeof(buf));
    buf[sizeof(buf)-1] = '\0';

    // separate the arguments
    argc = ods_str_explode(buf,NARGV,argv);
    if (argc > NARGV) {
        ods_log_warning("[%s] too many arguments for %s command",
                        module_str,scmd);
        ods_printf(sockfd,"too many arguments\n");
		help_keystate_rollover_cmd(sockfd);
        return 1; // errors, but handled
    }

    const char *zone = NULL;
    const char *keytype = NULL;
    (void)ods_find_arg_and_param(&argc,argv,"zone","z",&zone);
    (void)ods_find_arg_and_param(&argc,argv,"keytype","t",&keytype);
    if (argc) {
        ods_log_warning("[%s] unknown arguments for %s command",
                        module_str,scmd);
        ods_printf(sockfd,"unknown arguments\n");
		help_keystate_rollover_cmd(sockfd);
        return 1; // errors, but handled
    }
    if (!zone) {
        ods_log_warning("[%s] expected option --zone <zone> for %s command",
                        module_str,scmd);
        ods_printf(sockfd,"expected --zone <zone> option\n");
		help_keystate_rollover_cmd(sockfd);
        return 1; // errors, but handled
    }

    int nkeytype = 0;
    if (keytype) {
        std::string kt(keytype);
        int (*fp)(int) = toupper;
        std::transform(kt.begin(),kt.end(),kt.begin(),fp);
        if (kt == "KSK") {
            nkeytype = (int)::ods::keystate::KSK;
        } else {
            if (kt == "ZSK") {
                nkeytype = (int)::ods::keystate::ZSK;
            } else {
                if (kt == "CSK") {
                    nkeytype = (int)::ods::keystate::CSK;
                } else {
                    ods_log_warning("[%s] given keytype \"%s\" invalid",
                                    module_str,keytype);
                    ods_printf(sockfd,"given keytype \"%s\" invalid\n",keytype);
					help_keystate_rollover_cmd(sockfd);
                    return 1; // errors, but handled
                }
            }
        }
    }

    time_t tstart = time(NULL);

    perform_keystate_rollover(sockfd,engine->config,zone,nkeytype);

    ods_printf(sockfd,"%s completed in %ld seconds.\n",scmd,time(NULL)-tstart);

    flush_enforce_task(engine);

    return 1;
}