text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<string name="tab_1">Work Orders</string>
	<string name="tab_2">Map</string>
	<string name="tab_3">Messages</string>
	<string name="tab_4">History</string>
	<string name="territory_watcher">Territory Watcher</string>
    <string name="hello">Hello World, TabTestActivity!</string>
    <string name="app_name">Esri Route Monitor Mobile</string>
    <string name="act_workorders">Work Orders</string>
    <string name="act_navigation">Navigation</string>
    <string name="act_messages">Messages</string>
    <string name="act_history">History</string>
    <string name="act_exited_territory">Exited Territory</string>
    <string name="add_tip">Add Tip</string>
    <string name="add_picture">Picture</string>
    <string name="all_attributes">View All Attributes</string>
    <string name="complete">Complete</string>
    <string name="exception">Exception</string>
    <string name="workorders">Work Orders</string>
    <string name="tips">Tips</string>
    <string name="updates">Updates</string>
    <string name="update">Update</string>
    <string name="updateResult">Update Result</string>
    <string name="updateSucceeded">Update Succeeded</string>
    <string name="updateFailed">Update Failed</string>
    <string name="okButtonLabel">OK</string>
    <string name="photos">Photos</string>
    <string name="add_stop">Add stop</string>
    <string name="stop_type">Stop Type</string>
    <string name="stop_type_break">Break</string>
    <string name="use_start_time">Choose a Start Time</string>
    <string name="start_after_stop">Start After This Stop</string>
    <string name="add_stop_afer">Add Stop After</string>
    <string name="running_late_reason">Running Late Reason</string>
    <string name="exited_territory_reason">Exited Territory Reason</string>
    <string name="map">Map</string>
    <string name="refresh">Refresh</string>
    <string name="settings">Settings</string>
    <string name="addbreak">Add A Break</string>
    <string name="help">Help</string>
    <string name="controls_1_save">Save</string>
    <string name="controls_1_checkbox_1">Checkbox 1</string>
    <string name="controls_1_checkbox_2">Checkbox 2</string>
    <string name="controls_1_radiobutton_1">RadioButton 1</string>
    <string name="controls_1_radiobutton_2">RadioButton 2</string>
    <string name="controls_1_star">Star</string>
    <string name="textColorPrimary">textColorPrimary</string>
    <string name="textColorSecondary">textColorSecondary</string>
    <string name="textColorTertiary">textColorTertiary</string>
    <string name="listSeparatorTextViewStyle">listSeparatorTextViewStyle</string>
    <string name="meterReadLabel">Meter Read:</string>
    <string name="meterReadHint">Enter meter read</string>
    <string name="exceptionReasonPrompt">Select a remark for the status change:</string>
    <string name="please_wait">Please wait</string>
    <string name="please_acknowledge_dispatch">Please Acknowledge Dispatch</string>
    <string name="please_acknowledge">Please Acknowledge</string>
    <string name="acknowledge">Acknowledge</string>
    <string name="acknowledged">Acknowledged</string>
    <string name="dispatch_acknowledged">Dispatch Acknowledged</string>
    <string name="view_work_orders">View Work Orders</string>

<!--     <string name="KEY_SEQUENCE_NUMBER">sequence_number</string>
	<string name="KEY_STOP_NAME">stop_name</string>
	<string name="KEY_ROUTE_NAME">route_name</string>
	<string name="KEY_VEHICLE_NAME">vehicle_name</string>
	<string name="KEY_TYPE">type</string>
	<string name="KEY_STATUS">status</string>
	<string name="KEY_SCHEDULED_ARRIVAL">scheduled_arrival</string>
	<string name="KEY_PROJECTED_ARRIVAL">projected_arrival</string>
	<string name="KEY_PROJECTED_DEPARTURE">projected_departure</string>
	<string name="KEY_SCHEDULED_DEPARTURE">scheduled_departure</string>
	<string name="KEY_ACTUAL_ARRIVAL">actual_arrival</string>
	<string name="KEY_ACTUAL_DEPARTURE">actual_departure</string>
	<string name="KEY_SCHEDULED_DURATION">scheduled_service_duration</string>
	<string name="KEY_ADDRESS">address</string>
	<string name="KEY_PICTURE_LOCATION">picture_location</string>
	<string name="KEY_EXCEPTION_REASON">exception_reason</string>
	<string name="KEY_LAST_UPDATED">last_updated</string> -->

    <string name="ALIAS_STOPSLAYER_SEQUENCE">Sequence</string>
	<string name="ALIAS_STOPSLAYER_STOP_NAME">Stop</string>
	<string name="ALIAS_STOPSLAYER_ROUTE_NAME">Route Name</string>
	<!-- <string name="ALIAS_STOPSLAYER_VEHICLE_NAME">vehicle_name</string> -->
	<string name="ALIAS_STOPSLAYER_TYPE">Type</string>
	<string name="ALIAS_STOPSLAYER_STATUS">Status</string>
	<string name="ALIAS_STOPSLAYER_SCHEDULED_ARRIVAL">Scheduled Arrival</string>
	<string name="ALIAS_STOPSLAYER_PROJECTED_ARRIVAL">Projected Arrival</string>
	<string name="ALIAS_STOPSLAYER_PROJECTED_DEPARTURE">Projected Departure</string>
	<string name="ALIAS_STOPSLAYER_SCHEDULED_DEPARTURE">Scheduled Departure</string>
	<string name="ALIAS_STOPSLAYER_ACTUAL_ARRIVAL">Actual Arrival</string>
	<string name="ALIAS_STOPSLAYER_ACTUAL_DEPARTURE">Actual Departure</string>
	<string name="ALIAS_STOPSLAYER_ACTUAL_DURATION">Actual Duration</string>
	<string name="ALIAS_STOPSLAYER_SCHEDULED_DURATION">Scheduled Duration</string>
	<string name="ALIAS_STOPSLAYER_ADDRESS">Address</string>
	<string name="ALIAS_STOPSLAYER_PICTURE_LOCATION">Picture Location</string>
	<string name="ALIAS_STOPSLAYER_STATUS_REMARK">Status Remark</string>

	<string name="ALIAS_LAST_UPDATED">Last Updated</string>

	<!-- <string name="KEY_MESSAGE_ID">id</string>
    <string name="KEY_MESSAGE_TYPE">type</string>
    <string name="KEY_MESSAGE_SUBJECT">subject</string>
    <string name="KEY_MESSAGE_TIME">message_time</string>
    <string name="KEY_MESSAGE_FROM">message_from</string>
    <string name="KEY_MESSAGE_TO">message_to</string>
    <string name="KEY_MESSAGE_STATUS">status</string>
    <string name="KEY_MESSAGE_BODY">body</string>
    <string name="KEY_MESSAGE_CALLBACK">callback</string> -->

	<string name="ALIAS_MESSAGESLAYER_ID">ID</string>
    <string name="ALIAS_MESSAGESLAYER_TYPE">Type</string>
    <string name="ALIAS_MESSAGESLAYER_SUBJECT">Subject</string>
    <string name="ALIAS_MESSAGESLAYER_MESSAGE_TIME">MessageTime</string>
    <string name="ALIAS_MESSAGESLAYER_MESSAGE_FROM">MessageFrom</string>
    <string name="ALIAS_MESSAGESLAYER_MESSAGE_TO">MessageTo</string>
    <string name="ALIAS_MESSAGESLAYER_STATUS">Status</string>
    <string name="ALIAS_MESSAGESLAYER_BODY">Body</string>
    <string name="ALIAS_MESSAGESLAYER_CALLBACK">Callback</string>

    <string name="KEY_ACCOUNT_NAME_RA">Account Name</string>
    <string name="KEY_ROUTE_NAME_RA">Route Name</string>

    <string name="ALIAS_ROUTESLAYER_ROUTE">Route</string>
    <string name="ALIAS_ROUTESLAYER_Vehicle">Vehicle</string>
    <string name="ALIAS_ROUTESLAYER_Status">Dispatch Ack</string>

    <string name="ALIAS_VEHICLESSLAYER_Vehicle">Vehicle</string>

</resources>


text:
/* jshint latedef:false */
/* jshint forin:false */
/* jshint noempty:false */

'use strict';

const msRest = require('ms-rest');
const ServiceClient = msRest.ServiceClient;

const models = require('./models');
const operations = require('./operations');

/** Class representing a ContentModeratorAPIClient. */
class ContentModeratorAPIClient extends ServiceClient {
  /**
   * Create a ContentModeratorAPIClient.
   * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription.
   * @param {azureRegionBaseUrl} baseUrl - Supported Azure regions for Content Moderator endpoints. Possible values include: 'westus.api.cognitive.microsoft.com', 'westus2.api.cognitive.microsoft.com', 'eastus.api.cognitive.microsoft.com', 'eastus2.api.cognitive.microsoft.com', 'westcentralus.api.cognitive.microsoft.com', 'southcentralus.api.cognitive.microsoft.com', 'westeurope.api.cognitive.microsoft.com', 'northeurope.api.cognitive.microsoft.com', 'southeastasia.api.cognitive.microsoft.com', 'eastasia.api.cognitive.microsoft.com', 'australiaeast.api.cognitive.microsoft.com', 'brazilsouth.api.cognitive.microsoft.com', 'contentmoderatortest.azure-api.net'
   * @param {object} [options] - The parameter options
   * @param {Array} [options.filters] - Filters to be added to the request pipeline
   * @param {object} [options.requestOptions] - Options for the underlying request object
   * {@link https://github.com/request/request#requestoptions-callback Options doc}
   * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
   */
  constructor(credentials, baseUrl, options) {
    if (credentials === null || credentials === undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (baseUrl === null || baseUrl === undefined) {
      throw new Error('\'baseUrl\' cannot be null.');
    }

    if (!options) options = {};

    super(credentials, options);

    this.baseUri = 'https://{baseUrl}';
    this.credentials = credentials;
    this.baseUrl = baseUrl;

    let packageInfo = this.getPackageJsonInfo(__dirname);
    this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
    this.imageModeration = new operations.ImageModeration(this);
    this.textModeration = new operations.TextModeration(this);
    this.listManagementImageLists = new operations.ListManagementImageLists(this);
    this.listManagementTermLists = new operations.ListManagementTermLists(this);
    this.listManagementImage = new operations.ListManagementImage(this);
    this.listManagementTerm = new operations.ListManagementTerm(this);
    this.reviews = new operations.Reviews(this);
    this.models = models;
    msRest.addSerializationMixin(this);
  }

}

module.exports = ContentModeratorAPIClient;

redpajama_set_name: RedPajamaGithub


text: Yet another LeetCode solution


text:
package de.upb.crc901.wever.crcreal.model.automaton;

public class AbstractTransitionFunction {

}


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

<!--

 Copyright 2003 - 2016 The eFaps Team

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

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

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->

<ui-table xmlns="http://www.efaps.org/xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd">

    <uuid>be62c952-158f-4556-8157-bf3e68c24b19</uuid>
    <file-application>eFaps-Kernel</file-application>

    <definition>
        <version-expression>(version==latest)</version-expression>
        <name>Admin_Common_SystemConfigurationObjectAttributeTable</name>
        <!-- fields -->
        <field name="key">
            <property name="Attribute">Key</property>

            <property name="Label">Admin_Common_SystemConfigurationObjectAttribute/Key.Label</property>
            <property name="HRef">${COMMONURL}/MenuTree.jsp</property>
            <property name="ShowTypeIcon">true</property>
        </field>
        <field name="value">
            <property name="Attribute">Value</property>
            <property name="Label">Admin_Common_SystemConfigurationObjectAttribute/Value.Label</property>
        </field>
        <field name="description">
            <property name="Attribute">Description</property>
            <property name="Label">Admin_Common_SystemConfigurationObjectAttribute/Description.Label</property>
        </field>
        <field name="companyLink">
            <property name="Select">linkto[CompanyLink].attribute[Name]</property>
            <property name="Label">Admin_Common_SystemConfigurationObjectAttribute/CompanyLink.Label</property>
        </field>
    </definition>
</ui-table>


text:
package me.hugmanrique.pokedata.trainers;

import lombok.Getter;
import lombok.ToString;
import me.hugmanrique.pokedata.Data;
import me.hugmanrique.pokedata.roms.ROM;

/**
 * Aka Party member, Trainer's Pokémon representation
 * @author Hugmanrique
 * @since 02/06/2017
 */
@Getter
@ToString
public class TrainerPokemon extends Data {
    private int evs;
    private int species;
    private int level;
    private int heldItem;
    private int[] attacks;

    public TrainerPokemon(ROM rom, Trainer trainer) {
        evs = rom.readWord();
        level = rom.readWord();
        species = rom.readWord();

        if (trainer.isHeldsItems()) {
            heldItem = rom.readWord();
        }

        if (trainer.isCustomAttacks()) {
            attacks = new int[4];

            for (int j = 0; j < 4; j++) {
                attacks[j] = rom.readWord();
            }
        }

        if (!trainer.isHeldsItems()) {
            rom.addInternalOffset(2);
        }
    }
}


text:
package org.apache.camel.processor.jpa;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.examples.SendEmail;
import org.apache.camel.spring.SpringRouteBuilder;
import org.junit.Test;

/**
 * @version
 */
public class JpaPreConsumedTest extends AbstractJpaTest {
    protected static final String SELECT_ALL_STRING = "select x from " + SendEmail.class.getName() + " x";

    @Test
    public void testPreConsumed() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.sendBody("direct:start", new SendEmail("dummy"));

        assertMockEndpointsSatisfied();

        // @PreConsumed should change the dummy address
        SendEmail email = mock.getReceivedExchanges().get(0).getIn().getBody(SendEmail.class);
        assertEquals("dummy@somewhere.org", email.getAddress());
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() {
                from("direct:start").to("jpa://" + SendEmail.class.getName());

                from("jpa://" + SendEmail.class.getName()).to("mock:result");
            }
        };
    }

    @Override
    protected String routeXml() {
        return "org/apache/camel/processor/jpa/springJpaRouteTest.xml";
    }

    @Override
    protected String selectAllString() {
        return SELECT_ALL_STRING;
    }
}


text:
'use strict';

const fs = require('fs');

const _ = require('lodash');
const Wreck = require('wreck');
const Subtext = require('subtext');

const common = require('../../common');

const internals = {};

internals.defaults = {
    payload: {
        output: 'data',
        parse: false
    },

    handler: function (request, reply) {

        const tmp = 'test/tmp/file';

        const options = {
            output: 'data',
            parse: true
        };

        const done = function (err) {

            if (err) {
                return reply(err);
            }

            return reply();
        };

        const save = function (buffer) {

            return function (err, fd) {

                if (err) {
                    return reply(err);
                }

                fs.write(fd, buffer, 0, buffer.length, 0, done);
            };
        };

        const open = function (err, parsed) {

            if (err) {
                return reply(err);
            }

            fs.open(tmp, 'w+', save(parsed.payload.file));
        };

        const stream = Wreck.toReadableStream(request.payload);
        stream.headers = request.headers;

        Subtext.parse(stream, null, options, open);
    }
};

exports.boostrap = function (options, fn) {

    options = _.isFunction(arguments[1]) ? arguments[0] : {};
    fn = _.isFunction(arguments[1]) ? arguments[1] : arguments[0];

    common.boostrap(internals.defaults, options, fn);
};


text:
define([
  'src/uri'
], function (
  URI
) {
  describe('URI()', function () {
    it('is a function', function () {
      expect(URI).to.be.a('function');
    });

    it('is a constructor', function () {
      expect(new URI()).to.be.instanceof(URI);
    });

    it('works without the \'new\' keyword', function () {
      expect(URI()).to.be.instanceof(URI);
    });

    describe('with a string', function () {
      var testUri = 'http://www.foo.bar/baz';

      beforeEach(function () {
        sinon.stub(URI, 'parse');
        URI.parse.reset();
      });

      afterEach(function () {
        URI.parse.restore();
      });

      it('parses the string', function () {
        URI(testUri);
        expect(URI.parse).to.have.been.calledWith(testUri);
      });

      it('extends the new instance with data from the given uri', function () {
        URI.parse.returns({
          scheme : 'http',
          authority : 'www.foo.bar',
          path : '/baz'
        });

        var uri = URI(testUri);
        expect(uri.scheme).to.equal('http');
        expect(uri.authority).to.equal('www.foo.bar');
        expect(uri.path).to.equal('/baz');
      });
    }); // with a string

    describe('with an object', function () {
      it('extends the new instance with data from the object', function () {
        var uri = URI({
          scheme : 'http',
          authority : 'foo.bar'
        });

        expect(uri.scheme).to.equal('http');
        expect(uri.authority).to.equal('foo.bar');
      });
    }); // with an object

    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    describe('data attribute', function () {
      var
        ATTRIBUTES,
        attr,
        len,
        i;

      ATTRIBUTES = [
        'scheme',
        'authority',
        'path',
        'query',
        'fragment',
        'userinfo',
        'ip',
        'ipv4',
        'ipv6',
        'hostname'
      ];

      function describeUriAttribute(attr) {
        return function () {
          it('is accessible', function () {
            var uri = URI();
            expect(uri[attr]).not.to.be.undefined;
          });

          it('is null by default', function () {
            var uri = URI();
            expect(uri[attr]).to.be.null;
          });
        };
      }

      for (i = 0, len = ATTRIBUTES.length; i < len; i += 1) {
        attr = ATTRIBUTES[i];
        describe('.' + attr, describeUriAttribute(attr));
      }

    }); // data attributes

    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    describe('.parseAuthority()', function () {
      it('is accessible', function () {
        expect(URI.parseAuthority).to.exist;
      });

      it('is a function', function () {
        expect(URI.parseAuthority).to.be.a('function');
      });

      it('parses user info', function () {
        var result = URI.parseAuthority('user:info@localhost');
        expect(result.userinfo).to.be.defined;
        expect(result.userinfo).to.equal('user:info');
      });

      it('parses hostname', function () {
        var
          withTld,
          localhost,
          withSubdomain;

        withTld = URI.parseAuthority('userinfo@foo.bar:80');
        localhost = URI.parseAuthority('userinfo@localhost:80');
        withSubdomain = URI.parseAuthority('userinfo@baz.foo.bar:80');

        expect(withTld.hostname).to.equal('foo.bar');
        expect(localhost.hostname).to.equal('localhost');
        expect(withSubdomain.hostname).to.equal('baz.foo.bar');

        expect(withTld.ip).to.be.undefined;
        expect(localhost.ip).to.be.undefined;
        expect(withSubdomain.ip).to.be.undefined;
      });

      it('parses ipv4', function () {
        var result = URI.parseAuthority('userinfo@127.0.0.1:80');
        expect(result.ipv4).to.equal('127.0.0.1');
        expect(result.ip).to.equal(result.ipv4);
        expect(result.ipv6).to.be.undefined;
        expect(result.hostname).to.be.undefined;
      });

      it('parses ipv6', function () {
        var result = URI.parseAuthority('userinfo@[ffff::ffff]:80');
        expect(result.ipv6).to.equal('ffff::ffff');
        expect(result.ip).to.equal(result.ipv6);
        expect(result.ipv4).to.be.undefined;
        expect(result.hostname).to.be.undefined;
      });

      it('parses port', function () {
        var
          withHostname,
          withIPv4,
          withIPv6;

        withHostname = URI.parseAuthority('localhost:80');
        withIPv4 = URI.parseAuthority('127.0.0.1:80');
        withIPv6 = URI.parseAuthority('[ffff::ffff]:80');

        expect(withHostname.port).to.equal(80);
        expect(withIPv4.port).to.equal(80);
        expect(withIPv6.port).to.equal(80);

        expect(withHostname.port).to.be.a('number');
        expect(withIPv4.port).to.be.a('number');
        expect(withIPv6.port).to.be.a('number');
      });

      it('returns an object', function () {
        expect(URI.parseAuthority('userinfo@foo.bar:80')).to.be.an('object');
        expect(URI.parseAuthority('')).to.be.an('object');
        expect(URI.parseAuthority()).to.be.an('object');
      });
    }); // .parseAuthority()

    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    describe('.parseQueryString()', function () {

      var qString = 'foo=foo1&bar=bar&baz=baz&foo=foo2';

      it('is accessible', function () {
        expect(URI.parseQueryString).to.exist;
      });

      it('is a function', function () {
        expect(URI.parseQueryString).to.be.a('function');
      });

      it('sets an array of values for each key', function () {
        var query = URI.parseQueryString(qString);
        expect(query.foo).to.be.instanceof(Array);
        expect(query.bar).to.be.instanceof(Array);
        expect(query.baz).to.be.instanceof(Array);
      });

      it('allows the occurrence of the equal sign (\'=\') in the value',
        function () {
          var query = URI.parseQueryString('foo=bar=baz');
          expect(query.foo).to.eql(['bar=baz']);
        });

      it('allows multiple values for the same key', function () {
        var query = URI.parseQueryString(qString);
        expect(query.foo).to.have.length(2);
        expect(query.bar).to.have.length(1);
        expect(query.baz).to.have.length(1);
        expect(query.foo).to.eql(['foo1', 'foo2']);
      });

      it('sets an empty array for the key if it has no assignment',
        function () {
          var query = URI.parseQueryString('foo&bar=bar');
          expect(query.foo).to.have.length(0);
          expect(query.bar).to.have.length(1);
        });

      it('sets an empty string as value if it has no value assigned',
        function () {
          var query = URI.parseQueryString('foo=&bar=bar');
          expect(query.foo).to.have.length(1);
          expect(query.foo).to.eql(['']);
          expect(query.bar).to.have.length(1);
          expect(query.bar).to.eql(['bar']);
        });

      it('returns an object', function () {
        expect(URI.parseQueryString('foo&bar=bar')).to.be.an('object');
      });

      it('returns an object if the querystring is empty', function () {
        expect(URI.parseQueryString('')).to.be.an('object');
      });

      it('returns an empty object if no querystring is given', function () {
        expect(URI.parseQueryString()).to.be.an('object');
        expect(URI.parseQueryString()).to.eql({});
        expect(URI.parseQueryString(null)).to.be.an('object');
        expect(URI.parseQueryString(null)).to.eql({});
      });
    }); // .parseQueryString()

    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    describe('.parse()', function () {
      var
        sampleUri,
        parsedUri;

      sampleUri = 'http://userinfo@localhost:80/path?q=foo#fragment';

      beforeEach(function () {
        parsedUri = URI.parse(sampleUri);
      });

      it('is accessible', function () {
        expect(URI.parse).to.be.defined;
      });

      it('is a function', function () {
        expect(URI.parse).to.be.a('function');
      });

      it('parses the authority', function () {
        expect(parsedUri.authority).to.be.defined;
        expect(parsedUri.authority).to.equal('userinfo@localhost:80');
        expect(parsedUri.userinfo).to.be.defined;
        expect(parsedUri.userinfo).to.equal('userinfo');
        expect(parsedUri.hostname).to.be.defined;
        expect(parsedUri.hostname).to.equal('localhost');
        expect(parsedUri.port).to.be.defined;
        expect(parsedUri.port).to.equal(80);
      });

      it('parses the scheme (protocol)', function () {
        expect(parsedUri.scheme).to.be.defined;
        expect(parsedUri.scheme).to.equal('http');
      });

      it('parses the path', function () {
        expect(parsedUri.path).to.be.defined;
        expect(parsedUri.path).to.equal('/path');
      });

      it('parses the query', function () {
        expect(parsedUri.query).to.be.defined;
        expect(parsedUri.query).to.be.an('object');
        expect(parsedUri.query).to.eql({q : ['foo']});
      });

      it('parses the fragment', function () {
        expect(parsedUri.fragment).to.be.defined;
        expect(parsedUri.fragment).to.equal('fragment');
      });

      it('returns an object', function () {
        expect(URI.parse('')).to.be.an('object');
        expect(URI.parse('')).to.eql({});

        expect(URI.parse()).to.be.an('object');
        expect(URI.parse()).to.eql({});
      });
    }); // .parse()
  });
});


text:
title: "ArgData API: PitCrewColorWriter Class"
---

[API Reference](/argdata/api/) > [0.21](/argdata/api/0.21/) > PitCrewColorWriter

# PitCrewColorWriter Class

Writes pit crew colors of one or more teams.

**Namespace:** ArgData

## Constructors

    Name
    Description

    PitCrewColorWriter(GpExeFile exeFile)
    Creates a PitCrewColorWriter for the specified GP.EXE file.
exeFile: GpExeFile to read from.

## Methods

    Name
    Description

    For(GpExeFile exeFile)
    Creates a PitCrewColorWriter for the specified GP.EXE file.
exeFile: GpExeFile to read from.

    WritePitCrewColors(PitCrew pitCrew, Int32 teamIndex)
    Writes pit crew colors for a team.
pitCrew: PitCrew with colors to write.
teamIndex: Index of the team to write the colors for.

    WritePitCrewColors(PitCrewList pitCrewList)
    Writes pit crew colors for all the teams.
pitCrewList: PitCrewList with colors to write.


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

#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/signed_exchange_browser_test_helper.h"

class SignedExchangePolicyBrowserTest : public CertVerifierBrowserTest {
 public:
  SignedExchangePolicyBrowserTest() = default;

  SignedExchangePolicyBrowserTest(const SignedExchangePolicyBrowserTest&) =
      delete;
  SignedExchangePolicyBrowserTest& operator=(
      const SignedExchangePolicyBrowserTest&) = delete;

  ~SignedExchangePolicyBrowserTest() override = default;

 protected:
  void PreRunTestOnMainThread() override {
    InProcessBrowserTest::PreRunTestOnMainThread();
    sxg_test_helper_.InstallMockCert(mock_cert_verifier());
    sxg_test_helper_.InstallMockCertChainInterceptor();
  }

  void SetUpInProcessBrowserTestFixture() override {
    CertVerifierBrowserTest::SetUpInProcessBrowserTestFixture();
    policy_provider_.SetDefaultReturns(
        /*is_initialization_complete_return=*/true,
        /*is_first_policy_load_complete_return=*/true);
    policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
        &policy_provider_);
  }

  testing::NiceMock<policy::MockConfigurationPolicyProvider> policy_provider_;

 private:
  void SetUp() override {
    sxg_test_helper_.SetUp();
    InProcessBrowserTest::SetUp();
  }

  void TearDownOnMainThread() override {
    sxg_test_helper_.TearDownOnMainThread();
  }

  content::SignedExchangeBrowserTestHelper sxg_test_helper_;
};

IN_PROC_BROWSER_TEST_F(SignedExchangePolicyBrowserTest, BlockList) {
  embedded_test_server()->ServeFilesFromSourceDirectory("content/test/data");
  ASSERT_TRUE(embedded_test_server()->Start());

  const GURL inner_url("https://test.example.org/test/");
  const GURL url =
      embedded_test_server()->GetURL("/sxg/test.example.org_test.sxg");

  std::u16string expected_title(base::UTF8ToUTF16(inner_url.spec()));
  content::WebContents* contents =
      browser()->tab_strip_model()->GetActiveWebContents();
  content::TitleWatcher title_watcher(contents, expected_title);
  ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url));
  EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());

  base::ListValue blocklist;
  blocklist.Append("test.example.org");
  policy::PolicyMap policies;
  policies.Set(policy::key::kURLBlocklist, policy::POLICY_LEVEL_MANDATORY,
               policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
               blocklist.Clone(), nullptr);

#if BUILDFLAG(IS_CHROMEOS)
  policy::SetEnterpriseUsersProfileDefaults(&policies);
#endif
  policy_provider_.UpdateChromePolicy(policies);
  base::RunLoop loop;
  loop.RunUntilIdle();

  // Updates of the URLBlocklist are done on IO, after building the blocklist
  // on the blocking pool, which is initiated from IO.
  content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
  content::RunAllTasksUntilIdle();
  content::RunAllPendingInMessageLoop(content::BrowserThread::IO);

  ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url));

  std::u16string blocked_page_title(u"test.example.org");
  EXPECT_EQ(blocked_page_title, contents->GetTitle());

  // Verify that the expected error page is being displayed.
  bool result = false;
  EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
      contents,
      "var textContent = document.body.textContent;"
      "var hasError = textContent.indexOf('ERR_BLOCKED_BY_ADMINISTRATOR') >= 0;"
      "domAutomationController.send(hasError);",
      &result));
  EXPECT_TRUE(result);
}


text:
package com.ryan.controller.system;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ryan.dto.ResourceDTO;
import com.ryan.service.ResourceService;
import com.ryan.vo.TreeNode;

@Controller
@RequestMapping("/resource")
public class ResourceController {

	private static final Logger log = LoggerFactory.getLogger(ResourceController.class);

	@Autowired
	private ResourceService resourceService;

	@RequestMapping("/index")
	public String index() {
		return "resource/index";
	}

	@RequestMapping(value = "/list")
	@ResponseBody
	public Map<String, Object> getList(Integer draw, Integer start, Integer length, Long id) {
		log.info("draw: {},start: {},length: {}", draw, start, length);
		List<ResourceDTO> resourceDTOs = resourceService.findByParentId(id);
		Map<String, Object> result = new HashMap<>();
		result.put("draw", draw);
		result.put("data", resourceDTOs);
		result.put("recordsTotal", resourceDTOs.size());
		result.put("recordsFiltered", resourceDTOs.size());
		return result;
	}

	@RequestMapping(value = "/{id}")
	public String show(Model model, @PathVariable Long id) {
		ResourceDTO resourceDTO = resourceService.findByPrimaryKey(id);
		model.addAttribute("resource", resourceDTO);
		return "resource/view";
	}

	@RequestMapping("/new")
	public String create() {
		return "resource/new";
	}

	@PostMapping("/new")
	@ResponseBody
	public String save(ResourceDTO resourceDTO) {
		resourceDTO.setCreateTime(new Date());
		resourceService.save(resourceDTO);
		log.info("新增id:{}", resourceDTO.getId());
		return "1";
	}

	@RequestMapping(value = "/update/{id}")
	public String update(Model model, @PathVariable Long id) {
		ResourceDTO resourceDTO = resourceService.findByPrimaryKey(id);
		model.addAttribute("resource", resourceDTO);
		return "resource/edit";
	}

	@PostMapping("/update")
	@ResponseBody
	public String update(ResourceDTO resourceDTO) {
		resourceDTO.setUpdateTime(new Date());
		resourceService.save(resourceDTO);
		log.info("更新id:{}", resourceDTO.getId());
		return "1";
	}

	@RequestMapping(value = "/delete/{id}", method = RequestMethod.GET)
	@ResponseBody
	public String delete(@PathVariable Long id) throws Exception {
		resourceService.deleteByPrimaryKey(id);
		log.info("删除->ID=" + id);
		return "1";
	}

	@GetMapping("/treeChildren")
	@ResponseBody
	public List<TreeNode> tree(@RequestParam Long parent) {
		log.info("parent: {}", parent);
		Map<String, Boolean> state = new HashMap<>();
		state.put("opened", false);
		List<TreeNode> result = new ArrayList<>();
		List<ResourceDTO> childrenResourceDTOs = resourceService.findByParentId(parent);
		for (ResourceDTO resourceDTO : childrenResourceDTOs) {
			List<ResourceDTO> resources = resourceService.findByParentId(resourceDTO.getId());
			result.add(new TreeNode(resourceDTO.getId(), resourceDTO.getParentId(), resourceDTO.getName(),
					CollectionUtils.isEmpty(resources) ? "fa fa-file icon-state-warning icon-lg" : "fa fa-folder icon-state-warning icon-lg",
					CollectionUtils.isEmpty(resources) ? false : true, state));
		}
		return result;
	}

	@GetMapping("/treeRoot")
	@ResponseBody
	public Map<String, Object> tree(@RequestParam String parent) {
		Map<String, Object> result = new HashMap<>();
		Long rootId = 1l;
		ResourceDTO rootResourceDTO = resourceService.findByPrimaryKey(rootId);
		result.put("id", "1");
		result.put("parent", "#");
		result.put("text", rootResourceDTO.getName());
		result.put("icon", "fa fa-home icon-state-warning icon-lg");
		result.put("children", true);
		Map<String, Boolean> state = new HashMap<>();
		state.put("opened", true);
		result.put("state", state);
		return result;
	}
}


text:
# TDTouchID

TDTouchID是一个封装好的指纹验证、人脸验证库,可以用来做iOSAPP的登录/支付等验证。

#预览
![(preview)](IMG_3457.PNG)

![(preview-Gif)](FaceID.gif)

#安装方式
使用Cocoa Pods安装
```
pod 'TDTouchID', '~> 1.0.4'

```
手动导入

下载本项目,导入子层`TDTouchID`文件夹.(里面包含`TDTouchID.h`和`TDTouchID.m`)文件

* 导入`#import "TDTouchID.h"`即可使用

哎,真香

#如何使用
```
/**
 启动生物验证

 @param desc Touch显示的描述
 @param block 回调状态的block
 */
- (void)td_showTouchIDWithDescribe:(NSString *)desc BlockState:(StateBlock)block;

/**
 启动生物验证
 @param desc Touch显示的描述
 @param faceDesc FaceID状态下显示的描述
 @param block 回调状态的block
 */
- (void)td_showTouchIDWithDescribe:(NSString *)desc FaceIDDescribe:(NSString *)faceDesc BlockState:(StateBlock)block;

// 判断设备支持哪种认证方式 TouchID & FaceID
- (TDTouchIDSupperType)td_canSupperBiometrics;

```

```
    //判断是否支持生物验证(此处根据不同类型来显示不同的图标)
    TDTouchIDSupperType type = [[TDTouchID sharedInstance] td_canSupperBiometrics];
    switch (type) {
        case TDTouchIDSupperTypeFaceID:
            NSLog(@"😄支持FaceID");
            break;
        case TDTouchIDSupperTypeTouchID:
            NSLog(@"😄支持TouchID");
            break;
        case TDTouchIDSupperTypeNone:
            NSLog(@"😭不支持生物验证");
            break;
        default:
            break;
    }
```

```
[[TDTouchID sharedInstance] td_showTouchIDWithDescribe:@"通过Home键验证已有指纹" FaceIDDescribe:@"通过已有面容ID验证" BlockState:^(TDTouchIDState state, NSError *error) {
        if (state == TDTouchIDStateNotSupport) {    //不支持TouchID/FaceID

            UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:@"当前设备不支持生物验证" message:@"请输入密码来验证" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
            alertview.alertViewStyle = UIAlertViewStyleSecureTextInput;
            [alertview show];

        } else if (state == TDTouchIDStateSuccess) {    //TouchID/FaceID验证成功

            NSLog(@"jump");
            TDHomeViewController *homeVc = [[TDHomeViewController alloc] init];
            [self.navigationController pushViewController:homeVc animated:YES];

        } else if (state == TDTouchIDStateInputPassword) { //用户选择手动输入密码

            UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:nil message:@"请输入密码" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
            alertview.alertViewStyle = UIAlertViewStyleSecureTextInput;
            [alertview show];

        }

        // ps:以上的状态处理并没有写完全!
        // 在使用中你需要根据回调的状态进行处理,需要处理什么就处理什么

    }];
```

详细使用方法参见Demo即可


text:
import github

# until projects make it into pygithub
class MonkeyPatchedRepo(github.Repository.Repository):
    def get_projects(self):
        return github.PaginatedList.PaginatedList(
            GitHubProject,
            self._requester,
            self.url + "/projects",
            None,
            headers={"Accept": "application/vnd.github.inertia-preview+json"},
        )

    def get_project(self, id):
        assert isinstance(id, int), id
        url = "%s/projects/%d" % (github.MainClass.DEFAULT_BASE_URL, id)
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            url,
            headers={"Accept": "application/vnd.github.inertia-preview+json"},
        )
        return GitHubProject(self._requester, headers, data, completed=True)

class GitHubProject(github.GithubObject.CompletableGithubObject):
    def __repr__(self):
        return self.get__repr__({"id": self._id.value, "name": self._name.value})

    @property
    def owner_url(self):
        self._completeIfNotSet(self._owner_url)
        return self._owner_url.value

    @property
    def url(self):
        self._completeIfNotSet(self._url)
        return self._url.value

    @property
    def html_url(self):
        self._completeIfNotSet(self._html_url)
        return self._html_url.value

    @property
    def columns_url(self):
        self._completeIfNotSet(self._columns_url)
        return self._columns_url.value

    @property
    def id(self):
        self._completeIfNotSet(self._id)
        return self._id.value

    @property
    def name(self):
        self._completeIfNotSet(self._name)
        return self._name.value

    @property
    def body(self):
        self._completeIfNotSet(self._body)
        return self._body.value

    @property
    def number(self):
        self._completeIfNotSet(self._number)
        return self._number.value

    @property
    def state(self):
        self._completeIfNotSet(self._state)
        return self._state.value

    @property
    def creator(self):
        self._completeIfNotSet(self._creator)
        return self._creator.value

    @property
    def created_at(self):
        self._completeIfNotSet(self._created_at)
        return self._created_at.value

    @property
    def updated_at(self):
        self._completeIfNotSet(self._updated_at)
        return self._updated_at.value

    def get_columns(self):
        return github.PaginatedList.PaginatedList(
            GitHubProjectColumn,
            self._requester,
            self.url + "/columns",
            None,
            headers={"Accept": "application/vnd.github.inertia-preview+json"},
        )

    def get_column(self, id):
        url = "%s/projects/columns/%d" % (github.MainClass.DEFAULT_BASE_URL, id)
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            url,
            headers={"Accept": "application/vnd.github.inertia-preview+json"},
        )
        return GitHubProjectColumn(self._requester, headers, data, completed=True)

    def _initAttributes(self):
        self._owner_url = github.GithubObject.NotSet
        self._url = github.GithubObject.NotSet
        self._html_url = github.GithubObject.NotSet
        self._columns_url = github.GithubObject.NotSet
        self._id = github.GithubObject.NotSet
        self._name = github.GithubObject.NotSet
        self._body = github.GithubObject.NotSet
        self._number = github.GithubObject.NotSet
        self._state = github.GithubObject.NotSet
        self._creator = github.GithubObject.NotSet
        self._created_at = github.GithubObject.NotSet
        self._updated_at = github.GithubObject.NotSet

    def _useAttributes(self, attributes):
        if "owner_url" in attributes:
            self._owner_url = self._makeStringAttribute(attributes["owner_url"])
        if "url" in attributes:
            self._url = self._makeStringAttribute(attributes["url"])
        if "html_url" in attributes:
            self._html_url = self._makeStringAttribute(attributes["html_url"])
        if "columns_url" in attributes:
            self._columns_url = self._makeStringAttribute(attributes["columns_url"])
        if "id" in attributes:
            self._id = self._makeIntAttribute(attributes["id"])
        if "name" in attributes:
            self._name = self._makeStringAttribute(attributes["name"])
        if "body" in attributes:
            self._body = self._makeStringAttribute(attributes["body"])
        if "number" in attributes:
            self._number = self._makeIntAttribute(attributes["number"])
        if "state" in attributes:
            self._state = self._makeStringAttribute(attributes["state"])
        if "creator" in attributes:
            self._creator = self._makeClassAttribute(
                github.NamedUser.NamedUser, attributes["creator"]
            )
        if "created_at" in attributes:
            self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
        if "updated_at" in attributes:
            self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])

class GitHubProjectColumn(github.GithubObject.CompletableGithubObject):
    def __repr__(self):
        return self.get__repr__({"id": self._id.value, "name": self._name.value})

    @property
    def id(self):
        self._completeIfNotSet(self._id)
        return self._id.value

    @property
    def name(self):
        self._completeIfNotSet(self._name)
        return self._name.value

    @property
    def url(self):
        self._completeIfNotSet(self._url)
        return self._url.value

    @property
    def project_url(self):
        self._completeIfNotSet(self._project_url)
        return self._project_url.value

    @property
    def cards_url(self):
        self._completeIfNotSet(self._cards_url)
        return self._cards_url.value

    @property
    def created_at(self):
        self._completeIfNotSet(self._created_at)
        return self._created_at.value

    @property
    def updated_at(self):
        self._completeIfNotSet(self._updated_at)
        return self._updated_at.value

    def create_card_for_issue(self, issue_id):
        assert isinstance(issue_id, int), issue_id
        post_parameters = {"content_id": issue_id, "content_type": "Issue"}
        url = "%s/projects/columns/%d/cards" % (
            github.MainClass.DEFAULT_BASE_URL,
            self.id,
        )
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            self.url + "/cards",
            input=post_parameters,
            headers={"Accept": "application/vnd.github.inertia-preview+json"},
        )

    def _initAttributes(self):
        self._id = github.GithubObject.NotSet
        self._name = github.GithubObject.NotSet
        self._url = github.GithubObject.NotSet
        self._project_url = github.GithubObject.NotSet
        self._cards_url = github.GithubObject.NotSet
        self._created_at = github.GithubObject.NotSet
        self._updated_at = github.GithubObject.NotSet

    def _useAttributes(self, attributes):
        if "id" in attributes:
            self._id = self._makeIntAttribute(attributes["id"])
        if "name" in attributes:
            self._name = self._makeStringAttribute(attributes["name"])
        if "url" in attributes:
            self._url = self._makeStringAttribute(attributes["url"])
        if "project_url" in attributes:
            self._project_url = self._makeStringAttribute(attributes["project_url"])
        if "cards_url" in attributes:
            self._cards_url = self._makeStringAttribute(attributes["cards_url"])
        if "created_at" in attributes:
            self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
        if "updated_at" in attributes:
            self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])

github.Repository.Repository = MonkeyPatchedRepo

from github import *


text:
#include "stdafx.h"

#include "phcharacter.h"
#include "PHDynamicData.h"
#include "Physics.h"
#include "ExtendedGeom.h"
#include "iphysicsshellholder.h"

#include "../xrEngine/cl_intersect.h"
#include "../xrEngine/gamemtllib.h"

#include "tri-colliderKNoOPC\__aabb_tri.h"
#include "ode/ode/src/util.h"
#include "ph_valid_ode.h"
#include "Phaicharacter.h"
#include "phactorcharacter.h"

CPHCharacter::CPHCharacter(void) : CPHDisablingTranslational() {

    m_params.acceleration = 0.001f;
    m_params.velocity = 0.0001f;
    m_body = NULL;
    m_safe_velocity[0] = 0.f;
    m_safe_velocity[1] = 0.f;
    m_safe_velocity[2] = 0.f;
    m_mean_y = 0.f;
    m_new_restriction_type = m_restriction_type = rtNone;
    b_actor_movable = true;
    p_lastMaterialIDX = &lastMaterialIDX;
    lastMaterialIDX = GAMEMTL_NONE_IDX;
    injuriousMaterialIDX = GAMEMTL_NONE_IDX;
    m_creation_step = u64(-1);
    b_in_touch_resrtrictor = false;
    m_current_object_radius = -1.f;
}

CPHCharacter::~CPHCharacter(void) {}

void CPHCharacter::FreezeContent() {

    dBodyDisable(m_body);
    CPHObject::FreezeContent();
}
void CPHCharacter::UnFreezeContent() {

    dBodyEnable(m_body);
    CPHObject::UnFreezeContent();
}
void CPHCharacter::getForce(Fvector& force) {
    if (!b_exist)
        return;
    force.set(*(Fvector*)dBodyGetForce(m_body));
}
void CPHCharacter::setForce(const Fvector& force) {
    if (!b_exist)
        return;
    dBodySetForce(m_body, force.x, force.y, force.z);
}

void CPHCharacter::get_State(SPHNetState& state) {
    GetPosition(state.position);
    m_body_interpolation.GetPosition(state.previous_position, 0);
    GetVelocity(state.linear_vel);
    getForce(state.force);

    state.angular_vel.set(0.f, 0.f, 0.f);
    state.quaternion.identity();
    state.previous_quaternion.identity();
    state.torque.set(0.f, 0.f, 0.f);
    //	state.accel = GetAcceleration();
    //	state.max_velocity = GetMaximumVelocity();

    if (!b_exist) {
        state.enabled = false;
        return;
    }
    state.enabled = CPHObject::is_active(); //!!dBodyIsEnabled(m_body);
}
void CPHCharacter::set_State(const SPHNetState& state) {
    m_body_interpolation.SetPosition(state.previous_position, 0);
    m_body_interpolation.SetPosition(state.position, 1);
    SetPosition(state.position);
    SetVelocity(state.linear_vel);
    setForce(state.force);

    //	SetAcceleration(state.accel);
    //	SetMaximumVelocity(state.max_velocity);

    if (!b_exist)
        return;
    if (state.enabled) {
        Enable();
    };
    if (!state.enabled) {
        Disable();
    };
    VERIFY2(dBodyStateValide(m_body), "WRONG BODYSTATE WAS SET");
}

void CPHCharacter::Disable() {

    CPHObject::deactivate();
    dBodyDisable(m_body);
    m_body_interpolation.ResetPositions();
}

void CPHCharacter::Enable() {
    if (!b_exist)
        return;
    CPHObject::activate();
    dBodyEnable(m_body);
}

void CarHitCallback(bool& /**do_colide/**/, dContact& /**c/**/) {}

void CPHCharacter::GetSavedVelocity(Fvector& vvel) {

    if (IsEnabled())
        vvel.set(m_safe_velocity);
    else
        GetVelocity(vvel);
}

void CPHCharacter::CutVelocity(float l_limit, float /*a_limit*/) {
    dVector3 limitedl, diffl;
    if (dVectorLimit(dBodyGetLinearVel(m_body), l_limit, limitedl)) {
        dVectorSub(diffl, limitedl, dBodyGetLinearVel(m_body));
        dBodySetLinearVel(m_body, diffl[0], diffl[1], diffl[2]);
        dBodySetAngularVel(m_body, 0.f, 0.f, 0.f);
        dxStepBody(m_body, fixed_step);
        dBodySetLinearVel(m_body, limitedl[0], limitedl[1], limitedl[2]);
    }
}

const Fmatrix& CPHCharacter::XFORM() const {
    return m_phys_ref_object->ObjectXFORM(); //>renderable.xform;
}
void CPHCharacter::get_LinearVel(Fvector& velocity) const { GetVelocity(velocity); }
void CPHCharacter::get_AngularVel(Fvector& velocity) const { velocity.set(0, 0, 0); }

const Fvector& CPHCharacter::mass_Center() const { return cast_fv(dBodyGetLinearVel(m_body)); }

void CPHCharacter::get_body_position(Fvector& p) {
    VERIFY(b_exist);
    VERIFY(get_body());
    p.set(cast_fv(dBodyGetPosition(get_body())));
}

void virtual_move_collide_callback(bool& do_collide, bool bo1, dContact& c, SGameMtl* material_1,
                                   SGameMtl* material_2) {
    if (!do_collide)
        return;
    do_collide = false;
    SGameMtl* oposite_matrial = bo1 ? material_1 : material_2;
    if (oposite_matrial->Flags.test(SGameMtl::flPassable))
        return;

    dxGeomUserData* my_data = retrieveGeomUserData(bo1 ? c.geom.g1 : c.geom.g2);
    dxGeomUserData* oposite_data = retrieveGeomUserData(bo1 ? c.geom.g2 : c.geom.g1);
    VERIFY(my_data);
    if (oposite_data && oposite_data->ph_ref_object == my_data->ph_ref_object)
        return;

    // if( c.geom.depth > camera_collision_sckin_depth/2.f )
    // cam_collided = true;
    // if( !cam_step )
    // return;

    c.surface.mu = 0;
    c.surface.soft_cfm = 0.01f;
    dJointID contact_joint = dJointCreateContact(
        0, ContactGroup, &c); // dJointCreateContactSpecial(0, ContactGroup, &c);
    CPHObject* obj = (CPHObject*)my_data->callback_data;
    VERIFY(obj);

    obj->Island().DActiveIsland()->ConnectJoint(contact_joint);

    if (bo1)
        dJointAttach(contact_joint, dGeomGetBody(c.geom.g1), 0);
    else
        dJointAttach(contact_joint, 0, dGeomGetBody(c.geom.g2));
}

void CPHCharacter::fix_body_rotation() {
    dBodyID b = get_body(); // GetBody();
    if (b) {
        dMatrix3 R;
        dRSetIdentity(R);
        dBodySetAngularVel(b, 0.f, 0.f, 0.f);
        dBodySetRotation(b, R);
    }
}

CPHCharacter* create_ai_character() { return xr_new<CPHAICharacter>(); }
CPHCharacter* create_actor_character(bool single_game) {
    return xr_new<CPHActorCharacter>(single_game);
}


text:
module Datawarehouse
  class Product
    class Service < OpenStruct

    end
  end
end


text:
using System;
using System.Web.Mvc;

namespace CGO.Web.Infrastructure
{
    public class MvcUrlHelper : IUrlHelper
    {
        private readonly UrlHelper urlHelper;

        public MvcUrlHelper(UrlHelper urlHelper)
        {
            if (urlHelper == null)
            {
                throw new ArgumentNullException("urlHelper");
            }

            this.urlHelper = urlHelper;
        }

        public string Action(string actionName, string controllerName, object routeValues = null)
        {
            return urlHelper.Action(actionName, controllerName, routeValues);
        }
    }
}


text:
#ifndef INPUTSAMPLE_H_
#define INPUTSAMPLE_H_

#include <hawkeye/gameplay.hh>
#include "Sample.hh"

using namespace hawkeye;

/**
 * Samples basic input for keyboard, mouse, touch and accelerometer.
 */
class InputSample : public Sample, Control::Listener
{
public:

    InputSample();

    void touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex);

    void keyEvent(Keyboard::KeyEvent evt, int key);

    bool mouseEvent(Mouse::MouseEvent evt, int x, int y, int wheelDelta);

    void controlEvent(Control* control, EventType evt);

protected:

    void initialize();

    void finalize();

    void update(float elapsedTime);

    void render(float elapsedTime);

private:

    bool drawScene(Node* node);

    void setCaptured(bool captured);

private:

    class TouchPoint
    {
    public:
        unsigned int _id;
        Vector2 _coord;
        bool _isStale;
    };

    std::list<TouchPoint> _touchPoints;
    std::set<int> _downKeys;
    Vector2 _mousePoint;
    Vector2 _mouseWheelPoint;
    std::string _keyboardString;
    std::string _symbolsString;
    std::string _mouseString;
    Font* _font;
    Form* _inputSampleControls;
    int _mouseWheel;
    bool _keyboardState;
    SpriteBatch* _crosshair;
    Rectangle _crosshairDstRect;
    Rectangle _crosshairSrcRect;
    Vector2 _crosshairLowerLimit;
    Vector2 _crosshairUpperLimit;
    Scene* _scene;
    Node* _formNode;
    Node* _formNodeParent;
    Vector3 _formNodeRestPosition;
};

#endif


text:
package edu.uci.isr.xarch.changes;

import java.util.Collection;
import edu.uci.isr.xarch.XArchActionMetadata;
import edu.uci.isr.xarch.XArchTypeMetadata;
import edu.uci.isr.xarch.XArchPropertyMetadata;

/**
 * Interface for accessing objects of the
 * ArchChange xsi:type in the
 * changes namespace.
 *
 * @author Automatically generated by xArch apigen
 */
public interface IArchChange extends edu.uci.isr.xarch.IXArchElement{

	public final static XArchTypeMetadata TYPE_METADATA = new XArchTypeMetadata(
		XArchTypeMetadata.XARCH_ELEMENT,
		"changes", "ArchChange", edu.uci.isr.xarch.IXArchElement.TYPE_METADATA,
		new XArchPropertyMetadata[]{
			XArchPropertyMetadata.createAttribute("id", "instance", "Identifier", null, null),
			XArchPropertyMetadata.createElement("description", "instance", "Description", 1, 1),
			XArchPropertyMetadata.createElement("changes", "changes", "Changes", 0, XArchPropertyMetadata.UNBOUNDED)},
		new XArchActionMetadata[]{});

	/**
	 * Set the id attribute on this ArchChange.
	 * @param id id
	 * @exception FixedValueException if the attribute has a fixed value
	 * and the value passed is not the fixed value.
	*/
	public void setId(String id);

	/**
	 * Remove the id attribute from this ArchChange.
	 */
	public void clearId();

	/**
	 * Get the id attribute from this ArchChange.
	 * if the attribute has a fixed value, this function will
	 * return that fixed value, even if it is not actually present
	 * in the XML document.
	 * @return id on this ArchChange
	 */
	public String getId();

	/**
	 * Determine if the id attribute on this ArchChange
	 * has the given value.
	 * @param id Attribute value to compare
	 * @return true if they match; false
	 * otherwise.
	 */
	public boolean hasId(String id);

	/**
	 * Set the description for this ArchChange.
	 * @param value new description
	 */
	public void setDescription(edu.uci.isr.xarch.instance.IDescription value);

	/**
	 * Clear the description from this ArchChange.
	 */
	public void clearDescription();

	/**
	 * Get the description from this ArchChange.
	 * @return description
	 */
	public edu.uci.isr.xarch.instance.IDescription getDescription();

	/**
	 * Determine if this ArchChange has the given description
	 * @param descriptionToCheck description to compare
	 * @return true if the descriptions are equivalent,
	 * false otherwise
	 */
	public boolean hasDescription(edu.uci.isr.xarch.instance.IDescription descriptionToCheck);

	/**
	 * Add a changes to this ArchChange.
	 * @param newChanges changes to add.
	 */
	public void addChanges(IChanges newChanges);

	/**
	 * Add a collection of changess to this ArchChange.
	 * @param changess changess to add.
	 */
	public void addChangess(Collection changess);

	/**
	 * Remove all changess from this ArchChange.
	 */
	public void clearChangess();

	/**
	 * Remove the given changes from this ArchChange.
	 * Matching is done by the isEquivalent(...) function.
	 * @param changesToRemove changes to remove.
	 */
	public void removeChanges(IChanges changesToRemove);

	/**
	 * Remove all the given changess from this ArchChange.
	 * Matching is done by the isEquivalent(...) function.
	 * @param changess changes to remove.
	 */
	public void removeChangess(Collection changess);

	/**
	 * Get all the changess from this ArchChange.
	 * @return all changess in this ArchChange.
	 */
	public Collection getAllChangess();

	/**
	 * Determine if this ArchChange contains a given changes.
	 * @return true if this ArchChange contains the given
	 * changesToCheck, false otherwise.
	 */
	public boolean hasChanges(IChanges changesToCheck);

	/**
	 * Determine if this ArchChange contains the given set of changess.
	 * @param changessToCheck changess to check for.
	 * @return Collection of java.lang.Boolean.  If the ith
	 * element in changess was found, then the ith
	 * element of the collection will be set to true, otherwise it
	 * will be set to false.  Matching is done with the
	 * isEquivalent(...) method.
	 */
	public Collection hasChangess(Collection changessToCheck);

	/**
	 * Determine if this ArchChange contains each element in the
	 * given set of changess.
	 * @param changessToCheck changess to check for.
	 * @return true if every element in
	 * changess is found in this ArchChange,
	 * false otherwise.
	 */
	public boolean hasAllChangess(Collection changessToCheck);

	/**
	 * Gets the changes from this ArchChange with the given
	 * id.
	 * @param id ID to look for.
	 * @return changes with the given ID, or null if not found.
	 */
	public IChanges getChanges(String id);

	/**
	 * Gets the changess from this ArchChange with the given
	 * ids.
	 * @param ids ID to look for.
	 * @return changess with the given IDs.  If an element with a given
	 * ID was not found, that ID is ignored.
	 */
	public Collection getChangess(Collection ids);

	/**
	 * Determine if another ArchChange has the same
	 * id as this one.
	 * @param ArchChangeToCheck ArchChange to compare with this
	 * one.
	 */
	public boolean isEqual(IArchChange ArchChangeToCheck);
	/**
	 * Determine if another ArchChange is equivalent to this one, ignoring
	 * ID's.
	 * @param ArchChangeToCheck ArchChange to compare to this one.
	 * @return true if all the child elements of this
	 * ArchChange are equivalent, false otherwise.
	 */
	public boolean isEquivalent(IArchChange ArchChangeToCheck);

}


text:
@class CardUnmaskPromptViewController;
@class UIViewController;
@class UINavigationController;

namespace autofill {

class CardUnmaskPromptController;

// iOS implementation of the unmask prompt UI.
class CardUnmaskPromptViewBridge : public CardUnmaskPromptView {
 public:
  CardUnmaskPromptViewBridge(CardUnmaskPromptController* controller,
                             UIViewController* base_view_controller);
  CardUnmaskPromptViewBridge(const CardUnmaskPromptViewBridge&) = delete;
  CardUnmaskPromptViewBridge& operator=(const CardUnmaskPromptViewBridge&) =
      delete;

  ~CardUnmaskPromptViewBridge() override;

  // CardUnmaskPromptView:
  void Show() override;
  void ControllerGone() override;
  void DisableAndWaitForVerification() override;
  void GotVerificationResult(const std::u16string& error_message,
                             bool allow_retry) override;

  CardUnmaskPromptController* GetController();

  // Closes the view.
  virtual void PerformClose();

  // Called when `navigation_controller_` was dismissed.
  // This call destroys `this`.
  void NavigationControllerDismissed();

 protected:
  // The presented UINavigationController containing `prompt_view_controller_`.
  UINavigationController* navigation_controller_;

  // Created on `Show` and destroyed when 'this' is destroyed.
  CardUnmaskPromptViewController* prompt_view_controller_;

  // The controller `this` queries for logic and state.
  CardUnmaskPromptController* controller_;  // weak

 private:
  // Deletes self. Called after CardUnmaskPromptViewController finishes
  // dismissing its own UI elements.
  void DeleteSelf();

  // Weak reference to the view controller used to present UI.
  __weak UIViewController* base_view_controller_;

  base::WeakPtrFactory<CardUnmaskPromptViewBridge> weak_ptr_factory_;
};

}  // namespace autofill

#endif  // IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_


text:
package org.apache.calcite.sql.type;

import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.sql.SqlCallBinding;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.SqlOperandCountRange;
import org.apache.calcite.sql.SqlOperator;
import org.apache.calcite.sql.SqlOperatorBinding;
import org.apache.calcite.sql.SqlUtil;
import org.apache.calcite.util.Util;

import com.google.common.collect.ImmutableList;

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

import static org.apache.calcite.util.Static.RESOURCE;

/**
 * Parameter type-checking strategy where all operand types must be the same.
 */
public class SameOperandTypeChecker implements SqlSingleOperandTypeChecker {
  //~ Instance fields --------------------------------------------------------

  protected final int nOperands;

  //~ Constructors -----------------------------------------------------------

  public SameOperandTypeChecker(
      int nOperands) {
    this.nOperands = nOperands;
  }

  //~ Methods ----------------------------------------------------------------

  public Consistency getConsistency() {
    return Consistency.NONE;
  }

  public boolean isOptional(int i) {
    return false;
  }

  public boolean checkOperandTypes(
      SqlCallBinding callBinding,
      boolean throwOnFailure) {
    return checkOperandTypesImpl(
        callBinding,
        throwOnFailure,
        callBinding);
  }

  protected List<Integer> getOperandList(int operandCount) {
    return nOperands == -1
        ? Util.range(0, operandCount)
        : Util.range(0, nOperands);
  }

  protected boolean checkOperandTypesImpl(
      SqlOperatorBinding operatorBinding,
      boolean throwOnFailure,
      SqlCallBinding callBinding) {
    int nOperandsActual = nOperands;
    if (nOperandsActual == -1) {
      nOperandsActual = operatorBinding.getOperandCount();
    }
    assert !(throwOnFailure && (callBinding == null));
    RelDataType[] types = new RelDataType[nOperandsActual];
    final List<Integer> operandList =
        getOperandList(operatorBinding.getOperandCount());
    for (int i : operandList) {
      types[i] = operatorBinding.getOperandType(i);
    }
    int prev = -1;
    for (int i : operandList) {
      if (prev >= 0) {
        if (!SqlTypeUtil.isComparable(types[i], types[prev])) {
          if (!throwOnFailure) {
            return false;
          }

          // REVIEW jvs 5-June-2005: Why don't we use
          // newValidationSignatureError() here?  It gives more
          // specific diagnostics.
          throw callBinding.newValidationError(
              RESOURCE.needSameTypeParameter());
        }
      }
      prev = i;
    }
    return true;
  }

  /**
   * Similar functionality to
   * {@link #checkOperandTypes(SqlCallBinding, boolean)}, but not part of the
   * interface, and cannot throw an error.
   */
  public boolean checkOperandTypes(
      SqlOperatorBinding operatorBinding, SqlCallBinding callBinding) {
    return checkOperandTypesImpl(operatorBinding, false, null);
  }

  // implement SqlOperandTypeChecker
  public SqlOperandCountRange getOperandCountRange() {
    if (nOperands == -1) {
      return SqlOperandCountRanges.any();
    } else {
      return SqlOperandCountRanges.of(nOperands);
    }
  }

  public String getAllowedSignatures(SqlOperator op, String opName) {
    final String typeName = getTypeName();
    return SqlUtil.getAliasedSignature(op, opName,
        nOperands == -1
            ? ImmutableList.of(typeName, typeName, "...")
            : Collections.nCopies(nOperands, typeName));
  }

  /** Override to change the behavior of
   * {@link #getAllowedSignatures(SqlOperator, String)}. */
  protected String getTypeName() {
    return "EQUIVALENT_TYPE";
  }

  public boolean checkSingleOperandType(
      SqlCallBinding callBinding,
      SqlNode operand,
      int iFormalOperand,
      boolean throwOnFailure) {
    throw new UnsupportedOperationException(); // TODO:
  }
}

// End SameOperandTypeChecker.java


text:
//
//  PDTSimpleCalendarViewCell.h
//  PDTSimpleCalendar
//
//  Created by Jerome Miglino on 10/7/13.
//  Copyright (c) 2013 Producteev. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, DateRangeStatus) {
    DateRangeStatusNone,
    DateRangeStatusStart,
    DateRangeStatusMiddle,
    DateRangeStatusEnd
};

@class PDTSimpleCalendarViewCell;

@protocol PDTSimpleCalendarViewCellDelegate <NSObject>

@optional

/**
 *  Asks the delegate if the Cell should use custom colors.
 *
 *  @param cell the current cell
 *  @param date the date associated with the cell
 *
 *  @return YES if the cell must ask the delegate for text and circle color, NO if it should use default values.
 */
- (BOOL)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell shouldUseCustomColorsForDate:(NSDate *)date;

/**
 *  Asks the delegate for the text color for a specific date.
 *  Will be called only if the delegate returns YES for `- (BOOL)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell shouldUseCustomColorsForDate:(NSDate *)date;`
 *
 *  @param cell the current cell
 *  @param date the date associated with the cell
 *
 *  @return The text desired color
 */
- (UIColor *)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell textColorForDate:(NSDate *)date;

/**
 *  Asks the delegate for the circle color for a specific date.
 *  Will be called only if the delegate returns YES for `- (BOOL)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell shouldUseCustomColorsForDate:(NSDate *)date;`
 *
 *  @param cell the current cell
 *  @param date the date associated with the cell
 *
 *  @return The circle desired color
 */
- (UIColor *)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell circleColorForDate:(NSDate *)date;

- (DateRangeStatus)simpleCalendarViewCell:(PDTSimpleCalendarViewCell *)cell dateRangeStatusForDate:(NSDate *)date;

@end

/**
 *  The `PDTSimpleCalendarViewCell` class displays a day in the calendar.
 */
@interface PDTSimpleCalendarViewCell : UICollectionViewCell

/**
 *  The delegate of the cell.
 *  Must adopt the `PDTSimpleCalendarViewCellDelegate` protocol.
 *
 *  @see PDTSimpleCalendarViewCellDelegate
 */
@property (nonatomic, weak) id<PDTSimpleCalendarViewCellDelegate> delegate;

@property (nonatomic) UIColor *cellRangeColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the circle behind the day's number color using UIAppearance.
 */
@property (nonatomic) UIColor *circleDefaultColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the color of the circle when cell is selected using UIAppearance.
 */
@property (nonatomic) UIColor *circleSelectedColor UI_APPEARANCE_SELECTOR;

@property (nonatomic) UIColor *circleRangeEndColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the day's number using UIAppearance.
 */
@property (nonatomic) UIColor *textDefaultColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the day's number color when cell is selected using UIAppearance.
 */
@property (nonatomic) UIColor *textSelectedColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the day's number color when cell is disabled using UIAppearance.
 */
@property (nonatomic) UIColor *textDisabledColor UI_APPEARANCE_SELECTOR;

/**
 *  Customize the day's number font using UIAppearance.
 */
@property (nonatomic) UIFont *textDefaultFont UI_APPEARANCE_SELECTOR;

/**
 * Set the date for this cell
 *
 * @param date the date (Midnight GMT).
 * @param calendar the calendar.
 */
- (void)setDate:(NSDate *)date calendar:(NSCalendar*)calendar enabled:(BOOL)enabled;

/**
 *  Force the refresh of the colors for the circle and the text
 */
- (void)refreshCellColors;

@end


text:
import {Aoi} from '../aoi'
import {DataCollectionContext, DataCollectionManager} from './dataCollectionManager'
import {Map} from 'app/home/map/map'
import {RecipeActions, getDefaultModel} from './classificationRecipe'
import {compose} from 'compose'
import {getAvailableBands} from './bands'
import {getPreSetVisualizations} from './visualizations'
import {initializeLayers} from '../recipeImageLayerSource'
import {msg} from 'translate'
import {recipe} from 'app/home/body/process/recipeContext'
import {selectFrom} from 'stateUtils'
import ClassificationToolbar from './panels/classificationToolbar'
import CollectPanel from './panels/collect/collectPanel'
import React from 'react'

const mapRecipeToProps = recipe => ({
    initialized: selectFrom(recipe, 'ui.initialized'),
    images: selectFrom(recipe, 'model.inputImagery.images'),
    savedLayers: selectFrom(recipe, 'layers'),
    trainingDataSets: selectFrom(recipe, 'model.trainingData.dataSets')
})

class _Classification extends React.Component {

    constructor(props) {
        super(props)
        const {savedLayers, recipeId} = props
        this.dataCollectionManager = new DataCollectionManager(recipeId)
        this.recipeActions = RecipeActions(recipeId)
        initializeLayers({
            recipeId,
            savedLayers,
            additionalFeatureLayerSources: [{
                id: 'referenceData',
                type: 'ReferenceData',
                description: msg('featureLayerSources.ReferenceData.description'),
                defaultEnabled: true
            }]
        })
    }

    render() {
        const {initialized, images} = this.props
        return (
            <DataCollectionContext.Provider value={{dataCollectionManager: this.dataCollectionManager}}>
                <Map>
                    <ClassificationToolbar dataCollectionManager={this.dataCollectionManager}/>
                    <Aoi value={images && images.length && images[0]}/>
                    {initialized
                        ? (
                            <CollectPanel dataCollectionManager={this.dataCollectionManager}/>
                        )
                        : null}
                </Map>
            </DataCollectionContext.Provider>
        )
    }

    componentDidMount() {
        const {trainingDataSets} = this.props
        const referenceData = trainingDataSets
            .filter(({type}) => type !== 'RECIPE')
            .map(({dataSetId, referenceData}) =>
                referenceData.map(point => ({...point, dataSetId}))
            )
            .flat()
        const countPerClass = {}
        referenceData.forEach(point => {
            const pointClass = point['class']
            countPerClass[pointClass] = (countPerClass[pointClass] || 0) + 1
        })
        this.recipeActions.setCountPerClass(countPerClass)
    }
}

const Classification = compose(
    _Classification,
    recipe({getDefaultModel, mapRecipeToProps})
)

const getDependentRecipeIds = recipe =>
    (selectFrom(recipe, 'model.inputImagery.images') || [])
        .filter(({type}) => type === 'RECIPE_REF')
        .map(({id}) => id)

export default () => ({
    id: 'CLASSIFICATION',
    labels: {
        name: msg('process.classification.create'),
        creationDescription: msg('process.classification.description'),
        tabPlaceholder: msg('process.classification.tabPlaceholder'),
    },
    components: {
        recipe: Classification
    },
    getDependentRecipeIds,
    getDateRange(_recipe) {
        return null
    },
    getAvailableBands,
    getPreSetVisualizations
})


text:
package com.axiomalaska.crks.dto;

public class DataProviderDTO extends AbstractDTO {

    private Integer id;
    private String label;
    private String description;
    private byte[] logo;
    private String url;

    public Integer getId() {
        return this.id;
    }

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

    public String getLabel() {
        return this.label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public byte[] getLogo() {
        return this.logo;
    }

    public void setLogo(byte[] logo) {
        this.logo = logo;
    }

    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
}


text:
from django.db.models import get_model

from rest_framework import viewsets

from oscar.core.compat import get_user_model

from . import serializers
from .mixins import UserFilterMixin

User = get_user_model()
Group = get_model('auth', 'Group')

class CustomerViewSet(UserFilterMixin, viewsets.ModelViewSet):
    model = User
    serializer_class = serializers.UserSerializer

    def get_queryset(self):
        return self.filter_queryset(self.model.objects.all())

class AgentViewSet(UserFilterMixin, viewsets.ModelViewSet):
    model = User
    serializer_class = serializers.UserSerializer

    def get_queryset(self):
        return self.filter_queryset(self.model.objects.filter(is_staff=True))

class GroupViewSet(viewsets.ModelViewSet):
    model = Group


text:
{% extends "eukalypse_now/root.html" %}

{% load thumbnail %}

{% block base_content %}

Test vom {{ testrun.created|date:"d. F Y" }} um {{ testrun.created|date:"H:i" }} Uhr

Ergebnisse

Übersicht

Projekt

Benachrichtigungen

        {% for testresult in testrun.testresult.all %}

            {% if testresult.error %}

                    {% if testresult.error_acknowledged %}

                    {% else %}

                    {% endif %}
                    {{testresult.test.identifier}}

                {% if testresult.error_reference_updated %}

                {% endif %}

                        {% if not testresult.error_reference_updated %}
                            <button class="btn ajaxcall" rel="tooltip" title="Use new created image as reference" data-ident="{{testresult.test.identifier}}" href="{{testresult.get_become_reference_url}}"></button>
                        {% endif %}
                        {% if not testresult.error_acknowledged %}
                            <button class="btn ajaxcall" rel="tooltip" title="acknowledge this error" data-ident="{{testresult.test.identifier}}" href="{{testresult.get_acknowledge_error_url}}" ></button>
                        {% endif %}

            {% else %}
                {{testresult.test.identifier}}

            {% endif %}

        {% endfor %}

Tests gesamt

{{ testrun.total_tests }}

Tests erfolgreich

{{ testrun.total_noerror }}

Tests behandelt

{{ testrun.total_error_handelt }}

Tests fehlgeschlagen

{{ testrun.total_error }}

Name

{{ testrun.project.name }}

Erstellt am

{{ testrun.project.created|date:"d. F Y" }} um {{ testrun.project.created|date:"H:i" }} Uhr

Letzte Änderung am

{{ testrun.project.modified|date:"d. F Y" }} um {{ testrun.project.created|date:"H:i" }} Uhr

Letzter Testlauf

{{ testrun.project.latest_testrun.0.created|date:"d. F Y" }} um {{ testrun.project.latest_testrun.0.created|date:"H:i" }} Uhr

Status

{% if testrun.project.notify_mail %}Aktiv{% else %}Inakti{% endif %}

Versenden

{% if testrun.project.notify_only_error %}Nur bei Fehler{% else %}Immer{% endif %}

Empfänger

{% if testrun.project.notify_recipient %}{{ testrun.project.notify_recipient }}{% else %}No recipients{% endif %}

{% endblock %}


text:
/**
 * callback method
 */

package screenshot

// #include <stdlib.h>
import "C"
import (
	"image/png"
	"math"
	"reflect"
	"unsafe"
)

type reader struct {
	cur  int
	data []byte
}

// Read method
func (r *reader) Read(p []byte) (n int, err error) {
	if r.cur == len(r.data)-1 {
		return
	}

	copy(p, r.data[r.cur:])
	n = int(math.Min(float64(len(r.data)-r.cur), float64(len(p))))
	r.cur += n

	return
}

//export callback
func callback(length uint, bytes unsafe.Pointer) {
	r := &reader{}
	sheader := (*reflect.SliceHeader)(unsafe.Pointer(&r.data))
	sheader.Data = uintptr(bytes)
	sheader.Len = int(length)

	img, err := png.Decode(r)
	if err != nil {
		errC <- err
		return
	}

	errC <- nil
	imgC <- img
}


text:
/* IBM_PROLOG_BEGIN_TAG */
/*
 * Copyright 2003,2016 IBM International Business Machines Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 		 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* IBM_PROLOG_END_TAG */
/* @(#)68	1.1  src/htx/usr/lpp/htx/bin/htxd/htxd_socket.h, htxd, htxubuntu 7/17/13 09:12:06 */

#ifndef HTXD__SOCKET__HEADER
#define HTXD__SOCKET__HEADER

extern int htxd_create_socket(void);
extern int htxd_set_socket_option(int);
extern int htxd_bind_socket(int, struct sockaddr_in *, int);
extern int htxd_listen_socket(int);
extern int htxd_select(int);
extern int htxd_accept_connection(int, struct sockaddr_in *, socklen_t *);
extern int htxd_receive_command_length(int);
extern char * htxd_receive_command(int);
extern int htxd_send_ack_command_length(int);
extern int htxd_send_response_length(int, int);
extern int htxd_send_response(int, char *, int);
extern  int htxd_receive_bytes(int, char *, int);

#endif


text:
import sys
import hyperdex.client
from hyperdex.client import LessEqual, GreaterEqual, LessThan, GreaterThan, Range, Regex, LengthEquals, LengthLessEqual, LengthGreaterEqual
c = hyperdex.client.Client(sys.argv[1], int(sys.argv[2]))
def to_objectset(xs):
    return set([frozenset(x.items()) for x in xs])
assert c.get('kv', 'k') == None
assert c.put('kv', 'k', {'v1': 'ABC'}) == True
assert c.get('kv', 'k') == {'v1': 'ABC', 'v2': ''}
assert c.put('kv', 'k', {'v2': '123'}) == True
assert c.get('kv', 'k') == {'v1': 'ABC', 'v2': '123'}
assert c.get_partial('kv', 'k', ['v1']) == {'v1': 'ABC'}


text:
PaintWidget::PaintWidget(QWidget *parent) : QWidget(parent)
{
    modelSet = false;
}

void PaintWidget::setModel(Model &m)
{
    model = m;
    model.p = m.p;
    model.q = m.q;
    modelSet = true;
}

void PaintWidget::paintEvent(QPaintEvent *)
{
    QPainter painter(this);

    // brush and colors:
    static QPalette palette;
    painter.setBrush(palette.window());
    painter.setRenderHint(QPainter::Antialiasing, false);
    painter.setPen(QPen(Qt::black, 0.0));

    paintVisualisation(painter);
}

void PaintWidget::paintVisualisation(QPainter &painter)
{
    if (!modelSet)
        return;

    double scale = (width() - 1.) / model.boxW;
    if (model.boxW/model.boxH < (width() - 1.)/(height() - 1.))
        scale = (height() - 1.) / model.boxH;
    painter.scale(scale, scale);

    for (int i=0; i<model.N; ++i)
        drawEigenEllipse(painter, model.q.col(i));

    painter.drawLine(QPointF(0, 0), QPointF(model.boxW, 0));
    painter.drawLine(QPointF(0, 0), QPointF(0, model.boxH));
    painter.drawLine(QPointF(model.boxW, model.boxH), QPointF(model.boxW, 0));
    painter.drawLine(QPointF(model.boxW, model.boxH), QPointF(0, model.boxH));
}

void PaintWidget::drawEigenEllipse(QPainter &painter, Eigen::Vector2d q0, double radius)
{
    painter.drawEllipse(QPointF(q0[0], q0[1]), radius, radius);
}


text:
package liquibase.changelog.visitor;

import liquibase.change.ColumnConfig;
import liquibase.change.core.CreateTableChange;
import liquibase.changelog.ChangeSet;
import liquibase.changelog.DatabaseChangeLog;
import liquibase.changelog.RanChangeSet;
import liquibase.database.Database;
import liquibase.exception.SetupException;
import liquibase.exception.ValidationErrors;
import liquibase.database.core.MockDatabase;
import org.junit.Before;
import org.junit.Test;

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

import static org.junit.Assert.*;

public class ValidatingVisitorTest {

    private ChangeSet changeSet1;
    private ChangeSet changeSet2;

    @Before
    public void setup() {
        changeSet1 = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, null, null);
        changeSet2 = new ChangeSet("2", "testAuthor", false, false, "path/changelog", null, null, null);

    }

    @Test
    public void visit_successful() throws Exception {
        CreateTableChange change1 = new CreateTableChange();
        change1.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change1.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");

        CreateTableChange change2 = new CreateTableChange();
        change2.setTableName("table2");
        ColumnConfig column2 = new ColumnConfig();
        change2.addColumn(column2);
        column2.setName("col2");
        column2.setType("int");

        changeSet1.addChange(change1);
        changeSet2.addChange(change2);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet1, new DatabaseChangeLog(), new MockDatabase(), null);
        handler.visit(changeSet2, new DatabaseChangeLog(), new MockDatabase(), null);

        assertTrue(handler.validationPassed());

    }

    @Test
    public void visit_setupException() throws Exception {
        changeSet1.addChange(new CreateTableChange() {
            @Override
            public void finishInitialization() throws SetupException {
                throw new SetupException("Test message");
            }
        });

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet1, new DatabaseChangeLog(), null, null);

        assertEquals(1, handler.getSetupExceptions().size());
        assertEquals("Test message", handler.getSetupExceptions().get(0).getMessage());

        assertFalse(handler.validationPassed());
    }

    @Test
    public void visit_duplicate() throws Exception {

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet1, new DatabaseChangeLog(), null, null);
        handler.visit(changeSet1, new DatabaseChangeLog(), null, null);

        assertEquals(1, handler.getDuplicateChangeSets().size());

        assertFalse(handler.validationPassed());
    }

    @Test
    public void visit_validateError() throws Exception {

        changeSet1.addChange(new CreateTableChange() {
            @Override
            public ValidationErrors validate(Database database) {
                ValidationErrors changeValidationErrors = new ValidationErrors();
                changeValidationErrors.addError("Test message");
                return changeValidationErrors;
            }
        });

        List<RanChangeSet> ran = new ArrayList<RanChangeSet>();
        ValidatingVisitor handler = new ValidatingVisitor(ran);
        handler.visit(changeSet1, new DatabaseChangeLog(), null, null);

        assertEquals(1, handler.getValidationErrors().getErrorMessages().size());
        assertTrue(handler.getValidationErrors().getErrorMessages().get(0).startsWith("Test message"));

        assertFalse(handler.validationPassed());
    }

    @Test
    public void visit_torunOnly() throws Exception {

        changeSet1.addChange(new CreateTableChange() {
            @Override
            public ValidationErrors validate(Database database) {
                ValidationErrors changeValidationErrors = new ValidationErrors();
                changeValidationErrors.addError("Test message");
                return changeValidationErrors;
            }
        });

        List<RanChangeSet> ran = new ArrayList<RanChangeSet>();
        ran.add(new RanChangeSet(changeSet1));
        ValidatingVisitor handler = new ValidatingVisitor(ran);
        handler.visit(changeSet1, new DatabaseChangeLog(), null, null);

        assertEquals(0, handler.getSetupExceptions().size());

        assertTrue(handler.validationPassed());
    }

    @Test
    public void visit_successfulWithSingleValidDbmsSet() throws Exception {
        CreateTableChange change = new CreateTableChange();
        change.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");

        ChangeSet changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, "postgresql", null);
        changeSet.addChange(change);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet, new DatabaseChangeLog(), new MockDatabase(), null);

        assertTrue(handler.validationPassed());
    }

    @Test
    public void visit_successfulWithValidListOfDbmsSet() throws Exception {
        CreateTableChange change = new CreateTableChange();
        change.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");
        ChangeSet changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, "postgresql, mssql, h2", null);
        changeSet.addChange(change);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet, new DatabaseChangeLog(), new MockDatabase(), null);

        assertTrue(handler.validationPassed());
    }

    @Test
    public void visit_unsuccessfulWithInvalidDbmsSet() throws Exception {
        CreateTableChange change = new CreateTableChange();
        change.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");
        ChangeSet changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, "post", null);
        changeSet.addChange(change);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet, new DatabaseChangeLog(), new MockDatabase(), null);

        assertFalse(handler.validationPassed());
    }

    @Test
    public void visit_successfulWithNoneSetAsDbms() throws Exception {
        CreateTableChange change = new CreateTableChange();
        change.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");
        ChangeSet changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, "none", null);
        changeSet.addChange(change);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet, new DatabaseChangeLog(), new MockDatabase(), null);

        assertTrue(handler.validationPassed());
    }

    @Test
    public void visit_successfulWithAllSetAsDbms() throws Exception {
        CreateTableChange change = new CreateTableChange();
        change.setTableName("table1");
        ColumnConfig column1 = new ColumnConfig();
        change.addColumn(column1);
        column1.setName("col1");
        column1.setType("int");
        ChangeSet changeSet = new ChangeSet("1", "testAuthor", false, false, "path/changelog", null, "all", null);
        changeSet.addChange(change);

        ValidatingVisitor handler = new ValidatingVisitor(new ArrayList<RanChangeSet>());
        handler.visit(changeSet, new DatabaseChangeLog(), new MockDatabase(), null);

        assertTrue(handler.validationPassed());
    }
}


text:
description: Get to know more about Next.js with the frequently asked questions.
---

# Frequently Asked Questions

  Is this production ready?

Next.js has been powering https://vercel.com  since its inception.

We're ecstatic about both the developer experience and end-user performance, so we decided to share it with the community.

  How big is it?

The client side bundle size should be measured in a per-app basis. A small Next main bundle is around 65kb gzipped.

  How can I change the internal webpack configs?

Next.js tries its best to remove the overhead of webpack configurations, but for advanced cases where more control is needed, refer to the custom webpack config documentation.

  What syntactic features are compiled? How do I change them?

We track V8. Since V8 has wide support for ES6 and async and await, we compile those. Since V8 doesn't support class decorators, we don't compile those.

See the documentation about customizing babel config for more information.

  Why a new Router?
  Next.js is special in that:

Routes don't need to be known ahead of time, We don't ship a route manifest

Routes are always lazy-loadable

  How do I fetch data?

It's up to you. You can use the fetch API or SWR inside your React components for remote data fetching; or use our data fetching methods for initial data population.

  Can I use it with GraphQL?

Yes! Here's an example with Apollo.

  Can I use it with Redux?

Yes! Here's an example. And there's another example with thunk.

  Can I use a CDN for static assets?

Yes. You can read more about it here.

  Can I use Next with my favorite JavaScript library or toolkit?

Since our first release we've had many example contributions. You can check them out in the examples directory.

  What is this inspired by?

Many of the goals we set out to accomplish were the ones listed in The 7 principles of Rich Web Applications by Guillermo Rauch.

The ease-of-use of PHP is a great inspiration. We feel Next.js is a suitable replacement for many scenarios where you would otherwise use PHP to output HTML.

Unlike PHP, we benefit from the ES6 module system and every page exports a component or function that can be easily imported for lazy evaluation or testing.

As we were researching options for server-rendering React that didn't involve a large number of steps, we came across react-page (now deprecated), a similar approach to Next.js by the creator of React Jordan Walke.

  Can I make a Next.js Progressive Web App (PWA)?

Yes! Check out our PWA Example to see how it works.


text:
import socket, cgi, errno
from common import ErrorResponse, statusmessage

class wsgirequest(object):
    def __init__(self, wsgienv, start_response):
        version = wsgienv['wsgi.version']
        if (version < (1, 0)) or (version >= (2, 0)):
            raise RuntimeError("Unknown and unsupported WSGI version %d.%d"
                               % version)
        self.inp = wsgienv['wsgi.input']
        self.err = wsgienv['wsgi.errors']
        self.threaded = wsgienv['wsgi.multithread']
        self.multiprocess = wsgienv['wsgi.multiprocess']
        self.run_once = wsgienv['wsgi.run_once']
        self.env = wsgienv
        self.form = cgi.parse(self.inp, self.env, keep_blank_values=1)
        self._start_response = start_response
        self.server_write = None
        self.headers = []

    def __iter__(self):
        return iter([])

    def read(self, count=-1):
        return self.inp.read(count)

    def respond(self, status, type=None, filename=None, length=0):
        if self._start_response is not None:

            self.httphdr(type, filename, length)
            if not self.headers:
                raise RuntimeError("request.write called before headers sent")

            for k, v in self.headers:
                if not isinstance(v, str):
                    raise TypeError('header value must be string: %r' % v)

            if isinstance(status, ErrorResponse):
                status = statusmessage(status.code)
            elif status == 200:
                status = '200 Script output follows'
            elif isinstance(status, int):
                status = statusmessage(status)

            self.server_write = self._start_response(status, self.headers)
            self._start_response = None
            self.headers = []

    def write(self, thing):
        if hasattr(thing, "__iter__"):
            for part in thing:
                self.write(part)
        else:
            thing = str(thing)
            try:
                self.server_write(thing)
            except socket.error, inst:
                if inst[0] != errno.ECONNRESET:
                    raise

    def writelines(self, lines):
        for line in lines:
            self.write(line)

    def flush(self):
        return None

    def close(self):
        return None

    def header(self, headers=[('Content-Type','text/html')]):
        self.headers.extend(headers)

    def httphdr(self, type=None, filename=None, length=0, headers={}):
        headers = headers.items()
        if type is not None:
            headers.append(('Content-Type', type))
        if filename:
            filename = (filename.split('/')[-1]
                        .replace('\\', '\\\\').replace('"', '\\"'))
            headers.append(('Content-Disposition',
                            'inline; filename="%s"' % filename))
        if length:
            headers.append(('Content-Length', str(length)))
        self.header(headers)

def wsgiapplication(app_maker):
    '''For compatibility with old CGI scripts. A plain hgweb() or hgwebdir()
    can and should now be used as a WSGI application.'''
    application = app_maker()
    def run_wsgi(env, respond):
        return application(env, respond)
    return run_wsgi


text:
<?php

/**
 * @file
 * Definition of Drupal\system\Tests\Upgrade\FilledStandardUpgradePathTest.
 */

namespace Drupal\system\Tests\Upgrade;

use Drupal\Core\Session\UserSession;

/**
 * Performs major version release upgrade tests on a populated database.
 *
 * Loads an installation of Drupal 7.x and runs the upgrade process on it.
 *
 * The install contains the standard profile (plus all optional) modules
 * with generated content so that an update from any of the modules under this
 * profile installation can be wholly tested.
 */
class FilledStandardUpgradePathTest extends UpgradePathTestBase {
  public static function getInfo() {
    return array(
      'name'  => 'Basic standard + all profile upgrade path, populated database',
      'description'  => 'Basic upgrade path tests for a standard profile install with all enabled modules and a populated database.',
      'group' => 'Upgrade path',
    );
  }

  public function setUp() {
    // Path to the database dump files.
    $this->databaseDumpFiles = array(
      drupal_get_path('module', 'system') . '/tests/upgrade/drupal-7.filled.standard_all.database.php.gz',
      drupal_get_path('module', 'system') . '/tests/upgrade/drupal-7.user_data.database.php',
    );
    parent::setUp();
  }

  /**
   * Tests a successful point release update.
   */
  public function testFilledStandardUpgrade() {
    $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');

    // Hit the frontpage.
    $this->drupalGet('');
    $this->assertResponse(200);

    // Verify that the former Navigation system menu block appears as Tools.
    // @todo Blocks are not being upgraded.
    //   $this->assertText(t('Tools'));

    // Verify that the Account menu still appears as secondary links source.
    $this->assertText(t('My account'));
    $this->assertText(t('Log out'));

    // Verify the the Main menu still appears as primary links source.
    $this->assertLink(t('Home'));

    // Verify that we are still logged in.
    $this->drupalGet('user');
    $this->clickLink(t('Edit'));
    $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.');

    // Logout and verify that we can login back in with our initial password.
    $this->drupalLogout();
    $user = new UserSession(array(
      'uid' => 1,
      'name' => 'admin',
      'pass_raw' => 'drupal',
    ));
    $this->drupalLogin($user);

    // The previous login should've triggered a password rehash, so login one
    // more time to make sure the new hash is readable.
    $this->drupalLogout();
    $this->drupalLogin($user);

    // Test that the site name is correctly displayed.
    $this->assertText('drupal', 'The site name is correctly displayed.');

    // Verify that the main admin sections are available.
    $this->drupalGet('admin');
    $this->assertText(t('Content'));
    $this->assertText(t('Appearance'));
    $this->assertText(t('People'));
    $this->assertText(t('Configuration'));
    $this->assertText(t('Reports'));
    $this->assertText(t('Structure'));
    $this->assertText(t('Extend'));

    // Confirm that no {menu_links} entry exists for user/autocomplete.
    $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
    $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete');

    // Verify that the blog node type has been assigned to node module.
    $node_type = entity_load('node_type', 'blog');
    $this->assertFalse($node_type->isLocked(), "Content type 'blog' has been reassigned from the blog module to the node module.");
    $node_type = entity_load('node_type', 'forum');
    $this->assertTrue($node_type->isLocked(), "The base string used to construct callbacks corresponding to content type 'Forum' has been reassigned to forum module.");

    // Each entity type has a 'full' view mode, ensure it was migrated.
    $all_view_modes = entity_get_view_modes();
    $this->assertTrue(!empty($all_view_modes), 'The view modes have been migrated.');
    foreach ($all_view_modes as $entity_view_modes) {
      $this->assertTrue(isset($entity_view_modes['full']));
    }

    // Check that user data has been migrated correctly.
    $query = db_query('SELECT * FROM {users_data}');

    $userdata = array();
    $i = 0;
    foreach ($query as $row) {
      $i++;
      $userdata[$row->uid][$row->module][$row->name] = $row;
    }
    // Check that the correct amount of rows exist.
    $this->assertEqual($i, 5);
    // Check that the data has been converted correctly.
    $this->assertEqual(unserialize($userdata[1]['contact']['enabled']->value), 1);
    $this->assertEqual($userdata[1]['contact']['enabled']->serialized, 1);
    $this->assertEqual(unserialize($userdata[2]['contact']['enabled']->value), 0);
    $this->assertEqual(unserialize($userdata[1]['overlay']['enabled']->value), 1);
    $this->assertEqual(unserialize($userdata[2]['overlay']['enabled']->value), 1);
    $this->assertEqual(unserialize($userdata[1]['overlay']['message_dismissed']->value), 1);
    $this->assertFalse(isset($userdata[2]['overlay']['message_dismissed']));

    // Make sure that only the garbage is remaining in the helper table.
    $this->assertEqual(db_query('SELECT COUNT(*) FROM {_d7_users_data}')->fetchField(), 2);
  }
}