text:
#endregion

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;

namespace Dynastream.Fit
{
   ///
   /// Implements the TrainingFile profile message.
   ///
   public class TrainingFileMesg : Mesg
   {
      #region Fields
      static class ProductSubfield
      {
         public static ushort GarminProduct = 0;
         public static ushort Subfields = 1;
         public static ushort Active = Fit.SubfieldIndexActiveSubfield;
         public static ushort MainField = Fit.SubfieldIndexMainField;
      }
      #endregion

      #region Constructors
      public TrainingFileMesg() : base(Profile.mesgs[Profile.TrainingFileIndex])
      {
      }

      public TrainingFileMesg(Mesg mesg) : base(mesg)
      {
      }
      #endregion // Constructors

      #region Methods
      ///
      /// Retrieves the Timestamp field
      /// <returns>Returns DateTime representing the Timestamp field</returns>
      public DateTime GetTimestamp()
      {
         return TimestampToDateTime((uint?)GetFieldValue(253, 0, Fit.SubfieldIndexMainField));
      }

      ///
      /// Set Timestamp field
      /// <param name="timestamp_">Nullable field value to be set</param>
      public void SetTimestamp(DateTime timestamp_)
      {
         SetFieldValue(253, 0, timestamp_.GetTimeStamp(), Fit.SubfieldIndexMainField);
      }

      ///
      /// Retrieves the Type field
      /// <returns>Returns nullable File enum representing the Type field</returns>
      new public File? GetType()
      {
         object obj = GetFieldValue(0, 0, Fit.SubfieldIndexMainField);
         File? value = obj == null ? (File?)null : (File)obj;
         return value;
      }

      ///
      /// Set Type field
      /// <param name="type_">Nullable field value to be set</param>
      public void SetType(File? type_)
      {
         SetFieldValue(0, 0, type_, Fit.SubfieldIndexMainField);
      }

      ///
      /// Retrieves the Manufacturer field
      /// <returns>Returns nullable ushort representing the Manufacturer field</returns>
      public ushort? GetManufacturer()
      {
         return (ushort?)GetFieldValue(1, 0, Fit.SubfieldIndexMainField);
      }

      ///
      /// Set Manufacturer field
      /// <param name="manufacturer_">Nullable field value to be set</param>
      public void SetManufacturer(ushort? manufacturer_)
      {
         SetFieldValue(1, 0, manufacturer_, Fit.SubfieldIndexMainField);
      }

      ///
      /// Retrieves the Product field
      /// <returns>Returns nullable ushort representing the Product field</returns>
      public ushort? GetProduct()
      {
         return (ushort?)GetFieldValue(2, 0, Fit.SubfieldIndexMainField);
      }

      ///
      /// Set Product field
      /// <param name="product_">Nullable field value to be set</param>
      public void SetProduct(ushort? product_)
      {
         SetFieldValue(2, 0, product_, Fit.SubfieldIndexMainField);
      }

      ///
      /// Retrieves the GarminProduct subfield
      /// <returns>Nullable ushort representing the GarminProduct subfield</returns>
      public ushort? GetGarminProduct()
      {
         return (ushort?)GetFieldValue(2, 0, ProductSubfield.GarminProduct);
      }

      ///
      ///
      /// Set GarminProduct subfield
      /// <param name="garminProduct">Subfield value to be set</param>
      public void SetGarminProduct(ushort? garminProduct)
      {
         SetFieldValue(2, 0, garminProduct, ProductSubfield.GarminProduct);
      }
      ///
      /// Retrieves the SerialNumber field
      /// <returns>Returns nullable uint representing the SerialNumber field</returns>
      public uint? GetSerialNumber()
      {
         return (uint?)GetFieldValue(3, 0, Fit.SubfieldIndexMainField);
      }

      ///
      /// Set SerialNumber field
      /// <param name="serialNumber_">Nullable field value to be set</param>
      public void SetSerialNumber(uint? serialNumber_)
      {
         SetFieldValue(3, 0, serialNumber_, Fit.SubfieldIndexMainField);
      }

      ///
      /// Retrieves the TimeCreated field
      /// <returns>Returns DateTime representing the TimeCreated field</returns>
      public DateTime GetTimeCreated()
      {
         return TimestampToDateTime((uint?)GetFieldValue(4, 0, Fit.SubfieldIndexMainField));
      }

      ///
      /// Set TimeCreated field
      /// <param name="timeCreated_">Nullable field value to be set</param>
      public void SetTimeCreated(DateTime timeCreated_)
      {
         SetFieldValue(4, 0, timeCreated_.GetTimeStamp(), Fit.SubfieldIndexMainField);
      }

      #endregion // Methods
   } // Class
} // namespace


text:
from django.test import TestCase

from json_patch.exceptions import PatchException, PointerException
from json_patch.operations import AddOperation
from json_patch.patch import Patch
from tests.models import (
    Author,
    Book,
)

class TestPatch(TestCase):

    def test_patch_exception_raised_when_operation_is_unsupported(self):
        patch = Patch([])
        with self.assertRaises(PatchException):
            patch.get_operation_class('mock')

    def test_add_operation_class_returned_for_operation_add_(self):
        patch = Patch([])
        add_operation_class = patch.get_operation_class('add')
        self.assertEqual(add_operation_class, AddOperation)

    def test_patch_exception_raised_when_operation_type_missing(self):
        invalid_operation = {
            'value': 'mock',
        }

        patch = Patch([])
        with self.assertRaises(PatchException):
            patch.get_operation(invalid_operation)

    def test_patch_exception_raised_when_operation_path_missing(self):
        invalid_operation = {
            'op': 'add',
            'value': 'mock',
        }

        patch = Patch([])
        with self.assertRaises(PatchException):
            patch.get_operation(invalid_operation)

    def test_add_exception_instance_returned_for_operation_add(self):
        operation = {
            'op': 'add',
            'path': '/0',
            'value': 'mock',
        }

        patch = Patch([])
        add_operation = patch.get_operation(operation)
        self.assertIsInstance(add_operation, AddOperation)

class TestPatchAddOperation(TestCase):

    def test_author_is_created_in_list(self):
        add_author_diff = [
            {
                'op': 'add',
                'path': '/0',
                'value': {
                    'id': 1,
                    'name': 'Jane'
                }
            }
        ]

        patch = Patch(add_author_diff)
        authors = Author.objects.all()
        patch.apply(authors)

        author = Author.objects.get(pk=1)
        self.assertEqual(author.name, 'Jane')

    def test_author_is_created_in_single_object(self):
        add_author_diff = [
            {
                'op': 'add',
                'path': '/',
                'value': {
                    'id': 1,
                    'name': 'Jane'
                }
            }
        ]

        patch = Patch(add_author_diff)
        authors = Author.objects.none()
        patch.apply(authors)

        author = Author.objects.get(pk=1)
        self.assertEqual(author.name, 'Jane')

    def test_nested_book_is_created_in_list(self):
        author = Author.objects.create(name='Jane')
        add_book_diff = [
            {
                'op': 'add',
                'path': '/0/books/0',
                'value': {
                    'id': 1,
                    'title': 'Book one',
                    'author': 1
                }
            }
        ]
        patch = Patch(add_book_diff)
        authors = Author.objects.all()
        patch.apply(authors)

        books = Book.objects.filter(author=author).all()
        self.assertEqual(books[0].title, 'Book one')

    def test_exception_throw_when_adding_invalid_path(self):
        add_author_diff = [
            {
                'op': 'add',
                'path': '/0/books/0',
                'value': {
                    'id': 1,
                    'title': 'Book one',
                    'author': 1
                }
            }
        ]

        patch = Patch(add_author_diff)
        authors = Author.objects.all()

        with self.assertRaises(PointerException):
            patch.apply(authors)

class TestPatchReplaceOperation(TestCase):

    def test_author_name_is_replaced_in_list(self):
        Author.objects.create(name='Bob')

        update_author_diff = [
            {
                'op': 'replace',
                'path': '/0/name',
                'value': 'Jeff',
            }
        ]

        patch = Patch(update_author_diff)
        authors = Author.objects.all()
        patch.apply(authors)

        author = Author.objects.first()
        self.assertEqual(author.name, 'Jeff')

    def test_author_name_is_replaced_in_single_object(self):
        author = Author.objects.create(name='Bob')

        update_author_diff = [
            {
                'op': 'replace',
                'path': '/name',
                'value': 'Jeff',
            }
        ]

        patch = Patch(update_author_diff)
        patch.apply(author)

        author_lookup = Author.objects.get(pk=author.pk)
        self.assertEqual(author_lookup.name, 'Jeff')

    def test_nested_book_two_name_is_replaced_in_list(self):
        author = Author.objects.create(name='Bob')
        Book.objects.create(author=author, title='Book One')
        Book.objects.create(author=author, title='Book two')

        update_book_diff = [
            {
                'op': 'replace',
                'path': '/0/books/1/title',
                'value': 'Book Two',
            }
        ]

        patch = Patch(update_book_diff)
        authors = Author.objects.all()
        patch.apply(authors)

        books = Book.objects.filter(author=author).all()
        self.assertEqual(books[1].title, 'Book Two')

class TestPatchRemoveOperation(TestCase):

    def test_authors_are_removed_from_queryset(self):
        Author.objects.create(name='Bob')
        Author.objects.create(name='Jeff')
        Author.objects.create(name='Jane')

        delete_all_authors_diff = [
            {
                'op': 'remove',
                'path': '/0'
            },
            {
                'op': 'remove',
                'path': '/0'
            }
        ]

        patch = Patch(delete_all_authors_diff)
        authors = Author.objects.all()
        patch.apply(authors)

        author_count = Author.objects.all().count()
        self.assertEqual(author_count, 1)

    def test_author_is_removed(self):
        author = Author.objects.create(name='Bob')
        Author.objects.create(name='Jeff')

        delete_author_diff = [
            {
                'op': 'remove',
                'path': '/'
            }
        ]

        patch = Patch(delete_author_diff)
        patch.apply(author)

        author_count = Author.objects.all().count()
        self.assertEqual(author_count, 1)

    def test_nested_book_is_removed_in_list(self):
        author = Author.objects.create(name='Jeff')
        Book.objects.create(author=author, title='Book One')

        delete_book_diff = [
            {
                'op': 'remove',
                'path': '/0/books/0'
            }
        ]

        patch = Patch(delete_book_diff)
        authors = list(Author.objects.all())
        patch.apply(authors)

        book_count = Book.objects.all().count()
        self.assertEqual(book_count, 0)

class TestPatchTestOperation(TestCase):

    def test_no_error_when_author_name_matches(self):
        Author.objects.create(name='Jeff')

        test_author_name_diff = [
            {
                'op': 'test',
                'path': '/0/name',
                'value': 'Jeff'
            }
        ]

        patch = Patch(test_author_name_diff)
        authors = Author.objects.all()
        patch.apply(authors)

    def test_no_error_when_author_id_value_and_type_matches(self):
        Author.objects.create(name='Jeff')

        test_author_name_diff = [
            {
                'op': 'test',
                'path': '/0/id',
                'value': 1
            }
        ]

        patch = Patch(test_author_name_diff)
        authors = Author.objects.all()
        patch.apply(authors)

    def test_exception_thrown_when_author_id_value_matches_but_type_does_not(self):
        Author.objects.create(name='Jeff')

        test_author_name_diff = [
            {
                'op': 'test',
                'path': '/0/id',
                'value': '1'
            }
        ]

        patch = Patch(test_author_name_diff)
        authors = Author.objects.all()
        with self.assertRaises(PatchException):
            patch.apply(authors)

    def test_exception_thrown_when_author_name_does_not_match(self):
        Author.objects.create(name='Jeff')

        test_author_name_diff = [
            {
                'op': 'test',
                'path': '/0/name',
                'value': 'Bob'
            }
        ]

        patch = Patch(test_author_name_diff)
        authors = Author.objects.all()
        with self.assertRaises(PatchException):
            patch.apply(authors)

    def test_exception_thrown_when_path_does_not_exist(self):
        test_author_name_diff = [
            {
                'op': 'test',
                'path': '/0/name',
                'value': 'Jeff'
            }
        ]

        patch = Patch(test_author_name_diff)
        authors = Author.objects.all()
        with self.assertRaises(PointerException):
            patch.apply(authors)

redpajama_set_name: RedPajamaGithub


text:
require "cases/helper"
require 'models/topic'
require 'models/reply'
require 'models/warehouse_thing'
require 'models/guid'
require 'models/event'

class Wizard < ActiveRecord::Base
  self.abstract_class = true

  validates_uniqueness_of :name
end

class IneptWizard < Wizard
  validates_uniqueness_of :city
end

class Conjurer < IneptWizard
end

class Thaumaturgist < IneptWizard
end

class UniquenessValidationTest < ActiveRecord::TestCase
  fixtures :topics, 'warehouse_things', :developers

  repair_validations(Topic, Reply)

  def test_validate_uniqueness
    Topic.validates_uniqueness_of(:title)

    t = Topic.new("title" => "I'm uniqué!")
    assert t.save, "Should save t as unique"

    t.content = "Remaining unique"
    assert t.save, "Should still save t as unique"

    t2 = Topic.new("title" => "I'm uniqué!")
    assert !t2.valid?, "Shouldn't be valid"
    assert !t2.save, "Shouldn't save t2 as unique"
    assert_equal ["has already been taken"], t2.errors[:title]

    t2.title = "Now Im really also unique"
    assert t2.save, "Should now save t2 as unique"
  end

  def test_validates_uniqueness_with_validates
    Topic.validates :title, :uniqueness => true
    Topic.create!('title' => 'abc')

    t2 = Topic.new('title' => 'abc')
    assert !t2.valid?
    assert t2.errors[:title]
  end

  def test_validates_uniqueness_with_newline_chars
    Topic.validates_uniqueness_of(:title, :case_sensitive => false)

    t = Topic.new("title" => "new\nline")
    assert t.save, "Should save t as unique"
  end

  def test_validate_uniqueness_with_scope
    Reply.validates_uniqueness_of(:content, :scope => "parent_id")

    t = Topic.create("title" => "I'm unique!")

    r1 = t.replies.create "title" => "r1", "content" => "hello world"
    assert r1.valid?, "Saving r1"

    r2 = t.replies.create "title" => "r2", "content" => "hello world"
    assert !r2.valid?, "Saving r2 first time"

    r2.content = "something else"
    assert r2.save, "Saving r2 second time"

    t2 = Topic.create("title" => "I'm unique too!")
    r3 = t2.replies.create "title" => "r3", "content" => "hello world"
    assert r3.valid?, "Saving r3"
  end

  def test_validate_uniqueness_scoped_to_defining_class
    t = Topic.create("title" => "What, me worry?")

    r1 = t.unique_replies.create "title" => "r1", "content" => "a barrel of fun"
    assert r1.valid?, "Saving r1"

    r2 = t.silly_unique_replies.create "title" => "r2", "content" => "a barrel of fun"
    assert !r2.valid?, "Saving r2"

    # Should succeed as validates_uniqueness_of only applies to
    # UniqueReply and its subclasses
    r3 = t.replies.create "title" => "r2", "content" => "a barrel of fun"
    assert r3.valid?, "Saving r3"
  end

  def test_validate_uniqueness_with_scope_array
    Reply.validates_uniqueness_of(:author_name, :scope => [:author_email_address, :parent_id])

    t = Topic.create("title" => "The earth is actually flat!")

    r1 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're crazy!", "content" => "Crazy reply"
    assert r1.valid?, "Saving r1"

    r2 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy@rubyonrails.com", "title" => "You're crazy!", "content" => "Crazy reply again..."
    assert !r2.valid?, "Saving r2. Double reply by same author."

    r2.author_email_address = "jeremy_alt_email@rubyonrails.com"
    assert r2.save, "Saving r2 the second time."

    r3 = t.replies.create "author_name" => "jeremy", "author_email_address" => "jeremy_alt_email@rubyonrails.com", "title" => "You're wrong", "content" => "It's cubic"
    assert !r3.valid?, "Saving r3"

    r3.author_name = "jj"
    assert r3.save, "Saving r3 the second time."

    r3.author_name = "jeremy"
    assert !r3.save, "Saving r3 the third time."
  end

  def test_validate_case_insensitive_uniqueness
    Topic.validates_uniqueness_of(:title, :parent_id, :case_sensitive => false, :allow_nil => true)

    t = Topic.new("title" => "I'm unique!", :parent_id => 2)
    assert t.save, "Should save t as unique"

    t.content = "Remaining unique"
    assert t.save, "Should still save t as unique"

    t2 = Topic.new("title" => "I'm UNIQUE!", :parent_id => 1)
    assert !t2.valid?, "Shouldn't be valid"
    assert !t2.save, "Shouldn't save t2 as unique"
    assert t2.errors[:title].any?
    assert t2.errors[:parent_id].any?
    assert_equal ["has already been taken"], t2.errors[:title]

    t2.title = "I'm truly UNIQUE!"
    assert !t2.valid?, "Shouldn't be valid"
    assert !t2.save, "Shouldn't save t2 as unique"
    assert t2.errors[:title].empty?
    assert t2.errors[:parent_id].any?

    t2.parent_id = 4
    assert t2.save, "Should now save t2 as unique"

    t2.parent_id = nil
    t2.title = nil
    assert t2.valid?, "should validate with nil"
    assert t2.save, "should save with nil"

    with_kcode('UTF8') do
      t_utf8 = Topic.new("title" => "Я тоже уникальный!")
      assert t_utf8.save, "Should save t_utf8 as unique"

      # If database hasn't UTF-8 character set, this test fails
      if Topic.find(t_utf8, :select => 'LOWER(title) AS title').title == "я тоже уникальный!"
        t2_utf8 = Topic.new("title" => "я тоже УНИКАЛЬНЫЙ!")
        assert !t2_utf8.valid?, "Shouldn't be valid"
        assert !t2_utf8.save, "Shouldn't save t2_utf8 as unique"
      end
    end
  end

  def test_validate_case_sensitive_uniqueness_with_special_sql_like_chars
    Topic.validates_uniqueness_of(:title, :case_sensitive => true)

    t = Topic.new("title" => "I'm unique!")
    assert t.save, "Should save t as unique"

    t2 = Topic.new("title" => "I'm %")
    assert t2.save, "Should save t2 as unique"

    t3 = Topic.new("title" => "I'm uniqu_!")
    assert t3.save, "Should save t3 as unique"
  end

  def test_validate_case_insensitive_uniqueness_with_special_sql_like_chars
    Topic.validates_uniqueness_of(:title, :case_sensitive => false)

    t = Topic.new("title" => "I'm unique!")
    assert t.save, "Should save t as unique"

    t2 = Topic.new("title" => "I'm %")
    assert t2.save, "Should save t2 as unique"

    t3 = Topic.new("title" => "I'm uniqu_!")
    assert t3.save, "Should save t3 as unique"
  end

  def test_validate_case_sensitive_uniqueness
    Topic.validates_uniqueness_of(:title, :case_sensitive => true, :allow_nil => true)

    t = Topic.new("title" => "I'm unique!")
    assert t.save, "Should save t as unique"

    t.content = "Remaining unique"
    assert t.save, "Should still save t as unique"

    t2 = Topic.new("title" => "I'M UNIQUE!")
    assert t2.valid?, "Should be valid"
    assert t2.save, "Should save t2 as unique"
    assert t2.errors[:title].empty?
    assert t2.errors[:parent_id].empty?
    assert_not_equal ["has already been taken"], t2.errors[:title]

    t3 = Topic.new("title" => "I'M uNiQUe!")
    assert t3.valid?, "Should be valid"
    assert t3.save, "Should save t2 as unique"
    assert t3.errors[:title].empty?
    assert t3.errors[:parent_id].empty?
    assert_not_equal ["has already been taken"], t3.errors[:title]
  end

  def test_validate_case_sensitive_uniqueness_with_attribute_passed_as_integer
    Topic.validates_uniqueness_of(:title, :case_sensitve => true)
    Topic.create!('title' => 101)

    t2 = Topic.new('title' => 101)
    assert !t2.valid?
    assert t2.errors[:title]
  end

  def test_validate_uniqueness_with_non_standard_table_names
    i1 = WarehouseThing.create(:value => 1000)
    assert !i1.valid?, "i1 should not be valid"
    assert i1.errors[:value].any?, "Should not be empty"
  end

  def test_validates_uniqueness_inside_with_scope
    Topic.validates_uniqueness_of(:title)

    Topic.send(:with_scope, :find => { :conditions => { :author_name => "David" } }) do
      t1 = Topic.new("title" => "I'm unique!", "author_name" => "Mary")
      assert t1.save
      t2 = Topic.new("title" => "I'm unique!", "author_name" => "David")
      assert !t2.valid?
    end
  end

  def test_validate_uniqueness_with_columns_which_are_sql_keywords
    repair_validations(Guid) do
      Guid.validates_uniqueness_of :key
      g = Guid.new
      g.key = "foo"
      assert_nothing_raised { !g.valid? }
    end
  end

  def test_validate_uniqueness_with_limit
    # Event.title is limited to 5 characters
    e1 = Event.create(:title => "abcde")
    assert e1.valid?, "Could not create an event with a unique, 5 character title"
    e2 = Event.create(:title => "abcdefgh")
    assert !e2.valid?, "Created an event whose title, with limit taken into account, is not unique"
  end

  def test_validate_uniqueness_with_limit_and_utf8
    unless current_adapter?(:IBM_DBAdapter)
      # Limit for the varchar field is number of bytes and not characters for DB2. Hence the below test cases is expected to fail.
      with_kcode('UTF8') do
        # Event.title is limited to 5 characters
        e1 = Event.create(:title => "一二三四五")
        assert e1.valid?, "Could not create an event with a unique, 5 character title"
        e2 = Event.create(:title => "一二三四五六七八")
        assert !e2.valid?, "Created an event whose title, with limit taken into account, is not unique"
      end
    end
  end

  def test_validate_straight_inheritance_uniqueness
    w1 = IneptWizard.create(:name => "Rincewind", :city => "Ankh-Morpork")
    assert w1.valid?, "Saving w1"

    # Should use validation from base class (which is abstract)
    w2 = IneptWizard.new(:name => "Rincewind", :city => "Quirm")
    assert !w2.valid?, "w2 shouldn't be valid"
    assert w2.errors[:name].any?, "Should have errors for name"
    assert_equal ["has already been taken"], w2.errors[:name], "Should have uniqueness message for name"

    w3 = Conjurer.new(:name => "Rincewind", :city => "Quirm")
    assert !w3.valid?, "w3 shouldn't be valid"
    assert w3.errors[:name].any?, "Should have errors for name"
    assert_equal ["has already been taken"], w3.errors[:name], "Should have uniqueness message for name"

    w4 = Conjurer.create(:name => "The Amazing Bonko", :city => "Quirm")
    assert w4.valid?, "Saving w4"

    w5 = Thaumaturgist.new(:name => "The Amazing Bonko", :city => "Lancre")
    assert !w5.valid?, "w5 shouldn't be valid"
    assert w5.errors[:name].any?, "Should have errors for name"
    assert_equal ["has already been taken"], w5.errors[:name], "Should have uniqueness message for name"

    w6 = Thaumaturgist.new(:name => "Mustrum Ridcully", :city => "Quirm")
    assert !w6.valid?, "w6 shouldn't be valid"
    assert w6.errors[:city].any?, "Should have errors for city"
    assert_equal ["has already been taken"], w6.errors[:city], "Should have uniqueness message for city"
  end
end


text:
import React = require('react');

function Greet(x: {name?: string}) {
	return
Hello, {x}
;
}

class BigGreeter extends React.Component<{ name?: string }, {}> {
	render() {
		return

;
	}
	greeting: string;
}

// OK
let a = <Greet />;
// OK - always valid to specify 'key'
let b = <Greet key="k" />;
// Error - not allowed to specify 'ref' on SFCs
let c = <Greet ref="myRef" />;

// OK - ref is valid for classes
let d = <BigGreeter ref={x => x.greeting.substr(10)} />;
// Error ('subtr' not on string)
let e = <BigGreeter ref={x => x.greeting.subtr(10)} />;
// Error (ref callback is contextually typed)
let f = <BigGreeter ref={x => x.notARealProperty} />;

// OK - key is always valid
let g = <BigGreeter key={100} />;

// OK - contextually typed intrinsic ref callback parameter
let h =
 x.innerText} />;
// Error - property not on ontextually typed intrinsic ref callback parameter
let i =
 x.propertyNotOnHtmlDivElement} />;


text:
package generated.zcsclient.mail;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for activityFilter complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="activityFilter">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *       </sequence>
 *       <attribute name="account" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="op" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="session" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "activityFilter")
public class testActivityFilter {

    @XmlAttribute(name = "account")
    protected String account;
    @XmlAttribute(name = "op")
    protected String op;
    @XmlAttribute(name = "session")
    protected String session;

    /**
     * Gets the value of the account property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAccount() {
        return account;
    }

    /**
     * Sets the value of the account property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAccount(String value) {
        this.account = value;
    }

    /**
     * Gets the value of the op property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getOp() {
        return op;
    }

    /**
     * Sets the value of the op property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setOp(String value) {
        this.op = value;
    }

    /**
     * Gets the value of the session property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getSession() {
        return session;
    }

    /**
     * Sets the value of the session property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setSession(String value) {
        this.session = value;
    }

}


text:
package com.google.cloud.storage.contrib.nio;

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

import com.google.cloud.storage.Acl;
import com.google.cloud.storage.BlobInfo;
import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;

import java.nio.file.attribute.FileTime;
import java.util.List;
import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.concurrent.Immutable;

/**
 * Metadata for a Google Cloud Storage file.
 */
@Immutable
final class CloudStorageObjectAttributes implements CloudStorageFileAttributes {

  @Nonnull private final BlobInfo info;

  CloudStorageObjectAttributes(BlobInfo info) {
    this.info = checkNotNull(info);
  }

  @Override
  public long size() {
    return info.getSize();
  }

  @Override
  public FileTime creationTime() {
    if (info.getUpdateTime() == null) {
      return CloudStorageFileSystem.FILE_TIME_UNKNOWN;
    }
    return FileTime.fromMillis(info.getUpdateTime());
  }

  @Override
  public FileTime lastModifiedTime() {
    return creationTime();
  }

  @Override
  public Optional<String> etag() {
    return Optional.fromNullable(info.getEtag());
  }

  @Override
  public Optional<String> mimeType() {
    return Optional.fromNullable(info.getContentType());
  }

  @Override
  public Optional<List<Acl>> acl() {
    return Optional.fromNullable(info.getAcl());
  }

  @Override
  public Optional<String> cacheControl() {
    return Optional.fromNullable(info.getCacheControl());
  }

  @Override
  public Optional<String> contentEncoding() {
    return Optional.fromNullable(info.getContentEncoding());
  }

  @Override
  public Optional<String> contentDisposition() {
    return Optional.fromNullable(info.getContentDisposition());
  }

  @Override
  public ImmutableMap<String, String> userMetadata() {
    if (null == info.getMetadata()) {
      return ImmutableMap.of();
    }
    return ImmutableMap.copyOf(info.getMetadata());
  }

  @Override
  public boolean isDirectory() {
    return false;
  }

  @Override
  public boolean isOther() {
    return false;
  }

  @Override
  public boolean isRegularFile() {
    return true;
  }

  @Override
  public boolean isSymbolicLink() {
    return false;
  }

  @Override
  public FileTime lastAccessTime() {
    return CloudStorageFileSystem.FILE_TIME_UNKNOWN;
  }

  @Override
  public Object fileKey() {
    return info.getBlobId().getBucket()
        + info.getBlobId().getName()
        + info.getBlobId().getGeneration();
  }

  @Override
  public boolean equals(Object other) {
    return this == other
        || other instanceof CloudStorageObjectAttributes
            && Objects.equals(info, ((CloudStorageObjectAttributes) other).info);
  }

  @Override
  public int hashCode() {
    return info.hashCode();
  }

  @Override
  public String toString() {
    return MoreObjects.toStringHelper(this).add("info", info).toString();
  }
}


text:
//
//  ECLocationMessageBody.h
//  CCPiPhoneSDK
//
//  Created by admin on 15/12/15.
//  Copyright © 2015年 ronglian. All rights reserved.
//

#import "ECMessageBody.h"
#import <MapKit/MapKit.h>

@interface ECLocationMessageBody : ECMessageBody

/**
 @brief 经纬度信息
 */
@property (nonatomic) CLLocationCoordinate2D coordinate;

/**
 @brief 位置信息
 */
@property (nonatomic, copy) NSString *title;

/**
 @method
 @brief 以经纬度和地理位置构造位置对象
 @result 位置对象
 */
- (instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate andTitle:(NSString*)title;

@end


text:
BEGIN_INANITY_GRAPHICS

class Dx11Texture;

/// Класс рендербуфера DirectX 11.
class Dx11RenderBuffer : public RenderBuffer
{
private:
	ComPointer<ID3D11RenderTargetView> renderTargetView;
	ptr<Dx11Texture> texture;

public:
	Dx11RenderBuffer(ComPointer<ID3D11RenderTargetView> renderTargetView, ptr<Dx11Texture> texture = 0);

	// методы RenderBuffer
	ptr<Texture> GetTexture();
	float GetScreenTopTexcoord() const;

	ID3D11RenderTargetView* GetRenderTargetViewInterface() const;
};

END_INANITY_GRAPHICS

#endif