text:
/**
 * Command-line Outputting
 */

"use strict";

exports = module.exports = {
    debug: debug,
    error: error,
    info: log,
    log: log,
    pjson: prettyJSON,
    prettyJSON: prettyJSON,
    rawJSON: rawJSON,
    rjson: rawJSON,
    setPS1: setPS1,
    success: success,
};

// built-in modules
var util = require("util");

// npm-installed modules
var consolejson = require("console.json"); // eslint-disable-line
var chalk = require("chalk");
var prettyjson = require("prettyjson");

// module variables
var marker = process.env.CLI_OUTPUT_PS1 || " >>> ";

/**
 * Sets the marker/PS1 used
 *
 * @param {String} ps1
 * @return {String} set marker
 */
function setPS1(ps1) {
    marker = ps1;
    return marker;
}

/**
 * Wraps the arguments by formatting and adding the prefix/marker/PS1
 *
 * @param  {Object} args - arguments passed to high-level functions
 * @return {String} message
 */
function wrap(args) {
    var message = chalk.magenta(marker) + args[0];
    args[0] = message;
    message = util.format.apply(null, args);
    return message;
}

/**
 * Logs a normal message
 */
function log() {
    var message = wrap(arguments);
    message = chalk.blue(message);
    console.log(message);
}

/**
 * Logs a success message
 */
function success() {
    var message = wrap(arguments);
    message = chalk.green(message);
    console.log(message);
}

/**
 * Logs an error message
 */
function error() {
    var message = wrap(arguments);
    message = chalk.red(message);
    console.error(message);
}

/**
 * Logs a debug message
 */
function debug() {
    if (!process.env.DEBUG) {
        return;
    }
    var message = wrap(arguments);
    message = chalk.yellow(message);
    console.log(message);
}

/**
 * Display json in its raw form
 *
 * @param {JSON|Object} json
 */
function rawJSON(json) {
    console.json(json);
}

/**
 * Displays JSON in a pretty manner
 *
 * @param {JSON|Object} json
 */
function prettyJSON(json) {
    var text = prettyjson.render(json);
    console.log(text);
}


text:
/*
* test for rule shouldInterceptHttpsReq rule
*
*/
const ProxyServerUtil = require('../util/ProxyServerUtil.js');
const { proxyGet, directGet } = require('../util/HttpUtil.js');
const Server = require('../server/server.js');
const { printLog } = require('../util/CommonUtil.js');

const rule = require('./rule/rule_should_intercept_https_req.js');

testWrapper();

function testWrapper() {
  describe('Rule shouldInterceptHttpsReq should be working', () => {
    let proxyServer;
    let serverInstance;

    beforeAll((done) => {
      jasmine.DEFAULT_TIMEOUT_INTERVAL = 50000;
      printLog('Start server for test_rule_should_intercept_https_req_spec');

      serverInstance = new Server();

      proxyServer = ProxyServerUtil.proxyServerWithRule(rule, {
        forceProxyHttps: false
      });

      setTimeout(() => {
        done();
      }, 2000);
    });

    afterAll(() => {
      serverInstance && serverInstance.close();
      proxyServer && proxyServer.close();
      printLog('Close server for test_rule_should_intercept_https_req_spec');
    });

    it('Should replace the header in proxy if assertion is true', done => {
      const url = 'https://localhost:3001/test';

      proxyGet(url)
        .then(proxyRes => {
          directGet(url)
            .then(directRes => {
              expect(proxyRes.statusCode).toEqual(200);

              expect(directRes.statusCode).toEqual(200);
              expect(directRes.body + '_hello_world').toEqual(proxyRes.body);
              done();
            })
            .catch(error => {
              console.error('error happened in direct get: ', error);
              done.fail('error happened in direct get');
            });
        })
        .catch(error => {
          console.error('error happened in proxy get: ', error);
          done.fail('error happened in proxy get');
        });
    });

    it('Should not replace the header in proxy if assertion is false', done => {
      const url = 'https://localhost:3002/test';
      proxyGet(url)
        .then(proxyRes => {
          expect(proxyRes.statusCode).toEqual(200);

          directGet(url)
            .then(directRes => {
              expect(directRes.statusCode).toEqual(200);
              expect(directRes.body.replace(/\s/g, '')).toEqual(proxyRes.body.replace(/\s/g, ''));
              done();
            })
            .catch(error => {
              console.error('error happened in direct get: ', error);
              done.fail('error happened in direct get');
            });
        })
        .catch(error => {
          console.error('error happened in proxy get: ', error);
          done.fail('error happened in proxy get');
        });
    });
  });
}

redpajama_set_name: RedPajamaGithub


text:
TEST_CASE("[make_graph] Testing make_graph")
{
  auto result       = make_graph(100);
  auto is_directed  = boost::is_directed(result);
  auto num_vertices = boost::num_vertices(result);
  CHECK(is_directed);
  CHECK(num_vertices == 100);
  // Human verification
  fmt::print("Graph is directed? {}\n", is_directed);
  fmt::print("Graph has {} vertices\n", num_vertices);
}


text:
include_recipe "java"

case node.platform
when "centos","redhat","fedora"
  include_recipe "tomcat::ark"
when "debian","ubuntu"
  include_recipe "tomcat::package"
end


text:
//
// IPacketReader.hpp for  in /home/gandoulf/epitech/rtype/RtypeSRC/include/IONetwork
//
// Made by Gandoulf
// Login   <gandoulf@epitech.net>
//
// Started on  Tue Dec  6 15:15:29 2016 Gandoulf
// Last update Thu Dec 15 16:09:31 2016 Gandoulf
//

#ifndef IPACKETREADER_HPP_
# define IPACKETREADER_HPP_

# include "Network/sockets/Server.hpp"
# include "Network/sockets/Client.hpp"

namespace rtype
{
  template <class socket>
  class IPacketReader
  {
  public:
    virtual char *read(socket & server, int const &fd, size_t const &length) = 0;
  };
}

#endif /* IPACKETREADER_HPP_ */


text:
package org.apache.tinkerpop.gremlin.structure.io.binary.types;

import org.apache.tinkerpop.gremlin.structure.io.binary.DataType;
import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryReader;
import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
import org.apache.tinkerpop.gremlin.structure.io.Buffer;

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

public class ByteCodeSerializer extends SimpleTypeSerializer<Bytecode> {
    public ByteCodeSerializer() {
        super(DataType.BYTECODE);
    }

    @Override
    protected Bytecode readValue(final Buffer buffer, final GraphBinaryReader context) throws IOException {
        final Bytecode result = new Bytecode();

        final int stepsLength = buffer.readInt();
        for (int i = 0; i < stepsLength; i++) {
            result.addStep(context.readValue(buffer, String.class, false), getInstructionArguments(buffer, context));
        }

        final int sourcesLength = buffer.readInt();
        for (int i = 0; i < sourcesLength; i++) {
            result.addSource(context.readValue(buffer, String.class, false), getInstructionArguments(buffer, context));
        }

        return result;
    }

    private static Object[] getInstructionArguments(final Buffer buffer, final GraphBinaryReader context) throws IOException {
        final int valuesLength = buffer.readInt();
        final Object[] values = new Object[valuesLength];
        for (int j = 0; j < valuesLength; j++) {
            values[j] = context.read(buffer);
        }
        return values;
    }

    @Override
    protected void writeValue(final Bytecode value, final Buffer buffer, final GraphBinaryWriter context) throws IOException {
        final List<Bytecode.Instruction> steps = value.getStepInstructions();
        final List<Bytecode.Instruction> sources = value.getSourceInstructions();
        // 2 buffers for the length + plus 2 buffers per each step and source

        writeInstructions(buffer, context, steps);
        writeInstructions(buffer, context, sources);
    }

    private void writeInstructions(final Buffer buffer, final GraphBinaryWriter context,
                                   final List<Bytecode.Instruction> instructions) throws IOException {

        context.writeValue(instructions.size(), buffer, false);

        for (Bytecode.Instruction instruction : instructions) {
            context.writeValue(instruction.getOperator(), buffer, false);
            fillArgumentsBuffer(instruction.getArguments(), buffer, context);
        }
    }

    private static void fillArgumentsBuffer(final Object[] arguments, final Buffer buffer, final GraphBinaryWriter context) throws IOException {

        context.writeValue(arguments.length, buffer, false);

        for (Object value : arguments) {
            context.write(value, buffer);
        }
    }
}


text:
require 'spec_helper'

# Also see spec/graphql/features/authorization_spec.rb for
# integration tests of AuthorizeFieldService
describe Gitlab::Graphql::Authorize::AuthorizeFieldService do
  def type(type_authorizations = [])
    Class.new(Types::BaseObject) do
      graphql_name "TestType"

      authorize type_authorizations
    end
  end

  def type_with_field(field_type, field_authorizations = [], resolved_value = "Resolved value")
    Class.new(Types::BaseObject) do
      graphql_name "TestTypeWithField"
      field :test_field, field_type, null: true, authorize: field_authorizations, resolve: -> (_, _, _) { resolved_value}
    end
  end

  let(:current_user) { double(:current_user) }
  subject(:service) { described_class.new(field) }

  describe "#authorized_resolve" do
    let(:presented_object) { double("presented object") }
    let(:presented_type) { double("parent type", object: presented_object) }
    subject(:resolved) { service.authorized_resolve.call(presented_type, {}, { current_user: current_user }) }

    context "scalar types" do
      shared_examples "checking permissions on the presented object" do
        it "checks the abilities on the object being presented and returns the value" do
          expected_permissions.each do |permission|
            spy_ability_check_for(permission, presented_object, passed: true)
          end

          expect(resolved).to eq("Resolved value")
        end

        it "returns nil if the value wasn't authorized" do
          allow(Ability).to receive(:allowed?).and_return false

          expect(resolved).to be_nil
        end
      end

      context "when the field is a built-in scalar type" do
        let(:field) { type_with_field(GraphQL::STRING_TYPE, :read_field).fields["testField"].to_graphql }
        let(:expected_permissions) { [:read_field] }

        it_behaves_like "checking permissions on the presented object"
      end

      context "when the field is a list of scalar types" do
        let(:field) { type_with_field([GraphQL::STRING_TYPE], :read_field).fields["testField"].to_graphql }
        let(:expected_permissions) { [:read_field] }

        it_behaves_like "checking permissions on the presented object"
      end

      context "when the field is sub-classed scalar type" do
        let(:field) { type_with_field(Types::TimeType, :read_field).fields["testField"].to_graphql }
        let(:expected_permissions) { [:read_field] }

        it_behaves_like "checking permissions on the presented object"
      end

      context "when the field is a list of sub-classed scalar types" do
        let(:field) { type_with_field([Types::TimeType], :read_field).fields["testField"].to_graphql }
        let(:expected_permissions) { [:read_field] }

        it_behaves_like "checking permissions on the presented object"
      end
    end

    context "when the field is a specific type" do
      let(:custom_type) { type(:read_type) }
      let(:object_in_field) { double("presented in field") }
      let(:field) { type_with_field(custom_type, :read_field, object_in_field).fields["testField"].to_graphql }

      it "checks both field & type permissions" do
        spy_ability_check_for(:read_field, object_in_field, passed: true)
        spy_ability_check_for(:read_type, object_in_field, passed: true)

        expect(resolved).to eq(object_in_field)
      end

      it "returns nil if viewing was not allowed" do
        spy_ability_check_for(:read_field, object_in_field, passed: false)
        spy_ability_check_for(:read_type, object_in_field, passed: true)

        expect(resolved).to be_nil
      end

      context "when the field is a list" do
        let(:object_1) { double("presented in field 1") }
        let(:object_2) { double("presented in field 2") }
        let(:presented_types) { [double(object: object_1), double(object: object_2)] }
        let(:field) { type_with_field([custom_type], :read_field, presented_types).fields["testField"].to_graphql }

        it "checks all permissions" do
          allow(Ability).to receive(:allowed?) { true }

          spy_ability_check_for(:read_field, object_1, passed: true)
          spy_ability_check_for(:read_type, object_1, passed: true)
          spy_ability_check_for(:read_field, object_2, passed: true)
          spy_ability_check_for(:read_type, object_2, passed: true)

          expect(resolved).to eq(presented_types)
        end

        it "filters out objects that the user cannot see" do
          allow(Ability).to receive(:allowed?) { true }

          spy_ability_check_for(:read_type, object_1, passed: false)

          expect(resolved.map(&:object)).to contain_exactly(object_2)
        end
      end
    end
  end

  private

  def spy_ability_check_for(ability, object, passed: true)
    expect(Ability)
      .to receive(:allowed?)
      .with(current_user, ability, object)
      .and_return(passed)
  end
end


text:
<?xml version="1.0" encoding="WINDOWS-1252"?>
<safe_pregnancy xmlns="http://www.commcare.org/MVP/safe_motherhood/close_v0.1" version="1" uiVersion="1">
<Meta>
<formName>MNNIJX</formName>
<formVersion>YNNRKKVY</formVersion>
<DeviceID>HWKVDJUJTBDKMZGT</DeviceID>
<TimeStart>2009-12-02T12:00:00.000</TimeStart>
<TimeEnd>2009-09-29T01:00:00.000</TimeEnd>
<username>mobile2</username>
<userid>mobile1</userid>
</Meta>
<what_happened>SA</what_happened>
<other_what_happened>U</other_what_happened>
<mother_survived>EGPJWHEVPWMMFCPWPF</mother_survived>
<infants_delivered>4</infants_delivered>
<infants_survived>2</infants_survived>
<birth_location>OYZBBEBWTHRD</birth_location>
<other_location>ECEOCN</other_location>
<birth_attendant>RRAWCIJBTZVZMMBBIXXLTMAWM</birth_attendant>
<other_attendant>QVHPJNAQUWJNABY</other_attendant>
<termination_location>QXYY</termination_location>
<other_termination_location>ETNEPTU</other_termination_location>
<termination_attendant>OSYAXBZBHYRODPPTJYMLV</termination_attendant>
<other_termination_attendant>SOYBWQONTSMKMVMCNVOOMVSYCQLPAH</other_termination_attendant>
<death_case_mother>ARISUVL</death_case_mother>
<death_case_infant>GFDVVMPUIHLEWBM</death_case_infant>
<newborn_case>DNZKODDEXMFEMUFARDATUGLV</newborn_case>
</safe_pregnancy>


text:
require_relative "utils"

if defined?(OpenSSL)

class OpenSSL::TestX509Certificate < Test::Unit::TestCase
  def setup
    @rsa1024 = OpenSSL::TestUtils::TEST_KEY_RSA1024
    @rsa2048 = OpenSSL::TestUtils::TEST_KEY_RSA2048
    @dsa256  = OpenSSL::TestUtils::TEST_KEY_DSA256
    @dsa512  = OpenSSL::TestUtils::TEST_KEY_DSA512
    @ca = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=CA")
    @ee1 = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=EE1")
    @ee2 = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=EE2")
  end

  def teardown
  end

  def issue_cert(*args)
    OpenSSL::TestUtils.issue_cert(*args)
  end

  def test_serial
    [1, 2**32, 2**100].each{|s|
      cert = issue_cert(@ca, @rsa2048, s, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::SHA1.new)
      assert_equal(s, cert.serial)
      cert = OpenSSL::X509::Certificate.new(cert.to_der)
      assert_equal(s, cert.serial)
    }
  end

  def test_public_key
    exts = [
      ["basicConstraints","CA:TRUE",true],
      ["subjectKeyIdentifier","hash",false],
      ["authorityKeyIdentifier","keyid:always",false],
    ]

    sha1 = OpenSSL::Digest::SHA1.new
    dss1 = OpenSSL::Digest::DSS1.new
    [
      [@rsa1024, sha1], [@rsa2048, sha1], [@dsa256, dss1], [@dsa512, dss1],
    ].each{|pk, digest|
      cert = issue_cert(@ca, pk, 1, Time.now, Time.now+3600, exts,
                        nil, nil, digest)
      assert_equal(cert.extensions[1].value,
                   OpenSSL::TestUtils.get_subject_key_id(cert))
      cert = OpenSSL::X509::Certificate.new(cert.to_der)
      assert_equal(cert.extensions[1].value,
                   OpenSSL::TestUtils.get_subject_key_id(cert))
    }
  end

  def test_validity
    now = Time.now until now && now.usec != 0
    cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_not_equal(now, cert.not_before)
    assert_not_equal(now+3600, cert.not_after)

    now = Time.at(now.to_i)
    cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal(now.getutc, cert.not_before)
    assert_equal((now+3600).getutc, cert.not_after)

    now = Time.at(0)
    cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal(now.getutc, cert.not_before)
    assert_equal(now.getutc, cert.not_after)

    now = Time.at(0x7fffffff)
    cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal(now.getutc, cert.not_before)
    assert_equal(now.getutc, cert.not_after)
  end

  def test_extension
    ca_exts = [
      ["basicConstraints","CA:TRUE",true],
      ["keyUsage","keyCertSign, cRLSign",true],
      ["subjectKeyIdentifier","hash",false],
      ["authorityKeyIdentifier","keyid:always",false],
    ]
    ca_cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, ca_exts,
                         nil, nil, OpenSSL::Digest::SHA1.new)
    ca_cert.extensions.each_with_index{|ext, i|
      assert_equal(ca_exts[i].first, ext.oid)
      assert_equal(ca_exts[i].last, ext.critical?)
    }

    ee1_exts = [
      ["keyUsage","Non Repudiation, Digital Signature, Key Encipherment",true],
      ["subjectKeyIdentifier","hash",false],
      ["authorityKeyIdentifier","keyid:always",false],
      ["extendedKeyUsage","clientAuth, emailProtection, codeSigning",false],
      ["subjectAltName","email:ee1@ruby-lang.org",false],
    ]
    ee1_cert = issue_cert(@ee1, @rsa1024, 2, Time.now, Time.now+1800, ee1_exts,
                          ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
    assert_equal(ca_cert.subject.to_der, ee1_cert.issuer.to_der)
    ee1_cert.extensions.each_with_index{|ext, i|
      assert_equal(ee1_exts[i].first, ext.oid)
      assert_equal(ee1_exts[i].last, ext.critical?)
    }

    ee2_exts = [
      ["keyUsage","Non Repudiation, Digital Signature, Key Encipherment",true],
      ["subjectKeyIdentifier","hash",false],
      ["authorityKeyIdentifier","issuer:always",false],
      ["extendedKeyUsage","clientAuth, emailProtection, codeSigning",false],
      ["subjectAltName","email:ee2@ruby-lang.org",false],
    ]
    ee2_cert = issue_cert(@ee2, @rsa1024, 3, Time.now, Time.now+1800, ee2_exts,
                          ca_cert, @rsa2048, OpenSSL::Digest::MD5.new)
    assert_equal(ca_cert.subject.to_der, ee2_cert.issuer.to_der)
    ee2_cert.extensions.each_with_index{|ext, i|
      assert_equal(ee2_exts[i].first, ext.oid)
      assert_equal(ee2_exts[i].last, ext.critical?)
    }

  end

  def test_sign_and_verify
    cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal(false, cert.verify(@rsa1024))
    assert_equal(true,  cert.verify(@rsa2048))
    assert_equal(false, certificate_error_returns_false { cert.verify(@dsa256) })
    assert_equal(false, certificate_error_returns_false { cert.verify(@dsa512) })
    cert.serial = 2
    assert_equal(false, cert.verify(@rsa2048))

    cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
                      nil, nil, OpenSSL::Digest::MD5.new)
    assert_equal(false, cert.verify(@rsa1024))
    assert_equal(true, cert.verify(@rsa2048))

    assert_equal(false, certificate_error_returns_false { cert.verify(@dsa256) })
    assert_equal(false, certificate_error_returns_false { cert.verify(@dsa512) })
    cert.subject = @ee1
    assert_equal(false, cert.verify(@rsa2048))

    cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
                      nil, nil, OpenSSL::Digest::DSS1.new)
    assert_equal(false, certificate_error_returns_false { cert.verify(@rsa1024) })
    assert_equal(false, certificate_error_returns_false { cert.verify(@rsa2048) })
    assert_equal(false, cert.verify(@dsa256))
    assert_equal(true,  cert.verify(@dsa512))
    cert.not_after = Time.now
    assert_equal(false, cert.verify(@dsa512))

    begin
      cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::DSS1.new)
      assert_equal(false, cert.verify(@rsa1024))
      assert_equal(true, cert.verify(@rsa2048))
      assert_equal(false, certificate_error_returns_false { cert.verify(@dsa256) })
      assert_equal(false, certificate_error_returns_false { cert.verify(@dsa512) })
      cert.subject = @ee1
      assert_equal(false, cert.verify(@rsa2048))
    rescue OpenSSL::X509::CertificateError
    end

    assert_raise(OpenSSL::X509::CertificateError){
      cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::MD5.new)
    }
  end

  def test_dsig_algorithm_mismatch
    assert_raise(OpenSSL::X509::CertificateError) do
      cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::DSS1.new)
    end
    assert_raise(OpenSSL::X509::CertificateError) do
      cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::MD5.new)
    end
  end

  def test_dsa_with_sha2
    begin
      cert = issue_cert(@ca, @dsa256, 1, Time.now, Time.now+3600, [],
                        nil, nil, OpenSSL::Digest::SHA256.new)
      assert_equal("dsa_with_SHA256", cert.signature_algorithm)
    rescue OpenSSL::X509::CertificateError
      # dsa_with_sha2 not supported. skip following test.
      return
    end
    # TODO: need more tests for dsa + sha2

    # SHA1 is allowed from OpenSSL 1.0.0 (0.9.8 requires DSS1)
    cert = issue_cert(@ca, @dsa256, 1, Time.now, Time.now+3600, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal("dsaWithSHA1", cert.signature_algorithm)
  end if defined?(OpenSSL::Digest::SHA256)

  def test_check_private_key
    cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
                      nil, nil, OpenSSL::Digest::SHA1.new)
    assert_equal(true, cert.check_private_key(@rsa2048))
  end

  private

  def certificate_error_returns_false
    yield
  rescue OpenSSL::X509::CertificateError
    false
  end
end

end


text:
module JsonApiClient
  VERSION = "0.9.2"
end


text:
if(!jQuery) var jQuery = django.jQuery;
// handler
window.django_autocomplete_max_reached = false;
function init_jQueryTagit(options){
    jQuery('#'+options.objectId).tagit({
        singleFieldDelimiter: ' ',
        fieldName         : options.fieldName,
        tagSource         : function(request, response){
            jQuery.getJSON(options.sourceUrl, {
                term: request.term
            }, response);
        },
        minLength         : options.minLength,
        removeConfirmation: options.removeConfirmation,
        caseSensitive     : options.caseSensitive,
        animate: options.animate,
        maxLength: options.maxLength,
        maxTags: options.maxTags,
        // Event callbacks.
        onTagAdded  : options.onTagAdded,
        onTagRemoved: options.onTagRemoved,
        onTagClicked: options.onTagClicked,
        onMaxTagsExceeded: options.onMaxTagsExceeded
    });
}


text: from recorder import Recorder


text:
package org.jbpm.executor.impl;

import org.jbpm.executor.entities.RequestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AvailableJobsExecutor extends AbstractAvailableJobsExecutor {

    private static final Logger logger = LoggerFactory.getLogger(AvailableJobsExecutor.class);

    public void executeJob(long requestId) {
        logger.debug("Executor attempts to run job with id {}", requestId);
        try {
            RequestInfo request = (RequestInfo) queryService.getRequestForProcessing(requestId);
            if (request != null) {
            	executeGivenJob(request);

            	logger.debug("Executor finished running job with id {}", requestId);
            }
        } catch (Exception e) {
            logger.warn("Unexpected error while processin executor's job {}", e.getMessage(), e);
        }
    }

}


text:
<?php

/*
Plugin Name: BugMeBar
Plugin URI: https://github.com/spiermar/wp-bugmebar
Description: Inserts your custom BugMeBar. Because of the WordPress User Bar, you might need to log out and visit your WordPress site again to see your BugMeBar.
Version: 1.0
Author: Martin Spier
Author URI: https://github.com/spiermar/wp-bugmebar
License: GPL v2

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

function add_bugmebar_css()
{
  echo '<link rel="stylesheet" href="' . plugins_url( 'css/bugme.min.css', __FILE__ ) . '" media="all" />';
}

function add_bugmebar_script()
{
  echo '<script src="' . plugins_url( 'js/jquery.cookie.min.js', __FILE__ ) . '"></script>';
  echo '<script src="' . plugins_url( 'js/jquery.bugme.min.js', __FILE__ ) . '"></script>';
  echo '<script src="' . plugins_url( 'js/bugmebar.js', __FILE__ ) . '"></script>';
}

add_action( 'wp_footer',  'add_bugmebar_script');
add_action('wp_head', 'add_bugmebar_css');

?>


text:
<?php
return array (
  'Your password is incorrect!' => ' ',
);


text:
<?php
function adminLogado(){
  if(isset($_SESSION['email']) and $_SESSION['tipo'] == 'admin'){
    return true;
  }else{
    return false;
  }
}

function userLogado(){
  if(isset($_SESSION['email']) and $_SESSION['tipo'] == 'user'){
    return true;
  }else{
    return false;
  }
}
?>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.group</groupId>
    <artifactId>cms</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>cms-business</artifactId>
  <dependencies>
  	<dependency>
  		<groupId>com.group</groupId>
  		<artifactId>cms-core</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  	</dependency>
  </dependencies>
</project>


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.pre = pre;

var _alaskaOrder = require('alaska-order');

var _alaskaOrder2 = _interopRequireDefault(_alaskaOrder);

var _Order = require('alaska-order/models/Order');

var _Order2 = _interopRequireDefault(_Order);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

async function pre() {
  let payment = this.params.payment;
  if (!payment.orders || !payment.orders.length) return;
  for (let order of payment.orders) {
    if (!order.save) {
      order = await _Order2.default.findById(order);
    }
    if (payment.orders.length === 1) {
      order.payed += payment.amount;
    } else if (!order.payed) {
      //多个订单一起支付
      order.payed = order.pay;
    } else {
      //多个订单一起支付,并且当前订单中已经有已支付金额
      //异常情况
    }
    order.payment = payment.type;
    await _alaskaOrder2.default.run('Pay', { order });
  }
  this.params.done = true;
}


text:
#nullable disable
using PasPasPas.Globals.Options.DataTypes;

namespace PasPasPas.Globals.Options {

    /// <summary>
    ///     linking options
    /// </summary>
    public interface ILinkOptions {

        /// <summary>
        ///     application type
        /// </summary>
        IOption<AppType> ApplicationType { get; }

        /// <summary>
        ///     image base address
        /// </summary>
        IOption<ulong> ImageBase { get; }

        /// <summary>
        ///     rtti link mode
        /// </summary>
        IOption<RttiLinkMode> WeakLinkRtti { get; }

        /// <summary>
        ///     link all types
        /// </summary>
        IOption<StrongTypeLinking> LinkAllTypes { get; }

        /// <summary>
        ///     export cpp objects
        /// </summary>
        IOption<ExportCppObjectMode> ExportCppObjects { get; }

        /// <summary>
        ///     minimum stack size
        /// </summary>
        IOption<ulong> MinimumStackMemorySize { get; }

        /// <summary>
        ///     maximum stack size
        /// </summary>
        IOption<ulong> MaximumStackMemorySize { get; }

        /// <summary>
        ///     weak package unit
        /// </summary>
        IOption<WeakPackaging> WeakPackageUnit { get; }

        /// <summary>
        ///     runtime only package option
        /// </summary>
        IOption<RuntimePackageMode> RuntimeOnlyPackage { get; }

        /// <summary>
        ///     clear options
        /// </summary>
        void Clear();

        /// <summary>
        ///     clear options on a new unit
        /// </summary>
        void ResetOnNewUnit();
    }
}


text:
""" plays stop action movies created by stop_action_player """

# disable pylint too many locals messages
#pylint: disable=R0914

# disable too many nested blocks
#pylint: disable=R0101

# disable too many branches
#pylint: disable=R0912

# disable too many statements
#pylint: disable=R0915

import argparse
import os
import cv2

RBG_GREEN = (0, 255, 0)   # green (red, green, blue)
FILE_TYPE = '.png'        # images will be saved as .png files
COUNT_TYPE = '.count'     # file type for the file containing the image count
TEXT_COLOR = RBG_GREEN    # frame number text color
TEXT_THICKNESS = 1        # frame number text thickness
TEXT_ORIGIN = (10, 25)    # location to place frame number text
TEXT_FONT_SCALE = 0.65    # font size for frame number textpress
DEFAULT_FPS = 10          # default frames per second
ESCAPE_KEY = 27           # ASCII value for the ESC key
LOWERCASE_F = 102         # ASCII value for 'f'
READ_ONLY = 'r'           # read only parameter for opening files
BACKWARDS = 'backwards'   # text to use in messages about playback sequence
FORWARDS = 'forwards'     # text to use in messages about playback sequence
FIRST_FRAME_REPEAT = 0    # number of times to repeat the frst frame on playback
LAST_FRAME_REPEAT = 0     # number of times to repeat the last frame on playback

def debug(program_name, print_debug_messages, display_text):
    """ print debugging messages prefixed by the name of the program """
    if print_debug_messages:
        print program_name + ':', display_text
    return

def main():
    """ main program """

    exit_message = 'user pressed ESC'

    # extract the parameters specified on the command line
    parser = argparse.ArgumentParser(description='Stop action movie player')
    parser.add_argument('movie_name', help='file name of the stop action movie')
    parser.add_argument('-f', '--FPS', dest='frames_per_second',
                        default=DEFAULT_FPS,
                        type=int, help='frames per second')
    parser.add_argument('-s', '--suppressframenumbers',
                        dest='suppress_frame_text',
                        action='store_true',
                        help='suppress display of frame numbers')
    parser.add_argument('-d', '--debug', dest='debug_switch',
                        action='store_true',
                        help='display debugging messages')
    parser.add_argument('-b', '--playbackwards', dest='play_backwards',
                        action='store_true', help='play the movie backwards')
    parser.add_argument('-a', '--firstframerepeat', dest='first_frame_repeat',
                        default=FIRST_FRAME_REPEAT, type=int,
                        help='number of times to repeat the first frame on playback')
    parser.add_argument('-z', '--lastframerepeat', dest='last_frame_repeat',
                        default=LAST_FRAME_REPEAT, type=int,
                        help='number of times to repeat the last frame on playback')
    args = parser.parse_args()

    # remove the .py from the program name
    prog_name = parser.prog.rsplit(".", 1)[0]
    movie_name = args.movie_name
    frames_per_second = args.frames_per_second
    print_dm = args.debug_switch
    suppress_frame_text = args.suppress_frame_text
    play_backwards = args.play_backwards
    first_frame_repeat = args.first_frame_repeat
    last_frame_repeat = args.last_frame_repeat

    # check for invalid frames per second setting
    if frames_per_second < 1:
        exit_message = 'frames per second must be one or higher'
        return exit_message

    # determine how to play the movie
    play_setting = BACKWARDS if play_backwards else FORWARDS

    # calculate the delay in millseconds between frames
    time_between_frames = int(1000 / frames_per_second)

    # display the command parameters if debug is turned on
    debug(prog_name, print_dm, 'movie name is ' + movie_name)
    debug(prog_name, print_dm, 'frames per second are ' + \
          str(frames_per_second))
    debug(prog_name, print_dm, 'time delay between frame is ' + \
          str(time_between_frames))
    debug(prog_name, print_dm, 'debug is set to ' + str(print_dm))
    debug(prog_name, print_dm, 'movie will be played ' + play_setting)
    debug(prog_name, print_dm, 'first frame will be repeated ' + \
          str(first_frame_repeat) + ' times')
    debug(prog_name, print_dm, 'last frame will be repeated ' + \
          str(last_frame_repeat) + ' times')

    # construct the file name for file containing the count of images
    # in the movie
    file_name = movie_name + COUNT_TYPE
    debug(prog_name, print_dm, 'count file name is ' + file_name)

    # verify the frame count file exists before trying to open it
    if os.path.isfile(file_name):
        count_file = open(file_name, READ_ONLY)

        # read the number of frames in the moview
        count = int(count_file.read())
        debug(prog_name, print_dm, 'frame count is ' + str(count))

        # make sure the movie has at least two frames
        if count < 2:
            exit_message = 'movie must contain at least two frames'
            return exit_message

        # close the frame count file
        count_file.close()

        # loop reading and displaying all the frames until the
        # ESC key is pressed
        keep_playing = True

        # create the sequence of frames to play
        play_sequence = range(1, count + 1, 1)

        # if play backwards was specified, reverse the play sequence
        if play_backwards:
            play_sequence.reverse()

        debug(prog_name, print_dm, 'frame play sequence: ' + str(play_sequence))

        # get the first frame in the sequence specified by the user
        first_frame = play_sequence[0]
        # get the last frame in the sequence specified by the user
        last_frame = play_sequence[-1]

        debug(prog_name, print_dm, 'first frame is ' + str(first_frame))
        debug(prog_name, print_dm, 'last frame is ' + str(last_frame))

        # play the movie until the user presses the escape key
        while keep_playing:
            # loop through all the image files
            for i in play_sequence:
                # construct the image number used in the file name
                sequence = str(i).zfill(3)
                # construct the file name
                file_name = movie_name + "." + sequence + FILE_TYPE
                debug(prog_name, print_dm, 'displaying ' + file_name)

                # verify the frame image file exists before trying to read it
                if os.path.isfile(file_name):

                    # read the image from the file
                    disp_image = cv2.imread(file_name, 1)

                    # ensure c has a value since some paths do not call waitkey
                    char = 0

                    # if this is the first frame, repeat it according to what
                    # the user specified
                    if i == first_frame:

                        # display the first frame the number of times specified
                        for rep in range(0, first_frame_repeat):

                            debug(prog_name, print_dm, 're-displaying ' + \
                                  file_name + ' ' + str(rep).zfill(3))

                            # make a copy of the image so there's a clean copy
                            # used to add text each iteration
                            disp_temp_image = disp_image.copy()

                            # check to see whether to suppress the display of
                            # frames per second, frame number, and repeat number
                            if not suppress_frame_text:
                                frame_text = 'FPS: ' + str(frames_per_second) + \
                                            ' Frame: ' + sequence + \
                                            ' Repeat: ' + str(rep).zfill(3)
                                cv2.putText(disp_temp_image, frame_text,
                                            TEXT_ORIGIN,
                                            cv2.FONT_HERSHEY_SIMPLEX,
                                            TEXT_FONT_SCALE, TEXT_COLOR,
                                            TEXT_THICKNESS)

                            # display the frame
                            cv2.imshow(movie_name, disp_temp_image)

                            # delay between frames and check to see if a
                            # key was pressed
                            char = cv2.waitKey(time_between_frames)

                            # if lower case f is pressed, toggle the display
                            # of the frame numbers
                            if char == LOWERCASE_F:
                                suppress_frame_text = not suppress_frame_text

                            # if the escape key was pressed exit the loops
                            if char == ESCAPE_KEY:
                                keep_playing = False
                                break

                    # if this is the last frame, repeat it according to what
                    # the user specified
                    elif i == last_frame:

                        # display the last frame the number of times specified
                        for rep in range(0, last_frame_repeat):
                            debug(prog_name, print_dm, 're-displaying ' + \
                                  file_name + ' ' + str(rep).zfill(3))

                            # make a copy of the image so there's a clean copy
                            # used to add text each iteration
                            disp_temp_image = disp_image.copy()

                            # check to see whether to suppress the display of
                            # frames per second, frame number, and repeat number
                            if not suppress_frame_text:
                                frame_text = 'FPS: ' + str(frames_per_second) + \
                                             ' Frame: ' + sequence + \
                                             ' Repeat: ' + str(rep).zfill(3)
                                cv2.putText(disp_temp_image, frame_text,
                                            TEXT_ORIGIN,
                                            cv2.FONT_HERSHEY_SIMPLEX,
                                            TEXT_FONT_SCALE, TEXT_COLOR,
                                            TEXT_THICKNESS)

                            # display the frame
                            cv2.imshow(movie_name, disp_temp_image)

                            # delay between frames and check to see if a
                            # key was pressed
                            char = cv2.waitKey(time_between_frames)

                            # if lower case f is pressed, toggle the display
                            # of the frame numbers
                            if char == LOWERCASE_F:
                                suppress_frame_text = not suppress_frame_text

                            # if the escape key was pressed exit the loops
                            if char == ESCAPE_KEY:
                                keep_playing = False
                                break

                    # this is not the first or last frame so just display
                    # it once
                    else:

                        # check to see whether to suppress the display of frames
                        # per second and the frame number
                        if not suppress_frame_text:
                            frame_text = 'FPS: ' + str(frames_per_second) + \
                                        ' Frame: ' + sequence
                            cv2.putText(disp_image, frame_text, TEXT_ORIGIN,
                                        cv2.FONT_HERSHEY_SIMPLEX,
                                        TEXT_FONT_SCALE, TEXT_COLOR,
                                        TEXT_THICKNESS)

                        # display the frame
                        cv2.imshow(movie_name, disp_image)

                        # delay between frames and check to see if a
                        # key was pressed
                        char = cv2.waitKey(time_between_frames)

                        # if lower case f is pressed, toggle the display
                        # of the frame numbers
                        if char == LOWERCASE_F:
                            suppress_frame_text = not suppress_frame_text

                        # if the escape key was pressed exit the loops
                        if char == ESCAPE_KEY:
                            keep_playing = False
                            break

                # the frame file does not exist: print an error and exit
                else:
                    exit_message = 'frame file ' + file_name + ' does not exist'
                    return exit_message

        # clean everything up and exit
        cv2.destroyAllWindows()

    # the frame count file does not exist: print an error message
    else:
        exit_message = 'can not open frame count file ' + file_name

    return exit_message

# command line execution starts here
if __name__ == "__main__":
    print main()


text:
require_relative 'reference_collector'

require_relative 'sexp_extensions/arguments'
require_relative 'sexp_extensions/begin'
require_relative 'sexp_extensions/block'
require_relative 'sexp_extensions/case'
require_relative 'sexp_extensions/constant'
require_relative 'sexp_extensions/if'
require_relative 'sexp_extensions/lambda'
require_relative 'sexp_extensions/logical_operators'
require_relative 'sexp_extensions/methods'
require_relative 'sexp_extensions/module'
require_relative 'sexp_extensions/nested_assignables'
require_relative 'sexp_extensions/self'
require_relative 'sexp_extensions/send'
require_relative 'sexp_extensions/super'
require_relative 'sexp_extensions/symbols'
require_relative 'sexp_extensions/variables'
require_relative 'sexp_extensions/when'
require_relative 'sexp_extensions/yield'


text:
var xpath = require('xpath'),
    dom = require('xmldom').DOMParser;

console.log('Starting LookupMetadata');

exports.handler = function(event, context) {
    console.log('REQUEST RECEIVED:\\n', JSON.stringify(event));
    console.log('context: %j', context);
    if (event.RequestType == 'Delete') {
        sendResponse(event, context, "SUCCESS");
        return;
    }

    var IdpURL = event.ResourceProperties.IdpURL;
    var IdpNAME = event.ResourceProperties.IdpName;
    var metadataTable = event.ResourceProperties.MetadataTable;
    var responseData = {};

    if (IdpURL) {
        if (IdpURL.match('https')) {
          https = require('https');
          var url = require('url');
          var parsedUrl = url.parse(IdpURL);
          var options = {
              hostname: parsedUrl.hostname,
              port: 443,
              path: parsedUrl.path,
              method: 'GET'
          };
          var stringResult = '';
          var request = https.request(options, function(response) {
            console.log('Status code: ' + response.statusCode);
            console.log('Status message: ' + response.statusMessage);
            response.on('data', function(data) {
              stringResult += data.toString();
            });
            response.on('end', function() {
              var entityPath = ".//*[local-name()='EntityDescriptor']/@entityID";
              var metadataDoc = new dom().parseFromString(stringResult);
              var entity = xpath.select(entityPath, metadataDoc)[0].value;
              var doc = require('dynamodb-doc');
              var db = new doc.DynamoDB();
              var params = {
                  Key: { IdpName: 'default' },
                  TableName: metadataTable,
                  AttributeUpdates: {
                      Metadata: {
                          Action: 'PUT',
                          Value: stringResult
                      }
                  },
                  ReturnValues: 'UPDATED_NEW'
              };
              db.updateItem(params, function(err, data) {
                if (err) {
                  responseData = {Error: err};
                  sendResponse(event, context, "FAILED", {});
                } else {
                  sendResponse(event, context, "SUCCESS", {Status: 'success'});
                  console.log('Updated DynamoDB with: ' + stringResult);
                  console.log('Dynamo returned: %j', data);
                }
              });
            });
          });
          request.on('error', function(err) {
            responseData = {Error: err, Opts: options};
            rsp.send(event, context, rsp.FAILED, responseData);
          });
          request.end();
        } else {
          responseData = {Error: 'IdP URL not supported'};
          rsp.send(event, context, rsp.FAILED, responseData);
        }
    } else {
        responseData = {Error: 'IdP URL not specified'};
        rsp.send(event, context, rsp.FAILED, responseData);
    }
};

// Send response to the pre-signed S3 URL
// Harvested from the AWS amilookup example
function sendResponse(event, context, responseStatus, responseData) {

    var responseBody = JSON.stringify({
        Status: responseStatus,
        Reason: "See the details in CloudWatch Log Stream: " + context.logStreamName,
        PhysicalResourceId: context.logStreamName,
        StackId: event.StackId,
        RequestId: event.RequestId,
        LogicalResourceId: event.LogicalResourceId,
        Data: responseData
    });

    console.log("RESPONSE BODY:\n", responseBody);

    var https = require("https");
    var url = require("url");

    var parsedUrl = url.parse(event.ResponseURL);
    var options = {
        hostname: parsedUrl.hostname,
        port: 443,
        path: parsedUrl.path,
        method: "PUT",
        headers: {
            "content-type": "",
            "content-length": responseBody.length
        }
    };

    console.log("SENDING RESPONSE...\n");

    var request = https.request(options, function(response) {
        console.log("STATUS: " + response.statusCode);
        console.log("HEADERS: " + JSON.stringify(response.headers));
        // Tell AWS Lambda that the function execution is done
        context.done();
    });

    request.on("error", function(error) {
        console.log("sendResponse Error:" + error);
        // Tell AWS Lambda that the function execution is done
        context.done();
    });

    // write data to request body
    request.write(responseBody);
    request.end();
}


text:
<?php

/**
 * Exception for expectations which failed their check.
 *
 * The exception contains the error message and optionally a
 * PHPUnit_Framework_ComparisonFailure which is used to
 * generate diff output of the failed expectations.
 *
 * @package    PHPUnit
 * @subpackage Framework
 * @author     Sebastian Bergmann <sebastian@phpunit.de>
 * @copyright  2001-2012 Sebastian Bergmann <sebastian@phpunit.de>
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.0.0
 */
class PHPUnit_Framework_ExpectationFailedException extends PHPUnit_Framework_AssertionFailedError
{
    /**
     * @var PHPUnit_Framework_ComparisonFailure
     */
    protected $comparisonFailure;

    public function __construct($message, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL, Exception $previous = NULL)
    {
        $this->comparisonFailure = $comparisonFailure;

        parent::__construct($message, 0, $previous);
    }

    /**
     * @return PHPUnit_Framework_ComparisonFailure
     */
    public function getComparisonFailure()
    {
        return $this->comparisonFailure;
    }
}


text:
<?php namespace spec\BX\User;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class ConfirmRegistrationManagerSpec extends ObjectBehavior
{
	use \BX\DB\DBTrait;
	function let()
	{
		\BX\DB\Schema::loadFromYamlFile();
	}
	function it_is_initializable()
	{
		$this->shouldHaveType('BX\User\ConfirmRegistrationManager');
	}
	function it_get_token()
	{
		$this->getToken(1,'qwerty','qwerty')->shouldBe('qwerty');
	}
	function it_check()
	{
		$this->check('qwerty','qwerty')->shouldBeLike(1);
	}
	function it_clear()
	{
		$this->clear(1)->shouldBe(true);
		$sql = 'SELECT * FROM tbl_confirm_registration';
		if ($this->db()->query($sql)->count() > 0){
			throw new \RuntimeException('Test fall.');
		}
	}
	function it_clear_old()
	{
		$this->clearOld(10)->shouldBe(true);
		$sql = 'SELECT * FROM tbl_confirm_registration';
		if ($this->db()->query($sql)->count() > 0){
			throw new \RuntimeException('Test fall.');
		}
	}
}


text:
setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars
DIRSTACKSIZE=5

# Enable extended globbing
setopt extendedglob

# Allow [ or ] whereever you want
unsetopt nomatch

# cdpath for quicker directory switching
setopt auto_cd
cdpath=($HOME $HOME/Code $HOME/stripe $HOME/Code/reshleman)


text:
import {ElementRef, ElementRef_} from './element_ref';

/**
 * Represents an Embedded Template that can be used to instantiate Embedded Views.
 *
 * You can access a `TemplateRef`, in two ways. Via a directive placed on a `<template>` element (or
 * directive prefixed with `*`) and have the `TemplateRef` for this Embedded View injected into the
 * constructor of the directive using the `TemplateRef` Token. Alternatively you can query for the
 * `TemplateRef` from a Component or a Directive via {@link Query}.
 *
 * To instantiate Embedded Views based on a Template, use
 * {@link ViewContainerRef#createEmbeddedView}, which will create the View and attach it to the
 * View Container.
 */
export abstract class TemplateRef {
  /**
   * The location in the View where the Embedded View logically belongs to.
   *
   * The data-binding and injection contexts of Embedded Views created from this `TemplateRef`
   * inherit from the contexts of this location.
   *
   * Typically new Embedded Views are attached to the View Container of this location, but in
   * advanced use-cases, the View can be attached to a different container while keeping the
   * data-binding and injection context from the original location.
   *
   */
  // TODO(i): rename to anchor or location
  get elementRef(): ElementRef { return null; }
}

export class TemplateRef_ extends TemplateRef {
  constructor(private _elementRef: ElementRef_) { super(); }

  get elementRef(): ElementRef_ { return this._elementRef; }
}


text:
layout: page
title: Corporate Engineering Blogs
---

### [Data](https://github.com/griffio/griffio.github.io/blob/master/_data/techblogs.csv) with Github repos and career/jobs link

Top 5 languages in companies listed:

{% assign sorted_techblogs = (site.data.techblogs | sort: 'desc') %}
{% for techblog in sorted_techblogs %}
{% assign ghlangs = (techblog.languages | split: ' ') %}

{{ techblog.desc }}
/{{ techblog.github }}
Jobs

{% for ghlang in ghlangs %}
{{ ghlang }}
{% endfor %}

{% endfor %}


text:
//
//  WYNewsDeaiViewModel.m
//  百思不得姐
//
//  Created by cyz on 16/11/21.
//  Copyright © 2016年 yuze. All rights reserved.
//

#import "WYNewsDeaiViewModel.h"
#import "BLNetworkTool.h"
#import <MJExtension.h>

@implementation WYNewsDeaiViewModel

- (instancetype)init
{
    if (self = [super init]) {
        [self setupRACCommand];
        NSLog(@"进入了WYNewsDeaiViewModel.init");
    }
    return self;
}

/**
 初始化发送命令
 */
- (void)setupRACCommand
{
    @weakify(self);
    _fetchNewsDetailCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
        NSLog(@"进入了_fetchNewsDetailCommand");
        return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {

            @strongify(self);
            [self requestForNewsDetailsuccess:^(NSDictionary *result) {
                //将请求到的数据进行解析存储
                self.detailModel = [WYNewsDetailEntity mj_objectWithKeyValues:result[self.listModel.docid]];
                // 完成
                [subscriber sendCompleted];

            } failure:^(NSError *error) {
                [subscriber sendError:error];
            }];
            return nil; // 必须有返回值
        }];
    }];
}

/**
 发起网络请求
 */
- (void)requestForNewsDetailsuccess:(void (^)(NSDictionary *result))success failure:(void (^)( NSError *error))failure
{
    NSString *url = [NSString stringWithFormat:@"http://c.m.163.com/nc/article/%@/full.html",self.listModel.docid];
    [BLNetworkTool BL_GET:url parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        if (responseObject) {
            success(responseObject);
        }
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        failure(error);
    }];
}

- (NSString *)getHtmlString
{
    NSMutableString *html = [NSMutableString string];
    [html appendString:@""];
    [html appendString:@""];
#warning test 测试函数
    [html appendString:@""];

    [html appendFormat:@"<link rel=\"stylesheet\" href=\"%@\">",[[NSBundle mainBundle] URLForResource:@"WYDetails.css" withExtension:nil]];
    [html appendString:@""];

    // 设置背景颜色 字体颜色
        [html appendString:@""];
    //style=\"background:#f6f6f6\"
    //
//    [html appendString:@""];
    [html appendString:[self getBodyString]];
    [html appendString:@""];

    [html appendString:@""];

    return html;

}

- (NSString *)getBodyString
{

    NSMutableString *body = [NSMutableString string];
    [body appendFormat:@"
%@
",self.listModel.title];
    [body appendFormat:@"
%@
",self.listModel.ptime];
    if (self.detailModel.body != nil) {
        // 直接拼接body
//        [body appendString:self.detailModel.body];
        [body appendFormat:@"
%@
",self.detailModel.body];
    }
    for (bodyimg *detailImgModel in self.detailModel.img) {

        NSMutableString *imgHtml = [NSMutableString string];
        // 设置img的div
        [imgHtml appendString:@"
"];
        NSArray *pixel = [detailImgModel.pixel componentsSeparatedByString:@"*"];
        CGFloat width = [[pixel firstObject]floatValue];
        CGFloat height = [[pixel lastObject]floatValue];
        // 判断是否超过最大宽度
        CGFloat maxWidth = [UIScreen mainScreen].bounds.size.width * 0.96;
        if (width > maxWidth) {
            height = maxWidth / width * height;
            width = maxWidth;
        }

        NSString *onload = @"this.onclick = function() {"
        "  window.location.href = 'sx://github.com/dsxNiubility?src=' +this.src+'&top=' + this.getBoundingClientRect().top + '&whscale=' + this.clientWidth/this.clientHeight ;"
        "};";
        [imgHtml appendFormat:@"",onload,width,height,detailImgModel.src];
        [imgHtml appendString:@"
"];
        [body replaceOccurrencesOfString:detailImgModel.ref withString:imgHtml options:NSCaseInsensitiveSearch range:NSMakeRange(0, body.length)];
    }
    return body;
}

@end


text:
[![CircleCI](https://circleci.com/gh/Xorlev/rust-sequencefile/tree/master.svg?style=svg)](https://circleci.com/gh/Xorlev/rust-sequencefile/tree/master)
![Crates.io](https://img.shields.io/crates/v/sequencefile)

# rust-sequencefile
Hadoop SequenceFile library for Rust

[Documentation](https://xorlev.github.io/rust-sequencefile/)

```toml
# Cargo.toml
[dependencies]
sequencefile = "0.2.0"
```

## Status
Prototype status! I'm in the process of learning Rust. :) Feedback appreciated.

Unfortunately that means the API will change. If you depend on this crate, please fully qualify your versions
for now.

Currently supports reading out your garden-variety sequence file. Handles uncompressed sequencefiles
as well as block/record compressed files (deflate, gzip, and bzip2 only). LZO and Snappy are not (yet) handled.

There's a lot more to do:
- [X] Varint decoding
 - Block sizes are written with Varints
- [X] Block decompression
- [X] Gzip support
- [X] Bzip2 support
- [X] Sequencefile metadata
- [X] Better error handling
- [X] Tests
- [X] Better error handling2
- [ ] More tests
- [ ] Better documentation
- [ ] Snappy support
- [ ] CRC file support
- [X] 'Writables', e.g. generic deserialization for common Hadoop writable types
- [ ] Writer
- [ ] Gracefully handle version 4 sequencefiles
- [ ] Zero-copy implementation.
- [ ] LZO support.

### Benchmarks

There aren't any formal benchmarks yet. However with deflate on my early 2012 MBP, 98.4% of CPU time
was spent in miniz producing ~125MB/s of decompressed data.

## Usage
```rust
let path = Path::new("/path/to/seqfile");
let file = File::open(&path).unwrap();

let seqfile = sequencefile::Reader::new(file).expect("Failed to open sequence file.");

for kv in seqfile {
    println!("{:?}", kv); // Some(([123, 123], [456, 456]))
}

// Until there's automatic deserialization, you can do something like this:
// VERY hacky
let kvs = seqfile.map(|e| e.unwrap()).map(|(key, value)| {
    (BigEndian::read_i64(&key),
     String::from_utf8_lossy(&value[2..value.len()]).to_string())
});

for (k,v) in kvs {
  println!("key: {}, value: {}", k, v);
}
```

## License
rust-sequencefile is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0),
with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.


text:
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='site-index'),
    url(r'^(?P<site_id>[0-9]+)/edit/$', views.update, name='site-update'),
]


text:
import mock

from rejviz import libvirt_nets
import rejviz.tests.utils as tutils

NETWORK_XMLDESC = """
<network>
  <name>default</name>
  <uuid>d2f553ca-f9fe-49cb-996d-934a69fc02da</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:f7:fc:83'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>
"""

class LibvirtNetsTest(tutils.TestCase):

    @mock.patch('libvirt.openReadOnly')
    @mock.patch('rejviz.libvirt_nets._fetch_network_data')
    def test_get_libvirt_networks(self, _fetch_network_data, openReadOnly):
        conn = openReadOnly.return_value
        conn.listAllNetworks.return_value = ['net1', 'net2']

        networks = libvirt_nets.get_libvirt_networks()

        self.assertEqual([_fetch_network_data.return_value,
                          _fetch_network_data.return_value],
                         networks)
        openReadOnly.assertCalledWith()
        conn.listAllNetworks.assertCalledWith()
        _fetch_network_data.assertCalledWith('net1')
        _fetch_network_data.assertCalledWith('net2')
        conn.close.assertCalledWith()

    def test_fetch_network_data(self):
        network_object = mock.MagicMock()
        network_object.name.return_value = 'default'
        network_object.XMLDesc.return_value = NETWORK_XMLDESC

        network = libvirt_nets._fetch_network_data(network_object)
        self.assertEqual('default', network['name'])
        self.assertEqual(True, network['dhcp'])
        self.assertEqual('192.168.122.0', network['network'])
        self.assertEqual('255.255.255.0', network['netmask'])

    def test_gateway_ipaddr_to_network(self):
        # for 192.168.122.0/24
        self.assertEqual(
            '192.168.122.0',
            libvirt_nets._gateway_ipaddr_to_network('192.168.122.1'))
        # for 192.168.123.192/26
        self.assertEqual(
            '192.168.123.192',
            libvirt_nets._gateway_ipaddr_to_network('192.168.123.193'))


text:
mod coverage;

pub use command::coverage:: {
    coverage_parser,
    coverage_action,
    CoverageError
};


text:
d-js
====

A jQuery replacement with a footprint of 13.38kB minified and gzipped vs the 29.59kB in jQuery.
Made to be a dropin that still works with common jQuery plugins...a nice middleground between
[dominus](https://github.com/bevacqua/dominus) and [jQuery](http://jquery.com/).

`npm install d-js`

## Things of note

#### Promises
No `$.Deferred`s. Use [Promises](https://github.com/then/promise).

#### Ajax
Include your own ajax via [xaja-js](https://github.com/JosephClay/xaja-js) if needed.

#### Events
Events are handled by [crossvent](https://github.com/bevacqua/crossvent) by [bevacqua](https://github.com/bevacqua) and support the normal
`.on`, `.off` and `.trigger` methods.

No shorthand events
```
// don't use d().click(doSomething);
d().on('click', doSomething);
```

#### Data
Does not get data atttributes from the element

#### Animations
None, there are plenty of good non-jquery alternatives.

#### Each
D.each works as it does in jQuery e.g. `.each(function(index, value) {})`. D.forEach works as expected in ES5 e.g. `.forEach(function(value, index) {})` with `this` as the value;

#### Extend
Uses a [lodash](https://lodash.com) style extend.

#### Custom Selectors
Supported!
- `:not(selector)`
- `:empty`
- `:focus`
- `:root`
- `:text`
- `:password`
- `:radio`
- `:checkbox`
- `:submit`
- `:reset`
- `:button`
- `:image`
- `:file`
- `:enabled`
- `:disabled`
- `:selected`
- `:checked`

Not supported:
- `:eq(index)`
- `:gt(no)`
- `:lt(no)`
- `:contains(text)`
- `:parent`
- `:has(selector)`
- `:hidden`
- `:visible`
- `:header`
- `:input`

#### More conflict
`.moreConflict()` to easily overwrite jQuery, $ and Zepto.

## Tests
Clone the repo, and run `npm test`.

## Perf
Clone the repo, and run `npm run perf`. Please note that most perfs are micro benchmarks...the DOM
is going to be a bigger limiting factor than jQuery or d-js's performance.

## TODO
- more unit tests
- more perf tests
- smaller builds, same feature set
- identify any missing or non-working methods
- namespaces for events

#License

The MIT License (MIT)

Copyright (c) 2014 Joseph Clay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


text:
.top-buffer { margin-top:-15px; }

.buffer { margin-bottom:0px; margin-top:0px;}


text:
//
//  SUErrors.h
//  Sparkle
//
//  Created by C.W. Betts on 10/13/14.
//  Copyright (c) 2014 Sparkle Project. All rights reserved.
//

#ifndef SUERRORS_H
#define SUERRORS_H

#import <Foundation/Foundation.h>
#import "SUExport.h"

/**
 * Error domain used by Sparkle
 */
SU_EXPORT extern NSString *const SUSparkleErrorDomain;

typedef NS_ENUM(OSStatus, SUError) {
    // Appcast phase errors.
    SUAppcastParseError = 1000,
    SUNoUpdateError = 1001,
    SUAppcastError = 1002,
    SURunningFromDiskImageError = 1003,

    // Downlaod phase errors.
    SUTemporaryDirectoryError = 2000,

    // Extraction phase errors.
    SUUnarchivingError = 3000,
    SUSignatureError = 3001,

    // Installation phase errors.
    SUFileCopyFailure = 4000,
    SUAuthenticationFailure = 4001,
    SUMissingUpdateError = 4002,
    SUMissingInstallerToolError = 4003,
    SURelaunchError = 4004,
    SUInstallationError = 4005,
    SUDowngradeError = 4006,

    SUXPCServiceError = 4007,

    // System phase errors
    SUSystemPowerOffError = 5000
};

#endif


text:
namespace cl {
	namespace detail {
		class CLFunction final {
		private:
			CLFunction(std::experimental::string_view name);

		public:
			template<typename CLFunctionPtr>
			static inline auto getByPtr(CLFunctionPtr ptr) -> CLFunction const&;

			inline auto getCLName() const -> std::experimental::string_view const&;

			#define CLPP_FUNC_GETTER(funcName) \
				static inline auto funcName() -> CLFunction const& { \
					static const auto instance = CLFunction{#funcName}; \
					return instance; \
				}

			CLPP_FUNC_GETTER(unknown);

			CLPP_FUNC_GETTER(clGetPlatformIDs);
			CLPP_FUNC_GETTER(clGetPlatformInfo);
			CLPP_FUNC_GETTER(clGetDeviceIDs);
			CLPP_FUNC_GETTER(clGetDeviceInfo);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clCreateSubDevices);
			CLPP_FUNC_GETTER(clRetainDevice);
			CLPP_FUNC_GETTER(clReleaseDevice);
		#endif // defined(CL_VERSION_1_2)

			CLPP_FUNC_GETTER(clCreateContext);
			CLPP_FUNC_GETTER(clCreateContextFromType);
			CLPP_FUNC_GETTER(clRetainContext);
			CLPP_FUNC_GETTER(clReleaseContext);
			CLPP_FUNC_GETTER(clGetContextInfo);

		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clCreateCommandQueueWithProperties);
		#else
			CLPP_FUNC_GETTER(clCreateCommandQueue);
		#endif // defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clRetainCommandQueue);
			CLPP_FUNC_GETTER(clReleaseCommandQueue);
			CLPP_FUNC_GETTER(clGetCommandQueueInfo);

			CLPP_FUNC_GETTER(clCreateBuffer);
			CLPP_FUNC_GETTER(clCreateSubBuffer);
			CLPP_FUNC_GETTER(clEnqueueReadBuffer);
			CLPP_FUNC_GETTER(clEnqueueWriteBuffer);
			CLPP_FUNC_GETTER(clEnqueueReadBufferRect);
			CLPP_FUNC_GETTER(clEnqueueWriteBufferRect);
			CLPP_FUNC_GETTER(clEnqueueCopyBuffer);
			CLPP_FUNC_GETTER(clEnqueueCopyBufferRect);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueFillBuffer);
		#endif // defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueMapBuffer);

		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clCreateImage);
		#else
			CLPP_FUNC_GETTER(clCreateImage2D);
			CLPP_FUNC_GETTER(clCreateImage3D);
		#endif
			CLPP_FUNC_GETTER(clGetSupportedImageFormats);
			CLPP_FUNC_GETTER(clEnqueueReadImage);
			CLPP_FUNC_GETTER(clEnqueueWriteImage);
			CLPP_FUNC_GETTER(clEnqueueCopyImage);
			CLPP_FUNC_GETTER(clEnqueueCopyImageToBuffer);
			CLPP_FUNC_GETTER(clEnqueueCopyBufferToImage);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueFillImage);
		#endif // defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueMapImage);

			CLPP_FUNC_GETTER(clEnqueueUnmapMemObject);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueMigrateMemObjects);
		#endif
			CLPP_FUNC_GETTER(clGetImageInfo);
			CLPP_FUNC_GETTER(clGetMemObjectInfo);
			CLPP_FUNC_GETTER(clRetainMemObject);
			CLPP_FUNC_GETTER(clReleaseMemObject);
			CLPP_FUNC_GETTER(clSetMemObjectDestructorCallback);

		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clCreateSamplerWithProperties);
		#else
			CLPP_FUNC_GETTER(clCreateSampler);
		#endif
			CLPP_FUNC_GETTER(clRetainSampler);
			CLPP_FUNC_GETTER(clReleaseSampler);
			CLPP_FUNC_GETTER(clGetSamplerInfo);

			CLPP_FUNC_GETTER(clCreateProgramWithSource);
			CLPP_FUNC_GETTER(clCreateProgramWithBinary);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clCreateProgramWithBuiltInKernels);
		#endif // defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clRetainProgram);
			CLPP_FUNC_GETTER(clReleaseProgram);
			CLPP_FUNC_GETTER(clBuildProgram);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clCompileProgram);
			CLPP_FUNC_GETTER(clLinkProgram);
		#endif
		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clUnloadPlatformCompiler);
		#else
			CLPP_FUNC_GETTER(clUnloadCompiler);
		#endif
			CLPP_FUNC_GETTER(clGetProgramInfo);
			CLPP_FUNC_GETTER(clGetProgramBuildInfo);

			CLPP_FUNC_GETTER(clCreateKernel);
			CLPP_FUNC_GETTER(clCreateKernelsInProgram);
			CLPP_FUNC_GETTER(clGetKernelInfo);
		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clGetKernelArgInfo);
		#endif // defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clGetKernelWorkGroupInfo);
			CLPP_FUNC_GETTER(clRetainKernel);
			CLPP_FUNC_GETTER(clReleaseKernel);
			CLPP_FUNC_GETTER(clSetKernelArg);
		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clSetKernelArgSVMPointer);
			CLPP_FUNC_GETTER(clSetKernelExecInfo);
		#endif // defined(CL_VERSION_2_0)

			CLPP_FUNC_GETTER(clEnqueueNDRangeKernel);
			CLPP_FUNC_GETTER(clEnqueueNativeKernel);

			CLPP_FUNC_GETTER(clCreateUserEvent);
			CLPP_FUNC_GETTER(clSetUserEventStatus);
			CLPP_FUNC_GETTER(clWaitForEvents);
			CLPP_FUNC_GETTER(clGetEventInfo);
			CLPP_FUNC_GETTER(clSetEventCallback);
			CLPP_FUNC_GETTER(clRetainEvent);
			CLPP_FUNC_GETTER(clReleaseEvent);

		#if defined(CL_VERSION_1_2)
			CLPP_FUNC_GETTER(clEnqueueMarkerWithWaitList);
			CLPP_FUNC_GETTER(clEnqueueBarrierWithWaitList);
		#else
			CLPP_FUNC_GETTER(clEnqueueMarker);
			CLPP_FUNC_GETTER(clEnqueueBarrier);
			CLPP_FUNC_GETTER(clEnqueueWaitForEvents);
		#endif // defined(CL_VERSION_1_2)

			CLPP_FUNC_GETTER(clGetEventProfilingInfo);
			CLPP_FUNC_GETTER(clFlush);
			CLPP_FUNC_GETTER(clFinish);

		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clCreatePipe);
			CLPP_FUNC_GETTER(clGetPipeInfo);
		#endif // defined(CL_VERSION_2_0)

		#if defined(CL_VERSION_2_0)
			CLPP_FUNC_GETTER(clSVMAlloc);
			CLPP_FUNC_GETTER(clSVMFree);
			CLPP_FUNC_GETTER(clEnqueueSVMFree);
			CLPP_FUNC_GETTER(clEnqueueSVMMemcpy);
			CLPP_FUNC_GETTER(clEnqueueSVMMemFill);
			CLPP_FUNC_GETTER(clEnqueueSVMMap);
			CLPP_FUNC_GETTER(clEnqueueSVMUnmap);
		#endif // defined(CL_VERSION_2_0)

			#undef CLPP_FUNC_GETTER

		private:
			std::experimental::string_view m_name;
		};
	}
}

#endif


text:
<?xml version="1.0" encoding="ISO-8859-1"?>

<Project>

	<Sources>
		<Source>gameworld.dependency.depmodule1.xml</Source>
		<Source>gameworld.dependency.depmodule2.xml</Source>
		<Source>gameworld.dependency.depmodule3.xml</Source>
	</Sources>

</Project>


text:
<?php echo $this->load->view('header_required');?>

<?php echo SITE_TITLE;?>

<?php echo $this->load->area('global_navigation');?>

<?php echo $this->load->area('main_image');?>

<?php echo set_content();?>

<address>Copyright © <?php echo date('Y');?> <?php echo prep_str(SITE_TITLE);?></address>

<?php echo $this->load->view('footer_required');?>


text:
package integration.client.entity.fatsecret;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the external.entity.fatsecret package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _Success_QNAME = new QName("http://platform.fatsecret.com/api/1.0/", "success");
    private final static QName _FoodEntryId_QNAME = new QName("http://platform.fatsecret.com/api/1.0/", "food_entry_id");
    private final static QName _Food_QNAME = new QName("http://platform.fatsecret.com/api/1.0/", "food");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: external.entity.fatsecret
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link Food }
     *
     */
    public Food createFood() {
        return new Food();
    }

    /**
     * Create an instance of {@link Foods }
     *
     */
    public Foods createFoods() {
        return new Foods();
    }

    /**
     * Create an instance of {@link Month }
     *
     */
    public Month createMonth() {
        return new Month();
    }

    /**
     * Create an instance of {@link Day }
     *
     */
    public Day createDay() {
        return new Day();
    }

    /**
     * Create an instance of {@link ExerciseEntries }
     *
     */
    public ExerciseEntries createExerciseEntries() {
        return new ExerciseEntries();
    }

    /**
     * Create an instance of {@link ExerciseEntry }
     *
     */
    public ExerciseEntry createExerciseEntry() {
        return new ExerciseEntry();
    }

    /**
     * Create an instance of {@link ExerciseTypes }
     *
     */
    public ExerciseTypes createExerciseTypes() {
        return new ExerciseTypes();
    }

    /**
     * Create an instance of {@link Exercise }
     *
     */
    public Exercise createExercise() {
        return new Exercise();
    }

    /**
     * Create an instance of {@link Profile }
     *
     */
    public Profile createProfile() {
        return new Profile();
    }

    /**
     * Create an instance of {@link FoodEntries }
     *
     */
    public FoodEntries createFoodEntries() {
        return new FoodEntries();
    }

    /**
     * Create an instance of {@link FoodEntry }
     *
     */
    public FoodEntry createFoodEntry() {
        return new FoodEntry();
    }

    /**
     * Create an instance of {@link Error }
     *
     */
    public Error createError() {
        return new Error();
    }

    /**
     * Create an instance of {@link Serving }
     *
     */
    public Serving createServing() {
        return new Serving();
    }

    /**
     * Create an instance of {@link Food.Servings }
     *
     */
    public Food.Servings createFoodServings() {
        return new Food.Servings();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://platform.fatsecret.com/api/1.0/", name = "success")
    public JAXBElement<Boolean> createSuccess(Boolean value) {
        return new JAXBElement<Boolean>(_Success_QNAME, Boolean.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Long }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://platform.fatsecret.com/api/1.0/", name = "food_entry_id")
    public JAXBElement<Long> createFoodEntryId(Long value) {
        return new JAXBElement<Long>(_FoodEntryId_QNAME, Long.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Food }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://platform.fatsecret.com/api/1.0/", name = "food")
    public JAXBElement<Food> createFood(Food value) {
        return new JAXBElement<Food>(_Food_QNAME, Food.class, null, value);
    }

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
W. Roxburgh, Fl. ind. 1:412. 1820

#### Original name
null

### Remarks
null


text:
from itertools import chain

from django.apps import apps

def check_generic_foreign_keys(app_configs=None, **kwargs):
    from .fields import GenericForeignKey

    if app_configs is None:
        models = apps.get_models()
    else:
        models = chain.from_iterable(app_config.get_models() for app_config in app_configs)
    errors = []
    fields = (
        obj for model in models for obj in vars(model).values()
        if isinstance(obj, GenericForeignKey)
    )
    for field in fields:
        errors.extend(field.check())
    return errors


text:
from daisychain.step import Step

class Marker(Step):
    def run(self):
        self.status.set_finished()


text:
#import <UIKit/UIKit.h>
#import "QRCodeReaderDelegate.h"

@interface ViewController : UIViewController <QRCodeReaderDelegate>

- (IBAction)scanAction:(id)sender;

@end


text:
namespace brynet { namespace base {

struct stack_s
{
    struct array_s* array;
    size_t element_size;

    size_t element_num;
    size_t front;
    size_t num;
};

static void stack_delete(struct stack_s* self)
{
    if (self == nullptr)
    {
        return;
    }

    if (self->array != nullptr)
    {
        array_delete(self->array);
        self->array = nullptr;
    }

    self->element_num = 0;
    self->front = 0;
    self->num = 0;
    free(self);
    self = nullptr;
}

static struct stack_s* stack_new(size_t num, size_t element_size)
{
    struct stack_s* ret = (struct stack_s*) malloc(sizeof(struct stack_s));
    if (ret == nullptr)
    {
        return nullptr;
    }

    ret->element_size = 0;
    ret->element_num = 0;
    ret->front = 0;
    ret->num = 0;
    ret->array = array_new(num, element_size);

    if (ret->array != nullptr)
    {
        ret->element_size = element_size;
        ret->element_num = num;
    }
    else
    {
        stack_delete(ret);
        ret = nullptr;
    }

    return ret;
}

static void stack_init(struct stack_s* self)
{
    self->front = 0;
    self->num = 0;
}

static size_t stack_num(struct stack_s* self)
{
    return self->num;
}

static bool stack_increase(struct stack_s* self, size_t increase_num)
{
    struct array_s* tmp = array_new(self->element_num + increase_num,
                                    self->element_size);
    if (tmp == nullptr)
    {
        return false;
    }

    {
        size_t current_num = self->element_num;
        size_t current_stack_num = stack_num(self);
        for (size_t i = 0; i < current_stack_num; ++i)
        {
            array_set(tmp, i, array_at(self->array, (self->front + i) % current_num));
        }

        self->front = 0;
        array_delete(self->array);
        self->array = tmp;
        self->element_num = array_num(self->array);
    }

    return true;
}

static size_t stack_size(struct stack_s* self)
{
    return self->element_num;
}

static bool stack_isfull(struct stack_s* self)
{
    return (self->num == self->element_num);
}

static bool stack_push(struct stack_s* self, const void* data)
{
    if (stack_isfull(self))
    {
        stack_increase(self, stack_size(self));
    }

    if (stack_isfull(self))
    {
        return false;
    }

    array_set(self->array, (self->front + self->num) % self->element_num, data);
    self->num++;
    return true;
}

static void* stack_front(struct stack_s* self)
{
    void* ret = nullptr;

    if (stack_num(self) > 0)
    {
        ret = array_at(self->array, self->front);
    }

    return ret;
}

static void* stack_popfront(struct stack_s* self)
{
    void* ret = stack_front(self);

    if (ret != nullptr)
    {
        self->num--;
        self->front++;
        self->front %= self->element_num;
    }

    return ret;
}

static void* stack_popback(struct stack_s* self)
{
    void* ret = nullptr;

    if (stack_num(self) > 0)
    {
        self->num--;
        ret = array_at(self->array, (self->front + self->num) % self->element_num);
    }

    return ret;
}

}}// namespace brynet::base


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.lemurproject</groupId>
    <artifactId>galago</artifactId>
    <version>3.9-SNAPSHOT</version>
  </parent>
  <groupId>org.lemurproject.galago</groupId>
  <artifactId>tupleflow</artifactId>
  <packaging>jar</packaging>
  <version>3.9-SNAPSHOT</version>
  <name>tupleflow</name>
  <url>http://lemurproject.org/galago.php</url>
  <description>TupleFlow is the distributed computation layer of Galago.</description>
  <licenses>
    <license>
      <name>BSD license</name>
      <url>http://lemurproject.org/galago-license.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:hg:http://lemur.hg.sourceforge.net:8000/hgroot/lemur/galago</connection>
    <developerConnection>scm:hg:ssh://USERNAME@lemur.hg.sourceforge.net/hgroot/lemur/galago</developerConnection>
    <url>http://lemur.hg.sourceforge.net/hgweb/lemur/galago/</url>
  </scm>
  <dependencies>
    <dependency>
      <groupId>net.sf.trove4j</groupId>
      <artifactId>trove4j</artifactId>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>utility</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.0</version>
    </dependency>
  </dependencies>
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.6</version>
      </plugin>
    </plugins>
  </reporting>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <!--<compilerArgument>-Xlint:unchecked</compilerArgument>-->
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.lemurproject.galago</groupId>
        <artifactId>tupleflow-typebuilder</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>typebuilder</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>


text:
from .base import *

DEBUG = True

ALLOWED_HOSTS = ['*']

SECRET_KEY = 'dev'

#
# Third app config
#

# Django debug toolbar

# INSTALLED_APPS.append('debug_toolbar')
# MIDDLEWARE_CLASSES.append('debug_toolbar.middleware.DebugToolbarMiddleware')
# INTERNAL_IPS = ['127.0.0.1']

# Sorl Thumbnail

THUMBNAIL_DEBUG = DEBUG


text:
package org.springframework.social.twitter.api.advertising;

import org.springframework.social.twitter.api.impl.DataListHolder;

/**
 * Interface defining the operations for advertising statistical operations.
 *
 * @author Hudson Mendes
 */
public interface TargetingCriteriaDiscoveryOperations {

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForAppStoreCategories}
     * @return an instance of {@link TargetingCriteriaDiscoveryForAppStoreCategories}
     */
    DataListHolder<TargetingCriteriaDiscoveryForAppStoreCategories> appStoreCategories(TargetingCriteriaDiscoveryForAppStoreCategoriesQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForDevices}
     * @return an instance of {@link TargetingCriteriaDiscoveryForDevices}
     */
    DataListHolder<TargetingCriteriaDiscoveryForDevices> devices(TargetingCriteriaDiscoveryForDevicesQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForEvents}
     * @return an instance of {@link TargetingCriteriaDiscoveryForEvents}
     */
    DataListHolder<TargetingCriteriaDiscoveryForEvents> events(TargetingCriteriaDiscoveryForEventsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForBehaviorTaxonomiesQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForBehaviorTaxonomies}
     */
    DataListHolder<TargetingCriteriaDiscoveryForBehaviorTaxonomies> behaviorTaxonomies(TargetingCriteriaDiscoveryForBehaviorTaxonomiesQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForBehaviorsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForBehaviors}
     */
    DataListHolder<TargetingCriteriaDiscoveryForBehaviors> behaviors(TargetingCriteriaDiscoveryForBehaviorsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForInterestsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForInterests}
     */
    DataListHolder<TargetingCriteriaDiscoveryForInterests> interests(TargetingCriteriaDiscoveryForInterestsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForLanguagesQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForLanguages}
     */
    DataListHolder<TargetingCriteriaDiscoveryForLanguages> languages(TargetingCriteriaDiscoveryForLanguagesQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForLocationsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForLocations}
     */
    DataListHolder<TargetingCriteriaDiscoveryForLocations> locations(TargetingCriteriaDiscoveryForLocationsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForNetworkOperatorsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForNetworkOperators}
     */
    DataListHolder<TargetingCriteriaDiscoveryForNetworkOperators> networkOperators(TargetingCriteriaDiscoveryForNetworkOperatorsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForPlatformVersionsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForPlatformVersions}
     */
    DataListHolder<TargetingCriteriaDiscoveryForPlatformVersions> platformVersions(TargetingCriteriaDiscoveryForPlatformVersionsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForPlatformsQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForPlatforms}
     */
    DataListHolder<TargetingCriteriaDiscoveryForPlatforms> platforms(TargetingCriteriaDiscoveryForPlatformsQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForTvShowQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForTvShow}
     */
    DataListHolder<TargetingCriteriaDiscoveryForTvShow> tvShow(TargetingCriteriaDiscoveryForTvShowQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForTvMarketQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForTvMarket}
     */
    DataListHolder<TargetingCriteriaDiscoveryForTvMarket> tvMarkets(TargetingCriteriaDiscoveryForTvMarketQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForTvGenreQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForTvGenre}
     */
    DataListHolder<TargetingCriteriaDiscoveryForTvGenre> tvGenres(TargetingCriteriaDiscoveryForTvGenreQuery query);

    /**
     * @param query builds the query for querying of {@link TargetingCriteriaDiscoveryForTvChannelQuery}
     * @return an instance of {@link TargetingCriteriaDiscoveryForTvChannel}
     */
    DataListHolder<TargetingCriteriaDiscoveryForTvChannel> tvChannels(TargetingCriteriaDiscoveryForTvChannelQuery query);
}


text:
from __future__ import absolute_import

import math

def _area_from_bbox(bbox):
    width = bbox[2] - bbox[0]
    height = bbox[3] - bbox[1]
    return width * height

def grid_coverage_ratio(bbox, srs, coverage):
    coverage = coverage.transform_to(srs)
    grid_area = _area_from_bbox(bbox)

    if coverage.geom:
        coverage_area = coverage.geom.area
    else:
        coverage_area = _area_from_bbox(coverage.bbox)

    return coverage_area / grid_area

def estimate_tiles(grid, levels, coverage=None):
    if coverage:
        ratio = grid_coverage_ratio(grid.bbox, grid.srs, coverage)
    else:
        ratio = 1

    tiles = 0
    for level in levels:
        grid_size = grid.grid_sizes[level]
        level_tiles = grid_size[0] * grid_size[1]
        level_tiles = int(math.ceil(level_tiles * ratio))

        tiles += level_tiles

    return tiles

if __name__ == '__main__':
    from mapproxy.srs import SRS
    from mapproxy.grid import tile_grid
    from mapproxy.util.coverage import BBOXCoverage

    print estimate_tiles(tile_grid(3857), levels=range(12), coverage=BBOXCoverage([5, 50, 10, 60], SRS(4326)))


text:
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.whirr</groupId>
    <artifactId>whirr</artifactId>
    <version>0.4.0-incubating-SNAPSHOT</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <groupId>org.apache.whirr</groupId>
  <artifactId>whirr-zookeeper</artifactId>
  <packaging>jar</packaging>
  <version>0.4.0-incubating-SNAPSHOT</version>
  <name>Apache Whirr ZooKeeper</name>
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>whirr-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>whirr-core</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jclouds</groupId>
      <artifactId>jclouds-allcompute</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jclouds</groupId>
      <artifactId>jclouds-compute</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jclouds</groupId>
      <artifactId>jclouds-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jclouds.driver</groupId>
      <artifactId>jclouds-enterprise</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jclouds.driver</groupId>
      <artifactId>jclouds-jsch</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jclouds.driver</groupId>
      <artifactId>jclouds-log4j</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-configuration</groupId>
      <artifactId>commons-configuration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jcraft</groupId>
      <artifactId>jsch</artifactId>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>zookeeper</artifactId>
      <version>3.3.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>