text:
"""lxml custom element classes for shape-tree-related XML elements."""

from __future__ import absolute_import, division, print_function, unicode_literals

from pptx.enum.shapes import MSO_CONNECTOR_TYPE
from pptx.oxml import parse_xml
from pptx.oxml.ns import nsdecls, qn
from pptx.oxml.shapes.autoshape import CT_Shape
from pptx.oxml.shapes.connector import CT_Connector
from pptx.oxml.shapes.graphfrm import CT_GraphicalObjectFrame
from pptx.oxml.shapes.picture import CT_Picture
from pptx.oxml.shapes.shared import BaseShapeElement
from pptx.oxml.xmlchemy import BaseOxmlElement, OneAndOnlyOne, ZeroOrOne
from pptx.util import Emu

class CT_GroupShape(BaseShapeElement):
    """
    Used for the shape tree (``<p:spTree>``) element as well as the group
    shape (``<p:grpSp>``) element.
    """

    nvGrpSpPr = OneAndOnlyOne("p:nvGrpSpPr")
    grpSpPr = OneAndOnlyOne("p:grpSpPr")

    _shape_tags = (
        qn("p:sp"),
        qn("p:grpSp"),
        qn("p:graphicFrame"),
        qn("p:cxnSp"),
        qn("p:pic"),
        qn("p:contentPart"),
    )

    def add_autoshape(self, id_, name, prst, x, y, cx, cy):
        """
        Append a new ``<p:sp>`` shape to the group/shapetree having the
        properties specified in call.
        """
        sp = CT_Shape.new_autoshape_sp(id_, name, prst, x, y, cx, cy)
        self.insert_element_before(sp, "p:extLst")
        return sp

    def add_cxnSp(self, id_, name, type_member, x, y, cx, cy, flipH, flipV):
        """
        Append a new ``<p:cxnSp>`` shape to the group/shapetree having the
        properties specified in call.
        """
        prst = MSO_CONNECTOR_TYPE.to_xml(type_member)
        cxnSp = CT_Connector.new_cxnSp(id_, name, prst, x, y, cx, cy, flipH, flipV)
        self.insert_element_before(cxnSp, "p:extLst")
        return cxnSp

    def add_freeform_sp(self, x, y, cx, cy):
        """Append a new freeform `p:sp` with specified position and size."""
        shape_id = self._next_shape_id
        name = "Freeform %d" % (shape_id - 1,)
        sp = CT_Shape.new_freeform_sp(shape_id, name, x, y, cx, cy)
        self.insert_element_before(sp, "p:extLst")
        return sp

    def add_grpSp(self):
        """Return `p:grpSp` element newly appended to this shape tree.

        The element contains no sub-shapes, is positioned at (0, 0), and has
        width and height of zero.
        """
        shape_id = self._next_shape_id
        name = "Group %d" % (shape_id - 1,)
        grpSp = CT_GroupShape.new_grpSp(shape_id, name)
        self.insert_element_before(grpSp, "p:extLst")
        return grpSp

    def add_pic(self, id_, name, desc, rId, x, y, cx, cy):
        """
        Append a ``<p:pic>`` shape to the group/shapetree having properties
        as specified in call.
        """
        pic = CT_Picture.new_pic(id_, name, desc, rId, x, y, cx, cy)
        self.insert_element_before(pic, "p:extLst")
        return pic

    def add_placeholder(self, id_, name, ph_type, orient, sz, idx):
        """
        Append a newly-created placeholder ``<p:sp>`` shape having the
        specified placeholder properties.
        """
        sp = CT_Shape.new_placeholder_sp(id_, name, ph_type, orient, sz, idx)
        self.insert_element_before(sp, "p:extLst")
        return sp

    def add_table(self, id_, name, rows, cols, x, y, cx, cy):
        """
        Append a ``<p:graphicFrame>`` shape containing a table as specified
        in call.
        """
        graphicFrame = CT_GraphicalObjectFrame.new_table_graphicFrame(
            id_, name, rows, cols, x, y, cx, cy
        )
        self.insert_element_before(graphicFrame, "p:extLst")
        return graphicFrame

    def add_textbox(self, id_, name, x, y, cx, cy):
        """
        Append a newly-created textbox ``<p:sp>`` shape having the specified
        position and size.
        """
        sp = CT_Shape.new_textbox_sp(id_, name, x, y, cx, cy)
        self.insert_element_before(sp, "p:extLst")
        return sp

    @property
    def chExt(self):
        """Descendent `p:grpSpPr/a:xfrm/a:chExt` element."""
        return self.grpSpPr.get_or_add_xfrm().get_or_add_chExt()

    @property
    def chOff(self):
        """Descendent `p:grpSpPr/a:xfrm/a:chOff` element."""
        return self.grpSpPr.get_or_add_xfrm().get_or_add_chOff()

    def get_or_add_xfrm(self):
        """
        Return the ``<a:xfrm>`` grandchild element, newly-added if not
        present.
        """
        return self.grpSpPr.get_or_add_xfrm()

    def iter_ph_elms(self):
        """
        Generate each placeholder shape child element in document order.
        """
        for e in self.iter_shape_elms():
            if e.has_ph_elm:
                yield e

    def iter_shape_elms(self):
        """
        Generate each child of this ``<p:spTree>`` element that corresponds
        to a shape, in the sequence they appear in the XML.
        """
        for elm in self.iterchildren():
            if elm.tag in self._shape_tags:
                yield elm

    @property
    def max_shape_id(self):
        """Maximum int value assigned as @id in this slide.

        This is generally a shape-id, but ids can be assigned to other
        objects so we just check all @id values anywhere in the document
        (XML id-values have document scope).

        In practice, its minimum value is 1 because the spTree element itself
        is always assigned id="1".
        """
        id_str_lst = self.xpath("//@id")
        used_ids = [int(id_str) for id_str in id_str_lst if id_str.isdigit()]
        return max(used_ids) if used_ids else 0

    @classmethod
    def new_grpSp(cls, id_, name):
        """Return new "loose" `p:grpSp` element having *id_* and *name*."""
        xml = (
            "<p:grpSp %s>\n"
            "  <p:nvGrpSpPr>\n"
            '    <p:cNvPr id="%%d" name="%%s"/>\n'
            "    <p:cNvGrpSpPr/>\n"
            "    <p:nvPr/>\n"
            "  </p:nvGrpSpPr>\n"
            "  <p:grpSpPr>\n"
            "    <a:xfrm>\n"
            '      <a:off x="0" y="0"/>\n'
            '      <a:ext cx="0" cy="0"/>\n'
            '      <a:chOff x="0" y="0"/>\n'
            '      <a:chExt cx="0" cy="0"/>\n'
            "    </a:xfrm>\n"
            "  </p:grpSpPr>\n"
            "</p:grpSp>" % nsdecls("a", "p", "r")
        ) % (id_, name)
        grpSp = parse_xml(xml)
        return grpSp

    def recalculate_extents(self):
        """Adjust x, y, cx, and cy to incorporate all contained shapes.

        This would typically be called when a contained shape is added,
        removed, or its position or size updated.

        This method is recursive "upwards" since a change in a group shape
        can change the position and size of its containing group.
        """
        if not self.tag == qn("p:grpSp"):
            return

        x, y, cx, cy = self._child_extents

        self.chOff.x = self.x = x
        self.chOff.y = self.y = y
        self.chExt.cx = self.cx = cx
        self.chExt.cy = self.cy = cy
        self.getparent().recalculate_extents()

    @property
    def xfrm(self):
        """
        The ``<a:xfrm>`` grandchild element or |None| if not found
        """
        return self.grpSpPr.xfrm

    @property
    def _child_extents(self):
        """(x, y, cx, cy) tuple representing net position and size.

        The values are formed as a composite of the contained child shapes.
        """
        child_shape_elms = list(self.iter_shape_elms())

        if not child_shape_elms:
            return Emu(0), Emu(0), Emu(0), Emu(0)

        min_x = min([xSp.x for xSp in child_shape_elms])
        min_y = min([xSp.y for xSp in child_shape_elms])
        max_x = max([(xSp.x + xSp.cx) for xSp in child_shape_elms])
        max_y = max([(xSp.y + xSp.cy) for xSp in child_shape_elms])

        x = min_x
        y = min_y
        cx = max_x - min_x
        cy = max_y - min_y

        return x, y, cx, cy

    @property
    def _next_shape_id(self):
        """Return unique shape id suitable for use with a new shape element.

        The returned id is the next available positive integer drawing object
        id in shape tree, starting from 1 and making use of any gaps in
        numbering. In practice, the minimum id is 2 because the spTree
        element itself is always assigned id="1".
        """
        id_str_lst = self.xpath("//@id")
        used_ids = [int(id_str) for id_str in id_str_lst if id_str.isdigit()]
        for n in range(1, len(used_ids) + 2):
            if n not in used_ids:
                return n

class CT_GroupShapeNonVisual(BaseShapeElement):
    """
    ``<p:nvGrpSpPr>`` element.
    """

    cNvPr = OneAndOnlyOne("p:cNvPr")

class CT_GroupShapeProperties(BaseOxmlElement):
    """p:grpSpPr element """

    _tag_seq = (
        "a:xfrm",
        "a:noFill",
        "a:solidFill",
        "a:gradFill",
        "a:blipFill",
        "a:pattFill",
        "a:grpFill",
        "a:effectLst",
        "a:effectDag",
        "a:scene3d",
        "a:extLst",
    )
    xfrm = ZeroOrOne("a:xfrm", successors=_tag_seq[1:])
    effectLst = ZeroOrOne("a:effectLst", successors=_tag_seq[8:])
    del _tag_seq


text:
module Moneta
  module Adapters
    # Null backend which doesn't store anything
    # @api public
    class Null
      include Defaults

      # @param [Hash] options Options hash
      def initialize(options = {})
      end

      # (see Proxy#key?)
      def key?(key, options = {})
        false
      end

      # (see Proxy#load)
      def load(key, options = {})
        nil
      end

      # (see Proxy#store)
      def store(key, value, options = {})
        value
      end

      # (see Proxy#delete)
      def delete(key, options = {})
        nil
      end

      # (see Proxy#clear)
      def clear(options = {})
        self
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
using namespace std;

void error_handling(char const* msg){
    cerr << msg << endl;
    exit(1);
}

int main(int argc, char* argv[]){
    if(3 != argc){
        cerr << "Usage : " << argv[0] << " <IP> <port>" << endl;
        exit(1);
    }
    auto_close_fd sock { socket(PF_INET, SOCK_STREAM, 0)};
    if(-1 == sock)
        error_handling("socket() error.");
    sockaddr_in serv_addr = {};
    serv_addr.sin_family = AF_INET;
    serv_addr.sin_addr.s_addr = inet_addr(argv[1]);
    serv_addr.sin_port = htons(atoi(argv[2]));
    if(-1 == connect(sock, (sockaddr*)&serv_addr, sizeof(serv_addr)))
        error_handling("connect() error.");
    char message[128];
    size_t str_len = read(sock, message, sizeof(message));
    if(-1 == str_len)
        error_handling("read() error.");

    cout << "Message from server : " << message << endl;

    return 0;
}


text:
package io.fundrequest.core.user;

import io.fundrequest.core.user.dto.UserDto;
import io.fundrequest.platform.keycloak.Provider;
import io.fundrequest.platform.keycloak.UserIdentity;

import java.util.Collections;

public final class UserDtoMother {

    public static UserDto davy() {
        UserDto userDto = new UserDto();
        userDto.setEmail("davy@fundrequest.io");
        userDto.setUserId("12347468fas738");
        userDto.setUserIdentities(Collections.singletonList(UserIdentity.builder()
                .provider(Provider.GITHUB)
                .userId(userDto.getUserId())
                .username("davyvanroy")
                .build()));
        return userDto;
    }
}


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

from collections import namedtuple

from caffe2.python import (
    core,
    layer_model_instantiator,
    layer_model_helper,
    schema,
    test_util,
    workspace,
    utils,
)
from caffe2.proto import caffe2_pb2
import numpy as np

class OpSpec(namedtuple("OpSpec", "type input output arg")):

    def __new__(cls, op_type, op_input, op_output, op_arg=None):
        return super(OpSpec, cls).__new__(cls, op_type, op_input,
                                          op_output, op_arg)

class LayersTestCase(test_util.TestCase):

    def setUp(self):
        super(LayersTestCase, self).setUp()
        self.setup_example()

    def setup_example(self):
        """
        This is undocumented feature in hypothesis,
        https://github.com/HypothesisWorks/hypothesis-python/issues/59
        """
        workspace.ResetWorkspace()
        self.reset_model()

    def reset_model(self, input_feature_schema=None, trainer_extra_schema=None):
        input_feature_schema = input_feature_schema or schema.Struct(
            ('float_features', schema.Scalar((np.float32, (32,)))),
        )
        trainer_extra_schema = trainer_extra_schema or schema.Struct()
        self.model = layer_model_helper.LayerModelHelper(
            'test_model',
            input_feature_schema=input_feature_schema,
            trainer_extra_schema=trainer_extra_schema)

    def new_record(self, schema_obj):
        return schema.NewRecord(self.model.net, schema_obj)

    def get_training_nets(self):
        """
        We don't use
        layer_model_instantiator.generate_training_nets_forward_only()
        here because it includes initialization of global constants, which make
        testing tricky
        """
        train_net = core.Net('train_net')
        train_init_net = core.Net('train_init_net')
        for layer in self.model.layers:
            layer.add_operators(train_net, train_init_net)
        return train_init_net, train_net

    def get_eval_net(self):
        return layer_model_instantiator.generate_eval_net(self.model)

    def get_predict_net(self):
        return layer_model_instantiator.generate_predict_net(self.model)

    def run_train_net(self):
        self.model.output_schema = schema.Struct()
        train_init_net, train_net = \
            layer_model_instantiator.generate_training_nets(self.model)
        workspace.RunNetOnce(train_init_net)
        workspace.RunNetOnce(train_net)

    def run_train_net_forward_only(self):
        self.model.output_schema = schema.Struct()
        train_init_net, train_net = \
            layer_model_instantiator.generate_training_nets_forward_only(
                self.model)
        workspace.RunNetOnce(train_init_net)
        workspace.RunNetOnce(train_net)

    def assertBlobsEqual(self, spec_blobs, op_blobs):
        """
        spec_blobs can either be None or a list of blob names. If it's None,
        then no assertion is performed. The elements of the list can be None,
        in that case, it means that position will not be checked.
        """
        if spec_blobs is None:
            return
        self.assertEqual(len(spec_blobs), len(op_blobs))
        for spec_blob, op_blob in zip(spec_blobs, op_blobs):
            if spec_blob is None:
                continue
            self.assertEqual(spec_blob, op_blob)

    def assertArgsEqual(self, spec_args, op_args):
        self.assertEqual(len(spec_args), len(op_args))
        keys = [a.name for a in op_args]

        def parse_args(args):
            operator = caffe2_pb2.OperatorDef()
            # Generate the expected value in the same order
            for k in keys:
                v = args[k]
                arg = utils.MakeArgument(k, v)
                operator.arg.add().CopyFrom(arg)
            return operator.arg

        self.assertEqual(parse_args(spec_args), op_args)

    def assertNetContainOps(self, net, op_specs):
        """
        Given a net and a list of OpSpec's, check that the net match the spec
        """
        ops = net.Proto().op
        self.assertEqual(len(op_specs), len(ops))
        for op, op_spec in zip(ops, op_specs):
            self.assertEqual(op_spec.type, op.type)
            self.assertBlobsEqual(op_spec.input, op.input)
            self.assertBlobsEqual(op_spec.output, op.output)
            if op_spec.arg is not None:
                self.assertArgsEqual(op_spec.arg, op.arg)
        return ops


text:
package com.dremio.exec.store.iceberg.hive;

import org.apache.iceberg.TableOperations;

import com.dremio.exec.catalog.MutablePlugin;
import com.dremio.exec.store.iceberg.SupportsIcebergRootPointer;
import com.dremio.exec.store.iceberg.model.IcebergBaseModel;
import com.dremio.exec.store.iceberg.model.IcebergCommand;
import com.dremio.exec.store.iceberg.model.IcebergTableIdentifier;
import com.dremio.io.file.FileSystem;
import com.dremio.sabot.exec.context.OperatorContext;

/**
 * Entry point for Hive catalog based Iceberg tables
 */
public class IcebergHiveModel extends IcebergBaseModel {

  private final SupportsIcebergRootPointer plugin;
  private final String tableName;
  private final String queryUserName;
  public static final String HIVE = "hive";

  public IcebergHiveModel(String namespace,
                          String tableName,
                          FileSystem fs,
                          String queryUserName,
                          OperatorContext context,
                          SupportsIcebergRootPointer plugin) {
    super(namespace, plugin.getFsConfCopy(), fs, context, null, (MutablePlugin) plugin);
    this.queryUserName = queryUserName;
    this.plugin = plugin;
    this.tableName = tableName;
  }

  @Override
  protected IcebergCommand getIcebergCommand(IcebergTableIdentifier tableIdentifier) {
    TableOperations tableOperations = plugin.createIcebergTableOperations(fs, queryUserName, tableIdentifier);
    return new IcebergHiveCommand(configuration,
      ((IcebergHiveTableIdentifier)tableIdentifier).getTableFolder(), fs, tableOperations, (MutablePlugin) plugin);
  }

  @Override
  public IcebergTableIdentifier getTableIdentifier(String rootFolder) {
    return new IcebergHiveTableIdentifier(namespace, rootFolder, tableName);
  }
}


text:
package com.google.common.base;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.GwtCompatible;
import java.io.Serializable;
import javax.annotation.Nullable;

/**
 * Utility class for converting between various ASCII case formats. Behavior is undefined for
 * non-ASCII input.
 *
 * @author Mike Bostock
 * @since 1.0
 */
@GwtCompatible
public enum CaseFormat {
  /**
   * Hyphenated variable naming convention, e.g., "lower-hyphen".
   */
  LOWER_HYPHEN(CharMatcher.is('-'), "-") {
    @Override
    String normalizeWord(String word) {
      return Ascii.toLowerCase(word);
    }

    @Override
    String convert(CaseFormat format, String s) {
      if (format == LOWER_UNDERSCORE) {
        return s.replace('-', '_');
      }
      if (format == UPPER_UNDERSCORE) {
        return Ascii.toUpperCase(s.replace('-', '_'));
      }
      return super.convert(format, s);
    }
  },

  /**
   * C++ variable naming convention, e.g., "lower_underscore".
   */
  LOWER_UNDERSCORE(CharMatcher.is('_'), "_") {
    @Override
    String normalizeWord(String word) {
      return Ascii.toLowerCase(word);
    }

    @Override
    String convert(CaseFormat format, String s) {
      if (format == LOWER_HYPHEN) {
        return s.replace('_', '-');
      }
      if (format == UPPER_UNDERSCORE) {
        return Ascii.toUpperCase(s);
      }
      return super.convert(format, s);
    }
  },

  /**
   * Java variable naming convention, e.g., "lowerCamel".
   */
  LOWER_CAMEL(CharMatcher.inRange('A', 'Z'), "") {
    @Override
    String normalizeWord(String word) {
      return firstCharOnlyToUpper(word);
    }
  },

  /**
   * Java and C++ class naming convention, e.g., "UpperCamel".
   */
  UPPER_CAMEL(CharMatcher.inRange('A', 'Z'), "") {
    @Override
    String normalizeWord(String word) {
      return firstCharOnlyToUpper(word);
    }
  },

  /**
   * Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".
   */
  UPPER_UNDERSCORE(CharMatcher.is('_'), "_") {
    @Override
    String normalizeWord(String word) {
      return Ascii.toUpperCase(word);
    }

    @Override
    String convert(CaseFormat format, String s) {
      if (format == LOWER_HYPHEN) {
        return Ascii.toLowerCase(s.replace('_', '-'));
      }
      if (format == LOWER_UNDERSCORE) {
        return Ascii.toLowerCase(s);
      }
      return super.convert(format, s);
    }
  };

  private final CharMatcher wordBoundary;
  private final String wordSeparator;

  CaseFormat(CharMatcher wordBoundary, String wordSeparator) {
    this.wordBoundary = wordBoundary;
    this.wordSeparator = wordSeparator;
  }

  /**
   * Converts the specified {@code String str} from this format to the specified {@code format}. A
   * "best effort" approach is taken; if {@code str} does not conform to the assumed format, then
   * the behavior of this method is undefined but we make a reasonable effort at converting anyway.
   */
  public final String to(CaseFormat format, String str) {
    checkNotNull(format);
    checkNotNull(str);
    return (format == this) ? str : convert(format, str);
  }

  /**
   * Enum values can override for performance reasons.
   */
  String convert(CaseFormat format, String s) {
    // deal with camel conversion
    StringBuilder out = null;
    int i = 0;
    int j = -1;
    while ((j = wordBoundary.indexIn(s, ++j)) != -1) {
      if (i == 0) {
        // include some extra space for separators
        out = new StringBuilder(s.length() + 4 * wordSeparator.length());
        out.append(format.normalizeFirstWord(s.substring(i, j)));
      } else {
        out.append(format.normalizeWord(s.substring(i, j)));
      }
      out.append(format.wordSeparator);
      i = j + wordSeparator.length();
    }
    return (i == 0)
        ? format.normalizeFirstWord(s)
        : out.append(format.normalizeWord(s.substring(i))).toString();
  }

  /**
   * Returns a {@code Converter} that converts strings from this format to {@code targetFormat}.
   *
   * @since 16.0
   */
  public Converter<String, String> converterTo(CaseFormat targetFormat) {
    return new StringConverter(this, targetFormat);
  }

  private static final class StringConverter extends Converter<String, String>
      implements Serializable {

    private final CaseFormat sourceFormat;
    private final CaseFormat targetFormat;

    StringConverter(CaseFormat sourceFormat, CaseFormat targetFormat) {
      this.sourceFormat = checkNotNull(sourceFormat);
      this.targetFormat = checkNotNull(targetFormat);
    }

    @Override
    protected String doForward(String s) {
      return sourceFormat.to(targetFormat, s);
    }

    @Override
    protected String doBackward(String s) {
      return targetFormat.to(sourceFormat, s);
    }

    @Override
    public boolean equals(@Nullable Object object) {
      if (object instanceof StringConverter) {
        StringConverter that = (StringConverter) object;
        return sourceFormat.equals(that.sourceFormat) && targetFormat.equals(that.targetFormat);
      }
      return false;
    }

    @Override
    public int hashCode() {
      return sourceFormat.hashCode() ^ targetFormat.hashCode();
    }

    @Override
    public String toString() {
      return sourceFormat + ".converterTo(" + targetFormat + ")";
    }

    private static final long serialVersionUID = 0L;
  }

  abstract String normalizeWord(String word);

  private String normalizeFirstWord(String word) {
    return (this == LOWER_CAMEL) ? Ascii.toLowerCase(word) : normalizeWord(word);
  }

  private static String firstCharOnlyToUpper(String word) {
    return (word.isEmpty())
        ? word
        : Ascii.toUpperCase(word.charAt(0)) + Ascii.toLowerCase(word.substring(1));
  }
}


text:
namespace Diploma.DAL.Entities
{
    using System.ComponentModel.DataAnnotations;

    public abstract class EmployeeEntity : UserEntity
    {
        [Required]
        public decimal Salary { get; set; }
    }
}


text:
package com.github.dnvriend.serializer.avro4s

import com.github.dnvriend.TestSpec
import com.github.dnvriend.domain.BookStore.{ ChangedBookV1, ChangedBookV2, ChangedBookV3, ChangedBookV4 }
import com.github.dnvriend.serializer.avro.{ BookSerializerV1, BookSerializerV2, BookSerializerV3 }
import com.sksamuel.avro4s.{ AvroSchema, RecordFormat }
import org.apache.avro.Schema
import org.apache.avro.file.SeekableByteArrayInput
import org.apache.avro.generic.{ GenericDatumReader, GenericRecord }
import org.apache.avro.io.DecoderFactory

// SE stands for Schema Evolution
class AvroSEBasicTest extends TestSpec {

  @Override
  def fromBytes(bytes: Array[Byte], schema: Schema): GenericRecord = {
    val serveReader = new GenericDatumReader[GenericRecord](schema)
    serveReader.read(null, DecoderFactory.get().binaryDecoder(bytes, null))
  }

  val title = "Moby-Dick; or, The Whale"
  val year = 1851
  val editor = "Scala Books"

  "AvroSEBasicTest" should "deserialize old class with renamed field" in {
    // in this case, two different serializers can be used

    val obj = ChangedBookV1(title, year)
    val serializerV1 = new BookSerializerV1
    val bytes: Array[Byte] = serializerV1.toBinary(obj)
    val serializerV2 = new BookSerializerV2

    serializerV2.fromBinary(bytes) should matchPattern {
      case ChangedBookV2(`title`, `year`) ⇒
    }
  }

  it should "deserialize old class without new field" in {

    val obj = ChangedBookV2(title, year)
    val serializerV2 = new BookSerializerV2
    val bytes: Array[Byte] = serializerV2.toBinary(obj)

    val in = new SeekableByteArrayInput(bytes)

    val schema2 = AvroSchema[ChangedBookV2]
    val schema3 = AvroSchema[ChangedBookV3]

    val gdr = new GenericDatumReader[GenericRecord](schema2, schema3)
    val binDecoder = DecoderFactory.get().binaryDecoder(in, null)
    val record: GenericRecord = gdr.read(null, binDecoder)
    val format = RecordFormat[ChangedBookV3]
    val r = format.from(record)

    r should matchPattern {
      case ChangedBookV3(`title`, `year`, "") ⇒
    }

  }

  it should "deserialize old class with dropped field" in {

    val obj = ChangedBookV3(title, year, editor)
    val serializerV3 = new BookSerializerV3
    val bytes: Array[Byte] = serializerV3.toBinary(obj)

    val in = new SeekableByteArrayInput(bytes)

    val schema3 = AvroSchema[ChangedBookV3]
    val schema4 = AvroSchema[ChangedBookV4]

    val gdr = new GenericDatumReader[GenericRecord](schema3, schema4)
    val binDecoder = DecoderFactory.get().binaryDecoder(in, null)
    val record: GenericRecord = gdr.read(null, binDecoder)
    val format = RecordFormat[ChangedBookV4]
    val r = format.from(record)

    r should matchPattern {
      case ChangedBookV4(`title`, `editor`) ⇒
    }

  }

}


text:
EVCF=../data/0.9.29.eval.vcf.gz
CSV=0.9.29.eval.data.csv
FIG=caller-report-example.png

mitty -v4 debug variant-call-analysis process \
 ${EVCF} \
 ${CSV} \
 --max-size 75 \
 --fig-file ${FIG} \
 --plot-bin-size 5 \
 --title 'Example call analysis plot'

mitty -v4 debug variant-call-analysis plot \
  ${CSV} \
  caller-report-example2.png \
  --plot-bin-size 10 \
  --plot-range 50 \
  --title 'Example call analysis plot'


text:
using System;

namespace InfoSupport.Tessler.Core
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class ResetDatabaseAttribute : Attribute
    {
        public ResetDatabaseAttribute(bool resetDatabase = true)
        {
            Reset = resetDatabase;
        }

        public bool Reset { get; set; }
    }
}


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <note/>
    <predicate lemma="assimilation">
        <note/>
        <roleset framnet="" id="assimilation.01" name="Becoming similar" vncls="">
            <roles>
                <role descr="Causer of change" f="" n="0"/>
                <note/>
                <role descr="Thing changing" f="" n="1"/>
                <role descr="Target" f="" n="2"/>
            </roles>
            <note/>
            <example name="Arg0,1" src="" type="">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>He is widely regarded both for great sophistication of argument and for his assimilation of many and diverse subjects in pursuit of synoptic vision.</text>
                <note/>
                <arg f="" n="0">his</arg>
                <rel f="">assimilation</rel>
                <arg f="" n="1">of many and diverse subjects</arg>
                <arg f="adj" n="m">in pursuit of synoptic vision</arg>
            </example>
            <example name="Arg1,2" src="" type="">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>He are very commited to helping his assimilation to Canadian society.</text>
                <note/>
                <arg f="" n="1">his</arg>
                <rel f="">assimilation</rel>
                <arg f="" n="2">to Canadian society</arg>
            </example>
        </roleset>
    </predicate>
</frameset>


text:
#region License

#endregion

using Common.Logging;
using Spring.Context;
using Spring.Messaging.Ems.Common;
using Spring.Messaging.Ems.Connections;
using Spring.Messaging.Ems.Support;
using Spring.Messaging.Ems.Support.Destinations;
using Spring.Objects.Factory;

namespace Spring.Messaging.Ems.Listener
{
    ///
    /// Common base class for all containers which need to implement listening
    /// based on a Connection (either shared or freshly obtained for each attempt).
    /// Inherits basic Connection and Session configuration handling from the
    /// <see cref="EmsAccessor"/> base class.
    ///
    /// <para>
    /// This class provides basic lifecycle management, in particular management
    /// of a shared Connection. Subclasses are supposed to plug into this
    /// lifecycle, implementing the <see cref="SharedConnectionEnabled"/> as well as
    ///
    /// </para>
    /// <remarks>
    ///
    /// </remarks>
    /// <author>Mark Pollack</author>
    public abstract class AbstractListenerContainer : EmsDestinationAccessor, ILifecycle, IObjectNameAware, IDisposable
    {
        #region Logging

        private readonly ILog logger = LogManager.GetLogger(typeof(AbstractListenerContainer));

        #endregion

        #region Fields

        private String clientId;

        private bool autoStartup = true;

        private string objectName;

        private IConnection sharedConnection;

        private bool sharedConnectionStarted = false;

        ///
        /// The monitor object to lock on when performing operations on the connection.
        ///
        protected object sharedConnectionMonitor = new object();

        private volatile bool active = false;

        private bool running = false;

        ///
        /// The monitor object to lock on when performing operations that update the lifecycle of the container.
        ///
        protected object lifecycleMonitor = new object();

        #endregion

        ///
        /// Gets or sets the client id for a shared Connection created and used by this container.
        ///
        /// <remarks>
        /// Note that client ids need to be unique among all active Connections
        /// of the underlying JMS provider. Furthermore, a client id can only be
        /// assigned if the original ConnectionFactory hasn't already assigned one.
        /// </remarks>
        /// <value>The client id.</value>
        public string ClientId
        {
            set { clientId = value; }
            get { return clientId;  }
        }

        ///  Set whether to automatically start the listener after initialization.
        ///
Default is "true"; set this to "false" to allow for manual startup.

        ///
        public virtual bool AutoStartup
        {
            set { this.autoStartup = value; }
        }

        ///
        /// Set the name of the object in the object factory that created this object.
        ///
        /// <value>The name of the object in the factory.</value>
        /// <remarks>
        ///

        /// Invoked after population of normal object properties but before an init
        /// callback like <see cref="Spring.Objects.Factory.IInitializingObject"/>'s
        /// <see cref="Spring.Objects.Factory.IInitializingObject.AfterPropertiesSet"/>
        /// method or a custom init-method.
        ///

        /// </remarks>
        public string ObjectName
        {
            set { objectName = value; }
        }

        ///
        /// Gets a value indicating whether this container is currently running,
        /// that is, whether it has been started and not stopped yet.
        ///
        /// <value>
        /// 	<c>true</c> if this container is running; otherwise, <c>false</c>.
        /// </value>
        public bool IsRunning
        {
            get
            {
                lock (lifecycleMonitor)
                {
                    return (running && RunningAllowed);
                }
            }
        }

        ///
        /// Gets a value indicating whether this container's listeners are generally allowed to run.
        ///
        /// <remarks>
        /// <para>
        /// >This implementation always returns true; the default 'running'
        /// state is purely determined by <see cref="Start"/>/<see cref="Stop"/>.
        /// </para>
        /// <para>
        /// Subclasses may override this method to check against temporary
        /// conditions that prevent listeners from actually running. In other words,
        /// they may apply further restrictions to the 'running' state, returning
        /// false if such a restriction prevents listeners from running.
        /// </para>
        /// </remarks>
        /// <value><c>true</c> if running allowed; otherwise, <c>false</c>.</value>
        protected virtual bool RunningAllowed
        {
            get {
                return true; }
        }

        ///
        /// Gets a value indicating whether	this container is currently active,
	    /// that is, whether it has been set up but not shut down yet.
        ///
        /// <value><c>true</c> if active; otherwise, <c>false</c>.</value>
        public virtual bool Active
        {
            get
            {
                lock (this.lifecycleMonitor)
                {
                    return this.active;
                }
            }

        }

        ///  Return whether a shared EMS Connection should be maintained
        /// by this listener container base class.
        ///
        /// <seealso cref="SharedConnection"/>
        protected abstract bool SharedConnectionEnabled { get; }

        ///
        /// Gets the shared connection maintained by this container.
        /// Available after initialization.
        ///
        /// <value>The shared connection (never null)</value>
        /// <exception cref="InvalidOperationException">if this container does not maintain a
        /// shared Connection, or if the Connection hasn't been initialized yet.
        /// </exception>
        /// <see cref="SharedConnectionEnabled"/>
        protected IConnection SharedConnection
        {
            get
            {
                if (!SharedConnectionEnabled)
                {
                    throw new InvalidOperationException("This listener container does not maintain a shared Connection");
                }
                lock (this.sharedConnectionMonitor)
                {
                    if (this.sharedConnection == null)
                    {
                        throw new SharedConnectionNotInitializedException("This listener container's shared Connection has not been initialized yet");
                    }
                    return this.sharedConnection;
                }
            }
        }

        ///
        /// Call base class method, then <see cref="ValidateConfiguration"/> and then <see cref="Initialize"/>
        ///
        public override void AfterPropertiesSet()
        {
            base.AfterPropertiesSet();
            ValidateConfiguration();
            Initialize();
        }

        ///
        /// Validates the configuration of this container.  The default implementation
        /// is empty.  To be overriden in subclasses.
        ///
        protected virtual void ValidateConfiguration()
        {

        }

        ///
        /// Calls <see cref="Shutdown"/> when the application context destroys the container instance.
        ///
        public void Dispose()
        {
            Shutdown();
        }

        ///
        /// Initializes this container.  Creates a Connection, starts the Connection
        /// (if the property <see cref="AutoStartup"/> hasn't been turned off), and calls
        /// <see cref="DoInitialize"/>.
        ///
        /// <exception cref="EMSException">If startup failed</exception>
        public virtual void Initialize()
        {
            try
            {
                lock (this.lifecycleMonitor)
                {
                    this.active = true;
                    System.Threading.Monitor.PulseAll(this.lifecycleMonitor);
                }

                if (this.autoStartup)
                {
                    DoStart();
                }

                DoInitialize();

            }
            catch (Exception)
            {
                lock (this.sharedConnectionMonitor)
                {
                    ConnectionFactoryUtils.ReleaseConnection(sharedConnection, ConnectionFactory, autoStartup);
                }
                throw;
            }
        }

        ///
        /// Stop the shared connection, call <see cref="DoShutdown"/>, and close this container.
        ///
        public virtual void Shutdown()
        {
            logger.Debug("Shutting down message listener container");
            bool wasRunning = false;
            lock (this.lifecycleMonitor)
            {
                wasRunning = this.running;
                this.running = false;
                this.active = false;
                System.Threading.Monitor.PulseAll(this.lifecycleMonitor);
            }

            if (wasRunning && SharedConnectionEnabled)
            {
                try
                {
                    StopSharedConnection();
                } catch (Exception ex)
                {
                    logger.Debug("Could not stop EMS Connection on shutdown", ex);
                }
            }

            // Shut down the invokers
            try
            {
                DoShutdown();
            }
            finally
            {
                lock (this.sharedConnectionMonitor)
                {
                    ConnectionFactoryUtils.ReleaseConnection(this.sharedConnection, ConnectionFactory, false);
                }
            }
        }

        ///
        /// Starts this container.
        ///
        /// <exception cref="EMSException">if starting failed.</exception>
        public void Start()
        {
            DoStart();
        }

        ///
        /// Start the shared Connection, if any, and notify all invoker tasks.
        ///
        protected virtual void DoStart()
        {
            // Lazily establish a shared Connection, if necessary.
            if (SharedConnectionEnabled)
            {
                EstablishSharedConnection();
            }

            lock (this.lifecycleMonitor)
            {
                running = true;
                System.Threading.Monitor.PulseAll(this.lifecycleMonitor);
            }

            // Start the shared Connection, if any.
            if (SharedConnectionEnabled)
            {
                StartSharedConnection();
            }
        }

        ///
        /// Stops this container.
        ///
        /// <exception cref="EMSException">if stopping failed.</exception>
        public void Stop()
        {
            DoStop();
        }

        ///
        /// Notify all invoker tasks and stop the shared Connection, if any.
        ///
        /// <exception cref="EMSException">if thrown by EMS API methods.</exception>
        /// <see cref="StopSharedConnection"/>
        protected virtual void DoStop()
        {
            lock (this.lifecycleMonitor)
            {
                this.running = false;
                System.Threading.Monitor.PulseAll(this.lifecycleMonitor);
            }

            if (SharedConnectionEnabled)
            {
                StopSharedConnection();
            }
        }

        ///
        /// Register any invokers within this container.
        /// Subclasses need to implement this method for their specific
        /// invoker management process.  A shared Connection, if any, will already have been
        /// started at this point.
        ///
        protected abstract void DoInitialize();

        ///
        /// Close the registered invokers.  Subclasses need to implement this method
        /// for their specific invoker management process. A shared Connection, if any,
        /// will automatically be closed afterwards.
        ///
        protected abstract void DoShutdown();

        ///
        /// Establishes a shared Connection for this container.
        ///
        /// <remarks>
        /// <para>
        /// The default implementation delegates to <see cref="CreateSharedConnection"/>
        /// which does one immediate attempt and throws an exception if it fails.
        /// Can be overridden to have a recovery process in place, retrying
        /// until a Connection can be successfully established.
        /// </para>
        /// </remarks>
        /// <exception cref="EMSException">If thrown by EMS API methods</exception>
        protected virtual void EstablishSharedConnection()
        {
            lock (sharedConnectionMonitor)
            {
                if (sharedConnection == null)
                {
                    sharedConnection = CreateSharedConnection();
                    logger.Debug("Established shared EMS Connection");
                }
            }
        }

        ///
        /// Refreshes the shared connection that this container holds.
        ///
        /// <remarks>
        /// Called on startup and also after an infrastructure exception
        /// that occurred during invoker setup and/or execution.
        /// </remarks>
        /// <exception cref="EMSException">If thrown by EMS API methods</exception>
        protected void RefreshSharedConnection()
        {
            lock (sharedConnectionMonitor)
            {
                ConnectionFactoryUtils.ReleaseConnection(sharedConnection, ConnectionFactory, sharedConnectionStarted);
                sharedConnection = CreateSharedConnection();
                if (sharedConnectionStarted)
                {
                    sharedConnection.Start();
                }
            }
        }

        ///
        /// Creates the shared connection for this container.
        ///
        /// <remarks>
        /// The default implementation creates a standard Connection
        /// and prepares it through <see cref="PrepareSharedConnection"/>
        /// </remarks>
        /// <returns>the prepared Connection</returns>
        /// <exception cref="EMSException">if the creation failed.</exception>
        protected virtual IConnection CreateSharedConnection()
        {
            IConnection con = CreateConnection();
            try
            {
                PrepareSharedConnection(con);
                return con;
            } catch (EMSException)
            {
                EmsUtils.CloseConnection(con);
                throw;
            }
        }

        ///
        /// Prepares the given connection, which is about to be registered
        /// as shared Connection for this container.
        ///
        /// <remarks>
        /// The default implementation sets the specified client id, if any.
        /// Subclasses can override this to apply further settings.
        /// </remarks>
        /// <param name="connection">The connection to prepare.</param>
        /// <exception cref="EMSException">If the preparation efforts failed.</exception>
        protected virtual void PrepareSharedConnection(IConnection connection)
        {
            if (ClientId != null)
            {
                connection.ClientID = ClientId;
            }
        }

        ///
        /// Starts the shared connection.
        ///
        /// <exception cref="EMSException">If thrown by EMS API methods</exception>
        /// <see cref="Start"/>
        protected virtual void StartSharedConnection()
        {
            lock (sharedConnectionMonitor)
            {
                if (sharedConnection != null)
                {
                    try
                    {
                        sharedConnectionStarted = true;
                        sharedConnection.Start();
                    }
                    catch (Exception ex)
                    {
                        logger.Warn("Ignoring Connection start exception - assuming already started", ex);
                    }
                }
            }
        }

        ///
        /// Stops the shared connection.
        ///
        /// <exception cref="EMSException">if thrown by EMS API methods.</exception>
        protected virtual void StopSharedConnection()
        {
            lock (this.sharedConnectionMonitor)
            {
                if (this.sharedConnection != null)
                {
                    try
                    {
                        this.sharedConnectionStarted = false;
                        this.sharedConnection.Stop();
                    }
                    catch (System.InvalidOperationException ex)
                    {
                        logger.Warn("Ignoring Connection stop exception - assuming already stopped", ex);
                    }
                }
            }
        }

    }

    ///
    /// Exception that indicates that the initial setup of this container's
    /// shared Connection failed. This is indicating to invokers that they need
    /// to establish the shared Connection themselves on first access.
    ///
    public class SharedConnectionNotInitializedException : EMSException
    {
        ///
        /// Initializes a new instance of the <see cref="SharedConnectionNotInitializedException"/> class.
        ///
        /// <param name="message">The message.</param>
        public SharedConnectionNotInitializedException(string message) : base(message)
        {
        }
    }
}


text:
package vm

import (
	"fmt"
)

type Program struct {
	// The list of instructions that make up the deserializer program
	Instructions []Instruction

	// A list of errors that can be triggered by halt(x), where x is the index in this array + 1
	Errors []string
}

func (p *Program) String() string {
	s := ""
	depth := ""
	for i, inst := range p.Instructions {
		if inst.Op == Exit {
			depth = depth[0 : len(depth)-3]
		}
		s += fmt.Sprintf("%v:\t%v%v\n", i, depth, inst)

		if inst.Op == Enter || inst.Op == AppendArray || inst.Op == AppendMap {
			depth += "|  "
		}
	}

	for i, err := range p.Errors {
		s += fmt.Sprintf("Error %v:\t%v\n", i+1, err)
	}
	return s
}


text:
package ollie.internal.codegen.validator;

import ollie.internal.codegen.Registry;

import javax.annotation.processing.Messager;
import javax.lang.model.element.Element;

import static javax.lang.model.element.ElementKind.CLASS;
import static javax.tools.Diagnostic.Kind.ERROR;

public class TypeAdapterValidator implements Validator {
	private Messager messager;

	public TypeAdapterValidator(Registry registry) {
		this.messager = registry.getMessager();
	}

	@Override
	public boolean validate(Element enclosingElement, Element element) {
		if (!element.getKind().equals(CLASS)) {
			messager.printMessage(ERROR, "@TypeAdapter applies only to Model classes.", element);
			return false;
		}

		return true;
	}
}


text:
package net.lacolaco.smileessence.twitter.task;

import net.lacolaco.smileessence.util.BackgroundTask;
import twitter4j.Paging;

import java.util.List;

public abstract class TimelineTask<T> extends BackgroundTask<List<T>, Void> {
    private Paging paging = new Paging();

    public TimelineTask<T> setPage(int page) {
        paging.setPage(page);
        return this;
    }

    public TimelineTask<T> setCount(int count) {
        paging.setCount(count);
        return this;
    }

    public TimelineTask<T> setMaxId(long maxId) {
        if (maxId > 0) {
            paging.setMaxId(maxId);
        }
        return this;
    }
    public TimelineTask<T> setSinceId(long sinceId) {
        if (sinceId > 0) {
            paging.setSinceId(sinceId);
        }
        return this;
    }

    protected Paging getPaging() {
        return paging;
    }
}


text:
% The MIT License (MIT)
%
% Copyright (c) 2015 Yinxiao Li and Yan Wang
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.

function mesh = parseObj(fn)
% parse an obj file and return the result mesh
% vertices
fprintf('Parsing the obj file... ');
mesh = [];
system(sprintf('bash -c "cat %s | grep ''^v '' | sed ''s/v //'' > tmp.txt"', fn));
mesh.v = load('tmp.txt', '-ascii')';
mesh.v = mesh.v(1: 3, :);
mesh.vn = size(mesh.v, 2);
% normal vectors
system(sprintf('bash -c "cat %s | grep ''^vn '' | sed ''s/vn //'' > tmp.txt"', fn));
mesh.n = load('tmp.txt', '-ascii')';
% faces
system(sprintf('bash -c "cat %s | grep ''^f '' | sed ''s/\\/\\/[0-9]*//g'' | sed ''s/f //'' > tmp.txt"', fn));
mesh.f = load('tmp.txt', '-ascii')';
mesh.fn = size(mesh.f, 2);
% clean up
system('bash -c "rm tmp.txt"');
fprintf('Done. %d vertices, %d edges.\n', mesh.vn, mesh.fn);
end


text:
Dupliquer et déplacer des tâches
================================

Dupliquer une tâche dans le même projet
---------------------------------------

Allez à la vue par tâche et choisissez **Dupliquer** sur la gauche.

![Duplication de tâche](../screenshots/task-duplication.png)

Une nouvelle tâche sera créée avec les mêmes propriétés que celles de la tâche originale.

Dupliquer une tâche vers un autre projet
-----------------------------------

Allez à la vue par tâches et choisissez **Dupliquer dans un autre projet**.

![Duplication d'une tâche dans un autre projet](../screenshots/task-duplication-another-project.png)

Seuls les projets dont vous êtes membre apparaîtront dans le menu déroulant.

Avant de copier les tâches, Kanboard vous demandera les propriétés de la destination qui ne sont pas communes entre les projets source et destination.

Vous devez essentiellement définir :

- La swimlane de destination
- La colonne
- La catégorie
- L'assigné

Déplacer une tâche vers un autre projet
------------------------------

Allez à la vue par tâches et choisissez **Déplacer vers un autre projet**.

Déplacer vers un autre projet est semblable à l'opération de duplication, vous devez choisir les nouvelles propriétés de la tâche.

Liste des champs dupliqués
-------------------------
Voici la liste des champs dupliqués :

- title
- description
- date_due
- color_id
- project_id
- column_id
- owner_id
- score
- category_id
- time_estimated
- swimlane_id
- recurrence_status
- recurrence_trigger
- recurrence_factor
- recurrence_timeframe
- recurrence_basedate


text:
FlatStrap
=============

Sometimes a project doesn't need rounded corners or drop shadows. That's why we ripped all of them out of Bootstrap.

For a demonstration go to http://littlesparkvt.com/flatstrap/

APACHE LICENSE

USE AND SHARE!


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class paginas_CriarCriterios : System.Web.UI.Page
{
    void Page_PreInit(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["PERFIL"] != null)
            {
                if (Session["PERFIL"].ToString() == "avaliador")
                    MasterPageFile = "~/paginas/MasterPageAvaliador.master";
                else
                    Response.Redirect("EscolherPerfil.aspx");
            }
            else
                Response.Redirect("EscolherPerfil.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private void CarregaCriterio()
    {
        ltbCritériosCriados.Items.Clear();
        ltbCritériosCriados.Items.Clear();
        DataSet ds = Cri_CriterioDB.SelectAll();
        int qtd = ds.Tables[0].Rows.Count;

        if (qtd > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ltbCritériosCriados.Items.Add(new ListItem(dr["cri_descricao"].ToString(), dr["cri_codigo"].ToString()));
            }
        }
    }
    protected void lkbCriarCriterio_Click(object sender, EventArgs e)
    {
        Cri_Criterio criterio = new Cri_Criterio();
        criterio.Cri_descricao = txtNomeCriterio.Text;

        switch (Cri_CriterioDB.Insert(criterio))
        {
            case 0:
                lblScript.Text = "<script> alert('Criterio cadastrado com Sucesso!');</script>";
                break;
            case -2:
                lblScript.Text = "<script> alert('Criterio nao cadastrado!');</script>";
                break;
        }

        CarregaCriterio();
        txtNomeCriterio.Text = "";
    }
}


text:
@interface HKFilter : NSObject {

}

// floatの値をunsigned charの範囲に最適化する
- (unsigned char)normalizeToChar:(CGFloat)value;

//フィルタ処理を実行する
- (CGImageRef)filterImage:(CGImageRef)image;

// CGImageからCGBitmapContextを作成する
- (CGContextRef)createARGBBitmapContext:(CGImageRef)inImage;

@end


text:
package com.paypal.selion.configuration;

import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;

import org.testng.ITestContext;
import org.testng.annotations.Test;

import com.paypal.selion.configuration.ConfigManager;
import com.paypal.selion.configuration.LocalConfig;
import com.paypal.selion.configuration.Config.ConfigProperty;
import com.paypal.selion.platform.grid.BrowserFlavors;

public class ConfigManagerTest {
    private static final String TEST_CONFIG_NAME = "Test1";

    LocalConfig localConfig = new LocalConfig();
    String browserValue = BrowserFlavors.OPERA.getBrowser();

    @Test(groups = { "unit" })
    public void testAddConfig() {
        assertNotNull(localConfig, "could not get the SeLion local config");
        // Set new values in local config
        localConfig.setConfigProperty(ConfigProperty.BROWSER, BrowserFlavors.OPERA.getBrowser());
        ConfigManager.addConfig(TEST_CONFIG_NAME, localConfig);
    }

    @Test(groups = { "unit" }, dependsOnMethods = { "testAddConfig" })
    public void testGetConfig() {
        assertNotNull(localConfig, "Could not get the SeLion local config");
        LocalConfig testConfig = ConfigManager.getConfig(TEST_CONFIG_NAME);
        assertNotNull(testConfig);
        String newBrowserValue = testConfig.getConfigProperty(ConfigProperty.BROWSER);
        assertTrue(newBrowserValue.equals(browserValue), "value from local config is not equal to the value set");

    }

    @Test(groups = { "unit" }, dependsOnMethods = { "testGetConfig", "testAddConfig" })
    public void testRemoveConfig() {
        assertTrue(ConfigManager.removeConfig(TEST_CONFIG_NAME), "Remove config failed");
    }

    @Test(groups = { "unit" }, dependsOnMethods = { "testAddConfig" })
    public void testGetConfigProperty(ITestContext ctx) {
        String name = ctx.getCurrentXmlTest().getName();
        String browser = ConfigManager.getConfig(name).getConfigProperty(ConfigProperty.BROWSER);
        assertNotNull(browser);
    }
}


text:
package ca.ualberta.cs.drivr;

import android.test.ActivityInstrumentationTestCase2;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import com.robotium.solo.Solo;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Created by adam on 2016-10-12.
 */

public class RequestHistoryActivityTest extends ActivityInstrumentationTestCase2<RequestHistoryActivity> {

    private Solo solo;

    public RequestHistoryActivityTest() {
        super(ca.ualberta.cs.drivr.RequestHistoryActivity.class);
    }

    @Override
    public void setUp() throws Exception {
        solo = new Solo(getInstrumentation(), getActivity());
    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
    }

}


text:
::: sidecode
```javascript
logger.levels = {
	custom: 4,
	debug: 	3,
	info: 	2,
	warn: 	1,
	error: 	0
};
```
:::

## Custom logging levels
Logging levels can be set by modifying `logger.levels` property.


text:
var chalk = require('chalk'),
  _ = require('lodash');

module.exports = Debug;

/**
 * Simple debug tool.
 * @param {Object} options
 * @returns {Debug}
 * @constructor
 */
function Debug(options) {
  if (!(this instanceof Debug)) {
    return new Debug(options);
  }
  if (typeof options == 'string') {
    options = {
      namespace: options
    };
  }
  this.options = _.defaults(options || {}, {
    namespace: 'pm2-gui',
    timestamp: true,
    debug: false
  });
}
Debug.prototype._l = function (level, args) {
  if(!this.options.debug){
    return;
  }
  args = _.values(args);

  var prints = [chalk.bgBlack.grey(this.options.namespace)];
  var prefix, color;
  switch (level) {
    case 'e':
      prefix = 'ERR!', color = 'red';
      break;
    case 'w':
      prefix = 'warn', color = 'yellow';
      break;
    case 'd':
      if(this.options.timestamp){
        prints.push(chalk.underline.dim((new Date()).toISOString()))
      }
      break;
    default :
      prefix = args.splice(0, 1), color = 'green';
      break;
  }
  if(prefix && color){
    prints.splice(2, 0, chalk.bgBlack[color](prefix));
  }
  prints.push(args.join(' '));
  console.log.apply(null, prints);
};

/**
 * Loggers: info, error, debug, log, warn.
 */
['i', 'e', 'd', 'l', 'w'].forEach(function(s){
  Debug.prototype[s] = function(){
    this._l.call(this, s, arguments);
  };
});


text:
from model import *

def parser(user_file, users, step):
	"Parses the file of users"

	count = 0
	with open(user_file, 'r') as usersFile:
		for line in usersFile:
			disks_played = []
			user_first = line.split("||")
			user_second = map(lambda x: x.split("&&"), user_first)
			#I found names like ":wumpscut:" that breaks the old parser
			user_disks = map(lambda x: x.rsplit("::", 1), user_second[4])

                        artists         = [Artist(*disk) for disk in user_disks]
			user            = User(user_second[0][0], user_second[2][0], user_second[1][0], user_second[3][0], artists)

			users.add(user)
			count += 1

                        #we have 1000k users
			if(count % step == 0):
                                yield users
                                #users = Type()#reset users


text:
package org.apereo.inspektr.audit.spi.support;

import org.aspectj.lang.JoinPoint;
import org.apereo.inspektr.common.spi.PrincipalResolver;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * Resolves the principal name to the one provided by Spring Security.
 *
 * @author Scott Battaglia
 * @version $Revision$ $Date$
 * @since 0.7.0
 *
 */
public class SpringSecurityAuditablePrincipalResolver implements PrincipalResolver {

    public String resolveFrom(final JoinPoint auditableTarget, final Object retval) {
        return getFromSecurityContext();
    }

    public String resolveFrom(final JoinPoint auditableTarget, final Exception exception) {
        return getFromSecurityContext();
    }

    public String resolve() {
        return getFromSecurityContext();
    }

    private String getFromSecurityContext() {
        final SecurityContext securityContext = SecurityContextHolder.getContext();

        if (securityContext == null) {
            return UNKNOWN_USER;
        }

        if (securityContext.getAuthentication() == null) {
            return UNKNOWN_USER;
        }

        final String subject = securityContext.getAuthentication().getName();
        if (subject == null) {
            return UNKNOWN_USER;
        }
        return subject;
    }

}


text:
var fs = require('fs');
var certEndDelimiter = '-----END CERTIFICATE-----';

exports.parse = function (bundlePath) {
  var certs = [], linesForNextCert = [];
  var rawLines = fs.readFileSync(bundlePath, 'utf8').split('\n');

  for (var i = 0, l = rawLines.length; i < l; i++) {
    var line = rawLines[i];
    if (line.length <= 0) { continue; }

    linesForNextCert.push(line);
    if (line.indexOf(certEndDelimiter) !== -1) {
      var nextCert = linesForNextCert.join('\n') + "\n";
      certs.push(nextCert);
      linesForNextCert = [];
    }
  }

  return certs;
};


text:
namespace blink {
class WebFrame;
class WebGamepadListener;
}

namespace content {

class WebTestDelegate;

class GamepadController
    : public base::SupportsWeakPtr<GamepadController>,
      public RendererGamepadProvider {
 public:
  static base::WeakPtr<GamepadController> Create(WebTestDelegate* delegate);
  ~GamepadController() override;

  void Reset();
  void Install(blink::WebFrame* frame);

  // RendererGamepadProvider implementation.
  void SampleGamepads(blink::WebGamepads& gamepads) override;
  bool OnControlMessageReceived(const IPC::Message& msg) override;
  void SendStartMessage() override;
  void SendStopMessage() override;

 private:
  friend class GamepadControllerBindings;
  GamepadController();

  // TODO(b.kelemen): for historical reasons Connect just initializes the
  // object. The 'gamepadconnected' event will be dispatched via
  // DispatchConnected. Tests for connected events need to first connect(),
  // then set the gamepad data and finally call dispatchConnected().
  // We should consider renaming Connect to Init and DispatchConnected to
  // Connect and at the same time updating all the gamepad tests.
  void Connect(int index);
  void DispatchConnected(int index);

  void Disconnect(int index);
  void SetId(int index, const std::string& src);
  void SetButtonCount(int index, int buttons);
  void SetButtonData(int index, int button, double data);
  void SetAxisCount(int index, int axes);
  void SetAxisData(int index, int axis, double data);

  blink::WebGamepads gamepads_;

  // Mapping from gamepad index to connection state.
  std::map<int, bool> pending_changes_;

  base::WeakPtrFactory<GamepadController> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(GamepadController);
};

}  // namespace content

#endif  // CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_


text:
namespace Rosalia.Core.Tasks
{
    using System;
    using Rosalia.Core.Tasks.Results;

    public class TransformTask<TInput, TOutput> : AbstractTask<TOutput>
        where TOutput : class
        where TInput : class
    {
        private readonly ITask<TInput> _nestedTask;
        private readonly Func<TInput, TOutput> _transformer;

        public TransformTask(ITask<TInput> nestedTask, Func<TInput, TOutput> transformer)
        {
            _nestedTask = nestedTask;
            _transformer = transformer;
        }

        protected override ITaskResult<TOutput> SafeExecute(TaskContext context)
        {
            ITaskResult<TInput> nestedResult = _nestedTask.Execute(context);
            if (!nestedResult.IsSuccess)
            {
                return new FailureResult<TOutput>(nestedResult.Error);
            }

            TOutput transformed = _transformer.Invoke(nestedResult.Data);
            return new SuccessResult<TOutput>(transformed);
        }
    }
}


text:
package org.qi4j.runtime.object;

import org.qi4j.api.common.ConstructionException;
import org.qi4j.api.common.MetaInfo;
import org.qi4j.api.common.Visibility;
import org.qi4j.api.mixin.Initializable;
import org.qi4j.api.mixin.InitializationException;
import org.qi4j.api.object.ObjectDescriptor;
import org.qi4j.functional.HierarchicalVisitor;
import org.qi4j.functional.VisitableHierarchy;
import org.qi4j.runtime.composite.ConstructorsModel;
import org.qi4j.runtime.injection.InjectedFieldsModel;
import org.qi4j.runtime.injection.InjectedMethodsModel;
import org.qi4j.runtime.injection.InjectionContext;

import static org.qi4j.functional.Iterables.iterable;

/**
 * JAVADOC
 */
public final class ObjectModel
    implements ObjectDescriptor, VisitableHierarchy<Object, Object>
{
    private final Class<?> objectType;
    private final Visibility visibility;
    private final MetaInfo metaInfo;
    private final ConstructorsModel constructorsModel;
    private final InjectedFieldsModel injectedFieldsModel;
    private final InjectedMethodsModel injectedMethodsModel;

    public ObjectModel( Class<?> objectType,
                        Visibility visibility,
                        MetaInfo metaInfo
    )
    {
        this.objectType = objectType;
        this.visibility = visibility;
        this.metaInfo = metaInfo;

        constructorsModel = new ConstructorsModel( objectType );
        injectedFieldsModel = new InjectedFieldsModel( objectType );
        injectedMethodsModel = new InjectedMethodsModel( objectType );
    }

    @Override
    @SuppressWarnings( "unchecked" )
    public Iterable<Class<?>> types()
    {
        Iterable<? extends Class<?>> iterable = iterable( objectType );
        return (Iterable<Class<?>>) iterable;
    }

    @Override
    public Visibility visibility()
    {
        return visibility;
    }

    @Override
    public <T> T metaInfo( Class<T> infoType )
    {
        return metaInfo.get( infoType );
    }

    @Override
    public boolean isAssignableTo( Class<?> type )
    {
        return type.isAssignableFrom( objectType );
    }

    @Override
    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<? super Object, ? super Object, ThrowableType> visitor )
        throws ThrowableType
    {
        if( visitor.visitEnter( this ) )
        {
            if( constructorsModel.accept( visitor ) )
            {
                if( injectedFieldsModel.accept( visitor ) )
                {
                    injectedMethodsModel.accept( visitor );
                }
            }
        }
        return visitor.visitLeave( this );
    }

    public Object newInstance( InjectionContext injectionContext )
    {
        Object instance;
        try
        {
            instance = constructorsModel.newInstance( injectionContext );
            injectionContext = new InjectionContext( injectionContext.module(), injectionContext.uses(), instance );
            injectedFieldsModel.inject( injectionContext, instance );
            injectedMethodsModel.inject( injectionContext, instance );
        }
        catch( Exception e )
        {
            throw new ConstructionException( "Could not instantiate " + objectType.getName(), e );
        }

        if( instance instanceof Initializable )
        {
            try
            {
                ( (Initializable) instance ).initialize();
            }
            catch( InitializationException e )
            {
                throw new ConstructionException( "Unable to initialize " + objectType, e );
            }
        }

        return instance;
    }

    public void inject( InjectionContext injectionContext, Object instance )
    {
        injectedFieldsModel.inject( injectionContext, instance );
        injectedMethodsModel.inject( injectionContext, instance );
    }

    @Override
    public String toString()
    {
        return objectType.getName();
    }
}


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Common\ExampleCompilerPass;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
        ];

        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    protected function prepareContainer(ContainerBuilder $container)
    {
        parent::prepareContainer($container);

        $container->registerExtension(new AppExtension());
    }

    protected function buildContainer()
    {
        $containerBuilder = parent::buildContainer();

        $containerBuilder->addCompilerPass(new ExampleCompilerPass());

        return $containerBuilder;
    }

    public function getRootDir()
    {
        return __DIR__;
    }

    public function getCacheDir()
    {
        return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
    }

    public function getLogDir()
    {
        return dirname(__DIR__).'/var/logs';
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.github.mob41</groupId>
  <artifactId>osumer</artifactId>
  <version>${global.version}</version>
  <packaging>pom</packaging>
  <modules>
  	<module>osumer-ui</module>
  	<module>osumer-daemon</module>
  	<module>osumer-lib</module>
  	<module>osumer-installer</module>
  	<module>osumer-launcher</module>
  	<module>osumer-debugdump</module>
  	<module>osums-api</module>
  	<module>osums-server</module>
  </modules>
  <properties>
  	<global.generation>2.0.0</global.generation>
  	<global.branch>SNAPSHOT</global.branch>
  	<global.build>11</global.build>
  	<global.version>${global.generation}-${global.branch}</global.version>
  	<metrics.version>3.1.0</metrics.version>
  	<maven.compiler.source>1.8</maven.compiler.source>
  	<maven.compiler.target>1.8</maven.compiler.target>
  </properties>
  <!--<build>
  	<plugins>
  		<plugin>
  			<groupId>com.googlecode.cmake-maven-project</groupId>
  			<artifactId>cmake-maven-plugin</artifactId>
  			<version>3.7.2-b1</version>
  			<executions>
  				<execution>
  					<id>cmake-generate</id>
      				<goals>
        				<goal>generate</goal>
      				</goals>
      				<configuration>
        				<sourcePath>.</sourcePath>
    		    		<targetPath>.</targetPath>
    		    		<generator>Ninja</generator>
     		   			<classifier>windows-x86_32</classifier>
      				</configuration>
  				</execution>
    			<execution>
      				<id>cmake-compile</id>
      				<goals>
        				<goal>compile</goal>
      				</goals>
      				<configuration>
        				<config>x86</config>
    		    		<projectDirectory>osumer-native</projectDirectory>
     		   			<classifier>windows-x86_32</classifier>
      				</configuration>
    			</execution>
  			</executions>
		</plugin>
  	</plugins>
  </build>-->
</project>


text:
package net.hydromatic.optiq.rules.java;

import net.hydromatic.linq4j.expressions.Expression;

import java.lang.reflect.Type;
import java.util.List;

/**
 * Implements an aggregate function by generating expressions to
 * initialize, add to, and get a result from, an accumulator.
 *
 * @see net.hydromatic.optiq.rules.java.StrictAggImplementor
 * @see net.hydromatic.optiq.rules.java.StrictWinAggImplementor
 * @see net.hydromatic.optiq.rules.java.RexImpTable.CountImplementor
 * @see net.hydromatic.optiq.rules.java.RexImpTable.SumImplementor
 */
public interface AggImplementor {
  /**
   * Returns the types of the intermediate variables used by the aggregate
   * implementation.
   * For instance, for "concatenate to string" this can be {@link java.lang.StringBuilder}.
   * Optiq calls this method before all other {@code implement*} methods.
   * @param info aggregate context
   * @return types of the intermediate variables used by the aggregate
   *   implementation
   */
  List<Type> getStateType(AggContext info);

  /**
   * Implements reset of the intermediate variables to the initial state.
   * {@link AggResetContext#accumulator()} should be used to reference
   * the state variables.
   * For instance, to zero the count use the following code:
   * {@code reset.currentBlock().add(Expressions.statement(
   * Expressions.assign(reset.accumulator().get(0), Expressions.constant(0)));}
   * @param info aggregate context
   * @param reset reset context
   */
  void implementReset(AggContext info, AggResetContext reset);

  /**
   * Updates intermediate values to account for the newly added value.
   * {@link AggResetContext#accumulator()} should be used to reference
   * the state variables.
   * @param info aggregate context
   * @param add add context
   */
  void implementAdd(AggContext info, AggAddContext add);

  /**
   * Calculates the resulting value based on the intermediate variables.
   * Note: this method must NOT destroy the intermediate variables as
   * optiq might reuse the state when calculating sliding aggregates.
   * {@link AggResetContext#accumulator()} should be used to reference
   * the state variables.
   * @param info aggregate context
   * @param result result context
   */
  Expression implementResult(AggContext info, AggResultContext result);
}

// End AggImplementor.java


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rox.Terrain {

    /// <summary>
    /// An implementation prototype for an object capable of creating noise values based on
    /// 2D and 3D coordinates.
    /// </summary>
    public interface INoise {

        /// <summary>
        ///
        /// </summary>
        long Seed { get; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        double Evaluate(double x, double y);

        /// <summary>
        ///
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        double Evaluate(double x, double y, double z);
    }
}


text:
<?php

// setup versions
$bootstrapVersion = "3.0.0";
$fontAwesomeVersion = "3.2.1";
$jqueryVersion = "2.0.3";
$queryUiVersion = "1.10.3";

// setup scriptmap for jquery and jquery-ui cdn
$cs = Yii::app()->clientScript;
$cs->scriptMap["jquery.js"] = "//ajax.googleapis.com/ajax/libs/jquery/$jqueryVersion/jquery.min.js";
$cs->scriptMap["jquery.min.js"] = $cs->scriptMap["jquery.js"];
$cs->scriptMap["jquery-ui.min.js"] = "//ajax.googleapis.com/ajax/libs/jqueryui/$queryUiVersion/jquery-ui.min.js";

// fix jquery.ba-bbq.js for jquery 1.9+ (removed $.browser)
// https://github.com/joshlangner/jquery-bbq/blob/master/jquery.ba-bbq.min.js
$cs->scriptMap["jquery.ba-bbq.js"] = Yii::app()->theme->baseUrl . "/assets/js/jquery.ba-bbq.min.js";

// register js files
$cs->registerCoreScript('jquery');
$cs->registerScriptFile("//netdna.bootstrapcdn.com/bootstrap/$bootstrapVersion/js/bootstrap.min.js", CClientScript::POS_BEGIN);
//$cs->registerScriptFile(Yii::app()->theme->baseUrl . "/assets/js/main.js", CClientScript::POS_END);
$cs->registerScriptFile(Yii::app()->baseUrl . "/js/handlebars-v1.3.0.js", CClientScript::POS_BEGIN);
$cs->registerScriptFile(Yii::app()->baseUrl . "/js/swank.js", CClientScript::POS_END);

?>

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="//netdna.bootstrapcdn.com/bootstrap/<?php echo $bootstrapVersion; ?>/css/bootstrap.min.css" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/font-awesome/<?php echo $fontAwesomeVersion; ?>/css/font-awesome.min.css" rel="stylesheet">
    <link href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/main.css" rel="stylesheet">

    <title><?php echo CHtml::encode($this->pageTitle); ?></title>

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                        Toggle navigation

                    </button>

                <a class="navbar-brand" href="<?php echo Yii::app()->baseUrl; ?>/">TxtMind.us

                <?php $this->widget('zii.widgets.CMenu',array(
                    'htmlOptions'=>array('class'=>'nav navbar-nav'),
                    'items'=>array(
                        array('label'=>'My Reminders', 'url'=>array('/me'), 'visible'=>!Yii::app()->user->isGuest),
                    ),
                )); ?>

                <?php $this->widget('zii.widgets.CMenu',array(
                    'htmlOptions'=>array('class'=>'nav navbar-nav pull-right'),
                    'items'=>array(
                        array('label'=>'Fork Me', 'url'=>'https://github.com/fillup/txtmindus'),
                        array('label'=>'Login with GitHub', 'url'=>array('/auth/login'),
                              'visible'=>Yii::app()->user->isGuest, ),
                        array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/auth/logout'), 'visible'=>!Yii::app()->user->isGuest)
                    ),
                )); ?>

                <?php /*

                        <?php if (Yii::app()->user->isGuest): ?>

                                Log in

<form class="navbar-form form-inline pull-right">
                                            <input type="text" placeholder="Email">
                                            <input type="password" placeholder="Password">
                                            <button type="submit" class="btn">Sign in</button>
                                        </form>

                        <?php else: ?>
                            <?php $username = Yii::app()->user->name; ?>

<?php echo CHtml::link("Logout ($username)", array("/site/logout")); ?>

                        <?php endif; ?>

                    */ ?>

        <?php // NOTE: this does not use bootstrap's breadcrumbs component because CBreadcrumbs doesn't use UL/LI ?>
        <?php // You can implement it yourself or use Chris83's - http://www.yiiframework.com/extension/bootstrap/ ?>
        <?php if(isset($this->breadcrumbs)):?>
            <?php $this->widget('zii.widgets.CBreadcrumbs', array(
                'links'=>$this->breadcrumbs,
            )); ?>
        <?php endif?>

                <?php
                    foreach(Yii::app()->user->getFlashes() as $key => $message) {
                    ?>
                        <div class="alert alert-<?php echo $key; ?> alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <?php echo $message; ?>

                    <?php
                    }
                ?>

            <?php if (!$this->menu): ?>

                        <?php echo $content; ?>

            <?php else: ?>

                        <?php echo $content; ?>

Operations

                                <?php
                                $this->widget('zii.widgets.CMenu', array(
                                    'items'=>$this->menu,
                                    'htmlOptions'=>array('class'=>'nav nav-pills nav-stacked'),
                                ));
                                ?>

            <?php endif; ?>

                © <?php echo date('Y',time()); ?> <?php echo Yii::app()->name; ?>. All Rights Reserved.

                Profiling: <?php echo round(Yii::getLogger()->getExecutionTime(),2); ?>s / <?php echo round(Yii::getLogger()->getMemoryUsage()/1048576,2); ?>mb


text:
package com.catify.core.process.nodes;

import com.catify.core.constants.ProcessConstants;
import com.catify.core.process.nodes.Node;

public class ForkNode extends Node {

	private static final long serialVersionUID = 2771099004884397971L;

	public ForkNode(String processId, String nodeName) {
		super(processId, nodeName);
	}

	@Override
	public int getNodeType() {
		return ProcessConstants.FORK;
	}

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Tutorials - UIkit documentation</title>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png">
    <link id="data-uikit-theme" rel="stylesheet" href="css/uikit.docs.min.css">
    <link rel="stylesheet" href="css/docs.css">
    <link rel="stylesheet" href="../vendor/highlight/highlight.css">

Get Started

Core

Components

Customizer

Showcase

Tutorials

Screencasts

Introduction

Basic markup

Responsive Grid

Building a one pager

Sticky navigation

Scrollspy and smooth scrolling

Off-canvas navigation

Autocompletion in Sublime Text

Parallax scrolling

Using the Customizer

Tutorials

A collection of tutorials created by the UIkit community. You've discovered some more tutorials online? Great, please let us know!

Overview and Introduction

March, 2015

Getting started with basic markup

March, 2015

The Responsive Grid

March, 2015

Building a one pager website

March, 2015

Sticky navigation

March, 2015

Scrollspy navigation and smooth scrolling

March, 2015

Off-canvas and mobile navigations

March, 2015

Autocompletion in Sublime Text 3

April, 2015

Parallax scrolling

May, 2015

Using the Customizer

May, 2015

GitHub

Issues

Changelog

Twitter

Made by YOOtheme with love and caffeine.
Licensed under MIT license.

Documentation

Get started

How to customize

Layout examples

Core

Components

Project structure

Less & Sass files

Create a theme

Create a style

Customizer.json

JavaScript

Custom prefix

Core

 Defaults

Base

Print

 Layout

Grid

Panel

Block

Article

Comment

Utility

Flex

Cover

 Navigations

Nav

Navbar

Subnav

Breadcrumb

Pagination

Tab

Thumbnav

 Elements

List

Description list

Table

Form

 Common

Button

Icon

Close

Badge

Alert

Thumbnail

Overlay

Text

Animation

Contrast

 JavaScript

Dropdown

Modal

Off-canvas

Switcher

Toggle

Scrollspy

Smooth scroll

Components

 Layout

Dynamic Grid

 Navigations

Dotnav

Slidenav

Dynamic Pagination

 Common

Form advanced

Form file

Form password

Form select

Placeholder

Progress

 JavaScript

Lightbox

Autocomplete

Datepicker

HTML editor

Slider

Slideset

Slideshow

Parallax

Accordion

Notify

Search

Nestable

Sortable

Sticky

Timepicker

Tooltip

Upload

Showcase


text:
package garmintools.wrappers;

import garmintools.Proto;
import garmintools.keys.IndexForeignKey;

public class Runway {
  public final Proto.Runway protoRunway;
  public final IndexForeignKey runwayNumberSuffix;
  public final IndexForeignKey lighting;
  public final IndexForeignKey surface;

  private Runway(Builder builder) {
    this.protoRunway = builder.protoRunway;
    this.runwayNumberSuffix = builder.runwayNumberSuffix;
    this.lighting = builder.lighting;
    this.surface = builder.surface;
  }

  public static Builder newBuilder() {
    return new Builder();
  }

  public static class Builder {
    private Proto.Runway protoRunway;
    private IndexForeignKey runwayNumberSuffix;
    private IndexForeignKey lighting;
    private IndexForeignKey surface;

    private Builder() { }
    public Builder withRunway(Proto.Runway proto) { this.protoRunway = proto; return this; }
    public Builder withRunwayNumberSuffix(IndexForeignKey key) { this.runwayNumberSuffix = key; return this; }
    public Builder withLighting(IndexForeignKey key) { this.lighting = key; return this; }
    public Builder withSurface(IndexForeignKey key) { this.surface = key; return this; }
    public Runway build() { return new Runway(this); }
  }

  @Override
  public String toString() {
    return protoRunway.toString();
  }
}


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="redrope.iteam.se" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Redrope</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@callback.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <feature name="Vibration">
        <param name="ios-package" value="CDVVibration" />
    </feature>
    <feature name="Notification">
        <param name="ios-package" value="CDVNotification" />
    </feature>
    <feature name="SplashScreen">
        <param name="ios-package" value="CDVSplashScreen" />
    </feature>

    <content src="index.html" />
    <access origin="*" />

    <preference name="permissions" value="none" />
    <preference name="orientation" value="default" />
    <preference name="target-device" value="universal" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="7" />
    <preference name="android-installLocation" value="auto" />

    <icon src="icon.png" />
    <icon gap:density="ldpi" gap:platform="android" src="res/icon/android/icon-36-ldpi.png" />
    <icon gap:density="mdpi" gap:platform="android" src="res/icon/android/icon-48-mdpi.png" />
    <icon gap:density="hdpi" gap:platform="android" src="res/icon/android/icon-72-hdpi.png" />
    <icon gap:density="xhdpi" gap:platform="android" src="res/icon/android/icon-96-xhdpi.png" />
    <icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
    <icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
    <icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
    <icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
    <icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
    <icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
    <icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
    <icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
    <icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" />
    <gap:splash gap:density="ldpi" gap:platform="android" src="res/screen/android/screen-ldpi-portrait.png" />
    <gap:splash gap:density="mdpi" gap:platform="android" src="res/screen/android/screen-mdpi-portrait.png" />
    <gap:splash gap:density="hdpi" gap:platform="android" src="res/screen/android/screen-hdpi-portrait.png" />
    <gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" />
    <gap:splash gap:platform="blackberry" src="res/screen/blackberry/screen-225.png" />
    <gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
    <gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
    <gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
    <gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
    <gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />
</widget>


text:
package org.elasticsearch.ingest.common;

import com.fasterxml.jackson.core.JsonParseException;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.ingest.AbstractProcessor;
import org.elasticsearch.ingest.ConfigurationUtils;
import org.elasticsearch.ingest.IngestDocument;
import org.elasticsearch.ingest.Processor;

import java.util.Map;

import static org.elasticsearch.ingest.ConfigurationUtils.newConfigurationException;

/**
 * Processor that serializes a string-valued field into a
 * map of maps.
 */
public final class JsonProcessor extends AbstractProcessor {

    public static final String TYPE = "json";

    private final String field;
    private final String targetField;
    private final boolean addToRoot;

    JsonProcessor(String tag, String field, String targetField, boolean addToRoot) {
        super(tag);
        this.field = field;
        this.targetField = targetField;
        this.addToRoot = addToRoot;
    }

    public String getField() {
        return field;
    }

    public String getTargetField() {
        return targetField;
    }

    boolean isAddToRoot() {
        return addToRoot;
    }

    @Override
    public void execute(IngestDocument document) throws Exception {
        String stringValue = document.getFieldValue(field, String.class);
        try {
            Map<String, Object> mapValue = JsonXContent.jsonXContent.createParser(stringValue).map();
            if (addToRoot) {
                for (Map.Entry<String, Object> entry : mapValue.entrySet()) {
                    document.setFieldValue(entry.getKey(), entry.getValue());
                }
            } else {
                document.setFieldValue(targetField, mapValue);
            }
        } catch (JsonParseException e) {
            throw new IllegalArgumentException(e);
        }
    }

    @Override
    public String getType() {
        return TYPE;
    }

    public static final class Factory implements Processor.Factory {
        @Override
        public JsonProcessor create(Map<String, Processor.Factory> registry, String processorTag,
                                    Map<String, Object> config) throws Exception {
            String field = ConfigurationUtils.readStringProperty(TYPE, processorTag, config, "field");
            String targetField = ConfigurationUtils.readOptionalStringProperty(TYPE, processorTag, config, "target_field");
            boolean addToRoot = ConfigurationUtils.readBooleanProperty(TYPE, processorTag, config, "add_to_root", false);

            if (addToRoot && targetField != null) {
                throw newConfigurationException(TYPE, processorTag, "target_field",
                    "Cannot set a target field while also setting `add_to_root` to true");
            }

            if (targetField == null) {
                targetField = field;
            }

            return new JsonProcessor(processorTag, field, targetField, addToRoot);
        }
    }
}