text:
import pymongo
from pymongo import MongoClient
from wowlib import wowapi, queries
import time

#connection informattion
client = MongoClient()

print ('Initiating db connection and getting wow data')
db = client.wow
print("retrieved data")
posts = db.auctiondata
itemdb = db.items

#create list of known users
knownitems = []
dbitems = itemdb.distinct('id')
for item in dbitems:
    knownitems.append(item)

#aggregates user name and server name return is {_id:{username:"",server:""}}

for item in posts.find().distinct('item'):
    try:

        if queries.binary_search(knownitems,item)== True:

            print ("already seen")
        else:
            newitem = wowapi.itemquery(item)
            #print ('adding new player')
            itemdb.insert_one(newitem)
            newcount +=1
    except:
        print("failed on tryblock")

redpajama_set_name: RedPajamaGithub


text:
module CanTango
  class Ability
    class Cache
      class Writer
        include CanTango::Helpers::Debug

        attr_reader :cache, :cache_key

        delegate :cache_key, :to => :cache

        def initialize cache
          @cache = cache
        end

        def save key, rules
          cache.invalidate!
          return if prepared_rules.blank?
          debug "writing #{prepared_rules.size} rules to cache: #{key}"
          cache.rules_cache.save cache.key, prepared_rules
          session[cache_key] = cache.key if session
        end

        protected

        def prepared_rules
          cache.compile_on? ? compiler.compile!(rules) : rules
        end

        def rules
          return cache.cached_rules if cache.cached_rules?
          cache.ability.send :rules # bad!? FIXME
        end

        def compiler
          cache.compiler
        end

        def session
          cache.session
        end

        def rules_cache
          cache.rules_cache
        end
      end
    end
  end
end


text:
import { get } from '@ember/object';
import RSVP from 'rsvp';
import { moduleFor, test } from 'ember-qunit';

moduleFor('service:current-user', 'Unit | Service | current user', {
  // Specify the other units that are required for this test.
  needs: [
    'service:metrics',
    'service:session'
  ]
});

test('it returns null for loadCurrentUser when there is no user', function(assert) {
  assert.expect(1);
  let service = this.subject();
  let done = assert.async();
  service.loadCurrentUser().then((user) => {
    assert.equal(user, null);
    done();
  });
});

test('it sets the user when there is a user', function(assert) {
  assert.expect(4);
  let service = this.subject({
    metrics: {
      identify(user) {
        assert.equal(user.distinctId, 1);
        assert.deepEqual(user.segmentContext, {
          Intercom: {
            user_hash: 'abc123'
          }
        });
      }
    },
    store: {
      findRecord() {
        return RSVP.resolve({ id: 1, intercomUserHash: 'abc123' });
      }
    },
    session: {
      session: {
        authenticated: {
          user_id: 1
        }
      }
    }
  });

  let done = assert.async();
  service.loadCurrentUser().then((user) => {
    assert.equal(get(user, 'id'), 1);
    assert.equal(get(service, 'user'), user);
    done();
  });
});

test('it rejects when the user is not returned from the store', function(assert) {
  assert.expect(1);
  let service = this.subject({
    store: {
      find() {
        return RSVP.reject();
      }
    },
    session: {
      session: {
        authenticated: {
          user_id: 1
        }
      }
    }
  });

  let done = assert.async();
  service.loadCurrentUser().catch(() => {
    assert.ok(true);
    done();
  });
});


text:
<!doctype html>

<meta charset="utf-8">
<title>Useless Trivia about Windows Process IDs – Half Full of Security</title>
<meta name="description" content="">
<meta name="keywords" content="">

<meta name="twitter:title" content="Useless Trivia about Windows Process IDs">
<meta name="twitter:description" content="">
<meta name="twitter:site" content="@GlassDFIR">
<meta name="twitter:creator" content="@GlassDFIR">

<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://jon.glass/images/site-logo.png">

<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Useless Trivia about Windows Process IDs">
<meta property="og:description" content="">
<meta property="og:url" content="https://jon.glass/blog/notes-about-windows-process-ids/">
<meta property="og:site_name" content="Half Full of Security">

<link rel="canonical" href="https://jon.glass/blog/notes-about-windows-process-ids/">
<link href="https://jon.glass/feed.xml" type="application/atom+xml" rel="alternate" title="Half Full of Security Feed">

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="https://jon.glass/assets/css/main.css">

<meta http-equiv="cleartype" content="on">

<link rel="shortcut icon" href="https://jon.glass/favicon.ico">

<link rel="shortcut icon" href="https://jon.glass/favicon.png">

<link rel="apple-touch-icon-precomposed" href="https://jon.glass/images/apple-touch-icon-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://jon.glass/images/apple-touch-icon-72x72-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://jon.glass/images/apple-touch-icon-114x114-precomposed.png">

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://jon.glass/images/apple-touch-icon-144x144-precomposed.png">

Blog

ADFIRWMC

Tips and Tricks

About

Search

Half Full of Security

Sharpening the ACKs since 2013

Useless Trivia about Windows Process IDs

        <time datetime="2015-02-20T11:05:14-05:00"> February 20, 2015</time>

Here are somethings I discovered about Windows Process IDs that I did not previously know...

ProcessIDs are stored as DWORDs.

A DWORD is a 32-bit unsigned integer (range: 0 through 4294967295 decimal).

ProcessIDs are divisible by 4 so the highest possible pid is 4,294,967,292.

Since they are divisible by 4, there are only 1,073,741,823 possible PIDs.

I wrote a script to keep launching and closing "calc.exe" until it gave me the PID I wanted.

On average, it took around 103 tries to get the pid I wanted.

I knew PIDs get reused all the time but its weird that it happens so often.

The whole problem with the sysmonmap from here

is that there was a PID reused in under a second. That has got to cause other problems than just logging.

I am not investing any actual research time on this but I am documenting the trivia nonetheless.

        Previous

        Next

© 2020 Jon Glass. Powered by Jekyll using the So Simple Theme.


text:
from __future__ import unicode_literals

from django.db import models, migrations
from django.contrib.postgres.operations import HStoreExtension
import django.utils.timezone

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        HStoreExtension(),
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('done', models.NullBooleanField()),
                ('subject', models.CharField(max_length=255, null=True, blank=True)),
                ('note', models.CharField(max_length=1024, null=True, blank=True)),
                ('type', models.CharField(max_length=255, null=True, blank=True)),
                ('due_date', models.DateField(null=True, blank=True)),
                ('due_time', models.TimeField(null=True, blank=True)),
                ('duration', models.TimeField(null=True, blank=True)),
                ('marked_as_done_time', models.DateTimeField(null=True, blank=True)),
                ('active_flag', models.NullBooleanField()),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Deal',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('title', models.CharField(max_length=255, null=True, blank=True)),
                ('upload_timestamp', models.DateTimeField(null=True, blank=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('last_updated_at', models.DateTimeField(null=True, blank=True)),
                ('value', models.IntegerField(null=True)),
                ('external_stage_id', models.IntegerField(null=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('stage_change_time', models.DateTimeField(null=True, blank=True)),
                ('next_activity_date', models.DateField(null=True, blank=True)),
                ('next_activity_time', models.TimeField(null=True, blank=True)),
                ('last_activity_date', models.DateField(null=True, blank=True)),
                ('last_activity_time', models.TimeField(null=True, blank=True)),
                ('won_time', models.DateTimeField(null=True, blank=True)),
                ('last_incoming_mail_time', models.DateTimeField(null=True, blank=True)),
                ('last_outgoing_mail_time', models.DateTimeField(null=True, blank=True)),
                ('lost_time', models.DateTimeField(null=True, blank=True)),
                ('close_time', models.DateTimeField(null=True, blank=True)),
                ('lost_reason', models.CharField(max_length=255, null=True, blank=True)),
                ('visible_to', models.IntegerField(default=0, choices=[(0, b'private'), (3, b'shared')])),
                ('activities_count', models.IntegerField(null=True)),
                ('done_activities_count', models.IntegerField(null=True)),
                ('undone_activities_count', models.IntegerField(null=True)),
                ('email_messages_count', models.IntegerField(null=True)),
                ('expected_close_date', models.DateField(null=True, blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DealField',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('key', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('field_type', models.CharField(max_length=255)),
                ('active_flag', models.NullBooleanField()),
                ('mandatory_flag', models.NullBooleanField()),
                ('edit_flag', models.NullBooleanField()),
                ('is_subfield', models.NullBooleanField()),
                ('retrieved_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('content', models.CharField(max_length=1024, null=True, blank=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('active_flag', models.NullBooleanField()),
                ('deal', models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Deal', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('last_updated_at', models.DateTimeField(null=True, blank=True)),
                ('name', models.CharField(max_length=255, null=True, blank=True)),
                ('people_count', models.IntegerField(null=True)),
                ('open_deals_count', models.IntegerField(null=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('visible_to', models.IntegerField(default=0, choices=[(0, b'private'), (3, b'shared')])),
                ('next_activity_date', models.DateField(null=True, blank=True)),
                ('next_activity_time', models.TimeField(null=True, blank=True)),
                ('last_activity_date', models.DateField(null=True, blank=True)),
                ('last_activity_time', models.TimeField(null=True, blank=True)),
                ('won_deals_count', models.IntegerField(null=True)),
                ('lost_deals_count', models.IntegerField(null=True)),
                ('closed_deals_count', models.IntegerField(null=True)),
                ('activities_count', models.IntegerField(null=True)),
                ('done_activities_count', models.IntegerField(null=True)),
                ('undone_activities_count', models.IntegerField(null=True)),
                ('email_messages_count', models.IntegerField(null=True)),
                ('address', models.CharField(max_length=255, null=True, blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OrganizationField',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('key', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('field_type', models.CharField(max_length=255)),
                ('active_flag', models.NullBooleanField()),
                ('mandatory_flag', models.NullBooleanField()),
                ('edit_flag', models.NullBooleanField()),
                ('is_subfield', models.NullBooleanField()),
                ('retrieved_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('last_updated_at', models.DateTimeField(null=True, blank=True)),
                ('name', models.CharField(max_length=255, null=True, blank=True)),
                ('phone', models.CharField(max_length=255, null=True, blank=True)),
                ('email', models.CharField(max_length=255, null=True, blank=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('open_deals_count', models.IntegerField(null=True)),
                ('visible_to', models.IntegerField(default=0, choices=[(0, b'private'), (3, b'shared')])),
                ('next_activity_date', models.DateField(null=True, blank=True)),
                ('next_activity_time', models.TimeField(null=True, blank=True)),
                ('last_activity_date', models.DateField(null=True, blank=True)),
                ('last_activity_time', models.TimeField(null=True, blank=True)),
                ('won_deals_count', models.IntegerField(null=True)),
                ('lost_deals_count', models.IntegerField(null=True)),
                ('closed_deals_count', models.IntegerField(null=True)),
                ('activities_count', models.IntegerField(null=True)),
                ('done_activities_count', models.IntegerField(null=True)),
                ('undone_activities_count', models.IntegerField(null=True)),
                ('email_messages_count', models.IntegerField(null=True)),
                ('last_incoming_mail_time', models.DateTimeField(null=True, blank=True)),
                ('last_outgoing_mail_time', models.DateTimeField(null=True, blank=True)),
                ('org', models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Organization', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PersonField',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('key', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('field_type', models.CharField(max_length=255)),
                ('active_flag', models.NullBooleanField()),
                ('mandatory_flag', models.NullBooleanField()),
                ('edit_flag', models.NullBooleanField()),
                ('is_subfield', models.NullBooleanField()),
                ('retrieved_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Pipeline',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=255, null=True, blank=True)),
                ('url_title', models.CharField(max_length=255, null=True, blank=True)),
                ('active', models.NullBooleanField()),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('update_time', models.DateTimeField(null=True, blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Stage',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('pipeline_name', models.CharField(max_length=255, null=True, blank=True)),
                ('name', models.CharField(max_length=255)),
                ('order_nr', models.IntegerField(null=True, blank=True)),
                ('active_flag', models.NullBooleanField()),
                ('update_time', models.DateTimeField(null=True, blank=True)),
                ('add_time', models.DateTimeField(null=True, blank=True)),
                ('pipeline', models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Pipeline', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('external_id', models.IntegerField(db_index=True, unique=True, null=True, blank=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=255, null=True, blank=True)),
                ('email', models.CharField(max_length=255, null=True, blank=True)),
                ('phone', models.CharField(max_length=255, null=True, blank=True)),
                ('last_login', models.DateTimeField(null=True, blank=True)),
                ('created', models.DateTimeField(null=True, blank=True)),
                ('modified', models.DateTimeField(null=True, blank=True)),
                ('role_id', models.IntegerField(null=True, blank=True)),
                ('active_flag', models.NullBooleanField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='person',
            name='owner',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
        migrations.AddField(
            model_name='organization',
            name='owner',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
        migrations.AddField(
            model_name='note',
            name='org',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Organization', null=True),
        ),
        migrations.AddField(
            model_name='note',
            name='person',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Person', null=True),
        ),
        migrations.AddField(
            model_name='note',
            name='user',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
        migrations.AddField(
            model_name='deal',
            name='creator_user',
            field=models.ForeignKey(related_name='creator', to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
        migrations.AddField(
            model_name='deal',
            name='org',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Organization', null=True),
        ),
        migrations.AddField(
            model_name='deal',
            name='person',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Person', null=True),
        ),
        migrations.AddField(
            model_name='deal',
            name='pipeline',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Pipeline', null=True),
        ),
        migrations.AddField(
            model_name='deal',
            name='user',
            field=models.ForeignKey(related_name='user', to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
        migrations.AddField(
            model_name='activity',
            name='deal',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Deal', null=True),
        ),
        migrations.AddField(
            model_name='activity',
            name='org',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Organization', null=True),
        ),
        migrations.AddField(
            model_name='activity',
            name='person',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.Person', null=True),
        ),
        migrations.AddField(
            model_name='activity',
            name='user',
            field=models.ForeignKey(to_field=b'external_id', blank=True, to='pipedrive.User', null=True),
        ),
    ]


text:
package org.apache.commons.imaging.formats.png.chunks;

import java.io.ByteArrayInputStream;
import java.io.IOException;

public class PngChunkPhys extends PngChunk
{
    public final int PixelsPerUnitXAxis;
    public final int PixelsPerUnitYAxis;
    public final int UnitSpecifier;

    public PngChunkPhys(int Length, int ChunkType, int CRC, byte bytes[])
            throws IOException
    {
        super(Length, ChunkType, CRC, bytes);

        ByteArrayInputStream is = new ByteArrayInputStream(bytes);

        PixelsPerUnitXAxis = read4Bytes("PixelsPerUnitXAxis", is,
                "Not a Valid Png File: pHYs Corrupt");
        PixelsPerUnitYAxis = read4Bytes("PixelsPerUnitYAxis", is,
                "Not a Valid Png File: pHYs Corrupt");
        UnitSpecifier = readByte("Unit specifier", is,
                "Not a Valid Png File: pHYs Corrupt");
    }

}


text:
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.hyperledger.jackson;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.hyperledger.common.Script;

import java.io.IOException;
import java.util.Base64;

public class ScriptSerializer extends StdSerializer<Script> {
    public ScriptSerializer() {
        super(Script.class);
    }

    @Override
    public void serialize(Script value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        jgen.writeString(Base64.getEncoder().encodeToString(value.toByteArray()));
    }
}


text:
/**
 * rcmSwitchUserSwitchToUserSimple
 */
angular.module('rcmSwitchUser').directive(
    'rcmSwitchUserSwitchToUserHorizontal',
    [
        '$sce',
        '$window',
        function (
            $sce,
            $window
        ) {
            /**
             *
             * @param $scope
             * @param element
             * @param attrs
             */
            function link($scope, element, attrs) {

            }

            return {
                link: link,
                scope: {
                    propLoading: '=loading', // Bool
                    propIsSu: '=isSu', // Bool
                    propImpersonatedUser: '=impersonatedUser', // {User}
                    propSwitchBackMethod: '=switchBackMethod', // string ('auth' or 'basic')
                    propShowSwitchToUserNameField: '=showSwitchToUserNameField', // bool
                    propSwitchToUserName: '=switchToUserName', // string
                    propSwitchToUserNamePlaceholder: '=switchToUserNamePlaceholder', // string
                    propSwitchToUserNameButtonLabel: '=switchToUserNameButtonLabel', // string
                    propSwitchBackButtonLabel: '=switchBackButtonLabel', // string
                    propSuUserPassword: '=suUserPassword', // string
                    propSwitchUserInfoContentPrefix: '=switchUserInfoContentPrefix', // string
                    propMessage: '=message', // {message},
                    propOnSwitchTo: '=onSwitchTo', // function
                    propOnSwitchBack: '=onSwitchBack' // function
                },
                template: '<%= inlineTemplate("src/switch-to-user-directive-horizontal.html") %>'
            }
        }
    ]
);


text:
package com.navercorp.utilset.cipher;

/**
 * Cipher mode to be used for encryption<br>
 * Currently, default cipher algorithm, AES, is solely provided
 *
 * @author jaemin.woo
 */
public enum CipherMode {
		AES,
	}


text:
package org.apache.flink.streaming.connectors.kafka;

import org.apache.flink.streaming.util.serialization.JSONDeserializationSchema;

import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode;

import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;

/**
 * Tests for the {@link JSONDeserializationSchema}.
 */
public class JSONDeserializationSchemaTest {
	@Test
	public void testDeserialize() throws IOException {
		ObjectMapper mapper = new ObjectMapper();
		ObjectNode initialValue = mapper.createObjectNode();
		initialValue.put("key", 4).put("value", "world");
		byte[] serializedValue = mapper.writeValueAsBytes(initialValue);

		JSONDeserializationSchema schema = new JSONDeserializationSchema();
		ObjectNode deserializedValue = schema.deserialize(serializedValue);

		Assert.assertEquals(4, deserializedValue.get("key").asInt());
		Assert.assertEquals("world", deserializedValue.get("value").asText());
	}
}


text:
from __future__ import absolute_import, division, print_function

import os, sys

import idaapi
from PyQt5.QtGui import QFontDatabase

_type_key_table = {
    'disas': 'Font\\Disassembly',
    'hexview': 'Font\\Hex view',
    'debug_regs': 'Font\\Debug registers',
    'text_input': 'Font\\Text input',
    'output_wnd': 'Font\\Output window',
}

class IdaFontConfig(object):
    """Read access to IDA's (undocumented) font config."""
    def __init__(self, type):
        self._key = _type_key_table[type]

    @property
    def family(self):
        return idaapi.reg_read_string(
            'Name',
            self._key,
            'Consolas'
            if os.name == 'nt' else
            QFontDatabase.systemFont(QFontDatabase.FixedFont).family().encode()
        )

    @property
    def size(self):
        return idaapi.reg_read_int('Size', 10, self._key)

    @property
    def bold(self):
        return idaapi.reg_read_bool('Bold', False, self._key)

    @property
    def italic(self):
        return idaapi.reg_read_bool('Italic', False, self._key)


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>C_STANDARD — CMake 3.8.2 Documentation</title>

    <link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

    <link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="C_STANDARD_REQUIRED" href="C_STANDARD_REQUIRED.html" />
    <link rel="prev" title="C_EXTENSIONS" href="C_EXTENSIONS.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.8.2 Documentation »

cmake-properties(7) »

C_STANDARD¶

The C standard whose features are requested to build this target.

This property specifies the C standard whose features are requested
to build this target.  For some compilers, this results in adding a
flag such as -std=gnu11 to the compile line.  For compilers that
have no notion of a standard level, such as MSVC, this has no effect.

Supported values are 90, 99 and 11.

If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead.  This
means that using:

set_property(TARGET tgt PROPERTY C_STANDARD 11)

with a compiler which does not support -std=gnu11 or an equivalent
flag will not result in an error or warning, but will instead add the
-std=gnu99 or -std=gnu90 flag if supported.  This “decay” behavior may
be controlled with the C_STANDARD_REQUIRED target property.
Additionally, the C_EXTENSIONS target property may be used to
control whether compiler-specific extensions are enabled on a per-target basis.

See the cmake-compile-features(7) manual for information on
compile features and a list of supported compilers.

This property is initialized by the value of
the CMAKE_C_STANDARD variable if it is set when a target
is created.

Previous topic

C_EXTENSIONS

Next topic

C_STANDARD_REQUIRED

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.8.2 Documentation »

cmake-properties(7) »

        © Copyright 2000-2017 Kitware, Inc. and Contributors.
      Created using Sphinx 1.5.2.


text:
What should I watch?
====

A site to help you select what movie to watch. Built on the MEAN stack and powered by [trakt.tv](http://trakt.tv).

Available [here](http://whatshouldiwat.ch).

##Todo:
* Placeholders for when there is no information
* A lot more sources


text:
using System;
using System.Runtime.InteropServices;

namespace SharpVk
{
    /// <summary>
    ///
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public partial struct BaseOutStructure
    {
        /// <summary>
        /// The type of this structure.
        /// </summary>
        public SharpVk.StructureType SType
        {
            get;
            set;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="pointer">
        /// </param>
        internal unsafe void MarshalTo(SharpVk.Interop.BaseOutStructure* pointer)
        {
            pointer->SType = this.SType;
            pointer->Next = null;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="pointer">
        /// </param>
        internal static unsafe BaseOutStructure MarshalFrom(SharpVk.Interop.BaseOutStructure* pointer)
        {
            BaseOutStructure result = default(BaseOutStructure);
            result.SType = pointer->SType;
            return result;
        }
    }
}


text:
namespace content {

namespace service_worker_loader_helpers {

namespace {

bool IsPathRestrictionSatisfied(const GURL& scope, const GURL& script_url) {
  std::string error_message;
  return service_worker_loader_helpers::IsPathRestrictionSatisfied(
      scope, script_url, nullptr, &error_message);
}

bool IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
    const GURL& scope,
    const GURL& script_url,
    const std::string& service_worker_allowed) {
  std::string error_message;
  return service_worker_loader_helpers::IsPathRestrictionSatisfied(
      scope, script_url, &service_worker_allowed, &error_message);
}

}  // namespace

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_Basic) {
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/"),
                                         GURL("http://example.com/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                         GURL("http://example.com/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                         GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar"),
                                         GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(IsPathRestrictionSatisfied(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(IsPathRestrictionSatisfied(
      GURL("http://example.com/bar/"), GURL("http://example.com/foo/sw.js")));

  // The scope is under the script directory, but that doesn't have the trailing
  // slash. In this case, the check should be failed.
  EXPECT_FALSE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo"), GURL("http://example.com/foo/sw.js")));

  // Query parameters should not affect the path restriction.
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/?query"),
                                         GURL("http://example.com/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo/?query"),
                                         GURL("http://example.com/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo/?query"),
                                         GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(IsPathRestrictionSatisfied(
      GURL("http://example.com/?query"), GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/bar/query?"),
                                 GURL("http://example.com/foo/sw.js")));

  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/"), GURL("http://example.com/sw.js?query")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/"), GURL("http://example.com/sw.js?query")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/foo/sw.js?query")));
  EXPECT_FALSE(IsPathRestrictionSatisfied(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js?query")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/bar/"),
                                 GURL("http://example.com/foo/sw.js?query")));

  // Query parameter including a slash should not affect.
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key/value"),
      GURL("http://example.com/foo/sw.js?key=value")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key=value"),
      GURL("http://example.com/foo/sw.js?key/value")));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_SelfReference) {
  // Self reference is canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/bar"),
            GURL("http://example.com/././foo/bar"));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/././foo/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/././foo/"),
                                         GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/./"),
                                 GURL("http://example.com/./foo/sw.js")));

  // URL-encoded dot ('%2e') is also canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/././bar"),
            GURL("http://example.com/foo/%2e/%2e/bar"));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e/%2e/bar"),
                                 GURL("http://example.com/foo/%2e/%2e/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar"),
                                 GURL("http://example.com/foo/%2e/%2e/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e/%2e/bar"),
                                 GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e/bar"),
                                 GURL("http://example.com/%2e/foo/sw.js")));

  // URL-encoded dot ('%2E') is also canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/././bar"),
            GURL("http://example.com/foo/%2E/%2e/bar"));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_ParentReference) {
  // Parent reference is canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/bar"),
            GURL("http://example.com/foo/../foo/bar"));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar"),
                                 GURL("http://example.com/foo/../foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/../foo/bar"),
                                 GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar/../bar"),
                                 GURL("http://example.com/../foo/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/../../../foo/bar"),
      GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/../bar"),
                                 GURL("http://example.com/foo/sw.js")));

  // URL-encoded dot ('%2e') is also canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/../foo/bar"),
            GURL("http://example.com/foo/%2e%2e/foo/bar"));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar"),
      GURL("http://example.com/foo/%2e%2e/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e%2e/foo/bar"),
                                 GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e%2e/foo/bar"),
                                 GURL("http://example.com/%2e%2e/foo/sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/%2e%2e/%2e%2e/%2e%2e/foo/bar"),
      GURL("http://example.com/foo/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/%2e%2e/bar"),
                                 GURL("http://example.com/foo/sw.js")));

  // URL-encoded dot ('%2E') is also canonicalized.
  ASSERT_EQ(GURL("http://example.com/foo/../foo/bar"),
            GURL("http://example.com/foo/%2E%2E/foo/bar"));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_ConsecutiveSlashes) {
  // Consecutive slashes are not unified.
  ASSERT_NE(GURL("http://example.com/foo/bar"),
            GURL("http://example.com/foo///bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar"),
                                 GURL("http://example.com/foo///sw.js")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo///bar"),
                                         GURL("http://example.com/foo/sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo///bar"),
                                 GURL("http://example.com/foo///sw.js")));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_BackSlash) {
  // A backslash is converted to a slash.
  ASSERT_EQ(GURL("http://example.com/foo/bar"),
            GURL("http://example.com/foo\\bar"));
  EXPECT_TRUE(IsPathRestrictionSatisfied(GURL("http://example.com/foo\\bar"),
                                         GURL("http://example.com/foo/sw.js")));

  // Consecutive back slashes should not unified.
  ASSERT_NE(GURL("http://example.com/foo\\\\\\bar"),
            GURL("http://example.com/foo\\bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo\\bar"),
                                 GURL("http://example.com/foo\\\\\\sw.js")));
  EXPECT_TRUE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo\\\\\\bar"),
                                 GURL("http://example.com/foo\\sw.js")));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_DisallowedCharacter) {
  // URL-encoded slash ('%2f') is not canonicalized.
  ASSERT_NE(GURL("http://example.com/foo///bar"),
            GURL("http://example.com/foo/%2f/bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo%2fbar/"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar%2f"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar/"),
                                 GURL("http://example.com/foo/bar%2fsw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/foo/bar%2fsw.js")));

  // URL-encoded slash ('%2F') is also not canonicalized.
  ASSERT_NE(GURL("http://example.com/foo///bar"),
            GURL("http://example.com/foo/%2F/bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo%2Fbar/"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar%2F"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar/"),
                                 GURL("http://example.com/foo/bar%2Fsw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/foo/bar%2Fsw.js")));

  // URL-encoded backslash ('%5c') is not canonicalized.
  ASSERT_NE(GURL("http://example.com/foo/\\/bar"),
            GURL("http://example.com/foo/%5c/bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo%5cbar/"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar%5c"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar/"),
                                 GURL("http://example.com/foo/bar%5csw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/foo/bar%5csw.js")));

  // URL-encoded backslash ('%5C') is also not canonicalized.
  ASSERT_NE(GURL("http://example.com/foo/\\/bar"),
            GURL("http://example.com/foo/%5C/bar"));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo%5Cbar/"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar%5C"),
                                 GURL("http://example.com/foo/bar/sw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/bar/"),
                                 GURL("http://example.com/foo/bar%5Csw.js")));
  EXPECT_FALSE(
      IsPathRestrictionSatisfied(GURL("http://example.com/foo/"),
                                 GURL("http://example.com/foo/bar%5Csw.js")));

  // Query parameter should be able to have escaped characters.
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key%2fvalue"),
      GURL("http://example.com/foo/sw.js?key/value")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key/value"),
      GURL("http://example.com/foo/sw.js?key%2fvalue")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key%5cvalue"),
      GURL("http://example.com/foo/sw.js?key\\value")));
  EXPECT_TRUE(IsPathRestrictionSatisfied(
      GURL("http://example.com/foo/bar?key\\value"),
      GURL("http://example.com/foo/sw.js?key%5cvalue")));
}

TEST(ServiceWorkerLoaderHelpersTest, PathRestriction_ServiceWorkerAllowed) {
  // Setting header to default max scope changes nothing.
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/sw.js"),
      "http://example.com/"));
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js"),
      "http://example.com/foo/"));

  // Using the header to widen allowed scope.
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js"),
      "http://example.com/"));
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js"), "/"));
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/foo/sw.js"), ".."));
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/bar/"), GURL("http://example.com/foo/sw.js"),
      "../b"));
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/bar/"), GURL("http://example.com/foo/sw.js"),
      "../c"));

  // Using the header to restrict allowed scope.
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/sw.js"),
      "http://example.com/foo/"));
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/sw.js"), "foo"));
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/foo/"), GURL("http://example.com/sw.js"),
      "foo"));

  // Empty string resolves to max scope of "http://www.example.com/sw.js".
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/sw.js"), ""));
  EXPECT_TRUE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/sw.js/hi"), GURL("http://example.com/sw.js"),
      ""));

  // Cross origin header value is not accepted.
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/"), GURL("http://example.com/sw.js"),
      "http://other.com/"));
  EXPECT_FALSE(IsPathRestrictionSatisfiedWithServiceWorkerAllowedHeader(
      GURL("http://example.com/foo/"), GURL("http://example.com/bar/sw.js"),
      "http://other.com/foo/"));
}

}  // namespace service_worker_loader_helpers

}  // namespace content


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

namespace WATF.Plugin.HPST.Assert
{
    public class AreEqual : WATF.Plugin.HPST.Assert.Base, WATF.Plugin.IPlugin
    {
        public object StartMethod(object parent = null, Dictionary<string, object> parameters = null)
        {
            //throw new NotImplementedException();
            object actual = parent;
            if (!parameters.ContainsKey("Expected")) throw new ArgumentNullException("Expected");
            object expected = parameters["Expected"];
            bool equal = false;
            if (actual == null)
            {
                if (expected == null)
                {
                    equal = true;
                }
                else
                {
                    equal = false;
                }
            }
            else
            {
                equal = actual.Equals(expected);
            }
            if (!equal)
            {
                string message = parameters.ContainsKey("Message") ? (string)parameters["Message"] : "";
                base.AddReport(0, message,actual,expected);
            }
            return default(object);
        }

        public void EndMethod()
        {
            //throw new NotImplementedException();
        }
    }
}


text:
package com.my.lionrpc.client;

import com.my.lionrpc.protocol.MessageDecoder;
import com.my.lionrpc.protocol.MessageEncoder;
import com.my.lionrpc.protocol.RequestMessage;
import com.my.lionrpc.protocol.ResponseMessage;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

/**
 * Created by littlechen on 17/5/21.
 */
public class LionClientChannelInitializer extends ChannelInitializer<SocketChannel>{

    protected void initChannel(SocketChannel socketChannel) throws Exception {
        socketChannel.pipeline()
        		.addLast(new MessageEncoder(RequestMessage.class))
        		.addLast(new LengthFieldBasedFrameDecoder(65536,0,4,0,0))
                .addLast(new MessageDecoder(ResponseMessage.class))
                .addLast(new LionClientChannelInboundHandler());

    }
}


text:
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#include "../../include/formfiller/FormFiller.h"
#include "../../include/formfiller/FFL_FormFiller.h"
#include "../../include/formfiller/FFL_ListBox.h"
//#include "../../include/formfiller/FFL_Module.h"
#include "../../include/formfiller/FFL_IFormFiller.h"
//#include "../../include/formfiller/FFL_Undo.h"
#include "../../include/formfiller/FFL_CBA_Fontmap.h"

#define	FFL_DEFAULTLISTBOXFONTSIZE		12.0f

/* ------------------------------- CFFL_ListBox ------------------------------- */

CFFL_ListBox::CFFL_ListBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget) :
	CFFL_FormFiller(pApp, pWidget),
	m_pFontMap(NULL)
{
}

CFFL_ListBox::~CFFL_ListBox()
{
    delete m_pFontMap;
}

PWL_CREATEPARAM	CFFL_ListBox::GetCreateParam()
{
	PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();

	ASSERT(m_pWidget != NULL);
	FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags();

	if (dwFieldFlag & FIELDFLAG_MULTISELECT)
	{
		cp.dwFlags |= PLBS_MULTIPLESEL;
	}

	cp.dwFlags |= PWS_VSCROLL;

	if (cp.dwFlags & PWS_AUTOFONTSIZE)
		cp.fFontSize = FFL_DEFAULTLISTBOXFONTSIZE;

	if (!m_pFontMap)
	{
		m_pFontMap = new CBA_FontMap(m_pWidget, m_pApp->GetSysHandler());
		m_pFontMap->Initial();
	}
	cp.pFontMap = m_pFontMap;

	return cp;
}

CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
{
	CPWL_ListBox* pWnd = new CPWL_ListBox();
	pWnd->AttachFFLData(this);
	pWnd->Create(cp);

	ASSERT(m_pApp != NULL);
	CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
	pWnd->SetFillerNotify(pIFormFiller);

	for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
		pWnd->AddString(m_pWidget->GetOptionLabel(i).c_str());

	if (pWnd->HasFlag(PLBS_MULTIPLESEL))
	{
		m_OriginSelections.clear();

		FX_BOOL bSetCaret = FALSE;
		for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
		{
			if (m_pWidget->IsOptionSelected(i))
			{
				if (!bSetCaret)
				{
					pWnd->SetCaret(i);
					bSetCaret = TRUE;
				}
				pWnd->Select(i);
				m_OriginSelections.insert(i);
			}
		}
	}
	else
	{
		for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
		{
			if (m_pWidget->IsOptionSelected(i))
			{
				pWnd->Select(i);
				break;
			}
		}
	}

	pWnd->SetTopVisibleIndex(m_pWidget->GetTopVisibleIndex());

	return pWnd;
}

FX_BOOL	CFFL_ListBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags)
{
	return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}

FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView)
{
    CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE);
    if (!pListBox)
        return FALSE;

    if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) {
        int nSelCount = 0;
        for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; ++i) {
            if (pListBox->IsItemSelected(i)) {
                if (m_OriginSelections.count(i) == 0)
                    return TRUE;

                nSelCount++;
            }
        }

        return nSelCount != m_OriginSelections.size();
    }
    return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0);
}

void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView)
{
	ASSERT(m_pWidget != NULL);

	if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
	{
		CFX_IntArray aOldSelect, aNewSelect;

		{
			for (int i=0,sz=m_pWidget->CountOptions(); i<sz; i++)
			{
				if (m_pWidget->IsOptionSelected(i))
				{
					aOldSelect.Add(i);
				}
			}
		}

		int32_t nNewTopIndex = pListBox->GetTopVisibleIndex();

		m_pWidget->ClearSelection(FALSE);

		if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
		{
			for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++)
			{
				if (pListBox->IsItemSelected(i))
				{
					m_pWidget->SetOptionSelection(i, TRUE, FALSE);
					aNewSelect.Add(i);
				}
			}
		}
		else
		{
			m_pWidget->SetOptionSelection(pListBox->GetCurSel(), TRUE, FALSE);
			aNewSelect.Add(pListBox->GetCurSel());
		}

		m_pWidget->SetTopVisibleIndex(nNewTopIndex);
		m_pWidget->ResetFieldAppearance(TRUE);
		m_pWidget->UpdateField();
		SetChangeMark();
	}
}

void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
						PDFSDK_FieldAction& fa)
{
	switch (type)
	{
	case CPDF_AAction::Validate:
		if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
		{
			fa.sValue = L"";
		}
		else
		{
			if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
			{
				ASSERT(m_pWidget != NULL);
				int32_t nCurSel = pListBox->GetCurSel();
				if (nCurSel >= 0)
					fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
			}
		}
		break;
	case CPDF_AAction::LoseFocus:
	case CPDF_AAction::GetFocus:
		if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT)
		{
			fa.sValue = L"";
		}
		else
		{
			ASSERT(m_pWidget != NULL);
			int32_t nCurSel = m_pWidget->GetSelectedIndex(0);
			if (nCurSel >= 0)
				fa.sValue = m_pWidget->GetOptionLabel(nCurSel);
		}
		break;
	default:
		break;
	}
}

void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
								const PDFSDK_FieldAction& fa)
{
}

void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView)
{
	ASSERT(pPageView != NULL);

	if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
	{
		for (int32_t i=0,sz=pListBox->GetCount(); i<sz; i++)
		{
			if (pListBox->IsItemSelected(i))
			{
				m_State.Add(i);
			}
		}
	}
}

void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView)
{
	if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, FALSE))
	{
		for (int i=0,sz=m_State.GetSize(); i<sz; i++)
			pListBox->Select(m_State[i]);
	}
}

CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue)
{
	if (bRestoreValue)
		SaveState(pPageView);

	DestroyPDFWindow(pPageView);

	CPWL_Wnd* pRet = NULL;

	if (bRestoreValue)
	{
		RestoreState(pPageView);
		pRet = GetPDFWindow(pPageView, FALSE);
	}
	else
		pRet = GetPDFWindow(pPageView, TRUE);

	m_pWidget->UpdateField();

	return pRet;
}

void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag)
{
	ASSERT(m_pWidget != NULL);

	int nFlags = m_pWidget->GetFieldFlags();

	if (nFlags & FIELDFLAG_COMMITONSELCHANGE)
	{
		if (m_bValid)
		{
			CPDFSDK_PageView* pPageView = GetCurPageView();
			ASSERT(pPageView != NULL);

			if (CommitData(pPageView, nFlag))
			{
				DestroyPDFWindow(pPageView);
				m_bValid = FALSE;
			}
		}
	}
}


text:
package com.amazonservices.mws.jaxb;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
VoltageUnitOfMeasure的 Java 类。
 *
 *
以下模式片段指定包含在此类中的预期内容。
 *

 *

 * <simpleType name="VoltageUnitOfMeasure">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="volts"/>
 *     <enumeration value="millivolts"/>
 *     <enumeration value="microvolts"/>
 *     <enumeration value="nanovolts"/>
 *     <enumeration value="kilovolts"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "VoltageUnitOfMeasure")
@XmlEnum
public enum VoltageUnitOfMeasure {

    @XmlEnumValue("volts")
    VOLTS("volts"),
    @XmlEnumValue("millivolts")
    MILLIVOLTS("millivolts"),
    @XmlEnumValue("microvolts")
    MICROVOLTS("microvolts"),
    @XmlEnumValue("nanovolts")
    NANOVOLTS("nanovolts"),
    @XmlEnumValue("kilovolts")
    KILOVOLTS("kilovolts");
    private final String value;

    VoltageUnitOfMeasure(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static VoltageUnitOfMeasure fromValue(String v) {
        for (VoltageUnitOfMeasure c: VoltageUnitOfMeasure.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
//---------------------------------------------------------------------
// <copyright file="CommonQueryBuilder.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Test.Taupo.Query.Common
{
    using Microsoft.Test.Taupo.Common;
    using Microsoft.Test.Taupo.Contracts.EntityModel;
    using Microsoft.Test.Taupo.Query.Contracts;
    using Microsoft.Test.Taupo.Query.Contracts.CommonExpressions;

    /// <summary>
    /// Factory methods used to construct common QueryExpression tree nodes.
    /// </summary>
    public static class CommonQueryBuilder
    {
        private static QueryConstantExpression constantUnspecifiedTypeNull = new QueryConstantExpression(new QueryScalarValue(QueryUnspecifiedType.Instance, null, null, DummyQueryEvaluationStrategy.Instance));

        /// <summary>
        /// Gets the <see cref="QueryConstantExpression"/> which represents an untyped null.
        /// </summary>
        /// <returns>The untyped null <see cref="QueryConstantExpression"/>.</returns>
        public static QueryConstantExpression ConstantUnspecifiedTypeNull
        {
            get { return constantUnspecifiedTypeNull; }
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryAddExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryAddExpression"/> with the provided arguments.</returns>
        public static QueryExpression Add(this QueryExpression left, QueryExpression right)
        {
            return Add(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryAndExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryAndExpression"/> with the provided arguments.</returns>
        public static QueryExpression And(this QueryExpression left, QueryExpression right)
        {
            return And(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing an As operation
        /// </summary>
        /// <param name="source">The Argument for the type operation</param>
        /// <param name="typeToCompareAgainst">The Type to test against</param>
        /// <returns>The <see cref="QueryExpression"/> representing an IsOf operation</returns>
        public static QueryExpression As(this QueryExpression source, QueryType typeToCompareAgainst)
        {
            ExceptionUtilities.CheckArgumentNotNull(source, "source");
            ExceptionUtilities.CheckArgumentNotNull(typeToCompareAgainst, "typeToCompareAgainst");
            AssertNotUnresolvedType(typeToCompareAgainst);

            return new QueryAsExpression(source, typeToCompareAgainst);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing a Cast operation
        /// </summary>
        /// <param name="argument">The Argument for the type operation</param>
        /// <param name="typeToCastTo">The Type to test against</param>
        /// <returns>The <see cref="QueryExpression"/> representing a Cast operation</returns>
        public static QueryExpression Cast(this QueryExpression argument, QueryType typeToCastTo)
        {
            ExceptionUtilities.CheckArgumentNotNull(argument, "argument");
            ExceptionUtilities.CheckArgumentNotNull(typeToCastTo, "typeToCastTo");
            AssertNotUnresolvedType(typeToCastTo);

            return new QueryCastExpression(argument, typeToCastTo);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryCustomFunctionCallExpression"/>.
        /// </summary>
        /// <param name="function">The function to call.</param>
        /// <param name="arguments">The arguments for the function call.</param>
        /// <returns>The <see cref="QueryCustomFunctionCallExpression"/> with the provided arguments.</returns>
        public static QueryExpression Call(this Function function, params QueryExpression[] arguments)
        {
            return new QueryCustomFunctionCallExpression(QueryType.Unresolved, function, null, false, false, arguments);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryFunctionImportCallExpression"/>.
        /// </summary>
        /// <param name="functionImport">The function import to call.</param>
        /// <param name="arguments">The arguments for the function call.</param>
        /// <returns>The <see cref="QueryFunctionImportCallExpression"/> with the provided arguments.</returns>
        public static QueryExpression Call(this FunctionImport functionImport, params QueryExpression[] arguments)
        {
            return new QueryFunctionImportCallExpression(QueryType.Unresolved, functionImport, false, arguments);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryConstantExpression"/>.
        /// </summary>
        /// <param name="scalarValue">Scalar value.</param>
        /// <returns>The <see cref="QueryConstantExpression"/> with the provided arguments.</returns>
        public static QueryConstantExpression Constant(QueryScalarValue scalarValue)
        {
            ExceptionUtilities.CheckArgumentNotNull(scalarValue, "scalarValue");

            return new QueryConstantExpression(scalarValue);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryConstantExpression"/>.
        /// </summary>
        /// <param name="value">Value of the expression.</param>
        /// <returns>The <see cref="QueryConstantExpression"/> with the provided value.</returns>
        public static QueryConstantExpression Constant(object value)
        {
            return Constant(value, QueryType.UnresolvedPrimitive);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryConstantExpression"/>.
        /// </summary>
        /// <param name="value">Value of the expression.</param>
        /// <param name="valueType">Type of the expression.</param>
        /// <returns>The <see cref="QueryConstantExpression"/> with the provided arguments.</returns>
        public static QueryConstantExpression Constant(object value, QueryScalarType valueType)
        {
            ExceptionUtilities.CheckArgumentNotNull(valueType, "valueType");

            if (value == null)
            {
                ExceptionUtilities.Assert(!valueType.IsUnresolved, "When value is null type cannot be unresolved.");
            }

            return Constant(valueType.CreateValue(value));
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryDivideExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryDivideExpression"/> with the provided arguments.</returns>
        public static QueryExpression Divide(this QueryExpression left, QueryExpression right)
        {
            return Divide(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryEqualToExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryEqualToExpression"/> with the provided arguments.</returns>
        public static QueryExpression EqualTo(this QueryExpression left, QueryExpression right)
        {
            return EqualTo(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing a function parameter reference
        /// </summary>
        /// <param name="parameterName">The function parameter name</param>
        /// <returns>The <see cref="QueryExpression"/> representing a function parameter reference</returns>
        public static QueryExpression FunctionParameterReference(string parameterName)
        {
            ExceptionUtilities.CheckStringArgumentIsNotNullOrEmpty(parameterName, "parameterName");

            return new QueryFunctionParameterReferenceExpression(parameterName, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryGreaterThanExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryGreaterThanExpression"/> with the provided arguments.</returns>
        public static QueryExpression GreaterThan(this QueryExpression left, QueryExpression right)
        {
            return GreaterThan(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryGreaterThanOrEqualToExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryGreaterThanOrEqualToExpression"/> with the provided arguments.</returns>
        public static QueryExpression GreaterThanOrEqualTo(this QueryExpression left, QueryExpression right)
        {
            return GreaterThanOrEqualTo(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create <see cref="QueryIsNotNullExpression"/>.
        /// </summary>
        /// <param name="argument">Argument for the expression.</param>
        /// <returns>The <see cref="QueryIsNotNullExpression"/> with the provided argument.</returns>
        public static QueryExpression IsNotNull(this QueryExpression argument)
        {
            ExceptionUtilities.CheckArgumentNotNull(argument, "argument");

            return new QueryIsNotNullExpression(argument, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create <see cref="QueryIsNullExpression"/>.
        /// </summary>
        /// <param name="argument">Argument for the expression.</param>
        /// <returns>The <see cref="QueryIsNullExpression"/> with the provided argument.</returns>
        public static QueryExpression IsNull(this QueryExpression argument)
        {
            ExceptionUtilities.CheckArgumentNotNull(argument, "argument");

            return new QueryIsNullExpression(argument, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing an IsOf operation
        /// </summary>
        /// <param name="argument">The Argument for the type operation</param>
        /// <param name="typeToCompareAgainst">The Type to test against</param>
        /// <returns>The <see cref="QueryExpression"/> representing an IsOf operation</returns>
        public static QueryExpression IsOf(this QueryExpression argument, QueryType typeToCompareAgainst)
        {
            ExceptionUtilities.CheckArgumentNotNull(argument, "argument");
            ExceptionUtilities.CheckArgumentNotNull(typeToCompareAgainst, "typeToCompareAgainst");
            AssertNotUnresolvedType(typeToCompareAgainst);

            var boolType = typeToCompareAgainst.EvaluationStrategy.BooleanType;
            return new QueryIsOfExpression(argument, typeToCompareAgainst, boolType);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryLessThanExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryLessThanExpression"/> with the provided arguments.</returns>
        public static QueryExpression LessThan(this QueryExpression left, QueryExpression right)
        {
            return LessThan(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryLessThanOrEqualToExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryLessThanOrEqualToExpression"/> with the provided arguments.</returns>
        public static QueryExpression LessThanOrEqualTo(this QueryExpression left, QueryExpression right)
        {
            return LessThanOrEqualTo(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryModuloExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryModuloExpression"/> with the provided arguments.</returns>
        public static QueryExpression Modulo(this QueryExpression left, QueryExpression right)
        {
            return Modulo(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryMultiplyExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryMultiplyExpression"/> with the provided arguments.</returns>
        public static QueryExpression Multiply(this QueryExpression left, QueryExpression right)
        {
            return Multiply(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryNotEqualToExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryNotEqualToExpression"/> with the provided arguments.</returns>
        public static QueryExpression NotEqualTo(this QueryExpression left, QueryExpression right)
        {
            return NotEqualTo(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryNotExpression"/>.
        /// </summary>
        /// <param name="expression">The operand.</param>
        /// <returns>The <see cref="QueryNotExpression"/> with the provided arguments.</returns>
        public static QueryExpression Not(this QueryExpression expression)
        {
            return Not(expression, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing a Null keyword
        /// </summary>
        /// <param name="type">Type of the Null keyword.</param>
        /// <returns>The <see cref="QueryExpression"/> representing the Null keyword</returns>
        public static QueryExpression Null(QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(type, "type");
            AssertNotUnresolvedType(type);

            return new QueryNullExpression(type);
        }

        /// <summary>
        /// Factory method to create a <see cref="QueryExpression"/> representing an OfType operation
        /// </summary>
        /// <param name="source">The source collection</param>
        /// <param name="typeToFilterAgainst">The Type to test against</param>
        /// <returns>The <see cref="QueryExpression"/> representing an OfType operation</returns>
        public static QueryExpression OfType(this QueryExpression source, QueryType typeToFilterAgainst)
        {
            ExceptionUtilities.CheckArgumentNotNull(source, "source");
            ExceptionUtilities.CheckArgumentNotNull(typeToFilterAgainst, "typeToFilterAgainst");
            AssertNotUnresolvedType(typeToFilterAgainst);

            return new QueryOfTypeExpression(source, typeToFilterAgainst, typeToFilterAgainst.CreateCollectionType());
        }

        /// <summary>
        /// Factory method to create the <see cref="QuerySubtractExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QuerySubtractExpression"/> with the provided arguments.</returns>
        public static QueryExpression Subtract(this QueryExpression left, QueryExpression right)
        {
            return Subtract(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryOrExpression"/>.
        /// </summary>
        /// <param name="left">The left operand.</param>
        /// <param name="right">The right operand.</param>
        /// <returns>The <see cref="QueryOrExpression"/> with the provided arguments.</returns>
        public static QueryExpression Or(this QueryExpression left, QueryExpression right)
        {
            return Or(left, right, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryPropertyExpression"/>.
        /// </summary>
        /// <param name="instance">Instance expression.</param>
        /// <param name="queryProperty">The property.</param>
        /// <returns>The <see cref="QueryPropertyExpression"/> with the provided instance, name and type.</returns>
        public static QueryExpression Property(this QueryExpression instance, QueryProperty queryProperty)
        {
            ExceptionUtilities.CheckArgumentNotNull(instance, "instance");
            ExceptionUtilities.CheckArgumentNotNull(queryProperty, "queryProperty");

            return instance.Property(queryProperty.Name);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryPropertyExpression"/>.
        /// </summary>
        /// <param name="instance">Instance expression.</param>
        /// <param name="name">Name of the property.</param>
        /// <returns>The <see cref="QueryPropertyExpression"/> with the provided instance, name and type.</returns>
        public static QueryExpression Property(this QueryExpression instance, string name)
        {
            return instance.Property(name, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryPropertyExpression"/>.
        /// </summary>
        /// <param name="instance">Instance expression.</param>
        /// <param name="name">Name of the property.</param>
        /// <param name="type">Type of the property.</param>
        /// <returns>The <see cref="QueryPropertyExpression"/> with the provided instance, name and type.</returns>
        public static QueryExpression Property(this QueryExpression instance, string name, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(instance, "instance");
            ExceptionUtilities.CheckStringArgumentIsNotNullOrEmpty(name, "name");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryPropertyExpression(instance, name, type);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryRootExpression"/>.
        /// </summary>
        /// <param name="name">Unqualified name of the source query.</param>
        /// <param name="expressionType">Type of the expression.</param>
        /// <returns>The <see cref="QueryRootExpression"/> with the provided instance, name and type.</returns>
        public static QueryExpression Root(string name, QueryType expressionType)
        {
            ExceptionUtilities.CheckArgumentNotNull(name, "name");
            ExceptionUtilities.CheckArgumentNotNull(expressionType, "expressionType");
            AssertNotUnresolvedType(expressionType);

            return new QueryRootExpression(name, expressionType);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryRootExpression"/> for the given entity set.
        /// </summary>
        /// <param name="entitySet">The underlying entity set for the root query.</param>
        /// <returns>The <see cref="QueryRootExpression"/> with the specified underlying entity set.</returns>
        public static QueryExpression Root(EntitySet entitySet)
        {
            ExceptionUtilities.CheckArgumentNotNull(entitySet, "entitySet");

            return new QueryRootExpression(entitySet, QueryType.Unresolved);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryCustomFunctionCallExpression"/> which is a root expression.
        /// </summary>
        /// <param name="function">The function to call.</param>
        /// <param name="arguments">The arguments for the function call.</param>
        /// <returns>The <see cref="QueryCustomFunctionCallExpression"/> with the provided arguments.</returns>
        public static QueryExpression AsRootQuery(this Function function, params QueryExpression[] arguments)
        {
            return new QueryCustomFunctionCallExpression(QueryType.Unresolved, function, null, true, false, arguments);
        }

        /// <summary>
        /// Factory method to create the <see cref="QueryCustomFunctionCallExpression"/> which is a root expression.
        /// </summary>
        /// <param name="functionImport">The function import to call.</param>
        /// <param name="arguments">The arguments for the function import call.</param>
        /// <returns>The <see cref="QueryFunctionImportCallExpression"/> with the provided arguments.</returns>
        public static QueryExpression AsRootQuery(this FunctionImport functionImport, params QueryExpression[] arguments)
        {
            return new QueryFunctionImportCallExpression(QueryType.Unresolved, functionImport, true, arguments);
        }

        internal static QueryExpression Add(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryAddExpression(left, right, type);
        }

        internal static QueryExpression And(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryAndExpression(left, right, type);
        }

        internal static QueryExpression Divide(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryDivideExpression(left, right, type);
        }

        internal static QueryExpression EqualTo(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryEqualToExpression(left, right, type);
        }

        internal static QueryExpression GreaterThan(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryGreaterThanExpression(left, right, type);
        }

        internal static QueryExpression GreaterThanOrEqualTo(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryGreaterThanOrEqualToExpression(left, right, type);
        }

        internal static QueryExpression LessThan(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryLessThanExpression(left, right, type);
        }

        internal static QueryExpression LessThanOrEqualTo(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryLessThanOrEqualToExpression(left, right, type);
        }

        internal static QueryExpression Modulo(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryModuloExpression(left, right, type);
        }

        internal static QueryExpression Multiply(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryMultiplyExpression(left, right, type);
        }

        internal static QueryExpression NotEqualTo(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryNotEqualToExpression(left, right, type);
        }

        internal static QueryExpression Not(this QueryExpression expression, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(expression, "expression");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryNotExpression(expression, type);
        }

        internal static QueryExpression Subtract(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QuerySubtractExpression(left, right, type);
        }

        internal static QueryExpression Or(this QueryExpression left, QueryExpression right, QueryType type)
        {
            ExceptionUtilities.CheckArgumentNotNull(right, "right");
            ExceptionUtilities.CheckArgumentNotNull(left, "left");
            ExceptionUtilities.CheckArgumentNotNull(type, "type");

            return new QueryOrExpression(left, right, type);
        }

        private static void AssertNotUnresolvedType(QueryType type)
        {
            ExceptionUtilities.Assert(!type.IsUnresolved, "Type must not be unresolved.");
        }
    }
}


text:
<!DOCTYPE html>

    <title>Type Definitions  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">

    <link rel='shortcut icon' href='https://mapzen.com/common/styleguide/images/favicon.ico' type='image/x-icon' />

          Mapzen Docs

         (99% documented)

            View on GitHub

      Mapzen Reference

      Type Definitions  Reference

            Classes

                TGGeoPolygon

                TGGeoPolyline

                TGHttpHandler

                TGLabelPickResult

                TGMapViewController

                TGMarkerPickResult

                TGSceneUpdate

            Constants

                TangramMapVersionNumber

                TangramMapVersionString

            Enums

                TGCameraType

                TGDebugFlag

                TGEaseType

                TGLabelType

            Protocols

                TGMapViewDelegate

                TGRecognizerDelegate

            Type Definitions

                TGDownloadCompletionHandler

                TGMapMarkerId

            Functions

                TGGeoPointMake

            Structs

                TGGeoPoint

Type Definitions

The following type definitions are available globally.

                    TGDownloadCompletionHandler

A network request completion callback, called when a download request of TGHttpHandler
completed an asynchronous request.

Declaration

Objective-C

typedef void (^TGDownloadCompletionHandler)(NSData *_Nullable,
                                            NSURLResponse *_Nullable,
                                            NSError *_Nullable)

Swift

typealias TGDownloadCompletionHandler = (Data?, URLResponse?, Error?) -> Void

                    TGMapMarkerId

A marker identifier for use in the marker interface.
A marker identifier of 0 is non-valid.

Declaration

Objective-C

typedef uint32_t TGMapMarkerId

Swift

typealias TGMapMarkerId = UInt32

© 2017 Mapzen.

Generated by jazzy ♪♫ v0.7.3, a Realm project.


text:
package sample.test.service;

import org.junit.jupiter.api.Test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * JSON tests for {@link VehicleDetails}.
 *
 * @author Phillip Webb
 */
@JsonTest
class VehicleDetailsJsonTests {

	@Autowired
	private JacksonTester<VehicleDetails> json;

	@Test
	void serializeJson() throws Exception {
		VehicleDetails details = new VehicleDetails("Honda", "Civic");
		assertThat(this.json.write(details)).isEqualTo("vehicledetails.json");
		assertThat(this.json.write(details)).isEqualToJson("vehicledetails.json");
		assertThat(this.json.write(details)).hasJsonPathStringValue("@.make");
		assertThat(this.json.write(details)).extractingJsonPathStringValue("@.make")
				.isEqualTo("Honda");
	}

	@Test
	void deserializeJson() throws Exception {
		String content = "{\"make\":\"Ford\",\"model\":\"Focus\"}";
		assertThat(this.json.parse(content))
				.isEqualTo(new VehicleDetails("Ford", "Focus"));
		assertThat(this.json.parseObject(content).getMake()).isEqualTo("Ford");
	}

}


text:
THISDIR=$(readlink -f $(dirname $0))

cd $THISDIR/..

BUILDDIR=$(mktemp -d)
VERSION=$(cat VERSION)

cp -a $THISDIR/.. $BUILDDIR/treesum-$VERSION

cd $BUILDDIR

tar cfz treesum-$VERSION.tar.gz treesum-$VERSION

[ $? -ne 0 ] && echo ' error: failed to create tarball' && exit 1

echo ${BUILDDIR}/treesum-${VERSION}.tar.gz