text:
require "formula"

# Please only update to versions that are published on PyPi as there are too
# many releases for us to update to every single one:
# https://pypi.python.org/pypi/youtube_dl
class YoutubeDl < Formula
  homepage "http://rg3.github.io/youtube-dl/"
  url "https://yt-dl.org/downloads/2014.08.10/youtube-dl-2014.08.10.tar.gz"
  sha1 "fd4d544f4852eb803fea7a2918b8f6e7deb89931"

  bottle do
    cellar :any
    sha1 "c1b5f8493c5a700ce740baeb5c86ee877400e619" => :mavericks
    sha1 "367f090904c3bf3953548b0b09dddaad0841ec6d" => :mountain_lion
    sha1 "774000f77e8f2a8c9aa2ddf6194729bd9ea7eab4" => :lion
  end

  head do
    url "https://github.com/rg3/youtube-dl.git"
    depends_on "pandoc" => :build
  end

  depends_on "rtmpdump" => :optional

  def install
    # Remove the legacy executable from the git repo
    rm "youtube-dl" if build.head?
    system "make", "PREFIX=#{prefix}"
    bin.install "youtube-dl"
    man1.install "youtube-dl.1"
    bash_completion.install "youtube-dl.bash-completion"
  end

  def caveats
    "To use post-processing options, `brew install ffmpeg`."
  end

  test do
    system "#{bin}/youtube-dl", "--simulate", "http://www.youtube.com/watch?v=he2a4xK8ctk"
  end
end


text:
namespace NEventStore.Client
{
    using System;
    using System.Threading.Tasks;

    public interface IObserveCommits : IObservable<ICommit>, IDisposable
    {
        Task Start();

        void PollNow();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package model

case class ThingAddress(roomSn: Int, thingSn: Int) extends Address[Thing] {
  override def resolve(world: World): Option[Thing] = {
    world.getById(roomSn) match {
      case None => None
      case Some(r: Room) => r.getById(thingSn)
    }
  }
}


text:
interface IChapter {
	title: string;
	rules: IRule[];
}


text:
<root>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator AbstractEmptyIterator()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator boolean hasNext()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator boolean hasPrevious()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator int nextIndex()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator int previousIndex()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator java.lang.Object setValue(java.lang.Object) 0'>
        <annotation name='org.jetbrains.annotations.Nullable'/>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator void add(java.lang.Object) 0'>
        <annotation name='org.jetbrains.annotations.Nullable'/>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator void reset()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.AbstractEmptyIterator void set(java.lang.Object) 0'>
        <annotation name='org.jetbrains.annotations.Nullable'/>
    </item>
    <item name='org.apache.commons.collections.iterators.EmptyIterator EmptyIterator()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.EmptyMapIterator EmptyMapIterator()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.EmptyOrderedIterator EmptyOrderedIterator()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
    <item name='org.apache.commons.collections.iterators.EmptyOrderedMapIterator EmptyOrderedMapIterator()'>
        <annotation name='org.jetbrains.annotations.Contract'>
            <val name="pure" val="true"/>
        </annotation>
    </item>
</root>


text:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="resources.html">

  &project;

  <properties>
    <title>The Resources Component</title>
  </properties>

<toc />

The Resources element represents all the resources
  available to the web application. This includes classes, JAR files, HTML, JSPs
  and any other files that contribute to the web application. Implementations
  are provided to use directories, JAR files and WARs as the source of these
  resources and the resources implementation may be extended to provide support
  for files stored in other forms such as in a database or a versioned
  repository.

Resources are cached by default.

Note: Running a webapp with non-filesystem based
  Resources implementations is only possible when the webapp does not
  rely on direct filesystem access to its own resources, and uses the methods
  in the ServletContext interface to access them.

A Resources element MAY be nested inside a
  Context component.  If it is not included,
  a default filesystem based Resources will be created automatically,
  which is sufficient for most requirements.

  <subsection name="Common Attributes">

All implementations of Resources support the following
    attributes:

    <attributes>

      <attribute name="allowLinking" required="false">

If the value of this flag is true, symlinks will be
        allowed inside the web application, pointing to resources outside the
        web application base path. If not specified, the default value
        of the flag is false.

NOTE: This flag MUST NOT be set to true on the Windows platform
        (or any other OS which does not have a case sensitive filesystem),
        as it will disable case sensitivity checks, allowing JSP source code
        disclosure, among other security problems.

      </attribute>

      <attribute name="cacheMaxSize" required="false">

The maximum size of the static resource cache in kilobytes.
        If not specified, the default value is 10240
        (10 megabytes). This value may be changed while the web application is
        running (e.g. via JMX). If the cache is using more memory than the new
        limit the cache will attempt to reduce in size over time to meet the
        new limit. If necessary, cacheObjectMaxSize will be
        reduced to ensure that it is no larger than
        cacheMaxSize/20.

      </attribute>

      <attribute name="cacheObjectMaxSize" required="false">

Maximum size of the static resource that will be placed in the cache.
        If not specified, the default value is 512
        (512 kilobytes). If this value is greater than
        cacheMaxSize/20 it will be reduced to
        cacheMaxSize/20. This value may be changed while the web
        application is running (e.g. via JMX).

      </attribute>

      <attribute name="cacheTTL" required="false">

The amount of time in milliseconds between the revalidation of cache
        entries. If not specified, the default value is 5000 (5
        seconds). This value may be changed while the web application is running
        (e.g. via JMX). When a resource is cached it will inherit the TTL in
        force at the time it was cached and retain that TTL until the resource
        is evicted from the cache regardless of any subsequent changes that may
        be made to this attribute.

      </attribute>

      <attribute name="cachingAllowed" required="false">

If the value of this flag is true, the cache for static
        resources will be used. If not specified, the default value
        of the flag is true. This value may be changed while the
        web application is running (e.g. via JMX). When the cache is disabled
        any resources currently in the cache are cleared from the cache.

      </attribute>

      <attribute name="className" required="false">

Java class name of the implementation to use. This class must
        implement the org.apache.catalina.WebResourceRoot
        interface. If not specified, the standard value (defined below) will be
        used.

      </attribute>

      <attribute name="trackLockedFiles" required="false">

Controls whether the track locked files feature is enabled. If
        enabled, all calls to methods that return objects that lock a file and
        need to be closed to release that lock (e.g.
        ServletContext.getResourceAsStream()) will perform a number
        of additional tasks.

The stack trace at the point where the method was called will be
          recorded and associated with the returned object.

The returned object will be wrapped so that the point where
          close() (or equivalent) is called to release the resources can be
          detected. Tracking of the object will cease once the resources have
          been released.

All remaining locked resources on web application shutdown will be
          logged and then closed.

If not specified, the default value of false will be
        used.

      </attribute>

    </attributes>

  </subsection>

  <subsection name="Standard Implementation">

The standard implementation of Resources is
    org.apache.catalina.webresources.StandardRoot, and
    is configured by its parent Context element.

  </subsection>

A web application's main resources are defined by the
  docBase defined for the Context.
  Additional resources may be made available to the web application by defining
  one or more nested components.

PreResources

PreResources are searched before the main resources. They will be searched
  in the order they are defined. To configure PreResources, nest a
  <PreResources> element inside the <Resources> element with the
  following attributes:

  <attributes>

    <attribute name="base" required="true">

Identifies where the resources to be used are located. This attribute
      is required by the org.apache.catalina.WebResourceSet
      implementations provided by Tomcat and should specify the absolute path to
      the file, directory or JAR where the resources are located. Custom
      implementations may not require it.

    </attribute>

    <attribute name="className" required="true">

Java class name of the implementation to use. This class must
      implement the org.apache.catalina.WebResourceSet interface.
      Tomcat provides three standard implementations:
      org.apache.catalina.webresources.DirResourceSet,
      org.apache.catalina.webresources.FileResourceSet and
      org.apache.catalina.webresources.JarResourceSet. Custom
      implementations may also be used.

    </attribute>

    <attribute name="internalPath" required="false">

Identifies the path within the base where the
      resources are to be found. This is typically only used with JAR files when
      the resources are not located at the root of the JAR as is the case with
      resource JARs. This attribute is required by the
      org.apache.catalina.WebResourceSet implementations provided
      by Tomcat and must start with '/'. Custom implementations may not require
      it. If not specified, the default value '/' will be used.

    </attribute>

    <attribute name="readOnly" required="false">

If true, resources within this resource set may not be
      deleted, created or modified. For instance of
      org.apache.catalina.webresources.JarResourceSet, this
      attribute is hard-coded to true and may not be changed. For
      instances of org.apache.catalina.webresources.DirResourceSet
      and org.apache.catalina.webresources.FileResourceSet the
      default value of this attribute is false.

    </attribute>

    <attribute name="webAppMount" required="false">

Identifies the path within the web application that these resources
      will be made available. For the
      org.apache.catalina.WebResourceSet implementations provided
      by Tomcat, this attribute is required and must start with '/'. Custom
      implementations may not require it. If not specified, the default value of
      '/' will be used.

    </attribute>

  </attributes>

JAR resources

JarResources are searched after the main resources but before the
  PostResources. They will be searched in the order they are defined. To
  configure JarResources, nest a <JarResources> element inside the
  <Resources> element. The configuration attributes are the same as for
  PreResources.

Post-resources

PostResources are searched after the resource JARs. They will be searched
  in the order they are defined. To configure PostResources, nest a
  <PostResources> element inside the <Resources> element. The
  configuration attributes are the same as for PreResources.

No special features are associated with a Resources
  element.

</document>


text:
package org.apache.commons.jelly.tags.regexp;

import org.apache.commons.jelly.TagLibrary;
/** Implements regexp tags.
 *
 *  @author Christian Amor Kvalheim
 *  @version $Revision: 155420 $
 */
public class RegexpTagLibrary extends TagLibrary {

    public RegexpTagLibrary()
    {
        registerTag("match", MatchTag.class);
        registerTag("contains", ContainsTag.class);
    }
}


text:
require_relative '../spec_helper_lite'

require "active_model"
require_relative '../../app/models/article'

describe Article do
  let(:article) { Article.new }

  it "starts with blank attributes" do
    article.title.should be_nil
    article.summary.should be_nil
    article.content.should be_nil
  end

  it "supports reading and writing a title" do
    article.title = "new one"
    article.title.should eq "new one"
  end

  it "supports reading and writing a summary" do
    article.summary = "new one"
    article.summary.should eq "new one"
  end

  it "supports reading and writing a article content" do
    article.content = "new one"
    article.content.should eq "new one"
  end

  it "supports setting attributes in initializer" do
    article = Article.new(title: 'new title', summary: 'new summary', content: 'new content')
    article.title.should eq 'new title'
    article.summary.should eq 'new summary'
    article.content.should eq 'new content'
  end

  it "supports reading and writing a feed reference" do
    feed = Object.new
    article.feed = feed
    article.feed.should eq feed
  end

  it "is not valid with blank title" do
    [nil, "", " "].each do |bad_title|
      article.title = bad_title
      article.should_not be_valid
    end
  end

  it "is valid with non-blanck title" do
    article.title = "hey there"
    article.should be_valid
  end

  describe "#publish" do
    let(:feed) { mock(:feed) }
    before(:each) do
      article.feed = feed
      # TODO remove this dep
      article.stub(:valid?).and_return(true)
    end

    it "adds the article to the feed" do
      feed.should_receive(:add_entry).with(article)
      article.publish
    end

    describe "given an invaid article" do
      before(:each) do
        article.stub(:valid?).and_return(false)
      end

      it "wont add the article to the feed" do
        feed.should_not_receive(:add_entry)
        article.publish
      end

      # TODO change to raise exception
      it "returns false" do
        article.publish.should be_false
      end
    end
  end

  describe "#pubdate" do
    context "before publishing" do
      it "is nil" do
        article.pubdate.should be_nil
      end
    end

    context "after publishing" do
      before(:each) do
        @now = DateTime.parse "2012-04-04T13:54"
        @clock = mock
        @clock.stub(:now).and_return(@now)

        article.feed = mock.as_null_object
        # TODO remove this dep
        article.stub(:valid?).and_return(true)
        article.publish(@clock)
      end

      it "is a datetime" do
        article.pubdate.should be_kind_of DateTime
      end

      it "is current time" do
        article.pubdate.should be @now
      end
    end
  end
end


text:
{% extends 'stackdio/page.html' %}
{% load i18n %}

{% block title %}User Password Change{% endblock %}
{% block profile-class %}active{% endblock %}

{% block page-content %}
    <form data-bind="submit: function () { changePassword() }">

                    {% trans 'Current password:' %}
                    <input id="id_current_password" type="password" name="current_password" class="form-control" data-bind="value: currentPassword, valueUpdate: 'keyup'" required autofocus>

                    {% trans 'New password:' %}
                    <input id="id_new_password1" type="password" name="new_password1" class="form-control" data-bind="value: newPassword1, valueUpdate: 'keyup'" required autofocus>

                    {% trans 'New password again:' %}
                    <input id="id_new_password2" type="password" name="new_password2" class="form-control" data-bind="value: newPassword2, valueUpdate: 'keyup'" required autofocus>

                <button type="submit" class="btn btn-primary">Change</button>

    </form>
{% endblock %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of PUNCT in UD_Old_East_Slavic-Ruthenian</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Old_East_Slavic-Ruthenian: POS Tags: PUNCT

There are 1 PUNCT lemmas (7%), 8 PUNCT types (1%) and 437 PUNCT tokens (14%).
Out of 15 observed tags, the rank of PUNCT is: 12 in number of lemmas, 14 in number of types and 2 in number of tokens.

The 10 most frequent PUNCT lemmas: _

The 10 most frequent PUNCT types:  ,, ., ;, -, ", :, [!], —

The 10 most frequent ambiguous lemmas: _ (<tt>NOUN</tt> 660, <tt>PUNCT</tt> 437, <tt>VERB</tt> 335, <tt>ADP</tt> 307, <tt>CCONJ</tt> 293, <tt>DET</tt> 271, <tt>ADJ</tt> 225, <tt>PRON</tt> 145, <tt>ADV</tt> 120, <tt>PART</tt> 114, <tt>SCONJ</tt> 76, <tt>AUX</tt> 59, <tt>NUM</tt> 18, <tt>PROPN</tt> 8, <tt>X</tt> 1)

The 10 most frequent ambiguous types:

Morphology

The form / lemma ratio of PUNCT is 8.000000 (the average of all parts of speech is 75.933333).

The 1st highest number of forms (8) was observed with the lemma "_": ,, -, ., :, ;, [!], ", —.

PUNCT does not occur with any features.

Relations

PUNCT nodes are attached to their parents using 1 different relations: <tt>punct</tt> (437; 100% instances)

Parents of PUNCT nodes belong to 9 different parts of speech: <tt>VERB</tt> (259; 59% instances), <tt>NOUN</tt> (129; 30% instances), <tt>ADJ</tt> (31; 7% instances), <tt>ADV</tt> (8; 2% instances), <tt>NUM</tt> (3; 1% instances), <tt>PRON</tt> (3; 1% instances), <tt>X</tt> (2; 0% instances), <tt>PROPN</tt> (1; 0% instances), <tt>SCONJ</tt> (1; 0% instances)

437 (100%) PUNCT nodes are leaves.

The highest child degree of a PUNCT node is 0.

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
package org.ddd4j.schema.avro.conversion;

import java.util.function.Function;

import org.apache.avro.Conversion;
import org.apache.avro.LogicalType;
import org.apache.avro.Schema;
import org.ddd4j.util.Require;

public class StringConversion<T> extends Conversion<T> {

	public static <T> Conversion<T> of(Class<T> convertedType, Function<T, ? extends CharSequence> serializer,
			Function<CharSequence, T> deserializer) {
		return new StringConversion<>(convertedType, convertedType.getSimpleName(), serializer, deserializer);
	}

	public static <T> Conversion<T> ofString(Class<T> convertedType, Function<T, String> serializer, Function<String, T> deserializer) {
		return of(convertedType, serializer, deserializer.compose(CharSequence::toString));
	}

	public static <T> Conversion<T> ofString(Class<T> convertedType, String logicalTypeName, Function<T, String> serializer,
			Function<String, T> deserializer) {
		return new StringConversion<>(convertedType, logicalTypeName, serializer, deserializer.compose(CharSequence::toString));
	}

	private final Class<T> convertedType;
	private final String logicalTypeName;
	private final Function<T, ? extends CharSequence> serializer;
	private final Function<CharSequence, T> deserializer;

	public StringConversion(Class<T> convertedType, String logicalTypeName, Function<T, ? extends CharSequence> serializer,
			Function<CharSequence, T> deserializer) {
		this.convertedType = Require.nonNull(convertedType);
		this.logicalTypeName = Require.nonEmpty(logicalTypeName);
		this.serializer = Require.nonNull(serializer);
		this.deserializer = Require.nonNull(deserializer);
	}

	@Override
	public Class<T> getConvertedType() {
		return convertedType;
	}

	@Override
	public String getLogicalTypeName() {
		return logicalTypeName;
	}

	@Override
	public Schema getRecommendedSchema() {
		LogicalType logicalType = new LogicalType(logicalTypeName);
		return logicalType.addToSchema(Schema.create(Schema.Type.STRING));
	}

	@Override
	public T fromCharSequence(CharSequence value, Schema schema, LogicalType type) {
		return deserializer.apply(value);
	}

	@Override
	public CharSequence toCharSequence(T value, Schema schema, LogicalType type) {
		return serializer.apply(value);
	}
}


text:
MYCALLPATHNAME=$0
MYCALLNAME=`basename $MYCALLPATHNAME`
MYCALLNAME=${MYCALLNAME%.sh}
MYCALLPATH=`dirname $MYCALLPATHNAME`g

MYBOOTSTRAPFILE=$(getPathToBootstrapDir.sh)/bootstrap-03_03_001.sh
. ${MYBOOTSTRAPFILE}
if [ $? -ne 0 ];then
	echo "ERROR:Missing bootstrap file:configuration: ${MYBOOTSTRAPFILE}">&2
	exit 1
fi
setUTALMbash 1 $*
#
###
#
. $(getPathToLib.sh libutalmfileobjects.sh)
PATH0=$(setUpperTreeSearchPath . tests)
TROOT=$(getUpperTreePathMatch $PWD tests 0)
. $(getPathToLib.sh libutalmrefpersistency.sh)
refDataInit $TROOT
dataX="${PATH0//$TROOT\//}"

refDataStore ID000 $dataX

####
#Testing the test-frame requires some extra effort
#
#echo "4TEST:$LINENO"
#TESTMODE=$T_CREATEREF  assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX";
#echo "4TEST:$LINENO"
#TESTMODE=$T_COMPAREREF assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX";
#echo "4TEST:$LINENO"
#TESTMODE=$((T_COMPAREREF|T_PRINTREF)) assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX"
#echo "4TEST:$LINENO"
#TESTMODE=$((T_COMPAREREF|T_PRINTREF)) assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX" 2>&1|sed '/utalm_exit:0/d'
#echo "4TEST:$LINENO"
#
####
export dataX
{
	(
		TESTMODE=$T_CREATEREF  assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX";
	);
	(
		TESTMODE=$T_COMPAREREF assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX";
	);
	refx=$(TESTMODE=$((T_PRINTREF)) assertRefDataWithExit $LINENO $BASH_SOURCE ID001 "$dataX" 2>&1)
	[[ "<$dataX>" == "<$refx>" ]]&&{ echo "utalm_exit:0"; exit 0; }
} 2>&1 |countErrors flat=1 filter=1 sums=1 intermediate=0

## \endcond


text:
var big_image;

$(document).ready(function() {
  BrowserDetect.init();

  // Init Material scripts for buttons ripples, inputs animations etc, more info on the next link https://github.com/FezVrasta/bootstrap-material-design#materialjs
  $('body').bootstrapMaterialDesign();

  window_width = $(window).width();

  $navbar = $('.navbar[color-on-scroll]');
  scroll_distance = $navbar.attr('color-on-scroll') || 500;

  $navbar_collapse = $('.navbar').find('.navbar-collapse');

  //  Activate the Tooltips
  $('[data-toggle="tooltip"], [rel="tooltip"]').tooltip();

  // Activate Popovers
  $('[data-toggle="popover"]').popover();

  if ($('.navbar-color-on-scroll').length != 0) {
    $(window).on('scroll', materialKit.checkScrollForTransparentNavbar);
  }

  materialKit.checkScrollForTransparentNavbar();

  if (window_width >= 768) {
    big_image = $('.page-header[data-parallax="true"]');
    if (big_image.length != 0) {
      $(window).on('scroll', materialKit.checkScrollForParallax);
    }

  }

});

$(document).on('click', '.navbar-toggler', function() {
  $toggle = $(this);

  if (materialKit.misc.navbar_menu_visible == 1) {
    $('html').removeClass('nav-open');
    materialKit.misc.navbar_menu_visible = 0;
    $('#bodyClick').remove();
    setTimeout(function() {
      $toggle.removeClass('toggled');
    }, 550);

    $('html').removeClass('nav-open-absolute');
  } else {
    setTimeout(function() {
      $toggle.addClass('toggled');
    }, 580);

    div = '

';
    $(div).appendTo("body").click(function() {
      $('html').removeClass('nav-open');

      if ($('nav').hasClass('navbar-absolute')) {
        $('html').removeClass('nav-open-absolute');
      }
      materialKit.misc.navbar_menu_visible = 0;
      $('#bodyClick').remove();
      setTimeout(function() {
        $toggle.removeClass('toggled');
      }, 550);
    });

    if ($('nav').hasClass('navbar-absolute')) {
      $('html').addClass('nav-open-absolute');
    }

    $('html').addClass('nav-open');
    materialKit.misc.navbar_menu_visible = 1;
  }
});

materialKit = {
  misc: {
    navbar_menu_visible: 0,
    window_width: 0,
    transparent: true,
    fixedTop: false,
    navbar_initialized: false,
    isWindow: document.documentMode || /Edge/.test(navigator.userAgent)
  },

  initFormExtendedDatetimepickers: function() {
    $('.datetimepicker').datetimepicker({
      icons: {
        time: "fa fa-clock-o",
        date: "fa fa-calendar",
        up: "fa fa-chevron-up",
        down: "fa fa-chevron-down",
        previous: 'fa fa-chevron-left',
        next: 'fa fa-chevron-right',
        today: 'fa fa-screenshot',
        clear: 'fa fa-trash',
        close: 'fa fa-remove'
      }
    });
  },

  initSliders: function() {
    // Sliders for demo purpose
    var slider = document.getElementById('sliderRegular');

    noUiSlider.create(slider, {
      start: 40,
      connect: [true, false],
      range: {
        min: 0,
        max: 100
      }
    });

    var slider2 = document.getElementById('sliderDouble');

    noUiSlider.create(slider2, {
      start: [20, 60],
      connect: true,
      range: {
        min: 0,
        max: 100
      }
    });
  },

  checkScrollForParallax: function() {
    oVal = ($(window).scrollTop() / 3);
    big_image.css({
      'transform': 'translate3d(0,' + oVal + 'px,0)',
      '-webkit-transform': 'translate3d(0,' + oVal + 'px,0)',
      '-ms-transform': 'translate3d(0,' + oVal + 'px,0)',
      '-o-transform': 'translate3d(0,' + oVal + 'px,0)'
    });
  },

  checkScrollForTransparentNavbar: debounce(function() {
    if ($(document).scrollTop() > scroll_distance) {
      if (materialKit.misc.transparent) {
        materialKit.misc.transparent = false;
        $('.navbar-color-on-scroll').removeClass('navbar-transparent');
      }
    } else {
      if (!materialKit.misc.transparent) {
        materialKit.misc.transparent = true;
        $('.navbar-color-on-scroll').addClass('navbar-transparent');
      }
    }
  }, 17)
};

// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.

function debounce(func, wait, immediate) {
  var timeout;
  return function() {
    var context = this,
      args = arguments;
    clearTimeout(timeout);
    timeout = setTimeout(function() {
      timeout = null;
      if (!immediate) func.apply(context, args);
    }, wait);
    if (immediate && !timeout) func.apply(context, args);
  };
};

var BrowserDetect = {
  init: function() {
    this.browser = this.searchString(this.dataBrowser) || "Other";
    this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown";
  },
  searchString: function(data) {
    for (var i = 0; i < data.length; i++) {
      var dataString = data[i].string;
      this.versionSearchString = data[i].subString;

      if (dataString.indexOf(data[i].subString) !== -1) {
        return data[i].identity;
      }
    }
  },
  searchVersion: function(dataString) {
    var index = dataString.indexOf(this.versionSearchString);
    if (index === -1) {
      return;
    }

    var rv = dataString.indexOf("rv:");
    if (this.versionSearchString === "Trident" && rv !== -1) {
      return parseFloat(dataString.substring(rv + 3));
    } else {
      return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
    }
  },

  dataBrowser: [{
      string: navigator.userAgent,
      subString: "Chrome",
      identity: "Chrome"
    },
    {
      string: navigator.userAgent,
      subString: "MSIE",
      identity: "Explorer"
    },
    {
      string: navigator.userAgent,
      subString: "Trident",
      identity: "Explorer"
    },
    {
      string: navigator.userAgent,
      subString: "Firefox",
      identity: "Firefox"
    },
    {
      string: navigator.userAgent,
      subString: "Safari",
      identity: "Safari"
    },
    {
      string: navigator.userAgent,
      subString: "Opera",
      identity: "Opera"
    }
  ]

};

var better_browser = '

We are sorry but it looks like your Browser doesn\'t support our website Features. In order to get the full experience please download a new version of your favourite browser.

Mozilla

Chrome

Internet Explorer

Thank you!

';


text:
/**
 * 版权所有 (c) 2018,中金支付有限公司
 */
package com.radish.master.listener;

import java.util.HashMap;
import java.util.Map;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import com.cnpc.framework.activiti.pojo.Constants;
import com.cnpc.framework.base.service.BaseService;
import com.radish.master.entity.Budget;
import com.radish.master.system.SpringUtil;

/**
* 类说明
*
* <pre>
* Modify Information:
* Author        Date          Description
* ============ =========== ============================
* dongyan      2018年1月4日    Create this file
* </pre>
*
*/

public class EstimateTaskCompleteListener implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        String eventName = delegateTask.getEventName();
        if(EVENTNAME_COMPLETE.equals(eventName) && "true".equalsIgnoreCase(delegateTask.getVariable("approved").toString())){
             String businessKey = delegateTask.getVariable(Constants.VAR_BUSINESS_KEY).toString();
             BaseService baseService = (BaseService)SpringUtil.getObject("baseActServer");
             Map<String, Object> params = new HashMap<String, Object>();
             params.put("budgetNo", businessKey);
             Budget budget = baseService.get("from Budget where budgetNo=:budgetNo", params);
             budget.setStatus("30");
             baseService.save(budget);
        }
    }
}


text:
import { h } from 'preact';
import { Component } from 'react';

import ScriptCache from './../util/ScriptCache';
import GoogleApi from './../util/GoogleApi';

const defaultMapConfig = {};
const defaultCreateCache = options => {
	options = options || {};
	const apiKey = options.apiKey;
	const libraries = options.libraries || ['places', 'geometry'];
	const version = options.version || '3';
	return ScriptCache({
		google: GoogleApi({ apiKey: apiKey, libraries: libraries, version: version }),
	});
};

export const wrapper = (options = {}) => WrappedComponent => {
	const apiKey = options.apiKey;
	const libraries = ['places', 'geometry', 'drawing'];
	const version = options.version || '3';
	const createCache = options.createCache || defaultCreateCache;

	class Wrapper extends Component {
		constructor(props, context) {
			super(props, context);
			options.apiKey = props.json.constants.apiKey;
			this.scriptCache = createCache(options);
			this.scriptCache.google.onLoad(this.onLoad.bind(this));

			this.state = {
				loaded: false,
				map: null,
				google: null,
			};
		}

		onLoad(err, tag) {
			this._gapi = window.google;

			this.setState({ loaded: true, google: this._gapi });
		}

		render() {
			const props = Object.assign({}, this.props, {
				loaded: this.state.loaded,
				google: window.google,
			});

			return (
				<div>
					<WrappedComponent {...props} />
				</div>
			);
		}
	}

	return Wrapper;
};

export default wrapper;


text:
@implementation BZRuntimeProperty

- (id)initWithName:(NSString*)name attributes:(NSString*)attributes
{
    if (self = [super init]) {
        _name = name;
        _attributes = attributes;
        _propertyType = [[BZRuntimePropertyType alloc]initWithAttributes:attributes];
        _propertyEncoding = [[BZRuntimePropertyEncoding alloc]initWithAttributes:attributes];
        _clazz = [self classWithAttributes:attributes];
        _structureName = [self structureNameWithAttributes:attributes];
    }
    return self;
}

- (NSString*)structureNameWithAttributes:(NSString*)attributes
{
    NSString *structureName = nil;
    if (_propertyEncoding.isStructure) {
        NSArray *attributeList = [attributes componentsSeparatedByString:@","];
        NSString *firstAttribute = [attributeList firstObject];
        if (firstAttribute.length > 3) {
            NSString *name = [firstAttribute substringWithRange:NSMakeRange(2, firstAttribute.length - 3)];
            NSArray *names = [name componentsSeparatedByString:@"="];
            structureName = names.firstObject;
        }
    }
    return structureName;
}

- (Class)classWithAttributes:(NSString*)attributes
{
    Class clazz = Nil;
    if (_propertyEncoding.isObject) {
        NSArray *attributeList = [attributes componentsSeparatedByString:@","];
        NSString *firstAttribute = [attributeList firstObject];
        if (firstAttribute.length > 3) {
            NSString *className = [firstAttribute substringWithRange:NSMakeRange(3, firstAttribute.length - 4)];
            NSArray *names = [className componentsSeparatedByString:@"<"];
            clazz = NSClassFromString(names.firstObject);
        }
    }
    return clazz;
}

@end


text:
struct IBridgeTSFInterface
{
	IBridgeTSFInterface(){}
	virtual V4::FRectF GetClientRect() = 0;
	virtual IDWriteTextFormat* GetFormat() = 0;
	virtual V4::FRectFBoxModel GetClientRectEx() = 0;
};


text:
#include "PaddleAPI.h"
#include "PaddleAPIPrivate.h"

#include <stdlib.h>
#include <atomic>
#include <memory>

#include "paddle/gserver/gradientmachines/NeuralNetwork.h"
#include "paddle/trainer/ParamUtil.h"
#include "paddle/trainer/Trainer.h"
#include "paddle/trainer/TrainerInternal.h"
#include "paddle/utils/Flags.h"

using paddle::real;

P_DECLARE_string(config);
P_DECLARE_string(init_model_path);
P_DECLARE_int32(start_pass);

struct TrainerPrivate : public paddle::Trainer {
  bool _trainOneBatch(size_t batchSize);
  bool forwardOneBatch(size_t batchSize);
  void forwardOneDataBatch(const std::vector<paddle::Argument>& inArgs);
  void setBatchSize(size_t batchSize);
  std::vector<paddle::Argument>& getForwardOutput();

  void startTestPeriod();
  void finishTestPeriod();
  void testOneDataBatch(const paddle::DataBatch& dataBatch);
  TrainerPrivate() : paddle::Trainer() {}
};

Trainer::Trainer() : m(new TrainerPrivate()) {
  auto conf = paddle::TrainerConfigHelper::createFromFlags();
  if (conf != nullptr) {
    m->init(conf);
  }
}

Trainer::~Trainer() { delete m; }

Trainer* Trainer::createByCommandLine() throw(IOError) {
  auto retv = new Trainer();
  if (retv->m->getConfig().IsInitialized()) {
    return retv;
  } else {
    throw IOError();
  }
}

Trainer::Trainer(TrainerConfig* config, GradientMachine* gm)
    : m(new TrainerPrivate()) {
  m->init(config->m->conf, /* testing= */ false, gm ? gm->m->machine : nullptr);
}

Trainer* Trainer::create(TrainerConfig* config,
                         GradientMachine* gm) throw(IOError) {
  auto retv = new Trainer(config, gm);
  if (retv->m->getConfig().IsInitialized()) {
    return retv;
  } else {
    retv->m->getConfig().CheckInitialized();
    throw IOError();
  }
}

void Trainer::startTrain() { m->startTrain(); }

void Trainer::finishTrain() { m->finishTrain(); }

void Trainer::startTrainPass() { m->startTrainPass(); }

void Trainer::finishTrainPass() { m->finishTrainPass(); }

void Trainer::trainOneDataBatch(size_t batchSize, const Arguments& inArgs) {
  paddle::DataBatch dataBatch;
  dataBatch.getStreams() = inArgs.m->outputs;
  dataBatch.setSize(batchSize);
  m->trainOneDataBatch(dataBatch);
}

bool Trainer::trainOneBatch(size_t batchSize) {
  return m->_trainOneBatch(batchSize);
}

bool TrainerPrivate::_trainOneBatch(size_t batchSize) {
  paddle::DataBatch dataBatch;
  CHECK(dataProvider_) << "data_provider is not specified";
  int num = dataProvider_->getNextBatch(batchSize, &dataBatch);
  if (num == 0) {
    return false;
  }
  trainOneDataBatch(dataBatch);
  return false;
}

void TrainerPrivate::startTestPeriod() {
  if (!tester_) {
    createTester();
  }
  tester_->startTestPeriod();
}

void Trainer::startTestPeriod() { m->startTestPeriod(); }

void TrainerPrivate::testOneDataBatch(const paddle::DataBatch& dataBatch) {
  tester_->testOneDataBatch(dataBatch, &forwardOutput_);
}

void Trainer::testOneDataBatch(size_t batchSize, const Arguments& args) {
  paddle::DataBatch dataBatch;
  dataBatch.getStreams() = args.m->outputs;
  dataBatch.setSize(batchSize);
  m->testOneDataBatch(dataBatch);
}

void TrainerPrivate::finishTestPeriod() { tester_->finishTestPeriod(); }
void Trainer::finishTestPeriod() { m->finishTestPeriod(); }

Matrix* Trainer::getLayerOutput(const std::string& layerName) {
  auto nn = std::dynamic_pointer_cast<paddle::NeuralNetwork>(
      this->m->getGradientMachine());
  CHECK(nn) << "trainerInternal_.getGradientMachine() is not NeuralNetwork";
  auto m = nn->getLayerOutput(layerName);
  return Matrix::createByPaddleMatrixPtr(&m);
}

void Trainer::forwardOneBatch(size_t batchSize) {
  m->forwardOneBatch(batchSize);
}

bool TrainerPrivate::forwardOneBatch(size_t batchSize) {
  CHECK(dataProvider_) << "data_provider is not specified";
  paddle::DataBatch dataBatch;
  int num = dataProvider_->getNextBatch(batchSize, &dataBatch);
  if (num == 0) {
    return false;
  }

  forwardOneDataBatch(dataBatch.getStreams());
  return true;
}

void TrainerPrivate::forwardOneDataBatch(
    const std::vector<paddle::Argument>& inArgs) {
  std::vector<paddle::Argument>& outArgs = forwardOutput_;

  if (config_->getOptConfig().use_sparse_remote_updater()) {
    trainerInternal_.getGradientMachine()->prefetch(inArgs);
    trainerInternal_.getParameterUpdater()->getParametersRemote();
  }
  trainerInternal_.getGradientMachine()->forward(
      inArgs, &outArgs, paddle::PASS_TEST);
}

Arguments* Trainer::getForwardOutput() {
  return Arguments::createByPaddleArgumentVector(&m->getForwardOutput());
}

std::vector<paddle::Argument>& TrainerPrivate::getForwardOutput() {
  return forwardOutput_;
}


text:
ActiveRecord::Schema.define(version: 20150603145730) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"
  enable_extension "uuid-ossp"

  create_table "api_applications", force: :cascade do |t|
    t.string   "name"
    t.string   "api_key"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "oauth_access_grants", force: :cascade do |t|
    t.integer  "resource_owner_id", null: false
    t.integer  "application_id",    null: false
    t.string   "token",             null: false
    t.integer  "expires_in",        null: false
    t.text     "redirect_uri",      null: false
    t.datetime "created_at",        null: false
    t.datetime "revoked_at"
    t.string   "scopes"
  end

  add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree

  create_table "oauth_access_tokens", force: :cascade do |t|
    t.integer  "resource_owner_id"
    t.integer  "application_id"
    t.string   "token",             null: false
    t.string   "refresh_token"
    t.integer  "expires_in"
    t.datetime "revoked_at"
    t.datetime "created_at",        null: false
    t.string   "scopes"
  end

  add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree
  add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree
  add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree

  create_table "oauth_applications", force: :cascade do |t|
    t.string   "name",                      null: false
    t.text     "description"
    t.string   "uid",                       null: false
    t.string   "secret",                    null: false
    t.string   "app_uri",                   null: false
    t.text     "redirect_uri",              null: false
    t.text     "support_uri"
    t.string   "scopes",       default: "", null: false
    t.datetime "created_at"
    t.datetime "updated_at"
    t.text     "pingback_uri"
  end

  add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree

  create_table "sso_clients", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
    t.uuid     "sso_session_id"
    t.integer  "access_grant_id"
    t.integer  "access_token_id"
    t.integer  "application_id"
    t.string   "ip"
    t.string   "agent"
    t.string   "location"
    t.string   "device"
    t.datetime "activity_at"
    t.datetime "created_at",      null: false
    t.datetime "updated_at",      null: false
  end

  add_index "sso_clients", ["access_grant_id"], name: "index_sso_clients_on_access_grant_id", using: :btree
  add_index "sso_clients", ["access_token_id"], name: "index_sso_clients_on_access_token_id", using: :btree
  add_index "sso_clients", ["application_id"], name: "index_sso_clients_on_application_id", using: :btree
  add_index "sso_clients", ["sso_session_id"], name: "index_sso_clients_on_sso_session_id", using: :btree

  create_table "sso_pingbacks", force: :cascade do |t|
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "sso_sessions", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
    t.integer  "access_grant_id"
    t.integer  "access_token_id"
    t.integer  "application_id"
    t.integer  "owner_id",        null: false
    t.string   "group_id",        null: false
    t.string   "secret",          null: false
    t.datetime "activity_at",     null: false
    t.datetime "revoked_at"
    t.string   "revoke_reason"
    t.datetime "created_at",      null: false
    t.datetime "updated_at",      null: false
  end

  add_index "sso_sessions", ["access_grant_id"], name: "index_sso_sessions_on_access_grant_id", using: :btree
  add_index "sso_sessions", ["access_token_id"], name: "index_sso_sessions_on_access_token_id", using: :btree
  add_index "sso_sessions", ["application_id"], name: "index_sso_sessions_on_application_id", using: :btree
  add_index "sso_sessions", ["group_id"], name: "index_sso_sessions_on_group_id", using: :btree
  add_index "sso_sessions", ["owner_id", "access_token_id", "application_id"], name: "one_access_token_per_owner", unique: true, where: "((revoked_at IS NULL) AND (access_token_id IS NOT NULL))", using: :btree
  add_index "sso_sessions", ["owner_id"], name: "index_sso_sessions_on_owner_id", using: :btree
  add_index "sso_sessions", ["revoke_reason"], name: "index_sso_sessions_on_revoke_reason", using: :btree
  add_index "sso_sessions", ["secret"], name: "index_sso_sessions_on_secret", using: :btree

  create_table "users", force: :cascade do |t|
    t.string   "email",                  default: "",   null: false
    t.string   "encrypted_password",     default: "",   null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count",          default: 0,    null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.inet     "current_sign_in_ip"
    t.inet     "last_sign_in_ip"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "name"
    t.string   "first_name"
    t.string   "last_name"
    t.string   "lang",                   default: "EN"
    t.string   "phone"
  end

  add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
  add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree

end


text:
package org.elasticsearch.protocol.xpack.graph;

import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.xcontent.ToXContentFragment;
import org.elasticsearch.xcontent.XContentBuilder;

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

/**
 * A Hop represents one of potentially many stages in a graph exploration.
 * Each Hop identifies one or more fields in which it will attempt to find
 * terms that are significantly connected to the previous Hop. Each field is identified
 * using a {@link VertexRequest}
 *
 *
An example series of Hops on webserver logs would be:
 *

 *
an initial Hop to find
 * the top ten IPAddresses trying to access urls containing the word "admin"

 *
a secondary Hop to see which other URLs those IPAddresses were trying to access

 *

 *
 *

 * Optionally, each hop can contain a "guiding query" that further limits the set of documents considered.
 * In our weblog example above we might choose to constrain the second hop to only look at log records that
 * had a response code of 404.
 *

 *

 * If absent, the list of {@link VertexRequest}s is inherited from the prior Hop's list to avoid repeating
 * the fields that will be examined at each stage.
 *

 *
 */
public class Hop implements ToXContentFragment {
    final Hop parentHop;
    List<VertexRequest> vertices = null;
    QueryBuilder guidingQuery = null;

    public Hop(Hop parent) {
        this.parentHop = parent;
    }

    public ActionRequestValidationException validate(ActionRequestValidationException validationException) {

        if (getEffectiveVertexRequests().size() == 0) {
            validationException = ValidateActions.addValidationError(GraphExploreRequest.NO_VERTICES_ERROR_MESSAGE, validationException);
        }
        return validationException;

    }

    public Hop getParentHop() {
        return parentHop;
    }

    void writeTo(StreamOutput out) throws IOException {
        out.writeOptionalNamedWriteable(guidingQuery);
        if (vertices == null) {
            out.writeVInt(0);
        } else {
            out.writeVInt(vertices.size());
            for (VertexRequest vr : vertices) {
                vr.writeTo(out);
            }
        }
    }

    void readFrom(StreamInput in) throws IOException {
        guidingQuery = in.readOptionalNamedWriteable(QueryBuilder.class);
        int size = in.readVInt();
        if (size > 0) {
            vertices = new ArrayList<>();
            for (int i = 0; i < size; i++) {
                VertexRequest vr = new VertexRequest();
                vr.readFrom(in);
                vertices.add(vr);
            }
        }
    }

    public QueryBuilder guidingQuery() {
        if (guidingQuery != null) {
            return guidingQuery;
        }
        return QueryBuilders.matchAllQuery();
    }

    /**
     * Add a field in which this {@link Hop} will look for terms that are highly linked to
     * previous hops and optionally the guiding query.
     *
     * @param fieldName a field in the chosen index
     */
    public VertexRequest addVertexRequest(String fieldName) {
        if (vertices == null) {
            vertices = new ArrayList<>();
        }
        VertexRequest vr = new VertexRequest();
        vr.fieldName(fieldName);
        vertices.add(vr);
        return vr;
    }

    /**
     * An optional parameter that focuses the exploration on documents that
     * match the given query.
     *
     * @param queryBuilder any query
     */
    public void guidingQuery(QueryBuilder queryBuilder) {
        guidingQuery = queryBuilder;
    }

    protected List<VertexRequest> getEffectiveVertexRequests() {
        if (vertices != null) {
            return vertices;
        }
        if (parentHop == null) {
            return Collections.emptyList();
        }
        // otherwise inherit settings from parent
        return parentHop.getEffectiveVertexRequests();
    }

    public int getNumberVertexRequests() {
        return getEffectiveVertexRequests().size();
    }

    public VertexRequest getVertexRequest(int requestNumber) {
        return getEffectiveVertexRequests().get(requestNumber);
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        if (guidingQuery != null) {
            builder.field("query");
            guidingQuery.toXContent(builder, params);
        }
        if (vertices != null && vertices.size() > 0) {
            builder.startArray("vertices");
            for (VertexRequest vertexRequest : vertices) {
                vertexRequest.toXContent(builder, params);
            }
            builder.endArray();
        }
        return builder;
    }
}


text:
cask 'font-material-icons' do
  version '2.2.3'
  sha256 'c68797889b285abe51898defa209d1a1bd1d959c9f20e5ef486c1d3f0e08eac2'

  # github.com/google/material-design-icons was verified as official when first introduced to the cask
  url "https://github.com/google/material-design-icons/archive/#{version}.zip"
  appcast 'https://github.com/google/material-design-icons/releases.atom',
          checkpoint: '904d2021b0453db73abe506f4756b53eb78aa372f0628d57c8226a132c97323d'
  name 'Material Icons'
  homepage 'http://google.github.io/material-design-icons/'
  license :oss

  font "material-design-icons-#{version}/iconfont/MaterialIcons-Regular.ttf"
end


text:
package com.jnape.palatable.lambda.internal.iteration;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import java.util.Iterator;

import static com.jnape.palatable.lambda.adt.hlist.HList.tuple;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.when;
import static testsupport.Mocking.mockIteratorToHaveValues;

@RunWith(MockitoJUnitRunner.class)
public class CombinatorialIteratorTest {

    @Mock private Iterator<Object> as;
    @Mock private Iterator<Object> bs;

    private CombinatorialIterator<Object, Object> combinatorialIterator;

    @Before
    public void setUp() {
        combinatorialIterator = new CombinatorialIterator<>(as, bs);
    }

    @Test
    public void hasNextIfMoreAsAndMoreBs() {
        when(as.hasNext()).thenReturn(true);
        when(bs.hasNext()).thenReturn(true);

        assertThat(combinatorialIterator.hasNext(), is(true));
    }

    @Test
    public void doesNotHaveNextIfMoreAsButNoBs() {
        when(as.hasNext()).thenReturn(true);
        when(bs.hasNext()).thenReturn(false);

        assertThat(combinatorialIterator.hasNext(), is(false));
    }

    @Test
    public void doesNotHaveNextIfNoAsButMoreBs() {
        when(as.hasNext()).thenReturn(false);

        assertThat(combinatorialIterator.hasNext(), is(false));
    }

    @Test
    public void computesCombinationsInOrder() {
        mockIteratorToHaveValues(as, "a1", "a2");
        mockIteratorToHaveValues(bs, "b1", "b2");

        assertThat(combinatorialIterator.next(), is(tuple("a1", "b1")));
        assertThat(combinatorialIterator.next(), is(tuple("a1", "b2")));
        assertThat(combinatorialIterator.next(), is(tuple("a2", "b1")));
        assertThat(combinatorialIterator.next(), is(tuple("a2", "b2")));
    }
}


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

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

001
018
019package org.apache.hadoop.lib.servlet;
020
021import org.apache.hadoop.classification.InterfaceAudience;
022import org.slf4j.MDC;
023
024import javax.servlet.Filter;
025import javax.servlet.FilterChain;
026import javax.servlet.FilterConfig;
027import javax.servlet.ServletException;
028import javax.servlet.ServletRequest;
029import javax.servlet.ServletResponse;
030import javax.servlet.http.HttpServletRequest;
031import java.io.IOException;
032import java.security.Principal;
033
034/**
035 * Filter that sets request contextual information for the slf4j MDC.
036 * <p>
037 * It sets the following values:
038 * <ul>
039 * <li>hostname: if the {@link HostnameFilter} is present and configured
040 * before this filter</li>
041 * <li>user: the <code>HttpServletRequest.getUserPrincipal().getName()</code></li>
042 * <li>method: the HTTP method fo the request (GET, POST, ...)</li>
043 * <li>path: the path of the request URL</li>
044 * </ul>
045 */
046@InterfaceAudience.Private
047public class MDCFilter implements Filter {
048
049  /**
050   * Initializes the filter.
051   * <p>
052   * This implementation is a NOP.
053   *
054   * @param config filter configuration.
055   *
056   * @throws ServletException thrown if the filter could not be initialized.
057   */
058  @Override
059  public void init(FilterConfig config) throws ServletException {
060  }
061
062  /**
063   * Sets the slf4j <code>MDC</code> and delegates the request to the chain.
064   *
065   * @param request servlet request.
066   * @param response servlet response.
067   * @param chain filter chain.
068   *
069   * @throws IOException thrown if an IO error occurrs.
070   * @throws ServletException thrown if a servet error occurrs.
071   */
072  @Override
073  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
074    throws IOException, ServletException {
075    try {
076      MDC.clear();
077      String hostname = HostnameFilter.get();
078      if (hostname != null) {
079        MDC.put("hostname", HostnameFilter.get());
080      }
081      Principal principal = ((HttpServletRequest) request).getUserPrincipal();
082      String user = (principal != null) ? principal.getName() : null;
083      if (user != null) {
084        MDC.put("user", user);
085      }
086      MDC.put("method", ((HttpServletRequest) request).getMethod());
087      MDC.put("path", ((HttpServletRequest) request).getPathInfo());
088      chain.doFilter(request, response);
089    } finally {
090      MDC.clear();
091    }
092  }
093
094  /**
095   * Destroys the filter.
096   * <p>
097   * This implementation is a NOP.
098   */
099  @Override
100  public void destroy() {
101  }
102}
103


text:
Jekyll theme based on [landing-page bootstrap theme ](http://startbootstrap.com/templates/landing-page/)

## How to use
 - Place a image in `/img/services/`
 - Create posts to display your services. Use the follow as an example:

```txt
---
layout: default
img: ipad.png
category: Services
title: The service title
---
The description of this service
```

## Demo
View this jekyll theme in action [here](https://swcool.github.io/landing-page-theme)

## Screenshot
![screenshot](https://raw.githubusercontent.com/swcool/landing-page-theme/master/img/screenshot.png)

===

For more Jekyll details, read [documentation](http://jekyllrb.com/).
This Jekyll theme used [Freelancer Jekyll theme](https://github.com/jeromelachaud/freelancer-theme/) as reference.

## License
The contents of this repository are licensed under the [Apache
2.0](http://www.apache.org/licenses/LICENSE-2.0.html).

## Version
1.0.1


text:
<?php
/**
 * pages/admin/settings_send.php
 * Verwaltung -> Einstellungen -> Einstellungen speichern
 */

// Sicherheitsabfrage
if(!defined('ODDB')) die('unerlaubter Zugriff!');

// keine Berechtigung
if(!$user->rechte['verwaltung_settings']) {
	$tmpl->error = 'Du hast keine Berechtigung!';
}

// alles OK
else {
	// bisherige Konfiguration laden
	if(!class_exists('config')) {
		include './common/config.php';
	}

	$c = config::getcustom(INSTANCE);

	// Daten aufbereiten
	foreach($_POST as $key=>$val) {
		if($val === '') {
			unset($_POST[$key]);
		}
	}

	$int_vars = array(
		'scan_veraltet',
		'scan_veraltet_ally',
		'scan_veraltet_oview',
		'scan_veraltet_einst',
		'scan_veraltet_flotten',
		'scan_veraltet_geld',
		'scan_veraltet_forschung',
		'sprunggenerator_del',
		'bbstf_del',
		'toxxroute_del'
	);

	foreach($int_vars as $var) {
		if(isset($_POST[$var])) {
			$_POST[$var] = (int)$_POST[$var];
		}
	}

	if(isset($_POST['disable_freischaltung'])) {
		$_POST['disable_freischaltung'] = (bool)$_POST['disable_freischaltung'];
	}

	if(isset($_POST['disable_freischaltung_level'])) {
		if(!isset($rechte[$_POST['disable_freischaltung_level']])) {
			unset($_POST['disable_freischaltung_level']);
		}
		else $_POST['disable_freischaltung_level'] = (int)$_POST['disable_freischaltung_level'];
	}

	if(isset($_POST['logging'])) {
		$_POST['logging'] = (int)$_POST['logging'];
		if($_POST['logging'] < 0 OR $_POST['logging'] > 3) {
			unset($_POST['logging']);
		}
	}

	if(isset($_POST['logging_time'])) {
		$_POST['logging_time'] = (int)$_POST['logging_time'];
		if($_POST['logging_time'] < 1) {
			unset($_POST['logging_time']);
		}
	}

	// in die Konfiguration übertragen
	$settings = array(
		'scan_veraltet',
		'scan_veraltet_ally',
		'scan_veraltet_oview',
		'scan_veraltet_einst',
		'scan_veraltet_flotten',
		'scan_veraltet_geld',
		'scan_veraltet_forschung',
		'sprunggenerator_del',
		'bbstf_del',
		'toxxroute_del',
		'disable_freischaltung',
		'disable_freischaltung_level',
		'logging',
		'logging_time',
		'oviewmsg'
	);

	foreach($settings as $key) {
		// in der Konfiguration eintragen oder ändern
		if(isset($_POST[$key])) {
			$c[$key] = $_POST[$key];
		}
		// aus der Konfiguration löschen
		else if(isset($c[$key])) {
			unset($c[$key]);
		}
	}

	// Konfiguration speichern
	if(config::save(INSTANCE, $c)) {
		// Log-Eintrag
		if($config['logging'] >= 1) {
			insertlog(25, 'ändert die Grundeinstellungen der Instanz');
		}

		$tmpl->content = 'Die Einstellungen wurden erfolgreich gespeichert.';
	}
	else {
		$tmpl->error = 'Fehler beim Speichern der Einstellungen!';
	}

}

// Ausgabe
$tmpl->output();

?>


text:
[![project status](http://stillmaintained.com/hyyan/sidebar-highlight.png)](http://stillmaintained.com/hyyan/sidebar-highlight)
[![Latest Stable Version](https://poser.pugx.org/hyyan/sidebar-highlight/v/stable.svg)](https://packagist.org/packages/hyyan/sidebar-highlight)
[![Total Downloads](https://poser.pugx.org/hyyan/sidebar-highlight/downloads.svg)](https://packagist.org/packages/hyyan/sidebar-highlight)
[![License](https://poser.pugx.org/hyyan/sidebar-highlight/license.svg)](https://packagist.org/packages/hyyan/sidebar-highlight)

Small Wordpress plugin to hightlight all sidebars when wordpress customize mode is enabled

## How to install

### Classical way

1. Download the plugin as zip archive and then upload it to your wordpress plugins folder and
extract it there.
2. Activate the plugin from your admin panel

### Composer way

1. run composer command : ``` composer require hyyan/sidebar-highlight```

## How to use

Just go to customize page and the plugin will be active by default , you can
also disable it from customize page to go back to real preview.

## Contributing

Everyone is welcome to help contribute and improve this plugin. There are several
ways you can contribute:

* Reporting issues (please read [issue guidelines](https://github.com/necolas/issue-guidelines))
* Suggesting new features
* Writing or refactoring code
* Fixing [issues](https://github.com/hyyan/sidebar-highlight/issues)


text:
var uuid = require('uuid');

const addBoundSubcription = ( l, x ) => ( e, h ) => l.subscribe( e, h.bind( x ) );

const attachCardEvents = (card) => {
  var addQueueSubscription = addBoundSubcription( card.queue, card );

  addQueueSubscription( 'card.moved', Card.prototype.moved );
  addQueueSubscription( 'card.updated', Card.prototype.updated );
  addQueueSubscription( 'card.transformed', Card.prototype.transformed );
  addQueueSubscription( 'card.regionentered', Card.prototype.regionEntered );
  addQueueSubscription( 'card.regionexited', Card.prototype.regionExited );

  return card;
};

const initializeWithData = ( card, data ) => {
  card.id = data.card;
  card.wall = data.wall;

  if ( data.title ) {
    card.title = data.title;
  }

  card.width = data.width || 100;
  card.height = data.height || 65;
};

function Card( data, queue ) {
  if ( !data.wall || data.wall === '' ) {
    throw new Error( 'Wall is required' );
  }

  initializeWithData( this, data );

  this.locations = {};
  this.regions = [];
  this.metadata = {};

  this.constructor = Card;
  this.queue = queue;

  return attachCardEvents( this );
}

Card.constructor = function( data, queue ) {
  var create = {
    card: uuid.v4(),
    wall: data.wall
  };

  var card = new Card( create, queue );

  queue.publish( 'card.created', create );

  if ( data.title && data.title !== '' ) {
    var update = {
      card: card.getId(),
      title: data.title,
      content: data.content
    };

    card.update( update );
  }

  if ( data.view && typeof data.x === 'number' && typeof data.y === 'number' ) {
    var move = {
      card: card.getId(),
      view: data.view,
      x: data.x,
      y: data.y
    };

    card.move( move );
  }

  return card;
};

Card.eventsource = function( queue, events ) {
  var card;

  events.forEach(function( event ) {
    if ( !card ) {
      if ( event.topic === 'card.created' ) {
        card = new Card( event.data, queue );

        return;
      }

      throw new Error( 'No created event found for resource' );
    }

    if ( event.topic !== 'card.created' ) {
      switch ( event.topic ) {
        case 'card.updated':
          card.updated( event.data );
          break;
        case 'card.moved':
          card.moved( event.data );
          break;
        case 'card.transformed':
          card.transformed( event.data );
          break;
        case 'card.regionentered':
          card.regionEntered( event.data );
          break;
        case 'card.regionexited':
          card.regionExited( event.data );
          break;
      }

      return;
    }

    throw new Error( 'Created event encountered for resource that was already created' );
  });

  return card;
};

Card.prototype.getId = function() {
    return this.id;
};

Card.prototype.getTitle = function() {
    return this.title;
};

Card.prototype.getContent = function() {
    return this.content;
};

Card.prototype.update = function( data ) {
  if ( data.card && data.card !== this.getId() ) {
    return;
  }

  var update = {
    card: this.getId(),
    title: data.title,
    content: data.content
  };

  var errors = this.updated( update );

  if ( errors ) {
    return errors;
  }

  this.queue.publish( 'card.updated', update );
};

Card.prototype.updated = function( data ) {
  if ( data.card === this.getId() ) {
    this.title = data.title;
    this.content = data.content;
  }
};

Card.prototype.transform = function( data ) {
  if ( data.card && data.card !== this.getId() ) {
    return;
  }

  var patch = {
    card: this.getId(),
    view: data.view,
    op: data.op,
    property: data.property,
    value: data.value
  };

  var errors = this.transformed( patch );

  if ( errors ) {
    return errors;
  }

  this.queue.publish( 'card.transformed', patch );
};

Card.prototype.transformed = function( patch ) {
  if ( patch.card !== this.getId() ) {
    return;
  }
  var metadata = this.metadata[ patch.view ] = this.metadata[ patch.view ] || {};

  switch ( patch.op ) {
    case 'set':
      if ( metadata[ patch.property ] !== patch.value ) {
        metadata[ patch.property ] = patch.value;
      }
    break;

    case 'unset':
      if ( metadata[ patch.property ] === patch.value ) {
        delete metadata[ patch.property ];
      }
    break;
  }
};

Card.prototype.getCardnumber = function() {
    return this.cardnumber;
};

Card.prototype.getMetadata = function( viewid ) {
  if (!(viewid in this.metadata)) {
    return {};
  }

  return this.metadata[ viewid ] || {};
};

Card.prototype.getWall = function() {
    return this.wall;
};

Card.prototype.getRegions = function() {
    return this.regions;
};

Card.prototype.regionEntered = function( data ) {
  if ( data.card !== this.getId() ) {
    return;
  }

  if ( !~this.regions.indexOf( data.region ) ) {
    this.regions.push( data.region );

    return true;
  }
};

Card.prototype.regionExited = function( data ) {
  if ( data.card !== this.getId() ) {
    return;
  }

  var loc = this.regions.indexOf( data.region );

  if ( ~loc ) {
    this.regions.splice( loc, 1 );

    return true;
  }
};

Card.prototype.getPosition = function( view ) {
  var pos = this.locations[ view ];

  return {
    view: view,
    x: pos && pos.x || 0,
    y: pos && pos.y || 0
  };
};

Card.prototype.getSize = function() {
  return {
    width: this.width,
    height: this.height
  };
};

Card.prototype.getCentre = function( view ) {
  var pos = this.locations[ view ];
  var size = this.getSize();

  return {
    view: view,
    x: pos && (pos.x + (size.width / 2)) || 0,
    y: pos && (pos.y + (size.height / 2)) || 0
  };
};

Card.prototype.move = function( data ) {
  if ( data.card && data.card !== this.getId() ) {
    return;
  }

  var update = {
    card: this.getId(),
    view: data.view,
    x: data.x,
    y: data.y
  };

  var errors = this.moved( update );

  if ( errors ) {
    return errors;
  }

  this.queue.publish( 'card.moved', update );
};

Card.prototype.moved = function( data ) {
  if ( data.card !== this.getId() ) {
    return;
  }

  var pos = this.getPosition( data.view );

  if ( !pos || ( pos.x !== data.x || pos.y !== data.y ) ) {
    this.locations[ data.view ] = { x: data.x, y: data.y };
  }
};

module.exports = Card;


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item android:id="@+id/action_settings"
        android:title="@string/action_settings"
        android:orderInCategory="100"
        app:showAsAction="never"/>
    <item android:id="@+id/action_about"
        android:title="About"
        android:orderInCategory="100"
        app:showAsAction="never"/>
    <item android:id="@+id/action_rate"
        android:title="@string/action_rate"
        android:orderInCategory="100"
        app:showAsAction="never"/>
    <item android:id="@+id/action_shareapp"
        android:title="@string/share_app"
        android:orderInCategory="100"
        app:showAsAction="never"/>
</menu>


text:
module ActivitiesFeedHelper

  def activity_feed(item)
    user_link = link_to(item.user.nome, perfil_path(item.user))

    if item.is_a? Inspiration
      content = about_competition(item, user_link)
    else
      content = about_topics(item, user_link)
    end

    # time elapsed
    content += content_tag(:span, :class => "time") do
      "há " + distance_of_time_in_words_to_now(item.created_at)
    end

    content_tag(:li, content.html_safe, "data-time" => item.created_at.to_i)
  end

  private

  def to_label(label)
    content_tag(:span, "#{label}:", :class => "label")
  end

  def about_competition(item, user_link)
    link = link_to(item.title, competition_path(item.competition,
        :phase => 'inspiration_phase',
        :anchor => 'inspiration_' + item.id.to_s
      ),
    )
    "#{to_label("Inspiração")} #{user_link} deixou a inspiração #{link}."
  end

  def about_topics(item, user_link)
    description = case item
      when Proposta, Problema
        label = "#{item.type}"
        topic = item
        "criou "
      when Adesao
        label = "Apoio"
        topic = item.topico
        "apoiou "
      when Seguido
        label = "Seguiu"
        topic = item.topico
        "seguiu "
      when Comment
        label = "Comentário"
        topic = item.topico
        "comentou n"
    end
    description += topic.nome_do_tipo(:artigo => :definido)
    topic_link = link_to topic.titulo, topico_path(topic)
    "#{to_label(label)} #{user_link} #{description} #{topic_link}"
  end
end


text:
package net.continuumsecurity.proxy.model;

import org.zaproxy.clientapi.core.ApiResponseSet;

/**
 * Created by stephen on 16/04/15.
 */
public class ScanInfo implements Comparable<ScanInfo> {
    int progress;
    int id;
    State state;

    @Override
    public int compareTo(ScanInfo o) {
        return id-o.getId();
    }

    public enum State {
        NOT_STARTED,
        FINISHED,
        PAUSED,
        RUNNING;

        public static State parse(String s) {
            if ("NOT_STARTED".equalsIgnoreCase(s)) return NOT_STARTED;
            if ("FINISHED".equalsIgnoreCase(s)) return FINISHED;
            if ("PAUSED".equalsIgnoreCase(s)) return PAUSED;
            if ("RUNNING".equalsIgnoreCase(s)) return RUNNING;
            throw new RuntimeException("Unknown state: "+s);
        }
    }

    public ScanInfo(ApiResponseSet response) {
        id = Integer.parseInt(response.getStringValue("id"));
        progress = Integer.parseInt(response.getStringValue("progress"));
        state = State.parse(response.getStringValue("state"));
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    public int getId() {
        return id;
    }

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

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }
}


text:
/**
 * Implementation of the vector writers. The code will make much more sense if
 * we start with a review of Drill's complex vector data model. Drill has 38+
 * data ("minor") types. Drill also has three cardinalities ("modes"). The
 * result is over 120+ different vector types. Then, when you add maps, repeated
 * maps, lists and repeated lists, you rapidly get an explosion of types that
 * the writer code must handle.
 *
 *
Understanding the Vector Model

 *
 * Vectors can be categorized along multiple dimensions:
 *

 *
By data (minor) type

 *
By cardinality (mode)

 *
By fixed or variable width

 *
By repeat levels

 *

 *

 * A repeated map, a list, a repeated list and any array (repeated) scalar all
 * are array-like. Nullable and required modes are identical (single values),
 * but a nullable has an additional is-set ("bit") vector.
 *

 * The writers (and readers) borrow concepts from JSON and relational theory
 * to simplify the problem:
 *

 *

 *
Both the top-level row, and a Drill map are "tuples" and are treated
 * similarly in the model.

 *
All non-map, non-list (that is, scalar) data types are treated
 * uniformly.

 *
All arrays (whether a list, a repeated list, a repeated map, or a
 * repeated scalar) are treated uniformly.

 *

 *
 *
Repeat Levels

 *
 * JSON and Parquet can be understood as a series of one or more "repeat
 * levels." First, let's identify the repeat levels above the batch
 * level:
 *

 *
The top-most level is the "result set": the entire collection of
 * rows that come from a file (or other data source.)

 *
Result sets are divided into batches: collections of up to 64K
 * rows.

 *

 *
 * Then, within a batch:
 *

 *
Each batch is a collection or rows. A batch-level index points
 * to the current row.

 *
Scalar arrays introduce a repeat level: each row has 0, 1 or
 * many elements in the array-valued column. An offset vector indexes
 * to the first value for each row. Each scalar array has its own
 * per-array index to point to the next write position.

 *
Map arrays introduce a repeat level for a group of columns
 * (those that make up the map.) A single offset vector points to
 * the common start position for the columns. A common index points
 * to the common next write position.

 *
Lists also introduce a repeat level. (Details to be worked
 * out.

 *

 *
 * For repeated vectors, one can think of the structure either top-down
 * or bottom-up:
 *

 *
Top down: the row position points into an offset vector. The
 * offset vector value points to either the data value, or into another
 * offset vector.

 *
Bottom-up: values are appended to the end of the vector. Values
 * are "pinched off" to form an array (for repeated maps) or for a row.
 * In this view, indexes bubble upward. The inner-most last write position
 * is written as the array end position in the enclosing offset vector.
 * This may occur up several levels.

 *

 *
 *
Writer Data Model

 *
 * The above leads to a very simple, JSON-like data model:
 *

 *
A tuple reader or writer models a row. (Usually via a subclass.) Column
 * are accessible by name or position.

 *
Every column is modeled as an object.

 *
The object can have an object type: scalar, tuple or array.

 *
An array has a single element type (but many run-time elements)

 *
A scalar can be nullable or not, and provides a uniform get/set
 * interface.

 *

 *

 * This data model is similar to; but has important differences from, the prior,
 * generated, readers and writers. This version is based on the concept of
 * minimizing the number of writer classes, and leveraging Java primitives to
 * keep the number of get/set methods to a reasonable size. This version also
 * automates vector allocation, vector overflow and so on.
 *

 * The object layer is new: it is the simplest way to model the three "object
 * types." An app using this code would use just the leaf scalar readers and
 * writers.
 *

 * Similarly, the {@link ColumnWriter} interface provides a uniform way to
 * access services common to all writer types, while allowing each JSON-like
 * writer to provide type-specific ways to access data.
 *
 *
Writer Performance

 *
 * To maximize performance, have a single version for all "data modes":
 * (nullable, required, repeated). Some items of note:
 *

 *
The writers bypass DrillBuf and the UDLE to needed writes to direct
 * memory.

 *
The writers buffer the buffer address and implement a number of methods
 * to synchronize that address when the buffer changes (on a new batch or during
 * vector resize).

 *
Writing require a single bounds check. In most cases, the write is within
 * bounds so the single check is all that is needed.

 *
If the write is out of bounds, then the writer determines the new vector
 * size and performs the needed reallocation. To avoid multiple doublings, the
 * writer computes the needed new size and allocates that size directly.

 *
Vector reallocation is improved to eliminate zeroing the new half of the
 * buffer, data is left "garbage-filled."

 *
If the vector would grow beyond 16 MB, then overflow is triggered, via a
 * listener, which causes the buffer to be replaced. The write then
 * continues.

 *
Offset vector updates are integrated into the writers using an
 * `OffsetVectorWriter`. This writer caches the last write position so that each
 * array write needs a single offset update, rather than the read and write as
 * in previous code.

 *
The writers keep track of the "last write position" and perform
 * "fill-empties" work if the new write position is more than one position
 * behind the last write. All types now correctly support "fill-empties"
 * (before, only nullable types did so reliably.)

 *
Null handling is done by an additional writer layer that wraps the
 * underlying data writer. This avoids the need for a special nullable writer:
 * the same nullable layer works for all data types.

 *
Array handling is done similarly: an array writer manages the offset
 * vector and works the same for repeated scalars, repeated maps and
 * (eventually) lists and repeated lists.

 *

 *
 *
Lists

 *
 * As described in the API package, Lists and Unions in Drill are highly
 * complex, and not well supported. This creates huge problems in the
 * writer layer because we must support something which is broken and
 * under-used, but which most people assume works (it is part of Drill's
 * JSON-like, schema-free model.) Our goal here is to support Union and
 * List well enough that nothing new is broken; though this layer cannot
 * fix the issues elsewhere in Drill.
 *

 * The most complex part is List support for the transition from a single
 * type to a union of types. The API should be simple: the client should
 * not have to be aware of the transition.
 *

 * To make this work, the writers provide two options:
 *

 *
Use metadata to state that a List will have exactly one type and
 * to specify that type. The List will present as an array of that type in
 * which each array can be null.

 *
Otherwise, the list is repeated union (a array of variants), even
 * if the list happens to have 0 or 1 types. In this case, the list presents
 * as an array of variants.

 *

 * The result is that client code assumes one or the other model, and never
 * has to worry about transitioning from one to the other within a single
 * operator.
 *

 * The {@link PromotableListWriter} handles the complex details of providing
 * the above simple API in the array-of-variant case.
 *
 *
Possible Improvements

 *
 * The code here works and has extensive unit tests. But, many improvements
 * are possible:
 *

 *
Drill has four "container" vector types (Map, Union, List, Repeated
 * List), each with its own quirky semantics. The code could be far simpler
 * if the container semantics were unified.

 *
Similarly, the corresponding writers implement some very awkward
 * logic to handle union and list containers. But, these vectors are not
 * fully supported in Drill. This means that the code implements (and tests)
 * many odd cases which no one may ever use. Better to limit the data types
 * that Drill supports, implement those well, and deprecate the obscure
 * cases.

 *
The same schema-parsing logic appears over and over in different
 * guises. Some parse vectors, some parse batch schemas, others parse the
 * column metadata (which provides information not available in the
 * materialized field) and so on. Would be great to find some common way
 * to do this work, perhaps in the form of a visitor. An earlier version of
 * this code tried using visitors. But, since each representation has its
 * own quirks, that approach didn't work out. A first step would be to come
 * up with a standard schema description which can be used in all cases,
 * then build a visitor on that.

 *
Many tests exist. But, the careful reader will note that Drill's
 * vectors define a potentially very complex recursive structure (most
 * variations of which are never used.) Additional testing should cover
 * all cases, such as repeated lists that contain unions, or unions that
 * contain repeated lists of tuples.

 *
Experience with the code may show additional redundancies that can
 * be removed. Each fresh set of eyes may see things that prior folks
 * missed.

 *

 *
 *
Caveats

 *
 * The column accessors are divided into two packages: <tt>vector</tt> and
 * <tt>java-exec</tt>. It is easy to add functionality in the wrong place,
 * breaking abstraction and encapsulation. Here are some general guidelines:
 *

 *
The core reader and writer logic is implemented in this <tt>vector</tt>
 * package. This package provides low-level tools to build accessors, but
 * not the construction logic itself. (That is found in the <tt>java-exec</tt>
 * layer.)

 *
The vector layer is designed to support both the simple "row set" and
 * the more complex "result set loader" implementations.

 *
The "row set" layer wraps the accessors in tools that work on one batch
 * (row set) at a time, without regard for schema versions, schema changes
 * and the like. The row set layer is primarily for testing: building an input
 * batch for some operator, and verifying an output batch. It also serves as a
 * simple test framework for the accessors, without the complexity of other
 * layers.

 *
The "result set loader" layer handles the complexity of dynamic schema
 * evolution, schema versioning, vector overflow and projection. It provides
 * an "industrial strength" version of the accessor mechanism intended for
 * use in the scan operator (but which can be generalized for other operators.)
 *

 *
The "listener" pattern is used to allow higher levels to "plug in"
 * functionality to the accessor layer. This is especially true for schema
 * evolution: listeners notify the higher layer to add a column, delegating
 * the actual work to that higher layer.

 *

 *
 * Given all this, plan carefully where to make any improvement. If your change
 * violates the dependencies below, perhaps reconsider another way to do the
 * change.
 *

 *                                                  +------------+
 *                      +-------------------------- | Result Set |
 *                      v                           |   Loader   |
 *             +----------------+     +---------+   +------------+
 *             |    Metadata    | <-- | Row Set |     |
 *             | Implementation |     |  Tools  |     |
 *             +----------------+     +---------+     |
 * java-exec           |                     |        |
 * ------------------- | ------------------- | ------ | ------------
 * vector              v                     v        v
 *               +------------+            +-----------+
 *               | Metadata   | <--------- |  Column   |
 *               | Interfaces |            | Accessors |
 *               +------------+            +-----------+
 *                                               |
 *                                               v
 *                                          +---------+
 *                                          |  Value  |
 *                                          | Vectors |
 *                                          +---------+
 *

 */

package org.apache.drill.exec.vector.accessor.writer;


text:
using Codeer.Friendly;

namespace Friendly.FarPoint
{
#if ENG
    /// <summary>
    /// Provides operations on controls of type FarPoint.Win.Spread.Model.CellRange[].
    /// </summary>
#else
    /// <summary>
    /// TypeがFarPoint.Win.Spread.Model.CellRange[]に対応した操作を提供します。
    /// </summary>
#endif
    public class CellRangeDriverArray: IAppVarOwner
    {
#if ENG
        /// <summary>
        /// Returns an AppVar for a .NET object for the corresponding window.
        /// </summary>
#else
        /// <summary>
        /// 対応するウィンドウの.Netのオブジェクトが格納されたAppVarを取得します。
        /// </summary>
#endif
        public AppVar AppVar { get; set; }

#if ENG
        /// <summary>
        /// Return count of array.
        /// </summary>
#else
        /// <summary>
        /// 配列数を取得します。
        /// </summary>
#endif
        public int Length { get { return (int)AppVar["Length"]().Core; } }

#if ENG
        /// <summary>
        /// Return a element of index.
        /// </summary>
        /// <param name="index">Index.</param>
        /// <returns>Element of array.</returns>
#else
        /// <summary>
        /// 指定のインデックスの配列要素を取得します。
        /// </summary>
        /// <param name="index">インデックス。</param>
        /// <returns>配列の要素</returns>
#endif
        public CellRangeDriver this[int index] { get { return new CellRangeDriver(AppVar["[]"](index)); } }

        internal CellRangeDriverArray(AppVar appVar)
        {
            AppVar = appVar;
        }
    }
}


text:
class MeshHolder : public Mesh {
private:
  Mesh* _mesh;

public:
  MeshHolder(Mesh* mesh) :
  _mesh(mesh)
  {

  }

  void setMesh(Mesh* mesh) {
    if (_mesh != mesh) {
      delete _mesh;
      _mesh = mesh;
    }
  }

  ~MeshHolder() {
    delete _mesh;
#ifdef JAVA_CODE
  super.dispose();
#endif

  }

  int getVertexCount() const {
    return _mesh->getVertexCount();
  }

  const Vector3D getVertex(int i) const {
    return _mesh->getVertex(i);
  }

  BoundingVolume* getBoundingVolume() const {
    return _mesh->getBoundingVolume();
  }

  bool isTransparent(const G3MRenderContext* rc) const {
    return _mesh->isTransparent(rc);
  }

  void rawRender(const G3MRenderContext* rc, const GLState* parentGLState) const{
    _mesh->render(rc, parentGLState);
  }

  void showNormals(bool v) const{
    _mesh->showNormals(v);
  }

};

#endif


text:
"""
Return cached data from minions
"""

import fnmatch
import logging
import os

import salt.cache
import salt.config
import salt.fileserver.gitfs
import salt.payload
import salt.pillar.git_pillar
import salt.runners.winrepo
import salt.utils.args
import salt.utils.gitfs
import salt.utils.master
from salt.exceptions import SaltInvocationError
from salt.fileserver import clear_lock as _clear_lock

log = logging.getLogger(__name__)

__func_alias__ = {
    "list_": "list",
}

def grains(tgt, tgt_type="glob", **kwargs):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached grains of the targeted minions.

    tgt
        Target to match minion ids.

        .. versionchanged:: 2017.7.5,2018.3.0
            The ``tgt`` argument is now required to display cached grains. If
            not used, the function will not return grains. This optional
            argument will become mandatory in the Salt ``3001`` release.

    tgt_type
        The type of targeting to use for matching, such as ``glob``, ``list``,
        etc.

    CLI Example:

    .. code-block:: bash

        salt-run cache.grains '*'
    """
    pillar_util = salt.utils.master.MasterPillarUtil(
        tgt, tgt_type, use_cached_grains=True, grains_fallback=False, opts=__opts__
    )
    cached_grains = pillar_util.get_minion_grains()
    return cached_grains

def pillar(tgt=None, tgt_type="glob", **kwargs):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached pillars of the targeted minions if tgt is set.
    If tgt is not set will return cached pillars for all minions.

    CLI Example:

    .. code-block:: bash

        salt-run cache.pillar
    """
    pillar_util = salt.utils.master.MasterPillarUtil(
        tgt,
        tgt_type,
        use_cached_grains=True,
        grains_fallback=False,
        use_cached_pillar=True,
        pillar_fallback=False,
        opts=__opts__,
    )
    cached_pillar = pillar_util.get_minion_pillar()
    return cached_pillar

def mine(tgt=None, tgt_type="glob", **kwargs):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.mine
    """
    pillar_util = salt.utils.master.MasterPillarUtil(
        tgt,
        tgt_type,
        use_cached_grains=False,
        grains_fallback=False,
        use_cached_pillar=False,
        pillar_fallback=False,
        opts=__opts__,
    )
    cached_mine = pillar_util.get_cached_mine_data()
    return cached_mine

def _clear_cache(
    tgt=None,
    tgt_type="glob",
    clear_pillar_flag=False,
    clear_grains_flag=False,
    clear_mine_flag=False,
    clear_mine_func_flag=None,
):
    """
    Clear the cached data/files for the targeted minions.
    """
    if tgt is None:
        return False

    pillar_util = salt.utils.master.MasterPillarUtil(
        tgt,
        tgt_type,
        use_cached_grains=True,
        grains_fallback=False,
        use_cached_pillar=True,
        pillar_fallback=False,
        opts=__opts__,
    )
    return pillar_util.clear_cached_minion_data(
        clear_pillar=clear_pillar_flag,
        clear_grains=clear_grains_flag,
        clear_mine=clear_mine_flag,
        clear_mine_func=clear_mine_func_flag,
    )

def clear_pillar(tgt=None, tgt_type="glob"):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached pillar data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_pillar
    """
    return _clear_cache(tgt, tgt_type, clear_pillar_flag=True)

def clear_grains(tgt=None, tgt_type="glob"):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached grains data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_grains
    """
    return _clear_cache(tgt, tgt_type, clear_grains_flag=True)

def clear_mine(tgt=None, tgt_type="glob"):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_mine
    """
    return _clear_cache(tgt, tgt_type, clear_mine_flag=True)

def clear_mine_func(tgt=None, tgt_type="glob", clear_mine_func_flag=None):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached mine function data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_mine_func tgt='*' clear_mine_func_flag='network.interfaces'
    """
    return _clear_cache(tgt, tgt_type, clear_mine_func_flag=clear_mine_func_flag)

def clear_all(tgt=None, tgt_type="glob"):
    """
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached pillar, grains, and mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_all
    """
    return _clear_cache(
        tgt,
        tgt_type,
        clear_pillar_flag=True,
        clear_grains_flag=True,
        clear_mine_flag=True,
    )

def clear_git_lock(role, remote=None, **kwargs):
    """
    .. versionadded:: 2015.8.2

    Remove the update locks for Salt components (gitfs, git_pillar, winrepo)
    which use gitfs backend code from salt.utils.gitfs.

    .. note::
        Running :py:func:`cache.clear_all <salt.runners.cache.clear_all>` will
        not include this function as it does for pillar, grains, and mine.

        Additionally, executing this function with a ``role`` of ``gitfs`` is
        equivalent to running ``salt-run fileserver.clear_lock backend=git``.

    role
        Which type of lock to remove (``gitfs``, ``git_pillar``, or
        ``winrepo``)

    remote
        If specified, then any remotes which contain the passed string will
        have their lock cleared. For example, a ``remote`` value of **github**
        will remove the lock from all github.com remotes.

    type : update,checkout,mountpoint
        The types of lock to clear. Can be one or more of ``update``,
        ``checkout``, and ``mountpoint``, and can be passed either as a
        comma-separated or Python list.

        .. versionadded:: 2015.8.8
        .. versionchanged:: 2018.3.0
            ``mountpoint`` lock type added

    CLI Examples:

    .. code-block:: bash

        salt-run cache.clear_git_lock gitfs
        salt-run cache.clear_git_lock git_pillar
        salt-run cache.clear_git_lock git_pillar type=update
        salt-run cache.clear_git_lock git_pillar type=update,checkout
        salt-run cache.clear_git_lock git_pillar type='["update", "mountpoint"]'
    """
    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    type_ = salt.utils.args.split_input(
        kwargs.pop("type", ["update", "checkout", "mountpoint"])
    )
    if kwargs:
        salt.utils.args.invalid_kwargs(kwargs)

    if role == "gitfs":
        git_objects = [
            salt.utils.gitfs.GitFS(
                __opts__,
                __opts__["gitfs_remotes"],
                per_remote_overrides=salt.fileserver.gitfs.PER_REMOTE_OVERRIDES,
                per_remote_only=salt.fileserver.gitfs.PER_REMOTE_ONLY,
            )
        ]
    elif role == "git_pillar":
        git_objects = []
        for ext_pillar in __opts__["ext_pillar"]:
            key = next(iter(ext_pillar))
            if key == "git":
                if not isinstance(ext_pillar["git"], list):
                    continue
                obj = salt.utils.gitfs.GitPillar(
                    __opts__,
                    ext_pillar["git"],
                    per_remote_overrides=salt.pillar.git_pillar.PER_REMOTE_OVERRIDES,
                    per_remote_only=salt.pillar.git_pillar.PER_REMOTE_ONLY,
                    global_only=salt.pillar.git_pillar.GLOBAL_ONLY,
                )
                git_objects.append(obj)
    elif role == "winrepo":
        winrepo_dir = __opts__["winrepo_dir"]
        winrepo_remotes = __opts__["winrepo_remotes"]

        git_objects = []
        for remotes, base_dir in (
            (winrepo_remotes, winrepo_dir),
            (__opts__["winrepo_remotes_ng"], __opts__["winrepo_dir_ng"]),
        ):
            obj = salt.utils.gitfs.WinRepo(
                __opts__,
                remotes,
                per_remote_overrides=salt.runners.winrepo.PER_REMOTE_OVERRIDES,
                per_remote_only=salt.runners.winrepo.PER_REMOTE_ONLY,
                global_only=salt.runners.winrepo.GLOBAL_ONLY,
                cache_root=base_dir,
            )
            git_objects.append(obj)
    else:
        raise SaltInvocationError("Invalid role '{}'".format(role))

    ret = {}
    for obj in git_objects:
        for lock_type in type_:
            cleared, errors = _clear_lock(
                obj.clear_lock, role, remote=remote, lock_type=lock_type
            )
            if cleared:
                ret.setdefault("cleared", []).extend(cleared)
            if errors:
                ret.setdefault("errors", []).extend(errors)
    if not ret:
        return "No locks were removed"
    return ret

def cloud(tgt, provider=None):
    """
    Return cloud cache data for target.

    .. note:: Only works with glob matching

    tgt
      Glob Target to match minion ids

    provider
      Cloud Provider

    CLI Example:

    .. code-block:: bash

        salt-run cache.cloud 'salt*'
        salt-run cache.cloud glance.example.org provider=openstack
    """
    if not isinstance(tgt, str):
        return {}

    opts = salt.config.cloud_config(
        os.path.join(os.path.dirname(__opts__["conf_file"]), "cloud")
    )
    if not opts.get("update_cachedir"):
        return {}

    cloud_cache = __utils__["cloud.list_cache_nodes_full"](opts=opts, provider=provider)
    if cloud_cache is None:
        return {}

    ret = {}
    for driver, providers in cloud_cache.items():
        for provider, servers in providers.items():
            for name, data in servers.items():
                if fnmatch.fnmatch(name, tgt):
                    ret[name] = data
                    ret[name]["provider"] = provider
    return ret

def store(bank, key, data, cachedir=None):
    """
    Lists entries stored in the specified bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.store mycache mykey 'The time has come the walrus said'
    """
    if cachedir is None:
        cachedir = __opts__["cachedir"]

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.store(bank, key, data)

def list_(bank, cachedir=None):
    """
    Lists entries stored in the specified bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.list cloud/active/ec2/myec2 cachedir=/var/cache/salt/
    """
    if cachedir is None:
        cachedir = __opts__["cachedir"]

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.list(bank)

def fetch(bank, key, cachedir=None):
    """
    Fetch data from a salt.cache bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.fetch cloud/active/ec2/myec2 myminion cachedir=/var/cache/salt/
    """
    if cachedir is None:
        cachedir = __opts__["cachedir"]

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.fetch(bank, key)

def flush(bank, key=None, cachedir=None):
    """
    Remove the key from the cache bank with all the key content. If no key is
    specified remove the entire bank with all keys and sub-banks inside.

    CLI Examples:

    .. code-block:: bash

        salt-run cache.flush cloud/active/ec2/myec2 cachedir=/var/cache/salt/
        salt-run cache.flush cloud/active/ec2/myec2 myminion cachedir=/var/cache/salt/
    """
    if cachedir is None:
        cachedir = __opts__["cachedir"]

    try:
        cache = salt.cache.Cache(__opts__, cachedir=cachedir)
    except TypeError:
        cache = salt.cache.Cache(__opts__)
    return cache.flush(bank, key)